@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
@@ -1,13 +1,17 @@
1
1
  import React from "react";
2
2
  import { ComboBoxProps } from "react-aria-components";
3
3
  import { HasControlContextData, Registerable } from "./utils";
4
+ import { WithVariants } from "./variant-utils";
4
5
  export interface BaseComboboxControlContextData {
5
6
  itemIds: string[];
6
7
  }
7
- export interface BaseComboboxProps extends ComboBoxProps<{}>, HasControlContextData<BaseComboboxControlContextData> {
8
+ declare const COMBOBOX_VARIANTS: "disabled"[];
9
+ export interface BaseComboboxProps extends ComboBoxProps<{}>, WithVariants<typeof COMBOBOX_VARIANTS>, HasControlContextData<BaseComboboxControlContextData> {
8
10
  placeholder?: string;
9
11
  children?: React.ReactNode;
10
12
  isOpen?: boolean;
13
+ className?: string;
11
14
  }
12
15
  export declare function BaseComboBox(props: BaseComboboxProps): React.JSX.Element;
13
16
  export declare function registerComboBox(loader?: Registerable): void;
17
+ export {};
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { SelectProps, SelectValue } from "react-aria-components";
3
3
  import { HasControlContextData, Registerable } from "./utils";
4
+ import { WithVariants } from "./variant-utils";
4
5
  export interface BaseSelectValueProps extends React.ComponentProps<typeof SelectValue> {
5
6
  customize?: boolean;
6
7
  }
@@ -8,9 +9,12 @@ export declare const BaseSelectValue: (props: BaseSelectValueProps) => React.JSX
8
9
  export interface BaseSelectControlContextData {
9
10
  itemIds: string[];
10
11
  }
12
+ declare const SELECT_VARIANTS: "disabled"[];
11
13
  export interface BaseSelectProps extends SelectProps<{}>, // NOTE: We don't need generic type here since we don't use items prop (that needs it). We just need to make the type checker happy
12
- HasControlContextData<BaseSelectControlContextData> {
14
+ WithVariants<typeof SELECT_VARIANTS>, HasControlContextData<BaseSelectControlContextData> {
13
15
  children?: React.ReactNode;
16
+ className?: string;
14
17
  }
15
18
  export declare function BaseSelect(props: BaseSelectProps): React.JSX.Element;
16
19
  export declare function registerSelect(loader?: Registerable): void;
20
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicpkgs/react-aria",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "Plasmic registration calls for react-aria based components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "32727a31ab14703a432dc386322e93a46f9deb35"
77
+ "gitHead": "42e49740d9e9a5b84048a3f2d0ec4baf668833ff"
78
78
  }
@@ -4,17 +4,16 @@ var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
5
  var common = require('./common-f6de262a.cjs.js');
6
6
  var contexts = require('./contexts-baa37b74.cjs.js');
7
- var registerListBox = require('./registerListBox-3f613b40.cjs.js');
7
+ var registerSection = require('./registerListBox-c2c63064.cjs.js');
8
8
  var registerButton = require('./registerButton.cjs.js');
9
9
  var registerInput = require('./registerInput.cjs.js');
10
10
  var registerLabel = require('./registerLabel.cjs.js');
11
11
  var registerPopover = require('./registerPopover.cjs.js');
12
12
  var utils = require('./utils-3e796b18.cjs.js');
13
+ var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
13
14
  require('./registerListBoxItem.cjs.js');
14
15
  require('./registerDescription.cjs.js');
15
16
  require('./registerText.cjs.js');
16
- require('./variant-utils-8cb38f8f.cjs.js');
17
- require('./registerSection.cjs.js');
18
17
  require('@react-aria/utils');
19
18
  require('react-aria');
20
19
  require('@plasmicapp/host');
@@ -56,6 +55,8 @@ var __objRest = (source, exclude) => {
56
55
  return target;
57
56
  };
58
57
  const COMBOBOX_NAME = utils.makeComponentName("combobox");
58
+ const COMBOBOX_VARIANTS = ["disabled"];
59
+ const { variants: COMBOBOX_VARIANTS_DATA } = variantUtils.pickAriaComponentVariants(COMBOBOX_VARIANTS);
59
60
  function ComboboxAutoOpen(props) {
60
61
  var _a;
61
62
  const { open, close } = (_a = React__default.default.useContext(reactAriaComponents.ComboBoxStateContext)) != null ? _a : {};
@@ -66,13 +67,19 @@ function BaseComboBox(props) {
66
67
  const _a = props, {
67
68
  children,
68
69
  setControlContextData,
70
+ plasmicUpdateVariant,
71
+ className,
72
+ isDisabled,
69
73
  isOpen: _isOpen
70
74
  } = _a, rest = __objRest(_a, [
71
75
  "children",
72
76
  "setControlContextData",
77
+ "plasmicUpdateVariant",
78
+ "className",
79
+ "isDisabled",
73
80
  "isOpen"
74
81
  ]);
75
- const idManager = React.useMemo(() => new registerListBox.ListBoxItemIdManager(), []);
82
+ const idManager = React.useMemo(() => new registerSection.ListBoxItemIdManager(), []);
76
83
  React.useEffect(() => {
77
84
  idManager.subscribe((ids) => {
78
85
  setControlContextData == null ? void 0 : setControlContextData({
@@ -80,15 +87,27 @@ function BaseComboBox(props) {
80
87
  });
81
88
  });
82
89
  }, []);
83
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ComboBox, __spreadValues({}, rest), /* @__PURE__ */ React__default.default.createElement(contexts.PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React__default.default.createElement(
84
- contexts.PlasmicListBoxContext.Provider,
85
- {
86
- value: {
87
- idManager
88
- }
89
- },
90
- /* @__PURE__ */ React__default.default.createElement(contexts.PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React__default.default.createElement(ComboboxAutoOpen, __spreadValues({}, props)), children)
91
- )));
90
+ React.useEffect(() => {
91
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
92
+ disabled: isDisabled
93
+ });
94
+ }, [isDisabled, plasmicUpdateVariant]);
95
+ return /* @__PURE__ */ React__default.default.createElement(
96
+ reactAriaComponents.ComboBox,
97
+ __spreadValues({
98
+ isDisabled,
99
+ className
100
+ }, rest),
101
+ /* @__PURE__ */ React__default.default.createElement(contexts.PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React__default.default.createElement(
102
+ contexts.PlasmicListBoxContext.Provider,
103
+ {
104
+ value: {
105
+ idManager
106
+ }
107
+ },
108
+ /* @__PURE__ */ React__default.default.createElement(contexts.PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React__default.default.createElement(ComboboxAutoOpen, __spreadValues({}, props)), children)
109
+ ))
110
+ );
92
111
  }
