@reshape-biotech/design-system 2.7.52 → 2.7.53
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/dist/components/activity/Activity.figma.d.ts +7 -0
- package/dist/components/activity/Activity.figma.js +24 -0
- package/dist/components/activity/Activity.stories.svelte +0 -6
- package/dist/components/avatar/Avatar.figma.d.ts +7 -0
- package/dist/components/avatar/Avatar.figma.js +17 -0
- package/dist/components/avatar/Avatar.stories.svelte +0 -6
- package/dist/components/banner/Banner.figma.d.ts +7 -0
- package/dist/components/banner/Banner.figma.js +26 -0
- package/dist/components/button/Button.figma.d.ts +7 -0
- package/dist/components/button/Button.figma.js +51 -0
- package/dist/components/button/Button.stories.svelte +0 -6
- package/dist/components/checkbox/Checkbox.figma.d.ts +7 -0
- package/dist/components/checkbox/Checkbox.figma.js +24 -0
- package/dist/components/checkbox/Checkbox.stories.svelte +69 -10
- package/dist/components/checkbox/Checkbox.svelte +32 -8
- package/dist/components/checkbox/Checkbox.svelte.d.ts +4 -2
- package/dist/components/collapsible/Collapsible.figma.d.ts +7 -0
- package/dist/components/collapsible/Collapsible.figma.js +21 -0
- package/dist/components/combobox/Combobox.stories.svelte +0 -6
- package/dist/components/datepicker/DatePicker.figma.d.ts +7 -0
- package/dist/components/datepicker/DatePicker.figma.js +14 -0
- package/dist/components/datepicker/DatePicker.stories.svelte +0 -6
- package/dist/components/divider/Divider.figma.d.ts +7 -0
- package/dist/components/divider/Divider.figma.js +12 -0
- package/dist/components/drawer/Drawer.figma.d.ts +7 -0
- package/dist/components/drawer/Drawer.figma.js +26 -0
- package/dist/components/dropdown/Dropdown.figma.d.ts +7 -0
- package/dist/components/dropdown/Dropdown.figma.js +22 -0
- package/dist/components/empty-content/EmptyContent.figma.d.ts +7 -0
- package/dist/components/empty-content/EmptyContent.figma.js +20 -0
- package/dist/components/empty-content/EmptyContent.stories.svelte +43 -0
- package/dist/components/empty-content/EmptyContent.svelte +11 -2
- package/dist/components/empty-content/EmptyContent.svelte.d.ts +1 -0
- package/dist/components/icon-button/IconButton.figma.d.ts +7 -0
- package/dist/components/icon-button/IconButton.figma.js +42 -0
- package/dist/components/icons/Icon.stories.svelte +0 -6
- package/dist/components/input/Input.figma.d.ts +7 -0
- package/dist/components/input/Input.figma.js +23 -0
- package/dist/components/input/Input.stories.svelte +0 -6
- package/dist/components/label/Label.figma.d.ts +7 -0
- package/dist/components/label/Label.figma.js +12 -0
- package/dist/components/legend/Legend.figma.d.ts +7 -0
- package/dist/components/legend/Legend.figma.js +14 -0
- package/dist/components/list/List.figma.d.ts +7 -0
- package/dist/components/list/List.figma.js +23 -0
- package/dist/components/logo/Logo.figma.d.ts +7 -0
- package/dist/components/logo/Logo.figma.js +21 -0
- package/dist/components/logo/Logo.stories.svelte +17 -0
- package/dist/components/logo/Logo.svelte +44 -18
- package/dist/components/logo/Logo.svelte.d.ts +1 -0
- package/dist/components/markdown/Markdown.figma.d.ts +7 -0
- package/dist/components/markdown/Markdown.figma.js +14 -0
- package/dist/components/modal/Modal.figma.d.ts +7 -0
- package/dist/components/modal/Modal.figma.js +31 -0
- package/dist/components/nav/Nav.figma.d.ts +7 -0
- package/dist/components/nav/Nav.figma.js +21 -0
- package/dist/components/notification-popup/NotificationPopup.figma.d.ts +7 -0
- package/dist/components/notification-popup/NotificationPopup.figma.js +19 -0
- package/dist/components/notifications/Notifications.figma.d.ts +7 -0
- package/dist/components/notifications/Notifications.figma.js +26 -0
- package/dist/components/pill/Pill.figma.d.ts +7 -0
- package/dist/components/pill/Pill.figma.js +11 -0
- package/dist/components/progress-circle/ProgressCircle.figma.d.ts +7 -0
- package/dist/components/progress-circle/ProgressCircle.figma.js +15 -0
- package/dist/components/progress-circle/ProgressCircle.stories.svelte +12 -0
- package/dist/components/progress-circle/ProgressCircle.svelte +19 -11
- package/dist/components/progress-circle/ProgressCircle.svelte.d.ts +1 -1
- package/dist/components/required-status-indicator/RequiredStatusIndicator.figma.d.ts +7 -0
- package/dist/components/required-status-indicator/RequiredStatusIndicator.figma.js +18 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.figma.d.ts +7 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.figma.js +27 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.stories.svelte +29 -0
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte +8 -6
- package/dist/components/segmented-control-buttons/SegmentedControlButtons.svelte.d.ts +3 -1
- package/dist/components/select/Select.figma.d.ts +7 -0
- package/dist/components/select/Select.figma.js +17 -0
- package/dist/components/skeleton-loader/SkeletonLoader.figma.d.ts +7 -0
- package/dist/components/skeleton-loader/SkeletonLoader.figma.js +16 -0
- package/dist/components/slider/Slider.figma.d.ts +7 -0
- package/dist/components/slider/Slider.figma.js +12 -0
- package/dist/components/spinner/Spinner.figma.d.ts +7 -0
- package/dist/components/spinner/Spinner.figma.js +11 -0
- package/dist/components/stat-card/StatCard.figma.d.ts +7 -0
- package/dist/components/stat-card/StatCard.figma.js +18 -0
- package/dist/components/status-badge/StatusBadge.figma.d.ts +7 -0
- package/dist/components/status-badge/StatusBadge.figma.js +29 -0
- package/dist/components/stepper/Stepper.figma.d.ts +7 -0
- package/dist/components/stepper/Stepper.figma.js +15 -0
- package/dist/components/table/Table.figma.d.ts +7 -0
- package/dist/components/table/Table.figma.js +26 -0
- package/dist/components/tabs/Tabs.figma.d.ts +7 -0
- package/dist/components/tabs/Tabs.figma.js +24 -0
- package/dist/components/tabs/Tabs.stories.svelte +23 -0
- package/dist/components/tabs/components/Tabs.svelte +6 -1
- package/dist/components/tabs/components/Tabs.svelte.d.ts +2 -0
- package/dist/components/tag/Tag.figma.d.ts +7 -0
- package/dist/components/tag/Tag.figma.js +33 -0
- package/dist/components/tag/Tag.svelte +0 -1
- package/dist/components/textarea/Textarea.figma.d.ts +7 -0
- package/dist/components/textarea/Textarea.figma.js +17 -0
- package/dist/components/toast/Toast.figma.d.ts +7 -0
- package/dist/components/toast/Toast.figma.js +17 -0
- package/dist/components/toggle/Toggle.figma.d.ts +7 -0
- package/dist/components/toggle/Toggle.figma.js +23 -0
- package/dist/components/toggle/Toggle.stories.svelte +56 -4
- package/dist/components/toggle/Toggle.stories.svelte.d.ts +6 -14
- package/dist/components/toggle/Toggle.svelte +56 -58
- package/dist/components/toggle/Toggle.svelte.d.ts +2 -0
- package/dist/components/toggle-icon-button/ToggleIconButton.figma.d.ts +7 -0
- package/dist/components/toggle-icon-button/ToggleIconButton.figma.js +31 -0
- package/dist/components/tooltip/Tooltip.figma.d.ts +7 -0
- package/dist/components/tooltip/Tooltip.figma.js +22 -0
- package/package.json +3 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=5302-18990
|
|
2
|
+
// source=src/lib/components/activity/Activity.svelte
|
|
3
|
+
// component=Activity
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const type = instance.getEnum('type', {
|
|
7
|
+
'job': 'job',
|
|
8
|
+
'plate': 'plate',
|
|
9
|
+
'project': 'project',
|
|
10
|
+
'well': 'well',
|
|
11
|
+
});
|
|
12
|
+
export default {
|
|
13
|
+
example: figma.code `
|
|
14
|
+
<Activity
|
|
15
|
+
activities={[{
|
|
16
|
+
icon: "${type}",
|
|
17
|
+
label: "Activity description",
|
|
18
|
+
timestamp: new Date().toISOString(),
|
|
19
|
+
}]}
|
|
20
|
+
/>
|
|
21
|
+
`,
|
|
22
|
+
imports: ["import Activity from './Activity.svelte'"],
|
|
23
|
+
id: 'activity',
|
|
24
|
+
};
|
|
@@ -10,12 +10,6 @@
|
|
|
10
10
|
component: Activity,
|
|
11
11
|
title: 'Components/Activity',
|
|
12
12
|
tags: ['autodocs'],
|
|
13
|
-
parameters: {
|
|
14
|
-
design: {
|
|
15
|
-
type: 'figma',
|
|
16
|
-
url: 'https://www.figma.com/design/VHTMNdy8PAXAMx43edNZGW/%F0%9F%92%A0--Reshape-Design-System%3A-V1?node-id=2248-7688&t=sCuBI8dX6K6NjNR6-0',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
13
|
});
|
|
20
14
|
|
|
21
15
|
let activities = $state([
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-9326
|
|
2
|
+
// source=src/lib/components/avatar/Avatar.svelte
|
|
3
|
+
// component=Avatar
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const size = instance.getEnum('size', {
|
|
7
|
+
'sm': 'sm',
|
|
8
|
+
'xs': 'sm',
|
|
9
|
+
'md': 'md',
|
|
10
|
+
'lg': 'md',
|
|
11
|
+
});
|
|
12
|
+
const showTooltip = instance.getBoolean('showTooltip');
|
|
13
|
+
export default {
|
|
14
|
+
example: figma.code `<Avatar name="John Doe" size="${size}" ${showTooltip ? '' : 'showTooltip={false}'} />`,
|
|
15
|
+
imports: ["import Avatar from './Avatar.svelte'"],
|
|
16
|
+
id: 'avatar',
|
|
17
|
+
};
|
|
@@ -6,12 +6,6 @@
|
|
|
6
6
|
component: Avatar,
|
|
7
7
|
title: 'Components/Avatar',
|
|
8
8
|
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
design: {
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/design/VHTMNdy8PAXAMx43edNZGW/%F0%9F%92%A0--Reshape-Design-System%3A-V1?node-id=9-9253&t=sCuBI8dX6K6NjNR6-0',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
9
|
});
|
|
16
10
|
</script>
|
|
17
11
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3351
|
|
2
|
+
// source=src/lib/components/banner/Banner.svelte
|
|
3
|
+
// component=Banner
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const type = instance.getEnum('type', {
|
|
7
|
+
'neutral': 'neutral',
|
|
8
|
+
'success': 'success',
|
|
9
|
+
'info': 'info',
|
|
10
|
+
'warning': 'warning',
|
|
11
|
+
'error': 'error',
|
|
12
|
+
'elevated': 'neutral',
|
|
13
|
+
'primary': 'info',
|
|
14
|
+
});
|
|
15
|
+
const closable = instance.getBoolean('closable');
|
|
16
|
+
const compact = instance.getBoolean('compact');
|
|
17
|
+
const title = instance.getString('Title');
|
|
18
|
+
export default {
|
|
19
|
+
example: figma.code `
|
|
20
|
+
<Banner type="${type}" ${compact ? 'compact' : ''} ${closable ? '' : 'closable={false}'}>
|
|
21
|
+
{#snippet content()}${title || 'Banner message'}{/snippet}
|
|
22
|
+
</Banner>
|
|
23
|
+
`,
|
|
24
|
+
imports: ["import Banner from './Banner.svelte'"],
|
|
25
|
+
id: 'banner',
|
|
26
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3073
|
|
2
|
+
// source=src/lib/components/button/Button.svelte
|
|
3
|
+
// component=Button
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'primary': 'primary',
|
|
8
|
+
'secondary': 'secondary',
|
|
9
|
+
'outline': 'outline',
|
|
10
|
+
'transparent': 'transparent',
|
|
11
|
+
'danger': 'danger',
|
|
12
|
+
'secondary-inverse': 'secondary-inverse',
|
|
13
|
+
'transparent-inverse': 'transparent-inverse',
|
|
14
|
+
});
|
|
15
|
+
const size = instance.getEnum('size', {
|
|
16
|
+
'xs': 'xs',
|
|
17
|
+
'sm': 'sm',
|
|
18
|
+
'md': 'md',
|
|
19
|
+
'lg': 'lg',
|
|
20
|
+
});
|
|
21
|
+
const rounded = instance.getEnum('rounded', { 'true': true, 'false': false });
|
|
22
|
+
const disabled = instance.getEnum('disabled', { 'true': true, 'false': false });
|
|
23
|
+
const label = instance.findText('label');
|
|
24
|
+
const hasLeftIcon = instance.getBoolean('left icon');
|
|
25
|
+
const leftIcon = hasLeftIcon ? instance.getInstanceSwap('left instance') : null;
|
|
26
|
+
let leftIconSnippet;
|
|
27
|
+
if (leftIcon && leftIcon.type === 'INSTANCE' && leftIcon.hasCodeConnect()) {
|
|
28
|
+
leftIconSnippet = leftIcon.executeTemplate().example;
|
|
29
|
+
}
|
|
30
|
+
const hasRightIcon = instance.getBoolean('right icon');
|
|
31
|
+
const rightIcon = hasRightIcon ? instance.getInstanceSwap('right instance') : null;
|
|
32
|
+
let rightIconSnippet;
|
|
33
|
+
if (rightIcon && rightIcon.type === 'INSTANCE' && rightIcon.hasCodeConnect()) {
|
|
34
|
+
rightIconSnippet = rightIcon.executeTemplate().example;
|
|
35
|
+
}
|
|
36
|
+
export default {
|
|
37
|
+
example: figma.code `
|
|
38
|
+
<Button
|
|
39
|
+
variant="${variant}"
|
|
40
|
+
size="${size}"
|
|
41
|
+
${rounded ? 'rounded' : ''}
|
|
42
|
+
${disabled ? 'disabled' : ''}
|
|
43
|
+
>
|
|
44
|
+
${leftIconSnippet ? figma.code `${leftIconSnippet}` : ''}
|
|
45
|
+
${label ? label.textContent : 'Button'}
|
|
46
|
+
${rightIconSnippet ? figma.code `${rightIconSnippet}` : ''}
|
|
47
|
+
</Button>
|
|
48
|
+
`,
|
|
49
|
+
imports: ["import Button from './Button.svelte'"],
|
|
50
|
+
id: 'button',
|
|
51
|
+
};
|
|
@@ -6,12 +6,6 @@
|
|
|
6
6
|
component: Button,
|
|
7
7
|
title: 'Components/Button',
|
|
8
8
|
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
design: {
|
|
11
|
-
type: 'figma',
|
|
12
|
-
url: 'https://www.figma.com/design/VHTMNdy8PAXAMx43edNZGW/%F0%9F%92%A0--Reshape-Design-System%3A-V1?node-id=9-3068&t=sCuBI8dX6K6NjNR6-0',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
9
|
});
|
|
16
10
|
|
|
17
11
|
const variants = [
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=155-6227
|
|
2
|
+
// source=src/lib/components/checkbox/Checkbox.svelte
|
|
3
|
+
// component=Checkbox
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const size = instance.getEnum('size', {
|
|
7
|
+
'sm': 'sm',
|
|
8
|
+
'md': 'md',
|
|
9
|
+
'lg': 'lg',
|
|
10
|
+
});
|
|
11
|
+
const disabled = instance.getEnum('disabled', {
|
|
12
|
+
'true': true,
|
|
13
|
+
'false': false,
|
|
14
|
+
});
|
|
15
|
+
const checked = instance.getEnum('state', {
|
|
16
|
+
'on': true,
|
|
17
|
+
'off': false,
|
|
18
|
+
'indeterminate': false,
|
|
19
|
+
});
|
|
20
|
+
export default {
|
|
21
|
+
example: figma.code `<Checkbox size="${size}" checked={${checked}} ${disabled ? 'disabled' : ''} />`,
|
|
22
|
+
imports: ["import Checkbox from './Checkbox.svelte'"],
|
|
23
|
+
id: 'checkbox',
|
|
24
|
+
};
|
|
@@ -6,17 +6,76 @@
|
|
|
6
6
|
component: Checkbox,
|
|
7
7
|
title: 'Components/Checkbox',
|
|
8
8
|
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'fullscreen',
|
|
11
|
+
},
|
|
9
12
|
});
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
const sizes = ['sm', 'md', 'lg'] as const;
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
|
-
<Story name="
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
<
|
|
17
|
+
<Story name="Overview" asChild>
|
|
18
|
+
<div class="flex flex-col gap-8 text-sm">
|
|
19
|
+
<div class="overflow-x-auto">
|
|
20
|
+
<table class="w-full min-w-[640px] table-fixed border-collapse text-center">
|
|
21
|
+
<colgroup>
|
|
22
|
+
<col class="w-24" />
|
|
23
|
+
<col />
|
|
24
|
+
<col />
|
|
25
|
+
<col />
|
|
26
|
+
<col />
|
|
27
|
+
<col />
|
|
28
|
+
<col />
|
|
29
|
+
</colgroup>
|
|
30
|
+
<thead>
|
|
31
|
+
<tr class="border-b border-static text-left text-label font-medium text-secondary">
|
|
32
|
+
<th class="bg-base p-4 text-left">Size</th>
|
|
33
|
+
<th class="p-4 text-center">Off</th>
|
|
34
|
+
<th class="p-4 text-center">On</th>
|
|
35
|
+
<th class="p-4 text-center">Indeterminate</th>
|
|
36
|
+
<th class="p-4 text-center">Disabled off</th>
|
|
37
|
+
<th class="p-4 text-center">Disabled on</th>
|
|
38
|
+
<th class="p-4 text-center">Indeterminate disabled</th>
|
|
39
|
+
</tr>
|
|
40
|
+
</thead>
|
|
41
|
+
<tbody>
|
|
42
|
+
{#each sizes as size}
|
|
43
|
+
<tr class="border-b last:border-none border-static">
|
|
44
|
+
<td class="bg-base p-4 text-left font-mono text-label text-secondary">{size}</td>
|
|
45
|
+
<td class="p-4">
|
|
46
|
+
<div class="flex w-full justify-center">
|
|
47
|
+
<Checkbox {size} checked={false} />
|
|
48
|
+
</div>
|
|
49
|
+
</td>
|
|
50
|
+
<td class="p-4">
|
|
51
|
+
<div class="flex w-full justify-center">
|
|
52
|
+
<Checkbox {size} checked />
|
|
53
|
+
</div>
|
|
54
|
+
</td>
|
|
55
|
+
<td class="p-4">
|
|
56
|
+
<div class="flex w-full justify-center">
|
|
57
|
+
<Checkbox {size} indeterminate />
|
|
58
|
+
</div>
|
|
59
|
+
</td>
|
|
60
|
+
<td class="p-4">
|
|
61
|
+
<div class="flex w-full justify-center">
|
|
62
|
+
<Checkbox {size} checked={false} disabled />
|
|
63
|
+
</div>
|
|
64
|
+
</td>
|
|
65
|
+
<td class="p-4">
|
|
66
|
+
<div class="flex w-full justify-center">
|
|
67
|
+
<Checkbox {size} checked disabled />
|
|
68
|
+
</div>
|
|
69
|
+
</td>
|
|
70
|
+
<td class="p-4">
|
|
71
|
+
<div class="flex w-full justify-center">
|
|
72
|
+
<Checkbox {size} indeterminate disabled />
|
|
73
|
+
</div>
|
|
74
|
+
</td>
|
|
75
|
+
</tr>
|
|
76
|
+
{/each}
|
|
77
|
+
</tbody>
|
|
78
|
+
</table>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</Story>
|
|
@@ -5,22 +5,46 @@
|
|
|
5
5
|
import { Icon } from '../icons/index.js';
|
|
6
6
|
import { Checkbox, type CheckboxRootProps } from 'bits-ui';
|
|
7
7
|
|
|
8
|
-
export type CheckboxProps = CheckboxRootProps
|
|
8
|
+
export type CheckboxProps = CheckboxRootProps & {
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
};
|
|
9
11
|
|
|
10
|
-
let {
|
|
12
|
+
let {
|
|
13
|
+
checked = $bindable(false),
|
|
14
|
+
onCheckedChange,
|
|
15
|
+
name,
|
|
16
|
+
class: className,
|
|
17
|
+
size = 'sm',
|
|
18
|
+
disabled = false,
|
|
19
|
+
...props
|
|
20
|
+
}: CheckboxProps = $props();
|
|
21
|
+
|
|
22
|
+
const sizeConfig = {
|
|
23
|
+
sm: { box: 'size-4.5 rounded-sm', iconSize: 14 },
|
|
24
|
+
md: { box: 'size-5 rounded-sm', iconSize: 16 },
|
|
25
|
+
lg: { box: 'size-6 rounded-md', iconSize: 16 },
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const config = $derived(sizeConfig[size]);
|
|
11
29
|
</script>
|
|
12
30
|
|
|
13
|
-
<Checkbox.Root bind:checked {onCheckedChange} {...props}>
|
|
31
|
+
<Checkbox.Root bind:checked {name} {onCheckedChange} {disabled} {...props}>
|
|
14
32
|
{#snippet children({ checked, indeterminate })}
|
|
33
|
+
{@const on = Boolean(checked || indeterminate)}
|
|
15
34
|
<div
|
|
16
|
-
class={twMerge(
|
|
35
|
+
class={twMerge(
|
|
36
|
+
'flex shrink-0 items-center justify-center transition-colors border border-interactive shadow-input cursor-pointer',
|
|
37
|
+
config.box,
|
|
38
|
+
disabled && 'cursor-not-allowed border-transparent bg-neutral-darker shadow-none',
|
|
39
|
+
!disabled && on && 'bg-accent-inverse hover:bg-accent-inverse-hover',
|
|
40
|
+
!disabled && !on && 'bg-surface hover:border-hover',
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
17
43
|
>
|
|
18
44
|
{#if checked}
|
|
19
|
-
<Icon class=
|
|
45
|
+
<Icon class={disabled ? 'text-tertiary' : 'text-primary-inverse'} icon={Check} size={config.iconSize}/>
|
|
20
46
|
{:else if indeterminate}
|
|
21
|
-
<Icon icon={Minus} />
|
|
22
|
-
{:else}
|
|
23
|
-
<div class="h-4 w-4"></div>
|
|
47
|
+
<Icon class={disabled ? 'text-tertiary' : 'text-primary-inverse'} icon={Minus} size={config.iconSize} />
|
|
24
48
|
{/if}
|
|
25
49
|
</div>
|
|
26
50
|
{/snippet}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Checkbox, type CheckboxRootProps } from 'bits-ui';
|
|
2
|
-
export type CheckboxProps = CheckboxRootProps
|
|
3
|
-
|
|
2
|
+
export type CheckboxProps = CheckboxRootProps & {
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
};
|
|
5
|
+
declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "checked">;
|
|
4
6
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
5
7
|
export default Checkbox;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6534-8043
|
|
2
|
+
// source=src/lib/components/collapsible/index.ts
|
|
3
|
+
// component=Collapsible
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const open = instance.getEnum('open', {
|
|
7
|
+
'true': true,
|
|
8
|
+
'false': false,
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<Collapsible.Root open={${open}}>
|
|
13
|
+
<Collapsible.Trigger>Section title</Collapsible.Trigger>
|
|
14
|
+
<Collapsible.Content>
|
|
15
|
+
Section content goes here
|
|
16
|
+
</Collapsible.Content>
|
|
17
|
+
</Collapsible.Root>
|
|
18
|
+
`,
|
|
19
|
+
imports: ["import * as Collapsible from './'"],
|
|
20
|
+
id: 'collapsible',
|
|
21
|
+
};
|
|
@@ -18,12 +18,6 @@
|
|
|
18
18
|
component: ComboboxRootForMeta,
|
|
19
19
|
title: 'Components/Combobox',
|
|
20
20
|
tags: ['autodocs'],
|
|
21
|
-
parameters: {
|
|
22
|
-
design: {
|
|
23
|
-
type: 'figma',
|
|
24
|
-
url: 'https://www.figma.com/design/VHTMNdy8PAXAMx43edNZGW/%F0%9F%92%A0--Reshape-Design-System%3A-V1?node-id=9-3294&t=sCuBI8dX6K6NjNR6-0',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
21
|
});
|
|
28
22
|
|
|
29
23
|
const fruits = [
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=2103-14621
|
|
2
|
+
// source=src/lib/components/datepicker/DatePicker.svelte
|
|
3
|
+
// component=DatePicker
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
export default {
|
|
6
|
+
example: figma.code `
|
|
7
|
+
<DatePicker
|
|
8
|
+
bind:selectedDate
|
|
9
|
+
onClick={(date) => {}}
|
|
10
|
+
/>
|
|
11
|
+
`,
|
|
12
|
+
imports: ["import DatePicker from './DatePicker.svelte'"],
|
|
13
|
+
id: 'datepicker',
|
|
14
|
+
};
|
|
@@ -12,12 +12,6 @@
|
|
|
12
12
|
component: DatePicker,
|
|
13
13
|
title: 'Components/DatePicker',
|
|
14
14
|
tags: ['autodocs'],
|
|
15
|
-
parameters: {
|
|
16
|
-
design: {
|
|
17
|
-
type: 'figma',
|
|
18
|
-
url: 'https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System%3A-V1?node-id=4381-32638&t=Epi2Ul7Cw7sCJpGy-0',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
15
|
});
|
|
22
16
|
|
|
23
17
|
const staticDate = DateTime.local(2023, 10, 15);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=1264-70819
|
|
2
|
+
// source=src/lib/components/divider/Divider.svelte
|
|
3
|
+
// component=Divider
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const vertical = instance.getBoolean('vertical');
|
|
7
|
+
const inverse = instance.getBoolean('inverse');
|
|
8
|
+
export default {
|
|
9
|
+
example: figma.code `<Divider ${vertical ? 'vertical' : ''} ${inverse ? 'inverse' : ''} />`,
|
|
10
|
+
imports: ["import Divider from './Divider.svelte'"],
|
|
11
|
+
id: 'divider',
|
|
12
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6534-8055
|
|
2
|
+
// source=src/lib/components/drawer/index.ts
|
|
3
|
+
// component=Drawer
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const side = instance.getEnum('side', {
|
|
7
|
+
'left': 'left',
|
|
8
|
+
'right': 'right',
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<Drawer.Root>
|
|
13
|
+
<Drawer.Trigger>Open Drawer</Drawer.Trigger>
|
|
14
|
+
<Drawer.Portal>
|
|
15
|
+
<Drawer.Content side="${side}">
|
|
16
|
+
<Drawer.Header>
|
|
17
|
+
<Drawer.Title>Drawer title</Drawer.Title>
|
|
18
|
+
</Drawer.Header>
|
|
19
|
+
Drawer content goes here
|
|
20
|
+
</Drawer.Content>
|
|
21
|
+
</Drawer.Portal>
|
|
22
|
+
</Drawer.Root>
|
|
23
|
+
`,
|
|
24
|
+
imports: ["import * as Drawer from './'"],
|
|
25
|
+
id: 'drawer',
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3370
|
|
2
|
+
// source=src/lib/components/dropdown/index.ts
|
|
3
|
+
// component=Dropdown
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const hasSearch = instance.getBoolean('Search');
|
|
7
|
+
export default {
|
|
8
|
+
example: figma.code `
|
|
9
|
+
<Dropdown.Root>
|
|
10
|
+
<Dropdown.Trigger>Open</Dropdown.Trigger>
|
|
11
|
+
<Dropdown.Portal>
|
|
12
|
+
<Dropdown.Content>
|
|
13
|
+
${hasSearch ? figma.code `<Dropdown.SearchHeader />` : ''}
|
|
14
|
+
<Dropdown.Item onSelect={() => {}}>Item 1</Dropdown.Item>
|
|
15
|
+
<Dropdown.Item onSelect={() => {}}>Item 2</Dropdown.Item>
|
|
16
|
+
</Dropdown.Content>
|
|
17
|
+
</Dropdown.Portal>
|
|
18
|
+
</Dropdown.Root>
|
|
19
|
+
`,
|
|
20
|
+
imports: ["import * as Dropdown from './'"],
|
|
21
|
+
id: 'dropdown',
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6229-11942
|
|
2
|
+
// source=src/lib/components/empty-content/EmptyContent.svelte
|
|
3
|
+
// component=EmptyContent
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const size = instance.getEnum('size', {
|
|
7
|
+
'md': 'md',
|
|
8
|
+
'sm': 'sm',
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<EmptyContent size="${size}">
|
|
13
|
+
{#snippet icon()}<Icon icon={Database} size={32} />{/snippet}
|
|
14
|
+
<h3>No data available</h3>
|
|
15
|
+
<p>Get started by adding your first item.</p>
|
|
16
|
+
</EmptyContent>
|
|
17
|
+
`,
|
|
18
|
+
imports: ["import EmptyContent from './EmptyContent.svelte'"],
|
|
19
|
+
id: 'empty-content',
|
|
20
|
+
};
|
|
@@ -43,3 +43,46 @@
|
|
|
43
43
|
</EmptyContent>
|
|
44
44
|
</div>
|
|
45
45
|
</Story>
|
|
46
|
+
|
|
47
|
+
<Story name="Small" asChild>
|
|
48
|
+
<div class="w-full bg-surface p-12">
|
|
49
|
+
<EmptyContent size="sm">
|
|
50
|
+
{#snippet icon()}
|
|
51
|
+
<Icon color="icon-tertiary" width={32} height={32} weight="light">
|
|
52
|
+
{#snippet children(props)}
|
|
53
|
+
<MagnifyingGlass {...props} />
|
|
54
|
+
{/snippet}
|
|
55
|
+
</Icon>
|
|
56
|
+
{/snippet}
|
|
57
|
+
<h6 class="text-sm font-medium">No results found</h6>
|
|
58
|
+
<p class="text-center text-xs">Try adjusting your search.</p>
|
|
59
|
+
</EmptyContent>
|
|
60
|
+
</div>
|
|
61
|
+
</Story>
|
|
62
|
+
|
|
63
|
+
<Story name="Sizes" asChild>
|
|
64
|
+
<div class="flex w-full flex-col gap-8 bg-surface p-12">
|
|
65
|
+
<EmptyContent size="md">
|
|
66
|
+
{#snippet icon()}
|
|
67
|
+
<Icon color="icon-tertiary" width={48} height={48} weight="light">
|
|
68
|
+
{#snippet children(props)}
|
|
69
|
+
<ClockCountdown {...props} />
|
|
70
|
+
{/snippet}
|
|
71
|
+
</Icon>
|
|
72
|
+
{/snippet}
|
|
73
|
+
<h6>Medium (default)</h6>
|
|
74
|
+
<p class="text-center text-sm">Nothing has been logged for this job.</p>
|
|
75
|
+
</EmptyContent>
|
|
76
|
+
<EmptyContent size="sm">
|
|
77
|
+
{#snippet icon()}
|
|
78
|
+
<Icon color="icon-tertiary" width={32} height={32} weight="light">
|
|
79
|
+
{#snippet children(props)}
|
|
80
|
+
<ClockCountdown {...props} />
|
|
81
|
+
{/snippet}
|
|
82
|
+
</Icon>
|
|
83
|
+
{/snippet}
|
|
84
|
+
<h6 class="text-sm font-medium">Small</h6>
|
|
85
|
+
<p class="text-center text-xs">Nothing has been logged.</p>
|
|
86
|
+
</EmptyContent>
|
|
87
|
+
</div>
|
|
88
|
+
</Story>
|