@svelte-atoms/core 1.0.0-alpha.29 → 1.0.0-alpha.30

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 (92) hide show
  1. package/README.md +852 -852
  2. package/dist/attachments/clickout.svelte.d.ts +1 -1
  3. package/dist/attachments/clickout.svelte.js +2 -2
  4. package/dist/components/accordion/accordion-root.svelte +61 -61
  5. package/dist/components/accordion/accordion-root.svelte.d.ts +1 -1
  6. package/dist/components/accordion/accordion.stories.svelte +145 -134
  7. package/dist/components/alert/alert.stories.svelte +400 -401
  8. package/dist/components/atom/html-atom.svelte +71 -17
  9. package/dist/components/avatar/avatar.stories.svelte +22 -27
  10. package/dist/components/badge/badge.stories.svelte +12 -17
  11. package/dist/components/badge/badge.svelte +19 -19
  12. package/dist/components/breadcrumb/breadcrumb.stories.svelte +16 -21
  13. package/dist/components/button/button.stories.svelte +27 -60
  14. package/dist/components/calendar/calendar-day.svelte +96 -96
  15. package/dist/components/calendar/calendar-header.svelte +29 -29
  16. package/dist/components/calendar/calendar-root.svelte +206 -206
  17. package/dist/components/calendar/calendar.stories.svelte +10 -15
  18. package/dist/components/card/card-body.svelte +39 -39
  19. package/dist/components/card/card-footer.svelte +41 -41
  20. package/dist/components/card/card-root.svelte +91 -91
  21. package/dist/components/card/card.stories.svelte +133 -145
  22. package/dist/components/checkbox/checkbox.stories.svelte +22 -27
  23. package/dist/components/checkbox/checkbox.svelte +155 -157
  24. package/dist/components/collapsible/collapsible.stories.svelte +172 -173
  25. package/dist/components/combobox/combobox-root.svelte +65 -65
  26. package/dist/components/combobox/compobox.stories.svelte +51 -54
  27. package/dist/components/container/container.stories.svelte +20 -23
  28. package/dist/components/datagrid/datagrid-root.svelte +59 -59
  29. package/dist/components/datagrid/datagrid.css +5 -5
  30. package/dist/components/datagrid/datagrid.stories.svelte +72 -75
  31. package/dist/components/date-picker/date-picker-calendar.svelte +67 -67
  32. package/dist/components/date-picker/date-picker-header.svelte +100 -100
  33. package/dist/components/date-picker/date-picker-months.svelte +142 -142
  34. package/dist/components/date-picker/date-picker-root.svelte +1 -1
  35. package/dist/components/date-picker/date-picker-years.svelte +205 -205
  36. package/dist/components/date-picker/date-picker.stories.svelte +11 -18
  37. package/dist/components/dialog/dialog-content.svelte +62 -62
  38. package/dist/components/dialog/dialog.stories.svelte +64 -67
  39. package/dist/components/drawer/attachments.svelte.js +8 -9
  40. package/dist/components/drawer/drawer-content.svelte +57 -42
  41. package/dist/components/drawer/drawer.stories.svelte +212 -224
  42. package/dist/components/dropdown/dropdown-root.svelte +59 -59
  43. package/dist/components/dropdown/dropdown.stories.svelte +80 -83
  44. package/dist/components/form/form.stories.svelte +96 -99
  45. package/dist/components/image/image.stories.svelte +20 -23
  46. package/dist/components/input/input.stories.svelte +35 -38
  47. package/dist/components/label/label.stories.svelte +15 -26
  48. package/dist/components/label/label.stories.svelte.d.ts +24 -4
  49. package/dist/components/lazy/lazy.stories.svelte +9 -16
  50. package/dist/components/lazy/lazy.svelte +28 -28
  51. package/dist/components/link/link.stories.svelte +15 -26
  52. package/dist/components/link/link.stories.svelte.d.ts +24 -4
  53. package/dist/components/menu/menu-list.svelte +40 -40
  54. package/dist/components/menu/menu.stories.svelte +33 -36
  55. package/dist/components/popover/bond.svelte.js +31 -25
  56. package/dist/components/popover/popover-arrow.svelte +111 -111
  57. package/dist/components/popover/popover-content.svelte +175 -178
  58. package/dist/components/popover/popover-indicator.svelte +44 -43
  59. package/dist/components/popover/popover-root.svelte +48 -48
  60. package/dist/components/popover/popover.stories.svelte +49 -52
  61. package/dist/components/qr-code/qr-code.stories.svelte +4 -13
  62. package/dist/components/qr-code/qr-code.svelte +75 -75
  63. package/dist/components/radio/radio-group.stories.svelte +41 -50
  64. package/dist/components/radio/radio.stories.svelte +17 -26
  65. package/dist/components/radio/radio.svelte +109 -109
  66. package/dist/components/root/root.svelte +121 -121
  67. package/dist/components/root/root.svelte.d.ts +1 -1
  68. package/dist/components/scrollable/scrollable.stories.svelte +116 -126
  69. package/dist/components/sidebar/sidebar-content.svelte +13 -2
  70. package/dist/components/sidebar/sidebar-root.svelte +10 -12
  71. package/dist/components/sidebar/sidebar.stories.svelte +8 -19
  72. package/dist/components/sidebar/types.d.ts +1 -0
  73. package/dist/components/tabs/tab/bond.svelte.d.ts +4 -1
  74. package/dist/components/tabs/tab/bond.svelte.js +4 -1
  75. package/dist/components/tabs/tabs.stories.svelte +56 -59
  76. package/dist/components/tooltip/tooltip-trigger.svelte +39 -37
  77. package/dist/components/tooltip/tooltip.stories.svelte +32 -35
  78. package/dist/components/tree/tree.stories.svelte +142 -134
  79. package/dist/context/preset.svelte.d.ts +3 -3
  80. package/dist/utils/function.d.ts +2 -0
  81. package/dist/utils/function.js +6 -0
  82. package/package.json +6 -9
  83. package/dist/actions/animation.svelte.d.ts +0 -6
  84. package/dist/actions/animation.svelte.js +0 -14
  85. package/dist/actions/clickout.svelte.d.ts +0 -2
  86. package/dist/actions/clickout.svelte.js +0 -15
  87. package/dist/actions/popover.svelte.d.ts +0 -19
  88. package/dist/actions/popover.svelte.js +0 -81
  89. package/dist/actions/portal.svelte.d.ts +0 -8
  90. package/dist/actions/portal.svelte.js +0 -32
  91. package/dist/attachments/gsap.svelte.d.ts +0 -2
  92. package/dist/attachments/gsap.svelte.js +0 -26
