@plasmicpkgs/react-aria 0.0.10 → 0.0.12

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.
Files changed (62) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/common.d.ts +2 -0
  3. package/dist/contexts.d.ts +1 -1
  4. package/dist/react-aria.esm.js +404 -203
  5. package/dist/react-aria.esm.js.map +1 -1
  6. package/dist/react-aria.js +403 -202
  7. package/dist/react-aria.js.map +1 -1
  8. package/dist/registerButton.d.ts +1 -0
  9. package/dist/registerForm.d.ts +9 -0
  10. package/dist/registerLabel.d.ts +2 -2
  11. package/dist/registerSwitch.d.ts +5 -0
  12. package/package.json +4 -4
  13. package/skinny/common-52c26d37.esm.js +52 -0
  14. package/skinny/common-52c26d37.esm.js.map +1 -0
  15. package/skinny/common-e74a9214.cjs.js +54 -0
  16. package/skinny/common-e74a9214.cjs.js.map +1 -0
  17. package/skinny/common.d.ts +2 -0
  18. package/skinny/{contexts-c0294d96.cjs.js → contexts-3e42cdf9.cjs.js} +2 -3
  19. package/skinny/{contexts-c0294d96.cjs.js.map → contexts-3e42cdf9.cjs.js.map} +1 -1
  20. package/skinny/{contexts-fd3e1077.esm.js → contexts-49f6c298.esm.js} +3 -3
  21. package/skinny/{contexts-fd3e1077.esm.js.map → contexts-49f6c298.esm.js.map} +1 -1
  22. package/skinny/contexts.d.ts +1 -1
  23. package/skinny/registerButton.cjs.js +20 -18
  24. package/skinny/registerButton.cjs.js.map +1 -1
  25. package/skinny/registerButton.d.ts +1 -0
  26. package/skinny/registerButton.esm.js +20 -18
  27. package/skinny/registerButton.esm.js.map +1 -1
  28. package/skinny/registerComboBox.cjs.js +1 -1
  29. package/skinny/registerComboBox.esm.js +1 -1
  30. package/skinny/registerFieldError.cjs.js +163 -0
  31. package/skinny/registerFieldError.cjs.js.map +1 -0
  32. package/skinny/registerFieldError.esm.js +156 -0
  33. package/skinny/registerFieldError.esm.js.map +1 -0
  34. package/skinny/registerForm.cjs.js +96 -0
  35. package/skinny/registerForm.cjs.js.map +1 -0
  36. package/skinny/registerForm.d.ts +9 -0
  37. package/skinny/registerForm.esm.js +89 -0
  38. package/skinny/registerForm.esm.js.map +1 -0
  39. package/skinny/registerHeader.cjs.js +1 -1
  40. package/skinny/registerHeader.esm.js +1 -1
  41. package/skinny/registerInput.cjs.js +1 -1
  42. package/skinny/registerInput.esm.js +1 -1
  43. package/skinny/registerLabel.cjs.js +5 -13
  44. package/skinny/registerLabel.cjs.js.map +1 -1
  45. package/skinny/registerLabel.d.ts +2 -2
  46. package/skinny/registerLabel.esm.js +4 -12
  47. package/skinny/registerLabel.esm.js.map +1 -1
  48. package/skinny/registerListBox.cjs.js +1 -1
  49. package/skinny/registerListBox.esm.js +1 -1
  50. package/skinny/registerListBoxItem.cjs.js +1 -1
  51. package/skinny/registerListBoxItem.esm.js +1 -1
  52. package/skinny/registerPopover.cjs.js +1 -1
  53. package/skinny/registerPopover.esm.js +1 -1
  54. package/skinny/registerSection.cjs.js +1 -1
  55. package/skinny/registerSection.esm.js +1 -1
  56. package/skinny/registerSelect.cjs.js +1 -1
  57. package/skinny/registerSelect.esm.js +1 -1
  58. package/skinny/registerSwitch.cjs.js +83 -0
  59. package/skinny/registerSwitch.cjs.js.map +1 -0
  60. package/skinny/registerSwitch.d.ts +5 -0
  61. package/skinny/registerSwitch.esm.js +80 -0
  62. package/skinny/registerSwitch.esm.js.map +1 -0
@@ -6,7 +6,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
6
 
7
7
  var React__default = /*#__PURE__*/_interopDefault(React);
8
8
 
9
- const PlasmicLabelContext = React__default.default.createContext(void 0);
9
+ React__default.default.createContext(void 0);
10
10
  const PlasmicListBoxContext = React__default.default.createContext(void 0);
11
11
  const PlasmicPopoverContext = React__default.default.createContext(void 0);
12
12
  const PlasmicItemContext = React__default.default.createContext(void 0);
@@ -17,8 +17,7 @@ const PlasmicInputContext = React__default.default.createContext(void 0);
17
17
  exports.PlasmicHeaderContext = PlasmicHeaderContext;
