@plasmicpkgs/react-aria 0.0.98 → 0.0.99
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/react-aria.esm.js +90 -23
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +89 -22
- package/dist/react-aria.js.map +1 -1
- package/dist/registerButton.d.ts +10 -3
- package/package.json +2 -2
- package/skinny/registerButton.cjs.js +89 -22
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.d.ts +10 -3
- package/skinny/registerButton.esm.js +90 -23
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerComboBox.cjs.js +1 -1
- package/skinny/registerComboBox.esm.js +1 -1
- package/skinny/registerSelect.cjs.js +1 -1
- package/skinny/registerSelect.esm.js +1 -1
package/dist/registerButton.d.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { ButtonProps } from "react-aria-components";
|
|
2
|
+
import type { ButtonProps, LinkProps } from "react-aria-components";
|
|
3
3
|
import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
4
4
|
import { WithVariants } from "./variant-utils";
|
|
5
5
|
declare const BUTTON_VARIANTS: ("disabled" | "hovered" | "pressed" | "focused" | "focusVisible")[];
|
|
6
|
-
|
|
6
|
+
type CommonProps = {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
} & Omit<ButtonProps, "className" | "children"> & Omit<LinkProps, "className" | "children">;
|
|
9
|
+
type LinkSpecificProps = Pick<LinkProps, "href" | "target">;
|
|
10
|
+
type ButtonSpecificProps = {
|
|
8
11
|
resetsForm?: boolean;
|
|
9
12
|
submitsForm?: boolean;
|
|
13
|
+
};
|
|
14
|
+
interface BaseButtonProps extends CommonProps, LinkSpecificProps, ButtonSpecificProps, WithVariants<typeof BUTTON_VARIANTS> {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
10
17
|
}
|
|
11
|
-
export declare const BaseButton: React.ForwardRefExoticComponent<BaseButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export declare const BaseButton: React.ForwardRefExoticComponent<BaseButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
12
19
|
export declare const BUTTON_COMPONENT_NAME: string;
|
|
13
20
|
export declare function registerButton(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseButton>): void;
|
|
14
21
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.99",
|
|
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": "48b2febe42b01040253c1874143862d9a7ea4b4f"
|
|
78
78
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var host = require('@plasmicapp/host');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var reactAria = require('react-aria');
|
|
5
6
|
var reactAriaComponents = require('react-aria-components');
|
|
6
7
|
var common = require('./common-b3b54c72.cjs.js');
|
|
7
8
|
var utils = require('./utils-7d000fa4.cjs.js');
|
|
8
9
|
var variantUtils = require('./variant-utils-0ad70db8.cjs.js');
|
|
9
|
-
require('@plasmicapp/host');
|
|
10
10
|
require('@plasmicapp/host/registerComponent');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -53,24 +53,73 @@ const BUTTON_VARIANTS = [
|
|
|
53
53
|
];
|
|
54
54
|
const { variants, withObservedValues } = variantUtils.pickAriaComponentVariants(BUTTON_VARIANTS);
|
|
55
55
|
const BaseButton = React__default.default.forwardRef(function BaseButtonInner(props, ref) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
const { href } = props;
|
|
57
|
+
if (href) {
|
|
58
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
59
|
+
LinkButton,
|
|
60
|
+
{
|
|
61
|
+
props,
|
|
62
|
+
ref
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
} else {
|
|
66
|
+
const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
|
|
67
|
+
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
68
|
+
const buttonProps = reactAria.mergeProps(rest, {
|
|
69
|
+
type,
|
|
70
|
+
style: common.COMMON_STYLES,
|
|
71
|
+
ref
|
|
72
|
+
});
|
|
73
|
+
return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues({}, buttonProps), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues(
|
|
74
|
+
children,
|
|
75
|
+
{
|
|
76
|
+
hovered: isHovered,
|
|
77
|
+
pressed: isPressed,
|
|
78
|
+
focused: isFocused,
|
|
79
|
+
focusVisible: isFocusVisible,
|
|
80
|
+
disabled: isDisabled
|
|
81
|
+
},
|
|
82
|
+
plasmicUpdateVariant
|
|
83
|
+
));
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function LinkButton({
|
|
87
|
+
props,
|
|
88
|
+
ref
|
|
89
|
+
}) {
|
|
90
|
+
const _a = props, { href, children, plasmicUpdateVariant } = _a, rest = __objRest(_a, ["href", "children", "plasmicUpdateVariant"]);
|
|
91
|
+
const PlasmicLink = host.usePlasmicLink();
|
|
92
|
+
const { linkProps, isPressed } = reactAria.useLink(props, ref);
|
|
93
|
+
const { hoverProps, isHovered } = reactAria.useHover(props);
|
|
94
|
+
const { focusProps, isFocused, isFocusVisible } = reactAria.useFocusRing();
|
|
95
|
+
const combinedLinkProps = reactAria.mergeProps(linkProps, hoverProps, focusProps, {
|
|
96
|
+
href,
|
|
97
|
+
className: props.className,
|
|
98
|
+
style: common.COMMON_STYLES,
|
|
60
99
|
ref
|
|
61
100
|
});
|
|
62
|
-
return /* @__PURE__ */ React__default.default.createElement(
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
disabled: isDisabled
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
101
|
+
return /* @__PURE__ */ React__default.default.createElement(
|
|
102
|
+
PlasmicLink,
|
|
103
|
+
__spreadProps(__spreadValues({}, combinedLinkProps), {
|
|
104
|
+
"data-focused": isFocused || void 0,
|
|
105
|
+
"data-hovered": isHovered || void 0,
|
|
106
|
+
"data-pressed": isPressed || void 0,
|
|
107
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
108
|
+
"data-disabled": props.isDisabled || void 0
|
|
109
|
+
}),
|
|
110
|
+
withObservedValues(
|
|
111
|
+
children,
|
|
112
|
+
{
|
|
113
|
+
hovered: isHovered,
|
|
114
|
+
pressed: isPressed,
|
|
115
|
+
focused: isFocused,
|
|
116
|
+
focusVisible: isFocusVisible,
|
|
117
|
+
disabled: !!rest.isDisabled
|
|
118
|
+
},
|
|
119
|
+
plasmicUpdateVariant
|
|
120
|
+
)
|
|
121
|
+
);
|
|
122
|
+
}
|
|
74
123
|
const BUTTON_COMPONENT_NAME = utils.makeComponentName("button");
|
|
75
124
|
function registerButton(loader, overrides) {
|
|
76
125
|
utils.registerComponentHelper(
|
|
@@ -83,11 +132,18 @@ function registerButton(loader, overrides) {
|
|
|
83
132
|
importName: "BaseButton",
|
|
84
133
|
variants,
|
|
85
134
|
defaultStyles: {
|
|
86
|
-
|
|
87
|
-
|
|
135
|
+
// Ensure consistent design across rendered elements (button, anchor tag).
|
|
136
|
+
backgroundColor: "#EFEFEF",
|
|
88
137
|
borderColor: "black",
|
|
138
|
+
borderStyle: "solid",
|
|
139
|
+
borderWidth: "1px",
|
|
140
|
+
color: "#000000",
|
|
141
|
+
cursor: "pointer",
|
|
142
|
+
fontFamily: "Arial",
|
|
143
|
+
fontSize: "1rem",
|
|
144
|
+
lineHeight: "1.2",
|
|
89
145
|
padding: "2px 10px",
|
|
90
|
-
|
|
146
|
+
textDecorationLine: "none"
|
|
91
147
|
},
|
|
92
148
|
props: __spreadProps(__spreadValues({}, common.getCommonProps("button", [
|
|
93
149
|
"autoFocus",
|
|
@@ -102,11 +158,22 @@ function registerButton(loader, overrides) {
|
|
|
102
158
|
value: "Button"
|
|
103
159
|
}
|
|
104
160
|
},
|
|
161
|
+
href: {
|
|
162
|
+
type: "href",
|
|
163
|
+
description: "The URL this button navigates to. If present, this button is an <a> element."
|
|
164
|
+
},
|
|
165
|
+
target: {
|
|
166
|
+
type: "choice",
|
|
167
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
168
|
+
description: "Same as target attribute of <a> element. Only applies when the href prop is present.",
|
|
169
|
+
hidden: (props) => !props.href,
|
|
170
|
+
defaultValueHint: "_self"
|
|
171
|
+
},
|
|
105
172
|
submitsForm: {
|
|
106
173
|
type: "boolean",
|
|
107
174
|
displayName: "Submits form?",
|
|
108
175
|
defaultValueHint: false,
|
|
109
|
-
hidden: (props) => Boolean(props.resetsForm),
|
|
176
|
+
hidden: (props) => Boolean(props.resetsForm) || Boolean(props.href),
|
|
110
177
|
description: "Whether clicking this button should submit the enclosing form.",
|
|
111
178
|
advanced: true
|
|
112
179
|
},
|
|
@@ -114,7 +181,7 @@ function registerButton(loader, overrides) {
|
|
|
114
181
|
type: "boolean",
|
|
115
182
|
displayName: "Resets form?",
|
|
116
183
|
defaultValueHint: false,
|
|
117
|
-
hidden: (props) => Boolean(props.submitsForm),
|
|
184
|
+
hidden: (props) => Boolean(props.submitsForm) || Boolean(props.href),
|
|
118
185
|
description: "Whether clicking this button should reset the enclosing form.",
|
|
119
186
|
advanced: true
|
|
120
187
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { COMMON_STYLES, getCommonProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\nconst BUTTON_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(BUTTON_VARIANTS);\n\ninterface BaseButtonProps\n extends ButtonProps,\n WithVariants<typeof BUTTON_VARIANTS> {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: boolean;\n}\n\nexport const BaseButton = React.forwardRef(function BaseButtonInner(\n props: BaseButtonProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const { submitsForm, resetsForm, children, plasmicUpdateVariant, ...rest } =\n props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n const mergedProps = mergeProps(rest, {\n type,\n ref,\n });\n\n return (\n <Button {...mergedProps} style={COMMON_STYLES}>\n {({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n },\n plasmicUpdateVariant\n )\n }\n </Button>\n );\n});\n\nexport const BUTTON_COMPONENT_NAME = makeComponentName(\"button\");\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: BUTTON_COMPONENT_NAME,\n displayName: \"Aria Button\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerButton\",\n importName: \"BaseButton\",\n variants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"2px 10px\",\n cursor: \"pointer\",\n },\n props: {\n ...getCommonProps<BaseButtonProps>(\"button\", [\n \"autoFocus\",\n \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.resetsForm),\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n resetsForm: {\n type: \"boolean\",\n displayName: \"Resets form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.submitsForm),\n description:\n \"Whether clicking this button should reset the enclosing form.\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","mergeProps","Button","COMMON_STYLES","makeComponentName","registerComponentHelper","getCommonProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,eAAkB,GAAA;AAAA,EACtB,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,QAAA,EAAU,kBAAmB,EAAA,GACnCA,uCAA0B,eAAe,CAAA,CAAA;AAUpC,MAAM,aAAaC,sBAAM,CAAA,UAAA,CAAW,SAAS,eAAA,CAClD,OACA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C,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
|
|
1
|
+
{"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import { usePlasmicLink } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport { mergeProps, useFocusRing, useHover, useLink } from \"react-aria\";\nimport type { ButtonProps, LinkProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { COMMON_STYLES, getCommonProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\nconst BUTTON_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(BUTTON_VARIANTS);\n\ntype CommonProps = { children: React.ReactNode } & Omit<\n ButtonProps,\n \"className\" | \"children\"\n> &\n Omit<LinkProps, \"className\" | \"children\">;\ntype LinkSpecificProps = Pick<LinkProps, \"href\" | \"target\">;\ntype ButtonSpecificProps = {\n resetsForm?: boolean;\n submitsForm?: boolean;\n};\n\ninterface BaseButtonProps\n extends CommonProps,\n LinkSpecificProps,\n ButtonSpecificProps,\n WithVariants<typeof BUTTON_VARIANTS> {\n children: React.ReactNode;\n className?: string;\n}\n\nexport const BaseButton = React.forwardRef(function BaseButtonInner(\n props: BaseButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { href } = props;\n\n if (href) {\n return (\n <LinkButton\n props={props}\n ref={ref as React.RefObject<HTMLAnchorElement>}\n />\n );\n } else {\n const { submitsForm, resetsForm, children, plasmicUpdateVariant, ...rest } =\n props;\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n const buttonProps = mergeProps(rest, {\n type,\n style: COMMON_STYLES,\n ref: ref as React.Ref<HTMLButtonElement>,\n });\n\n return (\n <Button {...buttonProps}>\n {({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n },\n plasmicUpdateVariant\n )\n }\n </Button>\n );\n }\n});\n\nfunction LinkButton({\n props,\n ref,\n}: {\n props: BaseButtonProps;\n ref: React.RefObject<HTMLAnchorElement>;\n}) {\n const { href, children, plasmicUpdateVariant, ...rest } = props;\n const PlasmicLink = usePlasmicLink();\n const { linkProps, isPressed } = useLink(props, ref);\n const { hoverProps, isHovered } = useHover(props);\n const { focusProps, isFocused, isFocusVisible } = useFocusRing();\n\n const combinedLinkProps = mergeProps(linkProps, hoverProps, focusProps, {\n href,\n className: props.className,\n style: COMMON_STYLES,\n ref,\n });\n\n return (\n <PlasmicLink\n {...combinedLinkProps}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n >\n {withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: !!rest.isDisabled,\n },\n plasmicUpdateVariant\n )}\n </PlasmicLink>\n );\n}\n\nexport const BUTTON_COMPONENT_NAME = makeComponentName(\"button\");\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: BUTTON_COMPONENT_NAME,\n displayName: \"Aria Button\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerButton\",\n importName: \"BaseButton\",\n variants,\n defaultStyles: {\n // Ensure consistent design across rendered elements (button, anchor tag).\n backgroundColor: \"#EFEFEF\",\n borderColor: \"black\",\n borderStyle: \"solid\",\n borderWidth: \"1px\",\n color: \"#000000\",\n cursor: \"pointer\",\n fontFamily: \"Arial\",\n fontSize: \"1rem\",\n lineHeight: \"1.2\",\n padding: \"2px 10px\",\n textDecorationLine: \"none\",\n },\n props: {\n ...getCommonProps<BaseButtonProps>(\"button\", [\n \"autoFocus\",\n \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n href: {\n type: \"href\",\n description:\n \"The URL this button navigates to. If present, this button is an <a> element.\",\n },\n target: {\n type: \"choice\",\n options: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n description:\n \"Same as target attribute of <a> element. Only applies when the href prop is present.\",\n hidden: (props) => !props.href,\n defaultValueHint: \"_self\",\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.resetsForm) || Boolean(props.href),\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n resetsForm: {\n type: \"boolean\",\n displayName: \"Resets form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.submitsForm) || Boolean(props.href),\n description:\n \"Whether clicking this button should reset the enclosing form.\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","mergeProps","COMMON_STYLES","Button","usePlasmicLink","useLink","useHover","useFocusRing","makeComponentName","registerComponentHelper","getCommonProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,eAAkB,GAAA;AAAA,EACtB,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA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,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { ButtonProps } from "react-aria-components";
|
|
2
|
+
import type { ButtonProps, LinkProps } from "react-aria-components";
|
|
3
3
|
import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
4
4
|
import { WithVariants } from "./variant-utils";
|
|
5
5
|
declare const BUTTON_VARIANTS: ("disabled" | "hovered" | "pressed" | "focused" | "focusVisible")[];
|
|
6
|
-
|
|
6
|
+
type CommonProps = {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
} & Omit<ButtonProps, "className" | "children"> & Omit<LinkProps, "className" | "children">;
|
|
9
|
+
type LinkSpecificProps = Pick<LinkProps, "href" | "target">;
|
|
10
|
+
type ButtonSpecificProps = {
|
|
8
11
|
resetsForm?: boolean;
|
|
9
12
|
submitsForm?: boolean;
|
|
13
|
+
};
|
|
14
|
+
interface BaseButtonProps extends CommonProps, LinkSpecificProps, ButtonSpecificProps, WithVariants<typeof BUTTON_VARIANTS> {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
10
17
|
}
|
|
11
|
-
export declare const BaseButton: React.ForwardRefExoticComponent<BaseButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export declare const BaseButton: React.ForwardRefExoticComponent<BaseButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
12
19
|
export declare const BUTTON_COMPONENT_NAME: string;
|
|
13
20
|
export declare function registerButton(loader?: Registerable, overrides?: CodeComponentMetaOverrides<typeof BaseButton>): void;
|
|
14
21
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { usePlasmicLink } from '@plasmicapp/host';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { mergeProps } from 'react-aria';
|
|
3
|
+
import { mergeProps, useLink, useHover, useFocusRing } from 'react-aria';
|
|
3
4
|
import { Button } from 'react-aria-components';
|
|
4
5
|
import { C as COMMON_STYLES, g as getCommonProps } from './common-ceebbaea.esm.js';
|
|
5
6
|
import { m as makeComponentName, r as registerComponentHelper } from './utils-5d1b4c6b.esm.js';
|
|
6
7
|
import { p as pickAriaComponentVariants } from './variant-utils-4405ebb0.esm.js';
|
|
7
|
-
import '@plasmicapp/host';
|
|
8
8
|
import '@plasmicapp/host/registerComponent';
|
|
9
9
|
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
@@ -47,24 +47,73 @@ const BUTTON_VARIANTS = [
|
|
|
47
47
|
];
|
|
48
48
|
const { variants, withObservedValues } = pickAriaComponentVariants(BUTTON_VARIANTS);
|
|
49
49
|
const BaseButton = React.forwardRef(function BaseButtonInner(props, ref) {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const { href } = props;
|
|
51
|
+
if (href) {
|
|
52
|
+
return /* @__PURE__ */ React.createElement(
|
|
53
|
+
LinkButton,
|
|
54
|
+
{
|
|
55
|
+
props,
|
|
56
|
+
ref
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
} else {
|
|
60
|
+
const _a = props, { submitsForm, resetsForm, children, plasmicUpdateVariant } = _a, rest = __objRest(_a, ["submitsForm", "resetsForm", "children", "plasmicUpdateVariant"]);
|
|
61
|
+
const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
|
|
62
|
+
const buttonProps = mergeProps(rest, {
|
|
63
|
+
type,
|
|
64
|
+
style: COMMON_STYLES,
|
|
65
|
+
ref
|
|
66
|
+
});
|
|
67
|
+
return /* @__PURE__ */ React.createElement(Button, __spreadValues({}, buttonProps), ({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) => withObservedValues(
|
|
68
|
+
children,
|
|
69
|
+
{
|
|
70
|
+
hovered: isHovered,
|
|
71
|
+
pressed: isPressed,
|
|
72
|
+
focused: isFocused,
|
|
73
|
+
focusVisible: isFocusVisible,
|
|
74
|
+
disabled: isDisabled
|
|
75
|
+
},
|
|
76
|
+
plasmicUpdateVariant
|
|
77
|
+
));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
function LinkButton({
|
|
81
|
+
props,
|
|
82
|
+
ref
|
|
83
|
+
}) {
|
|
84
|
+
const _a = props, { href, children, plasmicUpdateVariant } = _a, rest = __objRest(_a, ["href", "children", "plasmicUpdateVariant"]);
|
|
85
|
+
const PlasmicLink = usePlasmicLink();
|
|
86
|
+
const { linkProps, isPressed } = useLink(props, ref);
|
|
87
|
+
const { hoverProps, isHovered } = useHover(props);
|
|
88
|
+
const { focusProps, isFocused, isFocusVisible } = useFocusRing();
|
|
89
|
+
const combinedLinkProps = mergeProps(linkProps, hoverProps, focusProps, {
|
|
90
|
+
href,
|
|
91
|
+
className: props.className,
|
|
92
|
+
style: COMMON_STYLES,
|
|
54
93
|
ref
|
|
55
94
|
});
|
|
56
|
-
return /* @__PURE__ */ React.createElement(
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
disabled: isDisabled
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
95
|
+
return /* @__PURE__ */ React.createElement(
|
|
96
|
+
PlasmicLink,
|
|
97
|
+
__spreadProps(__spreadValues({}, combinedLinkProps), {
|
|
98
|
+
"data-focused": isFocused || void 0,
|
|
99
|
+
"data-hovered": isHovered || void 0,
|
|
100
|
+
"data-pressed": isPressed || void 0,
|
|
101
|
+
"data-focus-visible": isFocusVisible || void 0,
|
|
102
|
+
"data-disabled": props.isDisabled || void 0
|
|
103
|
+
}),
|
|
104
|
+
withObservedValues(
|
|
105
|
+
children,
|
|
106
|
+
{
|
|
107
|
+
hovered: isHovered,
|
|
108
|
+
pressed: isPressed,
|
|
109
|
+
focused: isFocused,
|
|
110
|
+
focusVisible: isFocusVisible,
|
|
111
|
+
disabled: !!rest.isDisabled
|
|
112
|
+
},
|
|
113
|
+
plasmicUpdateVariant
|
|
114
|
+
)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
68
117
|
const BUTTON_COMPONENT_NAME = makeComponentName("button");
|
|
69
118
|
function registerButton(loader, overrides) {
|
|
70
119
|
registerComponentHelper(
|
|
@@ -77,11 +126,18 @@ function registerButton(loader, overrides) {
|
|
|
77
126
|
importName: "BaseButton",
|
|
78
127
|
variants,
|
|
79
128
|
defaultStyles: {
|
|
80
|
-
|
|
81
|
-
|
|
129
|
+
// Ensure consistent design across rendered elements (button, anchor tag).
|
|
130
|
+
backgroundColor: "#EFEFEF",
|
|
82
131
|
borderColor: "black",
|
|
132
|
+
borderStyle: "solid",
|
|
133
|
+
borderWidth: "1px",
|
|
134
|
+
color: "#000000",
|
|
135
|
+
cursor: "pointer",
|
|
136
|
+
fontFamily: "Arial",
|
|
137
|
+
fontSize: "1rem",
|
|
138
|
+
lineHeight: "1.2",
|
|
83
139
|
padding: "2px 10px",
|
|
84
|
-
|
|
140
|
+
textDecorationLine: "none"
|
|
85
141
|
},
|
|
86
142
|
props: __spreadProps(__spreadValues({}, getCommonProps("button", [
|
|
87
143
|
"autoFocus",
|
|
@@ -96,11 +152,22 @@ function registerButton(loader, overrides) {
|
|
|
96
152
|
value: "Button"
|
|
97
153
|
}
|
|
98
154
|
},
|
|
155
|
+
href: {
|
|
156
|
+
type: "href",
|
|
157
|
+
description: "The URL this button navigates to. If present, this button is an <a> element."
|
|
158
|
+
},
|
|
159
|
+
target: {
|
|
160
|
+
type: "choice",
|
|
161
|
+
options: ["_blank", "_self", "_parent", "_top"],
|
|
162
|
+
description: "Same as target attribute of <a> element. Only applies when the href prop is present.",
|
|
163
|
+
hidden: (props) => !props.href,
|
|
164
|
+
defaultValueHint: "_self"
|
|
165
|
+
},
|
|
99
166
|
submitsForm: {
|
|
100
167
|
type: "boolean",
|
|
101
168
|
displayName: "Submits form?",
|
|
102
169
|
defaultValueHint: false,
|
|
103
|
-
hidden: (props) => Boolean(props.resetsForm),
|
|
170
|
+
hidden: (props) => Boolean(props.resetsForm) || Boolean(props.href),
|
|
104
171
|
description: "Whether clicking this button should submit the enclosing form.",
|
|
105
172
|
advanced: true
|
|
106
173
|
},
|
|
@@ -108,7 +175,7 @@ function registerButton(loader, overrides) {
|
|
|
108
175
|
type: "boolean",
|
|
109
176
|
displayName: "Resets form?",
|
|
110
177
|
defaultValueHint: false,
|
|
111
|
-
hidden: (props) => Boolean(props.submitsForm),
|
|
178
|
+
hidden: (props) => Boolean(props.submitsForm) || Boolean(props.href),
|
|
112
179
|
description: "Whether clicking this button should reset the enclosing form.",
|
|
113
180
|
advanced: true
|
|
114
181
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerButton.esm.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { mergeProps } from \"react-aria\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { COMMON_STYLES, getCommonProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\nconst BUTTON_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(BUTTON_VARIANTS);\n\ninterface BaseButtonProps\n extends ButtonProps,\n WithVariants<typeof BUTTON_VARIANTS> {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: boolean;\n}\n\nexport const BaseButton = React.forwardRef(function BaseButtonInner(\n props: BaseButtonProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const { submitsForm, resetsForm, children, plasmicUpdateVariant, ...rest } =\n props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n const mergedProps = mergeProps(rest, {\n type,\n ref,\n });\n\n return (\n <Button {...mergedProps} style={COMMON_STYLES}>\n {({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n },\n plasmicUpdateVariant\n )\n }\n </Button>\n );\n});\n\nexport const BUTTON_COMPONENT_NAME = makeComponentName(\"button\");\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: BUTTON_COMPONENT_NAME,\n displayName: \"Aria Button\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerButton\",\n importName: \"BaseButton\",\n variants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"2px 10px\",\n cursor: \"pointer\",\n },\n props: {\n ...getCommonProps<BaseButtonProps>(\"button\", [\n \"autoFocus\",\n \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.resetsForm),\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n resetsForm: {\n type: \"boolean\",\n displayName: \"Resets form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.submitsForm),\n description:\n \"Whether clicking this button should reset the enclosing form.\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n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AU,KAAA,OAAA,CAAQ,MAAM,WAAW,CAAA;AAAA,UAC5C,WACE,EAAA,+DAAA;AAAA,UACF,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,QACA,OAAS,EAAA;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,QACA,OAAS,EAAA;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"registerButton.esm.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import { usePlasmicLink } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport { mergeProps, useFocusRing, useHover, useLink } from \"react-aria\";\nimport type { ButtonProps, LinkProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { COMMON_STYLES, getCommonProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\nimport { pickAriaComponentVariants, WithVariants } from \"./variant-utils\";\n\nconst BUTTON_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { variants, withObservedValues } =\n pickAriaComponentVariants(BUTTON_VARIANTS);\n\ntype CommonProps = { children: React.ReactNode } & Omit<\n ButtonProps,\n \"className\" | \"children\"\n> &\n Omit<LinkProps, \"className\" | \"children\">;\ntype LinkSpecificProps = Pick<LinkProps, \"href\" | \"target\">;\ntype ButtonSpecificProps = {\n resetsForm?: boolean;\n submitsForm?: boolean;\n};\n\ninterface BaseButtonProps\n extends CommonProps,\n LinkSpecificProps,\n ButtonSpecificProps,\n WithVariants<typeof BUTTON_VARIANTS> {\n children: React.ReactNode;\n className?: string;\n}\n\nexport const BaseButton = React.forwardRef(function BaseButtonInner(\n props: BaseButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { href } = props;\n\n if (href) {\n return (\n <LinkButton\n props={props}\n ref={ref as React.RefObject<HTMLAnchorElement>}\n />\n );\n } else {\n const { submitsForm, resetsForm, children, plasmicUpdateVariant, ...rest } =\n props;\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n const buttonProps = mergeProps(rest, {\n type,\n style: COMMON_STYLES,\n ref: ref as React.Ref<HTMLButtonElement>,\n });\n\n return (\n <Button {...buttonProps}>\n {({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n },\n plasmicUpdateVariant\n )\n }\n </Button>\n );\n }\n});\n\nfunction LinkButton({\n props,\n ref,\n}: {\n props: BaseButtonProps;\n ref: React.RefObject<HTMLAnchorElement>;\n}) {\n const { href, children, plasmicUpdateVariant, ...rest } = props;\n const PlasmicLink = usePlasmicLink();\n const { linkProps, isPressed } = useLink(props, ref);\n const { hoverProps, isHovered } = useHover(props);\n const { focusProps, isFocused, isFocusVisible } = useFocusRing();\n\n const combinedLinkProps = mergeProps(linkProps, hoverProps, focusProps, {\n href,\n className: props.className,\n style: COMMON_STYLES,\n ref,\n });\n\n return (\n <PlasmicLink\n {...combinedLinkProps}\n data-focused={isFocused || undefined}\n data-hovered={isHovered || undefined}\n data-pressed={isPressed || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n >\n {withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: !!rest.isDisabled,\n },\n plasmicUpdateVariant\n )}\n </PlasmicLink>\n );\n}\n\nexport const BUTTON_COMPONENT_NAME = makeComponentName(\"button\");\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: BUTTON_COMPONENT_NAME,\n displayName: \"Aria Button\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerButton\",\n importName: \"BaseButton\",\n variants,\n defaultStyles: {\n // Ensure consistent design across rendered elements (button, anchor tag).\n backgroundColor: \"#EFEFEF\",\n borderColor: \"black\",\n borderStyle: \"solid\",\n borderWidth: \"1px\",\n color: \"#000000\",\n cursor: \"pointer\",\n fontFamily: \"Arial\",\n fontSize: \"1rem\",\n lineHeight: \"1.2\",\n padding: \"2px 10px\",\n textDecorationLine: \"none\",\n },\n props: {\n ...getCommonProps<BaseButtonProps>(\"button\", [\n \"autoFocus\",\n \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n href: {\n type: \"href\",\n description:\n \"The URL this button navigates to. If present, this button is an <a> element.\",\n },\n target: {\n type: \"choice\",\n options: [\"_blank\", \"_self\", \"_parent\", \"_top\"],\n description:\n \"Same as target attribute of <a> element. Only applies when the href prop is present.\",\n hidden: (props) => !props.href,\n defaultValueHint: \"_self\",\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.resetsForm) || Boolean(props.href),\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n resetsForm: {\n type: \"boolean\",\n displayName: \"Resets form?\",\n defaultValueHint: false,\n hidden: (props) => Boolean(props.submitsForm) || Boolean(props.href),\n description:\n \"Whether clicking this button should reset the enclosing form.\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onFocus: {\n type: \"eventHandler\",\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A;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,QACA,OAAS,EAAA;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -12,11 +12,11 @@ var registerSection = require('./registerListBox-a99736df.cjs.js');
|
|
|
12
12
|
var registerPopover = require('./registerPopover.cjs.js');
|
|
13
13
|
var utils = require('./utils-7d000fa4.cjs.js');
|
|
14
14
|
var variantUtils = require('./variant-utils-0ad70db8.cjs.js');
|
|
15
|
+
require('@plasmicapp/host');
|
|
15
16
|
require('react-aria');
|
|
16
17
|
require('./registerListBoxItem.cjs.js');
|
|
17
18
|
require('./registerDescription.cjs.js');
|
|
18
19
|
require('./registerText.cjs.js');
|
|
19
|
-
require('@plasmicapp/host');
|
|
20
20
|
require('@react-aria/utils');
|
|
21
21
|
require('@plasmicapp/host/registerComponent');
|
|
22
22
|
|
|
@@ -10,11 +10,11 @@ import { L as LIST_BOX_COMPONENT_NAME } from './registerListBox-40846430.esm.js'
|
|
|
10
10
|
import { POPOVER_COMPONENT_NAME } from './registerPopover.esm.js';
|
|
11
11
|
import { r as registerComponentHelper, m as makeComponentName, u as useAutoOpen } from './utils-5d1b4c6b.esm.js';
|
|
12
12
|
import { p as pickAriaComponentVariants } from './variant-utils-4405ebb0.esm.js';
|
|
13
|
+
import '@plasmicapp/host';
|
|
13
14
|
import 'react-aria';
|
|
14
15
|
import './registerListBoxItem.esm.js';
|
|
15
16
|
import './registerDescription.esm.js';
|
|
16
17
|
import './registerText.esm.js';
|
|
17
|
-
import '@plasmicapp/host';
|
|
18
18
|
import '@react-aria/utils';
|
|
19
19
|
import '@plasmicapp/host/registerComponent';
|
|
20
20
|
|
|
@@ -11,11 +11,11 @@ var registerSection = require('./registerListBox-a99736df.cjs.js');
|
|
|
11
11
|
var registerPopover = require('./registerPopover.cjs.js');
|
|
12
12
|
var utils = require('./utils-7d000fa4.cjs.js');
|
|
13
13
|
var variantUtils = require('./variant-utils-0ad70db8.cjs.js');
|
|
14
|
+
require('@plasmicapp/host');
|
|
14
15
|
require('react-aria');
|
|
15
16
|
require('./registerListBoxItem.cjs.js');
|
|
16
17
|
require('./registerDescription.cjs.js');
|
|
17
18
|
require('./registerText.cjs.js');
|
|
18
|
-
require('@plasmicapp/host');
|
|
19
19
|
require('@react-aria/utils');
|
|
20
20
|
require('@plasmicapp/host/registerComponent');
|
|
21
21
|
|
|
@@ -9,11 +9,11 @@ import { L as LIST_BOX_COMPONENT_NAME } from './registerListBox-40846430.esm.js'
|
|
|
9
9
|
import { POPOVER_COMPONENT_NAME } from './registerPopover.esm.js';
|
|
10
10
|
import { e as extractPlasmicDataProps, r as registerComponentHelper, u as useAutoOpen, m as makeComponentName } from './utils-5d1b4c6b.esm.js';
|
|
11
11
|
import { p as pickAriaComponentVariants } from './variant-utils-4405ebb0.esm.js';
|
|
12
|
+
import '@plasmicapp/host';
|
|
12
13
|
import 'react-aria';
|
|
13
14
|
import './registerListBoxItem.esm.js';
|
|
14
15
|
import './registerDescription.esm.js';
|
|
15
16
|
import './registerText.esm.js';
|
|
16
|
-
import '@plasmicapp/host';
|
|
17
17
|
import '@react-aria/utils';
|
|
18
18
|
import '@plasmicapp/host/registerComponent';
|
|
19
19
|
|