@reshape-biotech/design-system 0.0.45 → 0.0.48

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.
Files changed (118) hide show
  1. package/dist/app.css +43 -31
  2. package/dist/components/activity/Activity.stories.svelte +100 -0
  3. package/dist/components/activity/Activity.stories.svelte.d.ts +19 -0
  4. package/dist/components/activity/Activity.svelte +80 -0
  5. package/dist/components/activity/Activity.svelte.d.ts +18 -0
  6. package/dist/components/activity/index.d.ts +1 -0
  7. package/dist/components/activity/index.js +1 -0
  8. package/dist/components/avatar/Avatar.svelte +3 -3
  9. package/dist/components/banner/Banner.svelte +2 -2
  10. package/dist/components/button/Button.svelte +94 -7
  11. package/dist/components/button/Button.svelte.d.ts +8 -5
  12. package/dist/components/collapsible/Collapsible.stories.svelte +40 -0
  13. package/dist/components/collapsible/Collapsible.stories.svelte.d.ts +19 -0
  14. package/dist/components/collapsible/components/collapsible-content.svelte +26 -0
  15. package/dist/components/collapsible/components/collapsible-content.svelte.d.ts +10 -0
  16. package/dist/components/collapsible/components/collapsible-trigger.svelte +36 -0
  17. package/dist/components/collapsible/components/collapsible-trigger.svelte.d.ts +4 -0
  18. package/dist/components/collapsible/index.d.ts +5 -0
  19. package/dist/components/collapsible/index.js +4 -0
  20. package/dist/components/collapsible/types.d.ts +9 -0
  21. package/dist/components/collapsible/types.js +1 -0
  22. package/dist/components/combobox/Combobox.stories.svelte +119 -0
  23. package/dist/components/combobox/Combobox.stories.svelte.d.ts +19 -0
  24. package/dist/components/combobox/components/combobox-add.svelte +30 -0
  25. package/dist/components/combobox/components/combobox-add.svelte.d.ts +8 -0
  26. package/dist/components/combobox/components/combobox-content.svelte +137 -0
  27. package/dist/components/combobox/components/combobox-content.svelte.d.ts +4 -0
  28. package/dist/components/combobox/components/combobox-indicator.svelte +5 -0
  29. package/dist/components/combobox/components/combobox-indicator.svelte.d.ts +18 -0
  30. package/dist/components/combobox/index.d.ts +14 -0
  31. package/dist/components/combobox/index.js +15 -0
  32. package/dist/components/combobox/types.d.ts +20 -0
  33. package/dist/components/combobox/types.js +1 -0
  34. package/dist/components/datepicker/DatePicker.svelte +158 -97
  35. package/dist/components/divider/Divider.svelte +1 -1
  36. package/dist/components/drawer/Drawer.svelte +1 -1
  37. package/dist/components/drawer/DrawerLabel.svelte +2 -2
  38. package/dist/components/dropdown/components/DropdownContent.svelte +4 -1
  39. package/dist/components/dropdown/components/DropdownMenu.svelte +1 -1
  40. package/dist/components/dropdown/components/DropdownTrigger.svelte +4 -2
  41. package/dist/components/dropdown/components/DropdownTrigger.svelte.d.ts +1 -0
  42. package/dist/components/dropdown/components/OutlinedButton.svelte +2 -2
  43. package/dist/components/empty-content/EmptyContent.svelte +19 -0
  44. package/dist/components/empty-content/EmptyContent.svelte.d.ts +8 -0
  45. package/dist/components/graphs/chart/Chart.stories.svelte +128 -0
  46. package/dist/components/graphs/chart/Chart.stories.svelte.d.ts +19 -0
  47. package/dist/components/graphs/chart/Chart.svelte +145 -0
  48. package/dist/components/graphs/chart/Chart.svelte.d.ts +17 -0
  49. package/dist/components/graphs/index.d.ts +4 -0
  50. package/dist/components/graphs/index.js +4 -0
  51. package/dist/components/graphs/line/LineChart.stories.svelte +73 -0
  52. package/dist/components/graphs/line/LineChart.stories.svelte.d.ts +19 -0
  53. package/dist/components/graphs/line/LineChart.svelte +102 -0
  54. package/dist/components/graphs/line/LineChart.svelte.d.ts +18 -0
  55. package/dist/components/graphs/multiline/MultiLineChart.stories.svelte +77 -0
  56. package/dist/components/graphs/multiline/MultiLineChart.stories.svelte.d.ts +19 -0
  57. package/dist/components/graphs/multiline/MultiLineChart.svelte +108 -0
  58. package/dist/components/graphs/multiline/MultiLineChart.svelte.d.ts +22 -0
  59. package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte +78 -0
  60. package/dist/components/graphs/scatterplot/Scatterplot.stories.svelte.d.ts +19 -0
  61. package/dist/components/graphs/scatterplot/Scatterplot.svelte +67 -0
  62. package/dist/components/graphs/scatterplot/Scatterplot.svelte.d.ts +16 -0
  63. package/dist/components/icon-button/IconButton.svelte +18 -5
  64. package/dist/components/icon-button/IconButton.svelte.d.ts +2 -2
  65. package/dist/components/icons/AnalysisIcon.stories.svelte +38 -0
  66. package/dist/components/icons/AnalysisIcon.stories.svelte.d.ts +27 -0
  67. package/dist/components/icons/AnalysisIcon.svelte +110 -0
  68. package/dist/components/icons/AnalysisIcon.svelte.d.ts +10 -0
  69. package/dist/components/icons/Icon.svelte +23 -0
  70. package/dist/components/icons/Icon.svelte.d.ts +4 -0
  71. package/dist/components/icons/custom/Halo.svelte +32 -0
  72. package/dist/components/icons/custom/Halo.svelte.d.ts +26 -0
  73. package/dist/components/icons/custom/Well.svelte +26 -0
  74. package/dist/components/icons/custom/Well.svelte.d.ts +26 -0
  75. package/dist/components/icons/index.d.ts +17 -0
  76. package/dist/components/icons/index.js +21 -0
  77. package/dist/components/icons/types.d.ts +0 -0
  78. package/dist/components/icons/types.js +1 -0
  79. package/dist/components/image/Image.svelte +5 -6
  80. package/dist/components/input/Input.svelte +63 -41
  81. package/dist/components/input/Input.svelte.d.ts +7 -4
  82. package/dist/components/list/List.svelte +4 -10
  83. package/dist/components/logo/Logo.svelte +8 -5
  84. package/dist/components/logo/Logo.svelte.d.ts +1 -0
  85. package/dist/components/modal/Modal.svelte +1 -1
  86. package/dist/components/notification-popup/NotificationPopup.stories.svelte +2 -2
  87. package/dist/components/notification-popup/NotificationPopup.svelte +4 -2
  88. package/dist/components/segmented-control-buttons/ControlButton.svelte +2 -4
  89. package/dist/components/select/Select.svelte +7 -4
  90. package/dist/components/skeleton-loader/StatcardSkeleton.svelte +2 -5
  91. package/dist/components/slider/Slider.svelte +32 -23
  92. package/dist/components/slider/Slider.svelte.d.ts +2 -0
  93. package/dist/components/stat-card/StatCard.svelte +6 -6
  94. package/dist/components/table/Table.svelte +1 -1
  95. package/dist/components/table/components/Th.svelte +1 -1
  96. package/dist/components/tag/Tag.svelte +3 -5
  97. package/dist/components/tag/Tag.svelte.d.ts +5 -4
  98. package/dist/components/toggle/Toggle.svelte.d.ts +3 -2
  99. package/dist/fonts/afAnotherSans-Medium.woff2 +0 -0
  100. package/dist/fonts/afAnotherSans-Regular.woff2 +0 -0
  101. package/dist/fonts/afAnotherSans-SemiBold.woff2 +0 -0
  102. package/dist/fonts/afAnotherSans.woff2 +0 -0
  103. package/dist/fonts/index.d.ts +1 -3
  104. package/dist/fonts/index.js +2 -6
  105. package/dist/index.d.ts +5 -0
  106. package/dist/index.js +5 -0
  107. package/dist/tailwind-safelist.js +1 -1
  108. package/dist/tailwind.preset.d.ts +19 -6
  109. package/dist/tailwind.preset.js +5 -4
  110. package/dist/tokens.d.ts +39 -11
  111. package/dist/tokens.js +34 -16
  112. package/package.json +18 -15
  113. package/dist/fonts/MDSystem-Medium.woff +0 -0
  114. package/dist/fonts/MDSystem-Medium.woff2 +0 -0
  115. package/dist/fonts/MDSystem-Regular.woff +0 -0
  116. package/dist/fonts/MDSystem-Regular.woff2 +0 -0
  117. package/dist/fonts/MDSystem-Semibold.woff +0 -0
  118. package/dist/fonts/MDSystem-Semibold.woff2 +0 -0