18
18
  exports.PlasmicInputContext = PlasmicInputContext;
19
19
  exports.PlasmicItemContext = PlasmicItemContext;
20
- exports.PlasmicLabelContext = PlasmicLabelContext;
21
20
  exports.PlasmicListBoxContext = PlasmicListBoxContext;
22
21
  exports.PlasmicPopoverContext = PlasmicPopoverContext;
23
22
  exports.PlasmicSectionContext = PlasmicSectionContext;
24
- //# sourceMappingURL=contexts-c0294d96.cjs.js.map
23
+ //# sourceMappingURL=contexts-3e42cdf9.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contexts-c0294d96.cjs.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport type { BaseListBoxItem } from \"./registerListBoxItem\";\nimport type { BasePopover } from \"./registerPopover\";\nimport type { BaseSection } from \"./registerSection\";\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\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n React.ComponentProps<typeof BaseListBoxItem> | 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":";;;;;;;;AAgBa,MAAA,mBAAA,GAAsBA,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;;;;;;;;;;"}
1
+ {"version":3,"file":"contexts-3e42cdf9.cjs.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport type { BaseListBoxItem } from \"./registerListBoxItem\";\nimport type { BasePopover } from \"./registerPopover\";\nimport type { BaseSection } from \"./registerSection\";\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\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n React.ComponentProps<typeof BaseListBoxItem> | 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":";;;;;;;;AAgBmCA,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;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- const PlasmicLabelContext = React.createContext(void 0);
3
+ React.createContext(void 0);
4
4
  const PlasmicListBoxContext = React.createContext(void 0);
5
5
  const PlasmicPopoverContext = React.createContext(void 0);
6
6
  const PlasmicItemContext = React.createContext(void 0);
@@ -8,5 +8,5 @@ const PlasmicSectionContext = React.createContext(void 0);
8
8
  const PlasmicHeaderContext = React.createContext(void 0);
9
9
  const PlasmicInputContext = React.createContext(void 0);
10
10
 
11
- export { PlasmicListBoxContext as P, PlasmicInputContext as a, PlasmicLabelContext as b, PlasmicSectionContext as c, PlasmicItemContext as d, PlasmicPopoverContext as e, PlasmicHeaderContext as f };
12
- //# sourceMappingURL=contexts-fd3e1077.esm.js.map
11
+ export { PlasmicListBoxContext as P, PlasmicInputContext as a, PlasmicSectionContext as b, PlasmicItemContext as c, PlasmicPopoverContext as d, PlasmicHeaderContext as e };
12
+ //# sourceMappingURL=contexts-49f6c298.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contexts-fd3e1077.esm.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport type { BaseListBoxItem } from \"./registerListBoxItem\";\nimport type { BasePopover } from \"./registerPopover\";\nimport type { BaseSection } from \"./registerSection\";\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\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n React.ComponentProps<typeof BaseListBoxItem> | 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":";;AAgBa,MAAA,mBAAA,GAAsB,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;;;;"}
1
+ {"version":3,"file":"contexts-49f6c298.esm.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport type { BaseListBoxItem } from \"./registerListBoxItem\";\nimport type { BasePopover } from \"./registerPopover\";\nimport type { BaseSection } from \"./registerSection\";\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\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicPopoverContext = React.createContext<\n React.ComponentProps<typeof BasePopover> | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n React.ComponentProps<typeof BaseListBoxItem> | 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":";;AAgBmC,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;;;;"}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import type { BaseListBoxProps } from "./registerListBox";
3
- export declare const PlasmicLabelContext: React.Context<(import("react-aria-components").LabelProps & React.RefAttributes<HTMLLabelElement>) | undefined>;
3
+ export declare const PlasmicLabelContext: React.Context<import("react-aria-components").LabelProps | undefined>;
4
4
  export declare const PlasmicListBoxContext: React.Context<BaseListBoxProps | undefined>;
5
5
  export declare const PlasmicPopoverContext: React.Context<{
6
6
  className?: string | undefined;
@@ -2,6 +2,7 @@
2
2
 
3
3
  var React = require('react');
4
4
  var reactAriaComponents = require('react-aria-components');
5
+ var common = require('./common-e74a9214.cjs.js');
5
6
  var utils = require('./utils-1190a0a9.cjs.js');
6
7
  require('@plasmicapp/host/registerComponent');
7
8
 
@@ -10,6 +11,8 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
11
  var React__default = /*#__PURE__*/_interopDefault(React);
11
12
 
12
13
  var __defProp = Object.defineProperty;
14
+ var __defProps = Object.defineProperties;
15
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
16
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
17
  var __hasOwnProp = Object.prototype.hasOwnProperty;
15
18
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -25,6 +28,7 @@ var __spreadValues = (a, b) => {
25
28
  }
26
29
  return a;
27
30
  };
31
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
32
  var __objRest = (source, exclude) => {
29
33
  var target = {};
30
34
  for (var prop in source)
@@ -38,8 +42,9 @@ var __objRest = (source, exclude) => {
38
42
  return target;
39
43
  };
40
44
  function BaseButton(props) {
41
- const _a = props, { submitsForm, onFocusVisibleChange, children } = _a, rest = __objRest(_a, ["submitsForm", "onFocusVisibleChange", "children"]);
42
- return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues({ type: submitsForm ? "submit" : "button" }, rest), ({ isFocusVisible }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
45
+ const _a = props, { submitsForm, onFocusVisibleChange, resetsForm, children } = _a, rest = __objRest(_a, ["submitsForm", "onFocusVisibleChange", "resetsForm", "children"]);
46
+ const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
47
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.Button, __spreadValues({ type }, rest), ({ isFocusVisible }) => /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, /* @__PURE__ */ React__default.default.createElement(
43
48
  utils.ValueObserver,
44
49
  {
45
50
  value: isFocusVisible,
@@ -56,28 +61,25 @@ function registerButton(loader, overrides) {
56
61
  displayName: "BaseButton",
57
62
  importPath: "@plasmicpkgs/react-aria/registerButton",
58
63
  importName: "BaseButton",
59
- props: {
60
- children: {
61
- type: "slot",
62
- mergeWithParent: true
63
- },
64
- isDisabled: {
65
- displayName: "Disabled",
66
- type: "boolean",
67
- description: "Whether the button is disabled",
68
- defaultValueHint: false
69
- },
64
+ props: __spreadProps(__spreadValues({}, common.getCommonInputProps("button", [
65
+ "isDisabled",
66
+ "aria-label",
67
+ "children"
68
+ ])), {
70
69
  submitsForm: {
71
70
  type: "boolean",
72
71
  displayName: "Submits form?",
73
72
  defaultValueHint: false,
73
+ hidden: (ps) => Boolean(ps.resetsForm),
74
74
  description: "Whether clicking this button should submit the enclosing form.",
75
75
  advanced: true
76
76
  },
77
- "aria-label": {
78
- type: "string",
79
- displayName: "Aria Label",
80
- description: "Label for this button, if no visible label is used (e.g. an icon only button)",
77
+ resetsForm: {
78
+ type: "boolean",
79
+ displayName: "Resets form?",
80
+ defaultValueHint: false,
81
+ hidden: (ps) => Boolean(ps.submitsForm),
82
+ description: "Whether clicking this button should reset the enclosing form.",
81
83
  advanced: true
82
84
  },
83
85
  onPress: {
@@ -100,7 +102,7 @@ function registerButton(loader, overrides) {
100
102
  type: "eventHandler",
101
103
  argTypes: [{ name: "isFocusVisible", type: "boolean" }]
102
104
  }
103
- },
105
+ }),
104
106
  states: {
105
107
  isHovered: {
106
108
  type: "readonly",
@@ -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 {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseButtonProps extends ButtonProps {\n submitsForm?: boolean;\n onFocusVisibleChange?: (isFocusVisible: boolean) => void;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const { submitsForm, onFocusVisibleChange, children, ...rest } = props;\n\n return (\n <Button type={submitsForm ? \"submit\" : \"button\"} {...rest}>\n {({ isFocusVisible }) => (\n <>\n <ValueObserver\n value={isFocusVisible}\n onChange={onFocusVisibleChange}\n />\n {children}\n </>\n )}\n </Button>\n );\n}\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: makeComponentName(\"button\"),\n displayName: \"BaseButton\",\n importPath: \"@plasmicpkgs/react-aria/registerButton\",\n importName: \"BaseButton\",\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n },\n isDisabled: {\n displayName: \"Disabled\",\n type: \"boolean\",\n description: \"Whether the button is disabled\",\n defaultValueHint: false,\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n \"aria-label\": {\n type: \"string\",\n displayName: \"Aria Label\",\n description:\n \"Label for this button, if no visible label is used (e.g. an icon only button)\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovered\", type: \"boolean\" }],\n },\n onPressChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isPressed\", type: \"boolean\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onFocusVisibleChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocusVisible\", type: \"boolean\" }],\n },\n },\n states: {\n isHovered: {\n type: \"readonly\",\n onChangeProp: \"onHoverChange\",\n variableType: \"boolean\",\n },\n isPressed: {\n type: \"readonly\",\n onChangeProp: \"onPressChange\",\n variableType: \"boolean\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isFocusVisible: {\n type: \"readonly\",\n onChangeProp: \"onFocusVisibleChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["React","Button","ValueObserver","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAiE,MAAA,EAAA,GAAA,KAAA,EAAzD,EAAa,WAAA,EAAA,oBAAA,E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A;AAAA,SAChB;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,sBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;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 React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseButtonProps extends ButtonProps {\n resetsForm?: boolean;\n submitsForm?: boolean;\n onFocusVisibleChange?: (isFocusVisible: boolean) => void;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const { submitsForm, onFocusVisibleChange, resetsForm, children, ...rest } =\n props;\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n return (\n <Button type={type} {...rest}>\n {({ isFocusVisible }) => (\n <>\n <ValueObserver\n value={isFocusVisible}\n onChange={onFocusVisibleChange}\n />\n {children}\n </>\n )}\n </Button>\n );\n}\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: makeComponentName(\"button\"),\n displayName: \"BaseButton\",\n importPath: \"@plasmicpkgs/react-aria/registerButton\",\n importName: \"BaseButton\",\n props: {\n ...getCommonInputProps<BaseButtonProps>(\"button\", [\n \"isDisabled\",\n \"aria-label\",\n \"children\",\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 onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovered\", type: \"boolean\" }],\n },\n onPressChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isPressed\", type: \"boolean\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onFocusVisibleChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocusVisible\", type: \"boolean\" }],\n },\n },\n states: {\n isHovered: {\n type: \"readonly\",\n onChangeProp: \"onHoverChange\",\n variableType: \"boolean\",\n },\n isPressed: {\n type: \"readonly\",\n onChangeProp: \"onPressChange\",\n variableType: \"boolean\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isFocusVisible: {\n type: \"readonly\",\n onChangeProp: \"onFocusVisibleChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["React","Button","ValueObserver","registerComponentHelper","makeComponentName","getCommonInputProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MACE,EADM,GAAA,KAAA,EAAA,EAAA,WAAA,EAAa,oBAAsB,EAAA,UAAA,EAAY,QAnBzD,EAAA,GAoBI,EADkE,EAAA,IAAA,GAAA,SAAA,CAClE,EADkE,EAAA,CAA5D,aAAa,EAAA,sBAAA,EAAsB,YAAY,EAAA,UAAA,CAAA,CAAA,CAAA;AAEvD,EAAA,MAAM,IAAO,GAAA,WAAA,GAAc,QAAW,GAAA,UAAA,GAAa,O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A,sBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;"}
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import type { ButtonProps } from "react-aria-components";
3
3
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
4
4
  interface BaseButtonProps extends ButtonProps {
5
+ resetsForm?: boolean;
5
6
  submitsForm?: boolean;
6
7
  onFocusVisibleChange?: (isFocusVisible: boolean) => void;
7
8
  }
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Button } from 'react-aria-components';
3
+ import { g as getCommonInputProps } from './common-52c26d37.esm.js';
3
4
  import { V as ValueObserver, r as registerComponentHelper, m as makeComponentName } from './utils-28f98072.esm.js';
4
5
  import '@plasmicapp/host/registerComponent';
5
6
 
6
7
  var __defProp = Object.defineProperty;
8
+ var __defProps = Object.defineProperties;
9
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
10
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
11
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
12
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -19,6 +22,7 @@ var __spreadValues = (a, b) => {
19
22
  }
20
23
  return a;
21
24
  };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
26
  var __objRest = (source, exclude) => {
23
27
  var target = {};
24
28
  for (var prop in source)
@@ -32,8 +36,9 @@ var __objRest = (source, exclude) => {
32
36
  return target;
33
37
  };
34
38
  function BaseButton(props) {
35
- const _a = props, { submitsForm, onFocusVisibleChange, children } = _a, rest = __objRest(_a, ["submitsForm", "onFocusVisibleChange", "children"]);
36
- return /* @__PURE__ */ React.createElement(Button, __spreadValues({ type: submitsForm ? "submit" : "button" }, rest), ({ isFocusVisible }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
39
+ const _a = props, { submitsForm, onFocusVisibleChange, resetsForm, children } = _a, rest = __objRest(_a, ["submitsForm", "onFocusVisibleChange", "resetsForm", "children"]);
40
+ const type = submitsForm ? "submit" : resetsForm ? "reset" : "button";
41
+ return /* @__PURE__ */ React.createElement(Button, __spreadValues({ type }, rest), ({ isFocusVisible }) => /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
37
42
  ValueObserver,
38
43
  {
39
44
  value: isFocusVisible,
@@ -50,28 +55,25 @@ function registerButton(loader, overrides) {
50
55
  displayName: "BaseButton",
51
56
  importPath: "@plasmicpkgs/react-aria/registerButton",
52
57
  importName: "BaseButton",
53
- props: {
54
- children: {
55
- type: "slot",
56
- mergeWithParent: true
57
- },
58
- isDisabled: {
59
- displayName: "Disabled",
60
- type: "boolean",
61
- description: "Whether the button is disabled",
62
- defaultValueHint: false
63
- },
58
+ props: __spreadProps(__spreadValues({}, getCommonInputProps("button", [
59
+ "isDisabled",
60
+ "aria-label",
61
+ "children"
62
+ ])), {
64
63
  submitsForm: {
65
64
  type: "boolean",
66
65
  displayName: "Submits form?",
67
66
  defaultValueHint: false,
67
+ hidden: (ps) => Boolean(ps.resetsForm),
68
68
  description: "Whether clicking this button should submit the enclosing form.",
69
69
  advanced: true
70
70
  },
71
- "aria-label": {
72
- type: "string",
73
- displayName: "Aria Label",
74
- description: "Label for this button, if no visible label is used (e.g. an icon only button)",
71
+ resetsForm: {
72
+ type: "boolean",
73
+ displayName: "Resets form?",
74
+ defaultValueHint: false,
75
+ hidden: (ps) => Boolean(ps.submitsForm),
76
+ description: "Whether clicking this button should reset the enclosing form.",
75
77
  advanced: true
76
78
  },
77
79
  onPress: {
@@ -94,7 +96,7 @@ function registerButton(loader, overrides) {
94
96
  type: "eventHandler",
95
97
  argTypes: [{ name: "isFocusVisible", type: "boolean" }]
96
98
  }
97
- },
99
+ }),
98
100
  states: {
99
101
  isHovered: {
100
102
  type: "readonly",
@@ -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 {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseButtonProps extends ButtonProps {\n submitsForm?: boolean;\n onFocusVisibleChange?: (isFocusVisible: boolean) => void;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const { submitsForm, onFocusVisibleChange, children, ...rest } = props;\n\n return (\n <Button type={submitsForm ? \"submit\" : \"button\"} {...rest}>\n {({ isFocusVisible }) => (\n <>\n <ValueObserver\n value={isFocusVisible}\n onChange={onFocusVisibleChange}\n />\n {children}\n </>\n )}\n </Button>\n );\n}\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: makeComponentName(\"button\"),\n displayName: \"BaseButton\",\n importPath: \"@plasmicpkgs/react-aria/registerButton\",\n importName: \"BaseButton\",\n props: {\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n },\n isDisabled: {\n displayName: \"Disabled\",\n type: \"boolean\",\n description: \"Whether the button is disabled\",\n defaultValueHint: false,\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n \"aria-label\": {\n type: \"string\",\n displayName: \"Aria Label\",\n description:\n \"Label for this button, if no visible label is used (e.g. an icon only button)\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovered\", type: \"boolean\" }],\n },\n onPressChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isPressed\", type: \"boolean\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onFocusVisibleChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocusVisible\", type: \"boolean\" }],\n },\n },\n states: {\n isHovered: {\n type: \"readonly\",\n onChangeProp: \"onHoverChange\",\n variableType: \"boolean\",\n },\n isPressed: {\n type: \"readonly\",\n onChangeProp: \"onPressChange\",\n variableType: \"boolean\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isFocusVisible: {\n type: \"readonly\",\n onChangeProp: \"onFocusVisibleChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAiE,MAAA,EAAA,GAAA,KAAA,EAAzD,EAAa,WAAA,EAAA,oBAAA,EAAsB,QAjB7C,EAAA,GAiBmE,IAAT,IAAS,GAAA,SAAA,CAAA,EAAA,EAAT,CAAhD,aAAA,EAAa,sBAAsB,EAAA,UAAA,CAAA,CAAA,CAAA;AAE3C,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,MAAO,EAAA,cAAA,CAAA,EAAA,IAAA,EAAM,WAAc,GAAA,QAAA,GAAW,QAAc,EAAA,EAAA,IAAA,CAAA,EAClD,CAAC,EAAE,cAAe,EAAA,qBAEf,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,cAAA;AAAA,MACP,QAAU,EAAA,oBAAA;AAAA,KAAA;AAAA,GACZ,EACC,QACH,CAEJ,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,cAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,UAAA;AAAA,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MAAM,WAAa,EAAA,IAAA,EAAM,WAAW,CAAA;AAAA,SACnD;AAAA,QACA,oBAAsB,EAAA;AAAA,UACpB,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,gBAAkB,EAAA,IAAA,EAAM,WAAW,CAAA;AAAA,SACxD;AAAA,OACF;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,sBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"registerButton.esm.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n ValueObserver,\n} from \"./utils\";\n\ninterface BaseButtonProps extends ButtonProps {\n resetsForm?: boolean;\n submitsForm?: boolean;\n onFocusVisibleChange?: (isFocusVisible: boolean) => void;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const { submitsForm, onFocusVisibleChange, resetsForm, children, ...rest } =\n props;\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n return (\n <Button type={type} {...rest}>\n {({ isFocusVisible }) => (\n <>\n <ValueObserver\n value={isFocusVisible}\n onChange={onFocusVisibleChange}\n />\n {children}\n </>\n )}\n </Button>\n );\n}\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: makeComponentName(\"button\"),\n displayName: \"BaseButton\",\n importPath: \"@plasmicpkgs/react-aria/registerButton\",\n importName: \"BaseButton\",\n props: {\n ...getCommonInputProps<BaseButtonProps>(\"button\", [\n \"isDisabled\",\n \"aria-label\",\n \"children\",\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 onHoverChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isHovered\", type: \"boolean\" }],\n },\n onPressChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isPressed\", type: \"boolean\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onFocusVisibleChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocusVisible\", type: \"boolean\" }],\n },\n },\n states: {\n isHovered: {\n type: \"readonly\",\n onChangeProp: \"onHoverChange\",\n variableType: \"boolean\",\n },\n isPressed: {\n type: \"readonly\",\n onChangeProp: \"onPressChange\",\n variableType: \"boolean\",\n },\n isFocused: {\n type: \"readonly\",\n onChangeProp: \"onFocusChange\",\n variableType: \"boolean\",\n },\n isFocusVisible: {\n type: \"readonly\",\n onChangeProp: \"onFocusVisibleChange\",\n variableType: \"boolean\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MACE,EADM,GAAA,KAAA,EAAA,EAAA,WAAA,EAAa,oBAAsB,EAAA,UAAA,EAAY,QAnBzD,EAAA,GAoBI,EADkE,EAAA,IAAA,GAAA,SAAA,CAClE,EADkE,EAAA,CAA5D,aAAa,EAAA,sBAAA,EAAsB,YAAY,EAAA,UAAA,CAAA,CAAA,CAAA;AAEvD,EAAA,MAAM,IAAO,GAAA,WAAA,GAAc,QAAW,GAAA,UAAA,GAAa,OAAU,GAAA,QAAA,CAAA;AAC7D,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,yBAAO,IAAgB,EAAA,EAAA,IAAA,CAAA,EACrB,CAAC,EAAE,cAAA,uBAEA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,cAAA;AAAA,MACP,QAAU,EAAA,oBAAA;AAAA,KAAA;AAAA,GACZ,EACC,QACH,CAEJ,CAAA,CAAA;AAEJ,CAAA;AAEgB,SAAA,cAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,kBAAkB,QAAQ,CAAA;AAAA,MAChC,WAAa,EAAA,YAAA;AAAA,MACb,UAAY,EAAA,wCAAA;AAAA,MACZ,UAAY,EAAA,YAAA;AAAA,MACZ,KAAA,EAAO,aACF,CAAA,cAAA,CAAA,EAAA,EAAA,mBAAA,CAAqC,QAAU,EAAA;AAAA,QAChD,Y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A,EAAM,WAAW,CAAA;AAAA,SACxD;AAAA,OACF,CAAA;AAAA,MACA,MAAQ,EAAA;AAAA,QACN,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,SAAW,EAAA;AAAA,UACT,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,eAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,QACA,cAAgB,EAAA;AAAA,UACd,IAAM,EAAA,UAAA;AAAA,UACN,YAAc,EAAA,sBAAA;AAAA,UACd,YAAc,EAAA,SAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;"}
@@ -3,7 +3,7 @@
3
3
  var i18n = require('@react-aria/i18n');
4
4
  var React = require('react');
5
5
  var reactAriaComponents = require('react-aria-components');
6
- var contexts = require('./contexts-c0294d96.cjs.js');
6
+ var contexts = require('./contexts-3e42cdf9.cjs.js');
7
7
  var optionUtils = require('./option-utils-0db61f6d.cjs.js');
8
8
  var utils = require('./utils-1190a0a9.cjs.js');
9
9
  require('@plasmicapp/host/registerComponent');
@@ -1,7 +1,7 @@
1
1
  import { useFilter } from '@react-aria/i18n';
2
2
  import React from 'react';
3
3
  import { ComboBox, ComboBoxStateContext } from 'react-aria-components';
4
- import { P as PlasmicListBoxContext, a as PlasmicInputContext } from './contexts-fd3e1077.esm.js';
4
+ import { P as PlasmicListBoxContext, a as PlasmicInputContext } from './contexts-49f6c298.esm.js';
5
5
  import { u as useStrictOptions, f as flattenOptions, m as makeOptionsPropType, a as makeValuePropType } from './option-utils-765a1782.esm.js';
6
6
  import { e as extractPlasmicDataProps, r as registerComponentHelper, w as withoutNils, m as makeComponentName } from './utils-28f98072.esm.js';
7
7
  import '@plasmicapp/host/registerComponent';
@@ -0,0 +1,163 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var reactAriaComponents = require('react-aria-components');
5
+ var utils = require('./utils-1190a0a9.cjs.js');
6
+ require('@plasmicapp/host/registerComponent');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var React__default = /*#__PURE__*/_interopDefault(React);
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
16
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
+ var __spreadValues = (a, b) => {
18
+ for (var prop in b || (b = {}))
19
+ if (__hasOwnProp.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ if (__getOwnPropSymbols)
22
+ for (var prop of __getOwnPropSymbols(b)) {
23
+ if (__propIsEnum.call(b, prop))
24
+ __defNormalProp(a, prop, b[prop]);
25
+ }
26
+ return a;
27
+ };
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
40
+ function BaseFieldError(_a) {
41
+ var _b = _a, {
42
+ badInput,
43
+ customError,
44
+ patternMismatch,
45
+ rangeOverflow,
46
+ rangeUnderflow,
47
+ stepMismatch,
48
+ tooLong,
49
+ tooShort,
50
+ typeMismatch,
51
+ valueMissing
52
+ } = _b, rest = __objRest(_b, [
53
+ "badInput",
54
+ "customError",
55
+ "patternMismatch",
56
+ "rangeOverflow",
57
+ "rangeUnderflow",
58
+ "stepMismatch",
59
+ "tooLong",
60
+ "tooShort",
61
+ "typeMismatch",
62
+ "valueMissing"
63
+ ]);
64
+ return /* @__PURE__ */ React__default.default.createElement(reactAriaComponents.FieldError, __spreadValues({}, rest), ({ validationDetails, validationErrors }) => {
65
+ if (validationDetails.badInput && badInput)
66
+ return badInput;
67
+ if (validationDetails.customError && customError)
68
+ return customError;
69
+ if (validationDetails.patternMismatch && patternMismatch)
70
+ return patternMismatch;
71
+ if (validationDetails.rangeOverflow && rangeOverflow)
72
+ return rangeOverflow;
73
+ if (validationDetails.rangeUnderflow && rangeUnderflow)
74
+ return rangeUnderflow;
75
+ if (validationDetails.stepMismatch && stepMismatch)
76
+ return stepMismatch;
77
+ if (validationDetails.tooLong && tooLong)
78
+ return tooLong;
79
+ if (validationDetails.tooShort && tooShort)
80
+ return tooShort;
81
+ if (validationDetails.typeMismatch && typeMismatch)
82
+ return typeMismatch;
83
+ if (validationDetails.valueMissing && valueMissing)
84
+ return valueMissing;
85
+ return validationErrors;
86
+ });
87
+ }
88
+ function PropsDescription() {
89
+ return /* @__PURE__ */ React__default.default.createElement("div", { style: { marginBottom: 20 } }, /* @__PURE__ */ React__default.default.createElement("p", null, "You can customize the error messages for built-in validations by utilizing the props below."), /* @__PURE__ */ React__default.default.createElement("p", null, "For further information on the specific conditions triggering each error, please refer to the", " ", /* @__PURE__ */ React__default.default.createElement(
90
+ "a",
91
+ {
92
+ target: "_blank",
93
+ href: "https://developer.mozilla.org/en-US/docs/Web/API/ValidityState#instance_properties"
94
+ },
95
+ "MDN Docs"
96
+ ), "."));
97
+ }
98
+ function registerFieldError(loader, overrides) {
99
+ utils.registerComponentHelper(
100
+ loader,
101
+ BaseFieldError,
102
+ {
103
+ name: utils.makeComponentName("fielderror"),
104
+ displayName: "BaseFieldError",
105
+ importPath: "@plasmicpkgs/react-aria/registerFieldError",
106
+ importName: "BaseFieldError",
107
+ actions: [
108
+ {
109
+ type: "custom-action",
110
+ control: PropsDescription
111
+ }
112
+ ],
113
+ props: {
114
+ badInput: {
115
+ type: "string",
116
+ description: "Error message if the user has provided input that the browser is unable to convert"
117
+ },
118
+ customError: {
119
+ type: "string",
120
+ description: "Error message for custom validations"
121
+ },
122
+ patternMismatch: {
123
+ type: "string",
124
+ description: "Error message if the value does not match the specified pattern"
125
+ },
126
+ rangeOverflow: {
127
+ type: "string",
128
+ description: "Error message if the value is greater than the maximum specified"
129
+ },
130
+ rangeUnderflow: {
131
+ type: "string",
132
+ description: "Error message if the value is less than the minimum specified"
133
+ },
134
+ stepMismatch: {
135
+ type: "string",
136
+ description: "Error message if the value is not evenly divisible by the step value"
137
+ },
138
+ tooLong: {
139
+ type: "string",
140
+ description: "Error message if the value exceeds the specified maximum number of characters"
141
+ },
142
+ tooShort: {
143
+ type: "string",
144
+ description: "Error message if the value fails to meet the specified minimum number of characters"
145
+ },
146
+ typeMismatch: {
147
+ type: "string",
148
+ description: "Error message if the value is not in the required syntax (when type is email or url)"
149
+ },
150
+ valueMissing: {
151
+ type: "string",
152
+ description: "Error message if a required field has no value"
153
+ }
154
+ },
155
+ trapsFocus: true
156
+ },
157
+ overrides
158
+ );
159
+ }
160
+
161
+ exports.BaseFieldError = BaseFieldError;
162
+ exports.registerFieldError = registerFieldError;
163
+ //# sourceMappingURL=registerFieldError.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerFieldError.cjs.js","sources":["../src/registerFieldError.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FieldErrorProps } from \"react-aria-components\";\nimport { FieldError } from \"react-aria-components\";\nimport {\n CodeComponentMetaOverrides,\n makeComponentName,\n Registerable,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseFieldErrorProps extends FieldErrorProps {\n useBuiltInValidation: boolean;\n badInput?: string;\n customError?: string;\n patternMismatch?: string;\n rangeOverflow?: string;\n rangeUnderflow?: string;\n stepMismatch?: string;\n tooLong?: string;\n tooShort?: string;\n typeMismatch?: string;\n valueMissing?: string;\n}\n\nexport function BaseFieldError({\n badInput,\n customError,\n patternMismatch,\n rangeOverflow,\n rangeUnderflow,\n stepMismatch,\n tooLong,\n tooShort,\n typeMismatch,\n valueMissing,\n ...rest\n}: BaseFieldErrorProps) {\n return (\n <FieldError {...rest}>\n {({ validationDetails, validationErrors }) => {\n if (validationDetails.badInput && badInput) return badInput;\n if (validationDetails.customError && customError) return customError;\n if (validationDetails.patternMismatch && patternMismatch)\n return patternMismatch;\n if (validationDetails.rangeOverflow && rangeOverflow)\n return rangeOverflow;\n if (validationDetails.rangeUnderflow && rangeUnderflow)\n return rangeUnderflow;\n if (validationDetails.stepMismatch && stepMismatch) return stepMismatch;\n if (validationDetails.tooLong && tooLong) return tooLong;\n if (validationDetails.tooShort && tooShort) return tooShort;\n if (validationDetails.typeMismatch && typeMismatch) return typeMismatch;\n if (validationDetails.valueMissing && valueMissing) return valueMissing;\n return validationErrors;\n }}\n </FieldError>\n );\n}\n\nfunction PropsDescription() {\n return (\n <div style={{ marginBottom: 20 }}>\n <p>\n You can customize the error messages for built-in validations by\n utilizing the props below.\n </p>\n <p>\n For further information on the specific conditions triggering each\n error, please refer to the{\" \"}\n <a\n target=\"_blank\"\n href=\"https://developer.mozilla.org/en-US/docs/Web/API/ValidityState#instance_properties\"\n >\n MDN Docs\n </a>\n .\n </p>\n </div>\n );\n}\n\nexport function registerFieldError(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseFieldError>\n) {\n registerComponentHelper(\n loader,\n BaseFieldError,\n {\n name: makeComponentName(\"fielderror\"),\n displayName: \"BaseFieldError\",\n importPath: \"@plasmicpkgs/react-aria/registerFieldError\",\n importName: \"BaseFieldError\",\n actions: [\n {\n type: \"custom-action\",\n control: PropsDescription,\n },\n ],\n props: {\n badInput: {\n type: \"string\",\n description:\n \"Error message if the user has provided input that the browser is unable to convert\",\n },\n customError: {\n type: \"string\",\n description: \"Error message for custom validations\",\n },\n patternMismatch: {\n type: \"string\",\n description:\n \"Error message if the value does not match the specified pattern\",\n },\n rangeOverflow: {\n type: \"string\",\n description:\n \"Error message if the value is greater than the maximum specified\",\n },\n rangeUnderflow: {\n type: \"string\",\n description:\n \"Error message if the value is less than the minimum specified\",\n },\n stepMismatch: {\n type: \"string\",\n description:\n \"Error message if the value is not evenly divisible by the step value\",\n },\n tooLong: {\n type: \"string\",\n description:\n \"Error message if the value exceeds the specified maximum number of characters\",\n },\n tooShort: {\n type: \"string\",\n description:\n \"Error message if the value fails to meet the specified minimum number of characters\",\n },\n typeMismatch: {\n type: \"string\",\n description:\n \"Error message if the value is not in the required syntax (when type is email or url)\",\n },\n valueMissing: {\n type: \"string\",\n description: \"Error message if a required field has no value\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["FieldError","React","registerComponentHelper","makeComponentName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,SAAS,eAAe,EAYP,EAAA;AAZO,EAC7B,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,QAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,aAAA;AAAA,IACA,cAAA;AAAA,IACA,YAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA,YAAA;AAAA,GAlCF,GAwB+B,EAW1B,EAAA,IAAA,GAAA,SAAA,CAX0B,EAW1B,EAAA;AAAA,IAVH,UAAA;AAAA,IACA,aAAA;AAAA,IACA,iBAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,cAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,GAAA,CAAA,CAAA;AAGA,EAAA,4DACGA,8BAAe,EAAA,cAAA,CAAA,EAAA,EAAA,IAAA,C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