@plasmicpkgs/react-aria 0.0.97 → 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 +110 -28
- package/dist/react-aria.esm.js.map +1 -1
- package/dist/react-aria.js +109 -27
- package/dist/react-aria.js.map +1 -1
- package/dist/registerButton.d.ts +10 -3
- package/dist/registerOverlayArrow.d.ts +1 -0
- package/package.json +2 -2
- package/skinny/{common-bf3c2660.cjs.js → common-b3b54c72.cjs.js} +20 -5
- package/skinny/common-b3b54c72.cjs.js.map +1 -0
- package/skinny/{common-2dfadd70.esm.js → common-ceebbaea.esm.js} +20 -5
- package/skinny/common-ceebbaea.esm.js.map +1 -0
- package/skinny/registerButton.cjs.js +90 -23
- package/skinny/registerButton.cjs.js.map +1 -1
- package/skinny/registerButton.d.ts +10 -3
- package/skinny/registerButton.esm.js +91 -24
- package/skinny/registerButton.esm.js.map +1 -1
- package/skinny/registerCheckbox.cjs.js +1 -1
- package/skinny/registerCheckbox.esm.js +1 -1
- package/skinny/registerCheckboxGroup.cjs.js +1 -1
- package/skinny/registerCheckboxGroup.esm.js +1 -1
- package/skinny/registerComboBox.cjs.js +3 -3
- package/skinny/registerComboBox.esm.js +3 -3
- package/skinny/registerDescription.cjs.js +1 -1
- package/skinny/registerDescription.esm.js +1 -1
- package/skinny/registerDialog.cjs.js +1 -1
- package/skinny/registerDialog.esm.js +1 -1
- package/skinny/registerDialogTrigger.cjs.js +1 -1
- package/skinny/registerDialogTrigger.esm.js +1 -1
- package/skinny/registerHeading.cjs.js +1 -1
- package/skinny/registerHeading.esm.js +1 -1
- package/skinny/registerInput.cjs.js +1 -1
- package/skinny/registerInput.esm.js +1 -1
- package/skinny/registerLabel.cjs.js +1 -1
- package/skinny/registerLabel.esm.js +1 -1
- package/skinny/{registerListBox-5d2e3f2e.esm.js → registerListBox-40846430.esm.js} +2 -2
- package/skinny/{registerListBox-5d2e3f2e.esm.js.map → registerListBox-40846430.esm.js.map} +1 -1
- package/skinny/{registerListBox-9ba3ccfe.cjs.js → registerListBox-a99736df.cjs.js} +2 -2
- package/skinny/{registerListBox-9ba3ccfe.cjs.js.map → registerListBox-a99736df.cjs.js.map} +1 -1
- package/skinny/registerListBox.cjs.js +2 -2
- package/skinny/registerListBox.esm.js +2 -2
- package/skinny/registerListBoxItem.cjs.js +1 -1
- package/skinny/registerListBoxItem.esm.js +1 -1
- package/skinny/registerModal.cjs.js +1 -1
- package/skinny/registerModal.esm.js +1 -1
- package/skinny/registerOverlayArrow.cjs.js +2 -2
- package/skinny/registerOverlayArrow.cjs.js.map +1 -1
- package/skinny/registerOverlayArrow.d.ts +1 -0
- package/skinny/registerOverlayArrow.esm.js +2 -2
- package/skinny/registerOverlayArrow.esm.js.map +1 -1
- package/skinny/registerPopover.cjs.js +1 -1
- package/skinny/registerPopover.esm.js +1 -1
- package/skinny/registerRadio.cjs.js +1 -1
- package/skinny/registerRadio.esm.js +1 -1
- package/skinny/registerRadioGroup.cjs.js +1 -1
- package/skinny/registerRadioGroup.esm.js +1 -1
- package/skinny/registerSection.cjs.js +2 -2
- package/skinny/registerSection.esm.js +2 -2
- package/skinny/registerSelect.cjs.js +3 -3
- package/skinny/registerSelect.esm.js +3 -3
- package/skinny/registerSlider.cjs.js +1 -1
- package/skinny/registerSlider.esm.js +1 -1
- package/skinny/registerSliderOutput.cjs.js +1 -1
- package/skinny/registerSliderOutput.esm.js +1 -1
- package/skinny/registerSliderThumb.cjs.js +1 -1
- package/skinny/registerSliderThumb.esm.js +1 -1
- package/skinny/registerSliderTrack.cjs.js +1 -1
- package/skinny/registerSliderTrack.esm.js +1 -1
- package/skinny/registerSwitch.cjs.js +1 -1
- package/skinny/registerSwitch.esm.js +1 -1
- package/skinny/registerText.cjs.js +1 -1
- package/skinny/registerText.esm.js +1 -1
- package/skinny/registerTextArea.cjs.js +1 -1
- package/skinny/registerTextArea.esm.js +1 -1
- package/skinny/registerTextField.cjs.js +1 -1
- package/skinny/registerTextField.esm.js +1 -1
- package/skinny/registerTooltip.cjs.js +1 -1
- package/skinny/registerTooltip.esm.js +1 -1
- package/skinny/common-2dfadd70.esm.js.map +0 -1
- package/skinny/common-bf3c2660.cjs.js.map +0 -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 {};
|
|
@@ -4,6 +4,7 @@ import { CodeComponentMetaOverrides, Registerable } from "./utils";
|
|
|
4
4
|
import { WithVariants } from "./variant-utils";
|
|
5
5
|
declare const OVERLAY_ARROW_VARIANTS: ("placementLeft" | "placementRight" | "placementTop")[];
|
|
6
6
|
export interface BaseOverlayArrowProps extends OverlayArrowProps, WithVariants<typeof OVERLAY_ARROW_VARIANTS> {
|
|
7
|
+
children: React.ReactNode;
|
|
7
8
|
}
|
|
8
9
|
export declare function BaseOverlayArrow({ children, plasmicUpdateVariant, className, }: BaseOverlayArrowProps): React.JSX.Element;
|
|
9
10
|
export declare const OVERLAY_ARROW_COMPONENT_NAME: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-aria",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.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
|
}
|
|
@@ -364,13 +364,28 @@ function createPlacementProp(componentName, overrides) {
|
|
|
364
364
|
type: "choice",
|
|
365
365
|
description: `Default placement of the ${componentName} relative to the trigger, if there is enough space`,
|
|
366
366
|
options: [
|
|
367
|
-
// Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825
|
|
368
|
-
"top",
|
|
369
367
|
"bottom",
|
|
368
|
+
"bottom left",
|
|
369
|
+
"bottom right",
|
|
370
|
+
"bottom start",
|
|
371
|
+
"bottom end",
|
|
372
|
+
"top",
|
|
373
|
+
"top left",
|
|
374
|
+
"top right",
|
|
375
|
+
"top start",
|
|
376
|
+
"top end",
|
|
377
|
+
"left",
|
|
378
|
+
"left top",
|
|
379
|
+
"left bottom",
|
|
370
380
|
"start",
|
|
381
|
+
"start top",
|
|
382
|
+
"start bottom",
|
|
383
|
+
"right",
|
|
384
|
+
"right top",
|
|
385
|
+
"right bottom",
|
|
371
386
|
"end",
|
|
372
|
-
"
|
|
373
|
-
"
|
|
387
|
+
"end top",
|
|
388
|
+
"end bottom"
|
|
374
389
|
]
|
|
375
390
|
}, overrides != null ? overrides : {});
|
|
376
391
|
}
|
|
@@ -437,4 +452,4 @@ exports.getCommonOverlayProps = getCommonOverlayProps;
|
|
|
437
452
|
exports.getCommonProps = getCommonProps;
|
|
438
453
|
exports.hasParent = hasParent;
|
|
439
454
|
exports.resolveAutoComplete = resolveAutoComplete;
|
|
440
|
-
//# sourceMappingURL=common-
|
|
455
|
+
//# sourceMappingURL=common-b3b54c72.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-b3b54c72.cjs.js","sources":["../src/common.ts"],"sourcesContent":["import { PlasmicElement, PropType } from \"@plasmicapp/host\";\nimport { CSSProperties } from \"react\";\nimport {\n BaseControlContextData,\n HasControlContextData,\n isDefined,\n} from \"./utils\";\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 displayName: \"Form field key\",\n // hidden: hasParent,\n hidden: () => true, // hiding required prop until the release of Aria Forms\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 hidden: () => true, // hiding required prop until the release of Aria Forms\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: `Assistive technology uses this if there is no visible label for this ${componentName}`,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createChildrenProp<T>(): PropType<T> {\n return {\n type: \"slot\",\n mergeWithParent: true,\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), visit [Regexr](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 \"Learn more about the available options on the [MDN guide](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\ntype Overrides = {\n defaultValueHint?: any;\n};\n\nexport function createPlacementProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"choice\",\n description: `Default placement of the ${componentName} relative to the trigger, if there is enough space`,\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"bottom start\",\n \"bottom end\",\n \"top\",\n \"top left\",\n \"top right\",\n \"top start\",\n \"top end\",\n \"left\",\n \"left top\",\n \"left bottom\",\n \"start\",\n \"start top\",\n \"start bottom\",\n \"right\",\n \"right top\",\n \"right bottom\",\n \"end\",\n \"end top\",\n \"end bottom\",\n ],\n ...(overrides ?? {}),\n };\n}\n\nexport function createOffsetProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"number\",\n displayName: \"Offset\",\n description: `Additional offset applied along the main axis between the ${componentName} and its trigger`,\n advanced: true,\n ...(overrides ?? {}),\n };\n}\n\nexport function createContainerPaddingProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"number\",\n description: `The padding that should be applied between the ${componentName} and its surrounding container. This affects the positioning breakpoints that determine when it will attempt to flip.`,\n advanced: true,\n ...(overrides ?? {}),\n };\n}\n\nexport function createCrossOffsetProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"number\",\n description: `The additional offset applied along the cross axis between the ${componentName} and its anchor element.`,\n advanced: true,\n ...(overrides ?? {}),\n };\n}\n\nexport function getCommonOverlayProps<T>(\n componentName: string,\n overrides: Record<string, Overrides>\n) {\n const commonProps: Record<string, PropType<T>> = {\n placement: createPlacementProp<T>(componentName, overrides[\"placement\"]),\n offset: createOffsetProp<T>(componentName, overrides[\"offset\"]),\n containerPadding: createContainerPaddingProp<T>(\n componentName,\n overrides[\"containerPadding\"]\n ),\n crossOffset: createCrossOffsetProp<T>(\n componentName,\n overrides[\"crossOffset\"]\n ),\n };\n return commonProps;\n}\n\nexport const arrowDown: PlasmicElement = {\n type: \"hbox\",\n children: [],\n styles: {\n width: 0,\n height: 0,\n padding: 0,\n borderLeftWidth: \"5px\",\n borderRightWidth: \"5px\",\n borderTopWidth: \"5px\",\n borderLeftStyle: \"solid\",\n borderRightStyle: \"solid\",\n borderTopStyle: \"solid\",\n borderLeftColor: \"transparent\",\n borderRightColor: \"transparent\",\n borderTopColor: \"black\",\n },\n};\n// Set border-box to the root element of the aria code component to align with Plasmic's default of using border-box for all root elements.\nexport const COMMON_STYLES: CSSProperties = { boxSizing: \"border-box\" };\n"],"names":["isDefined"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQgB,SAAA,SAAA,CAAa,QAAW,GAAqC,EAAA;AAC3E,EAAO,OAAAA,eAAA,CAAU,GAAK,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,GAAA,CAAA,MAAM,CAAM,KAAA,IAAA,CAAA;AACpC,CAAA;AAEgB,SAAA,gBAAA,CAAoB,QAAW,GAA4B,EAAA;AAZ3E,EAAA,IAAA,EAAA,CAAA;AAaE,EAAO,OAAA,CAAA,CAAA,EAAA,GAAA,GAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,GAAA,CAAK,MAAL,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAa,UAAe,MAAA,IAAA,CAAA;AACrC,CAAA;AAEgB,SAAA,gBAAA,CAAoB,QAAW,GAA4B,EAAA;AAhB3E,EAAA,IAAA,EAAA,CAAA;AAiBE,EAAO,OAAA,CAAA,CAAA,EAAA,GAAA,GAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,GAAA,CAAK,MAAL,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAa,UAAe,MAAA,IAAA,CAAA;AACrC,CAAA;AAEO,SAAS,oBAAoB,gBAAsC,EAAA;AACxE,EAAI,IAAA,OAAO,qBAAqB,QAAU,EAAA;AACxC,IAAO,OAAA,gBAAA,CAAA;AAAA,GACT;AACA,EACE,IAAA,CAAC,gBACD,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,gBAAgB,CAC/B,IAAA,gBAAA,CAAiB,QAAS,CAAA,KAAK,CAC/B,EAAA;AACA,IAAO,OAAA,KAAA,CAAA,CAAA;AAAA,GACT;AACA,EAA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AA,OAAA;AAAA,IACjB,gBAAkB,EAAA,OAAA;AAAA,IAClB,cAAgB,EAAA,OAAA;AAAA,IAChB,eAAiB,EAAA,aAAA;AAAA,IACjB,gBAAkB,EAAA,aAAA;AAAA,IAClB,cAAgB,EAAA,OAAA;AAAA,GAClB;AACF,EAAA;AAEa,MAAA,aAAA,GAA+B,EAAE,SAAA,EAAW,YAAa;;;;;;;;;"}
|
|
@@ -362,13 +362,28 @@ function createPlacementProp(componentName, overrides) {
|
|
|
362
362
|
type: "choice",
|
|
363
363
|
description: `Default placement of the ${componentName} relative to the trigger, if there is enough space`,
|
|
364
364
|
options: [
|
|
365
|
-
// Not allowing other placement options here because of https://github.com/adobe/react-spectrum/issues/6825
|
|
366
|
-
"top",
|
|
367
365
|
"bottom",
|
|
366
|
+
"bottom left",
|
|
367
|
+
"bottom right",
|
|
368
|
+
"bottom start",
|
|
369
|
+
"bottom end",
|
|
370
|
+
"top",
|
|
371
|
+
"top left",
|
|
372
|
+
"top right",
|
|
373
|
+
"top start",
|
|
374
|
+
"top end",
|
|
375
|
+
"left",
|
|
376
|
+
"left top",
|
|
377
|
+
"left bottom",
|
|
368
378
|
"start",
|
|
379
|
+
"start top",
|
|
380
|
+
"start bottom",
|
|
381
|
+
"right",
|
|
382
|
+
"right top",
|
|
383
|
+
"right bottom",
|
|
369
384
|
"end",
|
|
370
|
-
"
|
|
371
|
-
"
|
|
385
|
+
"end top",
|
|
386
|
+
"end bottom"
|
|
372
387
|
]
|
|
373
388
|
}, overrides != null ? overrides : {});
|
|
374
389
|
}
|
|
@@ -430,4 +445,4 @@ const arrowDown = {
|
|
|
430
445
|
const COMMON_STYLES = { boxSizing: "border-box" };
|
|
431
446
|
|
|
432
447
|
export { COMMON_STYLES as C, arrowDown as a, getCommonOverlayProps as b, getCommonProps as g, hasParent as h, resolveAutoComplete as r };
|
|
433
|
-
//# sourceMappingURL=common-
|
|
448
|
+
//# sourceMappingURL=common-ceebbaea.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-ceebbaea.esm.js","sources":["../src/common.ts"],"sourcesContent":["import { PlasmicElement, PropType } from \"@plasmicapp/host\";\nimport { CSSProperties } from \"react\";\nimport {\n BaseControlContextData,\n HasControlContextData,\n isDefined,\n} from \"./utils\";\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 displayName: \"Form field key\",\n // hidden: hasParent,\n hidden: () => true, // hiding required prop until the release of Aria Forms\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 hidden: () => true, // hiding required prop until the release of Aria Forms\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: `Assistive technology uses this if there is no visible label for this ${componentName}`,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createChildrenProp<T>(): PropType<T> {\n return {\n type: \"slot\",\n mergeWithParent: true,\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), visit [Regexr](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 \"Learn more about the available options on the [MDN guide](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\ntype Overrides = {\n defaultValueHint?: any;\n};\n\nexport function createPlacementProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"choice\",\n description: `Default placement of the ${componentName} relative to the trigger, if there is enough space`,\n options: [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"bottom start\",\n \"bottom end\",\n \"top\",\n \"top left\",\n \"top right\",\n \"top start\",\n \"top end\",\n \"left\",\n \"left top\",\n \"left bottom\",\n \"start\",\n \"start top\",\n \"start bottom\",\n \"right\",\n \"right top\",\n \"right bottom\",\n \"end\",\n \"end top\",\n \"end bottom\",\n ],\n ...(overrides ?? {}),\n };\n}\n\nexport function createOffsetProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"number\",\n displayName: \"Offset\",\n description: `Additional offset applied along the main axis between the ${componentName} and its trigger`,\n advanced: true,\n ...(overrides ?? {}),\n };\n}\n\nexport function createContainerPaddingProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"number\",\n description: `The padding that should be applied between the ${componentName} and its surrounding container. This affects the positioning breakpoints that determine when it will attempt to flip.`,\n advanced: true,\n ...(overrides ?? {}),\n };\n}\n\nexport function createCrossOffsetProp<T>(\n componentName: string,\n overrides: Overrides\n): PropType<T> {\n return {\n type: \"number\",\n description: `The additional offset applied along the cross axis between the ${componentName} and its anchor element.`,\n advanced: true,\n ...(overrides ?? {}),\n };\n}\n\nexport function getCommonOverlayProps<T>(\n componentName: string,\n overrides: Record<string, Overrides>\n) {\n const commonProps: Record<string, PropType<T>> = {\n placement: createPlacementProp<T>(componentName, overrides[\"placement\"]),\n offset: createOffsetProp<T>(componentName, overrides[\"offset\"]),\n containerPadding: createContainerPaddingProp<T>(\n componentName,\n overrides[\"containerPadding\"]\n ),\n crossOffset: createCrossOffsetProp<T>(\n componentName,\n overrides[\"crossOffset\"]\n ),\n };\n return commonProps;\n}\n\nexport const arrowDown: PlasmicElement = {\n type: \"hbox\",\n children: [],\n styles: {\n width: 0,\n height: 0,\n padding: 0,\n borderLeftWidth: \"5px\",\n borderRightWidth: \"5px\",\n borderTopWidth: \"5px\",\n borderLeftStyle: \"solid\",\n borderRightStyle: \"solid\",\n borderTopStyle: \"solid\",\n borderLeftColor: \"transparent\",\n borderRightColor: \"transparent\",\n borderTopColor: \"black\",\n },\n};\n// Set border-box to the root element of the aria code component to align with Plasmic's default of using border-box for all root elements.\nexport const COMMON_STYLES: CSSProperties = { boxSizing: \"border-box\" };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAQgB,SAAA,SAAA,CAAa,QAAW,GAAqC,EAAA;AAC3E,EAAO,OAAA,SAAA,CAAU,GAAK,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,GAAA,CAAA,MAAM,CAAM,KAAA,IAAA,CAAA;AACpC,CAAA;AAEgB,SAAA,gBAAA,CAAoB,QAAW,GAA4B,EAAA;AAZ3E,EAAA,IAAA,EAAA,CAAA;AAaE,EAAO,OAAA,CAAA,CAAA,EAAA,GAAA,GAAA,IAAA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A,IAC/C,SAAW,EAAA,mBAAA,CAAuB,aAAe,EAAA,SAAA,CAAU,WAAW,CAAC,CAAA;AAAA,IACvE,MAAQ,EAAA,gBAAA,CAAoB,aAAe,EAAA,SAAA,CAAU,QAAQ,CAAC,CAAA;AAAA,IAC9D,gBAAkB,EAAA,0BAAA;AAAA,MAChB,aAAA;AAAA,MACA,UAAU,kBAAkB,CAAA;AAAA,KAC9B;AAAA,IACA,WAAa,EAAA,qBAAA;AAAA,MACX,aAAA;AAAA,MACA,UAAU,aAAa,CAAA;AAAA,KACzB;AAAA,GACF,CAAA;AACA,EAAO,OAAA,WAAA,CAAA;AACT,CAAA;AAEO,MAAM,SAA4B,GAAA;AAAA,EACvC,IAAM,EAAA,MAAA;AAAA,EACN,UAAU,EAAC;AAAA,EACX,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,CAAA;AAAA,IACP,MAAQ,EAAA,CAAA;AAAA,IACR,OAAS,EAAA,CAAA;AAAA,IACT,eAAiB,EAAA,KAAA;AAAA,IACjB,gBAAkB,EAAA,KAAA;AAAA,IAClB,cAAgB,EAAA,KAAA;AAAA,IAChB,eAAiB,EAAA,OAAA;AAAA,IACjB,gBAAkB,EAAA,OAAA;AAAA,IAClB,cAAgB,EAAA,OAAA;AAAA,IAChB,eAAiB,EAAA,aAAA;AAAA,IACjB,gBAAkB,EAAA,aAAA;AAAA,IAClB,cAAgB,EAAA,OAAA;AAAA,GAClB;AACF,EAAA;AAEa,MAAA,aAAA,GAA+B,EAAE,SAAA,EAAW,YAAa;;;;"}
|
|
@@ -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
|
-
var common = require('./common-
|
|
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,GA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A;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.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,EACA,cAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,QAAA,EAAU,kBAAmB,EAAA,GACnCA,uCAA0B,eAAe,CAAA,CAAA;AAsBpC,MAAM,aAAaC,sBAAM,CAAA,UAAA,CAAW,SAAS,eAAA,CAClD,OACA,GACA,EAAA;AACA,EAAM,MAAA,EAAE,MAAS,GAAA,KAAA,CAAA;AAEjB,EAAA,IAAI,IAAM,EAAA;AACR,IACE,uBAAAA,sBAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,KAAA;AAAA,QACA,GAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAAA,GAEG,MAAA;AACL,IAAA,MACE,EADM,GAAA,KAAA,EAAA,EAAA,WAAA,EAAa,UAAY,EAAA,QAAA,EAAU,oBA3D/C,EAAA,GA4DM,EADkE,EAAA,IAAA,GAAA,SAAA,CAClE,EADkE,EAAA,CAA5D,aAAa,EAAA,YAAA,EAAY,UAAU,EAAA,sBAAA,CAAA,CAAA,CAAA;AAE3C,IAAA,MAAM,IAAO,GAAA,WAAA,GAAc,QAAW,GAAA,UAAA,GAAa,OAAU,GAAA,QAAA,CAAA;AAE7D,IAAM,MAAA,WAAA,GAAcC,qBAAW,IAAM,EAAA;AAAA,MACnC,IAAA;AAAA,MACA,KAAO,EAAAC,oBAAA;AAAA,MACP,GAAA;AAAA,KACD,CAAA,CAAA;AAED,IACE,uBAAAF,sBAAA,CAAA,aAAA,CAACG,0BAAW,EAAA,cAAA,CAAA,EAAA,EAAA,WAAA,CAAA,EACT,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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,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 {};
|