@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,18 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=4822-19833
|
|
2
|
+
// source=src/lib/components/required-status-indicator/RequiredStatusIndicator.svelte
|
|
3
|
+
// component=RequiredStatusIndicator
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const type = instance.getEnum('type', {
|
|
7
|
+
'complete': 'complete',
|
|
8
|
+
'incomplete': 'incomplete',
|
|
9
|
+
'optional': 'optional',
|
|
10
|
+
});
|
|
11
|
+
// complete → currentCount >= requiredCount, incomplete → currentCount < requiredCount
|
|
12
|
+
const currentCount = type === 'complete' ? 3 : 1;
|
|
13
|
+
const requiredCount = 3;
|
|
14
|
+
export default {
|
|
15
|
+
example: figma.code `<RequiredStatusIndicator currentCount={${currentCount}} requiredCount={${requiredCount}} />`,
|
|
16
|
+
imports: ["import RequiredStatusIndicator from './RequiredStatusIndicator.svelte'"],
|
|
17
|
+
id: 'required-status-indicator',
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=4301-16461
|
|
2
|
+
// source=src/lib/components/segmented-control-buttons/SegmentedControlButtons.svelte
|
|
3
|
+
// component=SegmentedControlButtons
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'primary': 'primary',
|
|
8
|
+
'secondary': 'secondary',
|
|
9
|
+
});
|
|
10
|
+
const size = instance.getEnum('size', {
|
|
11
|
+
'lg': 'lg',
|
|
12
|
+
'md': 'md',
|
|
13
|
+
'sm': 'sm',
|
|
14
|
+
});
|
|
15
|
+
export default {
|
|
16
|
+
example: figma.code `
|
|
17
|
+
<SegmentedControlButtons variant="${variant}" size="${size}">
|
|
18
|
+
{#snippet children({ ControlButton })}
|
|
19
|
+
<ControlButton active>Option 1</ControlButton>
|
|
20
|
+
<ControlButton>Option 2</ControlButton>
|
|
21
|
+
<ControlButton>Option 3</ControlButton>
|
|
22
|
+
{/snippet}
|
|
23
|
+
</SegmentedControlButtons>
|
|
24
|
+
`,
|
|
25
|
+
imports: ["import SegmentedControlButtons from './SegmentedControlButtons.svelte'"],
|
|
26
|
+
id: 'segmented-control-buttons',
|
|
27
|
+
};
|
|
@@ -65,6 +65,16 @@
|
|
|
65
65
|
{/snippet}
|
|
66
66
|
</SegmentedControlButtons>
|
|
67
67
|
</Story>
|
|
68
|
+
<Story name="Small" asChild>
|
|
69
|
+
<SegmentedControlButtons size="sm" class="w-[350px]">
|
|
70
|
+
{#snippet children({ ControlButton })}
|
|
71
|
+
<ControlButton active>Low</ControlButton>
|
|
72
|
+
<ControlButton>Medium</ControlButton>
|
|
73
|
+
<ControlButton>High</ControlButton>
|
|
74
|
+
{/snippet}
|
|
75
|
+
</SegmentedControlButtons>
|
|
76
|
+
</Story>
|
|
77
|
+
|
|
68
78
|
<Story name="Secondary" asChild>
|
|
69
79
|
<SegmentedControlButtons class="w-[350px]">
|
|
70
80
|
{#snippet children({ ControlButton })}
|
|
@@ -92,3 +102,22 @@
|
|
|
92
102
|
{/snippet}
|
|
93
103
|
</SegmentedControlButtons>
|
|
94
104
|
</Story>
|
|
105
|
+
|
|
106
|
+
<Story name="Variant Prop" asChild>
|
|
107
|
+
<div class="flex flex-col gap-4">
|
|
108
|
+
<SegmentedControlButtons variant="primary" class="w-[350px]">
|
|
109
|
+
{#snippet children({ ControlButton, variant })}
|
|
110
|
+
<ControlButton active color={variant}>Primary active</ControlButton>
|
|
111
|
+
<ControlButton color={variant}>Primary</ControlButton>
|
|
112
|
+
<ControlButton color={variant}>Primary</ControlButton>
|
|
113
|
+
{/snippet}
|
|
114
|
+
</SegmentedControlButtons>
|
|
115
|
+
<SegmentedControlButtons variant="secondary" class="w-[350px]">
|
|
116
|
+
{#snippet children({ ControlButton, variant })}
|
|
117
|
+
<ControlButton active color={variant}>Secondary active</ControlButton>
|
|
118
|
+
<ControlButton color={variant}>Secondary</ControlButton>
|
|
119
|
+
<ControlButton color={variant}>Secondary</ControlButton>
|
|
120
|
+
{/snippet}
|
|
121
|
+
</SegmentedControlButtons>
|
|
122
|
+
</div>
|
|
123
|
+
</Story>
|
|
@@ -5,18 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
class?: string;
|
|
8
|
-
size?: 'md' | 'lg';
|
|
9
|
-
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
variant?: 'primary' | 'secondary';
|
|
10
|
+
children?: Snippet<[{ ControlButton: typeof ControlButton; variant: 'primary' | 'secondary' }]>;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
let { class: className = '', size = 'md', children }: Props = $props();
|
|
13
|
+
let { class: className = '', size = 'md', variant = 'primary', children }: Props = $props();
|
|
13
14
|
|
|
14
15
|
const sizes = {
|
|
15
|
-
|
|
16
|
+
sm: 'h-8',
|
|
17
|
+
md: 'h-10',
|
|
16
18
|
lg: 'h-16 [&>*>.control-button]:flex-col',
|
|
17
19
|
};
|
|
18
20
|
</script>
|
|
19
21
|
|
|
20
|
-
<div class={twMerge('join flex gap-1 rounded-lg bg-neutral p-1', sizes[size],
|
|
21
|
-
{@render children?.({ ControlButton })}
|
|
22
|
+
<div class={twMerge('join flex gap-1 rounded-lg bg-neutral p-1', sizes[size], className)}>
|
|
23
|
+
{@render children?.({ ControlButton, variant })}
|
|
22
24
|
</div>
|
|
@@ -2,9 +2,11 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import ControlButton from './ControlButton.svelte';
|
|
3
3
|
interface Props {
|
|
4
4
|
class?: string;
|
|
5
|
-
size?: 'md' | 'lg';
|
|
5
|
+
size?: 'sm' | 'md' | 'lg';
|
|
6
|
+
variant?: 'primary' | 'secondary';
|
|
6
7
|
children?: Snippet<[{
|
|
7
8
|
ControlButton: typeof ControlButton;
|
|
9
|
+
variant: 'primary' | 'secondary';
|
|
8
10
|
}]>;
|
|
9
11
|
}
|
|
10
12
|
declare const SegmentedControlButtons: import("svelte").Component<Props, {}, "">;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3298
|
|
2
|
+
// source=src/lib/components/select/index.ts
|
|
3
|
+
// component=Select
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
export default {
|
|
6
|
+
example: figma.code `
|
|
7
|
+
<Select.Root>
|
|
8
|
+
<Select.Trigger placeholder="Select an option..." />
|
|
9
|
+
<Select.Content>
|
|
10
|
+
<Select.Item value="option1">Option 1</Select.Item>
|
|
11
|
+
<Select.Item value="option2">Option 2</Select.Item>
|
|
12
|
+
</Select.Content>
|
|
13
|
+
</Select.Root>
|
|
14
|
+
`,
|
|
15
|
+
imports: ["import * as Select from './'"],
|
|
16
|
+
id: 'select',
|
|
17
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6531-8046
|
|
2
|
+
// source=src/lib/components/skeleton-loader/SkeletonLoader.svelte
|
|
3
|
+
// component=SkeletonLoader
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
export default {
|
|
6
|
+
example: figma.code `
|
|
7
|
+
<SkeletonLoader>
|
|
8
|
+
{#snippet children({ Skeleton })}
|
|
9
|
+
<Skeleton class="h-4 w-full rounded" />
|
|
10
|
+
<Skeleton class="h-4 w-3/4 rounded" />
|
|
11
|
+
{/snippet}
|
|
12
|
+
</SkeletonLoader>
|
|
13
|
+
`,
|
|
14
|
+
imports: ["import SkeletonLoader from './SkeletonLoader.svelte'"],
|
|
15
|
+
id: 'skeleton-loader',
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=1264-70678
|
|
2
|
+
// source=src/lib/components/slider/Slider.svelte
|
|
3
|
+
// component=Slider
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const disabled = instance.getBoolean('disabled');
|
|
7
|
+
const showSteps = instance.getBoolean('Steps');
|
|
8
|
+
export default {
|
|
9
|
+
example: figma.code `<Slider value={50} max={100} ${disabled ? 'disabled' : ''} ${showSteps ? 'showSteps' : ''} />`,
|
|
10
|
+
imports: ["import Slider from './Slider.svelte'"],
|
|
11
|
+
id: 'slider',
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6531-8044
|
|
2
|
+
// source=src/lib/components/spinner/Spinner.svelte
|
|
3
|
+
// component=Spinner
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const inverted = instance.getBoolean('inverted');
|
|
7
|
+
export default {
|
|
8
|
+
example: figma.code `<Spinner ${inverted ? 'inverted' : ''} />`,
|
|
9
|
+
imports: ["import Spinner from './Spinner.svelte'"],
|
|
10
|
+
id: 'spinner',
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=2120-12015
|
|
2
|
+
// source=src/lib/components/stat-card/StatCard.svelte
|
|
3
|
+
// component=StatCard
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'primary': 'primary',
|
|
8
|
+
'secondary': 'secondary',
|
|
9
|
+
});
|
|
10
|
+
const size = instance.getEnum('size', {
|
|
11
|
+
'md': 'md',
|
|
12
|
+
'sm': 'sm',
|
|
13
|
+
});
|
|
14
|
+
export default {
|
|
15
|
+
example: figma.code `<StatCard title="Metric" value={42} variant="${variant}" size="${size}" />`,
|
|
16
|
+
imports: ["import StatCard from './StatCard.svelte'"],
|
|
17
|
+
id: 'stat-card',
|
|
18
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=627-8319
|
|
2
|
+
// source=src/lib/components/status-badge/StatusBadge.svelte
|
|
3
|
+
// component=StatusBadge
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const type = instance.getEnum('type', {
|
|
7
|
+
'success': 'success',
|
|
8
|
+
'error': 'error',
|
|
9
|
+
'neutral': 'neutral',
|
|
10
|
+
'progress': 'progress',
|
|
11
|
+
'warning': 'warning',
|
|
12
|
+
});
|
|
13
|
+
const size = instance.getEnum('size', {
|
|
14
|
+
'sm': 'sm',
|
|
15
|
+
'md': 'md',
|
|
16
|
+
});
|
|
17
|
+
const iconOnly = instance.getEnum('iconOnly', {
|
|
18
|
+
'true': true,
|
|
19
|
+
'false': false,
|
|
20
|
+
});
|
|
21
|
+
export default {
|
|
22
|
+
example: figma.code `
|
|
23
|
+
<StatusBadge type="${type}" size="${size}" ${iconOnly ? 'iconOnly' : ''}>
|
|
24
|
+
{#snippet content()}Status{/snippet}
|
|
25
|
+
</StatusBadge>
|
|
26
|
+
`,
|
|
27
|
+
imports: ["import StatusBadge from './StatusBadge.svelte'"],
|
|
28
|
+
id: 'status-badge',
|
|
29
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=5050-66266
|
|
2
|
+
// source=src/lib/components/stepper/index.ts
|
|
3
|
+
// component=Stepper
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
export default {
|
|
6
|
+
example: figma.code `
|
|
7
|
+
<Stepper.Root currentStep="2">
|
|
8
|
+
<Stepper.Step stepNumber="1" state="completed">Step 1</Stepper.Step>
|
|
9
|
+
<Stepper.Step stepNumber="2" state="active">Step 2</Stepper.Step>
|
|
10
|
+
<Stepper.Step stepNumber="3" state="future">Step 3</Stepper.Step>
|
|
11
|
+
</Stepper.Root>
|
|
12
|
+
`,
|
|
13
|
+
imports: ["import * as Stepper from './'"],
|
|
14
|
+
id: 'stepper',
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=20-5441
|
|
2
|
+
// source=src/lib/components/table/Table.svelte
|
|
3
|
+
// component=Table
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
export default {
|
|
6
|
+
example: figma.code `
|
|
7
|
+
<Table>
|
|
8
|
+
{#snippet children({ THead, TBody, Tr, Th, Td })}
|
|
9
|
+
<THead>
|
|
10
|
+
<Tr>
|
|
11
|
+
<Th>Column A</Th>
|
|
12
|
+
<Th>Column B</Th>
|
|
13
|
+
</Tr>
|
|
14
|
+
</THead>
|
|
15
|
+
<TBody>
|
|
16
|
+
<Tr>
|
|
17
|
+
<Td>Cell A1</Td>
|
|
18
|
+
<Td>Cell B1</Td>
|
|
19
|
+
</Tr>
|
|
20
|
+
</TBody>
|
|
21
|
+
{/snippet}
|
|
22
|
+
</Table>
|
|
23
|
+
`,
|
|
24
|
+
imports: ["import { Table } from './'"],
|
|
25
|
+
id: 'table',
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3473
|
|
2
|
+
// source=src/lib/components/tabs/Tabs.svelte
|
|
3
|
+
// component=TabsRoot
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const active = instance.getEnum('state', {
|
|
7
|
+
'active': true,
|
|
8
|
+
'default': false,
|
|
9
|
+
'hover': false,
|
|
10
|
+
});
|
|
11
|
+
export default {
|
|
12
|
+
example: figma.code `
|
|
13
|
+
<TabsRoot>
|
|
14
|
+
{#snippet children({ Tabs, Tab, Content })}
|
|
15
|
+
<Tabs>
|
|
16
|
+
<Tab ${active ? 'active' : ''}>Tab Label</Tab>
|
|
17
|
+
</Tabs>
|
|
18
|
+
<Content>Tab content</Content>
|
|
19
|
+
{/snippet}
|
|
20
|
+
</TabsRoot>
|
|
21
|
+
`,
|
|
22
|
+
imports: ["import TabsRoot from './Tabs.svelte'"],
|
|
23
|
+
id: 'tabs',
|
|
24
|
+
};
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
let activeTabSecondary = 'tab-1';
|
|
21
21
|
let activeTabTransparent = 'tab-1';
|
|
22
22
|
let activeTabSizes = 'tab-1';
|
|
23
|
+
let activeTabSquare = 'tab-1';
|
|
23
24
|
</script>
|
|
24
25
|
|
|
25
26
|
<Story name="Primary Variant" asChild>
|
|
@@ -158,3 +159,25 @@
|
|
|
158
159
|
</div>
|
|
159
160
|
</div>
|
|
160
161
|
</Story>
|
|
162
|
+
|
|
163
|
+
<Story name="Square Style" asChild>
|
|
164
|
+
<Tabs>
|
|
165
|
+
{#snippet children({ Tabs, Tab, Content })}
|
|
166
|
+
<Tabs variant="primary" style="square">
|
|
167
|
+
<Tab active={activeTabSquare === 'tab-1'} onclick={() => (activeTabSquare = 'tab-1')}
|
|
168
|
+
>Tab 1</Tab
|
|
169
|
+
>
|
|
170
|
+
<Tab active={activeTabSquare === 'tab-2'} onclick={() => (activeTabSquare = 'tab-2')}
|
|
171
|
+
>Tab 2</Tab
|
|
172
|
+
>
|
|
173
|
+
<Tab active={activeTabSquare === 'tab-3'} onclick={() => (activeTabSquare = 'tab-3')}
|
|
174
|
+
>Tab 3</Tab
|
|
175
|
+
>
|
|
176
|
+
</Tabs>
|
|
177
|
+
|
|
178
|
+
<Content show={activeTabSquare === 'tab-1'}>Showing square tab 1 content</Content>
|
|
179
|
+
<Content show={activeTabSquare === 'tab-2'}>Showing square tab 2 content</Content>
|
|
180
|
+
<Content show={activeTabSquare === 'tab-3'}>Showing square tab 3 content</Content>
|
|
181
|
+
{/snippet}
|
|
182
|
+
</Tabs>
|
|
183
|
+
</Story>
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
type Size = 'sm' | 'md' | 'lg';
|
|
6
6
|
type Variant = 'primary' | 'secondary' | 'transparent';
|
|
7
|
+
type Style = 'rounded' | 'square';
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
class?: string;
|
|
10
11
|
size?: Size;
|
|
11
12
|
variant?: Variant;
|
|
12
13
|
fullWidth?: boolean;
|
|
14
|
+
style?: Style;
|
|
13
15
|
children?: Snippet<[{ variant: Variant }]>;
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -18,6 +20,7 @@
|
|
|
18
20
|
size = 'lg',
|
|
19
21
|
variant = 'primary',
|
|
20
22
|
fullWidth = true,
|
|
23
|
+
style = 'rounded',
|
|
21
24
|
children,
|
|
22
25
|
}: Props = $props();
|
|
23
26
|
|
|
@@ -26,11 +29,13 @@
|
|
|
26
29
|
md: 'h-10 p-1 gap-1 rounded-[10px] [&>*]:rounded-md!',
|
|
27
30
|
lg: 'h-12 p-1 gap-1 rounded-xl',
|
|
28
31
|
};
|
|
32
|
+
|
|
33
|
+
const squareClass = $derived(style === 'square' ? 'rounded-none! [&>*]:rounded-none!' : '');
|
|
29
34
|
</script>
|
|
30
35
|
|
|
31
36
|
<div
|
|
32
37
|
role="tablist"
|
|
33
|
-
class={twMerge('flex', sizes[size], variant, fullWidth ? 'w-full [&>*]:flex-1' : 'w-fit [&>*]:flex-none', className)}
|
|
38
|
+
class={twMerge('flex', sizes[size], variant, fullWidth ? 'w-full [&>*]:flex-1' : 'w-fit [&>*]:flex-none', squareClass, className)}
|
|
34
39
|
>
|
|
35
40
|
{@render children?.({ variant })}
|
|
36
41
|
</div>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
type Size = 'sm' | 'md' | 'lg';
|
|
3
3
|
type Variant = 'primary' | 'secondary' | 'transparent';
|
|
4
|
+
type Style = 'rounded' | 'square';
|
|
4
5
|
interface Props {
|
|
5
6
|
class?: string;
|
|
6
7
|
size?: Size;
|
|
7
8
|
variant?: Variant;
|
|
8
9
|
fullWidth?: boolean;
|
|
10
|
+
style?: Style;
|
|
9
11
|
children?: Snippet<[{
|
|
10
12
|
variant: Variant;
|
|
11
13
|
}]>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3311
|
|
2
|
+
// source=src/lib/components/tag/Tag.svelte
|
|
3
|
+
// component=Tag
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'default': 'default',
|
|
8
|
+
'outline': 'outline',
|
|
9
|
+
'transparent': 'transparent',
|
|
10
|
+
});
|
|
11
|
+
const color = instance.getEnum('color', {
|
|
12
|
+
'blue': 'blue',
|
|
13
|
+
'lilac': 'lilac',
|
|
14
|
+
'lime': 'lime',
|
|
15
|
+
'orange': 'orange',
|
|
16
|
+
'pear': 'pear',
|
|
17
|
+
'pink': 'pink',
|
|
18
|
+
'sky': 'sky',
|
|
19
|
+
'default': 'default',
|
|
20
|
+
});
|
|
21
|
+
const size = instance.getEnum('size', {
|
|
22
|
+
'xs': 'xs',
|
|
23
|
+
'sm': 'sm',
|
|
24
|
+
'md': 'md',
|
|
25
|
+
});
|
|
26
|
+
const text = instance.getString('Text');
|
|
27
|
+
// When color is set, use color as variant; otherwise use the style variant
|
|
28
|
+
const resolvedVariant = color !== 'default' ? color : variant;
|
|
29
|
+
export default {
|
|
30
|
+
example: figma.code `<Tag variant="${resolvedVariant}" size="${size}">${text || 'Tag'}</Tag>`,
|
|
31
|
+
imports: ["import Tag from './Tag.svelte'"],
|
|
32
|
+
id: 'tag',
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=9-3173
|
|
2
|
+
// source=src/lib/components/textarea/Textarea.svelte
|
|
3
|
+
// component=Textarea
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const size = instance.getEnum('size', {
|
|
7
|
+
'xs': 'xs',
|
|
8
|
+
'sm': 'sm',
|
|
9
|
+
'md': 'md',
|
|
10
|
+
'lg': 'lg',
|
|
11
|
+
});
|
|
12
|
+
const placeholder = instance.getString('placeholder');
|
|
13
|
+
export default {
|
|
14
|
+
example: figma.code `<Textarea size="${size}" placeholder="${placeholder || 'Enter text...'}" />`,
|
|
15
|
+
imports: ["import Textarea from './Textarea.svelte'"],
|
|
16
|
+
id: 'textarea',
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=2086-4597
|
|
2
|
+
// source=src/lib/components/toast/Toast.svelte
|
|
3
|
+
// component=Toast
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const type = instance.getEnum('type', {
|
|
7
|
+
'neutral': 'default',
|
|
8
|
+
'danger': 'danger',
|
|
9
|
+
'info': 'info',
|
|
10
|
+
'success': 'success',
|
|
11
|
+
'warning': 'warning',
|
|
12
|
+
});
|
|
13
|
+
export default {
|
|
14
|
+
example: figma.code `<Toast notification={{ id: '1', type: "${type}", message: 'Notification message', dismissable: true }} />`,
|
|
15
|
+
imports: ["import Toast from './Toast.svelte'"],
|
|
16
|
+
id: 'toast',
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=389-7679
|
|
2
|
+
// source=src/lib/components/toggle/Toggle.svelte
|
|
3
|
+
// component=Toggle
|
|
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('Checked', {
|
|
16
|
+
'true': true,
|
|
17
|
+
'false': false,
|
|
18
|
+
});
|
|
19
|
+
export default {
|
|
20
|
+
example: figma.code `<Toggle id="toggle-id" size="${size}" value={${checked}} ${disabled ? 'disabled' : ''} />`,
|
|
21
|
+
imports: ["import Toggle from './Toggle.svelte'"],
|
|
22
|
+
id: 'toggle',
|
|
23
|
+
};
|