@reshape-biotech/design-system 2.7.36 → 2.7.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/activity/Activity.svelte +6 -4
- package/dist/components/button/Button.svelte +2 -1
- package/dist/components/card/Card.svelte +7 -5
- package/dist/components/card/CardWrapper.svelte +10 -13
- package/dist/components/checkbox/Checkbox.svelte +3 -2
- package/dist/components/combobox/components/combobox-content.svelte +2 -1
- package/dist/components/datepicker/DatePicker.svelte +8 -5
- package/dist/components/divider/Divider.svelte +7 -3
- package/dist/components/drawer/components/drawer-content.svelte +2 -1
- package/dist/components/drawer/components/drawer-title.svelte +2 -1
- package/dist/components/dropdown/components/dropdown-item.svelte +2 -1
- package/dist/components/dropdown/components/dropdown-sub-trigger.svelte +2 -1
- package/dist/components/icon-button/IconButton.svelte +3 -2
- package/dist/components/input/Input.svelte +2 -1
- package/dist/components/label/Label.svelte +3 -1
- package/dist/components/list/List.svelte +4 -1
- package/dist/components/markdown/Markdown.svelte +2 -1
- package/dist/components/segmented-control-buttons/ControlButton.svelte +7 -1
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +2 -1
- package/dist/components/select/components/MultiSelectTrigger.svelte +5 -2
- package/dist/components/select/components/SelectItem.svelte +2 -1
- package/dist/components/select/components/SelectTrigger.svelte +2 -1
- package/dist/components/skeleton-loader/SkeletonLoader.svelte +6 -1
- package/dist/components/slider/Slider.svelte +6 -3
- package/dist/components/status-badge/StatusBadge.svelte +4 -2
- package/dist/components/status-badge/StatusBadge.svelte.d.ts +1 -0
- package/dist/components/table/Table.svelte +2 -1
- package/dist/components/table/components/TBody.svelte +2 -1
- package/dist/components/table/components/THead.svelte +2 -1
- package/dist/components/table/components/Td.svelte +2 -1
- package/dist/components/table/components/Th.svelte +2 -1
- package/dist/components/table/components/Tr.svelte +2 -1
- package/dist/components/tabs/components/Tab.svelte +2 -1
- package/dist/components/tabs/components/Tabs.svelte +2 -1
- package/dist/components/tag/Tag.svelte +3 -2
- package/dist/components/tooltip/Tooltip.svelte +2 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import ActivityIcon from './ActivityIcon.svelte';
|
|
4
4
|
import type { ActivityIconType } from './ActivityIcon.svelte';
|
|
5
5
|
import { DateTime } from 'luxon';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
|
|
7
8
|
type Activity = {
|
|
8
9
|
activity_type?: string;
|
|
@@ -54,13 +55,14 @@
|
|
|
54
55
|
let { class: className = '', activity }: Props = $props();
|
|
55
56
|
</script>
|
|
56
57
|
|
|
57
|
-
<div class={
|
|
58
|
+
<div class={twMerge('group flex items-stretch gap-3', className)}>
|
|
58
59
|
<div class="flex min-h-12 flex-col items-center gap-1.5">
|
|
59
60
|
<div class="bg-neutral w-0.5 grow group-first:invisible"></div>
|
|
60
61
|
<div
|
|
61
|
-
class=
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
class={twMerge(
|
|
63
|
+
'text-secondary flex h-5 w-5 shrink-0 items-center justify-center rounded p-0.5',
|
|
64
|
+
ACTIVITY_BACKGROUND[activity.icon]
|
|
65
|
+
)}
|
|
64
66
|
>
|
|
65
67
|
<ActivityIcon icon={activity.icon} />
|
|
66
68
|
</div>
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<script lang="ts">
|
|
15
|
+
import { twMerge } from 'tailwind-merge';
|
|
15
16
|
import Spinner from '../spinner/Spinner.svelte';
|
|
16
17
|
import type { Snippet } from 'svelte';
|
|
17
18
|
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
{id}
|
|
67
68
|
{tabindex}
|
|
68
69
|
class:cursor-wait={loading}
|
|
69
|
-
class=
|
|
70
|
+
class={twMerge('button', variantClass, sizeClass, className)}
|
|
70
71
|
data-testid={dataTestId}
|
|
71
72
|
class:rounded
|
|
72
73
|
class:disabled
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
|
|
4
5
|
type Props = {
|
|
5
6
|
Header?: Snippet;
|
|
@@ -19,19 +20,20 @@
|
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
22
|
<div
|
|
22
|
-
class=
|
|
23
|
+
class={twMerge(
|
|
24
|
+
'overflow-hidden rounded-[10px] border border-static bg-surface shadow-container',
|
|
25
|
+
additionalClasses
|
|
26
|
+
)}
|
|
23
27
|
>
|
|
24
28
|
{#if Header}
|
|
25
29
|
<header
|
|
26
|
-
class=
|
|
27
|
-
class:border-b={headerBorder}
|
|
28
|
-
class:border-static={headerBorder}
|
|
30
|
+
class={twMerge('flex min-h-12 items-center px-4', headerBorder && 'border-b border-static')}
|
|
29
31
|
>
|
|
30
32
|
{@render Header()}
|
|
31
33
|
</header>
|
|
32
34
|
{/if}
|
|
33
35
|
{#if children}
|
|
34
|
-
<div class={`p-${padding}`}>
|
|
36
|
+
<div class={twMerge(`p-${padding}`)}>
|
|
35
37
|
{@render children()}
|
|
36
38
|
</div>
|
|
37
39
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { ClassValue } from 'svelte/elements';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
5
|
|
|
5
6
|
type Props = {
|
|
6
7
|
Header?: Snippet;
|
|
@@ -19,28 +20,24 @@
|
|
|
19
20
|
}: Props = $props();
|
|
20
21
|
</script>
|
|
21
22
|
|
|
22
|
-
<div class={
|
|
23
|
+
<div class={twMerge('wrapper', variant, additionalClasses)}>
|
|
23
24
|
{#if Header}
|
|
24
25
|
<header
|
|
25
|
-
class={
|
|
26
|
+
class={twMerge(
|
|
26
27
|
'flex w-full items-center justify-between',
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
]}
|
|
28
|
+
variant === 'default' && 'min-h-10 px-4',
|
|
29
|
+
variant === 'compact' && 'min-h-8 px-3'
|
|
30
|
+
)}
|
|
32
31
|
>
|
|
33
32
|
{@render Header()}
|
|
34
33
|
</header>
|
|
35
34
|
{/if}
|
|
36
35
|
<div
|
|
37
|
-
class={
|
|
36
|
+
class={twMerge(
|
|
38
37
|
'flex w-full flex-col !overflow-hidden [&>*]:w-full',
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
]}
|
|
38
|
+
variant === 'default' && 'gap-1 [&>*]:rounded-xl',
|
|
39
|
+
variant === 'compact' && 'gap-0.5 [&>*]:rounded-[10px]'
|
|
40
|
+
)}
|
|
44
41
|
>
|
|
45
42
|
{@render children()}
|
|
46
43
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import Check from 'phosphor-svelte/lib/Check';
|
|
3
4
|
import Minus from 'phosphor-svelte/lib/Minus';
|
|
4
5
|
import { Icon } from '../icons/index.js';
|
|
@@ -6,13 +7,13 @@
|
|
|
6
7
|
|
|
7
8
|
export type CheckboxProps = CheckboxRootProps;
|
|
8
9
|
|
|
9
|
-
let { checked = $bindable(false), onCheckedChange, name, ...props }: CheckboxProps = $props();
|
|
10
|
+
let { checked = $bindable(false), onCheckedChange, name, class: className, ...props }: CheckboxProps = $props();
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
13
|
<Checkbox.Root bind:checked {onCheckedChange} {...props}>
|
|
13
14
|
{#snippet children({ checked, indeterminate })}
|
|
14
15
|
<div
|
|
15
|
-
class={
|
|
16
|
+
class={twMerge('flex items-center justify-center rounded border border-static', checked && 'bg-dark-accent-inverse-hover', className)}
|
|
16
17
|
>
|
|
17
18
|
{#if checked}
|
|
18
19
|
<Icon class="text-primary-inverse" icon={Check} />
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { Combobox } from 'bits-ui';
|
|
6
6
|
import type { ComboboxContentProps } from '../types';
|
|
7
7
|
import { fade } from 'svelte/transition';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
8
9
|
|
|
9
10
|
let {
|
|
10
11
|
children,
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
<Icon icon={CaretUp} color="tertiary" />
|
|
31
32
|
</Combobox.ScrollUpButton>
|
|
32
33
|
<Combobox.Viewport class="overflow-y-auto">
|
|
33
|
-
<div class=
|
|
34
|
+
<div class={twMerge(paddedContent ? 'p-1' : '', 'empty:p-0')}>
|
|
34
35
|
{@render children()}
|
|
35
36
|
</div>
|
|
36
37
|
</Combobox.Viewport>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import CaretRight from 'phosphor-svelte/lib/CaretRight';
|
|
4
4
|
import { Icon } from '../icons/index.js';
|
|
5
5
|
import { run } from 'svelte/legacy';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
|
|
7
8
|
import { DateTime, type MonthNumbers } from 'luxon';
|
|
8
9
|
|
|
@@ -125,11 +126,13 @@
|
|
|
125
126
|
{#if dayOfMonth > 0}
|
|
126
127
|
<div class="date-container">
|
|
127
128
|
<p
|
|
128
|
-
class={
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
class={twMerge(
|
|
130
|
+
'date',
|
|
131
|
+
dayOfMonth === selectedDay &&
|
|
132
|
+
selectedMonth === shownMonth &&
|
|
133
|
+
selectedYear === shownYear &&
|
|
134
|
+
'selected-date'
|
|
135
|
+
)}
|
|
133
136
|
>
|
|
134
137
|
<button
|
|
135
138
|
onclick={() => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
2
4
|
interface Props {
|
|
3
5
|
class?: string;
|
|
4
6
|
vertical?: boolean;
|
|
@@ -9,7 +11,9 @@
|
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<div
|
|
12
|
-
class={
|
|
13
|
-
vertical ? 'h-full w-0 border-l' : 'h-0 w-full border-b'
|
|
14
|
-
|
|
14
|
+
class={twMerge(
|
|
15
|
+
vertical ? 'h-full w-0 border-l' : 'h-0 w-full border-b',
|
|
16
|
+
inverse ? 'border-static-inverse' : 'border-static',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
15
19
|
></div>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Icon } from '../../icons/index.js';
|
|
4
4
|
import { Dialog } from 'bits-ui';
|
|
5
5
|
import { fly } from 'svelte/transition';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
import type { DrawerContentProps } from '../types';
|
|
7
8
|
import Overlay from './drawer-overlay.svelte';
|
|
8
9
|
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
|
|
21
22
|
const baseClasses = 'fixed top-0 h-screen z-50 w-[460px] flex flex-col bg-surface shadow-lg';
|
|
22
23
|
const sideClasses = side === 'left' ? 'left-0' : 'right-0';
|
|
23
|
-
const finalClasses =
|
|
24
|
+
const finalClasses = twMerge(baseClasses, sideClasses, className);
|
|
24
25
|
|
|
25
26
|
const getTransitionParams = (side: 'left' | 'right') => ({
|
|
26
27
|
x: side === 'left' ? -300 : 300,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Dialog } from 'bits-ui';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import type { DrawerTitleProps } from '../types';
|
|
4
5
|
|
|
5
6
|
let { children, class: className = '', icon, ...restProps }: DrawerTitleProps = $props();
|
|
6
7
|
|
|
7
8
|
const baseClasses = 'text-xl font-semibold tracking-tight text-primary';
|
|
8
|
-
const finalClasses =
|
|
9
|
+
const finalClasses = twMerge(baseClasses, className);
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<div class="space-y-6">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import type { DropdownItemProps } from '../types';
|
|
4
5
|
|
|
5
6
|
let {
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
{:else}
|
|
19
20
|
<div
|
|
20
21
|
{...props}
|
|
21
|
-
class=
|
|
22
|
+
class={twMerge('dropdown-item flex gap-2 cursor-pointer items-center rounded-md px-2.5 py-2 min-h-10 text-sm outline-none transition-colors hover:bg-neutral focus:bg-neutral data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_a]:no-underline', className)}
|
|
22
23
|
>
|
|
23
24
|
{@render children?.()}
|
|
24
25
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { DropdownMenu } from 'bits-ui';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import CaretRight from 'phosphor-svelte/lib/CaretRight';
|
|
4
5
|
import CaretLeft from 'phosphor-svelte/lib/CaretLeft';
|
|
5
6
|
import { Icon } from '../../icons/index.js';
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
{:else}
|
|
18
19
|
<div
|
|
19
20
|
{...props}
|
|
20
|
-
class=
|
|
21
|
+
class={twMerge('dropdown-sub-trigger flex h-9 cursor-pointer items-center justify-between gap-2 rounded-md px-2 py-1.5 text-sm outline-none transition-colors hover:bg-neutral focus:bg-neutral data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_a]:no-underline', className)}
|
|
21
22
|
>
|
|
22
23
|
{#if !hideChevron && side === 'left'}
|
|
23
24
|
<Icon color="tertiary" icon={chevronIcon} size={14} class="mr-2" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import { Spinner } from '../spinner/';
|
|
4
5
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
}}
|
|
51
52
|
{type}
|
|
52
53
|
{disabled}
|
|
53
|
-
class=
|
|
54
|
+
class={twMerge(sizeClass, variantClass, 'disabled', className)}
|
|
54
55
|
class:rounded
|
|
55
56
|
{...rest}
|
|
56
57
|
>
|
|
@@ -66,7 +67,7 @@
|
|
|
66
67
|
{type}
|
|
67
68
|
{disabled}
|
|
68
69
|
{tabindex}
|
|
69
|
-
class=
|
|
70
|
+
class={twMerge(sizeClass, variantClass, className)}
|
|
70
71
|
class:rounded
|
|
71
72
|
{...rest}
|
|
72
73
|
>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import X from 'phosphor-svelte/lib/X';
|
|
3
4
|
import { Icon } from '../icons/index.js';
|
|
4
5
|
import type { Snippet } from 'svelte';
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
|
|
92
93
|
<div class="flex-1">
|
|
93
94
|
<div
|
|
94
|
-
class=
|
|
95
|
+
class={twMerge('flex w-full items-center gap-1 transition-colors', `size-${size}`, className)}
|
|
95
96
|
class:!border-error={!valid}
|
|
96
97
|
class:primary={variant === 'primary'}
|
|
97
98
|
class:secondary={variant === 'secondary'}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
|
|
2
4
|
interface Props {
|
|
3
5
|
forId: string;
|
|
4
6
|
text: string;
|
|
@@ -9,7 +11,7 @@
|
|
|
9
11
|
const { forId, text, required = false, class: className }: Props = $props();
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
|
-
<label for={forId} class=
|
|
14
|
+
<label for={forId} class={twMerge('block text-sm text-secondary', className)}>
|
|
13
15
|
{text}
|
|
14
16
|
{#if required}
|
|
15
17
|
<span class="ml-0.5 text-danger">*</span>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" generics="T">
|
|
2
2
|
import type { Overflow } from '../../tailwind';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
5
|
|
|
5
6
|
type Props = {
|
|
6
7
|
items: T[];
|
|
@@ -11,7 +12,9 @@
|
|
|
11
12
|
let { items, item, overflow = 'overflow-y-auto', variant = 'default' }: Props = $props();
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
|
-
<div
|
|
15
|
+
<div
|
|
16
|
+
class={twMerge('listStyles', variant === 'compact' ? 'compact' : 'default', overflow)}
|
|
17
|
+
>
|
|
15
18
|
{#each items as currentItem, i}
|
|
16
19
|
<div class="item">
|
|
17
20
|
{@render item(currentItem)}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { marked } from 'marked';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
interface Props {
|
|
4
5
|
markdown: string;
|
|
5
6
|
variant?: 'light' | 'dark';
|
|
@@ -8,6 +9,6 @@
|
|
|
8
9
|
let { markdown, variant = 'light' }: Props = $props();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<div class=
|
|
12
|
+
<div class={twMerge('prose prose-slate text-sm', variant === 'dark' && 'dark:prose-invert')}>
|
|
12
13
|
{@html marked.parse(markdown ?? '')}
|
|
13
14
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
|
|
4
5
|
type Color = 'primary' | 'secondary';
|
|
5
6
|
|
|
@@ -32,7 +33,12 @@
|
|
|
32
33
|
<div class="join-item flex h-full flex-1">
|
|
33
34
|
<button
|
|
34
35
|
{onclick}
|
|
35
|
-
class={
|
|
36
|
+
class={twMerge(
|
|
37
|
+
'control-button flex flex-1 items-center justify-center gap-2 rounded-md text-sm leading-4',
|
|
38
|
+
colors[color],
|
|
39
|
+
color,
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
36
42
|
class:active
|
|
37
43
|
type="button"
|
|
38
44
|
{disabled}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import ControlButton from './ControlButton.svelte';
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -16,6 +17,6 @@
|
|
|
16
17
|
};
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
|
-
<div class={
|
|
20
|
+
<div class={twMerge('join flex gap-1 rounded-lg bg-neutral p-1', sizes[size], size, className)}>
|
|
20
21
|
{@render children?.({ ControlButton })}
|
|
21
22
|
</div>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import Icon from '../../icons/Icon.svelte';
|
|
4
4
|
import * as Select from '../index';
|
|
5
5
|
import IconButton from '../../icon-button/IconButton.svelte';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
7
|
|
|
7
8
|
type ItemType = {
|
|
8
9
|
value: string;
|
|
@@ -30,8 +31,10 @@
|
|
|
30
31
|
</script>
|
|
31
32
|
|
|
32
33
|
<Select.Trigger
|
|
33
|
-
class={
|
|
34
|
-
|
|
34
|
+
class={twMerge(
|
|
35
|
+
'flex h-fit min-h-10 w-full items-center justify-between rounded-lg border border-input bg-surface py-1 text-sm placeholder:text-tertiary focus:outline-none disabled:cursor-not-allowed disabled:border-transparent disabled:bg-neutral disabled:opacity-75',
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
35
38
|
{...restProps}
|
|
36
39
|
>
|
|
37
40
|
{#if selectedValues.length === 0}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Check from 'phosphor-svelte/lib/Check';
|
|
3
3
|
import { Icon } from '../../icons/index.js';
|
|
4
4
|
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
6
|
import type { ItemProps, ItemSlotProps } from '../types';
|
|
6
7
|
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
`;
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
|
-
<SelectPrimitive.Item {...restProps} class={baseClasses
|
|
25
|
+
<SelectPrimitive.Item {...restProps} class={twMerge(baseClasses, className)}>
|
|
25
26
|
{#snippet children(params: ItemSlotProps)}
|
|
26
27
|
{#if children}
|
|
27
28
|
{@render children(params)}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import CaretDown from 'phosphor-svelte/lib/CaretDown';
|
|
3
3
|
import { Icon } from '../../icons/index.js';
|
|
4
4
|
import { Select as SelectPrimitive } from 'bits-ui';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
6
|
import type { TriggerProps, IconSnippet } from '../types';
|
|
6
7
|
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
|
|
38
39
|
<SelectPrimitive.Trigger
|
|
39
40
|
{...restProps}
|
|
40
|
-
class={
|
|
41
|
+
class={twMerge(baseClasses, className)}
|
|
41
42
|
aria-label={placeholder}
|
|
42
43
|
>
|
|
43
44
|
<div class="flex-1 truncate text-left">
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import Skeleton from './components/Skeleton.svelte';
|
|
4
4
|
import SkeletonImage from './components/SkeletonImage.svelte';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
class?: string;
|
|
@@ -12,6 +13,10 @@
|
|
|
12
13
|
let { class: className = '', dataTestId = '', children }: Props = $props();
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
role="status"
|
|
18
|
+
class={twMerge('h-full w-full animate-pulse', className)}
|
|
19
|
+
data-testid={dataTestId}
|
|
20
|
+
>
|
|
16
21
|
{@render children?.({ Skeleton, SkeletonImage })}
|
|
17
22
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import CaretUpDown from 'phosphor-svelte/lib/CaretUpDown';
|
|
3
3
|
import { Icon } from '../icons/index.js';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
5
|
|
|
5
6
|
let className = '';
|
|
6
7
|
export { className as class };
|
|
@@ -31,10 +32,12 @@
|
|
|
31
32
|
}
|
|
32
33
|
</script>
|
|
33
34
|
|
|
34
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
class={twMerge('relative flex h-10 items-center', disabled && 'opacity-40', className)}
|
|
37
|
+
>
|
|
35
38
|
<div class="track-overlay"></div>
|
|
36
39
|
<div
|
|
37
|
-
class=
|
|
40
|
+
class={twMerge('pointer-events-none absolute h-2.5 rounded-full', bufferColorClass)}
|
|
38
41
|
style="
|
|
39
42
|
width: {calculatePosition(buffer - bufferMin)} + 1rem);
|
|
40
43
|
left: {calculatePosition(bufferMin)}
|
|
@@ -42,7 +45,7 @@
|
|
|
42
45
|
></div>
|
|
43
46
|
{#if showFilled}
|
|
44
47
|
<div
|
|
45
|
-
class=
|
|
48
|
+
class={twMerge('absolute h-2.5 rounded-full', filledColorClass)}
|
|
46
49
|
style="width: {calculatePosition(value)} + 1rem);left: 0;"
|
|
47
50
|
></div>
|
|
48
51
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
5
6
|
// we can add dynamic classes because they are safelisted in tailwind-safelist.txt
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
progress?: Snippet;
|
|
10
11
|
icon?: Snippet;
|
|
11
12
|
iconOnly?: boolean;
|
|
13
|
+
class?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
let {
|
|
@@ -18,14 +20,14 @@
|
|
|
18
20
|
progress,
|
|
19
21
|
icon,
|
|
20
22
|
iconOnly: propIconOnly = false,
|
|
23
|
+
class: className,
|
|
21
24
|
}: Props = $props();
|
|
22
25
|
|
|
23
26
|
let iconOnly = $derived((content === undefined && progress === undefined) || propIconOnly);
|
|
24
27
|
</script>
|
|
25
28
|
|
|
26
29
|
<div
|
|
27
|
-
class={`badge badge-${type} badge-${size}
|
|
28
|
-
class:badge-icon-only={iconOnly}
|
|
30
|
+
class={twMerge(`badge badge-${type} badge-${size}`, iconOnly && 'badge-icon-only', className)}
|
|
29
31
|
data-testid="status-badge"
|
|
30
32
|
>
|
|
31
33
|
{#if icon}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
import Td from './components/Td.svelte';
|
|
4
5
|
import Th from './components/Th.svelte';
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
</script>
|
|
33
34
|
|
|
34
35
|
<div class="w-full rounded-xl border border-static bg-surface px-5 py-2 shadow-container">
|
|
35
|
-
<table class={
|
|
36
|
+
<table class={twMerge('w-full table-fixed sm:table-auto', `xl:table-${tableLayout}`)}>
|
|
36
37
|
{@render children?.({ THead: THead, TBody: TBody, Tr: Tr, Th: Th, Td: Td })}
|
|
37
38
|
</table>
|
|
38
39
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -9,6 +10,6 @@
|
|
|
9
10
|
let { class: className = '', children }: Props = $props();
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
|
-
<tbody class={
|
|
13
|
+
<tbody class={twMerge(className)}>
|
|
13
14
|
{@render children?.()}
|
|
14
15
|
</tbody>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -9,6 +10,6 @@
|
|
|
9
10
|
let { class: className = '', children }: Props = $props();
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
|
-
<thead class={
|
|
13
|
+
<thead class={twMerge(className)}>
|
|
13
14
|
{@render children?.()}
|
|
14
15
|
</thead>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -10,6 +11,6 @@
|
|
|
10
11
|
let { dataTestId = '', align = 'left', children }: Props = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<td data-testid={dataTestId} class={`text-${align} text-sm font-normal
|
|
14
|
+
<td data-testid={dataTestId} class={twMerge(`text-${align}`, 'text-sm font-normal')}>
|
|
14
15
|
{@render children?.()}
|
|
15
16
|
</td>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Width } from '../../../tailwind';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
|
|
@@ -10,6 +11,6 @@
|
|
|
10
11
|
let { class: className = '', children }: Props = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<th class={
|
|
14
|
+
<th class={twMerge('text-left text-xs font-medium text-tertiary', className)}>
|
|
14
15
|
{@render children?.()}
|
|
15
16
|
</th>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
2
3
|
import type { Snippet } from 'svelte';
|
|
3
4
|
|
|
4
5
|
interface Props {
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
let { disabled = false, children, class: className = '' }: Props = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<tr class={
|
|
14
|
+
<tr class={twMerge('border-static py-2 [&.disabled]:text-tertiary', className)} class:disabled>
|
|
14
15
|
{@render children?.()}
|
|
15
16
|
</tr>
|
|
16
17
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import Button from '../../button/Button.svelte';
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
{onclick}
|
|
17
18
|
variant="transparent"
|
|
18
19
|
size="sm"
|
|
19
|
-
class={
|
|
20
|
+
class={twMerge('tab !h-full', active && 'active', className)}
|
|
20
21
|
>
|
|
21
22
|
{@render children?.()}
|
|
22
23
|
</Button>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
|
|
4
5
|
type Size = 'sm' | 'md' | 'lg';
|
|
5
6
|
type Variant = 'primary' | 'secondary' | 'transparent';
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
|
|
30
31
|
<div
|
|
31
32
|
role="tablist"
|
|
32
|
-
class={
|
|
33
|
+
class={twMerge('flex', sizes[size], variant, fullWidth ? 'w-full [&>*]:flex-1' : 'w-fit [&>*]:flex-none', className)}
|
|
33
34
|
>
|
|
34
35
|
{@render children?.({ variant })}
|
|
35
36
|
</div>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import { Tooltip } from '../tooltip/';
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -82,14 +83,14 @@
|
|
|
82
83
|
{#snippet renderTag()}
|
|
83
84
|
{#if onclick}
|
|
84
85
|
<button
|
|
85
|
-
class=
|
|
86
|
+
class={twMerge('outer', variantClassName, sizeClassName, buttonClassVariant, 'hover:cursor-pointer', className)}
|
|
86
87
|
title={tooltip}
|
|
87
88
|
{onclick}
|
|
88
89
|
>
|
|
89
90
|
{@render children()}
|
|
90
91
|
</button>
|
|
91
92
|
{:else}
|
|
92
|
-
<div class=
|
|
93
|
+
<div class={twMerge('outer', variantClassName, sizeClassName, 'no-underline', className)} title={tooltip}>
|
|
93
94
|
{@render children()}
|
|
94
95
|
</div>
|
|
95
96
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Tooltip } from 'bits-ui';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import { backgroundColor } from '../../tokens';
|
|
5
6
|
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
{side}
|
|
51
52
|
{align}
|
|
52
53
|
sideOffset={8}
|
|
53
|
-
class={
|
|
54
|
+
class={twMerge('z-50 max-w-xs text-wrap rounded-md bg-base-inverse px-2 py-1 text-left text-sm font-normal text-primary-inverse shadow-menu', className)}
|
|
54
55
|
>
|
|
55
56
|
{#if content}
|
|
56
57
|
{@render content()}
|