ui-ingredients 0.21.0 → 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/accordion/accordion-item-content.svelte +55 -55
- package/dist/accordion/accordion-root.svelte +66 -66
- package/dist/alert-dialog/alert-dialog-backdrop.svelte +49 -49
- package/dist/alert-dialog/alert-dialog-root.svelte +48 -48
- package/dist/avatar/avatar-root.svelte +46 -46
- package/dist/carousel/carousel-root.svelte +56 -56
- package/dist/checkbox/checkbox-root.svelte +59 -59
- package/dist/clipboard/clipboard-root.svelte +52 -52
- package/dist/collapsible/collapsible-root.svelte +75 -75
- package/dist/color-picker/color-picker-root.svelte +87 -87
- package/dist/combobox/combobox-root.svelte +101 -101
- package/dist/combobox/combobox-trigger.svelte +41 -41
- package/dist/date-picker/date-picker-root.svelte +89 -89
- package/dist/dialog/dialog-backdrop.svelte +45 -45
- package/dist/dialog/dialog-root.svelte +48 -48
- package/dist/drawer/drawer-backdrop.svelte +45 -45
- package/dist/drawer/drawer-root.svelte +48 -48
- package/dist/editable/editable-root.svelte +74 -74
- package/dist/field/field-error-text.svelte +50 -50
- package/dist/field/field-root.svelte +63 -63
- package/dist/file-upload/file-upload-root.svelte +66 -66
- package/dist/floating-panel/floating-panel-root.svelte +47 -47
- package/dist/hover-card/hover-card-root.svelte +52 -52
- package/dist/menu/menu-root.svelte +74 -74
- package/dist/number-input/number-input-root.svelte +74 -74
- package/dist/pagination/pagination-root.svelte +57 -57
- package/dist/pin-input/pin-input-root.svelte +68 -68
- package/dist/popover/popover-root.svelte +60 -60
- package/dist/presence/presence.svelte +48 -48
- package/dist/progress/progress-root.svelte +54 -54
- package/dist/qr-code/qr-code-root.svelte +48 -48
- package/dist/radio-group/radio-group-root.svelte +56 -56
- package/dist/rating-group/rating-group-root.svelte +63 -63
- package/dist/segment-group/segment-group-root.svelte +58 -58
- package/dist/select/select-root.svelte +88 -88
- package/dist/signature-pad/signature-pad-root.svelte +59 -59
- package/dist/slider/slider-root.svelte +69 -69
- package/dist/splitter/splitter-root.svelte +53 -53
- package/dist/steps/steps-completed-content.svelte +51 -51
- package/dist/steps/steps-content.svelte +55 -55
- package/dist/steps/steps-root.svelte +65 -65
- package/dist/switch/switch-root.svelte +59 -59
- package/dist/tabs/tabs-root.svelte +57 -57
- package/dist/tags-input/tags-input-root.svelte +74 -74
- package/dist/time-picker/time-picker-root.svelte +81 -81
- package/dist/timer/timer-root.svelte +55 -55
- package/dist/toast/create-toaster.svelte.d.ts +1 -1
- package/dist/toast/toast-actor.svelte +19 -19
- package/dist/toast/toast-actor.svelte.d.ts +3 -3
- package/dist/toast/toaster.svelte +19 -21
- package/dist/toast/toaster.svelte.d.ts +1 -1
- package/dist/toggle/toggle-root.svelte +50 -50
- package/dist/toggle-group/toggle-group-root.svelte +58 -58
- package/dist/tooltip/tooltip-root.svelte +44 -44
- package/dist/tour/tour-backdrop.svelte +44 -44
- package/dist/tour/tour-root.svelte +47 -47
- package/dist/tree-view/tree-view-branch-content.svelte +55 -55
- package/dist/tree-view/tree-view-root.svelte +68 -68
- package/package.json +5 -5
@@ -1,55 +1,55 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {Action} from 'svelte/action';
|
4
|
-
|
5
|
-
export interface TreeViewBranchContentProps
|
6
|
-
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
-
</script>
|
8
|
-
|
9
|
-
<script lang="ts">
|
10
|
-
import {mergeProps} from '../merge-props.js';
|
11
|
-
import {createPresence} from '../presence/create-presence.svelte.js';
|
12
|
-
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
13
|
-
import {reflect} from '@zag-js/svelte';
|
14
|
-
import {
|
15
|
-
getTreeViewContext,
|
16
|
-
getTreeViewNodePropsContext,
|
17
|
-
} from './tree-view-context.svelte.js';
|
18
|
-
|
19
|
-
let {
|
20
|
-
ref = $bindable(null),
|
21
|
-
asChild,
|
22
|
-
children,
|
23
|
-
...props
|
24
|
-
}: TreeViewBranchContentProps = $props();
|
25
|
-
|
26
|
-
let treeView = getTreeViewContext();
|
27
|
-
let nodeProps = getTreeViewNodePropsContext();
|
28
|
-
let nodeState = $derived(treeView.getNodeState(nodeProps));
|
29
|
-
|
30
|
-
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
31
|
-
let presence = createPresence(
|
32
|
-
reflect(() => ({
|
33
|
-
...presenceStrategyProps,
|
34
|
-
present: nodeState.expanded,
|
35
|
-
})),
|
36
|
-
);
|
37
|
-
|
38
|
-
let mergedProps = $derived(
|
39
|
-
mergeProps(
|
40
|
-
treeView.getBranchContentProps(nodeProps),
|
41
|
-
presence.getPresenceProps(),
|
42
|
-
props,
|
43
|
-
),
|
44
|
-
);
|
45
|
-
</script>
|
46
|
-
|
47
|
-
{#if presence.mounted}
|
48
|
-
{#if asChild}
|
49
|
-
{@render asChild(presence.setReference, mergedProps)}
|
50
|
-
{:else}
|
51
|
-
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
52
|
-
{@render children?.()}
|
53
|
-
</div>
|
54
|
-
{/if}
|
55
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
4
|
+
|
5
|
+
export interface TreeViewBranchContentProps
|
6
|
+
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
+
</script>
|
8
|
+
|
9
|
+
<script lang="ts">
|
10
|
+
import {mergeProps} from '../merge-props.js';
|
11
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
12
|
+
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
13
|
+
import {reflect} from '@zag-js/svelte';
|
14
|
+
import {
|
15
|
+
getTreeViewContext,
|
16
|
+
getTreeViewNodePropsContext,
|
17
|
+
} from './tree-view-context.svelte.js';
|
18
|
+
|
19
|
+
let {
|
20
|
+
ref = $bindable(null),
|
21
|
+
asChild,
|
22
|
+
children,
|
23
|
+
...props
|
24
|
+
}: TreeViewBranchContentProps = $props();
|
25
|
+
|
26
|
+
let treeView = getTreeViewContext();
|
27
|
+
let nodeProps = getTreeViewNodePropsContext();
|
28
|
+
let nodeState = $derived(treeView.getNodeState(nodeProps));
|
29
|
+
|
30
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
31
|
+
let presence = createPresence(
|
32
|
+
reflect(() => ({
|
33
|
+
...presenceStrategyProps,
|
34
|
+
present: nodeState.expanded,
|
35
|
+
})),
|
36
|
+
);
|
37
|
+
|
38
|
+
let mergedProps = $derived(
|
39
|
+
mergeProps(
|
40
|
+
treeView.getBranchContentProps(nodeProps),
|
41
|
+
presence.getPresenceProps(),
|
42
|
+
props,
|
43
|
+
),
|
44
|
+
);
|
45
|
+
</script>
|
46
|
+
|
47
|
+
{#if presence.mounted}
|
48
|
+
{#if asChild}
|
49
|
+
{@render asChild(presence.setReference, mergedProps)}
|
50
|
+
{:else}
|
51
|
+
<div bind:this={ref} use:presence.setReference {...mergedProps}>
|
52
|
+
{@render children?.()}
|
53
|
+
</div>
|
54
|
+
{/if}
|
55
|
+
{/if}
|
@@ -1,68 +1,68 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
|
3
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
4
|
-
import type {
|
5
|
-
CreateTreeViewProps,
|
6
|
-
CreateTreeViewReturn,
|
7
|
-
} from './create-tree-view.svelte.js';
|
8
|
-
|
9
|
-
export interface TreeViewProps
|
10
|
-
extends Assign<
|
11
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateTreeViewReturn>,
|
12
|
-
CreateTreeViewProps
|
13
|
-
>,
|
14
|
-
PresenceStrategyProps {}
|
15
|
-
</script>
|
16
|
-
|
17
|
-
<script lang="ts">
|
18
|
-
import {mergeProps} from '../merge-props.js';
|
19
|
-
import {setPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
20
|
-
import {reflect} from '@zag-js/svelte';
|
21
|
-
import {createSplitProps} from '@zag-js/utils';
|
22
|
-
import {createTreeView} from './create-tree-view.svelte.js';
|
23
|
-
import {setTreeViewContext} from './tree-view-context.svelte.js';
|
24
|
-
|
25
|
-
let {
|
26
|
-
ref = $bindable(null),
|
27
|
-
asChild,
|
28
|
-
children,
|
29
|
-
...props
|
30
|
-
}: TreeViewProps = $props();
|
31
|
-
|
32
|
-
let [presenceStrategyProps, rest] = $derived(
|
33
|
-
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
|
34
|
-
props,
|
35
|
-
),
|
36
|
-
);
|
37
|
-
|
38
|
-
let [createTreeViewProps, localProps] = $derived(
|
39
|
-
createSplitProps<CreateTreeViewProps>([
|
40
|
-
'id',
|
41
|
-
'ids',
|
42
|
-
'typeahead',
|
43
|
-
'collection',
|
44
|
-
'focusedValue',
|
45
|
-
'expandedValue',
|
46
|
-
'expandOnClick',
|
47
|
-
'selectedValue',
|
48
|
-
'selectionMode',
|
49
|
-
'onFocusChange',
|
50
|
-
'onExpandedChange',
|
51
|
-
'onSelectionChange',
|
52
|
-
])(rest),
|
53
|
-
);
|
54
|
-
|
55
|
-
let treeView = createTreeView(reflect(() => createTreeViewProps));
|
56
|
-
let mergedProps = $derived(mergeProps(treeView.getRootProps(), localProps));
|
57
|
-
|
58
|
-
setTreeViewContext(treeView);
|
59
|
-
setPresenceStrategyPropsContext(() => presenceStrategyProps);
|
60
|
-
</script>
|
61
|
-
|
62
|
-
{#if asChild}
|
63
|
-
{@render asChild(mergedProps, treeView)}
|
64
|
-
{:else}
|
65
|
-
<div bind:this={ref} {...mergedProps}>
|
66
|
-
{@render children?.(treeView)}
|
67
|
-
</div>
|
68
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
|
3
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
4
|
+
import type {
|
5
|
+
CreateTreeViewProps,
|
6
|
+
CreateTreeViewReturn,
|
7
|
+
} from './create-tree-view.svelte.js';
|
8
|
+
|
9
|
+
export interface TreeViewProps
|
10
|
+
extends Assign<
|
11
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateTreeViewReturn>,
|
12
|
+
CreateTreeViewProps
|
13
|
+
>,
|
14
|
+
PresenceStrategyProps {}
|
15
|
+
</script>
|
16
|
+
|
17
|
+
<script lang="ts">
|
18
|
+
import {mergeProps} from '../merge-props.js';
|
19
|
+
import {setPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
20
|
+
import {reflect} from '@zag-js/svelte';
|
21
|
+
import {createSplitProps} from '@zag-js/utils';
|
22
|
+
import {createTreeView} from './create-tree-view.svelte.js';
|
23
|
+
import {setTreeViewContext} from './tree-view-context.svelte.js';
|
24
|
+
|
25
|
+
let {
|
26
|
+
ref = $bindable(null),
|
27
|
+
asChild,
|
28
|
+
children,
|
29
|
+
...props
|
30
|
+
}: TreeViewProps = $props();
|
31
|
+
|
32
|
+
let [presenceStrategyProps, rest] = $derived(
|
33
|
+
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
|
34
|
+
props,
|
35
|
+
),
|
36
|
+
);
|
37
|
+
|
38
|
+
let [createTreeViewProps, localProps] = $derived(
|
39
|
+
createSplitProps<CreateTreeViewProps>([
|
40
|
+
'id',
|
41
|
+
'ids',
|
42
|
+
'typeahead',
|
43
|
+
'collection',
|
44
|
+
'focusedValue',
|
45
|
+
'expandedValue',
|
46
|
+
'expandOnClick',
|
47
|
+
'selectedValue',
|
48
|
+
'selectionMode',
|
49
|
+
'onFocusChange',
|
50
|
+
'onExpandedChange',
|
51
|
+
'onSelectionChange',
|
52
|
+
])(rest),
|
53
|
+
);
|
54
|
+
|
55
|
+
let treeView = createTreeView(reflect(() => createTreeViewProps));
|
56
|
+
let mergedProps = $derived(mergeProps(treeView.getRootProps(), localProps));
|
57
|
+
|
58
|
+
setTreeViewContext(treeView);
|
59
|
+
setPresenceStrategyPropsContext(() => presenceStrategyProps);
|
60
|
+
</script>
|
61
|
+
|
62
|
+
{#if asChild}
|
63
|
+
{@render asChild(mergedProps, treeView)}
|
64
|
+
{:else}
|
65
|
+
<div bind:this={ref} {...mergedProps}>
|
66
|
+
{@render children?.(treeView)}
|
67
|
+
</div>
|
68
|
+
{/if}
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "ui-ingredients",
|
3
3
|
"type": "module",
|
4
4
|
"license": "MIT",
|
5
|
-
"version": "0.21.
|
5
|
+
"version": "0.21.1",
|
6
6
|
"packageManager": "pnpm@9.15.0",
|
7
7
|
"svelte": "./dist/index.js",
|
8
8
|
"types": "./dist/index.d.ts",
|
@@ -361,10 +361,10 @@
|
|
361
361
|
},
|
362
362
|
"devDependencies": {
|
363
363
|
"@faker-js/faker": "^9.3.0",
|
364
|
-
"@sveltejs/adapter-vercel": "^5.5.
|
365
|
-
"@sveltejs/kit": "^2.
|
364
|
+
"@sveltejs/adapter-vercel": "^5.5.2",
|
365
|
+
"@sveltejs/kit": "^2.12.1",
|
366
366
|
"@sveltejs/package": "^2.3.7",
|
367
|
-
"@sveltejs/vite-plugin-svelte": "^5.0.
|
367
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.2",
|
368
368
|
"@testing-library/jest-dom": "^6.6.3",
|
369
369
|
"@testing-library/svelte": "^5.2.6",
|
370
370
|
"@testing-library/user-event": "^14.5.2",
|
@@ -377,7 +377,7 @@
|
|
377
377
|
"publint": "^0.2.12",
|
378
378
|
"release-it": "^17.10.0",
|
379
379
|
"resize-observer-polyfill": "^1.5.1",
|
380
|
-
"svelte": "^5.
|
380
|
+
"svelte": "^5.14.1",
|
381
381
|
"svelte-check": "^4.1.1",
|
382
382
|
"tailwind-merge": "^2.5.5",
|
383
383
|
"tailwind-variants": "^0.3.0",
|