@@ -1,83 +1,80 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { Dropdown as ADropdown } from '.';
4
- import Root from '../root/root.svelte';
5
- import { Input } from '../input';
6
- import { flip } from 'svelte/animate';
7
- import { filter } from './runes.svelte';
8
-
9
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
10
- const { Story } = defineMeta({
11
- title: 'Atoms/Dropdown',
12
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
13
-
14
- parameters: {
15
- // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
16
- layout: 'fullscreen'
17
- },
18
- args: {}
19
- });
20
- </script>
21
-
22
- <script lang="ts">
23
- let open = $state(false);
24
-
25
- const data = $state([
26
- { id: 1, value: 'apple', text: 'Apple' },
27
- { id: 2, value: 'banana', text: 'Banana' },
28
- { id: 3, value: 'cherry', text: 'Cherry' },
29
- { id: 4, value: 'date', text: 'Date' },
30
- { id: 5, value: 'elderberry', text: 'Elderberry' }
31
- ]);
32
-
33
- const dd = filter(
34
- () => data,
35
- (query, item) => item.text.toLowerCase().includes(query.toLowerCase())
36
- );
37
- </script>
38
-
39
- <Story name="Dropdown" args={{}}>
40
- <Root class="items-center justify-center p-4">
41
- <!-- Multi-select dropdown with search functionality -->
42
- <ADropdown.Root
43
- bind:open
44
- keys={data.map((item) => item.value)}
45
- multiple
46
- onquerychange={(q) => (dd.query = q)}
47
- >
48
- {#snippet children({ dropdown })}
49
- <!-- Compose ADropdown.Trigger with Input.Root for a custom trigger -->
50
- <ADropdown.Trigger
51
- base={Input.Root}
52
- class="h-auto min-h-12 max-w-sm min-w-sm items-center gap-2 rounded-sm px-4 transition-colors duration-200"
53
- onclick={(ev) => {
54
- ev.preventDefault();
55
-
56
- dropdown.state.open();
57
- }}
58
- >
59
- <!-- Display selected values with animation -->
60
- {#each dropdown?.state?.selectedItems ?? [] as item (item.id)}
61
- <div animate:flip={{ duration: 200 }}>
62
- <ADropdown.Value value={item.value} class="text-foreground/80">
63
- {item.text}
64
- </ADropdown.Value>
65
- </div>
66
- {/each}
67
-
68
- <!-- Inline search input within the trigger -->
69
- <ADropdown.Query class="flex-1 px-1" placeholder="Search for fruits..." />
70
- </ADropdown.Trigger>
71
-
72
- <!-- ADropdown list with filtered items -->
73
- <ADropdown.List>
74
- {#each dd.current as item (item.id)}
75
- <div animate:flip={{ duration: 200 }}>
76
- <ADropdown.Item value={item.value}>{item.text}</ADropdown.Item>
77
- </div>
78
- {/each}
79
- </ADropdown.List>
80
- {/snippet}
81
- </ADropdown.Root>
82
- </Root>
83
- </Story>
1
+ <script module>
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import { Dropdown as ADropdown } from '.';
4
+ import { Input } from '../input';
5
+ import { flip } from 'svelte/animate';
6
+ import { filter } from './runes.svelte';
7
+
8
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
9
+ const { Story } = defineMeta({
10
+ title: 'Atoms/Dropdown',
11
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
12
+
13
+ parameters: {
14
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
15
+ layout: 'fullscreen'
16
+ },
17
+ args: {}
18
+ });
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ let open = $state(false);
23
+
24
+ const data = $state([
25
+ { id: 1, value: 'apple', text: 'Apple' },
26
+ { id: 2, value: 'banana', text: 'Banana' },
27
+ { id: 3, value: 'cherry', text: 'Cherry' },
28
+ { id: 4, value: 'date', text: 'Date' },
29
+ { id: 5, value: 'elderberry', text: 'Elderberry' }
30
+ ]);
31
+
32
+ const dd = filter(
33
+ () => data,
34
+ (query, item) => item.text.toLowerCase().includes(query.toLowerCase())
35
+ );
36
+ </script>
37
+
38
+ <Story name="Dropdown" args={{}}>
39
+ <!-- Multi-select dropdown with search functionality -->
40
+ <ADropdown.Root
41
+ bind:open
42
+ keys={data.map((item) => item.value)}
43
+ multiple
44
+ onquerychange={(q) => (dd.query = q)}
45
+ >
46
+ {#snippet children({ dropdown })}
47
+ <!-- Compose ADropdown.Trigger with Input.Root for a custom trigger -->
48
+ <ADropdown.Trigger
49
+ base={Input.Root}
50
+ class="h-auto min-h-12 max-w-sm min-w-sm items-center gap-2 rounded-sm px-4 transition-colors duration-200"
51
+ onclick={(ev) => {
52
+ ev.preventDefault();
53
+
54
+ dropdown.state.open();
55
+ }}
56
+ >
57
+ <!-- Display selected values with animation -->
58
+ {#each dropdown?.state?.selectedItems ?? [] as item (item.id)}
59
+ <div animate:flip={{ duration: 200 }}>
60
+ <ADropdown.Value value={item.value} class="text-foreground/80">
61
+ {item.text}
62
+ </ADropdown.Value>
63
+ </div>
64
+ {/each}
65
+
66
+ <!-- Inline search input within the trigger -->
67
+ <ADropdown.Query class="flex-1 px-1" placeholder="Search for fruits..." />
68
+ </ADropdown.Trigger>
69
+
70
+ <!-- ADropdown list with filtered items -->
71
+ <ADropdown.List>
72
+ {#each dd.current as item (item.id)}
73
+ <div animate:flip={{ duration: 200 }}>
74
+ <ADropdown.Item value={item.value}>{item.text}</ADropdown.Item>
75
+ </div>
76
+ {/each}
77
+ </ADropdown.List>
78
+ {/snippet}
79
+ </ADropdown.Root>
80
+ </Story>
@@ -1,99 +1,96 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import Root from '../root/root.svelte';
4
- import AForm from './form-root.svelte';
5
- import { Field } from './field';
6
- import { Input } from '../input';
7
- import { Checkbox } from '../checkbox';
8
-
9
- const { Story } = defineMeta({
10
- title: 'ATOMS/Form'
11
- });
12
- </script>
13
-
14
- <script lang="ts">
15
- import { z } from 'zod';
16
- import { ZodAdapter } from './field/validation-adapters';
17
- import { Radio, RadioGroup } from '../radio';
18
-
19
- const nameSchema = z.string().min(2).max(100);
20
-
21
- const personSchema = z.object({
22
- firstName: nameSchema,
23
- lastName: nameSchema,
24
- isAdmin: z.boolean()
25
- });
26
-
27
- type PersonSchema = z.infer<typeof personSchema>;
28
-
29
- const validator = new ZodAdapter();
30
- </script>
31
-
32
- <Story name="Form">
33
- <Root class="flex items-center justify-center p-4">
34
- {#snippet children({ args })}
35
- <AForm class="flex flex-col gap-2" {validator}>
36
- <div class="mb-4 flex flex-col">
37
- <h2 class="text-3xl font-semibold">Form Title</h2>
38
- <p class="text-sm text-gray-500">Form description goes here.</p>
39
- </div>
40
-
41
- <div class="flex gap-2">
42
- <Field.Root name="first name" schema={personSchema.shape.firstName}>
43
- {#snippet children({ field })}
44
- <Field.Label>First Name</Field.Label>
45
- <Input.Root>
46
- <Field.Control
47
- base={Input.Control}
48
- placeholder="Enter your first name"
49
- onblur={() => {
50
- const results = field?.state.validate();
51
- console.log(results);
52
- }}
53
- />
54
- </Input.Root>
55
- {#if field?.state?.errors?.length > 0}
56
- <div class="text-xs text-red-600">
57
- {#each field.state.errors as error}
58
- <div>{error.message}</div>
59
- {/each}
60
- </div>
61
- {/if}
62
- {/snippet}
63
- </Field.Root>
64
-
65
- <Field.Root name="last name" schema={personSchema.shape.lastName}>
66
- <Field.Label>Last Name</Field.Label>
67
- <Input.Root>
68
- <Field.Control base={Input.Control} placeholder="Enter your last name" />
69
- </Input.Root>
70
- </Field.Root>
71
- </div>
72
-
73
- <div class="flex flex-col">
74
- <Field.Root name="is admin" schema={personSchema.shape.isAdmin}>
75
- <Field.Label>Is Admin?</Field.Label>
76
- <Field.Control base={Checkbox} />
77
- </Field.Root>
78
- </div>
79
-
80
- <div class="flex flex-col">
81
- <Field.Root name="color" schema={personSchema.shape.color}>
82
- <Field.Label>Is current scheme black?</Field.Label>
83
- <Field.Control class="flex flex-col items-start text-sm" base={RadioGroup}>
84
- <div class="flex items-center gap-2">
85
- <Radio value="yes" />
86
- <div>Yes</div>
87
- </div>
88
-
89
- <div class="flex items-center gap-2">
90
- <Radio value="no" />
91
- <div>No</div>
92
- </div>
93
- </Field.Control>
94
- </Field.Root>
95
- </div>
96
- </AForm>
97
- {/snippet}
98
- </Root>
99
- </Story>
1
+ <script module>
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import AForm from './form-root.svelte';
4
+ import { Field } from './field';
5
+ import { Input } from '../input';
6
+ import { Checkbox } from '../checkbox';
7
+
8
+ const { Story } = defineMeta({
9
+ title: 'ATOMS/Form'
10
+ });
11
+ </script>
12
+
13
+ <script lang="ts">
14
+ import { z } from 'zod';
15
+ import { ZodAdapter } from './field/validation-adapters';
16
+ import { Radio, RadioGroup } from '../radio';
17
+
18
+ const nameSchema = z.string().min(2).max(100);
19
+
20
+ const personSchema = z.object({
21
+ firstName: nameSchema,
22
+ lastName: nameSchema,
23
+ isAdmin: z.boolean()
24
+ });
25
+
26
+ type PersonSchema = z.infer<typeof personSchema>;
27
+
28
+ const validator = new ZodAdapter();
29
+ </script>
30
+
31
+ <Story name="Form">
32
+ {#snippet children({ args })}
33
+ <AForm class="flex flex-col gap-2" {validator}>
34
+ <div class="mb-4 flex flex-col">
35
+ <h2 class="text-3xl font-semibold">Form Title</h2>
36
+ <p class="text-sm text-gray-500">Form description goes here.</p>
37
+ </div>
38
+
39
+ <div class="flex gap-2">
40
+ <Field.Root name="first name" schema={personSchema.shape.firstName}>
41
+ {#snippet children({ field })}
42
+ <Field.Label>First Name</Field.Label>
43
+ <Input.Root>
44
+ <Field.Control
45
+ base={Input.Control}
46
+ placeholder="Enter your first name"
47
+ onblur={() => {
48
+ const results = field?.state.validate();
49
+ console.log(results);
50
+ }}
51
+ />
52
+ </Input.Root>
53
+ {#if field?.state?.errors?.length > 0}
54
+ <div class="text-xs text-red-600">
55
+ {#each field.state.errors as error}
56
+ <div>{error.message}</div>
57
+ {/each}
58
+ </div>
59
+ {/if}
60
+ {/snippet}
61
+ </Field.Root>
62
+
63
+ <Field.Root name="last name" schema={personSchema.shape.lastName}>
64
+ <Field.Label>Last Name</Field.Label>
65
+ <Input.Root>
66
+ <Field.Control base={Input.Control} placeholder="Enter your last name" />
67
+ </Input.Root>
68
+ </Field.Root>
69
+ </div>
70
+
71
+ <div class="flex flex-col">
72
+ <Field.Root name="is admin" schema={personSchema.shape.isAdmin}>
73
+ <Field.Label>Is Admin?</Field.Label>
74
+ <Field.Control base={Checkbox} />
75
+ </Field.Root>
76
+ </div>
77
+
78
+ <div class="flex flex-col">
79
+ <Field.Root name="color" schema={personSchema.shape.color}>
80
+ <Field.Label>Is current scheme black?</Field.Label>
81
+ <Field.Control class="flex flex-col items-start text-sm" base={RadioGroup}>
82
+ <div class="flex items-center gap-2">
83
+ <Radio value="yes" />
84
+ <div>Yes</div>
85
+ </div>
86
+
87
+ <div class="flex items-center gap-2">
88
+ <Radio value="no" />
89
+ <div>No</div>
90
+ </div>
91
+ </Field.Control>
92
+ </Field.Root>
93
+ </div>
94
+ </AForm>
95
+ {/snippet}
96
+ </Story>
@@ -1,23 +1,20 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import Root from '../root/root.svelte';
4
- import ImageCmp from './image.svelte';
5
-
6
- const { Story } = defineMeta({
7
- title: 'ATOMS/Image'
8
- });
9
- </script>
10
-
11
- <Story name="Image">
12
- <Root class="p-4">
13
- {#snippet children({ args })}
14
- <ImageCmp
15
- class="h-[400px] w-[600px]"
16
- src="https://placehold.co/600x400/t"
17
- alt="Placeholder image"
18
- >
19
- <p>Failed Loading...</p>
20
- </ImageCmp>
21
- {/snippet}
22
- </Root>
23
- </Story>
1
+ <script module>
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import ImageCmp from './image.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'ATOMS/Image'
7
+ });
8
+ </script>
9
+
10
+ <Story name="Image">
11
+ {#snippet children({ args })}
12
+ <ImageCmp
13
+ class="h-[400px] w-[600px]"
14
+ src="https://placehold.co/600x400/t"
15
+ alt="Placeholder image"
16
+ >
17
+ <p>Failed Loading...</p>
18
+ </ImageCmp>
19
+ {/snippet}
20
+ </Story>
@@ -1,38 +1,35 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { Input as AInput } from '.';
4
- import Root from '../root/root.svelte';
5
- import { Label } from '../label';
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const { Story } = defineMeta({
9
- title: 'Atoms/Input',
10
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
11
-
12
- parameters: {
13
- // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
14
- layout: 'fullscreen'
15
- },
16
- args: {}
17
- });
18
- </script>
19
-
20
- <script lang="ts">
21
- </script>
22
-
23
- <Story name="Input" args={{}}>
24
- <Root class="p-4">
25
- <div class="flex flex-col">
26
- <Label for="price-input">Price</Label>
27
- <AInput.Root>
28
- <AInput.Icon class="text-foreground box-content px-0">$</AInput.Icon>
29
- <AInput.Control id="price-input" class="border-border box-content border-x px-2 py-2">
30
- <!-- -->
31
- </AInput.Control>
32
- <AInput.Icon class="text-foreground box-content px-2">.00</AInput.Icon>
33
-
34
- <AInput.Placeholder class="text-foreground/20 pl-2">Hello World</AInput.Placeholder>
35
- </AInput.Root>
36
- </div>
37
- </Root>
38
- </Story>
1
+ <script module>
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import { Input as AInput } from '.';
4
+ import { Label } from '../label';
5
+
6
+ // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
7
+ const { Story } = defineMeta({
8
+ title: 'Atoms/Input',
9
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
10
+
11
+ parameters: {
12
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
13
+ layout: 'fullscreen'
14
+ },
15
+ args: {}
16
+ });
17
+ </script>
18
+
19
+ <script lang="ts">
20
+ </script>
21
+
22
+ <Story name="Input" args={{}}>
23
+ <div class="flex flex-col">
24
+ <Label for="price-input">Price</Label>
25
+ <AInput.Root>
26
+ <AInput.Icon class="text-foreground box-content px-0">$</AInput.Icon>
27
+ <AInput.Control id="price-input" class="border-border box-content border-x px-2 py-2">
28
+ <!-- -->
29
+ </AInput.Control>
30
+ <AInput.Icon class="text-foreground box-content px-2">.00</AInput.Icon>
31
+
32
+ <AInput.Placeholder class="text-foreground/20 pl-2">Hello World</AInput.Placeholder>
33
+ </AInput.Root>
34
+ </div>
35
+ </Story>
@@ -1,26 +1,15 @@
1
- <script module>
2
- import { defineMeta } from '@storybook/addon-svelte-csf';
3
- import { default as LabelCmp } from './label.svelte';
4
- import { Root } from '../root';
5
-
6
- const { Story } = defineMeta({
7
- title: 'ATOMS/Label'
8
- });
9
- </script>
10
-
11
- <script>
12
- let value = $state(undefined);
13
- let checked = $state(false);
14
- </script>
15
-
16
- <Story name="Label">
17
- {#snippet children(args)}
18
- <Root>
19
- {#snippet children({})}
20
- <div class="flex h-full w-full items-center justify-center">
21
- <LabelCmp>Hello World</LabelCmp>
22
- </div>
23
- {/snippet}
24
- </Root>
25
- {/snippet}
26
- </Story>
1
+ <script module>
2
+ import { defineMeta } from '@storybook/addon-svelte-csf';
3
+ import { default as LabelCmp } from './label.svelte';
4
+
5
+ const { Story } = defineMeta({
6
+ title: 'ATOMS/Label'
7
+ });
8
+ </script>
9
+
10
+ <script>
11
+ </script>
12
+
13
+ <Story name="Label">
14
+ <LabelCmp>Hello World</LabelCmp>
15
+ </Story>
@@ -1,6 +1,26 @@
1
1
  export default Label;
2
- type Label = {
3
- $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<Record<string, never>>): void;
2
+ type Label = SvelteComponent<{
3
+ [x: string]: never;
4
+ }, {
5
+ [evt: string]: CustomEvent<any>;
6
+ }, {}> & {
7
+ $$bindings?: string;
5
8
  };
6
- declare const Label: import("svelte").Component<Record<string, never>, {}, "">;
9
+ declare const Label: $$__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
+ }
@@ -8,28 +8,21 @@
8
8
 
9
9
  <script lang="ts">
10
10
  import Lazy from './lazy.svelte';
11
- import { Root } from '../root';
12
11
  import { delay } from 'es-toolkit';
13
12
  </script>
14
13
 
15
14
  <Story name="Lazy">
16
- {#snippet children({ args })}
17
- <Root>
18
- {#snippet children({})}
19
- <Lazy
20
- promise={import('../button/button.svelte').then(async res=> {
21
- await delay(1000 * 5);
15
+ <Lazy
16
+ promise={import('../button/button.svelte').then(async res=> {
17
+ await delay(1000 * 2);
22
18
 
23
19
  return res.default;
24
20
  })}
25
- >
26
- Hello World
21
+ >
22
+ Hello World
27
23
 
28
- {#snippet loading()}
29
- <span>Loading...</span>
30
- {/snippet}
31
- </Lazy>
32
- {/snippet}
33
- </Root>
34
- {/snippet}
24
+ {#snippet loading()}
25
+ <span>Loading...</span>
26
+ {/snippet}
27
+ </Lazy>
35
28
  </Story>