@svelte-atoms/core 1.0.0-alpha.30 → 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 +853 -852
- package/dist/components/accordion/accordion-root.svelte +7 -3
- package/dist/components/accordion/accordion.stories.svelte +7 -82
- 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 +400 -400
- 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 -261
- package/dist/components/avatar/avatar.stories.svelte +22 -22
- package/dist/components/badge/badge.stories.svelte +12 -12
- package/dist/components/badge/badge.svelte +19 -19
- package/dist/components/breadcrumb/breadcrumb.stories.svelte +5 -5
- package/dist/components/button/button.stories.svelte +27 -27
- package/dist/components/calendar/calendar-day.svelte +101 -96
- package/dist/components/calendar/calendar.stories.svelte +26 -26
- 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 -133
- package/dist/components/checkbox/checkbox.stories.svelte +22 -22
- package/dist/components/checkbox/checkbox.svelte +6 -2
- package/dist/components/collapsible/collapsible.stories.svelte +172 -172
- package/dist/components/combobox/atoms.d.ts +1 -1
- package/dist/components/combobox/atoms.js +1 -1
- package/dist/components/combobox/combobox-root.svelte +65 -65
- package/dist/components/combobox/compobox.stories.svelte +51 -51
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/container/container.stories.svelte +20 -20
- package/dist/components/container/container.svelte.d.ts +1 -1
- package/dist/components/datagrid/datagrid.stories.svelte +72 -72
- 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 +67 -67
- package/dist/components/date-picker/date-picker-root.svelte +95 -95
- package/dist/components/date-picker/date-picker.stories.svelte +35 -35
- 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 +44 -62
- package/dist/components/dialog/dialog-root.svelte +91 -110
- package/dist/components/dialog/dialog.stories.svelte +64 -64
- 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 +1 -3
- 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 +6 -14
- package/dist/components/drawer/drawer.stories.svelte +27 -95
- 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 +59 -59
- package/dist/components/dropdown/dropdown.stories.svelte +80 -80
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/form/form.stories.svelte +96 -96
- package/dist/components/image/image.stories.svelte +20 -20
- package/dist/components/input/input.stories.svelte +35 -35
- package/dist/components/label/label.stories.svelte +15 -15
- package/dist/components/lazy/lazy.stories.svelte +28 -28
- package/dist/components/link/link.stories.svelte +15 -15
- 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.stories.svelte +33 -33
- package/dist/components/popover/bond.svelte.d.ts +20 -7
- package/dist/components/popover/bond.svelte.js +80 -27
- package/dist/components/popover/motion.d.ts +6 -0
- package/dist/components/popover/motion.js +56 -0
- package/dist/components/popover/popover-arrow.svelte +111 -111
- package/dist/components/popover/popover-content.svelte +34 -72
- package/dist/components/popover/popover-indicator.svelte +44 -44
- package/dist/components/popover/popover-root.svelte +48 -48
- package/dist/components/popover/popover.stories.svelte +3 -3
- 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 -18
- package/dist/components/radio/radio-group.stories.svelte +41 -41
- package/dist/components/radio/radio.stories.svelte +17 -17
- package/dist/components/radio/radio.svelte +1 -1
- package/dist/components/radio/types.d.ts +98 -0
- package/dist/components/radio/types.js +2 -0
- package/dist/components/root/root.svelte +13 -30
- package/dist/components/root/root.svelte.d.ts +1 -1
- package/dist/components/scrollable/scrollable-root.svelte.d.ts +2 -2
- package/dist/components/scrollable/scrollable.stories.svelte +116 -116
- 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 -13
- package/dist/components/sidebar/sidebar-root.svelte +39 -39
- package/dist/components/sidebar/sidebar.stories.svelte +43 -43
- package/dist/components/sidebar/types.d.ts +2 -12
- package/dist/components/tabs/tabs.stories.svelte +56 -56
- 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 +2 -2
- package/dist/components/tooltip/tooltip-trigger.svelte.d.ts +1 -0
- package/dist/components/tooltip/tooltip.stories.svelte +32 -32
- package/dist/components/tree/tree.stories.svelte +142 -142
- 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/markdown-to-llm.d.ts +28 -0
- package/dist/utils/markdown-to-llm.js +76 -0
- package/package.json +1 -2
- 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,9 +1,9 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { Input } from '../input';
|
|
3
|
-
|
|
4
|
-
let { children, ...restProps } = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<Input.Root preset="textarea" {...restProps}>
|
|
8
|
-
{@render children?.()}
|
|
9
|
-
</Input.Root>
|
|
1
|
+
<script>
|
|
2
|
+
import { Input } from '../input';
|
|
3
|
+
|
|
4
|
+
let { class: klass = '', children, ...restProps } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<Input.Root preset="textarea" class={['h-auto', klass]} {...restProps}>
|
|
8
|
+
{@render children?.()}
|
|
9
|
+
</Input.Root>
|
|
@@ -4,8 +4,10 @@ type TextareaRoot = {
|
|
|
4
4
|
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
5
|
};
|
|
6
6
|
declare const TextareaRoot: import("svelte").Component<{
|
|
7
|
+
class?: string;
|
|
7
8
|
children: any;
|
|
8
9
|
} & Record<string, any>, {}, "">;
|
|
9
10
|
type $$ComponentProps = {
|
|
11
|
+
class?: string;
|
|
10
12
|
children: any;
|
|
11
13
|
} & Record<string, any>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
const popoverBond = PopoverBond.get();
|
|
6
6
|
|
|
7
|
-
let { onmount, children, ...restProps } = $props();
|
|
7
|
+
let { onmount, children, onclick = undefined, ...restProps } = $props();
|
|
8
8
|
|
|
9
9
|
function tooltip(node: HTMLElement) {
|
|
10
10
|
const onpointerenter = async () => {
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
}
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
|
-
<Trigger preset="tooltip.trigger" onmount={tooltip} {...restProps}>
|
|
37
|
+
<Trigger preset="tooltip.trigger" onmount={tooltip} {onclick} {...restProps}>
|
|
38
38
|
{@render children?.()}
|
|
39
39
|
</Trigger>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
-
import { Tooltip as Tooltip_ } from '.';
|
|
4
|
-
import { Root as TooltipRoot } from './atoms';
|
|
5
|
-
import { Button } from '../button';
|
|
6
|
-
|
|
7
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
-
const { Story } = defineMeta({
|
|
9
|
-
title: 'Atoms/Tooltip',
|
|
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
|
-
let open = $state(false);
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<Story name="Tooltip" args={{}}>
|
|
25
|
-
<Tooltip_.Root bind:open offset={0}>
|
|
26
|
-
<Tooltip_.Trigger base={Button}>Open Popover</Tooltip_.Trigger>
|
|
27
|
-
<Tooltip_.Content>
|
|
28
|
-
<div>Hello World !</div>
|
|
29
|
-
<Tooltip_.Arrow />
|
|
30
|
-
</Tooltip_.Content>
|
|
31
|
-
</Tooltip_.Root>
|
|
32
|
-
</Story>
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { Tooltip as Tooltip_ } from '.';
|
|
4
|
+
import { Root as TooltipRoot } from './atoms';
|
|
5
|
+
import { Button } from '../button';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
title: 'Atoms/Tooltip',
|
|
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
|
+
let open = $state(false);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<Story name="Tooltip" args={{}}>
|
|
25
|
+
<Tooltip_.Root bind:open offset={0}>
|
|
26
|
+
<Tooltip_.Trigger base={Button}>Open Popover</Tooltip_.Trigger>
|
|
27
|
+
<Tooltip_.Content>
|
|
28
|
+
<div>Hello World !</div>
|
|
29
|
+
<Tooltip_.Arrow />
|
|
30
|
+
</Tooltip_.Content>
|
|
31
|
+
</Tooltip_.Root>
|
|
32
|
+
</Story>
|
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { untrack } from 'svelte';
|
|
3
|
-
import { animate } from 'motion';
|
|
4
|
-
import { RenderScan } from 'svelte-render-scan';
|
|
5
|
-
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
6
|
-
import { dev } from '$app/environment';
|
|
7
|
-
import { Tree as Tree_ } from '.';
|
|
8
|
-
import { tree } from './attachments.svelte';
|
|
9
|
-
import { TreeBond } from './bond.svelte';
|
|
10
|
-
|
|
11
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
12
|
-
const { Story } = defineMeta({
|
|
13
|
-
title: 'Atoms/Tree',
|
|
14
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
15
|
-
|
|
16
|
-
parameters: {
|
|
17
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
18
|
-
layout: 'fullscreen'
|
|
19
|
-
},
|
|
20
|
-
args: {}
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<script lang="ts">
|
|
25
|
-
let open = $state(true);
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<Story name="Tree" args={{}}>
|
|
29
|
-
<Tree_.Root class="" bind:open>
|
|
30
|
-
{#if dev}
|
|
31
|
-
<RenderScan duration={300} />
|
|
32
|
-
{/if}
|
|
33
|
-
|
|
34
|
-
<Tree_.Header>Vehicles</Tree_.Header>
|
|
35
|
-
|
|
36
|
-
<Tree_.Body
|
|
37
|
-
class="border-l border-l-neutral-200"
|
|
38
|
-
onmount={(node) => {
|
|
39
|
-
const bond = TreeBond.get();
|
|
40
|
-
const isOpen = untrack(() => bond?.state.props.open ?? false);
|
|
41
|
-
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
42
|
-
}}
|
|
43
|
-
{@attach tree((node, bond) => {
|
|
44
|
-
const isOpen = bond?.state.props.open ?? false;
|
|
45
|
-
animate(
|
|
46
|
-
node,
|
|
47
|
-
{
|
|
48
|
-
height: +isOpen ? 'auto' : 0,
|
|
49
|
-
opacity: +isOpen,
|
|
50
|
-
pointerEvents: isOpen ? 'all' : 'none'
|
|
51
|
-
},
|
|
52
|
-
{ duration: 0.1 }
|
|
53
|
-
);
|
|
54
|
-
})}
|
|
55
|
-
>
|
|
56
|
-
<Tree_.Root>
|
|
57
|
-
<Tree_.Header>Cars</Tree_.Header>
|
|
58
|
-
<Tree_.Body
|
|
59
|
-
class="border-l border-l-neutral-200"
|
|
60
|
-
onmount={(node) => {
|
|
61
|
-
const bond = TreeBond.get();
|
|
62
|
-
const isOpen = bond?.state.props.open ?? false;
|
|
63
|
-
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
64
|
-
}}
|
|
65
|
-
animate={(node) => {
|
|
66
|
-
const bond = TreeBond.get();
|
|
67
|
-
const isOpen = bond?.state.props.open ?? false;
|
|
68
|
-
animate(
|
|
69
|
-
node,
|
|
70
|
-
{
|
|
71
|
-
height: +isOpen ? 'auto' : 0,
|
|
72
|
-
opacity: +isOpen,
|
|
73
|
-
pointerEvents: isOpen ? 'all' : 'none'
|
|
74
|
-
},
|
|
75
|
-
{ duration: 0.1 }
|
|
76
|
-
);
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
Mauris et habitasse cubilia potenti at condimentum iaculis nam. Ante fusce litora
|
|
80
|
-
tristique letius libero. Curabitur vitae cursus consectetur feugiat aenean viverra vel
|
|
81
|
-
dolor diam nascetur.
|
|
82
|
-
</Tree_.Body>
|
|
83
|
-
</Tree_.Root>
|
|
84
|
-
|
|
85
|
-
<Tree_.Root>
|
|
86
|
-
<Tree_.Header>Trucks</Tree_.Header>
|
|
87
|
-
<Tree_.Body
|
|
88
|
-
class="border-l border-l-neutral-200"
|
|
89
|
-
onmount={(node) => {
|
|
90
|
-
const bond = TreeBond.get();
|
|
91
|
-
const isOpen = bond?.state.props.open ?? false;
|
|
92
|
-
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
93
|
-
}}
|
|
94
|
-
{@attach tree((node, bond) => {
|
|
95
|
-
const isOpen = bond?.state.props.open ?? false;
|
|
96
|
-
animate(
|
|
97
|
-
node,
|
|
98
|
-
{
|
|
99
|
-
height: +isOpen ? 'auto' : 0,
|
|
100
|
-
opacity: +isOpen,
|
|
101
|
-
pointerEvents: isOpen ? 'all' : 'none'
|
|
102
|
-
},
|
|
103
|
-
{ duration: 0.1 }
|
|
104
|
-
);
|
|
105
|
-
})}
|
|
106
|
-
>
|
|
107
|
-
Mauris et habitasse cubilia potenti at condimentum iaculis nam. Ante fusce litora
|
|
108
|
-
tristique letius libero. Curabitur vitae cursus consectetur feugiat aenean viverra vel
|
|
109
|
-
dolor diam nascetur.
|
|
110
|
-
</Tree_.Body>
|
|
111
|
-
</Tree_.Root>
|
|
112
|
-
|
|
113
|
-
<Tree_.Root>
|
|
114
|
-
<Tree_.Header>Bikes</Tree_.Header>
|
|
115
|
-
<Tree_.Body
|
|
116
|
-
class="border-l border-l-neutral-200"
|
|
117
|
-
onmount={(node) => {
|
|
118
|
-
const bond = TreeBond.get();
|
|
119
|
-
const isOpen = untrack(() => bond?.state.props.open ?? false);
|
|
120
|
-
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
121
|
-
}}
|
|
122
|
-
{@attach tree((node, bond) => {
|
|
123
|
-
const isOpen = bond?.state.props.open ?? false;
|
|
124
|
-
animate(
|
|
125
|
-
node,
|
|
126
|
-
{
|
|
127
|
-
height: +isOpen ? 'auto' : 0,
|
|
128
|
-
opacity: +isOpen,
|
|
129
|
-
pointerEvents: isOpen ? 'all' : 'none'
|
|
130
|
-
},
|
|
131
|
-
{ duration: 0.1 }
|
|
132
|
-
);
|
|
133
|
-
})}
|
|
134
|
-
>
|
|
135
|
-
Mauris et habitasse cubilia potenti at condimentum iaculis nam. Ante fusce litora
|
|
136
|
-
tristique letius libero. Curabitur vitae cursus consectetur feugiat aenean viverra vel
|
|
137
|
-
dolor diam nascetur.
|
|
138
|
-
</Tree_.Body>
|
|
139
|
-
</Tree_.Root>
|
|
140
|
-
</Tree_.Body>
|
|
141
|
-
</Tree_.Root>
|
|
142
|
-
</Story>
|
|
1
|
+
<script module>
|
|
2
|
+
import { untrack } from 'svelte';
|
|
3
|
+
import { animate } from 'motion';
|
|
4
|
+
import { RenderScan } from 'svelte-render-scan';
|
|
5
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
6
|
+
import { dev } from '$app/environment';
|
|
7
|
+
import { Tree as Tree_ } from '.';
|
|
8
|
+
import { tree } from './attachments.svelte';
|
|
9
|
+
import { TreeBond } from './bond.svelte';
|
|
10
|
+
|
|
11
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
12
|
+
const { Story } = defineMeta({
|
|
13
|
+
title: 'Atoms/Tree',
|
|
14
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
15
|
+
|
|
16
|
+
parameters: {
|
|
17
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
18
|
+
layout: 'fullscreen'
|
|
19
|
+
},
|
|
20
|
+
args: {}
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<script lang="ts">
|
|
25
|
+
let open = $state(true);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<Story name="Tree" args={{}}>
|
|
29
|
+
<Tree_.Root class="" bind:open>
|
|
30
|
+
{#if dev}
|
|
31
|
+
<RenderScan duration={300} />
|
|
32
|
+
{/if}
|
|
33
|
+
|
|
34
|
+
<Tree_.Header>Vehicles</Tree_.Header>
|
|
35
|
+
|
|
36
|
+
<Tree_.Body
|
|
37
|
+
class="border-l border-l-neutral-200"
|
|
38
|
+
onmount={(node) => {
|
|
39
|
+
const bond = TreeBond.get();
|
|
40
|
+
const isOpen = untrack(() => bond?.state.props.open ?? false);
|
|
41
|
+
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
42
|
+
}}
|
|
43
|
+
{@attach tree((node, bond) => {
|
|
44
|
+
const isOpen = bond?.state.props.open ?? false;
|
|
45
|
+
animate(
|
|
46
|
+
node,
|
|
47
|
+
{
|
|
48
|
+
height: +isOpen ? 'auto' : 0,
|
|
49
|
+
opacity: +isOpen,
|
|
50
|
+
pointerEvents: isOpen ? 'all' : 'none'
|
|
51
|
+
},
|
|
52
|
+
{ duration: 0.1 }
|
|
53
|
+
);
|
|
54
|
+
})}
|
|
55
|
+
>
|
|
56
|
+
<Tree_.Root>
|
|
57
|
+
<Tree_.Header>Cars</Tree_.Header>
|
|
58
|
+
<Tree_.Body
|
|
59
|
+
class="border-l border-l-neutral-200"
|
|
60
|
+
onmount={(node) => {
|
|
61
|
+
const bond = TreeBond.get();
|
|
62
|
+
const isOpen = bond?.state.props.open ?? false;
|
|
63
|
+
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
64
|
+
}}
|
|
65
|
+
animate={(node) => {
|
|
66
|
+
const bond = TreeBond.get();
|
|
67
|
+
const isOpen = bond?.state.props.open ?? false;
|
|
68
|
+
animate(
|
|
69
|
+
node,
|
|
70
|
+
{
|
|
71
|
+
height: +isOpen ? 'auto' : 0,
|
|
72
|
+
opacity: +isOpen,
|
|
73
|
+
pointerEvents: isOpen ? 'all' : 'none'
|
|
74
|
+
},
|
|
75
|
+
{ duration: 0.1 }
|
|
76
|
+
);
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
Mauris et habitasse cubilia potenti at condimentum iaculis nam. Ante fusce litora
|
|
80
|
+
tristique letius libero. Curabitur vitae cursus consectetur feugiat aenean viverra vel
|
|
81
|
+
dolor diam nascetur.
|
|
82
|
+
</Tree_.Body>
|
|
83
|
+
</Tree_.Root>
|
|
84
|
+
|
|
85
|
+
<Tree_.Root>
|
|
86
|
+
<Tree_.Header>Trucks</Tree_.Header>
|
|
87
|
+
<Tree_.Body
|
|
88
|
+
class="border-l border-l-neutral-200"
|
|
89
|
+
onmount={(node) => {
|
|
90
|
+
const bond = TreeBond.get();
|
|
91
|
+
const isOpen = bond?.state.props.open ?? false;
|
|
92
|
+
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
93
|
+
}}
|
|
94
|
+
{@attach tree((node, bond) => {
|
|
95
|
+
const isOpen = bond?.state.props.open ?? false;
|
|
96
|
+
animate(
|
|
97
|
+
node,
|
|
98
|
+
{
|
|
99
|
+
height: +isOpen ? 'auto' : 0,
|
|
100
|
+
opacity: +isOpen,
|
|
101
|
+
pointerEvents: isOpen ? 'all' : 'none'
|
|
102
|
+
},
|
|
103
|
+
{ duration: 0.1 }
|
|
104
|
+
);
|
|
105
|
+
})}
|
|
106
|
+
>
|
|
107
|
+
Mauris et habitasse cubilia potenti at condimentum iaculis nam. Ante fusce litora
|
|
108
|
+
tristique letius libero. Curabitur vitae cursus consectetur feugiat aenean viverra vel
|
|
109
|
+
dolor diam nascetur.
|
|
110
|
+
</Tree_.Body>
|
|
111
|
+
</Tree_.Root>
|
|
112
|
+
|
|
113
|
+
<Tree_.Root>
|
|
114
|
+
<Tree_.Header>Bikes</Tree_.Header>
|
|
115
|
+
<Tree_.Body
|
|
116
|
+
class="border-l border-l-neutral-200"
|
|
117
|
+
onmount={(node) => {
|
|
118
|
+
const bond = TreeBond.get();
|
|
119
|
+
const isOpen = untrack(() => bond?.state.props.open ?? false);
|
|
120
|
+
animate(node, { height: +isOpen ? 'auto' : 0, opacity: +isOpen }, { duration: 0 });
|
|
121
|
+
}}
|
|
122
|
+
{@attach tree((node, bond) => {
|
|
123
|
+
const isOpen = bond?.state.props.open ?? false;
|
|
124
|
+
animate(
|
|
125
|
+
node,
|
|
126
|
+
{
|
|
127
|
+
height: +isOpen ? 'auto' : 0,
|
|
128
|
+
opacity: +isOpen,
|
|
129
|
+
pointerEvents: isOpen ? 'all' : 'none'
|
|
130
|
+
},
|
|
131
|
+
{ duration: 0.1 }
|
|
132
|
+
);
|
|
133
|
+
})}
|
|
134
|
+
>
|
|
135
|
+
Mauris et habitasse cubilia potenti at condimentum iaculis nam. Ante fusce litora
|
|
136
|
+
tristique letius libero. Curabitur vitae cursus consectetur feugiat aenean viverra vel
|
|
137
|
+
dolor diam nascetur.
|
|
138
|
+
</Tree_.Body>
|
|
139
|
+
</Tree_.Root>
|
|
140
|
+
</Tree_.Body>
|
|
141
|
+
</Tree_.Root>
|
|
142
|
+
</Story>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="size-full" viewBox="0 0 24 24"
|
|
2
|
+
><!-- Icon from Fluent UI System Icons by Microsoft Corporation - https://github.com/microsoft/fluentui-system-icons/blob/main/LICENSE --><path
|
|
3
|
+
fill="currentColor"
|
|
4
|
+
d="M5.503 4.627 5.5 6.75v10.504a3.25 3.25 0 0 0 3.25 3.25h8.616a2.251 2.251 0 0 1-2.122 1.5H8.75A4.75 4.75 0 0 1 4 17.254V6.75c0-.98.627-1.815 1.503-2.123M17.75 2A2.25 2.25 0 0 1 20 4.25v13a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-13A2.25 2.25 0 0 1 8.75 2zM7.75 17.25c0 .414.336.75.75.75h9a.75.75 0 0 0 .75-.75v-13a.75.75 0 0 0-.75-.75h-9a.75.75 0 0 0-.75.75z"
|
|
5
|
+
/></svg
|
|
6
|
+
>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export default
|
|
2
|
-
type
|
|
1
|
+
export default IconCopy;
|
|
2
|
+
type IconCopy = SvelteComponent<{
|
|
3
3
|
[x: string]: never;
|
|
4
4
|
}, {
|
|
5
5
|
[evt: string]: CustomEvent<any>;
|
|
6
6
|
}, {}> & {
|
|
7
7
|
$$bindings?: string;
|
|
8
8
|
};
|
|
9
|
-
declare const
|
|
9
|
+
declare const IconCopy: $$__sveltets_2_IsomorphicComponent<{
|
|
10
10
|
[x: string]: never;
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface PropDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
default: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Converts prop definitions to markdown table format
|
|
9
|
+
*/
|
|
10
|
+
export declare function propsToMarkdown(props: PropDefinition[]): string;
|
|
11
|
+
/**
|
|
12
|
+
* Injects props into markdown content by replacing placeholders
|
|
13
|
+
* Placeholders format: {{propName}}
|
|
14
|
+
*/
|
|
15
|
+
export declare function injectPropsIntoMarkdown(markdown: string, propsMap: Record<string, PropDefinition[]>): string;
|
|
16
|
+
/**
|
|
17
|
+
* Converts markdown content to LLM-friendly text format
|
|
18
|
+
* Keeps markdown syntax as-is since LLMs parse it well
|
|
19
|
+
*/
|
|
20
|
+
export declare function markdownToLLM(markdown: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Reads markdown files from the docs directory
|
|
23
|
+
*/
|
|
24
|
+
export declare function readMarkdownFile(filePath: string): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Generate LLM-friendly documentation metadata
|
|
27
|
+
*/
|
|
28
|
+
export declare function generateLLMHeader(title: string, description: string, version?: string): string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts prop definitions to markdown table format
|
|
3
|
+
*/
|
|
4
|
+
export function propsToMarkdown(props) {
|
|
5
|
+
if (!props || props.length === 0)
|
|
6
|
+
return '';
|
|
7
|
+
let markdown = '| Name | Type | Default | Description |\n';
|
|
8
|
+
markdown += '|------|------|---------|-------------|\n';
|
|
9
|
+
for (const prop of props) {
|
|
10
|
+
const name = prop.name.replace(/\|/g, '\\|');
|
|
11
|
+
const type = prop.type.replace(/\|/g, '\\|');
|
|
12
|
+
const defaultVal = prop.default.replace(/\|/g, '\\|');
|
|
13
|
+
const description = prop.description.replace(/\|/g, '\\|');
|
|
14
|
+
markdown += `| ${name} | ${type} | ${defaultVal} | ${description} |\n`;
|
|
15
|
+
}
|
|
16
|
+
return markdown;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Injects props into markdown content by replacing placeholders
|
|
20
|
+
* Placeholders format: {{propName}}
|
|
21
|
+
*/
|
|
22
|
+
export function injectPropsIntoMarkdown(markdown, propsMap) {
|
|
23
|
+
let result = markdown;
|
|
24
|
+
for (const [key, props] of Object.entries(propsMap)) {
|
|
25
|
+
const placeholder = new RegExp(`{{${key}}}`, 'g');
|
|
26
|
+
const propsMarkdown = propsToMarkdown(props);
|
|
27
|
+
result = result.replace(placeholder, propsMarkdown);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Converts markdown content to LLM-friendly text format
|
|
33
|
+
* Keeps markdown syntax as-is since LLMs parse it well
|
|
34
|
+
*/
|
|
35
|
+
export function markdownToLLM(markdown) {
|
|
36
|
+
let text = markdown;
|
|
37
|
+
// Remove HTML comments
|
|
38
|
+
text = text.replace(/<!--[\s\S]*?-->/g, '');
|
|
39
|
+
// Remove excessive blank lines (more than 2)
|
|
40
|
+
text = text.replace(/\n{3,}/g, '\n\n');
|
|
41
|
+
// Trim whitespace
|
|
42
|
+
text = text.trim();
|
|
43
|
+
return text;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Reads markdown files from the docs directory
|
|
47
|
+
*/
|
|
48
|
+
export async function readMarkdownFile(filePath) {
|
|
49
|
+
try {
|
|
50
|
+
// In production, you might want to use a different approach
|
|
51
|
+
// This is a placeholder - adjust based on your build setup
|
|
52
|
+
const response = await fetch(filePath);
|
|
53
|
+
if (!response.ok)
|
|
54
|
+
throw new Error(`Failed to fetch ${filePath}`);
|
|
55
|
+
return await response.text();
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error(`Error reading markdown file: ${filePath}`, error);
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Generate LLM-friendly documentation metadata
|
|
64
|
+
*/
|
|
65
|
+
export function generateLLMHeader(title, description, version = '1.0.0-alpha.30') {
|
|
66
|
+
return `# ${title}
|
|
67
|
+
|
|
68
|
+
${description}
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
Generated: ${new Date().toISOString()}
|
|
72
|
+
Version: ${version}
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
`;
|
|
76
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svelte-atoms/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.31",
|
|
4
4
|
"description": "A modular, accessible, and extensible Svelte UI component library.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist",
|
|
34
|
-
"llm",
|
|
35
34
|
"!dist/**/*.test.*",
|
|
36
35
|
"!dist/**/*.spec.*"
|
|
37
36
|
],
|
|
File without changes
|