@plasmicpkgs/react-aria 0.0.73 → 0.0.75

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 (32) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/react-aria.esm.js +50 -11
  3. package/dist/react-aria.esm.js.map +1 -1
  4. package/dist/react-aria.js +50 -11
  5. package/dist/react-aria.js.map +1 -1
  6. package/dist/registerComboBox.d.ts +5 -1
  7. package/dist/registerSelect.d.ts +5 -1
  8. package/package.json +2 -2
  9. package/skinny/registerComboBox.cjs.js +34 -14
  10. package/skinny/registerComboBox.cjs.js.map +1 -1
  11. package/skinny/registerComboBox.d.ts +5 -1
  12. package/skinny/registerComboBox.esm.js +32 -12
  13. package/skinny/registerComboBox.esm.js.map +1 -1
  14. package/skinny/{registerListBox-3beb3a9f.esm.js → registerListBox-64bcf3d2.esm.js} +83 -5
  15. package/skinny/registerListBox-64bcf3d2.esm.js.map +1 -0
  16. package/skinny/{registerListBox-3f613b40.cjs.js → registerListBox-c2c63064.cjs.js} +86 -6
  17. package/skinny/registerListBox-c2c63064.cjs.js.map +1 -0
  18. package/skinny/registerListBox.cjs.js +6 -7
  19. package/skinny/registerListBox.cjs.js.map +1 -1
  20. package/skinny/registerListBox.esm.js +2 -3
  21. package/skinny/registerListBox.esm.js.map +1 -1
  22. package/skinny/registerSection.cjs.js +12 -78
  23. package/skinny/registerSection.cjs.js.map +1 -1
  24. package/skinny/registerSection.esm.js +10 -76
  25. package/skinny/registerSection.esm.js.map +1 -1
  26. package/skinny/registerSelect.cjs.js +13 -5
  27. package/skinny/registerSelect.cjs.js.map +1 -1
  28. package/skinny/registerSelect.d.ts +5 -1
  29. package/skinny/registerSelect.esm.js +12 -4
  30. package/skinny/registerSelect.esm.js.map +1 -1
  31. package/skinny/registerListBox-3beb3a9f.esm.js.map +0 -1
  32. package/skinny/registerListBox-3f613b40.cjs.js.map +0 -1
@@ -1771,8 +1771,17 @@ var __objRest$g = (source, exclude) => {
1771
1771
  function BaseSection(props) {
1772
1772
  const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
1773
1773
  const contextProps = React.useContext(PlasmicListBoxContext);
1774
+ const isStandalone = !contextProps;
1774
1775
  const mergedProps = mergeProps$1(contextProps, rest);
1775
- return /* @__PURE__ */ React.createElement(Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React.createElement(Header, null, header), items);
1776
+ const section = /* @__PURE__ */ React.createElement(Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React.createElement(Header, null, header), items);
1777
+ if (isStandalone) {
1778
+ return (
1779
+ // BaseListbox should give section a listbox context (that it can't be used without)
1780
+ // as well as the id manager (that is needed to identify and warn about duplication of ids)
1781
+ /* @__PURE__ */ React.createElement(BaseListBox, null, section)
1782
+ );
1783
+ }
1784
+ return section;
1776
1785
  }
1777
1786
  function registerSection(loader, overrides) {
1778
1787
  return registerComponentHelper(
@@ -2272,6 +2281,8 @@ var __objRest$d = (source, exclude) => {
2272
2281
  return target;
2273
2282
  };
2274
2283
  const COMBOBOX_NAME = makeComponentName("combobox");
2284
+ const COMBOBOX_VARIANTS = ["disabled"];
2285
+ const { variants: COMBOBOX_VARIANTS_DATA } = pickAriaComponentVariants(COMBOBOX_VARIANTS);
2275
2286
  function ComboboxAutoOpen(props) {
2276
2287
  var _a;
2277
2288
  const { open, close } = (_a = React.useContext(ComboBoxStateContext)) != null ? _a : {};
@@ -2282,10 +2293,16 @@ function BaseComboBox(props) {
2282
2293
  const _a = props, {
2283
2294
  children,
2284
2295
  setControlContextData,
2296
+ plasmicUpdateVariant,
2297
+ className,
2298
+ isDisabled,
2285
2299
  isOpen: _isOpen
2286
2300
  } = _a, rest = __objRest$d(_a, [
2287
2301
  "children",
2288
2302
  "setControlContextData",
2303
+ "plasmicUpdateVariant",
2304
+ "className",
2305
+ "isDisabled",
2289
2306
  "isOpen"
2290
2307
  ]);
2291
2308
  const idManager = useMemo(() => new ListBoxItemIdManager(), []);
@@ -2296,15 +2313,27 @@ function BaseComboBox(props) {
2296
2313
  });
2297
2314
  });
2298
2315
  }, []);