package/dist/app.css CHANGED
@@ -10,89 +10,101 @@
10
10
  src: url('/fonts/MDSystemMono-Regular.woff2') format('woff2');
11
11
  }
12
12
  @font-face {
13
- font-family: 'MD System';
13
+ font-family: 'af Another Sans';
14
14
  font-style: normal;
15
15
  font-weight: 400;
16
- src: url('/fonts/MDSystem-Regular.woff2') format('woff2');
16
+ src: url('/fonts/afAnotherSans-Regular.woff2') format('woff2');
17
17
  }
18
18
  @font-face {
19
- font-family: 'MD System';
20
- src: url('/fonts/MDSystem-Medium.woff2') format('woff2');
21
- font-weight: 500;
19
+ font-family: 'af Another Sans';
22
20
  font-style: normal;
21
+ font-weight: 500;
22
+ src: url('/fonts/afAnotherSans-Medium.woff2') format('woff2');
23
23
  }
24
24
  @font-face {
25
- font-family: 'MD System';
25
+ font-family: 'af Another Sans';
26
26
  font-style: normal;
27
27
  font-weight: 600;
28
- src: url('/fonts/MDSystem-Semibold.woff2') format('woff2');
28
+ src: url('/fonts/afAnotherSans-SemiBold.woff2') format('woff2');
29
29
  }
