Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add non clickable variant for tag #255

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions v2/pink-sb/src/lib/Tag.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@
Partial<{
selected: boolean;
size: 's' | 'm';
isClickable?: boolean;
}>;

export let size: $$Props['size'] = 'm';
export let selected: $$Props['selected'] = false;
export let isClickable: $$Props['isClickable'] = true;
</script>

<button class:s={size === 's'} on:click class:selected type="button" {...$$restProps}>
<slot />
</button>
{#if isClickable}
<button class:s={size === 's'} on:click class:selected type="button" {...$$restProps}>
<slot />
</button>
{:else}
<div class:s={size === 's'} class:selected {...$$restProps}>
<slot />
</div>
{/if}

<style lang="scss">
@use '../scss/mixins/transitions';

button {
button,
div {
@include transitions.common;

--p-tag-font-family: var(--badge-font-family, var(--font-family-sansserif));
Expand Down Expand Up @@ -47,8 +56,6 @@
font-weight: 500;
line-height: 140%;

cursor: pointer;

&.s {
--p-tag-padding-block: var(--space-1);
--p-tag-padding-inline: var(--space-3);
Expand All @@ -70,4 +77,8 @@
background-color: var(--color-bgcolor-neutral-tertiary);
}
}

button {
cursor: pointer;
}
</style>
2 changes: 1 addition & 1 deletion v2/pink-sb/src/lib/step/StepItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{/if}
{#if !hideBadge}
<div class="badge">
<Tag size="s">
<Tag size="s" isClickable={false}>
{#if state === 'next'}
Next
{:else if state === 'current'}
Expand Down
Loading