93
112
  function registerComboBox(loader) {
94
113
  utils.registerComponentHelper(loader, BaseComboBox, {
@@ -96,6 +115,7 @@ function registerComboBox(loader) {
96
115
  displayName: "Aria ComboBox",
97
116
  importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
98
117
  importName: "BaseComboBox",
118
+ variants: COMBOBOX_VARIANTS_DATA,
99
119
  props: __spreadProps(__spreadValues({}, common.getCommonProps("ComboBox", [
100
120
  "name",
101
121
  "aria-label",
@@ -195,7 +215,7 @@ function registerComboBox(loader) {
195
215
  children: [
196
216
  {
197
217
  type: "component",
198
- name: registerListBox.LIST_BOX_COMPONENT_NAME,
218
+ name: registerSection.LIST_BOX_COMPONENT_NAME,
199
219
  props: {
200
220
  selectionMode: "single"
201
221
  },
@@ -1 +1 @@
1
- {"version":3,"file":"registerComboBox.cjs.js","sources":["../src/registerComboBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport {\n ComboBox,\n ComboBoxProps,\n ComboBoxStateContext,\n} from \"react-aria-components\";\nimport { getCommonProps } from \"./common\";\nimport {\n PlasmicInputContext,\n PlasmicListBoxContext,\n PlasmicPopoverContext,\n} from \"./contexts\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport { BUTTON_COMPONENT_NAME } from \"./registerButton\";\nimport { INPUT_COMPONENT_NAME } from \"./registerInput\";\nimport { LABEL_COMPONENT_NAME } from \"./registerLabel\";\nimport { LIST_BOX_COMPONENT_NAME } from \"./registerListBox\";\nimport { POPOVER_COMPONENT_NAME } from \"./registerPopover\";\nimport {\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n useAutoOpen,\n} from \"./utils\";\n\nconst COMBOBOX_NAME = makeComponentName(\"combobox\");\n\nexport interface BaseComboboxControlContextData {\n itemIds: string[];\n}\n\nexport interface BaseComboboxProps\n extends ComboBoxProps<{}>,\n HasControlContextData<BaseComboboxControlContextData> {\n placeholder?: string;\n children?: React.ReactNode;\n isOpen?: boolean;\n}\n\n/*\n This React Hook is used to help with auto-opening the combobox when the canvas component is selected.\n Currently, there is a bug in react-aria combobox (https://github.com/adobe/react-spectrum/issues/7149) where, when the combobox's popover is auto-opened, it is unable to render any listbox items.\n Setting popover's open state to true in not enough unless, unless it has previously been opened via user interaction with combobox.\n Also, <Combobox> does not support an `isOpen` prop either.\n\n So, we use this custom hook to access the combobox's internal state via ComboBoxStateContext and change the `open` state manually via tha available `open` method.\n\n Note: It cannot be used as a hook like useAutoOpen() within the BaseSelect component\n because it needs access to SelectStateContext, which is only created in the BaseSelect component's render function.\n */\nfunction ComboboxAutoOpen(props: any) {\n const { open, close } = React.useContext(ComboBoxStateContext) ?? {};\n\n useAutoOpen({ props, open, close });\n\n return null;\n}\n\nexport function BaseComboBox(props: BaseComboboxProps) {\n const {\n children,\n setControlContextData,\n isOpen: _isOpen, // uncontrolled if not selected in canvas/edit mode\n ...rest\n } = props;\n\n const idManager = useMemo(() => new ListBoxItemIdManager(), []);\n\n useEffect(() => {\n idManager.subscribe((ids: string[]) => {\n setControlContextData?.({\n itemIds: ids,\n });\n });\n }, []);\n\n return (\n <ComboBox {...rest}>\n <PlasmicPopoverContext.Provider value={{}}>\n <PlasmicListBoxContext.Provider\n value={{\n idManager,\n }}\n >\n <PlasmicInputContext.Provider value={{ isUncontrolled: true }}>\n <ComboboxAutoOpen {...props} />\n {children}\n </PlasmicInputContext.Provider>\n </PlasmicListBoxContext.Provider>\n </PlasmicPopoverContext.Provider>\n </ComboBox>\n );\n}\n\nexport function registerComboBox(loader?: Registerable) {\n registerComponentHelper(loader, BaseComboBox, {\n name: COMBOBOX_NAME,\n displayName: \"Aria ComboBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerComboBox\",\n importName: \"BaseComboBox\",\n props: {\n ...getCommonProps<BaseComboboxProps>(\"ComboBox\", [\n \"name\",\n \"aria-label\",\n \"placeholder\",\n \"isDisabled\",\n ]),\n selectedKey: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKey\",\n displayName: \"Initial selected item\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n // React Aria ComboBox do not support multiple selections yet\n multiSelect: false,\n },\n disabledKeys: {\n type: \"choice\",\n displayName: \"Disabled values\",\n description:\n \"The items that are disabled. These items cannot be selected, focused, or otherwise interacted with.\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n multiSelect: true,\n advanced: true,\n },\n isOpen: {\n type: \"boolean\",\n defaultValue: false,\n // It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.\n hidden: () => true,\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectedValue\", type: \"string\" }],\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"vbox\",\n styles: {\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n width: \"300px\",\n padding: 0,\n },\n children: [\n {\n type: \"component\",\n name: LABEL_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n {\n type: \"hbox\",\n children: [\n {\n type: \"component\",\n name: INPUT_COMPONENT_NAME,\n styles: {\n width: \"100%\",\n },\n },\n {\n type: \"component\",\n name: BUTTON_COMPONENT_NAME,\n props: {\n children: {\n type: \"img\",\n // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n width: \"15px\",\n transform: \"rotate(180deg)\",\n },\n },\n },\n },\n ],\n },\n {\n type: \"component\",\n name: POPOVER_COMPONENT_NAME,\n styles: {\n backgroundColor: \"white\",\n padding: \"10px\",\n overflow: \"scroll\",\n },\n props: {\n offset: 0,\n children: [\n {\n type: \"component\",\n name: LIST_BOX_COMPONENT_NAME,\n props: {\n selectionMode: \"single\",\n },\n styles: {\n borderWidth: 0,\n width: \"stretch\",\n },\n },\n ],\n },\n },\n ],\n },\n ],\n },\n },\n states: {\n selectedValue: {\n type: \"writable\",\n valueProp: \"selectedKey\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n });\n}\n"],"names":["makeComponentName","ComboBoxStateContext","useAutoOpen","useMemo","ListBoxItemIdManager","useEffect","React","ComboBox","PlasmicPopoverContext","PlasmicListBoxContext","PlasmicInputContext","registerComponentHelper","getCommonProps","LABEL_COMPONENT_NAME","INPUT_COMPONENT_NAME","BUTTON_COMPONENT_NAME","POPOVER_COMPONENT_NAME","LIST_BOX_COMPONENT_NAME"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,aAAA,GAAgBA,wBAAkB,UAAU,CAAA,CAAA;AAyBlD,SAAS,iBAAiB,KAAY,EAAA;AAnDtC,EAAA,IAAA,EAAA,CAAA;AAoDE,EAAM,MAAA,EAAE,MAAM,KAAM,EAAA,GAAA,CAAI,4BAAM,UAAW,CAAAC,wCAAoB,CAArC,KAAA,IAAA,GAAA,EAAA,GAA0C,EAAC,CAAA;AAEnE,EAAAC,iBAAA,CAAY,EAAE,KAAA,EAAO,IAAM,EAAA,KAAA,EAAO,CAAA,CAAA;AAElC,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEO,SAAS,aAAa,KAA0B,EAAA;AACrD,EAAA,MAKI,EAJF,GAAA,KAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,MAAQ,EAAA,OAAA;AAA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AM,EAAA,WAAA;AAAA,gBACN,IAAM,EAAAC,sCAAA;AAAA,gBACN,MAAQ,EAAA;AAAA,kBACN,eAAiB,EAAA,OAAA;AAAA,kBACjB,OAAS,EAAA,MAAA;AAAA,kBACT,QAAU,EAAA,QAAA;AAAA,iBACZ;AAAA,gBACA,KAAO,EAAA;AAAA,kBACL,MAAQ,EAAA,CAAA;AAAA,kBACR,QAAU,EAAA;AAAA,oBACR;AAAA,sBACE,IAAM,EAAA,WAAA;AAAA,sBACN,IAAM,EAAAC,uCAAA;AAAA,sBACN,KAAO,EAAA;AAAA,wBACL,aAAe,EAAA,QAAA;AAAA,uBACjB;AAAA,sBACA,MAAQ,EAAA;AAAA,wBACN,WAAa,EAAA,CAAA;AAAA,wBACb,KAAO,EAAA,SAAA;AAAA,uBACT;AAAA,qBACF;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,aAAe,EAAA;AAAA,QACb,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,aAAA;AAAA,QACX,YAAc,EAAA,mBAAA;AAAA,QACd,YAAc,EAAA,MAAA;AAAA,OAChB;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,QAAA;AAAA,QACX,YAAc,EAAA,cAAA;AAAA,QACd,YAAc,EAAA,SAAA;AAAA,OAChB;AAAA,KACF;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;;"}
1
+ {"version":3,"file":"registerComboBox.cjs.js","sources":["../src/registerComboBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport {\n ComboBox,\n ComboBoxProps,\n ComboBoxStateContext,\n} from \"react-aria-components\";\nimport { getCommonProps } from \"./common\";\nimport {\n PlasmicInputContext,\n PlasmicListBoxContext,\n PlasmicPopoverContext,\n} from \"./contexts\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport { BUTTON_COMPONENT_NAME } from \"./registerButton\";\nimport { INPUT_COMPONENT_NAME } from \"./registerInput\";\nimport { LABEL_COMPONENT_NAME } from \"./registerLabel\";\nimport { LIST_BOX_COMPONENT_NAME } from \"./registerListBox\";\nimport { POPOVER_COMPONENT_NAME } from \"./registerPopover\";\nimport {\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n useAutoOpen,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\nconst COMBOBOX_NAME = makeComponentName(\"combobox\");\n\nexport interface BaseComboboxControlContextData {\n itemIds: string[];\n}\n\nconst COMBOBOX_VARIANTS = [\"disabled\" as const];\n\nconst { variants: COMBOBOX_VARIANTS_DATA } =\n pickAriaComponentVariants(COMBOBOX_VARIANTS);\n\nexport interface BaseComboboxProps\n extends ComboBoxProps<{}>,\n WithVariants<typeof COMBOBOX_VARIANTS>,\n HasControlContextData<BaseComboboxControlContextData> {\n placeholder?: string;\n children?: React.ReactNode;\n isOpen?: boolean;\n className?: string;\n}\n\n/*\n This React Hook is used to help with auto-opening the combobox when the canvas component is selected.\n Currently, there is a bug in react-aria combobox (https://github.com/adobe/react-spectrum/issues/7149) where, when the combobox's popover is auto-opened, it is unable to render any listbox items.\n Setting popover's open state to true in not enough unless, unless it has previously been opened via user interaction with combobox.\n Also, <Combobox> does not support an `isOpen` prop either.\n\n So, we use this custom hook to access the combobox's internal state via ComboBoxStateContext and change the `open` state manually via tha available `open` method.\n\n Note: It cannot be used as a hook like useAutoOpen() within the BaseSelect component\n because it needs access to SelectStateContext, which is only created in the BaseSelect component's render function.\n */\nfunction ComboboxAutoOpen(props: any) {\n const { open, close } = React.useContext(ComboBoxStateContext) ?? {};\n\n useAutoOpen({ props, open, close });\n\n return null;\n}\n\nexport function BaseComboBox(props: BaseComboboxProps) {\n const {\n children,\n setControlContextData,\n plasmicUpdateVariant,\n className,\n isDisabled,\n isOpen: _isOpen, // uncontrolled if not selected in canvas/edit mode\n ...rest\n } = props;\n\n const idManager = useMemo(() => new ListBoxItemIdManager(), []);\n\n useEffect(() => {\n idManager.subscribe((ids: string[]) => {\n setControlContextData?.({\n itemIds: ids,\n });\n });\n }, []);\n\n // NOTE: Aria <Combobox> does not support render props, neither does it provide an onDisabledChange event, so we have to manually update the disabled state.\n useEffect(() => {\n plasmicUpdateVariant?.({\n disabled: isDisabled,\n });\n }, [isDisabled, plasmicUpdateVariant]);\n\n return (\n <ComboBox\n isDisabled={isDisabled}\n // Not calling plasmicUpdateVariant within className callback (which has access to render props) because it would then run on every render\n className={className}\n {...rest}\n >\n <PlasmicPopoverContext.Provider value={{}}>\n <PlasmicListBoxContext.Provider\n value={{\n idManager,\n }}\n >\n <PlasmicInputContext.Provider value={{ isUncontrolled: true }}>\n <ComboboxAutoOpen {...props} />\n {children}\n </PlasmicInputContext.Provider>\n </PlasmicListBoxContext.Provider>\n </PlasmicPopoverContext.Provider>\n </ComboBox>\n );\n}\n\nexport function registerComboBox(loader?: Registerable) {\n registerComponentHelper(loader, BaseComboBox, {\n name: COMBOBOX_NAME,\n displayName: \"Aria ComboBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerComboBox\",\n importName: \"BaseComboBox\",\n variants: COMBOBOX_VARIANTS_DATA,\n props: {\n ...getCommonProps<BaseComboboxProps>(\"ComboBox\", [\n \"name\",\n \"aria-label\",\n \"placeholder\",\n \"isDisabled\",\n ]),\n selectedKey: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKey\",\n displayName: \"Initial selected item\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n // React Aria ComboBox do not support multiple selections yet\n multiSelect: false,\n },\n disabledKeys: {\n type: \"choice\",\n displayName: \"Disabled values\",\n description:\n \"The items that are disabled. These items cannot be selected, focused, or otherwise interacted with.\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n multiSelect: true,\n advanced: true,\n },\n isOpen: {\n type: \"boolean\",\n defaultValue: false,\n // It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.\n hidden: () => true,\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectedValue\", type: \"string\" }],\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"vbox\",\n styles: {\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n width: \"300px\",\n padding: 0,\n },\n children: [\n {\n type: \"component\",\n name: LABEL_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n {\n type: \"hbox\",\n children: [\n {\n type: \"component\",\n name: INPUT_COMPONENT_NAME,\n styles: {\n width: \"100%\",\n },\n },\n {\n type: \"component\",\n name: BUTTON_COMPONENT_NAME,\n props: {\n children: {\n type: \"img\",\n // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n width: \"15px\",\n transform: \"rotate(180deg)\",\n },\n },\n },\n },\n ],\n },\n {\n type: \"component\",\n name: POPOVER_COMPONENT_NAME,\n styles: {\n backgroundColor: \"white\",\n padding: \"10px\",\n overflow: \"scroll\",\n },\n props: {\n offset: 0,\n children: [\n {\n type: \"component\",\n name: LIST_BOX_COMPONENT_NAME,\n props: {\n selectionMode: \"single\",\n },\n styles: {\n borderWidth: 0,\n width: \"stretch\",\n },\n },\n ],\n },\n },\n ],\n },\n ],\n },\n },\n states: {\n selectedValue: {\n type: \"writable\",\n valueProp: \"selectedKey\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n });\n}\n"],"names":["makeComponentName","pickAriaComponentVariants","ComboBoxStateContext","useAutoOpen","useMemo","ListBoxItemIdManager","useEffect","React","ComboBox","PlasmicPopoverContext","PlasmicListBoxContext","PlasmicInputContext","registerComponentHelper","getCommonProps","LABEL_COMPONENT_NAME","INPUT_COMPONENT_NAME","BUTTON_COMPONENT_NAME","POPOVER_COMPONENT_NAME","LIST_BOX_COMPONENT_NAME"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,aAAA,GAAgBA,wBAAkB,UAAU,CAAA,CAAA;AAMlD,MAAM,iBAAA,GAAoB,CAAC,UAAmB,CAAA,CAAA;AAE9C,MAAM,EAAE,QAAA,EAAU,sBAAuB,EAAA,GACvCC,uCAA0B,iBAAiB,CAAA,CAAA;AAuB7C,SAAS,iBAAiB,KAAY,EAAA;AA3DtC,EAAA,IAAA,EAAA,CAAA;AA4DE,EAAM,MAAA,EAAE,MAAM,KAAM,EAAA,GAAA,CAAI,4BAAM,UAAW,CAAAC,wCAAoB,CAArC,KAAA,IAAA,GAAA,EAAA,GAA0C,EAAC,CAAA;AAEnE,EAAAC,iBAAA,CAAY,EAAE,KAAA,EAAO,IAAM,EAAA,KAAA,EAAO,CAAA,CAAA;AAElC,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEO,SAAS,aAAa,KAA0B,EAAA;AACrD,EAAA,MAQI,EAPF,GAAA,KAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,oBAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAQ,EAAA,OAAA;AAAA,GA1EZ,GA4EM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IANH,UAAA;AAAA,IACA,uBAAA;AAAA,IACA,sBAAA;AAAA,IACA,WAA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AA;AACH;;;;;"}
@@ -1,13 +1,17 @@
1
1
  import React from "react";
2
2
  import { ComboBoxProps } from "react-aria-components";
3
3
  import { HasControlContextData, Registerable } from "./utils";
4
+ import { WithVariants } from "./variant-utils";
4
5
  export interface BaseComboboxControlContextData {
5
6
  itemIds: string[];
6
7
  }
7
- export interface BaseComboboxProps extends ComboBoxProps<{}>, HasControlContextData<BaseComboboxControlContextData> {
8
+ declare const COMBOBOX_VARIANTS: "disabled"[];
9
+ export interface BaseComboboxProps extends ComboBoxProps<{}>, WithVariants<typeof COMBOBOX_VARIANTS>, HasControlContextData<BaseComboboxControlContextData> {
8
10
  placeholder?: string;
9
11
  children?: React.ReactNode;
10
12
  isOpen?: boolean;
13
+ className?: string;
11
14
  }
12
15
  export declare function BaseComboBox(props: BaseComboboxProps): React.JSX.Element;
13
16
  export declare function registerComboBox(loader?: Registerable): void;
17
+ export {};
@@ -2,17 +2,16 @@ import React, { useMemo, useEffect } from 'react';
2
2
  import { ComboBox, ComboBoxStateContext } from 'react-aria-components';
3
3
  import { g as getCommonProps } from './common-70efdf8a.esm.js';
4
4
  import { a as PlasmicPopoverContext, b as PlasmicListBoxContext, c as PlasmicInputContext } from './contexts-081d65a0.esm.js';
5
- import { L as ListBoxItemIdManager, a as LIST_BOX_COMPONENT_NAME } from './registerListBox-3beb3a9f.esm.js';
5
+ import { L as ListBoxItemIdManager, a as LIST_BOX_COMPONENT_NAME } from './registerListBox-64bcf3d2.esm.js';
6
6
  import { BUTTON_COMPONENT_NAME } from './registerButton.esm.js';
7
7
  import { INPUT_COMPONENT_NAME } from './registerInput.esm.js';
8
8
  import { LABEL_COMPONENT_NAME } from './registerLabel.esm.js';
9
9
  import { POPOVER_COMPONENT_NAME } from './registerPopover.esm.js';
10
10
  import { r as registerComponentHelper, a as makeComponentName, u as useAutoOpen } from './utils-25448fbd.esm.js';
11
+ import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
11
12
  import './registerListBoxItem.esm.js';
12
13
  import './registerDescription.esm.js';
13
14
  import './registerText.esm.js';
14
- import './variant-utils-7c2ea202.esm.js';
15
- import './registerSection.esm.js';
16
15
  import '@react-aria/utils';
17
16
  import 'react-aria';
18
17
  import '@plasmicapp/host';
@@ -50,6 +49,8 @@ var __objRest = (source, exclude) => {
50
49
  return target;
51
50
  };
52
51
  const COMBOBOX_NAME = makeComponentName("combobox");
52
+ const COMBOBOX_VARIANTS = ["disabled"];
53
+ const { variants: COMBOBOX_VARIANTS_DATA } = pickAriaComponentVariants(COMBOBOX_VARIANTS);
53
54
  function ComboboxAutoOpen(props) {
54
55
  var _a;
55
56
  const { open, close } = (_a = React.useContext(ComboBoxStateContext)) != null ? _a : {};
@@ -60,10 +61,16 @@ function BaseComboBox(props) {
60
61
  const _a = props, {
61
62
  children,
62
63
  setControlContextData,
64
+ plasmicUpdateVariant,
65
+ className,
66
+ isDisabled,
63
67
  isOpen: _isOpen
64
68
  } = _a, rest = __objRest(_a, [
65
69
  "children",
66
70
  "setControlContextData",
71
+ "plasmicUpdateVariant",
72
+ "className",
73
+ "isDisabled",
67
74
  "isOpen"
68
75
  ]);
69
76
  const idManager = useMemo(() => new ListBoxItemIdManager(), []);
@@ -74,15 +81,27 @@ function BaseComboBox(props) {
74
81
  });
75
82
  });
76
83
  }, []);
77
- return /* @__PURE__ */ React.createElement(ComboBox, __spreadValues({}, rest), /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React.createElement(
78
- PlasmicListBoxContext.Provider,
79
- {
80
- value: {
81
- idManager
82
- }
83
- },
84
- /* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React.createElement(ComboboxAutoOpen, __spreadValues({}, props)), children)
85
- )));
84
+ useEffect(() => {
85
+ plasmicUpdateVariant == null ? void 0 : plasmicUpdateVariant({
86
+ disabled: isDisabled
87
+ });
88
+ }, [isDisabled, plasmicUpdateVariant]);
89
+ return /* @__PURE__ */ React.createElement(
90
+ ComboBox,
91
+ __spreadValues({
92
+ isDisabled,
93
+ className
94
+ }, rest),
95
+ /* @__PURE__ */ React.createElement(PlasmicPopoverContext.Provider, { value: {} }, /* @__PURE__ */ React.createElement(
96
+ PlasmicListBoxContext.Provider,
97
+ {
98
+ value: {
99
+ idManager
100
+ }
101
+ },
102
+ /* @__PURE__ */ React.createElement(PlasmicInputContext.Provider, { value: { isUncontrolled: true } }, /* @__PURE__ */ React.createElement(ComboboxAutoOpen, __spreadValues({}, props)), children)
103
+ ))
104
+ );
86
105
  }
87
106
  function registerComboBox(loader) {
88
107
  registerComponentHelper(loader, BaseComboBox, {
@@ -90,6 +109,7 @@ function registerComboBox(loader) {
90
109
  displayName: "Aria ComboBox",
91
110
  importPath: "@plasmicpkgs/react-aria/skinny/registerComboBox",
92
111
  importName: "BaseComboBox",
112
+ variants: COMBOBOX_VARIANTS_DATA,
93
113
  props: __spreadProps(__spreadValues({}, getCommonProps("ComboBox", [
94
114
  "name",
95
115
  "aria-label",
@@ -1 +1 @@
1
- {"version":3,"file":"registerComboBox.esm.js","sources":["../src/registerComboBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport {\n ComboBox,\n ComboBoxProps,\n ComboBoxStateContext,\n} from \"react-aria-components\";\nimport { getCommonProps } from \"./common\";\nimport {\n PlasmicInputContext,\n PlasmicListBoxContext,\n PlasmicPopoverContext,\n} from \"./contexts\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport { BUTTON_COMPONENT_NAME } from \"./registerButton\";\nimport { INPUT_COMPONENT_NAME } from \"./registerInput\";\nimport { LABEL_COMPONENT_NAME } from \"./registerLabel\";\nimport { LIST_BOX_COMPONENT_NAME } from \"./registerListBox\";\nimport { POPOVER_COMPONENT_NAME } from \"./registerPopover\";\nimport {\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n useAutoOpen,\n} from \"./utils\";\n\nconst COMBOBOX_NAME = makeComponentName(\"combobox\");\n\nexport interface BaseComboboxControlContextData {\n itemIds: string[];\n}\n\nexport interface BaseComboboxProps\n extends ComboBoxProps<{}>,\n HasControlContextData<BaseComboboxControlContextData> {\n placeholder?: string;\n children?: React.ReactNode;\n isOpen?: boolean;\n}\n\n/*\n This React Hook is used to help with auto-opening the combobox when the canvas component is selected.\n Currently, there is a bug in react-aria combobox (https://github.com/adobe/react-spectrum/issues/7149) where, when the combobox's popover is auto-opened, it is unable to render any listbox items.\n Setting popover's open state to true in not enough unless, unless it has previously been opened via user interaction with combobox.\n Also, <Combobox> does not support an `isOpen` prop either.\n\n So, we use this custom hook to access the combobox's internal state via ComboBoxStateContext and change the `open` state manually via tha available `open` method.\n\n Note: It cannot be used as a hook like useAutoOpen() within the BaseSelect component\n because it needs access to SelectStateContext, which is only created in the BaseSelect component's render function.\n */\nfunction ComboboxAutoOpen(props: any) {\n const { open, close } = React.useContext(ComboBoxStateContext) ?? {};\n\n useAutoOpen({ props, open, close });\n\n return null;\n}\n\nexport function BaseComboBox(props: BaseComboboxProps) {\n const {\n children,\n setControlContextData,\n isOpen: _isOpen, // uncontrolled if not selected in canvas/edit mode\n ...rest\n } = props;\n\n const idManager = useMemo(() => new ListBoxItemIdManager(), []);\n\n useEffect(() => {\n idManager.subscribe((ids: string[]) => {\n setControlContextData?.({\n itemIds: ids,\n });\n });\n }, []);\n\n return (\n <ComboBox {...rest}>\n <PlasmicPopoverContext.Provider value={{}}>\n <PlasmicListBoxContext.Provider\n value={{\n idManager,\n }}\n >\n <PlasmicInputContext.Provider value={{ isUncontrolled: true }}>\n <ComboboxAutoOpen {...props} />\n {children}\n </PlasmicInputContext.Provider>\n </PlasmicListBoxContext.Provider>\n </PlasmicPopoverContext.Provider>\n </ComboBox>\n );\n}\n\nexport function registerComboBox(loader?: Registerable) {\n registerComponentHelper(loader, BaseComboBox, {\n name: COMBOBOX_NAME,\n displayName: \"Aria ComboBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerComboBox\",\n importName: \"BaseComboBox\",\n props: {\n ...getCommonProps<BaseComboboxProps>(\"ComboBox\", [\n \"name\",\n \"aria-label\",\n \"placeholder\",\n \"isDisabled\",\n ]),\n selectedKey: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKey\",\n displayName: \"Initial selected item\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n // React Aria ComboBox do not support multiple selections yet\n multiSelect: false,\n },\n disabledKeys: {\n type: \"choice\",\n displayName: \"Disabled values\",\n description:\n \"The items that are disabled. These items cannot be selected, focused, or otherwise interacted with.\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n multiSelect: true,\n advanced: true,\n },\n isOpen: {\n type: \"boolean\",\n defaultValue: false,\n // It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.\n hidden: () => true,\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectedValue\", type: \"string\" }],\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"vbox\",\n styles: {\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n width: \"300px\",\n padding: 0,\n },\n children: [\n {\n type: \"component\",\n name: LABEL_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n {\n type: \"hbox\",\n children: [\n {\n type: \"component\",\n name: INPUT_COMPONENT_NAME,\n styles: {\n width: \"100%\",\n },\n },\n {\n type: \"component\",\n name: BUTTON_COMPONENT_NAME,\n props: {\n children: {\n type: \"img\",\n // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n width: \"15px\",\n transform: \"rotate(180deg)\",\n },\n },\n },\n },\n ],\n },\n {\n type: \"component\",\n name: POPOVER_COMPONENT_NAME,\n styles: {\n backgroundColor: \"white\",\n padding: \"10px\",\n overflow: \"scroll\",\n },\n props: {\n offset: 0,\n children: [\n {\n type: \"component\",\n name: LIST_BOX_COMPONENT_NAME,\n props: {\n selectionMode: \"single\",\n },\n styles: {\n borderWidth: 0,\n width: \"stretch\",\n },\n },\n ],\n },\n },\n ],\n },\n ],\n },\n },\n states: {\n selectedValue: {\n type: \"writable\",\n valueProp: \"selectedKey\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,aAAA,GAAgB,kBAAkB,UAAU,CAAA,CAAA;AAyBlD,SAAS,iBAAiB,KAAY,EAAA;AAnDtC,EAAA,IAAA,EAAA,CAAA;AAoDE,EAAM,MAAA,EAAE,MAAM,KAAM,EAAA,GAAA,CAAI,WAAM,UAAW,CAAA,oBAAoB,CAArC,KAAA,IAAA,GAAA,EAAA,GAA0C,EAAC,CAAA;AAEnE,EAAA,WAAA,CAAY,EAAE,KAAA,EAAO,IAAM,EAAA,KAAA,EAAO,CAAA,CAAA;AAElC,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEO,SAAS,aAAa,KAA0B,EAAA;AACrD,EAAA,MAKI,EAJF,GAAA,KAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,MAAQ,EAAA,OAAA;AAAA,GA/DZ,GAiEM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAHH,UAAA;AAAA,IACA,uBAAA;AAAA,IACA,QAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EAAA,MAAM,YAAY,OAAQ,CAA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AA;AAAA,kBACL,MAAQ,EAAA,CAAA;AAAA,kBACR,QAAU,EAAA;AAAA,oBACR;AAAA,sBACE,IAAM,EAAA,WAAA;AAAA,sBACN,IAAM,EAAA,uBAAA;AAAA,sBACN,KAAO,EAAA;AAAA,wBACL,aAAe,EAAA,QAAA;AAAA,uBACjB;AAAA,sBACA,MAAQ,EAAA;AAAA,wBACN,WAAa,EAAA,CAAA;AAAA,wBACb,KAAO,EAAA,SAAA;AAAA,uBACT;AAAA,qBACF;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,aAAe,EAAA;AAAA,QACb,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,aAAA;AAAA,QACX,YAAc,EAAA,mBAAA;AAAA,QACd,YAAc,EAAA,MAAA;AAAA,OAChB;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,QAAA;AAAA,QACX,YAAc,EAAA,cAAA;AAAA,QACd,YAAc,EAAA,SAAA;AAAA,OAChB;AAAA,KACF;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"registerComboBox.esm.js","sources":["../src/registerComboBox.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport {\n ComboBox,\n ComboBoxProps,\n ComboBoxStateContext,\n} from \"react-aria-components\";\nimport { getCommonProps } from \"./common\";\nimport {\n PlasmicInputContext,\n PlasmicListBoxContext,\n PlasmicPopoverContext,\n} from \"./contexts\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport { BUTTON_COMPONENT_NAME } from \"./registerButton\";\nimport { INPUT_COMPONENT_NAME } from \"./registerInput\";\nimport { LABEL_COMPONENT_NAME } from \"./registerLabel\";\nimport { LIST_BOX_COMPONENT_NAME } from \"./registerListBox\";\nimport { POPOVER_COMPONENT_NAME } from \"./registerPopover\";\nimport {\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n useAutoOpen,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\nconst COMBOBOX_NAME = makeComponentName(\"combobox\");\n\nexport interface BaseComboboxControlContextData {\n itemIds: string[];\n}\n\nconst COMBOBOX_VARIANTS = [\"disabled\" as const];\n\nconst { variants: COMBOBOX_VARIANTS_DATA } =\n pickAriaComponentVariants(COMBOBOX_VARIANTS);\n\nexport interface BaseComboboxProps\n extends ComboBoxProps<{}>,\n WithVariants<typeof COMBOBOX_VARIANTS>,\n HasControlContextData<BaseComboboxControlContextData> {\n placeholder?: string;\n children?: React.ReactNode;\n isOpen?: boolean;\n className?: string;\n}\n\n/*\n This React Hook is used to help with auto-opening the combobox when the canvas component is selected.\n Currently, there is a bug in react-aria combobox (https://github.com/adobe/react-spectrum/issues/7149) where, when the combobox's popover is auto-opened, it is unable to render any listbox items.\n Setting popover's open state to true in not enough unless, unless it has previously been opened via user interaction with combobox.\n Also, <Combobox> does not support an `isOpen` prop either.\n\n So, we use this custom hook to access the combobox's internal state via ComboBoxStateContext and change the `open` state manually via tha available `open` method.\n\n Note: It cannot be used as a hook like useAutoOpen() within the BaseSelect component\n because it needs access to SelectStateContext, which is only created in the BaseSelect component's render function.\n */\nfunction ComboboxAutoOpen(props: any) {\n const { open, close } = React.useContext(ComboBoxStateContext) ?? {};\n\n useAutoOpen({ props, open, close });\n\n return null;\n}\n\nexport function BaseComboBox(props: BaseComboboxProps) {\n const {\n children,\n setControlContextData,\n plasmicUpdateVariant,\n className,\n isDisabled,\n isOpen: _isOpen, // uncontrolled if not selected in canvas/edit mode\n ...rest\n } = props;\n\n const idManager = useMemo(() => new ListBoxItemIdManager(), []);\n\n useEffect(() => {\n idManager.subscribe((ids: string[]) => {\n setControlContextData?.({\n itemIds: ids,\n });\n });\n }, []);\n\n // NOTE: Aria <Combobox> does not support render props, neither does it provide an onDisabledChange event, so we have to manually update the disabled state.\n useEffect(() => {\n plasmicUpdateVariant?.({\n disabled: isDisabled,\n });\n }, [isDisabled, plasmicUpdateVariant]);\n\n return (\n <ComboBox\n isDisabled={isDisabled}\n // Not calling plasmicUpdateVariant within className callback (which has access to render props) because it would then run on every render\n className={className}\n {...rest}\n >\n <PlasmicPopoverContext.Provider value={{}}>\n <PlasmicListBoxContext.Provider\n value={{\n idManager,\n }}\n >\n <PlasmicInputContext.Provider value={{ isUncontrolled: true }}>\n <ComboboxAutoOpen {...props} />\n {children}\n </PlasmicInputContext.Provider>\n </PlasmicListBoxContext.Provider>\n </PlasmicPopoverContext.Provider>\n </ComboBox>\n );\n}\n\nexport function registerComboBox(loader?: Registerable) {\n registerComponentHelper(loader, BaseComboBox, {\n name: COMBOBOX_NAME,\n displayName: \"Aria ComboBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerComboBox\",\n importName: \"BaseComboBox\",\n variants: COMBOBOX_VARIANTS_DATA,\n props: {\n ...getCommonProps<BaseComboboxProps>(\"ComboBox\", [\n \"name\",\n \"aria-label\",\n \"placeholder\",\n \"isDisabled\",\n ]),\n selectedKey: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKey\",\n displayName: \"Initial selected item\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n // React Aria ComboBox do not support multiple selections yet\n multiSelect: false,\n },\n disabledKeys: {\n type: \"choice\",\n displayName: \"Disabled values\",\n description:\n \"The items that are disabled. These items cannot be selected, focused, or otherwise interacted with.\",\n options: (_props, ctx) => (ctx?.itemIds ? Array.from(ctx.itemIds) : []),\n multiSelect: true,\n advanced: true,\n },\n isOpen: {\n type: \"boolean\",\n defaultValue: false,\n // It doesn't make sense to make isOpen prop editable (it's controlled by user interaction and always closed by default), so we keep this prop hidden. We have listed the prop here in the meta only so we can expose a writeable state for it.\n hidden: () => true,\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectedValue\", type: \"string\" }],\n },\n onOpenChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isOpen\", type: \"boolean\" }],\n },\n\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"vbox\",\n styles: {\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n width: \"300px\",\n padding: 0,\n },\n children: [\n {\n type: \"component\",\n name: LABEL_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n {\n type: \"hbox\",\n children: [\n {\n type: \"component\",\n name: INPUT_COMPONENT_NAME,\n styles: {\n width: \"100%\",\n },\n },\n {\n type: \"component\",\n name: BUTTON_COMPONENT_NAME,\n props: {\n children: {\n type: \"img\",\n // TODO: Replace with the image of an arrow pointing up, like: https://icon-sets.iconify.design/mdi/triangle/\n src: \"https://static1.plasmic.app/arrow-up.svg\",\n styles: {\n width: \"15px\",\n transform: \"rotate(180deg)\",\n },\n },\n },\n },\n ],\n },\n {\n type: \"component\",\n name: POPOVER_COMPONENT_NAME,\n styles: {\n backgroundColor: \"white\",\n padding: \"10px\",\n overflow: \"scroll\",\n },\n props: {\n offset: 0,\n children: [\n {\n type: \"component\",\n name: LIST_BOX_COMPONENT_NAME,\n props: {\n selectionMode: \"single\",\n },\n styles: {\n borderWidth: 0,\n width: \"stretch\",\n },\n },\n ],\n },\n },\n ],\n },\n ],\n },\n },\n states: {\n selectedValue: {\n type: \"writable\",\n valueProp: \"selectedKey\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"text\",\n },\n isOpen: {\n type: \"writable\",\n valueProp: \"isOpen\",\n onChangeProp: \"onOpenChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,aAAA,GAAgB,kBAAkB,UAAU,CAAA,CAAA;AAMlD,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AAU,EAAA;AAAA,oBACR;AAAA,sBACE,IAAM,EAAA,WAAA;AAAA,sBACN,IAAM,EAAA,uBAAA;AAAA,sBACN,KAAO,EAAA;AAAA,wBACL,aAAe,EAAA,QAAA;AAAA,uBACjB;AAAA,sBACA,MAAQ,EAAA;AAAA,wBACN,WAAa,EAAA,CAAA;AAAA,wBACb,KAAO,EAAA,SAAA;AAAA,uBACT;AAAA,qBACF;AAAA,mBACF;AAAA,iBACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF,CAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,aAAe,EAAA;AAAA,QACb,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,aAAA;AAAA,QACX,YAAc,EAAA,mBAAA;AAAA,QACd,YAAc,EAAA,MAAA;AAAA,OAChB;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,IAAM,EAAA,UAAA;AAAA,QACN,SAAW,EAAA,QAAA;AAAA,QACX,YAAc,EAAA,cAAA;AAAA,QACd,YAAc,EAAA,SAAA;AAAA,OAChB;AAAA,KACF;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,GACb,CAAA,CAAA;AACH;;;;"}
@@ -1,9 +1,9 @@
1
1
  import React, { useState, useMemo, useEffect } from 'react';
2
- import { ListBox } from 'react-aria-components';
2
+ import { Section, Header, ListBox } from 'react-aria-components';
3
3
  import { b as PlasmicListBoxContext } from './contexts-081d65a0.esm.js';
4
4
  import { registerListBoxItem, makeDefaultListBoxItemChildren } from './registerListBoxItem.esm.js';
5
- import { registerSection } from './registerSection.esm.js';
6
- import { a as makeComponentName, r as registerComponentHelper } from './utils-25448fbd.esm.js';
5
+ import { mergeProps } from '@react-aria/utils';
6
+ import { r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
7
7
 
8
8
  class ListBoxItemIdManager {
9
9
  constructor() {
@@ -57,6 +57,84 @@ class ListBoxItemIdManager {
57
57
  }
58
58
  }
59
59
 
60
+ var __defProp$1 = Object.defineProperty;
61
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
62
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
63
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
64
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
65
+ var __spreadValues$1 = (a, b) => {
66
+ for (var prop in b || (b = {}))
67
+ if (__hasOwnProp$1.call(b, prop))
68
+ __defNormalProp$1(a, prop, b[prop]);
69
+ if (__getOwnPropSymbols$1)
70
+ for (var prop of __getOwnPropSymbols$1(b)) {
71
+ if (__propIsEnum$1.call(b, prop))
72
+ __defNormalProp$1(a, prop, b[prop]);
73
+ }
74
+ return a;
75
+ };
76
+ var __objRest$1 = (source, exclude) => {
77
+ var target = {};
78
+ for (var prop in source)
79
+ if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
80
+ target[prop] = source[prop];
81
+ if (source != null && __getOwnPropSymbols$1)
82
+ for (var prop of __getOwnPropSymbols$1(source)) {
83
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
84
+ target[prop] = source[prop];
85
+ }
86
+ return target;
87
+ };
88
+ function BaseSection(props) {
89
+ const _a = props, { header, items } = _a, rest = __objRest$1(_a, ["header", "items"]);
90
+ const contextProps = React.useContext(PlasmicListBoxContext);
91
+ const isStandalone = !contextProps;
92
+ const mergedProps = mergeProps(contextProps, rest);
93
+ const section = /* @__PURE__ */ React.createElement(Section, __spreadValues$1({}, mergedProps), /* @__PURE__ */ React.createElement(Header, null, header), items);
94
+ if (isStandalone) {
95
+ return (
96
+ // BaseListbox should give section a listbox context (that it can't be used without)
97
+ // as well as the id manager (that is needed to identify and warn about duplication of ids)
98
+ /* @__PURE__ */ React.createElement(BaseListBox, null, section)
99
+ );
100
+ }
101
+ return section;
102
+ }
103
+ function registerSection(loader, overrides) {
104
+ return registerComponentHelper(
105
+ loader,
106
+ BaseSection,
107
+ {
108
+ name: makeComponentName("section"),
109
+ displayName: "Aria Section",
110
+ importPath: "@plasmicpkgs/react-aria/skinny/registerSection",
111
+ importName: "BaseSection",
112
+ defaultStyles: {
113
+ width: "stretch",
114
+ padding: "10px"
115
+ },
116
+ props: {
117
+ header: {
118
+ type: "slot",
119
+ mergeWithParent: true,
120
+ defaultValue: [
121
+ {
122
+ type: "text",
123
+ value: "Section Header."
124
+ }
125
+ ]
126
+ },
127
+ items: {
128
+ type: "slot",
129
+ mergeWithParent: true
130
+ }
131
+ },
132
+ trapsFocus: true
133
+ },
134
+ overrides
135
+ );
136
+ }
137
+
60
138
  var __defProp = Object.defineProperty;
61
139
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
62
140
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -319,5 +397,5 @@ function registerListBox(loader, overrides) {
319
397
  );
320
398
  }
321
399
 
322
- export { BaseListBox as B, ListBoxItemIdManager as L, LIST_BOX_COMPONENT_NAME as a, listboxHelpers as l, registerListBox as r };
323
- //# sourceMappingURL=registerListBox-3beb3a9f.esm.js.map
400
+ export { BaseSection as B, ListBoxItemIdManager as L, LIST_BOX_COMPONENT_NAME as a, BaseListBox as b, registerListBox as c, listboxHelpers as l, registerSection as r };
401
+ //# sourceMappingURL=registerListBox-64bcf3d2.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerListBox-64bcf3d2.esm.js","sources":["../src/ListBoxItemIdManager.ts","../src/registerSection.tsx","../src/registerListBox.tsx"],"sourcesContent":["type Observer = (ids: string[]) => void;\n\nexport class ListBoxItemIdManager {\n private readonly _ids: Set<string> = new Set();\n private readonly _observers: Set<Observer> = new Set();\n\n private generateDuplicateId(id: string, count = 1): string {\n const dupId = `${id} duplicate(${count})`;\n if (this._ids.has(dupId)) {\n return this.generateDuplicateId(id, count + 1);\n } else {\n return dupId;\n }\n }\n\n private generateMissingId(count = 1): string {\n const missingId = `missing(${count})`;\n if (this._ids.has(missingId)) {\n return this.generateMissingId(count + 1);\n } else {\n return missingId;\n }\n }\n\n register(id?: unknown): string {\n const idStr = id === undefined ? undefined : String(id).trim();\n let newId: string;\n\n if (!idStr) {\n // No id is provided, so generate one\n newId = this.generateMissingId();\n } else if (this._ids.has(idStr)) {\n // The provided id is already registered with another uuid (i.e. it's not unique), so just generate a new one\n newId = this.generateDuplicateId(idStr);\n } else {\n // The provided id is not already registered, so use it\n newId = idStr;\n }\n\n this._ids.add(newId);\n this.notify();\n return newId;\n }\n\n unregister(id: string) {\n this._ids.delete(id);\n this.notify();\n }\n\n subscribe(observer: Observer) {\n this._observers.add(observer);\n observer(this.ids);\n }\n\n // Notify all observers about an event.\n notify() {\n this._observers.forEach((observer) => observer(this.ids));\n }\n\n get ids(): string[] {\n return Array.from(this._ids);\n }\n}\n","import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Header, Section } from \"react-aria-components\";\nimport { PlasmicListBoxContext } from \"./contexts\";\nimport { BaseListBox } from \"./registerListBox\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n Styleable,\n} from \"./utils\";\n\nexport interface BaseSectionProps extends Styleable {\n items: React.ReactNode;\n header: React.ReactNode;\n}\n\nexport function BaseSection(props: BaseSectionProps) {\n const { header, items, ...rest } = props;\n const contextProps = React.useContext(PlasmicListBoxContext);\n const isStandalone = !contextProps;\n const mergedProps = mergeProps(contextProps, rest);\n\n const section = (\n <Section {...mergedProps}>\n <Header>{header}</Header>\n {items}\n </Section>\n );\n\n if (isStandalone) {\n return (\n // BaseListbox should give section a listbox context (that it can't be used without)\n // as well as the id manager (that is needed to identify and warn about duplication of ids)\n <BaseListBox>{section}</BaseListBox>\n );\n }\n\n return section;\n}\n\nexport function registerSection(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseSection>\n) {\n return registerComponentHelper(\n loader,\n BaseSection,\n {\n name: makeComponentName(\"section\"),\n displayName: \"Aria Section\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerSection\",\n importName: \"BaseSection\",\n defaultStyles: {\n width: \"stretch\",\n padding: \"10px\",\n },\n props: {\n header: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: [\n {\n type: \"text\",\n value: \"Section Header.\",\n },\n ],\n },\n items: {\n type: \"slot\",\n mergeWithParent: true,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { Key, ListBox } from \"react-aria-components\";\nimport { PlasmicListBoxContext } from \"./contexts\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport {\n makeDefaultListBoxItemChildren,\n registerListBoxItem,\n} from \"./registerListBoxItem\";\nimport { registerSection } from \"./registerSection\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BaseListBoxControlContextData {\n itemIds: string[];\n isStandalone: boolean;\n}\n\nexport interface BaseListBoxProps\n extends Omit<\n React.ComponentProps<typeof ListBox>,\n \"selectedKeys\" | \"defaultSelectedKeys\"\n >,\n HasControlContextData<BaseListBoxControlContextData> {\n children?: React.ReactNode;\n selectedKeys?: string | string[] | undefined;\n defaultSelectedKeys?: string | string[] | undefined;\n}\n\nexport const listboxHelpers = {\n states: {\n selectedValue: {\n onChangeArgsToValue: (value: Set<Key> | string[] | string) => {\n // only single selection is supported\n return Array.from(value)[0];\n },\n },\n },\n};\n\nfunction normalizeSelectedKeys(selectedKeys: string | string[] | undefined) {\n // Listbox expects it to be of type \"all\" | Iterable\n return typeof selectedKeys === \"string\" && selectedKeys !== \"all\"\n ? [selectedKeys]\n : selectedKeys;\n}\n\nexport function BaseListBox(props: BaseListBoxProps) {\n const {\n setControlContextData: setControlContextData,\n children,\n selectedKeys,\n defaultSelectedKeys,\n ...rest\n } = props;\n const context = React.useContext(PlasmicListBoxContext);\n const isStandalone = !context;\n const [ids, setIds] = useState<string[]>([]);\n\n const idManager = useMemo(\n () => context?.idManager ?? new ListBoxItemIdManager(),\n []\n );\n\n useEffect(() => {\n setControlContextData?.({\n itemIds: ids,\n isStandalone,\n });\n }, [ids, isStandalone, setControlContextData]);\n\n useEffect(() => {\n idManager.subscribe((_ids: string[]) => {\n setIds(_ids);\n });\n }, []);\n\n const listbox = (\n <ListBox\n selectedKeys={normalizeSelectedKeys(selectedKeys)}\n defaultSelectedKeys={normalizeSelectedKeys(defaultSelectedKeys)}\n {...rest}\n >\n {children}\n </ListBox>\n );\n\n if (isStandalone) {\n return (\n <PlasmicListBoxContext.Provider\n value={{\n idManager,\n }}\n >\n {listbox}\n </PlasmicListBoxContext.Provider>\n );\n }\n\n return listbox;\n}\n\nexport const LIST_BOX_COMPONENT_NAME = makeComponentName(\"listbox\");\n\nexport function registerListBox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBox>\n) {\n const listBoxItemMeta = registerListBoxItem(loader, {\n parentComponentName: LIST_BOX_COMPONENT_NAME,\n });\n const sectionMeta = registerSection(loader, {\n parentComponentName: LIST_BOX_COMPONENT_NAME,\n props: {\n items: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"component\",\n name: listBoxItemMeta.name,\n props: {\n id: \"section-1-1\",\n textValue: \"Section1-Item 1\",\n children: [\n makeDefaultListBoxItemChildren(\n \"Item 1\",\n \"Add dynamic values to make it more interesting\"\n ),\n ],\n },\n },\n {\n type: \"component\",\n name: listBoxItemMeta.name,\n props: {\n id: \"section-1-2\",\n textValue: \"Section1-Item 2\",\n children: [\n makeDefaultListBoxItemChildren(\n \"Item 2\",\n \"Add dynamic values to make it more interesting\"\n ),\n ],\n },\n },\n {\n type: \"component\",\n name: listBoxItemMeta.name,\n props: {\n id: \"section-1-3\",\n textValue: \"Section1-Item 3\",\n children: [\n makeDefaultListBoxItemChildren(\n \"Item 3\",\n \"Add dynamic values to make it more interesting\"\n ),\n ],\n },\n },\n ],\n },\n },\n });\n\n registerComponentHelper(\n loader,\n BaseListBox,\n {\n name: LIST_BOX_COMPONENT_NAME,\n displayName: \"Aria ListBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBox\",\n importName: \"BaseListBox\",\n defaultStyles: {\n width: \"250px\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n },\n props: {\n children: {\n type: \"slot\",\n displayName: \"List Items\",\n allowedComponents: [listBoxItemMeta.name, sectionMeta.name],\n allowRootWrapper: true,\n defaultValue: [\n {\n type: \"component\",\n name: listBoxItemMeta.name,\n props: {\n id: \"1\",\n textValue: \"Item 1\",\n children: [\n makeDefaultListBoxItemChildren(\n \"Item 1\",\n \"Add dynamic values to make it more interesting\"\n ),\n ],\n },\n },\n {\n type: \"component\",\n name: listBoxItemMeta.name,\n props: {\n id: \"2\",\n textValue: \"Item 2\",\n children: [\n makeDefaultListBoxItemChildren(\n \"Item 2\",\n \"Add dynamic values to make it more interesting\"\n ),\n ],\n },\n },\n {\n type: \"component\",\n name: listBoxItemMeta.name,\n props: {\n id: \"3\",\n textValue: \"Item 3\",\n children: [\n makeDefaultListBoxItemChildren(\n \"Item 3\",\n \"Add dynamic values to make it more interesting\"\n ),\n ],\n },\n },\n {\n type: \"component\",\n name: sectionMeta.name,\n },\n ],\n },\n selectionMode: {\n type: \"choice\",\n description: \"The selection mode of the listbox\",\n options: [\"none\", \"single\"],\n defaultValue: \"none\",\n hidden: (_props, ctx) => !ctx?.isStandalone,\n },\n selectedKeys: {\n type: \"choice\",\n editOnly: true,\n uncontrolledProp: \"defaultSelectedKeys\",\n displayName: \"Initial selected item\",\n options: (_props, ctx) =>\n ctx?.itemIds ? Array.from(ctx.itemIds) : [],\n hidden: (props, ctx) =>\n !ctx?.isStandalone || props.selectionMode === \"none\",\n // We do not support multiple selections yet (Because React Aria select and combobox only support single selections).\n multiSelect: false,\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectedValues\", type: \"object\" }],\n },\n },\n states: {\n selectedValue: {\n type: \"writable\",\n valueProp: \"selectedKeys\",\n hidden: (props, ctx) =>\n !ctx?.isStandalone || props.selectionMode === \"none\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"text\",\n ...listboxHelpers.states.selectedValue,\n },\n },\n componentHelpers: {\n helpers: listboxHelpers,\n importName: \"listboxHelpers\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBox\",\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["__objRest","__spreadValues","_a"],"mappings":";;;;;;;AAEO,MAAM,oBAAqB,CAAA;AAAA,EAA3B,WAAA,GAAA;AACL,IAAiB,IAAA,CAAA,IAAA,uBAAwB,GAAI,EAAA,CAAA;AAC7C,IAAiB,IAAA,CAAA,UAAA,uBAAgC,GAAI,EAAA,CAAA;AAAA,GAAA;AAAA,EAE7C,mBAAA,CAAoB,EAAY,EAAA,KAAA,GAAQ,CAAW,EAAA;AACzD,IAAM,MAAA,KAAA,GAAQ,GAAG,EAAgB,CAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACjC,IAAA,IAAI,IAAK,CAAA,IAAA,CAAK,GAAI,CAAA,KAAK,CAAG,EAAA;AACxB,MAAA,OAAO,IAAK,CAAA,mBAAA,CAAoB,EAAI,EAAA,KAAA,GAAQ,CAAC,CAAA,CAAA;AAAA,KACxC,MAAA;AACL,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAAA,GACF;AAAA,EAEQ,iBAAA,CAAkB,QAAQ,CAAW,EAAA;AAC3C,IAAA,MAAM,YAAY,CAAW,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AAC7B,IAAA,IAAI,IAAK,CAAA,IAAA,CAAK,GAAI,CAAA,SAAS,CAAG,EAAA;AAC5B,MAAO,OAAA,IAAA,CAAK,iBAAkB,CAAA,KAAA,GAAQ,CAAC,CAAA,CAAA;AAAA,KAClC,MAAA;AACL,MAAO,OAAA,SAAA,CAAA;AAAA,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