2299
- return /* @__PURE__ */ React.createElement(ComboBox, __spreadValues$e({}, rest), /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React.createElement(
2300
- PlasmicListBoxContext.Provider,
2301
- {
2302
- value: {
2303
- idManager
2304
- }
2305
- },
2306
- /* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React.createElement(ComboboxAutoOpen, __spreadValues$e({}, props)), children)
2307
- )));
2316
+ useEffect(() => {
2317
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
2318
+ disabled: isDisabled
2319
+ });
2320
+ }, [isDisabled, plasmicUpdateVariant]);
2321
+ return /* @__PURE__ */ React.createElement(
2322
+ ComboBox,
2323
+ __spreadValues$e({
2324
+ isDisabled,
2325
+ className
2326
+ }, rest),
2327
+ /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React.createElement(
2328
+ PlasmicListBoxContext.Provider,
2329
+ {
2330
+ value: {
2331
+ idManager
2332
+ }
2333
+ },
2334
+ /* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React.createElement(ComboboxAutoOpen, __spreadValues$e({}, props)), children)
2335
+ ))
2336
+ );
2308
2337
  }
2309
2338
  function registerComboBox(loader) {
2310
2339
  registerComponentHelper(loader, BaseComboBox, {
@@ -2312,6 +2341,7 @@ function registerComboBox(loader) {
2312
2341
  displayName: "Aria ComboBox",
2313
2342
  importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
2314
2343
  importName: "BaseComboBox",
2344
+ variants: COMBOBOX_VARIANTS_DATA,
2315
2345
  props: __spreadProps$9(__spreadValues$e({}, getCommonProps("ComboBox", [
2316
2346
  "name",
2317
2347
  "aria-label",
@@ -3158,6 +3188,8 @@ const BaseSelectValue = (props) => {
3158
3188
  return /* @__PURE__ */ React.createElement(SelectValue, { className }, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React.createElement(React.Fragment, null, isPlaceholder ? placeholder : selectedText));
3159
3189
  };
3160
3190
  const SELECT_NAME = makeComponentName("select");
3191
+ const SELECT_VARIANTS = ["disabled"];
3192
+ const { variants: SELECT_VARIANTS_DATA } = pickAriaComponentVariants(SELECT_VARIANTS);
3161
3193
  function BaseSelect(props) {
3162
3194
  const {
3163
3195
  selectedKey,
@@ -3171,9 +3203,10 @@ function BaseSelect(props) {
3171
3203
  disabledKeys,
3172
3204
  name,
3173
3205
  setControlContextData,
3206
+ plasmicUpdateVariant,
3174
3207
  "aria-label": ariaLabel
3175
3208
  } = props;
3176
- let idManager = useMemo(() => new ListBoxItemIdManager(), []);
3209
+ const idManager = useMemo(() => new ListBoxItemIdManager(), []);
3177
3210
  useEffect(() => {
3178
3211
  idManager.subscribe((ids) => {
3179
3212
  setControlContextData == null ? void 0 : setControlContextData({
@@ -3181,6 +3214,11 @@ function BaseSelect(props) {
3181
3214
  });
3182
3215
  });
3183
3216
  }, []);
3217
+ useEffect(() => {
3218
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
3219
+ disabled: isDisabled
3220
+ });
3221
+ }, [isDisabled, plasmicUpdateVariant]);
3184
3222
  return /* @__PURE__ */ React.createElement(
3185
3223
  Select,
3186
3224
  __spreadValues$8({
@@ -3237,6 +3275,7 @@ function registerSelect(loader) {
3237
3275
  displayName: "Aria Select",
3238
3276
  importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
3239
3277
  importName: "BaseSelect",
3278
+ variants: SELECT_VARIANTS_DATA,
3240
3279
  props: __spreadProps$4(__spreadValues$8({}, getCommonProps("Select", [
3241
3280
  "name",
3242
3281
  "aria-label",