@flightlesslabs/dodo-ui 0.22.2 → 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 +20 -34
  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,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,22 +0,0 @@
1
- import Column from './Column.svelte';
2
- import type { GridColumnProps } from './Column.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyColumnArgTypes: Partial<ArgTypes<GridColumnProps>>;
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 Column: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type Column = InstanceType<typeof Column>;
22
- export default Column;
@@ -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,22 +0,0 @@
1
- import Grid from './Grid.svelte';
2
- import type { GridProps } from './Grid.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyGridArgTypes: Partial<ArgTypes<GridProps>>;
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 Grid: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type Grid = InstanceType<typeof Grid>;
22
- export default Grid;
@@ -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,22 +0,0 @@
1
- import Row from './Row.svelte';
2
- import type { GridRowProps } from './Row.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- export declare const storyRowArgTypes: Partial<ArgTypes<GridRowProps>>;
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 Row: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
19
- [evt: string]: CustomEvent<any>;
20
- }, {}, {}, string>;
21
- type Row = InstanceType<typeof Row>;
22
- export default Row;
@@ -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 '../../../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,25 +0,0 @@
1
- import Theme from './Theme.svelte';
2
- import type { ThemeProps } from './Theme.svelte';
3
- import type { ArgTypes } from 'storybook/internal/csf';
4
- /**
5
- * Storybook controls for Theme
6
- */
7
- export declare const ThemeArgTypes: Partial<ArgTypes<ThemeProps>>;
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 Theme: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
22
- [evt: string]: CustomEvent<any>;
23
- }, {}, {}, string>;
24
- type Theme = InstanceType<typeof Theme>;
25
- export default Theme;
@@ -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
- ```
@@ -1,129 +0,0 @@
1
- type ControlType = 'object' | 'boolean' | 'check' | 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select' | 'number' | 'range' | 'file' | 'color' | 'date' | 'text';
2
- interface ControlBase {
3
- [key: string]: any;
4
- /** @see https://storybook.js.org/docs/api/arg-types#controltype */
5
- type?: ControlType;
6
- disable?: boolean;
7
- }
8
- type Control = ControlType | false | (ControlBase & (ControlBase | {
9
- type: 'color';
10
- /** @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors */
11
- presetColors?: string[];
12
- } | {
13
- type: 'file';
14
- /** @see https://storybook.js.org/docs/api/arg-types#controlaccept */
15
- accept?: string;
16
- } | {
17
- type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
18
- /** @see https://storybook.js.org/docs/api/arg-types#controllabels */
19
- labels?: {
20
- [options: string]: string;
21
- };
22
- } | {
23
- type: 'number' | 'range';
24
- /** @see https://storybook.js.org/docs/api/arg-types#controlmax */
25
- max?: number;
26
- /** @see https://storybook.js.org/docs/api/arg-types#controlmin */
27
- min?: number;
28
- /** @see https://storybook.js.org/docs/api/arg-types#controlstep */
29
- step?: number;
30
- }));
31
- type ConditionalTest = {
32
- truthy?: boolean;
33
- } | {
34
- exists: boolean;
35
- } | {
36
- eq: any;
37
- } | {
38
- neq: any;
39
- };
40
- type ConditionalValue = {
41
- arg: string;
42
- } | {
43
- global: string;
44
- };
45
- type Conditional = ConditionalValue & ConditionalTest;
46
- interface Args {
47
- [name: string]: any;
48
- }
49
- interface SBBaseType {
50
- required?: boolean;
51
- raw?: string;
52
- }
53
- type SBScalarType = SBBaseType & {
54
- name: 'boolean' | 'string' | 'number' | 'function' | 'symbol';
55
- };
56
- type SBArrayType = SBBaseType & {
57
- name: 'array';
58
- value: SBType;
59
- };
60
- type SBObjectType = SBBaseType & {
61
- name: 'object';
62
- value: Record<string, SBType>;
63
- };
64
- type SBEnumType = SBBaseType & {
65
- name: 'enum';
66
- value: (string | number)[];
67
- };
68
- type SBIntersectionType = SBBaseType & {
69
- name: 'intersection';
70
- value: SBType[];
71
- };
72
- type SBUnionType = SBBaseType & {
73
- name: 'union';
74
- value: SBType[];
75
- };
76
- type SBOtherType = SBBaseType & {
77
- name: 'other';
78
- value: string;
79
- };
80
- type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
81
- interface InputType {
82
- /** @see https://storybook.js.org/docs/api/arg-types#control */
83
- control?: Control;
84
- /** @see https://storybook.js.org/docs/api/arg-types#description */
85
- description?: string;
86
- /** @see https://storybook.js.org/docs/api/arg-types#if */
87
- if?: Conditional;
88
- /** @see https://storybook.js.org/docs/api/arg-types#mapping */
89
- mapping?: {
90
- [key: string]: any;
91
- };
92
- /** @see https://storybook.js.org/docs/api/arg-types#name */
93
- name?: string;
94
- /** @see https://storybook.js.org/docs/api/arg-types#options */
95
- options?: readonly any[];
96
- /** @see https://storybook.js.org/docs/api/arg-types#table */
97
- table?: {
98
- [key: string]: unknown;
99
- /** @see https://storybook.js.org/docs/api/arg-types#tablecategory */
100
- category?: string;
101
- /** @see https://storybook.js.org/docs/api/arg-types#tabledefaultvalue */
102
- defaultValue?: {
103
- summary?: string;
104
- detail?: string;
105
- };
106
- /** @see https://storybook.js.org/docs/api/arg-types#tabledisable */
107
- disable?: boolean;
108
- /** @see https://storybook.js.org/docs/api/arg-types#tablesubcategory */
109
- subcategory?: string;
110
- /** @see https://storybook.js.org/docs/api/arg-types#tabletype */
111
- type?: {
112
- summary?: string;
113
- detail?: string;
114
- };
115
- };
116
- /** @see https://storybook.js.org/docs/api/arg-types#type */
117
- type?: SBType | SBScalarType['name'];
118
- /**
119
- * @deprecated Use `table.defaultValue.summary` instead.
120
- * @see https://storybook.js.org/docs/api/arg-types#defaultvalue
121
- */
122
- defaultValue?: any;
123
- [key: string]: any;
124
- }
125
- export type ArgTypes<TArgs = Args> = {
126
- [name in keyof TArgs]: InputType;
127
- };
128
- export type StoryBookArgTypes = Partial<ArgTypes<Args>>;
129
- export {};
@@ -1 +0,0 @@
1
- export {};