@plasmicpkgs/react-aria 0.0.55 → 0.0.57

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.
Files changed (42) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/ListBoxItemIdManager.d.ts +1 -1
  3. package/dist/react-aria.esm.js +37 -14
  4. package/dist/react-aria.esm.js.map +1 -1
  5. package/dist/react-aria.js +37 -14
  6. package/dist/react-aria.js.map +1 -1
  7. package/dist/registerListBoxItem.d.ts +1 -1
  8. package/package.json +2 -2
  9. package/skinny/ListBoxItemIdManager.d.ts +1 -1
  10. package/skinny/registerButton.cjs.js +2 -2
  11. package/skinny/registerButton.cjs.js.map +1 -1
  12. package/skinny/registerButton.esm.js +2 -2
  13. package/skinny/registerButton.esm.js.map +1 -1
  14. package/skinny/registerComboBox.cjs.js +8 -1
  15. package/skinny/registerComboBox.cjs.js.map +1 -1
  16. package/skinny/registerComboBox.esm.js +8 -1
  17. package/skinny/registerComboBox.esm.js.map +1 -1
  18. package/skinny/{registerListBox-85f61377.esm.js → registerListBox-3c236462.esm.js} +6 -5
  19. package/skinny/registerListBox-3c236462.esm.js.map +1 -0
  20. package/skinny/{registerListBox-96ae5783.cjs.js → registerListBox-da9cf4ed.cjs.js} +6 -5
  21. package/skinny/registerListBox-da9cf4ed.cjs.js.map +1 -0
  22. package/skinny/registerListBox.cjs.js +1 -1
  23. package/skinny/registerListBox.esm.js +1 -1
  24. package/skinny/registerListBoxItem.cjs.js +18 -5
  25. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  26. package/skinny/registerListBoxItem.d.ts +1 -1
  27. package/skinny/registerListBoxItem.esm.js +18 -5
  28. package/skinny/registerListBoxItem.esm.js.map +1 -1
  29. package/skinny/registerPopover.cjs.js +1 -1
  30. package/skinny/registerPopover.cjs.js.map +1 -1
  31. package/skinny/registerPopover.esm.js +1 -1
  32. package/skinny/registerPopover.esm.js.map +1 -1
  33. package/skinny/registerSelect.cjs.js +4 -2
  34. package/skinny/registerSelect.cjs.js.map +1 -1
  35. package/skinny/registerSelect.esm.js +4 -2
  36. package/skinny/registerSelect.esm.js.map +1 -1
  37. package/skinny/registerSliderThumb.cjs.js +1 -1
  38. package/skinny/registerSliderThumb.cjs.js.map +1 -1
  39. package/skinny/registerSliderThumb.esm.js +1 -1
  40. package/skinny/registerSliderThumb.esm.js.map +1 -1
  41. package/skinny/registerListBox-85f61377.esm.js.map +0 -1
  42. package/skinny/registerListBox-96ae5783.cjs.js.map +0 -1
@@ -4,7 +4,7 @@ export declare class ListBoxItemIdManager {
4
4
  private readonly _observers;
5
5
  private generateDuplicateId;
6
6
  private generateMissingId;
7
- register(id?: string): string;
7
+ register(id?: unknown): string;
8
8
  unregister(id: string): void;
9
9
  subscribe(observer: Observer): void;
10
10
  notify(): void;
@@ -561,7 +561,7 @@ function registerButton(loader, overrides) {
561
561
  type: "boolean",
562
562
  displayName: "Submits form?",
563
563
  defaultValueHint: false,
564
- hidden: (ps) => Boolean(ps.resetsForm),
564
+ hidden: (props) => Boolean(props.resetsForm),
565
565
  description: "Whether clicking this button should submit the enclosing form.",
566
566
  advanced: true
567
567
  },
@@ -569,7 +569,7 @@ function registerButton(loader, overrides) {
569
569
  type: "boolean",
570
570
  displayName: "Resets form?",
571
571
  defaultValueHint: false,
572
- hidden: (ps) => Boolean(ps.submitsForm),
572
+ hidden: (props) => Boolean(props.submitsForm),
573
573
  description: "Whether clicking this button should reset the enclosing form.",
574
574
  advanced: true
575
575
  },
@@ -1280,13 +1280,14 @@ class ListBoxItemIdManager {
1280
1280
  }
1281
1281
  }
