@ark-ui/svelte 5.3.0 → 5.3.2
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/dist/components/collection/use-list-selection.svelte.d.ts +0 -12
- package/dist/components/collection/use-list-selection.svelte.js +3 -14
- package/dist/components/portal/portal.svelte +15 -27
- package/dist/components/portal/portal.svelte.d.ts +1 -1
- package/dist/components/tour/tour.anatomy.d.ts +1 -1
- package/dist/components/tour/tour.d.ts +2 -1
- package/package.json +60 -59
- package/dist/components/portal/portal-consumer.svelte +0 -9
- package/dist/components/portal/portal-consumer.svelte.d.ts +0 -7
|
@@ -89,16 +89,4 @@ export interface UseListSelectionReturn {
|
|
|
89
89
|
* Returns true if at least one item from the collection is selected.
|
|
90
90
|
*/
|
|
91
91
|
isSomeSelected: () => boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Set the selection to a specific array of items.
|
|
94
|
-
*/
|
|
95
|
-
setSelection: (selection: string[]) => void;
|
|
96
|
-
/**
|
|
97
|
-
* Set the selection mode.
|
|
98
|
-
*/
|
|
99
|
-
setSelectionMode: (mode: SelectionMode) => void;
|
|
100
|
-
/**
|
|
101
|
-
* Set whether the selection is deselectable.
|
|
102
|
-
*/
|
|
103
|
-
setDeselectable: (deselectable: boolean) => void;
|
|
104
92
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Selection } from '@zag-js/collection';
|
|
2
2
|
import { runIfFn } from '@zag-js/utils';
|
|
3
|
+
import { untrack } from 'svelte';
|
|
3
4
|
export function useListSelection(props) {
|
|
4
5
|
const localProps = $derived.by(() => {
|
|
5
6
|
const { collection, selectionMode = 'single', deselectable = true, initialSelectedValues = [], resetOnCollectionChange = false, } = runIfFn(props);
|
|
@@ -17,7 +18,8 @@ export function useListSelection(props) {
|
|
|
17
18
|
selection.deselectable = localProps.deselectable;
|
|
18
19
|
return selection;
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
+
const initialSelectedValues = untrack(() => localProps.initialSelectedValues);
|
|
22
|
+
let selection = $state(createSelection(initialSelectedValues));
|
|
21
23
|
// Watch for collection changes and reset selection if needed
|
|
22
24
|
$effect(() => {
|
|
23
25
|
const { collection, resetOnCollectionChange } = localProps;
|
|
@@ -74,18 +76,5 @@ export function useListSelection(props) {
|
|
|
74
76
|
resetSelection: () => {
|
|
75
77
|
selection = createSelection();
|
|
76
78
|
},
|
|
77
|
-
setSelection: (newSelection) => {
|
|
78
|
-
selection = selection.setSelection(newSelection);
|
|
79
|
-
},
|
|
80
|
-
setSelectionMode: (mode) => {
|
|
81
|
-
const newSelection = selection.copy();
|
|
82
|
-
newSelection.selectionMode = mode;
|
|
83
|
-
selection = newSelection;
|
|
84
|
-
},
|
|
85
|
-
setDeselectable: (deselectable) => {
|
|
86
|
-
const newSelection = selection.copy();
|
|
87
|
-
newSelection.deselectable = deselectable;
|
|
88
|
-
selection = newSelection;
|
|
89
|
-
},
|
|
90
79
|
};
|
|
91
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import type
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type Snippet, getAllContexts, mount, tick, unmount } from 'svelte'
|
|
3
3
|
|
|
4
4
|
export interface PortalProps {
|
|
5
5
|
/**
|
|
@@ -15,42 +15,30 @@
|
|
|
15
15
|
*/
|
|
16
16
|
children: Snippet
|
|
17
17
|
}
|
|
18
|
-
</script>
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @see https://github.com/sveltejs/svelte/issues/7082
|
|
23
|
-
*/
|
|
24
|
-
import { getAllContexts, mount, unmount } from 'svelte'
|
|
25
|
-
import PortalConsumer from './portal-consumer.svelte'
|
|
26
|
-
|
|
27
|
-
const { container = globalThis?.document?.body, children, disabled = false }: PortalProps = $props()
|
|
19
|
+
let { children, container = globalThis.document?.body, disabled = false }: PortalProps = $props()
|
|
28
20
|
|
|
29
21
|
const context = getAllContexts()
|
|
30
22
|
|
|
31
|
-
let instance:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
let instance: any = null
|
|
24
|
+
$effect(() => {
|
|
25
|
+
const cleanup = () => {
|
|
26
|
+
if (instance) {
|
|
27
|
+
void unmount(instance)
|
|
28
|
+
instance = null
|
|
29
|
+
}
|
|
37
30
|
}
|
|
38
|
-
}
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
unmountInstance()
|
|
32
|
+
if (disabled) {
|
|
33
|
+
cleanup()
|
|
43
34
|
return
|
|
44
35
|
}
|
|
45
36
|
|
|
46
|
-
|
|
47
|
-
target: container,
|
|
48
|
-
props: { children },
|
|
49
|
-
context,
|
|
37
|
+
tick().then(() => {
|
|
38
|
+
instance = mount(children, { target: container, context })
|
|
50
39
|
})
|
|
51
|
-
|
|
52
40
|
return () => {
|
|
53
|
-
|
|
41
|
+
cleanup()
|
|
54
42
|
}
|
|
55
43
|
})
|
|
56
44
|
</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const tourAnatomy: import("@zag-js/anatomy").AnatomyInstance<"title" | "content" | "control" | "positioner" | "
|
|
1
|
+
export declare const tourAnatomy: import("@zag-js/anatomy").AnatomyInstance<"title" | "content" | "control" | "positioner" | "description" | "arrow" | "actionTrigger" | "closeTrigger" | "progressText" | "arrowTip" | "backdrop" | "spotlight">;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { WaitForOptions as WaitOptions } from '@zag-js/dom-query';
|
|
2
|
+
export type { Point, ProgressTextDetails, StatusChangeDetails, StepAction, StepActionMap, StepActionTriggerProps, StepBaseDetails, StepChangeDetails, StepDetails, StepEffectArgs, StepPlacement, StepStatus, StepType, } from '@zag-js/tour';
|
|
2
3
|
export { default as ActionTrigger, type TourActionTriggerBaseProps as ActionTriggerBaseProps, type TourActionTriggerProps as ActionTriggerProps, } from './tour-action-trigger.svelte';
|
|
3
4
|
export { default as Actions } from './tour-actions.svelte';
|
|
4
5
|
export { default as Arrow, type TourArrowBaseProps as ArrowBaseProps, type TourArrowProps as ArrowProps, } from './tour-arrow.svelte';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/svelte",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.3.
|
|
4
|
+
"version": "5.3.2",
|
|
5
5
|
"description": "A collection of unstyled, accessible UI components for Svelte",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"accordion",
|
|
@@ -120,64 +120,64 @@
|
|
|
120
120
|
"sideEffects": false,
|
|
121
121
|
"dependencies": {
|
|
122
122
|
"@internationalized/date": "3.8.2",
|
|
123
|
-
"@zag-js/accordion": "1.
|
|
124
|
-
"@zag-js/angle-slider": "1.
|
|
125
|
-
"@zag-js/anatomy": "1.
|
|
126
|
-
"@zag-js/auto-resize": "1.
|
|
127
|
-
"@zag-js/avatar": "1.
|
|
128
|
-
"@zag-js/carousel": "1.
|
|
129
|
-
"@zag-js/checkbox": "1.
|
|
130
|
-
"@zag-js/clipboard": "1.
|
|
131
|
-
"@zag-js/collapsible": "1.
|
|
132
|
-
"@zag-js/collection": "1.
|
|
133
|
-
"@zag-js/color-picker": "1.
|
|
134
|
-
"@zag-js/color-utils": "1.
|
|
135
|
-
"@zag-js/combobox": "1.
|
|
136
|
-
"@zag-js/core": "1.
|
|
137
|
-
"@zag-js/date-picker": "1.
|
|
138
|
-
"@zag-js/date-utils": "1.
|
|
139
|
-
"@zag-js/dialog": "1.
|
|
140
|
-
"@zag-js/dom-query": "1.
|
|
141
|
-
"@zag-js/editable": "1.
|
|
142
|
-
"@zag-js/file-upload": "1.
|
|
143
|
-
"@zag-js/file-utils": "1.
|
|
144
|
-
"@zag-js/focus-trap": "1.
|
|
145
|
-
"@zag-js/floating-panel": "1.
|
|
146
|
-
"@zag-js/highlight-word": "1.
|
|
147
|
-
"@zag-js/hover-card": "1.
|
|
148
|
-
"@zag-js/i18n-utils": "1.
|
|
149
|
-
"@zag-js/json-tree-utils": "1.
|
|
150
|
-
"@zag-js/listbox": "1.
|
|
151
|
-
"@zag-js/menu": "1.
|
|
152
|
-
"@zag-js/number-input": "1.
|
|
153
|
-
"@zag-js/pagination": "1.
|
|
154
|
-
"@zag-js/password-input": "1.
|
|
155
|
-
"@zag-js/pin-input": "1.
|
|
156
|
-
"@zag-js/popover": "1.
|
|
157
|
-
"@zag-js/presence": "1.
|
|
158
|
-
"@zag-js/progress": "1.
|
|
159
|
-
"@zag-js/qr-code": "1.
|
|
160
|
-
"@zag-js/radio-group": "1.
|
|
161
|
-
"@zag-js/rating-group": "1.
|
|
162
|
-
"@zag-js/svelte": "1.
|
|
163
|
-
"@zag-js/select": "1.
|
|
164
|
-
"@zag-js/signature-pad": "1.
|
|
165
|
-
"@zag-js/slider": "1.
|
|
166
|
-
"@zag-js/splitter": "1.
|
|
167
|
-
"@zag-js/steps": "1.
|
|
168
|
-
"@zag-js/switch": "1.
|
|
169
|
-
"@zag-js/tabs": "1.
|
|
170
|
-
"@zag-js/tags-input": "1.
|
|
171
|
-
"@zag-js/time-picker": "1.
|
|
172
|
-
"@zag-js/timer": "1.
|
|
173
|
-
"@zag-js/toast": "1.
|
|
174
|
-
"@zag-js/toggle": "1.
|
|
175
|
-
"@zag-js/toggle-group": "1.
|
|
176
|
-
"@zag-js/tooltip": "1.
|
|
177
|
-
"@zag-js/tour": "1.
|
|
178
|
-
"@zag-js/tree-view": "1.
|
|
179
|
-
"@zag-js/types": "1.
|
|
180
|
-
"@zag-js/utils": "1.
|
|
123
|
+
"@zag-js/accordion": "1.21.0",
|
|
124
|
+
"@zag-js/angle-slider": "1.21.0",
|
|
125
|
+
"@zag-js/anatomy": "1.21.0",
|
|
126
|
+
"@zag-js/auto-resize": "1.21.0",
|
|
127
|
+
"@zag-js/avatar": "1.21.0",
|
|
128
|
+
"@zag-js/carousel": "1.21.0",
|
|
129
|
+
"@zag-js/checkbox": "1.21.0",
|
|
130
|
+
"@zag-js/clipboard": "1.21.0",
|
|
131
|
+
"@zag-js/collapsible": "1.21.0",
|
|
132
|
+
"@zag-js/collection": "1.21.0",
|
|
133
|
+
"@zag-js/color-picker": "1.21.0",
|
|
134
|
+
"@zag-js/color-utils": "1.21.0",
|
|
135
|
+
"@zag-js/combobox": "1.21.0",
|
|
136
|
+
"@zag-js/core": "1.21.0",
|
|
137
|
+
"@zag-js/date-picker": "1.21.0",
|
|
138
|
+
"@zag-js/date-utils": "1.21.0",
|
|
139
|
+
"@zag-js/dialog": "1.21.0",
|
|
140
|
+
"@zag-js/dom-query": "1.21.0",
|
|
141
|
+
"@zag-js/editable": "1.21.0",
|
|
142
|
+
"@zag-js/file-upload": "1.21.0",
|
|
143
|
+
"@zag-js/file-utils": "1.21.0",
|
|
144
|
+
"@zag-js/focus-trap": "1.21.0",
|
|
145
|
+
"@zag-js/floating-panel": "1.21.0",
|
|
146
|
+
"@zag-js/highlight-word": "1.21.0",
|
|
147
|
+
"@zag-js/hover-card": "1.21.0",
|
|
148
|
+
"@zag-js/i18n-utils": "1.21.0",
|
|
149
|
+
"@zag-js/json-tree-utils": "1.21.0",
|
|
150
|
+
"@zag-js/listbox": "1.21.0",
|
|
151
|
+
"@zag-js/menu": "1.21.0",
|
|
152
|
+
"@zag-js/number-input": "1.21.0",
|
|
153
|
+
"@zag-js/pagination": "1.21.0",
|
|
154
|
+
"@zag-js/password-input": "1.21.0",
|
|
155
|
+
"@zag-js/pin-input": "1.21.0",
|
|
156
|
+
"@zag-js/popover": "1.21.0",
|
|
157
|
+
"@zag-js/presence": "1.21.0",
|
|
158
|
+
"@zag-js/progress": "1.21.0",
|
|
159
|
+
"@zag-js/qr-code": "1.21.0",
|
|
160
|
+
"@zag-js/radio-group": "1.21.0",
|
|
161
|
+
"@zag-js/rating-group": "1.21.0",
|
|
162
|
+
"@zag-js/svelte": "1.21.0",
|
|
163
|
+
"@zag-js/select": "1.21.0",
|
|
164
|
+
"@zag-js/signature-pad": "1.21.0",
|
|
165
|
+
"@zag-js/slider": "1.21.0",
|
|
166
|
+
"@zag-js/splitter": "1.21.0",
|
|
167
|
+
"@zag-js/steps": "1.21.0",
|
|
168
|
+
"@zag-js/switch": "1.21.0",
|
|
169
|
+
"@zag-js/tabs": "1.21.0",
|
|
170
|
+
"@zag-js/tags-input": "1.21.0",
|
|
171
|
+
"@zag-js/time-picker": "1.21.0",
|
|
172
|
+
"@zag-js/timer": "1.21.0",
|
|
173
|
+
"@zag-js/toast": "1.21.0",
|
|
174
|
+
"@zag-js/toggle": "1.21.0",
|
|
175
|
+
"@zag-js/toggle-group": "1.21.0",
|
|
176
|
+
"@zag-js/tooltip": "1.21.0",
|
|
177
|
+
"@zag-js/tour": "1.21.0",
|
|
178
|
+
"@zag-js/tree-view": "1.21.0",
|
|
179
|
+
"@zag-js/types": "1.21.0",
|
|
180
|
+
"@zag-js/utils": "1.21.0"
|
|
181
181
|
},
|
|
182
182
|
"devDependencies": {
|
|
183
183
|
"@storybook/addon-a11y": "9.0.18",
|
|
@@ -192,6 +192,7 @@
|
|
|
192
192
|
"@testing-library/user-event": "14.6.1",
|
|
193
193
|
"@vitest/coverage-v8": "3.2.4",
|
|
194
194
|
"clean-package": "2.2.0",
|
|
195
|
+
"image-conversion": "2.1.1",
|
|
195
196
|
"lucide-svelte": "0.525.0",
|
|
196
197
|
"storybook": "9.0.18",
|
|
197
198
|
"svelte": "5.36.13",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
children: Snippet;
|
|
4
|
-
};
|
|
5
|
-
declare const PortalConsumer: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
-
type PortalConsumer = ReturnType<typeof PortalConsumer>;
|
|
7
|
-
export default PortalConsumer;
|