@flightlesslabs/dodo-ui 0.7.2 → 0.8.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/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/stories/components/Form/Select/Customize/Customize.stories.svelte +16 -1
- package/dist/stories/components/Form/Select/DropDownArrow/DropDownArrow.stories.svelte +59 -0
- package/dist/stories/components/Form/Select/DropDownArrow/DropDownArrow.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/Positions/AutoPosition/AutoPosition.stories.svelte +54 -0
- package/dist/stories/components/Form/Select/Positions/AutoPosition/AutoPosition.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/Positions/Positions.stories.svelte +83 -0
- package/dist/stories/components/Form/Select/Positions/Positions.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Select/Select.svelte +107 -123
- package/dist/stories/components/Form/Select/Select.svelte.d.ts +15 -2
- package/dist/stories/components/Layout/Menu/DynamicMenu/Customize/Customize.stories.svelte +28 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/Customize/Customize.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.stories.svelte +51 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.stories.svelte.d.ts +22 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.svelte +129 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.svelte.d.ts +81 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/Events/Events.stories.svelte +46 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/KeybaordNavigation/KeybaordNavigation.stories.svelte +27 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/KeybaordNavigation/KeybaordNavigation.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Layout/Menu/DynamicMenu/Options/OptionFormat.mdx +72 -0
- package/dist/stories/components/Layout/Menu/MenuItem/MenuItem.svelte.d.ts +1 -1
- package/dist/stories/developer tools/components/DynamicInput/DynamicInput.svelte +1 -0
- package/package.json +15 -17
- package/src/lib/index.ts +13 -0
- package/src/lib/stories/Home.mdx +59 -0
- package/src/lib/stories/assets/dark-theme-toggle.png +0 -0
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +61 -0
- package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +43 -0
- package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +36 -0
- package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +43 -0
- package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +23 -0
- package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +18 -0
- package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +28 -0
- package/src/lib/stories/components/Form/Label/Label.stories.svelte +13 -0
- package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +36 -0
- package/src/lib/stories/components/Form/Message/Message.stories.svelte +27 -0
- package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +22 -0
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +110 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +59 -0
- package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +31 -0
- package/src/lib/stories/components/Form/Select/Customize/Customize.stories.svelte +139 -0
- package/src/lib/stories/components/Form/Select/DropDownArrow/DropDownArrow.stories.svelte +63 -0
- package/src/lib/stories/components/Form/Select/Events/Events.stories.svelte +144 -0
- package/src/lib/stories/components/Form/Select/Options/OptionFormat.mdx +40 -0
- package/src/lib/stories/components/Form/Select/Positions/AutoPosition/AutoPosition.stories.svelte +58 -0
- package/src/lib/stories/components/Form/Select/Positions/Positions.stories.svelte +87 -0
- package/src/lib/stories/components/Form/Select/Roundness/Roundness.stories.svelte +32 -0
- package/src/lib/stories/components/Form/Select/Select.stories.svelte +121 -0
- package/src/lib/stories/components/Form/Select/Select.svelte +153 -146
- package/src/lib/stories/components/Form/Select/Size/Size.stories.svelte +28 -0
- package/src/lib/stories/components/Form/Select/WithIcon/WithIcon.stories.svelte +43 -0
- package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +97 -0
- package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +21 -0
- package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +17 -0
- package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +43 -0
- package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/Customize/Customize.stories.svelte +30 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.stories.svelte +56 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.svelte +262 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/Events/Events.stories.svelte +48 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/KeybaordNavigation/KeybaordNavigation.stories.svelte +29 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/Options/OptionFormat.mdx +72 -0
- package/src/lib/stories/components/Layout/Menu/Menu.stories.svelte +69 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/MenuItem.stories.svelte +34 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/MenuItem.svelte +1 -1
- package/src/lib/stories/components/Layout/Menu/MenuItem/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/Type/Type.stories.svelte +21 -0
- package/src/lib/stories/components/Layout/Menu/Size/Size.stories.svelte +37 -0
- package/src/lib/stories/components/Layout/Paper/Color/Color.stories.svelte +63 -0
- package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +50 -0
- package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +25 -0
- package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +24 -0
- package/src/lib/stories/components/Layout/Separator/Color/Color.stories.svelte +19 -0
- package/src/lib/stories/components/Layout/Separator/Separator.stories.svelte +30 -0
- package/src/lib/stories/developer tools/Intro.mdx +9 -0
- package/src/lib/stories/developer tools/components/DynamicInput/DynamicInput.stories.svelte +53 -0
- package/src/lib/stories/developer tools/components/DynamicInput/DynamicInput.svelte +1 -0
- package/src/lib/stories/developer tools/components/DynamicInput/Size/Size.stories.svelte +17 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +38 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/stories/developer tools/components/Popper/Popper.stories.svelte +124 -0
- package/src/lib/stories/developer tools/components/Popper/PopperPopup/PopperPopup.stories.svelte +64 -0
- package/src/lib/stories/developer tools/components/Popper/Positions/AutoPosition/AutoPosition.stories.svelte +92 -0
- package/src/lib/stories/developer tools/components/Popper/Positions/Positions.stories.svelte +114 -0
- package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +25 -0
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +30 -0
- package/src/lib/stories/developer tools/directives/clickOutside/index.mdx +25 -0
- package/src/lib/stories/developer tools/philosophy/Colors/Colors.mdx +43 -0
- package/src/lib/stories/developer tools/philosophy/Colors/Colors.stories.svelte +22 -0
- package/src/lib/stories/developer tools/philosophy/Colors/Opacity.stories.svelte +11 -0
- package/src/lib/stories/developer tools/philosophy/Themes.mdx +23 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Source } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
# Option Format
|
|
4
|
+
|
|
5
|
+
## DynamicMenuItemOption
|
|
6
|
+
|
|
7
|
+
<Source
|
|
8
|
+
dark
|
|
9
|
+
language="ts"
|
|
10
|
+
code={`
|
|
11
|
+
type DynamicMenuItemOption<TMeta = unknown> = {
|
|
12
|
+
id: string;
|
|
13
|
+
/** label */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Custom Metadata */
|
|
16
|
+
meta?: TMeta;
|
|
17
|
+
/** Menu Item type */
|
|
18
|
+
type?: MenuItemType;
|
|
19
|
+
/** Menu Separator */
|
|
20
|
+
separator?: boolean;
|
|
21
|
+
/** How large should the Menu Items be? */
|
|
22
|
+
size?: ComponentSize;
|
|
23
|
+
/** The onclick event handler */
|
|
24
|
+
onclick?: MouseEventHandler<HTMLButtonElement>;
|
|
25
|
+
/** disabled state */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** link href */
|
|
28
|
+
href?: string;
|
|
29
|
+
/** Link button: download */
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
download?: any;
|
|
32
|
+
/** Link button: hreflang */
|
|
33
|
+
hreflang?: string | undefined | null;
|
|
34
|
+
/** Link button: media */
|
|
35
|
+
media?: string | undefined | null;
|
|
36
|
+
/** Link button: ping */
|
|
37
|
+
ping?: string | undefined | null;
|
|
38
|
+
/** Link button: rel */
|
|
39
|
+
rel?: string | undefined | null;
|
|
40
|
+
/** Link button: target */
|
|
41
|
+
target?: ButtonLinkTarget;
|
|
42
|
+
/** Link button: Type */
|
|
43
|
+
anchorMediaType?: string | undefined | null;
|
|
44
|
+
/** Link button: referrerpolicy */
|
|
45
|
+
referrerpolicy?: ButtonLinkReferrerpolicy;
|
|
46
|
+
};
|
|
47
|
+
`}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
## Example values
|
|
51
|
+
|
|
52
|
+
<Source
|
|
53
|
+
dark
|
|
54
|
+
language="ts"
|
|
55
|
+
code={`
|
|
56
|
+
const options: DynamicMenuItemOption[] = [
|
|
57
|
+
{
|
|
58
|
+
id: '1',
|
|
59
|
+
label: 'One',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: '2',
|
|
63
|
+
label: 'Two',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: '3',
|
|
67
|
+
label: 'Three',
|
|
68
|
+
disabled: true,
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
`}
|
|
72
|
+
/>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Menu from './Menu.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import MenuItem from './MenuItem/MenuItem.svelte';
|
|
6
|
+
import { Separator } from '$lib/index.js';
|
|
7
|
+
|
|
8
|
+
export const storyMenuArgTypes: StoryBookArgTypes = {};
|
|
9
|
+
|
|
10
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
11
|
+
const { Story } = defineMeta({
|
|
12
|
+
component: Menu,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: storyMenuArgTypes,
|
|
15
|
+
});
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<!-- Default Menu -->
|
|
19
|
+
<Story name="Default" asChild>
|
|
20
|
+
<Menu>
|
|
21
|
+
<MenuItem>Cut</MenuItem>
|
|
22
|
+
<MenuItem>Copy</MenuItem>
|
|
23
|
+
<MenuItem>Paste</MenuItem>
|
|
24
|
+
</Menu>
|
|
25
|
+
</Story>
|
|
26
|
+
|
|
27
|
+
<!-- Fixed width and height -->
|
|
28
|
+
<Story name="FixedSize" asChild>
|
|
29
|
+
<Menu width="200px" height="300px">
|
|
30
|
+
<MenuItem>Cut</MenuItem>
|
|
31
|
+
<MenuItem>Copy</MenuItem>
|
|
32
|
+
<MenuItem>Paste</MenuItem>
|
|
33
|
+
</Menu>
|
|
34
|
+
</Story>
|
|
35
|
+
|
|
36
|
+
<!-- MenuItems With Separator -->
|
|
37
|
+
<Story name="WithSeparator" asChild>
|
|
38
|
+
<Menu separator>
|
|
39
|
+
<MenuItem>Cut</MenuItem>
|
|
40
|
+
<MenuItem>Copy</MenuItem>
|
|
41
|
+
<MenuItem>Paste</MenuItem>
|
|
42
|
+
</Menu>
|
|
43
|
+
</Story>
|
|
44
|
+
|
|
45
|
+
<!-- MenuItems Grouped in Sections. [Separator](?path=/docs/components-layout-separator--docs) -->
|
|
46
|
+
<Story name="Sections" asChild>
|
|
47
|
+
<Menu width="200px">
|
|
48
|
+
<MenuItem>Cut</MenuItem>
|
|
49
|
+
<MenuItem>Cut Special</MenuItem>
|
|
50
|
+
<MenuItem>Cut Selected</MenuItem>
|
|
51
|
+
<Separator />
|
|
52
|
+
<MenuItem>Copy</MenuItem>
|
|
53
|
+
<MenuItem>Copy Special</MenuItem>
|
|
54
|
+
<MenuItem>Copy Selected</MenuItem>
|
|
55
|
+
<Separator />
|
|
56
|
+
<MenuItem>Paste</MenuItem>
|
|
57
|
+
<MenuItem>Paste Special</MenuItem>
|
|
58
|
+
<MenuItem>Paste Selected</MenuItem>
|
|
59
|
+
</Menu>
|
|
60
|
+
</Story>
|
|
61
|
+
|
|
62
|
+
<!-- MenuItems With some options disabled -->
|
|
63
|
+
<Story name="Disabled" asChild>
|
|
64
|
+
<Menu>
|
|
65
|
+
<MenuItem>Cut</MenuItem>
|
|
66
|
+
<MenuItem disabled>Copy</MenuItem>
|
|
67
|
+
<MenuItem>Paste</MenuItem>
|
|
68
|
+
</Menu>
|
|
69
|
+
</Story>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
4
|
+
import MenuItem, { menuItemTypeArray } from './MenuItem.svelte';
|
|
5
|
+
import { componentSizeArray } from '$lib/types/size.js';
|
|
6
|
+
|
|
7
|
+
export const storyMenuItemArgTypes: StoryBookArgTypes = {
|
|
8
|
+
type: {
|
|
9
|
+
control: { type: 'select' },
|
|
10
|
+
options: menuItemTypeArray,
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: componentSizeArray,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
19
|
+
const { Story } = defineMeta({
|
|
20
|
+
component: MenuItem,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: storyMenuItemArgTypes,
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- Default MenuItem -->
|
|
27
|
+
<Story name="Default">Menu Item</Story>
|
|
28
|
+
|
|
29
|
+
<!-- With Separator -->
|
|
30
|
+
<Story name="WithSeparator" args={{ separator: true }}>Menu Item</Story>
|
|
31
|
+
|
|
32
|
+
<Story name="Disabled" args={{ disabled: true }}>Menu Item</Story>
|
|
33
|
+
|
|
34
|
+
<Story name="Selected" args={{ selected: true }}>Menu Item</Story>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import MenuItem from '../MenuItem.svelte';
|
|
4
|
+
import { storyMenuItemArgTypes } from '../MenuItem.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: MenuItem,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyMenuItemArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Normal">Menu Item</Story>
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }}>Menu Item</Story>
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }}>Menu Item</Story>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import MenuItem from '../MenuItem.svelte';
|
|
4
|
+
import { storyMenuItemArgTypes } from '../MenuItem.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: MenuItem,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyMenuItemArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Text">Menu Item</Story>
|
|
15
|
+
<Story
|
|
16
|
+
name="Link"
|
|
17
|
+
args={{ type: 'link', href: 'https://www.w3schools.com/tags/tag_a.asp', target: '_blank' }}
|
|
18
|
+
>
|
|
19
|
+
Menu Item
|
|
20
|
+
</Story>
|
|
21
|
+
<Story name="Button" args={{ type: 'button', onclick: () => {} }}>Menu Item</Story>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Menu from '../Menu.svelte';
|
|
4
|
+
import { storyMenuArgTypes } from '../Menu.stories.svelte';
|
|
5
|
+
import MenuItem from '../MenuItem/MenuItem.svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: Menu,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyMenuArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Normal" asChild>
|
|
16
|
+
<Menu>
|
|
17
|
+
<MenuItem>Cut</MenuItem>
|
|
18
|
+
<MenuItem>Copy</MenuItem>
|
|
19
|
+
<MenuItem>Paste</MenuItem>
|
|
20
|
+
</Menu>
|
|
21
|
+
</Story>
|
|
22
|
+
|
|
23
|
+
<Story name="Small" asChild>
|
|
24
|
+
<Menu size="small">
|
|
25
|
+
<MenuItem>Cut</MenuItem>
|
|
26
|
+
<MenuItem>Copy</MenuItem>
|
|
27
|
+
<MenuItem>Paste</MenuItem>
|
|
28
|
+
</Menu>
|
|
29
|
+
</Story>
|
|
30
|
+
|
|
31
|
+
<Story name="Large" asChild>
|
|
32
|
+
<Menu size="large">
|
|
33
|
+
<MenuItem>Cut</MenuItem>
|
|
34
|
+
<MenuItem>Copy</MenuItem>
|
|
35
|
+
<MenuItem>Paste</MenuItem>
|
|
36
|
+
</Menu>
|
|
37
|
+
</Story>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
4
|
+
import Paper from '../Paper.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Default" args={{ height: '100px' }}>Hola!</Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Primary" args={{ color: 'primary', height: '100px' }}>Hola!</Story>
|
|
17
|
+
<Story name="Secondary" args={{ color: 'secondary', height: '100px' }}>Hola!</Story>
|
|
18
|
+
<Story name="Neutral" args={{ color: 'neutral', height: '100px' }}>Hola!</Story>
|
|
19
|
+
<Story name="Safe" args={{ color: 'safe', height: '100px' }}>Hola!</Story>
|
|
20
|
+
<Story name="Warning" args={{ color: 'warning', height: '100px' }}>Hola!</Story>
|
|
21
|
+
<Story name="Danger" args={{ color: 'danger', height: '100px' }}>Hola!</Story>
|
|
22
|
+
|
|
23
|
+
<Story name="Default Outline" args={{ outline: true, height: '100px' }}>Hola!</Story>
|
|
24
|
+
<Story name="Primary Outline" args={{ color: 'primary', outline: true, height: '100px' }}>
|
|
25
|
+
Hola!
|
|
26
|
+
</Story>
|
|
27
|
+
<Story name="Secondary Outline" args={{ color: 'secondary', outline: true, height: '100px' }}>
|
|
28
|
+
Hola!
|
|
29
|
+
</Story>
|
|
30
|
+
<Story name="Neutral Outline" args={{ color: 'neutral', outline: true, height: '100px' }}>
|
|
31
|
+
Hola!
|
|
32
|
+
</Story>
|
|
33
|
+
<Story name="Safe Outline" args={{ color: 'safe', outline: true, height: '100px' }}>Hola!</Story>
|
|
34
|
+
<Story name="Warning Outline" args={{ color: 'warning', outline: true, height: '100px' }}>
|
|
35
|
+
Hola!
|
|
36
|
+
</Story>
|
|
37
|
+
<Story name="Danger Outline" args={{ color: 'danger', outline: true, height: '100px' }}>Hola!</Story
|
|
38
|
+
>
|
|
39
|
+
|
|
40
|
+
<Story name="Primary Solid" args={{ color: 'primary', variant: 'solid', height: '100px' }}>
|
|
41
|
+
Hola!
|
|
42
|
+
</Story>
|
|
43
|
+
<Story name="Secondary Solid" args={{ color: 'secondary', variant: 'solid', height: '100px' }}>
|
|
44
|
+
Hola!
|
|
45
|
+
</Story>
|
|
46
|
+
<Story name="Neutral Solid" args={{ color: 'neutral', variant: 'solid', height: '100px' }}>
|
|
47
|
+
Hola!
|
|
48
|
+
</Story>
|
|
49
|
+
<Story name="Safe Solid" args={{ color: 'safe', variant: 'solid', height: '100px' }}>Hola!</Story>
|
|
50
|
+
<Story name="Warning Solid" args={{ color: 'warning', variant: 'solid', height: '100px' }}>
|
|
51
|
+
Hola!
|
|
52
|
+
</Story>
|
|
53
|
+
<Story name="Danger Solid" args={{ color: 'danger', variant: 'solid', height: '100px' }}>
|
|
54
|
+
Hola!
|
|
55
|
+
</Story>
|
|
56
|
+
|
|
57
|
+
<!-- Paper with Custom Background and Border colors -->
|
|
58
|
+
<Story
|
|
59
|
+
name="Custom Color"
|
|
60
|
+
args={{ height: '100px', customBackgroundColor: '#ffdfad', customBorderColor: '#fbc674' }}
|
|
61
|
+
>
|
|
62
|
+
Hola!
|
|
63
|
+
</Story>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper, { paperColorArray } from './Paper.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentRoundnessArray } from '$lib/types/roundness.js';
|
|
6
|
+
import { componentShadowArray } from '$lib/types/shadow.js';
|
|
7
|
+
import { componentWeightArray } from '$lib/types/weight.js';
|
|
8
|
+
|
|
9
|
+
export const storyPaperArgTypes: StoryBookArgTypes = {
|
|
10
|
+
color: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: paperColorArray,
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: componentWeightArray,
|
|
17
|
+
},
|
|
18
|
+
roundness: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: componentRoundnessArray,
|
|
21
|
+
},
|
|
22
|
+
shadow: {
|
|
23
|
+
control: { type: 'select' },
|
|
24
|
+
options: componentShadowArray,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
29
|
+
const { Story } = defineMeta({
|
|
30
|
+
component: Paper,
|
|
31
|
+
tags: ['autodocs'],
|
|
32
|
+
argTypes: storyPaperArgTypes,
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<!-- Paper with default style -->
|
|
37
|
+
<Story name="Default">Hola!</Story>
|
|
38
|
+
|
|
39
|
+
<!-- Paper with width and height -->
|
|
40
|
+
<Story name="WidthAndHeight" args={{ width: '200px', height: '200px', color: 'primary' }}>
|
|
41
|
+
Hola!
|
|
42
|
+
</Story>
|
|
43
|
+
|
|
44
|
+
<!-- Paper with Custom Background and Border colors -->
|
|
45
|
+
<Story
|
|
46
|
+
name="Custom Color"
|
|
47
|
+
args={{ height: '100px', customBackgroundColor: '#ffdfad', customBorderColor: '#fbc674' }}
|
|
48
|
+
>
|
|
49
|
+
Hola!
|
|
50
|
+
</Story>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from '../Paper.svelte';
|
|
4
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Roundness 1" args={{ height: '100px', color: 'primary' }}></Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Roundness 2" args={{ roundness: 2, height: '100px', color: 'primary' }}></Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Roundness 3" args={{ roundness: 3, height: '100px', color: 'primary' }}></Story>
|
|
19
|
+
|
|
20
|
+
<Story name="Roundness 0" args={{ roundness: 0, height: '100px', color: 'primary' }}></Story>
|
|
21
|
+
|
|
22
|
+
<Story
|
|
23
|
+
name="Roundness Full"
|
|
24
|
+
args={{ roundness: 'full', height: '100px', width: '100%', color: 'primary' }}
|
|
25
|
+
></Story>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from '../Paper.svelte';
|
|
4
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Shadow 0" args={{ height: '100px' }}>Hola!</Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Shadow 1" args={{ shadow: 1, height: '100px' }}>Hola!</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Shadow 2" args={{ shadow: 2, height: '100px' }}>Hola!</Story>
|
|
19
|
+
|
|
20
|
+
<Story name="Shadow 3" args={{ shadow: 3, height: '100px' }}>Hola!</Story>
|
|
21
|
+
|
|
22
|
+
<Story name="Shadow 4" args={{ shadow: 4, height: '100px' }}>Hola!</Story>
|
|
23
|
+
|
|
24
|
+
<Story name="Shadow 5" args={{ shadow: 5, height: '100px' }}>Hola!</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { storySeparatorArgTypes } from '../Separator.stories.svelte';
|
|
4
|
+
import Separator from '../Separator.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Separator,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storySeparatorArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Neutral">Hola!</Story>
|
|
15
|
+
<Story name="Primary" args={{ color: 'primary' }}>Hola!</Story>
|
|
16
|
+
<Story name="Secondary" args={{ color: 'secondary' }}>Hola!</Story>
|
|
17
|
+
<Story name="Safe" args={{ color: 'safe' }}>Hola!</Story>
|
|
18
|
+
<Story name="Warning" args={{ color: 'warning' }}>Hola!</Story>
|
|
19
|
+
<Story name="Danger" args={{ color: 'danger' }}>Hola!</Story>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Separator, { separatorOrientationArray } from './Separator.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentColorArray } from '$lib/types/colors.js';
|
|
6
|
+
|
|
7
|
+
export const storySeparatorArgTypes: StoryBookArgTypes = {
|
|
8
|
+
color: {
|
|
9
|
+
control: { type: 'select' },
|
|
10
|
+
options: componentColorArray,
|
|
11
|
+
},
|
|
12
|
+
orientation: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: separatorOrientationArray,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
19
|
+
const { Story } = defineMeta({
|
|
20
|
+
component: Separator,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: storySeparatorArgTypes,
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<Story name="Default" />
|
|
27
|
+
|
|
28
|
+
<Story name="FixedWidth" args={{ width: '200px' }} />
|
|
29
|
+
|
|
30
|
+
<Story name="VerticalOrientation" args={{ orientation: 'vertical', height: '200px' }} />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Developer Tools
|
|
2
|
+
|
|
3
|
+
A set of components and tools used internally in dodo-ui.
|
|
4
|
+
|
|
5
|
+
## Explore More
|
|
6
|
+
|
|
7
|
+
- [Utility Button](?path=/docs/developer-tools-components-utilitybutton--docs)
|
|
8
|
+
- [Colors](?path=/docs/developer-tools-philosophy-colors--docs)
|
|
9
|
+
- [Adjust Color Opacity](?path=/docs/developer-tools-philosophy-colors--docs#adjusting-opacity)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import DynamicInput, { dynamicInputVariantArray } from './DynamicInput.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentSizeArray } from '$lib/types/size.js';
|
|
6
|
+
import { textInputTypeArray } from '$lib/stories/components/Form/TextInput/TextInput.svelte';
|
|
7
|
+
import Icon from '@iconify/svelte';
|
|
8
|
+
|
|
9
|
+
export const storyDynamicInputArgTypes: StoryBookArgTypes = {
|
|
10
|
+
type: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: textInputTypeArray,
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: dynamicInputVariantArray,
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: componentSizeArray,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
25
|
+
const { Story } = defineMeta({
|
|
26
|
+
component: DynamicInput,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
argTypes: storyDynamicInputArgTypes,
|
|
29
|
+
args: { value: 'Hello world!' },
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Story name="Default" />
|
|
34
|
+
|
|
35
|
+
<!-- Clickable button type Variant -->
|
|
36
|
+
<Story name="VariantButton" args={{ variant: 'button' }} />
|
|
37
|
+
|
|
38
|
+
<!-- Clickable button type Variant with placeholder -->
|
|
39
|
+
<Story
|
|
40
|
+
name="ButtonWithPlaceholder"
|
|
41
|
+
args={{ variant: 'button', placeholder: 'Type Something...', value: '' }}
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<Story name="CustomInputContent" asChild>
|
|
45
|
+
<DynamicInput variant="button" value="Hello world!">
|
|
46
|
+
{#snippet customInputContent(value)}
|
|
47
|
+
<div>
|
|
48
|
+
{`${value}`}
|
|
49
|
+
<Icon icon="material-symbols:ads-click" width="24" height="24" style="color: #d21313" />
|
|
50
|
+
</div>
|
|
51
|
+
{/snippet}
|
|
52
|
+
</DynamicInput>
|
|
53
|
+
</Story>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import DynamicInput from '../DynamicInput.svelte';
|
|
4
|
+
import { storyDynamicInputArgTypes } from '../DynamicInput.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: DynamicInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyDynamicInputArgTypes,
|
|
11
|
+
args: { value: 'Hello world!' },
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Normal" />
|
|
16
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
17
|
+
<Story name="Large" args={{ size: 'large' }} />
|
package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from './InputEnclosure.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentRoundnessArray } from '$lib/types/roundness.js';
|
|
6
|
+
import { componentSizeArray } from '$lib/types/size.js';
|
|
7
|
+
|
|
8
|
+
export const storyInputEnclosureArgTypes: StoryBookArgTypes = {
|
|
9
|
+
roundness: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: componentRoundnessArray,
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: componentSizeArray,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
20
|
+
const { Story } = defineMeta({
|
|
21
|
+
component: InputEnclosure,
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<!-- An ensloure for Form Inputs [TextInput](?path=/docs/components-form-textinput--docs) -->
|
|
28
|
+
<Story name="Default" />
|
|
29
|
+
|
|
30
|
+
<Story name="Focused" args={{ focused: true }} />
|
|
31
|
+
|
|
32
|
+
<Story name="Error" args={{ error: true }} />
|
|
33
|
+
|
|
34
|
+
<Story name="Disabled" args={{ disabled: true }} />
|
|
35
|
+
|
|
36
|
+
<Story name="Input example">
|
|
37
|
+
<input type="text" style="flex: 1; border: 0;" placeholder="Enter name" />
|
|
38
|
+
</Story>
|
package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Roundness 1" />
|
|
15
|
+
|
|
16
|
+
<Story name="Roundness 2" args={{ roundness: 2 }} />
|
|
17
|
+
|
|
18
|
+
<Story name="Roundness 3" args={{ roundness: 3 }} />
|
|
19
|
+
|
|
20
|
+
<Story name="Roundness 0" args={{ roundness: 0 }} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Normal" />
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }} />
|