@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.
Files changed (86) hide show
  1. package/README.md +7 -5
  2. package/dist/Alert.stories.svelte +19 -20
  3. package/dist/Alert.stories.svelte.d.ts +17 -35
  4. package/dist/Alert.svelte +12 -5
  5. package/dist/Alert.svelte.d.ts +7 -18
  6. package/dist/Button.stories.svelte +16 -12
  7. package/dist/Button.stories.svelte.d.ts +17 -43
  8. package/dist/Button.svelte +33 -12
  9. package/dist/Button.svelte.d.ts +13 -38
  10. package/dist/DataTable.stories.svelte +24 -19
  11. package/dist/DataTable.stories.svelte.d.ts +17 -27
  12. package/dist/DataTable.svelte +45 -25
  13. package/dist/DataTable.svelte.d.ts +16 -23
  14. package/dist/IconBurger.stories.svelte +8 -12
  15. package/dist/IconBurger.stories.svelte.d.ts +17 -46
  16. package/dist/IconBurger.svelte +7 -2
  17. package/dist/IconBurger.svelte.d.ts +6 -16
  18. package/dist/IconClose.stories.svelte +6 -12
  19. package/dist/IconClose.stories.svelte.d.ts +17 -46
  20. package/dist/IconClose.svelte +7 -2
  21. package/dist/IconClose.svelte.d.ts +6 -16
  22. package/dist/IconFloppyDisk.stories.svelte +4 -11
  23. package/dist/IconFloppyDisk.stories.svelte.d.ts +17 -53
  24. package/dist/IconFloppyDisk.svelte +8 -3
  25. package/dist/IconFloppyDisk.svelte.d.ts +7 -17
  26. package/dist/IconInfo.stories.svelte +8 -11
  27. package/dist/IconInfo.stories.svelte.d.ts +17 -48
  28. package/dist/IconInfo.svelte +7 -2
  29. package/dist/IconInfo.svelte.d.ts +6 -16
  30. package/dist/IconIrocoLogo.stories.svelte +8 -8
  31. package/dist/IconIrocoLogo.stories.svelte.d.ts +17 -55
  32. package/dist/IconIrocoLogo.svelte +18 -6
  33. package/dist/IconIrocoLogo.svelte.d.ts +9 -19
  34. package/dist/IconMoreSign.stories.svelte +7 -14
  35. package/dist/IconMoreSign.stories.svelte.d.ts +17 -48
  36. package/dist/IconMoreSign.svelte +7 -2
  37. package/dist/IconMoreSign.svelte.d.ts +6 -16
  38. package/dist/IconTrashCan.stories.svelte +6 -12
  39. package/dist/IconTrashCan.stories.svelte.d.ts +17 -48
  40. package/dist/IconTrashCan.svelte +8 -3
  41. package/dist/IconTrashCan.svelte.d.ts +7 -17
  42. package/dist/ImageArticle.stories.svelte +11 -8
  43. package/dist/ImageArticle.stories.svelte.d.ts +17 -64
  44. package/dist/ImageArticle.svelte +37 -165
  45. package/dist/ImageArticle.svelte.d.ts +11 -21
  46. package/dist/IrocoLogo.stories.svelte +12 -7
  47. package/dist/IrocoLogo.stories.svelte.d.ts +17 -48
  48. package/dist/IrocoLogo.svelte +15 -4
  49. package/dist/IrocoLogo.svelte.d.ts +8 -18
  50. package/dist/Loader.stories.svelte +11 -8
  51. package/dist/Loader.stories.svelte.d.ts +17 -27
  52. package/dist/Loader.svelte +19 -18
  53. package/dist/Loader.svelte.d.ts +16 -12
  54. package/dist/NavBar.stories.svelte +29 -20
  55. package/dist/NavBar.stories.svelte.d.ts +17 -35
  56. package/dist/NavBar.svelte +49 -183
  57. package/dist/NavBar.svelte.d.ts +33 -20
  58. package/dist/Navigation.stories.svelte +30 -28
  59. package/dist/Navigation.stories.svelte.d.ts +17 -57
  60. package/dist/Navigation.svelte +35 -14
  61. package/dist/Navigation.svelte.d.ts +18 -20
  62. package/dist/NumberInput.stories.svelte +12 -7
  63. package/dist/NumberInput.stories.svelte.d.ts +17 -75
  64. package/dist/NumberInput.svelte +26 -8
  65. package/dist/NumberInput.svelte.d.ts +13 -24
  66. package/dist/RadioButton.stories.svelte +17 -30
  67. package/dist/RadioButton.stories.svelte.d.ts +17 -54
  68. package/dist/RadioButton.svelte +26 -12
  69. package/dist/RadioButton.svelte.d.ts +10 -20
  70. package/dist/SlottedComponentWrapper.svelte +4 -4
  71. package/dist/SlottedComponentWrapper.svelte.d.ts +4 -22
  72. package/dist/TextInput.stories.svelte +24 -47
  73. package/dist/TextInput.stories.svelte.d.ts +17 -109
  74. package/dist/TextInput.svelte +45 -25
  75. package/dist/TextInput.svelte.d.ts +19 -30
  76. package/dist/definition.d.ts +0 -5
  77. package/dist/definition.js +0 -11
  78. package/dist/index.d.ts +14 -10
  79. package/dist/index.js +14 -10
  80. package/dist/scss/button.scss +7 -3
  81. package/dist/scss/colors.scss +21 -11
  82. package/dist/scss/fields/_input.scss +1 -1
  83. package/dist/scss/fields/_style.scss +2 -2
  84. package/package.json +49 -48
  85. package/dist/RadioButtonTest.svelte +0 -10
  86. 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
