@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.
Files changed (74) hide show
  1. package/README.md +1 -9
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.js +4 -0
  4. package/package.json +25 -35
  5. package/src/lib/index.ts +5 -0
  6. package/src/lib/utils/time/date-creator/createDate/createDate.test.ts +109 -0
  7. package/src/lib/utils/time/date-creator/createDateFactory/createDateFactory.test.ts +146 -0
  8. package/dist/Home.mdx +0 -69
  9. package/dist/components/Form/Button/Button.stories.svelte +0 -178
  10. package/dist/components/Form/Button/Button.stories.svelte.d.ts +0 -22
  11. package/dist/components/Form/Checkbox/Checkbox.stories.svelte +0 -132
  12. package/dist/components/Form/Checkbox/Checkbox.stories.svelte.d.ts +0 -25
  13. package/dist/components/Form/DatePicker/DatePicker.stories.svelte +0 -139
  14. package/dist/components/Form/DatePicker/DatePicker.stories.svelte.d.ts +0 -22
  15. package/dist/components/Form/FormField/FormField.stories.svelte +0 -48
  16. package/dist/components/Form/FormField/FormField.stories.svelte.d.ts +0 -25
  17. package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte +0 -166
  18. package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte.d.ts +0 -22
  19. package/dist/components/Form/Label/Label.stories.svelte +0 -31
  20. package/dist/components/Form/Label/Label.stories.svelte.d.ts +0 -25
  21. package/dist/components/Form/RadioGroup/Radio/Radio.stories.svelte +0 -78
  22. package/dist/components/Form/RadioGroup/Radio/Radio.stories.svelte.d.ts +0 -25
  23. package/dist/components/Form/RadioGroup/RadioGroup.stories.svelte +0 -172
  24. package/dist/components/Form/RadioGroup/RadioGroup.stories.svelte.d.ts +0 -25
  25. package/dist/components/Form/Select/Select.stories.svelte +0 -175
  26. package/dist/components/Form/Select/Select.stories.svelte.d.ts +0 -22
  27. package/dist/components/Form/Switch/Switch.stories.svelte +0 -128
  28. package/dist/components/Form/Switch/Switch.stories.svelte.d.ts +0 -25
  29. package/dist/components/Form/TextInput/TextInput.stories.svelte +0 -162
  30. package/dist/components/Form/TextInput/TextInput.stories.svelte.d.ts +0 -22
  31. package/dist/components/Form/UtilityButton/UtilityButton.stories.svelte +0 -163
  32. package/dist/components/Form/UtilityButton/UtilityButton.stories.svelte.d.ts +0 -22
  33. package/dist/components/Info/Calendar/Calendar.stories.svelte +0 -134
  34. package/dist/components/Info/Calendar/Calendar.stories.svelte.d.ts +0 -22
  35. package/dist/components/Layout/Card/Card.stories.svelte +0 -113
  36. package/dist/components/Layout/Card/Card.stories.svelte.d.ts +0 -22
  37. package/dist/components/Layout/Grid/Column/Column.stories.svelte +0 -66
  38. package/dist/components/Layout/Grid/Column/Column.stories.svelte.d.ts +0 -22
  39. package/dist/components/Layout/Grid/Grid.stories.svelte +0 -192
  40. package/dist/components/Layout/Grid/Grid.stories.svelte.d.ts +0 -22
  41. package/dist/components/Layout/Grid/Row/Row.stories.svelte +0 -39
  42. package/dist/components/Layout/Grid/Row/Row.stories.svelte.d.ts +0 -22
  43. package/dist/components/Layout/Theme/Theme.stories.svelte +0 -54
  44. package/dist/components/Layout/Theme/Theme.stories.svelte.d.ts +0 -25
  45. package/dist/components/Layout/Theme/ThemeSystem/index.mdx +0 -35
  46. package/dist/storybook-types.d.ts +0 -129
  47. package/dist/storybook-types.js +0 -1
  48. package/dist/utils/time/date-creator/createDate/createDate.mdx +0 -98
  49. package/dist/utils/time/date-creator/createDateFactory/createDateFactory.mdx +0 -104
  50. package/dist/utils/time/timeout/timeout.mdx +0 -114
  51. package/src/lib/Home.mdx +0 -69
  52. package/src/lib/components/Form/Button/Button.stories.svelte +0 -178
  53. package/src/lib/components/Form/Checkbox/Checkbox.stories.svelte +0 -132
  54. package/src/lib/components/Form/DatePicker/DatePicker.stories.svelte +0 -139
  55. package/src/lib/components/Form/FormField/FormField.stories.svelte +0 -48
  56. package/src/lib/components/Form/InputEnclosure/InputEnclosure.stories.svelte +0 -166
  57. package/src/lib/components/Form/Label/Label.stories.svelte +0 -31
  58. package/src/lib/components/Form/RadioGroup/Radio/Radio.stories.svelte +0 -78
  59. package/src/lib/components/Form/RadioGroup/RadioGroup.stories.svelte +0 -172
  60. package/src/lib/components/Form/Select/Select.stories.svelte +0 -175
  61. package/src/lib/components/Form/Switch/Switch.stories.svelte +0 -128
  62. package/src/lib/components/Form/TextInput/TextInput.stories.svelte +0 -162
  63. package/src/lib/components/Form/UtilityButton/UtilityButton.stories.svelte +0 -163
  64. package/src/lib/components/Info/Calendar/Calendar.stories.svelte +0 -134
  65. package/src/lib/components/Layout/Card/Card.stories.svelte +0 -113
  66. package/src/lib/components/Layout/Grid/Column/Column.stories.svelte +0 -66
  67. package/src/lib/components/Layout/Grid/Grid.stories.svelte +0 -192
  68. package/src/lib/components/Layout/Grid/Row/Row.stories.svelte +0 -39
  69. package/src/lib/components/Layout/Theme/Theme.stories.svelte +0 -54
  70. package/src/lib/components/Layout/Theme/ThemeSystem/index.mdx +0 -35
  71. package/src/lib/storybook-types.ts +0 -182
  72. package/src/lib/utils/time/date-creator/createDate/createDate.mdx +0 -98
  73. package/src/lib/utils/time/date-creator/createDateFactory/createDateFactory.mdx +0 -104
  74. package/src/lib/utils/time/timeout/timeout.mdx +0 -114
