@iroco/ui 1.0.0-9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/Alert.stories.svelte +19 -20
- package/dist/Alert.stories.svelte.d.ts +17 -35
- package/dist/Alert.svelte +12 -5
- package/dist/Alert.svelte.d.ts +7 -18
- package/dist/Button.stories.svelte +16 -12
- package/dist/Button.stories.svelte.d.ts +17 -43
- package/dist/Button.svelte +33 -12
- package/dist/Button.svelte.d.ts +13 -38
- package/dist/DataTable.stories.svelte +24 -19
- package/dist/DataTable.stories.svelte.d.ts +17 -27
- package/dist/DataTable.svelte +45 -25
- package/dist/DataTable.svelte.d.ts +16 -23
- package/dist/IconBurger.stories.svelte +8 -12
- package/dist/IconBurger.stories.svelte.d.ts +17 -46
- package/dist/IconBurger.svelte +7 -2
- package/dist/IconBurger.svelte.d.ts +6 -16
- package/dist/IconClose.stories.svelte +6 -12
- package/dist/IconClose.stories.svelte.d.ts +17 -46
- package/dist/IconClose.svelte +7 -2
- package/dist/IconClose.svelte.d.ts +6 -16
- package/dist/IconFloppyDisk.stories.svelte +4 -11
- package/dist/IconFloppyDisk.stories.svelte.d.ts +17 -53
- package/dist/IconFloppyDisk.svelte +8 -3
- package/dist/IconFloppyDisk.svelte.d.ts +7 -17
- package/dist/IconInfo.stories.svelte +8 -11
- package/dist/IconInfo.stories.svelte.d.ts +17 -48
- package/dist/IconInfo.svelte +7 -2
- package/dist/IconInfo.svelte.d.ts +6 -16
- package/dist/IconIrocoLogo.stories.svelte +8 -8
- package/dist/IconIrocoLogo.stories.svelte.d.ts +17 -55
- package/dist/IconIrocoLogo.svelte +18 -6
- package/dist/IconIrocoLogo.svelte.d.ts +9 -19
- package/dist/IconMoreSign.stories.svelte +7 -14
- package/dist/IconMoreSign.stories.svelte.d.ts +17 -48
- package/dist/IconMoreSign.svelte +7 -2
- package/dist/IconMoreSign.svelte.d.ts +6 -16
- package/dist/IconTrashCan.stories.svelte +6 -12
- package/dist/IconTrashCan.stories.svelte.d.ts +17 -48
- package/dist/IconTrashCan.svelte +8 -3
- package/dist/IconTrashCan.svelte.d.ts +7 -17
- package/dist/ImageArticle.stories.svelte +11 -8
- package/dist/ImageArticle.stories.svelte.d.ts +17 -64
- package/dist/ImageArticle.svelte +37 -165
- package/dist/ImageArticle.svelte.d.ts +11 -21
- package/dist/IrocoLogo.stories.svelte +12 -7
- package/dist/IrocoLogo.stories.svelte.d.ts +17 -48
- package/dist/IrocoLogo.svelte +15 -4
- package/dist/IrocoLogo.svelte.d.ts +8 -18
- package/dist/Loader.stories.svelte +11 -8
- package/dist/Loader.stories.svelte.d.ts +17 -27
- package/dist/Loader.svelte +19 -18
- package/dist/Loader.svelte.d.ts +16 -12
- package/dist/NavBar.stories.svelte +29 -20
- package/dist/NavBar.stories.svelte.d.ts +17 -35
- package/dist/NavBar.svelte +49 -183
- package/dist/NavBar.svelte.d.ts +33 -20
- package/dist/Navigation.stories.svelte +30 -28
- package/dist/Navigation.stories.svelte.d.ts +17 -57
- package/dist/Navigation.svelte +35 -14
- package/dist/Navigation.svelte.d.ts +18 -20
- package/dist/NumberInput.stories.svelte +12 -7
- package/dist/NumberInput.stories.svelte.d.ts +17 -75
- package/dist/NumberInput.svelte +26 -8
- package/dist/NumberInput.svelte.d.ts +13 -24
- package/dist/RadioButton.stories.svelte +17 -30
- package/dist/RadioButton.stories.svelte.d.ts +17 -54
- package/dist/RadioButton.svelte +26 -12
- package/dist/RadioButton.svelte.d.ts +10 -20
- package/dist/SlottedComponentWrapper.svelte +4 -4
- package/dist/SlottedComponentWrapper.svelte.d.ts +4 -22
- package/dist/TextInput.stories.svelte +24 -47
- package/dist/TextInput.stories.svelte.d.ts +17 -109
- package/dist/TextInput.svelte +45 -25
- package/dist/TextInput.svelte.d.ts +19 -30
- package/dist/definition.d.ts +0 -5
- package/dist/definition.js +0 -11
- package/dist/index.d.ts +14 -10
- package/dist/index.js +14 -10
- package/dist/scss/button.scss +7 -3
- package/dist/scss/colors.scss +21 -11
- package/dist/scss/fields/_input.scss +1 -1
- package/dist/scss/fields/_style.scss +2 -2
- package/package.json +49 -48
- package/dist/RadioButtonTest.svelte +0 -10
- package/dist/RadioButtonTest.svelte.d.ts +0 -19
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { NavigationItem } from './definition';
|
|
3
2
|
import { Color } from './definition';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type NavigationEvents = typeof __propDef.events;
|
|
20
|
-
export type NavigationSlots = typeof __propDef.slots;
|
|
21
|
-
export default class Navigation extends SvelteComponent<NavigationProps, NavigationEvents, NavigationSlots> {
|
|
3
|
+
interface Props {
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
navigationItems: Array<NavigationItem>;
|
|
7
|
+
type?: 'sidebar' | 'topbar';
|
|
8
|
+
title?: string | null;
|
|
9
|
+
version?: string | null;
|
|
10
|
+
color?: Color | string;
|
|
11
|
+
navigating?: {
|
|
12
|
+
to: {
|
|
13
|
+
url: {
|
|
14
|
+
pathname: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} | null;
|
|
22
18
|
}
|
|
23
|
-
|
|
19
|
+
declare const Navigation: import("svelte").Component<Props, {}, "">;
|
|
20
|
+
type Navigation = ReturnType<typeof Navigation>;
|
|
21
|
+
export default Navigation;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script module lang="ts">
|
|
2
2
|
import { NumberInput } from './index';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { defineMeta, setTemplate } from '@storybook/addon-svelte-csf';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
title: 'Iroco-UI/Form/NumberInput',
|
|
6
10
|
component: NumberInput,
|
|
7
11
|
argTypes: {
|
|
@@ -27,18 +31,19 @@
|
|
|
27
31
|
control: { type: 'number' }
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
};
|
|
34
|
+
});
|
|
31
35
|
</script>
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
setTemplate(template);
|
|
35
40
|
</script>
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
{#snippet template({ ...args })}
|
|
38
43
|
<form class="iroco-ui-form">
|
|
39
44
|
<NumberInput {...args} />
|
|
40
45
|
</form>
|
|
41
|
-
|
|
46
|
+
{/snippet}
|
|
42
47
|
|
|
43
48
|
<Story name="Default" />
|
|
44
49
|
<Story name="Label" args={{ label: 'Label' }} />
|
|
@@ -1,77 +1,19 @@
|
|
|
1
|
-
export namespace meta {
|
|
2
|
-
export let title: string;
|
|
3
|
-
export { NumberInput as component };
|
|
4
|
-
export namespace argTypes {
|
|
5
|
-
namespace id {
|
|
6
|
-
namespace control {
|
|
7
|
-
let type: string;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
namespace label {
|
|
11
|
-
export namespace control_1 {
|
|
12
|
-
let type_1: string;
|
|
13
|
-
export { type_1 as type };
|
|
14
|
-
}
|
|
15
|
-
export { control_1 as control };
|
|
16
|
-
}
|
|
17
|
-
namespace placeholder {
|
|
18
|
-
export namespace control_2 {
|
|
19
|
-
let type_2: string;
|
|
20
|
-
export { type_2 as type };
|
|
21
|
-
}
|
|
22
|
-
export { control_2 as control };
|
|
23
|
-
}
|
|
24
|
-
namespace error {
|
|
25
|
-
export namespace control_3 {
|
|
26
|
-
let type_3: string;
|
|
27
|
-
export { type_3 as type };
|
|
28
|
-
}
|
|
29
|
-
export { control_3 as control };
|
|
30
|
-
}
|
|
31
|
-
namespace value {
|
|
32
|
-
export namespace control_4 {
|
|
33
|
-
let type_4: string;
|
|
34
|
-
export { type_4 as type };
|
|
35
|
-
}
|
|
36
|
-
export { control_4 as control };
|
|
37
|
-
}
|
|
38
|
-
namespace min {
|
|
39
|
-
export namespace control_5 {
|
|
40
|
-
let type_5: string;
|
|
41
|
-
export { type_5 as type };
|
|
42
|
-
}
|
|
43
|
-
export { control_5 as control };
|
|
44
|
-
}
|
|
45
|
-
namespace max {
|
|
46
|
-
export namespace control_6 {
|
|
47
|
-
let type_6: string;
|
|
48
|
-
export { type_6 as type };
|
|
49
|
-
}
|
|
50
|
-
export { control_6 as control };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/** @typedef {typeof __propDef.props} NumberInputProps */
|
|
55
|
-
/** @typedef {typeof __propDef.events} NumberInputEvents */
|
|
56
|
-
/** @typedef {typeof __propDef.slots} NumberInputSlots */
|
|
57
|
-
export default class NumberInput extends SvelteComponent<{
|
|
58
|
-
[x: string]: never;
|
|
59
|
-
}, {
|
|
60
|
-
[evt: string]: CustomEvent<any>;
|
|
61
|
-
}, {}> {
|
|
62
|
-
}
|
|
63
|
-
export type NumberInputProps = typeof __propDef.props;
|
|
64
|
-
export type NumberInputEvents = typeof __propDef.events;
|
|
65
|
-
export type NumberInputSlots = typeof __propDef.slots;
|
|
66
1
|
import { NumberInput } from './index';
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
71
12
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const NumberInput: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type NumberInput = InstanceType<typeof NumberInput>;
|
|
19
|
+
export default NumberInput;
|
package/dist/NumberInput.svelte
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ChangeEventHandler, HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLInputAttributes{
|
|
5
|
+
id: string;
|
|
6
|
+
label: string | '' | undefined;
|
|
7
|
+
placeholder?: string | '' | undefined;
|
|
8
|
+
error?: string | undefined;
|
|
9
|
+
value?: number | undefined;
|
|
10
|
+
min: number | undefined;
|
|
11
|
+
max: number | undefined;
|
|
12
|
+
onchange: ChangeEventHandler<HTMLInputElement> | null | undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
id,
|
|
17
|
+
label,
|
|
18
|
+
placeholder = '',
|
|
19
|
+
error = undefined,
|
|
20
|
+
value = $bindable(undefined),
|
|
21
|
+
min,
|
|
22
|
+
max,
|
|
23
|
+
onchange,
|
|
24
|
+
...rest
|
|
25
|
+
}: Props = $props();
|
|
8
26
|
</script>
|
|
9
27
|
|
|
10
28
|
<div class="iroco-ui-input">
|
|
11
29
|
{#if label}
|
|
12
30
|
<label class="iroco-ui-label" for={id}>{label}</label>
|
|
13
31
|
{/if}
|
|
14
|
-
<input
|
|
32
|
+
<input {onchange} bind:value {id} type="number" {placeholder} {min} {max} {...rest} />
|
|
15
33
|
{#if error}
|
|
16
34
|
<p data-testid="error" class="error">{error}</p>
|
|
17
35
|
{/if}
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
max: number | undefined;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
change: Event;
|
|
15
|
-
} & {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
export type NumberInputProps = typeof __propDef.props;
|
|
21
|
-
export type NumberInputEvents = typeof __propDef.events;
|
|
22
|
-
export type NumberInputSlots = typeof __propDef.slots;
|
|
23
|
-
export default class NumberInput extends SvelteComponent<NumberInputProps, NumberInputEvents, NumberInputSlots> {
|
|
1
|
+
import type { ChangeEventHandler, HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLInputAttributes {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string | '' | undefined;
|
|
5
|
+
placeholder?: string | '' | undefined;
|
|
6
|
+
error?: string | undefined;
|
|
7
|
+
value?: number | undefined;
|
|
8
|
+
min: number | undefined;
|
|
9
|
+
max: number | undefined;
|
|
10
|
+
onchange: ChangeEventHandler<HTMLInputElement> | null | undefined;
|
|
24
11
|
}
|
|
25
|
-
|
|
12
|
+
declare const NumberInput: import("svelte").Component<Props, {}, "value">;
|
|
13
|
+
type NumberInput = ReturnType<typeof NumberInput>;
|
|
14
|
+
export default NumberInput;
|
|
@@ -1,39 +1,26 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script module lang="ts">
|
|
2
2
|
import { RadioButton } from './index';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import {defineMeta,setTemplate} from '@storybook/addon-svelte-csf'
|
|
5
|
+
|
|
6
|
+
const {Story} = defineMeta({
|
|
7
|
+
|
|
5
8
|
title: 'Iroco-UI/Form/RadioButton',
|
|
6
9
|
component: RadioButton,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
control: { type: 'string' }
|
|
10
|
-
},
|
|
11
|
-
group: {
|
|
12
|
-
control: { type: 'string' }
|
|
13
|
-
},
|
|
14
|
-
name: {
|
|
15
|
-
control: { type: 'string' }
|
|
16
|
-
},
|
|
17
|
-
checked: {
|
|
18
|
-
control: { type: 'boolean' }
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
10
|
+
})
|
|
11
|
+
let group = $state('bar');
|
|
22
12
|
</script>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import { Story, Template } from '@storybook/addon-svelte-csf';
|
|
26
|
-
|
|
27
|
-
let group = 'bar';
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
setTemplate(template);
|
|
28
15
|
</script>
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
{#snippet template({ ...args })}
|
|
18
|
+
<form class="iroco-ui-form">
|
|
19
|
+
<RadioButton bind:group name="name-hello" value="hello" {...args}>Hello</RadioButton>
|
|
20
|
+
<RadioButton bind:group name="name-foo" value="foo">Foo</RadioButton>
|
|
21
|
+
<RadioButton bind:group name="name-bar" value="bar">Bar</RadioButton>
|
|
22
|
+
</form>
|
|
23
|
+
Selected group : {group}
|
|
24
|
+
{/snippet}
|
|
38
25
|
|
|
39
26
|
<Story name="Default" />
|
|
@@ -1,56 +1,19 @@
|
|
|
1
|
-
export namespace meta {
|
|
2
|
-
export let title: string;
|
|
3
|
-
export { RadioButton as component };
|
|
4
|
-
export namespace argTypes {
|
|
5
|
-
namespace value {
|
|
6
|
-
namespace control {
|
|
7
|
-
let type: string;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
namespace group {
|
|
11
|
-
export namespace control_1 {
|
|
12
|
-
let type_1: string;
|
|
13
|
-
export { type_1 as type };
|
|
14
|
-
}
|
|
15
|
-
export { control_1 as control };
|
|
16
|
-
}
|
|
17
|
-
namespace name {
|
|
18
|
-
export namespace control_2 {
|
|
19
|
-
let type_2: string;
|
|
20
|
-
export { type_2 as type };
|
|
21
|
-
}
|
|
22
|
-
export { control_2 as control };
|
|
23
|
-
}
|
|
24
|
-
namespace checked {
|
|
25
|
-
export namespace control_3 {
|
|
26
|
-
let type_3: string;
|
|
27
|
-
export { type_3 as type };
|
|
28
|
-
}
|
|
29
|
-
export { control_3 as control };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/** @typedef {typeof __propDef.props} RadioButtonProps */
|
|
34
|
-
/** @typedef {typeof __propDef.events} RadioButtonEvents */
|
|
35
|
-
/** @typedef {typeof __propDef.slots} RadioButtonSlots */
|
|
36
|
-
export default class RadioButton extends SvelteComponent<{
|
|
37
|
-
[x: string]: never;
|
|
38
|
-
}, {
|
|
39
|
-
[evt: string]: CustomEvent<any>;
|
|
40
|
-
}, {}> {
|
|
41
|
-
}
|
|
42
|
-
export type RadioButtonProps = typeof __propDef.props;
|
|
43
|
-
export type RadioButtonEvents = typeof __propDef.events;
|
|
44
|
-
export type RadioButtonSlots = typeof __propDef.slots;
|
|
45
1
|
import { RadioButton } from './index';
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
2
|
+
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
50
12
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const RadioButton: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type RadioButton = InstanceType<typeof RadioButton>;
|
|
19
|
+
export default RadioButton;
|
package/dist/RadioButton.svelte
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
interface Props extends HTMLInputAttributes {
|
|
5
|
+
value?: string | null;
|
|
6
|
+
group?: string | null;
|
|
7
|
+
name?: string | null;
|
|
8
|
+
checked: boolean;
|
|
9
|
+
children?: import('svelte').Snippet;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let {
|
|
13
|
+
value = null,
|
|
14
|
+
group = $bindable(null),
|
|
15
|
+
name = null,
|
|
16
|
+
checked,
|
|
17
|
+
children
|
|
18
|
+
}: Props = $props();
|
|
19
|
+
|
|
20
|
+
function onchange(event: Event) {
|
|
21
|
+
group = event.currentTarget.value;
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
</script>
|
|
11
25
|
|
|
12
26
|
<label class="iroco-ui-radio">
|
|
13
|
-
<input type="radio" bind:group {value} {name}
|
|
14
|
-
<span class="radio-button-color"
|
|
15
|
-
|
|
27
|
+
<input type="radio" bind:group={group} {value} {name} {checked} {onchange} />
|
|
28
|
+
<span class="radio-button-color"></span>
|
|
29
|
+
{@render children?.()}
|
|
16
30
|
</label>
|
|
17
31
|
|
|
18
32
|
<style>.iroco-ui-radio {
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export type RadioButtonProps = typeof __propDef.props;
|
|
17
|
-
export type RadioButtonEvents = typeof __propDef.events;
|
|
18
|
-
export type RadioButtonSlots = typeof __propDef.slots;
|
|
19
|
-
export default class RadioButton extends SvelteComponent<RadioButtonProps, RadioButtonEvents, RadioButtonSlots> {
|
|
1
|
+
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
+
interface Props extends HTMLInputAttributes {
|
|
3
|
+
value?: string | null;
|
|
4
|
+
group?: string | null;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
children?: import('svelte').Snippet;
|
|
20
8
|
}
|
|
21
|
-
|
|
9
|
+
declare const RadioButton: import("svelte").Component<Props, {}, "group">;
|
|
10
|
+
type RadioButton = ReturnType<typeof RadioButton>;
|
|
11
|
+
export default RadioButton;
|
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/** @typedef {typeof __propDef.events} SlottedComponentWrapperEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} SlottedComponentWrapperSlots */
|
|
4
|
-
export default class SlottedComponentWrapper extends SvelteComponent<{
|
|
1
|
+
declare const SlottedComponentWrapper: import("svelte").Component<{
|
|
5
2
|
Component: any;
|
|
6
|
-
}, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export type SlottedComponentWrapperProps = typeof __propDef.props;
|
|
11
|
-
export type SlottedComponentWrapperEvents = typeof __propDef.events;
|
|
12
|
-
export type SlottedComponentWrapperSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponent } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
Component: any;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
3
|
+
}, {}, "">;
|
|
4
|
+
type SlottedComponentWrapper = ReturnType<typeof SlottedComponentWrapper>;
|
|
5
|
+
export default SlottedComponentWrapper;
|
|
@@ -1,61 +1,38 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script module lang="ts">
|
|
2
2
|
import { TextInput } from './index';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { defineMeta, setTemplate } from '@storybook/addon-svelte-csf';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
title: 'Iroco-UI/Form/TextInput',
|
|
6
10
|
component: TextInput,
|
|
7
11
|
argTypes: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
type: {
|
|
12
|
-
control: { type: 'select' },
|
|
13
|
-
options: ['text', 'email', 'password']
|
|
14
|
-
},
|
|
15
|
-
name: {
|
|
16
|
-
control: { type: 'text' }
|
|
17
|
-
},
|
|
18
|
-
label: {
|
|
19
|
-
control: { type: 'text' }
|
|
20
|
-
},
|
|
21
|
-
placeholder: {
|
|
22
|
-
control: { type: 'text' }
|
|
23
|
-
},
|
|
24
|
-
error: {
|
|
25
|
-
control: { type: 'text' }
|
|
26
|
-
},
|
|
27
|
-
htmlError: {
|
|
28
|
-
control: { type: 'text' }
|
|
29
|
-
},
|
|
30
|
-
value: {
|
|
31
|
-
control: { type: 'number' }
|
|
32
|
-
},
|
|
33
|
-
readonly: {
|
|
34
|
-
control: { type: 'boolean' }
|
|
35
|
-
},
|
|
36
|
-
border: {
|
|
37
|
-
control: { type: 'boolean' }
|
|
38
|
-
},
|
|
39
|
-
autocomplete: {
|
|
40
|
-
control: { type: 'text' }
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
args: {
|
|
44
|
-
type: 'text'
|
|
12
|
+
type: { control: { type: 'select' } },
|
|
13
|
+
autocomplete: { control: { type: 'select' } }
|
|
45
14
|
}
|
|
46
|
-
};
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
let oninputFoo = $state<string | null>('');
|
|
18
|
+
|
|
19
|
+
function handleOnInput(event: Event & { currentTarget: EventTarget & HTMLInputElement; }) {
|
|
20
|
+
oninputFoo = '' + event.data + ' ' + event.timeStamp;
|
|
21
|
+
}
|
|
22
|
+
|
|
47
23
|
</script>
|
|
48
24
|
|
|
49
|
-
|
|
50
|
-
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
setTemplate(template);
|
|
51
28
|
</script>
|
|
52
29
|
|
|
53
|
-
|
|
30
|
+
{#snippet template({ ...args })}
|
|
54
31
|
<form class="iroco-ui-form">
|
|
55
|
-
<TextInput {...args} />
|
|
32
|
+
<TextInput {...args} oninput={handleOnInput} />
|
|
56
33
|
</form>
|
|
57
|
-
|
|
58
|
-
|
|
34
|
+
<p>On input handled : {oninputFoo}</p>
|
|
35
|
+
{/snippet}
|
|
59
36
|
|
|
60
37
|
<Story name="Default" />
|
|
61
38
|
<Story name="Text" args={{ type: 'text' }} />
|
|
@@ -64,7 +41,7 @@
|
|
|
64
41
|
<Story name="Label" args={{ label: 'Label' }} />
|
|
65
42
|
<Story name="Error" args={{ error: 'An error message' }} />
|
|
66
43
|
<Story name="Placeholder" args={{ placeholder: 'A placeholder' }} />
|
|
67
|
-
<Story name="Border" args={{
|
|
44
|
+
<Story name="Border" args={{ border: true }} />
|
|
68
45
|
<Story
|
|
69
46
|
name="Html Error"
|
|
70
47
|
args={{
|