@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
|
@@ -4,13 +4,22 @@
|
|
|
4
4
|
type Props = {
|
|
5
5
|
icon: Snippet;
|
|
6
6
|
children: Snippet;
|
|
7
|
+
size?: 'sm' | 'md';
|
|
7
8
|
};
|
|
8
9
|
|
|
9
|
-
const { icon, children }: Props = $props();
|
|
10
|
+
const { icon, children, size = 'md' }: Props = $props();
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
13
|
<div class="flex w-full justify-center">
|
|
13
|
-
<div
|
|
14
|
+
<div
|
|
15
|
+
class="flex flex-col items-center justify-center text-tertiary"
|
|
16
|
+
class:max-w-96={size === 'md'}
|
|
17
|
+
class:max-w-64={size === 'sm'}
|
|
18
|
+
class:gap-5={size === 'md'}
|
|
19
|
+
class:gap-3={size === 'sm'}
|
|
20
|
+
class:py-5={size === 'md'}
|
|
21
|
+
class:py-3={size === 'sm'}
|
|
22
|
+
>
|
|
14
23
|
{@render icon()}
|
|
15
24
|
<div class="flex w-full flex-col items-center justify-center gap-2 text-center">
|
|
16
25
|
{@render children()}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6404-29645
|
|
2
|
+
// source=src/lib/components/icon-button/IconButton.svelte
|
|
3
|
+
// component=IconButton
|
|
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', {
|
|
22
|
+
'true': true,
|
|
23
|
+
'false': false,
|
|
24
|
+
});
|
|
25
|
+
const disabled = instance.getEnum('disabled', {
|
|
26
|
+
'true': true,
|
|
27
|
+
'false': false,
|
|
28
|
+
});
|
|
29
|
+
const iconInstance = instance.getInstanceSwap('Icon');
|
|
30
|
+
let iconSnippet;
|
|
31
|
+
if (iconInstance && iconInstance.type === 'INSTANCE' && iconInstance.hasCodeConnect()) {
|
|
32
|
+
iconSnippet = iconInstance.executeTemplate().example;
|
|
33
|
+
}
|
|
34
|
+
export default {
|
|
35
|
+
example: figma.code `
|
|
36
|
+
<IconButton variant="${variant}" size="${size}" ${rounded ? 'rounded' : 'rounded={false}'} ${disabled ? 'disabled' : ''}>
|
|
37
|
+
${iconSnippet ? figma.code `${iconSnippet}` : '<Icon icon={Plus} />'}
|
|
38
|
+
</IconButton>
|
|
39
|
+
`,
|
|
40
|
+
imports: ["import IconButton from './IconButton.svelte'"],
|
|
41
|
+
id: 'icon-button',
|
|
42
|
+
};
|
|
@@ -7,12 +7,6 @@
|
|
|
7
7
|
component: Icon,
|
|
8
8
|
title: 'Components/Icons',
|
|
9
9
|
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
design: {
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%5BWIP%5D--Reshape-Design-System%3A-V1.1?node-id=20-30983&t=qQZtfqCN4P2k2UYf-0',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
10
|
});
|
|
17
11
|
</script>
|
|
18
12
|
|
|
@@ -0,0 +1,23 @@
|
|
|
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/input/Input.svelte
|
|
3
|
+
// component=Input
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'primary': 'primary',
|
|
8
|
+
'secondary': 'secondary',
|
|
9
|
+
'transparent': 'transparent',
|
|
10
|
+
'borderless': 'borderless',
|
|
11
|
+
});
|
|
12
|
+
const size = instance.getEnum('size', {
|
|
13
|
+
'xs': 'xs',
|
|
14
|
+
'sm': 'sm',
|
|
15
|
+
'md': 'md',
|
|
16
|
+
'lg': 'lg',
|
|
17
|
+
});
|
|
18
|
+
const placeholder = instance.getString('placeholder');
|
|
19
|
+
export default {
|
|
20
|
+
example: figma.code `<Input variant="${variant}" size="${size}" placeholder="${placeholder || 'Enter text...'}" />`,
|
|
21
|
+
imports: ["import Input from './Input.svelte'"],
|
|
22
|
+
id: 'input',
|
|
23
|
+
};
|
|
@@ -12,12 +12,6 @@
|
|
|
12
12
|
component: Input,
|
|
13
13
|
title: 'Components/Input',
|
|
14
14
|
tags: ['autodocs'],
|
|
15
|
-
parameters: {
|
|
16
|
-
design: {
|
|
17
|
-
type: 'figma',
|
|
18
|
-
url: 'https://www.figma.com/design/VHTMNdy8PAXAMx43edNZGW/%F0%9F%92%A0--Reshape-Design-System%3A-V1?node-id=9-3169&t=sCuBI8dX6K6NjNR6-0',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
15
|
});
|
|
22
16
|
|
|
23
17
|
let value = '';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6531-8038
|
|
2
|
+
// source=src/lib/components/label/Label.svelte
|
|
3
|
+
// component=Label
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const required = instance.getBoolean('required');
|
|
7
|
+
const labelText = instance.findText('Label');
|
|
8
|
+
export default {
|
|
9
|
+
example: figma.code `<Label forId="field-id" text="${labelText ? labelText.textContent : 'Label'}" ${required ? 'required' : ''} />`,
|
|
10
|
+
imports: ["import Label from './Label.svelte'"],
|
|
11
|
+
id: 'label',
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=5754-37765
|
|
2
|
+
// source=src/lib/components/legend/index.ts
|
|
3
|
+
// component=Legend
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
export default {
|
|
6
|
+
example: figma.code `
|
|
7
|
+
<Legend.Root>
|
|
8
|
+
<Legend.Item color="#4F46E5" name="Series A" />
|
|
9
|
+
<Legend.Item color="#10B981" name="Series B" />
|
|
10
|
+
</Legend.Root>
|
|
11
|
+
`,
|
|
12
|
+
imports: ["import * as Legend from './'"],
|
|
13
|
+
id: 'legend',
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6533-8047
|
|
2
|
+
// source=src/lib/components/list/List.svelte
|
|
3
|
+
// component=List
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'default': 'default',
|
|
8
|
+
'compact': 'compact',
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<List
|
|
13
|
+
items={['Item 1', 'Item 2', 'Item 3']}
|
|
14
|
+
variant="${variant}"
|
|
15
|
+
>
|
|
16
|
+
{#snippet item(value)}
|
|
17
|
+
{value}
|
|
18
|
+
{/snippet}
|
|
19
|
+
</List>
|
|
20
|
+
`,
|
|
21
|
+
imports: ["import List from './List.svelte'"],
|
|
22
|
+
id: 'list',
|
|
23
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=433-11089
|
|
2
|
+
// source=src/lib/components/logo/Logo.svelte
|
|
3
|
+
// component=Logo
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'horizontal': 'horizontal',
|
|
8
|
+
'logomark': 'logomark',
|
|
9
|
+
});
|
|
10
|
+
const size = instance.getEnum('size', {
|
|
11
|
+
'xs': 'xs',
|
|
12
|
+
'sm': 'sm',
|
|
13
|
+
'md': 'md',
|
|
14
|
+
'lg': 'lg',
|
|
15
|
+
'xl': 'xl',
|
|
16
|
+
});
|
|
17
|
+
export default {
|
|
18
|
+
example: figma.code `<Logo variant="${variant}" size="${size}" />`,
|
|
19
|
+
imports: ["import Logo from './Logo.svelte'"],
|
|
20
|
+
id: 'logo',
|
|
21
|
+
};
|
|
@@ -19,3 +19,20 @@
|
|
|
19
19
|
<Logo size="xl" />
|
|
20
20
|
</div>
|
|
21
21
|
</Story>
|
|
22
|
+
|
|
23
|
+
<Story name="Horizontal" asChild>
|
|
24
|
+
<div class="flex flex-col gap-4">
|
|
25
|
+
<Logo variant="horizontal" size="xs" />
|
|
26
|
+
<Logo variant="horizontal" size="sm" />
|
|
27
|
+
<Logo variant="horizontal" size="md" />
|
|
28
|
+
<Logo variant="horizontal" size="lg" />
|
|
29
|
+
<Logo variant="horizontal" size="xl" />
|
|
30
|
+
</div>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="White" asChild>
|
|
34
|
+
<div class="flex flex-col gap-4 bg-gray-900 p-4">
|
|
35
|
+
<Logo color="white" />
|
|
36
|
+
<Logo variant="horizontal" color="white" />
|
|
37
|
+
</div>
|
|
38
|
+
</Story>
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
type Props = {
|
|
3
3
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
color?: 'default' | 'white';
|
|
5
|
+
variant?: 'logomark' | 'horizontal';
|
|
5
6
|
};
|
|
6
7
|
|
|
7
|
-
let { size = 'md', color = 'default' }: Props = $props();
|
|
8
|
+
let { size = 'md', color = 'default', variant = 'logomark' }: Props = $props();
|
|
8
9
|
|
|
9
10
|
const colorMap = {
|
|
10
11
|
default: '#ff7a00',
|
|
@@ -18,22 +19,47 @@
|
|
|
18
19
|
lg: 32,
|
|
19
20
|
xl: 40,
|
|
20
21
|
};
|
|
22
|
+
|
|
23
|
+
const textSizeMap = {
|
|
24
|
+
xs: 11,
|
|
25
|
+
sm: 14,
|
|
26
|
+
md: 17,
|
|
27
|
+
lg: 22,
|
|
28
|
+
xl: 28,
|
|
29
|
+
};
|
|
21
30
|
</script>
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
{#snippet logomark()}
|
|
33
|
+
<svg
|
|
34
|
+
width={sizeMap[size]}
|
|
35
|
+
height={sizeMap[size]}
|
|
36
|
+
viewBox="0 0 24 24"
|
|
37
|
+
fill={colorMap[color]}
|
|
38
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
39
|
+
>
|
|
40
|
+
<path
|
|
41
|
+
d="M5.25 10.5C2.3511 10.5 0 8.1489 0 5.25C0 2.3511 2.3511 0 5.25 0C8.1489 0 10.5 2.3511 10.5 5.25C10.5034 8.1489 8.1523 10.5 5.25 10.5Z"
|
|
42
|
+
/>
|
|
43
|
+
<path
|
|
44
|
+
d="M18.75 10.5C15.8511 10.5 13.5 8.1489 13.5 5.25C13.5 2.3511 15.8511 0 18.75 0C21.6489 0 24 2.3511 24 5.25C24.0034 8.1489 21.6523 10.5 18.75 10.5Z"
|
|
45
|
+
/>
|
|
46
|
+
<path
|
|
47
|
+
d="M0 18.75C0 15.8511 2.3511 13.5 5.25 13.5C8.1489 13.5 10.5 15.8511 10.5 18.75C10.5 21.6489 8.1489 24 5.25 24C2.3511 24 0 21.6489 0 18.75Z"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
{/snippet}
|
|
51
|
+
|
|
52
|
+
{#if variant === 'horizontal'}
|
|
53
|
+
<div class="flex items-center gap-2">
|
|
54
|
+
{@render logomark()}
|
|
55
|
+
<span
|
|
56
|
+
style:color={colorMap[color]}
|
|
57
|
+
style:font-size="{textSizeMap[size]}px"
|
|
58
|
+
style:font-weight="600"
|
|
59
|
+
style:letter-spacing="-0.02em"
|
|
60
|
+
style:line-height="1"
|
|
61
|
+
>reshape</span>
|
|
62
|
+
</div>
|
|
63
|
+
{:else}
|
|
64
|
+
{@render logomark()}
|
|
65
|
+
{/if}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6533-8072
|
|
2
|
+
// source=src/lib/components/markdown/Markdown.svelte
|
|
3
|
+
// component=Markdown
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'light': 'light',
|
|
8
|
+
'dark': 'dark',
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `<Markdown markdown="# Hello\n\nThis is **markdown** content." variant="${variant}" />`,
|
|
12
|
+
imports: ["import Markdown from './Markdown.svelte'"],
|
|
13
|
+
id: 'markdown',
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=4320-13114
|
|
2
|
+
// source=src/lib/components/modal/index.ts
|
|
3
|
+
// component=Modal
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const variant = instance.getEnum('variant', {
|
|
7
|
+
'default': 'default',
|
|
8
|
+
'alert': 'alert',
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<Modal.Root>
|
|
13
|
+
<Modal.Trigger>Open Modal</Modal.Trigger>
|
|
14
|
+
<Modal.Portal>
|
|
15
|
+
<Modal.Overlay />
|
|
16
|
+
<Modal.Content>
|
|
17
|
+
<Modal.Title>Modal title</Modal.Title>
|
|
18
|
+
<Modal.Description>Modal description</Modal.Description>
|
|
19
|
+
<Modal.ScrollContent>
|
|
20
|
+
Modal content goes here
|
|
21
|
+
</Modal.ScrollContent>
|
|
22
|
+
<Modal.Bottom>
|
|
23
|
+
<Modal.Close>Close</Modal.Close>
|
|
24
|
+
</Modal.Bottom>
|
|
25
|
+
</Modal.Content>
|
|
26
|
+
</Modal.Portal>
|
|
27
|
+
</Modal.Root>
|
|
28
|
+
`,
|
|
29
|
+
imports: ["import * as Modal from './'"],
|
|
30
|
+
id: 'modal',
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=2248-7404
|
|
2
|
+
// source=src/lib/components/nav/Nav.svelte
|
|
3
|
+
// component=Nav
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const collapsed = instance.getEnum('collapsed', {
|
|
7
|
+
'true': true,
|
|
8
|
+
'false': false,
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<Nav company="Acme" defaultCollapsed={${collapsed}}>
|
|
13
|
+
{#snippet main({ NavItem, NavItemGroup, collapsed })}
|
|
14
|
+
<NavItem href="/home">Home</NavItem>
|
|
15
|
+
<NavItem href="/settings">Settings</NavItem>
|
|
16
|
+
{/snippet}
|
|
17
|
+
</Nav>
|
|
18
|
+
`,
|
|
19
|
+
imports: ["import Nav from './Nav.svelte'"],
|
|
20
|
+
id: 'nav',
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6534-8057
|
|
2
|
+
// source=src/lib/components/notification-popup/NotificationPopup.svelte
|
|
3
|
+
// component=NotificationPopup
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const title = instance.findText('Notification title');
|
|
7
|
+
export default {
|
|
8
|
+
example: figma.code `
|
|
9
|
+
<NotificationPopup
|
|
10
|
+
title="${title ? title.textContent : 'Notification'}"
|
|
11
|
+
visible={true}
|
|
12
|
+
onClose={() => {}}
|
|
13
|
+
>
|
|
14
|
+
Notification message content
|
|
15
|
+
</NotificationPopup>
|
|
16
|
+
`,
|
|
17
|
+
imports: ["import NotificationPopup from './NotificationPopup.svelte'"],
|
|
18
|
+
id: 'notification-popup',
|
|
19
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=6534-8069
|
|
2
|
+
// source=src/lib/components/notifications/Notifications.svelte
|
|
3
|
+
// component=Notifications
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const type = instance.getEnum('type', {
|
|
7
|
+
'default': 'default',
|
|
8
|
+
'danger': 'danger',
|
|
9
|
+
});
|
|
10
|
+
export default {
|
|
11
|
+
example: figma.code `
|
|
12
|
+
<!-- Add once to your app layout -->
|
|
13
|
+
<Notifications />
|
|
14
|
+
|
|
15
|
+
<!-- Then trigger notifications via the store -->
|
|
16
|
+
<script>
|
|
17
|
+
import { notifications } from '../../notifications'
|
|
18
|
+
notifications.add({ type: "${type}", message: "Notification message" })
|
|
19
|
+
</script>
|
|
20
|
+
`,
|
|
21
|
+
imports: [
|
|
22
|
+
"import Notifications from './Notifications.svelte'",
|
|
23
|
+
"import { notifications } from '../../notifications'",
|
|
24
|
+
],
|
|
25
|
+
id: 'notifications',
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=331-6870
|
|
2
|
+
// source=src/lib/components/pill/Pill.svelte
|
|
3
|
+
// component=Pill
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const text = instance.findText('input');
|
|
7
|
+
export default {
|
|
8
|
+
example: figma.code `<Pill text="${text ? text.textContent : 'Label'}" onclick={() => {}} />`,
|
|
9
|
+
imports: ["import Pill from './Pill.svelte'"],
|
|
10
|
+
id: 'pill',
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/WkxhG4H2Ybc7STFi1VJIau/%F0%9F%92%A0-Reshape-Design-System--V1?node-id=764-12352
|
|
2
|
+
// source=src/lib/components/progress-circle/ProgressCircle.svelte
|
|
3
|
+
// component=ProgressCircle
|
|
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
|
+
export default {
|
|
12
|
+
example: figma.code `<ProgressCircle progress={75} size="${size}" />`,
|
|
13
|
+
imports: ["import ProgressCircle from './ProgressCircle.svelte'"],
|
|
14
|
+
id: 'progress-circle',
|
|
15
|
+
};
|
|
@@ -13,3 +13,15 @@
|
|
|
13
13
|
<Story name="Base" args={{ progress: 20 }} />
|
|
14
14
|
|
|
15
15
|
<Story name="Small" args={{ progress: 20, size: 'sm' }} />
|
|
16
|
+
|
|
17
|
+
<Story name="Medium" args={{ progress: 20, size: 'md' }} />
|
|
18
|
+
|
|
19
|
+
<Story name="Large" args={{ progress: 20, size: 'lg' }} />
|
|
20
|
+
|
|
21
|
+
<Story name="Sizes" asChild>
|
|
22
|
+
<div class="flex items-center gap-4">
|
|
23
|
+
<ProgressCircle progress={60} size="sm" />
|
|
24
|
+
<ProgressCircle progress={60} size="md" />
|
|
25
|
+
<ProgressCircle progress={60} size="lg" />
|
|
26
|
+
</div>
|
|
27
|
+
</Story>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
// Make sure progress is between 0 and 100 and round down to the nearest 10 if over 90
|
|
3
2
|
$effect(() => {
|
|
4
3
|
progress =
|
|
5
4
|
progress > 90
|
|
@@ -9,21 +8,27 @@
|
|
|
9
8
|
|
|
10
9
|
type Props = {
|
|
11
10
|
progress: number;
|
|
12
|
-
size?: 'md' | '
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
let { progress = $bindable(), size = 'md' }: Props = $props();
|
|
16
15
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const configs = {
|
|
17
|
+
sm: { viewBox: '0 0 16 16', center: 8, radius: 6 },
|
|
18
|
+
md: { viewBox: '0 0 20 20', center: 10, radius: 7 },
|
|
19
|
+
lg: { viewBox: '0 0 24 24', center: 12, radius: 9 },
|
|
20
|
+
};
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const config = $derived(configs[size]);
|
|
23
|
+
const viewBox = $derived(config.viewBox);
|
|
24
|
+
const center = $derived(config.center);
|
|
25
|
+
const radius = $derived(config.radius);
|
|
26
|
+
const path = $derived(
|
|
27
|
+
`M ${center} ${center - radius} A ${radius} ${radius} 0 1 1 ${center - 0.01} ${center - radius}`
|
|
28
|
+
);
|
|
24
29
|
</script>
|
|
25
30
|
|
|
26
|
-
<div class="progress-wrapper" class:sm={size === 'sm'} class:md={size === 'md'}>
|
|
31
|
+
<div class="progress-wrapper" class:sm={size === 'sm'} class:md={size === 'md'} class:lg={size === 'lg'}>
|
|
27
32
|
<svg xmlns="http://www.w3.org/2000/svg" {viewBox} fill="none">
|
|
28
33
|
<!-- Background track -->
|
|
29
34
|
<path d={path} stroke="currentColor" stroke-opacity="0.25" stroke-width="2" fill="none" />
|
|
@@ -47,11 +52,14 @@
|
|
|
47
52
|
@apply relative inline-block;
|
|
48
53
|
|
|
49
54
|
aspect-ratio: 1;
|
|
55
|
+
&.sm {
|
|
56
|
+
@apply size-4;
|
|
57
|
+
}
|
|
50
58
|
&.md {
|
|
51
59
|
@apply size-5;
|
|
52
60
|
}
|
|
53
|
-
&.
|
|
54
|
-
@apply size-
|
|
61
|
+
&.lg {
|
|
62
|
+
@apply size-6;
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
|