@plasmicpkgs/react-aria 0.0.29 → 0.0.30

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 (165) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/contexts.d.ts +3 -0
  3. package/dist/react-aria.esm.js +1712 -878
  4. package/dist/react-aria.esm.js.map +1 -1
  5. package/dist/react-aria.js +1711 -877
  6. package/dist/react-aria.js.map +1 -1
  7. package/dist/registerButton.d.ts +1 -0
  8. package/dist/registerCheckbox.d.ts +8 -2
  9. package/dist/registerCheckboxGroup.d.ts +2 -2
  10. package/dist/registerDescription.d.ts +2 -1
  11. package/dist/registerDialogTrigger.d.ts +1 -2
  12. package/dist/registerHeader.d.ts +1 -1
  13. package/dist/registerInput.d.ts +1 -0
  14. package/dist/registerListBox.d.ts +3 -6
  15. package/dist/registerListBoxItem.d.ts +3 -1
  16. package/dist/registerModal.d.ts +3 -1
  17. package/dist/registerPopover.d.ts +3 -0
  18. package/dist/registerRadio.d.ts +5 -2
  19. package/dist/registerRadioGroup.d.ts +3 -3
  20. package/dist/registerSection.d.ts +1 -1
  21. package/dist/registerSelect.d.ts +5 -2
  22. package/dist/registerText.d.ts +2 -1
  23. package/dist/registerTextField.d.ts +1 -0
  24. package/dist/utils.d.ts +9 -2
  25. package/package.json +2 -2
  26. package/skinny/contexts-9475faad.esm.js +16 -0
  27. package/skinny/contexts-9475faad.esm.js.map +1 -0
  28. package/skinny/{contexts-dd0ce341.cjs.js → contexts-b21f6b12.cjs.js} +7 -1
  29. package/skinny/contexts-b21f6b12.cjs.js.map +1 -0
  30. package/skinny/contexts.d.ts +3 -0
  31. package/skinny/registerButton.cjs.js +19 -4
  32. package/skinny/registerButton.cjs.js.map +1 -1
  33. package/skinny/registerButton.d.ts +1 -0
  34. package/skinny/registerButton.esm.js +19 -5
  35. package/skinny/registerButton.esm.js.map +1 -1
  36. package/skinny/registerCheckbox.cjs.js +75 -6
  37. package/skinny/registerCheckbox.cjs.js.map +1 -1
  38. package/skinny/registerCheckbox.d.ts +8 -2
  39. package/skinny/registerCheckbox.esm.js +75 -7
  40. package/skinny/registerCheckbox.esm.js.map +1 -1
  41. package/skinny/registerCheckboxGroup.cjs.js +89 -13
  42. package/skinny/registerCheckboxGroup.cjs.js.map +1 -1
  43. package/skinny/registerCheckboxGroup.d.ts +2 -2
  44. package/skinny/registerCheckboxGroup.esm.js +88 -16
  45. package/skinny/registerCheckboxGroup.esm.js.map +1 -1
  46. package/skinny/registerComboBox.cjs.js +113 -8
  47. package/skinny/registerComboBox.cjs.js.map +1 -1
  48. package/skinny/registerComboBox.esm.js +109 -4
  49. package/skinny/registerComboBox.esm.js.map +1 -1
  50. package/skinny/registerDescription.cjs.js +10 -3
  51. package/skinny/registerDescription.cjs.js.map +1 -1
  52. package/skinny/registerDescription.d.ts +2 -1
  53. package/skinny/registerDescription.esm.js +10 -4
  54. package/skinny/registerDescription.esm.js.map +1 -1
  55. package/skinny/registerDialogTrigger.cjs.js +25 -4
  56. package/skinny/registerDialogTrigger.cjs.js.map +1 -1
  57. package/skinny/registerDialogTrigger.d.ts +1 -2
  58. package/skinny/registerDialogTrigger.esm.js +25 -4
  59. package/skinny/registerDialogTrigger.esm.js.map +1 -1
  60. package/skinny/registerFieldError.cjs.js +21 -11
  61. package/skinny/registerFieldError.cjs.js.map +1 -1
  62. package/skinny/registerFieldError.esm.js +21 -11
  63. package/skinny/registerFieldError.esm.js.map +1 -1
  64. package/skinny/registerForm.cjs.js +1 -1
  65. package/skinny/registerForm.esm.js +1 -1
  66. package/skinny/registerHeader.cjs.js +7 -3
  67. package/skinny/registerHeader.cjs.js.map +1 -1
  68. package/skinny/registerHeader.d.ts +1 -1
  69. package/skinny/registerHeader.esm.js +7 -3
  70. package/skinny/registerHeader.esm.js.map +1 -1
  71. package/skinny/registerInput.cjs.js +11 -2
  72. package/skinny/registerInput.cjs.js.map +1 -1
  73. package/skinny/registerInput.d.ts +1 -0
  74. package/skinny/registerInput.esm.js +11 -3
  75. package/skinny/registerInput.esm.js.map +1 -1
  76. package/skinny/registerLabel.cjs.js +1 -1
  77. package/skinny/registerLabel.esm.js +1 -1
  78. package/skinny/registerListBox-1effa43d.esm.js +299 -0
  79. package/skinny/registerListBox-1effa43d.esm.js.map +1 -0
  80. package/skinny/registerListBox-837b90d8.cjs.js +311 -0
  81. package/skinny/registerListBox-837b90d8.cjs.js.map +1 -0
  82. package/skinny/registerListBox.cjs.js +14 -108
  83. package/skinny/registerListBox.cjs.js.map +1 -1
  84. package/skinny/registerListBox.d.ts +3 -6
  85. package/skinny/registerListBox.esm.js +11 -106
  86. package/skinny/registerListBox.esm.js.map +1 -1
  87. package/skinny/registerListBoxItem.cjs.js +49 -5
  88. package/skinny/registerListBoxItem.cjs.js.map +1 -1
  89. package/skinny/registerListBoxItem.d.ts +3 -1
  90. package/skinny/registerListBoxItem.esm.js +49 -6
  91. package/skinny/registerListBoxItem.esm.js.map +1 -1
  92. package/skinny/registerModal.cjs.js +78 -9
  93. package/skinny/registerModal.cjs.js.map +1 -1
  94. package/skinny/registerModal.d.ts +3 -1
  95. package/skinny/registerModal.esm.js +78 -10
  96. package/skinny/registerModal.esm.js.map +1 -1
  97. package/skinny/registerPopover.cjs.js +56 -4
  98. package/skinny/registerPopover.cjs.js.map +1 -1
  99. package/skinny/registerPopover.d.ts +3 -0
  100. package/skinny/registerPopover.esm.js +55 -5
  101. package/skinny/registerPopover.esm.js.map +1 -1
  102. package/skinny/registerRadio.cjs.js +51 -6
  103. package/skinny/registerRadio.cjs.js.map +1 -1
  104. package/skinny/registerRadio.d.ts +5 -2
  105. package/skinny/registerRadio.esm.js +51 -7
  106. package/skinny/registerRadio.esm.js.map +1 -1
  107. package/skinny/registerRadioGroup.cjs.js +80 -16
  108. package/skinny/registerRadioGroup.cjs.js.map +1 -1
  109. package/skinny/registerRadioGroup.d.ts +3 -3
  110. package/skinny/registerRadioGroup.esm.js +79 -19
  111. package/skinny/registerRadioGroup.esm.js.map +1 -1
  112. package/skinny/registerSection.cjs.js +36 -12
  113. package/skinny/registerSection.cjs.js.map +1 -1
  114. package/skinny/registerSection.d.ts +1 -1
  115. package/skinny/registerSection.esm.js +36 -12
  116. package/skinny/registerSection.esm.js.map +1 -1
  117. package/skinny/registerSelect.cjs.js +133 -30
  118. package/skinny/registerSelect.cjs.js.map +1 -1
  119. package/skinny/registerSelect.d.ts +5 -2
  120. package/skinny/registerSelect.esm.js +130 -25
  121. package/skinny/registerSelect.esm.js.map +1 -1
  122. package/skinny/{registerSlider-efdba013.esm.js → registerSlider-39783c91.esm.js} +3 -3
  123. package/skinny/{registerSlider-efdba013.esm.js.map → registerSlider-39783c91.esm.js.map} +1 -1
  124. package/skinny/{registerSlider-73e80194.cjs.js → registerSlider-ac9f3b1e.cjs.js} +3 -3
  125. package/skinny/{registerSlider-73e80194.cjs.js.map → registerSlider-ac9f3b1e.cjs.js.map} +1 -1
  126. package/skinny/registerSlider.cjs.js +3 -3
  127. package/skinny/registerSlider.esm.js +3 -3
  128. package/skinny/registerSliderOutput.cjs.js +1 -1
  129. package/skinny/registerSliderOutput.esm.js +1 -1
  130. package/skinny/registerSliderThumb.cjs.js +2 -2
  131. package/skinny/registerSliderThumb.esm.js +2 -2
  132. package/skinny/registerSliderTrack.cjs.js +3 -3
  133. package/skinny/registerSliderTrack.esm.js +3 -3
  134. package/skinny/registerSwitch.cjs.js +83 -3
  135. package/skinny/registerSwitch.cjs.js.map +1 -1
  136. package/skinny/registerSwitch.esm.js +83 -3
  137. package/skinny/registerSwitch.esm.js.map +1 -1
  138. package/skinny/registerText.cjs.js +11 -4
  139. package/skinny/registerText.cjs.js.map +1 -1
  140. package/skinny/registerText.d.ts +2 -1
  141. package/skinny/registerText.esm.js +11 -5
  142. package/skinny/registerText.esm.js.map +1 -1
  143. package/skinny/registerTextArea.cjs.js +1 -1
  144. package/skinny/registerTextArea.esm.js +1 -1
  145. package/skinny/registerTextField.cjs.js +47 -6
  146. package/skinny/registerTextField.cjs.js.map +1 -1
  147. package/skinny/registerTextField.d.ts +1 -0
  148. package/skinny/registerTextField.esm.js +50 -10
  149. package/skinny/registerTextField.esm.js.map +1 -1
  150. package/skinny/registerTooltip.cjs.js +1 -1
  151. package/skinny/registerTooltip.esm.js +1 -1
  152. package/skinny/{utils-cf2632c9.esm.js → utils-5051df41.esm.js} +3 -2
  153. package/skinny/utils-5051df41.esm.js.map +1 -0
  154. package/skinny/{utils-18b2465b.cjs.js → utils-745db876.cjs.js} +2 -1
  155. package/skinny/utils-745db876.cjs.js.map +1 -0
  156. package/skinny/utils.d.ts +9 -2
  157. package/skinny/contexts-8a2a183b.esm.js +0 -13
  158. package/skinny/contexts-8a2a183b.esm.js.map +0 -1
  159. package/skinny/contexts-dd0ce341.cjs.js.map +0 -1
  160. package/skinny/option-utils-4f037568.esm.js +0 -153
  161. package/skinny/option-utils-4f037568.esm.js.map +0 -1
  162. package/skinny/option-utils-5e4e85bd.cjs.js +0 -162
  163. package/skinny/option-utils-5e4e85bd.cjs.js.map +0 -1
  164. package/skinny/utils-18b2465b.cjs.js.map +0 -1
  165. package/skinny/utils-cf2632c9.esm.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registerTextField.esm.js","sources":["../src/registerTextField.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { InputProps, TextFieldProps } from \"react-aria-components\";\nimport { TextField } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { registerDescription } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { registerInput } from \"./registerInput\";\nimport { registerLabel } from \"./registerLabel\";\nimport { registerTextArea } from \"./registerTextArea\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeChildComponentName,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseTextFieldProps extends TextFieldProps {\n label?: ReactNode;\n description?: ReactNode;\n enableAutoComplete?: boolean;\n multiline?: boolean;\n inputProps?: InputProps;\n children: ReactNode;\n}\n\nexport function BaseTextField(props: BaseTextFieldProps) {\n const { enableAutoComplete, autoComplete, children, ...rest } = props;\n\n return (\n <TextField\n autoComplete={enableAutoComplete ? autoComplete : undefined}\n {...rest}\n >\n {children}\n </TextField>\n );\n}\n\nconst componentName = makeComponentName(\"textField\");\n\nexport function registerTextField(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseTextField>\n) {\n registerComponentHelper(\n loader,\n BaseTextField,\n {\n name: componentName,\n displayName: \"Aria TextField\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerTextField\",\n importName: \"BaseTextField\",\n // TODO: Support for validate prop\n props: {\n ...getCommonInputProps<BaseTextFieldProps>(\"input\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"aria-label\",\n \"children\",\n \"isRequired\",\n ]),\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n // TODO: Not sure if needed\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n customValidationErrors: {\n // TODO: Not sure if needed\n type: \"array\",\n description: \"Errors for custom validation\",\n },\n // validate: {\n // type: \"function\" as const,\n // argNames: [\"value\"],\n // argValues: (_ps: any, ctx: any) => [ctx.data[0]],\n // },\n enableAutoComplete: {\n type: \"boolean\",\n description:\n \"Whether the browser is allowed to automatically complete the input\",\n defaultValueHint: false,\n },\n autoComplete: {\n type: \"choice\",\n hidden: ({ enableAutoComplete }: BaseTextFieldProps) =>\n !enableAutoComplete,\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 \"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 maxLength: {\n type: \"number\",\n description:\n \"The maximum number of characters supported by the input\",\n },\n minLength: {\n type: \"number\",\n description:\n \"The minimum number of characters supported by the input\",\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) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\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 },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n },\n onBlur: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onKeyDown: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n },\n onKeyUp: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n },\n onCopy: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n },\n onCut: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n },\n onPaste: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n },\n onCompositionStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n },\n onCompositionEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n },\n onCompositionUpdate: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n },\n onSelect: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectionEvent\", type: \"object\" }],\n },\n onBeforeInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n },\n onInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n },\n },\n // NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n componentName\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerInput(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerDescription(loader, { parentComponentName: thisName });\n registerTextArea(loader, { parentComponentName: thisName });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,SAAS,cAAc,KAA2B,EAAA;AACvD,EAAgE,MAAA,EAAA,GAAA,KAAA,EAAxD,EAAoB,kBAAA,EAAA,YAAA,EAAc,QA3B5C,EAAA,GA2BkE,IAAT,IAAS,GAAA,SAAA,CAAA,EAAA,EAAT,CAA/C,oBAAA,EAAoB,cAAc,EAAA,UAAA,CAAA,CAAA,CAAA;AAE1C,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA,cAAA,CAAA;AAAA,MACC,YAAA,EAAc,qBAAqB,YAAe,GAAA,KAAA,CAAA;AAAA,KAC9C,EAAA,IAAA,CAAA;AAAA,IAEH,QAAA;AAAA,GACH,CAAA;AAEJ,CAAA;AAEA,MAAM,aAAA,GAAgB,kBAAkB,WAAW,CAAA,CAAA;AAEnC,SAAA,iBAAA,CACd,QACA,SACA,EAAA;AACA,EAAA,uBAAA;AAAA,IACE,MAAA;AAAA,IACA,aAAA;AAAA,IACA;AAAA,MACE,IAAM,EAAA,aAAA;AAAA,MACN,WAAa,EAAA,gBAAA;AAAA,MACb,UAAY,EAAA,kDAAA;AAAA,MACZ,UAAY,EAAA,eAAA;AAAA;AAAA,MAEZ,KAAA,EAAO,aACF,CAAA,cAAA,CAAA,EAAA,EAAA,mBAAA,CAAwC,OAAS,EAAA;AAAA,QAClD,MAAA;AAAA,QACA,YAAA;AAAA,QACA,YAAA;AAAA,QACA,WAAA;AAAA,QACA,YAAA;AAAA,QACA,UAAA;AAAA,QACA,YAAA;AAAA,OACD,CATI,CAAA,EAAA;AAAA,QAUL,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,QAAA;AAAA,UACN,QA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EA,MAAQ,EAAA;AAAA,QACN,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA,OAAA;AAAA,UACX,YAAc,EAAA,UAAA;AAAA,UACd,YAAc,EAAA,MAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,QAAW,GAAA,sBAAA;AAAA,IACf,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,mBAAA;AAAA,IACX,aAAA;AAAA,GACF,CAAA;AAEA,EAAA,kBAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,mBAAA,CAAoB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC7D,EAAA,gBAAA,CAAiB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D;;;;"}
