@plasmicpkgs/react-aria 0.0.42 → 0.0.44

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 (146) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/common.d.ts +8 -1
  3. package/dist/contexts.d.ts +3 -2
  4. package/dist/react-aria.esm.js +863 -670
  5. package/dist/react-aria.esm.js.map +1 -1
  6. package/dist/react-aria.js +861 -668
  7. package/dist/react-aria.js.map +1 -1
  8. package/dist/registerButton.d.ts +1 -1
  9. package/dist/registerCheckbox.d.ts +3 -4
  10. package/dist/registerCheckboxGroup.d.ts +2 -2
  11. package/dist/registerInput.d.ts +12 -5
  12. package/dist/registerListBox.d.ts +2 -3
  13. package/dist/registerModal.d.ts +2 -3
  14. package/dist/registerPopover.d.ts +4 -6
  15. package/dist/registerRadio.d.ts +3 -5
  16. package/dist/registerRadioGroup.d.ts +1 -1
  17. package/dist/registerSlider.d.ts +3 -20
  18. package/dist/registerSliderOutput.d.ts +1 -1
  19. package/dist/registerSliderThumb.d.ts +3 -3
  20. package/dist/registerSliderTrack.d.ts +3 -1
  21. package/dist/registerSwitch.d.ts +1 -1
  22. package/dist/registerTextArea.d.ts +11 -5
  23. package/dist/registerTextField.d.ts +3 -3
  24. package/dist/utils.d.ts +7 -1
  25. package/package.json +2 -2
  26. package/skinny/common-96be13c3.esm.js +341 -0
  27. package/skinny/common-96be13c3.esm.js.map +1 -0
  28. package/skinny/common-f51484c1.cjs.js +345 -0
  29. package/skinny/common-f51484c1.cjs.js.map +1 -0
  30. package/skinny/common.d.ts +8 -1
  31. package/skinny/{contexts-7236059e.cjs.js → contexts-3a98471a.cjs.js} +1 -3
  32. package/skinny/contexts-3a98471a.cjs.js.map +1 -0
  33. package/skinny/{contexts-21e0d928.esm.js → contexts-87c261f6.esm.js} +2 -3
  34. package/skinny/contexts-87c261f6.esm.js.map +1 -0
  35. package/skinny/contexts.d.ts +3 -2
  36. package/skinny/registerButton.cjs.js +2 -2
  37. package/skinny/registerButton.cjs.js.map +1 -1
  38. package/skinny/registerButton.d.ts +1 -1
  39. package/skinny/registerButton.esm.js +2 -2
  40. package/skinny/registerButton.esm.js.map +1 -1
  41. package/skinny/registerCheckbox.cjs.js +13 -18
  42. package/skinny/registerCheckbox.cjs.js.map +1 -1
  43. package/skinny/registerCheckbox.d.ts +3 -4
  44. package/skinny/registerCheckbox.esm.js +13 -18
  45. package/skinny/registerCheckbox.esm.js.map +1 -1
  46. package/skinny/registerCheckboxGroup.cjs.js +5 -5
  47. package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
  48. package/skinny/registerCheckboxGroup.d.ts +2 -2
  49. package/skinny/registerCheckboxGroup.esm.js +5 -5
  50. package/skinny/registerCheckboxGroup.esm.js.map +1 -1
  51. package/skinny/registerComboBox.cjs.js +3 -3
  52. package/skinny/registerComboBox.esm.js +3 -3
  53. package/skinny/registerDialogTrigger.cjs.js +2 -2
  54. package/skinny/registerDialogTrigger.esm.js +2 -2
  55. package/skinny/registerHeader.cjs.js +1 -1
  56. package/skinny/registerHeader.esm.js +1 -1
  57. package/skinny/registerInput.cjs.js +76 -16
  58. package/skinny/registerInput.cjs.js.map +1 -1
  59. package/skinny/registerInput.d.ts +12 -5
  60. package/skinny/registerInput.esm.js +76 -17
  61. package/skinny/registerInput.esm.js.map +1 -1
  62. package/skinny/{registerListBox-f060da58.cjs.js → registerListBox-44316bb6.cjs.js} +7 -7
  63. package/skinny/registerListBox-44316bb6.cjs.js.map +1 -0
  64. package/skinny/{registerListBox-38a08460.esm.js → registerListBox-ccd14a2e.esm.js} +7 -7
  65. package/skinny/registerListBox-ccd14a2e.esm.js.map +1 -0
  66. package/skinny/registerListBox.cjs.js +3 -2
  67. package/skinny/registerListBox.cjs.js.map +1 -1
  68. package/skinny/registerListBox.d.ts +2 -3
  69. package/skinny/registerListBox.esm.js +3 -2
  70. package/skinny/registerListBox.esm.js.map +1 -1
  71. package/skinny/registerListBoxItem.cjs.js +1 -1
  72. package/skinny/registerListBoxItem.esm.js +1 -1
  73. package/skinny/registerModal.cjs.js +5 -4
  74. package/skinny/registerModal.cjs.js.map +1 -1
  75. package/skinny/registerModal.d.ts +2 -3
  76. package/skinny/registerModal.esm.js +5 -4
  77. package/skinny/registerModal.esm.js.map +1 -1
  78. package/skinny/registerPopover.cjs.js +23 -24
  79. package/skinny/registerPopover.cjs.js.map +1 -1
  80. package/skinny/registerPopover.d.ts +4 -6
  81. package/skinny/registerPopover.esm.js +24 -25
  82. package/skinny/registerPopover.esm.js.map +1 -1
  83. package/skinny/registerRadio.cjs.js +14 -26
  84. package/skinny/registerRadio.cjs.js.map +1 -1
  85. package/skinny/registerRadio.d.ts +3 -5
  86. package/skinny/registerRadio.esm.js +14 -26
  87. package/skinny/registerRadio.esm.js.map +1 -1
  88. package/skinny/registerRadioGroup.cjs.js +4 -4
  89. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  90. package/skinny/registerRadioGroup.d.ts +1 -1
  91. package/skinny/registerRadioGroup.esm.js +4 -4
  92. package/skinny/registerRadioGroup.esm.js.map +1 -1
  93. package/skinny/registerSection.cjs.js +1 -1
  94. package/skinny/registerSection.esm.js +1 -1
  95. package/skinny/registerSelect.cjs.js +3 -3
  96. package/skinny/registerSelect.esm.js +3 -3
  97. package/skinny/registerSlider.cjs.js +305 -15
  98. package/skinny/registerSlider.cjs.js.map +1 -1
  99. package/skinny/registerSlider.d.ts +3 -20
  100. package/skinny/registerSlider.esm.js +303 -11
  101. package/skinny/registerSlider.esm.js.map +1 -1
  102. package/skinny/registerSliderOutput.cjs.js +1 -1
  103. package/skinny/registerSliderOutput.cjs.js.map +1 -1
  104. package/skinny/registerSliderOutput.d.ts +1 -1
  105. package/skinny/registerSliderOutput.esm.js +1 -1
  106. package/skinny/registerSliderOutput.esm.js.map +1 -1
  107. package/skinny/registerSliderThumb.cjs.js +4 -4
  108. package/skinny/registerSliderThumb.cjs.js.map +1 -1
  109. package/skinny/registerSliderThumb.d.ts +3 -3
  110. package/skinny/registerSliderThumb.esm.js +4 -4
  111. package/skinny/registerSliderThumb.esm.js.map +1 -1
  112. package/skinny/registerSliderTrack.cjs.js +188 -16
  113. package/skinny/registerSliderTrack.cjs.js.map +1 -1
  114. package/skinny/registerSliderTrack.d.ts +3 -1
  115. package/skinny/registerSliderTrack.esm.js +184 -13
  116. package/skinny/registerSliderTrack.esm.js.map +1 -1
  117. package/skinny/registerSwitch.cjs.js +10 -4
  118. package/skinny/registerSwitch.cjs.js.map +1 -1
  119. package/skinny/registerSwitch.d.ts +1 -1
  120. package/skinny/registerSwitch.esm.js +10 -4
  121. package/skinny/registerSwitch.esm.js.map +1 -1
  122. package/skinny/registerTextArea.cjs.js +56 -35
  123. package/skinny/registerTextArea.cjs.js.map +1 -1
  124. package/skinny/registerTextArea.d.ts +11 -5
  125. package/skinny/registerTextArea.esm.js +56 -36
  126. package/skinny/registerTextArea.esm.js.map +1 -1
  127. package/skinny/registerTextField.cjs.js +34 -215
  128. package/skinny/registerTextField.cjs.js.map +1 -1
  129. package/skinny/registerTextField.d.ts +3 -3
  130. package/skinny/registerTextField.esm.js +34 -215
  131. package/skinny/registerTextField.esm.js.map +1 -1
  132. package/skinny/utils-a1785802.esm.js.map +1 -1
  133. package/skinny/utils-d3708034.cjs.js.map +1 -1
  134. package/skinny/utils.d.ts +7 -1
  135. package/skinny/common-52c26d37.esm.js +0 -52
  136. package/skinny/common-52c26d37.esm.js.map +0 -1
  137. package/skinny/common-e74a9214.cjs.js +0 -54
  138. package/skinny/common-e74a9214.cjs.js.map +0 -1
  139. package/skinny/contexts-21e0d928.esm.js.map +0 -1
  140. package/skinny/contexts-7236059e.cjs.js.map +0 -1
  141. package/skinny/registerListBox-38a08460.esm.js.map +0 -1
  142. package/skinny/registerListBox-f060da58.cjs.js.map +0 -1
  143. package/skinny/registerSlider-58ef7e20.cjs.js +0 -473
  144. package/skinny/registerSlider-58ef7e20.cjs.js.map +0 -1
  145. package/skinny/registerSlider-d74e2330.esm.js +0 -460
  146. package/skinny/registerSlider-d74e2330.esm.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-96be13c3.esm.js","sources":["../src/common.ts"],"sourcesContent":["import { PropType } from \"@plasmicapp/host\";\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 hidden: hasParent,\n advanced: true,\n };\n}\n\nfunction createDisabledProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Disabled\",\n type: \"boolean\",\n description: `Whether the ${componentName} is read-only and unfocusable`,\n defaultValueHint: false,\n hidden: isParentDisabled,\n };\n}\n\nfunction createReadOnlyProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Read only\",\n type: \"boolean\",\n description: `Whether the value of this ${componentName} can be changed by the user. Unlike disabled, read-only does not prevent the user from interacting with the component (such as focus).`,\n defaultValueHint: false,\n advanced: true,\n hidden: isParentReadOnly,\n };\n}\n\nfunction createRequiredProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Required\",\n type: \"boolean\",\n description: `Whether user input is required on the ${componentName} before form submission.`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAutoFocusProp<T>(componentName: string): PropType<T> {\n return {\n type: \"boolean\",\n description: `Whether the ${componentName} should be focused when rendered`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAriaLabelProp<T>(componentName: string): PropType<T> {\n return {\n type: \"string\",\n displayName: \"Aria Label\",\n description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createChildrenProp<T>(): PropType<T> {\n return {\n type: \"slot\",\n mergeWithParent: true as any,\n };\n}\n\nexport function getCommonProps<T>(\n componentName: string,\n propNames: (keyof T)[]\n) {\n const commonProps: Record<string, PropType<T>> = {\n name: createNameProp<T>(),\n disabled: createDisabledProp(componentName),\n isDisabled: createDisabledProp(componentName),\n readOnly: createReadOnlyProp(componentName),\n isReadOnly: createReadOnlyProp(componentName),\n autoFocus: createAutoFocusProp(componentName),\n \"aria-label\": createAriaLabelProp(componentName),\n required: createRequiredProp(componentName),\n isRequired: createRequiredProp(componentName),\n children: createChildrenProp(),\n // NOTE: The following props are only applicable to inputs, textareas, and text fields\n value: {\n type: \"string\",\n editOnly: true,\n displayName: \"Default Value\",\n uncontrolledProp: \"defaultValue\",\n description: `The default value of the ${componentName}`,\n hidden: hasParent,\n },\n maxLength: {\n type: \"number\",\n description: \"The maximum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n minLength: {\n type: \"number\",\n description: \"The minimum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n pattern: {\n type: \"string\",\n description:\n \"Regex pattern that the value of the input must match to be valid\",\n helpText:\n \"For more information about writing Regular Expressions (regex), check out https://regexr.com/\",\n validator: (value: string) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n advanced: true,\n hidden: hasParent,\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\n description:\n \"The type of data that an input field is expected to handle. It influences the input's behavior, validation, and the kind of interface provided to the user.\",\n advanced: true,\n hidden: hasParent,\n },\n inputMode: {\n type: \"choice\",\n description:\n \"hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.\",\n options: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n hidden: hasParent,\n },\n autoComplete: {\n type: \"choice\",\n advanced: true,\n multiSelect: true,\n hidden: hasParent,\n description: \"Guidance as to the type of data expected in the field\",\n helpText:\n \"For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\",\n options: [\n \"on\",\n \"off\",\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"email\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"shipping\",\n \"billing\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-suffix\",\n \"tel-local-prefix\",\n \"tel-extension\",\n \"impp\",\n \"url\",\n \"photo\",\n \"webauthn\",\n ],\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n advanced: true,\n hidden: hasParent,\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n hidden: hasParent,\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBlur: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyDown: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyUp: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCopy: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCut: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onPaste: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionUpdate: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onSelect: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBeforeInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n placeholder: {\n type: \"string\",\n },\n };\n\n // Filter the properties based on the provided fields array\n const filteredProps: Partial<Record<keyof T, PropType<T>>> = {};\n propNames.forEach((propName) => {\n if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {\n filteredProps[propName] = commonProps[propName as string];\n }\n });\n\n return filteredProps;\n}\n"],"names":[],"mappings":";;AAOgB,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;AAX3E,EAAA,IAAA,EAAA,CAAA;AAYE,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;AAf3E,EAAA,IAAA,EAAA,CAAA;AAgBE,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;A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MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,WAAa,EAAA;AAAA,MACX,IAAM,EAAA,QAAA;AAAA,KACR;AAAA,GACF,CAAA;AAGA,EAAA,MAAM,gBAAuD,EAAC,CAAA;AAC9D,EAAU,SAAA,CAAA,OAAA,CAAQ,CAAC,QAAa,KAAA;AAC9B,IAAA,IAAI,OAAO,SAAU,CAAA,cAAA,CAAe,IAAK,CAAA,WAAA,EAAa,QAAQ,CAAG,EAAA;AAC/D,MAAc,aAAA,CAAA,QAAQ,CAAI,GAAA,WAAA,CAAY,QAAkB,CAAA,CAAA;AAAA,KAC1D;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,aAAA,CAAA;AACT;;;;"}
