@reshape-biotech/design-system 0.0.48 → 0.0.50

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 (43) hide show
  1. package/dist/components/activity/Activity.stories.svelte +10 -4
  2. package/dist/components/activity/Activity.svelte +11 -12
  3. package/dist/components/activity/Activity.svelte.d.ts +1 -2
  4. package/dist/components/avatar/Avatar.stories.svelte +51 -0
  5. package/dist/components/avatar/Avatar.stories.svelte.d.ts +19 -0
  6. package/dist/components/banner/Banner.stories.svelte +9 -9
  7. package/dist/components/banner/Banner.svelte +3 -3
  8. package/dist/components/button/Button.stories.svelte +7 -1
  9. package/dist/components/collapsible/components/collapsible-trigger.svelte +2 -2
  10. package/dist/components/combobox/Combobox.stories.svelte +326 -5
  11. package/dist/components/combobox/components/combobox-add.svelte +2 -2
  12. package/dist/components/combobox/components/combobox-content.svelte +3 -3
  13. package/dist/components/combobox/components/combobox-indicator.svelte +2 -2
  14. package/dist/components/datepicker/DatePicker.stories.svelte +227 -0
  15. package/dist/components/datepicker/DatePicker.stories.svelte.d.ts +19 -0
  16. package/dist/components/datepicker/DatePicker.svelte +8 -7
  17. package/dist/components/icon-button/IconButton.stories.svelte +17 -17
  18. package/dist/components/icons/AnalysisIcon.svelte +4 -1
  19. package/dist/components/icons/Icon.stories.svelte +127 -0
  20. package/dist/components/icons/Icon.stories.svelte.d.ts +19 -0
  21. package/dist/components/icons/Icon.svelte +6 -5
  22. package/dist/components/icons/index.d.ts +7 -5
  23. package/dist/components/icons/index.js +170 -4
  24. package/dist/components/input/Input.stories.svelte +7 -1
  25. package/dist/components/list/List.stories.svelte +3 -3
  26. package/dist/components/modal/Modal.svelte +2 -2
  27. package/dist/components/notification-popup/NotificationPopup.stories.svelte +2 -3
  28. package/dist/components/notification-popup/NotificationPopup.svelte +4 -4
  29. package/dist/components/pill/Pill.svelte +2 -2
  30. package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +10 -10
  31. package/dist/components/select/Select.svelte +5 -5
  32. package/dist/components/slider/Slider.svelte +4 -3
  33. package/dist/components/stat-card/StatCard.svelte +2 -2
  34. package/dist/components/status-badge/StatusBadge.stories.svelte +26 -34
  35. package/dist/components/table/Table.stories.svelte +6 -2
  36. package/dist/components/tag/Tag.stories.svelte +2 -2
  37. package/dist/components/tooltip/Tooltip.svelte +1 -1
  38. package/dist/components/tooltip/Tooltip.svelte.d.ts +1 -1
  39. package/dist/icons.d.ts +0 -0
  40. package/dist/icons.js +0 -0
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.js +1 -1
  43. package/package.json +3 -2
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Plus } from 'phosphor-svelte';
2
+ import { Icon } from '../../icons';
3
3
  import type { Snippet } from 'svelte';
4
4
  import type { HTMLButtonAttributes } from 'svelte/elements';
5
5
 
@@ -9,7 +9,7 @@
9
9
  </script>
10
10
 
11
11
  <button {...props}>
12
- <Plus />
12
+ <Icon iconName="Plus" />
13
13
  {@render children()}
14
14
  </button>
15
15
 
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { Combobox } from 'bits-ui';
3
3
  import type { ComboboxContentProps } from '../types';
4
- import { CaretDown, CaretUp } from 'phosphor-svelte';
4
+ import { Icon } from '../../icons';
5
5
 
