@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
@@ -1779,8 +1779,17 @@ var __objRest$g = (source, exclude) => {
1779
1779
  function BaseSection(props) {
1780
1780
  const _a = props, { header, items } = _a, rest = __objRest$g(_a, ["header", "items"]);
1781
1781
  const contextProps = React__default.default.useContext(PlasmicListBoxContext);
1782
+ const isStandalone = !contextProps;
1782
1783
  const mergedProps = utils.mergeProps(contextProps, rest);
1783
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, null, header), items);
1784
+ const section = /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Section, __spreadValues$h({}, mergedProps), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Header, null, header), items);
1785
+ if (isStandalone) {
1786
+ return (
1787
+ // BaseListbox should give section a listbox context (that it can't be used without)
1788
+ // as well as the id manager (that is needed to identify and warn about duplication of ids)
1789
+ /* @__PURE__ */ React__default.default.createElement(BaseListBox, null, section)
1790
+ );
1791
+ }
1792
+ return section;
1784
1793
  }
1785
1794
  function registerSection(loader, overrides) {
1786
1795
  return registerComponentHelper(
@@ -2280,6 +2289,8 @@ var __objRest$d = (source, exclude) => {
2280
2289
  return target;
2281
2290
  };
2282
2291
  const COMBOBOX_NAME = makeComponentName("combobox");
2292
+ const COMBOBOX_VARIANTS = ["disabled"];
2293
+ const { variants: COMBOBOX_VARIANTS_DATA } = pickAriaComponentVariants(COMBOBOX_VARIANTS);
2283
2294
  function ComboboxAutoOpen(props) {
2284
2295
  var _a;
2285
2296
  const { open, close } = (_a = React__default.default.useContext(reactAriaComponents.ComboBoxStateContext)) != null ? _a : {};
@@ -2290,10 +2301,16 @@ function BaseComboBox(props) {
2290
2301
  const _a = props, {
2291
2302
  children,
2292
2303
  setControlContextData,
2304
+ plasmicUpdateVariant,
2305
+ className,
2306
+ isDisabled,
2293
2307
  isOpen: _isOpen
2294
2308
  } = _a, rest = __objRest$d(_a, [
2295
2309
  "children",
2296
2310
  "setControlContextData",
2311
+ "plasmicUpdateVariant",
2312
+ "className",
2313
+ "isDisabled",
2297
2314
  "isOpen"
2298
2315
  ]);
2299
2316
  const idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
@@ -2304,15 +2321,27 @@ function BaseComboBox(props) {
2304
2321
  });
2305
2322
  });
2306
2323
  }, []);
2307
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ComboBox, __spreadValues$e({}, rest), /* @__PURE__ */ React__default.default.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React__default.default.createElement(
2308
- PlasmicListBoxContext.Provider,
2309
- {
2310
- value: {
2311
- idManager
2312
- }
2313
- },
2314
- /* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React__default.default.createElement(ComboboxAutoOpen, __spreadValues$e({}, props)), children)
2315
- )));
2324
+ React.useEffect(() => {
2325
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
2326
+ disabled: isDisabled
2327
+ });
2328
+ }, [isDisabled, plasmicUpdateVariant]);
2329
+ return /* @__PURE__ */ React__default.default.createElement(
2330
+ reactAriaComponents.ComboBox,
2331
+ __spreadValues$e({
2332
+ isDisabled,
2333
+ className
2334
+ }, rest),
2335
+ /* @__PURE__ */ React__default.default.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React__default.default.createElement(
2336
+ PlasmicListBoxContext.Provider,
2337
+ {
2338
+ value: {
2339
+ idManager
2340
+ }
2341
+ },
2342
+ /* @__PURE__ */ React__default.default.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React__default.default.createElement(ComboboxAutoOpen, __spreadValues$e({}, props)), children)
2343
+ ))
2344
+ );
2316
2345
  }
2317
2346
  function registerComboBox(loader) {
2318
2347
  registerComponentHelper(loader, BaseComboBox, {
@@ -2320,6 +2349,7 @@ function registerComboBox(loader) {
2320
2349
  displayName: "Aria ComboBox",
2321
2350
  importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
2322
2351
  importName: "BaseComboBox",
2352
+ variants: COMBOBOX_VARIANTS_DATA,
2323
2353
  props: __spreadProps$9(__spreadValues$e({}, getCommonProps("ComboBox", [
2324
2354
  "name",
2325
2355
  "aria-label",
@@ -3166,6 +3196,8 @@ const BaseSelectValue = (props) => {
3166
3196
  return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.SelectValue, { className }, ({ isPlaceholder, selectedText }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isPlaceholder ? placeholder : selectedText));
3167
3197
  };
3168
3198
  const SELECT_NAME = makeComponentName("select");
3199
+ const SELECT_VARIANTS = ["disabled"];
3200
+ const { variants: SELECT_VARIANTS_DATA } = pickAriaComponentVariants(SELECT_VARIANTS);
3169
3201
  function BaseSelect(props) {
3170
3202
  const {
3171
3203
  selectedKey,
@@ -3179,9 +3211,10 @@ function BaseSelect(props) {
3179
3211
  disabledKeys,
3180
3212
  name,
3181
3213
  setControlContextData,
3214
+ plasmicUpdateVariant,
3182
3215
  "aria-label": ariaLabel
3183
3216
  } = props;
3184
- let idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
3217
+ const idManager = React.useMemo(() => new ListBoxItemIdManager(), []);
3185
3218
  React.useEffect(() => {
3186
3219
  idManager.subscribe((ids) => {
3187
3220
  setControlContextData == null ? void 0 : setControlContextData({
@@ -3189,6 +3222,11 @@ function BaseSelect(props) {
3189
3222
  });
3190
3223
  });
3191
3224
  }, []);
3225
+ React.useEffect(() => {
3226
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
3227
+ disabled: isDisabled
3228
+ });
3229
+ }, [isDisabled, plasmicUpdateVariant]);
3192
3230
  return /* @__PURE__ */ React__default.default.createElement(
3193
3231
  reactAriaComponents.Select,
3194
3232
  __spreadValues$8({
@@ -3245,6 +3283,7 @@ function registerSelect(loader) {
3245
3283
  displayName: "Aria Select",
3246
3284
  importPath: "@plasmicpkgs/react-aria/skinny/registerSelect",
3247
3285
  importName: "BaseSelect",
3286
+ variants: SELECT_VARIANTS_DATA,
3248
3287
  props: __spreadProps$4(__spreadValues$8({}, getCommonProps("Select", [
3249
3288
  "name",
3250
3289
  "aria-label",