1
+ {"version":3,"file":"registerTextField.esm.js","sources":["../src/registerTextField.tsx"],"sourcesContent":["import React, { ReactNode } from \"react\";\nimport type { InputProps, TextFieldProps } from \"react-aria-components\";\nimport { TextField } from \"react-aria-components\";\nimport { getCommonInputProps } from \"./common\";\nimport { DESCRIPTION_COMPONENT_NAME } from \"./registerDescription\";\nimport { registerFieldError } from \"./registerFieldError\";\nimport { INPUT_COMPONENT_NAME, registerInput } from \"./registerInput\";\nimport { LABEL_COMPONENT_NAME, registerLabel } from \"./registerLabel\";\nimport { registerTextArea } from \"./registerTextArea\";\nimport {\n CodeComponentMetaOverrides,\n Registerable,\n makeChildComponentName,\n makeComponentName,\n registerComponentHelper,\n} from \"./utils\";\n\ninterface BaseTextFieldProps extends TextFieldProps {\n label?: ReactNode;\n description?: ReactNode;\n enableAutoComplete?: boolean;\n multiline?: boolean;\n inputProps?: InputProps;\n children: ReactNode;\n}\n\nexport function BaseTextField(props: BaseTextFieldProps) {\n const { enableAutoComplete, autoComplete, children, ...rest } = props;\n\n return (\n <TextField\n autoComplete={enableAutoComplete ? autoComplete : undefined}\n {...rest}\n >\n {children}\n </TextField>\n );\n}\n\nexport const TEXT_FIELD_COMPONENT_NAME = makeComponentName(\"textField\");\n\nexport function registerTextField(\n loader?: Registerable,\n overrides?: CodeComponentMetaOverrides<typeof BaseTextField>\n) {\n registerComponentHelper(\n loader,\n BaseTextField,\n {\n name: TEXT_FIELD_COMPONENT_NAME,\n displayName: \"Aria TextField\",\n importPath: \"@plasmicpkgs/react-aria/skinny/registerTextField\",\n importName: \"BaseTextField\",\n // TODO: Support for validate prop\n props: {\n ...getCommonInputProps<BaseTextFieldProps>(\"input\", [\n \"name\",\n \"isDisabled\",\n \"isReadOnly\",\n \"autoFocus\",\n \"aria-label\",\n \"isRequired\",\n ]),\n children: {\n type: \"slot\",\n mergeWithParent: true as any,\n defaultValue: {\n type: \"vbox\",\n styles: {\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n width: \"300px\",\n gap: \"5px\",\n },\n children: [\n {\n type: \"component\",\n name: LABEL_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Label\",\n },\n },\n },\n {\n type: \"component\",\n name: INPUT_COMPONENT_NAME,\n styles: {\n width: \"100%\",\n },\n },\n {\n type: \"component\",\n name: DESCRIPTION_COMPONENT_NAME,\n props: {\n children: {\n type: \"text\",\n value: \"Type something...\",\n },\n },\n },\n ],\n },\n },\n value: {\n type: \"string\",\n editOnly: true,\n uncontrolledProp: \"defaultValue\",\n description: \"The current value\",\n },\n isInvalid: {\n // TODO: Not sure if needed\n displayName: \"Invalid\",\n type: \"boolean\",\n description: \"Whether the input value is invalid\",\n defaultValueHint: false,\n },\n customValidationErrors: {\n // TODO: Not sure if needed\n type: \"array\",\n description: \"Errors for custom validation\",\n },\n // validate: {\n // type: \"function\" as const,\n // argNames: [\"value\"],\n // argValues: (_ps: any, ctx: any) => [ctx.data[0]],\n // },\n enableAutoComplete: {\n type: \"boolean\",\n description:\n \"Whether the browser is allowed to automatically complete the input\",\n defaultValueHint: false,\n },\n autoComplete: {\n type: \"choice\",\n hidden: ({ enableAutoComplete }: BaseTextFieldProps) =>\n !enableAutoComplete,\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 \"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 maxLength: {\n type: \"number\",\n description:\n \"The maximum number of characters supported by the input\",\n },\n minLength: {\n type: \"number\",\n description:\n \"The minimum number of characters supported by the input\",\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) => {\n try {\n new RegExp(value);\n return true;\n } catch (error) {\n return \"Invalid Regex\";\n }\n },\n },\n type: {\n type: \"choice\",\n defaultValueHint: \"text\",\n options: [\"text\", \"search\", \"url\", \"tel\", \"email\", \"password\"],\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 },\n validationBehavior: {\n type: \"choice\",\n options: [\"native\", \"aria\"],\n description:\n \"Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.\",\n defaultValueHint: \"native\",\n },\n onChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"value\", type: \"string\" }],\n },\n onFocus: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n },\n onBlur: {\n type: \"eventHandler\",\n argTypes: [{ name: \"focusEvent\", type: \"object\" }],\n },\n onFocusChange: {\n type: \"eventHandler\",\n argTypes: [{ name: \"isFocused\", type: \"boolean\" }],\n },\n onKeyDown: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n },\n onKeyUp: {\n type: \"eventHandler\",\n argTypes: [{ name: \"keyboardEvent\", type: \"object\" }],\n },\n onCopy: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n },\n onCut: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n },\n onPaste: {\n type: \"eventHandler\",\n argTypes: [{ name: \"clipbordEvent\", type: \"object\" }],\n },\n onCompositionStart: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n },\n onCompositionEnd: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n },\n onCompositionUpdate: {\n type: \"eventHandler\",\n argTypes: [{ name: \"compositionEvent\", type: \"object\" }],\n },\n onSelect: {\n type: \"eventHandler\",\n argTypes: [{ name: \"selectionEvent\", type: \"object\" }],\n },\n onBeforeInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n },\n onInput: {\n type: \"eventHandler\",\n argTypes: [{ name: \"inputEvent\", type: \"object\" }],\n },\n },\n // NOTE: React-Aria does not support render props for <Input> and <Textarea>, so focusVisible and inputHovered states are not implemented\n states: {\n value: {\n type: \"writable\",\n valueProp: \"value\",\n onChangeProp: \"onChange\",\n variableType: \"text\",\n },\n },\n trapsFocus: true,\n },\n overrides\n );\n\n const thisName = makeChildComponentName(\n overrides?.parentComponentName,\n TEXT_FIELD_COMPONENT_NAME\n );\n\n registerFieldError(loader, { parentComponentName: thisName });\n registerInput(loader, { parentComponentName: thisName });\n registerLabel(loader, { parentComponentName: thisName });\n registerTextArea(loader, { parentComponentName: thisName });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,SAAS,cAAc,KAA2B,EAAA;AACvD,EAAgE,MAAA,EAAA,GAAA,KAAA,EAAxD,EAAoB,kBAAA,EAAA,YAAA,EAAc,QA3B5C,EAAA,GA2BkE,IAAT,IAAS,GAAA,SAAA,CAAA,EAAA,EAAT,CAA/C,oBAAA,EAAoB,cAAc,EAAA,UAAA,CAAA,CAAA,CAAA;AAE1C,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA,cAAA,CAAA;AAAA,MACC,YAAA,EAAc,qBAAqB,YAAe,GAAA,KAAA,CAAA;AAAA,KAC9C,EAAA,IAAA,CAAA;AAAA,IAEH,QAAA;AAAA,GACH,CAAA;AAEJ,CAAA;AAEa,MAAA,yBAAA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AU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SACnD;AAAA,QACA,OAAS,EAAA;AAAA,UACP,IAAM,EAAA,cAAA;AAAA,UACN,UAAU,CAAC,EAAE,MAAM,YAAc,EAAA,IAAA,EAAM,UAAU,CAAA;AAAA,SACnD;AAAA,OACF,CAAA;AAAA;AAAA,MAEA,MAAQ,EAAA;AAAA,QACN,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,UAAA;AAAA,UACN,SAAW,EAAA,OAAA;AAAA,UACX,YAAc,EAAA,UAAA;AAAA,UACd,YAAc,EAAA,MAAA;AAAA,SAChB;AAAA,OACF;AAAA,MACA,UAAY,EAAA,IAAA;AAAA,KACd;AAAA,IACA,SAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,QAAW,GAAA,sBAAA;AAAA,IACf,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,mBAAA;AAAA,IACX,yBAAA;AAAA,GACF,CAAA;AAEA,EAAA,kBAAA,CAAmB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,aAAA,CAAc,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AACvD,EAAA,gBAAA,CAAiB,MAAQ,EAAA,EAAE,mBAAqB,EAAA,QAAA,EAAU,CAAA,CAAA;AAC5D;;;;"}
@@ -5,7 +5,7 @@ var React = require('react');
5
5
  var reactAria = require('react-aria');
6
6
  var flattenChildren = require('react-keyed-flatten-children');
7
7
  var reactStately = require('react-stately');
8
- var utils$1 = require('./utils-18b2465b.cjs.js');
8
+ var utils$1 = require('./utils-745db876.cjs.js');
9
9
  require('@plasmicapp/host/registerComponent');
10
10
 
11
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { useTooltipTrigger } from 'react-aria';
4
4
  import flattenChildren from 'react-keyed-flatten-children';
5
5
  import { useTooltipTriggerState } from 'react-stately';
6
- import { r as registerComponentHelper } from './utils-cf2632c9.esm.js';
6
+ import { r as registerComponentHelper } from './utils-5051df41.esm.js';
7
7
  import '@plasmicapp/host/registerComponent';
8
8
 
9
9
  var __defProp = Object.defineProperty;
@@ -36,6 +36,7 @@ function registerComponentHelper(loader, component, meta, overrides) {
36
36
  } else {
37
37
  registerComponent(component, meta);
38
38
  }
39
+ return meta;
39
40
  }
