@cerberus-design/react 0.25.1 → 0.25.2-rc.1
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/accordion/primitives.cjs +2 -2
- package/dist/components/accordion/primitives.js +2 -2
- package/dist/components/admonition/primitives.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/primitives.js +1 -1
- package/dist/components/carousel/parts.js +1 -1
- package/dist/components/carousel/primitives.cjs +3 -3
- package/dist/components/carousel/primitives.js +3 -3
- package/dist/components/circular-progress/primitives.cjs +4 -4
- package/dist/components/circular-progress/primitives.js +5 -5
- package/dist/components/clipboard/primitives.cjs +4 -4
- package/dist/components/clipboard/primitives.js +4 -4
- package/dist/components/collapsible/index.cjs +1 -0
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/collapsible/parts.cjs +1 -0
- package/dist/components/collapsible/parts.d.cts +4 -0
- package/dist/components/collapsible/parts.d.ts +4 -0
- package/dist/components/collapsible/parts.js +2 -1
- package/dist/components/collapsible/primitives.cjs +3 -0
- package/dist/components/collapsible/primitives.d.cts +6 -1
- package/dist/components/collapsible/primitives.d.ts +6 -1
- package/dist/components/collapsible/primitives.js +3 -1
- package/dist/components/combobox/combobox.cjs +1 -2
- package/dist/components/combobox/combobox.d.cts +0 -5
- package/dist/components/combobox/combobox.d.ts +0 -5
- package/dist/components/combobox/combobox.js +1 -2
- package/dist/components/combobox/primitives.cjs +7 -7
- package/dist/components/combobox/primitives.js +7 -7
- package/dist/components/date-picker/calendar.cjs +1 -1
- package/dist/components/date-picker/calendar.d.cts +0 -5
- package/dist/components/date-picker/calendar.d.ts +0 -5
- package/dist/components/date-picker/calendar.js +1 -1
- package/dist/components/date-picker/index.cjs +4 -4
- package/dist/components/date-picker/index.js +2 -2
- package/dist/components/date-picker/primitives.cjs +7 -7
- package/dist/components/date-picker/primitives.js +7 -7
- package/dist/components/deprecated/Legend.js +1 -1
- package/dist/components/deprecated/NavMenuLink.js +1 -1
- package/dist/components/dialog/primitives.cjs +2 -2
- package/dist/components/dialog/primitives.js +2 -2
- package/dist/components/field/primitives.cjs +2 -2
- package/dist/components/field/primitives.js +2 -2
- package/dist/components/file-upload/file-status.js +1 -1
- package/dist/components/file-upload/file-uploader.cjs +1 -1
- package/dist/components/file-upload/file-uploader.js +1 -1
- package/dist/components/file-upload/index.cjs +1 -0
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/file-upload/parts.cjs +1 -0
- package/dist/components/file-upload/parts.d.cts +4 -0
- package/dist/components/file-upload/parts.d.ts +4 -0
- package/dist/components/file-upload/parts.js +2 -1
- package/dist/components/file-upload/primitives.cjs +11 -9
- package/dist/components/file-upload/primitives.d.cts +2 -0
- package/dist/components/file-upload/primitives.d.ts +2 -0
- package/dist/components/file-upload/primitives.js +11 -10
- package/dist/components/file-upload/utils.cjs +1 -1
- package/dist/components/file-upload/utils.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/notifications/index.cjs +4 -4
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/number-input/primitives.cjs +3 -3
- package/dist/components/number-input/primitives.js +3 -3
- package/dist/components/pin-input/primitives.cjs +1 -1
- package/dist/components/pin-input/primitives.js +1 -1
- package/dist/components/progress/primitives.js +1 -1
- package/dist/components/radio/primitives.cjs +3 -3
- package/dist/components/radio/primitives.js +3 -3
- package/dist/components/rating/primitives.cjs +2 -2
- package/dist/components/rating/primitives.js +2 -2
- package/dist/components/select/primitives.cjs +8 -8
- package/dist/components/select/primitives.js +8 -8
- package/dist/components/select/select.d.cts +0 -5
- package/dist/components/select/select.d.ts +0 -5
- package/dist/components/switch/primitives.cjs +2 -2
- package/dist/components/switch/primitives.js +2 -2
- package/dist/components/table/primitives.js +1 -1
- package/dist/components/tabs/parts.js +1 -1
- package/dist/components/tabs/primitives.cjs +2 -2
- package/dist/components/tabs/primitives.js +2 -2
- package/dist/components/tooltip/primitives.cjs +4 -4
- package/dist/components/tooltip/primitives.js +4 -4
- package/dist/context/cerberus.js +1 -1
- package/dist/context/confirm-modal.js +1 -1
- package/dist/context/feature-flags.js +1 -1
- package/dist/context/navMenu.js +1 -1
- package/dist/context/prompt-modal.js +1 -1
- package/dist/context/theme.js +1 -1
- package/dist/index.cjs +266 -256
- package/dist/index.client.d.cts +1 -1
- package/dist/index.client.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root-provider.cjs +21 -0
- package/dist/node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root-provider.js +17 -0
- package/dist/node_modules/.pnpm/{@floating-ui_core@1.7.3 → @floating-ui_core@1.7.4}/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +79 -73
- package/dist/node_modules/.pnpm/{@floating-ui_core@1.7.3 → @floating-ui_core@1.7.4}/node_modules/@floating-ui/core/dist/floating-ui.core.js +80 -74
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +1 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +2 -2
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.0/node_modules/@internationalized/date/src/queries.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_accordion@1.31.1/node_modules/@zag-js/accordion/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_avatar@1.31.1/node_modules/@zag-js/avatar/dist/index.cjs +5 -5
- package/dist/node_modules/.pnpm/@zag-js_carousel@1.31.1/node_modules/@zag-js/carousel/dist/index.cjs +16 -16
- package/dist/node_modules/.pnpm/@zag-js_carousel@1.31.1/node_modules/@zag-js/carousel/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_clipboard@1.31.1/node_modules/@zag-js/clipboard/dist/index.cjs +4 -4
- package/dist/node_modules/.pnpm/@zag-js_clipboard@1.31.1/node_modules/@zag-js/clipboard/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_collapsible@1.31.1/node_modules/@zag-js/collapsible/dist/index.cjs +11 -11
- package/dist/node_modules/.pnpm/@zag-js_collapsible@1.31.1/node_modules/@zag-js/collapsible/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_combobox@1.31.1/node_modules/@zag-js/combobox/dist/index.cjs +84 -84
- package/dist/node_modules/.pnpm/@zag-js_combobox@1.31.1/node_modules/@zag-js/combobox/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_date-picker@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-picker/dist/index.cjs +154 -154
- package/dist/node_modules/.pnpm/@zag-js_date-picker@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-picker/dist/index.js +4 -4
- package/dist/node_modules/.pnpm/@zag-js_date-utils@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-utils/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/@zag-js_date-utils@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-utils/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_dialog@1.31.1/node_modules/@zag-js/dialog/dist/index.cjs +14 -14
- package/dist/node_modules/.pnpm/@zag-js_file-upload@1.31.1/node_modules/@zag-js/file-upload/dist/index.cjs +47 -47
- package/dist/node_modules/.pnpm/@zag-js_file-upload@1.31.1/node_modules/@zag-js/file-upload/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@zag-js_number-input@1.31.1/node_modules/@zag-js/number-input/dist/index.cjs +53 -53
- package/dist/node_modules/.pnpm/@zag-js_number-input@1.31.1/node_modules/@zag-js/number-input/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@zag-js_pin-input@1.31.1/node_modules/@zag-js/pin-input/dist/index.cjs +44 -44
- package/dist/node_modules/.pnpm/@zag-js_pin-input@1.31.1/node_modules/@zag-js/pin-input/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_progress@1.31.1/node_modules/@zag-js/progress/dist/index.cjs +6 -6
- package/dist/node_modules/.pnpm/@zag-js_rating-group@1.31.1/node_modules/@zag-js/rating-group/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_react@1.31.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@zag-js/react/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_remove-scroll@1.31.1/node_modules/@zag-js/remove-scroll/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_select@1.31.1/node_modules/@zag-js/select/dist/index.cjs +5 -5
- package/dist/node_modules/.pnpm/@zag-js_tabs@1.31.1/node_modules/@zag-js/tabs/dist/index.cjs +37 -37
- package/dist/node_modules/.pnpm/@zag-js_tabs@1.31.1/node_modules/@zag-js/tabs/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_toast@1.31.1/node_modules/@zag-js/toast/dist/index.cjs +33 -33
- package/dist/node_modules/.pnpm/@zag-js_toast@1.31.1/node_modules/@zag-js/toast/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_tooltip@1.31.1/node_modules/@zag-js/tooltip/dist/index.cjs +9 -9
- package/dist/node_modules/.pnpm/@zag-js_tooltip@1.31.1/node_modules/@zag-js/tooltip/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/components/collapsible/parts.ts +6 -0
- package/src/components/collapsible/primitives.tsx +6 -0
- package/src/components/combobox/combobox.tsx +0 -6
- package/src/components/date-picker/calendar.tsx +1 -6
- package/src/components/file-upload/file-uploader.tsx +2 -2
- package/src/components/file-upload/parts.tsx +6 -0
- package/src/components/file-upload/primitives.ts +5 -0
- package/src/components/file-upload/utils.ts +1 -1
- package/src/components/select/select.tsx +0 -5
- package/src/index.client.ts +2 -0
package/dist/node_modules/.pnpm/@zag-js_combobox@1.31.1/node_modules/@zag-js/combobox/dist/index.cjs
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const index$
|
|
6
|
-
const index$
|
|
7
|
-
const index$
|
|
8
|
-
const index$
|
|
9
|
-
const index
|
|
10
|
-
const index = require('../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.cjs');
|
|
11
|
-
const index$
|
|
5
|
+
const index$6 = require('../../../../../@zag-js_anatomy@1.31.1/node_modules/@zag-js/anatomy/dist/index.cjs');
|
|
6
|
+
const index$5 = require('../../../../../@zag-js_collection@1.31.1/node_modules/@zag-js/collection/dist/index.cjs');
|
|
7
|
+
const index$1 = require('../../../../../@zag-js_dom-query@1.31.1/node_modules/@zag-js/dom-query/dist/index.cjs');
|
|
8
|
+
const index$2 = require('../../../../../@zag-js_popper@1.31.1/node_modules/@zag-js/popper/dist/index.cjs');
|
|
9
|
+
const index = require('../../../../../@zag-js_utils@1.31.1/node_modules/@zag-js/utils/dist/index.cjs');
|
|
10
|
+
const index$4 = require('../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.cjs');
|
|
11
|
+
const index$3 = require('../../../../../@zag-js_dismissable@1.31.1/node_modules/@zag-js/dismissable/dist/index.cjs');
|
|
12
12
|
const index$7 = require('../../../../../@zag-js_types@1.31.1/node_modules/@zag-js/types/dist/index.cjs');
|
|
13
13
|
|
|
14
14
|
// src/combobox.anatomy.ts
|
|
15
|
-
var anatomy = index$
|
|
15
|
+
var anatomy = index$6.createAnatomy("combobox").parts(
|
|
16
16
|
"root",
|
|
17
17
|
"clearTrigger",
|
|
18
18
|
"content",
|
|
@@ -30,10 +30,10 @@ var anatomy = index$5.createAnatomy("combobox").parts(
|
|
|
30
30
|
);
|
|
31
31
|
var parts = anatomy.build();
|
|
32
32
|
var collection = (options) => {
|
|
33
|
-
return new index$
|
|
33
|
+
return new index$5.ListCollection(options);
|
|
34
34
|
};
|
|
35
35
|
collection.empty = () => {
|
|
36
|
-
return new index$
|
|
36
|
+
return new index$5.ListCollection({ items: [] });
|
|
37
37
|
};
|
|
38
38
|
var getRootId = (ctx) => ctx.ids?.root ?? `combobox:${ctx.id}`;
|
|
39
39
|
var getLabelId = (ctx) => ctx.ids?.label ?? `combobox:${ctx.id}:label`;
|
|
@@ -55,7 +55,7 @@ var getClearTriggerEl = (ctx) => ctx.getById(getClearTriggerId(ctx));
|
|
|
55
55
|
var getItemEl = (ctx, value) => {
|
|
56
56
|
if (value == null) return null;
|
|
57
57
|
const selector = `[role=option][data-value="${CSS.escape(value)}"]`;
|
|
58
|
-
return index$
|
|
58
|
+
return index$1.query(getContentEl(ctx), selector);
|
|
59
59
|
};
|
|
60
60
|
var focusInputEl = (ctx) => {
|
|
61
61
|
const inputEl = getInputEl(ctx);
|
|
@@ -82,14 +82,14 @@ function connect(service, normalize) {
|
|
|
82
82
|
const focused = state.hasTag("focused");
|
|
83
83
|
const composite = prop("composite");
|
|
84
84
|
const highlightedValue = context.get("highlightedValue");
|
|
85
|
-
const popperStyles = index$
|
|
85
|
+
const popperStyles = index$2.getPlacementStyles({
|
|
86
86
|
...prop("positioning"),
|
|
87
87
|
placement: context.get("currentPlacement")
|
|
88
88
|
});
|
|
89
89
|
function getItemState(props2) {
|
|
90
90
|
const disabled2 = collection2.getItemDisabled(props2.item);
|
|
91
91
|
const value = collection2.getItemValue(props2.item);
|
|
92
|
-
index
|
|
92
|
+
index.ensure(value, () => `[zag-js] No value found for item ${JSON.stringify(props2.item)}`);
|
|
93
93
|
return {
|
|
94
94
|
value,
|
|
95
95
|
disabled: Boolean(disabled2 || disabled2),
|
|
@@ -151,8 +151,8 @@ function connect(service, normalize) {
|
|
|
151
151
|
...parts.root.attrs,
|
|
152
152
|
dir: prop("dir"),
|
|
153
153
|
id: getRootId(scope),
|
|
154
|
-
"data-invalid": index$
|
|
155
|
-
"data-readonly": index$
|
|
154
|
+
"data-invalid": index$1.dataAttr(invalid),
|
|
155
|
+
"data-readonly": index$1.dataAttr(readOnly)
|
|
156
156
|
});
|
|
157
157
|
},
|
|
158
158
|
getLabelProps() {
|
|
@@ -161,11 +161,11 @@ function connect(service, normalize) {
|
|
|
161
161
|
dir: prop("dir"),
|
|
162
162
|
htmlFor: getInputId(scope),
|
|
163
163
|
id: getLabelId(scope),
|
|
164
|
-
"data-readonly": index$
|
|
165
|
-
"data-disabled": index$
|
|
166
|
-
"data-invalid": index$
|
|
167
|
-
"data-required": index$
|
|
168
|
-
"data-focus": index$
|
|
164
|
+
"data-readonly": index$1.dataAttr(readOnly),
|
|
165
|
+
"data-disabled": index$1.dataAttr(disabled),
|
|
166
|
+
"data-invalid": index$1.dataAttr(invalid),
|
|
167
|
+
"data-required": index$1.dataAttr(required),
|
|
168
|
+
"data-focus": index$1.dataAttr(focused),
|
|
169
169
|
onClick(event2) {
|
|
170
170
|
if (composite) return;
|
|
171
171
|
event2.preventDefault();
|
|
@@ -179,9 +179,9 @@ function connect(service, normalize) {
|
|
|
179
179
|
dir: prop("dir"),
|
|
180
180
|
id: getControlId(scope),
|
|
181
181
|
"data-state": open ? "open" : "closed",
|
|
182
|
-
"data-focus": index$
|
|
183
|
-
"data-disabled": index$
|
|
184
|
-
"data-invalid": index$
|
|
182
|
+
"data-focus": index$1.dataAttr(focused),
|
|
183
|
+
"data-disabled": index$1.dataAttr(disabled),
|
|
184
|
+
"data-invalid": index$1.dataAttr(invalid)
|
|
185
185
|
});
|
|
186
186
|
},
|
|
187
187
|
getPositionerProps() {
|
|
@@ -196,9 +196,9 @@ function connect(service, normalize) {
|
|
|
196
196
|
return normalize.input({
|
|
197
197
|
...parts.input.attrs,
|
|
198
198
|
dir: prop("dir"),
|
|
199
|
-
"aria-invalid": index$
|
|
200
|
-
"data-invalid": index$
|
|
201
|
-
"data-autofocus": index$
|
|
199
|
+
"aria-invalid": index$1.ariaAttr(invalid),
|
|
200
|
+
"data-invalid": index$1.dataAttr(invalid),
|
|
201
|
+
"data-autofocus": index$1.dataAttr(prop("autoFocus")),
|
|
202
202
|
name: prop("name"),
|
|
203
203
|
form: prop("form"),
|
|
204
204
|
disabled,
|
|
@@ -238,7 +238,7 @@ function connect(service, normalize) {
|
|
|
238
238
|
onKeyDown(event2) {
|
|
239
239
|
if (event2.defaultPrevented) return;
|
|
240
240
|
if (!interactive) return;
|
|
241
|
-
if (event2.ctrlKey || event2.shiftKey || index$
|
|
241
|
+
if (event2.ctrlKey || event2.shiftKey || index$1.isComposingEvent(event2)) return;
|
|
242
242
|
const openOnKeyPress = prop("openOnKeyPress");
|
|
243
243
|
const isModifierKey = event2.ctrlKey || event2.metaKey || event2.shiftKey;
|
|
244
244
|
const keypress = true;
|
|
@@ -277,7 +277,7 @@ function connect(service, normalize) {
|
|
|
277
277
|
}
|
|
278
278
|
if (highlightedValue == null) return;
|
|
279
279
|
const itemEl = getItemEl(scope, highlightedValue);
|
|
280
|
-
if (index$
|
|
280
|
+
if (index$1.isAnchorElement(itemEl)) {
|
|
281
281
|
prop("navigate")?.({ value: highlightedValue, node: itemEl, href: itemEl.href });
|
|
282
282
|
}
|
|
283
283
|
},
|
|
@@ -286,7 +286,7 @@ function connect(service, normalize) {
|
|
|
286
286
|
event2.preventDefault();
|
|
287
287
|
}
|
|
288
288
|
};
|
|
289
|
-
const key = index$
|
|
289
|
+
const key = index$1.getEventKey(event2, { dir: prop("dir") });
|
|
290
290
|
const exec = keymap[key];
|
|
291
291
|
exec?.(event2);
|
|
292
292
|
}
|
|
@@ -305,10 +305,10 @@ function connect(service, normalize) {
|
|
|
305
305
|
"data-state": open ? "open" : "closed",
|
|
306
306
|
"aria-controls": open ? getContentId(scope) : void 0,
|
|
307
307
|
disabled,
|
|
308
|
-
"data-invalid": index$
|
|
309
|
-
"data-focusable": index$
|
|
310
|
-
"data-readonly": index$
|
|
311
|
-
"data-disabled": index$
|
|
308
|
+
"data-invalid": index$1.dataAttr(invalid),
|
|
309
|
+
"data-focusable": index$1.dataAttr(props2.focusable),
|
|
310
|
+
"data-readonly": index$1.dataAttr(readOnly),
|
|
311
|
+
"data-disabled": index$1.dataAttr(disabled),
|
|
312
312
|
onFocus() {
|
|
313
313
|
if (!props2.focusable) return;
|
|
314
314
|
send({ type: "INPUT.FOCUS", src: "trigger" });
|
|
@@ -316,13 +316,13 @@ function connect(service, normalize) {
|
|
|
316
316
|
onClick(event2) {
|
|
317
317
|
if (event2.defaultPrevented) return;
|
|
318
318
|
if (!interactive) return;
|
|
319
|
-
if (!index$
|
|
319
|
+
if (!index$1.isLeftClick(event2)) return;
|
|
320
320
|
send({ type: "TRIGGER.CLICK", src: "trigger-click" });
|
|
321
321
|
},
|
|
322
322
|
onPointerDown(event2) {
|
|
323
323
|
if (!interactive) return;
|
|
324
324
|
if (event2.pointerType === "touch") return;
|
|
325
|
-
if (!index$
|
|
325
|
+
if (!index$1.isLeftClick(event2)) return;
|
|
326
326
|
event2.preventDefault();
|
|
327
327
|
queueMicrotask(() => {
|
|
328
328
|
getInputEl(scope)?.focus({ preventScroll: true });
|
|
@@ -339,7 +339,7 @@ function connect(service, normalize) {
|
|
|
339
339
|
send({ type: "INPUT.ARROW_UP", src: "arrow-key" });
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
|
-
const key = index$
|
|
342
|
+
const key = index$1.getEventKey(event2, { dir: prop("dir") });
|
|
343
343
|
const exec = keyMap[key];
|
|
344
344
|
if (exec) {
|
|
345
345
|
exec(event2);
|
|
@@ -360,9 +360,9 @@ function connect(service, normalize) {
|
|
|
360
360
|
"data-placement": context.get("currentPlacement"),
|
|
361
361
|
"aria-labelledby": getLabelId(scope),
|
|
362
362
|
"aria-multiselectable": prop("multiple") && composite ? true : void 0,
|
|
363
|
-
"data-empty": index$
|
|
363
|
+
"data-empty": index$1.dataAttr(collection2.size === 0),
|
|
364
364
|
onPointerDown(event2) {
|
|
365
|
-
if (!index$
|
|
365
|
+
if (!index$1.isLeftClick(event2)) return;
|
|
366
366
|
event2.preventDefault();
|
|
367
367
|
}
|
|
368
368
|
});
|
|
@@ -371,7 +371,7 @@ function connect(service, normalize) {
|
|
|
371
371
|
return normalize.element({
|
|
372
372
|
...parts.list.attrs,
|
|
373
373
|
role: !composite ? "listbox" : void 0,
|
|
374
|
-
"data-empty": index$
|
|
374
|
+
"data-empty": index$1.dataAttr(collection2.size === 0),
|
|
375
375
|
"aria-labelledby": getLabelId(scope),
|
|
376
376
|
"aria-multiselectable": prop("multiple") && !composite ? true : void 0
|
|
377
377
|
});
|
|
@@ -384,12 +384,12 @@ function connect(service, normalize) {
|
|
|
384
384
|
type: "button",
|
|
385
385
|
tabIndex: -1,
|
|
386
386
|
disabled,
|
|
387
|
-
"data-invalid": index$
|
|
387
|
+
"data-invalid": index$1.dataAttr(invalid),
|
|
388
388
|
"aria-label": translations.clearTriggerLabel,
|
|
389
389
|
"aria-controls": getInputId(scope),
|
|
390
390
|
hidden: !context.get("value").length,
|
|
391
391
|
onPointerDown(event2) {
|
|
392
|
-
if (!index$
|
|
392
|
+
if (!index$1.isLeftClick(event2)) return;
|
|
393
393
|
event2.preventDefault();
|
|
394
394
|
},
|
|
395
395
|
onClick(event2) {
|
|
@@ -409,11 +409,11 @@ function connect(service, normalize) {
|
|
|
409
409
|
id: getItemId(scope, value),
|
|
410
410
|
role: "option",
|
|
411
411
|
tabIndex: -1,
|
|
412
|
-
"data-highlighted": index$
|
|
412
|
+
"data-highlighted": index$1.dataAttr(itemState.highlighted),
|
|
413
413
|
"data-state": itemState.selected ? "checked" : "unchecked",
|
|
414
|
-
"aria-selected": index$
|
|
415
|
-
"aria-disabled": index$
|
|
416
|
-
"data-disabled": index$
|
|
414
|
+
"aria-selected": index$1.ariaAttr(itemState.highlighted),
|
|
415
|
+
"aria-disabled": index$1.ariaAttr(itemState.disabled),
|
|
416
|
+
"data-disabled": index$1.dataAttr(itemState.disabled),
|
|
417
417
|
"data-value": itemState.value,
|
|
418
418
|
onPointerMove() {
|
|
419
419
|
if (itemState.disabled) return;
|
|
@@ -429,9 +429,9 @@ function connect(service, normalize) {
|
|
|
429
429
|
send({ type: "ITEM.POINTER_LEAVE", value });
|
|
430
430
|
},
|
|
431
431
|
onClick(event2) {
|
|
432
|
-
if (index$
|
|
433
|
-
if (index$
|
|
434
|
-
if (index$
|
|
432
|
+
if (index$1.isDownloadingEvent(event2)) return;
|
|
433
|
+
if (index$1.isOpeningInNewTab(event2)) return;
|
|
434
|
+
if (index$1.isContextMenuEvent(event2)) return;
|
|
435
435
|
if (itemState.disabled) return;
|
|
436
436
|
send({ type: "ITEM.CLICK", src: "item-select", value });
|
|
437
437
|
}
|
|
@@ -443,8 +443,8 @@ function connect(service, normalize) {
|
|
|
443
443
|
...parts.itemText.attrs,
|
|
444
444
|
dir: prop("dir"),
|
|
445
445
|
"data-state": itemState.selected ? "checked" : "unchecked",
|
|
446
|
-
"data-disabled": index$
|
|
447
|
-
"data-highlighted": index$
|
|
446
|
+
"data-disabled": index$1.dataAttr(itemState.disabled),
|
|
447
|
+
"data-highlighted": index$1.dataAttr(itemState.highlighted)
|
|
448
448
|
});
|
|
449
449
|
},
|
|
450
450
|
getItemIndicatorProps(props2) {
|
|
@@ -464,7 +464,7 @@ function connect(service, normalize) {
|
|
|
464
464
|
dir: prop("dir"),
|
|
465
465
|
id: getItemGroupId(scope, id),
|
|
466
466
|
"aria-labelledby": getItemGroupLabelId(scope, id),
|
|
467
|
-
"data-empty": index$
|
|
467
|
+
"data-empty": index$1.dataAttr(collection2.size === 0),
|
|
468
468
|
role: "group"
|
|
469
469
|
});
|
|
470
470
|
},
|
|
@@ -479,7 +479,7 @@ function connect(service, normalize) {
|
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
var { guards, createMachine, choose } = index.setup();
|
|
482
|
+
var { guards, createMachine, choose } = index$4.setup();
|
|
483
483
|
var { and, not } = guards;
|
|
484
484
|
var machine = createMachine({
|
|
485
485
|
props({ props: props2 }) {
|
|
@@ -497,7 +497,7 @@ var machine = createMachine({
|
|
|
497
497
|
openOnChange: true,
|
|
498
498
|
composite: true,
|
|
499
499
|
navigate({ node }) {
|
|
500
|
-
index$
|
|
500
|
+
index$1.clickIfLink(node);
|
|
501
501
|
},
|
|
502
502
|
collection: collection.empty(),
|
|
503
503
|
...props2,
|
|
@@ -525,7 +525,7 @@ var machine = createMachine({
|
|
|
525
525
|
value: bindable(() => ({
|
|
526
526
|
defaultValue: prop("defaultValue"),
|
|
527
527
|
value: prop("value"),
|
|
528
|
-
isEqual: index
|
|
528
|
+
isEqual: index.isEqual,
|
|
529
529
|
hash(value) {
|
|
530
530
|
return value.join(",");
|
|
531
531
|
},
|
|
@@ -554,7 +554,7 @@ var machine = createMachine({
|
|
|
554
554
|
const value = prop("value") || prop("defaultValue");
|
|
555
555
|
if (!inputValue.trim() && !prop("multiple")) {
|
|
556
556
|
const valueAsString = prop("collection").stringifyMany(value);
|
|
557
|
-
inputValue = index
|
|
557
|
+
inputValue = index.match(prop("selectionBehavior"), {
|
|
558
558
|
preserve: inputValue || valueAsString,
|
|
559
559
|
replace: valueAsString,
|
|
560
560
|
clear: ""
|
|
@@ -1150,7 +1150,7 @@ var machine = createMachine({
|
|
|
1150
1150
|
isOpenControlled: ({ prop }) => prop("open") != null,
|
|
1151
1151
|
openOnChange: ({ prop, context }) => {
|
|
1152
1152
|
const openOnChange = prop("openOnChange");
|
|
1153
|
-
if (index
|
|
1153
|
+
if (index.isBoolean(openOnChange)) return openOnChange;
|
|
1154
1154
|
return !!openOnChange?.({ inputValue: context.get("inputValue") });
|
|
1155
1155
|
},
|
|
1156
1156
|
restoreFocus: ({ event }) => {
|
|
@@ -1166,7 +1166,7 @@ var machine = createMachine({
|
|
|
1166
1166
|
trackDismissableLayer({ send, prop, scope }) {
|
|
1167
1167
|
if (prop("disableLayer")) return;
|
|
1168
1168
|
const contentEl = () => getContentEl(scope);
|
|
1169
|
-
return index$
|
|
1169
|
+
return index$3.trackDismissableElement(contentEl, {
|
|
1170
1170
|
type: "listbox",
|
|
1171
1171
|
defer: true,
|
|
1172
1172
|
exclude: () => [getInputEl(scope), getTriggerEl(scope), getClearTriggerEl(scope)],
|
|
@@ -1187,7 +1187,7 @@ var machine = createMachine({
|
|
|
1187
1187
|
const anchorEl = () => getControlEl(scope) || getTriggerEl(scope);
|
|
1188
1188
|
const positionerEl = () => getPositionerEl(scope);
|
|
1189
1189
|
context.set("currentPlacement", prop("positioning").placement);
|
|
1190
|
-
return index$
|
|
1190
|
+
return index$2.getPlacement(anchorEl, positionerEl, {
|
|
1191
1191
|
...prop("positioning"),
|
|
1192
1192
|
defer: true,
|
|
1193
1193
|
onComplete(data) {
|
|
@@ -1214,14 +1214,14 @@ var machine = createMachine({
|
|
|
1214
1214
|
return;
|
|
1215
1215
|
}
|
|
1216
1216
|
const itemEl = getItemEl(scope, highlightedValue);
|
|
1217
|
-
const raf_cleanup = index$
|
|
1218
|
-
index$
|
|
1217
|
+
const raf_cleanup = index$1.raf(() => {
|
|
1218
|
+
index$1.scrollIntoView(itemEl, { rootEl: contentEl, block: "nearest" });
|
|
1219
1219
|
});
|
|
1220
1220
|
cleanups.push(raf_cleanup);
|
|
1221
1221
|
};
|
|
1222
|
-
const rafCleanup = index$
|
|
1222
|
+
const rafCleanup = index$1.raf(() => exec(true));
|
|
1223
1223
|
cleanups.push(rafCleanup);
|
|
1224
|
-
const observerCleanup = index$
|
|
1224
|
+
const observerCleanup = index$1.observeAttributes(inputEl, {
|
|
1225
1225
|
attributes: ["aria-activedescendant"],
|
|
1226
1226
|
callback: () => exec(false)
|
|
1227
1227
|
});
|
|
@@ -1235,7 +1235,7 @@ var machine = createMachine({
|
|
|
1235
1235
|
reposition({ context, prop, scope, event }) {
|
|
1236
1236
|
const controlEl = () => getControlEl(scope);
|
|
1237
1237
|
const positionerEl = () => getPositionerEl(scope);
|
|
1238
|
-
index$
|
|
1238
|
+
index$2.getPlacement(controlEl, positionerEl, {
|
|
1239
1239
|
...prop("positioning"),
|
|
1240
1240
|
...event.options,
|
|
1241
1241
|
defer: true,
|
|
@@ -1257,10 +1257,10 @@ var machine = createMachine({
|
|
|
1257
1257
|
const collection2 = prop("collection");
|
|
1258
1258
|
const highlightedValue = context.get("highlightedValue");
|
|
1259
1259
|
if (!highlightedValue || !collection2.has(highlightedValue)) return;
|
|
1260
|
-
const nextValue = prop("multiple") ? index
|
|
1260
|
+
const nextValue = prop("multiple") ? index.addOrRemove(context.get("value"), highlightedValue) : [highlightedValue];
|
|
1261
1261
|
prop("onSelect")?.({ value: nextValue, itemValue: highlightedValue });
|
|
1262
1262
|
context.set("value", nextValue);
|
|
1263
|
-
const inputValue = index
|
|
1263
|
+
const inputValue = index.match(prop("selectionBehavior"), {
|
|
1264
1264
|
preserve: context.get("inputValue"),
|
|
1265
1265
|
replace: collection2.stringifyMany(nextValue),
|
|
1266
1266
|
clear: ""
|
|
@@ -1268,7 +1268,7 @@ var machine = createMachine({
|
|
|
1268
1268
|
context.set("inputValue", inputValue);
|
|
1269
1269
|
},
|
|
1270
1270
|
scrollToHighlightedItem({ context, prop, scope }) {
|
|
1271
|
-
index$
|
|
1271
|
+
index$1.nextTick(() => {
|
|
1272
1272
|
const highlightedValue = context.get("highlightedValue");
|
|
1273
1273
|
if (highlightedValue == null) return;
|
|
1274
1274
|
const itemEl = getItemEl(scope, highlightedValue);
|
|
@@ -1283,17 +1283,17 @@ var machine = createMachine({
|
|
|
1283
1283
|
});
|
|
1284
1284
|
return;
|
|
1285
1285
|
}
|
|
1286
|
-
index$
|
|
1286
|
+
index$1.scrollIntoView(itemEl, { rootEl: contentEl, block: "nearest" });
|
|
1287
1287
|
});
|
|
1288
1288
|
},
|
|
1289
1289
|
selectItem(params) {
|
|
1290
1290
|
const { context, event, flush, prop } = params;
|
|
1291
1291
|
if (event.value == null) return;
|
|
1292
1292
|
flush(() => {
|
|
1293
|
-
const nextValue = prop("multiple") ? index
|
|
1293
|
+
const nextValue = prop("multiple") ? index.addOrRemove(context.get("value"), event.value) : [event.value];
|
|
1294
1294
|
prop("onSelect")?.({ value: nextValue, itemValue: event.value });
|
|
1295
1295
|
context.set("value", nextValue);
|
|
1296
|
-
const inputValue = index
|
|
1296
|
+
const inputValue = index.match(prop("selectionBehavior"), {
|
|
1297
1297
|
preserve: context.get("inputValue"),
|
|
1298
1298
|
replace: prop("collection").stringifyMany(nextValue),
|
|
1299
1299
|
clear: ""
|
|
@@ -1305,9 +1305,9 @@ var machine = createMachine({
|
|
|
1305
1305
|
const { context, event, flush, prop } = params;
|
|
1306
1306
|
if (event.value == null) return;
|
|
1307
1307
|
flush(() => {
|
|
1308
|
-
const nextValue = index
|
|
1308
|
+
const nextValue = index.remove(context.get("value"), event.value);
|
|
1309
1309
|
context.set("value", nextValue);
|
|
1310
|
-
const inputValue = index
|
|
1310
|
+
const inputValue = index.match(prop("selectionBehavior"), {
|
|
1311
1311
|
preserve: context.get("inputValue"),
|
|
1312
1312
|
replace: prop("collection").stringifyMany(nextValue),
|
|
1313
1313
|
clear: ""
|
|
@@ -1316,12 +1316,12 @@ var machine = createMachine({
|
|
|
1316
1316
|
});
|
|
1317
1317
|
},
|
|
1318
1318
|
setInitialFocus({ scope }) {
|
|
1319
|
-
index$
|
|
1319
|
+
index$1.raf(() => {
|
|
1320
1320
|
focusInputEl(scope);
|
|
1321
1321
|
});
|
|
1322
1322
|
},
|
|
1323
1323
|
setFinalFocus({ scope }) {
|
|
1324
|
-
index$
|
|
1324
|
+
index$1.raf(() => {
|
|
1325
1325
|
const triggerEl = getTriggerEl(scope);
|
|
1326
1326
|
if (triggerEl?.dataset.focusable == null) {
|
|
1327
1327
|
focusInputEl(scope);
|
|
@@ -1336,7 +1336,7 @@ var machine = createMachine({
|
|
|
1336
1336
|
inputEl.value = context.get("inputValue");
|
|
1337
1337
|
queueMicrotask(() => {
|
|
1338
1338
|
if (event.current().type === "INPUT.CHANGE") return;
|
|
1339
|
-
index$
|
|
1339
|
+
index$1.setCaretToEnd(inputEl);
|
|
1340
1340
|
});
|
|
1341
1341
|
},
|
|
1342
1342
|
setInputValue({ context, event }) {
|
|
@@ -1347,7 +1347,7 @@ var machine = createMachine({
|
|
|
1347
1347
|
},
|
|
1348
1348
|
revertInputValue({ context, prop, computed }) {
|
|
1349
1349
|
const selectionBehavior = prop("selectionBehavior");
|
|
1350
|
-
const inputValue = index
|
|
1350
|
+
const inputValue = index.match(selectionBehavior, {
|
|
1351
1351
|
replace: computed("hasSelectedItems") ? computed("valueAsString") : "",
|
|
1352
1352
|
preserve: context.get("inputValue"),
|
|
1353
1353
|
clear: ""
|
|
@@ -1358,7 +1358,7 @@ var machine = createMachine({
|
|
|
1358
1358
|
const { context, flush, event, prop } = params;
|
|
1359
1359
|
flush(() => {
|
|
1360
1360
|
context.set("value", event.value);
|
|
1361
|
-
const inputValue = index
|
|
1361
|
+
const inputValue = index.match(prop("selectionBehavior"), {
|
|
1362
1362
|
preserve: context.get("inputValue"),
|
|
1363
1363
|
replace: prop("collection").stringifyMany(event.value),
|
|
1364
1364
|
clear: ""
|
|
@@ -1370,7 +1370,7 @@ var machine = createMachine({
|
|
|
1370
1370
|
const { context, flush, prop } = params;
|
|
1371
1371
|
flush(() => {
|
|
1372
1372
|
context.set("value", []);
|
|
1373
|
-
const inputValue = index
|
|
1373
|
+
const inputValue = index.match(prop("selectionBehavior"), {
|
|
1374
1374
|
preserve: context.get("inputValue"),
|
|
1375
1375
|
replace: prop("collection").stringifyMany([]),
|
|
1376
1376
|
clear: ""
|
|
@@ -1402,7 +1402,7 @@ var machine = createMachine({
|
|
|
1402
1402
|
prop("onOpenChange")?.({ open: false, reason, value: context.get("value") });
|
|
1403
1403
|
},
|
|
1404
1404
|
highlightFirstItem({ context, prop, scope }) {
|
|
1405
|
-
const exec = getContentEl(scope) ? queueMicrotask : index$
|
|
1405
|
+
const exec = getContentEl(scope) ? queueMicrotask : index$1.raf;
|
|
1406
1406
|
exec(() => {
|
|
1407
1407
|
const value = prop("collection").firstValue;
|
|
1408
1408
|
if (value) context.set("highlightedValue", value);
|
|
@@ -1413,7 +1413,7 @@ var machine = createMachine({
|
|
|
1413
1413
|
action(["highlightFirstItem"]);
|
|
1414
1414
|
},
|
|
1415
1415
|
highlightLastItem({ context, prop, scope }) {
|
|
1416
|
-
const exec = getContentEl(scope) ? queueMicrotask : index$
|
|
1416
|
+
const exec = getContentEl(scope) ? queueMicrotask : index$1.raf;
|
|
1417
1417
|
exec(() => {
|
|
1418
1418
|
const value = prop("collection").lastValue;
|
|
1419
1419
|
if (value) context.set("highlightedValue", value);
|
|
@@ -1444,13 +1444,13 @@ var machine = createMachine({
|
|
|
1444
1444
|
if (value) context.set("highlightedValue", value);
|
|
1445
1445
|
},
|
|
1446
1446
|
highlightFirstSelectedItem({ context, prop }) {
|
|
1447
|
-
index$
|
|
1447
|
+
index$1.raf(() => {
|
|
1448
1448
|
const [value] = prop("collection").sort(context.get("value"));
|
|
1449
1449
|
if (value) context.set("highlightedValue", value);
|
|
1450
1450
|
});
|
|
1451
1451
|
},
|
|
1452
1452
|
highlightFirstOrSelectedItem({ context, prop, computed }) {
|
|
1453
|
-
index$
|
|
1453
|
+
index$1.raf(() => {
|
|
1454
1454
|
let value = null;
|
|
1455
1455
|
if (computed("hasSelectedItems")) {
|
|
1456
1456
|
value = prop("collection").sort(context.get("value"))[0];
|
|
@@ -1461,7 +1461,7 @@ var machine = createMachine({
|
|
|
1461
1461
|
});
|
|
1462
1462
|
},
|
|
1463
1463
|
highlightLastOrSelectedItem({ context, prop, computed }) {
|
|
1464
|
-
index$
|
|
1464
|
+
index$1.raf(() => {
|
|
1465
1465
|
const collection2 = prop("collection");
|
|
1466
1466
|
let value = null;
|
|
1467
1467
|
if (computed("hasSelectedItems")) {
|
|
@@ -1477,7 +1477,7 @@ var machine = createMachine({
|
|
|
1477
1477
|
const collection2 = prop("collection");
|
|
1478
1478
|
if (!computed("autoComplete") || !inputEl || !event.keypress) return;
|
|
1479
1479
|
const valueText = collection2.stringify(context.get("highlightedValue"));
|
|
1480
|
-
index$
|
|
1480
|
+
index$1.raf(() => {
|
|
1481
1481
|
inputEl.value = valueText || context.get("inputValue");
|
|
1482
1482
|
});
|
|
1483
1483
|
},
|
|
@@ -1491,7 +1491,7 @@ var machine = createMachine({
|
|
|
1491
1491
|
return item || collection2.find(v);
|
|
1492
1492
|
});
|
|
1493
1493
|
context.set("selectedItems", selectedItems);
|
|
1494
|
-
const inputValue = index
|
|
1494
|
+
const inputValue = index.match(prop("selectionBehavior"), {
|
|
1495
1495
|
preserve: context.get("inputValue"),
|
|
1496
1496
|
replace: collection2.stringifyMany(value),
|
|
1497
1497
|
clear: ""
|
package/dist/node_modules/.pnpm/@zag-js_combobox@1.31.1/node_modules/@zag-js/combobox/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnatomy } from '../../../../../@zag-js_anatomy@1.31.1/node_modules/@zag-js/anatomy/dist/index.js';
|
|
2
2
|
import { ListCollection } from '../../../../../@zag-js_collection@1.31.1/node_modules/@zag-js/collection/dist/index.js';
|
|
3
|
-
import { raf, setCaretToEnd, nextTick, observeAttributes, clickIfLink, dataAttr,
|
|
3
|
+
import { raf, setCaretToEnd, nextTick, observeAttributes, clickIfLink, dataAttr, isDownloadingEvent, isOpeningInNewTab, isContextMenuEvent, ariaAttr, isLeftClick, getEventKey, isComposingEvent, query, isAnchorElement, scrollIntoView } from '../../../../../@zag-js_dom-query@1.31.1/node_modules/@zag-js/dom-query/dist/index.js';
|
|
4
4
|
import { getPlacement, getPlacementStyles } from '../../../../../@zag-js_popper@1.31.1/node_modules/@zag-js/popper/dist/index.js';
|
|
5
5
|
import { match, remove, addOrRemove, isBoolean, isEqual, ensure } from '../../../../../@zag-js_utils@1.31.1/node_modules/@zag-js/utils/dist/index.js';
|
|
6
6
|
import { setup } from '../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.js';
|