30
+
30
31
  body {
31
- background-color: theme('backgroundColor.base');
32
+ background-color: theme('backgroundColor.surface');
32
33
  color: theme('textColor.primary');
33
- font-family: 'MD System', sans-serif;
34
+ font-family: 'af Another Sans', sans-serif;
34
35
  font-style: normal;
36
+ font-feature-settings: 'ss01' on;
37
+ font-variant-numeric: lining-nums tabular-nums;
35
38
  font-weight: 400;
36
- line-height: 140%;
37
- font-size: 16px;
39
+ font-size: 0.875rem;
40
+ line-height: 1.25rem;
41
+ letter-spacing: 0.01em;
38
42
  }
39
43
 
40
44
  a {
41
45
  color: theme('textColor.accent');
42
- font-family: 'MD System', sans-serif;
43
- font-size: 14px;
44
46
  font-style: normal;
45
- font-weight: 400;
46
- line-height: 140%; /* 19.6px */
47
47
  }
48
48
  a:hover {
49
49
  text-decoration: underline;
50
50
  }
51
51
 
52
+ strong {
53
+ font-weight: 600;
54
+ }
55
+
52
56
  h1 {
53
- font-size: 80px;
57
+ /* text-7xl */
58
+ font-size: 4.5rem;
54
59
  font-style: normal;
55
60
  font-weight: 600;
56
- line-height: 100%; /* 80px */
57
- letter-spacing: -1.6px;
61
+ line-height: 4.5rem;
62
+ letter-spacing: -0.1em;
58
63
  }
59
64
 
60
65
  h2 {
61
- font-size: 48px;
66
+ /* text-5xl */
67
+ font-size: 3rem;
62
68
  font-style: normal;
63
69
  font-weight: 600;
64
- line-height: 130%; /* 62.4px */
65
- letter-spacing: -0.96px;
70
+ line-height: 3rem;
71
+ letter-spacing: -0.05em;
66
72
  }
67
73
 