40
41
  function makeComponentName(name) {
41
42
  return `plasmic-react-aria-${name}`;
@@ -58,5 +59,5 @@ function withoutNils(array) {
58
59
  return array.filter((x) => x != null);
59
60
  }
60
61
 
61
- export { makeChildComponentName as a, extractPlasmicDataProps as e, makeComponentName as m, registerComponentHelper as r, withoutNils as w };
62
- //# sourceMappingURL=utils-cf2632c9.esm.js.map
62
+ export { makeComponentName as a, extractPlasmicDataProps as e, makeChildComponentName as m, registerComponentHelper as r, withoutNils as w };
63
+ //# sourceMappingURL=utils-5051df41.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-5051df41.esm.js","sources":["../src/utils.ts"],"sourcesContent":["import type { CodeComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport type BaseControlContextData = {\n isStandalone: boolean;\n};\n\nexport type Registerable = {\n registerComponent: typeof registerComponent;\n};\n\nexport type OtherCodeComponentsMeta = {\n text: CodeComponentMeta<any>;\n description: CodeComponentMeta<any>;\n};\n\nexport type CodeComponentMetaOverrides<T extends React.ComponentType<any>> =\n Partial<\n Pick<\n CodeComponentMeta<React.ComponentProps<T>>,\n \"parentComponentName\" | \"props\" | \"displayName\" | \"name\"\n >\n >;\n\nexport function registerComponentHelper<T extends React.ComponentType<any>>(\n loader: Registerable | undefined,\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>,\n overrides?: CodeComponentMetaOverrides<T>\n) {\n if (overrides) {\n meta = {\n ...meta,\n ...overrides,\n props: {\n ...meta.props,\n ...overrides.props,\n },\n };\n if (overrides.parentComponentName) {\n meta.name = makeChildComponentName(\n overrides.parentComponentName,\n meta.name\n );\n }\n }\n if (loader) {\n loader.registerComponent(component, meta);\n } else {\n registerComponent(component, meta);\n }\n return meta;\n}\n\nexport function makeComponentName(name: string) {\n return `plasmic-react-aria-${name}`;\n}\n\nexport function makeChildComponentName(\n fullParentName: string | undefined,\n fullChildName: string\n) {\n if (!fullParentName) {\n return fullChildName;\n }\n return `${fullParentName}-${fullChildName.replace(\n \"plasmic-react-aria-\",\n \"\"\n )}`;\n}\n\nexport interface Styleable {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function extractPlasmicDataProps(props: Record<string, any>) {\n return Object.fromEntries(\n Object.entries(props).filter(([key]) => key.startsWith(\"data-plasmic-\"))\n );\n}\n\nexport function withoutNils<T>(array: (T | undefined | null)[]) {\n return array.filter((x): x is T => x != null);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBO,SAAS,uBACd,CAAA,MAAA,EACA,SACA,EAAA,IAAA,EACA,SACA,EAAA;AACA,EAAA,IAAI,SAAW,EAAA;AACb,IAAO,IAAA,GAAA,aAAA,CAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACF,OACA,SAFE,CAAA,EAAA;AAAA,MAGL,KAAO,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EACF,IAAK,CAAA,KAAA,CAAA,EACL,SAAU,CAAA,KAAA,CAAA;AAAA,KAEjB,CAAA,CAAA;AACA,IAAA,IAAI,UAAU,mBAAqB,EAAA;AACjC,MAAA,IAAA,CAAK,IAAO,GAAA,sBAAA;AAAA,QACV,SAAU,CAAA,mBAAA;AAAA,QACV,IAAK,CAAA,IAAA;AAAA,OACP,CAAA;AAAA,KACF;AAAA,GACF;AACA,EAAA,IAAI,MAAQ,EAAA;AACV,IAAO,MAAA,CAAA,iBAAA,CAAkB,WAAW,IAAI,CAAA,CAAA;AAAA,GACnC,MAAA;AACL,IAAA,iBAAA,CAAkB,WAAW,IAAI,CAAA,CAAA;AAAA,GACnC;AACA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEO,SAAS,kBAAkB,IAAc,EAAA;AAC9C,EAAA,OAAO,CAAsB,mBAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AAC/B,CAAA;AAEgB,SAAA,sBAAA,CACd,gBACA,aACA,EAAA;AACA,EAAA,IAAI,CAAC,cAAgB,EAAA;AACnB,IAAO,OAAA,aAAA,CAAA;AAAA,GACT;AACA,EAAO,OAAA,CAAA,EAAG,kBAAkB,aAAc,CAAA,OAAA;AAAA,IACxC,qBAAA;AAAA,IACA,EAAA;AAAA,GACF,CAAA,CAAA,CAAA;AACF,CAAA;AAOO,SAAS,wBAAwB,KAA4B,EAAA;AAClE,EAAA,OAAO,MAAO,CAAA,WAAA;AAAA,IACZ,MAAO,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAE,MAAO,CAAA,CAAC,CAAC,GAAG,CAAM,KAAA,GAAA,CAAI,UAAW,CAAA,eAAe,CAAC,CAAA;AAAA,GACzE,CAAA;AACF,CAAA;AAEO,SAAS,YAAe,KAAiC,EAAA;AAC9D,EAAA,OAAO,KAAM,CAAA,MAAA,CAAO,CAAC,CAAA,KAAc,KAAK,IAAI,CAAA,CAAA;AAC9C;;;;"}
@@ -42,6 +42,7 @@ function registerComponentHelper(loader, component, meta, overrides) {
42
42
  } else {
43
43
  registerComponent__default.default(component, meta);
44
44
  }
45
+ return meta;
45
46
  }
