@reshape-biotech/design-system 2.7.23 → 2.7.25

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 (40) hide show
  1. package/README.md +19 -10
  2. package/dist/components/datepicker/DatePicker.stories.svelte +35 -36
  3. package/dist/components/dropdown/Dropdown.stories.svelte +309 -196
  4. package/dist/components/dropdown/Dropdown.stories.svelte.d.ts +3 -26
  5. package/dist/components/dropdown/DropdownTest.svelte +48 -0
  6. package/dist/components/dropdown/DropdownTest.svelte.d.ts +16 -0
  7. package/dist/components/dropdown/components/dropdown-content.svelte +29 -0
  8. package/dist/components/dropdown/components/dropdown-content.svelte.d.ts +4 -0
  9. package/dist/components/dropdown/components/dropdown-field-trigger.svelte +13 -0
  10. package/dist/components/dropdown/components/dropdown-field-trigger.svelte.d.ts +4 -0
  11. package/dist/components/dropdown/components/dropdown-item.svelte +13 -0
  12. package/dist/components/dropdown/components/dropdown-item.svelte.d.ts +4 -0
  13. package/dist/components/dropdown/components/dropdown-trigger.svelte +26 -0
  14. package/dist/components/dropdown/components/dropdown-trigger.svelte.d.ts +4 -0
  15. package/dist/components/dropdown/index.d.ts +27 -1
  16. package/dist/components/dropdown/index.js +23 -1
  17. package/dist/components/dropdown/types.d.ts +27 -0
  18. package/dist/components/dropdown/types.js +1 -0
  19. package/dist/components/input/Input.stories.svelte +1 -1
  20. package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +2 -2
  21. package/dist/components/multi-cfu-counter/MultiCFUCounter.svelte +26 -50
  22. package/dist/components/toggle/Toggle.svelte +1 -1
  23. package/dist/echarts-config.js +2 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/tailwind-safelist.d.ts +0 -1
  27. package/dist/tailwind-safelist.js +0 -157
  28. package/dist/tailwind.preset.d.ts +0 -26
  29. package/dist/tailwind.preset.js +1 -31
  30. package/package.json +1 -2
  31. package/dist/components/dropdown/Dropdown.svelte +0 -69
  32. package/dist/components/dropdown/Dropdown.svelte.d.ts +0 -26
  33. package/dist/components/dropdown/components/DropdownContent.svelte +0 -29
  34. package/dist/components/dropdown/components/DropdownContent.svelte.d.ts +0 -10
  35. package/dist/components/dropdown/components/DropdownMenu.svelte +0 -23
  36. package/dist/components/dropdown/components/DropdownMenu.svelte.d.ts +0 -8
  37. package/dist/components/dropdown/components/DropdownTrigger.svelte +0 -46
  38. package/dist/components/dropdown/components/DropdownTrigger.svelte.d.ts +0 -13
  39. package/dist/components/dropdown/components/OutlinedButton.svelte +0 -61
  40. package/dist/components/dropdown/components/OutlinedButton.svelte.d.ts +0 -8
package/README.md CHANGED
@@ -1,19 +1,30 @@
1
-
2
1
  ## Local development flow with downstream consumer:
3
2
 
4
- `bun link` will give you a soft link you can install in your consuming project's `node_modules` directory.
3
+ First run
4
+
5
+ ```sh
6
+ bun link
7
+ ```
8
+
9
+ To create a soft link you can install in your consuming project's `node_modules`.
5
10
 
6
11
  Add this to your consumer's `package.json`:
12
+
7
13
  ```sh
8
14
  "@reshape-biotech/design-system": "link:@reshape-biotech/design-system"
9
15
  ```
10
16
 
17
+ or run this:
18
+
19
+ ```sh
20
+ bun link @reshape-biotech/design-system
21
+ ```
22
+
23
+ Now, to have the package buidling watch for changes:
11
24
 
12
- If you then keep updating the design system, run
13
25
  ```sh
14
26
  bun run package --watch
15
27
  ```
16
- to keep updating the exported components.
17
28
 
18
29
  ## Publishing
19
30
 
@@ -33,6 +44,7 @@ bun publish
33
44
  `bun publish` requires a valid NPM publishing token to be set in your environment.
34
45
 
35
46
  ## Notes about consuming
47
+
36
48
  As this project heavily uses TailwindCSS **you must** have tailwind include the component files when compiling your bundle css
37
49
 
38
50
  Specifically, your `tailwind.config.js` should have something like this:
@@ -50,21 +62,18 @@ This package contains the core design system for Reshape Biotech frontend projec
50
62
  ### Contents