@@ -1,162 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import TextInput from './TextInput.svelte';
4
- import type { TextInputProps } from './TextInput.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
- Input box with powers ⚡
13
-
14
- \`\`\`ts
15
- import { TextInput } from '@flightlesslabs/dodo-ui';
16
- \`\`\`
17
- `;
18
-
19
- // ------------------------------
20
- // Storybook ArgTypes
21
- // ------------------------------
22
- export const storyTextInputArgTypes: Partial<ArgTypes<TextInputProps>> = {
23
- children: {
24
- table: { disable: true },
25
- control: false,
26
- },
27
-
28
- // ------------------------------
29
- // Core
30
- // ------------------------------
31
- class: { table: { category: 'API', subcategory: 'Base' } },
32
- placeholder: {
33
- control: { type: 'text' },
34
- table: { category: 'API', subcategory: 'Base' },
35
- },
36
- value: {
37
- control: { type: 'text' },
38
- table: { category: 'API', subcategory: 'Base' },
39
- },
40
- name: { table: { category: 'API', subcategory: 'Base' } },
41
-
42
- // ------------------------------
43
- // State
44
- // ------------------------------
45
- disabled: {
46
- control: { type: 'boolean' },
47
- description: 'Disabled state of the input',
48
- table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
49
- },
50
- focused: {
51
- control: { type: 'boolean' },
52
- description: 'Force focused visual state',
53
- table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
54
- },
55
- error: {
56
- control: { type: 'boolean' },
57
- description: 'Error visual state',
58
- table: { category: 'API', subcategory: 'State', defaultValue: { summary: 'false' } },
59
- },
60
-
61
- // ------------------------------
62
- // Appearance
63
- // ------------------------------
64
- size: {
65
- control: { type: 'select' },
66
- options: componentSizeOptions,
67
- description: 'Visual size token',
68
- table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'normal' } },
69
- },
70
- roundness: {
71
- control: { type: 'select' },
72
- options: componentRoundnessOptions,
73
- description: 'Border radius token',
74
- table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: '1' } },
75
- },
76
- outline: {
77
- control: { type: 'boolean' },
78
- description: 'Render outlined enclosure',
79
- table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'true' } },
80
- },
81
-
82
- // ------------------------------
83
- // Slots (Snippets)
84
- // ------------------------------
85
- before: {
86
- table: { category: 'API', subcategory: 'Slots' },
87
- description: 'Content rendered before the input',
88
- },
89
- after: {
90
- table: { category: 'API', subcategory: 'Slots' },
91
- description: 'Content rendered after the input',
92
- },
93
-
94
- // ------------------------------
95
- // Events
96
- // ------------------------------
97
- onfocus: { table: { category: 'API', subcategory: 'Events' }, action: 'focus' },
98
- onblur: { table: { category: 'API', subcategory: 'Events' }, action: 'blur' },
99
- oninput: { table: { category: 'API', subcategory: 'Events' }, action: 'input' },
100
- onchange: { table: { category: 'API', subcategory: 'Events' }, action: 'change' },
101
- };
102
-
103
- // ------------------------------
104
- // Storybook Meta
105
- // ------------------------------
106
- const { Story } = defineMeta({
107
- component: TextInput,
108
- tags: ['autodocs'],
109
- argTypes: storyTextInputArgTypes,
110
- parameters: {
111
- docs: {
112
- description: {
113
- component: description,
114
- },
115
- },
116
- },
117
- });
118
- </script>
119
-
120
- <!-- ------------------------------ -->
121
- <!-- Stories -->
122
- <!-- ------------------------------ -->
123
-
124
- <Story name="Default" args={{ placeholder: 'Type something…' }} />
125
-
126
- <Story name="Focused" args={{ placeholder: 'Focused state…', focused: true }} />
127
-
128
- <Story name="Error" args={{ placeholder: 'Error state…', error: true }} />
129
-
130
- <Story name="Large" args={{ placeholder: 'Type something…', size: 'large' }} />
131
-
132
- <Story name="Pill Shape" args={{ placeholder: 'Type something…', roundness: 'pill' }} />
133
-
134
- <Story name="Disabled" args={{ placeholder: 'Disabled state…', disabled: true }} />
135
-
136
- <Story name="With Before (Prefix Icon)" asChild>
137
- <TextInput placeholder="Search…">
138
- {#snippet before()}
139
- <span style="color: #888; padding-left: 8px">🔍</span>
140
- {/snippet}
141
- </TextInput>
142
- </Story>
143
-
144
- <Story name="With After (Suffix Text)" asChild>
145
- <TextInput placeholder="Website">
146
- {#snippet after()}
147
- <span style="color: #888; padding-right: 8px">.com</span>
148
- {/snippet}
149
- </TextInput>
150
- </Story>
151
-
152
- <Story name="Light Theme" asChild>
153
- <Theme type="light">
154
- <TextInput placeholder="Type something…" />
155
- </Theme>
156
- </Story>
157
-
158
- <Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
159
- <Theme type="dark">
160
- <TextInput placeholder="Type something…" />
161
- </Theme>
162
- </Story>
@@ -1,22 +0,0 @@
1
- import TextInput from './TextInput.svelte';
2
- import type { TextInputProps } from './TextInput.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyTextInputArgTypes: Partial<ArgTypes<TextInputProps>>;
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 TextInput: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type TextInput = InstanceType<typeof TextInput>;
22
- export default TextInput;
@@ -1,163 +0,0 @@
1
- <script module lang="ts">
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import UtilityButton from './UtilityButton.svelte';
4
- import type { UtilityButtonProps } from './UtilityButton.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 Theme from '../../Layout/Theme/Theme.svelte';
10
-
11
- const description = `
12
- A flexible small sized button component based on bits-ui [button](https://bits-ui.com/docs/components/button).
13
-
14
- \`\`\`ts
15
- import { UtilityButton } from '@flightlesslabs/dodo-ui';
16
- \`\`\`
17
- `;
18
-
19
- // ------------------------------
20
- // Storybook ArgTypes
21
- // ------------------------------
22
- export const storyUtilityButtonArgTypes: Partial<ArgTypes<UtilityButtonProps>> = {
23
- // ------------------------------
24
- // Core
25
- // ------------------------------
26
- children: { table: { category: 'API', subcategory: 'Base' } },
27
- href: {
28
- control: { type: 'text' },
29
- description: 'Render as Anchor when provided',
30
- table: { category: 'API', subcategory: 'Base' },
31
- },
32
- disabled: {
33
- control: { type: 'boolean' },
34
- description: 'Disable interactions',
35
- table: { category: 'API', subcategory: 'Base' },
36
- },
37
- class: { table: { category: 'API', subcategory: 'Base' } },
38
- type: { table: { category: 'API', subcategory: 'Base' } },
39
-
40
- // ------------------------------
41
- // Appearance
42
- // ------------------------------
43
- color: {
44
- control: { type: 'select' },
45
- options: componentColorOptions,
46
- description: 'Color theme token',
47
- table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'primary' } },
48
- },
49
- size: {
50
- control: { type: 'select' },
51
- options: componentSizeOptions,
52
- description: 'Visual size token',
53
- table: { category: 'API', subcategory: 'Appearance', defaultValue: { summary: 'normal' } },
54
- },
55
- roundness: {
56
- control: { type: 'select' },
57
- options: componentRoundnessOptions,
58
- description: 'Border radius token',
59
- table: { category: 'API', subcategory: 'Appearance' },
60
- },
61
- compact: {
62
- control: { type: 'boolean' },
63
- description: 'Compact spacing (icon buttons)',
64
- table: { category: 'API', subcategory: 'Appearance' },
65
- },
66
- outline: {
67
- control: { type: 'boolean' },
68
- description: 'Render outlined style',
69
- table: { category: 'API', subcategory: 'Appearance' },
70
- },
71
-
72
- // ------------------------------
73
- // Accessibility
74
- // ------------------------------
75
- 'aria-label': {
76
- control: { type: 'text' },
77
- description: 'Accessible label (required for icon-only buttons)',
78
- table: { category: 'API', subcategory: 'Accessibility' },
79
- },
80
-
81
- // ------------------------------
82
- // Events (Svelte-style)
83
- // ------------------------------
84
- onclick: { table: { category: 'API', subcategory: 'Events' }, action: 'click' },
85
- };
86
-
87
- // ------------------------------
88
- // Storybook Meta
89
- // ------------------------------
90
- const { Story } = defineMeta({
91
- component: UtilityButton,
92
- tags: ['autodocs'],
93
- argTypes: storyUtilityButtonArgTypes,
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">Click me!</Story>
109
-
110
- <Story
111
- name="Link Button"
112
- args={{
113
- href: 'https://www.w3schools.com/tags/tag_a.asp',
114
- target: '_blank',
115
- }}
116
- >
117
- Click me!
118
- </Story>
119
-
120
- <Story
121
- name="OnClick (Actions)"
122
- args={{
123
- onclick: (e: Event) => {
124
- const target = e.target as HTMLButtonElement;
125
- alert('Button Clicked');
126
- console.log('Button Clicked', target);
127
- },
128
- }}
129
- >
130
- Click me
131
- </Story>
132
-
133
- <Story name="Color" args={{ color: 'safe' }}>Click me</Story>
134
-
135
- <Story name="Outline" args={{ outline: true }}>Click me!</Story>
136
-
137
- <Story name="Size" args={{ size: 'large' }}>Click me!</Story>
138
-
139
- <Story name="Disabled" args={{ disabled: true }}>Click me!</Story>
140
-
141
- <Story name="Submit Button" args={{ type: 'submit' }}>Click me!</Story>
142
-
143
- <Story
144
- name="Compact"
145
- args={{
146
- compact: true,
147
- 'aria-label': 'Add item',
148
- }}
149
- >
150
- +
151
- </Story>
152
-
153
- <Story name="Light Theme" asChild>
154
- <Theme type="light">
155
- <UtilityButton>Click me!</UtilityButton>
156
- </Theme>
157
- </Story>
158
-
159
- <Story name="Dark Theme" asChild globals={{ backgrounds: { value: 'dark' } }}>
160
- <Theme type="dark">
161
- <UtilityButton>Click me!</UtilityButton>
162
- </Theme>
163
- </Story>
@@ -1,22 +0,0 @@
1
- import UtilityButton from './UtilityButton.svelte';
2
- import type { UtilityButtonProps } from './UtilityButton.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyUtilityButtonArgTypes: Partial<ArgTypes<UtilityButtonProps>>;
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 UtilityButton: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type UtilityButton = InstanceType<typeof UtilityButton>;
22
- export default UtilityButton;
@@ -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 '../../../attributes/roundness.js';
7
- import { CalendarDate, type DateValue } from '@internationalized/date';
8
- import Theme from '../../Layout/Theme/Theme.svelte';
9
- import { componentVariantOptions } from '../../../attributes/variant.js';
10
- import { cardColorOptions } from '../../Layout/Card/Card.svelte';
11
- import { componentThemeColorsOptions } from '../../../attributes/theme.js';
12
- import { ComponentShadowOptions } from '../../../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,22 +0,0 @@
1
- import Calendar from './Calendar.svelte';
2
- import type { CalendarProps } from './Calendar.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyCalendarArgTypes: Partial<ArgTypes<CalendarProps>>;
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 Calendar: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type Calendar = InstanceType<typeof Calendar>;
22
- export default Calendar;
@@ -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 '../../../attributes/variant.js';
7
- import { componentRoundnessOptions } from '../../../attributes/roundness.js';
8
- import { ComponentShadowOptions } from '../../../attributes/shadow.js';
9
- import { componentThemeColorsOptions } from '../../../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,22 +0,0 @@
1
- import Card from './Card.svelte';
2
- import type { CardProps } from './Card.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyCardArgTypes: Partial<ArgTypes<CardProps>>;
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 Card: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type Card = InstanceType<typeof Card>;
22
- export default Card;