@plasmicpkgs/react-aria 0.0.46 → 0.0.48
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/common.d.ts +2 -0
- package/dist/contexts.d.ts +1 -0
- package/dist/react-aria.esm.js +25 -6
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +25 -6
- package/dist/react-aria.js.map +1 -1
- package/dist/registerSelect.d.ts +3 -3
- package/package.json +2 -2
- package/skinny/{common-0e83996a.cjs.js → common-bfedaf7d.cjs.js} +82 -3
- package/skinny/common-bfedaf7d.cjs.js.map +1 -0
- package/skinny/{common-e9d84279.esm.js → common-fa69e9b3.esm.js} +72 -3
- package/skinny/common-fa69e9b3.esm.js.map +1 -0
- package/skinny/common.d.ts +2 -0
- package/skinny/{contexts-3a98471a.cjs.js → contexts-0dec6156.cjs.js} +3 -1
- package/skinny/contexts-0dec6156.cjs.js.map +1 -0
- package/skinny/{contexts-87c261f6.esm.js → contexts-9a8234bf.esm.js} +3 -2
- package/skinny/contexts-9a8234bf.esm.js.map +1 -0
- package/skinny/contexts.d.ts +1 -0
- package/skinny/registerButton.cjs.js +3 -4
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.esm.js +1 -2
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +4 -5
- package/skinny/registerCheckbox.cjs.js.map +1 -1
- package/skinny/registerCheckbox.esm.js +2 -3
- package/skinny/registerCheckbox.esm.js.map +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +6 -7
- package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
- package/skinny/registerCheckboxGroup.esm.js +3 -4
- package/skinny/registerCheckboxGroup.esm.js.map +1 -1
- package/skinny/registerComboBox.cjs.js +7 -8
- package/skinny/registerComboBox.cjs.js.map +1 -1
- package/skinny/registerComboBox.esm.js +3 -4
- package/skinny/registerComboBox.esm.js.map +1 -1
- package/skinny/registerDescription.cjs.js +2 -2
- package/skinny/registerDescription.cjs.js.map +1 -1
- package/skinny/registerDescription.esm.js +1 -1
- package/skinny/registerDialogTrigger.cjs.js +4 -5
- package/skinny/registerDialogTrigger.cjs.js.map +1 -1
- package/skinny/registerDialogTrigger.esm.js +2 -3
- package/skinny/registerDialogTrigger.esm.js.map +1 -1
- package/skinny/registerFieldError.cjs.js +3 -3
- package/skinny/registerFieldError.cjs.js.map +1 -1
- package/skinny/registerFieldError.esm.js +1 -1
- package/skinny/registerForm.cjs.js +3 -3
- package/skinny/registerForm.cjs.js.map +1 -1
- package/skinny/registerForm.esm.js +1 -1
- package/skinny/registerHeader.cjs.js +4 -4
- package/skinny/registerHeader.cjs.js.map +1 -1
- package/skinny/registerHeader.esm.js +2 -2
- package/skinny/registerInput.cjs.js +4 -5
- package/skinny/registerInput.cjs.js.map +1 -1
- package/skinny/registerInput.esm.js +2 -3
- package/skinny/registerInput.esm.js.map +1 -1
- package/skinny/registerLabel.cjs.js +3 -3
- package/skinny/registerLabel.cjs.js.map +1 -1
- package/skinny/registerLabel.esm.js +1 -1
- package/skinny/{registerListBox-cd96c7f7.esm.js → registerListBox-b3f2891a.esm.js} +3 -4
- package/skinny/{registerListBox-cd96c7f7.esm.js.map → registerListBox-b3f2891a.esm.js.map} +1 -1
- package/skinny/{registerListBox-9cef735f.cjs.js → registerListBox-f4801dbd.cjs.js} +5 -6
- package/skinny/{registerListBox-9cef735f.cjs.js.map → registerListBox-f4801dbd.cjs.js.map} +1 -1
- package/skinny/registerListBox.cjs.js +4 -5
- package/skinny/registerListBox.cjs.js.map +1 -1
- package/skinny/registerListBox.esm.js +4 -5
- package/skinny/registerListBox.esm.js.map +1 -1
- package/skinny/registerListBoxItem.cjs.js +4 -4
- package/skinny/registerListBoxItem.cjs.js.map +1 -1
- package/skinny/registerListBoxItem.esm.js +2 -2
- package/skinny/registerModal.cjs.js +4 -5
- package/skinny/registerModal.cjs.js.map +1 -1
- package/skinny/registerModal.esm.js +2 -3
- package/skinny/registerModal.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +6 -3
- package/skinny/registerPopover.cjs.js.map +1 -1
- package/skinny/registerPopover.esm.js +4 -1
- package/skinny/registerPopover.esm.js.map +1 -1
- package/skinny/registerRadio.cjs.js +4 -5
- package/skinny/registerRadio.cjs.js.map +1 -1
- package/skinny/registerRadio.esm.js +2 -3
- package/skinny/registerRadio.esm.js.map +1 -1
- package/skinny/registerRadioGroup.cjs.js +6 -7
- package/skinny/registerRadioGroup.cjs.js.map +1 -1
- package/skinny/registerRadioGroup.esm.js +3 -4
- package/skinny/registerRadioGroup.esm.js.map +1 -1
- package/skinny/registerSection.cjs.js +6 -6
- package/skinny/registerSection.cjs.js.map +1 -1
- package/skinny/registerSection.esm.js +2 -2
- package/skinny/registerSelect.cjs.js +22 -14
- package/skinny/registerSelect.cjs.js.map +1 -1
- package/skinny/registerSelect.d.ts +3 -3
- package/skinny/registerSelect.esm.js +18 -10
- package/skinny/registerSelect.esm.js.map +1 -1
- package/skinny/registerSlider.cjs.js +7 -8
- package/skinny/registerSlider.cjs.js.map +1 -1
- package/skinny/registerSlider.esm.js +3 -4
- package/skinny/registerSlider.esm.js.map +1 -1
- package/skinny/registerSliderOutput.cjs.js +3 -3
- package/skinny/registerSliderOutput.cjs.js.map +1 -1
- package/skinny/registerSliderOutput.esm.js +1 -1
- package/skinny/registerSliderThumb.cjs.js +4 -5
- package/skinny/registerSliderThumb.cjs.js.map +1 -1
- package/skinny/registerSliderThumb.esm.js +2 -3
- package/skinny/registerSliderThumb.esm.js.map +1 -1
- package/skinny/registerSliderTrack.cjs.js +6 -6
- package/skinny/registerSliderTrack.cjs.js.map +1 -1
- package/skinny/registerSliderTrack.esm.js +2 -2
- package/skinny/registerSwitch.cjs.js +4 -5
- package/skinny/registerSwitch.cjs.js.map +1 -1
- package/skinny/registerSwitch.esm.js +2 -3
- package/skinny/registerSwitch.esm.js.map +1 -1
- package/skinny/registerText.cjs.js +3 -3
- package/skinny/registerText.cjs.js.map +1 -1
- package/skinny/registerText.esm.js +1 -1
- package/skinny/registerTextArea.cjs.js +4 -5
- package/skinny/registerTextArea.cjs.js.map +1 -1
- package/skinny/registerTextArea.esm.js +2 -3
- package/skinny/registerTextArea.esm.js.map +1 -1
- package/skinny/registerTextField.cjs.js +6 -7
- package/skinny/registerTextField.cjs.js.map +1 -1
- package/skinny/registerTextField.esm.js +3 -4
- package/skinny/registerTextField.esm.js.map +1 -1
- package/skinny/registerTooltip.cjs.js +2 -2
- package/skinny/registerTooltip.cjs.js.map +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/common-0e83996a.cjs.js.map +0 -1
- package/skinny/common-e9d84279.esm.js.map +0 -1
- package/skinny/contexts-3a98471a.cjs.js.map +0 -1
- package/skinny/contexts-87c261f6.esm.js.map +0 -1
- package/skinny/utils-a1785802.esm.js +0 -66
- package/skinny/utils-a1785802.esm.js.map +0 -1
- package/skinny/utils-d3708034.cjs.js +0 -77
- package/skinny/utils-d3708034.cjs.js.map +0 -1
package/dist/registerSelect.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Key, SelectValue } from "react-aria-components";
|
|
2
|
+
import { Key, SelectProps, SelectValue } from "react-aria-components";
|
|
3
3
|
import { HasOptions } from "./option-utils";
|
|
4
|
-
import { Registerable
|
|
4
|
+
import { Registerable } from "./utils";
|
|
5
5
|
export interface BaseSelectValueProps extends React.ComponentProps<typeof SelectValue> {
|
|
6
6
|
customize?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const BaseSelectValue: (props: BaseSelectValueProps) => React.JSX.Element;
|
|
9
|
-
export interface BaseSelectProps<T extends object> extends HasOptions<T>,
|
|
9
|
+
export interface BaseSelectProps<T extends object> extends HasOptions<T>, SelectProps<T> {
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
isDisabled?: boolean;
|
|
12
12
|
value?: Key;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
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": "041626814fb144585dfd7a2bd710c4996fe21b71"
|
|
78
78
|
}
|
|
@@ -1,9 +1,82 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
4
4
|
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var registerComponent__default = /*#__PURE__*/_interopDefault(registerComponent);
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __defProps = Object.defineProperties;
|
|
11
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
12
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
15
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
16
|
+
var __spreadValues = (a, b) => {
|
|
17
|
+
for (var prop in b || (b = {}))
|
|
18
|
+
if (__hasOwnProp.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop))
|
|
23
|
+
__defNormalProp(a, prop, b[prop]);
|
|
24
|
+
}
|
|
25
|
+
return a;
|
|
26
|
+
};
|
|
27
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
28
|
+
function registerComponentHelper(loader, component, meta, overrides) {
|
|
29
|
+
var _a;
|
|
30
|
+
meta = __spreadProps(__spreadValues({}, meta), {
|
|
31
|
+
defaultStyles: __spreadValues(__spreadValues({}, defaultStyles), (_a = meta.defaultStyles) != null ? _a : {})
|
|
32
|
+
});
|
|
33
|
+
if (overrides) {
|
|
34
|
+
meta = __spreadProps(__spreadValues(__spreadValues({}, meta), overrides), {
|
|
35
|
+
props: __spreadValues(__spreadValues({}, meta.props), overrides.props)
|
|
36
|
+
});
|
|
37
|
+
if (overrides.parentComponentName) {
|
|
38
|
+
meta.name = makeChildComponentName(
|
|
39
|
+
overrides.parentComponentName,
|
|
40
|
+
meta.name
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (loader) {
|
|
45
|
+
loader.registerComponent(component, meta);
|
|
46
|
+
} else {
|
|
47
|
+
registerComponent__default.default(component, meta);
|
|
48
|
+
}
|
|
49
|
+
return meta;
|
|
50
|
+
}
|
|
51
|
+
function makeComponentName(name) {
|
|
52
|
+
return `plasmic-react-aria-${name}`;
|
|
53
|
+
}
|
|
54
|
+
function makeChildComponentName(fullParentName, fullChildName) {
|
|
55
|
+
if (!fullParentName) {
|
|
56
|
+
return fullChildName;
|
|
57
|
+
}
|
|
58
|
+
return `${fullParentName}-${fullChildName.replace(
|
|
59
|
+
"plasmic-react-aria-",
|
|
60
|
+
""
|
|
61
|
+
)}`;
|
|
62
|
+
}
|
|
63
|
+
function extractPlasmicDataProps(props) {
|
|
64
|
+
return Object.fromEntries(
|
|
65
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function withoutNils(array) {
|
|
69
|
+
return array.filter((x) => x != null);
|
|
70
|
+
}
|
|
71
|
+
function isDefined(thing) {
|
|
72
|
+
return thing !== void 0 && thing !== null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const defaultStyles = {
|
|
76
|
+
boxSizing: "border-box"
|
|
77
|
+
};
|
|
5
78
|
function hasParent(_props, ctx) {
|
|
6
|
-
return
|
|
79
|
+
return isDefined(ctx == null ? void 0 : ctx.parent) === true;
|
|
7
80
|
}
|
|
8
81
|
function isParentReadOnly(_props, ctx) {
|
|
9
82
|
var _a;
|
|
@@ -339,7 +412,13 @@ function getCommonProps(componentName, propNames) {
|
|
|
339
412
|
return filteredProps;
|
|
340
413
|
}
|
|
341
414
|
|
|
415
|
+
exports.extractPlasmicDataProps = extractPlasmicDataProps;
|
|
342
416
|
exports.getCommonProps = getCommonProps;
|
|
343
417
|
exports.hasParent = hasParent;
|
|
418
|
+
exports.isDefined = isDefined;
|
|
419
|
+
exports.makeChildComponentName = makeChildComponentName;
|
|
420
|
+
exports.makeComponentName = makeComponentName;
|
|
421
|
+
exports.registerComponentHelper = registerComponentHelper;
|
|
344
422
|
exports.resolveAutoComplete = resolveAutoComplete;
|
|
345
|
-
|
|
423
|
+
exports.withoutNils = withoutNils;
|
|
424
|
+
//# sourceMappingURL=common-bfedaf7d.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-bfedaf7d.cjs.js","sources":["../src/utils.ts","../src/common.ts"],"sourcesContent":["import type { CodeComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport { defaultStyles } from \"./common\";\n\nexport type HasControlContextData<T = BaseControlContextData> = {\n setControlContextData?: (ctxData: T) => void;\n};\n\nexport type BaseControlContextData = {\n parent?: {\n isDisabled?: boolean;\n isReadOnly?: boolean;\n };\n};\n\nexport type Registerable = {\n registerComponent: typeof registerComponent;\n};\n\nexport type OtherCodeComponentsMeta = {\n text: CodeComponentMeta<any>;\n description: CodeComponentMeta<any>;\n};\n\nexport type CodeComponentMetaOverrides<T extends React.ComponentType<any>> =\n Partial<\n Pick<\n CodeComponentMeta<React.ComponentProps<T>>,\n \"parentComponentName\" | \"props\" | \"displayName\" | \"name\"\n >\n >;\n\nexport function registerComponentHelper<T extends React.ComponentType<any>>(\n loader: Registerable | undefined,\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>,\n overrides?: CodeComponentMetaOverrides<T>\n) {\n meta = {\n ...meta,\n defaultStyles: {\n ...defaultStyles,\n ...(meta.defaultStyles ?? {}),\n },\n };\n if (overrides) {\n meta = {\n ...meta,\n ...overrides,\n props: {\n ...meta.props,\n ...overrides.props,\n },\n };\n if (overrides.parentComponentName) {\n meta.name = makeChildComponentName(\n overrides.parentComponentName,\n meta.name\n );\n }\n }\n if (loader) {\n loader.registerComponent(component, meta);\n } else {\n registerComponent(component, meta);\n }\n return meta;\n}\n\nexport function makeComponentName(name: string) {\n return `plasmic-react-aria-${name}`;\n}\n\nexport function makeChildComponentName(\n fullParentName: string | undefined,\n fullChildName: string\n) {\n if (!fullParentName) {\n return fullChildName;\n }\n return `${fullParentName}-${fullChildName.replace(\n \"plasmic-react-aria-\",\n \"\"\n )}`;\n}\n\nexport interface Styleable {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function extractPlasmicDataProps(props: Record<string, any>) {\n return Object.fromEntries(\n Object.entries(props).filter(([key]) => key.startsWith(\"data-plasmic-\"))\n );\n}\n\nexport function withoutNils<T>(array: (T | undefined | null)[]) {\n return array.filter((x): x is T => x != null);\n}\n\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return thing !== undefined && thing !== null;\n}\n","import { PropType } from \"@plasmicapp/host\";\nimport {\n BaseControlContextData,\n HasControlContextData,\n isDefined,\n} from \"./utils\";\n\nexport const defaultStyles: React.CSSProperties = {\n boxSizing: \"border-box\",\n};\n\nexport function hasParent<T>(_props: T, ctx: ConditionalContext<T>): boolean {\n return isDefined(ctx?.parent) === true;\n}\n\nexport function isParentReadOnly<T>(_props: T, ctx: ConditionalContext<T>) {\n return ctx?.parent?.isReadOnly === true;\n}\n\nexport function isParentDisabled<T>(_props: T, ctx: ConditionalContext<T>) {\n return ctx?.parent?.isDisabled === true;\n}\n\nexport function resolveAutoComplete(autoCompleteProp?: string | string[]) {\n if (typeof autoCompleteProp === \"string\") {\n return autoCompleteProp;\n }\n if (\n !autoCompleteProp ||\n !Array.isArray(autoCompleteProp) ||\n autoCompleteProp.includes(\"off\")\n ) {\n return undefined;\n }\n if (autoCompleteProp.includes(\"off\")) {\n return \"off\";\n }\n if (autoCompleteProp.includes(\"on\") && autoCompleteProp.length === 1) {\n return \"on\";\n }\n return autoCompleteProp.filter((x) => x !== \"on\").join(\" \");\n}\n\ntype ConditionalContext<T> = T extends HasControlContextData\n ? BaseControlContextData | null\n : null;\n\nfunction createNameProp<T>(): PropType<T> {\n return {\n type: \"string\",\n description: \"Name for this field if it is part of a form\",\n hidden: hasParent,\n advanced: true,\n };\n}\n\nfunction createDisabledProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Disabled\",\n type: \"boolean\",\n description: `Whether the ${componentName} is read-only and unfocusable`,\n defaultValueHint: false,\n hidden: isParentDisabled,\n };\n}\n\nfunction createReadOnlyProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Read only\",\n type: \"boolean\",\n description: `Whether the value of this ${componentName} can be changed by the user. Unlike disabled, read-only does not prevent the user from interacting with the component (such as focus).`,\n defaultValueHint: false,\n advanced: true,\n hidden: isParentReadOnly,\n };\n}\n\nfunction createRequiredProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Required\",\n type: \"boolean\",\n description: `Whether user input is required on the ${componentName} before form submission.`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAutoFocusProp<T>(componentName: string): PropType<T> {\n return {\n type: \"boolean\",\n description: `Whether the ${componentName} should be focused when rendered`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAriaLabelProp<T>(componentName: string): PropType<T> {\n return {\n type: \"string\",\n displayName: \"ARIA label\",\n description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createChildrenProp<T>(): PropType<T> {\n return {\n type: \"slot\",\n mergeWithParent: true as any,\n };\n}\n\nexport function getCommonProps<T>(\n componentName: string,\n propNames: (keyof T)[]\n) {\n const commonProps: Record<string, PropType<T>> = {\n name: createNameProp<T>(),\n disabled: createDisabledProp(componentName),\n isDisabled: createDisabledProp(componentName),\n readOnly: createReadOnlyProp(componentName),\n isReadOnly: createReadOnlyProp(componentName),\n autoFocus: createAutoFocusProp(componentName),\n \"aria-label\": createAriaLabelProp(componentName),\n required: createRequiredProp(componentName),\n isRequired: createRequiredProp(componentName),\n children: createChildrenProp(),\n // NOTE: The following props are only applicable to inputs, textareas, and text fields\n value: {\n type: \"string\",\n editOnly: true,\n displayName: \"Initial value\",\n uncontrolledProp: \"defaultValue\",\n description: `The default value of the ${componentName}`,\n hidden: hasParent,\n },\n maxLength: {\n type: \"number\",\n description: \"The maximum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n minLength: {\n type: \"number\",\n description: \"The minimum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n pattern: {\n type: \"string\",\n description:\n \"Regex pattern that the value of the input must match to be valid\",\n helpText:\n \"For more information about writing Regular Expressions (regex), check out https://regexr.com/\",\n validator: (value: string) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n advanced: true,\n hidden: hasParent,\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\n description:\n \"The type of data that an input field is expected to handle. It influences the input's behavior, validation, and the kind of interface provided to the user.\",\n advanced: true,\n hidden: hasParent,\n },\n inputMode: {\n type: \"choice\",\n description:\n \"hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.\",\n options: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n hidden: hasParent,\n },\n autoComplete: {\n type: \"choice\",\n advanced: true,\n multiSelect: true,\n hidden: hasParent,\n description: \"Guidance as to the type of data expected in the field\",\n helpText:\n \"For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\",\n options: [\n \"on\",\n \"off\",\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"email\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"shipping\",\n \"billing\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-suffix\",\n \"tel-local-prefix\",\n \"tel-extension\",\n \"impp\",\n \"url\",\n \"photo\",\n \"webauthn\",\n ],\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n advanced: true,\n hidden: hasParent,\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n hidden: hasParent,\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBlur: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyDown: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyUp: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCopy: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCut: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onPaste: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionUpdate: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onSelect: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBeforeInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n placeholder: {\n type: \"string\",\n },\n };\n\n // Filter the properties based on the provided fields array\n const filteredProps: Partial<Record<keyof T, PropType<T>>> = {};\n propNames.forEach((propName) => {\n if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {\n filteredProps[propName] = commonProps[propName as string];\n }\n });\n\n return filteredProps;\n}\n"],"names":["registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,uBACd,CAAA,MAAA,EACA,SACA,EAAA,IAAA,EACA,SACA,EAAA;AAtCF,EAAA,IAAA,EAAA,CAAA;AAuCE,EAAA,IAAA,GAAO,iCACF,IADE,CAAA,EAAA;AAAA,IAEL,eAAe,cACV,CAAA,cAAA,CAAA,EAAA,EAAA,aAAA,CAAA,EAAA,CACC,EAAK,GAAA,IAAA,CAAA,aAAA,KAAL,YAAsB,EAAC,CAAA;AAAA,GAE/B,CAAA,CAAA;AACA,EAAA,IAAI,SAAW,EAAA;AACb,IAAO,IAAA,GAAA,aAAA,CAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACF,OACA,SAFE,CAAA,EAAA;AAAA,MAGL,KAAO,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACF,IAAK,CAAA,KAAA,CAAA,EACL,SAAU,CAAA,KAAA,CAAA;AAAA,KAEjB,CAAA,CAAA;AACA,IAAA,IAAI,UAAU,mBAAqB,EAAA;AACjC,MAAA,IAAA,CAAK,IAAO,GAAA,sBAAA;AAAA,QACV,SAAU,CAAA,mBAAA;AAAA,QACV,IAAK,CAAA,IAAA;AAAA,OACP,CAAA;AAAA,KACF;AAAA,GACF;AACA,EAAA,IAAI,MAAQ,EAAA;AACV,IAAO,MAAA,CAAA,iBAAA,CAAkB,WAAW,IAAI,CAAA,CAAA;AAAA,GACnC,MAAA;AACL,IAAAA,kCAAA,CAAkB,WAAW,IAAI,CAAA,CAAA;AAAA,GACnC;AACA,EAAO,OAAA,IAAA,CAAA;AAC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AAE,MAAM,gBAAkB,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACrD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,WAAa,EAAA;AAAA,MACX,IAAM,EAAA,QAAA;AAAA,KACR;AAAA,GACF,CAAA;AAGA,EAAA,MAAM,gBAAuD,EAAC,CAAA;AAC9D,EAAU,SAAA,CAAA,OAAA,CAAQ,CAAC,QAAa,KAAA;AAC9B,IAAA,IAAI,OAAO,SAAU,CAAA,cAAA,CAAe,IAAK,CAAA,WAAA,EAAa,QAAQ,CAAG,EAAA;AAC/D,MAAc,aAAA,CAAA,QAAQ,CAAI,GAAA,WAAA,CAAY,QAAkB,CAAA,CAAA;AAAA,KAC1D;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,aAAA,CAAA;AACT;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,74 @@
|
|
|
1
|
-
import
|
|
1
|
+
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
2
|
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
function registerComponentHelper(loader, component, meta, overrides) {
|
|
23
|
+
var _a;
|
|
24
|
+
meta = __spreadProps(__spreadValues({}, meta), {
|
|
25
|
+
defaultStyles: __spreadValues(__spreadValues({}, defaultStyles), (_a = meta.defaultStyles) != null ? _a : {})
|
|
26
|
+
});
|
|
27
|
+
if (overrides) {
|
|
28
|
+
meta = __spreadProps(__spreadValues(__spreadValues({}, meta), overrides), {
|
|
29
|
+
props: __spreadValues(__spreadValues({}, meta.props), overrides.props)
|
|
30
|
+
});
|
|
31
|
+
if (overrides.parentComponentName) {
|
|
32
|
+
meta.name = makeChildComponentName(
|
|
33
|
+
overrides.parentComponentName,
|
|
34
|
+
meta.name
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (loader) {
|
|
39
|
+
loader.registerComponent(component, meta);
|
|
40
|
+
} else {
|
|
41
|
+
registerComponent(component, meta);
|
|
42
|
+
}
|
|
43
|
+
return meta;
|
|
44
|
+
}
|
|
45
|
+
function makeComponentName(name) {
|
|
46
|
+
return `plasmic-react-aria-${name}`;
|
|
47
|
+
}
|
|
48
|
+
function makeChildComponentName(fullParentName, fullChildName) {
|
|
49
|
+
if (!fullParentName) {
|
|
50
|
+
return fullChildName;
|
|
51
|
+
}
|
|
52
|
+
return `${fullParentName}-${fullChildName.replace(
|
|
53
|
+
"plasmic-react-aria-",
|
|
54
|
+
""
|
|
55
|
+
)}`;
|
|
56
|
+
}
|
|
57
|
+
function extractPlasmicDataProps(props) {
|
|
58
|
+
return Object.fromEntries(
|
|
59
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-plasmic-"))
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function withoutNils(array) {
|
|
63
|
+
return array.filter((x) => x != null);
|
|
64
|
+
}
|
|
65
|
+
function isDefined(thing) {
|
|
66
|
+
return thing !== void 0 && thing !== null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const defaultStyles = {
|
|
70
|
+
boxSizing: "border-box"
|
|
71
|
+
};
|
|
3
72
|
function hasParent(_props, ctx) {
|
|
4
73
|
return isDefined(ctx == null ? void 0 : ctx.parent) === true;
|
|
5
74
|
}
|
|
@@ -337,5 +406,5 @@ function getCommonProps(componentName, propNames) {
|
|
|
337
406
|
return filteredProps;
|
|
338
407
|
}
|
|
339
408
|
|
|
340
|
-
export { getCommonProps as g, hasParent as h,
|
|
341
|
-
//# sourceMappingURL=common-
|
|
409
|
+
export { makeComponentName as a, resolveAutoComplete as b, extractPlasmicDataProps as e, getCommonProps as g, hasParent as h, isDefined as i, makeChildComponentName as m, registerComponentHelper as r, withoutNils as w };
|
|
410
|
+
//# sourceMappingURL=common-fa69e9b3.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-fa69e9b3.esm.js","sources":["../src/utils.ts","../src/common.ts"],"sourcesContent":["import type { CodeComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport { defaultStyles } from \"./common\";\n\nexport type HasControlContextData<T = BaseControlContextData> = {\n setControlContextData?: (ctxData: T) => void;\n};\n\nexport type BaseControlContextData = {\n parent?: {\n isDisabled?: boolean;\n isReadOnly?: boolean;\n };\n};\n\nexport type Registerable = {\n registerComponent: typeof registerComponent;\n};\n\nexport type OtherCodeComponentsMeta = {\n text: CodeComponentMeta<any>;\n description: CodeComponentMeta<any>;\n};\n\nexport type CodeComponentMetaOverrides<T extends React.ComponentType<any>> =\n Partial<\n Pick<\n CodeComponentMeta<React.ComponentProps<T>>,\n \"parentComponentName\" | \"props\" | \"displayName\" | \"name\"\n >\n >;\n\nexport function registerComponentHelper<T extends React.ComponentType<any>>(\n loader: Registerable | undefined,\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>,\n overrides?: CodeComponentMetaOverrides<T>\n) {\n meta = {\n ...meta,\n defaultStyles: {\n ...defaultStyles,\n ...(meta.defaultStyles ?? {}),\n },\n };\n if (overrides) {\n meta = {\n ...meta,\n ...overrides,\n props: {\n ...meta.props,\n ...overrides.props,\n },\n };\n if (overrides.parentComponentName) {\n meta.name = makeChildComponentName(\n overrides.parentComponentName,\n meta.name\n );\n }\n }\n if (loader) {\n loader.registerComponent(component, meta);\n } else {\n registerComponent(component, meta);\n }\n return meta;\n}\n\nexport function makeComponentName(name: string) {\n return `plasmic-react-aria-${name}`;\n}\n\nexport function makeChildComponentName(\n fullParentName: string | undefined,\n fullChildName: string\n) {\n if (!fullParentName) {\n return fullChildName;\n }\n return `${fullParentName}-${fullChildName.replace(\n \"plasmic-react-aria-\",\n \"\"\n )}`;\n}\n\nexport interface Styleable {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function extractPlasmicDataProps(props: Record<string, any>) {\n return Object.fromEntries(\n Object.entries(props).filter(([key]) => key.startsWith(\"data-plasmic-\"))\n );\n}\n\nexport function withoutNils<T>(array: (T | undefined | null)[]) {\n return array.filter((x): x is T => x != null);\n}\n\nexport function isDefined<T>(thing: T | undefined | null): thing is T {\n return thing !== undefined && thing !== null;\n}\n","import { PropType } from \"@plasmicapp/host\";\nimport {\n BaseControlContextData,\n HasControlContextData,\n isDefined,\n} from \"./utils\";\n\nexport const defaultStyles: React.CSSProperties = {\n boxSizing: \"border-box\",\n};\n\nexport function hasParent<T>(_props: T, ctx: ConditionalContext<T>): boolean {\n return isDefined(ctx?.parent) === true;\n}\n\nexport function isParentReadOnly<T>(_props: T, ctx: ConditionalContext<T>) {\n return ctx?.parent?.isReadOnly === true;\n}\n\nexport function isParentDisabled<T>(_props: T, ctx: ConditionalContext<T>) {\n return ctx?.parent?.isDisabled === true;\n}\n\nexport function resolveAutoComplete(autoCompleteProp?: string | string[]) {\n if (typeof autoCompleteProp === \"string\") {\n return autoCompleteProp;\n }\n if (\n !autoCompleteProp ||\n !Array.isArray(autoCompleteProp) ||\n autoCompleteProp.includes(\"off\")\n ) {\n return undefined;\n }\n if (autoCompleteProp.includes(\"off\")) {\n return \"off\";\n }\n if (autoCompleteProp.includes(\"on\") && autoCompleteProp.length === 1) {\n return \"on\";\n }\n return autoCompleteProp.filter((x) => x !== \"on\").join(\" \");\n}\n\ntype ConditionalContext<T> = T extends HasControlContextData\n ? BaseControlContextData | null\n : null;\n\nfunction createNameProp<T>(): PropType<T> {\n return {\n type: \"string\",\n description: \"Name for this field if it is part of a form\",\n hidden: hasParent,\n advanced: true,\n };\n}\n\nfunction createDisabledProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Disabled\",\n type: \"boolean\",\n description: `Whether the ${componentName} is read-only and unfocusable`,\n defaultValueHint: false,\n hidden: isParentDisabled,\n };\n}\n\nfunction createReadOnlyProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Read only\",\n type: \"boolean\",\n description: `Whether the value of this ${componentName} can be changed by the user. Unlike disabled, read-only does not prevent the user from interacting with the component (such as focus).`,\n defaultValueHint: false,\n advanced: true,\n hidden: isParentReadOnly,\n };\n}\n\nfunction createRequiredProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Required\",\n type: \"boolean\",\n description: `Whether user input is required on the ${componentName} before form submission.`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAutoFocusProp<T>(componentName: string): PropType<T> {\n return {\n type: \"boolean\",\n description: `Whether the ${componentName} should be focused when rendered`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAriaLabelProp<T>(componentName: string): PropType<T> {\n return {\n type: \"string\",\n displayName: \"ARIA label\",\n description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createChildrenProp<T>(): PropType<T> {\n return {\n type: \"slot\",\n mergeWithParent: true as any,\n };\n}\n\nexport function getCommonProps<T>(\n componentName: string,\n propNames: (keyof T)[]\n) {\n const commonProps: Record<string, PropType<T>> = {\n name: createNameProp<T>(),\n disabled: createDisabledProp(componentName),\n isDisabled: createDisabledProp(componentName),\n readOnly: createReadOnlyProp(componentName),\n isReadOnly: createReadOnlyProp(componentName),\n autoFocus: createAutoFocusProp(componentName),\n \"aria-label\": createAriaLabelProp(componentName),\n required: createRequiredProp(componentName),\n isRequired: createRequiredProp(componentName),\n children: createChildrenProp(),\n // NOTE: The following props are only applicable to inputs, textareas, and text fields\n value: {\n type: \"string\",\n editOnly: true,\n displayName: \"Initial value\",\n uncontrolledProp: \"defaultValue\",\n description: `The default value of the ${componentName}`,\n hidden: hasParent,\n },\n maxLength: {\n type: \"number\",\n description: \"The maximum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n minLength: {\n type: \"number\",\n description: \"The minimum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n pattern: {\n type: \"string\",\n description:\n \"Regex pattern that the value of the input must match to be valid\",\n helpText:\n \"For more information about writing Regular Expressions (regex), check out https://regexr.com/\",\n validator: (value: string) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n advanced: true,\n hidden: hasParent,\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\n description:\n \"The type of data that an input field is expected to handle. It influences the input's behavior, validation, and the kind of interface provided to the user.\",\n advanced: true,\n hidden: hasParent,\n },\n inputMode: {\n type: \"choice\",\n description:\n \"hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.\",\n options: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n hidden: hasParent,\n },\n autoComplete: {\n type: \"choice\",\n advanced: true,\n multiSelect: true,\n hidden: hasParent,\n description: \"Guidance as to the type of data expected in the field\",\n helpText:\n \"For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\",\n options: [\n \"on\",\n \"off\",\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"email\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"shipping\",\n \"billing\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-suffix\",\n \"tel-local-prefix\",\n \"tel-extension\",\n \"impp\",\n \"url\",\n \"photo\",\n \"webauthn\",\n ],\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n advanced: true,\n hidden: hasParent,\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n hidden: hasParent,\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBlur: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyDown: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyUp: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCopy: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCut: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onPaste: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionUpdate: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onSelect: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBeforeInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n placeholder: {\n type: \"string\",\n },\n };\n\n // Filter the properties based on the provided fields array\n const filteredProps: Partial<Record<keyof T, PropType<T>>> = {};\n propNames.forEach((propName) => {\n if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {\n filteredProps[propName] = commonProps[propName as string];\n }\n });\n\n return filteredProps;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,uBACd,CAAA,MAAA,EACA,SACA,EAAA,IAAA,EACA,SACA,EAAA;AAtCF,EAAA,IAAA,EAAA,CAAA;AAuCE,EAAA,IAAA,GAAO,iCACF,IADE,CAAA,EAAA;AAAA,IAEL,eAAe,cACV,CAAA,cAAA,CAAA,EAAA,EAAA,aAAA,CAAA,EAAA,CACC,EAAK,GAAA,IAAA,CAAA,aAAA,KAAL,YAAsB,EAAC,CAAA;AAAA,GAE/B,CAAA,CAAA;AACA,EAAA,IAAI,SAAW,EAAA;AACb,IAAO,IAAA,GAAA,aAAA,CAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACF,OACA,SAFE,CAAA,EAAA;AAAA,MAGL,KAAO,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACF,IAAK,CAAA,KAAA,CAAA,EACL,SAAU,CAAA,KAAA,CAAA;AAAA,KAEjB,CAAA,CAAA;AACA,IAAA,IAAI,UAAU,mBAAqB,EAAA;AACjC,MAAA,IAAA,CAAK,IAAO,GAAA,sBAAA;AAAA,QACV,SAAU,CAAA,mBAAA;AAAA,QACV,IAAK,CAAA,IAAA;AAAA,OACP,CAAA;AAAA,KACF;AAAA,GACF;AACA,EAAA,IAAI,MAAQ,EAAA;AACV,IAAO,MAAA,CAAA,iB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AAAA,MACvD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,gBAAkB,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACrD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,WAAa,EAAA;AAAA,MACX,IAAM,EAAA,QAAA;AAAA,KACR;AAAA,GACF,CAAA;AAGA,EAAA,MAAM,gBAAuD,EAAC,CAAA;AAC9D,EAAU,SAAA,CAAA,OAAA,CAAQ,CAAC,QAAa,KAAA;AAC9B,IAAA,IAAI,OAAO,SAAU,CAAA,cAAA,CAAe,IAAK,CAAA,WAAA,EAAa,QAAQ,CAAG,EAAA;AAC/D,MAAc,aAAA,CAAA,QAAQ,CAAI,GAAA,WAAA,CAAY,QAAkB,CAAA,CAAA;AAAA,KAC1D;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,aAAA,CAAA;AACT;;;;"}
|
package/skinny/common.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { PropType } from "@plasmicapp/host";
|
|
2
3
|
import { BaseControlContextData, HasControlContextData } from "./utils";
|
|
4
|
+
export declare const defaultStyles: React.CSSProperties;
|
|
3
5
|
export declare function hasParent<T>(_props: T, ctx: ConditionalContext<T>): boolean;
|
|
4
6
|
export declare function isParentReadOnly<T>(_props: T, ctx: ConditionalContext<T>): boolean;
|
|
5
7
|
export declare function isParentDisabled<T>(_props: T, ctx: ConditionalContext<T>): boolean;
|
|
@@ -12,6 +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 PlasmicPopoverContext = React__default.default.createContext(void 0);
|
|
15
16
|
const PlasmicListBoxContext = React__default.default.createContext(void 0);
|
|
16
17
|
const PlasmicItemContext = React__default.default.createContext(void 0);
|
|
17
18
|
const PlasmicSectionContext = React__default.default.createContext(void 0);
|
|
@@ -24,8 +25,9 @@ exports.PlasmicHeaderContext = PlasmicHeaderContext;
|
|
|
24
25
|
exports.PlasmicInputContext = PlasmicInputContext;
|
|
25
26
|
exports.PlasmicItemContext = PlasmicItemContext;
|
|
26
27
|
exports.PlasmicListBoxContext = PlasmicListBoxContext;
|
|
28
|
+
exports.PlasmicPopoverContext = PlasmicPopoverContext;
|
|
27
29
|
exports.PlasmicRadioGroupContext = PlasmicRadioGroupContext;
|
|
28
30
|
exports.PlasmicSectionContext = PlasmicSectionContext;
|
|
29
31
|
exports.PlasmicSliderContext = PlasmicSliderContext;
|
|
30
32
|
exports.PlasmicTextFieldContext = PlasmicTextFieldContext;
|
|
31
|
-
//# sourceMappingURL=contexts-
|
|
33
|
+
//# sourceMappingURL=contexts-0dec6156.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts-0dec6156.cjs.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { StrictItemType } from \"./option-utils\";\nimport { BaseCheckboxGroup } from \"./registerCheckboxGroup\";\nimport { BaseDialogTrigger } from \"./registerDialogTrigger\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport { BasePopover } from \"./registerPopover\";\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 PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n StrictItemType | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicHeaderContext = React.createContext<\n React.ComponentProps<typeof BaseHeader> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":["React"],"mappings":";;;;;;;;AAsBa,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,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,kBAAA,GAAqBA,sBAAM,CAAA,aAAA,CAEtC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,oBAAA,GAAuBA,sBAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEE,MAAA,mBAAA,GAAsBA,sBAAM,CAAA,aAAA,CAEvC,KAAS,CAAA;;;;;;;;;;;;;;"}
|
|
@@ -6,11 +6,12 @@ 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 PlasmicPopoverContext = React.createContext(void 0);
|
|
9
10
|
const PlasmicListBoxContext = React.createContext(void 0);
|
|
10
11
|
const PlasmicItemContext = React.createContext(void 0);
|
|
11
12
|
const PlasmicSectionContext = React.createContext(void 0);
|
|
12
13
|
const PlasmicHeaderContext = React.createContext(void 0);
|
|
13
14
|
const PlasmicInputContext = React.createContext(void 0);
|
|
14
15
|
|
|
15
|
-
export { PlasmicCheckboxGroupContext as P, PlasmicListBoxContext as a, PlasmicInputContext as b, PlasmicDialogTriggerContext as c, PlasmicRadioGroupContext as d,
|
|
16
|
-
//# sourceMappingURL=contexts-
|
|
16
|
+
export { PlasmicCheckboxGroupContext as P, PlasmicListBoxContext as a, PlasmicInputContext as b, PlasmicDialogTriggerContext as c, PlasmicRadioGroupContext as d, PlasmicPopoverContext as e, PlasmicSectionContext as f, PlasmicItemContext as g, PlasmicHeaderContext as h, PlasmicSliderContext as i, PlasmicTextFieldContext as j };
|
|
17
|
+
//# sourceMappingURL=contexts-9a8234bf.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts-9a8234bf.esm.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { StrictItemType } from \"./option-utils\";\nimport { BaseCheckboxGroup } from \"./registerCheckboxGroup\";\nimport { BaseDialogTrigger } from \"./registerDialogTrigger\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport { BasePopover } from \"./registerPopover\";\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 PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n StrictItemType | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicHeaderContext = React.createContext<\n React.ComponentProps<typeof BaseHeader> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":[],"mappings":";;AAsBa,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,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,kBAAA,GAAqB,KAAM,CAAA,aAAA,CAEtC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,oBAAA,GAAuB,KAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEE,MAAA,mBAAA,GAAsB,KAAM,CAAA,aAAA,CAEvC,KAAS,CAAA;;;;"}
|
package/skinny/contexts.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const PlasmicDialogTriggerContext: React.Context<import("./regist
|
|
|
9
9
|
export type PlasmicSliderContextType<T extends number | number[]> = React.ComponentProps<typeof BaseSlider<T>> | undefined;
|
|
10
10
|
export declare const PlasmicSliderContext: React.Context<PlasmicSliderContextType<number | number[]>>;
|
|
11
11
|
export declare const PlasmicLabelContext: React.Context<(import("react-aria-components").LabelProps & React.RefAttributes<HTMLLabelElement>) | undefined>;
|
|
12
|
+
export declare const PlasmicPopoverContext: React.Context<import("./registerPopover").BasePopoverProps | undefined>;
|
|
12
13
|
export declare const PlasmicListBoxContext: React.Context<BaseListBoxProps | undefined>;
|
|
13
14
|
export declare const PlasmicItemContext: React.Context<StrictItemType | undefined>;
|
|
14
15
|
export declare const PlasmicSectionContext: React.Context<import("./registerSection").BaseSectionProps | undefined>;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
|
-
var common = require('./common-
|
|
5
|
+
var common = require('./common-bfedaf7d.cjs.js');
|
|
6
6
|
var interactionVariantUtils = require('./interaction-variant-utils-36f1b397.cjs.js');
|
|
7
|
-
var utils = require('./utils-d3708034.cjs.js');
|
|
8
7
|
require('@plasmicapp/host/registerComponent');
|
|
9
8
|
|
|
10
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -77,9 +76,9 @@ function BaseButton(props) {
|
|
|
77
76
|
updateInteractionVariant
|
|
78
77
|
));
|
|
79
78
|
}
|
|
80
|
-
const BUTTON_COMPONENT_NAME =
|
|
79
|
+
const BUTTON_COMPONENT_NAME = common.makeComponentName("button");
|
|
81
80
|
function registerButton(loader, overrides) {
|
|
82
|
-
|
|
81
|
+
common.registerComponentHelper(
|
|
83
82
|
loader,
|
|
84
83
|
BaseButton,
|
|
85
84
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonProps } 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 BUTTON_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n BUTTON_INTERACTION_VARIANTS\n);\n\ninterface BaseButtonProps extends ButtonProps {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: 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 BUTTON_INTERACTION_VARIANTS\n >;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const {\n submitsForm,\n resetsForm,\n children,\n updateInteractionVariant,\n ...rest\n } = props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n return (\n <Button type={type} {...rest}>\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 updateInteractionVariant\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 interactionVariants,\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 \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.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: (ps: BaseButtonProps) => Boolean(ps.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 },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","Button","makeComponentName","registerComponentHelper","getCommonProps"],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonProps } 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 BUTTON_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n BUTTON_INTERACTION_VARIANTS\n);\n\ninterface BaseButtonProps extends ButtonProps {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: 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 BUTTON_INTERACTION_VARIANTS\n >;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const {\n submitsForm,\n resetsForm,\n children,\n updateInteractionVariant,\n ...rest\n } = props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n return (\n <Button type={type} {...rest}>\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 updateInteractionVariant\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 interactionVariants,\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 \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.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: (ps: BaseButtonProps) => Boolean(ps.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 },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","Button","makeComponentName","registerComponentHelper","getCommonProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,2BAA8B,GAAA;AAAA,EAClC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,2BAAA;AACF,CAAA,CAAA;AAaO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,wBAAA;AAAA,GA3CJ,GA6CM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,aAAA;AAAA,IACA,YAAA;A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;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,UACN,eAAiB,EAAA,IAAA;AAAA,UACjB,YAAc,EAAA;AAAA,YACZ,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,QAAA;AAAA,WACT;AAAA,SACF;AAAA,QACA,WAAa,EAAA;AAAA,UACX,IAAM,EAAA,SAAA;AAAA,UACN,WAAa,EAAA,eAAA;AAAA,UACb,gBAAkB,EAAA,KAAA;AAAA,UAClB,MAAQ,EAAA,CAAC,EAAwB,KAAA,OAAA,CAAQ,GAAG,UAAU,CAAA;AAAA,UACtD,WACE,EAAA,gEAAA;AAAA,UACF,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,QACA,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,SAAA;AAAA,UACN,WAAa,EAAA,cAAA;AAAA,UACb,gBAAkB,EAAA,KAAA;AAAA,UAClB,MAAQ,EAAA,CAAC,EAAwB,KAAA,OAAA,CAAQ,GAAG,WAAW,CAAA;AAAA,UACvD,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,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from 'react-aria-components';
|
|
3
|
-
import { g as getCommonProps } from './common-
|
|
3
|
+
import { a as makeComponentName, r as registerComponentHelper, g as getCommonProps } from './common-fa69e9b3.esm.js';
|
|
4
4
|
import { p as pickAriaComponentVariants } from './interaction-variant-utils-abd0c319.esm.js';
|
|
5
|
-
import { a as makeComponentName, r as registerComponentHelper } from './utils-a1785802.esm.js';
|
|
6
5
|
import '@plasmicapp/host/registerComponent';
|
|
7
6
|
|
|
8
7
|
var __defProp = Object.defineProperty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerButton.esm.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonProps } 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 BUTTON_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n BUTTON_INTERACTION_VARIANTS\n);\n\ninterface BaseButtonProps extends ButtonProps {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: 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 BUTTON_INTERACTION_VARIANTS\n >;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const {\n submitsForm,\n resetsForm,\n children,\n updateInteractionVariant,\n ...rest\n } = props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n return (\n <Button type={type} {...rest}>\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 updateInteractionVariant\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 interactionVariants,\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 \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.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: (ps: BaseButtonProps) => Boolean(ps.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 },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerButton.esm.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonProps } 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 BUTTON_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n BUTTON_INTERACTION_VARIANTS\n);\n\ninterface BaseButtonProps extends ButtonProps {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: 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 BUTTON_INTERACTION_VARIANTS\n >;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const {\n submitsForm,\n resetsForm,\n children,\n updateInteractionVariant,\n ...rest\n } = props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n return (\n <Button type={type} {...rest}>\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 updateInteractionVariant\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 interactionVariants,\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 \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.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: (ps: BaseButtonProps) => Boolean(ps.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 },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,2BAA8B,GAAA;AAAA,EAClC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAA,yBAAA;AAAA,EAClD,2BAAA;AACF,CAAA,CAAA;AAaO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,wBAAA;AAAA,GA3CJ,GA6CM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,aAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,0BAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EAAA,MAAM,IAAO,GAAA,WAAA,GAAc,QAAW,GAAA,UAAA,GAAa,OAAU,GAAA,QAAA,CAAA;AAE7D,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,MAAO,EAAA,cAAA,CAAA,EAAA,IAAA,EAAA,EAAgB,IACrB,CAAA,EAAA,CAAC,EAAE,SAAA,EAAW,SAAW,EAAA,SAAA,EAAW,cAAgB,EAAA,UAAA,EACnD,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,MACd,QAAU,EAAA,UAAA;AAAA,KACZ;AAAA,IACA,wBAAA;AAAA,GAGN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EAAwB,KAAA,OAAA,CAAQ,GAAG,WAAW,CAAA;AAAA,UACvD,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,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var reactAriaComponents = require('react-aria-components');
|
|
5
|
-
var common = require('./common-
|
|
6
|
-
var contexts = require('./contexts-
|
|
5
|
+
var common = require('./common-bfedaf7d.cjs.js');
|
|
6
|
+
var contexts = require('./contexts-0dec6156.cjs.js');
|
|
7
7
|
var interactionVariantUtils = require('./interaction-variant-utils-36f1b397.cjs.js');
|
|
8
|
-
var utils = require('./utils-d3708034.cjs.js');
|
|
9
8
|
require('@plasmicapp/host/registerComponent');
|
|
10
9
|
|
|
11
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -134,11 +133,11 @@ const makeDefaultCheckboxChildren = ({
|
|
|
134
133
|
]
|
|
135
134
|
});
|
|
136
135
|
function registerCheckbox(loader, overrides) {
|
|
137
|
-
return
|
|
136
|
+
return common.registerComponentHelper(
|
|
138
137
|
loader,
|
|
139
138
|
BaseCheckbox,
|
|
140
139
|
{
|
|
141
|
-
name:
|
|
140
|
+
name: common.makeComponentName("checkbox"),
|
|
142
141
|
displayName: "Aria Checkbox",
|
|
143
142
|
importPath: "@plasmicpkgs/react-aria/skinny/registerCheckbox",
|
|
144
143
|
importName: "BaseCheckbox",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerCheckbox.cjs.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import { PlasmicElement } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport type { CheckboxProps } from \"react-aria-components\";\nimport { Checkbox } from \"react-aria-components\";\nimport { getCommonProps, hasParent } from \"./common\";\nimport { PlasmicCheckboxGroupContext } from \"./contexts\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst CHECKBOX_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"indeterminate\" as const,\n \"disabled\" as const,\n \"selected\" as const,\n \"readonly\" as const,\n \"selected\" as const,\n];\n\ninterface BaseCheckboxProps extends CheckboxProps, HasControlContextData {\n children: React.ReactNode;\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 CHECKBOX_INTERACTION_VARIANTS\n >;\n}\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n CHECKBOX_INTERACTION_VARIANTS\n);\n\nexport function BaseCheckbox(props: BaseCheckboxProps) {\n const { children, updateInteractionVariant, setControlContextData, ...rest } =\n props;\n const contextProps = React.useContext(PlasmicCheckboxGroupContext);\n\n setControlContextData?.({\n parent: contextProps,\n });\n\n return (\n <>\n <Checkbox {...rest}>\n {({\n isHovered,\n isPressed,\n isFocused,\n isFocusVisible,\n isDisabled,\n isIndeterminate,\n isSelected,\n isReadOnly,\n }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n indeterminate: isIndeterminate,\n selected: isSelected,\n readonly: isReadOnly,\n },\n updateInteractionVariant\n )\n }\n </Checkbox>\n </>\n );\n}\n\nexport const makeDefaultCheckboxChildren = ({\n label,\n showDocs,\n}: {\n label: string;\n showDocs?: boolean;\n}): PlasmicElement => ({\n type: \"vbox\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"2px\",\n padding: 0,\n },\n children: [\n {\n type: \"hbox\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"10px\",\n padding: 0,\n },\n children: [\n {\n type: \"box\",\n styles: {\n width: \"7px\",\n height: \"7px\",\n borderRadius: \"3px\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n },\n },\n {\n type: \"text\",\n value: label,\n },\n ],\n },\n ...(showDocs\n ? [\n {\n type: \"text\",\n value: \"Add interaction variants to see it in action...\",\n } as PlasmicElement,\n ]\n : []),\n ],\n});\n\nexport function registerCheckbox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckbox>\n) {\n return registerComponentHelper(\n loader,\n BaseCheckbox,\n {\n name: makeComponentName(\"checkbox\"),\n displayName: \"Aria Checkbox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckbox\",\n importName: \"BaseCheckbox\",\n interactionVariants,\n props: {\n ...getCommonProps<BaseCheckboxProps>(\"checkbox\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"isRequired\",\n \"autoFocus\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: makeDefaultCheckboxChildren({\n label: \"Label\",\n showDocs: true,\n }),\n },\n value: {\n type: \"string\",\n description:\n 'The value of the checkbox in \"selected\" state, used when submitting an HTML form.',\n defaultValueHint: \"on\",\n },\n isSelected: {\n type: \"boolean\",\n displayName: \"Default Selected\",\n editOnly: true,\n uncontrolledProp: \"defaultSelected\",\n description: \"Whether the checkbox should be selected by default\",\n defaultValueHint: false,\n defaultValue: false,\n },\n isIndeterminate: {\n displayName: \"Indeterminate\",\n type: \"boolean\",\n description:\n \"This state indicates that the checkbox is neither fully checked nor unchecked. It typically represents a partial selection when dealing with groups of options. Some but not all items in the group are selected, resulting in an indeterminate state for the checkbox.\",\n defaultValueHint: false,\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"writable\",\n valueProp: \"isSelected\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n hidden: hasParent,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","PlasmicCheckboxGroupContext","Checkbox","registerComponentHelper","makeComponentName","getCommonProps","hasParent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,6BAAgC,GAAA;AAAA,EACpC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAWA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,6BAAA;AACF,CAAA,CAAA;AAEO,SAAS,aAAa,KAA0B,EAAA;AACrD,EACE,MAAA,EAAA,GAAA,KAAA,EADM,EAAU,QAAA,EAAA,wBAAA,EAA0B,qBA5C9C,EAAA,GA6CI,IADoE,IACpE,GAAA,SAAA,CAAA,EAAA,EADoE,CAA9D,UAAA,EAAU,0BAA0B,EAAA,uBAAA,CAAA,CAAA,CAAA;AAE5C,EAAM,MAAA,YAAA,GAAeC,sBAAM,CAAA,UAAA,CAAWC,oCAA2B,CAAA,CAAA;AAEjE,EAAwB,qBAAA,IAAA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A,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
|
|
1
|
+
{"version":3,"file":"registerCheckbox.cjs.js","sources":["../src/registerCheckbox.tsx"],"sourcesContent":["import { PlasmicElement } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport type { CheckboxProps } from \"react-aria-components\";\nimport { Checkbox } from \"react-aria-components\";\nimport { getCommonProps, hasParent } from \"./common\";\nimport { PlasmicCheckboxGroupContext } from \"./contexts\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n HasControlContextData,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst CHECKBOX_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"indeterminate\" as const,\n \"disabled\" as const,\n \"selected\" as const,\n \"readonly\" as const,\n \"selected\" as const,\n];\n\ninterface BaseCheckboxProps extends CheckboxProps, HasControlContextData {\n children: React.ReactNode;\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 CHECKBOX_INTERACTION_VARIANTS\n >;\n}\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n CHECKBOX_INTERACTION_VARIANTS\n);\n\nexport function BaseCheckbox(props: BaseCheckboxProps) {\n const { children, updateInteractionVariant, setControlContextData, ...rest } =\n props;\n const contextProps = React.useContext(PlasmicCheckboxGroupContext);\n\n setControlContextData?.({\n parent: contextProps,\n });\n\n return (\n <>\n <Checkbox {...rest}>\n {({\n isHovered,\n isPressed,\n isFocused,\n isFocusVisible,\n isDisabled,\n isIndeterminate,\n isSelected,\n isReadOnly,\n }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n indeterminate: isIndeterminate,\n selected: isSelected,\n readonly: isReadOnly,\n },\n updateInteractionVariant\n )\n }\n </Checkbox>\n </>\n );\n}\n\nexport const makeDefaultCheckboxChildren = ({\n label,\n showDocs,\n}: {\n label: string;\n showDocs?: boolean;\n}): PlasmicElement => ({\n type: \"vbox\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"2px\",\n padding: 0,\n },\n children: [\n {\n type: \"hbox\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"10px\",\n padding: 0,\n },\n children: [\n {\n type: \"box\",\n styles: {\n width: \"7px\",\n height: \"7px\",\n borderRadius: \"3px\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n },\n },\n {\n type: \"text\",\n value: label,\n },\n ],\n },\n ...(showDocs\n ? [\n {\n type: \"text\",\n value: \"Add interaction variants to see it in action...\",\n } as PlasmicElement,\n ]\n : []),\n ],\n});\n\nexport function registerCheckbox(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseCheckbox>\n) {\n return registerComponentHelper(\n loader,\n BaseCheckbox,\n {\n name: makeComponentName(\"checkbox\"),\n displayName: \"Aria Checkbox\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerCheckbox\",\n importName: \"BaseCheckbox\",\n interactionVariants,\n props: {\n ...getCommonProps<BaseCheckboxProps>(\"checkbox\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"aria-label\",\n \"isRequired\",\n \"autoFocus\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: makeDefaultCheckboxChildren({\n label: \"Label\",\n showDocs: true,\n }),\n },\n value: {\n type: \"string\",\n description:\n 'The value of the checkbox in \"selected\" state, used when submitting an HTML form.',\n defaultValueHint: \"on\",\n },\n isSelected: {\n type: \"boolean\",\n displayName: \"Default Selected\",\n editOnly: true,\n uncontrolledProp: \"defaultSelected\",\n description: \"Whether the checkbox should be selected by default\",\n defaultValueHint: false,\n defaultValue: false,\n },\n isIndeterminate: {\n displayName: \"Indeterminate\",\n type: \"boolean\",\n description:\n \"This state indicates that the checkbox is neither fully checked nor unchecked. It typically represents a partial selection when dealing with groups of options. Some but not all items in the group are selected, resulting in an indeterminate state for the checkbox.\",\n defaultValueHint: false,\n },\n isInvalid: {\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isSelected\", type: \"boolean\" }],\n },\n },\n states: {\n isSelected: {\n type: \"writable\",\n valueProp: \"isSelected\",\n onChangeProp: \"onChange\",\n variableType: \"boolean\",\n hidden: hasParent,\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","PlasmicCheckboxGroupContext","Checkbox","registerComponentHelper","makeComponentName","getCommonProps","hasParent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,6BAAgC,GAAA;AAAA,EACpC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAWA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,6BAAA;AACF,CAAA,CAAA;AAEO,SAAS,aAAa,KAA0B,EAAA;AACrD,EACE,MAAA,EAAA,GAAA,KAAA,EADM,EAAU,QAAA,EAAA,wBAAA,EAA0B,qBA5C9C,EAAA,GA6CI,IADoE,IACpE,GAAA,SAAA,CAAA,EAAA,EADoE,CAA9D,UAAA,EAAU,0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,UACN,SAAW,EAAA,YAAA;AAAA,UACX,YAAc,EAAA,UAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,UACd,MAAQ,EAAAC,gBAAA;AAAA,SACV;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Checkbox } from 'react-aria-components';
|
|
3
|
-
import { g as getCommonProps, h as hasParent } from './common-
|
|
4
|
-
import { P as PlasmicCheckboxGroupContext } from './contexts-
|
|
3
|
+
import { r as registerComponentHelper, a as makeComponentName, g as getCommonProps, h as hasParent } from './common-fa69e9b3.esm.js';
|
|
4
|
+
import { P as PlasmicCheckboxGroupContext } from './contexts-9a8234bf.esm.js';
|
|
5
5
|
import { p as pickAriaComponentVariants } from './interaction-variant-utils-abd0c319.esm.js';
|
|
6
|
-
import { r as registerComponentHelper, a as makeComponentName } from './utils-a1785802.esm.js';
|
|
7
6
|
import '@plasmicapp/host/registerComponent';
|
|
8
7
|
|
|
9
8
|
var __defProp = Object.defineProperty;
|