6
6
  let {
7
7
  children,
@@ -16,13 +16,13 @@
16
16
  <Combobox.Content {...props} class={className}>
17
17
  {#if showScroll}
18
18
  <Combobox.ScrollUpButton class="flex justify-center">
19
- <CaretUp />
19
+ <Icon iconName="CaretUp" />
20
20
  </Combobox.ScrollUpButton>
21
21
  <Combobox.Viewport class="p-1">
22
22
  {@render children()}
23
23
  </Combobox.Viewport>
24
24
  <Combobox.ScrollDownButton class="flex justify-center">
25
- <CaretDown />
25
+ <Icon iconName="CaretDown" />
26
26
  </Combobox.ScrollDownButton>
27
27
  {:else}
28
28
  {@render children()}
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { Check } from 'phosphor-svelte';
2
+ import { Icon } from '../../icons';
3
3
  </script>
4
4
 
5
- <Check size={16} />
5
+ <Icon iconName="Check" />
@@ -0,0 +1,227 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import { userEvent, within } from '@storybook/test';
4
+ import { DateTime } from 'luxon';
5
+ import DatePicker from './DatePicker.svelte';
6
+ import Dropdown from '../dropdown/Dropdown.svelte';
7
+ import Button from '../button/Button.svelte';
8
+ import { Icon } from '../icons';
9
+
10
+ const { Story } = defineMeta({
11
+ component: DatePicker,
12
+ title: 'Design System/DatePicker',
13
+ tags: ['autodocs'],
14
+ parameters: {
15
+ design: {
16
+ type: 'figma',
17
+ url: 'https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System%3A-V1?node-id=4381-32638&t=Epi2Ul7Cw7sCJpGy-0'
18
+ }
19
+ }
20
+ });
21
+
22
+ let selectedDate = $state<DateTime | undefined>(undefined);
23
+ let loggedDate = $state<string | undefined>(undefined);
24
+
25
+ function handleDateSelection(date: DateTime) {
26
+ loggedDate = date.toFormat('yyyy-MM-dd');
27
+ }
28
+
29
+ // States for the dropdown story
30
+ let dropdownDate = $state<DateTime | undefined>(undefined);
31
+ let displayText = $state('Select a date');
32
+ let isOpen = $state(false);
33
+
34
+ // States for the form test
35
+ let formDropdownDate = $state<DateTime | undefined>(undefined);
36
+ let formDisplayText = $state('Select a date');
37
+ let formIsOpen = $state(false);
38
+
39
+ function handleDropdownSelection(date: DateTime) {
40
+ dropdownDate = date;
41
+ displayText = date.toFormat('MMM dd, yyyy');
42
+ isOpen = false;
43
+ }
44
+
45
+ function handleFormDateSelection(date: DateTime) {
46
+ formDropdownDate = date;
47
+ formDisplayText = date.toFormat('MMM dd, yyyy');
48
+ formIsOpen = false;
49
+ }
50
+ </script>
51
+
52
+ <Story name="Default">
53
+ <div class="p-4">
54
+ <DatePicker bind:selectedDate />
55
+ </div>
56
+ </Story>
57
+
58
+ <Story name="With Selected Date">
59
+ <div class="p-4">
60
+ <DatePicker selectedDate={DateTime.local(2023, 10, 15)} />
61
+ </div>
62
+ </Story>
63
+
64
+ <Story name="With Date Change Handler">
65
+ <div class="p-4">
66
+ <div class="mb-4">
67
+ <DatePicker {selectedDate} onClick={handleDateSelection} />
68
+ </div>
69
+ {#if loggedDate}
70
+ <div class="mt-4 rounded bg-neutral p-2">
71
+ <p>Selected date: <strong>{loggedDate}</strong></p>
72
+ </div>
73
+ {/if}
74
+ </div>
75
+ </Story>
76
+
77
+ <Story name="Month Navigation">
78
+ <div class="p-4">
79
+ <DatePicker selectedDate={DateTime.local()} />
80
+ <div class="mt-4 text-sm text-tertiary">
81
+ <p>Click the arrow buttons to navigate between months</p>
82
+ </div>
83
+ </div>
84
+ </Story>
85
+
86
+ <Story
87
+ name="Interaction Test"
88
+ play={async ({ canvasElement }) => {
89
+ const canvas = within(canvasElement);
90
+
91
+ // Click next month button
92
+ const nextMonthButton = canvas.getAllByRole('button')[1]; // Second button is next month
93
+ await userEvent.click(nextMonthButton);
94
+
95
+ // Wait a moment
96
+ await new Promise((resolve) => setTimeout(resolve, 300));
97
+
98
+ // Click a date (the 15th of the month)
99
+ const dateButtons = canvas.getAllByRole('button').filter((button) => {
100
+ // Find buttons with just numbers as their text content
101
+ const text = button.textContent?.trim();
102
+ return text && !isNaN(Number(text));
103
+ });
104
+
105
+ // Find the button with text "15" if it exists
106
+ const date15Button = dateButtons.find((button) => button.textContent?.trim() === '15');
107
+
108
+ if (date15Button) {
109
+ await userEvent.click(date15Button);
110
+ }
111
+ }}
112
+ >
113
+ <div class="p-4">
114
+ <DatePicker bind:selectedDate />
115
+ {#if selectedDate}
116
+ <div class="mt-4 rounded bg-neutral p-2">
117
+ <p>Selected date: <strong>{selectedDate.toFormat('yyyy-MM-dd')}</strong></p>
118
+ </div>
119
+ {/if}
120
+ </div>
121
+ </Story>
122
+
123
+ <Story name="Multiple DatePickers">
124
+ <div class="flex flex-col gap-4 p-4 md:flex-row">
125
+ <div>
126
+ <h3 class="mb-2 text-sm font-medium">Start Date</h3>
127
+ <DatePicker selectedDate={DateTime.local().minus({ days: 7 })} />
128
+ </div>
129
+ <div>
130
+ <h3 class="mb-2 text-sm font-medium">End Date</h3>
131
+ <DatePicker selectedDate={DateTime.local()} />
132
+ </div>
133
+ </div>
134
+ </Story>
135
+
136
+ <Story name="In Dropdown">
137
+ <div class="p-4">
138
+ <Dropdown bind:open={isOpen} side="dropdown-bottom" alignEnd={false}>
139
+ {#snippet trigger({ Trigger })}
140
+ <Trigger>
141
+ <Icon iconName="CalendarBlank" class="mr-2" size={16} />
142
+ {displayText}
143
+ </Trigger>
144
+ {/snippet}
145
+
146
+ {#snippet content()}
147
+ <DatePicker selectedDate={dropdownDate} onClick={handleDropdownSelection} />
148
+ {/snippet}
149
+ </Dropdown>
150
+
151
+ {#if dropdownDate}
152
+ <div class="mt-4 rounded bg-neutral p-2">
153
+ <p>You selected: <strong>{dropdownDate.toFormat('MMMM dd, yyyy')}</strong></p>
154
+ </div>
155
+ {/if}
156
+ </div>
157
+ </Story>
158
+
159
+ <Story
160
+ name="Form Submit Prevention Test"
161
+ play={async ({ canvasElement }) => {
162
+ const canvas = within(canvasElement);
163
+
164
+ // Setup spy on form submission
165
+ const form = canvas.getByTestId('test-form');
166
+ let submissionCount = 0;
167
+ form.addEventListener('submit', (e) => {
168
+ e.preventDefault();
169
+ submissionCount++;
170
+ console.log('Form was submitted!');
171
+ });
172
+
173
+ // First open the dropdown
174
+ const dropdownTrigger = canvas.getByTestId('form-date-trigger');
175
+ await userEvent.click(dropdownTrigger);
176
+
177
+ // Click prev/next month and verify no submission
178
+ const buttons = document.querySelectorAll('button');
179
+ const prevMonthButton = Array.from(buttons).find((btn) => btn.innerHTML.includes('CaretLeft'));
180
+ const nextMonthButton = Array.from(buttons).find((btn) => btn.innerHTML.includes('CaretRight'));
181
+
182
+ if (prevMonthButton) {
183
+ await userEvent.click(prevMonthButton);
184
+ console.log('Clicked prev month, submission count:', submissionCount);
185
+ }
186
+
187
+ if (nextMonthButton) {
188
+ await userEvent.click(nextMonthButton);
189
+ console.log('Clicked next month, submission count:', submissionCount);
190
+ }
191
+
192
+ // Success message if no form submission occurred
193
+ if (submissionCount === 0) {
194
+ console.log('TEST PASSED: Month navigation did not trigger form submission');
195
+ } else {
196
+ console.error('TEST FAILED: Month navigation triggered form submission');
197
+ }
198
+ }}
199
+ >
200
+ <div class="p-4">
201
+ <form data-testid="test-form" onsubmit={(e) => e.preventDefault()}>
202
+ <div class="mb-4">
203
+ <label for="name" class="mb-1 block text-sm font-medium">Name</label>
204
+ <input id="name" type="text" class="input input-bordered w-full" />
205
+ </div>
206
+
207
+ <div class="mb-4">
208
+ <Dropdown bind:open={formIsOpen} side="dropdown-bottom" alignEnd={false}>
209
+ {#snippet trigger({ Trigger })}
210
+ <Trigger>
211
+ <div data-testid="form-date-trigger" class="flex items-center gap-2">
212
+ <Icon iconName="CalendarBlank" class="mr-2" size={16} />
213
+ {formDisplayText}
214
+ </div>
215
+ </Trigger>
216
+ {/snippet}
217
+
218
+ {#snippet content()}
219
+ <DatePicker selectedDate={formDropdownDate} onClick={handleFormDateSelection} />
220
+ {/snippet}
221
+ </Dropdown>
222
+ </div>
223
+
224
+ <button type="submit" class="btn btn-primary mt-4">Submit Form</button>
225
+ </form>
226
+ </div>
227
+ </Story>
@@ -0,0 +1,19 @@
1
+ import DatePicker from './DatePicker.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 DatePicker: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type DatePicker = InstanceType<typeof DatePicker>;
19
+ export default DatePicker;
@@ -2,8 +2,9 @@
2
2
  import { run } from 'svelte/legacy';
3
3
 
4
4
  import { DateTime, type MonthNumbers } from 'luxon';
5
- import { CaretLeft, CaretRight } from 'phosphor-svelte';
5
+
6
6
  import IconButton from '../icon-button/IconButton.svelte';
7
+ import { Icon } from '../icons';
7
8
 
8
9
  interface Props {
9
10
  selectedDate: DateTime | undefined;
@@ -94,13 +95,13 @@
94
95
  <div class="calendar">
95
96
  <div class="calendar-header">
96
97
  <div class="month-year">
97
- <IconButton onclick={previousMonth}
98
- ><CaretLeft class="text-secondary" weight="bold" size="0.75rem" /></IconButton
99
- >
98
+ <IconButton onclick={previousMonth} type="button">
99
+ <Icon iconName="CaretLeft" color="secondary" size="0.75rem" />
100
+ </IconButton>
100
101
  <h5>{DateTime.local(shownYear, shownMonth).toFormat('MMM yyyy')}</h5>
101
- <IconButton onclick={nextMonth}
102
- ><CaretRight class="text-secondary" weight="bold" size="0.75rem" /></IconButton
103
- >
102
+ <IconButton onclick={nextMonth} type="button">
103
+ <Icon iconName="CaretRight" color="secondary" size="0.75rem" />
104
+ </IconButton>
104
105
  </div>
105
106
  </div>
106
107
  <div class="calendar-body">
@@ -1,7 +1,7 @@
1
1
  <script module lang="ts">
2
2
  import { defineMeta } from '@storybook/addon-svelte-csf';
3
3
  import IconButton from '../icon-button/IconButton.svelte';
4
- import { Plus } from 'phosphor-svelte';
4
+ import { Icon } from '../icons';
5
5
 
6
6
  const { Story } = defineMeta({
7
7
  component: IconButton,
@@ -13,16 +13,16 @@
13
13
  <Story name="Base">
14
14
  <div class="flex flex-col gap-2">
15
15
  <IconButton variant="primary">
16
- <Plus />
16
+ <Icon iconName="Plus" />
17
17
  </IconButton>
18
18
  <IconButton variant="secondary">
19
- <Plus />
19
+ <Icon iconName="Plus" />
20
20
  </IconButton>
21
21
  <IconButton variant="danger">
22
- <Plus />
22
+ <Icon iconName="Plus" />
23
23
  </IconButton>
24
24
  <IconButton variant="transparent">
25
- <Plus />
25
+ <Icon iconName="Plus" />
26
26
  </IconButton>
27
27
  </div>
28
28
  </Story>
@@ -30,29 +30,29 @@
30
30
  <Story name="Sizes">
31
31
  <div class="flex flex-col gap-2">
32
32
  <IconButton variant="secondary" size="xs">
33
- <Plus />
33
+ <Icon iconName="Plus" />
34
34
  </IconButton>
35
35
  <IconButton variant="secondary" size="sm">
36
- <Plus />
36
+ <Icon iconName="Plus" />
37
37
  </IconButton>
38
38
  <IconButton variant="secondary" size="md">
39
- <Plus />
39
+ <Icon iconName="Plus" />
40
40
  </IconButton>
41
41
  </div>
42
42
  </Story>
43
43
  <Story name="Not rounded base">
44
44
  <div class="flex flex-col gap-2">
45
45
  <IconButton variant="primary" rounded={false}>
46
- <Plus />
46
+ <Icon iconName="Plus" />
47
47
  </IconButton>
48
48
  <IconButton variant="secondary" rounded={false}>
49
- <Plus />
49
+ <Icon iconName="Plus" />
50
50
  </IconButton>
51
51
  <IconButton variant="danger" rounded={false}>
52
- <Plus />
52
+ <Icon iconName="Plus" />
53
53
  </IconButton>
54
54
  <IconButton variant="transparent" rounded={false}>
55
- <Plus />
55
+ <Icon iconName="Plus" />
56
56
  </IconButton>
57
57
  </div>
58
58
  </Story>
@@ -60,23 +60,23 @@
60
60
  <Story name="Not rounded sizes">
61
61
  <div class="flex flex-col gap-2">
62
62
  <IconButton variant="secondary" size="xs" rounded={false}>
63
- <Plus />
63
+ <Icon iconName="Plus" />
64
64
  </IconButton>
65
65
  <IconButton variant="secondary" size="sm" rounded={false}>
66
- <Plus />
66
+ <Icon iconName="Plus" />
67
67
  </IconButton>
68
68
  <IconButton variant="secondary" size="md" rounded={false}>
69
- <Plus />
69
+ <Icon iconName="Plus" />
70
70
  </IconButton>
71
71
  </div>
72
72
  </Story>
73
73
  <Story name="Disabled">
74
74
  <IconButton disabled>
75
- <Plus />
75
+ <Icon iconName="Plus" />
76
76
  </IconButton>
77
77
  </Story>
78
78
  <Story name="Loading">
79
79
  <IconButton loading>
80
- <Plus />
80
+ <Icon iconName="Plus" />
81
81
  </IconButton>
82
82
  </Story>
@@ -3,7 +3,8 @@
3
3
  import Well from './custom/Well.svelte';
4
4
  import RadioButton from 'phosphor-svelte/lib/RadioButton';
5
5
  import type { IconColor, SupportedAnalysisModelIcons } from '.';
6
- import { BugBeetle, Plant } from 'phosphor-svelte';
6
+ import BugBeetle from 'phosphor-svelte/lib/BugBeetle';
7
+ import Plant from 'phosphor-svelte/lib/Plant';
7
8
 
8
9
  type Props = {
9
10
  model: SupportedAnalysisModelIcons;
@@ -19,6 +20,7 @@
19
20
  case 'halos':
20
21
  return Halo;
21
22
  case 'large_colonies':
23
+ case 'pipeline_radial_growth':
22
24
  return RadioButton;
23
25
  case 'small_colonies':
24
26
  case 'sgs_enteros':
@@ -27,6 +29,7 @@
27
29
  return BugBeetle;
28
30
  case 'pipeline_seed_germination':
29
31
  return Plant;
32
+ case 'pipeline_colony_formation':
30
33
  default:
31
34
  return Well;
32
35
  }
@@ -0,0 +1,127 @@
1
+ <script module lang="ts">
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import { Icon, iconMap, type IconName } from './index';
4
+
5
+ const { Story } = defineMeta({
6
+ component: Icon,
7
+ title: 'Design System/Icons',
8
+ tags: ['autodocs'],
9
+ parameters: {
10
+ design: {
11
+ type: 'figma',
12
+ url: 'https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%5BWIP%5D--Reshape-Design-System%3A-V1.1?node-id=20-30983&t=qQZtfqCN4P2k2UYf-0'
13
+ }
14
+ }
15
+ });
16
+
17
+ // Get all icon names from the iconMap
18
+ const iconNames = Object.keys(iconMap);
19
+ </script>
20
+
21
+ <Story name="All Icons">
22
+ <div class="p-4">
23
+ <h2 class="mb-6 text-xl font-semibold">Icon Gallery</h2>
24
+ <div class="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
25
+ {#each iconNames as iconName}
26
+ <div class="flex flex-col items-center rounded-lg border border-neutral p-4 text-center">
27
+ <div class="mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-neutral">
28
+ <Icon iconName={iconName as IconName} size={24} />
29
+ </div>
30
+ <span class="text-sm">{iconName}</span>
31
+ </div>
32
+ {/each}
33
+ </div>
34
+ </div>
35
+ </Story>
36
+
37
+ <Story name="Icon Sizes">
38
+ <div class="p-4">
39
+ <h2 class="mb-6 text-xl font-semibold">Icon Sizes</h2>
40
+ <div class="flex flex-wrap items-end gap-8">
41
+ <div class="flex flex-col items-center">
42
+ <Icon iconName="Star" size={16} />
43
+ <span class="mt-2 text-xs">16px</span>
44
+ </div>
45
+ <div class="flex flex-col items-center">
46
+ <Icon iconName="Star" size={20} />
47
+ <span class="mt-2 text-xs">20px</span>
48
+ </div>
49
+ <div class="flex flex-col items-center">
50
+ <Icon iconName="Star" size={24} />
51
+ <span class="mt-2 text-xs">24px</span>
52
+ </div>
53
+ <div class="flex flex-col items-center">
54
+ <Icon iconName="Star" size={32} />
55
+ <span class="mt-2 text-xs">32px</span>
56
+ </div>
57
+ <div class="flex flex-col items-center">
58
+ <Icon iconName="Star" size={48} />
59
+ <span class="mt-2 text-xs">48px</span>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </Story>
64
+
65
+ <Story name="Icon Weights">
66
+ <div class="p-4">
67
+ <h2 class="mb-6 text-xl font-semibold">Icon Weights</h2>
68
+ <div class="flex flex-wrap gap-8">
69
+ <div class="flex flex-col items-center">
70
+ <Icon iconName="Star" size={24} weight="thin" />
71
+ <span class="mt-2 text-xs">Thin</span>
72
+ </div>
73
+ <div class="flex flex-col items-center">
74
+ <Icon iconName="Star" size={24} weight="light" />
75
+ <span class="mt-2 text-xs">Light</span>
76
+ </div>
77
+ <div class="flex flex-col items-center">
78
+ <Icon iconName="Star" size={24} weight="regular" />
79
+ <span class="mt-2 text-xs">Regular</span>
80
+ </div>
81
+ <div class="flex flex-col items-center">
82
+ <Icon iconName="Star" size={24} weight="bold" />
83
+ <span class="mt-2 text-xs">Bold</span>
84
+ </div>
85
+ <div class="flex flex-col items-center">
86
+ <Icon iconName="Star" size={24} weight="fill" />
87
+ <span class="mt-2 text-xs">Fill</span>
88
+ </div>
89
+ <div class="flex flex-col items-center">
90
+ <Icon iconName="Star" size={24} weight="duotone" />
91
+ <span class="mt-2 text-xs">Duotone</span>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </Story>
96
+
97
+ <Story name="Icon Colors">
98
+ <div class="p-4">
99
+ <h2 class="mb-6 text-xl font-semibold">Icon Colors</h2>
100
+ <div class="flex flex-wrap gap-8">
101
+ <div class="flex flex-col items-center">
102
+ <Icon iconName="Star" size={24} color="primary" />
103
+ <span class="mt-2 text-xs">Primary</span>
104
+ </div>
105
+ <div class="flex flex-col items-center">
106
+ <Icon iconName="Star" size={24} color="secondary" />
107
+ <span class="mt-2 text-xs">Secondary</span>
108
+ </div>
109
+ <div class="flex flex-col items-center">
110
+ <Icon iconName="Star" size={24} color="tertiary" />
111
+ <span class="mt-2 text-xs">Tertiary</span>
112
+ </div>
113
+ <div class="flex flex-col items-center">
114
+ <Icon iconName="Star" size={24} color="success" />
115
+ <span class="mt-2 text-xs">Success</span>
116
+ </div>
117
+ <div class="flex flex-col items-center">
118
+ <Icon iconName="Star" size={24} color="warning" />
119
+ <span class="mt-2 text-xs">Warning</span>
120
+ </div>
121
+ <div class="flex flex-col items-center">
122
+ <Icon iconName="Star" size={24} color="danger" />
123
+ <span class="mt-2 text-xs">Danger</span>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </Story>
@@ -0,0 +1,19 @@
1
+ import { Icon } from './index';
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 Icon: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Icon = InstanceType<typeof Icon>;
19
+ export default Icon;
@@ -4,10 +4,11 @@
4
4
 
5
5
  let {
6
6
  iconName,
7
- color,
8
- weight = 'regular',
7
+ color = 'inherit',
8
+ weight = 'bold',
9
9
  width = 16,
10
10
  height = 16,
11
+ size,
11
12
  class: className
12
13
  }: IconProps = $props();
13
14
  </script>
@@ -15,9 +16,9 @@
15
16
  <!-- svelte-ignore svelte_component_deprecated -->
16
17
  <svelte:component
17
18
  this={renderIcon(iconName ?? 'SealQuestion')}
18
- color={textColor[color ?? 'icon-primary']}
19
+ color={color === 'inherit' ? 'currentColor' : textColor[color]}
19
20
  class={className}
20
21
  {weight}
21
- {width}
22
- {height}
22
+ width={size ? size : width}
23
+ height={size ? size : height}
23
24
  />
@@ -1,16 +1,18 @@
1
- import type { Component } from 'svelte';
2
1
  import type { IconComponentProps } from 'phosphor-svelte';
2
+ import type { Component } from 'svelte';
3
3
  import type { textColor } from './../../tokens';
4
4
  export type PhosphorIconProps = Component<IconComponentProps, object, ''>;
5
- export declare const iconMap: Record<string, PhosphorIconProps>;
5
+ export type IconName = 'ArrowFatLineRight' | 'ArrowRight' | 'ArrowUpRight' | 'Barcode' | 'BookOpen' | 'BookOpenText' | 'BowlingBall' | 'CalendarBlank' | 'CameraSlash' | 'CaretDown' | 'CaretLeft' | 'CaretRight' | 'CaretUp' | 'CaretUpDown' | 'ChatTeardropDots' | 'Check' | 'CheckCircle' | 'CheckFat' | 'Circle' | 'CircleDashed' | 'CircleHalf' | 'CirclesFour' | 'CirclesThreePlus' | 'Clock' | 'ClockCountdown' | 'Copy' | 'Crop' | 'Cube' | 'Database' | 'DotsThree' | 'DotsThreeOutlineVertical' | 'DownloadSimple' | 'Drop' | 'EnvelopeSimple' | 'Eye' | 'Eyedropper' | 'FileCsv' | 'Flag' | 'Flask' | 'Folder' | 'FolderDashed' | 'FolderSimplePlus' | 'FunnelSimple' | 'Gear' | 'GlobeSimple' | 'GlobeSimpleX' | 'GridFour' | 'Hash' | 'House' | 'ImageSquare' | 'ImagesSquare' | 'Info' | 'Lock' | 'List' | 'MagnifyingGlass' | 'MegaphoneSimple' | 'Moon' | 'Pause' | 'Pencil' | 'PencilSimple' | 'Percent' | 'Phone' | 'Plant' | 'Play' | 'Plus' | 'PlusMinus' | 'Question' | 'SealQuestion' | 'Share' | 'SidebarSimple' | 'SkipBack' | 'SkipForward' | 'Sparkle' | 'SpinnerGap' | 'SquaresFour' | 'Star' | 'Stop' | 'StopCircle' | 'Sun' | 'Table' | 'Tag' | 'TestTube' | 'Trash' | 'TrashSimple' | 'UserPlus' | 'Video' | 'Warning' | 'WarningCircle' | 'WifiSlash' | 'X';
6
+ export declare const iconMap: Record<IconName, PhosphorIconProps>;
6
7
  export declare function renderIcon(iconName: keyof typeof iconMap): PhosphorIconProps;
7
8
  export type IconColor = keyof typeof textColor;
8
9
  export type SupportedAnalysisModelIcons = 'halos' | 'large_colonies' | 'small_colonies' | 'sgs_enteros' | 'general_germination_rate_with_tracking' | 'general_germination_rate_without_tracking' | 'pipeline_insect_analysis' | 'pipeline_colony_formation' | 'pipeline_radial_growth' | 'syngenta_health_score_crw' | 'pipeline_seed_germination' | 'syngenta_health_score_faw' | 'syngenta_health_score_sbl' | 'unilever_cfu_count_lowres';
9
10
  export { default as Icon } from './Icon.svelte';
10
11
  export type IconProps = {
11
- iconName: string;
12
- color: IconColor;
13
- weight?: 'fill' | 'light' | 'regular' | 'thin';
12
+ iconName: IconName;
13
+ color?: IconColor | 'inherit';
14
+ weight?: 'fill' | 'light' | 'regular' | 'thin' | 'bold' | 'duotone';
15
+ size?: number | string;
14
16
  width?: number;
15
17
  height?: number;
16
18
  class?: string;