@flightlesslabs/dodo-ui 0.22.1 → 0.23.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 -0
- package/dist/index.js +4 -0
- package/package.json +25 -35
- package/src/lib/index.ts +5 -0
- 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.stories.svelte +0 -139
- package/dist/components/Form/DatePicker/DatePicker.stories.svelte.d.ts +0 -22
- 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.stories.svelte +0 -134
- package/dist/components/Info/Calendar/Calendar.stories.svelte.d.ts +0 -22
- 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.stories.svelte +0 -139
- 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.stories.svelte +0 -134
- 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,134 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Calendar from './Calendar.svelte';
|
|
4
|
-
import type { CalendarProps } from './Calendar.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import { componentRoundnessOptions } from '$lib/attributes/roundness.js';
|
|
7
|
-
import { CalendarDate, type DateValue } from '@internationalized/date';
|
|
8
|
-
import Theme from '$lib/components/Layout/Theme/Theme.svelte';
|
|
9
|
-
import { componentVariantOptions } from '$lib/attributes/variant.js';
|
|
10
|
-
import { cardColorOptions } from '$lib/components/Layout/Card/Card.svelte';
|
|
11
|
-
import { componentThemeColorsOptions } from '$lib/attributes/theme.js';
|
|
12
|
-
import { ComponentShadowOptions } from '$lib/attributes/shadow.js';
|
|
13
|
-
|
|
14
|
-
const description = `
|
|
15
|
-
a plug and play Calendar component based on bits-ui [calendar](https://bits-ui.com/docs/components/calendar).
|
|
16
|
-
|
|
17
|
-
\`\`\`ts
|
|
18
|
-
import { Calendar } from '@flightlesslabs/dodo-ui';
|
|
19
|
-
\`\`\`
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
// ------------------------------
|
|
23
|
-
// Storybook ArgTypes
|
|
24
|
-
// ------------------------------
|
|
25
|
-
export const storyCalendarArgTypes: Partial<ArgTypes<CalendarProps>> = {
|
|
26
|
-
// ------------------------------
|
|
27
|
-
// Core
|
|
28
|
-
// ------------------------------
|
|
29
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
30
|
-
value: {
|
|
31
|
-
control: { type: 'text' },
|
|
32
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
// ------------------------------
|
|
36
|
-
// State
|
|
37
|
-
// ------------------------------
|
|
38
|
-
disabled: {
|
|
39
|
-
control: { type: 'boolean' },
|
|
40
|
-
description: 'Disabled state of the input',
|
|
41
|
-
table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
// ------------------------------
|
|
45
|
-
// Appearance
|
|
46
|
-
// ------------------------------
|
|
47
|
-
shadow: {
|
|
48
|
-
control: { type: 'select' },
|
|
49
|
-
options: ComponentShadowOptions,
|
|
50
|
-
description: 'Component Shadow',
|
|
51
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: '1' } },
|
|
52
|
-
},
|
|
53
|
-
color: {
|
|
54
|
-
control: { type: 'select' },
|
|
55
|
-
options: cardColorOptions,
|
|
56
|
-
description: 'Color theme token',
|
|
57
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'default' } },
|
|
58
|
-
},
|
|
59
|
-
variant: {
|
|
60
|
-
control: { type: 'select' },
|
|
61
|
-
options: componentVariantOptions,
|
|
62
|
-
description: 'Visual variant of the card',
|
|
63
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'text' } },
|
|
64
|
-
},
|
|
65
|
-
roundness: {
|
|
66
|
-
control: { type: 'select' },
|
|
67
|
-
options: componentRoundnessOptions,
|
|
68
|
-
description: 'Border radius token',
|
|
69
|
-
table: { category: 'API', subcategory: 'Appearance' },
|
|
70
|
-
},
|
|
71
|
-
outline: {
|
|
72
|
-
control: { type: 'boolean' },
|
|
73
|
-
description: 'Render outlined style',
|
|
74
|
-
table: { category: 'API', subcategory: 'Appearance' },
|
|
75
|
-
},
|
|
76
|
-
active: {
|
|
77
|
-
control: { type: 'boolean' },
|
|
78
|
-
description: 'Add mouse hover and active effects',
|
|
79
|
-
table: { category: 'API', subcategory: 'Appearance' },
|
|
80
|
-
},
|
|
81
|
-
theme: {
|
|
82
|
-
control: { type: 'select' },
|
|
83
|
-
options: componentThemeColorsOptions,
|
|
84
|
-
description: 'Theme color',
|
|
85
|
-
table: { category: 'API', subcategory: 'Base', defaultValue: { summary: 'undefined' } },
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
// ------------------------------
|
|
90
|
-
// Storybook Meta
|
|
91
|
-
// ------------------------------
|
|
92
|
-
const { Story } = defineMeta({
|
|
93
|
-
component: Calendar,
|
|
94
|
-
tags: ['autodocs'],
|
|
95
|
-
argTypes: storyCalendarArgTypes,
|
|
96
|
-
parameters: {
|
|
97
|
-
docs: {
|
|
98
|
-
description: {
|
|
99
|
-
component: description,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
let myValue = $state<DateValue>(new CalendarDate(2026, 4, 7));
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<!-- ------------------------------ -->
|
|
109
|
-
<!-- Stories -->
|
|
110
|
-
<!-- ------------------------------ -->
|
|
111
|
-
|
|
112
|
-
<Story name="Default" />
|
|
113
|
-
|
|
114
|
-
<Story name="Controlled" asChild>
|
|
115
|
-
<Calendar bind:value={myValue} />
|
|
116
|
-
</Story>
|
|
117
|
-
|
|
118
|
-
<Story name="Starts On Sunday" args={{ weekStartsOn: 0 }} />
|
|
119
|
-
|
|
120
|
-
<Story name="Min Date" args={{ minValue: new CalendarDate(2026, 4, 7) }} />
|
|
121
|
-
|
|
122
|
-
<Story name="Max Date" args={{ maxValue: new CalendarDate(2026, 4, 7) }} />
|
|
123
|
-
|
|
124
|
-
<Story name="Light Theme" asChild>
|
|
125
|
-
<Theme type="light">
|
|
126
|
-
<Calendar />
|
|
127
|
-
</Theme>
|
|
128
|
-
</Story>
|
|
129
|
-
|
|
130
|
-
<Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
|
|
131
|
-
<Theme type="dark">
|
|
132
|
-
<Calendar />
|
|
133
|
-
</Theme>
|
|
134
|
-
</Story>
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Card, { cardColorOptions } from './Card.svelte';
|
|
4
|
-
import type { CardProps } from './Card.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import { componentVariantOptions } from '$lib/attributes/variant.js';
|
|
7
|
-
import { componentRoundnessOptions } from '$lib/attributes/roundness.js';
|
|
8
|
-
import { ComponentShadowOptions } from '$lib/attributes/shadow.js';
|
|
9
|
-
import { componentThemeColorsOptions } from '$lib/attributes/theme.js';
|
|
10
|
-
|
|
11
|
-
const description = `
|
|
12
|
-
a simple, customizable, and re-usable card component
|
|
13
|
-
|
|
14
|
-
\`\`\`ts
|
|
15
|
-
import { Card } from '@flightlesslabs/dodo-ui';
|
|
16
|
-
\`\`\`
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
// ------------------------------
|
|
20
|
-
// Storybook ArgTypes
|
|
21
|
-
// ------------------------------
|
|
22
|
-
export const storyCardArgTypes: Partial<ArgTypes<CardProps>> = {
|
|
23
|
-
// ------------------------------
|
|
24
|
-
// Core
|
|
25
|
-
// ------------------------------
|
|
26
|
-
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
27
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
28
|
-
|
|
29
|
-
// ------------------------------
|
|
30
|
-
// Appearance
|
|
31
|
-
// ------------------------------
|
|
32
|
-
shadow: {
|
|
33
|
-
control: { type: 'select' },
|
|
34
|
-
options: ComponentShadowOptions,
|
|
35
|
-
description: 'Component Shadow',
|
|
36
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: '1' } },
|
|
37
|
-
},
|
|
38
|
-
color: {
|
|
39
|
-
control: { type: 'select' },
|
|
40
|
-
options: cardColorOptions,
|
|
41
|
-
description: 'Color theme token',
|
|
42
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'default' } },
|
|
43
|
-
},
|
|
44
|
-
variant: {
|
|
45
|
-
control: { type: 'select' },
|
|
46
|
-
options: componentVariantOptions,
|
|
47
|
-
description: 'Visual variant of the card',
|
|
48
|
-
table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'text' } },
|
|
49
|
-
},
|
|
50
|
-
roundness: {
|
|
51
|
-
control: { type: 'select' },
|
|
52
|
-
options: componentRoundnessOptions,
|
|
53
|
-
description: 'Border radius token',
|
|
54
|
-
table: { category: 'API', subcategory: 'Appearance' },
|
|
55
|
-
},
|
|
56
|
-
outline: {
|
|
57
|
-
control: { type: 'boolean' },
|
|
58
|
-
description: 'Render outlined style',
|
|
59
|
-
table: { category: 'API', subcategory: 'Appearance' },
|
|
60
|
-
},
|
|
61
|
-
active: {
|
|
62
|
-
control: { type: 'boolean' },
|
|
63
|
-
description: 'Add mouse hover and active effects',
|
|
64
|
-
table: { category: 'API', subcategory: 'Appearance' },
|
|
65
|
-
},
|
|
66
|
-
theme: {
|
|
67
|
-
control: { type: 'select' },
|
|
68
|
-
options: componentThemeColorsOptions,
|
|
69
|
-
description: 'Theme color',
|
|
70
|
-
table: { category: 'API', subcategory: 'Base', defaultValue: { summary: 'undefined' } },
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// ------------------------------
|
|
75
|
-
// Storybook Meta
|
|
76
|
-
// ------------------------------
|
|
77
|
-
const { Story } = defineMeta({
|
|
78
|
-
component: Card,
|
|
79
|
-
tags: ['autodocs'],
|
|
80
|
-
argTypes: storyCardArgTypes,
|
|
81
|
-
parameters: {
|
|
82
|
-
docs: {
|
|
83
|
-
description: {
|
|
84
|
-
component: description,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<!-- ------------------------------ -->
|
|
92
|
-
<!-- Stories -->
|
|
93
|
-
<!-- ------------------------------ -->
|
|
94
|
-
|
|
95
|
-
<Story name="Default"><p>Hello there</p></Story>
|
|
96
|
-
|
|
97
|
-
<Story name="Color" args={{ color: 'safe' }}><p>Hello there</p></Story>
|
|
98
|
-
|
|
99
|
-
<Story name="Active" args={{ color: 'primary', active: true }}><p>Hello there</p></Story>
|
|
100
|
-
|
|
101
|
-
<Story name="Solid" args={{ color: 'primary', variant: 'solid' }}><p>Hello there</p></Story>
|
|
102
|
-
|
|
103
|
-
<Story name="Outline" args={{ outline: true, shadow: 0 }}><p>Hello there</p></Story>
|
|
104
|
-
|
|
105
|
-
<Story name="Fixed Size" args={{ height: '200px', width: '250px' }}><p>Hello there</p></Story>
|
|
106
|
-
|
|
107
|
-
<Story name="Light Theme" args={{ theme: 'light' }}>
|
|
108
|
-
<p>Hello there</p>
|
|
109
|
-
</Story>
|
|
110
|
-
|
|
111
|
-
<Story name="Dark Theme" args={{ theme: 'dark' }} globals={{ backgrounds: { value: 'dark' } }}>
|
|
112
|
-
<p>Hello there</p>
|
|
113
|
-
</Story>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Column, { gridColumnSizeOptions } from './Column.svelte';
|
|
4
|
-
import type { GridColumnProps } from './Column.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
|
|
7
|
-
// ------------------------------
|
|
8
|
-
// Storybook ArgTypes
|
|
9
|
-
// ------------------------------
|
|
10
|
-
export const storyColumnArgTypes: Partial<ArgTypes<GridColumnProps>> = {
|
|
11
|
-
// ------------------------------
|
|
12
|
-
// Core
|
|
13
|
-
// ------------------------------
|
|
14
|
-
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
15
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
16
|
-
|
|
17
|
-
// ------------------------------
|
|
18
|
-
// Size
|
|
19
|
-
// ------------------------------
|
|
20
|
-
size: {
|
|
21
|
-
control: { type: 'select' },
|
|
22
|
-
options: gridColumnSizeOptions,
|
|
23
|
-
table: { category: 'API', subcategory: 'Size', defaultValue: { summary: '12' } },
|
|
24
|
-
},
|
|
25
|
-
sm: {
|
|
26
|
-
control: { type: 'select' },
|
|
27
|
-
options: gridColumnSizeOptions,
|
|
28
|
-
table: { category: 'API', subcategory: 'Size' },
|
|
29
|
-
},
|
|
30
|
-
md: {
|
|
31
|
-
control: { type: 'select' },
|
|
32
|
-
options: gridColumnSizeOptions,
|
|
33
|
-
table: { category: 'API', subcategory: 'Size' },
|
|
34
|
-
},
|
|
35
|
-
lg: {
|
|
36
|
-
control: { type: 'select' },
|
|
37
|
-
options: gridColumnSizeOptions,
|
|
38
|
-
table: { category: 'API', subcategory: 'Size' },
|
|
39
|
-
},
|
|
40
|
-
xl: {
|
|
41
|
-
control: { type: 'select' },
|
|
42
|
-
options: gridColumnSizeOptions,
|
|
43
|
-
table: { category: 'API', subcategory: 'Size' },
|
|
44
|
-
},
|
|
45
|
-
xxl: {
|
|
46
|
-
control: { type: 'select' },
|
|
47
|
-
options: gridColumnSizeOptions,
|
|
48
|
-
table: { category: 'API', subcategory: 'Size' },
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// ------------------------------
|
|
53
|
-
// Storybook Meta
|
|
54
|
-
// ------------------------------
|
|
55
|
-
const { Story } = defineMeta({
|
|
56
|
-
component: Column,
|
|
57
|
-
tags: ['autodocs'],
|
|
58
|
-
argTypes: storyColumnArgTypes,
|
|
59
|
-
});
|
|
60
|
-
</script>
|
|
61
|
-
|
|
62
|
-
<!-- ------------------------------ -->
|
|
63
|
-
<!-- Stories -->
|
|
64
|
-
<!-- ------------------------------ -->
|
|
65
|
-
|
|
66
|
-
<Story name="Default">Hello there</Story>
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Grid from './Grid.svelte';
|
|
4
|
-
import type { GridProps } from './Grid.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import Column from './Column/Column.svelte';
|
|
7
|
-
import Card from '../Card/Card.svelte';
|
|
8
|
-
import Row from './Row/Row.svelte';
|
|
9
|
-
|
|
10
|
-
const description = `
|
|
11
|
-
a set of components for your basic "12 column grid" needs
|
|
12
|
-
|
|
13
|
-
\`\`\`ts
|
|
14
|
-
import { Grid, Column, Row } from '@flightlesslabs/dodo-ui';
|
|
15
|
-
\`\`\`
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
// ------------------------------
|
|
19
|
-
// Storybook ArgTypes
|
|
20
|
-
// ------------------------------
|
|
21
|
-
export const storyGridArgTypes: Partial<ArgTypes<GridProps>> = {
|
|
22
|
-
// ------------------------------
|
|
23
|
-
// Core
|
|
24
|
-
// ------------------------------
|
|
25
|
-
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
26
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
27
|
-
gap: { table: { category: 'API', subcategory: 'Base', defaultValue: { summary: '1' } } },
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// ------------------------------
|
|
31
|
-
// Storybook Meta
|
|
32
|
-
// ------------------------------
|
|
33
|
-
const { Story } = defineMeta({
|
|
34
|
-
component: Grid,
|
|
35
|
-
tags: ['autodocs'],
|
|
36
|
-
argTypes: storyGridArgTypes,
|
|
37
|
-
parameters: {
|
|
38
|
-
docs: {
|
|
39
|
-
description: {
|
|
40
|
-
component: description,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<!-- ------------------------------ -->
|
|
48
|
-
<!-- Stories -->
|
|
49
|
-
<!-- ------------------------------ -->
|
|
50
|
-
|
|
51
|
-
<!-- Basic 12 column grid -->
|
|
52
|
-
<Story name="Default">
|
|
53
|
-
<Column sm={4}>Hello there</Column>
|
|
54
|
-
<Column sm={4}>Hello there</Column>
|
|
55
|
-
<Column sm={4}>Hello there</Column>
|
|
56
|
-
<Column sm={4}>Hello there</Column>
|
|
57
|
-
<Column sm={4}>Hello there</Column>
|
|
58
|
-
</Story>
|
|
59
|
-
|
|
60
|
-
<Story name="Example">
|
|
61
|
-
<Column sm={4}>
|
|
62
|
-
<Card color="primary">
|
|
63
|
-
<p>Hello there</p>
|
|
64
|
-
</Card>
|
|
65
|
-
</Column>
|
|
66
|
-
<Column sm={4}>
|
|
67
|
-
<Card color="primary">
|
|
68
|
-
<p>Hello there</p>
|
|
69
|
-
</Card>
|
|
70
|
-
</Column>
|
|
71
|
-
<Column sm={4}>
|
|
72
|
-
<Card color="primary">
|
|
73
|
-
<p>Hello there</p>
|
|
74
|
-
</Card>
|
|
75
|
-
</Column>
|
|
76
|
-
<Column sm={4}>
|
|
77
|
-
<Card color="primary">
|
|
78
|
-
<p>Hello there</p>
|
|
79
|
-
</Card>
|
|
80
|
-
</Column>
|
|
81
|
-
</Story>
|
|
82
|
-
|
|
83
|
-
<Story name="Grid Row">
|
|
84
|
-
<Row>
|
|
85
|
-
<Column sm={6} md={4} lg={3}>
|
|
86
|
-
<Card color="primary">
|
|
87
|
-
<p>Hello there</p>
|
|
88
|
-
</Card>
|
|
89
|
-
</Column>
|
|
90
|
-
<Column sm={6} md={4} lg={3}>
|
|
91
|
-
<Card color="primary">
|
|
92
|
-
<p>Hello there</p>
|
|
93
|
-
</Card>
|
|
94
|
-
</Column>
|
|
95
|
-
<Column sm={6} md={4} lg={3}>
|
|
96
|
-
<Card color="primary">
|
|
97
|
-
<p>Hello there</p>
|
|
98
|
-
</Card>
|
|
99
|
-
</Column>
|
|
100
|
-
</Row>
|
|
101
|
-
<Row>
|
|
102
|
-
<Column sm={6} md={4} lg={3}>
|
|
103
|
-
<Card color="primary">
|
|
104
|
-
<p>Hello there</p>
|
|
105
|
-
</Card>
|
|
106
|
-
</Column>
|
|
107
|
-
<Column sm={6} md={4} lg={3}>
|
|
108
|
-
<Card color="primary">
|
|
109
|
-
<p>Hello there</p>
|
|
110
|
-
</Card>
|
|
111
|
-
</Column>
|
|
112
|
-
<Column sm={6} md={4} lg={3}>
|
|
113
|
-
<Card color="primary">
|
|
114
|
-
<p>Hello there</p>
|
|
115
|
-
</Card>
|
|
116
|
-
</Column>
|
|
117
|
-
</Row>
|
|
118
|
-
</Story>
|
|
119
|
-
|
|
120
|
-
<Story name="Gap" args={{ gap: 2 }}>
|
|
121
|
-
<Column sm={4}>
|
|
122
|
-
<Card color="primary">
|
|
123
|
-
<p>Hello there</p>
|
|
124
|
-
</Card>
|
|
125
|
-
</Column>
|
|
126
|
-
<Column sm={4}>
|
|
127
|
-
<Card color="primary">
|
|
128
|
-
<p>Hello there</p>
|
|
129
|
-
</Card>
|
|
130
|
-
</Column>
|
|
131
|
-
<Column sm={4}>
|
|
132
|
-
<Card color="primary">
|
|
133
|
-
<p>Hello there</p>
|
|
134
|
-
</Card>
|
|
135
|
-
</Column>
|
|
136
|
-
<Column sm={4}>
|
|
137
|
-
<Card color="primary">
|
|
138
|
-
<p>Hello there</p>
|
|
139
|
-
</Card>
|
|
140
|
-
</Column>
|
|
141
|
-
</Story>
|
|
142
|
-
|
|
143
|
-
<Story name="Responsive">
|
|
144
|
-
<Column sm={6} md={4} lg={3}>
|
|
145
|
-
<Card color="primary">
|
|
146
|
-
<p>Hello there</p>
|
|
147
|
-
</Card>
|
|
148
|
-
</Column>
|
|
149
|
-
<Column sm={6} md={4} lg={3}>
|
|
150
|
-
<Card color="primary">
|
|
151
|
-
<p>Hello there</p>
|
|
152
|
-
</Card>
|
|
153
|
-
</Column>
|
|
154
|
-
<Column sm={6} md={4} lg={3}>
|
|
155
|
-
<Card color="primary">
|
|
156
|
-
<p>Hello there</p>
|
|
157
|
-
</Card>
|
|
158
|
-
</Column>
|
|
159
|
-
<Column sm={6} md={4} lg={3}>
|
|
160
|
-
<Card color="primary">
|
|
161
|
-
<p>Hello there</p>
|
|
162
|
-
</Card>
|
|
163
|
-
</Column>
|
|
164
|
-
<Column sm={6} md={4} lg={3}>
|
|
165
|
-
<Card color="primary">
|
|
166
|
-
<p>Hello there</p>
|
|
167
|
-
</Card>
|
|
168
|
-
</Column>
|
|
169
|
-
<Column sm={6} md={4} lg={3}>
|
|
170
|
-
<Card color="primary">
|
|
171
|
-
<p>Hello there</p>
|
|
172
|
-
</Card>
|
|
173
|
-
</Column>
|
|
174
|
-
</Story>
|
|
175
|
-
|
|
176
|
-
<Story name="Flex">
|
|
177
|
-
<Column md="flex">
|
|
178
|
-
<Card color="primary">
|
|
179
|
-
<p>Hello there</p>
|
|
180
|
-
</Card>
|
|
181
|
-
</Column>
|
|
182
|
-
<Column md={2}>
|
|
183
|
-
<Card color="primary">
|
|
184
|
-
<p>Hello there</p>
|
|
185
|
-
</Card>
|
|
186
|
-
</Column>
|
|
187
|
-
<Column md={2}>
|
|
188
|
-
<Card color="primary">
|
|
189
|
-
<p>Hello there</p>
|
|
190
|
-
</Card>
|
|
191
|
-
</Column>
|
|
192
|
-
</Story>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Row from './Row.svelte';
|
|
4
|
-
import type { GridRowProps } from './Row.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import Column from '../Column/Column.svelte';
|
|
7
|
-
|
|
8
|
-
// ------------------------------
|
|
9
|
-
// Storybook ArgTypes
|
|
10
|
-
// ------------------------------
|
|
11
|
-
export const storyRowArgTypes: Partial<ArgTypes<GridRowProps>> = {
|
|
12
|
-
// ------------------------------
|
|
13
|
-
// Core
|
|
14
|
-
// ------------------------------
|
|
15
|
-
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
16
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// ------------------------------
|
|
20
|
-
// Storybook Meta
|
|
21
|
-
// ------------------------------
|
|
22
|
-
const { Story } = defineMeta({
|
|
23
|
-
component: Row,
|
|
24
|
-
tags: ['autodocs'],
|
|
25
|
-
argTypes: storyRowArgTypes,
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<!-- ------------------------------ -->
|
|
30
|
-
<!-- Stories -->
|
|
31
|
-
<!-- ------------------------------ -->
|
|
32
|
-
|
|
33
|
-
<Story name="Default">
|
|
34
|
-
<Column sm={4}>Hello there</Column>
|
|
35
|
-
<Column sm={4}>Hello there</Column>
|
|
36
|
-
<Column sm={4}>Hello there</Column>
|
|
37
|
-
<Column sm={4}>Hello there</Column>
|
|
38
|
-
<Column sm={4}>Hello there</Column>
|
|
39
|
-
</Story>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Theme from './Theme.svelte';
|
|
4
|
-
import type { ThemeProps } from './Theme.svelte';
|
|
5
|
-
import type { ArgTypes } from 'storybook/internal/csf';
|
|
6
|
-
import { componentThemeOptions } from '$lib/attributes/theme.js';
|
|
7
|
-
|
|
8
|
-
const description = `
|
|
9
|
-
Wrap your app at the root with Theme to provide a consistent light or dark class (based on system or override) to all child components
|
|
10
|
-
|
|
11
|
-
\`\`\`ts
|
|
12
|
-
import { Theme } from '@flightlesslabs/dodo-ui';
|
|
13
|
-
\`\`\`
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Storybook controls for Theme
|
|
18
|
-
*/
|
|
19
|
-
export const ThemeArgTypes: Partial<ArgTypes<ThemeProps>> = {
|
|
20
|
-
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
21
|
-
type: {
|
|
22
|
-
control: { type: 'select' },
|
|
23
|
-
options: componentThemeOptions,
|
|
24
|
-
description: 'Theme color type: auto by defualt',
|
|
25
|
-
table: { category: 'API', subcategory: 'Base', defaultValue: { summary: 'auto' } },
|
|
26
|
-
},
|
|
27
|
-
global: {
|
|
28
|
-
table: { category: 'API', subcategory: 'Base' },
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const { Story } = defineMeta({
|
|
33
|
-
component: Theme,
|
|
34
|
-
tags: ['autodocs'],
|
|
35
|
-
argTypes: ThemeArgTypes,
|
|
36
|
-
parameters: {
|
|
37
|
-
docs: {
|
|
38
|
-
description: {
|
|
39
|
-
component: description,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<!-- ------------------------------ -->
|
|
47
|
-
<!-- Stories -->
|
|
48
|
-
<!-- ------------------------------ -->
|
|
49
|
-
|
|
50
|
-
<Story name="Default"></Story>
|
|
51
|
-
|
|
52
|
-
<Story name="Light" args={{ type: 'light' }}></Story>
|
|
53
|
-
|
|
54
|
-
<Story name="Dark" args={{ type: 'dark' }} globals={{ backgrounds: { value: 'dark' } }}></Story>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# 🎨 Theme System
|
|
2
|
-
|
|
3
|
-
A lightweight theme system built using context + local store.
|
|
4
|
-
|
|
5
|
-
## 🧩 Theme Context
|
|
6
|
-
|
|
7
|
-
### 📦 Import
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import { useThemeContext } from '@flightlesslabs/dodo-ui';
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Provides access to the active theme.
|
|
14
|
-
|
|
15
|
-
### Usage
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
const { theme } = useThemeContext();
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## 🏪 Theme Store
|
|
22
|
-
|
|
23
|
-
Global theme state.
|
|
24
|
-
|
|
25
|
-
### 📦 Import
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
import { useThemeStore } from '@flightlesslabs/dodo-ui';
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Read
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
const theme = useThemeStore.theme;
|
|
35
|
-
```
|