1282
1282
  register(id) {
1283
+ const idStr = id === void 0 ? void 0 : String(id).trim();
1283
1284
  let newId;
1284
- if (!id) {
1285
+ if (!idStr) {
1285
1286
  newId = this.generateMissingId();
1286
- } else if (this._ids.has(id)) {
1287
- newId = this.generateDuplicateId(id);
1287
+ } else if (this._ids.has(idStr)) {
1288
+ newId = this.generateDuplicateId(idStr);
1288
1289
  } else {
1289
- newId = id;
1290
+ newId = idStr;
1290
1291
  }
1291
1292
  this._ids.add(newId);
1292
1293
  this.notify();
@@ -1525,8 +1526,21 @@ function BaseListBoxItem(props) {
1525
1526
  };
1526
1527
  }, [id]);
1527
1528
  setControlContextData == null ? void 0 : setControlContextData({
1528
- // this means that a unique id was registered, different from the provided id
1529
- hasDuplicateId: !isStandalone && id !== registeredId
1529
+ idError: (() => {
1530
+ if (id === void 0) {
1531
+ return "ID must be defined";
1532
+ }
1533
+ if (typeof id !== "string") {
1534
+ return "ID must be a string";
1535
+ }
1536
+ if (!id.trim()) {
1537
+ return "ID must be defined";
1538
+ }
1539
+ if (!isStandalone && id != registeredId) {
1540
+ return "ID must be unique";
1541
+ }
1542
+ return void 0;
1543
+ })()
1530
1544
  });
1531
1545
  const listboxItem = /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues$j({ key: registeredId, id: registeredId }, rest), ({
1532
1546
  isHovered,
@@ -1602,11 +1616,11 @@ function registerListBoxItem(loader, overrides) {
1602
1616
  props: {
1603
1617
  id: {
1604
1618
  type: "string",
1605
- description: "The id of the item",
1619
+ description: "The ID of the item",
1606
1620
  required: true,
1607
1621
  validator: (_value, _props, ctx) => {
1608
- if (ctx == null ? void 0 : ctx.hasDuplicateId) {
1609
- return "Please make sure the id is unique!";
1622
+ if (ctx == null ? void 0 : ctx.idError) {
1623
+ return ctx.idError;
1610
1624
  }
1611
1625
  return true;
1612
1626
  }
@@ -2089,7 +2103,7 @@ function registerPopover(loader, overrides) {
2089
2103
  shouldFlip: {
2090
2104
  type: "boolean",
2091
2105
  description: "Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.",
2092
- defaultValueHint: (_ps, ctx) => {
2106
+ defaultValueHint: (_props, ctx) => {
2093
2107
  var _a;
2094
2108
  return (_a = ctx == null ? void 0 : ctx.defaultShouldFlip) != null ? _a : true;
2095
2109
  }
@@ -2192,6 +2206,13 @@ function registerComboBox(loader) {
2192
2206
  // React Aria ComboBox do not support multiple comboBoxions yet
2193
2207
  multiSelect: false
2194
2208
  },
2209
+ disabledKeys: {
2210
+ type: "choice",
2211
+ description: "The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.",
2212
+ options: (_props, ctx) => (ctx == null ? void 0 : ctx.itemIds) ? Array.from(ctx.itemIds) : [],
2213
+ multiSelect: true,
2214
+ advanced: true
2215
+ },
2195
2216
  isOpen: {
2196
2217
  type: "boolean",
2197
2218
  defaultValue: false,
@@ -3079,6 +3100,7 @@ function BaseSelect(props) {
3079
3100
  className,
3080
3101
  style,
3081
3102
  children,
3103
+ disabledKeys,
3082
3104
  name,
3083
3105
  isOpen,
3084
3106
  setControlContextData,
@@ -3105,6 +3127,7 @@ function BaseSelect(props) {
3105
3127
  className,
3106
3128
  style,
3107
3129
  name,
3130
+ disabledKeys,
3108
3131
  "aria-label": ariaLabel,
3109
3132
  isOpen: openProp
3110
3133
  }, extractPlasmicDataProps(props)),
@@ -3139,7 +3162,7 @@ function registerSelect(loader) {
3139
3162
  value: "Selected value..."
3140
3163
  }
3141
3164
  ],
3142
- hidden: (ps) => !ps.customize
3165
+ hidden: (props) => !props.customize
3143
3166
  },
3144
3167
  className: {
3145
3168
  type: "class",
@@ -3492,7 +3515,7 @@ function registerSliderThumb(loader, overrides) {
3492
3515
  children: {
3493
3516
  type: "slot",
3494
3517
  mergeWithParent: true,
3495
- hidden: (ps) => !ps.advanced
3518
+ hidden: (props) => !props.advanced
3496
3519
  }
3497
3520
  }),
3498
3521
  trapsFocus: true