@flightlesslabs/dodo-ui 0.2.0 → 0.3.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 +6 -0
- package/dist/index.js +4 -0
- package/dist/stories/Home.mdx +1 -1
- package/dist/stories/components/Form/Button/Button.stories.svelte +10 -5
- package/dist/stories/components/Form/Button/Button.svelte +213 -208
- package/dist/stories/components/Form/Button/Button.svelte.d.ts +4 -1
- package/dist/stories/components/Form/Button/Events/Events.stories.svelte +40 -0
- package/dist/stories/components/Form/Button/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/Button/utils/scss/mixins.scss +21 -21
- package/dist/stories/components/Form/PasswordInput/Events/Events.stories.svelte +168 -0
- package/dist/stories/components/Form/PasswordInput/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +37 -0
- package/dist/stories/components/Form/PasswordInput/PasswordInput.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte +219 -0
- package/dist/stories/components/Form/PasswordInput/PasswordInput.svelte.d.ts +59 -0
- package/dist/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +20 -0
- package/dist/stories/components/Form/{ExampleButton/ExampleButton.stories.svelte.d.ts → PasswordInput/Roundness/Roundness.stories.svelte.d.ts} +3 -4
- package/dist/stories/components/Form/PasswordInput/Size/Size.stories.svelte +16 -0
- package/dist/stories/components/Form/PasswordInput/Size/Size.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +31 -0
- package/dist/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/TextInput/Events/Events.stories.svelte +148 -0
- package/dist/stories/components/Form/TextInput/Events/Events.stories.svelte.d.ts +18 -0
- package/dist/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +21 -0
- package/dist/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/TextInput/Size/Size.stories.svelte +17 -0
- package/dist/stories/components/Form/TextInput/Size/Size.stories.svelte.d.ts +26 -0
- package/dist/stories/components/Form/TextInput/TextInput.stories.svelte +35 -0
- package/dist/stories/components/Form/TextInput/TextInput.stories.svelte.d.ts +21 -0
- package/dist/stories/components/Form/TextInput/TextInput.svelte +166 -0
- package/dist/stories/components/Form/TextInput/TextInput.svelte.d.ts +56 -0
- package/dist/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +47 -0
- package/dist/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte.d.ts +26 -0
- package/dist/styles/_components.css +8 -7
- package/dist/styles/_minimal-reset.css +3 -0
- package/dist/styles/global.css +1 -0
- package/package.json +1 -1
- package/src/lib/index.ts +13 -0
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +10 -5
- package/src/lib/stories/components/Form/Button/Button.svelte +32 -22
- package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +42 -0
- package/src/lib/stories/components/Form/Button/utils/scss/mixins.scss +21 -21
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +174 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +41 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.svelte +361 -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/TextInput/Events/Events.stories.svelte +153 -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 +39 -0
- package/src/lib/stories/components/Form/TextInput/TextInput.svelte +293 -0
- package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/styles/_components.css +8 -7
- package/src/lib/styles/_minimal-reset.css +3 -0
- package/src/lib/styles/global.css +1 -0
- package/dist/stories/components/Form/ExampleButton/ExampleButton.stories.svelte +0 -30
- package/dist/stories/components/Form/ExampleButton/ExampleButton.svelte +0 -14
- package/dist/stories/components/Form/ExampleButton/ExampleButton.svelte.d.ts +0 -16
- package/dist/stories/components/Form/ExampleButton/button.css +0 -30
- package/src/lib/stories/components/Form/ExampleButton/ExampleButton.stories.svelte +0 -30
- package/src/lib/stories/components/Form/ExampleButton/ExampleButton.svelte +0 -29
- package/src/lib/stories/components/Form/ExampleButton/button.css +0 -30
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export type PasswordInputToggleEvent = {
|
|
2
|
+
event: Event;
|
|
3
|
+
toggle: boolean;
|
|
4
|
+
};
|
|
5
|
+
import type { ComponentSize } from '../../../../types.js';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
import type { ChangeEventHandler, ClipboardEventHandler, FocusEventHandler, FormEventHandler } from 'svelte/elements';
|
|
8
|
+
import type { TextInputRoundness } from '../TextInput/TextInput.svelte';
|
|
9
|
+
interface PasswordInputProps {
|
|
10
|
+
/** How large should the button be? */
|
|
11
|
+
size?: ComponentSize;
|
|
12
|
+
/** Toggle Password */
|
|
13
|
+
passwordToggle?: boolean;
|
|
14
|
+
/** Default Password Toggle State */
|
|
15
|
+
defaultPasswordToggleState?: boolean;
|
|
16
|
+
/** Toggle Password Icon */
|
|
17
|
+
passwordToggleIcon?: Snippet;
|
|
18
|
+
/** How round should the border radius be? */
|
|
19
|
+
roundness?: TextInputRoundness;
|
|
20
|
+
/** Add a border around the button. Default True */
|
|
21
|
+
outline?: boolean;
|
|
22
|
+
/** Input value */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** How round should the border radius be? */
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/** Button disabled state */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** is there any associated Error ? */
|
|
29
|
+
error?: boolean;
|
|
30
|
+
/** Name */
|
|
31
|
+
name?: string;
|
|
32
|
+
/** Id */
|
|
33
|
+
id?: string;
|
|
34
|
+
/** Icon before button content */
|
|
35
|
+
before?: Snippet;
|
|
36
|
+
/** Icon after button content */
|
|
37
|
+
after?: Snippet;
|
|
38
|
+
/** Custom css class*/
|
|
39
|
+
class?: string;
|
|
40
|
+
/** oninput event handler */
|
|
41
|
+
oninput?: FormEventHandler<HTMLInputElement>;
|
|
42
|
+
/** onchange event handler */
|
|
43
|
+
onchange?: ChangeEventHandler<HTMLInputElement>;
|
|
44
|
+
/** onblur event handler */
|
|
45
|
+
onblur?: FocusEventHandler<HTMLInputElement>;
|
|
46
|
+
/** onfocus event handler */
|
|
47
|
+
onfocus?: FocusEventHandler<HTMLInputElement>;
|
|
48
|
+
/** onpaste event handler */
|
|
49
|
+
onpaste?: ClipboardEventHandler<HTMLInputElement>;
|
|
50
|
+
/** oncopy event handler */
|
|
51
|
+
oncopy?: ClipboardEventHandler<HTMLInputElement>;
|
|
52
|
+
/** oncut event handler */
|
|
53
|
+
oncut?: ClipboardEventHandler<HTMLInputElement>;
|
|
54
|
+
/** ontoggle event handler */
|
|
55
|
+
ontoggle?: (e: PasswordInputToggleEvent) => void;
|
|
56
|
+
}
|
|
57
|
+
declare const PasswordInput: import("svelte").Component<PasswordInputProps, {}, "value">;
|
|
58
|
+
type PasswordInput = ReturnType<typeof PasswordInput>;
|
|
59
|
+
export default PasswordInput;
|
|
@@ -0,0 +1,20 @@
|
|
|
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,17 +1,16 @@
|
|
|
1
|
-
export default
|
|
2
|
-
type
|
|
1
|
+
export default Roundness;
|
|
2
|
+
type Roundness = SvelteComponent<{
|
|
3
3
|
[x: string]: never;
|
|
4
4
|
}, {
|
|
5
5
|
[evt: string]: CustomEvent<any>;
|
|
6
6
|
}, {}> & {
|
|
7
7
|
$$bindings?: string | undefined;
|
|
8
8
|
};
|
|
9
|
-
declare const
|
|
9
|
+
declare const Roundness: $$__sveltets_2_IsomorphicComponent<{
|
|
10
10
|
[x: string]: never;
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {}, {}, string>;
|
|
14
|
-
import ExampleButton from './ExampleButton.svelte';
|
|
15
14
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
15
|
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
16
|
$$bindings?: Bindings;
|
|
@@ -0,0 +1,16 @@
|
|
|
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' }} />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default Size;
|
|
2
|
+
type Size = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Size: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default WithIcon;
|
|
2
|
+
type WithIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const WithIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
|
+
import TextInput, {} from '../TextInput.svelte';
|
|
3
|
+
import { storyTextInputArgTypes } from '../TextInput.stories.svelte';
|
|
4
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
component: TextInput,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: storyTextInputArgTypes,
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<Story
|
|
13
|
+
name="Input"
|
|
14
|
+
args={{
|
|
15
|
+
oninput: (e: Event) => {
|
|
16
|
+
const target = e.target as HTMLInputElement;
|
|
17
|
+
|
|
18
|
+
console.log('Input Event', target.value);
|
|
19
|
+
},
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<TextInput
|
|
23
|
+
oninput={(e: Event) => {
|
|
24
|
+
const target = e.target as HTMLInputElement;
|
|
25
|
+
|
|
26
|
+
console.log('Input Event', target.value);
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
</Story>
|
|
30
|
+
|
|
31
|
+
<Story
|
|
32
|
+
name="Change"
|
|
33
|
+
args={{
|
|
34
|
+
onchange: (e: Event) => {
|
|
35
|
+
const target = e.target as HTMLInputElement;
|
|
36
|
+
|
|
37
|
+
console.log('onChange Event', target.value);
|
|
38
|
+
},
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<TextInput
|
|
42
|
+
onchange={(e: Event) => {
|
|
43
|
+
const target = e.target as HTMLInputElement;
|
|
44
|
+
|
|
45
|
+
console.log('onchange Event', target.value);
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
</Story>
|
|
49
|
+
|
|
50
|
+
<!-- `e: TextInputFocusEvent` -->
|
|
51
|
+
<Story
|
|
52
|
+
name="Focus"
|
|
53
|
+
args={{
|
|
54
|
+
onfocus: (e: TextInputFocusEvent) => {
|
|
55
|
+
const target = e.target as HTMLInputElement;
|
|
56
|
+
|
|
57
|
+
console.log('onfocus Event', target);
|
|
58
|
+
},
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<TextInput
|
|
62
|
+
onfocus={(e: TextInputFocusEvent) => {
|
|
63
|
+
const target = e.target as HTMLInputElement;
|
|
64
|
+
|
|
65
|
+
console.log('onfocus Event', target);
|
|
66
|
+
}}
|
|
67
|
+
/>
|
|
68
|
+
</Story>
|
|
69
|
+
|
|
70
|
+
<!-- `e: TextInputFocusEvent` -->
|
|
71
|
+
<Story
|
|
72
|
+
name="Blur"
|
|
73
|
+
args={{
|
|
74
|
+
onblur: (e: TextInputFocusEvent) => {
|
|
75
|
+
const target = e.target as HTMLInputElement;
|
|
76
|
+
|
|
77
|
+
console.log('onblur Event', target);
|
|
78
|
+
},
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
<TextInput
|
|
82
|
+
onblur={(e: TextInputFocusEvent) => {
|
|
83
|
+
const target = e.target as HTMLInputElement;
|
|
84
|
+
|
|
85
|
+
console.log('onblur Event', target);
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
</Story>
|
|
89
|
+
|
|
90
|
+
<!-- `e: TextInputClipboardEvent` -->
|
|
91
|
+
<Story
|
|
92
|
+
name="Copy"
|
|
93
|
+
args={{
|
|
94
|
+
oncopy: (e: TextInputClipboardEvent) => {
|
|
95
|
+
const target = e.target as HTMLInputElement;
|
|
96
|
+
|
|
97
|
+
console.log('oncopy Event', target);
|
|
98
|
+
},
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
<TextInput
|
|
102
|
+
oncopy={(e: TextInputClipboardEvent) => {
|
|
103
|
+
const target = e.target as HTMLInputElement;
|
|
104
|
+
|
|
105
|
+
console.log('oncopy Event', target);
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
108
|
+
</Story>
|
|
109
|
+
|
|
110
|
+
<!-- `e: TextInputClipboardEvent` -->
|
|
111
|
+
<Story
|
|
112
|
+
name="Cut"
|
|
113
|
+
args={{
|
|
114
|
+
oncut: (e: TextInputClipboardEvent) => {
|
|
115
|
+
const target = e.target as HTMLInputElement;
|
|
116
|
+
|
|
117
|
+
console.log('oncut Event', target);
|
|
118
|
+
},
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<TextInput
|
|
122
|
+
oncut={(e: TextInputClipboardEvent) => {
|
|
123
|
+
const target = e.target as HTMLInputElement;
|
|
124
|
+
|
|
125
|
+
console.log('oncut Event', target);
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
</Story>
|
|
129
|
+
|
|
130
|
+
<!-- `e: TextInputClipboardEvent` -->
|
|
131
|
+
<Story
|
|
132
|
+
name="Paste"
|
|
133
|
+
args={{
|
|
134
|
+
onpaste: (e: TextInputClipboardEvent) => {
|
|
135
|
+
const target = e.target as HTMLInputElement;
|
|
136
|
+
|
|
137
|
+
console.log('onpaste Event', target);
|
|
138
|
+
},
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<TextInput
|
|
142
|
+
onpaste={(e: TextInputClipboardEvent) => {
|
|
143
|
+
const target = e.target as HTMLInputElement;
|
|
144
|
+
|
|
145
|
+
console.log('onpaste Event', target);
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
</Story>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Events: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Events = InstanceType<typeof Events>;
|
|
18
|
+
export default Events;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TextInput from '../TextInput.svelte';
|
|
4
|
+
import { storyTextInputArgTypes } from '../TextInput.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: TextInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyTextInputArgTypes,
|
|
11
|
+
args: { value: 'Hello world!' },
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Roundness 1x" />
|
|
16
|
+
|
|
17
|
+
<Story name="Roundness 2x" args={{ roundness: '2x' }} />
|
|
18
|
+
|
|
19
|
+
<Story name="Roundness 3x" args={{ roundness: '3x' }} />
|
|
20
|
+
|
|
21
|
+
<Story name="Roundness False" args={{ roundness: false }} />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default Roundness;
|
|
2
|
+
type Roundness = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Roundness: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import TextInput from '../TextInput.svelte';
|
|
4
|
+
import { storyTextInputArgTypes } from '../TextInput.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: TextInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyTextInputArgTypes,
|
|
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' }} />
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default Size;
|
|
2
|
+
type Size = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const Size: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script module lang="ts">import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
2
|
+
import TextInput from './TextInput.svelte';
|
|
3
|
+
export const storyTextInputArgTypes = {
|
|
4
|
+
type: {
|
|
5
|
+
control: { type: 'select' },
|
|
6
|
+
options: ['text', 'tel', 'email', 'password', 'url', 'number'],
|
|
7
|
+
},
|
|
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
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
18
|
+
const { Story } = defineMeta({
|
|
19
|
+
component: TextInput,
|
|
20
|
+
tags: ['autodocs'],
|
|
21
|
+
argTypes: storyTextInputArgTypes,
|
|
22
|
+
args: { value: 'Hello world!' },
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- TextInput with default style -->
|
|
27
|
+
<Story name="Default" />
|
|
28
|
+
|
|
29
|
+
<Story name="Placeholder" args={{ value: '', placeholder: 'Type something...' }} />
|
|
30
|
+
|
|
31
|
+
<Story name="No Outline" args={{ outline: false }} />
|
|
32
|
+
|
|
33
|
+
<Story name="Error" args={{ error: true }} />
|
|
34
|
+
|
|
35
|
+
<Story name="Disabled" args={{ disabled: true }} />
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import TextInput from './TextInput.svelte';
|
|
2
|
+
import type { StoryBookArgTypes } from '../../../../storybook-types.js';
|
|
3
|
+
export declare const storyTextInputArgTypes: StoryBookArgTypes;
|
|
4
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
14
|
+
};
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
16
|
+
}
|
|
17
|
+
declare const TextInput: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type TextInput = InstanceType<typeof TextInput>;
|
|
21
|
+
export default TextInput;
|