@plasmicpkgs/react-aria 0.0.76 → 0.0.77
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/.tsbuildinfo +1 -1
- package/dist/contexts.d.ts +1 -1
- package/dist/react-aria.esm.js +46 -18
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +46 -18
- package/dist/react-aria.js.map +1 -1
- package/dist/registerPopover.d.ts +6 -2
- package/package.json +2 -2
- package/skinny/{contexts-081d65a0.esm.js → contexts-5cb81c2f.esm.js} +3 -3
- package/skinny/contexts-5cb81c2f.esm.js.map +1 -0
- package/skinny/{contexts-baa37b74.cjs.js → contexts-6d0cb2b1.cjs.js} +3 -3
- package/skinny/contexts-6d0cb2b1.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +1 -1
- package/skinny/registerCheckbox.cjs.js +1 -1
- package/skinny/registerCheckbox.esm.js +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +1 -1
- package/skinny/registerCheckboxGroup.esm.js +1 -1
- package/skinny/registerComboBox.cjs.js +5 -4
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +5 -4
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDialogTrigger.cjs.js +1 -1
- package/skinny/registerDialogTrigger.esm.js +1 -1
- package/skinny/registerInput.cjs.js +1 -1
- package/skinny/registerInput.esm.js +1 -1
- package/skinny/{registerListBox-32d2fae3.esm.js → registerListBox-25d602fa.esm.js} +2 -2
- package/skinny/{registerListBox-32d2fae3.esm.js.map → registerListBox-25d602fa.esm.js.map} +1 -1
- package/skinny/{registerListBox-3d146fe7.cjs.js → registerListBox-f4f6beb5.cjs.js} +2 -2
- package/skinny/{registerListBox-3d146fe7.cjs.js.map → registerListBox-f4f6beb5.cjs.js.map} +1 -1
- package/skinny/registerListBox.cjs.js +2 -2
- package/skinny/registerListBox.esm.js +2 -2
- package/skinny/registerListBoxItem.cjs.js +1 -1
- package/skinny/registerListBoxItem.esm.js +1 -1
- package/skinny/registerModal.cjs.js +1 -1
- package/skinny/registerModal.esm.js +1 -1
- package/skinny/registerPopover.cjs.js +40 -14
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +6 -2
- package/skinny/registerPopover.esm.js +41 -15
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +1 -1
- package/skinny/registerRadio.esm.js +1 -1
- package/skinny/registerRadioGroup.cjs.js +1 -1
- package/skinny/registerRadioGroup.esm.js +1 -1
- package/skinny/registerSection.cjs.js +2 -2
- package/skinny/registerSection.esm.js +2 -2
- package/skinny/registerSelect.cjs.js +5 -4
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.esm.js +5 -4
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider.cjs.js +1 -1
- package/skinny/registerSlider.esm.js +1 -1
- package/skinny/registerSliderTrack.cjs.js +1 -1
- package/skinny/registerSliderTrack.esm.js +1 -1
- package/skinny/registerTextArea.cjs.js +1 -1
- package/skinny/registerTextArea.esm.js +1 -1
- package/skinny/registerTextField.cjs.js +1 -1
- package/skinny/registerTextField.esm.js +1 -1
- package/skinny/contexts-081d65a0.esm.js.map +0 -1
- package/skinny/contexts-baa37b74.cjs.js.map +0 -1
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { PlasmicElement } from "@plasmicapp/host";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Popover } from "react-aria-components";
|
|
4
|
-
import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
4
|
+
import { CodeComponentMetaOverrides, HasControlContextData, Registerable } from "./utils";
|
|
5
5
|
import { WithVariants } from "./variant-utils";
|
|
6
6
|
declare const POPOVER_VARIANTS: ("placementLeft" | "placementRight" | "placementTop" | "placementBottom")[];
|
|
7
|
-
export interface
|
|
7
|
+
export interface BasePopoverControlContextData {
|
|
8
|
+
canMatchTriggerWidth?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface BasePopoverProps extends React.ComponentProps<typeof Popover>, WithVariants<typeof POPOVER_VARIANTS>, HasControlContextData<BasePopoverControlContextData> {
|
|
8
11
|
className?: string;
|
|
9
12
|
resetClassName?: string;
|
|
10
13
|
children?: React.ReactNode;
|
|
14
|
+
matchTriggerWidth?: boolean;
|
|
11
15
|
}
|
|
12
16
|
export declare function BasePopover(props: BasePopoverProps): React.JSX.Element;
|
|
13
17
|
export declare const POPOVER_COMPONENT_NAME: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
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": "
|
|
77
|
+
"gitHead": "60bbe9e24fafc4428d8f4b09db85654a62293278"
|
|
78
78
|
}
|
|
@@ -6,10 +6,10 @@ const PlasmicRadioGroupContext = React.createContext(void 0);
|
|
|
6
6
|
const PlasmicDialogTriggerContext = React.createContext(void 0);
|
|
7
7
|
const PlasmicSliderContext = React.createContext(void 0);
|
|
8
8
|
React.createContext(void 0);
|
|
9
|
-
const
|
|
9
|
+
const PlasmicPopoverTriggerContext = React.createContext(void 0);
|
|
10
10
|
const PlasmicListBoxContext = React.createContext(void 0);
|
|
11
11
|
React.createContext(void 0);
|
|
12
12
|
const PlasmicInputContext = React.createContext(void 0);
|
|
13
13
|
|
|
14
|
-
export { PlasmicCheckboxGroupContext as P,
|
|
15
|
-
//# sourceMappingURL=contexts-
|
|
14
|
+
export { PlasmicCheckboxGroupContext as P, PlasmicPopoverTriggerContext as a, PlasmicListBoxContext as b, PlasmicInputContext as c, PlasmicDialogTriggerContext as d, PlasmicRadioGroupContext as e, PlasmicSliderContext as f, PlasmicTextFieldContext as g };
|
|
15
|
+
//# sourceMappingURL=contexts-5cb81c2f.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts-5cb81c2f.esm.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport { BaseCheckboxGroup } from \"./registerCheckboxGroup\";\nimport { BaseDialogTrigger } from \"./registerDialogTrigger\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport { BaseRadioGroup } from \"./registerRadioGroup\";\nimport type { BaseSection } from \"./registerSection\";\nimport { BaseSlider } from \"./registerSlider\";\nimport { BaseTextField } from \"./registerTextField\";\n\n// We pass down context props via our own Plasmic*Context instead of directly\n// using react-aria-component's *Context, because react-aria-component's\n// contexts don't \"merge\" with contexts further up the tree, so if we render\n// a context provider, it will just be overwritten by react-aria-component's\n// context provider. So we do the merging within our own Base* components\n// instead.\n\n// Creating the text field context here because input/textarea inside text field receive a null for the TextFieldContext\nexport const PlasmicTextFieldContext = React.createContext<\n React.ComponentProps<typeof BaseTextField> | undefined\n>(undefined);\n\nexport const PlasmicCheckboxGroupContext = React.createContext<\n React.ComponentProps<typeof BaseCheckboxGroup> | undefined\n>(undefined);\n\nexport const PlasmicRadioGroupContext = React.createContext<\n React.ComponentProps<typeof BaseRadioGroup> | undefined\n>(undefined);\n\nexport const PlasmicDialogTriggerContext = React.createContext<\n React.ComponentProps<typeof BaseDialogTrigger> | undefined\n>(undefined);\n\nexport type PlasmicSliderContextType<T extends number | number[]> =\n | React.ComponentProps<typeof BaseSlider<T>>\n | undefined;\n\nexport const PlasmicSliderContext =\n React.createContext<PlasmicSliderContextType<number | number[]>>(undefined);\n\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicPopoverTriggerContext = React.createContext<\n boolean | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n | {\n idManager: ListBoxItemIdManager;\n }\n | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":[],"mappings":";;AAmBa,MAAA,uBAAA,GAA0B,KAAM,CAAA,aAAA,CAE3C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8B,KAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAEE,MAAA,wBAAA,GAA2B,KAAM,CAAA,aAAA,CAE5C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8B,KAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAME,MAAA,oBAAA,GACX,KAAM,CAAA,aAAA,CAA2D,KAAS,CAAA,EAAA;AAEzC,KAAM,CAAA,aAAA,CAEvC,KAAS,CAAA,EAAA;AAEE,MAAA,4BAAA,GAA+B,KAAM,CAAA,aAAA,CAEhD,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAKzC,KAAS,CAAA,EAAA;AAE0B,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,mBAAA,GAAsB,KAAM,CAAA,aAAA,CAEvC,KAAS,CAAA;;;;"}
|
|
@@ -12,7 +12,7 @@ const PlasmicRadioGroupContext = React__default.default.createContext(void 0);
|
|
|
12
12
|
const PlasmicDialogTriggerContext = React__default.default.createContext(void 0);
|
|
13
13
|
const PlasmicSliderContext = React__default.default.createContext(void 0);
|
|
14
14
|
React__default.default.createContext(void 0);
|
|
15
|
-
const
|
|
15
|
+
const PlasmicPopoverTriggerContext = React__default.default.createContext(void 0);
|
|
16
16
|
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
17
17
|
React__default.default.createContext(void 0);
|
|
18
18
|
const PlasmicInputContext = React__default.default.createContext(void 0);
|
|
@@ -21,8 +21,8 @@ exports.PlasmicCheckboxGroupContext = PlasmicCheckboxGroupContext;
|
|
|
21
21
|
exports.PlasmicDialogTriggerContext = PlasmicDialogTriggerContext;
|
|
22
22
|
exports.PlasmicInputContext = PlasmicInputContext;
|
|
23
23
|
exports.PlasmicListBoxContext = PlasmicListBoxContext;
|
|
24
|
-
exports.
|
|
24
|
+
exports.PlasmicPopoverTriggerContext = PlasmicPopoverTriggerContext;
|
|
25
25
|
exports.PlasmicRadioGroupContext = PlasmicRadioGroupContext;
|
|
26
26
|
exports.PlasmicSliderContext = PlasmicSliderContext;
|
|
27
27
|
exports.PlasmicTextFieldContext = PlasmicTextFieldContext;
|
|
28
|
-
//# sourceMappingURL=contexts-
|
|
28
|
+
//# sourceMappingURL=contexts-6d0cb2b1.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts-6d0cb2b1.cjs.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport { ListBoxItemIdManager } from \"./ListBoxItemIdManager\";\nimport { BaseCheckboxGroup } from \"./registerCheckboxGroup\";\nimport { BaseDialogTrigger } from \"./registerDialogTrigger\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport { BaseRadioGroup } from \"./registerRadioGroup\";\nimport type { BaseSection } from \"./registerSection\";\nimport { BaseSlider } from \"./registerSlider\";\nimport { BaseTextField } from \"./registerTextField\";\n\n// We pass down context props via our own Plasmic*Context instead of directly\n// using react-aria-component's *Context, because react-aria-component's\n// contexts don't \"merge\" with contexts further up the tree, so if we render\n// a context provider, it will just be overwritten by react-aria-component's\n// context provider. So we do the merging within our own Base* components\n// instead.\n\n// Creating the text field context here because input/textarea inside text field receive a null for the TextFieldContext\nexport const PlasmicTextFieldContext = React.createContext<\n React.ComponentProps<typeof BaseTextField> | undefined\n>(undefined);\n\nexport const PlasmicCheckboxGroupContext = React.createContext<\n React.ComponentProps<typeof BaseCheckboxGroup> | undefined\n>(undefined);\n\nexport const PlasmicRadioGroupContext = React.createContext<\n React.ComponentProps<typeof BaseRadioGroup> | undefined\n>(undefined);\n\nexport const PlasmicDialogTriggerContext = React.createContext<\n React.ComponentProps<typeof BaseDialogTrigger> | undefined\n>(undefined);\n\nexport type PlasmicSliderContextType<T extends number | number[]> =\n | React.ComponentProps<typeof BaseSlider<T>>\n | undefined;\n\nexport const PlasmicSliderContext =\n React.createContext<PlasmicSliderContextType<number | number[]>>(undefined);\n\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicPopoverTriggerContext = React.createContext<\n boolean | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n | {\n idManager: ListBoxItemIdManager;\n }\n | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":["React"],"mappings":";;;;;;;;AAmBa,MAAA,uBAAA,GAA0BA,sBAAM,CAAA,aAAA,CAE3C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8BA,sBAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAEE,MAAA,wBAAA,GAA2BA,sBAAM,CAAA,aAAA,CAE5C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8BA,sBAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAME,MAAA,oBAAA,GACXA,sBAAM,CAAA,aAAA,CAA2D,KAAS,CAAA,EAAA;AAEzCA,sBAAM,CAAA,aAAA,CAEvC,KAAS,CAAA,EAAA;AAEE,MAAA,4BAAA,GAA+BA,sBAAM,CAAA,aAAA,CAEhD,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAKzC,KAAS,CAAA,EAAA;AAE0BA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,mBAAA,GAAsBA,sBAAM,CAAA,aAAA,CAEvC,KAAS,CAAA;;;;;;;;;;;"}
|
package/skinny/contexts.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const PlasmicDialogTriggerContext: React.Context<import("./regist
|
|
|
8
8
|
export type PlasmicSliderContextType<T extends number | number[]> = React.ComponentProps<typeof BaseSlider<T>> | undefined;
|
|
9
9
|
export declare const PlasmicSliderContext: React.Context<PlasmicSliderContextType<number | number[]>>;
|
|
10
10
|
export declare const PlasmicLabelContext: React.Context<import("react-aria-components").LabelProps | undefined>;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const PlasmicPopoverTriggerContext: React.Context<boolean | undefined>;
|
|
12
12
|
export declare const PlasmicListBoxContext: React.Context<{
|
|
13
13
|
idManager: ListBoxItemIdManager;
|
|
14
14
|
} | undefined>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
5
|
var common = require('./common-f6de262a.cjs.js');
|
|
6
|
-
var contexts = require('./contexts-
|
|
6
|
+
var contexts = require('./contexts-6d0cb2b1.cjs.js');
|
|
7
7
|
var utils = require('./utils-3e796b18.cjs.js');
|
|
8
8
|
var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
|
|
9
9
|
require('@plasmicapp/host');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Checkbox } from 'react-aria-components';
|
|
3
3
|
import { g as getCommonProps, h as hasParent } from './common-70efdf8a.esm.js';
|
|
4
|
-
import { P as PlasmicCheckboxGroupContext } from './contexts-
|
|
4
|
+
import { P as PlasmicCheckboxGroupContext } from './contexts-5cb81c2f.esm.js';
|
|
5
5
|
import { r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
|
|
6
6
|
import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
|
|
7
7
|
import '@plasmicapp/host';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
5
|
var common = require('./common-f6de262a.cjs.js');
|
|
6
|
-
var contexts = require('./contexts-
|
|
6
|
+
var contexts = require('./contexts-6d0cb2b1.cjs.js');
|
|
7
7
|
var registerCheckbox = require('./registerCheckbox.cjs.js');
|
|
8
8
|
var registerDescription = require('./registerDescription.cjs.js');
|
|
9
9
|
var registerFieldError = require('./registerFieldError.cjs.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CheckboxGroup } from 'react-aria-components';
|
|
3
3
|
import { g as getCommonProps } from './common-70efdf8a.esm.js';
|
|
4
|
-
import { P as PlasmicCheckboxGroupContext } from './contexts-
|
|
4
|
+
import { P as PlasmicCheckboxGroupContext } from './contexts-5cb81c2f.esm.js';
|
|
5
5
|
import { registerCheckbox, makeDefaultCheckboxChildren } from './registerCheckbox.esm.js';
|
|
6
6
|
import { DESCRIPTION_COMPONENT_NAME } from './registerDescription.esm.js';
|
|
7
7
|
import { registerFieldError } from './registerFieldError.esm.js';
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
5
|
var common = require('./common-f6de262a.cjs.js');
|
|
6
|
-
var contexts = require('./contexts-
|
|
7
|
-
var registerSection = require('./registerListBox-
|
|
6
|
+
var contexts = require('./contexts-6d0cb2b1.cjs.js');
|
|
7
|
+
var registerSection = require('./registerListBox-f4f6beb5.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');
|
|
@@ -98,7 +98,7 @@ function BaseComboBox(props) {
|
|
|
98
98
|
isDisabled,
|
|
99
99
|
className
|
|
100
100
|
}, rest),
|
|
101
|
-
/* @__PURE__ */ React__default.default.createElement(contexts.
|
|
101
|
+
/* @__PURE__ */ React__default.default.createElement(contexts.PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React__default.default.createElement(
|
|
102
102
|
contexts.PlasmicListBoxContext.Provider,
|
|
103
103
|
{
|
|
104
104
|
value: {
|
|
@@ -208,7 +208,8 @@ function registerComboBox(loader) {
|
|
|
208
208
|
styles: {
|
|
209
209
|
backgroundColor: "white",
|
|
210
210
|
padding: "10px",
|
|
211
|
-
overflow: "scroll"
|
|
211
|
+
overflow: "scroll",
|
|
212
|
+
width: "unset"
|
|
212
213
|
},
|
|
213
214
|
props: {
|
|
214
215
|
offset: 0,
|
|
@@ -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\";\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,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;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 PlasmicPopoverTriggerContext,\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 <PlasmicPopoverTriggerContext.Provider value={true}>\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 </PlasmicPopoverTriggerContext.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 width: \"unset\",\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","PlasmicPopoverTriggerContext","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,WAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EAAA,MAAM,YAAYC,aAAQ,CAAA,MAAM,IAAIC,oCAAqB,EAAA,EAAG,EAAE,CAAA,CAAA;AAE9D,EAAAC,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from 'react-aria-components';
|
|
3
3
|
import { g as getCommonProps } from './common-70efdf8a.esm.js';
|
|
4
|
-
import { a as
|
|
5
|
-
import { L as ListBoxItemIdManager, a as LIST_BOX_COMPONENT_NAME } from './registerListBox-
|
|
4
|
+
import { a as PlasmicPopoverTriggerContext, b as PlasmicListBoxContext, c as PlasmicInputContext } from './contexts-5cb81c2f.esm.js';
|
|
5
|
+
import { L as ListBoxItemIdManager, a as LIST_BOX_COMPONENT_NAME } from './registerListBox-25d602fa.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';
|
|
@@ -92,7 +92,7 @@ function BaseComboBox(props) {
|
|
|
92
92
|
isDisabled,
|
|
93
93
|
className
|
|
94
94
|
}, rest),
|
|
95
|
-
/* @__PURE__ */ React.createElement(
|
|
95
|
+
/* @__PURE__ */ React.createElement(PlasmicPopoverTriggerContext.Provider, { value: true }, /* @__PURE__ */ React.createElement(
|
|
96
96
|
PlasmicListBoxContext.Provider,
|
|
97
97
|
{
|
|
98
98
|
value: {
|
|
@@ -202,7 +202,8 @@ function registerComboBox(loader) {
|
|
|
202
202
|
styles: {
|
|
203
203
|
backgroundColor: "white",
|
|
204
204
|
padding: "10px",
|
|
205
|
-
overflow: "scroll"
|
|
205
|
+
overflow: "scroll",
|
|
206
|
+
width: "unset"
|
|
206
207
|
},
|
|
207
208
|
props: {
|
|
208
209
|
offset: 0,
|
|
@@ -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\";\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 onChange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A,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,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 PlasmicPopoverTriggerContext,\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 <PlasmicPopoverTriggerContext.Provider value={true}>\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 </PlasmicPopoverTriggerContext.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 width: \"unset\",\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\",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AAAA,gBACN,MAAQ,EAAA;AAAA,kBACN,eAAiB,EAAA,OAAA;AAAA,kBACjB,OAAS,EAAA,MAAA;AAAA,kBACT,QAAU,EAAA,QAAA;AAAA,kBACV,KAAO,EAAA,OAAA;AAAA,iBACT;AAAA,gBACA,KAAO,EAAA;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;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var host = require('@plasmicapp/host');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
|
-
var contexts = require('./contexts-
|
|
6
|
+
var contexts = require('./contexts-6d0cb2b1.cjs.js');
|
|
7
7
|
var registerButton = require('./registerButton.cjs.js');
|
|
8
8
|
var registerModal = require('./registerModal.cjs.js');
|
|
9
9
|
var utils = require('./utils-3e796b18.cjs.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePlasmicCanvasComponentInfo } from '@plasmicapp/host';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { DialogTrigger } from 'react-aria-components';
|
|
4
|
-
import { d as PlasmicDialogTriggerContext } from './contexts-
|
|
4
|
+
import { d as PlasmicDialogTriggerContext } from './contexts-5cb81c2f.esm.js';
|
|
5
5
|
import { BUTTON_COMPONENT_NAME } from './registerButton.esm.js';
|
|
6
6
|
import { MODAL_COMPONENT_NAME } from './registerModal.esm.js';
|
|
7
7
|
import { r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
|
|
@@ -4,7 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var reactAria = require('react-aria');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
6
|
var common = require('./common-f6de262a.cjs.js');
|
|
7
|
-
var contexts = require('./contexts-
|
|
7
|
+
var contexts = require('./contexts-6d0cb2b1.cjs.js');
|
|
8
8
|
var utils = require('./utils-3e796b18.cjs.js');
|
|
9
9
|
var variantUtils = require('./variant-utils-8cb38f8f.cjs.js');
|
|
10
10
|
require('@plasmicapp/host');
|
|
@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
|
|
|
2
2
|
import { mergeProps } from 'react-aria';
|
|
3
3
|
import { Input } from 'react-aria-components';
|
|
4
4
|
import { r as resolveAutoComplete, g as getCommonProps } from './common-70efdf8a.esm.js';
|
|
5
|
-
import { g as PlasmicTextFieldContext, c as PlasmicInputContext } from './contexts-
|
|
5
|
+
import { g as PlasmicTextFieldContext, c as PlasmicInputContext } from './contexts-5cb81c2f.esm.js';
|
|
6
6
|
import { a as makeComponentName, r as registerComponentHelper } from './utils-25448fbd.esm.js';
|
|
7
7
|
import { p as pickAriaComponentVariants } from './variant-utils-7c2ea202.esm.js';
|
|
8
8
|
import '@plasmicapp/host';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useMemo, useEffect } from 'react';
|
|
2
2
|
import { Section, Header, ListBox } from 'react-aria-components';
|
|
3
|
-
import { b as PlasmicListBoxContext } from './contexts-
|
|
3
|
+
import { b as PlasmicListBoxContext } from './contexts-5cb81c2f.esm.js';
|
|
4
4
|
import { registerListBoxItem, makeDefaultListBoxItemChildren } from './registerListBoxItem.esm.js';
|
|
5
5
|
import { r as registerComponentHelper, a as makeComponentName } from './utils-25448fbd.esm.js';
|
|
6
6
|
|
|
@@ -396,4 +396,4 @@ function registerListBox(loader, overrides) {
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
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 };
|
|
399
|
-
//# sourceMappingURL=registerListBox-
|
|
399
|
+
//# sourceMappingURL=registerListBox-25d602fa.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerListBox-32d2fae3.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 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\n const section = (\n <Section {...rest}>\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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A;AAAA,SAAA,EACX,eAAe,MAAO,CAAA,aAAA,CAAA;AAAA,OAE7B;AAAA,MACA,gBAAkB,EAAA;AAAA,QAChB,OAAS,EAAA,cAAA;AAAA,QACT,UAAY,EAAA,gBAAA;AAAA,QACZ,UAAY,EAAA,gDAAA;AAAA,OACd;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"registerListBox-25d602fa.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 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\n const section = (\n <Section {...rest}>\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,KA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
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
|
-
var contexts = require('./contexts-
|
|
5
|
+
var contexts = require('./contexts-6d0cb2b1.cjs.js');
|
|
6
6
|
var registerListBoxItem = require('./registerListBoxItem.cjs.js');
|
|
7
7
|
var utils = require('./utils-3e796b18.cjs.js');
|
|
8
8
|
|
|
@@ -408,4 +408,4 @@ exports.ListBoxItemIdManager = ListBoxItemIdManager;
|
|
|
408
408
|
exports.listboxHelpers = listboxHelpers;
|
|
409
409
|
exports.registerListBox = registerListBox;
|
|
410
410
|
exports.registerSection = registerSection;
|
|
411
|
-
//# sourceMappingURL=registerListBox-
|
|
411
|
+
//# sourceMappingURL=registerListBox-f4f6beb5.cjs.js.map
|