@flightlesslabs/dodo-ui 0.20.0 → 0.22.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 +2 -205
- package/dist/components/Form/Button/ButtonAsAnchor.svelte +1 -1
- package/dist/components/Form/DatePicker/DatePicker.scss +0 -26
- package/dist/components/Form/DatePicker/DatePicker.svelte +8 -1
- package/dist/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte +3 -1
- package/dist/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte +1 -1
- package/dist/components/Form/InputEnclosure/InputEnclosure.scss +34 -0
- package/dist/components/Form/InputEnclosure/InputEnclosure.stories.svelte +11 -11
- package/dist/components/Form/Label/Label.svelte +1 -1
- package/dist/components/Form/Select/Select.scss +0 -27
- package/dist/components/Form/Select/SelectInput.svelte +4 -1
- package/dist/components/Form/TextInput/TextInput.svelte +3 -3
- package/dist/components/Layout/Card/Card.stories.svelte +1 -2
- package/dist/components/Layout/Card/Card.svelte +1 -1
- package/dist/components/Layout/Card/Card.svelte.d.ts +1 -1
- package/dist/components/Layout/Grid/Column/Column.scss +78 -0
- package/dist/components/Layout/Grid/Column/Column.stories.svelte +66 -0
- package/dist/components/Layout/Grid/Column/Column.stories.svelte.d.ts +22 -0
- package/dist/components/Layout/Grid/Column/Column.svelte +79 -0
- package/dist/components/Layout/Grid/Column/Column.svelte.d.ts +33 -0
- package/dist/components/Layout/Grid/Grid.scss +8 -0
- package/dist/components/Layout/Grid/Grid.stories.svelte +177 -0
- package/dist/components/Layout/Grid/Grid.stories.svelte.d.ts +22 -0
- package/dist/components/Layout/Grid/Grid.svelte +32 -0
- package/dist/components/Layout/Grid/Grid.svelte.d.ts +12 -0
- package/dist/components/Layout/Grid/Row/Row.scss +7 -0
- package/dist/components/Layout/Grid/Row/Row.stories.svelte +39 -0
- package/dist/components/Layout/Grid/Row/Row.stories.svelte.d.ts +22 -0
- package/dist/components/Layout/Grid/Row/Row.svelte +21 -0
- package/dist/components/Layout/Grid/Row/Row.svelte.d.ts +10 -0
- package/dist/components/Layout/Theme/ThemeSystem/index.mdx +53 -53
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/styles/components.css +478 -68
- package/dist/styles/components.css.map +1 -1
- package/dist/styles/components.scss +3 -1
- package/package.json +1 -1
- package/src/lib/components/Form/Button/ButtonAsAnchor.svelte +1 -1
- package/src/lib/components/Form/DatePicker/DatePicker.scss +0 -26
- package/src/lib/components/Form/DatePicker/DatePicker.svelte +8 -1
- package/src/lib/components/Form/DatePicker/DatePickerInput/DatePickerInput.svelte +3 -1
- package/src/lib/components/Form/DatePicker/DatePickerPopup/CalendarGrid.svelte +1 -1
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.scss +34 -0
- package/src/lib/components/Form/InputEnclosure/InputEnclosure.stories.svelte +11 -11
- package/src/lib/components/Form/Label/Label.svelte +1 -1
- package/src/lib/components/Form/Select/Select.scss +0 -27
- package/src/lib/components/Form/Select/SelectInput.svelte +4 -1
- package/src/lib/components/Form/TextInput/TextInput.svelte +3 -3
- package/src/lib/components/Layout/Card/Card.stories.svelte +1 -2
- package/src/lib/components/Layout/Card/Card.svelte +1 -1
- package/src/lib/components/Layout/Grid/Column/Column.scss +78 -0
- package/src/lib/components/Layout/Grid/Column/Column.stories.svelte +66 -0
- package/src/lib/components/Layout/Grid/Column/Column.svelte +79 -0
- package/src/lib/components/Layout/Grid/Grid.scss +8 -0
- package/src/lib/components/Layout/Grid/Grid.stories.svelte +177 -0
- package/src/lib/components/Layout/Grid/Grid.svelte +32 -0
- package/src/lib/components/Layout/Grid/Row/Row.scss +7 -0
- package/src/lib/components/Layout/Grid/Row/Row.stories.svelte +39 -0
- package/src/lib/components/Layout/Grid/Row/Row.svelte +21 -0
- package/src/lib/components/Layout/Theme/ThemeSystem/index.mdx +53 -53
- package/src/lib/index.ts +17 -0
- package/src/lib/styles/components.scss +3 -1
- package/dist/components/Form/TextInput/TextInput.scss +0 -34
- package/src/lib/components/Form/TextInput/TextInput.scss +0 -34
|
@@ -0,0 +1,66 @@
|
|
|
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>
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export const GRID_COLUMN_BREAKPOINT = {
|
|
5
|
+
numerical: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
6
|
+
flex: ['flex'],
|
|
7
|
+
} as const;
|
|
8
|
+
|
|
9
|
+
export type GridColumnSizeNumerical = (typeof GRID_COLUMN_BREAKPOINT.numerical)[number];
|
|
10
|
+
type GridColumnSizeFlex = (typeof GRID_COLUMN_BREAKPOINT.flex)[number];
|
|
11
|
+
export type GridColumnSize = GridColumnSizeNumerical | GridColumnSizeFlex;
|
|
12
|
+
|
|
13
|
+
export const gridColumnSizeOptions = [
|
|
14
|
+
...GRID_COLUMN_BREAKPOINT.numerical,
|
|
15
|
+
...GRID_COLUMN_BREAKPOINT.flex,
|
|
16
|
+
] as const satisfies readonly GridColumnSize[];
|
|
17
|
+
|
|
18
|
+
export const gridColumnSizeNumericalOptions = GRID_COLUMN_BREAKPOINT.numerical;
|
|
19
|
+
|
|
20
|
+
export interface GridColumnProps {
|
|
21
|
+
/** Custom CSS class names */
|
|
22
|
+
class?: string;
|
|
23
|
+
|
|
24
|
+
/** Column contents go here */
|
|
25
|
+
children?: Snippet;
|
|
26
|
+
|
|
27
|
+
/** GridColumn ref */
|
|
28
|
+
ref?: HTMLDivElement | null;
|
|
29
|
+
|
|
30
|
+
/** Breakpoint: size (default unit) */
|
|
31
|
+
size?: GridColumnSize;
|
|
32
|
+
|
|
33
|
+
/** Breakpoint: sm */
|
|
34
|
+
sm?: GridColumnSize;
|
|
35
|
+
|
|
36
|
+
/** Breakpoint: md */
|
|
37
|
+
md?: GridColumnSize;
|
|
38
|
+
|
|
39
|
+
/** Breakpoint: lg */
|
|
40
|
+
lg?: GridColumnSize;
|
|
41
|
+
|
|
42
|
+
/** Breakpoint: xl */
|
|
43
|
+
xl?: GridColumnSize;
|
|
44
|
+
|
|
45
|
+
/** Breakpoint: xxl */
|
|
46
|
+
xxl?: GridColumnSize;
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<script lang="ts">
|
|
51
|
+
let {
|
|
52
|
+
class: className = '',
|
|
53
|
+
ref = $bindable(null),
|
|
54
|
+
children,
|
|
55
|
+
size = 12,
|
|
56
|
+
sm,
|
|
57
|
+
md,
|
|
58
|
+
lg,
|
|
59
|
+
xl,
|
|
60
|
+
xxl,
|
|
61
|
+
}: GridColumnProps = $props();
|
|
62
|
+
|
|
63
|
+
const classes = $derived(
|
|
64
|
+
[
|
|
65
|
+
'dodo-ui-Grid-Column',
|
|
66
|
+
`column-size--default--${size}`,
|
|
67
|
+
sm ? `column-size--sm--${sm}` : '',
|
|
68
|
+
md ? `column-size--md--${md}` : '',
|
|
69
|
+
lg ? `column-size--lg--${lg}` : '',
|
|
70
|
+
xl ? `column-size--xl--${xl}` : '',
|
|
71
|
+
xxl ? `column-size--xxl--${xxl}` : '',
|
|
72
|
+
className,
|
|
73
|
+
].filter(Boolean),
|
|
74
|
+
);
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<div class={classes.join(' ')} bind:this={ref}>
|
|
78
|
+
{@render children?.()}
|
|
79
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export declare const GRID_COLUMN_BREAKPOINT: {
|
|
3
|
+
readonly numerical: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
4
|
+
readonly flex: readonly ["flex"];
|
|
5
|
+
};
|
|
6
|
+
export type GridColumnSizeNumerical = (typeof GRID_COLUMN_BREAKPOINT.numerical)[number];
|
|
7
|
+
type GridColumnSizeFlex = (typeof GRID_COLUMN_BREAKPOINT.flex)[number];
|
|
8
|
+
export type GridColumnSize = GridColumnSizeNumerical | GridColumnSizeFlex;
|
|
9
|
+
export declare const gridColumnSizeOptions: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "flex"];
|
|
10
|
+
export declare const gridColumnSizeNumericalOptions: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
11
|
+
export interface GridColumnProps {
|
|
12
|
+
/** Custom CSS class names */
|
|
13
|
+
class?: string;
|
|
14
|
+
/** Column contents go here */
|
|
15
|
+
children?: Snippet;
|
|
16
|
+
/** GridColumn ref */
|
|
17
|
+
ref?: HTMLDivElement | null;
|
|
18
|
+
/** Breakpoint: size (default unit) */
|
|
19
|
+
size?: GridColumnSize;
|
|
20
|
+
/** Breakpoint: sm */
|
|
21
|
+
sm?: GridColumnSize;
|
|
22
|
+
/** Breakpoint: md */
|
|
23
|
+
md?: GridColumnSize;
|
|
24
|
+
/** Breakpoint: lg */
|
|
25
|
+
lg?: GridColumnSize;
|
|
26
|
+
/** Breakpoint: xl */
|
|
27
|
+
xl?: GridColumnSize;
|
|
28
|
+
/** Breakpoint: xxl */
|
|
29
|
+
xxl?: GridColumnSize;
|
|
30
|
+
}
|
|
31
|
+
declare const Column: import("svelte").Component<GridColumnProps, {}, "ref">;
|
|
32
|
+
type Column = ReturnType<typeof Column>;
|
|
33
|
+
export default Column;
|
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
// ------------------------------
|
|
11
|
+
// Storybook ArgTypes
|
|
12
|
+
// ------------------------------
|
|
13
|
+
export const storyGridArgTypes: Partial<ArgTypes<GridProps>> = {
|
|
14
|
+
// ------------------------------
|
|
15
|
+
// Core
|
|
16
|
+
// ------------------------------
|
|
17
|
+
children: { table: { category: 'API', subcategory: 'Base' } },
|
|
18
|
+
class: { table: { category: 'API', subcategory: 'Base' } },
|
|
19
|
+
gap: { table: { category: 'API', subcategory: 'Base', defaultValue: { summary: '1' } } },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// ------------------------------
|
|
23
|
+
// Storybook Meta
|
|
24
|
+
// ------------------------------
|
|
25
|
+
const { Story } = defineMeta({
|
|
26
|
+
component: Grid,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
argTypes: storyGridArgTypes,
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<!-- ------------------------------ -->
|
|
33
|
+
<!-- Stories -->
|
|
34
|
+
<!-- ------------------------------ -->
|
|
35
|
+
|
|
36
|
+
<!-- Basic 12 column grid -->
|
|
37
|
+
<Story name="Default">
|
|
38
|
+
<Column sm={4}>Hello there</Column>
|
|
39
|
+
<Column sm={4}>Hello there</Column>
|
|
40
|
+
<Column sm={4}>Hello there</Column>
|
|
41
|
+
<Column sm={4}>Hello there</Column>
|
|
42
|
+
<Column sm={4}>Hello there</Column>
|
|
43
|
+
</Story>
|
|
44
|
+
|
|
45
|
+
<Story name="Example">
|
|
46
|
+
<Column sm={4}>
|
|
47
|
+
<Card color="primary">
|
|
48
|
+
<p>Hello there</p>
|
|
49
|
+
</Card>
|
|
50
|
+
</Column>
|
|
51
|
+
<Column sm={4}>
|
|
52
|
+
<Card color="primary">
|
|
53
|
+
<p>Hello there</p>
|
|
54
|
+
</Card>
|
|
55
|
+
</Column>
|
|
56
|
+
<Column sm={4}>
|
|
57
|
+
<Card color="primary">
|
|
58
|
+
<p>Hello there</p>
|
|
59
|
+
</Card>
|
|
60
|
+
</Column>
|
|
61
|
+
<Column sm={4}>
|
|
62
|
+
<Card color="primary">
|
|
63
|
+
<p>Hello there</p>
|
|
64
|
+
</Card>
|
|
65
|
+
</Column>
|
|
66
|
+
</Story>
|
|
67
|
+
|
|
68
|
+
<Story name="Grid Row">
|
|
69
|
+
<Row>
|
|
70
|
+
<Column sm={6} md={4} lg={3}>
|
|
71
|
+
<Card color="primary">
|
|
72
|
+
<p>Hello there</p>
|
|
73
|
+
</Card>
|
|
74
|
+
</Column>
|
|
75
|
+
<Column sm={6} md={4} lg={3}>
|
|
76
|
+
<Card color="primary">
|
|
77
|
+
<p>Hello there</p>
|
|
78
|
+
</Card>
|
|
79
|
+
</Column>
|
|
80
|
+
<Column sm={6} md={4} lg={3}>
|
|
81
|
+
<Card color="primary">
|
|
82
|
+
<p>Hello there</p>
|
|
83
|
+
</Card>
|
|
84
|
+
</Column>
|
|
85
|
+
</Row>
|
|
86
|
+
<Row>
|
|
87
|
+
<Column sm={6} md={4} lg={3}>
|
|
88
|
+
<Card color="primary">
|
|
89
|
+
<p>Hello there</p>
|
|
90
|
+
</Card>
|
|
91
|
+
</Column>
|
|
92
|
+
<Column sm={6} md={4} lg={3}>
|
|
93
|
+
<Card color="primary">
|
|
94
|
+
<p>Hello there</p>
|
|
95
|
+
</Card>
|
|
96
|
+
</Column>
|
|
97
|
+
<Column sm={6} md={4} lg={3}>
|
|
98
|
+
<Card color="primary">
|
|
99
|
+
<p>Hello there</p>
|
|
100
|
+
</Card>
|
|
101
|
+
</Column>
|
|
102
|
+
</Row>
|
|
103
|
+
</Story>
|
|
104
|
+
|
|
105
|
+
<Story name="Gap" args={{ gap: 2 }}>
|
|
106
|
+
<Column sm={4}>
|
|
107
|
+
<Card color="primary">
|
|
108
|
+
<p>Hello there</p>
|
|
109
|
+
</Card>
|
|
110
|
+
</Column>
|
|
111
|
+
<Column sm={4}>
|
|
112
|
+
<Card color="primary">
|
|
113
|
+
<p>Hello there</p>
|
|
114
|
+
</Card>
|
|
115
|
+
</Column>
|
|
116
|
+
<Column sm={4}>
|
|
117
|
+
<Card color="primary">
|
|
118
|
+
<p>Hello there</p>
|
|
119
|
+
</Card>
|
|
120
|
+
</Column>
|
|
121
|
+
<Column sm={4}>
|
|
122
|
+
<Card color="primary">
|
|
123
|
+
<p>Hello there</p>
|
|
124
|
+
</Card>
|
|
125
|
+
</Column>
|
|
126
|
+
</Story>
|
|
127
|
+
|
|
128
|
+
<Story name="Responsive">
|
|
129
|
+
<Column sm={6} md={4} lg={3}>
|
|
130
|
+
<Card color="primary">
|
|
131
|
+
<p>Hello there</p>
|
|
132
|
+
</Card>
|
|
133
|
+
</Column>
|
|
134
|
+
<Column sm={6} md={4} lg={3}>
|
|
135
|
+
<Card color="primary">
|
|
136
|
+
<p>Hello there</p>
|
|
137
|
+
</Card>
|
|
138
|
+
</Column>
|
|
139
|
+
<Column sm={6} md={4} lg={3}>
|
|
140
|
+
<Card color="primary">
|
|
141
|
+
<p>Hello there</p>
|
|
142
|
+
</Card>
|
|
143
|
+
</Column>
|
|
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
|
+
</Story>
|
|
160
|
+
|
|
161
|
+
<Story name="Flex">
|
|
162
|
+
<Column md="flex">
|
|
163
|
+
<Card color="primary">
|
|
164
|
+
<p>Hello there</p>
|
|
165
|
+
</Card>
|
|
166
|
+
</Column>
|
|
167
|
+
<Column md={2}>
|
|
168
|
+
<Card color="primary">
|
|
169
|
+
<p>Hello there</p>
|
|
170
|
+
</Card>
|
|
171
|
+
</Column>
|
|
172
|
+
<Column md={2}>
|
|
173
|
+
<Card color="primary">
|
|
174
|
+
<p>Hello there</p>
|
|
175
|
+
</Card>
|
|
176
|
+
</Column>
|
|
177
|
+
</Story>
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export interface GridProps {
|
|
5
|
+
/** Custom CSS class names */
|
|
6
|
+
class?: string;
|
|
7
|
+
|
|
8
|
+
/** Grid contents go here*/
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
|
|
11
|
+
/** Grid spacing, affects Coulumns */
|
|
12
|
+
gap?: number;
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
let { class: className = '', gap = 1, children }: GridProps = $props();
|
|
18
|
+
|
|
19
|
+
function normalizeGap(value: number) {
|
|
20
|
+
return value === 0 ? 0 : value / 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const gapHalf = $derived(normalizeGap(gap));
|
|
24
|
+
|
|
25
|
+
const classes = $derived(['dodo-ui-Grid', className].filter(Boolean));
|
|
26
|
+
|
|
27
|
+
const inlineStyles = $derived([`--Grid-gap: ${gapHalf}`].filter(Boolean));
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<div class={classes.join(' ')} style={inlineStyles.join(';')}>
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface GridProps {
|
|
3
|
+
/** Custom CSS class names */
|
|
4
|
+
class?: string;
|
|
5
|
+
/** Grid contents go here*/
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
/** Grid spacing, affects Coulumns */
|
|
8
|
+
gap?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const Grid: import("svelte").Component<GridProps, {}, "">;
|
|
11
|
+
type Grid = ReturnType<typeof Grid>;
|
|
12
|
+
export default Grid;
|
|
@@ -0,0 +1,39 @@
|
|
|
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>
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export interface GridRowProps {
|
|
5
|
+
/** Custom CSS class names */
|
|
6
|
+
class?: string;
|
|
7
|
+
|
|
8
|
+
/** GridRow contents go here*/
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
let { class: className = '', children }: GridRowProps = $props();
|
|
15
|
+
|
|
16
|
+
const classes = $derived(['dodo-ui-Grid-Row', className].filter(Boolean));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div class={classes.join(' ')}>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export interface GridRowProps {
|
|
3
|
+
/** Custom CSS class names */
|
|
4
|
+
class?: string;
|
|
5
|
+
/** GridRow contents go here*/
|
|
6
|
+
children?: Snippet;
|
|
7
|
+
}
|
|
8
|
+
declare const Row: import("svelte").Component<GridRowProps, {}, "">;
|
|
9
|
+
type Row = ReturnType<typeof Row>;
|
|
10
|
+
export default Row;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { Source } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
# 🎨 Theme System
|
|
4
|
-
|
|
5
|
-
A lightweight theme system built using context + local store.
|
|
6
|
-
|
|
7
|
-
## 🧩 Theme Context
|
|
8
|
-
|
|
9
|
-
### 📦 Import
|
|
10
|
-
|
|
11
|
-
<Source
|
|
12
|
-
dark
|
|
13
|
-
language="ts"
|
|
14
|
-
code={`
|
|
15
|
-
import { useThemeContext } from '@flightlesslabs/dodo-ui';
|
|
16
|
-
`}
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
Provides access to the active theme.
|
|
20
|
-
|
|
21
|
-
### Usage
|
|
22
|
-
|
|
23
|
-
<Source
|
|
24
|
-
dark
|
|
25
|
-
language="ts"
|
|
26
|
-
code={`
|
|
27
|
-
const { theme } = useThemeContext();
|
|
28
|
-
`}
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
## 🏪 Theme Store
|
|
32
|
-
|
|
33
|
-
Global theme state.
|
|
34
|
-
|
|
35
|
-
### 📦 Import
|
|
36
|
-
|
|
37
|
-
<Source
|
|
38
|
-
dark
|
|
39
|
-
language="ts"
|
|
40
|
-
code={`
|
|
41
|
-
import { useThemeStore } from '@flightlesslabs/dodo-ui';
|
|
42
|
-
`}
|
|
43
|
-
/>
|
|
44
|
-
|
|
45
|
-
### Read
|
|
46
|
-
|
|
47
|
-
<Source
|
|
48
|
-
dark
|
|
49
|
-
language="ts"
|
|
50
|
-
code={`
|
|
51
|
-
const theme = useThemeStore.theme;
|
|
52
|
-
`}
|
|
53
|
-
/>
|
|
1
|
+
import { Source } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
# 🎨 Theme System
|
|
4
|
+
|
|
5
|
+
A lightweight theme system built using context + local store.
|
|
6
|
+
|
|
7
|
+
## 🧩 Theme Context
|
|
8
|
+
|
|
9
|
+
### 📦 Import
|
|
10
|
+
|
|
11
|
+
<Source
|
|
12
|
+
dark
|
|
13
|
+
language="ts"
|
|
14
|
+
code={`
|
|
15
|
+
import { useThemeContext } from '@flightlesslabs/dodo-ui';
|
|
16
|
+
`}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
Provides access to the active theme.
|
|
20
|
+
|
|
21
|
+
### Usage
|
|
22
|
+
|
|
23
|
+
<Source
|
|
24
|
+
dark
|
|
25
|
+
language="ts"
|
|
26
|
+
code={`
|
|
27
|
+
const { theme } = useThemeContext();
|
|
28
|
+
`}
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
## 🏪 Theme Store
|
|
32
|
+
|
|
33
|
+
Global theme state.
|
|
34
|
+
|
|
35
|
+
### 📦 Import
|
|
36
|
+
|
|
37
|
+
<Source
|
|
38
|
+
dark
|
|
39
|
+
language="ts"
|
|
40
|
+
code={`
|
|
41
|
+
import { useThemeStore } from '@flightlesslabs/dodo-ui';
|
|
42
|
+
`}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
### Read
|
|
46
|
+
|
|
47
|
+
<Source
|
|
48
|
+
dark
|
|
49
|
+
language="ts"
|
|
50
|
+
code={`
|
|
51
|
+
const theme = useThemeStore.theme;
|
|
52
|
+
`}
|
|
53
|
+
/>
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,12 @@ export { useThemeStore } from './components/Layout/Theme/ThemeSystem/theme.svelt
|
|
|
53
53
|
* Card component and related prop types.
|
|
54
54
|
*/
|
|
55
55
|
export { CARD_COLOR, default as Card, cardColorOptions, type CardColor, type CardProps, } from './components/Layout/Card/Card.svelte';
|
|
56
|
+
/**
|
|
57
|
+
* Grid component and related prop types.
|
|
58
|
+
*/
|
|
59
|
+
export { default as Grid, type GridProps } from './components/Layout/Grid/Grid.svelte';
|
|
60
|
+
export { GRID_COLUMN_BREAKPOINT, default as Column, gridColumnSizeOptions, gridColumnSizeNumericalOptions, type GridColumnProps, type GridColumnSizeNumerical, type GridColumnSize, } from './components/Layout/Grid/Column/Column.svelte';
|
|
61
|
+
export { default as Row, type GridRowProps } from './components/Layout/Grid/Row/Row.svelte';
|
|
56
62
|
/**
|
|
57
63
|
* Calendar component and related prop types.
|
|
58
64
|
*/
|