@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.
- package/README.md +852 -852
- package/dist/attachments/clickout.svelte.d.ts +1 -1
- package/dist/attachments/clickout.svelte.js +2 -2
- package/dist/components/accordion/accordion-root.svelte +61 -61
- package/dist/components/accordion/accordion-root.svelte.d.ts +1 -1
- package/dist/components/accordion/accordion.stories.svelte +145 -134
- package/dist/components/alert/alert.stories.svelte +400 -401
- package/dist/components/atom/html-atom.svelte +71 -17
- package/dist/components/avatar/avatar.stories.svelte +22 -27
- package/dist/components/badge/badge.stories.svelte +12 -17
- package/dist/components/badge/badge.svelte +19 -19
- package/dist/components/breadcrumb/breadcrumb.stories.svelte +16 -21
- package/dist/components/button/button.stories.svelte +27 -60
- package/dist/components/calendar/calendar-day.svelte +96 -96
- package/dist/components/calendar/calendar-header.svelte +29 -29
- package/dist/components/calendar/calendar-root.svelte +206 -206
- package/dist/components/calendar/calendar.stories.svelte +10 -15
- package/dist/components/card/card-body.svelte +39 -39
- package/dist/components/card/card-footer.svelte +41 -41
- package/dist/components/card/card-root.svelte +91 -91
- package/dist/components/card/card.stories.svelte +133 -145
- package/dist/components/checkbox/checkbox.stories.svelte +22 -27
- package/dist/components/checkbox/checkbox.svelte +155 -157
- package/dist/components/collapsible/collapsible.stories.svelte +172 -173
- package/dist/components/combobox/combobox-root.svelte +65 -65
- package/dist/components/combobox/compobox.stories.svelte +51 -54
- package/dist/components/container/container.stories.svelte +20 -23
- package/dist/components/datagrid/datagrid-root.svelte +59 -59
- package/dist/components/datagrid/datagrid.css +5 -5
- package/dist/components/datagrid/datagrid.stories.svelte +72 -75
- package/dist/components/date-picker/date-picker-calendar.svelte +67 -67
- package/dist/components/date-picker/date-picker-header.svelte +100 -100
- package/dist/components/date-picker/date-picker-months.svelte +142 -142
- package/dist/components/date-picker/date-picker-root.svelte +1 -1
- package/dist/components/date-picker/date-picker-years.svelte +205 -205
- package/dist/components/date-picker/date-picker.stories.svelte +11 -18
- package/dist/components/dialog/dialog-content.svelte +62 -62
- package/dist/components/dialog/dialog.stories.svelte +64 -67
- package/dist/components/drawer/attachments.svelte.js +8 -9
- package/dist/components/drawer/drawer-content.svelte +57 -42
- package/dist/components/drawer/drawer.stories.svelte +212 -224
- package/dist/components/dropdown/dropdown-root.svelte +59 -59
- package/dist/components/dropdown/dropdown.stories.svelte +80 -83
- package/dist/components/form/form.stories.svelte +96 -99
- package/dist/components/image/image.stories.svelte +20 -23
- package/dist/components/input/input.stories.svelte +35 -38
- package/dist/components/label/label.stories.svelte +15 -26
- package/dist/components/label/label.stories.svelte.d.ts +24 -4
- package/dist/components/lazy/lazy.stories.svelte +9 -16
- package/dist/components/lazy/lazy.svelte +28 -28
- package/dist/components/link/link.stories.svelte +15 -26
- package/dist/components/link/link.stories.svelte.d.ts +24 -4
- package/dist/components/menu/menu-list.svelte +40 -40
- package/dist/components/menu/menu.stories.svelte +33 -36
- package/dist/components/popover/bond.svelte.js +31 -25
- package/dist/components/popover/popover-arrow.svelte +111 -111
- package/dist/components/popover/popover-content.svelte +175 -178
- package/dist/components/popover/popover-indicator.svelte +44 -43
- package/dist/components/popover/popover-root.svelte +48 -48
- package/dist/components/popover/popover.stories.svelte +49 -52
- package/dist/components/qr-code/qr-code.stories.svelte +4 -13
- package/dist/components/qr-code/qr-code.svelte +75 -75
- package/dist/components/radio/radio-group.stories.svelte +41 -50
- package/dist/components/radio/radio.stories.svelte +17 -26
- package/dist/components/radio/radio.svelte +109 -109
- package/dist/components/root/root.svelte +121 -121
- package/dist/components/root/root.svelte.d.ts +1 -1
- package/dist/components/scrollable/scrollable.stories.svelte +116 -126
- package/dist/components/sidebar/sidebar-content.svelte +13 -2
- package/dist/components/sidebar/sidebar-root.svelte +10 -12
- package/dist/components/sidebar/sidebar.stories.svelte +8 -19
- package/dist/components/sidebar/types.d.ts +1 -0
- package/dist/components/tabs/tab/bond.svelte.d.ts +4 -1
- package/dist/components/tabs/tab/bond.svelte.js +4 -1
- package/dist/components/tabs/tabs.stories.svelte +56 -59
- package/dist/components/tooltip/tooltip-trigger.svelte +39 -37
- package/dist/components/tooltip/tooltip.stories.svelte +32 -35
- package/dist/components/tree/tree.stories.svelte +142 -134
- package/dist/context/preset.svelte.d.ts +3 -3
- package/dist/utils/function.d.ts +2 -0
- package/dist/utils/function.js +6 -0
- package/package.json +6 -9
- package/dist/actions/animation.svelte.d.ts +0 -6
- package/dist/actions/animation.svelte.js +0 -14
- package/dist/actions/clickout.svelte.d.ts +0 -2
- package/dist/actions/clickout.svelte.js +0 -15
- package/dist/actions/popover.svelte.d.ts +0 -19
- package/dist/actions/popover.svelte.js +0 -81
- package/dist/actions/portal.svelte.d.ts +0 -8
- package/dist/actions/portal.svelte.js +0 -32
- package/dist/attachments/gsap.svelte.d.ts +0 -2
- 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
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{ id:
|
|
27
|
-
{ id:
|
|
28
|
-
{ id:
|
|
29
|
-
{ id:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
() =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<Root
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<Field.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<Field.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<Field.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
<Field.
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
<div
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
<div
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<AInput.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</
|
|
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
|
-
|
|
4
|
-
|
|
2
|
+
type Label = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
5
8
|
};
|
|
6
|
-
declare const Label:
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
21
|
+
>
|
|
22
|
+
Hello World
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{/snippet}
|
|
33
|
-
</Root>
|
|
34
|
-
{/snippet}
|
|
24
|
+
{#snippet loading()}
|
|
25
|
+
<span>Loading...</span>
|
|
26
|
+
{/snippet}
|
|
27
|
+
</Lazy>
|
|
35
28
|
</Story>
|