@flightlesslabs/dodo-ui 0.6.2 → 0.6.3
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/stories/philosophy/Colors/Colors.svelte +1 -1
- package/dist/stories/philosophy/Colors/Swatches/Palette.svelte +26 -4
- package/dist/stories/philosophy/Colors/Swatches/Swatch.svelte +6 -0
- package/dist/stories/philosophy/Colors/Swatches/Swatches.svelte +7 -3
- package/package.json +3 -3
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +0 -82
- package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +0 -68
- package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +0 -42
- package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +0 -51
- package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +0 -49
- package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +0 -22
- package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +0 -21
- package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +0 -29
- package/src/lib/stories/components/Form/Label/Label.stories.svelte +0 -23
- package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +0 -36
- package/src/lib/stories/components/Form/Message/Message.stories.svelte +0 -35
- package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +0 -24
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +0 -174
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +0 -57
- package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +0 -20
- package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +0 -16
- package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +0 -31
- package/src/lib/stories/components/Form/SimpleSelect/Events/Events.stories.svelte +0 -79
- package/src/lib/stories/components/Form/SimpleSelect/Roundness/Roundness.stories.svelte +0 -24
- package/src/lib/stories/components/Form/SimpleSelect/SimpleSelect.stories.svelte +0 -64
- package/src/lib/stories/components/Form/SimpleSelect/Size/Size.stories.svelte +0 -20
- package/src/lib/stories/components/Form/SimpleSelect/WithIcon/WithIcon.stories.svelte +0 -36
- package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +0 -153
- package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +0 -21
- package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +0 -17
- package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +0 -41
- package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +0 -47
- package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +0 -41
- package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +0 -30
- package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +0 -42
- package/src/lib/stories/developer tools/Intro.mdx +0 -7
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +0 -38
- package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +0 -20
- package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +0 -16
- package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +0 -47
- package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +0 -27
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +0 -33
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { storyPasswordInputArgTypes } from '../PasswordInput.stories.svelte';
|
|
4
|
-
import PasswordInput, { type PasswordInputToggleEvent } from '../PasswordInput.svelte';
|
|
5
|
-
import type {
|
|
6
|
-
TextInputFocusEvent,
|
|
7
|
-
TextInputClipboardEvent,
|
|
8
|
-
} from '../../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: PasswordInput,
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
argTypes: storyPasswordInputArgTypes,
|
|
15
|
-
});
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<Story
|
|
19
|
-
name="Input"
|
|
20
|
-
args={{
|
|
21
|
-
oninput: (e: Event) => {
|
|
22
|
-
const target = e.target as HTMLInputElement;
|
|
23
|
-
|
|
24
|
-
console.log('Input Event', target.value);
|
|
25
|
-
},
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<PasswordInput
|
|
29
|
-
oninput={(e: Event) => {
|
|
30
|
-
const target = e.target as HTMLInputElement;
|
|
31
|
-
|
|
32
|
-
console.log('Input Event', target.value);
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
</Story>
|
|
36
|
-
|
|
37
|
-
<Story
|
|
38
|
-
name="Change"
|
|
39
|
-
args={{
|
|
40
|
-
onchange: (e: Event) => {
|
|
41
|
-
const target = e.target as HTMLInputElement;
|
|
42
|
-
|
|
43
|
-
console.log('onChange Event', target.value);
|
|
44
|
-
},
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
<PasswordInput
|
|
48
|
-
onchange={(e: Event) => {
|
|
49
|
-
const target = e.target as HTMLInputElement;
|
|
50
|
-
|
|
51
|
-
console.log('onchange Event', target.value);
|
|
52
|
-
}}
|
|
53
|
-
/>
|
|
54
|
-
</Story>
|
|
55
|
-
|
|
56
|
-
<!-- `e: PasswordInputToggleEvent` -->
|
|
57
|
-
<Story
|
|
58
|
-
name="Toggle"
|
|
59
|
-
args={{
|
|
60
|
-
ontoggle: (e: PasswordInputToggleEvent) => {
|
|
61
|
-
const target = e.event.target as HTMLButtonElement;
|
|
62
|
-
|
|
63
|
-
console.log('ontoggle Event', e, target);
|
|
64
|
-
},
|
|
65
|
-
}}
|
|
66
|
-
>
|
|
67
|
-
<PasswordInput
|
|
68
|
-
ontoggle={(e: PasswordInputToggleEvent) => {
|
|
69
|
-
const target = e.event.target as HTMLButtonElement;
|
|
70
|
-
|
|
71
|
-
console.log('ontoggle Event', e, target);
|
|
72
|
-
}}
|
|
73
|
-
/>
|
|
74
|
-
</Story>
|
|
75
|
-
|
|
76
|
-
<!-- `e: TextInputFocusEvent` -->
|
|
77
|
-
<Story
|
|
78
|
-
name="Focus"
|
|
79
|
-
args={{
|
|
80
|
-
onfocus: (e: TextInputFocusEvent) => {
|
|
81
|
-
const target = e.target as HTMLInputElement;
|
|
82
|
-
|
|
83
|
-
console.log('onfocus Event', target);
|
|
84
|
-
},
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
<PasswordInput
|
|
88
|
-
onfocus={(e: TextInputFocusEvent) => {
|
|
89
|
-
const target = e.target as HTMLInputElement;
|
|
90
|
-
|
|
91
|
-
console.log('onfocus Event', target);
|
|
92
|
-
}}
|
|
93
|
-
/>
|
|
94
|
-
</Story>
|
|
95
|
-
|
|
96
|
-
<!-- `e: TextInputFocusEvent` -->
|
|
97
|
-
<Story
|
|
98
|
-
name="Blur"
|
|
99
|
-
args={{
|
|
100
|
-
onblur: (e: TextInputFocusEvent) => {
|
|
101
|
-
const target = e.target as HTMLInputElement;
|
|
102
|
-
|
|
103
|
-
console.log('onblur Event', target);
|
|
104
|
-
},
|
|
105
|
-
}}
|
|
106
|
-
>
|
|
107
|
-
<PasswordInput
|
|
108
|
-
onblur={(e: TextInputFocusEvent) => {
|
|
109
|
-
const target = e.target as HTMLInputElement;
|
|
110
|
-
|
|
111
|
-
console.log('onblur Event', target);
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
114
|
-
</Story>
|
|
115
|
-
|
|
116
|
-
<!-- `e: TextInputClipboardEvent` -->
|
|
117
|
-
<Story
|
|
118
|
-
name="Copy"
|
|
119
|
-
args={{
|
|
120
|
-
oncopy: (e: TextInputClipboardEvent) => {
|
|
121
|
-
const target = e.target as HTMLInputElement;
|
|
122
|
-
|
|
123
|
-
console.log('oncopy Event', target);
|
|
124
|
-
},
|
|
125
|
-
}}
|
|
126
|
-
>
|
|
127
|
-
<PasswordInput
|
|
128
|
-
oncopy={(e: TextInputClipboardEvent) => {
|
|
129
|
-
const target = e.target as HTMLInputElement;
|
|
130
|
-
|
|
131
|
-
console.log('oncopy Event', target);
|
|
132
|
-
}}
|
|
133
|
-
/>
|
|
134
|
-
</Story>
|
|
135
|
-
|
|
136
|
-
<!-- `e: TextInputClipboardEvent` -->
|
|
137
|
-
<Story
|
|
138
|
-
name="Cut"
|
|
139
|
-
args={{
|
|
140
|
-
oncut: (e: TextInputClipboardEvent) => {
|
|
141
|
-
const target = e.target as HTMLInputElement;
|
|
142
|
-
|
|
143
|
-
console.log('oncut Event', target);
|
|
144
|
-
},
|
|
145
|
-
}}
|
|
146
|
-
>
|
|
147
|
-
<PasswordInput
|
|
148
|
-
oncut={(e: TextInputClipboardEvent) => {
|
|
149
|
-
const target = e.target as HTMLInputElement;
|
|
150
|
-
|
|
151
|
-
console.log('oncut Event', target);
|
|
152
|
-
}}
|
|
153
|
-
/>
|
|
154
|
-
</Story>
|
|
155
|
-
|
|
156
|
-
<!-- `e: TextInputClipboardEvent` -->
|
|
157
|
-
<Story
|
|
158
|
-
name="Paste"
|
|
159
|
-
args={{
|
|
160
|
-
onpaste: (e: TextInputClipboardEvent) => {
|
|
161
|
-
const target = e.target as HTMLInputElement;
|
|
162
|
-
|
|
163
|
-
console.log('onpaste Event', target);
|
|
164
|
-
},
|
|
165
|
-
}}
|
|
166
|
-
>
|
|
167
|
-
<PasswordInput
|
|
168
|
-
onpaste={(e: TextInputClipboardEvent) => {
|
|
169
|
-
const target = e.target as HTMLInputElement;
|
|
170
|
-
|
|
171
|
-
console.log('onpaste Event', target);
|
|
172
|
-
}}
|
|
173
|
-
/>
|
|
174
|
-
</Story>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import PasswordInput from './PasswordInput.svelte';
|
|
4
|
-
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
-
import Icon from '@iconify/svelte';
|
|
6
|
-
|
|
7
|
-
export const storyPasswordInputArgTypes: StoryBookArgTypes = {
|
|
8
|
-
roundness: {
|
|
9
|
-
control: { type: 'select' },
|
|
10
|
-
options: [false, '1x', '2x', '3x'],
|
|
11
|
-
},
|
|
12
|
-
size: {
|
|
13
|
-
control: { type: 'select' },
|
|
14
|
-
options: ['normal', 'small', 'large'],
|
|
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: PasswordInput,
|
|
21
|
-
tags: ['autodocs'],
|
|
22
|
-
argTypes: storyPasswordInputArgTypes,
|
|
23
|
-
args: { value: 'Hello world!' },
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<!-- PasswordInput with default style -->
|
|
28
|
-
<Story name="Default" />
|
|
29
|
-
|
|
30
|
-
<Story name="Placeholder" args={{ value: '', placeholder: 'Type something...' }} />
|
|
31
|
-
|
|
32
|
-
<Story name="No Outline" args={{ outline: false }} />
|
|
33
|
-
|
|
34
|
-
<Story name="Error" args={{ error: true }} />
|
|
35
|
-
|
|
36
|
-
<Story name="Disabled" args={{ disabled: true }} />
|
|
37
|
-
|
|
38
|
-
<!-- Disable password toggle -->
|
|
39
|
-
<Story name="No toggle" args={{ passwordToggle: false }} />
|
|
40
|
-
|
|
41
|
-
<!-- Show Password by default -->
|
|
42
|
-
<Story name="Show Password" args={{ passwordToggleState: true }} />
|
|
43
|
-
|
|
44
|
-
<Story name="Read only" args={{ readonly: true }} />
|
|
45
|
-
|
|
46
|
-
<!-- Show Password by default -->
|
|
47
|
-
<Story name="Custom toggle icon">
|
|
48
|
-
<PasswordInput value="Hello world!">
|
|
49
|
-
{#snippet customPasswordToggleIcon(toggle)}
|
|
50
|
-
{#if toggle}
|
|
51
|
-
<Icon icon="mingcute:eye-close-line" width="24" height="24" />
|
|
52
|
-
{:else}
|
|
53
|
-
<Icon icon="mingcute:eye-2-line" width="24" height="24" />
|
|
54
|
-
{/if}
|
|
55
|
-
{/snippet}
|
|
56
|
-
</PasswordInput>
|
|
57
|
-
</Story>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import PasswordInput from '../PasswordInput.svelte';
|
|
4
|
-
import { storyPasswordInputArgTypes } from '../PasswordInput.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: PasswordInput,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
argTypes: storyPasswordInputArgTypes,
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<Story name="Roundness 1x" />
|
|
15
|
-
|
|
16
|
-
<Story name="Roundness 2x" args={{ roundness: '2x' }} />
|
|
17
|
-
|
|
18
|
-
<Story name="Roundness 3x" args={{ roundness: '3x' }} />
|
|
19
|
-
|
|
20
|
-
<Story name="Roundness False" args={{ roundness: false }} />
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import PasswordInput from '../PasswordInput.svelte';
|
|
4
|
-
import { storyPasswordInputArgTypes } from '../PasswordInput.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: PasswordInput,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
argTypes: storyPasswordInputArgTypes,
|
|
11
|
-
});
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<Story name="Normal" />
|
|
15
|
-
<Story name="Small" args={{ size: 'small' }} />
|
|
16
|
-
<Story name="Large" args={{ size: 'large' }} />
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import PasswordInput from '../PasswordInput.svelte';
|
|
4
|
-
import { storyPasswordInputArgTypes } from '../PasswordInput.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: PasswordInput,
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
argTypes: storyPasswordInputArgTypes,
|
|
12
|
-
});
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<!-- PasswordInput icon in front. -->
|
|
16
|
-
<Story name="Icon Before">
|
|
17
|
-
<PasswordInput>
|
|
18
|
-
{#snippet before()}
|
|
19
|
-
<Icon icon="material-symbols:content-copy" />
|
|
20
|
-
{/snippet}
|
|
21
|
-
</PasswordInput>
|
|
22
|
-
</Story>
|
|
23
|
-
|
|
24
|
-
<!-- PasswordInput icon in front. -->
|
|
25
|
-
<Story name="Icon After">
|
|
26
|
-
<PasswordInput>
|
|
27
|
-
{#snippet after()}
|
|
28
|
-
<Icon icon="material-symbols:download-2" />
|
|
29
|
-
{/snippet}
|
|
30
|
-
</PasswordInput>
|
|
31
|
-
</Story>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { type SimpleSelectFocusEvent } from '../SimpleSelect.svelte';
|
|
4
|
-
import SimpleSelect from '../SimpleSelect.svelte';
|
|
5
|
-
import {
|
|
6
|
-
storySimpleSelectArgTypes,
|
|
7
|
-
storySimpleSelectOptions,
|
|
8
|
-
} from '../SimpleSelect.stories.svelte';
|
|
9
|
-
|
|
10
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
11
|
-
const { Story } = defineMeta({
|
|
12
|
-
component: SimpleSelect,
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
argTypes: storySimpleSelectArgTypes,
|
|
15
|
-
args: { options: storySimpleSelectOptions },
|
|
16
|
-
});
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<Story
|
|
20
|
-
name="Change"
|
|
21
|
-
args={{
|
|
22
|
-
onchange: (e: Event) => {
|
|
23
|
-
const target = e.target as HTMLSelectElement;
|
|
24
|
-
|
|
25
|
-
console.log('onChange Event', target.value);
|
|
26
|
-
},
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
<SimpleSelect
|
|
30
|
-
onchange={(e: Event) => {
|
|
31
|
-
const target = e.target as HTMLSelectElement;
|
|
32
|
-
|
|
33
|
-
console.log('onchange Event', target.value);
|
|
34
|
-
}}
|
|
35
|
-
options={storySimpleSelectOptions}
|
|
36
|
-
/>
|
|
37
|
-
</Story>
|
|
38
|
-
|
|
39
|
-
<!-- `e: SimpleSelectFocusEvent` -->
|
|
40
|
-
<Story
|
|
41
|
-
name="Focus"
|
|
42
|
-
args={{
|
|
43
|
-
onfocus: (e: SimpleSelectFocusEvent) => {
|
|
44
|
-
const target = e.target as HTMLSelectElement;
|
|
45
|
-
|
|
46
|
-
console.log('onfocus Event', target);
|
|
47
|
-
},
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
<SimpleSelect
|
|
51
|
-
onfocus={(e: SimpleSelectFocusEvent) => {
|
|
52
|
-
const target = e.target as HTMLSelectElement;
|
|
53
|
-
|
|
54
|
-
console.log('onfocus Event', target);
|
|
55
|
-
}}
|
|
56
|
-
options={storySimpleSelectOptions}
|
|
57
|
-
/>
|
|
58
|
-
</Story>
|
|
59
|
-
|
|
60
|
-
<!-- `e: SimpleSelectFocusEvent` -->
|
|
61
|
-
<Story
|
|
62
|
-
name="Blur"
|
|
63
|
-
args={{
|
|
64
|
-
onblur: (e: SimpleSelectFocusEvent) => {
|
|
65
|
-
const target = e.target as HTMLSelectElement;
|
|
66
|
-
|
|
67
|
-
console.log('onblur Event', target);
|
|
68
|
-
},
|
|
69
|
-
}}
|
|
70
|
-
>
|
|
71
|
-
<SimpleSelect
|
|
72
|
-
onblur={(e: SimpleSelectFocusEvent) => {
|
|
73
|
-
const target = e.target as HTMLSelectElement;
|
|
74
|
-
|
|
75
|
-
console.log('onblur Event', target);
|
|
76
|
-
}}
|
|
77
|
-
options={storySimpleSelectOptions}
|
|
78
|
-
/>
|
|
79
|
-
</Story>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import SimpleSelect from '../SimpleSelect.svelte';
|
|
4
|
-
import {
|
|
5
|
-
storySimpleSelectArgTypes,
|
|
6
|
-
storySimpleSelectOptions,
|
|
7
|
-
} from '../SimpleSelect.stories.svelte';
|
|
8
|
-
|
|
9
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
10
|
-
const { Story } = defineMeta({
|
|
11
|
-
component: SimpleSelect,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
argTypes: storySimpleSelectArgTypes,
|
|
14
|
-
args: { options: storySimpleSelectOptions },
|
|
15
|
-
});
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<Story name="Roundness 1x" />
|
|
19
|
-
|
|
20
|
-
<Story name="Roundness 2x" args={{ roundness: '2x' }} />
|
|
21
|
-
|
|
22
|
-
<Story name="Roundness 3x" args={{ roundness: '3x' }} />
|
|
23
|
-
|
|
24
|
-
<Story name="Roundness False" args={{ roundness: false }} />
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { type SimpleSelectOption } from './SimpleSelect.svelte';
|
|
4
|
-
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
-
import SimpleSelect from './SimpleSelect.svelte';
|
|
6
|
-
|
|
7
|
-
export const storySimpleSelectArgTypes: StoryBookArgTypes = {
|
|
8
|
-
type: {
|
|
9
|
-
control: { type: 'select' },
|
|
10
|
-
options: ['text', 'tel', 'email', 'password', 'url', 'number'],
|
|
11
|
-
},
|
|
12
|
-
roundness: {
|
|
13
|
-
control: { type: 'select' },
|
|
14
|
-
options: [false, '1x', '2x', '3x'],
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
control: { type: 'select' },
|
|
18
|
-
options: ['normal', 'small', 'large'],
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const storySimpleSelectOptions: SimpleSelectOption[] = [
|
|
23
|
-
{
|
|
24
|
-
value: 'volvo',
|
|
25
|
-
label: 'Volvo',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: 'saab',
|
|
29
|
-
label: 'Saab',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: 'mercedes',
|
|
33
|
-
label: 'Mercedes',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
value: 'audi',
|
|
37
|
-
label: 'Audi',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
value: 'opel',
|
|
41
|
-
label: 'Opel',
|
|
42
|
-
disabled: true,
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
47
|
-
const { Story } = defineMeta({
|
|
48
|
-
component: SimpleSelect,
|
|
49
|
-
tags: ['autodocs'],
|
|
50
|
-
argTypes: storySimpleSelectArgTypes,
|
|
51
|
-
args: { options: storySimpleSelectOptions },
|
|
52
|
-
});
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<!-- SimpleSelect with default style -->
|
|
56
|
-
<Story name="Default" />
|
|
57
|
-
|
|
58
|
-
<Story name="Placeholder" args={{ value: '', placeholder: 'Type something...' }} />
|
|
59
|
-
|
|
60
|
-
<Story name="No Outline" args={{ outline: false }} />
|
|
61
|
-
|
|
62
|
-
<Story name="Error" args={{ error: true }} />
|
|
63
|
-
|
|
64
|
-
<Story name="Disabled" args={{ disabled: true }} />
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import SimpleSelect from '../SimpleSelect.svelte';
|
|
4
|
-
import {
|
|
5
|
-
storySimpleSelectArgTypes,
|
|
6
|
-
storySimpleSelectOptions,
|
|
7
|
-
} from '../SimpleSelect.stories.svelte';
|
|
8
|
-
|
|
9
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
10
|
-
const { Story } = defineMeta({
|
|
11
|
-
component: SimpleSelect,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
argTypes: storySimpleSelectArgTypes,
|
|
14
|
-
args: { options: storySimpleSelectOptions },
|
|
15
|
-
});
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<Story name="Normal" />
|
|
19
|
-
<Story name="Small" args={{ size: 'small' }} />
|
|
20
|
-
<Story name="Large" args={{ size: 'large' }} />
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Icon from '@iconify/svelte';
|
|
4
|
-
|
|
5
|
-
import SimpleSelect from '../SimpleSelect.svelte';
|
|
6
|
-
import {
|
|
7
|
-
storySimpleSelectArgTypes,
|
|
8
|
-
storySimpleSelectOptions,
|
|
9
|
-
} from '../SimpleSelect.stories.svelte';
|
|
10
|
-
|
|
11
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
12
|
-
const { Story } = defineMeta({
|
|
13
|
-
component: SimpleSelect,
|
|
14
|
-
tags: ['autodocs'],
|
|
15
|
-
argTypes: storySimpleSelectArgTypes,
|
|
16
|
-
args: { options: storySimpleSelectOptions },
|
|
17
|
-
});
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<!-- SimpleSelect icon in front. -->
|
|
21
|
-
<Story name="Icon Before">
|
|
22
|
-
<SimpleSelect options={storySimpleSelectOptions}>
|
|
23
|
-
{#snippet before()}
|
|
24
|
-
<Icon icon="material-symbols:content-copy" />
|
|
25
|
-
{/snippet}
|
|
26
|
-
</SimpleSelect>
|
|
27
|
-
</Story>
|
|
28
|
-
|
|
29
|
-
<!-- SimpleSelect icon in front. -->
|
|
30
|
-
<Story name="Icon After">
|
|
31
|
-
<SimpleSelect options={storySimpleSelectOptions}>
|
|
32
|
-
{#snippet after()}
|
|
33
|
-
<Icon icon="material-symbols:download-2" />
|
|
34
|
-
{/snippet}
|
|
35
|
-
</SimpleSelect>
|
|
36
|
-
</Story>
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import TextInput, {
|
|
4
|
-
type TextInputClipboardEvent,
|
|
5
|
-
type TextInputFocusEvent,
|
|
6
|
-
} from '../TextInput.svelte';
|
|
7
|
-
import { storyTextInputArgTypes } from '../TextInput.stories.svelte';
|
|
8
|
-
|
|
9
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
10
|
-
const { Story } = defineMeta({
|
|
11
|
-
component: TextInput,
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
argTypes: storyTextInputArgTypes,
|
|
14
|
-
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<Story
|
|
18
|
-
name="Input"
|
|
19
|
-
args={{
|
|
20
|
-
oninput: (e: Event) => {
|
|
21
|
-
const target = e.target as HTMLInputElement;
|
|
22
|
-
|
|
23
|
-
console.log('Input Event', target.value);
|
|
24
|
-
},
|
|
25
|
-
}}
|
|
26
|
-
>
|
|
27
|
-
<TextInput
|
|
28
|
-
oninput={(e: Event) => {
|
|
29
|
-
const target = e.target as HTMLInputElement;
|
|
30
|
-
|
|
31
|
-
console.log('Input Event', target.value);
|
|
32
|
-
}}
|
|
33
|
-
/>
|
|
34
|
-
</Story>
|
|
35
|
-
|
|
36
|
-
<Story
|
|
37
|
-
name="Change"
|
|
38
|
-
args={{
|
|
39
|
-
onchange: (e: Event) => {
|
|
40
|
-
const target = e.target as HTMLInputElement;
|
|
41
|
-
|
|
42
|
-
console.log('onChange Event', target.value);
|
|
43
|
-
},
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
<TextInput
|
|
47
|
-
onchange={(e: Event) => {
|
|
48
|
-
const target = e.target as HTMLInputElement;
|
|
49
|
-
|
|
50
|
-
console.log('onchange Event', target.value);
|
|
51
|
-
}}
|
|
52
|
-
/>
|
|
53
|
-
</Story>
|
|
54
|
-
|
|
55
|
-
<!-- `e: TextInputFocusEvent` -->
|
|
56
|
-
<Story
|
|
57
|
-
name="Focus"
|
|
58
|
-
args={{
|
|
59
|
-
onfocus: (e: TextInputFocusEvent) => {
|
|
60
|
-
const target = e.target as HTMLInputElement;
|
|
61
|
-
|
|
62
|
-
console.log('onfocus Event', target);
|
|
63
|
-
},
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
<TextInput
|
|
67
|
-
onfocus={(e: TextInputFocusEvent) => {
|
|
68
|
-
const target = e.target as HTMLInputElement;
|
|
69
|
-
|
|
70
|
-
console.log('onfocus Event', target);
|
|
71
|
-
}}
|
|
72
|
-
/>
|
|
73
|
-
</Story>
|
|
74
|
-
|
|
75
|
-
<!-- `e: TextInputFocusEvent` -->
|
|
76
|
-
<Story
|
|
77
|
-
name="Blur"
|
|
78
|
-
args={{
|
|
79
|
-
onblur: (e: TextInputFocusEvent) => {
|
|
80
|
-
const target = e.target as HTMLInputElement;
|
|
81
|
-
|
|
82
|
-
console.log('onblur Event', target);
|
|
83
|
-
},
|
|
84
|
-
}}
|
|
85
|
-
>
|
|
86
|
-
<TextInput
|
|
87
|
-
onblur={(e: TextInputFocusEvent) => {
|
|
88
|
-
const target = e.target as HTMLInputElement;
|
|
89
|
-
|
|
90
|
-
console.log('onblur Event', target);
|
|
91
|
-
}}
|
|
92
|
-
/>
|
|
93
|
-
</Story>
|
|
94
|
-
|
|
95
|
-
<!-- `e: TextInputClipboardEvent` -->
|
|
96
|
-
<Story
|
|
97
|
-
name="Copy"
|
|
98
|
-
args={{
|
|
99
|
-
oncopy: (e: TextInputClipboardEvent) => {
|
|
100
|
-
const target = e.target as HTMLInputElement;
|
|
101
|
-
|
|
102
|
-
console.log('oncopy Event', target);
|
|
103
|
-
},
|
|
104
|
-
}}
|
|
105
|
-
>
|
|
106
|
-
<TextInput
|
|
107
|
-
oncopy={(e: TextInputClipboardEvent) => {
|
|
108
|
-
const target = e.target as HTMLInputElement;
|
|
109
|
-
|
|
110
|
-
console.log('oncopy Event', target);
|
|
111
|
-
}}
|
|
112
|
-
/>
|
|
113
|
-
</Story>
|
|
114
|
-
|
|
115
|
-
<!-- `e: TextInputClipboardEvent` -->
|
|
116
|
-
<Story
|
|
117
|
-
name="Cut"
|
|
118
|
-
args={{
|
|
119
|
-
oncut: (e: TextInputClipboardEvent) => {
|
|
120
|
-
const target = e.target as HTMLInputElement;
|
|
121
|
-
|
|
122
|
-
console.log('oncut Event', target);
|
|
123
|
-
},
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
<TextInput
|
|
127
|
-
oncut={(e: TextInputClipboardEvent) => {
|
|
128
|
-
const target = e.target as HTMLInputElement;
|
|
129
|
-
|
|
130
|
-
console.log('oncut Event', target);
|
|
131
|
-
}}
|
|
132
|
-
/>
|
|
133
|
-
</Story>
|
|
134
|
-
|
|
135
|
-
<!-- `e: TextInputClipboardEvent` -->
|
|
136
|
-
<Story
|
|
137
|
-
name="Paste"
|
|
138
|
-
args={{
|
|
139
|
-
onpaste: (e: TextInputClipboardEvent) => {
|
|
140
|
-
const target = e.target as HTMLInputElement;
|
|
141
|
-
|
|
142
|
-
console.log('onpaste Event', target);
|
|
143
|
-
},
|
|
144
|
-
}}
|
|
145
|
-
>
|
|
146
|
-
<TextInput
|
|
147
|
-
onpaste={(e: TextInputClipboardEvent) => {
|
|
148
|
-
const target = e.target as HTMLInputElement;
|
|
149
|
-
|
|
150
|
-
console.log('onpaste Event', target);
|
|
151
|
-
}}
|
|
152
|
-
/>
|
|
153
|
-
</Story>
|