@reshape-biotech/design-system 2.7.24 → 2.7.26
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/README.md +9 -8
- package/dist/components/activity/Activity.svelte +3 -3
- package/dist/components/avatar/Avatar.svelte +1 -1
- package/dist/components/datepicker/DatePicker.stories.svelte +35 -36
- package/dist/components/dropdown/Dropdown.stories.svelte +464 -195
- package/dist/components/dropdown/Dropdown.stories.svelte.d.ts +3 -26
- package/dist/components/dropdown/DropdownTest.svelte +48 -0
- package/dist/components/dropdown/DropdownTest.svelte.d.ts +16 -0
- package/dist/components/dropdown/components/dropdown-content.svelte +29 -0
- package/dist/components/dropdown/components/dropdown-content.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown-field-trigger.svelte +13 -0
- package/dist/components/dropdown/components/dropdown-field-trigger.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown-item.svelte +13 -0
- package/dist/components/dropdown/components/dropdown-item.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown-sub-content.svelte +20 -0
- package/dist/components/dropdown/components/dropdown-sub-content.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown-sub-trigger.svelte +24 -0
- package/dist/components/dropdown/components/dropdown-sub-trigger.svelte.d.ts +4 -0
- package/dist/components/dropdown/components/dropdown-trigger.svelte +26 -0
- package/dist/components/dropdown/components/dropdown-trigger.svelte.d.ts +4 -0
- package/dist/components/dropdown/index.d.ts +29 -1
- package/dist/components/dropdown/index.js +25 -1
- package/dist/components/dropdown/types.d.ts +38 -0
- package/dist/components/dropdown/types.js +1 -0
- package/dist/components/input/Input.stories.svelte +1 -1
- package/dist/components/multi-cfu-counter/MultiCFUCounter.stories.svelte +2 -2
- package/dist/components/toggle/Toggle.svelte +1 -1
- package/dist/echarts-config.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tailwind-safelist.d.ts +0 -1
- package/dist/tailwind-safelist.js +0 -157
- package/dist/tailwind.preset.d.ts +0 -26
- package/dist/tailwind.preset.js +1 -31
- package/package.json +1 -2
- package/dist/components/dropdown/Dropdown.svelte +0 -69
- package/dist/components/dropdown/Dropdown.svelte.d.ts +0 -26
- package/dist/components/dropdown/components/DropdownContent.svelte +0 -29
- package/dist/components/dropdown/components/DropdownContent.svelte.d.ts +0 -10
- package/dist/components/dropdown/components/DropdownMenu.svelte +0 -23
- package/dist/components/dropdown/components/DropdownMenu.svelte.d.ts +0 -8
- package/dist/components/dropdown/components/DropdownTrigger.svelte +0 -46
- package/dist/components/dropdown/components/DropdownTrigger.svelte.d.ts +0 -13
- package/dist/components/dropdown/components/OutlinedButton.svelte +0 -61
- 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
|
-
|
|
71
|
-
- Pre-configured DaisyUI setup
|
|
72
|
+
- Pre-configured Tailwind CSS setup
|
|
72
73
|
- Custom theme extensions
|
|
73
74
|
- Shared utility classes
|
|
74
75
|
|
|
75
|
-
|
|
76
|
+
3. **Design Tokens**
|
|
76
77
|
- Color palette
|
|
77
78
|
- Typography
|
|
78
79
|
- Shadow definitions
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
|
|
57
57
|
<div class={`group flex items-stretch gap-3 ${className}`}>
|
|
58
58
|
<div class="flex min-h-12 flex-col items-center gap-1.5">
|
|
59
|
-
<div class="w-0.5 grow
|
|
59
|
+
<div class="bg-neutral w-0.5 grow group-first:invisible"></div>
|
|
60
60
|
<div
|
|
61
|
-
class="flex h-5 w-5 shrink-0 items-center justify-center rounded p-0.5
|
|
61
|
+
class="text-secondary flex h-5 w-5 shrink-0 items-center justify-center rounded p-0.5 {ACTIVITY_BACKGROUND[
|
|
62
62
|
activity.icon
|
|
63
63
|
]}"
|
|
64
64
|
>
|
|
65
65
|
<ActivityIcon icon={activity.icon} />
|
|
66
66
|
</div>
|
|
67
|
-
<div class="w-0.5 grow
|
|
67
|
+
<div class="bg-neutral w-0.5 grow group-last:invisible"></div>
|
|
68
68
|
</div>
|
|
69
69
|
<div class="flex items-center py-4">
|
|
70
70
|
<div class="text-secondary">
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
{#snippet avatar()}
|
|
45
45
|
<div
|
|
46
|
-
class="{sizeClassName} flex items-center justify-center rounded-full border
|
|
46
|
+
class="{sizeClassName} border-static bg-accent text-accent flex items-center justify-center rounded-full border"
|
|
47
47
|
>
|
|
48
48
|
{initials}
|
|
49
49
|
</div>
|
|
@@ -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/
|
|
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}
|
|
134
|
-
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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}
|
|
209
|
-
|
|
210
|
-
<
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
<
|
|
227
|
+
<Button type="submit" class="mt-4">Submit Form</Button>
|
|
229
228
|
</form>
|
|
230
229
|
</div>
|
|
231
230
|
</Story>
|