@svelte-atoms/core 1.0.0-alpha.29 → 1.0.0-alpha.31
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 +3 -2
- package/dist/attachments/clickout.svelte.d.ts +1 -1
- package/dist/attachments/clickout.svelte.js +2 -2
- package/dist/components/accordion/accordion-root.svelte +65 -61
- package/dist/components/accordion/accordion-root.svelte.d.ts +1 -1
- package/dist/components/accordion/accordion.stories.svelte +70 -134
- package/dist/components/accordion/item/accordion-item-body.svelte +44 -42
- package/dist/components/accordion/item/accordion-item-header.svelte +51 -50
- package/dist/components/accordion/item/accordion-item-indicator.svelte +51 -50
- package/dist/components/accordion/item/accordion-item-root.svelte +66 -65
- package/dist/components/accordion/item/bond.svelte.d.ts +2 -0
- package/dist/components/accordion/item/index.d.ts +3 -0
- package/dist/components/accordion/item/index.js +3 -0
- package/dist/components/accordion/item/motion.svelte.d.ts +15 -0
- package/dist/components/accordion/item/motion.svelte.js +30 -0
- package/dist/components/accordion/item/types.d.ts +7 -24
- package/dist/components/alert/alert-close-button.svelte +66 -70
- package/dist/components/alert/alert-description.svelte +42 -42
- package/dist/components/alert/alert-description.svelte.d.ts +3 -6
- package/dist/components/alert/alert-root.svelte +68 -103
- package/dist/components/alert/alert-root.svelte.d.ts +2 -2
- package/dist/components/alert/alert.stories.svelte +10 -11
- package/dist/components/alert/bond.svelte.d.ts +0 -13
- package/dist/components/alert/bond.svelte.js +0 -32
- package/dist/components/alert/types.d.ts +8 -32
- package/dist/components/atom/html-atom.svelte +261 -207
- package/dist/components/avatar/avatar.stories.svelte +8 -13
- package/dist/components/badge/badge.stories.svelte +1 -6
- package/dist/components/badge/badge.svelte +1 -1
- package/dist/components/breadcrumb/breadcrumb.stories.svelte +16 -21
- package/dist/components/button/button.stories.svelte +1 -34
- package/dist/components/calendar/calendar-day.svelte +9 -4
- 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 +26 -31
- package/dist/components/card/card-body.svelte +1 -1
- package/dist/components/card/card-footer.svelte +1 -1
- package/dist/components/card/card-root.svelte +1 -1
- package/dist/components/card/card.stories.svelte +92 -104
- package/dist/components/checkbox/checkbox.stories.svelte +4 -9
- package/dist/components/checkbox/checkbox.svelte +159 -157
- package/dist/components/collapsible/collapsible.stories.svelte +2 -3
- package/dist/components/combobox/atoms.d.ts +1 -1
- package/dist/components/combobox/atoms.js +1 -1
- package/dist/components/combobox/combobox-root.svelte +1 -1
- package/dist/components/combobox/compobox.stories.svelte +19 -22
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/container/container.stories.svelte +8 -11
- package/dist/components/container/container.svelte.d.ts +1 -1
- package/dist/components/datagrid/datagrid-root.svelte +59 -59
- package/dist/components/datagrid/datagrid.css +5 -5
- package/dist/components/datagrid/datagrid.stories.svelte +47 -50
- package/dist/components/datagrid/tr/bond.svelte.d.ts +4 -2
- package/dist/components/datagrid/tr/bond.svelte.js +9 -7
- package/dist/components/datagrid/tr/datagrid-tr.svelte +90 -88
- package/dist/components/date-picker/date-picker-calendar.svelte +2 -2
- 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 +95 -95
- package/dist/components/date-picker/date-picker-years.svelte +205 -205
- package/dist/components/date-picker/date-picker.stories.svelte +35 -42
- package/dist/components/dialog/bond.svelte.d.ts +13 -3
- package/dist/components/dialog/bond.svelte.js +66 -5
- package/dist/components/dialog/dialog-content.svelte +2 -20
- package/dist/components/dialog/dialog-root.svelte +91 -110
- package/dist/components/dialog/dialog.stories.svelte +34 -37
- package/dist/components/dialog/motion.svelte.d.ts +13 -0
- package/dist/components/dialog/motion.svelte.js +44 -0
- package/dist/components/drawer/attachments.svelte.d.ts +1 -1
- package/dist/components/drawer/attachments.svelte.js +7 -10
- package/dist/components/drawer/bond.svelte.d.ts +24 -5
- package/dist/components/drawer/bond.svelte.js +77 -11
- package/dist/components/drawer/drawer-content.svelte +49 -42
- package/dist/components/drawer/drawer.stories.svelte +144 -224
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/motion.d.ts +15 -0
- package/dist/components/drawer/motion.js +28 -0
- package/dist/components/dropdown/atoms.d.ts +1 -1
- package/dist/components/dropdown/atoms.js +1 -1
- package/dist/components/dropdown/bond.svelte.d.ts +5 -1
- package/dist/components/dropdown/dropdown-root.svelte +1 -1
- package/dist/components/dropdown/dropdown.stories.svelte +38 -41
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/form/form.stories.svelte +58 -61
- package/dist/components/image/image.stories.svelte +9 -12
- package/dist/components/input/input.stories.svelte +11 -14
- package/dist/components/label/label.stories.svelte +1 -12
- package/dist/components/label/label.stories.svelte.d.ts +24 -4
- package/dist/components/lazy/lazy.stories.svelte +28 -35
- package/dist/components/lazy/lazy.svelte +28 -28
- package/dist/components/link/link.stories.svelte +1 -12
- package/dist/components/link/link.stories.svelte.d.ts +24 -4
- package/dist/components/list/list-item.svelte +20 -20
- package/dist/components/menu/atoms.d.ts +1 -0
- package/dist/components/menu/atoms.js +1 -0
- package/dist/components/menu/index.d.ts +2 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/menu-item.svelte +69 -51
- package/dist/components/menu/menu-item.svelte.d.ts +1 -0
- package/dist/components/menu/menu-list.svelte +40 -40
- package/dist/components/menu/menu.stories.svelte +9 -12
- package/dist/components/popover/bond.svelte.d.ts +20 -7
- package/dist/components/popover/bond.svelte.js +104 -45
- package/dist/components/popover/motion.d.ts +6 -0
- package/dist/components/popover/motion.js +56 -0
- package/dist/components/popover/popover-arrow.svelte +4 -4
- package/dist/components/popover/popover-content.svelte +137 -178
- package/dist/components/popover/popover-indicator.svelte +2 -1
- package/dist/components/popover/popover-root.svelte +1 -1
- package/dist/components/popover/popover.stories.svelte +49 -52
- package/dist/components/popover/types.d.ts +9 -7
- package/dist/components/portal/active-portal.svelte +29 -22
- package/dist/components/portal/active-portal.svelte.d.ts +2 -9
- package/dist/components/portal/portal-root.svelte +76 -83
- package/dist/components/portal/portal-root.svelte.d.ts +4 -6
- package/dist/components/portal/teleport.svelte +49 -50
- package/dist/components/portal/teleport.svelte.d.ts +3 -4
- package/dist/components/qr-code/qr-code.stories.svelte +18 -27
- package/dist/components/qr-code/qr-code.svelte +75 -75
- package/dist/components/radio/radio-group.stories.svelte +21 -30
- package/dist/components/radio/radio.stories.svelte +1 -10
- package/dist/components/radio/radio.svelte +109 -109
- package/dist/components/radio/types.d.ts +98 -0
- package/dist/components/radio/types.js +2 -0
- package/dist/components/root/root.svelte +104 -121
- package/dist/components/scrollable/scrollable-root.svelte.d.ts +2 -2
- package/dist/components/scrollable/scrollable.stories.svelte +95 -105
- package/dist/components/sidebar/index.d.ts +2 -0
- package/dist/components/sidebar/index.js +2 -0
- package/dist/components/sidebar/motion.svelte.d.ts +11 -0
- package/dist/components/sidebar/motion.svelte.js +16 -0
- package/dist/components/sidebar/sidebar-content.svelte +3 -2
- package/dist/components/sidebar/sidebar-root.svelte +39 -41
- package/dist/components/sidebar/sidebar.stories.svelte +43 -54
- package/dist/components/sidebar/types.d.ts +3 -12
- 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 +31 -34
- package/dist/components/textarea/atoms.d.ts +1 -0
- package/dist/components/textarea/atoms.js +1 -0
- package/dist/components/textarea/textarea-input.svelte +9 -6
- package/dist/components/textarea/textarea-root.svelte +9 -9
- package/dist/components/textarea/textarea-root.svelte.d.ts +2 -0
- package/dist/components/tooltip/tooltip-trigger.svelte +39 -37
- package/dist/components/tooltip/tooltip-trigger.svelte.d.ts +1 -0
- package/dist/components/tooltip/tooltip.stories.svelte +7 -10
- package/dist/components/tree/tree.stories.svelte +102 -94
- package/dist/context/preset.svelte.d.ts +3 -3
- package/dist/icons/icon-copy.svelte +6 -0
- package/dist/{components/radio/types.svelte.d.ts → icons/icon-copy.svelte.d.ts} +3 -3
- package/dist/utils/function.d.ts +2 -0
- package/dist/utils/function.js +6 -0
- package/dist/utils/markdown-to-llm.d.ts +28 -0
- package/dist/utils/markdown-to-llm.js +76 -0
- package/package.json +6 -10
- 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
- package/dist/components/radio/types.svelte +0 -0
- package/llm/composition.md +0 -395
- package/llm/crafting.md +0 -838
- package/llm/motion.md +0 -970
- package/llm/philosophy.md +0 -23
- package/llm/preset-variant-integration.md +0 -516
- package/llm/preset.md +0 -383
- package/llm/styling.md +0 -216
- package/llm/usage.md +0 -46
- package/llm/variants.md +0 -1259
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
3
|
import { Dropdown as ADropdown } from '.';
|
|
4
|
-
import Root from '../root/root.svelte';
|
|
5
4
|
import { Input } from '../input';
|
|
6
5
|
import { flip } from 'svelte/animate';
|
|
7
6
|
import { filter } from './runes.svelte';
|
|
@@ -37,47 +36,45 @@
|
|
|
37
36
|
</script>
|
|
38
37
|
|
|
39
38
|
<Story name="Dropdown" args={{}}>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ev.preventDefault();
|
|
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();
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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}
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
<!-- Inline search input within the trigger -->
|
|
67
|
+
<ADropdown.Query class="flex-1 px-1" placeholder="Search for fruits..." />
|
|
68
|
+
</ADropdown.Trigger>
|
|
71
69
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
</Root>
|
|
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>
|
|
83
80
|
</Story>
|
|
@@ -2,3 +2,4 @@ export * as Dropdown from './atoms';
|
|
|
2
2
|
export { DropdownBond, type DropdownBondElements, DropdownBondState, type DropdownStateProps } from './bond.svelte';
|
|
3
3
|
export { filter } from './runes.svelte';
|
|
4
4
|
export * from './types';
|
|
5
|
+
export type { AnimatePopoverContentParams as AnimateDropdownContentParams, animatePopoverContent as animateDropdownContent } from '../popover/motion';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Root from '../root/root.svelte';
|
|
4
3
|
import AForm from './form-root.svelte';
|
|
5
4
|
import { Field } from './field';
|
|
6
5
|
import { Input } from '../input';
|
|
@@ -30,70 +29,68 @@
|
|
|
30
29
|
</script>
|
|
31
30
|
|
|
32
31
|
<Story name="Form">
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</div>
|
|
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>
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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>
|
|
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>
|
|
67
43
|
<Input.Root>
|
|
68
|
-
<Field.Control
|
|
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
|
+
/>
|
|
69
52
|
</Input.Root>
|
|
70
|
-
|
|
71
|
-
|
|
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>
|
|
72
62
|
|
|
73
|
-
<
|
|
74
|
-
<Field.
|
|
75
|
-
|
|
76
|
-
<Field.Control base={
|
|
77
|
-
</
|
|
78
|
-
</
|
|
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>
|
|
79
70
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
<div>Yes</div>
|
|
87
|
-
</div>
|
|
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>
|
|
88
77
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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}
|
|
99
96
|
</Story>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import Root from '../root/root.svelte';
|
|
4
3
|
import ImageCmp from './image.svelte';
|
|
5
4
|
|
|
6
5
|
const { Story } = defineMeta({
|
|
@@ -9,15 +8,13 @@
|
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
<Story name="Image">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{/snippet}
|
|
22
|
-
</Root>
|
|
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}
|
|
23
20
|
</Story>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
3
|
import { Input as AInput } from '.';
|
|
4
|
-
import Root from '../root/root.svelte';
|
|
5
4
|
import { Label } from '../label';
|
|
6
5
|
|
|
7
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
@@ -21,18 +20,16 @@
|
|
|
21
20
|
</script>
|
|
22
21
|
|
|
23
22
|
<Story name="Input" args={{}}>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
<AInput.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<AInput.Icon class="text-foreground box-content px-2">.00</AInput.Icon>
|
|
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>
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</Root>
|
|
32
|
+
<AInput.Placeholder class="text-foreground/20 pl-2">Hello World</AInput.Placeholder>
|
|
33
|
+
</AInput.Root>
|
|
34
|
+
</div>
|
|
38
35
|
</Story>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
3
|
import { default as LabelCmp } from './label.svelte';
|
|
4
|
-
import { Root } from '../root';
|
|
5
4
|
|
|
6
5
|
const { Story } = defineMeta({
|
|
7
6
|
title: 'ATOMS/Label'
|
|
@@ -9,18 +8,8 @@
|
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
<script>
|
|
12
|
-
let value = $state(undefined);
|
|
13
|
-
let checked = $state(false);
|
|
14
11
|
</script>
|
|
15
12
|
|
|
16
13
|
<Story name="Label">
|
|
17
|
-
|
|
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}
|
|
14
|
+
<LabelCmp>Hello World</LabelCmp>
|
|
26
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
|
+
}
|
|
@@ -1,35 +1,28 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
|
|
4
|
-
const { Story } = defineMeta({
|
|
5
|
-
title: 'Atoms/Lazy'
|
|
6
|
-
});
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
import Lazy from './lazy.svelte';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<span>Loading...</span>
|
|
30
|
-
{/snippet}
|
|
31
|
-
</Lazy>
|
|
32
|
-
{/snippet}
|
|
33
|
-
</Root>
|
|
34
|
-
{/snippet}
|
|
35
|
-
</Story>
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
|
|
4
|
+
const { Story } = defineMeta({
|
|
5
|
+
title: 'Atoms/Lazy'
|
|
6
|
+
});
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import Lazy from './lazy.svelte';
|
|
11
|
+
import { delay } from 'es-toolkit';
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Lazy">
|
|
15
|
+
<Lazy
|
|
16
|
+
promise={import('../button/button.svelte').then(async res=> {
|
|
17
|
+
await delay(1000 * 2);
|
|
18
|
+
|
|
19
|
+
return res.default;
|
|
20
|
+
})}
|
|
21
|
+
>
|
|
22
|
+
Hello World
|
|
23
|
+
|
|
24
|
+
{#snippet loading()}
|
|
25
|
+
<span>Loading...</span>
|
|
26
|
+
{/snippet}
|
|
27
|
+
</Lazy>
|
|
28
|
+
</Story>
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Component } from 'svelte';
|
|
3
|
-
import type { LazyProps } from './types';
|
|
4
|
-
|
|
5
|
-
let { promise, children, loading, error, ...restProps }: LazyProps = $props();
|
|
6
|
-
|
|
7
|
-
let Lazy: Component | null = $state(null);
|
|
8
|
-
|
|
9
|
-
let err = $state();
|
|
10
|
-
|
|
11
|
-
promise
|
|
12
|
-
.then((c) => {
|
|
13
|
-
Lazy = c;
|
|
14
|
-
})
|
|
15
|
-
.catch((r) => {
|
|
16
|
-
err = r;
|
|
17
|
-
});
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<Lazy {...restProps}>
|
|
21
|
-
{@render children?.()}
|
|
22
|
-
</Lazy>
|
|
23
|
-
|
|
24
|
-
{#if err && error}
|
|
25
|
-
{@render error?.()}
|
|
26
|
-
{:else if !Lazy}
|
|
27
|
-
{@render loading?.()}
|
|
28
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Component } from 'svelte';
|
|
3
|
+
import type { LazyProps } from './types';
|
|
4
|
+
|
|
5
|
+
let { promise, children, loading, error, ...restProps }: LazyProps = $props();
|
|
6
|
+
|
|
7
|
+
let Lazy: Component | null = $state(null);
|
|
8
|
+
|
|
9
|
+
let err = $state();
|
|
10
|
+
|
|
11
|
+
promise
|
|
12
|
+
.then((c) => {
|
|
13
|
+
Lazy = c;
|
|
14
|
+
})
|
|
15
|
+
.catch((r) => {
|
|
16
|
+
err = r;
|
|
17
|
+
});
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<Lazy {...restProps}>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</Lazy>
|
|
23
|
+
|
|
24
|
+
{#if err && error}
|
|
25
|
+
{@render error?.()}
|
|
26
|
+
{:else if !Lazy}
|
|
27
|
+
{@render loading?.()}
|
|
28
|
+
{/if}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script module>
|
|
2
2
|
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { Root } from '../root';
|
|
4
3
|
import LinkComponent from './link.svelte';
|
|
5
4
|
|
|
6
5
|
const { Story } = defineMeta({
|
|
@@ -9,18 +8,8 @@
|
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
<script>
|
|
12
|
-
let value = $state(undefined);
|
|
13
|
-
let checked = $state(false);
|
|
14
11
|
</script>
|
|
15
12
|
|
|
16
13
|
<Story name="Link">
|
|
17
|
-
|
|
18
|
-
<Root>
|
|
19
|
-
{#snippet children({})}
|
|
20
|
-
<div class="flex h-full w-full items-center justify-center">
|
|
21
|
-
<LinkComponent>Hello World</LinkComponent>
|
|
22
|
-
</div>
|
|
23
|
-
{/snippet}
|
|
24
|
-
</Root>
|
|
25
|
-
{/snippet}
|
|
14
|
+
<LinkComponent>Hello World</LinkComponent>
|
|
26
15
|
</Story>
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
export default Link;
|
|
2
|
-
type Link = {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type Link = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
5
8
|
};
|
|
6
|
-
declare const Link:
|
|
9
|
+
declare const Link: $$__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
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<script lang="ts" generics="T extends keyof HTMLElementTagNameMap = 'li', B extends Base = Base">
|
|
2
|
-
import { HtmlAtom, type Base } from '../atom';
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
class: klass = '',
|
|
6
|
-
as = 'li' as T,
|
|
7
|
-
preset
|
|
8
|
-
children = undefined,
|
|
9
|
-
...restProps
|
|
10
|
-
} = $props();
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<HtmlAtom
|
|
14
|
-
{as}
|
|
15
|
-
preset
|
|
16
|
-
class={['border-border flex w-full gap-2 px-4 py-1', '$preset', klass]}
|
|
17
|
-
{...restProps}
|
|
18
|
-
>
|
|
19
|
-
{@render children?.()}
|
|
20
|
-
</HtmlAtom>
|
|
1
|
+
<script lang="ts" generics="T extends keyof HTMLElementTagNameMap = 'li', B extends Base = Base">
|
|
2
|
+
import { HtmlAtom, type Base } from '../atom';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
class: klass = '',
|
|
6
|
+
as = 'li' as T,
|
|
7
|
+
preset = 'list.item',
|
|
8
|
+
children = undefined,
|
|
9
|
+
...restProps
|
|
10
|
+
} = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<HtmlAtom
|
|
14
|
+
{as}
|
|
15
|
+
{preset}
|
|
16
|
+
class={['border-border flex w-full gap-2 px-4 py-1', '$preset', klass]}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</HtmlAtom>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * as Menu from './atoms';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export { PopoverBond, type PopoverDomElements, type PopoverParams, PopoverState, type PopoverStateProps, type TriggerParams } from '../popover
|
|
3
|
+
export { PopoverBond, type PopoverDomElements, type PopoverParams, PopoverState, type PopoverStateProps, type TriggerParams } from '../popover';
|
|
4
|
+
export type { AnimatePopoverContentParams as AnimateMenuContentParams, animatePopoverContent as animateMenuContent } from '../popover/motion';
|