@reshape-biotech/design-system 2.7.24 → 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 (39) hide show
  1. package/README.md +9 -8
  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/toggle/Toggle.svelte +1 -1
  22. package/dist/echarts-config.js +2 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/tailwind-safelist.d.ts +0 -1
  26. package/dist/tailwind-safelist.js +0 -157
  27. package/dist/tailwind.preset.d.ts +0 -26
  28. package/dist/tailwind.preset.js +1 -31
  29. package/package.json +1 -2
  30. package/dist/components/dropdown/Dropdown.svelte +0 -69
  31. package/dist/components/dropdown/Dropdown.svelte.d.ts +0 -26
  32. package/dist/components/dropdown/components/DropdownContent.svelte +0 -29
  33. package/dist/components/dropdown/components/DropdownContent.svelte.d.ts +0 -10
  34. package/dist/components/dropdown/components/DropdownMenu.svelte +0 -23
  35. package/dist/components/dropdown/components/DropdownMenu.svelte.d.ts +0 -8
  36. package/dist/components/dropdown/components/DropdownTrigger.svelte +0 -46
  37. package/dist/components/dropdown/components/DropdownTrigger.svelte.d.ts +0 -13
  38. package/dist/components/dropdown/components/OutlinedButton.svelte +0 -61
  39. package/dist/components/dropdown/components/OutlinedButton.svelte.d.ts +0 -8
package/README.md CHANGED
@@ -1,28 +1,31 @@
1
-
2
1
  ## Local development flow with downstream consumer:
3
2
 
4
3
  First run
4
+
5
5
  ```sh
6
6
  bun link
7
7
  ```
8
+
8
9
  To create a soft link you can install in your consuming project's `node_modules`.
9
10
 
10
11
  Add this to your consumer's `package.json`:
12
+
11
13
  ```sh
12
14
  "@reshape-biotech/design-system": "link:@reshape-biotech/design-system"
13
15
  ```
14
16
 
15
17
  or run this:
18
+
16
19
  ```sh
17
20
  bun link @reshape-biotech/design-system
18
21
  ```
19
22
 
20
23
  Now, to have the package buidling watch for changes:
24
+
21
25
  ```sh
22
26
  bun run package --watch
23
27
  ```
24
28
 
25
-
26
29
  ## Publishing
27
30
 
28
31
  Set the package version in the `package.json` file.
@@ -41,6 +44,7 @@ bun publish
41
44
  `bun publish` requires a valid NPM publishing token to be set in your environment.
42
45
 
43
46
  ## Notes about consuming
47
+
44
48
  As this project heavily uses TailwindCSS **you must** have tailwind include the component files when compiling your bundle css
45
49
 
46
50
  Specifically, your `tailwind.config.js` should have something like this:
@@ -58,21 +62,18 @@ This package contains the core design system for Reshape Biotech frontend projec
58
62
  ### Contents
59
63
 
60
64
  1. **Component Library**
65
+
61
66
  - A collection of shared, reusable Svelte components
62
67
  - Standardized UI elements following Reshape Biotech's design guidelines
63
68
  - Fully typed components with TypeScript support
64
69
 
65
70
  2. **Tailwind Configuration**
66
- - Pre-configured Tailwind CSS setup
67
- - Custom theme extensions
68
- - Shared utility classes
69
71
 
70
- 3. **DaisyUI**
71
- - Pre-configured DaisyUI setup
72
+ - Pre-configured Tailwind CSS setup
72
73
  - Custom theme extensions
73
74
  - Shared utility classes
74
75
 
75
- 4. **Design Tokens**
76
+ 3. **Design Tokens**
76
77
  - Color palette
77
78
  - Typography
78
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>