ui-ingredients 0.0.64 → 0.0.65
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/collapsible/collapsible-root.svelte +1 -1
- package/dist/collapsible/create-collapsible.svelte.d.ts +2 -2
- package/dist/collapsible/create-collapsible.svelte.js +3 -4
- package/dist/color-picker/color-picker-root.svelte +1 -1
- package/dist/color-picker/create-color-picker.svelte.d.ts +2 -2
- package/dist/color-picker/create-color-picker.svelte.js +3 -4
- package/dist/combobox/combobox-root.svelte +1 -1
- package/dist/combobox/create-combobox.svelte.d.ts +2 -2
- package/dist/combobox/create-combobox.svelte.js +4 -4
- package/dist/date-picker/create-date-picker.svelte.d.ts +2 -2
- package/dist/date-picker/create-date-picker.svelte.js +4 -5
- package/dist/date-picker/date-picker-root.svelte +1 -1
- package/dist/dialog/create-dialog.svelte.d.ts +2 -2
- package/dist/dialog/create-dialog.svelte.js +3 -4
- package/dist/editable/create-editable.svelte.d.ts +2 -2
- package/dist/editable/create-editable.svelte.js +3 -4
- package/dist/editable/editable-root.svelte +1 -1
- package/dist/hover-card/create-hover-card.svelte.d.ts +2 -2
- package/dist/hover-card/create-hover-card.svelte.js +3 -4
- package/dist/hover-card/hover-card-root.svelte +1 -1
- package/dist/menu/create-menu.svelte.d.ts +2 -2
- package/dist/menu/create-menu.svelte.js +3 -4
- package/dist/menu/menu-root.svelte +12 -12
- package/dist/popover/create-popover.svelte.d.ts +2 -2
- package/dist/popover/create-popover.svelte.js +3 -4
- package/dist/popover/popover-root.svelte +11 -11
- package/dist/select/create-select.svelte.d.ts +2 -2
- package/dist/select/create-select.svelte.js +3 -4
- package/dist/select/select-root.svelte +1 -1
- package/dist/time-picker/create-time-picker.svelte.d.ts +2 -2
- package/dist/time-picker/create-time-picker.svelte.js +4 -5
- package/dist/time-picker/time-picker-root.svelte +1 -1
- package/dist/tooltip/create-tooltip.svelte.d.ts +2 -2
- package/dist/tooltip/create-tooltip.svelte.js +3 -4
- package/package.json +1 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as collapsible from '@zag-js/collapsible';
|
2
2
|
export interface CreateCollapsibleProps extends Omit<collapsible.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateCollapsibleReturn extends collapsible.Api {
|
7
7
|
}
|
@@ -8,12 +8,11 @@ export function createCollapsible(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
13
|
+
...props,
|
15
14
|
getRootNode: environment?.getRootNode,
|
16
|
-
'open.controlled': props.
|
15
|
+
'open.controlled': props.openControlled,
|
17
16
|
}));
|
18
17
|
const [state, send] = useMachine(collapsible.machine(context), { context });
|
19
18
|
return reflect(() => collapsible.connect(state, send, normalizeProps));
|
@@ -2,9 +2,9 @@ import type { GenericObject } from '../types.js';
|
|
2
2
|
import * as colorPicker from '@zag-js/color-picker';
|
3
3
|
type Omitted = 'id' | 'dir' | 'value' | 'getRootNode' | 'open.controlled';
|
4
4
|
export interface CreateColorPickerProps extends Omit<colorPicker.Context, Omitted> {
|
5
|
-
id?: string
|
5
|
+
id?: string;
|
6
6
|
value?: string;
|
7
|
-
|
7
|
+
openControlled?: boolean;
|
8
8
|
}
|
9
9
|
export interface CreateColorPickerReturn extends colorPicker.Api {
|
10
10
|
getViewProps(props: {
|
@@ -9,13 +9,12 @@ export function createColorPicker(props) {
|
|
9
9
|
const environment = getEnvironmentContext();
|
10
10
|
const id = uid();
|
11
11
|
const context = $derived.by(() => ({
|
12
|
-
|
13
|
-
id: props.id ?? id,
|
12
|
+
id,
|
14
13
|
dir: locale?.dir,
|
15
|
-
|
14
|
+
...props,
|
16
15
|
value: props.value ? colorPicker.parse(props.value) : undefined,
|
17
16
|
getRootNode: environment?.getRootNode,
|
18
|
-
'open.controlled': props.
|
17
|
+
'open.controlled': props.openControlled,
|
19
18
|
}));
|
20
19
|
const [state, send] = useMachine(colorPicker.machine(context), { context });
|
21
20
|
return reflect(() => {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as combobox from '@zag-js/combobox';
|
2
2
|
type Omitted = 'id' | 'dir' | 'collection' | 'getRootNode' | 'open.controlled';
|
3
3
|
export interface CreateComboboxProps<T> extends combobox.CollectionOptions<T>, Omit<combobox.Context, Omitted> {
|
4
|
-
id?: string
|
5
|
-
|
4
|
+
id?: string;
|
5
|
+
openControlled?: boolean;
|
6
6
|
}
|
7
7
|
export interface CreateComboboxReturn extends combobox.Api {
|
8
8
|
}
|
@@ -18,22 +18,22 @@ export function createCombobox(props) {
|
|
18
18
|
const environment = getEnvironmentContext();
|
19
19
|
const id = uid();
|
20
20
|
const context = reflect(() => ({
|
21
|
+
id,
|
21
22
|
ids: {
|
22
23
|
label: field?.ids.label,
|
23
24
|
input: field?.ids.control,
|
24
25
|
},
|
26
|
+
dir: locale?.dir,
|
25
27
|
invalid: field?.invalid,
|
26
28
|
disabled: field?.disabled,
|
27
29
|
readOnly: field?.readOnly,
|
28
30
|
required: field?.required,
|
29
31
|
...comboboxProps,
|
30
|
-
id: props.id ?? id,
|
31
|
-
dir: locale?.dir,
|
32
|
-
open: props.defaultOpen ?? props.open,
|
33
|
-
'open.controlled': props.open != null,
|
34
32
|
getRootNode: environment?.getRootNode,
|
33
|
+
'open.controlled': props.openControlled,
|
35
34
|
collection,
|
36
35
|
}));
|
36
|
+
/* FIXME: pass controlled context */
|
37
37
|
const [state, send] = useMachine(combobox.machine(context));
|
38
38
|
return reflect(() => {
|
39
39
|
const o = combobox.connect(state, send, normalizeProps);
|
@@ -2,12 +2,12 @@ import type { GenericObject } from '../types.js';
|
|
2
2
|
import * as datePicker from '@zag-js/date-picker';
|
3
3
|
type Omitted = 'id' | 'dir' | 'min' | 'max' | 'value' | 'focusedValue' | 'getRootNode' | 'open.controlled';
|
4
4
|
export interface CreateDatePickerProps extends Omit<datePicker.Context, Omitted> {
|
5
|
-
id?: string
|
5
|
+
id?: string;
|
6
6
|
min?: string | Date;
|
7
7
|
max?: string | Date;
|
8
8
|
value?: string[] | Date[];
|
9
9
|
focusedValue?: string | Date;
|
10
|
-
|
10
|
+
openControlled?: boolean;
|
11
11
|
}
|
12
12
|
export interface CreateDatePickerReturn extends datePicker.Api {
|
13
13
|
getViewProps(props: datePicker.ViewProps): GenericObject;
|
@@ -10,19 +10,18 @@ export function createDatePicker(props) {
|
|
10
10
|
const id = uid();
|
11
11
|
/* FIXME: use reflect */
|
12
12
|
const context = $derived.by(() => ({
|
13
|
-
|
14
|
-
id: props.id ?? id,
|
13
|
+
id,
|
15
14
|
dir: locale?.dir,
|
15
|
+
locale: locale?.locale,
|
16
|
+
...props,
|
16
17
|
min: props.min ? datePicker.parse(props.min) : undefined,
|
17
18
|
max: props.max ? datePicker.parse(props.max) : undefined,
|
18
19
|
value: props.value ? datePicker.parse(props.value) : undefined,
|
19
20
|
focusedValue: props.focusedValue
|
20
21
|
? datePicker.parse(props.focusedValue)
|
21
22
|
: undefined,
|
22
|
-
open: props.defaultOpen ?? props.open,
|
23
|
-
'open.controlled': props.open != null,
|
24
|
-
locale: props.locale ?? locale?.locale,
|
25
23
|
getRootNode: environment?.getRootNode,
|
24
|
+
'open.controlled': props.openControlled,
|
26
25
|
}));
|
27
26
|
const [state, send] = useMachine(datePicker.machine(context), { context });
|
28
27
|
return reflect(() => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as dialog from '@zag-js/dialog';
|
2
2
|
export interface CreateDialogProps extends Omit<dialog.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateDialogReturn extends dialog.Api {
|
7
7
|
}
|
@@ -8,12 +8,11 @@ export function createDialog(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
13
|
+
...props,
|
15
14
|
getRootNode: environment?.getRootNode,
|
16
|
-
'open.controlled': props.
|
15
|
+
'open.controlled': props.openControlled,
|
17
16
|
}));
|
18
17
|
const [state, send] = useMachine(dialog.machine(context), { context });
|
19
18
|
return reflect(() => dialog.connect(state, send, normalizeProps));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as editable from '@zag-js/editable';
|
2
2
|
export interface CreateEditableProps extends Omit<editable.Context, 'id' | 'dir' | 'getRootNode' | 'edit.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
editControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateEditableReturn extends editable.Api {
|
7
7
|
}
|
@@ -10,20 +10,19 @@ export function createEditable(props) {
|
|
10
10
|
const environment = getEnvironmentContext();
|
11
11
|
const id = uid();
|
12
12
|
const context = reflect(() => ({
|
13
|
+
id,
|
13
14
|
ids: {
|
14
15
|
label: field?.ids.label,
|
15
16
|
input: field?.ids.control,
|
16
17
|
},
|
18
|
+
dir: locale?.dir,
|
17
19
|
invalid: field?.invalid,
|
18
20
|
disabled: field?.disabled,
|
19
21
|
readOnly: field?.readOnly,
|
20
22
|
required: field?.required,
|
21
23
|
...props,
|
22
|
-
id: props.id ?? id,
|
23
|
-
dir: locale?.dir,
|
24
|
-
edit: props.defaultEdit ?? props.edit,
|
25
24
|
getRootNode: environment?.getRootNode,
|
26
|
-
'edit.controlled': props.
|
25
|
+
'edit.controlled': props.editControlled,
|
27
26
|
}));
|
28
27
|
const [state, send] = useMachine(editable.machine(context), { context });
|
29
28
|
return reflect(() => {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as hoverCard from '@zag-js/hover-card';
|
2
2
|
export interface CreateHoverCardProps extends Omit<hoverCard.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateHoverCardReturn extends hoverCard.Api {
|
7
7
|
}
|
@@ -8,12 +8,11 @@ export function createHoverCard(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
13
|
+
...props,
|
15
14
|
getRootNode: environment?.getRootNode,
|
16
|
-
'open.controlled': props.
|
15
|
+
'open.controlled': props.openControlled,
|
17
16
|
}));
|
18
17
|
const [state, send] = useMachine(hoverCard.machine(context), { context });
|
19
18
|
return reflect(() => hoverCard.connect(state, send, normalizeProps));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as menu from '@zag-js/menu';
|
2
2
|
export interface CreateMenuProps extends Omit<menu.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateMenuReturn extends menu.Api {
|
7
7
|
machine: menu.Service;
|
@@ -8,12 +8,11 @@ export function createMenu(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
13
|
+
...props,
|
15
14
|
getRootNode: environment?.getRootNode,
|
16
|
-
'open.controlled': props.
|
15
|
+
'open.controlled': props.openControlled,
|
17
16
|
}));
|
18
17
|
const [state, send, machine] = useMachine(menu.machine(context), { context });
|
19
18
|
return reflect(() => ({
|
@@ -29,25 +29,25 @@
|
|
29
29
|
|
30
30
|
let [createMenuProps, presenceStrategyProps] = $derived(
|
31
31
|
createSplitProps<CreateMenuProps>([
|
32
|
-
'anchorPoint',
|
33
|
-
'aria-label',
|
34
|
-
'closeOnSelect',
|
35
|
-
'composite',
|
36
|
-
'defaultOpen',
|
37
|
-
'highlightedValue',
|
38
32
|
'id',
|
39
33
|
'ids',
|
34
|
+
'open',
|
35
|
+
'openControlled',
|
40
36
|
'loopFocus',
|
41
|
-
'
|
37
|
+
'composite',
|
38
|
+
'typeahead',
|
39
|
+
'positioning',
|
40
|
+
'anchorPoint',
|
41
|
+
'closeOnSelect',
|
42
|
+
'highlightedValue',
|
43
|
+
'aria-label',
|
44
|
+
'onSelect',
|
45
|
+
'onOpenChange',
|
42
46
|
'onFocusOutside',
|
47
|
+
'onEscapeKeyDown',
|
43
48
|
'onHighlightChange',
|
44
49
|
'onInteractOutside',
|
45
|
-
'onOpenChange',
|
46
50
|
'onPointerDownOutside',
|
47
|
-
'onSelect',
|
48
|
-
'open',
|
49
|
-
'positioning',
|
50
|
-
'typeahead',
|
51
51
|
])(props),
|
52
52
|
);
|
53
53
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as popover from '@zag-js/popover';
|
2
2
|
export interface CreatePopoverProps extends Omit<popover.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreatePopoverReturn extends popover.Api {
|
7
7
|
}
|
@@ -8,12 +8,11 @@ export function createPopover(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
13
|
+
...props,
|
15
14
|
getRootNode: environment?.getRootNode,
|
16
|
-
'open.controlled': props.
|
15
|
+
'open.controlled': props.openControlled,
|
17
16
|
}));
|
18
17
|
const [state, send] = useMachine(popover.machine(context), { context });
|
19
18
|
return reflect(() => popover.connect(state, send, normalizeProps));
|
@@ -25,23 +25,23 @@
|
|
25
25
|
|
26
26
|
let [createPopoverProps, presenceStrategyProps] = $derived(
|
27
27
|
createSplitProps<CreatePopoverProps>([
|
28
|
-
'autoFocus',
|
29
|
-
'closeOnEscape',
|
30
|
-
'closeOnInteractOutside',
|
31
|
-
'defaultOpen',
|
32
28
|
'id',
|
33
29
|
'ids',
|
34
|
-
'
|
30
|
+
'open',
|
31
|
+
'openControlled',
|
35
32
|
'modal',
|
36
|
-
'
|
33
|
+
'autoFocus',
|
34
|
+
'portalled',
|
35
|
+
'positioning',
|
36
|
+
'closeOnEscape',
|
37
|
+
'initialFocusEl',
|
38
|
+
'persistentElements',
|
39
|
+
'closeOnInteractOutside',
|
40
|
+
'onOpenChange',
|
37
41
|
'onFocusOutside',
|
42
|
+
'onEscapeKeyDown',
|
38
43
|
'onInteractOutside',
|
39
|
-
'onOpenChange',
|
40
44
|
'onPointerDownOutside',
|
41
|
-
'open',
|
42
|
-
'persistentElements',
|
43
|
-
'portalled',
|
44
|
-
'positioning',
|
45
45
|
])(props),
|
46
46
|
);
|
47
47
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as select from '@zag-js/select';
|
2
2
|
type Omitted = 'id' | 'dir' | 'getRootNode' | 'collection' | 'open.controlled';
|
3
3
|
export interface CreateSelectProps<T> extends select.CollectionOptions<T>, Omit<select.Context, Omitted> {
|
4
|
-
id?: string
|
5
|
-
|
4
|
+
id?: string;
|
5
|
+
openControlled?: boolean;
|
6
6
|
}
|
7
7
|
export interface CreateSelectReturn extends select.Api {
|
8
8
|
}
|
@@ -18,20 +18,19 @@ export function createSelect(props) {
|
|
18
18
|
const environment = getEnvironmentContext();
|
19
19
|
const id = uid();
|
20
20
|
const context = reflect(() => ({
|
21
|
+
id,
|
21
22
|
ids: {
|
22
23
|
label: field?.ids.label,
|
23
24
|
hiddenSelect: field?.ids.control,
|
24
25
|
},
|
26
|
+
dir: locale?.dir,
|
25
27
|
invalid: field?.invalid,
|
26
28
|
disabled: field?.disabled,
|
27
29
|
readOnly: field?.readOnly,
|
28
30
|
required: field?.required,
|
29
31
|
...selectProps,
|
30
|
-
id: props.id ?? id,
|
31
|
-
dir: locale?.dir,
|
32
|
-
open: props.defaultOpen ?? props.open,
|
33
|
-
'open.controlled': props.open != null,
|
34
32
|
getRootNode: environment?.getRootNode,
|
33
|
+
'open.controlled': props.openControlled,
|
35
34
|
collection,
|
36
35
|
}));
|
37
36
|
const [state, send] = useMachine(select.machine(context), { context });
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as timePicker from '@zag-js/time-picker';
|
2
2
|
export interface CreateTimePickerProps extends Omit<timePicker.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateTimePickerReturn extends timePicker.Api {
|
7
7
|
}
|
@@ -8,13 +8,12 @@ export function createTimePicker(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
15
|
-
|
13
|
+
locale: locale?.locale,
|
14
|
+
...props,
|
16
15
|
getRootNode: environment?.getRootNode,
|
17
|
-
'open.controlled': props.
|
16
|
+
'open.controlled': props.openControlled,
|
18
17
|
}));
|
19
18
|
const [state, send] = useMachine(timePicker.machine(context), { context });
|
20
19
|
return reflect(() => timePicker.connect(state, send, normalizeProps));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as tooltip from '@zag-js/tooltip';
|
2
2
|
export interface CreateTooltipProps extends Omit<tooltip.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
-
id?: string
|
4
|
-
|
3
|
+
id?: string;
|
4
|
+
openControlled?: boolean;
|
5
5
|
}
|
6
6
|
export interface CreateTooltipReturn extends tooltip.Api {
|
7
7
|
}
|
@@ -8,12 +8,11 @@ export function createTooltip(props) {
|
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const id = uid();
|
10
10
|
const context = reflect(() => ({
|
11
|
-
|
12
|
-
id: props.id ?? id,
|
11
|
+
id,
|
13
12
|
dir: locale?.dir,
|
14
|
-
|
13
|
+
...props,
|
15
14
|
getRootNode: environment?.getRootNode,
|
16
|
-
'open.controlled': props.
|
15
|
+
'open.controlled': props.openControlled,
|
17
16
|
}));
|
18
17
|
const [state, send] = useMachine(tooltip.machine(context), { context });
|
19
18
|
return reflect(() => tooltip.connect(state, send, normalizeProps));
|