68
74
  h3 {
69
- font-size: 28px;
75
+ /* text-2xl */
76
+ font-size: 1.5rem;
70
77
  font-style: normal;
71
78
  font-weight: 600;
72
- line-height: 130%; /* 36.4px */
73
- letter-spacing: -0.56px;
79
+ line-height: 1.75rem;
80
+ letter-spacing: -0.025em;
74
81
  }
75
82
 
76
83
  h4 {
77
- font-size: 20px;
84
+ /* text-xl */
85
+ font-size: 1.25rem;
86
+ line-height: 1.75rem;
78
87
  font-style: normal;
79
88
  font-weight: 600;
80
- line-height: 130%; /* 26px */
81
- letter-spacing: -0.4px;
89
+ letter-spacing: -0.01em;
82
90
  }
83
91
 
84
92
  h5 {
85
- font-size: 16px;
93
+ /* text-base */
94
+ font-size: 1rem;
95
+ line-height: 1.5rem;
86
96
  font-style: normal;
87
97
  font-weight: 600;
88
- line-height: 130%; /* 20.8px */
98
+ letter-spacing: 0;
89
99
  }
90
100
 
91
101
  h6 {
92
- font-size: 14px;
102
+ /* text-sm */
103
+ font-size: 0.875rem;
104
+ line-height: 1.25rem;
93
105
  font-style: normal;
94
106
  font-weight: 600;
95
- line-height: 130%; /* 18.2px */
107
+ letter-spacing: 0;
96
108
  }
97
109
  }
98
110
 
