@flightlesslabs/dodo-ui 0.22.2 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -9
- package/dist/index.d.ts +4 -10
- package/dist/index.js +5 -10
- package/dist/styles/components.css +0 -154
- package/dist/styles/components.css.map +1 -1
- package/dist/styles/components.scss +0 -2
- package/package.json +27 -41
- package/src/lib/index.ts +6 -19
- package/src/lib/styles/components.scss +0 -2
- package/src/lib/utils/time/date-creator/createDate/createDate.test.ts +109 -0
- package/src/lib/utils/time/date-creator/createDateFactory/createDateFactory.test.ts +146 -0
- package/dist/Home.mdx +0 -69
- package/dist/components/Form/Button/Button.stories.svelte +0 -178
- package/dist/components/Form/Button/Button.stories.svelte.d.ts +0 -22
- package/dist/components/Form/Checkbox/Checkbox.stories.svelte +0 -132
- package/dist/components/Form/Checkbox/Checkbox.stories.svelte.d.ts +0 -25
- package/dist/components/Form/DatePicker/DatePicker.scss +0 -55
- package/dist/components/Form/DatePicker/DatePicker.stories.svelte +0 -139
- package/dist/components/Form/DatePicker/DatePicker.stories.svelte.d.ts +0 -22
- package/dist/components/Form/DatePicker/DatePicker.svelte +0 -136
- package/dist/components/Form/DatePicker/DatePicker.svelte.d.ts +0 -64
- package/dist/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte +0 -96
- package/dist/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte.d.ts +0 -23
- package/dist/components/Form/DatePicker/DatePickerInput/Segments.svelte +0 -17
- package/dist/components/Form/DatePicker/DatePickerInput/Segments.svelte.d.ts +0 -8
- package/dist/components/Form/DatePicker/DatePickerInput/utils.d.ts +0 -10
- package/dist/components/Form/DatePicker/DatePickerInput/utils.js +0 -26
- package/dist/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte +0 -35
- package/dist/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte.d.ts +0 -4
- package/dist/components/Form/DatePicker/DatePickerPopup/DatePickerPopup.svelte +0 -52
- package/dist/components/Form/DatePicker/DatePickerPopup/DatePickerPopup.svelte.d.ts +0 -6
- package/dist/components/Form/DatePicker/DatePickerPopup/Header.svelte +0 -25
- package/dist/components/Form/DatePicker/DatePickerPopup/Header.svelte.d.ts +0 -3
- package/dist/components/Form/FormField/FormField.stories.svelte +0 -48
- package/dist/components/Form/FormField/FormField.stories.svelte.d.ts +0 -25
- package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte +0 -166
- package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte.d.ts +0 -22
- package/dist/components/Form/Label/Label.stories.svelte +0 -31
- package/dist/components/Form/Label/Label.stories.svelte.d.ts +0 -25
- package/dist/components/Form/RadioGroup/Radio/Radio.stories.svelte +0 -78
- package/dist/components/Form/RadioGroup/Radio/Radio.stories.svelte.d.ts +0 -25
- package/dist/components/Form/RadioGroup/RadioGroup.stories.svelte +0 -172
- package/dist/components/Form/RadioGroup/RadioGroup.stories.svelte.d.ts +0 -25
- package/dist/components/Form/Select/Select.stories.svelte +0 -175
- package/dist/components/Form/Select/Select.stories.svelte.d.ts +0 -22
- package/dist/components/Form/Switch/Switch.stories.svelte +0 -128
- package/dist/components/Form/Switch/Switch.stories.svelte.d.ts +0 -25
- package/dist/components/Form/TextInput/TextInput.stories.svelte +0 -162
- package/dist/components/Form/TextInput/TextInput.stories.svelte.d.ts +0 -22
- package/dist/components/Form/UtilityButton/UtilityButton.stories.svelte +0 -163
- package/dist/components/Form/UtilityButton/UtilityButton.stories.svelte.d.ts +0 -22
- package/dist/components/Info/Calendar/Calendar.scss +0 -147
- package/dist/components/Info/Calendar/Calendar.stories.svelte +0 -134
- package/dist/components/Info/Calendar/Calendar.stories.svelte.d.ts +0 -22
- package/dist/components/Info/Calendar/Calendar.svelte +0 -61
- package/dist/components/Info/Calendar/Calendar.svelte.d.ts +0 -6
- package/dist/components/Info/Calendar/CalendarGrid/CalendarGrid.svelte +0 -16
- package/dist/components/Info/Calendar/CalendarGrid/CalendarGrid.svelte.d.ts +0 -4
- package/dist/components/Info/Calendar/CalendarGrid/TableBody.svelte +0 -25
- package/dist/components/Info/Calendar/CalendarGrid/TableBody.svelte.d.ts +0 -8
- package/dist/components/Info/Calendar/CalendarGrid/TableHead.svelte +0 -19
- package/dist/components/Info/Calendar/CalendarGrid/TableHead.svelte.d.ts +0 -6
- package/dist/components/Info/Calendar/Header.svelte +0 -25
- package/dist/components/Info/Calendar/Header.svelte.d.ts +0 -3
- package/dist/components/Layout/Card/Card.stories.svelte +0 -113
- package/dist/components/Layout/Card/Card.stories.svelte.d.ts +0 -22
- package/dist/components/Layout/Grid/Column/Column.stories.svelte +0 -66
- package/dist/components/Layout/Grid/Column/Column.stories.svelte.d.ts +0 -22
- package/dist/components/Layout/Grid/Grid.stories.svelte +0 -192
- package/dist/components/Layout/Grid/Grid.stories.svelte.d.ts +0 -22
- package/dist/components/Layout/Grid/Row/Row.stories.svelte +0 -39
- package/dist/components/Layout/Grid/Row/Row.stories.svelte.d.ts +0 -22
- package/dist/components/Layout/Theme/Theme.stories.svelte +0 -54
- package/dist/components/Layout/Theme/Theme.stories.svelte.d.ts +0 -25
- package/dist/components/Layout/Theme/ThemeSystem/index.mdx +0 -35
- package/dist/storybook-types.d.ts +0 -129
- package/dist/storybook-types.js +0 -1
- package/dist/utils/time/date-creator/createDate/createDate.mdx +0 -98
- package/dist/utils/time/date-creator/createDateFactory/createDateFactory.mdx +0 -104
- package/dist/utils/time/timeout/timeout.mdx +0 -114
- package/src/lib/Home.mdx +0 -69
- package/src/lib/components/Form/Button/Button.stories.svelte +0 -178
- package/src/lib/components/Form/Checkbox/Checkbox.stories.svelte +0 -132
- package/src/lib/components/Form/DatePicker/DatePicker.scss +0 -55
- package/src/lib/components/Form/DatePicker/DatePicker.stories.svelte +0 -139
- package/src/lib/components/Form/DatePicker/DatePicker.svelte +0 -136
- package/src/lib/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte +0 -96
- package/src/lib/components/Form/DatePicker/DatePickerInput/Segments.svelte +0 -17
- package/src/lib/components/Form/DatePicker/DatePickerInput/utils.ts +0 -55
- package/src/lib/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte +0 -35
- package/src/lib/components/Form/DatePicker/DatePickerPopup/DatePickerPopup.svelte +0 -52
- package/src/lib/components/Form/DatePicker/DatePickerPopup/Header.svelte +0 -25
- package/src/lib/components/Form/FormField/FormField.stories.svelte +0 -48
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.stories.svelte +0 -166
- package/src/lib/components/Form/Label/Label.stories.svelte +0 -31
- package/src/lib/components/Form/RadioGroup/Radio/Radio.stories.svelte +0 -78
- package/src/lib/components/Form/RadioGroup/RadioGroup.stories.svelte +0 -172
- package/src/lib/components/Form/Select/Select.stories.svelte +0 -175
- package/src/lib/components/Form/Switch/Switch.stories.svelte +0 -128
- package/src/lib/components/Form/TextInput/TextInput.stories.svelte +0 -162
- package/src/lib/components/Form/UtilityButton/UtilityButton.stories.svelte +0 -163
- package/src/lib/components/Info/Calendar/Calendar.scss +0 -147
- package/src/lib/components/Info/Calendar/Calendar.stories.svelte +0 -134
- package/src/lib/components/Info/Calendar/Calendar.svelte +0 -61
- package/src/lib/components/Info/Calendar/CalendarGrid/CalendarGrid.svelte +0 -16
- package/src/lib/components/Info/Calendar/CalendarGrid/TableBody.svelte +0 -25
- package/src/lib/components/Info/Calendar/CalendarGrid/TableHead.svelte +0 -19
- package/src/lib/components/Info/Calendar/Header.svelte +0 -25
- package/src/lib/components/Layout/Card/Card.stories.svelte +0 -113
- package/src/lib/components/Layout/Grid/Column/Column.stories.svelte +0 -66
- package/src/lib/components/Layout/Grid/Grid.stories.svelte +0 -192
- package/src/lib/components/Layout/Grid/Row/Row.stories.svelte +0 -39
- package/src/lib/components/Layout/Theme/Theme.stories.svelte +0 -54
- package/src/lib/components/Layout/Theme/ThemeSystem/index.mdx +0 -35
- package/src/lib/storybook-types.ts +0 -182
- package/src/lib/utils/time/date-creator/createDate/createDate.mdx +0 -98
- package/src/lib/utils/time/date-creator/createDateFactory/createDateFactory.mdx +0 -104
- package/src/lib/utils/time/timeout/timeout.mdx +0 -114
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import FormField from './FormField.svelte';
|
|
4
|
-
import type { FormFieldProps } from './FormField.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import TextInput from '../TextInput/TextInput.svelte';
|
|
7
|
-
|
|
8
|
-
const description = `
|
|
9
|
-
a form control for input tags and more.
|
|
10
|
-
\`\`\`ts
|
|
11
|
-
import { FormField } from '@flightlesslabs/dodo-ui';
|
|
12
|
-
\`\`\`
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Storybook controls for FormField
|
|
17
|
-
*/
|
|
18
|
-
export const FormFieldArgTypes: Partial<ArgTypes<FormFieldProps>> = {
|
|
19
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
20
|
-
label: {
|
|
21
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
22
|
-
},
|
|
23
|
-
for: {
|
|
24
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const { Story } = defineMeta({
|
|
29
|
-
component: FormField,
|
|
30
|
-
tags: ['autodocs'],
|
|
31
|
-
argTypes: FormFieldArgTypes,
|
|
32
|
-
parameters: {
|
|
33
|
-
docs: {
|
|
34
|
-
description: {
|
|
35
|
-
component: description,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<!-- ------------------------------ -->
|
|
43
|
-
<!-- Stories -->
|
|
44
|
-
<!-- ------------------------------ -->
|
|
45
|
-
|
|
46
|
-
<Story name="Defualt" args={{ label: 'Name:', for: 'name' }}>
|
|
47
|
-
<TextInput placeholder="Type something…" name="name" />
|
|
48
|
-
</Story>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import FormField from './FormField.svelte';
|
|
2
|
-
import type { FormFieldProps } from './FormField.svelte';
|
|
3
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
4
|
-
/**
|
|
5
|
-
* Storybook controls for FormField
|
|
6
|
-
*/
|
|
7
|
-
export declare const FormFieldArgTypes: Partial<ArgTypes<FormFieldProps>>;
|
|
8
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
9
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
10
|
-
$$bindings?: Bindings;
|
|
11
|
-
} & Exports;
|
|
12
|
-
(internal: unknown, props: {
|
|
13
|
-
$$events?: Events;
|
|
14
|
-
$$slots?: Slots;
|
|
15
|
-
}): Exports & {
|
|
16
|
-
$set?: any;
|
|
17
|
-
$on?: any;
|
|
18
|
-
};
|
|
19
|
-
z_$$bindings?: Bindings;
|
|
20
|
-
}
|
|
21
|
-
declare const FormField: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
}, {}, {}, string>;
|
|
24
|
-
type FormField = InstanceType<typeof FormField>;
|
|
25
|
-
export default FormField;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import InputEnclosure from './InputEnclosure.svelte';
|
|
4
|
-
import type { InputEnclosureProps } from './InputEnclosure.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
|
|
7
|
-
import { componentSizeOptions } from '../../../attributes/size.js';
|
|
8
|
-
import { componentRoundnessOptions } from '../../../attributes/roundness.js';
|
|
9
|
-
import Theme from '../../Layout/Theme/Theme.svelte';
|
|
10
|
-
|
|
11
|
-
const description = `
|
|
12
|
-
An extensive wrappwer for input boxes.
|
|
13
|
-
|
|
14
|
-
\`\`\`ts
|
|
15
|
-
import { InputEnclosure } from '@flightlesslabs/dodo-ui';
|
|
16
|
-
|
|
17
|
-
// apply 'InputBox' class to the input
|
|
18
|
-
<input class="InputBox" />
|
|
19
|
-
\`\`\`
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
// ------------------------------
|
|
23
|
-
// Storybook ArgTypes
|
|
24
|
-
// ------------------------------
|
|
25
|
-
export const storyInputEnclosureArgTypes: Partial<ArgTypes<InputEnclosureProps>> = {
|
|
26
|
-
// ------------------------------
|
|
27
|
-
// Core
|
|
28
|
-
// ------------------------------
|
|
29
|
-
children: {
|
|
30
|
-
control: { type: 'text' },
|
|
31
|
-
description: 'InputEnclosure contents (typically an input or control)',
|
|
32
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
33
|
-
},
|
|
34
|
-
before: {
|
|
35
|
-
description:
|
|
36
|
-
'Content rendered before the input (prefix). Provided via {#snippet before} in Svelte.',
|
|
37
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
38
|
-
},
|
|
39
|
-
after: {
|
|
40
|
-
description:
|
|
41
|
-
'Content rendered after the input (suffix). Provided via {#snippet after} in Svelte.',
|
|
42
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
43
|
-
},
|
|
44
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
45
|
-
|
|
46
|
-
// ------------------------------
|
|
47
|
-
// State
|
|
48
|
-
// ------------------------------
|
|
49
|
-
disabled: {
|
|
50
|
-
control: { type: 'boolean' },
|
|
51
|
-
description: 'Disabled visual state',
|
|
52
|
-
table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
|
|
53
|
-
},
|
|
54
|
-
focused: {
|
|
55
|
-
control: { type: 'boolean' },
|
|
56
|
-
description: 'Focused visual state (wrapper-level)',
|
|
57
|
-
table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
|
|
58
|
-
},
|
|
59
|
-
error: {
|
|
60
|
-
control: { type: 'boolean' },
|
|
61
|
-
description: 'Error visual state (validation)',
|
|
62
|
-
table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
// ------------------------------
|
|
66
|
-
// Appearance
|
|
67
|
-
// ------------------------------
|
|
68
|
-
size: {
|
|
69
|
-
control: { type: 'select' },
|
|
70
|
-
options: componentSizeOptions,
|
|
71
|
-
description: 'Visual size token',
|
|
72
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'normal' } },
|
|
73
|
-
},
|
|
74
|
-
roundness: {
|
|
75
|
-
control: { type: 'select' },
|
|
76
|
-
options: componentRoundnessOptions,
|
|
77
|
-
description: 'Border radius token',
|
|
78
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: '1' } },
|
|
79
|
-
},
|
|
80
|
-
outline: {
|
|
81
|
-
control: { type: 'boolean' },
|
|
82
|
-
description: 'Render outlined enclosure',
|
|
83
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'true' } },
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
// ------------------------------
|
|
88
|
-
// Storybook Meta
|
|
89
|
-
// ------------------------------
|
|
90
|
-
const { Story } = defineMeta({
|
|
91
|
-
component: InputEnclosure,
|
|
92
|
-
tags: ['autodocs'],
|
|
93
|
-
argTypes: storyInputEnclosureArgTypes,
|
|
94
|
-
parameters: {
|
|
95
|
-
docs: {
|
|
96
|
-
description: {
|
|
97
|
-
component: description,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
</script>
|
|
103
|
-
|
|
104
|
-
<!-- ------------------------------ -->
|
|
105
|
-
<!-- Stories -->
|
|
106
|
-
<!-- ------------------------------ -->
|
|
107
|
-
|
|
108
|
-
<Story name="Default">
|
|
109
|
-
<input placeholder="Type something…" class="InputBox" />
|
|
110
|
-
</Story>
|
|
111
|
-
|
|
112
|
-
<Story name="No Outline" args={{ outline: false }}>
|
|
113
|
-
<input placeholder="No outline…" class="InputBox" />
|
|
114
|
-
</Story>
|
|
115
|
-
|
|
116
|
-
<Story name="Focused" args={{ focused: true }}>
|
|
117
|
-
<input placeholder="Focused state…" class="InputBox" />
|
|
118
|
-
</Story>
|
|
119
|
-
|
|
120
|
-
<Story name="Error" args={{ error: true }}>
|
|
121
|
-
<input placeholder="Error state…" class="InputBox" />
|
|
122
|
-
</Story>
|
|
123
|
-
|
|
124
|
-
<Story name="Disabled" args={{ disabled: true }}>
|
|
125
|
-
<input placeholder="Disabled state…" disabled class="InputBox" />
|
|
126
|
-
</Story>
|
|
127
|
-
|
|
128
|
-
<Story name="Large" args={{ size: 'large' }}>
|
|
129
|
-
<input placeholder="Large input…" class="InputBox" />
|
|
130
|
-
</Story>
|
|
131
|
-
|
|
132
|
-
<Story name="With Before (Icon Prefix)" asChild>
|
|
133
|
-
<InputEnclosure>
|
|
134
|
-
{#snippet before()}
|
|
135
|
-
<span style="color: #888; padding-left: 8px">🔍</span>
|
|
136
|
-
{/snippet}
|
|
137
|
-
|
|
138
|
-
<input placeholder="Search…" class="InputBox" />
|
|
139
|
-
</InputEnclosure>
|
|
140
|
-
</Story>
|
|
141
|
-
|
|
142
|
-
<Story name="With After (Suffix Text)" asChild>
|
|
143
|
-
<InputEnclosure>
|
|
144
|
-
{#snippet after()}
|
|
145
|
-
<span style="color: #888; padding-right: 8px">.com</span>
|
|
146
|
-
{/snippet}
|
|
147
|
-
|
|
148
|
-
<input placeholder="Website" class="InputBox" />
|
|
149
|
-
</InputEnclosure>
|
|
150
|
-
</Story>
|
|
151
|
-
|
|
152
|
-
<Story name="Light Theme" asChild>
|
|
153
|
-
<Theme type="light">
|
|
154
|
-
<InputEnclosure>
|
|
155
|
-
<input placeholder="Type something…" class="InputBox" />
|
|
156
|
-
</InputEnclosure>
|
|
157
|
-
</Theme>
|
|
158
|
-
</Story>
|
|
159
|
-
|
|
160
|
-
<Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
|
|
161
|
-
<Theme type="dark">
|
|
162
|
-
<InputEnclosure>
|
|
163
|
-
<input placeholder="Type something…" class="InputBox" />
|
|
164
|
-
</InputEnclosure>
|
|
165
|
-
</Theme>
|
|
166
|
-
</Story>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import InputEnclosure from './InputEnclosure.svelte';
|
|
2
|
-
import type { InputEnclosureProps } from './InputEnclosure.svelte';
|
|
3
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
4
|
-
export declare const storyInputEnclosureArgTypes: Partial<ArgTypes<InputEnclosureProps>>;
|
|
5
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
6
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
7
|
-
$$bindings?: Bindings;
|
|
8
|
-
} & Exports;
|
|
9
|
-
(internal: unknown, props: {
|
|
10
|
-
$$events?: Events;
|
|
11
|
-
$$slots?: Slots;
|
|
12
|
-
}): Exports & {
|
|
13
|
-
$set?: any;
|
|
14
|
-
$on?: any;
|
|
15
|
-
};
|
|
16
|
-
z_$$bindings?: Bindings;
|
|
17
|
-
}
|
|
18
|
-
declare const InputEnclosure: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
}, {}, {}, string>;
|
|
21
|
-
type InputEnclosure = InstanceType<typeof InputEnclosure>;
|
|
22
|
-
export default InputEnclosure;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Label from './Label.svelte';
|
|
4
|
-
import type { LabelProps } from './Label.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import TextInput from '../TextInput/TextInput.svelte';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Storybook controls for Label
|
|
10
|
-
*/
|
|
11
|
-
export const LabelArgTypes: Partial<ArgTypes<LabelProps>> = {
|
|
12
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const { Story } = defineMeta({
|
|
16
|
-
component: Label,
|
|
17
|
-
tags: ['autodocs'],
|
|
18
|
-
argTypes: LabelArgTypes,
|
|
19
|
-
});
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<!-- ------------------------------ -->
|
|
23
|
-
<!-- Stories -->
|
|
24
|
-
<!-- ------------------------------ -->
|
|
25
|
-
|
|
26
|
-
<Story name="Default">Default Label</Story>
|
|
27
|
-
|
|
28
|
-
<Story name="WithTextInput" asChild>
|
|
29
|
-
<Label for="search">Search:</Label>
|
|
30
|
-
<TextInput placeholder="Search…" name="search" />
|
|
31
|
-
</Story>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import Label from './Label.svelte';
|
|
2
|
-
import type { LabelProps } from './Label.svelte';
|
|
3
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
4
|
-
/**
|
|
5
|
-
* Storybook controls for Label
|
|
6
|
-
*/
|
|
7
|
-
export declare const LabelArgTypes: Partial<ArgTypes<LabelProps>>;
|
|
8
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
9
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
10
|
-
$$bindings?: Bindings;
|
|
11
|
-
} & Exports;
|
|
12
|
-
(internal: unknown, props: {
|
|
13
|
-
$$events?: Events;
|
|
14
|
-
$$slots?: Slots;
|
|
15
|
-
}): Exports & {
|
|
16
|
-
$set?: any;
|
|
17
|
-
$on?: any;
|
|
18
|
-
};
|
|
19
|
-
z_$$bindings?: Bindings;
|
|
20
|
-
}
|
|
21
|
-
declare const Label: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
}, {}, {}, string>;
|
|
24
|
-
type Label = InstanceType<typeof Label>;
|
|
25
|
-
export default Label;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Radio from './Radio.svelte';
|
|
4
|
-
import type { RadioProps } from './Radio.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import { componentColorOptions } from '../../../../attributes/color.js';
|
|
7
|
-
import { componentSizeOptions } from '../../../../attributes/size.js';
|
|
8
|
-
import { componentRoundnessOptions } from '../../../../attributes/roundness.js';
|
|
9
|
-
import { componentVariantOptions } from '../../../../attributes/variant.js';
|
|
10
|
-
import RadioGroup from '../RadioGroup.svelte';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Storybook controls for Radio
|
|
14
|
-
*/
|
|
15
|
-
export const RadioArgTypes: Partial<ArgTypes<RadioProps>> = {
|
|
16
|
-
// ------------------------------
|
|
17
|
-
// Core
|
|
18
|
-
// ------------------------------
|
|
19
|
-
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
20
|
-
disabled: {
|
|
21
|
-
control: { type: 'boolean' },
|
|
22
|
-
description: 'Disable interactions',
|
|
23
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
24
|
-
},
|
|
25
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
26
|
-
|
|
27
|
-
// ------------------------------
|
|
28
|
-
// Appearance
|
|
29
|
-
// ------------------------------
|
|
30
|
-
color: {
|
|
31
|
-
control: { type: 'select' },
|
|
32
|
-
options: componentColorOptions,
|
|
33
|
-
description: 'Color theme token',
|
|
34
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'neutral' } },
|
|
35
|
-
},
|
|
36
|
-
variant: {
|
|
37
|
-
control: { type: 'select' },
|
|
38
|
-
options: componentVariantOptions,
|
|
39
|
-
description: 'Visual variant of the Radio',
|
|
40
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'text' } },
|
|
41
|
-
},
|
|
42
|
-
size: {
|
|
43
|
-
control: { type: 'select' },
|
|
44
|
-
options: componentSizeOptions,
|
|
45
|
-
description: 'Visual size token',
|
|
46
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'normal' } },
|
|
47
|
-
},
|
|
48
|
-
roundness: {
|
|
49
|
-
control: { type: 'select' },
|
|
50
|
-
options: componentRoundnessOptions,
|
|
51
|
-
description: 'Border radius token',
|
|
52
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'full' } },
|
|
53
|
-
},
|
|
54
|
-
outline: {
|
|
55
|
-
control: { type: 'boolean' },
|
|
56
|
-
description: 'Render outlined style',
|
|
57
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'true' } },
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const { Story } = defineMeta({
|
|
62
|
-
component: Radio,
|
|
63
|
-
tags: ['autodocs'],
|
|
64
|
-
argTypes: RadioArgTypes,
|
|
65
|
-
});
|
|
66
|
-
</script>
|
|
67
|
-
|
|
68
|
-
<!-- ------------------------------ -->
|
|
69
|
-
<!-- Stories -->
|
|
70
|
-
<!-- ------------------------------ -->
|
|
71
|
-
|
|
72
|
-
<Story name="Default" asChild>
|
|
73
|
-
<RadioGroup id="Default">
|
|
74
|
-
<Radio id="Default-1" value="1">One</Radio>
|
|
75
|
-
<Radio id="Default-2" value="2">Two</Radio>
|
|
76
|
-
<Radio id="Default-3" value="3">Three</Radio>
|
|
77
|
-
</RadioGroup>
|
|
78
|
-
</Story>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import Radio from './Radio.svelte';
|
|
2
|
-
import type { RadioProps } from './Radio.svelte';
|
|
3
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
4
|
-
/**
|
|
5
|
-
* Storybook controls for Radio
|
|
6
|
-
*/
|
|
7
|
-
export declare const RadioArgTypes: Partial<ArgTypes<RadioProps>>;
|
|
8
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
9
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
10
|
-
$$bindings?: Bindings;
|
|
11
|
-
} & Exports;
|
|
12
|
-
(internal: unknown, props: {
|
|
13
|
-
$$events?: Events;
|
|
14
|
-
$$slots?: Slots;
|
|
15
|
-
}): Exports & {
|
|
16
|
-
$set?: any;
|
|
17
|
-
$on?: any;
|
|
18
|
-
};
|
|
19
|
-
z_$$bindings?: Bindings;
|
|
20
|
-
}
|
|
21
|
-
declare const Radio: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
}, {}, {}, string>;
|
|
24
|
-
type Radio = InstanceType<typeof Radio>;
|
|
25
|
-
export default Radio;
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import RadioGroup from './RadioGroup.svelte';
|
|
4
|
-
import type { RadioGroupProps } from './RadioGroup.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import Radio from './Radio/Radio.svelte';
|
|
7
|
-
import Theme from '../../Layout/Theme/Theme.svelte';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Storybook controls for RadioGroup
|
|
11
|
-
*/
|
|
12
|
-
export const RadioGroupArgTypes: Partial<ArgTypes<RadioGroupProps>> = {
|
|
13
|
-
// ------------------------------
|
|
14
|
-
// Core
|
|
15
|
-
// ------------------------------
|
|
16
|
-
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
17
|
-
disabled: {
|
|
18
|
-
control: { type: 'boolean' },
|
|
19
|
-
description: 'Disable interactions',
|
|
20
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
21
|
-
},
|
|
22
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
23
|
-
orientation: {
|
|
24
|
-
control: { type: 'select' },
|
|
25
|
-
options: ['horizontal', 'vertical'],
|
|
26
|
-
table: {
|
|
27
|
-
category: 'API',
|
|
28
|
-
subcategory: 'Base',
|
|
29
|
-
defaultValue: { summary: 'vertical' },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const { Story } = defineMeta({
|
|
35
|
-
component: RadioGroup,
|
|
36
|
-
tags: ['autodocs'],
|
|
37
|
-
argTypes: RadioGroupArgTypes,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
let myValue = $state<string>('3');
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
<!-- ------------------------------ -->
|
|
44
|
-
<!-- Stories -->
|
|
45
|
-
<!-- ------------------------------ -->
|
|
46
|
-
|
|
47
|
-
<!-- ------------------------------ -->
|
|
48
|
-
<!-- Stories -->
|
|
49
|
-
<!-- ------------------------------ -->
|
|
50
|
-
|
|
51
|
-
<Story name="Default" asChild>
|
|
52
|
-
<RadioGroup id="Default">
|
|
53
|
-
<Radio id="Default-1" value="1">One</Radio>
|
|
54
|
-
<Radio id="Default-2" value="2">Two</Radio>
|
|
55
|
-
<Radio id="Default-3" value="3">Three</Radio>
|
|
56
|
-
</RadioGroup>
|
|
57
|
-
</Story>
|
|
58
|
-
|
|
59
|
-
<Story name="Selected" asChild>
|
|
60
|
-
<RadioGroup id="Selected" bind:value={myValue}>
|
|
61
|
-
<Radio id="Selected-1" value="1">One</Radio>
|
|
62
|
-
<Radio id="Selected-2" value="2">Two</Radio>
|
|
63
|
-
<Radio id="Selected-3" value="3">Three</Radio>
|
|
64
|
-
</RadioGroup>
|
|
65
|
-
</Story>
|
|
66
|
-
|
|
67
|
-
<Story name="Horizontal" asChild>
|
|
68
|
-
<RadioGroup orientation="horizontal" id="Horizontal">
|
|
69
|
-
<Radio id="Horizontal-1" value="1">One</Radio>
|
|
70
|
-
<Radio id="Horizontal-2" value="2">Two</Radio>
|
|
71
|
-
<Radio id="Horizontal-3" value="3">Three</Radio>
|
|
72
|
-
</RadioGroup>
|
|
73
|
-
</Story>
|
|
74
|
-
|
|
75
|
-
<Story name="Solid" asChild>
|
|
76
|
-
<RadioGroup id="Solid" value="1">
|
|
77
|
-
<Radio id="Solid-1" value="1" variant="solid">One</Radio>
|
|
78
|
-
<Radio id="Solid-2" value="2" variant="solid">Two</Radio>
|
|
79
|
-
<Radio id="Solid-3" value="3" variant="solid">Three</Radio>
|
|
80
|
-
</RadioGroup>
|
|
81
|
-
</Story>
|
|
82
|
-
|
|
83
|
-
<Story name="NoOutline" asChild>
|
|
84
|
-
<RadioGroup id="NoOutline" value="1">
|
|
85
|
-
<Radio id="NoOutline-1" value="1" outline={false}>One</Radio>
|
|
86
|
-
<Radio id="NoOutline-2" value="2" outline={false}>Two</Radio>
|
|
87
|
-
<Radio id="NoOutline-3" value="3" outline={false}>Three</Radio>
|
|
88
|
-
</RadioGroup>
|
|
89
|
-
</Story>
|
|
90
|
-
|
|
91
|
-
<Story name="Disabled" asChild>
|
|
92
|
-
<RadioGroup disabled id="Disabled" value="1">
|
|
93
|
-
<Radio id="Disabled-1" value="1">One</Radio>
|
|
94
|
-
<Radio id="Disabled-2" value="2">Two</Radio>
|
|
95
|
-
<Radio id="Disabled-3" value="3">Three</Radio>
|
|
96
|
-
</RadioGroup>
|
|
97
|
-
</Story>
|
|
98
|
-
|
|
99
|
-
<Story name="DisabledRadio" asChild>
|
|
100
|
-
<RadioGroup id="DisabledRadio" value="2">
|
|
101
|
-
<Radio id="DisabledRadio-1" value="1" disabled>One (disabled)</Radio>
|
|
102
|
-
<Radio id="DisabledRadio-2" value="2">Two</Radio>
|
|
103
|
-
<Radio id="DisabledRadio-3" value="3">Three</Radio>
|
|
104
|
-
</RadioGroup>
|
|
105
|
-
</Story>
|
|
106
|
-
|
|
107
|
-
<Story name="Primary" asChild>
|
|
108
|
-
<RadioGroup id="Primary" value="1">
|
|
109
|
-
<Radio id="Primary-1" value="1" color="primary">One</Radio>
|
|
110
|
-
<Radio id="Primary-2" value="2" color="primary">Two</Radio>
|
|
111
|
-
<Radio id="Primary-3" value="3" color="primary">Three</Radio>
|
|
112
|
-
</RadioGroup>
|
|
113
|
-
</Story>
|
|
114
|
-
|
|
115
|
-
<Story name="Large" asChild>
|
|
116
|
-
<RadioGroup id="Large" value="1">
|
|
117
|
-
<Radio id="Large-1" value="1" size="large">One</Radio>
|
|
118
|
-
<Radio id="Large-2" value="2" size="large">Two</Radio>
|
|
119
|
-
<Radio id="Large-3" value="3" size="large">Three</Radio>
|
|
120
|
-
</RadioGroup>
|
|
121
|
-
</Story>
|
|
122
|
-
|
|
123
|
-
<Story name="Safe" asChild>
|
|
124
|
-
<RadioGroup id="Safe" value="1">
|
|
125
|
-
<Radio id="Safe-1" value="1" color="safe">One</Radio>
|
|
126
|
-
<Radio id="Safe-2" value="2" color="safe">Two</Radio>
|
|
127
|
-
<Radio id="Safe-3" value="3" color="safe">Three</Radio>
|
|
128
|
-
</RadioGroup>
|
|
129
|
-
</Story>
|
|
130
|
-
|
|
131
|
-
<Story name="Danger" asChild>
|
|
132
|
-
<RadioGroup id="Danger" value="1">
|
|
133
|
-
<Radio id="Danger-1" value="1" color="danger">One</Radio>
|
|
134
|
-
<Radio id="Danger-2" value="2" color="danger">Two</Radio>
|
|
135
|
-
<Radio id="Danger-3" value="3" color="danger">Three</Radio>
|
|
136
|
-
</RadioGroup>
|
|
137
|
-
</Story>
|
|
138
|
-
|
|
139
|
-
<Story name="onValueChange (Actions)" asChild>
|
|
140
|
-
<RadioGroup
|
|
141
|
-
id="onValueChange"
|
|
142
|
-
value="1"
|
|
143
|
-
onValueChange={(value: string) => {
|
|
144
|
-
alert('onValueChange');
|
|
145
|
-
console.log('onValueChange', value);
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
<Radio id="onValueChange-1" value="1">One</Radio>
|
|
149
|
-
<Radio id="onValueChange-2" value="2">Two</Radio>
|
|
150
|
-
<Radio id="onValueChange-3" value="3">Three</Radio>
|
|
151
|
-
</RadioGroup>
|
|
152
|
-
</Story>
|
|
153
|
-
|
|
154
|
-
<Story name="Light Theme" asChild>
|
|
155
|
-
<Theme type="light">
|
|
156
|
-
<RadioGroup value="1">
|
|
157
|
-
<Radio id="Light_theme-1" value="1">One</Radio>
|
|
158
|
-
<Radio id="Light_theme-2" value="2">Two</Radio>
|
|
159
|
-
<Radio id="Light_theme-3" value="3">Three</Radio>
|
|
160
|
-
</RadioGroup>
|
|
161
|
-
</Theme>
|
|
162
|
-
</Story>
|
|
163
|
-
|
|
164
|
-
<Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
|
|
165
|
-
<Theme type="dark">
|
|
166
|
-
<RadioGroup value="1">
|
|
167
|
-
<Radio id="Dark_theme-1" value="1">One</Radio>
|
|
168
|
-
<Radio id="Dark_theme-2" value="2">Two</Radio>
|
|
169
|
-
<Radio id="Dark_theme-3" value="3">Three</Radio>
|
|
170
|
-
</RadioGroup>
|
|
171
|
-
</Theme>
|
|
172
|
-
</Story>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import RadioGroup from './RadioGroup.svelte';
|
|
2
|
-
import type { RadioGroupProps } from './RadioGroup.svelte';
|
|
3
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
4
|
-
/**
|
|
5
|
-
* Storybook controls for RadioGroup
|
|
6
|
-
*/
|
|
7
|
-
export declare const RadioGroupArgTypes: Partial<ArgTypes<RadioGroupProps>>;
|
|
8
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
9
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
10
|
-
$$bindings?: Bindings;
|
|
11
|
-
} & Exports;
|
|
12
|
-
(internal: unknown, props: {
|
|
13
|
-
$$events?: Events;
|
|
14
|
-
$$slots?: Slots;
|
|
15
|
-
}): Exports & {
|
|
16
|
-
$set?: any;
|
|
17
|
-
$on?: any;
|
|
18
|
-
};
|
|
19
|
-
z_$$bindings?: Bindings;
|
|
20
|
-
}
|
|
21
|
-
declare const RadioGroup: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
}, {}, {}, string>;
|
|
24
|
-
type RadioGroup = InstanceType<typeof RadioGroup>;
|
|
25
|
-
export default RadioGroup;
|