@@ -0,0 +1,345 @@
1
+ 'use strict';
2
+
3
+ var utils = require('./utils-d3708034.cjs.js');
4
+
5
+ function hasParent(_props, ctx) {
6
+ return utils.isDefined(ctx == null ? void 0 : ctx.parent) === true;
7
+ }
8
+ function isParentReadOnly(_props, ctx) {
9
+ var _a;
10
+ return ((_a = ctx == null ? void 0 : ctx.parent) == null ? void 0 : _a.isReadOnly) === true;
11
+ }
12
+ function isParentDisabled(_props, ctx) {
13
+ var _a;
14
+ return ((_a = ctx == null ? void 0 : ctx.parent) == null ? void 0 : _a.isDisabled) === true;
15
+ }
16
+ function resolveAutoComplete(autoCompleteProp) {
17
+ if (typeof autoCompleteProp === "string") {
18
+ return autoCompleteProp;
19
+ }
20
+ if (!autoCompleteProp || !Array.isArray(autoCompleteProp) || autoCompleteProp.includes("off")) {
21
+ return void 0;
22
+ }
23
+ if (autoCompleteProp.includes("off")) {
24
+ return "off";
25
+ }
26
+ if (autoCompleteProp.includes("on") && autoCompleteProp.length === 1) {
27
+ return "on";
28
+ }
29
+ return autoCompleteProp.filter((x) => x !== "on").join(" ");
30
+ }
31
+ function createNameProp() {
32
+ return {
33
+ type: "string",
34
+ description: "Name for this field if it is part of a form",
35
+ hidden: hasParent,
36
+ advanced: true
37
+ };
38
+ }
39
+ function createDisabledProp(componentName) {
40
+ return {
41
+ displayName: "Disabled",
42
+ type: "boolean",
43
+ description: `Whether the ${componentName} is read-only and unfocusable`,
44
+ defaultValueHint: false,
45
+ hidden: isParentDisabled
46
+ };
47
+ }
48
+ function createReadOnlyProp(componentName) {
49
+ return {
50
+ displayName: "Read only",
51
+ type: "boolean",
52
+ 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).`,
53
+ defaultValueHint: false,
54
+ advanced: true,
55
+ hidden: isParentReadOnly
56
+ };
57
+ }
58
+ function createRequiredProp(componentName) {
59
+ return {
60
+ displayName: "Required",
61
+ type: "boolean",
62
+ description: `Whether user input is required on the ${componentName} before form submission.`,
63
+ defaultValueHint: false,
64
+ advanced: true,
65
+ hidden: hasParent
66
+ };
67
+ }
68
+ function createAutoFocusProp(componentName) {
69
+ return {
70
+ type: "boolean",
71
+ description: `Whether the ${componentName} should be focused when rendered`,
72
+ defaultValueHint: false,
73
+ advanced: true,
74
+ hidden: hasParent
75
+ };
76
+ }
77
+ function createAriaLabelProp(componentName) {
78
+ return {
79
+ type: "string",
80
+ displayName: "Aria Label",
81
+ description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,
82
+ advanced: true,
83
+ hidden: hasParent
84
+ };
85
+ }
86
+ function createChildrenProp() {
87
+ return {
88
+ type: "slot",
89
+ mergeWithParent: true
90
+ };
91
+ }
92
+ function getCommonProps(componentName, propNames) {
93
+ const commonProps = {
94
+ name: createNameProp(),
95
+ disabled: createDisabledProp(componentName),
96
+ isDisabled: createDisabledProp(componentName),
97
+ readOnly: createReadOnlyProp(componentName),
98
+ isReadOnly: createReadOnlyProp(componentName),
99
+ autoFocus: createAutoFocusProp(componentName),
100
+ "aria-label": createAriaLabelProp(componentName),
101
+ required: createRequiredProp(componentName),
102
+ isRequired: createRequiredProp(componentName),
103
+ children: createChildrenProp(),
104
+ // NOTE: The following props are only applicable to inputs, textareas, and text fields
105
+ value: {
106
+ type: "string",
107
+ editOnly: true,
108
+ displayName: "Default Value",
109
+ uncontrolledProp: "defaultValue",
110
+ description: `The default value of the ${componentName}`,
111
+ hidden: hasParent
112
+ },
113
+ maxLength: {
114
+ type: "number",
115
+ description: "The maximum number of characters supported by the input",
116
+ advanced: true,
117
+ hidden: hasParent
118
+ },
119
+ minLength: {
120
+ type: "number",
121
+ description: "The minimum number of characters supported by the input",
122
+ advanced: true,
123
+ hidden: hasParent
124
+ },
125
+ pattern: {
126
+ type: "string",
127
+ description: "Regex pattern that the value of the input must match to be valid",
128
+ helpText: "For more information about writing Regular Expressions (regex), check out https://regexr.com/",
129
+ validator: (value) => {
130
+ try {
131
+ new RegExp(value);
132
+ return true;
133
+ } catch (error) {
134
+ return "Invalid Regex";
135
+ }
136
+ },
137
+ advanced: true,
138
+ hidden: hasParent
139
+ },
140
+ type: {
141
+ type: "choice",
142
+ defaultValueHint: "text",
143
+ options: ["text", "search", "url", "tel", "email", "password"],
144
+ description: "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.",
145
+ advanced: true,
146
+ hidden: hasParent
147
+ },
148
+ inputMode: {
149
+ type: "choice",
150
+ description: "hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.",
151
+ options: [
152
+ "none",
153
+ "text",
154
+ "tel",
155
+ "url",
156
+ "email",
157
+ "numeric",
158
+ "decimal",
159
+ "search"
160
+ ],
161
+ hidden: hasParent
162
+ },
163
+ autoComplete: {
164
+ type: "choice",
165
+ advanced: true,
166
+ multiSelect: true,
167
+ hidden: hasParent,
168
+ description: "Guidance as to the type of data expected in the field",
169
+ helpText: "For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values",
170
+ options: [
171
+ "on",
172
+ "off",
173
+ "name",
174
+ "honorific-prefix",
175
+ "given-name",
176
+ "additional-name",
177
+ "family-name",
178
+ "honorific-suffix",
179
+ "nickname",
180
+ "email",
181
+ "username",
182
+ "new-password",
183
+ "current-password",
184
+ "one-time-code",
185
+ "organization-title",
186
+ "organization",
187
+ "street-address",
188
+ "shipping",
189
+ "billing",
190
+ "address-line1",
191
+ "address-line2",
192
+ "address-line3",
193
+ "address-level4",
194
+ "address-level3",
195
+ "address-level2",
196
+ "address-level1",
197
+ "country",
198
+ "country-name",
199
+ "postal-code",
200
+ "cc-name",
201
+ "cc-given-name",
202
+ "cc-additional-name",
203
+ "cc-family-name",
204
+ "cc-number",
205
+ "cc-exp",
206
+ "cc-exp-month",
207
+ "cc-exp-year",
208
+ "cc-csc",
209
+ "cc-type",
210
+ "transaction-currency",
211
+ "transaction-amount",
212
+ "language",
213
+ "bday",
214
+ "bday-day",
215
+ "bday-month",
216
+ "bday-year",
217
+ "sex",
218
+ "tel",
219
+ "tel-country-code",
220
+ "tel-national",
221
+ "tel-area-code",
222
+ "tel-local",
223
+ "tel-local-suffix",
224
+ "tel-local-prefix",
225
+ "tel-extension",
226
+ "impp",
227
+ "url",
228
+ "photo",
229
+ "webauthn"
230
+ ]
231
+ },
232
+ validationBehavior: {
233
+ type: "choice",
234
+ options: ["native", "aria"],
235
+ description: "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.",
236
+ defaultValueHint: "native",
237
+ advanced: true,
238
+ hidden: hasParent
239
+ },
240
+ onChange: {
241
+ type: "eventHandler",
242
+ argTypes: [{ name: "value", type: "string" }],
243
+ hidden: hasParent
244
+ },
245
+ onFocus: {
246
+ type: "eventHandler",
247
+ argTypes: [{ name: "focusEvent", type: "object" }],
248
+ advanced: true,
249
+ hidden: hasParent
250
+ },
251
+ onBlur: {
252
+ type: "eventHandler",
253
+ argTypes: [{ name: "focusEvent", type: "object" }],
254
+ advanced: true,
255
+ hidden: hasParent
256
+ },
257
+ onFocusChange: {
258
+ type: "eventHandler",
259
+ argTypes: [{ name: "isFocused", type: "boolean" }],
260
+ advanced: true,
261
+ hidden: hasParent
262
+ },
263
+ onKeyDown: {
264
+ type: "eventHandler",
265
+ argTypes: [{ name: "keyboardEvent", type: "object" }],
266
+ advanced: true,
267
+ hidden: hasParent
268
+ },
269
+ onKeyUp: {
270
+ type: "eventHandler",
271
+ argTypes: [{ name: "keyboardEvent", type: "object" }],
272
+ advanced: true,
273
+ hidden: hasParent
274
+ },
275
+ onCopy: {
276
+ type: "eventHandler",
277
+ argTypes: [{ name: "clipbordEvent", type: "object" }],
278
+ advanced: true,
279
+ hidden: hasParent
280
+ },
281
+ onCut: {
282
+ type: "eventHandler",
283
+ argTypes: [{ name: "clipbordEvent", type: "object" }],
284
+ advanced: true,
285
+ hidden: hasParent
286
+ },
287
+ onPaste: {
288
+ type: "eventHandler",
289
+ argTypes: [{ name: "clipbordEvent", type: "object" }],
290
+ advanced: true,
291
+ hidden: hasParent
292
+ },
293
+ onCompositionStart: {
294
+ type: "eventHandler",
295
+ argTypes: [{ name: "compositionEvent", type: "object" }],
296
+ advanced: true,
297
+ hidden: hasParent
298
+ },
299
+ onCompositionEnd: {
300
+ type: "eventHandler",
301
+ argTypes: [{ name: "compositionEvent", type: "object" }],
302
+ advanced: true,
303
+ hidden: hasParent
304
+ },
305
+ onCompositionUpdate: {
306
+ type: "eventHandler",
307
+ argTypes: [{ name: "compositionEvent", type: "object" }],
308
+ advanced: true,
309
+ hidden: hasParent
310
+ },
311
+ onSelect: {
312
+ type: "eventHandler",
313
+ argTypes: [{ name: "selectionEvent", type: "object" }],
314
+ advanced: true,
315
+ hidden: hasParent
316
+ },
317
+ onBeforeInput: {
318
+ type: "eventHandler",
319
+ argTypes: [{ name: "inputEvent", type: "object" }],
320
+ advanced: true,
321
+ hidden: hasParent
322
+ },
323
+ onInput: {
324
+ type: "eventHandler",
325
+ argTypes: [{ name: "inputEvent", type: "object" }],
326
+ advanced: true,
327
+ hidden: hasParent
328
+ },
329
+ placeholder: {
330
+ type: "string"
331
+ }
332
+ };
333
+ const filteredProps = {};
334
+ propNames.forEach((propName) => {
335
+ if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {
336
+ filteredProps[propName] = commonProps[propName];
337
+ }
338
+ });
339
+ return filteredProps;
340
+ }
341
+
342
+ exports.getCommonProps = getCommonProps;
343
+ exports.hasParent = hasParent;
344
+ exports.resolveAutoComplete = resolveAutoComplete;
345
+ //# sourceMappingURL=common-f51484c1.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common-f51484c1.cjs.js","sources":["../src/common.ts"],"sourcesContent":["import { PropType } from \"@plasmicapp/host\";\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 hidden: hasParent,\n advanced: true,\n };\n}\n\nfunction createDisabledProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Disabled\",\n type: \"boolean\",\n description: `Whether the ${componentName} is read-only and unfocusable`,\n defaultValueHint: false,\n hidden: isParentDisabled,\n };\n}\n\nfunction createReadOnlyProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Read only\",\n type: \"boolean\",\n description: `Whether the value of this ${componentName} can be changed by the user. Unlike disabled, read-only does not prevent the user from interacting with the component (such as focus).`,\n defaultValueHint: false,\n advanced: true,\n hidden: isParentReadOnly,\n };\n}\n\nfunction createRequiredProp<T>(componentName: string): PropType<T> {\n return {\n displayName: \"Required\",\n type: \"boolean\",\n description: `Whether user input is required on the ${componentName} before form submission.`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAutoFocusProp<T>(componentName: string): PropType<T> {\n return {\n type: \"boolean\",\n description: `Whether the ${componentName} should be focused when rendered`,\n defaultValueHint: false,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createAriaLabelProp<T>(componentName: string): PropType<T> {\n return {\n type: \"string\",\n displayName: \"Aria Label\",\n description: `Label for this ${componentName}, if no visible label is used, to identify the element to assistive technology`,\n advanced: true,\n hidden: hasParent,\n };\n}\n\nfunction createChildrenProp<T>(): PropType<T> {\n return {\n type: \"slot\",\n mergeWithParent: true as any,\n };\n}\n\nexport function getCommonProps<T>(\n componentName: string,\n propNames: (keyof T)[]\n) {\n const commonProps: Record<string, PropType<T>> = {\n name: createNameProp<T>(),\n disabled: createDisabledProp(componentName),\n isDisabled: createDisabledProp(componentName),\n readOnly: createReadOnlyProp(componentName),\n isReadOnly: createReadOnlyProp(componentName),\n autoFocus: createAutoFocusProp(componentName),\n \"aria-label\": createAriaLabelProp(componentName),\n required: createRequiredProp(componentName),\n isRequired: createRequiredProp(componentName),\n children: createChildrenProp(),\n // NOTE: The following props are only applicable to inputs, textareas, and text fields\n value: {\n type: \"string\",\n editOnly: true,\n displayName: \"Default Value\",\n uncontrolledProp: \"defaultValue\",\n description: `The default value of the ${componentName}`,\n hidden: hasParent,\n },\n maxLength: {\n type: \"number\",\n description: \"The maximum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n minLength: {\n type: \"number\",\n description: \"The minimum number of characters supported by the input\",\n advanced: true,\n hidden: hasParent,\n },\n pattern: {\n type: \"string\",\n description:\n \"Regex pattern that the value of the input must match to be valid\",\n helpText:\n \"For more information about writing Regular Expressions (regex), check out https://regexr.com/\",\n validator: (value: string) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n advanced: true,\n hidden: hasParent,\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\n description:\n \"The type of data that an input field is expected to handle. It influences the input's behavior, validation, and the kind of interface provided to the user.\",\n advanced: true,\n hidden: hasParent,\n },\n inputMode: {\n type: \"choice\",\n description:\n \"hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.\",\n options: [\n \"none\",\n \"text\",\n \"tel\",\n \"url\",\n \"email\",\n \"numeric\",\n \"decimal\",\n \"search\",\n ],\n hidden: hasParent,\n },\n autoComplete: {\n type: \"choice\",\n advanced: true,\n multiSelect: true,\n hidden: hasParent,\n description: \"Guidance as to the type of data expected in the field\",\n helpText:\n \"For explanations on what each of the values mean, check https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\",\n options: [\n \"on\",\n \"off\",\n \"name\",\n \"honorific-prefix\",\n \"given-name\",\n \"additional-name\",\n \"family-name\",\n \"honorific-suffix\",\n \"nickname\",\n \"email\",\n \"username\",\n \"new-password\",\n \"current-password\",\n \"one-time-code\",\n \"organization-title\",\n \"organization\",\n \"street-address\",\n \"shipping\",\n \"billing\",\n \"address-line1\",\n \"address-line2\",\n \"address-line3\",\n \"address-level4\",\n \"address-level3\",\n \"address-level2\",\n \"address-level1\",\n \"country\",\n \"country-name\",\n \"postal-code\",\n \"cc-name\",\n \"cc-given-name\",\n \"cc-additional-name\",\n \"cc-family-name\",\n \"cc-number\",\n \"cc-exp\",\n \"cc-exp-month\",\n \"cc-exp-year\",\n \"cc-csc\",\n \"cc-type\",\n \"transaction-currency\",\n \"transaction-amount\",\n \"language\",\n \"bday\",\n \"bday-day\",\n \"bday-month\",\n \"bday-year\",\n \"sex\",\n \"tel\",\n \"tel-country-code\",\n \"tel-national\",\n \"tel-area-code\",\n \"tel-local\",\n \"tel-local-suffix\",\n \"tel-local-prefix\",\n \"tel-extension\",\n \"impp\",\n \"url\",\n \"photo\",\n \"webauthn\",\n ],\n },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n advanced: true,\n hidden: hasParent,\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n hidden: hasParent,\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBlur: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyDown: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onKeyUp: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCopy: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCut: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onPaste: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onCompositionUpdate: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onSelect: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectionEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onBeforeInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n onInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n advanced: true,\n hidden: hasParent,\n },\n placeholder: {\n type: \"string\",\n },\n };\n\n // Filter the properties based on the provided fields array\n const filteredProps: Partial<Record<keyof T, PropType<T>>> = {};\n propNames.forEach((propName) => {\n if (Object.prototype.hasOwnProperty.call(commonProps, propName)) {\n filteredProps[propName] = commonProps[propName as string];\n }\n });\n\n return filteredProps;\n}\n"],"names":["isDefined"],"mappings":";;;;AAOgB,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;AAX3E,EAAA,IAAA,EAAA,CAAA;AAYE,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,CAA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,KACV;AAAA,IACA,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,cAAA;AAAA,MACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,MACjD,QAAU,EAAA,IAAA;AAAA,MACV,MAAQ,EAAA,SAAA;AAAA,KACV;AAAA,IACA,WAAa,EAAA;AAAA,MACX,IAAM,EAAA,QAAA;AAAA,KACR;AAAA,GACF,CAAA;AAGA,EAAA,MAAM,gBAAuD,EAAC,CAAA;AAC9D,EAAU,SAAA,CAAA,OAAA,CAAQ,CAAC,QAAa,KAAA;AAC9B,IAAA,IAAI,OAAO,SAAU,CAAA,cAAA,CAAe,IAAK,CAAA,WAAA,EAAa,QAAQ,CAAG,EAAA;AAC/D,MAAc,aAAA,CAAA,QAAQ,CAAI,GAAA,WAAA,CAAY,QAAkB,CAAA,CAAA;AAAA,KAC1D;AAAA,GACD,CAAA,CAAA;AAED,EAAO,OAAA,aAAA,CAAA;AACT;;;;;;"}
@@ -1,2 +1,9 @@
1
1
  import { PropType } from "@plasmicapp/host";
2
- export declare function getCommonInputProps<T>(fieldName: string, fields: (keyof T)[]): Record<string, PropType<T>>;
2
+ import { BaseControlContextData, HasControlContextData } from "./utils";
3
+ export declare function hasParent<T>(_props: T, ctx: ConditionalContext<T>): boolean;
4
+ export declare function isParentReadOnly<T>(_props: T, ctx: ConditionalContext<T>): boolean;
5
+ export declare function isParentDisabled<T>(_props: T, ctx: ConditionalContext<T>): boolean;
6
+ export declare function resolveAutoComplete(autoCompleteProp?: string | string[]): string | undefined;
7
+ type ConditionalContext<T> = T extends HasControlContextData ? BaseControlContextData | null : null;
8
+ export declare function getCommonProps<T>(componentName: string, propNames: (keyof T)[]): Partial<Record<keyof T, PropType<T>>>;
9
+ export {};
@@ -13,7 +13,6 @@ const PlasmicDialogTriggerContext = React__default.default.createContext(void 0)
13
13
  const PlasmicSliderContext = React__default.default.createContext(void 0);
14
14
  React__default.default.createContext(void 0);
15
15
  const PlasmicListBoxContext = React__default.default.createContext(void 0);
16
- const PlasmicPopoverContext = React__default.default.createContext(void 0);
17
16
  const PlasmicItemContext = React__default.default.createContext(void 0);
18
17
  const PlasmicSectionContext = React__default.default.createContext(void 0);
19
18
  const PlasmicHeaderContext = React__default.default.createContext(void 0);
@@ -25,9 +24,8 @@ exports.PlasmicHeaderContext = PlasmicHeaderContext;
25
24
  exports.PlasmicInputContext = PlasmicInputContext;
26
25
  exports.PlasmicItemContext = PlasmicItemContext;
27
26
  exports.PlasmicListBoxContext = PlasmicListBoxContext;
28
- exports.PlasmicPopoverContext = PlasmicPopoverContext;
29
27
  exports.PlasmicRadioGroupContext = PlasmicRadioGroupContext;
30
28
  exports.PlasmicSectionContext = PlasmicSectionContext;
31
29
  exports.PlasmicSliderContext = PlasmicSliderContext;
32
30
  exports.PlasmicTextFieldContext = PlasmicTextFieldContext;
33
- //# sourceMappingURL=contexts-7236059e.cjs.js.map
31
+ //# sourceMappingURL=contexts-3a98471a.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts-3a98471a.cjs.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { StrictItemType } from \"./option-utils\";\nimport { BaseCheckboxGroup } from \"./registerCheckboxGroup\";\nimport { BaseDialogTrigger } from \"./registerDialogTrigger\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport { BaseRadioGroup } from \"./registerRadioGroup\";\nimport type { BaseSection } from \"./registerSection\";\nimport { BaseSlider } from \"./registerSlider\";\nimport { BaseTextField } from \"./registerTextField\";\n\n// We pass down context props via our own Plasmic*Context instead of directly\n// using react-aria-component's *Context, because react-aria-component's\n// contexts don't \"merge\" with contexts further up the tree, so if we render\n// a context provider, it will just be overwritten by react-aria-component's\n// context provider. So we do the merging within our own Base* components\n// instead.\n\n// Creating the text field context here because input/textarea inside text field receive a null for the TextFieldContext\nexport const PlasmicTextFieldContext = React.createContext<\n React.ComponentProps<typeof BaseTextField> | undefined\n>(undefined);\n\nexport const PlasmicCheckboxGroupContext = React.createContext<\n React.ComponentProps<typeof BaseCheckboxGroup> | undefined\n>(undefined);\n\nexport const PlasmicRadioGroupContext = React.createContext<\n React.ComponentProps<typeof BaseRadioGroup> | undefined\n>(undefined);\n\nexport const PlasmicDialogTriggerContext = React.createContext<\n React.ComponentProps<typeof BaseDialogTrigger> | undefined\n>(undefined);\n\nexport type PlasmicSliderContextType<T extends number | number[]> =\n | React.ComponentProps<typeof BaseSlider<T>>\n | undefined;\n\nexport const PlasmicSliderContext =\n React.createContext<PlasmicSliderContextType<number | number[]>>(undefined);\n\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n StrictItemType | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicHeaderContext = React.createContext<\n React.ComponentProps<typeof BaseHeader> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":["React"],"mappings":";;;;;;;;AAqBa,MAAA,uBAAA,GAA0BA,sBAAM,CAAA,aAAA,CAE3C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8BA,sBAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAEE,MAAA,wBAAA,GAA2BA,sBAAM,CAAA,aAAA,CAE5C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8BA,sBAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAME,MAAA,oBAAA,GACXA,sBAAM,CAAA,aAAA,CAA2D,KAAS,CAAA,EAAA;AAEzCA,sBAAM,CAAA,aAAA,CAEvC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwBA,sBAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,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;;;;;;;;;;;;;"}
@@ -7,11 +7,10 @@ const PlasmicDialogTriggerContext = React.createContext(void 0);
7
7
  const PlasmicSliderContext = React.createContext(void 0);
8
8
  React.createContext(void 0);
9
9
  const PlasmicListBoxContext = React.createContext(void 0);
10
- const PlasmicPopoverContext = React.createContext(void 0);
11
10
  const PlasmicItemContext = React.createContext(void 0);
12
11
  const PlasmicSectionContext = React.createContext(void 0);
13
12
  const PlasmicHeaderContext = React.createContext(void 0);
14
13
  const PlasmicInputContext = React.createContext(void 0);
15
14
 
16
- export { PlasmicCheckboxGroupContext as P, PlasmicListBoxContext as a, PlasmicInputContext as b, PlasmicDialogTriggerContext as c, PlasmicRadioGroupContext as d, PlasmicSectionContext as e, PlasmicItemContext as f, PlasmicPopoverContext as g, PlasmicHeaderContext as h, PlasmicSliderContext as i, PlasmicTextFieldContext as j };
17
- //# sourceMappingURL=contexts-21e0d928.esm.js.map
15
+ export { PlasmicCheckboxGroupContext as P, PlasmicListBoxContext as a, PlasmicInputContext as b, PlasmicDialogTriggerContext as c, PlasmicRadioGroupContext as d, PlasmicSectionContext as e, PlasmicItemContext as f, PlasmicHeaderContext as g, PlasmicSliderContext as h, PlasmicTextFieldContext as i };
16
+ //# sourceMappingURL=contexts-87c261f6.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contexts-87c261f6.esm.js","sources":["../src/contexts.tsx"],"sourcesContent":["import React from \"react\";\nimport type { StrictItemType } from \"./option-utils\";\nimport { BaseCheckboxGroup } from \"./registerCheckboxGroup\";\nimport { BaseDialogTrigger } from \"./registerDialogTrigger\";\nimport type { BaseHeader } from \"./registerHeader\";\nimport type { BaseInput } from \"./registerInput\";\nimport type { BaseLabel } from \"./registerLabel\";\nimport type { BaseListBoxProps } from \"./registerListBox\";\nimport { BaseRadioGroup } from \"./registerRadioGroup\";\nimport type { BaseSection } from \"./registerSection\";\nimport { BaseSlider } from \"./registerSlider\";\nimport { BaseTextField } from \"./registerTextField\";\n\n// We pass down context props via our own Plasmic*Context instead of directly\n// using react-aria-component's *Context, because react-aria-component's\n// contexts don't \"merge\" with contexts further up the tree, so if we render\n// a context provider, it will just be overwritten by react-aria-component's\n// context provider. So we do the merging within our own Base* components\n// instead.\n\n// Creating the text field context here because input/textarea inside text field receive a null for the TextFieldContext\nexport const PlasmicTextFieldContext = React.createContext<\n React.ComponentProps<typeof BaseTextField> | undefined\n>(undefined);\n\nexport const PlasmicCheckboxGroupContext = React.createContext<\n React.ComponentProps<typeof BaseCheckboxGroup> | undefined\n>(undefined);\n\nexport const PlasmicRadioGroupContext = React.createContext<\n React.ComponentProps<typeof BaseRadioGroup> | undefined\n>(undefined);\n\nexport const PlasmicDialogTriggerContext = React.createContext<\n React.ComponentProps<typeof BaseDialogTrigger> | undefined\n>(undefined);\n\nexport type PlasmicSliderContextType<T extends number | number[]> =\n | React.ComponentProps<typeof BaseSlider<T>>\n | undefined;\n\nexport const PlasmicSliderContext =\n React.createContext<PlasmicSliderContextType<number | number[]>>(undefined);\n\nexport const PlasmicLabelContext = React.createContext<\n React.ComponentProps<typeof BaseLabel> | undefined\n>(undefined);\n\nexport const PlasmicListBoxContext = React.createContext<\n BaseListBoxProps | undefined\n>(undefined);\n\nexport const PlasmicItemContext = React.createContext<\n StrictItemType | undefined\n>(undefined);\n\nexport const PlasmicSectionContext = React.createContext<\n React.ComponentProps<typeof BaseSection> | undefined\n>(undefined);\n\nexport const PlasmicHeaderContext = React.createContext<\n React.ComponentProps<typeof BaseHeader> | undefined\n>(undefined);\n\nexport const PlasmicInputContext = React.createContext<\n React.ComponentProps<typeof BaseInput> | undefined\n>(undefined);\n"],"names":[],"mappings":";;AAqBa,MAAA,uBAAA,GAA0B,KAAM,CAAA,aAAA,CAE3C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8B,KAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAEE,MAAA,wBAAA,GAA2B,KAAM,CAAA,aAAA,CAE5C,KAAS,CAAA,EAAA;AAEE,MAAA,2BAAA,GAA8B,KAAM,CAAA,aAAA,CAE/C,KAAS,CAAA,EAAA;AAME,MAAA,oBAAA,GACX,KAAM,CAAA,aAAA,CAA2D,KAAS,CAAA,EAAA;AAEzC,KAAM,CAAA,aAAA,CAEvC,KAAS,CAAA,EAAA;AAEE,MAAA,qBAAA,GAAwB,KAAM,CAAA,aAAA,CAEzC,KAAS,CAAA,EAAA;AAEE,MAAA,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,14 +1,15 @@
1
1
  import React from "react";
2
2
  import type { StrictItemType } from "./option-utils";
3
3
  import type { BaseListBoxProps } from "./registerListBox";
4
+ import { BaseSlider } from "./registerSlider";
4
5
  export declare const PlasmicTextFieldContext: React.Context<import("./registerTextField").BaseTextFieldProps | undefined>;
5
6
  export declare const PlasmicCheckboxGroupContext: React.Context<import("./registerCheckboxGroup").BaseCheckboxGroupProps | undefined>;
6
7
  export declare const PlasmicRadioGroupContext: React.Context<import("./registerRadioGroup").BaseRadioGroupProps | undefined>;
7
8
  export declare const PlasmicDialogTriggerContext: React.Context<import("./registerDialogTrigger").BaseDialogTriggerProps | undefined>;
8
- export declare const PlasmicSliderContext: React.Context<import("./registerSlider").BaseSliderProps | undefined>;
9
+ export type PlasmicSliderContextType<T extends number | number[]> = React.ComponentProps<typeof BaseSlider<T>> | undefined;
10
+ export declare const PlasmicSliderContext: React.Context<PlasmicSliderContextType<number | number[]>>;
9
11
  export declare const PlasmicLabelContext: React.Context<(import("react-aria-components").LabelProps & React.RefAttributes<HTMLLabelElement>) | undefined>;
10
12
  export declare const PlasmicListBoxContext: React.Context<BaseListBoxProps | undefined>;
11
- export declare const PlasmicPopoverContext: React.Context<import("./registerPopover").BasePopoverProps | undefined>;
12
13
  export declare const PlasmicItemContext: React.Context<StrictItemType | undefined>;
13
14
  export declare const PlasmicSectionContext: React.Context<import("./registerSection").BaseSectionProps | undefined>;
14
15
  export declare const PlasmicHeaderContext: React.Context<(React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>) | undefined>;
@@ -2,7 +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
+ var common = require('./common-f51484c1.cjs.js');
6
6
  var interactionVariantUtils = require('./interaction-variant-utils-36f1b397.cjs.js');
7
7
  var utils = require('./utils-d3708034.cjs.js');
8
8
  require('@plasmicapp/host/registerComponent');
@@ -95,7 +95,7 @@ function registerButton(loader, overrides) {
95
95
  padding: "2px 10px",
96
96
  cursor: "pointer"
97
97
  },
98
- props: __spreadProps(__spreadValues({}, common.getCommonInputProps("button", [
98
+ props: __spreadProps(__spreadValues({}, common.getCommonProps("button", [
99
99
  "isDisabled",
100
100
  "aria-label"
101
101
  ])), {
@@ -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 { getCommonInputProps } from \"./common\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst BUTTON_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n BUTTON_INTERACTION_VARIANTS\n);\n\ninterface BaseButtonProps extends ButtonProps {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: boolean;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof BUTTON_INTERACTION_VARIANTS\n >;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const {\n submitsForm,\n resetsForm,\n children,\n updateInteractionVariant,\n ...rest\n } = props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n return (\n <Button type={type} {...rest}>\n {({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n },\n updateInteractionVariant\n )\n }\n </Button>\n );\n}\n\nexport const BUTTON_COMPONENT_NAME = makeComponentName(\"button\");\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: BUTTON_COMPONENT_NAME,\n displayName: \"Aria Button\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerButton\",\n importName: \"BaseButton\",\n interactionVariants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"2px 10px\",\n cursor: \"pointer\",\n },\n props: {\n ...getCommonInputProps<BaseButtonProps>(\"button\", [\n \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.resetsForm),\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n resetsForm: {\n type: \"boolean\",\n displayName: \"Resets form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.submitsForm),\n description:\n \"Whether clicking this button should reset the enclosing form.\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","Button","makeComponentName","registerComponentHelper","getCommonInputProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,2BAA8B,GAAA;AAAA,EAClC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,2BAAA;AACF,CAAA,CAAA;AAaO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,wBAAA;AAAA,GA3CJ,GA6CM,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AChD,YAAA;AAAA,QACA,YAAA;AAAA,OACD,CAJI,CAAA,EAAA;AAAA,QAKL,QAAU,EAAA;AAAA,UACR,IAAM,EAAA,MAAA;AAAA,UACN,eAAiB,EAAA,IAAA;AAAA,UACjB,YAAc,EAAA;AAAA,YACZ,IAAM,EAAA,MAAA;AAAA,YACN,KAAO,EAAA,QAAA;AAAA,WACT;AAAA,SACF;AAAA,QACA,WAAa,EAAA;AAAA,UACX,IAAM,EAAA,SAAA;AAAA,UACN,WAAa,EAAA,eAAA;AAAA,UACb,gBAAkB,EAAA,KAAA;AAAA,UAClB,MAAQ,EAAA,CAAC,EAAwB,KAAA,OAAA,CAAQ,GAAG,UAAU,CAAA;AAAA,UACtD,WACE,EAAA,gEAAA;AAAA,UACF,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,QACA,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,SAAA;AAAA,UACN,WAAa,EAAA,cAAA;AAAA,UACb,gBAAkB,EAAA,KAAA;AAAA,UAClB,MAAQ,EAAA,CAAC,EAAwB,KAAA,OAAA,CAAQ,GAAG,WAAW,CAAA;AAAA,UACvD,WACE,EAAA,+DAAA;AAAA,UACF,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,QACA,OAAS,EAAA;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
1
+ {"version":3,"file":"registerButton.cjs.js","sources":["../src/registerButton.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ButtonProps } from \"react-aria-components\";\nimport { Button } from \"react-aria-components\";\nimport { getCommonProps } from \"./common\";\nimport {\n UpdateInteractionVariant,\n pickAriaComponentVariants,\n} from \"./interaction-variant-utils\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\nconst BUTTON_INTERACTION_VARIANTS = [\n \"hovered\" as const,\n \"pressed\" as const,\n \"focused\" as const,\n \"focusVisible\" as const,\n \"disabled\" as const,\n];\n\nconst { interactionVariants, withObservedValues } = pickAriaComponentVariants(\n BUTTON_INTERACTION_VARIANTS\n);\n\ninterface BaseButtonProps extends ButtonProps {\n children: React.ReactNode;\n resetsForm?: boolean;\n submitsForm?: boolean;\n // Optional callback to update the interaction variant state\n // as it's only provided if the component is the root of a Studio component\n updateInteractionVariant?: UpdateInteractionVariant<\n typeof BUTTON_INTERACTION_VARIANTS\n >;\n}\n\nexport function BaseButton(props: BaseButtonProps) {\n const {\n submitsForm,\n resetsForm,\n children,\n updateInteractionVariant,\n ...rest\n } = props;\n\n const type = submitsForm ? \"submit\" : resetsForm ? \"reset\" : \"button\";\n\n return (\n <Button type={type} {...rest}>\n {({ isHovered, isPressed, isFocused, isFocusVisible, isDisabled }) =>\n withObservedValues(\n children,\n {\n hovered: isHovered,\n pressed: isPressed,\n focused: isFocused,\n focusVisible: isFocusVisible,\n disabled: isDisabled,\n },\n updateInteractionVariant\n )\n }\n </Button>\n );\n}\n\nexport const BUTTON_COMPONENT_NAME = makeComponentName(\"button\");\n\nexport function registerButton(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseButton>\n) {\n registerComponentHelper(\n loader,\n BaseButton,\n {\n name: BUTTON_COMPONENT_NAME,\n displayName: \"Aria Button\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerButton\",\n importName: \"BaseButton\",\n interactionVariants,\n defaultStyles: {\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"black\",\n padding: \"2px 10px\",\n cursor: \"pointer\",\n },\n props: {\n ...getCommonProps<BaseButtonProps>(\"button\", [\n \"isDisabled\",\n \"aria-label\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"text\",\n value: \"Button\",\n },\n },\n submitsForm: {\n type: \"boolean\",\n displayName: \"Submits form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.resetsForm),\n description:\n \"Whether clicking this button should submit the enclosing form.\",\n advanced: true,\n },\n resetsForm: {\n type: \"boolean\",\n displayName: \"Resets form?\",\n defaultValueHint: false,\n hidden: (ps: BaseButtonProps) => Boolean(ps.submitsForm),\n description:\n \"Whether clicking this button should reset the enclosing form.\",\n advanced: true,\n },\n onPress: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n}\n"],"names":["pickAriaComponentVariants","React","Button","makeComponentName","registerComponentHelper","getCommonProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,2BAA8B,GAAA;AAAA,EAClC,SAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AACF,CAAA,CAAA;AAEA,MAAM,EAAE,mBAAqB,EAAA,kBAAA,EAAuB,GAAAA,iDAAA;AAAA,EAClD,2BAAA;AACF,CAAA,CAAA;AAaO,SAAS,WAAW,KAAwB,EAAA;AACjD,EAAA,MAMI,EALF,GAAA,KAAA,EAAA;AAAA,IAAA,WAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,wBAAA;AAAA,GA3CJ,GA6CM,EADC,EAAA,IAAA,GAAA,SAAA,CACD,EADC,EAAA;AAAA,IAJH,aAAA;AAAA,IACA,YAAA;AAAA,IACA,UAAA;AAAA,IACA,0BAAA;AAAA,GAAA,CAAA,CAAA;AAIF,EAAA,MAAM,IAAO,GAAA,WAAA,GAAc,QAAW,GAAA,UAAA,GAAa,OAAU,GAAA,QAAA,CAAA;AAE7D,EACE,uBAAAC,sBAAA,CAAA,aAAA,CAACC,0BAAO,EAAA,cAAA,CAAA,EAAA,IAAA,EAAA,EAAgB,IAC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AAA,UACb,gBAAkB,EAAA,KAAA;AAAA,UAClB,MAAQ,EAAA,CAAC,EAAwB,KAAA,OAAA,CAAQ,GAAG,UAAU,CAAA;AAAA,UACtD,WACE,EAAA,gEAAA;AAAA,UACF,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,QACA,UAAY,EAAA;AAAA,UACV,IAAM,EAAA,SAAA;AAAA,UACN,WAAa,EAAA,cAAA;AAAA,UACb,gBAAkB,EAAA,KAAA;AAAA,UAClB,MAAQ,EAAA,CAAC,EAAwB,KAAA,OAAA,CAAQ,GAAG,WAAW,CAAA;AAAA,UACvD,WACE,EAAA,+DAAA;AAAA,UACF,QAAU,EAAA,IAAA;AAAA,SACZ;AAAA,QACA,OAAS,EAAA;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,OAAS,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SAC9C;AAAA,OACF,CAAA;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AACF;;;;;;"}
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import type { ButtonProps } from "react-aria-components";
3
3
  import { UpdateInteractionVariant } from "./interaction-variant-utils";
4
4
  import { CodeComponentMetaOverrides, Registerable } from "./utils";
5
- declare const BUTTON_INTERACTION_VARIANTS: ("hovered" | "pressed" | "focused" | "focusVisible" | "disabled")[];
5
+ declare const BUTTON_INTERACTION_VARIANTS: ("disabled" | "hovered" | "pressed" | "focused" | "focusVisible")[];
6
6
  interface BaseButtonProps extends ButtonProps {
7
7
  children: React.ReactNode;
8
8
  resetsForm?: boolean;
@@ -1,6 +1,6 @@
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
+ import { g as getCommonProps } from './common-96be13c3.esm.js';
4
4
  import { p as pickAriaComponentVariants } from './interaction-variant-utils-abd0c319.esm.js';
5
5
  import { a as makeComponentName, r as registerComponentHelper } from './utils-a1785802.esm.js';
6
6
  import '@plasmicapp/host/registerComponent';
@@ -89,7 +89,7 @@ function registerButton(loader, overrides) {
89
89
  padding: "2px 10px",
90
90
  cursor: "pointer"
91
91
  },
92
- props: __spreadProps(__spreadValues({}, getCommonInputProps("button", [
92
+ props: __spreadProps(__spreadValues({}, getCommonProps("button", [
93
93
  "isDisabled",
94
94
  "aria-label"
95
95
  ])), {