@reshape-biotech/design-system 2.7.51 → 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 +37 -41
- package/dist/components/button/Button.svelte +18 -13
- package/dist/components/button/Button.svelte.d.ts +1 -1
- 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/icon-button/IconButton.stories.svelte +72 -28
- package/dist/components/icon-button/IconButton.stories.svelte.d.ts +1 -1
- package/dist/components/icon-button/IconButton.svelte +80 -84
- package/dist/components/icon-button/IconButton.svelte.d.ts +10 -4
- 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 +42 -16
- package/dist/components/input/Input.stories.svelte.d.ts +2 -17
- package/dist/components/input/Input.svelte +18 -18
- package/dist/components/input/Input.svelte.d.ts +2 -2
- 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/toast/Toast.stories.svelte +3 -24
- package/dist/components/toast/Toast.svelte +22 -40
- 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/dist/safelist-source.d.ts +1 -1
- package/dist/safelist-source.js +2 -2
- package/dist/safelist.css +1 -1
- package/dist/tailwind.preset.d.ts +2 -0
- package/dist/tokens/colors.d.ts +1 -0
- package/dist/tokens/colors.js +8 -7
- package/dist/tokens.d.ts +13 -0
- package/dist/tokens.js +8 -2
- package/package.json +3 -1
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
export type IconButtonVariant = 'primary' | 'secondary' | 'transparent' | 'outline' | 'danger' | 'secondary-inverse' | 'transparent-inverse';
|
|
2
|
+
export type IconButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
2
3
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
-
type
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
4
5
|
interface Props extends HTMLButtonAttributes {
|
|
5
|
-
|
|
6
|
+
class?: string;
|
|
7
|
+
onClick?: (event?: MouseEvent) => void;
|
|
6
8
|
type?: 'button' | 'submit' | 'reset' | null | undefined;
|
|
7
9
|
loading?: boolean;
|
|
8
|
-
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
accessibilityLabel?: string | undefined;
|
|
12
|
+
size?: IconButtonSize;
|
|
13
|
+
tabindex?: number | undefined;
|
|
14
|
+
variant?: IconButtonVariant;
|
|
9
15
|
children?: Snippet;
|
|
10
16
|
rounded?: boolean;
|
|
11
17
|
}
|
|
@@ -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
|
+
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import Input, { type InputVariant
|
|
2
|
+
import Input, { type InputVariant } from './Input.svelte';
|
|
3
|
+
import Check from 'phosphor-svelte/lib/Check';
|
|
4
|
+
import MagnifyingGlass from 'phosphor-svelte/lib/MagnifyingGlass';
|
|
5
|
+
import XCircle from 'phosphor-svelte/lib/XCircle';
|
|
6
|
+
import AnalysisIcon from '../icons/AnalysisIcon.svelte';
|
|
7
|
+
import { Icon } from '../icons/index.js';
|
|
3
8
|
|
|
4
9
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
5
10
|
|
|
@@ -7,12 +12,6 @@
|
|
|
7
12
|
component: Input,
|
|
8
13
|
title: 'Components/Input',
|
|
9
14
|
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
design: {
|
|
12
|
-
type: 'figma',
|
|
13
|
-
url: 'https://www.figma.com/design/VHTMNdy8PAXAMx43edNZGW/%F0%9F%92%A0--Reshape-Design-System%3A-V1?node-id=9-3169&t=sCuBI8dX6K6NjNR6-0',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
15
|
});
|
|
17
16
|
|
|
18
17
|
let value = '';
|
|
@@ -23,7 +22,16 @@
|
|
|
23
22
|
|
|
24
23
|
const variants = ['primary', 'secondary', 'transparent', 'borderless'];
|
|
25
24
|
|
|
26
|
-
const sizes = ['xs', 'sm', 'md', 'lg'
|
|
25
|
+
const sizes = ['xs', 'sm', 'md', 'lg'] as const;
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script lang="ts">
|
|
29
|
+
let sizeStoryValues = $state({
|
|
30
|
+
xs: 'Sample text',
|
|
31
|
+
sm: 'Sample text',
|
|
32
|
+
md: 'Sample text',
|
|
33
|
+
lg: 'Sample text',
|
|
34
|
+
});
|
|
27
35
|
</script>
|
|
28
36
|
|
|
29
37
|
<Story name="Base" args={{ autofocus: true, value: 'Hello' }} />
|
|
@@ -42,8 +50,18 @@
|
|
|
42
50
|
|
|
43
51
|
<Story name="Sizes" asChild>
|
|
44
52
|
<div class="flex flex-col gap-4">
|
|
45
|
-
{#each sizes as size}
|
|
46
|
-
<Input
|
|
53
|
+
{#each sizes as size (size)}
|
|
54
|
+
<Input
|
|
55
|
+
label={size}
|
|
56
|
+
{size}
|
|
57
|
+
placeholder="Placeholder"
|
|
58
|
+
clearable
|
|
59
|
+
bind:value={sizeStoryValues[size]}
|
|
60
|
+
>
|
|
61
|
+
{#snippet prefix()}
|
|
62
|
+
<Icon icon={MagnifyingGlass} color="secondary" size={16} />
|
|
63
|
+
{/snippet}
|
|
64
|
+
</Input>
|
|
47
65
|
{/each}
|
|
48
66
|
</div>
|
|
49
67
|
</Story>
|
|
@@ -63,7 +81,15 @@
|
|
|
63
81
|
<Story name="Prefix" asChild>
|
|
64
82
|
<Input value="Bob">
|
|
65
83
|
{#snippet prefix()}
|
|
66
|
-
|
|
84
|
+
Mr.
|
|
85
|
+
{/snippet}
|
|
86
|
+
</Input>
|
|
87
|
+
</Story>
|
|
88
|
+
|
|
89
|
+
<Story name="Analysis icon" asChild>
|
|
90
|
+
<Input label="Analysis" placeholder="Enter analysis name…" value="">
|
|
91
|
+
{#snippet prefix()}
|
|
92
|
+
<AnalysisIcon model="pipeline_small_colonies" size="sm" withBackground />
|
|
67
93
|
{/snippet}
|
|
68
94
|
</Input>
|
|
69
95
|
</Story>
|
|
@@ -71,7 +97,7 @@
|
|
|
71
97
|
<Story name="Suffix" asChild>
|
|
72
98
|
<Input value="30">
|
|
73
99
|
{#snippet suffix()}
|
|
74
|
-
|
|
100
|
+
± 1°C
|
|
75
101
|
{/snippet}
|
|
76
102
|
</Input>
|
|
77
103
|
</Story>
|
|
@@ -79,10 +105,10 @@
|
|
|
79
105
|
<Story name="Prefix & Suffix" asChild>
|
|
80
106
|
<Input value="9001">
|
|
81
107
|
{#snippet prefix()}
|
|
82
|
-
|
|
108
|
+
$
|
|
83
109
|
{/snippet}
|
|
84
110
|
{#snippet suffix()}
|
|
85
|
-
|
|
111
|
+
🔥
|
|
86
112
|
{/snippet}
|
|
87
113
|
</Input>
|
|
88
114
|
</Story>
|
|
@@ -92,9 +118,9 @@
|
|
|
92
118
|
{#snippet prefix({ valid })}
|
|
93
119
|
<div>
|
|
94
120
|
{#if valid}
|
|
95
|
-
|
|
121
|
+
<Icon icon={Check} color="success" />
|
|
96
122
|
{:else}
|
|
97
|
-
|
|
123
|
+
<Icon icon={XCircle} color="danger" />
|
|
98
124
|
{/if}
|
|
99
125
|
</div>
|
|
100
126
|
{/snippet}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import Input from './Input.svelte';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
$$bindings?: Bindings;
|
|
5
|
-
} & Exports;
|
|
6
|
-
(internal: unknown, props: {
|
|
7
|
-
$$events?: Events;
|
|
8
|
-
$$slots?: Slots;
|
|
9
|
-
}): Exports & {
|
|
10
|
-
$set?: any;
|
|
11
|
-
$on?: any;
|
|
12
|
-
};
|
|
13
|
-
z_$$bindings?: Bindings;
|
|
14
|
-
}
|
|
15
|
-
declare const Input: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
}, {}, {}, string>;
|
|
18
|
-
type Input = InstanceType<typeof Input>;
|
|
2
|
+
declare const Input: import("svelte").Component<Record<string, never>, {}, "">;
|
|
3
|
+
type Input = ReturnType<typeof Input>;
|
|
19
4
|
export default Input;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
suffix?: Snippet;
|
|
17
17
|
error?: Snippet;
|
|
18
18
|
input?: HTMLInputElement;
|
|
19
|
-
size?: 'xs' | 'sm' | 'md' | 'lg'
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' ;
|
|
20
20
|
clearable?: boolean;
|
|
21
21
|
onclear?: () => void;
|
|
22
22
|
class?: string;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
|
|
69
69
|
export type InputVariant = 'primary' | 'secondary' | 'transparent' | 'borderless';
|
|
70
70
|
|
|
71
|
-
export type InputSize = 'xs' | 'sm' | 'md' | 'lg'
|
|
71
|
+
export type InputSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
72
72
|
</script>
|
|
73
73
|
|
|
74
74
|
<div
|
|
@@ -92,16 +92,18 @@
|
|
|
92
92
|
|
|
93
93
|
<div class="flex-1">
|
|
94
94
|
<div
|
|
95
|
-
class={twMerge('flex w-full items-center
|
|
95
|
+
class={twMerge('flex w-full items-center transition-colors', `size-${size}`, className)}
|
|
96
96
|
class:border-error!={!valid}
|
|
97
97
|
class:primary={variant === 'primary'}
|
|
98
98
|
class:secondary={variant === 'secondary'}
|
|
99
99
|
class:transparent={variant === 'transparent'}
|
|
100
100
|
class:borderless={variant === 'borderless'}
|
|
101
101
|
>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
{#if prefix}
|
|
103
|
+
<div class="whitespace-nowrap text-secondary pl-1">
|
|
104
|
+
{@render prefix?.({ valid })}
|
|
105
|
+
</div>
|
|
106
|
+
{/if}
|
|
105
107
|
<input
|
|
106
108
|
{id}
|
|
107
109
|
class="inline leading-none"
|
|
@@ -115,9 +117,11 @@
|
|
|
115
117
|
bind:value
|
|
116
118
|
{...rest}
|
|
117
119
|
/>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
{#if suffix}
|
|
121
|
+
<div class="whitespace-nowrap text-secondary pr-1">
|
|
122
|
+
{@render suffix?.()}
|
|
123
|
+
</div>
|
|
124
|
+
{/if}
|
|
121
125
|
|
|
122
126
|
{#if clearable && value}
|
|
123
127
|
<IconButton
|
|
@@ -142,7 +146,7 @@
|
|
|
142
146
|
<style>
|
|
143
147
|
@reference "../../app.css";
|
|
144
148
|
input {
|
|
145
|
-
@apply w-full resize-none bg-transparent
|
|
149
|
+
@apply w-full px-2 resize-none bg-transparent outline-none rounded-none placeholder:text-tertiary;
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
div:not(:focus-within):hover {
|
|
@@ -174,22 +178,18 @@
|
|
|
174
178
|
}
|
|
175
179
|
|
|
176
180
|
.size-xs {
|
|
177
|
-
@apply h-
|
|
181
|
+
@apply h-7 rounded-md p-1 text-label;
|
|
178
182
|
}
|
|
179
183
|
|
|
180
184
|
.size-sm {
|
|
181
|
-
@apply h-8 rounded-
|
|
185
|
+
@apply h-8 rounded-lg p-1;
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
.size-md {
|
|
185
|
-
@apply h-
|
|
189
|
+
@apply h-9 rounded-lg p-1;
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
.size-lg {
|
|
189
|
-
@apply h-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.size-dynamic {
|
|
193
|
-
@apply h-auto rounded-lg px-3 py-2;
|
|
193
|
+
@apply h-10 rounded-lg p-1;
|
|
194
194
|
}
|
|
195
195
|
</style>
|
|
@@ -10,7 +10,7 @@ interface InputProps extends Omit<HTMLInputAttributes, 'size' | 'prefix' | 'suff
|
|
|
10
10
|
suffix?: Snippet;
|
|
11
11
|
error?: Snippet;
|
|
12
12
|
input?: HTMLInputElement;
|
|
13
|
-
size?: 'xs' | 'sm' | 'md' | 'lg'
|
|
13
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
14
14
|
clearable?: boolean;
|
|
15
15
|
onclear?: () => void;
|
|
16
16
|
class?: string;
|
|
@@ -18,7 +18,7 @@ interface InputProps extends Omit<HTMLInputAttributes, 'size' | 'prefix' | 'suff
|
|
|
18
18
|
onblur?: (event: FocusEvent) => void;
|
|
19
19
|
}
|
|
20
20
|
export type InputVariant = 'primary' | 'secondary' | 'transparent' | 'borderless';
|
|
21
|
-
export type InputSize = 'xs' | 'sm' | 'md' | 'lg'
|
|
21
|
+
export type InputSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
22
22
|
declare const Input: import("svelte").Component<InputProps, {
|
|
23
23
|
focus: () => void;
|
|
24
24
|
}, "value" | "input">;
|
|
@@ -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
|
+
};
|