@plasmicpkgs/react-aria 0.0.27 → 0.0.29
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 +3 -7
- package/dist/interaction-variant-utils.d.ts +4 -0
- package/dist/option-utils.d.ts +4 -13
- package/dist/react-aria.esm.js +1193 -686
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +1190 -683
- package/dist/react-aria.js.map +1 -1
- package/dist/registerDialogTrigger.d.ts +10 -0
- package/dist/registerLabel.d.ts +1 -0
- package/dist/registerListBox.d.ts +7 -5
- package/dist/registerListBoxItem.d.ts +2 -4
- package/dist/registerPopover.d.ts +4 -2
- package/dist/registerSection.d.ts +1 -3
- package/dist/registerSelect.d.ts +1 -1
- package/dist/registerSlider.d.ts +14 -0
- package/dist/registerSliderOutput.d.ts +5 -0
- package/dist/registerSliderThumb.d.ts +13 -0
- package/dist/registerSliderTrack.d.ts +14 -0
- package/package.json +3 -3
- package/skinny/ErrorBoundary-c6b111d3.esm.js +20 -0
- package/skinny/ErrorBoundary-c6b111d3.esm.js.map +1 -0
- package/skinny/ErrorBoundary-e9b86248.cjs.js +22 -0
- package/skinny/ErrorBoundary-e9b86248.cjs.js.map +1 -0
- package/skinny/{contexts-49f6c298.esm.js → contexts-8a2a183b.esm.js} +3 -2
- package/skinny/contexts-8a2a183b.esm.js.map +1 -0
- package/skinny/{contexts-3e42cdf9.cjs.js → contexts-dd0ce341.cjs.js} +3 -1
- package/skinny/contexts-dd0ce341.cjs.js.map +1 -0
- package/skinny/contexts.d.ts +3 -7
- package/skinny/{interaction-variant-utils-80bf1cfd.cjs.js → interaction-variant-utils-244b74fb.cjs.js} +20 -2
- package/skinny/interaction-variant-utils-244b74fb.cjs.js.map +1 -0
- package/skinny/{interaction-variant-utils-608d984b.esm.js → interaction-variant-utils-c44a9d56.esm.js} +20 -2
- package/skinny/interaction-variant-utils-c44a9d56.esm.js.map +1 -0
- package/skinny/interaction-variant-utils.d.ts +4 -0
- package/skinny/{option-utils-765a1782.esm.js → option-utils-4f037568.esm.js} +22 -22
- package/skinny/option-utils-4f037568.esm.js.map +1 -0
- package/skinny/{option-utils-0db61f6d.cjs.js → option-utils-5e4e85bd.cjs.js} +22 -22
- package/skinny/option-utils-5e4e85bd.cjs.js.map +1 -0
- package/skinny/option-utils.d.ts +4 -13
- package/skinny/registerButton.cjs.js +5 -1
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +5 -1
- package/skinny/registerButton.esm.js.map +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 +11 -19
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +11 -19
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDialogTrigger.cjs.js +88 -0
- package/skinny/registerDialogTrigger.cjs.js.map +1 -0
- package/skinny/registerDialogTrigger.d.ts +10 -0
- package/skinny/registerDialogTrigger.esm.js +81 -0
- package/skinny/registerDialogTrigger.esm.js.map +1 -0
- package/skinny/registerHeader.cjs.js +1 -1
- package/skinny/registerHeader.esm.js +1 -1
- package/skinny/registerInput.cjs.js +1 -1
- package/skinny/registerInput.esm.js +1 -1
- package/skinny/registerLabel.cjs.js +6 -1
- package/skinny/registerLabel.cjs.js.map +1 -1
- package/skinny/registerLabel.d.ts +1 -0
- package/skinny/registerLabel.esm.js +7 -3
- package/skinny/registerLabel.esm.js.map +1 -1
- package/skinny/registerListBox.cjs.js +30 -74
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.d.ts +7 -5
- package/skinny/registerListBox.esm.js +30 -74
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +4 -20
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.d.ts +2 -4
- package/skinny/registerListBoxItem.esm.js +4 -20
- package/skinny/registerListBoxItem.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +8 -33
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.d.ts +4 -2
- package/skinny/registerPopover.esm.js +8 -33
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +3 -18
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.esm.js +3 -18
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +2 -1
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.esm.js +2 -1
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +5 -34
- package/skinny/registerSection.cjs.js.map +1 -1
- package/skinny/registerSection.d.ts +1 -3
- package/skinny/registerSection.esm.js +5 -34
- package/skinny/registerSection.esm.js.map +1 -1
- package/skinny/registerSelect.cjs.js +5 -16
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.d.ts +1 -1
- package/skinny/registerSelect.esm.js +5 -16
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider-73e80194.cjs.js +437 -0
- package/skinny/registerSlider-73e80194.cjs.js.map +1 -0
- package/skinny/registerSlider-efdba013.esm.js +425 -0
- package/skinny/registerSlider-efdba013.esm.js.map +1 -0
- package/skinny/registerSlider.cjs.js +23 -0
- package/skinny/registerSlider.cjs.js.map +1 -0
- package/skinny/registerSlider.d.ts +14 -0
- package/skinny/registerSlider.esm.js +15 -0
- package/skinny/registerSlider.esm.js.map +1 -0
- package/skinny/registerSliderOutput.cjs.js +30 -0
- package/skinny/registerSliderOutput.cjs.js.map +1 -0
- package/skinny/registerSliderOutput.d.ts +5 -0
- package/skinny/registerSliderOutput.esm.js +26 -0
- package/skinny/registerSliderOutput.esm.js.map +1 -0
- package/skinny/registerSliderThumb.cjs.js +119 -0
- package/skinny/registerSliderThumb.cjs.js.map +1 -0
- package/skinny/registerSliderThumb.d.ts +13 -0
- package/skinny/registerSliderThumb.esm.js +111 -0
- package/skinny/registerSliderThumb.esm.js.map +1 -0
- package/skinny/registerSliderTrack.cjs.js +23 -0
- package/skinny/registerSliderTrack.cjs.js.map +1 -0
- package/skinny/registerSliderTrack.d.ts +14 -0
- package/skinny/registerSliderTrack.esm.js +15 -0
- package/skinny/registerSliderTrack.esm.js.map +1 -0
- package/skinny/registerSwitch.cjs.js +1 -1
- package/skinny/registerSwitch.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/registerTooltip.cjs.js +13 -6
- package/skinny/registerTooltip.cjs.js.map +1 -1
- package/skinny/registerTooltip.esm.js +13 -6
- package/skinny/registerTooltip.esm.js.map +1 -1
- package/skinny/contexts-3e42cdf9.cjs.js.map +0 -1
- package/skinny/contexts-49f6c298.esm.js.map +0 -1
- package/skinny/interaction-variant-utils-608d984b.esm.js.map +0 -1
- package/skinny/interaction-variant-utils-80bf1cfd.cjs.js.map +0 -1
- package/skinny/option-utils-0db61f6d.cjs.js.map +0 -1
- package/skinny/option-utils-765a1782.esm.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { mergeProps } from '@react-aria/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ListBox } from 'react-aria-components';
|
|
4
|
-
import { P as PlasmicListBoxContext, b as PlasmicSectionContext, c as PlasmicItemContext } from './contexts-
|
|
4
|
+
import { P as PlasmicListBoxContext, b as PlasmicSectionContext, c as PlasmicItemContext } from './contexts-8a2a183b.esm.js';
|
|
5
|
+
import { u as useStrictOptions, m as makeOptionsPropType } from './option-utils-4f037568.esm.js';
|
|
5
6
|
import { registerListBoxItem } from './registerListBoxItem.esm.js';
|
|
6
7
|
import { r as registerComponentHelper, m as makeComponentName } from './utils-cf2632c9.esm.js';
|
|
7
8
|
import '@plasmicapp/host/registerComponent';
|
|
@@ -37,71 +38,36 @@ var __objRest = (source, exclude) => {
|
|
|
37
38
|
}
|
|
38
39
|
return target;
|
|
39
40
|
};
|
|
40
|
-
const STANDALONE_PROPS = {
|
|
41
|
-
getItemType: (item) => item.type,
|
|
42
|
-
items: [
|
|
43
|
-
{ type: "item", value: "op1", label: "Option 1" },
|
|
44
|
-
{ type: "item", value: "op2", label: "Option 2" },
|
|
45
|
-
{ type: "item", value: "op3", label: "Option 3" },
|
|
46
|
-
{
|
|
47
|
-
type: "section",
|
|
48
|
-
label: "Section 1",
|
|
49
|
-
items: [
|
|
50
|
-
{ type: "item", value: "s1op1", label: "Section 1 Option 1" },
|
|
51
|
-
{ type: "item", value: "s1op2", label: "Section 1 Option 2" },
|
|
52
|
-
{ type: "item", value: "s1op3", label: "Section 1 Option 3" }
|
|
53
|
-
]
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
type: "section",
|
|
57
|
-
label: "Section 2",
|
|
58
|
-
items: [
|
|
59
|
-
{ type: "item", value: "s2op1", label: "Section 2 Option 1" },
|
|
60
|
-
{ type: "item", value: "s2op2", label: "Section 2 Option 2" },
|
|
61
|
-
{ type: "item", value: "s2op3", label: "Section 2 Option 3" }
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
makeItemProps: (item) => ({
|
|
66
|
-
key: item.value,
|
|
67
|
-
textValue: item.label,
|
|
68
|
-
children: item.label
|
|
69
|
-
}),
|
|
70
|
-
makeSectionProps: (section) => ({
|
|
71
|
-
section,
|
|
72
|
-
key: section.label
|
|
73
|
-
})
|
|
74
|
-
};
|
|
75
41
|
function BaseListBox(props) {
|
|
42
|
+
var _c;
|
|
76
43
|
const contextProps = React.useContext(PlasmicListBoxContext);
|
|
77
44
|
const isStandalone = !contextProps;
|
|
78
|
-
const _a =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if ((getItemType == null ? void 0 : getItemType(item)) === "section") {
|
|
93
|
-
const sectionProps = makeSectionProps == null ? void 0 : makeSectionProps(item);
|
|
94
|
-
return /* @__PURE__ */ React.createElement(
|
|
45
|
+
const _a = props, rest = __objRest(_a, ["options"]);
|
|
46
|
+
const { options } = useStrictOptions(props);
|
|
47
|
+
const _b = mergeProps(
|
|
48
|
+
contextProps,
|
|
49
|
+
rest,
|
|
50
|
+
isStandalone ? { items: options } : {}
|
|
51
|
+
), { renderItem, renderSection } = _b, mergedProps = __objRest(_b, ["renderItem", "renderSection"]);
|
|
52
|
+
(_c = props.setControlContextData) == null ? void 0 : _c.call(props, {
|
|
53
|
+
isStandalone
|
|
54
|
+
});
|
|
55
|
+
return /* @__PURE__ */ React.createElement(ListBox, __spreadValues({}, mergedProps), (item) => {
|
|
56
|
+
var _a2;
|
|
57
|
+
if (item.type === "option-group") {
|
|
58
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
95
59
|
PlasmicSectionContext.Provider,
|
|
96
60
|
{
|
|
97
|
-
|
|
98
|
-
|
|
61
|
+
value: {
|
|
62
|
+
renderItem,
|
|
63
|
+
key: (_a2 = item.key) != null ? _a2 : item.label,
|
|
64
|
+
section: item
|
|
65
|
+
}
|
|
99
66
|
},
|
|
100
67
|
renderSection == null ? void 0 : renderSection(item)
|
|
101
|
-
);
|
|
68
|
+
));
|
|
102
69
|
} else {
|
|
103
|
-
|
|
104
|
-
return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { key: itemProps == null ? void 0 : itemProps.key, value: itemProps }, renderItem == null ? void 0 : renderItem(item));
|
|
70
|
+
return /* @__PURE__ */ React.createElement(PlasmicItemContext.Provider, { value: item }, renderItem == null ? void 0 : renderItem(item));
|
|
105
71
|
}
|
|
106
72
|
});
|
|
107
73
|
}
|
|
@@ -115,29 +81,19 @@ function registerListBox(loader, overrides) {
|
|
|
115
81
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBox",
|
|
116
82
|
importName: "BaseListBox",
|
|
117
83
|
props: {
|
|
84
|
+
options: __spreadProps(__spreadValues({}, makeOptionsPropType()), {
|
|
85
|
+
displayName: "Items",
|
|
86
|
+
hidden: (_ps, ctx) => !(ctx == null ? void 0 : ctx.isStandalone)
|
|
87
|
+
}),
|
|
118
88
|
renderItem: {
|
|
119
89
|
type: "slot",
|
|
120
90
|
displayName: "Render Item",
|
|
121
|
-
renderPropParams: ["
|
|
91
|
+
renderPropParams: ["itemProps"]
|
|
122
92
|
},
|
|
123
93
|
renderSection: {
|
|
124
94
|
type: "slot",
|
|
125
95
|
displayName: "Render Section",
|
|
126
|
-
renderPropParams: ["
|
|
127
|
-
},
|
|
128
|
-
className: {
|
|
129
|
-
type: "class",
|
|
130
|
-
displayName: "Additional states",
|
|
131
|
-
selectors: [
|
|
132
|
-
{
|
|
133
|
-
selector: ":self[data-focused]",
|
|
134
|
-
label: "Focused"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
selector: ":self[data-focus-visible]",
|
|
138
|
-
label: "Focused by keyboard"
|
|
139
|
-
}
|
|
140
|
-
]
|
|
96
|
+
renderPropParams: ["sectionProps"]
|
|
141
97
|
}
|
|
142
98
|
}
|
|
143
99
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerListBox.esm.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox } from \"react-aria-components\";\nimport {\n PlasmicItemContext,\n PlasmicListBoxContext,\n PlasmicSectionContext,\n} from \"./contexts\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"registerListBox.esm.js","sources":["../src/registerListBox.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBox } from \"react-aria-components\";\nimport {\n PlasmicItemContext,\n PlasmicListBoxContext,\n PlasmicSectionContext,\n} from \"./contexts\";\nimport {\n HasOptions,\n makeOptionsPropType,\n StrictOptionType,\n useStrictOptions,\n} from \"./option-utils\";\nimport { registerListBoxItem } from \"./registerListBoxItem\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseListBoxControlContextData {\n isStandalone: boolean;\n}\n\nexport interface BaseListBoxProps\n extends React.ComponentProps<typeof ListBox>,\n HasOptions<any> {\n renderItem?: (item: any) => React.ReactNode;\n renderSection?: (section: any) => React.ReactNode;\n getItemType?: (thing: any) => \"item\" | \"section\";\n setControlContextData?: (ctxData: BaseListBoxControlContextData) => void;\n}\n\nexport function BaseListBox(props: BaseListBoxProps) {\n const contextProps = React.useContext(PlasmicListBoxContext);\n const isStandalone: boolean = !contextProps;\n const { options: _rawOptions, ...rest } = props;\n const { options } = useStrictOptions(props);\n const { renderItem, renderSection, ...mergedProps } = mergeProps(\n contextProps,\n rest,\n isStandalone ? { items: options } : {}\n );\n\n // Tell the prop control about whether the listbox is standalone or not, so it can hide/show the items prop\n props.setControlContextData?.({\n isStandalone,\n });\n\n return (\n <ListBox {...mergedProps}>\n {(item: StrictOptionType) => {\n if (item.type === \"option-group\") {\n return (\n <>\n <PlasmicSectionContext.Provider\n value={{\n renderItem,\n key: item.key ?? item.label,\n section: item,\n }}\n >\n {renderSection?.(item)}\n </PlasmicSectionContext.Provider>\n </>\n );\n } else {\n return (\n <PlasmicItemContext.Provider value={item}>\n {renderItem?.(item)}\n </PlasmicItemContext.Provider>\n );\n }\n }}\n </ListBox>\n );\n}\n\nexport function registerListBox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBox>\n) {\n registerComponentHelper(\n loader,\n BaseListBox,\n {\n name: makeComponentName(\"listbox\"),\n displayName: \"Aria ListBox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBox\",\n importName: \"BaseListBox\",\n props: {\n options: {\n ...makeOptionsPropType(),\n displayName: \"Items\",\n hidden: (\n _ps: BaseListBoxProps,\n ctx: BaseListBoxControlContextData | null\n ) => !ctx?.isStandalone,\n },\n renderItem: {\n type: \"slot\",\n displayName: \"Render Item\",\n renderPropParams: [\"itemProps\"],\n },\n renderSection: {\n type: \"slot\",\n displayName: \"Render Section\",\n renderPropParams: [\"sectionProps\"],\n },\n },\n },\n overrides\n );\n\n registerListBoxItem(loader, {\n parentComponentName: makeComponentName(\"listbox\"),\n });\n}\n"],"names":["_a"],"mappings":"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"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var utils = require('@react-aria/utils');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
|
-
var contexts = require('./contexts-
|
|
6
|
+
var contexts = require('./contexts-dd0ce341.cjs.js');
|
|
7
7
|
var utils$1 = require('./utils-18b2465b.cjs.js');
|
|
8
8
|
require('@plasmicapp/host/registerComponent');
|
|
9
9
|
|
|
@@ -28,10 +28,9 @@ var __spreadValues = (a, b) => {
|
|
|
28
28
|
return a;
|
|
29
29
|
};
|
|
30
30
|
function BaseListBoxItem(props) {
|
|
31
|
-
var _a;
|
|
32
31
|
const contextProps = React__default.default.useContext(contexts.PlasmicItemContext);
|
|
33
32
|
const mergedProps = utils.mergeProps(contextProps, props);
|
|
34
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues({
|
|
33
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.ListBoxItem, __spreadValues({}, mergedProps), mergedProps.children);
|
|
35
34
|
}
|
|
36
35
|
function registerListBoxItem(loader, overrides) {
|
|
37
36
|
utils$1.registerComponentHelper(
|
|
@@ -43,23 +42,8 @@ function registerListBoxItem(loader, overrides) {
|
|
|
43
42
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
44
43
|
importName: "BaseListBoxItem",
|
|
45
44
|
props: {
|
|
46
|
-
|
|
47
|
-
type: "
|
|
48
|
-
displayName: "Additional states",
|
|
49
|
-
selectors: [
|
|
50
|
-
{
|
|
51
|
-
selector: ":self[data-selected]",
|
|
52
|
-
label: "Selected"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
selector: ":self[data-focused], :self[data-hovered]",
|
|
56
|
-
label: "Focused"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
selector: ":self[data-disabled]",
|
|
60
|
-
label: "Disabled"
|
|
61
|
-
}
|
|
62
|
-
]
|
|
45
|
+
children: {
|
|
46
|
+
type: "slot"
|
|
63
47
|
}
|
|
64
48
|
}
|
|
65
49
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerListBoxItem.cjs.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"registerListBoxItem.cjs.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem>\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return (\n <ListBoxItem {...mergedProps}>\n {mergedProps.children as React.ReactNode}\n </ListBoxItem>\n );\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"Aria ListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n children: {\n type: \"slot\",\n },\n },\n },\n overrides\n );\n}\n"],"names":["React","PlasmicItemContext","mergeProps","ListBoxItem","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KACA,EAAA;AACA,EAAM,MAAA,YAAA,GAAeA,sBAAM,CAAA,UAAA,CAAWC,2BAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,uBACGF,sBAAA,CAAA,aAAA,CAAAG,+BAAA,EAAA,cAAA,CAAA,EAAA,EAAgB,WACd,CAAA,EAAA,WAAA,CAAY,QACf,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,0BAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,kBAAA;AAAA,MACb,UAAY,EAAA,oDAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ListBoxItem } from "react-aria-components";
|
|
3
3
|
import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
4
|
-
export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem>
|
|
5
|
-
key?: Key;
|
|
6
|
-
}): React.JSX.Element;
|
|
4
|
+
export declare function BaseListBoxItem(props: React.ComponentProps<typeof ListBoxItem>): React.JSX.Element;
|
|
7
5
|
export declare function registerListBoxItem(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergeProps } from '@react-aria/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ListBoxItem } from 'react-aria-components';
|
|
4
|
-
import { c as PlasmicItemContext } from './contexts-
|
|
4
|
+
import { c as PlasmicItemContext } from './contexts-8a2a183b.esm.js';
|
|
5
5
|
import { r as registerComponentHelper, m as makeComponentName } from './utils-cf2632c9.esm.js';
|
|
6
6
|
import '@plasmicapp/host/registerComponent';
|
|
7
7
|
|
|
@@ -22,10 +22,9 @@ var __spreadValues = (a, b) => {
|
|
|
22
22
|
return a;
|
|
23
23
|
};
|
|
24
24
|
function BaseListBoxItem(props) {
|
|
25
|
-
var _a;
|
|
26
25
|
const contextProps = React.useContext(PlasmicItemContext);
|
|
27
26
|
const mergedProps = mergeProps(contextProps, props);
|
|
28
|
-
return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues({
|
|
27
|
+
return /* @__PURE__ */ React.createElement(ListBoxItem, __spreadValues({}, mergedProps), mergedProps.children);
|
|
29
28
|
}
|
|
30
29
|
function registerListBoxItem(loader, overrides) {
|
|
31
30
|
registerComponentHelper(
|
|
@@ -37,23 +36,8 @@ function registerListBoxItem(loader, overrides) {
|
|
|
37
36
|
importPath: "@plasmicpkgs/react-aria/skinny/registerListBoxItem",
|
|
38
37
|
importName: "BaseListBoxItem",
|
|
39
38
|
props: {
|
|
40
|
-
|
|
41
|
-
type: "
|
|
42
|
-
displayName: "Additional states",
|
|
43
|
-
selectors: [
|
|
44
|
-
{
|
|
45
|
-
selector: ":self[data-selected]",
|
|
46
|
-
label: "Selected"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
selector: ":self[data-focused], :self[data-hovered]",
|
|
50
|
-
label: "Focused"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
selector: ":self[data-disabled]",
|
|
54
|
-
label: "Disabled"
|
|
55
|
-
}
|
|
56
|
-
]
|
|
39
|
+
children: {
|
|
40
|
+
type: "slot"
|
|
57
41
|
}
|
|
58
42
|
}
|
|
59
43
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerListBoxItem.esm.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"registerListBoxItem.esm.js","sources":["../src/registerListBoxItem.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { ListBoxItem } from \"react-aria-components\";\nimport { PlasmicItemContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport function BaseListBoxItem(\n props: React.ComponentProps<typeof ListBoxItem>\n) {\n const contextProps = React.useContext(PlasmicItemContext);\n const mergedProps = mergeProps(contextProps, props);\n return (\n <ListBoxItem {...mergedProps}>\n {mergedProps.children as React.ReactNode}\n </ListBoxItem>\n );\n}\n\nexport function registerListBoxItem(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseListBoxItem>\n) {\n registerComponentHelper(\n loader,\n BaseListBoxItem,\n {\n name: makeComponentName(\"item\"),\n displayName: \"Aria ListBoxItem\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerListBoxItem\",\n importName: \"BaseListBoxItem\",\n props: {\n children: {\n type: \"slot\",\n },\n },\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,gBACd,KACA,EAAA;AACA,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,kBAAkB,CAAA,CAAA;AACxD,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,KAAK,CAAA,CAAA;AAClD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,cAAA,CAAA,EAAA,EAAgB,WACd,CAAA,EAAA,WAAA,CAAY,QACf,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,mBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,MAAM,CAAA;AAAA,MAC9B,WAAa,EAAA,kBAAA;AAAA,MACb,UAAY,EAAA,oDAAA;AAAA,MACZ,UAAY,EAAA,iBAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,OACF;AAAA,KACF;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var host = require('@plasmicapp/host');
|
|
4
3
|
var utils = require('@react-aria/utils');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var reactAriaComponents = require('react-aria-components');
|
|
7
|
-
var contexts = require('./contexts-
|
|
6
|
+
var contexts = require('./contexts-dd0ce341.cjs.js');
|
|
8
7
|
var utils$1 = require('./utils-18b2465b.cjs.js');
|
|
9
8
|
require('@plasmicapp/host/registerComponent');
|
|
10
9
|
|
|
@@ -13,8 +12,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
13
12
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
13
|
|
|
15
14
|
var __defProp = Object.defineProperty;
|
|
16
|
-
var __defProps = Object.defineProperties;
|
|
17
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
18
15
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
19
16
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
20
17
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -30,7 +27,6 @@ var __spreadValues = (a, b) => {
|
|
|
30
27
|
}
|
|
31
28
|
return a;
|
|
32
29
|
};
|
|
33
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
34
30
|
var __objRest = (source, exclude) => {
|
|
35
31
|
var target = {};
|
|
36
32
|
for (var prop in source)
|
|
@@ -47,23 +43,16 @@ function BasePopover(props) {
|
|
|
47
43
|
const _a = props, { resetClassName } = _a, restProps = __objRest(_a, ["resetClassName"]);
|
|
48
44
|
const isStandalone = !React__default.default.useContext(reactAriaComponents.PopoverContext);
|
|
49
45
|
const contextProps = React__default.default.useContext(contexts.PlasmicPopoverContext);
|
|
50
|
-
const canvas = host.usePlasmicCanvasContext();
|
|
51
46
|
const mergedProps = utils.mergeProps(contextProps, restProps, {
|
|
52
47
|
className: `${resetClassName}`
|
|
53
48
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
isOpen: true
|
|
62
|
-
})
|
|
63
|
-
));
|
|
64
|
-
} else {
|
|
65
|
-
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadProps(__spreadValues({}, mergedProps), { isNonModal: !!canvas }));
|
|
66
|
-
}
|
|
49
|
+
const triggerRef = React__default.default.useRef(null);
|
|
50
|
+
const standaloneProps = isStandalone ? {
|
|
51
|
+
triggerRef,
|
|
52
|
+
isNonModal: true,
|
|
53
|
+
isOpen: true
|
|
54
|
+
} : {};
|
|
55
|
+
return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, isStandalone && /* @__PURE__ */ React__default.default.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Popover, __spreadValues(__spreadValues({}, mergedProps), standaloneProps)));
|
|
67
56
|
}
|
|
68
57
|
function registerPopover(loader, overrides) {
|
|
69
58
|
utils$1.registerComponentHelper(
|
|
@@ -99,20 +88,6 @@ function registerPopover(loader, overrides) {
|
|
|
99
88
|
resetClassName: {
|
|
100
89
|
type: "themeResetClass"
|
|
101
90
|
}
|
|
102
|
-
// className: {
|
|
103
|
-
// type: "class",
|
|
104
|
-
// displayName: "Additional states",
|
|
105
|
-
// selectors: [
|
|
106
|
-
// {
|
|
107
|
-
// selector: ":self[data-entering]",
|
|
108
|
-
// label: "Entering",
|
|
109
|
-
// },
|
|
110
|
-
// {
|
|
111
|
-
// selector: ":self[data-exiting]",
|
|
112
|
-
// label: "Exiting",
|
|
113
|
-
// },
|
|
114
|
-
// ],
|
|
115
|
-
// },
|
|
116
91
|
},
|
|
117
92
|
styleSections: true
|
|
118
93
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"registerPopover.cjs.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BasePopoverProps extends React.ComponentProps<typeof Popover> {\n className?: string;\n resetClassName?: string;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${resetClassName}`,\n });\n\n const triggerRef = React.useRef<any>(null);\n\n const standaloneProps = isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n isOpen: true,\n }\n : {};\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover {...mergedProps} {...standaloneProps} />\n </>\n );\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":["React","PopoverContext","PlasmicPopoverContext","mergeProps","Popover","registerComponentHelper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,SAAS,YAAY,KAAyB,EAAA;AACnD,EAAA,MAAyC,YAAjC,EAhBV,cAAA,EAAA,GAgB2C,EAAd,EAAA,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,CAAA,CAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAACA,sBAAM,CAAA,UAAA,CAAWC,kCAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAeD,sBAAM,CAAA,UAAA,CAAWE,8BAAqB,CAAA,CAAA;AAC3D,EAAM,MAAA,WAAA,GAAcC,gBAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,WAAW,CAAG,EAAA,cAAA,CAAA,CAAA;AAAA,GACf,CAAA,CAAA;AAED,EAAM,MAAA,UAAA,GAAaH,sBAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AAEzC,EAAA,MAAM,kBAAkB,YACpB,GAAA;AAAA,IACE,UAAA;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,IACZ,MAAQ,EAAA,IAAA;AAAA,MAEV,EAAC,CAAA;AAEL,EACE,uBAAAA,sBAAA,CAAA,aAAA,CAAAA,sBAAA,CAAA,QAAA,EAAA,IAAA,EACG,YAAgB,oBAAAA,sBAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,CAAA,kBACtCA,sBAAA,CAAA,aAAA,CAAAI,2BAAA,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAY,WAAiB,CAAA,EAAA,eAAA,CAAiB,CACjD,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,eAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,+BAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,4BAAA;AAAA,MACN,WAAa,EAAA,cAAA;AAAA,MACb,UAAY,EAAA,gDAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,QAAA;AAAA,UACN,WAAa,EAAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Popover } from "react-aria-components";
|
|
2
3
|
import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
3
|
-
export
|
|
4
|
+
export interface BasePopoverProps extends React.ComponentProps<typeof Popover> {
|
|
4
5
|
className?: string;
|
|
5
6
|
resetClassName?: string;
|
|
6
|
-
}
|
|
7
|
+
}
|
|
8
|
+
export declare function BasePopover(props: BasePopoverProps): React.JSX.Element;
|
|
7
9
|
export declare function registerPopover(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BasePopover>): void;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { usePlasmicCanvasContext } from '@plasmicapp/host';
|
|
2
1
|
import { mergeProps } from '@react-aria/utils';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { PopoverContext, Popover } from 'react-aria-components';
|
|
5
|
-
import { d as PlasmicPopoverContext } from './contexts-
|
|
4
|
+
import { d as PlasmicPopoverContext } from './contexts-8a2a183b.esm.js';
|
|
6
5
|
import { r as registerComponentHelper } from './utils-cf2632c9.esm.js';
|
|
7
6
|
import '@plasmicapp/host/registerComponent';
|
|
8
7
|
|
|
9
8
|
var __defProp = Object.defineProperty;
|
|
10
|
-
var __defProps = Object.defineProperties;
|
|
11
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
9
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
11
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -24,7 +21,6 @@ var __spreadValues = (a, b) => {
|
|
|
24
21
|
}
|
|
25
22
|
return a;
|
|
26
23
|
};
|
|
27
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
24
|
var __objRest = (source, exclude) => {
|
|
29
25
|
var target = {};
|
|
30
26
|
for (var prop in source)
|
|
@@ -41,23 +37,16 @@ function BasePopover(props) {
|
|
|
41
37
|
const _a = props, { resetClassName } = _a, restProps = __objRest(_a, ["resetClassName"]);
|
|
42
38
|
const isStandalone = !React.useContext(PopoverContext);
|
|
43
39
|
const contextProps = React.useContext(PlasmicPopoverContext);
|
|
44
|
-
const canvas = usePlasmicCanvasContext();
|
|
45
40
|
const mergedProps = mergeProps(contextProps, restProps, {
|
|
46
41
|
className: `${resetClassName}`
|
|
47
42
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
isOpen: true
|
|
56
|
-
})
|
|
57
|
-
));
|
|
58
|
-
} else {
|
|
59
|
-
return /* @__PURE__ */ React.createElement(Popover, __spreadProps(__spreadValues({}, mergedProps), { isNonModal: !!canvas }));
|
|
60
|
-
}
|
|
43
|
+
const triggerRef = React.useRef(null);
|
|
44
|
+
const standaloneProps = isStandalone ? {
|
|
45
|
+
triggerRef,
|
|
46
|
+
isNonModal: true,
|
|
47
|
+
isOpen: true
|
|
48
|
+
} : {};
|
|
49
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, isStandalone && /* @__PURE__ */ React.createElement("div", { ref: triggerRef }), /* @__PURE__ */ React.createElement(Popover, __spreadValues(__spreadValues({}, mergedProps), standaloneProps)));
|
|
61
50
|
}
|
|
62
51
|
function registerPopover(loader, overrides) {
|
|
63
52
|
registerComponentHelper(
|
|
@@ -93,20 +82,6 @@ function registerPopover(loader, overrides) {
|
|
|
93
82
|
resetClassName: {
|
|
94
83
|
type: "themeResetClass"
|
|
95
84
|
}
|
|
96
|
-
// className: {
|
|
97
|
-
// type: "class",
|
|
98
|
-
// displayName: "Additional states",
|
|
99
|
-
// selectors: [
|
|
100
|
-
// {
|
|
101
|
-
// selector: ":self[data-entering]",
|
|
102
|
-
// label: "Entering",
|
|
103
|
-
// },
|
|
104
|
-
// {
|
|
105
|
-
// selector: ":self[data-exiting]",
|
|
106
|
-
// label: "Exiting",
|
|
107
|
-
// },
|
|
108
|
-
// ],
|
|
109
|
-
// },
|
|
110
85
|
},
|
|
111
86
|
styleSections: true
|
|
112
87
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"registerPopover.esm.js","sources":["../src/registerPopover.tsx"],"sourcesContent":["import { mergeProps } from \"@react-aria/utils\";\nimport React from \"react\";\nimport { Popover, PopoverContext } from \"react-aria-components\";\nimport { PlasmicPopoverContext } from \"./contexts\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\nexport interface BasePopoverProps extends React.ComponentProps<typeof Popover> {\n className?: string;\n resetClassName?: string;\n}\n\nexport function BasePopover(props: BasePopoverProps) {\n const { resetClassName, ...restProps } = props;\n const isStandalone = !React.useContext(PopoverContext);\n const contextProps = React.useContext(PlasmicPopoverContext);\n const mergedProps = mergeProps(contextProps, restProps, {\n className: `${resetClassName}`,\n });\n\n const triggerRef = React.useRef<any>(null);\n\n const standaloneProps = isStandalone\n ? {\n triggerRef,\n isNonModal: true,\n isOpen: true,\n }\n : {};\n\n return (\n <>\n {isStandalone && <div ref={triggerRef} />}\n <Popover {...mergedProps} {...standaloneProps} />\n </>\n );\n}\n\nexport function registerPopover(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BasePopover>\n) {\n registerComponentHelper(\n loader,\n BasePopover,\n {\n name: \"plasmic-react-aria-popover\",\n displayName: \"Aria Popover\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerPopover\",\n importName: \"BasePopover\",\n props: {\n children: {\n type: \"slot\",\n },\n offset: {\n type: \"number\",\n displayName: \"Offset\",\n description:\n \"Additional offset applied vertically between the popover and its trigger\",\n defaultValueHint: 0,\n },\n placement: {\n type: \"choice\",\n description:\n \"Default placement of the popover relative to the trigger, if there is enough space\",\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"top\",\n \"top left\",\n \"top right\",\n ],\n },\n resetClassName: {\n type: \"themeResetClass\",\n },\n },\n styleSections: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,SAAS,YAAY,KAAyB,EAAA;AACnD,EAAA,MAAyC,YAAjC,EAhBV,cAAA,EAAA,GAgB2C,EAAd,EAAA,SAAA,GAAA,SAAA,CAAc,IAAd,CAAnB,gBAAA,CAAA,CAAA,CAAA;AACR,EAAA,MAAM,YAAe,GAAA,CAAC,KAAM,CAAA,UAAA,CAAW,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,YAAA,GAAe,KAAM,CAAA,UAAA,CAAW,qBAAqB,CAAA,CAAA;AAC3D,EAAM,MAAA,WAAA,GAAc,UAAW,CAAA,YAAA,EAAc,SAAW,EAAA;AAAA,IACtD,WAAW,CAAG,EAAA,cAAA,CAAA,CAAA;AAAA,GACf,CAAA,CAAA;AAED,EAAM,MAAA,UAAA,GAAa,KAAM,CAAA,MAAA,CAAY,IAAI,CAAA,CAAA;AAEzC,EAAA,MAAM,kBAAkB,YACpB,GAAA;AAAA,IACE,UAAA;AAAA,IACA,UAAY,EAAA,IAAA;AAAA,IACZ,MAAQ,EAAA,IAAA;AAAA,MAEV,EAAC,CAAA;AAEL,EACE,uBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,YAAgB,oBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,UAAY,EAAA,CAAA,kBACtC,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAY,WAAiB,CAAA,EAAA,eAAA,CAAiB,CACjD,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,eAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,4BAAA;AAAA,MACN,WAAa,EAAA,cAAA;AAAA,MACb,UAAY,EAAA,gDAAA;AAAA,MACZ,UAAY,EAAA,aAAA;AAAA,MACZ,KAAO,EAAA;AAAA,QACL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,SACR;AAAA,QACA,MAAQ,EAAA;AAAA,UACN,IAAM,EAAA,QAAA;AAAA,UACN,WAAa,EAAA,QAAA;AAAA,UACb,WACE,EAAA,0EAAA;AAAA,UACF,gBAAkB,EAAA,CAAA;AAAA,SACpB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oFAAA;AAAA,UACF,OAAS,EAAA;AAAA,YACP,QAAA;AAAA,YACA,aAAA;AAAA,YACA,cAAA;AAAA,YACA,KAAA;AAAA,YACA,UAAA;AAAA,YACA,WAAA;AAAA,WACF;AAAA,SACF;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,iBAAA;AAAA,SACR;AAAA,OACF;AAAA,MACA,aAAe,EAAA,IAAA;AAAA,KACjB;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
|
+
var ErrorBoundary = require('./ErrorBoundary-e9b86248.cjs.js');
|
|
5
6
|
var common = require('./common-e74a9214.cjs.js');
|
|
6
|
-
var interactionVariantUtils = require('./interaction-variant-utils-
|
|
7
|
+
var interactionVariantUtils = require('./interaction-variant-utils-244b74fb.cjs.js');
|
|
7
8
|
var utils = require('./utils-18b2465b.cjs.js');
|
|
8
9
|
require('@plasmicapp/host/registerComponent');
|
|
9
10
|
|
|
@@ -11,22 +12,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
11
12
|
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
14
|
|
|
14
|
-
class ErrorBoundary extends React.Component {
|
|
15
|
-
constructor(props) {
|
|
16
|
-
super(props);
|
|
17
|
-
this.state = { hasError: false };
|
|
18
|
-
}
|
|
19
|
-
static getDerivedStateFromError(_) {
|
|
20
|
-
return { hasError: true };
|
|
21
|
-
}
|
|
22
|
-
render() {
|
|
23
|
-
if (this.state.hasError) {
|
|
24
|
-
return this.props.fallback;
|
|
25
|
-
}
|
|
26
|
-
return this.props.children;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
15
|
var __defProp = Object.defineProperty;
|
|
31
16
|
var __defProps = Object.defineProperties;
|
|
32
17
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -79,7 +64,7 @@ function BaseRadio(props) {
|
|
|
79
64
|
},
|
|
80
65
|
updateInteractionVariant
|
|
81
66
|
));
|
|
82
|
-
return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
|
|
67
|
+
return /* @__PURE__ */ React__default.default.createElement(ErrorBoundary.ErrorBoundary, { fallback: /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.RadioGroup, null, radio) }, radio);
|
|
83
68
|
}
|
|
84
69
|
function registerRadio(loader, overrides) {
|
|
85
70
|
utils.registerComponentHelper(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerRadio.cjs.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"registerRadio.cjs.js","sources":["../src/registerRadio.tsx"],"sourcesContent":["import React from \"react\";\nimport type { RadioProps } from \"react-aria-components\";\nimport { Radio, RadioGroup } from \"react-aria-components\";\nimport ErrorBoundary from \"./ErrorBoundary\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst RADIO_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n];\n\nexport interface BaseRadioProps extends RadioProps {\n children: React.ReactNode;\n isSelected: boolean;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof RADIO_INTERACTION_VARIANTS\n >;\n}\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n RADIO_INTERACTION_VARIANTS\n);\n\nexport function BaseRadio(props: BaseRadioProps) {\n const { children, updateInteractionVariant, ...rest } = props;\n\n const radio = (\n <Radio {...rest}>\n {({ isHovered, isPressed, isFocused, isFocusVisible }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n },\n updateInteractionVariant\n )\n }\n </Radio>\n );\n\n return (\n <ErrorBoundary fallback={<RadioGroup>{radio}</RadioGroup>}>\n {radio}\n </ErrorBoundary>\n );\n}\n\nexport function registerRadio(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseRadio>\n) {\n registerComponentHelper(\n loader,\n BaseRadio,\n {\n name: makeComponentName(\"radio\"),\n displayName: \"Aria Radio\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerRadio\",\n importName: \"BaseRadio\",\n interactionVariants,\n props: {\n ...getCommonInputProps<BaseRadioProps>(\"radio\", [\n \"isDisabled\",\n \"autoFocus\",\n \"aria-label\",\n \"children\",\n ]),\n value: {\n type: \"string\",\n description:\n \"The value of the input element, used when submitting an HTML form.\",\n },\n onSelectionChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"readonly\",\n onChangeProp: \"onSelectionChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","Radio","ErrorBoundary","RadioGroup","registerComponentHelper","makeComponentName","getCommonInputProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,0BAA6B,GAAA;AAAA,EACjC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AACF,CAAA,CAAA;AAYA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,0BAAA;AACF,CAAA,CAAA;AAEO,SAAS,UAAU,KAAuB,EAAA;AAC/C,EAAwD,MAAA,EAAA,GAAA,KAAA,EAAhD,YAAU,wBAtCpB,EAAA,GAsC0D,IAAT,IAAS,GAAA,SAAA,CAAA,EAAA,EAAT,CAAvC,UAAU,EAAA,0BAAA,CAAA,CAAA,CAAA;AAElB,EAAM,MAAA,KAAA,mBACHC,sBAAA,CAAA,aAAA,CAAAC,yBAAA,EAAA,cAAA,CAAA,EAAA,EAAU,IACR,CAAA,EAAA,CAAC,EAAE,SAAW,EAAA,SAAA,EAAW,SAAW,EAAA,cAAA,EACnC,KAAA,kBAAA;AAAA,IACE,QAAA;AAAA,IACA;AAAA,MACE,OAAS,EAAA,SAAA;AAAA,MACT,OAAS,EAAA,SAAA;AAAA,MACT,OAAS,EAAA,SAAA;AAAA,MACT,YAAc,EAAA,cAAA;AAAA,KAChB;AAAA,IACA,wBAAA;AAAA,GAGN,CAAA,CAAA;AAGF,EAAA,4DACGC,2BAAc,EAAA,EAAA,QAAA,uDAAWC,8BAAY,EAAA,IAAA,EAAA,KAAM,KACzC,KACH,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,aAAA,CACd,QACA,SACA,EAAA;AACA,EAAAC,6BAAA;AAAA,IACE,MAAA;AAAA,IACA,SAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAMC,wBAAkB,OAAO,CAAA;AAAA,MAC/B,WAAa,EAAA,YAAA;AAAA,MACb,UAAY,EAAA,8CAAA;AAAA,MACZ,UAAY,EAAA,WAAA;AAAA,MACZ,mBAAA;AAAA,MACA,KAAA,EAAO,aACF,CAAA,cAAA,CAAA,EAAA,EAAAC,0BAAA,CAAoC,OAAS,EAAA;AAAA,QAC9C,YAAA;AAAA,QACA,WAAA;AAAA,QACA,YAAA;AAAA,QACA,UAAA;AAAA,OACD,CANI,CAAA,EAAA;AAAA,QAOL,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,QAAA;AAAA,UACN,WACE,EAAA,oEAAA;AAAA,SACJ;AAAA,QACA,iBAAmB,EAAA;AAAA,UACjB,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,WAAW,CAAA;AAAA,SACpD;AAAA,OACF,CAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,mBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
|