@@ -0,0 +1,100 @@
1
+ <script module lang="ts">
2
+ import Button from '../button/Button.svelte';
3
+ import Activity from './Activity.svelte';
4
+ import * as Collapsible from '../collapsible/index';
5
+ import { Eye } from 'phosphor-svelte';
6
+
7
+ import { defineMeta } from '@storybook/addon-svelte-csf';
8
+ const { Story } = defineMeta({
9
+ component: Activity,
10
+ title: 'Design System/Activity',
11
+ tags: ['autodocs']
12
+ });
13
+
14
+ let activities = $state([
15
+ {
16
+ icon: 'add' as const,
17
+ label: 'Job created',
18
+ timestamp: '12 Sep 2025, 9:59',
19
+ author: 'Ella Roth'
20
+ },
21
+ {
22
+ icon: 'edit' as const,
23
+ label: 'Sample ID edited',
24
+ from: 'Sample123',
25
+ to: 'Sample456',
26
+ timestamp: '5 Sep 2025, 12:05',
27
+ author: 'Ella Roth'
28
+ },
29
+ {
30
+ icon: 'success' as const,
31
+ label: 'Job finished',
32
+ timestamp: '14 Aug 2025, 13:05'
33
+ },
34
+ {
35
+ icon: 'pause' as const,
36
+ label: 'Job paused',
37
+ timestamp: '4 Aug 2025, 13:05',
38
+ author: 'Bob Vance'
39
+ },
40
+ {
41
+ icon: 'stop' as const,
42
+ label: 'Some label that just happened to be very long so it will probably wrap in most cases',
43
+ timestamp: '4 Aug 2025, 13:05',
44
+ author: 'Michael Scott'
45
+ }
46
+ ]);
47
+
48
+ const fetchedMoreActivities = () => {
49
+ const index = Math.floor(Math.random() * (activities.length - 1));
50
+ activities = [...activities, activities[index]];
51
+ };
52
+ </script>
53
+
54
+ <Story name="Collapsible activity">
55
+ <Collapsible.Root>
56
+ <Collapsible.Trigger class="w-full pb-4">
57
+ <h6>Activity</h6>
58
+ </Collapsible.Trigger>
59
+
60
+ <Collapsible.Content class="flex flex-col items-center gap-3">
61
+ <div class="flex flex-col text-sm">
62
+ {#each activities as activity}
63
+ <Activity {activity} />
64
+ {/each}
65
+ </div>
66
+ <Button
67
+ onClick={fetchedMoreActivities}
68
+ variant="outline"
69
+ size="sm"
70
+ class="icon-secondary w-36 rounded-full"
71
+ >
72
+ <Eye />
73
+ <p>Show more</p>
74
+ </Button>
75
+ </Collapsible.Content>
76
+ </Collapsible.Root>
77
+ </Story>
78
+
79
+ <Story name="Single activity">
80
+ <Activity activity={{ icon: 'delete', label: 'Project deleted', timestamp: '2 Oct, 1980' }} />
81
+ </Story>
82
+
83
+ <Story name="Few activities">
84
+ <Activity
85
+ activity={{
86
+ icon: 'pause',
87
+ label: 'Project paused',
88
+ timestamp: '2 Oct, 1999',
89
+ author: 'Dwight'
90
+ }}
91
+ />
92
+ <Activity
93
+ activity={{
94
+ icon: 'add',
95
+ label: 'Project created',
96
+ timestamp: '2 Oct, 1999',
97
+ author: 'Dwight'
98
+ }}
99
+ />
100
+ </Story>
@@ -0,0 +1,19 @@
1
+ import Activity from './Activity.svelte';
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const Activity: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Activity = InstanceType<typeof Activity>;
19
+ export default Activity;
@@ -0,0 +1,80 @@
1
+ <script lang="ts">
2
+ import { DateTime } from 'luxon';
3
+ import { Plus, CheckFat, Pencil, Play, Pause, Stop, Trash, WarningCircle } from 'phosphor-svelte';
4
+ import type { Component } from 'svelte';
5
+
6
+ type ActivityIcon = 'add' | 'edit' | 'success' | 'start' | 'pause' | 'stop' | 'delete' | 'failed';
7
+
8
+ type Activity = {
9
+ activity_type?: string;
10
+ icon: ActivityIcon;
11
+ label: string;
12
+ timestamp: string;
13
+ author?: string | null;
14
+ field?: string | null;
15
+ previous_value?: string | null;
16
+ value?: string | null;
17
+ };
18
+
19
+ type Props = {
20
+ activity: Activity;
21
+ class?: string;
22
+ };
23
+
24
+ const ACTIVITY_ICONS: Record<ActivityIcon, Component> = {
25
+ add: Plus,
26
+ edit: Pencil,
27
+ success: CheckFat,
28
+ start: Play,
29
+ pause: Pause,
30
+ stop: Stop,
31
+ delete: Trash,
32
+ failed: WarningCircle
33
+ };
34
+
35
+ function formatDateTime(timestamp: string): string {
36
+ try {
37
+ const dateTime = DateTime.fromISO(timestamp);
38
+
39
+ if (dateTime.isValid) {
40
+ return dateTime.toLocaleString(DateTime.DATETIME_MED, {
41
+ locale: navigator.language ?? 'en-US'
42
+ });
43
+ }
44
+
45
+ return timestamp;
46
+ } catch (err) {
47
+ return timestamp;
48
+ }
49
+ }
50
+
51
+ let { class: className = '', activity }: Props = $props();
52
+ </script>
53
+
54
+ <div class={`group flex items-stretch gap-3 ${className}`}>
55
+ <div class="flex min-h-12 flex-col items-center gap-1.5">
56
+ <div class="w-0.5 grow bg-neutral group-first:invisible"></div>
57
+ <div
58
+ class="flex h-5 w-5 shrink-0 items-center justify-center rounded bg-neutral p-0.5 text-secondary"
59
+ >
60
+ <svelte:component this={ACTIVITY_ICONS[activity.icon]} />
61
+ </div>
62
+ <div class="w-0.5 grow bg-neutral group-last:invisible"></div>
63
+ </div>
64
+ <div class="flex items-center py-4">
65
+ <div class="text-secondary">
66
+ <span class="text-primary">{activity.label}</span>
67
+ {#if activity.previous_value}
68
+ <span> from <span class="text-primary">{activity.previous_value}</span></span>
69
+ {/if}
70
+ {#if activity.value}
71
+ <span> to <span class="text-primary">{activity.value}</span></span>
72
+ {/if}
73
+ <span class="px-0.5">⸱</span>
74
+ <span>{formatDateTime(activity.timestamp)}</span>
75
+ {#if activity.author}
76
+ <span> by <span class="text-primary">{activity.author}</span></span>
77
+ {/if}
78
+ </div>
79
+ </div>
80
+ </div>
@@ -0,0 +1,18 @@
1
+ import type { Component } from 'svelte';
2
+ type ActivityIcon = 'add' | 'edit' | 'success' | 'start' | 'pause' | 'stop' | 'delete' | 'failed';
3
+ type Activity = {
4
+ activity_type?: string;
5
+ icon: ActivityIcon;
6
+ label: string;
7
+ timestamp: string;
8
+ author?: string | null;
9
+ field?: string | null;
10
+ previous_value?: string | null;
11
+ value?: string | null;
12
+ };
13
+ type Props = {
14
+ activity: Activity;
15
+ class?: string;
16
+ };
17
+ declare const Activity: Component<Props, {}, "">;
18
+ export default Activity;
@@ -0,0 +1 @@
1
+ export { default as Activity } from './Activity.svelte';
@@ -0,0 +1 @@
1
+ export { default as Activity } from './Activity.svelte';
@@ -8,8 +8,8 @@
8
8
 
9
9
  let { name, size = 'md', showTooltip = true }: Props = $props();
10
10
  const sizes = {
11
- sm: 'h-5 w-5 min-w-5 text-xxs font-medium',
12
- md: 'h-7 w-7 min-w-7 text-xs font-medium'
11
+ sm: 'h-6 w-6 min-w-6 text-xxs font-semibold tracking-wide',
12
+ md: 'h-8 w-8 min-w-8 text-xs font-semibold tracking-wide'
13
13
  };
14
14
 
15
15
  let sizeClassName = $derived(sizes[size]);
@@ -43,7 +43,7 @@
43
43
 
44
44
  {#snippet avatar()}
45
45
  <div
46
- class="{sizeClassName} flex items-center justify-center rounded-full bg-accent-inverse text-primary-inverse"
46
+ class="{sizeClassName} flex items-center justify-center rounded-full border border-static bg-accent text-accent"
47
47
  >
48
48
  {initials}
49
49
  </div>
@@ -30,13 +30,13 @@
30
30
 
31
31
  {#if show}
32
32
  <div class="rounded-lg bg-{color} flex h-11 w-full items-center justify-between p-3">
33
- <div class="inline-flex items-center justify-start gap-3">
33
+ <div class="inline-flex w-full items-center justify-start gap-3">
34
34
  {#if icon}
35
35
  <div class="size-5 text-icon-{color} ">
36
36
  {@render icon?.()}
37
37
  </div>
38
38
  {/if}
39
- <div class="content text-sm">
39
+ <div class="content w-full text-sm">
40
40
  {@render content?.()}
41
41
  </div>
42
42
  </div>
@@ -17,12 +17,13 @@
17
17
  loading?: boolean;
18
18
  disabled?: boolean;
19
19
  accessibilityLabel?: string;
20
- size?: 'sm' | 'md' | 'lg';
20
+ size?: 'xs' | 'sm' | 'md' | 'lg';
21
21
  id?: string | undefined;
22
22
  tabindex?: number | undefined;
23
23
  variant?: Variant;
24
24
  children?: Snippet;
25
25
  dataTestId?: string;
26
+ rounded?: boolean;
26
27
  }
27
28
 
28
29
  let {
@@ -37,7 +38,8 @@
37
38
  tabindex = undefined,
38
39
  variant = 'primary',
39
40
  children,
40
- dataTestId = undefined
41
+ dataTestId = undefined,
42
+ rounded = false
41
43
  }: Props = $props();
42
44
 
43
45
  let variantClass = $derived(`btn-${variant}`);
@@ -60,6 +62,7 @@
60
62
  class:cursor-wait={loading}
61
63
  class="button {variantClass} {sizeClass} {className}"
62
64
  data-testid={dataTestId}
65
+ class:rounded
63
66
  >
64
67
  {#if loading}
65
68
  <Spinner />
@@ -70,107 +73,191 @@
70
73
 
71
74
  <style>
72
75
  .button {
76
+
73
77
  display: inline-flex;
78
+
74
79
  align-items: center;
80
+
75
81
  justify-content: center;
82
+
76
83
  gap: 0.5rem;
77
- border-radius: 9999px;
78
- font-size: 1rem;
84
+
85
+ overflow: hidden;
86
+
87
+ text-overflow: ellipsis;
88
+
89
+ white-space: nowrap;
90
+
91
+ text-wrap: nowrap;
92
+
93
+ border-radius: 0.5rem;
94
+
95
+ font-size: 0.875rem;
96
+
79
97
  font-weight: 500;
98
+
80
99
  line-height: 1.5rem;
100
+
81
101
  transition-duration: 150ms
82
102
  }
103
+
83
104
  .button:disabled {
105
+
84
106
  background-color: #12192a0d;
107
+
85
108
  --tw-text-opacity: 1;
109
+
86
110
  color: rgb(136 140 148 / var(--tw-text-opacity, 1))
87
111
  }
88
112
 
113
+ .rounded {
114
+
115
+ border-radius: 9999px
116
+ }
117
+
89
118
  /* Size variants */
119
+ .btn-size-xs {
120
+
121
+ height: 1.75rem;
122
+
123
+ padding: 0.5rem
124
+ }
90
125
  .btn-size-sm {
126
+
91
127
  height: 2rem;
128
+
92
129
  padding-left: 0.75rem;
130
+
93
131
  padding-right: 0.75rem;
132
+
94
133
  padding-top: 0.5rem;
134
+
95
135
  padding-bottom: 0.5rem
96
136
  }
97
137
  .btn-size-md {
138
+
98
139
  height: 2.5rem;
99
- padding-left: 1.25rem;
100
- padding-right: 1.25rem;
140
+
141
+ padding-left: 1rem;
142
+
143
+ padding-right: 1rem;
144
+
101
145
  padding-top: 0.75rem;
146
+
102
147
  padding-bottom: 0.75rem
103
148
  }
104
149
  .btn-size-lg {
150
+
105
151
  height: 3rem;
152
+
106
153
  padding-left: 1.5rem;
154
+
107
155
  padding-right: 1.5rem;
156
+
108
157
  padding-top: 1rem;
109
- padding-bottom: 1rem
158
+
159
+ padding-bottom: 1rem;
160
+
161
+ font-size: 1rem;
162
+
163
+ line-height: 1.5rem
110
164
  }
111
165
 
112
166
  /* Button variants */
113
167
  .btn-primary {
168
+
114
169
  --tw-bg-opacity: 1;
170
+
115
171
  background-color: rgb(87 80 238 / var(--tw-bg-opacity, 1));
172
+
116
173
  --tw-text-opacity: 1;
174
+
117
175
  color: rgb(255 255 255 / var(--tw-text-opacity, 1))
118
176
  }
119
177
  .btn-primary:hover {
178
+
120
179
  --tw-bg-opacity: 1;
180
+
121
181
  background-color: rgb(71 65 193 / var(--tw-bg-opacity, 1))
122
182
  }
123
183
  .btn-secondary {
184
+
124
185
  background-color: #12192a0d;
186
+
125
187
  --tw-text-opacity: 1;
188
+
126
189
  color: rgb(18 25 42 / var(--tw-text-opacity, 1))
127
190
  }
128
191
  .btn-secondary:hover {
192
+
129
193
  background-color: #12192A1A
130
194
  }
131
195
  .btn-secondary:active {
196
+
132
197
  background-color: #12192a0d
133
198
  }
134
199
  .btn-transparent {
200
+
135
201
  background-color: transparent;
202
+
136
203
  --tw-text-opacity: 1;
204
+
137
205
  color: rgb(18 25 42 / var(--tw-text-opacity, 1))
138
206
  }
139
207
  .btn-transparent:hover {
208
+
140
209
  background-color: #12192a0d
141
210
  }
142
211
  .btn-danger {
212
+
143
213
  --tw-bg-opacity: 1;
214
+
144
215
  background-color: rgb(235 70 71 / var(--tw-bg-opacity, 1));
216
+
145
217
  --tw-text-opacity: 1;
218
+
146
219
  color: rgb(255 255 255 / var(--tw-text-opacity, 1))
147
220
  }
148
221
  .btn-danger:hover {
222
+
149
223
  --tw-bg-opacity: 1;
224
+
150
225
  background-color: rgb(191 57 58 / var(--tw-bg-opacity, 1))
151
226
  }
152
227
  .btn-outline {
228
+
153
229
  border-width: 1px;
230
+
154
231
  border-color: #12192A26;
232
+
155
233
  background-color: transparent;
234
+
156
235
  --tw-text-opacity: 1;
236
+
157
237
  color: rgb(18 25 42 / var(--tw-text-opacity, 1))
158
238
  }
159
239
  .btn-outline:hover {
240
+
160
241
  background-color: #12192A1A
161
242
  }
162
243
  .btn-outline:disabled {
244
+
163
245
  border-style: none
164
246
  }
165
247
  .btn-secondary-inverse {
248
+
166
249
  background-color: #FFFFFF0D;
250
+
167
251
  --tw-text-opacity: 1;
252
+
168
253
  color: rgb(255 255 255 / var(--tw-text-opacity, 1))
169
254
  }
170
255
  .btn-secondary-inverse:hover {
256
+
171
257
  background-color: #FFFFFF26
172
258
  }
173
259
  .btn-secondary-inverse:active {
260
+
174
261
  background-color: #FFFFFF0D
175
262
  }
176
263
  </style>
@@ -1,17 +1,20 @@
1
1
  import type { Snippet } from 'svelte';
2
- declare const Button: import("svelte").Component<{
2
+ type Variant = 'primary' | 'secondary' | 'transparent' | 'danger' | 'outline' | 'secondary-inverse';
3
+ interface Props {
3
4
  class?: string;
4
5
  onClick?: (event?: MouseEvent) => void;
5
- type?: "button" | "submit" | "reset" | null | undefined;
6
+ type?: 'button' | 'submit' | 'reset' | null | undefined;
6
7
  loading?: boolean;
7
8
  disabled?: boolean;
8
9
  accessibilityLabel?: string;
9
- size?: "sm" | "md" | "lg";
10
+ size?: 'xs' | 'sm' | 'md' | 'lg';
10
11
  id?: string | undefined;
11
12
  tabindex?: number | undefined;
12
- variant?: "primary" | "secondary" | "transparent" | "danger" | "outline" | "secondary-inverse";
13
+ variant?: Variant;
13
14
  children?: Snippet;
14
15
  dataTestId?: string;
15
- }, {}, "">;
16
+ rounded?: boolean;
17
+ }
18
+ declare const Button: import("svelte").Component<Props, {}, "">;
16
19
  type Button = ReturnType<typeof Button>;
17
20
  export default Button;
@@ -0,0 +1,40 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import * as Collapsible from './index';
4
+ import Button from '../button/Button.svelte';
5
+
6
+ const { Story } = defineMeta({
7
+ component: Collapsible.Root,
8
+ title: 'Design System/Collapsible',
9
+ tags: ['autodocs']
10
+ });
11
+
12
+ let open = $state(false);
13
+ </script>
14
+
15
+ <Story name="Base">
16
+ <Collapsible.Root class="w-[200px]">
17
+ <Collapsible.Trigger class="w-full">
18
+ <h6>Trigger</h6>
19
+ </Collapsible.Trigger>
20
+
21
+ <Collapsible.Content>Content</Collapsible.Content>
22
+ </Collapsible.Root>
23
+ </Story>
24
+
25
+ <Story name="Without Icon">
26
+ <Collapsible.Root class="w-[200px]">
27
+ <Collapsible.Trigger class="w-full" withIcon={false}>
28
+ <h6>Trigger</h6>
29
+ </Collapsible.Trigger>
30
+
31
+ <Collapsible.Content>Content</Collapsible.Content>
32
+ </Collapsible.Root>
33
+ </Story>
34
+
35
+ <Story name="Controlled">
36
+ <Button onClick={() => (open = !open)}>Outside Trigger</Button>
37
+ <Collapsible.Root class="w-[200px]" {open}>
38
+ <Collapsible.Content>Content</Collapsible.Content>
39
+ </Collapsible.Root>
40
+ </Story>