51
63
 
52
64
  1. **Component Library**
65
+
53
66
  - A collection of shared, reusable Svelte components
54
67
  - Standardized UI elements following Reshape Biotech's design guidelines
55
68
  - Fully typed components with TypeScript support
56
69
 
57
70
  2. **Tailwind Configuration**
58
- - Pre-configured Tailwind CSS setup
59
- - Custom theme extensions
60
- - Shared utility classes
61
71
 
62
- 3. **DaisyUI**
63
- - Pre-configured DaisyUI setup
72
+ - Pre-configured Tailwind CSS setup
64
73
  - Custom theme extensions
65
74
  - Shared utility classes
66
75
 
67
- 4. **Design Tokens**
76
+ 3. **Design Tokens**
68
77
  - Color palette
69
78
  - Typography
70
79
  - Shadow definitions
@@ -5,7 +5,8 @@
5
5
  import { userEvent, within } from '@storybook/test';
6
6
  import { DateTime } from 'luxon';
7
7
  import DatePicker from './DatePicker.svelte';
8
- import Dropdown from '../dropdown/Dropdown.svelte';
8
+ import * as Dropdown from '../dropdown/index';
9
+ import Button from '../button/Button.svelte';
9
10
 
10
11
  const { Story } = defineMeta({
11
12
  component: DatePicker,
@@ -130,22 +131,21 @@
130
131
 
131
132
  <Story name="In Dropdown" asChild>
132
133
  <div class="p-4">
133
- <Dropdown bind:open={isOpen} side="dropdown-bottom" alignEnd={false}>
134
- {#snippet trigger({ Trigger })}
135
- <Trigger>
136
- <Icon class="mr-2" size={16}>
137
- {#snippet children(props)}
138
- <CalendarBlank {...props} />
139
- {/snippet}
140
- </Icon>
141
- {displayText}
142
- </Trigger>
143
- {/snippet}
144
-
145
- {#snippet content()}
146
- <DatePicker selectedDate={dropdownDate} onClick={handleDropdownSelection} />
147
- {/snippet}
148
- </Dropdown>
134
+ <Dropdown.Root bind:open={isOpen}>
135
+ <Dropdown.Trigger>
136
+ <Icon class="mr-2" size={16}>
137
+ {#snippet children(props)}
138
+ <CalendarBlank {...props} />
139
+ {/snippet}
140
+ </Icon>
141
+ {displayText}
142
+ </Dropdown.Trigger>
143
+ <Dropdown.Portal>
144
+ <Dropdown.RawContent side="bottom" sideOffset={4}>
145
+ <DatePicker selectedDate={dropdownDate} onClick={handleDropdownSelection} />
146
+ </Dropdown.RawContent>
147
+ </Dropdown.Portal>
148
+ </Dropdown.Root>
149
149
 
150
150
  {#if dropdownDate}
151
151
  <div class="mt-4 rounded bg-neutral p-2">
@@ -205,27 +205,26 @@
205
205
  </div>
206
206
 
207
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 class="mr-2" size={16}>
213
- {#snippet children(props)}
214
- <CalendarBlank {...props} />
215
- {/snippet}
216
- </Icon>
217
- {formDisplayText}
218
- </div>
219
- </Trigger>
220
- {/snippet}
221
-
222
- {#snippet content()}
223
- <DatePicker selectedDate={formDropdownDate} onClick={handleFormDateSelection} />
224
- {/snippet}
225
- </Dropdown>
208
+ <Dropdown.Root bind:open={formIsOpen}>
209
+ <Dropdown.Trigger>
210
+ <div data-testid="form-date-trigger" class="flex items-center gap-2">
211
+ <Icon class="mr-2" size={16}>
212
+ {#snippet children(props)}
213
+ <CalendarBlank {...props} />
214
+ {/snippet}
215
+ </Icon>
216
+ {formDisplayText}
217
+ </div>
218
+ </Dropdown.Trigger>
219
+ <Dropdown.Portal>
220
+ <Dropdown.RawContent side="bottom" sideOffset={4}>
221
+ <DatePicker selectedDate={formDropdownDate} onClick={handleFormDateSelection} />
222
+ </Dropdown.RawContent>
223
+ </Dropdown.Portal>
224
+ </Dropdown.Root>
226
225
  </div>
227
226
 
228
- <button type="submit" class="btn btn-primary mt-4">Submit Form</button>
227
+ <Button type="submit" class="mt-4">Submit Form</Button>
229
228
  </form>
230
229
  </div>
231
230
  </Story>