@zag-js/combobox 1.8.2 → 1.9.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/index.js CHANGED
@@ -350,6 +350,7 @@ function connect(service, normalize) {
350
350
  "data-placement": context.get("currentPlacement"),
351
351
  "aria-labelledby": getLabelId(scope),
352
352
  "aria-multiselectable": prop("multiple") && composite ? true : void 0,
353
+ "data-empty": domQuery.dataAttr(collection2.size === 0),
353
354
  onPointerDown(event2) {
354
355
  event2.preventDefault();
355
356
  }
@@ -359,6 +360,7 @@ function connect(service, normalize) {
359
360
  return normalize.element({
360
361
  ...parts.list.attrs,
361
362
  role: !composite ? "listbox" : void 0,
363
+ "data-empty": domQuery.dataAttr(collection2.size === 0),
362
364
  "aria-labelledby": getLabelId(scope),
363
365
  "aria-multiselectable": prop("multiple") && !composite ? true : void 0
364
366
  });
@@ -450,6 +452,7 @@ function connect(service, normalize) {
450
452
  dir: prop("dir"),
451
453
  id: getItemGroupId(scope, id),
452
454
  "aria-labelledby": getItemGroupLabelId(scope, id),
455
+ "data-empty": domQuery.dataAttr(collection2.size === 0),
453
456
  role: "group"
454
457
  });
455
458
  },
@@ -1144,10 +1147,10 @@ var machine = core.createMachine({
1144
1147
  ]);
1145
1148
  },
1146
1149
  trackPlacement({ context, prop, scope }) {
1147
- const controlEl = () => getControlEl(scope);
1150
+ const anchorEl = () => getControlEl(scope) || getTriggerEl(scope);
1148
1151
  const positionerEl = () => getPositionerEl(scope);
1149
1152
  context.set("currentPlacement", prop("positioning").placement);
1150
- return popper.getPlacement(controlEl, positionerEl, {
1153
+ return popper.getPlacement(anchorEl, positionerEl, {
1151
1154
  ...prop("positioning"),
1152
1155
  defer: true,
1153
1156
  onComplete(data) {
package/dist/index.mjs CHANGED
@@ -348,6 +348,7 @@ function connect(service, normalize) {
348
348
  "data-placement": context.get("currentPlacement"),
349
349
  "aria-labelledby": getLabelId(scope),
350
350
  "aria-multiselectable": prop("multiple") && composite ? true : void 0,
351
+ "data-empty": dataAttr(collection2.size === 0),
351
352
  onPointerDown(event2) {
352
353
  event2.preventDefault();
353
354
  }
@@ -357,6 +358,7 @@ function connect(service, normalize) {
357
358
  return normalize.element({
358
359
  ...parts.list.attrs,
359
360
  role: !composite ? "listbox" : void 0,
361
+ "data-empty": dataAttr(collection2.size === 0),
360
362
  "aria-labelledby": getLabelId(scope),
361
363
  "aria-multiselectable": prop("multiple") && !composite ? true : void 0
362
364
  });
@@ -448,6 +450,7 @@ function connect(service, normalize) {
448
450
  dir: prop("dir"),
449
451
  id: getItemGroupId(scope, id),
450
452
  "aria-labelledby": getItemGroupLabelId(scope, id),
453
+ "data-empty": dataAttr(collection2.size === 0),
451
454
  role: "group"
452
455
  });
453
456
  },
@@ -1142,10 +1145,10 @@ var machine = createMachine({
1142
1145
  ]);
1143
1146
  },
1144
1147
  trackPlacement({ context, prop, scope }) {
1145
- const controlEl = () => getControlEl(scope);
1148
+ const anchorEl = () => getControlEl(scope) || getTriggerEl(scope);
1146
1149
  const positionerEl = () => getPositionerEl(scope);
1147
1150
  context.set("currentPlacement", prop("positioning").placement);
1148
- return getPlacement(controlEl, positionerEl, {
1151
+ return getPlacement(anchorEl, positionerEl, {
1149
1152
  ...prop("positioning"),
1150
1153
  defer: true,
1151
1154
  onComplete(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zag-js/combobox",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "Core logic for the combobox widget implemented as a state machine",
5
5
  "keywords": [
6
6
  "js",
@@ -26,15 +26,15 @@
26
26
  "url": "https://github.com/chakra-ui/zag/issues"
27
27
  },
28
28
  "dependencies": {
29
- "@zag-js/anatomy": "1.8.2",
30
- "@zag-js/aria-hidden": "1.8.2",
31
- "@zag-js/collection": "1.8.2",
32
- "@zag-js/core": "1.8.2",
33
- "@zag-js/dismissable": "1.8.2",
34
- "@zag-js/dom-query": "1.8.2",
35
- "@zag-js/utils": "1.8.2",
36
- "@zag-js/popper": "1.8.2",
37
- "@zag-js/types": "1.8.2"
29
+ "@zag-js/anatomy": "1.9.1",
30
+ "@zag-js/aria-hidden": "1.9.1",
31
+ "@zag-js/collection": "1.9.1",
32
+ "@zag-js/core": "1.9.1",
33
+ "@zag-js/dismissable": "1.9.1",
34
+ "@zag-js/dom-query": "1.9.1",
35
+ "@zag-js/utils": "1.9.1",
36
+ "@zag-js/popper": "1.9.1",
37
+ "@zag-js/types": "1.9.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "clean-package": "2.2.0"