- declare const __propDef: {
5
- props: {
6
- href?: string | undefined;
7
- navigationItems: Array<NavigationItem>;
8
- type?: "sidebar" | "topbar" | undefined;
9
- title?: string | null | undefined;
10
- version?: string | null | undefined;
11
- color?: Color | undefined;
12
- };
13
- events: {
14
- [evt: string]: CustomEvent<any>;
15
- };
16
- slots: {};
17
- };
18
- export type NavigationProps = typeof __propDef.props;
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
- export {};
19
+ declare const Navigation: import("svelte").Component<Props, {}, "">;
20
+ type Navigation = ReturnType<typeof Navigation>;
21
+ export default Navigation;
@@ -1,7 +1,11 @@
1
- <script context="module">
1
+ <script module lang="ts">
2
2
  import { NumberInput } from './index';
3
3
 
4
- export const meta = {
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
- <script>
34
- import { Story, Template } from '@storybook/addon-svelte-csf';
37
+
38
+ <script lang="ts">
39
+ setTemplate(template);
35
40
  </script>
36
41
 
37
- <Template let:args>
42
+ {#snippet template({ ...args })}
38
43
  <form class="iroco-ui-form">
39
44
  <NumberInput {...args} />
40
45
  </form>
41
- </Template>
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
- import { SvelteComponent } from "svelte";
68
- declare const __propDef: {
69
- props: {
70
- [x: string]: never;
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
- events: {
73
- [evt: string]: CustomEvent<any>;
74
- };
75
- slots: {};
76
- };
77
- export {};
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;
@@ -1,17 +1,35 @@
1
- <script>export let id;
2
- export let label;
3
- export let placeholder = "";
4
- export let error = void 0;
5
- export let value = void 0;
6
- export let min;
7
- export let max;
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 on:change bind:value {id} type="number" {placeholder} {min} {max} {...$$restProps} />
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 { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- [x: string]: any;
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
- };
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
- export {};
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 context="module">
1
+ <script module lang="ts">
2
2
  import { RadioButton } from './index';
3
3
 
4
- export const meta = {
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
- argTypes: {
8
- value: {
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
- <script>
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
- <Template let:args>
31
- <form class="iroco-ui-form">
32
- <RadioButton bind:group name="name-hello" value="hello" {...args}>Hello</RadioButton>
33
- <RadioButton bind:group name="name-foo" value="foo">Foo</RadioButton>
34
- <RadioButton bind:group name="name-bar" value="bar">Bar</RadioButton>
35
- </form>
36
- Selected group : {group}
37
- </Template>
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
- import { SvelteComponent } from "svelte";
47
- declare const __propDef: {
48
- props: {
49
- [x: string]: never;
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
- events: {
52
- [evt: string]: CustomEvent<any>;
53
- };
54
- slots: {};
55
- };
56
- export {};
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;
@@ -1,18 +1,32 @@
1
- <script>export let value;
2
- export let group = null;
3
- export let name;
4
- export let checked;
5
- function onChange(event) {
6
- group = event.target.value;
7
- }
8
- $:
9
- checked = group === value;
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} on:change={onChange} {checked} />
14
- <span class="radio-button-color" />
15
- <slot />
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 { SvelteComponent } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- value: string | null;
5
- group?: string | null | undefined;
6
- name: string | null;
7
- checked: boolean;
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
- export {};
9
+ declare const RadioButton: import("svelte").Component<Props, {}, "group">;
10
+ type RadioButton = ReturnType<typeof RadioButton>;
11
+ export default RadioButton;
@@ -1,7 +1,7 @@
1
- <script>
2
- export let Component;
1
+ <script lang="ts">
2
+ let { Component } = $props();
3
3
  </script>
4
4
 
5
- <svelte:component this={Component}>
5
+ <Component>
6
6
  <h1 data-testid="slot">Slot value</h1>
7
- </svelte:component>
7
+ </Component>
@@ -1,23 +1,5 @@
1
- /** @typedef {typeof __propDef.props} SlottedComponentWrapperProps */
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
- [evt: string]: CustomEvent<any>;
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 context="module">
1
+ <script module lang="ts">
2
2
  import { TextInput } from './index';
3
3
 
4
- export const meta = {
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
- id: {
9
- control: { type: 'text' }
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
- <script>
50
- import { Story, Template } from '@storybook/addon-svelte-csf';
25
+
26
+ <script lang="ts">
27
+ setTemplate(template);
51
28
  </script>
52
29
 
53
- <Template let:args>
30
+ {#snippet template({ ...args })}
54
31
  <form class="iroco-ui-form">
55
- <TextInput {...args} />
32
+ <TextInput {...args} oninput={handleOnInput} />
56
33
  </form>
57
-
58
- </Template>
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={{ placeholder: 'A placeholder' }} />
44
+ <Story name="Border" args={{ border: true }} />
68
45
  <Story
69
46
  name="Html Error"
70
47
  args={{