@flightlesslabs/dodo-ui 0.7.2 → 0.9.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 +18 -2
- package/dist/index.js +11 -0
- package/dist/stories/components/Form/NumericInput/Events/Events.stories.svelte +126 -0
- package/dist/stories/components/Form/NumericInput/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/NumericInput/NumericInput.stories.svelte +79 -0
- package/dist/stories/components/Form/NumericInput/NumericInput.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Form/NumericInput/NumericInput.svelte +161 -0
- package/dist/stories/components/Form/NumericInput/NumericInput.svelte.d.ts +69 -0
- package/dist/stories/components/Form/NumericInput/Validation/Validation.stories.svelte +84 -0
- package/dist/stories/components/Form/NumericInput/Validation/Validation.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/PasswordInput/Events/Events.stories.svelte +27 -6
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +5 -3
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +7 -1
- 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/Events/Events.stories.svelte +27 -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 +110 -123
- package/dist/stories/components/Form/Select/Select.svelte.d.ts +22 -3
- package/dist/stories/components/Form/TextInput/Events/Events.stories.svelte +27 -0
- package/dist/stories/components/Form/TextInput/TextInput.svelte +5 -3
- package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +10 -1
- 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 +23 -4
- package/dist/stories/developer tools/components/DynamicInput/DynamicInput.svelte.d.ts +13 -2
- package/dist/stories/developer tools/components/DynamicInput/Events/Events.stories.svelte +115 -0
- package/dist/stories/developer tools/components/DynamicInput/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/developer tools/helpers/Numbers/cleanNumericString/cleanNumericString.d.ts +13 -0
- package/dist/stories/developer tools/helpers/Numbers/cleanNumericString/cleanNumericString.js +26 -0
- package/dist/stories/developer tools/helpers/Numbers/cleanNumericString/index.mdx +20 -0
- package/dist/stories/developer tools/helpers/Numbers/isValidNumberValue/index.mdx +71 -0
- package/dist/stories/developer tools/helpers/Numbers/isValidNumberValue/isValidNumberValue.d.ts +51 -0
- package/dist/stories/developer tools/helpers/Numbers/isValidNumberValue/isValidNumberValue.js +96 -0
- package/dist/stories/developer tools/helpers/logger/index.mdx +63 -0
- package/dist/stories/developer tools/helpers/logger/logger.d.ts +24 -0
- package/dist/stories/developer tools/helpers/logger/logger.js +31 -0
- package/package.json +15 -17
- package/src/lib/index.ts +33 -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/NumericInput/Events/Events.stories.svelte +134 -0
- package/src/lib/stories/components/Form/NumericInput/NumericInput.stories.svelte +84 -0
- package/src/lib/stories/components/Form/NumericInput/NumericInput.svelte +286 -0
- package/src/lib/stories/components/Form/NumericInput/Validation/Validation.stories.svelte +87 -0
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +132 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +59 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +15 -3
- 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 +174 -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 +166 -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 +125 -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/TextInput.svelte +18 -3
- 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 +43 -3
- package/src/lib/stories/developer tools/components/DynamicInput/Events/Events.stories.svelte +121 -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/helpers/Numbers/cleanNumericString/cleanNumericString.ts +27 -0
- package/src/lib/stories/developer tools/helpers/Numbers/cleanNumericString/index.mdx +20 -0
- package/src/lib/stories/developer tools/helpers/Numbers/isValidNumberValue/index.mdx +71 -0
- package/src/lib/stories/developer tools/helpers/Numbers/isValidNumberValue/isValidNumberValue.ts +156 -0
- package/src/lib/stories/developer tools/helpers/logger/index.mdx +63 -0
- package/src/lib/stories/developer tools/helpers/logger/logger.ts +46 -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,121 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { storyDynamicInputArgTypes } from '../DynamicInput.stories.svelte';
|
|
4
|
+
import DynamicInput, {
|
|
5
|
+
type DynamicInputFocusEvent,
|
|
6
|
+
type DynamicInputKeyboardEvent,
|
|
7
|
+
} from '../DynamicInput.svelte';
|
|
8
|
+
import type { TextInputClipboardEvent } from '$lib/stories/components/Form/TextInput/TextInput.svelte';
|
|
9
|
+
|
|
10
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
11
|
+
const { Story } = defineMeta({
|
|
12
|
+
component: DynamicInput,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: storyDynamicInputArgTypes,
|
|
15
|
+
args: { value: 'Hello world!' },
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Story
|
|
20
|
+
name="Input"
|
|
21
|
+
args={{
|
|
22
|
+
oninput: (e: Event) => {
|
|
23
|
+
const target = e.target as HTMLInputElement;
|
|
24
|
+
|
|
25
|
+
console.log('Input Event', target.value);
|
|
26
|
+
},
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<Story
|
|
31
|
+
name="Change"
|
|
32
|
+
args={{
|
|
33
|
+
onchange: (e: Event) => {
|
|
34
|
+
const target = e.target as HTMLInputElement;
|
|
35
|
+
|
|
36
|
+
console.log('onChange Event', target.value);
|
|
37
|
+
},
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<Story
|
|
42
|
+
name="Focus"
|
|
43
|
+
args={{
|
|
44
|
+
onfocus: (e: DynamicInputFocusEvent) => {
|
|
45
|
+
const target = e.target as HTMLInputElement;
|
|
46
|
+
|
|
47
|
+
console.log('onfocus Event', target);
|
|
48
|
+
},
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<Story
|
|
53
|
+
name="Blur"
|
|
54
|
+
args={{
|
|
55
|
+
onblur: (e: DynamicInputFocusEvent) => {
|
|
56
|
+
const target = e.target as HTMLInputElement;
|
|
57
|
+
|
|
58
|
+
console.log('onblur Event', target);
|
|
59
|
+
},
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<Story
|
|
64
|
+
name="Copy"
|
|
65
|
+
args={{
|
|
66
|
+
oncopy: (e: TextInputClipboardEvent) => {
|
|
67
|
+
const target = e.target as HTMLInputElement;
|
|
68
|
+
|
|
69
|
+
console.log('oncopy Event', target);
|
|
70
|
+
},
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<Story
|
|
75
|
+
name="Cut"
|
|
76
|
+
args={{
|
|
77
|
+
oncut: (e: TextInputClipboardEvent) => {
|
|
78
|
+
const target = e.target as HTMLInputElement;
|
|
79
|
+
|
|
80
|
+
console.log('oncut Event', target);
|
|
81
|
+
},
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<Story
|
|
86
|
+
name="Paste"
|
|
87
|
+
args={{
|
|
88
|
+
onpaste: (e: TextInputClipboardEvent) => {
|
|
89
|
+
const target = e.target as HTMLInputElement;
|
|
90
|
+
|
|
91
|
+
console.log('onpaste Event', target);
|
|
92
|
+
},
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<Story
|
|
97
|
+
name="KeyDown"
|
|
98
|
+
args={{
|
|
99
|
+
onkeydown: (e: DynamicInputKeyboardEvent) => {
|
|
100
|
+
console.log('onkeydown Event', e.key);
|
|
101
|
+
},
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<Story
|
|
106
|
+
name="KeyPress"
|
|
107
|
+
args={{
|
|
108
|
+
onkeypress: (e: DynamicInputKeyboardEvent) => {
|
|
109
|
+
console.log('onkeypress Event', e.key);
|
|
110
|
+
},
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
|
|
114
|
+
<Story
|
|
115
|
+
name="KeyUp"
|
|
116
|
+
args={{
|
|
117
|
+
onkeyup: (e: DynamicInputKeyboardEvent) => {
|
|
118
|
+
console.log('onkeyup Event', e.key);
|
|
119
|
+
},
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
@@ -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' }} />
|
package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: InputEnclosure,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<!-- InputEnclosure icon in front. -->
|
|
16
|
+
<Story name="Icon Before" asChild>
|
|
17
|
+
<InputEnclosure>
|
|
18
|
+
{#snippet before()}
|
|
19
|
+
<Icon icon="material-symbols:content-copy" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
</InputEnclosure>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<!-- InputEnclosure icon in front. -->
|
|
25
|
+
<Story name="Icon After" asChild>
|
|
26
|
+
<InputEnclosure>
|
|
27
|
+
{#snippet after()}
|
|
28
|
+
<Icon icon="material-symbols:download-2" />
|
|
29
|
+
{/snippet}
|
|
30
|
+
</InputEnclosure>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="Small" args={{ size: 'small' }} asChild>
|
|
34
|
+
<InputEnclosure size="small">
|
|
35
|
+
{#snippet before()}
|
|
36
|
+
<Icon icon="material-symbols:content-copy" />
|
|
37
|
+
{/snippet}
|
|
38
|
+
</InputEnclosure>
|
|
39
|
+
</Story>
|
|
40
|
+
|
|
41
|
+
<Story name="Large" args={{ size: 'large' }} asChild>
|
|
42
|
+
<InputEnclosure size="large">
|
|
43
|
+
{#snippet before()}
|
|
44
|
+
<Icon icon="material-symbols:content-copy" />
|
|
45
|
+
{/snippet}
|
|
46
|
+
</InputEnclosure>
|
|
47
|
+
</Story>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
4
|
+
import { Menu, MenuItem, Popper } from '$lib/index.js';
|
|
5
|
+
import Button from '$lib/stories/components/Form/Button/Button.svelte';
|
|
6
|
+
import { positionXArray, positionYArray } from '$lib/types/position.js';
|
|
7
|
+
|
|
8
|
+
export const storyPopperArgTypes: StoryBookArgTypes = {
|
|
9
|
+
popupPositionX: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: positionXArray,
|
|
12
|
+
},
|
|
13
|
+
popupPositionY: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: positionYArray,
|
|
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: Popper,
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
argTypes: storyPopperArgTypes,
|
|
24
|
+
parameters: {
|
|
25
|
+
docs: {
|
|
26
|
+
story: {
|
|
27
|
+
height: '200px',
|
|
28
|
+
inline: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
let open = $state(false);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<Story name="Default" args={{ open, onClickOutside: () => (open = false) }} asChild>
|
|
38
|
+
<Popper {open} onClickOutside={() => (open = false)}>
|
|
39
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
40
|
+
{#snippet popupChildren()}
|
|
41
|
+
<Menu>
|
|
42
|
+
<MenuItem>One</MenuItem>
|
|
43
|
+
<MenuItem>Two</MenuItem>
|
|
44
|
+
<MenuItem>Three</MenuItem>
|
|
45
|
+
</Menu>
|
|
46
|
+
{/snippet}
|
|
47
|
+
</Popper>
|
|
48
|
+
</Story>
|
|
49
|
+
|
|
50
|
+
<Story name="MenuOpen" args={{ open: true }} asChild>
|
|
51
|
+
<Popper open>
|
|
52
|
+
Hello! how are you doing?
|
|
53
|
+
{#snippet popupChildren()}
|
|
54
|
+
<Menu>
|
|
55
|
+
<MenuItem>One</MenuItem>
|
|
56
|
+
<MenuItem>Two</MenuItem>
|
|
57
|
+
<MenuItem>Three</MenuItem>
|
|
58
|
+
</Menu>
|
|
59
|
+
{/snippet}
|
|
60
|
+
</Popper>
|
|
61
|
+
</Story>
|
|
62
|
+
|
|
63
|
+
<Story
|
|
64
|
+
name="CustomPaperProps"
|
|
65
|
+
args={{
|
|
66
|
+
open: true,
|
|
67
|
+
paperProps: {
|
|
68
|
+
color: 'primary',
|
|
69
|
+
},
|
|
70
|
+
}}
|
|
71
|
+
asChild
|
|
72
|
+
>
|
|
73
|
+
<Popper
|
|
74
|
+
open
|
|
75
|
+
paperProps={{
|
|
76
|
+
color: 'primary',
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
Hello! how are you doing?
|
|
80
|
+
{#snippet popupChildren()}
|
|
81
|
+
<Menu>
|
|
82
|
+
<MenuItem>One</MenuItem>
|
|
83
|
+
<MenuItem>Two</MenuItem>
|
|
84
|
+
<MenuItem>Three</MenuItem>
|
|
85
|
+
</Menu>
|
|
86
|
+
{/snippet}
|
|
87
|
+
</Popper>
|
|
88
|
+
</Story>
|
|
89
|
+
|
|
90
|
+
<Story name="FullWidth" asChild>
|
|
91
|
+
<Popper {open} fullWidth onClickOutside={() => (open = false)}>
|
|
92
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
93
|
+
|
|
94
|
+
{#snippet popupChildren()}
|
|
95
|
+
<Menu>
|
|
96
|
+
<MenuItem>One</MenuItem>
|
|
97
|
+
<MenuItem>Two</MenuItem>
|
|
98
|
+
<MenuItem>Three</MenuItem>
|
|
99
|
+
</Menu>
|
|
100
|
+
{/snippet}
|
|
101
|
+
</Popper>
|
|
102
|
+
</Story>
|
|
103
|
+
|
|
104
|
+
<Story
|
|
105
|
+
name="CustomPopup"
|
|
106
|
+
args={{
|
|
107
|
+
open,
|
|
108
|
+
onClickOutside: () => (open = false),
|
|
109
|
+
}}
|
|
110
|
+
asChild
|
|
111
|
+
>
|
|
112
|
+
<Popper {open} onClickOutside={() => (open = false)}>
|
|
113
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
114
|
+
|
|
115
|
+
{#snippet customPopup(popperLocation)}
|
|
116
|
+
{#if open}
|
|
117
|
+
<Menu>
|
|
118
|
+
<MenuItem>{popperLocation?.height}</MenuItem>
|
|
119
|
+
<MenuItem>{popperLocation?.width}</MenuItem>
|
|
120
|
+
</Menu>
|
|
121
|
+
{/if}
|
|
122
|
+
{/snippet}
|
|
123
|
+
</Popper>
|
|
124
|
+
</Story>
|
package/src/lib/stories/developer tools/components/Popper/PopperPopup/PopperPopup.stories.svelte
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
4
|
+
import { Menu, MenuItem, PopperPopup } from '$lib/index.js';
|
|
5
|
+
import { positionXArray, positionYArray } from '$lib/types/position.js';
|
|
6
|
+
|
|
7
|
+
export const storyPopperPopupArgTypes: StoryBookArgTypes = {
|
|
8
|
+
popupPositionX: {
|
|
9
|
+
control: { type: 'select' },
|
|
10
|
+
options: positionXArray,
|
|
11
|
+
},
|
|
12
|
+
popupPositionY: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: positionYArray,
|
|
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: PopperPopup,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: storyPopperPopupArgTypes,
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
story: {
|
|
26
|
+
height: '200px',
|
|
27
|
+
inline: false,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<Story name="Default" asChild>
|
|
35
|
+
<PopperPopup>
|
|
36
|
+
<Menu>
|
|
37
|
+
<MenuItem>One</MenuItem>
|
|
38
|
+
<MenuItem>Two</MenuItem>
|
|
39
|
+
<MenuItem>Three</MenuItem>
|
|
40
|
+
</Menu>
|
|
41
|
+
</PopperPopup>
|
|
42
|
+
</Story>
|
|
43
|
+
|
|
44
|
+
<Story
|
|
45
|
+
name="CustomPaperProps"
|
|
46
|
+
args={{
|
|
47
|
+
paperProps: {
|
|
48
|
+
color: 'primary',
|
|
49
|
+
},
|
|
50
|
+
}}
|
|
51
|
+
asChild
|
|
52
|
+
>
|
|
53
|
+
<PopperPopup
|
|
54
|
+
paperProps={{
|
|
55
|
+
color: 'primary',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<Menu>
|
|
59
|
+
<MenuItem>One</MenuItem>
|
|
60
|
+
<MenuItem>Two</MenuItem>
|
|
61
|
+
<MenuItem>Three</MenuItem>
|
|
62
|
+
</Menu>
|
|
63
|
+
</PopperPopup>
|
|
64
|
+
</Story>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { Menu, MenuItem, Popper } from '$lib/index.js';
|
|
4
|
+
import Button from '$lib/stories/components/Form/Button/Button.svelte';
|
|
5
|
+
import { storyPopperArgTypes } from '../../Popper.stories.svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: Popper,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyPopperArgTypes,
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: {
|
|
14
|
+
story: {
|
|
15
|
+
height: '200px',
|
|
16
|
+
inline: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
let open = $state(false);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<!-- Positions will auto adjust depending on the space on top and bottom -->
|
|
26
|
+
<Story
|
|
27
|
+
name="PositionAutoAdjust"
|
|
28
|
+
args={{ open, onClickOutside: () => (open = false), popupPositionY: 'top' }}
|
|
29
|
+
asChild
|
|
30
|
+
>
|
|
31
|
+
<Popper {open} onClickOutside={() => (open = false)} popupPositionY="top">
|
|
32
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
33
|
+
{#snippet popupChildren()}
|
|
34
|
+
<Menu>
|
|
35
|
+
<MenuItem>One</MenuItem>
|
|
36
|
+
<MenuItem>Two</MenuItem>
|
|
37
|
+
<MenuItem>Three</MenuItem>
|
|
38
|
+
</Menu>
|
|
39
|
+
{/snippet}
|
|
40
|
+
</Popper>
|
|
41
|
+
</Story>
|
|
42
|
+
|
|
43
|
+
<!-- Positions will not auto adjust if you use `lockPoistions` -->
|
|
44
|
+
<Story
|
|
45
|
+
name="LockPoistions"
|
|
46
|
+
args={{
|
|
47
|
+
open,
|
|
48
|
+
onClickOutside: () => (open = false),
|
|
49
|
+
popupPositionY: 'top',
|
|
50
|
+
lockPoistions: true,
|
|
51
|
+
}}
|
|
52
|
+
asChild
|
|
53
|
+
>
|
|
54
|
+
<Popper {open} lockPoistions onClickOutside={() => (open = false)} popupPositionY="top">
|
|
55
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
56
|
+
{#snippet popupChildren()}
|
|
57
|
+
<Menu>
|
|
58
|
+
<MenuItem>One</MenuItem>
|
|
59
|
+
<MenuItem>Two</MenuItem>
|
|
60
|
+
<MenuItem>Three</MenuItem>
|
|
61
|
+
</Menu>
|
|
62
|
+
{/snippet}
|
|
63
|
+
</Popper>
|
|
64
|
+
</Story>
|
|
65
|
+
|
|
66
|
+
<!-- you can also adjust `popperHeightForVerticalPosition` to achive the same -->
|
|
67
|
+
<Story
|
|
68
|
+
name="HeightForVerticalPosition"
|
|
69
|
+
args={{
|
|
70
|
+
open,
|
|
71
|
+
onClickOutside: () => (open = false),
|
|
72
|
+
popupPositionY: 'top',
|
|
73
|
+
popperHeightForVerticalPosition: 3,
|
|
74
|
+
}}
|
|
75
|
+
asChild
|
|
76
|
+
>
|
|
77
|
+
<Popper
|
|
78
|
+
{open}
|
|
79
|
+
onClickOutside={() => (open = false)}
|
|
80
|
+
popupPositionY="top"
|
|
81
|
+
popperHeightForVerticalPosition={3}
|
|
82
|
+
>
|
|
83
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
84
|
+
{#snippet popupChildren()}
|
|
85
|
+
<Menu>
|
|
86
|
+
<MenuItem>One</MenuItem>
|
|
87
|
+
<MenuItem>Two</MenuItem>
|
|
88
|
+
<MenuItem>Three</MenuItem>
|
|
89
|
+
</Menu>
|
|
90
|
+
{/snippet}
|
|
91
|
+
</Popper>
|
|
92
|
+
</Story>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { Menu, MenuItem, Popper } from '$lib/index.js';
|
|
4
|
+
import Button from '$lib/stories/components/Form/Button/Button.svelte';
|
|
5
|
+
import { storyPopperArgTypes } from '../Popper.stories.svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: Popper,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyPopperArgTypes,
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'centered',
|
|
14
|
+
docs: {
|
|
15
|
+
story: {
|
|
16
|
+
height: '400px',
|
|
17
|
+
inline: false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
let open = $state(false);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<Story name="BottomLeft" asChild>
|
|
27
|
+
<Popper {open} onClickOutside={() => (open = false)} popupWidth="100px">
|
|
28
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
29
|
+
{#snippet popupChildren()}
|
|
30
|
+
<Menu>
|
|
31
|
+
<MenuItem>One</MenuItem>
|
|
32
|
+
<MenuItem>Two</MenuItem>
|
|
33
|
+
<MenuItem>Three</MenuItem>
|
|
34
|
+
</Menu>
|
|
35
|
+
{/snippet}
|
|
36
|
+
</Popper>
|
|
37
|
+
</Story>
|
|
38
|
+
|
|
39
|
+
<Story name="BottomCenter" asChild>
|
|
40
|
+
<Popper {open} popupPositionX="center" onClickOutside={() => (open = false)} popupWidth="100px">
|
|
41
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
42
|
+
{#snippet popupChildren()}
|
|
43
|
+
<Menu>
|
|
44
|
+
<MenuItem>One</MenuItem>
|
|
45
|
+
<MenuItem>Two</MenuItem>
|
|
46
|
+
<MenuItem>Three</MenuItem>
|
|
47
|
+
</Menu>
|
|
48
|
+
{/snippet}
|
|
49
|
+
</Popper>
|
|
50
|
+
</Story>
|
|
51
|
+
|
|
52
|
+
<Story name="BottomRight" asChild>
|
|
53
|
+
<Popper {open} popupPositionX="right" onClickOutside={() => (open = false)} popupWidth="100px">
|
|
54
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
55
|
+
{#snippet popupChildren()}
|
|
56
|
+
<Menu>
|
|
57
|
+
<MenuItem>One</MenuItem>
|
|
58
|
+
<MenuItem>Two</MenuItem>
|
|
59
|
+
<MenuItem>Three</MenuItem>
|
|
60
|
+
</Menu>
|
|
61
|
+
{/snippet}
|
|
62
|
+
</Popper>
|
|
63
|
+
</Story>
|
|
64
|
+
|
|
65
|
+
<Story name="TopLeft" asChild>
|
|
66
|
+
<Popper {open} popupPositionY="top" onClickOutside={() => (open = false)} popupWidth="100px">
|
|
67
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
68
|
+
{#snippet popupChildren()}
|
|
69
|
+
<Menu>
|
|
70
|
+
<MenuItem>One</MenuItem>
|
|
71
|
+
<MenuItem>Two</MenuItem>
|
|
72
|
+
<MenuItem>Three</MenuItem>
|
|
73
|
+
</Menu>
|
|
74
|
+
{/snippet}
|
|
75
|
+
</Popper>
|
|
76
|
+
</Story>
|
|
77
|
+
|
|
78
|
+
<Story name="TopCenter" asChild>
|
|
79
|
+
<Popper
|
|
80
|
+
{open}
|
|
81
|
+
popupPositionY="top"
|
|
82
|
+
popupPositionX="center"
|
|
83
|
+
onClickOutside={() => (open = false)}
|
|
84
|
+
popupWidth="100px"
|
|
85
|
+
>
|
|
86
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
87
|
+
{#snippet popupChildren()}
|
|
88
|
+
<Menu>
|
|
89
|
+
<MenuItem>One</MenuItem>
|
|
90
|
+
<MenuItem>Two</MenuItem>
|
|
91
|
+
<MenuItem>Three</MenuItem>
|
|
92
|
+
</Menu>
|
|
93
|
+
{/snippet}
|
|
94
|
+
</Popper>
|
|
95
|
+
</Story>
|
|
96
|
+
|
|
97
|
+
<Story name="TopRight" asChild>
|
|
98
|
+
<Popper
|
|
99
|
+
{open}
|
|
100
|
+
popupPositionY="top"
|
|
101
|
+
popupPositionX="right"
|
|
102
|
+
onClickOutside={() => (open = false)}
|
|
103
|
+
popupWidth="100px"
|
|
104
|
+
>
|
|
105
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
106
|
+
{#snippet popupChildren()}
|
|
107
|
+
<Menu>
|
|
108
|
+
<MenuItem>One</MenuItem>
|
|
109
|
+
<MenuItem>Two</MenuItem>
|
|
110
|
+
<MenuItem>Three</MenuItem>
|
|
111
|
+
</Menu>
|
|
112
|
+
{/snippet}
|
|
113
|
+
</Popper>
|
|
114
|
+
</Story>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import UtilityButton from '../UtilityButton.svelte';
|
|
4
|
+
import { storyUtilityButtonArgTypes } from '../UtilityButton.stories.svelte';
|
|
5
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: UtilityButton,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyUtilityButtonArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Normal">
|
|
16
|
+
<Icon icon="mdi:eye" width="24" height="24" />
|
|
17
|
+
</Story>
|
|
18
|
+
|
|
19
|
+
<Story name="Small" args={{ size: 'small' }}>
|
|
20
|
+
<Icon icon="mdi:eye" width="24" height="24" />
|
|
21
|
+
</Story>
|
|
22
|
+
|
|
23
|
+
<Story name="Large" args={{ size: 'large' }}>
|
|
24
|
+
<Icon icon="mdi:eye" width="24" height="24" />
|
|
25
|
+
</Story>
|