46
47
  function makeComponentName(name) {
47
48
  return `plasmic-react-aria-${name}`;
@@ -69,4 +70,4 @@ exports.makeChildComponentName = makeChildComponentName;
69
70
  exports.makeComponentName = makeComponentName;
70
71
  exports.registerComponentHelper = registerComponentHelper;
71
72
  exports.withoutNils = withoutNils;
72
- //# sourceMappingURL=utils-18b2465b.cjs.js.map
73
+ //# sourceMappingURL=utils-745db876.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-745db876.cjs.js","sources":["../src/utils.ts"],"sourcesContent":["import type { CodeComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport type BaseControlContextData = {\n isStandalone: boolean;\n};\n\nexport type Registerable = {\n registerComponent: typeof registerComponent;\n};\n\nexport type OtherCodeComponentsMeta = {\n text: CodeComponentMeta<any>;\n description: CodeComponentMeta<any>;\n};\n\nexport type CodeComponentMetaOverrides<T extends React.ComponentType<any>> =\n Partial<\n Pick<\n CodeComponentMeta<React.ComponentProps<T>>,\n \"parentComponentName\" | \"props\" | \"displayName\" | \"name\"\n >\n >;\n\nexport function registerComponentHelper<T extends React.ComponentType<any>>(\n loader: Registerable | undefined,\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>,\n overrides?: CodeComponentMetaOverrides<T>\n) {\n if (overrides) {\n meta = {\n ...meta,\n ...overrides,\n props: {\n ...meta.props,\n ...overrides.props,\n },\n };\n if (overrides.parentComponentName) {\n meta.name = makeChildComponentName(\n overrides.parentComponentName,\n meta.name\n );\n }\n }\n if (loader) {\n loader.registerComponent(component, meta);\n } else {\n registerComponent(component, meta);\n }\n return meta;\n}\n\nexport function makeComponentName(name: string) {\n return `plasmic-react-aria-${name}`;\n}\n\nexport function makeChildComponentName(\n fullParentName: string | undefined,\n fullChildName: string\n) {\n if (!fullParentName) {\n return fullChildName;\n }\n return `${fullParentName}-${fullChildName.replace(\n \"plasmic-react-aria-\",\n \"\"\n )}`;\n}\n\nexport interface Styleable {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function extractPlasmicDataProps(props: Record<string, any>) {\n return Object.fromEntries(\n Object.entries(props).filter(([key]) => key.startsWith(\"data-plasmic-\"))\n );\n}\n\nexport function withoutNils<T>(array: (T | undefined | null)[]) {\n return array.filter((x): x is T => x != null);\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AA,CAAQ,KAAK,CAAA,CAAE,MAAO,CAAA,CAAC,CAAC,GAAG,CAAM,KAAA,GAAA,CAAI,UAAW,CAAA,eAAe,CAAC,CAAA;AAAA,GACzE,CAAA;AACF,CAAA;AAEO,SAAS,YAAe,KAAiC,EAAA;AAC9D,EAAA,OAAO,KAAM,CAAA,MAAA,CAAO,CAAC,CAAA,KAAc,KAAK,IAAI,CAAA,CAAA;AAC9C;;;;;;;;"}
package/skinny/utils.d.ts CHANGED
@@ -1,11 +1,18 @@
1
1
  import type { CodeComponentMeta } from "@plasmicapp/host";
2
2
  import registerComponent from "@plasmicapp/host/registerComponent";
3
3
  import React from "react";
4
+ export type BaseControlContextData = {
5
+ isStandalone: boolean;
6
+ };
4
7
  export type Registerable = {
5
8
  registerComponent: typeof registerComponent;
6
9
  };
7
- export type CodeComponentMetaOverrides<T extends React.ComponentType<any>> = Partial<Pick<CodeComponentMeta<React.ComponentProps<T>>, "parentComponentName" | "props" | "displayName">>;
8
- export declare function registerComponentHelper<T extends React.ComponentType<any>>(loader: Registerable | undefined, component: T, meta: CodeComponentMeta<React.ComponentProps<T>>, overrides?: CodeComponentMetaOverrides<T>): void;
10
+ export type OtherCodeComponentsMeta = {
11
+ text: CodeComponentMeta<any>;
12
+ description: CodeComponentMeta<any>;
13
+ };
14
+ export type CodeComponentMetaOverrides<T extends React.ComponentType<any>> = Partial<Pick<CodeComponentMeta<React.ComponentProps<T>>, "parentComponentName" | "props" | "displayName" | "name">>;
15
+ export declare function registerComponentHelper<T extends React.ComponentType<any>>(loader: Registerable | undefined, component: T, meta: CodeComponentMeta<React.ComponentProps<T>>, overrides?: CodeComponentMetaOverrides<T>): CodeComponentMeta<React.ComponentProps<T>>;
9
16
  export declare function makeComponentName(name: string): string;
10
17
  export declare function makeChildComponentName(fullParentName: string | undefined, fullChildName: string): string;
11
18
  export interface Styleable {
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
-
3
- const PlasmicSliderContext = React.createContext(void 0);
4
- React.createContext(void 0);
5
- const PlasmicListBoxContext = React.createContext(void 0);
6
- const PlasmicPopoverContext = React.createContext(void 0);
7
- const PlasmicItemContext = React.createContext(void 0);
8
- const PlasmicSectionContext = React.createContext(void 0);
9
- const PlasmicHeaderContext = React.createContext(void 0);
10
- const PlasmicInputContext = React.createContext(void 0);
11
-
12
- export { PlasmicListBoxContext as P, PlasmicInputContext as a, PlasmicSectionContext as b, PlasmicItemContext as c, PlasmicPopoverContext as d, PlasmicHeaderContext as e, PlasmicSliderContext as f };
13
- //# sourceMappingURL=contexts-8a2a183b.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contexts-8a2a183b.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\";\nimport { BaseSlider } from \"./registerSlider\";\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 PlasmicSliderContext = React.createContext<\n React.ComponentProps<typeof BaseSlider> | undefined\n>(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 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":";;AAiBa,MAAA,oBAAA,GAAuB,KAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEwB,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 +0,0 @@
1
- {"version":3,"file":"contexts-dd0ce341.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\";\nimport { BaseSlider } from \"./registerSlider\";\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 PlasmicSliderContext = React.createContext<\n React.ComponentProps<typeof BaseSlider> | undefined\n>(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 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":";;;;;;;;AAiBa,MAAA,oBAAA,GAAuBA,sBAAM,CAAA,aAAA,CAExC,KAAS,CAAA,EAAA;AAEwBA,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,153 +0,0 @@
1
- import React from 'react';
2
-
3
- function useStrictOptions(props) {
4
- const { options, optionInfo } = props;
5
- return React.useMemo(() => {
6
- return deriveStrictOptions({ options, optionInfo });
7
- }, [options, optionInfo]);
8
- }
9
- function deriveStrictOptions(props) {
10
- var _a;
11
- const { options, optionInfo } = props;
12
- let sectionCount = 0;
13
- const makeStrict = (op) => {
14
- var _a2, _b, _c, _d, _e, _f;
15
- if (!op) {
16
- return void 0;
17
- } else if (typeof op === "string" || typeof op === "number") {
18
- const item = {
19
- id: op
20
- };
21
- return item;
22
- } else if (optionInfo) {
23
- const info = optionInfo(op);
24
- if (info.type === "option-group") {
25
- const section = {
26
- type: "option-group",
27
- items: (_c = (_b = (_a2 = info.items) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => makeStrict(item))) == null ? void 0 : _c.filter((x) => !!x),
28
- label: info.label,
29
- key: `option-group-${sectionCount}`
30
- };
31
- sectionCount += 1;
32
- return section;
33
- } else {
34
- let item = info;
35
- if (!("id" in item)) {
36
- item = {
37
- type: "option",
38
- id: JSON.stringify(item)
39
- };
40
- }
41
- return item;
42
- }
43
- } else if (typeof op === "object") {
44
- if ("items" in op) {
45
- const section = {
46
- type: "option-group",
47
- items: (_f = (_e = (_d = op.items) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (item) => makeStrict(item))) == null ? void 0 : _f.filter((x) => !!x),
48
- label: op.label,
49
- key: `option-group-${sectionCount}`
50
- };
51
- sectionCount += 1;
52
- return section;
53
- } else {
54
- let item = op;
55
- if (!("id" in item)) {
56
- item = {
57
- type: "option",
58
- id: JSON.stringify(item)
59
- };
60
- }
61
- return item;
62
- }
63
- } else {
64
- return void 0;
65
- }
66
- };
67
- const strictOptions = (_a = options == null ? void 0 : options.map(makeStrict)) == null ? void 0 : _a.filter((x) => !!x);
68
- const optionText = (op) => {
69
- var _a2;
70
- return (_a2 = op.label) != null ? _a2 : op.id;
71
- };
72
- return { options: strictOptions, optionText };
73
- }
74
- function flattenOptions(options) {
75
- if (!options) {
76
- return [];
77
- } else {
78
- return options.flatMap(
79
- (op) => {
80
- var _a;
81
- return op.type === "option-group" ? (_a = op.items) != null ? _a : [] : op;
82
- }
83
- );
84
- }
85
- }
86
- function makeOptionsPropType() {
87
- const type = {
88
- type: "array",
89
- itemType: {
90
- type: "object",
91
- nameFunc: (item) => item.label || item.id,
92
- fields: {
93
- type: {
94
- type: "choice",
95
- options: [
96
- { value: "option", label: "Option" },
97
- { value: "option-group", label: "Option Group" }
98
- ],
99
- defaultValue: "option"
100
- },
101
- id: {
102
- type: "string",
103
- hidden: (_ps, _ctx, { item }) => item.type !== "option"
104
- },
105
- label: "string",
106
- items: {
107
- type: "array",
108
- displayName: "Options",
109
- hidden: (_ps, _ctx, { item }) => {
110
- return item.type !== "option-group";
111
- },
112
- itemType: {
113
- type: "object",
114
- nameFunc: (item) => item.label || item.id,
115
- fields: {
116
- id: "string",
117
- label: "string"
118
- }
119
- }
120
- }
121
- }
122
- },
123
- defaultValue: [
124
- {
125
- id: "option1",
126
- label: "Option 1",
127
- type: "option"
128
- },
129
- {
130
- id: "option2",
131
- label: "Option 2",
132
- type: "option"
133
- }
134
- ]
135
- };
136
- return type;
137
- }
138
- function makeValuePropType() {
139
- const type = {
140
- type: "choice",
141
- options: (ps) => {
142
- const { options, optionText } = deriveStrictOptions(ps);
143
- return flattenOptions(options).map((op) => ({
144
- value: op.id,
145
- label: optionText(op)
146
- }));
147
- }
148
- };
149
- return type;
150
- }
151
-
152
- export { makeValuePropType as a, flattenOptions as f, makeOptionsPropType as m, useStrictOptions as u };
153
- //# sourceMappingURL=option-utils-4f037568.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"option-utils-4f037568.esm.js","sources":["../src/option-utils.ts"],"sourcesContent":["import type { ArrayType, ChoiceType } from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface ObjectSectionType<T extends object> {\n label?: string;\n items?: ObjectItemType<T>[];\n}\ninterface FlexSectionType<T extends object> {\n label?: string;\n items?: FlexItemType<T>[];\n}\n\nexport type ObjectItemType<T extends object> = StrictOptionType | T;\ntype FlexItemType<T extends object> = ObjectItemType<T> | string;\n\nexport type FlexOptionType<T extends object> =\n | FlexItemType<T>\n | FlexSectionType<T>;\n\nexport type ObjectOptionType<T extends object> =\n | ObjectSectionType<T>\n | ObjectItemType<T>;\n\nexport interface HasOptions<T extends object> {\n options?: FlexOptionType<T>[];\n optionInfo?: (option: FlexOptionType<T>) => StrictOptionType;\n}\n\nexport interface StrictItemType {\n type?: \"option\";\n id: string;\n label?: string;\n isDisabled?: boolean;\n}\n\nexport interface StrictSectionType {\n type: \"option-group\";\n label?: string;\n items?: StrictItemType[];\n key: string;\n}\n\nexport type StrictOptionType = StrictItemType | StrictSectionType;\n\nexport function useStrictOptions<T extends object>(props: HasOptions<T>) {\n const { options, optionInfo } = props;\n return React.useMemo(() => {\n return deriveStrictOptions({ options, optionInfo });\n }, [options, optionInfo]);\n}\n\nexport function deriveStrictOptions<T extends object>(props: HasOptions<T>) {\n const { options, optionInfo } = props;\n let sectionCount = 0;\n\n const makeStrict = (op: FlexOptionType<T>): StrictOptionType | undefined => {\n if (!op) {\n return undefined;\n } else if (typeof op === \"string\" || typeof op === \"number\") {\n const item = {\n id: op,\n };\n return item;\n } else if (optionInfo) {\n const info = optionInfo(op);\n if (info.type === \"option-group\") {\n const section: StrictSectionType = {\n type: \"option-group\",\n items: info.items\n ?.map?.((item) => makeStrict(item) as StrictItemType)\n ?.filter((x) => !!x),\n label: info.label,\n key: `option-group-${sectionCount}`,\n };\n sectionCount += 1;\n return section;\n } else {\n let item = info;\n if (!(\"id\" in item)) {\n item = {\n type: \"option\",\n id: JSON.stringify(item),\n };\n }\n return item;\n }\n } else if (typeof op === \"object\") {\n if (\"items\" in op) {\n const section: StrictSectionType = {\n type: \"option-group\",\n items: op.items\n ?.map?.((item) => makeStrict(item) as StrictItemType)\n ?.filter((x) => !!x),\n label: op.label,\n key: `option-group-${sectionCount}`,\n };\n sectionCount += 1;\n return section;\n } else {\n let item = op;\n if (!(\"id\" in item)) {\n item = {\n type: \"option\",\n id: JSON.stringify(item),\n };\n }\n return item;\n }\n } else {\n return undefined;\n }\n };\n\n const strictOptions = options\n ?.map(makeStrict)\n ?.filter((x): x is StrictOptionType => !!x);\n\n const optionText = (op: StrictItemType) => {\n return op.label ?? op.id;\n };\n\n return { options: strictOptions, optionText };\n}\n\nexport function flattenOptions(\n options: (StrictItemType | StrictSectionType)[] | undefined\n): StrictItemType[] {\n if (!options) {\n return [];\n } else {\n return options.flatMap((op) =>\n op.type === \"option-group\" ? op.items ?? [] : op\n );\n }\n}\n\nexport function makeOptionsPropType() {\n const type: ArrayType<HasOptions<any>> = {\n type: \"array\",\n itemType: {\n type: \"object\",\n nameFunc: (item: any) => item.label || item.id,\n fields: {\n type: {\n type: \"choice\",\n options: [\n { value: \"option\", label: \"Option\" },\n { value: \"option-group\", label: \"Option Group\" },\n ],\n defaultValue: \"option\",\n },\n id: {\n type: \"string\",\n hidden: (_ps: any, _ctx: any, { item }: any) =>\n item.type !== \"option\",\n },\n label: \"string\",\n items: {\n type: \"array\",\n displayName: \"Options\",\n hidden: (_ps: any, _ctx: any, { item }: any) => {\n return item.type !== \"option-group\";\n },\n itemType: {\n type: \"object\",\n nameFunc: (item: any) => item.label || item.id,\n fields: {\n id: \"string\",\n label: \"string\",\n },\n },\n },\n },\n },\n defaultValue: [\n {\n id: \"option1\",\n label: \"Option 1\",\n type: \"option\",\n },\n {\n id: \"option2\",\n label: \"Option 2\",\n type: \"option\",\n },\n ],\n };\n return type;\n}\n\nexport function makeValuePropType() {\n const type: ChoiceType<HasOptions<any>> = {\n type: \"choice\",\n options: (ps: HasOptions<any>) => {\n const { options, optionText } = deriveStrictOptions(ps);\n return flattenOptions(options).map((op) => ({\n value: op.id,\n label: optionText(op),\n }));\n },\n };\n return type;\n}\n"],"names":["_a"],"mappings":";;AA4CO,SAAS,iBAAmC,KAAsB,EAAA;AACvE,EAAM,MAAA,EAAE,OAAS,EAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AAChC,EAAO,OAAA,KAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,OAAO,mBAAoB,CAAA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AAA;AACA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEO,SAAS,iBAAoB,GAAA;AAClC,EAAA,MAAM,IAAoC,GAAA;AAAA,IACxC,IAAM,EAAA,QAAA;AAAA,IACN,OAAA,EAAS,CAAC,EAAwB,KAAA;AAChC,MAAA,MAAM,EAAE,OAAA,EAAS,UAAW,EAAA,GAAI,oBAAoB,EAAE,CAAA,CAAA;AACtD,MAAA,OAAO,cAAe,CAAA,OAAO,CAAE,CAAA,GAAA,CAAI,CAAC,EAAQ,MAAA;AAAA,QAC1C,OAAO,EAAG,CAAA,EAAA;AAAA,QACV,KAAA,EAAO,WAAW,EAAE,CAAA;AAAA,OACpB,CAAA,CAAA,CAAA;AAAA,KACJ;AAAA,GACF,CAAA;AACA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
@@ -1,162 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var React__default = /*#__PURE__*/_interopDefault(React);
8
-
9
- function useStrictOptions(props) {
10
- const { options, optionInfo } = props;
11
- return React__default.default.useMemo(() => {
12
- return deriveStrictOptions({ options, optionInfo });
13
- }, [options, optionInfo]);
14
- }
15
- function deriveStrictOptions(props) {
16
- var _a;
17
- const { options, optionInfo } = props;
18
- let sectionCount = 0;
19
- const makeStrict = (op) => {
20
- var _a2, _b, _c, _d, _e, _f;
21
- if (!op) {
22
- return void 0;
23
- } else if (typeof op === "string" || typeof op === "number") {
24
- const item = {
25
- id: op
26
- };
27
- return item;
28
- } else if (optionInfo) {
29
- const info = optionInfo(op);
30
- if (info.type === "option-group") {
31
- const section = {
32
- type: "option-group",
33
- items: (_c = (_b = (_a2 = info.items) == null ? void 0 : _a2.map) == null ? void 0 : _b.call(_a2, (item) => makeStrict(item))) == null ? void 0 : _c.filter((x) => !!x),
34
- label: info.label,
35
- key: `option-group-${sectionCount}`
36
- };
37
- sectionCount += 1;
38
- return section;
39
- } else {
40
- let item = info;
41
- if (!("id" in item)) {
42
- item = {
43
- type: "option",
44
- id: JSON.stringify(item)
45
- };
46
- }
47
- return item;
48
- }
49
- } else if (typeof op === "object") {
50
- if ("items" in op) {
51
- const section = {
52
- type: "option-group",
53
- items: (_f = (_e = (_d = op.items) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (item) => makeStrict(item))) == null ? void 0 : _f.filter((x) => !!x),
54
- label: op.label,
55
- key: `option-group-${sectionCount}`
56
- };
57
- sectionCount += 1;
58
- return section;
59
- } else {
60
- let item = op;
61
- if (!("id" in item)) {
62
- item = {
63
- type: "option",
64
- id: JSON.stringify(item)
65
- };
66
- }
67
- return item;
68
- }
69
- } else {
70
- return void 0;
71
- }
72
- };
73
- const strictOptions = (_a = options == null ? void 0 : options.map(makeStrict)) == null ? void 0 : _a.filter((x) => !!x);
74
- const optionText = (op) => {
75
- var _a2;
76
- return (_a2 = op.label) != null ? _a2 : op.id;
77
- };
78
- return { options: strictOptions, optionText };
79
- }
80
- function flattenOptions(options) {
81
- if (!options) {
82
- return [];
83
- } else {
84
- return options.flatMap(
85
- (op) => {
86
- var _a;
87
- return op.type === "option-group" ? (_a = op.items) != null ? _a : [] : op;
88
- }
89
- );
90
- }
91
- }
92
- function makeOptionsPropType() {
93
- const type = {
94
- type: "array",
95
- itemType: {
96
- type: "object",
97
- nameFunc: (item) => item.label || item.id,
98
- fields: {
99
- type: {
100
- type: "choice",
101
- options: [
102
- { value: "option", label: "Option" },
103
- { value: "option-group", label: "Option Group" }
104
- ],
105
- defaultValue: "option"
106
- },
107
- id: {
108
- type: "string",
109
- hidden: (_ps, _ctx, { item }) => item.type !== "option"
110
- },
111
- label: "string",
112
- items: {
113
- type: "array",
114
- displayName: "Options",
115
- hidden: (_ps, _ctx, { item }) => {
116
- return item.type !== "option-group";
117
- },
118
- itemType: {
119
- type: "object",
120
- nameFunc: (item) => item.label || item.id,
121
- fields: {
122
- id: "string",
123
- label: "string"
124
- }
125
- }
126
- }
127
- }
128
- },
129
- defaultValue: [
130
- {
131
- id: "option1",
132
- label: "Option 1",
133
- type: "option"
134
- },
135
- {
136
- id: "option2",
137
- label: "Option 2",
138
- type: "option"
139
- }
140
- ]
141
- };
142
- return type;
143
- }
144
- function makeValuePropType() {
145
- const type = {
146
- type: "choice",
147
- options: (ps) => {
148
- const { options, optionText } = deriveStrictOptions(ps);
149
- return flattenOptions(options).map((op) => ({
150
- value: op.id,
151
- label: optionText(op)
152
- }));
153
- }
154
- };
155
- return type;
156
- }
157
-
158
- exports.flattenOptions = flattenOptions;
159
- exports.makeOptionsPropType = makeOptionsPropType;
160
- exports.makeValuePropType = makeValuePropType;
161
- exports.useStrictOptions = useStrictOptions;
162
- //# sourceMappingURL=option-utils-5e4e85bd.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"option-utils-5e4e85bd.cjs.js","sources":["../src/option-utils.ts"],"sourcesContent":["import type { ArrayType, ChoiceType } from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface ObjectSectionType<T extends object> {\n label?: string;\n items?: ObjectItemType<T>[];\n}\ninterface FlexSectionType<T extends object> {\n label?: string;\n items?: FlexItemType<T>[];\n}\n\nexport type ObjectItemType<T extends object> = StrictOptionType | T;\ntype FlexItemType<T extends object> = ObjectItemType<T> | string;\n\nexport type FlexOptionType<T extends object> =\n | FlexItemType<T>\n | FlexSectionType<T>;\n\nexport type ObjectOptionType<T extends object> =\n | ObjectSectionType<T>\n | ObjectItemType<T>;\n\nexport interface HasOptions<T extends object> {\n options?: FlexOptionType<T>[];\n optionInfo?: (option: FlexOptionType<T>) => StrictOptionType;\n}\n\nexport interface StrictItemType {\n type?: \"option\";\n id: string;\n label?: string;\n isDisabled?: boolean;\n}\n\nexport interface StrictSectionType {\n type: \"option-group\";\n label?: string;\n items?: StrictItemType[];\n key: string;\n}\n\nexport type StrictOptionType = StrictItemType | StrictSectionType;\n\nexport function useStrictOptions<T extends object>(props: HasOptions<T>) {\n const { options, optionInfo } = props;\n return React.useMemo(() => {\n return deriveStrictOptions({ options, optionInfo });\n }, [options, optionInfo]);\n}\n\nexport function deriveStrictOptions<T extends object>(props: HasOptions<T>) {\n const { options, optionInfo } = props;\n let sectionCount = 0;\n\n const makeStrict = (op: FlexOptionType<T>): StrictOptionType | undefined => {\n if (!op) {\n return undefined;\n } else if (typeof op === \"string\" || typeof op === \"number\") {\n const item = {\n id: op,\n };\n return item;\n } else if (optionInfo) {\n const info = optionInfo(op);\n if (info.type === \"option-group\") {\n const section: StrictSectionType = {\n type: \"option-group\",\n items: info.items\n ?.map?.((item) => makeStrict(item) as StrictItemType)\n ?.filter((x) => !!x),\n label: info.label,\n key: `option-group-${sectionCount}`,\n };\n sectionCount += 1;\n return section;\n } else {\n let item = info;\n if (!(\"id\" in item)) {\n item = {\n type: \"option\",\n id: JSON.stringify(item),\n };\n }\n return item;\n }\n } else if (typeof op === \"object\") {\n if (\"items\" in op) {\n const section: StrictSectionType = {\n type: \"option-group\",\n items: op.items\n ?.map?.((item) => makeStrict(item) as StrictItemType)\n ?.filter((x) => !!x),\n label: op.label,\n key: `option-group-${sectionCount}`,\n };\n sectionCount += 1;\n return section;\n } else {\n let item = op;\n if (!(\"id\" in item)) {\n item = {\n type: \"option\",\n id: JSON.stringify(item),\n };\n }\n return item;\n }\n } else {\n return undefined;\n }\n };\n\n const strictOptions = options\n ?.map(makeStrict)\n ?.filter((x): x is StrictOptionType => !!x);\n\n const optionText = (op: StrictItemType) => {\n return op.label ?? op.id;\n };\n\n return { options: strictOptions, optionText };\n}\n\nexport function flattenOptions(\n options: (StrictItemType | StrictSectionType)[] | undefined\n): StrictItemType[] {\n if (!options) {\n return [];\n } else {\n return options.flatMap((op) =>\n op.type === \"option-group\" ? op.items ?? [] : op\n );\n }\n}\n\nexport function makeOptionsPropType() {\n const type: ArrayType<HasOptions<any>> = {\n type: \"array\",\n itemType: {\n type: \"object\",\n nameFunc: (item: any) => item.label || item.id,\n fields: {\n type: {\n type: \"choice\",\n options: [\n { value: \"option\", label: \"Option\" },\n { value: \"option-group\", label: \"Option Group\" },\n ],\n defaultValue: \"option\",\n },\n id: {\n type: \"string\",\n hidden: (_ps: any, _ctx: any, { item }: any) =>\n item.type !== \"option\",\n },\n label: \"string\",\n items: {\n type: \"array\",\n displayName: \"Options\",\n hidden: (_ps: any, _ctx: any, { item }: any) => {\n return item.type !== \"option-group\";\n },\n itemType: {\n type: \"object\",\n nameFunc: (item: any) => item.label || item.id,\n fields: {\n id: \"string\",\n label: \"string\",\n },\n },\n },\n },\n },\n defaultValue: [\n {\n id: \"option1\",\n label: \"Option 1\",\n type: \"option\",\n },\n {\n id: \"option2\",\n label: \"Option 2\",\n type: \"option\",\n },\n ],\n };\n return type;\n}\n\nexport function makeValuePropType() {\n const type: ChoiceType<HasOptions<any>> = {\n type: \"choice\",\n options: (ps: HasOptions<any>) => {\n const { options, optionText } = deriveStrictOptions(ps);\n return flattenOptions(options).map((op) => ({\n value: op.id,\n label: optionText(op),\n }));\n },\n };\n return type;\n}\n"],"names":["React","_a"],"mappings":";;;;;;;;AA4CO,SAAS,iBAAmC,KAAsB,EAAA;AACvE,EAAM,MAAA,EAAE,OAAS,EAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AAChC,EAAO,OAAAA,sBAAA,CAAM,QAAQ,MAAM;AACzB,IAAA,OAAO,mBAAoB,CAAA,EAAE,OAAS,EAAA,UAAA,EAAY,CAAA,CAAA;AAAA,GACjD,EAAA,CAAC,OAAS,EAAA,UAAU,CAAC,CAAA,CAAA;AAC1B,CAAA;AAEO,SAAS,oBAAsC,KAAsB,EAAA;AAnD5E,EAAA,IAAA,EAAA,CAAA;AAoDE,EAAM,MAAA,EAAE,OAAS,EAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AAChC,EAAA,IAAI,YAAe,GAAA,CAAA,CAAA;AAEnB,EAAM,MAAA,UAAA,GAAa,CAAC,EAAwD,KAAA;AAvD9E,IAAA,IAAAC,GAAA,EAAA,EAAA,EAA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A,EAAO,WAAW,EAAE,CAAA;AAAA,OACpB,CAAA,CAAA,CAAA;AAAA,KACJ;AAAA,GACF,CAAA;AACA,EAAO,OAAA,IAAA,CAAA;AACT;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils-18b2465b.cjs.js","sources":["../src/utils.ts"],"sourcesContent":["import type { CodeComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport type Registerable = {\n registerComponent: typeof registerComponent;\n};\n\nexport type CodeComponentMetaOverrides<T extends React.ComponentType<any>> =\n Partial<\n Pick<\n CodeComponentMeta<React.ComponentProps<T>>,\n \"parentComponentName\" | \"props\" | \"displayName\"\n >\n >;\n\nexport function registerComponentHelper<T extends React.ComponentType<any>>(\n loader: Registerable | undefined,\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>,\n overrides?: CodeComponentMetaOverrides<T>\n) {\n if (overrides) {\n meta = {\n ...meta,\n ...overrides,\n props: {\n ...meta.props,\n ...overrides.props,\n },\n };\n if (overrides.parentComponentName) {\n meta.name = makeChildComponentName(\n overrides.parentComponentName,\n meta.name\n );\n }\n }\n if (loader) {\n loader.registerComponent(component, meta);\n } else {\n registerComponent(component, meta);\n }\n}\n\nexport function makeComponentName(name: string) {\n return `plasmic-react-aria-${name}`;\n}\n\nexport function makeChildComponentName(\n fullParentName: string | undefined,\n fullChildName: string\n) {\n if (!fullParentName) {\n return fullChildName;\n }\n return `${fullParentName}-${fullChildName.replace(\n \"plasmic-react-aria-\",\n \"\"\n )}`;\n}\n\nexport interface Styleable {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function extractPlasmicDataProps(props: Record<string, any>) {\n return Object.fromEntries(\n Object.entries(props).filter(([key]) => key.startsWith(\"data-plasmic-\"))\n );\n}\n\nexport function withoutNils<T>(array: (T | undefined | null)[]) {\n return array.filter((x): x is T => x != null);\n}\n"],"names":["registerComponent"],"mappings":";;;;;;;;;;;;;;;;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A,CAAI,UAAW,CAAA,eAAe,CAAC,CAAA;AAAA,GACzE,CAAA;AACF,CAAA;AAEO,SAAS,YAAe,KAAiC,EAAA;AAC9D,EAAA,OAAO,KAAM,CAAA,MAAA,CAAO,CAAC,CAAA,KAAc,KAAK,IAAI,CAAA,CAAA;AAC9C;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils-cf2632c9.esm.js","sources":["../src/utils.ts"],"sourcesContent":["import type { CodeComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport type Registerable = {\n registerComponent: typeof registerComponent;\n};\n\nexport type CodeComponentMetaOverrides<T extends React.ComponentType<any>> =\n Partial<\n Pick<\n CodeComponentMeta<React.ComponentProps<T>>,\n \"parentComponentName\" | \"props\" | \"displayName\"\n >\n >;\n\nexport function registerComponentHelper<T extends React.ComponentType<any>>(\n loader: Registerable | undefined,\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>,\n overrides?: CodeComponentMetaOverrides<T>\n) {\n if (overrides) {\n meta = {\n ...meta,\n ...overrides,\n props: {\n ...meta.props,\n ...overrides.props,\n },\n };\n if (overrides.parentComponentName) {\n meta.name = makeChildComponentName(\n overrides.parentComponentName,\n meta.name\n );\n }\n }\n if (loader) {\n loader.registerComponent(component, meta);\n } else {\n registerComponent(component, meta);\n }\n}\n\nexport function makeComponentName(name: string) {\n return `plasmic-react-aria-${name}`;\n}\n\nexport function makeChildComponentName(\n fullParentName: string | undefined,\n fullChildName: string\n) {\n if (!fullParentName) {\n return fullChildName;\n }\n return `${fullParentName}-${fullChildName.replace(\n \"plasmic-react-aria-\",\n \"\"\n )}`;\n}\n\nexport interface Styleable {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function extractPlasmicDataProps(props: Record<string, any>) {\n return Object.fromEntries(\n Object.entries(props).filter(([key]) => key.startsWith(\"data-plasmic-\"))\n );\n}\n\nexport function withoutNils<T>(array: (T | undefined | null)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