@app-studio/components 0.12.0 → 0.12.1

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 (335) hide show
  1. package/README.md +1 -1
  2. package/dist/alert.cjs.js +1 -1
  3. package/dist/alert.esm.mjs +1 -1
  4. package/dist/avatar.cjs.js +1 -1
  5. package/dist/avatar.esm.mjs +1 -1
  6. package/dist/button.cjs.js +1 -1
  7. package/dist/button.esm.mjs +1 -1
  8. package/dist/card.cjs.js +1 -1
  9. package/dist/card.esm.mjs +1 -1
  10. package/dist/checkbox.cjs.js +1 -1
  11. package/dist/checkbox.esm.mjs +1 -1
  12. package/dist/chunks/{Alert-Q1HlVX8f.mjs → Alert-B5vkpWXy.mjs} +55 -42
  13. package/dist/chunks/Alert-B5vkpWXy.mjs.map +1 -0
  14. package/dist/chunks/Alert-BHlgJZAo.cjs +2 -0
  15. package/dist/chunks/Alert-BHlgJZAo.cjs.map +1 -0
  16. package/dist/chunks/{AttachmentPreview-8d8gZ5kk.mjs → AttachmentPreview-B2-kP0Bn.mjs} +1745 -2997
  17. package/dist/chunks/AttachmentPreview-B2-kP0Bn.mjs.map +1 -0
  18. package/dist/chunks/AttachmentPreview-BZV6xSa4.cjs +2 -0
  19. package/dist/chunks/AttachmentPreview-BZV6xSa4.cjs.map +1 -0
  20. package/dist/chunks/{Avatar-D-GkyL2c.mjs → Avatar-CC1SDq6h.mjs} +34 -32
  21. package/dist/chunks/Avatar-CC1SDq6h.mjs.map +1 -0
  22. package/dist/chunks/Avatar-DtfD7QQ6.cjs +2 -0
  23. package/dist/chunks/Avatar-DtfD7QQ6.cjs.map +1 -0
  24. package/dist/chunks/Button.core-BB25t8wB.cjs +7 -0
  25. package/dist/chunks/Button.core-BB25t8wB.cjs.map +1 -0
  26. package/dist/chunks/{Button.core-Bc5cSn_z.mjs → Button.core-oxCH_VTn.mjs} +236 -222
  27. package/dist/chunks/Button.core-oxCH_VTn.mjs.map +1 -0
  28. package/dist/chunks/Button.pilot-BJK10U1-.mjs +6 -0
  29. package/dist/chunks/{Button.pilot-C4BIb08S.mjs.map → Button.pilot-BJK10U1-.mjs.map} +1 -1
  30. package/dist/chunks/Button.pilot-eWGY9Jm5.cjs +2 -0
  31. package/dist/chunks/{Button.pilot-JmR2DCSE.cjs.map → Button.pilot-eWGY9Jm5.cjs.map} +1 -1
  32. package/dist/chunks/Card-CK_D7gzP.cjs +2 -0
  33. package/dist/chunks/Card-CK_D7gzP.cjs.map +1 -0
  34. package/dist/chunks/Card-ymI5Thma.mjs +208 -0
  35. package/dist/chunks/Card-ymI5Thma.mjs.map +1 -0
  36. package/dist/chunks/Checkbox-BXbEChdd.cjs +2 -0
  37. package/dist/chunks/Checkbox-BXbEChdd.cjs.map +1 -0
  38. package/dist/chunks/Checkbox-DnwrApdj.mjs +21 -0
  39. package/dist/chunks/Checkbox-DnwrApdj.mjs.map +1 -0
  40. package/dist/chunks/Checkbox.view-B7K8ycvs.cjs +2 -0
  41. package/dist/chunks/Checkbox.view-B7K8ycvs.cjs.map +1 -0
  42. package/dist/chunks/{Checkbox.view-dhc-rfEX.mjs → Checkbox.view-CCGfVtqr.mjs} +140 -119
  43. package/dist/chunks/Checkbox.view-CCGfVtqr.mjs.map +1 -0
  44. package/dist/chunks/{Formik.Uploader-DRIyxMI0.mjs → Formik.Uploader-CIYySBWB.mjs} +18 -18
  45. package/dist/chunks/{Formik.Uploader-DRIyxMI0.mjs.map → Formik.Uploader-CIYySBWB.mjs.map} +1 -1
  46. package/dist/chunks/{Formik.Uploader-D0nzjyau.cjs → Formik.Uploader-DePTdd7A.cjs} +4 -4
  47. package/dist/chunks/{Formik.Uploader-D0nzjyau.cjs.map → Formik.Uploader-DePTdd7A.cjs.map} +1 -1
  48. package/dist/chunks/{Icon-DrAZswNH.mjs → Icon-Cy5kEVYz.mjs} +60 -60
  49. package/dist/chunks/{Icon-DrAZswNH.mjs.map → Icon-Cy5kEVYz.mjs.map} +1 -1
  50. package/dist/chunks/Modal-BzlrQQu5.cjs +2 -0
  51. package/dist/chunks/Modal-BzlrQQu5.cjs.map +1 -0
  52. package/dist/chunks/{Modal-DkckCT8-.mjs → Modal-CqbUQXoc.mjs} +92 -75
  53. package/dist/chunks/Modal-CqbUQXoc.mjs.map +1 -0
  54. package/dist/chunks/Select-CrOxhfvQ.mjs +28 -0
  55. package/dist/chunks/Select-CrOxhfvQ.mjs.map +1 -0
  56. package/dist/chunks/Select-DRMUC3NX.cjs +2 -0
  57. package/dist/chunks/Select-DRMUC3NX.cjs.map +1 -0
  58. package/dist/chunks/{Select.view-CPMqT8pn.mjs → Select.view-BHMiRNIc.mjs} +126 -124
  59. package/dist/chunks/Select.view-BHMiRNIc.mjs.map +1 -0
  60. package/dist/chunks/Select.view-BV01zWHM.cjs +2 -0
  61. package/dist/chunks/Select.view-BV01zWHM.cjs.map +1 -0
  62. package/dist/chunks/{Switch-DWx1g3jT.mjs → Switch-04GGHGrV.mjs} +2 -2
  63. package/dist/chunks/{Switch-DWx1g3jT.mjs.map → Switch-04GGHGrV.mjs.map} +1 -1
  64. package/dist/chunks/{Switch-D80yPNFV.cjs → Switch-DqgmPp8M.cjs} +2 -2
  65. package/dist/chunks/{Switch-D80yPNFV.cjs.map → Switch-DqgmPp8M.cjs.map} +1 -1
  66. package/dist/chunks/Switch.view-6ncV6Ifz.cjs +2 -0
  67. package/dist/chunks/Switch.view-6ncV6Ifz.cjs.map +1 -0
  68. package/dist/chunks/{Switch.view-QLZ7O5Z7.mjs → Switch.view-DUvFLhyy.mjs} +34 -39
  69. package/dist/chunks/Switch.view-DUvFLhyy.mjs.map +1 -0
  70. package/dist/chunks/Tabs-BdoE88Ee.mjs +567 -0
  71. package/dist/chunks/Tabs-BdoE88Ee.mjs.map +1 -0
  72. package/dist/chunks/Tabs-DneEt-le.cjs +2 -0
  73. package/dist/chunks/Tabs-DneEt-le.cjs.map +1 -0
  74. package/dist/chunks/{TextField-DOU2CL5J.mjs → TextField-Bwc_F2Rq.mjs} +97 -86
  75. package/dist/chunks/TextField-Bwc_F2Rq.mjs.map +1 -0
  76. package/dist/chunks/TextField-CwaxvcqN.cjs +2 -0
  77. package/dist/chunks/TextField-CwaxvcqN.cjs.map +1 -0
  78. package/dist/chunks/{default-nRKhMTzF.mjs → default-1F10zins.mjs} +2 -2
  79. package/dist/chunks/{default-nRKhMTzF.mjs.map → default-1F10zins.mjs.map} +1 -1
  80. package/dist/chunks/default-W-NMTEJ3.cjs +2 -0
  81. package/dist/chunks/default-W-NMTEJ3.cjs.map +1 -0
  82. package/dist/chunks/designSystem.page-BgmjSYsz.cjs +11 -0
  83. package/dist/chunks/designSystem.page-BgmjSYsz.cjs.map +1 -0
  84. package/dist/chunks/{designSystem.page-K0ajTvy7.mjs → designSystem.page-CM_h09Ui.mjs} +18 -16
  85. package/dist/chunks/designSystem.page-CM_h09Ui.mjs.map +1 -0
  86. package/dist/chunks/{FieldWrapper-Bb0j8Iog.mjs → useFieldDesignSystemProps-BZj7d9gK.mjs} +118 -87
  87. package/dist/chunks/useFieldDesignSystemProps-BZj7d9gK.mjs.map +1 -0
  88. package/dist/chunks/useFieldDesignSystemProps-CgVU3R10.cjs +2 -0
  89. package/dist/chunks/useFieldDesignSystemProps-CgVU3R10.cjs.map +1 -0
  90. package/dist/design-system-preview.cjs.js +1 -1
  91. package/dist/design-system-preview.esm.mjs +14 -14
  92. package/dist/formik.cjs.js +1 -1
  93. package/dist/formik.esm.mjs +2 -2
  94. package/dist/link.esm.mjs +1 -1
  95. package/dist/modal.cjs.js +1 -1
  96. package/dist/modal.esm.mjs +1 -1
  97. package/dist/native/components/ActionSheet/ActionSheet/ActionSheet.view.native.js +13 -5
  98. package/dist/native/components/ActionSheet/ActionSheet/ActionSheet.view.native.js.map +1 -1
  99. package/dist/native/components/Alert/Alert/Alert.view.d.ts +3 -1
  100. package/dist/native/components/Alert/Alert/Alert.view.js +16 -6
  101. package/dist/native/components/Alert/Alert/Alert.view.js.map +1 -1
  102. package/dist/native/components/Alert/Alert/Alert.view.native.d.ts +3 -1
  103. package/dist/native/components/Alert/Alert/Alert.view.native.js +15 -4
  104. package/dist/native/components/Alert/Alert/Alert.view.native.js.map +1 -1
  105. package/dist/native/components/Alert/Alert.js +3 -3
  106. package/dist/native/components/Alert/Alert.js.map +1 -1
  107. package/dist/native/components/Avatar/Avatar/Avatar.props.d.ts +1 -1
  108. package/dist/native/components/Avatar/Avatar/Avatar.state.d.ts +2 -2
  109. package/dist/native/components/Avatar/Avatar/Avatar.state.js +6 -5
  110. package/dist/native/components/Avatar/Avatar/Avatar.state.js.map +1 -1
  111. package/dist/native/components/Avatar/Avatar/Avatar.view.d.ts +1 -1
  112. package/dist/native/components/Avatar/Avatar/Avatar.view.js +2 -2
  113. package/dist/native/components/Avatar/Avatar/Avatar.view.js.map +1 -1
  114. package/dist/native/components/Avatar/Avatar.js +2 -2
  115. package/dist/native/components/Avatar/Avatar.js.map +1 -1
  116. package/dist/native/components/Button/Button/Button.style.js +11 -6
  117. package/dist/native/components/Button/Button/Button.style.js.map +1 -1
  118. package/dist/native/components/Button/Button/Button.view.d.ts +2 -0
  119. package/dist/native/components/Button/Button/Button.view.js +9 -3
  120. package/dist/native/components/Button/Button/Button.view.js.map +1 -1
  121. package/dist/native/components/Button/Button/Button.view.native.d.ts +1 -0
  122. package/dist/native/components/Button/Button/Button.view.native.js +19 -4
  123. package/dist/native/components/Button/Button/Button.view.native.js.map +1 -1
  124. package/dist/native/components/Button/Button.core.js +3 -3
  125. package/dist/native/components/Button/Button.core.js.map +1 -1
  126. package/dist/native/components/Card/Card/Card.view.d.ts +3 -1
  127. package/dist/native/components/Card/Card/Card.view.js +32 -24
  128. package/dist/native/components/Card/Card/Card.view.js.map +1 -1
  129. package/dist/native/components/Card/Card.js +3 -3
  130. package/dist/native/components/Card/Card.js.map +1 -1
  131. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +1 -0
  132. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +5 -1
  133. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.state.js +13 -0
  134. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.state.js.map +1 -1
  135. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +3 -12
  136. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.style.js +3 -12
  137. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.style.js.map +1 -1
  138. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js +19 -16
  139. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js.map +1 -1
  140. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js +36 -30
  141. package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js.map +1 -1
  142. package/dist/native/components/Form/Checkbox/Checkbox.js +3 -3
  143. package/dist/native/components/Form/Checkbox/Checkbox.js.map +1 -1
  144. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js +8 -2
  145. package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js.map +1 -1
  146. package/dist/native/components/Form/Select/Select/Select.props.d.ts +1 -0
  147. package/dist/native/components/Form/Select/Select/Select.view.js +2 -2
  148. package/dist/native/components/Form/Select/Select/Select.view.js.map +1 -1
  149. package/dist/native/components/Form/Select/Select/Select.view.native.js +17 -4
  150. package/dist/native/components/Form/Select/Select/Select.view.native.js.map +1 -1
  151. package/dist/native/components/Form/Select/Select.js +3 -3
  152. package/dist/native/components/Form/Select/Select.js.map +1 -1
  153. package/dist/native/components/Form/Switch/Switch/Switch.style.d.ts +3 -8
  154. package/dist/native/components/Form/Switch/Switch/Switch.style.js +3 -8
  155. package/dist/native/components/Form/Switch/Switch/Switch.style.js.map +1 -1
  156. package/dist/native/components/Form/Switch/Switch/Switch.view.js +1 -5
  157. package/dist/native/components/Form/Switch/Switch/Switch.view.js.map +1 -1
  158. package/dist/native/components/Form/Switch/Switch/Switch.view.native.js +7 -4
  159. package/dist/native/components/Form/Switch/Switch/Switch.view.native.js.map +1 -1
  160. package/dist/native/components/Form/TextField/TextField/TextField.props.d.ts +1 -0
  161. package/dist/native/components/Form/TextField/TextField/TextField.view.js +2 -2
  162. package/dist/native/components/Form/TextField/TextField/TextField.view.js.map +1 -1
  163. package/dist/native/components/Form/TextField/TextField/TextField.view.native.js +9 -4
  164. package/dist/native/components/Form/TextField/TextField/TextField.view.native.js.map +1 -1
  165. package/dist/native/components/Form/TextField/TextField.js +3 -3
  166. package/dist/native/components/Form/TextField/TextField.js.map +1 -1
  167. package/dist/native/components/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -0
  168. package/dist/native/components/Input/FieldContent/FieldContent.js +16 -3
  169. package/dist/native/components/Input/FieldContent/FieldContent.js.map +1 -1
  170. package/dist/native/components/Input/useFieldDesignSystemProps.d.ts +9 -0
  171. package/dist/native/components/Input/useFieldDesignSystemProps.js +15 -0
  172. package/dist/native/components/Input/useFieldDesignSystemProps.js.map +1 -0
  173. package/dist/native/components/Modal/Modal/Modal.props.d.ts +2 -0
  174. package/dist/native/components/Modal/Modal/Modal.view.js +6 -4
  175. package/dist/native/components/Modal/Modal/Modal.view.js.map +1 -1
  176. package/dist/native/components/Modal/Modal/Modal.view.native.js +5 -4
  177. package/dist/native/components/Modal/Modal/Modal.view.native.js.map +1 -1
  178. package/dist/native/components/Tabs/Tabs/TabHeader.d.ts +2 -0
  179. package/dist/native/components/Tabs/Tabs/TabHeader.js +7 -6
  180. package/dist/native/components/Tabs/Tabs/TabHeader.js.map +1 -1
  181. package/dist/native/components/Tabs/Tabs/Tabs.props.d.ts +10 -0
  182. package/dist/native/components/Tabs/Tabs/Tabs.state.d.ts +1 -0
  183. package/dist/native/components/Tabs/Tabs/Tabs.state.js +20 -43
  184. package/dist/native/components/Tabs/Tabs/Tabs.state.js.map +1 -1
  185. package/dist/native/components/Tabs/Tabs/Tabs.styles.d.ts +11 -0
  186. package/dist/native/components/Tabs/Tabs/Tabs.styles.js +7 -0
  187. package/dist/native/components/Tabs/Tabs/Tabs.styles.js.map +1 -0
  188. package/dist/native/components/Tabs/Tabs/Tabs.type.d.ts +4 -0
  189. package/dist/native/components/Tabs/Tabs/Tabs.view.js +146 -58
  190. package/dist/native/components/Tabs/Tabs/Tabs.view.js.map +1 -1
  191. package/dist/native/components/Tabs/Tabs/Tabs.view.native.js +83 -19
  192. package/dist/native/components/Tabs/Tabs/Tabs.view.native.js.map +1 -1
  193. package/dist/native/components/Tabs/Tabs.js +8 -8
  194. package/dist/native/components/Tabs/Tabs.js.map +1 -1
  195. package/dist/native/components/index.js +1 -1
  196. package/dist/native/components/index.js.map +1 -1
  197. package/dist/native/components/pilot/blocks/SettingsPanel.js +3 -1
  198. package/dist/native/components/pilot/blocks/SettingsPanel.js.map +1 -1
  199. package/dist/native/components/pilot/blocks/SignIn.js +3 -1
  200. package/dist/native/components/pilot/blocks/SignIn.js.map +1 -1
  201. package/dist/native/design-system/DesignSystemProvider.d.ts +1 -1
  202. package/dist/native/design-system/DesignSystemProvider.js +2 -2
  203. package/dist/native/design-system/DesignSystemProvider.js.map +1 -1
  204. package/dist/native/design-system/configs/default.json +1 -1
  205. package/dist/native/design-system/theme.d.ts +10 -1
  206. package/dist/native/design-system/theme.js +41 -12
  207. package/dist/native/design-system/theme.js.map +1 -1
  208. package/dist/native/design-system/types.d.ts +3 -9
  209. package/dist/native/design-system/utils.d.ts +5 -2
  210. package/dist/native/design-system/utils.js +42 -10
  211. package/dist/native/design-system/utils.js.map +1 -1
  212. package/dist/presets.cjs.js +1 -1
  213. package/dist/presets.esm.mjs +1 -1
  214. package/dist/registry/alert.json +13 -12
  215. package/dist/registry/avatar.json +15 -15
  216. package/dist/registry/button.json +14 -12
  217. package/dist/registry/card.json +13 -13
  218. package/dist/registry/checkbox.json +14 -11
  219. package/dist/registry/modal.json +8 -4
  220. package/dist/registry/registry.json +178 -78
  221. package/dist/registry/select.json +20 -12
  222. package/dist/registry/settings-panel.json +6 -2
  223. package/dist/registry/sign-in.json +6 -2
  224. package/dist/registry/switch.json +15 -15
  225. package/dist/registry/tabs.json +23 -18
  226. package/dist/registry/text-field.json +19 -11
  227. package/dist/registry/theme.json +71 -0
  228. package/dist/select.cjs.js +1 -1
  229. package/dist/select.esm.mjs +1 -1
  230. package/dist/settings-panel.cjs.js +1 -1
  231. package/dist/settings-panel.cjs.js.map +1 -1
  232. package/dist/settings-panel.esm.mjs +9 -9
  233. package/dist/settings-panel.esm.mjs.map +1 -1
  234. package/dist/sign-in.cjs.js +1 -1
  235. package/dist/sign-in.cjs.js.map +1 -1
  236. package/dist/sign-in.esm.mjs +15 -15
  237. package/dist/sign-in.esm.mjs.map +1 -1
  238. package/dist/switch.cjs.js +1 -1
  239. package/dist/switch.esm.mjs +1 -1
  240. package/dist/tabs.cjs.js +1 -1
  241. package/dist/tabs.esm.mjs +1 -1
  242. package/dist/text-field.cjs.js +1 -1
  243. package/dist/text-field.esm.mjs +1 -1
  244. package/dist/theme.cjs.js +1 -1
  245. package/dist/theme.cjs.js.map +1 -1
  246. package/dist/theme.esm.mjs +125 -72
  247. package/dist/theme.esm.mjs.map +1 -1
  248. package/dist/types/components/Alert/Alert/Alert.view.d.ts +3 -1
  249. package/dist/types/components/Avatar/Avatar/Avatar.props.d.ts +1 -1
  250. package/dist/types/components/Avatar/Avatar/Avatar.state.d.ts +2 -2
  251. package/dist/types/components/Avatar/Avatar/Avatar.view.d.ts +1 -1
  252. package/dist/types/components/Button/Button/Button.view.d.ts +2 -0
  253. package/dist/types/components/Card/Card/Card.view.d.ts +3 -1
  254. package/dist/types/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +1 -0
  255. package/dist/types/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +5 -1
  256. package/dist/types/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +3 -12
  257. package/dist/types/components/Form/Select/Select/Select.props.d.ts +1 -0
  258. package/dist/types/components/Form/Switch/Switch/Switch.style.d.ts +3 -8
  259. package/dist/types/components/Form/TextField/TextField/TextField.props.d.ts +1 -0
  260. package/dist/types/components/IconPicker/IconPicker/IconPicker.state.d.ts +2 -2
  261. package/dist/types/components/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -0
  262. package/dist/types/components/Input/useFieldDesignSystemProps.d.ts +9 -0
  263. package/dist/types/components/Modal/Modal/Modal.props.d.ts +2 -0
  264. package/dist/types/components/Tabs/Tabs/TabHeader.d.ts +2 -0
  265. package/dist/types/components/Tabs/Tabs/Tabs.props.d.ts +10 -0
  266. package/dist/types/components/Tabs/Tabs/Tabs.state.d.ts +1 -0
  267. package/dist/types/components/Tabs/Tabs/Tabs.styles.d.ts +11 -0
  268. package/dist/types/components/Tabs/Tabs/Tabs.type.d.ts +4 -0
  269. package/dist/types/design-system/DesignSystemProvider.d.ts +1 -1
  270. package/dist/types/design-system/configs/default.json.d.ts +1 -1
  271. package/dist/types/design-system/theme.d.ts +10 -1
  272. package/dist/types/design-system/types.d.ts +3 -9
  273. package/dist/types/design-system/utils.d.ts +5 -2
  274. package/dist/web.cjs.js +16 -16
  275. package/dist/web.esm.mjs +44 -41
  276. package/dist/web.umd.js +38 -38
  277. package/dist/web.umd.js.map +1 -1
  278. package/docs/getting-started/react-native.md +17 -3
  279. package/docs/guides/performance.mdx +5 -0
  280. package/docs/guides/react-native.mdx +10 -0
  281. package/docs/guides/registry-guide.mdx +72 -8
  282. package/package.json +6 -4
  283. package/dist/chunks/Alert-Bjl40k3x.cjs +0 -2
  284. package/dist/chunks/Alert-Bjl40k3x.cjs.map +0 -1
  285. package/dist/chunks/Alert-Q1HlVX8f.mjs.map +0 -1
  286. package/dist/chunks/AttachmentPreview-8d8gZ5kk.mjs.map +0 -1
  287. package/dist/chunks/AttachmentPreview-Bwrz5TJh.cjs +0 -2
  288. package/dist/chunks/AttachmentPreview-Bwrz5TJh.cjs.map +0 -1
  289. package/dist/chunks/Avatar-BB0DeN9j.cjs +0 -2
  290. package/dist/chunks/Avatar-BB0DeN9j.cjs.map +0 -1
  291. package/dist/chunks/Avatar-D-GkyL2c.mjs.map +0 -1
  292. package/dist/chunks/Button.core-Bc5cSn_z.mjs.map +0 -1
  293. package/dist/chunks/Button.core-BhtOm8ak.cjs +0 -7
  294. package/dist/chunks/Button.core-BhtOm8ak.cjs.map +0 -1
  295. package/dist/chunks/Button.pilot-C4BIb08S.mjs +0 -6
  296. package/dist/chunks/Button.pilot-JmR2DCSE.cjs +0 -2
  297. package/dist/chunks/Card-CNSl9fD5.cjs +0 -2
  298. package/dist/chunks/Card-CNSl9fD5.cjs.map +0 -1
  299. package/dist/chunks/Card-DMhV_NTt.mjs +0 -200
  300. package/dist/chunks/Card-DMhV_NTt.mjs.map +0 -1
  301. package/dist/chunks/Checkbox-Bo7IRVRE.mjs +0 -11
  302. package/dist/chunks/Checkbox-Bo7IRVRE.mjs.map +0 -1
  303. package/dist/chunks/Checkbox-CAI6RtuO.cjs +0 -2
  304. package/dist/chunks/Checkbox-CAI6RtuO.cjs.map +0 -1
  305. package/dist/chunks/Checkbox.view-DGdNPlF9.cjs +0 -2
  306. package/dist/chunks/Checkbox.view-DGdNPlF9.cjs.map +0 -1
  307. package/dist/chunks/Checkbox.view-dhc-rfEX.mjs.map +0 -1
  308. package/dist/chunks/FieldWrapper-Bb0j8Iog.mjs.map +0 -1
  309. package/dist/chunks/FieldWrapper-DRCn7BLi.cjs +0 -2
  310. package/dist/chunks/FieldWrapper-DRCn7BLi.cjs.map +0 -1
  311. package/dist/chunks/Modal-DkckCT8-.mjs.map +0 -1
  312. package/dist/chunks/Modal-zok954As.cjs +0 -2
  313. package/dist/chunks/Modal-zok954As.cjs.map +0 -1
  314. package/dist/chunks/Select-C6R0Tei-.cjs +0 -2
  315. package/dist/chunks/Select-C6R0Tei-.cjs.map +0 -1
  316. package/dist/chunks/Select-C7IBNyjR.mjs +0 -24
  317. package/dist/chunks/Select-C7IBNyjR.mjs.map +0 -1
  318. package/dist/chunks/Select.view-CPMqT8pn.mjs.map +0 -1
  319. package/dist/chunks/Select.view-Pq1yAcMm.cjs +0 -2
  320. package/dist/chunks/Select.view-Pq1yAcMm.cjs.map +0 -1
  321. package/dist/chunks/Switch.view-CQZO_Js7.cjs +0 -2
  322. package/dist/chunks/Switch.view-CQZO_Js7.cjs.map +0 -1
  323. package/dist/chunks/Switch.view-QLZ7O5Z7.mjs.map +0 -1
  324. package/dist/chunks/Tabs-D5chMrkE.mjs +0 -403
  325. package/dist/chunks/Tabs-D5chMrkE.mjs.map +0 -1
  326. package/dist/chunks/Tabs-DQeBJwkz.cjs +0 -2
  327. package/dist/chunks/Tabs-DQeBJwkz.cjs.map +0 -1
  328. package/dist/chunks/TextField-DOU2CL5J.mjs.map +0 -1
  329. package/dist/chunks/TextField-Da4JCcAU.cjs +0 -2
  330. package/dist/chunks/TextField-Da4JCcAU.cjs.map +0 -1
  331. package/dist/chunks/default-D7ePSMKP.cjs +0 -2
  332. package/dist/chunks/default-D7ePSMKP.cjs.map +0 -1
  333. package/dist/chunks/designSystem.page-B74Vm2Dt.cjs +0 -11
  334. package/dist/chunks/designSystem.page-B74Vm2Dt.cjs.map +0 -1
  335. package/dist/chunks/designSystem.page-K0ajTvy7.mjs.map +0 -1
@@ -1,200 +0,0 @@
1
- import { jsx as d, jsxs as W } from "react/jsx-runtime";
2
- import R, { createContext as _, useContext as q, useMemo as A } from "react";
3
- import { useTheme as h, View as B, Vertical as m } from "app-studio";
4
- import { useMergedDesignSystemComponentProps as S } from "../theme.esm.mjs";
5
- const w = {
6
- sm: {
7
- padding: "12px"
8
- },
9
- md: {
10
- padding: "16px"
11
- },
12
- lg: {
13
- padding: "24px"
14
- }
15
- }, G = {
16
- square: 0,
17
- rounded: "8px",
18
- pill: "24px"
19
- }, I = (r) => {
20
- const t = r === "dark";
21
- return {
22
- default: {
23
- backgroundColor: "color-white",
24
- border: "none",
25
- transition: "background-color 0.2s ease, box-shadow 0.2s ease"
26
- },
27
- outlined: {
28
- backgroundColor: "color-white",
29
- borderWidth: "1px",
30
- borderStyle: "solid",
31
- borderColor: "color-gray-200",
32
- transition: "border-color 0.2s ease, box-shadow 0.2s ease",
33
- _hover: {
34
- borderColor: "color-gray-300",
35
- boxShadow: t ? "0px 1px 3px rgba(0, 0, 0, 0.3)" : "0px 1px 3px rgba(0, 0, 0, 0.05)"
36
- }
37
- },
38
- elevated: {
39
- backgroundColor: "color-white",
40
- boxShadow: t ? "0px 1px 3px rgba(0, 0, 0, 0.35), 0px 1px 2px rgba(0, 0, 0, 0.3)" : "0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)",
41
- border: "none",
42
- transition: "box-shadow 0.2s ease",
43
- _hover: {
44
- boxShadow: t ? "0px 4px 6px rgba(0, 0, 0, 0.4), 0px 2px 4px rgba(0, 0, 0, 0.35)" : "0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)"
45
- }
46
- }
47
- };
48
- }, b = (r) => (r.themeMode, {
49
- container: {
50
- backgroundColor: "color-white",
51
- color: "color-gray-900",
52
- borderRadius: "8px",
53
- overflow: "hidden",
54
- transition: "background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease"
55
- },
56
- header: {
57
- padding: "16px",
58
- borderBottom: "1px solid",
59
- borderColor: "color-gray-100",
60
- color: "theme-primary",
61
- fontWeight: 600,
62
- fontSize: 14
63
- },
64
- content: {
65
- padding: "16px",
66
- color: "color-gray-600",
67
- fontSize: 12,
68
- lineHeight: "18px"
69
- },
70
- footer: {
71
- padding: "16px",
72
- borderTop: "1px solid",
73
- borderColor: "color-gray-100",
74
- justifyContent: "flex-end",
75
- gap: 8
76
- }
77
- }), T = _({}), M = () => q(T), C = ({
78
- children: r,
79
- views: t,
80
- style: a,
81
- themeMode: l,
82
- ...s
83
- }) => {
84
- var n;
85
- const p = h(), { styles: e } = M(), o = b(p).header, c = {
86
- ...o,
87
- ...e == null ? void 0 : e.header,
88
- ...s,
89
- style: {
90
- ...o == null ? void 0 : o.style,
91
- ...(n = e == null ? void 0 : e.header) == null ? void 0 : n.style,
92
- ...a
93
- }
94
- };
95
- return /* @__PURE__ */ d(m, { gap: 8, ...c, children: r });
96
- }, y = ({
97
- children: r,
98
- views: t,
99
- style: a,
100
- themeMode: l,
101
- ...s
102
- }) => {
103
- var n;
104
- const p = h(), { styles: e } = M(), o = b(p).content, c = {
105
- ...o,
106
- ...e == null ? void 0 : e.content,
107
- ...s,
108
- style: {
109
- ...o == null ? void 0 : o.style,
110
- ...(n = e == null ? void 0 : e.content) == null ? void 0 : n.style,
111
- ...a
112
- }
113
- };
114
- return /* @__PURE__ */ d(m, { gap: 12, ...c, children: r });
115
- }, f = ({
116
- children: r,
117
- views: t,
118
- style: a,
119
- themeMode: l,
120
- ...s
121
- }) => {
122
- var n;
123
- const p = h(), { styles: e } = M(), o = b(p).footer, c = {
124
- ...o,
125
- ...e == null ? void 0 : e.footer,
126
- ...s,
127
- style: {
128
- ...o == null ? void 0 : o.style,
129
- ...(n = e == null ? void 0 : e.footer) == null ? void 0 : n.style,
130
- ...a
131
- }
132
- };
133
- return /* @__PURE__ */ d(m, { gap: 8, ...c, children: r });
134
- }, J = ({
135
- variant: r = "default",
136
- size: t = "md",
137
- shape: a = "rounded",
138
- children: l,
139
- header: s,
140
- footer: p,
141
- isFullWidth: e = !1,
142
- views: o,
143
- style: c,
144
- themeMode: n,
145
- config: L,
146
- ...j
147
- }) => {
148
- var V, z;
149
- const P = h(), x = b(P), i = ((V = w[t]) == null ? void 0 : V.padding) || "16px", u = A(
150
- () => ({
151
- styles: {
152
- container: {
153
- ...x.container,
154
- borderRadius: G[a],
155
- ...o == null ? void 0 : o.container
156
- },
157
- header: {
158
- ...x.header,
159
- padding: i,
160
- ...o == null ? void 0 : o.header
161
- },
162
- content: {
163
- ...x.content,
164
- padding: i,
165
- ...o == null ? void 0 : o.content
166
- },
167
- footer: {
168
- ...x.footer,
169
- padding: i,
170
- ...o == null ? void 0 : o.footer
171
- }
172
- }
173
- }),
174
- [x, o, i, a]
175
- ), D = R.Children.toArray(l).some(
176
- (g) => R.isValidElement(g) && (g.type === C || g.type === y || g.type === f)
177
- ), { themeMode: H } = P, E = I(n || H)[r], F = {
178
- width: e ? "100%" : "auto",
179
- overflow: "hidden",
180
- ...E,
181
- ...u.styles.container,
182
- ...j,
183
- style: { ...(z = u.styles.container) == null ? void 0 : z.style, ...c }
184
- };
185
- return /* @__PURE__ */ d(T.Provider, { value: u, children: /* @__PURE__ */ d(B, { ...F, children: D ? l : /* @__PURE__ */ W(m, { width: "100%", children: [
186
- s && /* @__PURE__ */ d(C, { children: s }),
187
- /* @__PURE__ */ d(y, { children: l }),
188
- p && /* @__PURE__ */ d(f, { children: p })
189
- ] }) }) });
190
- }, K = (r) => {
191
- const t = S("card", r);
192
- return /* @__PURE__ */ d(J, { ...t });
193
- }, k = K;
194
- k.Header = C;
195
- k.Content = y;
196
- k.Footer = f;
197
- export {
198
- k as C
199
- };
200
- //# sourceMappingURL=Card-DMhV_NTt.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Card-DMhV_NTt.mjs","sources":["../../src/components/Card/Card/Card.style.ts","../../src/components/Card/Card/Card.context.ts","../../src/components/Card/Card/Card.view.tsx","../../src/components/Card/Card.tsx"],"sourcesContent":["import { ViewProps } from 'app-studio';\nimport { CardStyles, Shape, Size, Variant } from './Card.type';\n// Defines a mapping of various card sizes (small, medium, large) to their respective padding styles.\nexport const CardSizes: Record<Size, ViewProps> = {\n sm: {\n padding: '12px',\n },\n md: {\n padding: '16px',\n },\n lg: {\n padding: '24px',\n },\n};\n// Defines a mapping of various card shapes (square, rounded, pill) to their respective border-radius values.\nexport const CardShapes: Record<Shape, number | string> = {\n square: 0,\n rounded: '8px',\n pill: '24px',\n};\n// Generates a set of card style variants (default, outlined, elevated) dynamically, adapting their appearance based on the current theme mode.\nexport const getCardVariants = (\n themeMode: string\n): Record<Variant, ViewProps> => {\n const isDark = themeMode === 'dark';\n return {\n default: {\n backgroundColor: 'color-white',\n border: 'none',\n transition: 'background-color 0.2s ease, box-shadow 0.2s ease',\n },\n outlined: {\n backgroundColor: 'color-white',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'color-gray-200',\n transition: 'border-color 0.2s ease, box-shadow 0.2s ease',\n _hover: {\n borderColor: 'color-gray-300',\n boxShadow: isDark\n ? '0px 1px 3px rgba(0, 0, 0, 0.3)'\n : '0px 1px 3px rgba(0, 0, 0, 0.05)',\n },\n },\n elevated: {\n backgroundColor: 'color-white',\n boxShadow: isDark\n ? '0px 1px 3px rgba(0, 0, 0, 0.35), 0px 1px 2px rgba(0, 0, 0, 0.3)'\n : '0px 1px 3px rgba(0, 0, 0, 0.08), 0px 1px 2px rgba(0, 0, 0, 0.06)',\n border: 'none',\n transition: 'box-shadow 0.2s ease',\n _hover: {\n boxShadow: isDark\n ? '0px 4px 6px rgba(0, 0, 0, 0.4), 0px 2px 4px rgba(0, 0, 0, 0.35)'\n : '0px 4px 6px rgba(0, 0, 0, 0.08), 0px 2px 4px rgba(0, 0, 0, 0.06)',\n },\n },\n };\n};\n// Provides default styles for the primary card container and its distinct sections (header, content, footer), adjusting colors and borders based on the active theme.\nexport const getDefaultCardStyles = (theme: any): CardStyles => {\n const isDark = theme.themeMode === 'dark';\n return {\n container: {\n backgroundColor: 'color-white',\n color: 'color-gray-900',\n borderRadius: '8px',\n overflow: 'hidden',\n transition:\n 'background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease',\n },\n header: {\n padding: '16px',\n borderBottom: '1px solid',\n borderColor: 'color-gray-100',\n color: 'theme-primary',\n fontWeight: 600,\n fontSize: 14,\n },\n content: {\n padding: '16px',\n color: 'color-gray-600',\n fontSize: 12,\n lineHeight: '18px',\n },\n footer: {\n padding: '16px',\n borderTop: '1px solid',\n borderColor: 'color-gray-100',\n justifyContent: 'flex-end',\n gap: 8,\n },\n };\n};\n","import { createContext, useContext } from 'react';\nimport { CardStyles } from './Card.type';\nexport interface CardContextValue {\n styles?: CardStyles;\n}\n// This file establishes the React Context for the Card component, facilitating global access to shared properties like styling across its children, and provides a custom hook for convenient context consumption.\nexport const CardContext = createContext<CardContextValue>({});\nexport const useCardContext = () => {\n return useContext(CardContext);\n};\n","import React, { useMemo } from 'react';\nimport { View, useTheme } from 'app-studio';\nimport { Vertical } from 'app-studio';\nimport {\n CardProps,\n CardHeaderProps,\n CardContentProps,\n CardFooterProps,\n} from './Card.props';\nimport {\n CardShapes,\n CardSizes,\n getCardVariants,\n getDefaultCardStyles,\n} from './Card.style';\nimport { CardContext, useCardContext } from './Card.context';\n// Defines the `CardHeader` functional component, responsible for rendering the header section of the Card.\nexport const CardHeader: React.FC<CardHeaderProps> = ({\n children,\n views,\n style,\n themeMode: elementMode,\n ...props\n}) => {\n // Initializes `theme` using the `useTheme` hook to access the current theme context for styling.\n const theme = useTheme();\n // Extracts `contextStyles` from the `CardContext` using `useCardContext` to apply context-specific styles.\n const { styles: contextStyles } = useCardContext();\n // Retrieves default header styles based on the current theme.\n const defaultStyles = getDefaultCardStyles(theme).header;\n // Combines default styles, context styles, and component props to create the final set of properties for the `CardHeader`.\n const mergedProps = {\n ...defaultStyles,\n ...contextStyles?.header,\n ...props,\n style: {\n ...defaultStyles?.style,\n ...contextStyles?.header?.style,\n ...style,\n },\n };\n return (\n <Vertical gap={8} {...mergedProps}>\n {children}\n </Vertical>\n );\n};\nexport const CardContent: React.FC<CardContentProps> = ({\n children,\n views,\n style,\n themeMode: elementMode,\n ...props\n}) => {\n const theme = useTheme();\n const { styles: contextStyles } = useCardContext();\n const defaultStyles = getDefaultCardStyles(theme).content;\n const mergedProps = {\n ...defaultStyles,\n ...contextStyles?.content,\n ...props,\n style: {\n ...defaultStyles?.style,\n ...contextStyles?.content?.style,\n ...style,\n },\n };\n return (\n <Vertical gap={12} {...mergedProps}>\n {children}\n </Vertical>\n );\n};\nexport const CardFooter: React.FC<CardFooterProps> = ({\n children,\n views,\n style,\n themeMode: elementMode,\n ...props\n}) => {\n const theme = useTheme();\n const { styles: contextStyles } = useCardContext();\n const defaultStyles = getDefaultCardStyles(theme).footer;\n const mergedProps = {\n ...defaultStyles,\n ...contextStyles?.footer,\n ...props,\n style: {\n ...defaultStyles?.style,\n ...contextStyles?.footer?.style,\n ...style,\n },\n };\n return (\n <Vertical gap={8} {...mergedProps}>\n {children}\n </Vertical>\n );\n};\nexport const CardView: React.FC<CardProps> = ({\n variant = 'default',\n size = 'md',\n shape = 'rounded',\n children,\n header,\n footer,\n isFullWidth = false,\n views,\n style,\n themeMode: elementMode,\n config,\n ...props\n}) => {\n const theme = useTheme();\n const defaultStyles = getDefaultCardStyles(theme);\n const sizePadding = CardSizes[size]?.padding || '16px';\n const contextValue = useMemo(\n () => ({\n styles: {\n container: {\n ...defaultStyles.container,\n borderRadius: CardShapes[shape],\n ...views?.container,\n },\n header: {\n ...defaultStyles.header,\n padding: sizePadding,\n ...views?.header,\n },\n content: {\n ...defaultStyles.content,\n padding: sizePadding,\n ...views?.content,\n },\n footer: {\n ...defaultStyles.footer,\n padding: sizePadding,\n ...views?.footer,\n },\n },\n }),\n [defaultStyles, views, sizePadding, shape]\n );\n const hasExplicitStructure = React.Children.toArray(children).some(\n (child) =>\n React.isValidElement(child) &&\n (child.type === CardHeader ||\n child.type === CardContent ||\n child.type === CardFooter)\n );\n const { themeMode } = theme;\n const currentThemeMode = elementMode || themeMode;\n const variantStyles = getCardVariants(currentThemeMode)[variant];\n const mergedRootProps = {\n width: isFullWidth ? '100%' : 'auto',\n overflow: 'hidden',\n ...variantStyles,\n ...contextValue.styles.container,\n ...props,\n style: { ...contextValue.styles.container?.style, ...style },\n };\n return (\n <CardContext.Provider value={contextValue}>\n <View {...mergedRootProps}>\n {hasExplicitStructure ? (\n children\n ) : (\n <Vertical width=\"100%\">\n {header && <CardHeader>{header}</CardHeader>}\n <CardContent>{children}</CardContent>\n {footer && <CardFooter>{footer}</CardFooter>}\n </Vertical>\n )}\n </View>\n </CardContext.Provider>\n );\n};\n","import React from 'react';\nimport { CardProps, CardType } from './Card/Card.props';\nimport {\n CardView,\n CardHeader,\n CardContent,\n CardFooter,\n} from './Card/Card.view';\nimport { useMergedDesignSystemComponentProps } from 'src/design-system/theme';\n// This file defines and exports the main `Card` component, which serves as a wrapper for its sub-components like `Card.Header`, `Card.Content`, and `Card.Footer`, enabling a compound component pattern for flexible content structuring.\nconst CardComponent: React.FC<CardProps> = (props) => {\n const mergedProps = useMergedDesignSystemComponentProps('card', props);\n return <CardView {...mergedProps} />;\n};\nexport const Card = CardComponent as CardType;\nCard.Header = CardHeader;\nCard.Content = CardContent;\nCard.Footer = CardFooter;\n"],"names":["CardSizes","CardShapes","getCardVariants","themeMode","isDark","getDefaultCardStyles","theme","CardContext","createContext","useCardContext","useContext","CardHeader","children","views","style","elementMode","props","useTheme","contextStyles","defaultStyles","mergedProps","_a","Vertical","CardContent","CardFooter","CardView","variant","size","shape","header","footer","isFullWidth","config","sizePadding","contextValue","useMemo","hasExplicitStructure","React","child","variantStyles","mergedRootProps","_b","jsx","View","jsxs","CardComponent","useMergedDesignSystemComponentProps","Card"],"mappings":";;;;AAGO,MAAMA,IAAqC;AAAA,EAChD,IAAI;AAAA,IACF,SAAS;AAAA,EAAA;AAAA,EAEX,IAAI;AAAA,IACF,SAAS;AAAA,EAAA;AAAA,EAEX,IAAI;AAAA,IACF,SAAS;AAAA,EAAA;AAEb,GAEaC,IAA6C;AAAA,EACxD,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AACR,GAEaC,IAAkB,CAC7BC,MAC+B;AAC/B,QAAMC,IAASD,MAAc;AAC7B,SAAO;AAAA,IACL,SAAS;AAAA,MACP,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,YAAY;AAAA,IAAA;AAAA,IAEd,UAAU;AAAA,MACR,iBAAiB;AAAA,MACjB,aAAa;AAAA,MACb,aAAa;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,QAAQ;AAAA,QACN,aAAa;AAAA,QACb,WAAWC,IACP,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a,KAAeZ,CACc,EAAEuB,CAAO,GACzDc,IAAkB;AAAA,IACtB,OAAOT,IAAc,SAAS;AAAA,IAC9B,UAAU;AAAA,IACV,GAAGQ;AAAA,IACH,GAAGL,EAAa,OAAO;AAAA,IACvB,GAAGlB;AAAA,IACH,OAAO,EAAE,IAAGyB,IAAAP,EAAa,OAAO,cAApB,gBAAAO,EAA+B,OAAO,GAAG3B,EAAA;AAAA,EAAM;AAE7D,SACE,gBAAA4B,EAACnC,EAAY,UAAZ,EAAqB,OAAO2B,GAC3B,UAAA,gBAAAQ,EAACC,GAAA,EAAM,GAAGH,GACP,UAAAJ,IACCxB,IAEA,gBAAAgC,EAACtB,GAAA,EAAS,OAAM,QACb,UAAA;AAAA,IAAAO,KAAU,gBAAAa,EAAC/B,KAAY,UAAAkB,EAAA,CAAO;AAAA,IAC/B,gBAAAa,EAACnB,KAAa,UAAAX,GAAS;AAAA,IACtBkB,KAAU,gBAAAY,EAAClB,GAAA,EAAY,UAAAM,EAAA,CAAO;AAAA,EAAA,EAAA,CACjC,GAEJ,GACF;AAEJ,GCtKMe,IAAqC,CAAC7B,MAAU;AACpD,QAAMI,IAAc0B,EAAoC,QAAQ9B,CAAK;AACrE,SAAO,gBAAA0B,EAACjB,GAAA,EAAU,GAAGL,EAAA,CAAa;AACpC,GACa2B,IAAOF;AACpBE,EAAK,SAASpC;AACdoC,EAAK,UAAUxB;AACfwB,EAAK,SAASvB;"}
@@ -1,11 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { u as r, C as c } from "./Checkbox.view-dhc-rfEX.mjs";
3
- import { useMergedDesignSystemComponentProps as m } from "../theme.esm.mjs";
4
- const n = (e) => {
5
- const o = m("checkbox", e), t = r(o);
6
- return /* @__PURE__ */ s(c, { ...t, ...o });
7
- }, b = n;
8
- export {
9
- b as C
10
- };
11
- //# sourceMappingURL=Checkbox-Bo7IRVRE.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox-Bo7IRVRE.mjs","sources":["../../src/components/Form/Checkbox/Checkbox.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CheckboxProps } from './Checkbox/Checkbox.props';\nimport { useCheckboxState } from './Checkbox/Checkbox.state';\nimport CheckboxView from './Checkbox/Checkbox.view';\nimport { useMergedDesignSystemComponentProps } from 'src/design-system/theme';\n\nconst CheckboxComponent: React.FC<CheckboxProps> = (props) => {\n const mergedProps = useMergedDesignSystemComponentProps('checkbox', props);\n const checkboxStates = useCheckboxState(mergedProps);\n\n return <CheckboxView {...checkboxStates} {...mergedProps} />;\n};\n\n/**\n * Checkbox allows users to select one or more options from a list of choices.\n */\nexport const Checkbox = CheckboxComponent;\n"],"names":["CheckboxComponent","props","mergedProps","useMergedDesignSystemComponentProps","checkboxStates","useCheckboxState","jsx","CheckboxView","Checkbox"],"mappings":";;;AAOA,MAAMA,IAA6C,CAACC,MAAU;AAC5D,QAAMC,IAAcC,EAAoC,YAAYF,CAAK,GACnEG,IAAiBC,EAAiBH,CAAW;AAEnD,SAAO,gBAAAI,EAACC,GAAA,EAAc,GAAGH,GAAiB,GAAGF,EAAA,CAAa;AAC5D,GAKaM,IAAWR;"}
@@ -1,2 +0,0 @@
1
- "use strict";const s=require("react/jsx-runtime"),o=require("./Checkbox.view-DGdNPlF9.cjs"),n=require("../theme.cjs.js"),r=t=>{const e=n.useMergedDesignSystemComponentProps("checkbox",t),c=o.useCheckboxState(e);return s.jsx(o.CheckboxView,{...c,...e})},x=r;exports.Checkbox=x;
2
- //# sourceMappingURL=Checkbox-CAI6RtuO.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox-CAI6RtuO.cjs","sources":["../../src/components/Form/Checkbox/Checkbox.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CheckboxProps } from './Checkbox/Checkbox.props';\nimport { useCheckboxState } from './Checkbox/Checkbox.state';\nimport CheckboxView from './Checkbox/Checkbox.view';\nimport { useMergedDesignSystemComponentProps } from 'src/design-system/theme';\n\nconst CheckboxComponent: React.FC<CheckboxProps> = (props) => {\n const mergedProps = useMergedDesignSystemComponentProps('checkbox', props);\n const checkboxStates = useCheckboxState(mergedProps);\n\n return <CheckboxView {...checkboxStates} {...mergedProps} />;\n};\n\n/**\n * Checkbox allows users to select one or more options from a list of choices.\n */\nexport const Checkbox = CheckboxComponent;\n"],"names":["CheckboxComponent","props","mergedProps","useMergedDesignSystemComponentProps","checkboxStates","useCheckboxState","jsx","CheckboxView","Checkbox"],"mappings":"yHAOMA,EAA8CC,GAAU,CAC5D,MAAMC,EAAcC,EAAAA,oCAAoC,WAAYF,CAAK,EACnEG,EAAiBC,EAAAA,iBAAiBH,CAAW,EAEnD,OAAOI,EAAAA,IAACC,EAAAA,aAAA,CAAc,GAAGH,EAAiB,GAAGF,CAAA,CAAa,CAC5D,EAKaM,EAAWR"}
@@ -1,2 +0,0 @@
1
- "use strict";const a=require("react"),e=require("react/jsx-runtime"),r=require("app-studio"),J=require("./Label-Bd0TpfkG.cjs"),F=require("./FixedIcons-Dz_f-yDL.cjs"),K=({defaultIsSelected:b=!1})=>{const[g,f]=a.useState(!1),[c,t]=a.useState(b);return{isHovered:g,setIsHovered:f,isSelected:c,setIsSelected:t}},N={xs:{height:"12px",width:"12px"},sm:{height:"16px",width:"16px"},md:{height:"20px",width:"20px"},lg:{height:"24px",width:"24px"},xl:{height:"28px",width:"28px"}},z={xs:10,sm:14,md:16,lg:20,xl:24},Q={selected:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"},unselected:{backgroundColor:"transparent",borderWidth:"2px",borderStyle:"solid",borderColor:"color-gray-300",color:"inherit",transition:"all 0.2s ease-in-out"},indeterminate:{backgroundColor:"theme-primary",borderColor:"theme-primary",borderWidth:"2px",borderStyle:"solid",color:"color-white",transition:"background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease"}},p={hover:{selected:{opacity:.9},unselected:{borderColor:"color-gray-400",backgroundColor:"color-gray-50"},indeterminate:{opacity:.9}},focus:{selected:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px theme-primary"},unselected:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px theme-primary"},indeterminate:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px theme-primary"}},disabled:{selected:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},unselected:{borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"},indeterminate:{backgroundColor:"color-gray-300",borderColor:"color-gray-300",opacity:.5,cursor:"not-allowed"}},error:{selected:{backgroundColor:"color-red-500",borderColor:"color-red-500"},unselected:{borderColor:"color-red-500"},indeterminate:{backgroundColor:"color-red-500",borderColor:"color-red-500"}}},U=({id:b,icon:g,name:f,label:c,isChecked:t,onChange:C,onValueChange:S,shadow:B={},labelPosition:y="right",size:l="md",error:i=!1,isSelected:h=!1,isHovered:j=!1,isDisabled:n=!1,isReadOnly:u=!1,isIndeterminate:s=!1,defaultIsSelected:X=!1,setIsSelected:w=()=>{},setIsHovered:L=()=>{},views:o={checkbox:{},label:{}},infoText:m,helperText:Y,...M})=>{const V=a.useId(),x=b??V,k=a.useRef(null),[E,I]=a.useState(!1),R=!!(t||h);a.useEffect(()=>{k.current&&(k.current.indeterminate=s)},[s]);const T=()=>L(!j),$=()=>{!u&&!n&&(w&&w(!h),C&&C(!t),S&&S(!t))},d=s?"indeterminate":t||h?"selected":"unselected",A=i?p.error[d]:n?p.disabled[d]:j?p.hover[d]:{},H={container:{gap:8,display:"flex",height:"fit-content",flexDirection:"column",width:"fit-content",color:i?"theme-error":n?"color-gray-400":"inherit",cursor:n?"not-allowed":u?"default":"pointer",opacity:n?.6:1,transition:"all 0.2s ease-in-out",...o.label},checkbox:{...Q[d],...A,borderRadius:6,...N[l],transition:"all 0.2s ease-in-out",...B,...o.checkbox}},W=`${x}-info`,q=`${x}-error`,G=[m?W:"",i?q:""].filter(Boolean).join(" ")||void 0;return e.jsxs(r.Vertical,{...H.container,children:[e.jsx(J.Label,{htmlFor:x,onMouseEnter:T,onMouseLeave:T,size:r.Typography.fontSizes[l],cursor:"inherit",children:e.jsxs(r.Horizontal,{gap:12,alignItems:"center",children:[" ",y==="left"&&c&&e.jsx(r.Text,{size:l,fontWeight:"500",...o==null?void 0:o.label,children:c}),e.jsxs(r.Center,{position:"relative",...H.checkbox,...E?p.focus[d]:{},children:[e.jsx(r.Input,{ref:k,type:"checkbox",id:x,name:f,checked:R,"aria-checked":s?"mixed":void 0,onChange:$,onFocus:()=>I(!0),onBlur:()=>I(!1),disabled:n,readOnly:u,position:"absolute",top:0,left:0,width:"100%",height:"100%",margin:0,opacity:0,zIndex:1,cursor:n?"not-allowed":u?"default":"pointer","aria-describedby":G,...M}),s?e.jsx(F.MinusIcon,{widthHeight:z[l],color:"color-white",transition:"opacity 0.2s ease"}):(t||h)&&(g??e.jsx(F.TickIcon,{widthHeight:z[l],color:"color-white",transition:"opacity 0.2s ease"}))]}),y==="right"&&c&&e.jsx(r.Text,{size:l,fontWeight:"500",...o==null?void 0:o.label,children:c})]})}),m&&e.jsx(r.Text,{id:W,marginLeft:y==="left"?0:36,color:"color-gray-500",size:"sm",fontWeight:"400",lineHeight:"20px",...o==null?void 0:o.infoText,children:m}),i&&e.jsx(r.Text,{id:q,size:"xs",marginTop:4,marginHorizontal:0,color:"theme-error",fontWeight:"500",transition:"all 0.2s ease-in-out",children:i})]})};exports.CheckboxView=U;exports.useCheckboxState=K;
2
- //# sourceMappingURL=Checkbox.view-DGdNPlF9.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.view-DGdNPlF9.cjs","sources":["../../src/components/Form/Checkbox/Checkbox/Checkbox.state.ts","../../src/components/Form/Checkbox/Checkbox/Checkbox.style.ts","../../src/components/Form/Checkbox/Checkbox/Checkbox.view.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CheckboxProps } from './Checkbox.props';\n\nexport const useCheckboxState = ({\n defaultIsSelected = false,\n}: CheckboxProps) => {\n const [isHovered, setIsHovered] = React.useState(false);\n const [isSelected, setIsSelected] =\n React.useState<boolean>(defaultIsSelected);\n\n return {\n isHovered,\n setIsHovered,\n isSelected,\n setIsSelected,\n };\n};\n","/**\n * Checkbox Styles\n *\n * Defines the styles for the Checkbox component following the design guidelines:\n * - Typography: Inter/Geist font, specific sizes/weights\n * - Spacing: 4px grid system\n * - Colors: Neutral palette with semantic colors\n * - Rounded corners: Consistent border radius\n * - Transitions: Subtle animations\n */\n\nimport { ViewProps } from 'app-studio';\nimport { Size, Variant } from './Checkbox.type';\n\n/**\n * Size configurations for the Checkbox component\n * Following the 4px grid system\n */\nexport const Sizes: Record<Size, ViewProps> = {\n xs: { height: '12px', width: '12px' }, // 3 × 4px grid\n sm: { height: '16px', width: '16px' }, // 4 × 4px grid\n md: { height: '20px', width: '20px' }, // 5 × 4px grid\n lg: { height: '24px', width: '24px' }, // 6 × 4px grid\n xl: { height: '28px', width: '28px' }, // 7 × 4px grid\n};\n\n/**\n * Icon sizes for the Checkbox component\n * Proportional to the component size\n */\nexport const IconSizes: Record<Size, number> = {\n xs: 10, // 2.5 × 4px grid\n sm: 14, // 3.5 × 4px grid\n md: 16, // 4 × 4px grid\n lg: 20, // 5 × 4px grid\n xl: 24, // 6 × 4px grid\n};\n\n/**\n * Variant styles for the Checkbox component\n */\nexport const VariantStyles: Record<Variant, ViewProps> = {\n selected: {\n backgroundColor: 'theme-primary',\n borderColor: 'theme-primary',\n borderWidth: '2px',\n borderStyle: 'solid',\n color: 'color-white',\n transition:\n 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease',\n },\n unselected: {\n backgroundColor: 'transparent',\n borderWidth: '2px',\n borderStyle: 'solid',\n borderColor: 'color-gray-300',\n color: 'inherit',\n transition: 'all 0.2s ease-in-out',\n },\n indeterminate: {\n backgroundColor: 'theme-primary',\n borderColor: 'theme-primary',\n borderWidth: '2px',\n borderStyle: 'solid',\n color: 'color-white',\n transition:\n 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease',\n },\n};\n\n/**\n * State styles for the Checkbox component\n */\nexport const StateStyles = {\n hover: {\n selected: {\n opacity: 0.9,\n },\n unselected: {\n borderColor: 'color-gray-400',\n backgroundColor: 'color-gray-50',\n },\n indeterminate: {\n opacity: 0.9,\n },\n },\n focus: {\n selected: {\n outline: 'none',\n boxShadow: '0 0 0 2px white, 0 0 0 4px theme-primary',\n },\n unselected: {\n outline: 'none',\n boxShadow: '0 0 0 2px white, 0 0 0 4px theme-primary',\n },\n indeterminate: {\n outline: 'none',\n boxShadow: '0 0 0 2px white, 0 0 0 4px theme-primary',\n },\n },\n disabled: {\n selected: {\n backgroundColor: 'color-gray-300',\n borderColor: 'color-gray-300',\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n unselected: {\n borderColor: 'color-gray-300',\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n indeterminate: {\n backgroundColor: 'color-gray-300',\n borderColor: 'color-gray-300',\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n },\n error: {\n selected: {\n backgroundColor: 'color-red-500',\n borderColor: 'color-red-500',\n },\n unselected: {\n borderColor: 'color-red-500',\n },\n indeterminate: {\n backgroundColor: 'color-red-500',\n borderColor: 'color-red-500',\n },\n },\n};\n","/**\n * Checkbox View Component\n *\n * Renders a checkbox with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Typography } from 'app-studio';\n\nimport { Center, Input } from 'app-studio';\nimport { Label } from '../../../Form/Label/Label';\nimport { TickIcon, MinusIcon } from '../../../Icon/FixedIcons';\n\nimport { CheckboxViewProps } from './Checkbox.props';\nimport { IconSizes, Sizes, VariantStyles, StateStyles } from './Checkbox.style';\nimport { Text } from 'app-studio';\nimport { Horizontal } from 'app-studio';\nimport { Vertical } from 'app-studio';\n\nconst CheckboxView: React.FC<CheckboxViewProps> = ({\n id,\n icon,\n name,\n label,\n isChecked,\n onChange,\n onValueChange,\n shadow = {},\n labelPosition = 'right',\n size = 'md',\n error = false,\n isSelected = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n isIndeterminate = false,\n defaultIsSelected = false,\n setIsSelected = () => {},\n setIsHovered = () => {},\n views = { checkbox: {}, label: {} },\n infoText,\n helperText,\n ...props\n}) => {\n const generatedId = React.useId();\n const checkboxId = id ?? generatedId;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [isFocused, setIsFocused] = React.useState(false);\n const checked = Boolean(isChecked || isSelected);\n\n // `indeterminate` only exists as a DOM property, never as an attribute.\n React.useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = isIndeterminate;\n }, [isIndeterminate]);\n\n const handleHover = () => setIsHovered(!isHovered);\n\n const handleChange = () => {\n if (!isReadOnly && !isDisabled) {\n if (setIsSelected) setIsSelected(!isSelected);\n if (onChange) onChange(!isChecked);\n if (onValueChange) onValueChange(!isChecked);\n }\n };\n\n /**\n * Determine the variant based on component state\n */\n const variant = isIndeterminate\n ? 'indeterminate'\n : isChecked || isSelected\n ? 'selected'\n : 'unselected';\n\n /**\n * Apply state-specific styles\n */\n const stateStyle = error\n ? StateStyles.error[variant]\n : isDisabled\n ? StateStyles.disabled[variant]\n : isHovered\n ? StateStyles.hover[variant]\n : {};\n\n /**\n * Styles for the checkbox component\n */\n const checkboxStyle = {\n container: {\n // Layout properties\n gap: 8, // 2 × 4px grid\n display: 'flex' as const,\n height: 'fit-content',\n flexDirection: 'column' as const,\n width: 'fit-content',\n\n // Typography properties\n\n // Visual properties — inherit so the brand/page ink shows on every surface\n color: error ? 'theme-error' : isDisabled ? 'color-gray-400' : 'inherit',\n\n // State properties\n cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'default' : 'pointer',\n opacity: isDisabled ? 0.6 : 1,\n\n // Animation\n transition: 'all 0.2s ease-in-out',\n\n // Apply custom styles\n ...views['label'],\n },\n checkbox: {\n // Base variant styles\n ...VariantStyles[variant],\n\n // State-specific styles\n ...stateStyle,\n\n // Visual properties\n borderRadius: 6, // radius-sm\n\n // Size properties\n ...Sizes[size],\n\n // Animation\n transition: 'all 0.2s ease-in-out',\n\n // Apply shadow and custom styles\n ...shadow,\n ...views['checkbox'],\n },\n };\n\n const infoTextId = `${checkboxId}-info`;\n const errorId = `${checkboxId}-error`;\n const describedBy =\n [infoText ? infoTextId : '', error ? errorId : '']\n .filter(Boolean)\n .join(' ') || undefined;\n\n return (\n <Vertical {...checkboxStyle.container}>\n <Label\n htmlFor={checkboxId}\n onMouseEnter={handleHover}\n onMouseLeave={handleHover}\n size={Typography.fontSizes[size]}\n cursor=\"inherit\"\n >\n <Horizontal gap={12} alignItems=\"center\">\n {' '}\n {/* 3 × 4px grid */}\n {/* Label on the left side */}\n {labelPosition === 'left' && label && (\n <Text\n size={size}\n fontWeight=\"500\" // Medium weight for better readability\n {...views?.label}\n >\n {label}\n </Text>\n )}\n {/* Checkbox */}\n <Center\n position=\"relative\"\n {...checkboxStyle.checkbox}\n {...(isFocused ? StateStyles.focus[variant] : {})}\n >\n {/* Real control: a transparent input covering the visible box, so\n the element found by role/name is the one that receives clicks */}\n <Input\n ref={inputRef}\n type=\"checkbox\"\n id={checkboxId}\n name={name}\n checked={checked}\n aria-checked={isIndeterminate ? 'mixed' : undefined}\n onChange={handleChange}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n disabled={isDisabled}\n readOnly={isReadOnly}\n position=\"absolute\"\n top={0}\n left={0}\n width=\"100%\"\n height=\"100%\"\n margin={0}\n opacity={0}\n zIndex={1}\n cursor={\n isDisabled ? 'not-allowed' : isReadOnly ? 'default' : 'pointer'\n }\n aria-describedby={describedBy}\n // Consumer rest props (aria-*, role, data-*) belong on the real\n // control, not the wrapping label.\n {...props}\n />\n {isIndeterminate ? (\n <MinusIcon\n widthHeight={IconSizes[size]}\n color=\"color-white\"\n transition=\"opacity 0.2s ease\"\n />\n ) : (\n (isChecked || isSelected) &&\n (icon ?? (\n <TickIcon\n widthHeight={IconSizes[size]}\n color=\"color-white\"\n transition=\"opacity 0.2s ease\"\n />\n ))\n )}\n </Center>\n {/* Label on the right side */}\n {labelPosition === 'right' && label && (\n <Text\n size={size}\n fontWeight=\"500\" // Medium weight for better readability\n {...views?.label}\n >\n {label}\n </Text>\n )}\n </Horizontal>\n </Label>\n {/* Info text — outside the <label> so it describes the input through\n `aria-describedby` instead of polluting its accessible name */}\n {infoText && (\n <Text\n id={infoTextId}\n marginLeft={labelPosition === 'left' ? 0 : 36} // 9 × 4px grid\n color=\"color-gray-500\"\n size=\"sm\"\n fontWeight=\"400\" // Regular weight\n lineHeight=\"20px\"\n {...views?.infoText}\n >\n {infoText}\n </Text>\n )}\n\n {/* Error message — outside the <label> for the same reason */}\n {error && (\n <Text\n id={errorId}\n size=\"xs\"\n marginTop={4} // 1 × 4px grid\n marginHorizontal={0}\n color=\"theme-error\"\n fontWeight=\"500\" // Medium weight for better readability\n transition=\"all 0.2s ease-in-out\"\n >\n {error}\n </Text>\n )}\n </Vertical>\n );\n};\n\nexport default CheckboxView;\n"],"names":["useCheckboxState","defaultIsSelected","isHovered","setIsHovered","React","isSelected","setIsSelected","Sizes","IconSizes","VariantStyles","StateStyles","CheckboxView","id","icon","name","label","isChecked","onChange","onValueChange","shadow","labelPosition","size","error","isDisabled","isReadOnly","isIndeterminate","views","infoText","helperText","props","generatedId","checkboxId","inputRef","isFocused","setIsFocused","checked","handleHover","handleChange","variant","stateStyle","checkboxStyle","infoTextId","errorId","describedBy","jsxs","Vertical","jsx","Label","Typography","Horizontal","Text","Center","Input","MinusIcon","TickIcon"],"mappings":"sKAIaA,EAAmB,CAAC,CAC/B,kBAAAC,EAAoB,EACtB,IAAqB,CACnB,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAS,EAAK,EAChD,CAACC,EAAYC,CAAa,EAC9BF,EAAM,SAAkBH,CAAiB,EAE3C,MAAO,CACL,UAAAC,EACA,aAAAC,EACA,WAAAE,EACA,cA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V,SAAS,WACT,IAAK,EACL,KAAM,EACN,MAAM,OACN,OAAO,OACP,OAAQ,EACR,QAAS,EACT,OAAQ,EACR,OACED,EAAa,cAAgBC,EAAa,UAAY,UAExD,mBAAkBmB,EAGjB,GAAGd,CAAA,CAAA,EAELJ,EACCqB,EAAAA,IAACO,EAAAA,UAAA,CACC,YAAa7C,EAAUa,CAAI,EAC3B,MAAM,cACN,WAAW,mBAAA,CAAA,GAGZL,GAAaX,KACbQ,GACCiC,EAAAA,IAACQ,EAAAA,SAAA,CACC,YAAa9C,EAAUa,CAAI,EAC3B,MAAM,cACN,WAAW,mBAAA,CAAA,EACb,CAAA,CAAA,EAKLD,IAAkB,SAAWL,GAC5B+B,EAAAA,IAACI,EAAAA,KAAA,CACC,KAAA7B,EACA,WAAW,MACV,GAAGK,GAAA,YAAAA,EAAO,MAEV,SAAAX,CAAA,CAAA,CACH,CAAA,CAEJ,CAAA,CAAA,EAIDY,GACCmB,EAAAA,IAACI,EAAAA,KAAA,CACC,GAAIT,EACJ,WAAYrB,IAAkB,OAAS,EAAI,GAC3C,MAAM,iBACN,KAAK,KACL,WAAW,MACX,WAAW,OACV,GAAGM,GAAA,YAAAA,EAAO,SAEV,SAAAC,CAAA,CAAA,EAKJL,GACCwB,EAAAA,IAACI,EAAAA,KAAA,CACC,GAAIR,EACJ,KAAK,KACL,UAAW,EACX,iBAAkB,EAClB,MAAM,cACN,WAAW,MACX,WAAW,uBAEV,SAAApB,CAAA,CAAA,CACH,EAEJ,CAEJ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.view-dhc-rfEX.mjs","sources":["../../src/components/Form/Checkbox/Checkbox/Checkbox.state.ts","../../src/components/Form/Checkbox/Checkbox/Checkbox.style.ts","../../src/components/Form/Checkbox/Checkbox/Checkbox.view.tsx"],"sourcesContent":["import React from 'react';\n\nimport { CheckboxProps } from './Checkbox.props';\n\nexport const useCheckboxState = ({\n defaultIsSelected = false,\n}: CheckboxProps) => {\n const [isHovered, setIsHovered] = React.useState(false);\n const [isSelected, setIsSelected] =\n React.useState<boolean>(defaultIsSelected);\n\n return {\n isHovered,\n setIsHovered,\n isSelected,\n setIsSelected,\n };\n};\n","/**\n * Checkbox Styles\n *\n * Defines the styles for the Checkbox component following the design guidelines:\n * - Typography: Inter/Geist font, specific sizes/weights\n * - Spacing: 4px grid system\n * - Colors: Neutral palette with semantic colors\n * - Rounded corners: Consistent border radius\n * - Transitions: Subtle animations\n */\n\nimport { ViewProps } from 'app-studio';\nimport { Size, Variant } from './Checkbox.type';\n\n/**\n * Size configurations for the Checkbox component\n * Following the 4px grid system\n */\nexport const Sizes: Record<Size, ViewProps> = {\n xs: { height: '12px', width: '12px' }, // 3 × 4px grid\n sm: { height: '16px', width: '16px' }, // 4 × 4px grid\n md: { height: '20px', width: '20px' }, // 5 × 4px grid\n lg: { height: '24px', width: '24px' }, // 6 × 4px grid\n xl: { height: '28px', width: '28px' }, // 7 × 4px grid\n};\n\n/**\n * Icon sizes for the Checkbox component\n * Proportional to the component size\n */\nexport const IconSizes: Record<Size, number> = {\n xs: 10, // 2.5 × 4px grid\n sm: 14, // 3.5 × 4px grid\n md: 16, // 4 × 4px grid\n lg: 20, // 5 × 4px grid\n xl: 24, // 6 × 4px grid\n};\n\n/**\n * Variant styles for the Checkbox component\n */\nexport const VariantStyles: Record<Variant, ViewProps> = {\n selected: {\n backgroundColor: 'theme-primary',\n borderColor: 'theme-primary',\n borderWidth: '2px',\n borderStyle: 'solid',\n color: 'color-white',\n transition:\n 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease',\n },\n unselected: {\n backgroundColor: 'transparent',\n borderWidth: '2px',\n borderStyle: 'solid',\n borderColor: 'color-gray-300',\n color: 'inherit',\n transition: 'all 0.2s ease-in-out',\n },\n indeterminate: {\n backgroundColor: 'theme-primary',\n borderColor: 'theme-primary',\n borderWidth: '2px',\n borderStyle: 'solid',\n color: 'color-white',\n transition:\n 'background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease',\n },\n};\n\n/**\n * State styles for the Checkbox component\n */\nexport const StateStyles = {\n hover: {\n selected: {\n opacity: 0.9,\n },\n unselected: {\n borderColor: 'color-gray-400',\n backgroundColor: 'color-gray-50',\n },\n indeterminate: {\n opacity: 0.9,\n },\n },\n focus: {\n selected: {\n outline: 'none',\n boxShadow: '0 0 0 2px white, 0 0 0 4px theme-primary',\n },\n unselected: {\n outline: 'none',\n boxShadow: '0 0 0 2px white, 0 0 0 4px theme-primary',\n },\n indeterminate: {\n outline: 'none',\n boxShadow: '0 0 0 2px white, 0 0 0 4px theme-primary',\n },\n },\n disabled: {\n selected: {\n backgroundColor: 'color-gray-300',\n borderColor: 'color-gray-300',\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n unselected: {\n borderColor: 'color-gray-300',\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n indeterminate: {\n backgroundColor: 'color-gray-300',\n borderColor: 'color-gray-300',\n opacity: 0.5,\n cursor: 'not-allowed',\n },\n },\n error: {\n selected: {\n backgroundColor: 'color-red-500',\n borderColor: 'color-red-500',\n },\n unselected: {\n borderColor: 'color-red-500',\n },\n indeterminate: {\n backgroundColor: 'color-red-500',\n borderColor: 'color-red-500',\n },\n },\n};\n","/**\n * Checkbox View Component\n *\n * Renders a checkbox with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Typography } from 'app-studio';\n\nimport { Center, Input } from 'app-studio';\nimport { Label } from '../../../Form/Label/Label';\nimport { TickIcon, MinusIcon } from '../../../Icon/FixedIcons';\n\nimport { CheckboxViewProps } from './Checkbox.props';\nimport { IconSizes, Sizes, VariantStyles, StateStyles } from './Checkbox.style';\nimport { Text } from 'app-studio';\nimport { Horizontal } from 'app-studio';\nimport { Vertical } from 'app-studio';\n\nconst CheckboxView: React.FC<CheckboxViewProps> = ({\n id,\n icon,\n name,\n label,\n isChecked,\n onChange,\n onValueChange,\n shadow = {},\n labelPosition = 'right',\n size = 'md',\n error = false,\n isSelected = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n isIndeterminate = false,\n defaultIsSelected = false,\n setIsSelected = () => {},\n setIsHovered = () => {},\n views = { checkbox: {}, label: {} },\n infoText,\n helperText,\n ...props\n}) => {\n const generatedId = React.useId();\n const checkboxId = id ?? generatedId;\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [isFocused, setIsFocused] = React.useState(false);\n const checked = Boolean(isChecked || isSelected);\n\n // `indeterminate` only exists as a DOM property, never as an attribute.\n React.useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = isIndeterminate;\n }, [isIndeterminate]);\n\n const handleHover = () => setIsHovered(!isHovered);\n\n const handleChange = () => {\n if (!isReadOnly && !isDisabled) {\n if (setIsSelected) setIsSelected(!isSelected);\n if (onChange) onChange(!isChecked);\n if (onValueChange) onValueChange(!isChecked);\n }\n };\n\n /**\n * Determine the variant based on component state\n */\n const variant = isIndeterminate\n ? 'indeterminate'\n : isChecked || isSelected\n ? 'selected'\n : 'unselected';\n\n /**\n * Apply state-specific styles\n */\n const stateStyle = error\n ? StateStyles.error[variant]\n : isDisabled\n ? StateStyles.disabled[variant]\n : isHovered\n ? StateStyles.hover[variant]\n : {};\n\n /**\n * Styles for the checkbox component\n */\n const checkboxStyle = {\n container: {\n // Layout properties\n gap: 8, // 2 × 4px grid\n display: 'flex' as const,\n height: 'fit-content',\n flexDirection: 'column' as const,\n width: 'fit-content',\n\n // Typography properties\n\n // Visual properties — inherit so the brand/page ink shows on every surface\n color: error ? 'theme-error' : isDisabled ? 'color-gray-400' : 'inherit',\n\n // State properties\n cursor: isDisabled ? 'not-allowed' : isReadOnly ? 'default' : 'pointer',\n opacity: isDisabled ? 0.6 : 1,\n\n // Animation\n transition: 'all 0.2s ease-in-out',\n\n // Apply custom styles\n ...views['label'],\n },\n checkbox: {\n // Base variant styles\n ...VariantStyles[variant],\n\n // State-specific styles\n ...stateStyle,\n\n // Visual properties\n borderRadius: 6, // radius-sm\n\n // Size properties\n ...Sizes[size],\n\n // Animation\n transition: 'all 0.2s ease-in-out',\n\n // Apply shadow and custom styles\n ...shadow,\n ...views['checkbox'],\n },\n };\n\n const infoTextId = `${checkboxId}-info`;\n const errorId = `${checkboxId}-error`;\n const describedBy =\n [infoText ? infoTextId : '', error ? errorId : '']\n .filter(Boolean)\n .join(' ') || undefined;\n\n return (\n <Vertical {...checkboxStyle.container}>\n <Label\n htmlFor={checkboxId}\n onMouseEnter={handleHover}\n onMouseLeave={handleHover}\n size={Typography.fontSizes[size]}\n cursor=\"inherit\"\n >\n <Horizontal gap={12} alignItems=\"center\">\n {' '}\n {/* 3 × 4px grid */}\n {/* Label on the left side */}\n {labelPosition === 'left' && label && (\n <Text\n size={size}\n fontWeight=\"500\" // Medium weight for better readability\n {...views?.label}\n >\n {label}\n </Text>\n )}\n {/* Checkbox */}\n <Center\n position=\"relative\"\n {...checkboxStyle.checkbox}\n {...(isFocused ? StateStyles.focus[variant] : {})}\n >\n {/* Real control: a transparent input covering the visible box, so\n the element found by role/name is the one that receives clicks */}\n <Input\n ref={inputRef}\n type=\"checkbox\"\n id={checkboxId}\n name={name}\n checked={checked}\n aria-checked={isIndeterminate ? 'mixed' : undefined}\n onChange={handleChange}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n disabled={isDisabled}\n readOnly={isReadOnly}\n position=\"absolute\"\n top={0}\n left={0}\n width=\"100%\"\n height=\"100%\"\n margin={0}\n opacity={0}\n zIndex={1}\n cursor={\n isDisabled ? 'not-allowed' : isReadOnly ? 'default' : 'pointer'\n }\n aria-describedby={describedBy}\n // Consumer rest props (aria-*, role, data-*) belong on the real\n // control, not the wrapping label.\n {...props}\n />\n {isIndeterminate ? (\n <MinusIcon\n widthHeight={IconSizes[size]}\n color=\"color-white\"\n transition=\"opacity 0.2s ease\"\n />\n ) : (\n (isChecked || isSelected) &&\n (icon ?? (\n <TickIcon\n widthHeight={IconSizes[size]}\n color=\"color-white\"\n transition=\"opacity 0.2s ease\"\n />\n ))\n )}\n </Center>\n {/* Label on the right side */}\n {labelPosition === 'right' && label && (\n <Text\n size={size}\n fontWeight=\"500\" // Medium weight for better readability\n {...views?.label}\n >\n {label}\n </Text>\n )}\n </Horizontal>\n </Label>\n {/* Info text — outside the <label> so it describes the input through\n `aria-describedby` instead of polluting its accessible name */}\n {infoText && (\n <Text\n id={infoTextId}\n marginLeft={labelPosition === 'left' ? 0 : 36} // 9 × 4px grid\n color=\"color-gray-500\"\n size=\"sm\"\n fontWeight=\"400\" // Regular weight\n lineHeight=\"20px\"\n {...views?.infoText}\n >\n {infoText}\n </Text>\n )}\n\n {/* Error message — outside the <label> for the same reason */}\n {error && (\n <Text\n id={errorId}\n size=\"xs\"\n marginTop={4} // 1 × 4px grid\n marginHorizontal={0}\n color=\"theme-error\"\n fontWeight=\"500\" // Medium weight for better readability\n transition=\"all 0.2s ease-in-out\"\n >\n {error}\n </Text>\n )}\n </Vertical>\n );\n};\n\nexport default CheckboxView;\n"],"names":["useCheckboxState","defaultIsSelected","isHovered","setIsHovered","React","isSelected","setIsSelected","Sizes","IconSizes","VariantStyles","StateStyles","CheckboxView","id","icon","name","label","isChecked","onChange","onValueChange","shadow","labelPosition","size","error","isDisabled","isReadOnly","isIndeterminate","views","infoText","helperText","props","generatedId","checkboxId","inputRef","isFocused","setIsFocused","checked","handleHover","handleChange","variant","stateStyle","checkboxStyle","infoTextId","errorId","describedBy","jsxs","Vertical","jsx","Label","Typography","Horizontal","Text","Center","Input","MinusIcon","TickIcon"],"mappings":";;;;;AAIO,MAAMA,KAAmB,CAAC;AAAA,EAC/B,mBAAAC,IAAoB;AACtB,MAAqB;AACnB,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAM,SAAS,EAAK,GAChD,CAACC,GAAYC,CAAa,IAC9BF,EAAM,SAAkBH,CAAiB;AAE3C,SAAO;AAAA,IACL,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAE;AAAA,IACA,eAAAC;AAAA,EAAA;AAEJ,GCC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A,QAEV,UAAApB;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldWrapper-Bb0j8Iog.mjs","sources":["../../src/components/Input/HelperText/HelperText.tsx","../../src/components/Input/FieldContainer/FieldContainer.tsx","../../src/components/Input/Input.style.ts","../../src/components/Input/fieldSizes.ts","../../src/components/Input/FieldContent/FieldContent.tsx","../../src/components/Input/FieldIcons/FieldIcons.tsx","../../src/components/Input/FieldLabel/FieldLabel.tsx","../../src/components/Input/FieldWrapper/FieldWrapper.tsx"],"sourcesContent":["/**\n * HelperText Component\n *\n * Renders helper text for form fields with appropriate styling\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Text } from 'app-studio';\n\nimport { HelperTextProps } from './HelperText.props';\n\nexport const HelperText: React.FC<HelperTextProps> = ({\n children,\n views = { helperText: {} },\n ...props\n}) => (\n <Text\n fontSize=\"11px\"\n fontWeight=\"400\"\n letterSpacing=\"-0.01em\"\n lineHeight=\"16px\"\n marginVertical={0}\n marginHorizontal={0}\n color=\"color-gray-500\"\n transition=\"color 0.2s ease, opacity 0.2s ease\"\n {...(views['helperText'] as any)}\n {...props}\n >\n {children}\n </Text>\n);\n","/**\n * FieldContainer Component\n *\n * Renders a container for a form field with helper text and error handling\n * according to the design guidelines.\n */\n\nimport React from 'react';\n\nimport { HelperText } from '../HelperText/HelperText';\n\nimport { ContainerProps } from './FieldContainer/FieldContainer.props';\nimport { Text } from 'app-studio';\nimport { Vertical } from 'app-studio';\n\nexport const FieldContainer = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, helperText, error = false, errorId, views, ...props }, ref) => (\n <Vertical\n ref={ref}\n gap={4}\n position=\"relative\"\n width=\"100%\"\n boxSizing=\"border-box\"\n marginVertical={0}\n {...props}\n {...views?.container}\n >\n {children}\n\n {!error && helperText && (\n <HelperText marginTop={0} {...views?.helperText}>\n {helperText}\n </HelperText>\n )}\n\n {error && (\n <Text\n id={errorId}\n fontSize=\"11px\"\n lineHeight=\"16px\"\n marginTop={0}\n marginHorizontal={0}\n fontWeight=\"500\"\n color=\"theme-error\"\n transition=\"color 0.2s ease, opacity 0.2s ease\"\n {...views?.error}\n >\n {error}\n </Text>\n )}\n </Vertical>\n )\n);\n\nFieldContainer.displayName = 'FieldContainer';\n","/**\n * Input Styles\n *\n * Defines the styles for input components following the design guidelines:\n * - Typography: Inter/Geist font, specific sizes/weights\n * - Spacing: 4px grid system\n * - Colors: Neutral palette with semantic colors\n * - Rounded corners: Consistent border radius\n * - Transitions: Subtle animations\n */\n\nimport { ViewProps } from 'app-studio';\nimport { Shape, Size, Variant } from './Input.type';\n\n/**\n * Shape styles for input components with consistent border radius\n */\nexport const Shapes: Record<Shape, ViewProps> = {\n default: {\n borderRadius: '8px', // Consistent with design system (rounded-md)\n },\n square: {\n borderRadius: 0,\n },\n rounded: {\n borderRadius: '8px', // Consistent with design system (rounded-md)\n },\n pill: {\n borderRadius: '9999px', // Full rounded for pill shape\n },\n};\n\n/**\n * Label sizes following the 4px grid system\n */\nexport const LabelSizes: Record<Size, string> = {\n xs: '10px',\n sm: '11px',\n md: '11px',\n lg: '12px',\n xl: '12px',\n};\n\n/**\n * Input variants with consistent styling\n * Design tokens:\n * - Transitions: 200ms ease-out for smooth, natural feel\n * - Focus ring: 3px offset with 15% opacity primary color\n * - Hover: Subtle background tint for better affordance\n */\nexport const InputVariants: Record<Variant, ViewProps> = {\n outline: {\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'color-gray-200',\n backgroundColor: 'transparent',\n color: 'inherit',\n transition:\n 'border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease',\n _hover: {\n borderColor: 'color-gray-300',\n },\n _focus: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n _focusVisible: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n },\n default: {\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'color-gray-200',\n borderRadius: '8px',\n backgroundColor: 'transparent',\n color: 'inherit',\n transition:\n 'border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease',\n _hover: {\n borderColor: 'color-gray-300',\n },\n _focus: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n _focusVisible: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n },\n none: {\n border: 'none',\n style: { backgroundColor: 'transparent' },\n color: 'inherit',\n transition: 'background-color 0.2s ease',\n },\n};\n\n/*\n * `PadddingWithLabel` and `PaddingWithoutLabel` used to live here. They were\n * removed rather than renamed (the first was misspelled with three d's) because\n * they had stopped meaning anything:\n *\n * - the two were byte-identical, so the `showLabel ? a : b` choice between\n * them had no effect;\n * - both were size-independent 10px/12px, which is why every field rendered\n * at roughly `md` height whatever size was requested;\n * - their `media.mobile` block repeated the same values, and being a nested\n * media rule it would have won over the size scale at mobile widths —\n * quietly pinning `xs` and `xl` fields back to `md` padding on phones.\n *\n * Field padding now comes from `Input/fieldSizes` via FieldContent.\n */\n","/**\n * The canonical size scale for form fields.\n *\n * One source of truth, because there used to be several: TextField and Select\n * each declared their own `fieldSizeStyles`, ComboBox declared a third in its\n * style file (with `xs` at 28px rather than 24px), and DatePicker, TagInput and\n * CountryPicker declared none at all — so they fell back to a fixed 10px\n * padding and rendered the same height at every size.\n *\n * The vertical metrics match `ButtonSizes`, so a Button and a field of the same\n * size line up in a row without any alignment work.\n *\n * `paddingVertical` is chosen so that padding + the input's natural line box +\n * the 1px border stays *under* `minHeight` at every size. `minHeight` is then\n * the binding constraint and each field renders at exactly its declared height,\n * while still being free to grow when its content wraps (TagInput chips, for\n * instance).\n */\n\nimport { Size } from './Input.type';\n\nexport interface FieldSizeMetrics {\n minHeight: number;\n paddingVertical: number;\n paddingHorizontal: number;\n}\n\nexport const FieldSizes: Record<Size, FieldSizeMetrics> = {\n xs: { minHeight: 24, paddingVertical: 4, paddingHorizontal: 10 },\n sm: { minHeight: 32, paddingVertical: 7, paddingHorizontal: 10 },\n md: { minHeight: 40, paddingVertical: 9, paddingHorizontal: 12 },\n lg: { minHeight: 48, paddingVertical: 11, paddingHorizontal: 14 },\n xl: { minHeight: 56, paddingVertical: 13, paddingHorizontal: 16 },\n};\n\n/** Field metrics as `ViewProps`, ready to spread onto the field shell. */\nexport const fieldSizeProps = (size: Size) => {\n const { minHeight, paddingVertical, paddingHorizontal } = FieldSizes[size];\n return {\n minHeight: `${minHeight}px`,\n paddingTop: `${paddingVertical}px`,\n paddingBottom: `${paddingVertical}px`,\n paddingLeft: `${paddingHorizontal}px`,\n paddingRight: `${paddingHorizontal}px`,\n };\n};\n","/**\n * FieldContent Component\n *\n * Renders the content area of a form field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Typography, useTheme } from 'app-studio';\n\nimport { InputVariants, Shapes } from '../Input.style';\nimport { fieldSizeProps } from '../fieldSizes';\nimport { Horizontal } from 'app-studio';\n\nimport { ContentProps } from './FieldContent/FieldContent.props';\n\nexport const FieldContent: React.FC<ContentProps> = ({\n label,\n shadow,\n children,\n value,\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n showLabel = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n views = { pickerBox: {} },\n ...props\n}) => {\n const { themeMode } = useTheme();\n const isDark = themeMode === 'dark';\n\n // Determine if the field is in an interactive state\n const isInteractive = (isHovered || isFocused) && !isDisabled;\n const color = error\n ? 'color-red-500'\n : isInteractive\n ? 'theme-primary'\n : 'color-gray-200';\n\n return (\n <Horizontal\n gap={8}\n width=\"100%\"\n // Fields set `width: 100%` and then add their own padding/border, so they\n // only fit their container under border-box. Declared here rather than\n // relying on a host `* { box-sizing: border-box }` reset, whose absence\n // otherwise makes every field overflow its parent by padding + border.\n boxSizing=\"border-box\"\n display=\"flex\"\n flexWrap=\"nowrap\"\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n borderStyle=\"solid\"\n borderColor={color}\n backgroundColor={isDark ? 'color-gray-900' : 'color-white'}\n fontSize={Typography.fontSizes[size]}\n cursor={isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'text'}\n opacity={isDisabled ? 0.7 : 1}\n transition=\"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease\"\n // Sizing belongs to the shell, not to each field: without it every field\n // rendered at roughly `md` height whatever size was asked for. Placed\n // before `views`/`props` so a caller can still override.\n {...fieldSizeProps(size)}\n {...(typeof shadow === 'object' && shadow !== null ? shadow : {})}\n {...Shapes[shape]}\n {...InputVariants[variant]}\n {...views?.container}\n {...props}\n >\n {children}\n </Horizontal>\n );\n};\n","import React from 'react';\nimport { Horizontal } from 'app-studio';\n\nimport { FieldIconsProps } from './FieldIcons/FieldIcons.props';\n\nexport const FieldIcons: React.FC<FieldIconsProps> = ({\n children,\n ...props\n}) => (\n <Horizontal\n gap={10}\n right={10}\n zIndex={500}\n flexWrap=\"nowrap\"\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n {...props}\n >\n {children}\n </Horizontal>\n);\n","/**\n * FieldLabel Component\n *\n * Renders a label for a form field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Label } from '../../Form/Label/Label';\n\nimport { LabelSizes } from '../Input.style';\n\nimport { LabelProps } from './FieldLabel/FieldLabel.props';\n\nexport const FieldLabel: React.FC<LabelProps> = ({\n children,\n size = 'md',\n error = false,\n color = 'theme-primary',\n views = { label: {} },\n helperText,\n ...props\n}) => (\n <Label\n position=\"static\"\n fontSize={LabelSizes[size]}\n letterSpacing=\"-0.01em\"\n whiteSpace=\"nowrap\"\n fontWeight={500}\n // Full opacity always: dimming inherited ink to 0.72 at 11–12px lands\n // under the 4.5:1 contrast ratio and fails axe (serious) on every form\n // screen. De-emphasis, where a design wants it, belongs to a color token\n // that still clears the ratio — not to an opacity filter.\n color={error ? 'theme-error' : 'inherit'}\n transition=\"color 0.2s ease\"\n {...views['label']}\n {...props}\n >\n {children}\n </Label>\n);\n","/**\n * FieldWrapper Component\n *\n * Renders a wrapper for form field content with appropriate styling\n * according to the design guidelines.\n */\n\nimport React from 'react';\n\nimport { Vertical } from 'app-studio';\n\nimport { WrapperFieldProps } from './FieldWrapper.props';\n\nexport const FieldWrapper: React.FC<WrapperFieldProps> = ({\n children,\n ...props\n}) => (\n <Vertical\n display=\"flex\"\n flexDirection=\"column\"\n gap={4}\n flex={1}\n width=\"100%\"\n maxWidth=\"100%\"\n boxSizing=\"border-box\"\n {...props}\n >\n {children}\n </Vertical>\n);\n"],"names":["HelperText","children","views","props","jsx","Text","FieldContainer","React","helperText","error","errorId","ref","jsxs","Vertical","Shapes","LabelSizes","InputVariants","FieldSizes","fieldSizeProps","size","minHeight","paddingVertical","paddingHorizontal","FieldContent","label","shadow","value","shape","variant","showLabel","isFocused","isHovered","isDisabled","isReadOnly","themeMode","useTheme","Horizontal","Typography","FieldIcons","FieldLabel","color","Label","FieldWrapper"],"mappings":";;;;AAYO,MAAMA,IAAwC,CAAC;AAAA,EACpD,UAAAC;AAAA,EACA,OAAAC,IAAQ,EAAE,YAAY,GAAC;AAAA,EACvB,GAAGC;AACL,MACE,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,UAAS;AAAA,IACT,YAAW;AAAA,IACX,eAAc;AAAA,IACd,YAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,OAAM;AAAA,IACN,YAAW;AAAA,IACV,GAAIH,EAAM;AAAA,IACV,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AACH,GCfWK,IAAiBC,EAAM;AAAA,EAClC,CAAC,EAAE,UAAAN,GAAU,YAAAO,GAAY,OAAAC,IAAQ,IAAO,SAAAC,GAAS,OAAAR,GAAO,GAAGC,KAASQ,MAClE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MAC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AGE;AACL,MACE,gBAAAC;AAAA,EAACgC;AAAA,EAAA;AAAA,IACC,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAS;AAAA,IACT,YAAW;AAAA,IACX,gBAAe;AAAA,IACd,GAAGjC;AAAA,IAEH,UAAAF;AAAA,EAAA;AACH,GCLWsC,IAAmC,CAAC;AAAA,EAC/C,UAAAtC;AAAA,EACA,MAAAkB,IAAO;AAAA,EACP,OAAAV,IAAQ;AAAA,EACR,OAAA+B,IAAQ;AAAA,EACR,OAAAtC,IAAQ,EAAE,OAAO,GAAC;AAAA,EAClB,YAAAM;AAAA,EACA,GAAGL;AACL,MACE,gBAAAC;AAAA,EAACqC;AAAA,EAAA;AAAA,IACC,UAAS;AAAA,IACT,UAAU1B,EAAWI,CAAI;AAAA,IACzB,eAAc;AAAA,IACd,YAAW;AAAA,IACX,YAAY;AAAA,IAKZ,OAAOV,IAAQ,gBAAgB;AAAA,IAC/B,YAAW;AAAA,IACV,GAAGP,EAAM;AAAA,IACT,GAAGC;AAAA,IAEH,UAAAF;AAAA,EAAA;AACH,GC1BWyC,IAA4C,CAAC;AAAA,EACxD,UAAAzC;AAAA,EACA,GAAGE;AACL,MACE,gBAAAC;AAAA,EAACS;AAAA,EAAA;AAAA,IACC,SAAQ;AAAA,IACR,eAAc;AAAA,IACd,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAM;AAAA,IACN,UAAS;AAAA,IACT,WAAU;AAAA,IACT,GAAGV;AAAA,IAEH,UAAAF;AAAA,EAAA;AACH;"}
@@ -1,2 +0,0 @@
1
- "use strict";const a=require("react/jsx-runtime"),z=require("react"),i=require("app-studio"),H=require("./Label-Bd0TpfkG.cjs"),c=({children:r,views:o={helperText:{}},...t})=>a.jsx(i.Text,{fontSize:"11px",fontWeight:"400",letterSpacing:"-0.01em",lineHeight:"16px",marginVertical:0,marginHorizontal:0,color:"color-gray-500",transition:"color 0.2s ease, opacity 0.2s ease",...o.helperText,...t,children:r}),x=z.forwardRef(({children:r,helperText:o,error:t=!1,errorId:n,views:e,...d},l)=>a.jsxs(i.Vertical,{ref:l,gap:4,position:"relative",width:"100%",boxSizing:"border-box",marginVertical:0,...d,...e==null?void 0:e.container,children:[r,!t&&o&&a.jsx(c,{marginTop:0,...e==null?void 0:e.helperText,children:o}),t&&a.jsx(i.Text,{id:n,fontSize:"11px",lineHeight:"16px",marginTop:0,marginHorizontal:0,fontWeight:"500",color:"theme-error",transition:"color 0.2s ease, opacity 0.2s ease",...e==null?void 0:e.error,children:t})]}));x.displayName="FieldContainer";const C={default:{borderRadius:"8px"},square:{borderRadius:0},rounded:{borderRadius:"8px"},pill:{borderRadius:"9999px"}},V={xs:"10px",sm:"11px",md:"11px",lg:"12px",xl:"12px"},j={outline:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",backgroundColor:"transparent",color:"inherit",transition:"border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease",_hover:{borderColor:"color-gray-300"},_focus:{borderColor:"theme-primary",outline:"none",boxShadow:"0 0 0 3px theme-primary"},_focusVisible:{borderColor:"theme-primary",outline:"none",boxShadow:"0 0 0 3px theme-primary"}},default:{borderWidth:"1px",borderStyle:"solid",borderColor:"color-gray-200",borderRadius:"8px",backgroundColor:"transparent",color:"inherit",transition:"border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease",_hover:{borderColor:"color-gray-300"},_focus:{borderColor:"theme-primary",outline:"none",boxShadow:"0 0 0 3px theme-primary"},_focusVisible:{borderColor:"theme-primary",outline:"none",boxShadow:"0 0 0 3px theme-primary"}},none:{border:"none",style:{backgroundColor:"transparent"},color:"inherit",transition:"background-color 0.2s ease"}},F={xs:{minHeight:24,paddingVertical:4,paddingHorizontal:10},sm:{minHeight:32,paddingVertical:7,paddingHorizontal:10},md:{minHeight:40,paddingVertical:9,paddingHorizontal:12},lg:{minHeight:48,paddingVertical:11,paddingHorizontal:14},xl:{minHeight:56,paddingVertical:13,paddingHorizontal:16}},T=r=>{const{minHeight:o,paddingVertical:t,paddingHorizontal:n}=F[r];return{minHeight:`${o}px`,paddingTop:`${t}px`,paddingBottom:`${t}px`,paddingLeft:`${n}px`,paddingRight:`${n}px`}},k=({label:r,shadow:o,children:t,value:n,size:e="md",shape:d="default",variant:l="default",error:g=!1,showLabel:L=!1,isFocused:b=!1,isHovered:h=!1,isDisabled:s=!1,isReadOnly:m=!1,views:p={pickerBox:{}},...u})=>{const{themeMode:f}=i.useTheme(),y=f==="dark",S=g?"color-red-500":(h||b)&&!s?"theme-primary":"color-gray-200";return a.jsx(i.Horizontal,{gap:8,width:"100%",boxSizing:"border-box",display:"flex",flexWrap:"nowrap",alignItems:"center",justifyContent:"flex-start",borderStyle:"solid",borderColor:S,backgroundColor:y?"color-gray-900":"color-white",fontSize:i.Typography.fontSizes[e],cursor:s?"not-allowed":m?"auto":"text",opacity:s?.7:1,transition:"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease",...T(e),...typeof o=="object"&&o!==null?o:{},...C[d],...j[l],...p==null?void 0:p.container,...u,children:t})},W=({children:r,...o})=>a.jsx(i.Horizontal,{gap:10,right:10,zIndex:500,flexWrap:"nowrap",alignItems:"center",justifyContent:"flex-end",...o,children:r}),R=({children:r,size:o="md",error:t=!1,color:n="theme-primary",views:e={label:{}},helperText:d,...l})=>a.jsx(H.Label,{position:"static",fontSize:V[o],letterSpacing:"-0.01em",whiteSpace:"nowrap",fontWeight:500,color:t?"theme-error":"inherit",transition:"color 0.2s ease",...e.label,...l,children:r}),I=({children:r,...o})=>a.jsx(i.Vertical,{display:"flex",flexDirection:"column",gap:4,flex:1,width:"100%",maxWidth:"100%",boxSizing:"border-box",...o,children:r});exports.FieldContainer=x;exports.FieldContent=k;exports.FieldIcons=W;exports.FieldLabel=R;exports.FieldWrapper=I;exports.HelperText=c;
2
- //# sourceMappingURL=FieldWrapper-DRCn7BLi.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldWrapper-DRCn7BLi.cjs","sources":["../../src/components/Input/HelperText/HelperText.tsx","../../src/components/Input/FieldContainer/FieldContainer.tsx","../../src/components/Input/Input.style.ts","../../src/components/Input/fieldSizes.ts","../../src/components/Input/FieldContent/FieldContent.tsx","../../src/components/Input/FieldIcons/FieldIcons.tsx","../../src/components/Input/FieldLabel/FieldLabel.tsx","../../src/components/Input/FieldWrapper/FieldWrapper.tsx"],"sourcesContent":["/**\n * HelperText Component\n *\n * Renders helper text for form fields with appropriate styling\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Text } from 'app-studio';\n\nimport { HelperTextProps } from './HelperText.props';\n\nexport const HelperText: React.FC<HelperTextProps> = ({\n children,\n views = { helperText: {} },\n ...props\n}) => (\n <Text\n fontSize=\"11px\"\n fontWeight=\"400\"\n letterSpacing=\"-0.01em\"\n lineHeight=\"16px\"\n marginVertical={0}\n marginHorizontal={0}\n color=\"color-gray-500\"\n transition=\"color 0.2s ease, opacity 0.2s ease\"\n {...(views['helperText'] as any)}\n {...props}\n >\n {children}\n </Text>\n);\n","/**\n * FieldContainer Component\n *\n * Renders a container for a form field with helper text and error handling\n * according to the design guidelines.\n */\n\nimport React from 'react';\n\nimport { HelperText } from '../HelperText/HelperText';\n\nimport { ContainerProps } from './FieldContainer/FieldContainer.props';\nimport { Text } from 'app-studio';\nimport { Vertical } from 'app-studio';\n\nexport const FieldContainer = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, helperText, error = false, errorId, views, ...props }, ref) => (\n <Vertical\n ref={ref}\n gap={4}\n position=\"relative\"\n width=\"100%\"\n boxSizing=\"border-box\"\n marginVertical={0}\n {...props}\n {...views?.container}\n >\n {children}\n\n {!error && helperText && (\n <HelperText marginTop={0} {...views?.helperText}>\n {helperText}\n </HelperText>\n )}\n\n {error && (\n <Text\n id={errorId}\n fontSize=\"11px\"\n lineHeight=\"16px\"\n marginTop={0}\n marginHorizontal={0}\n fontWeight=\"500\"\n color=\"theme-error\"\n transition=\"color 0.2s ease, opacity 0.2s ease\"\n {...views?.error}\n >\n {error}\n </Text>\n )}\n </Vertical>\n )\n);\n\nFieldContainer.displayName = 'FieldContainer';\n","/**\n * Input Styles\n *\n * Defines the styles for input components following the design guidelines:\n * - Typography: Inter/Geist font, specific sizes/weights\n * - Spacing: 4px grid system\n * - Colors: Neutral palette with semantic colors\n * - Rounded corners: Consistent border radius\n * - Transitions: Subtle animations\n */\n\nimport { ViewProps } from 'app-studio';\nimport { Shape, Size, Variant } from './Input.type';\n\n/**\n * Shape styles for input components with consistent border radius\n */\nexport const Shapes: Record<Shape, ViewProps> = {\n default: {\n borderRadius: '8px', // Consistent with design system (rounded-md)\n },\n square: {\n borderRadius: 0,\n },\n rounded: {\n borderRadius: '8px', // Consistent with design system (rounded-md)\n },\n pill: {\n borderRadius: '9999px', // Full rounded for pill shape\n },\n};\n\n/**\n * Label sizes following the 4px grid system\n */\nexport const LabelSizes: Record<Size, string> = {\n xs: '10px',\n sm: '11px',\n md: '11px',\n lg: '12px',\n xl: '12px',\n};\n\n/**\n * Input variants with consistent styling\n * Design tokens:\n * - Transitions: 200ms ease-out for smooth, natural feel\n * - Focus ring: 3px offset with 15% opacity primary color\n * - Hover: Subtle background tint for better affordance\n */\nexport const InputVariants: Record<Variant, ViewProps> = {\n outline: {\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'color-gray-200',\n backgroundColor: 'transparent',\n color: 'inherit',\n transition:\n 'border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease',\n _hover: {\n borderColor: 'color-gray-300',\n },\n _focus: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n _focusVisible: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n },\n default: {\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'color-gray-200',\n borderRadius: '8px',\n backgroundColor: 'transparent',\n color: 'inherit',\n transition:\n 'border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease',\n _hover: {\n borderColor: 'color-gray-300',\n },\n _focus: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n _focusVisible: {\n borderColor: 'theme-primary',\n outline: 'none',\n boxShadow: '0 0 0 3px theme-primary',\n },\n },\n none: {\n border: 'none',\n style: { backgroundColor: 'transparent' },\n color: 'inherit',\n transition: 'background-color 0.2s ease',\n },\n};\n\n/*\n * `PadddingWithLabel` and `PaddingWithoutLabel` used to live here. They were\n * removed rather than renamed (the first was misspelled with three d's) because\n * they had stopped meaning anything:\n *\n * - the two were byte-identical, so the `showLabel ? a : b` choice between\n * them had no effect;\n * - both were size-independent 10px/12px, which is why every field rendered\n * at roughly `md` height whatever size was requested;\n * - their `media.mobile` block repeated the same values, and being a nested\n * media rule it would have won over the size scale at mobile widths —\n * quietly pinning `xs` and `xl` fields back to `md` padding on phones.\n *\n * Field padding now comes from `Input/fieldSizes` via FieldContent.\n */\n","/**\n * The canonical size scale for form fields.\n *\n * One source of truth, because there used to be several: TextField and Select\n * each declared their own `fieldSizeStyles`, ComboBox declared a third in its\n * style file (with `xs` at 28px rather than 24px), and DatePicker, TagInput and\n * CountryPicker declared none at all — so they fell back to a fixed 10px\n * padding and rendered the same height at every size.\n *\n * The vertical metrics match `ButtonSizes`, so a Button and a field of the same\n * size line up in a row without any alignment work.\n *\n * `paddingVertical` is chosen so that padding + the input's natural line box +\n * the 1px border stays *under* `minHeight` at every size. `minHeight` is then\n * the binding constraint and each field renders at exactly its declared height,\n * while still being free to grow when its content wraps (TagInput chips, for\n * instance).\n */\n\nimport { Size } from './Input.type';\n\nexport interface FieldSizeMetrics {\n minHeight: number;\n paddingVertical: number;\n paddingHorizontal: number;\n}\n\nexport const FieldSizes: Record<Size, FieldSizeMetrics> = {\n xs: { minHeight: 24, paddingVertical: 4, paddingHorizontal: 10 },\n sm: { minHeight: 32, paddingVertical: 7, paddingHorizontal: 10 },\n md: { minHeight: 40, paddingVertical: 9, paddingHorizontal: 12 },\n lg: { minHeight: 48, paddingVertical: 11, paddingHorizontal: 14 },\n xl: { minHeight: 56, paddingVertical: 13, paddingHorizontal: 16 },\n};\n\n/** Field metrics as `ViewProps`, ready to spread onto the field shell. */\nexport const fieldSizeProps = (size: Size) => {\n const { minHeight, paddingVertical, paddingHorizontal } = FieldSizes[size];\n return {\n minHeight: `${minHeight}px`,\n paddingTop: `${paddingVertical}px`,\n paddingBottom: `${paddingVertical}px`,\n paddingLeft: `${paddingHorizontal}px`,\n paddingRight: `${paddingHorizontal}px`,\n };\n};\n","/**\n * FieldContent Component\n *\n * Renders the content area of a form field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Typography, useTheme } from 'app-studio';\n\nimport { InputVariants, Shapes } from '../Input.style';\nimport { fieldSizeProps } from '../fieldSizes';\nimport { Horizontal } from 'app-studio';\n\nimport { ContentProps } from './FieldContent/FieldContent.props';\n\nexport const FieldContent: React.FC<ContentProps> = ({\n label,\n shadow,\n children,\n value,\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n showLabel = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n views = { pickerBox: {} },\n ...props\n}) => {\n const { themeMode } = useTheme();\n const isDark = themeMode === 'dark';\n\n // Determine if the field is in an interactive state\n const isInteractive = (isHovered || isFocused) && !isDisabled;\n const color = error\n ? 'color-red-500'\n : isInteractive\n ? 'theme-primary'\n : 'color-gray-200';\n\n return (\n <Horizontal\n gap={8}\n width=\"100%\"\n // Fields set `width: 100%` and then add their own padding/border, so they\n // only fit their container under border-box. Declared here rather than\n // relying on a host `* { box-sizing: border-box }` reset, whose absence\n // otherwise makes every field overflow its parent by padding + border.\n boxSizing=\"border-box\"\n display=\"flex\"\n flexWrap=\"nowrap\"\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n borderStyle=\"solid\"\n borderColor={color}\n backgroundColor={isDark ? 'color-gray-900' : 'color-white'}\n fontSize={Typography.fontSizes[size]}\n cursor={isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'text'}\n opacity={isDisabled ? 0.7 : 1}\n transition=\"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease\"\n // Sizing belongs to the shell, not to each field: without it every field\n // rendered at roughly `md` height whatever size was asked for. Placed\n // before `views`/`props` so a caller can still override.\n {...fieldSizeProps(size)}\n {...(typeof shadow === 'object' && shadow !== null ? shadow : {})}\n {...Shapes[shape]}\n {...InputVariants[variant]}\n {...views?.container}\n {...props}\n >\n {children}\n </Horizontal>\n );\n};\n","import React from 'react';\nimport { Horizontal } from 'app-studio';\n\nimport { FieldIconsProps } from './FieldIcons/FieldIcons.props';\n\nexport const FieldIcons: React.FC<FieldIconsProps> = ({\n children,\n ...props\n}) => (\n <Horizontal\n gap={10}\n right={10}\n zIndex={500}\n flexWrap=\"nowrap\"\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n {...props}\n >\n {children}\n </Horizontal>\n);\n","/**\n * FieldLabel Component\n *\n * Renders a label for a form field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Label } from '../../Form/Label/Label';\n\nimport { LabelSizes } from '../Input.style';\n\nimport { LabelProps } from './FieldLabel/FieldLabel.props';\n\nexport const FieldLabel: React.FC<LabelProps> = ({\n children,\n size = 'md',\n error = false,\n color = 'theme-primary',\n views = { label: {} },\n helperText,\n ...props\n}) => (\n <Label\n position=\"static\"\n fontSize={LabelSizes[size]}\n letterSpacing=\"-0.01em\"\n whiteSpace=\"nowrap\"\n fontWeight={500}\n // Full opacity always: dimming inherited ink to 0.72 at 11–12px lands\n // under the 4.5:1 contrast ratio and fails axe (serious) on every form\n // screen. De-emphasis, where a design wants it, belongs to a color token\n // that still clears the ratio — not to an opacity filter.\n color={error ? 'theme-error' : 'inherit'}\n transition=\"color 0.2s ease\"\n {...views['label']}\n {...props}\n >\n {children}\n </Label>\n);\n","/**\n * FieldWrapper Component\n *\n * Renders a wrapper for form field content with appropriate styling\n * according to the design guidelines.\n */\n\nimport React from 'react';\n\nimport { Vertical } from 'app-studio';\n\nimport { WrapperFieldProps } from './FieldWrapper.props';\n\nexport const FieldWrapper: React.FC<WrapperFieldProps> = ({\n children,\n ...props\n}) => (\n <Vertical\n display=\"flex\"\n flexDirection=\"column\"\n gap={4}\n flex={1}\n width=\"100%\"\n maxWidth=\"100%\"\n boxSizing=\"border-box\"\n {...props}\n >\n {children}\n </Vertical>\n);\n"],"names":["HelperText","children","views","props","jsx","Text","FieldContainer","React","helperText","error","errorId","ref","jsxs","Vertical","Shapes","LabelSizes","InputVariants","FieldSizes","fieldSizeProps","size","minHeight","paddingVertical","paddingHorizontal","FieldContent","label","shadow","value","shape","variant","showLabel","isFocused","isHovered","isDisabled","isReadOnly","themeMode","useTheme","isDark","color","Horizontal","Typography","FieldIcons","FieldLabel","Label","FieldWrapper"],"mappings":"+HAYaA,EAAwC,CAAC,CACpD,SAAAC,EACA,MAAAC,EAAQ,CAAE,WAAY,EAAC,EACvB,GAAGC,CACL,IACEC,EAAAA,IAACC,EAAAA,KAAA,CACC,SAAS,OACT,WAAW,MACX,cAAc,UACd,WAAW,OACX,eAAgB,EAChB,iBAAkB,EAClB,MAAM,iBACN,WAAW,qCACV,GAAIH,EAAM,WACV,GAAGC,EAEH,SAAAF,CAAA,CACH,ECfWK,EAAiBC,EAAM,WAClC,CAAC,CAAE,SAAAN,EAAU,WAAAO,EAAY,MAAAC,EAAQ,GAAO,QAAAC,EAAS,MAAAR,EAAO,GAAGC,GAASQ,IAClEC,EAAAA,KAACC,EAAAA,SAAA,CACC,IAAAF,EACA,IAAK,EACL,SAAS,WACT,MAAM,OACN,UAAU,aACV,eAAgB,EACf,GAAGR,EACH,GAAGD,GAAA,YAAAA,EAAO,UAEV,SAAA,CAAAD,EAEA,CAACQ,GAASD,GACTJ,EAAAA,IAACJ,EAAA,CAAW,UAAW,EAAI,GAAGE,GAAA,YAAAA,EAAO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7D,GAAGX,EAAOa,CAAK,EACf,GAAGX,EAAcY,CAAO,EACxB,GAAG1B,GAAA,YAAAA,EAAO,UACV,GAAGC,EAEH,SAAAF,CAAA,CAAA,CAGP,ECxEauC,EAAwC,CAAC,CACpD,SAAAvC,EACA,GAAGE,CACL,IACEC,EAAAA,IAACkC,EAAAA,WAAA,CACC,IAAK,GACL,MAAO,GACP,OAAQ,IACR,SAAS,SACT,WAAW,SACX,eAAe,WACd,GAAGnC,EAEH,SAAAF,CAAA,CACH,ECLWwC,EAAmC,CAAC,CAC/C,SAAAxC,EACA,KAAAkB,EAAO,KACP,MAAAV,EAAQ,GACR,MAAA4B,EAAQ,gBACR,MAAAnC,EAAQ,CAAE,MAAO,EAAC,EAClB,WAAAM,EACA,GAAGL,CACL,IACEC,EAAAA,IAACsC,EAAAA,MAAA,CACC,SAAS,SACT,SAAU3B,EAAWI,CAAI,EACzB,cAAc,UACd,WAAW,SACX,WAAY,IAKZ,MAAOV,EAAQ,cAAgB,UAC/B,WAAW,kBACV,GAAGP,EAAM,MACT,GAAGC,EAEH,SAAAF,CAAA,CACH,EC1BW0C,EAA4C,CAAC,CACxD,SAAA1C,EACA,GAAGE,CACL,IACEC,EAAAA,IAACS,EAAAA,SAAA,CACC,QAAQ,OACR,cAAc,SACd,IAAK,EACL,KAAM,EACN,MAAM,OACN,SAAS,OACT,UAAU,aACT,GAAGV,EAEH,SAAAF,CAAA,CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Modal-DkckCT8-.mjs","sources":["../../src/components/Modal/Modal/Modal.store.tsx","../../src/components/Modal/Modal/Modal.style.ts","../../src/components/Modal/Modal/Modal.view.tsx","../../src/components/Modal/Modal/Modal.layout.tsx","../../src/components/Modal/Modal.tsx"],"sourcesContent":["import { create } from 'zustand';\n// Defines the structure for a single modal instance managed by the store.\nexport interface ModalItem {\n // A unique string identifier for the modal.\n name: string;\n // An object containing properties to be passed to the modal component, including its visibility state.\n props: any & { isVisible: boolean };\n // An object containing properties for the modal's overlay component.\n overlayProps: any;\n}\n// Defines the overall state shape and available actions for the modal store.\nexport interface ModalState {\n // An array holding all currently active modal items.\n modals: ModalItem[];\n // Function to add a new modal to the state, making it visible.\n show: (name: string, modalProps?: any, overlayProps?: any) => void;\n // Function to remove a modal from the state, making it hidden.\n hide: (name?: string) => void;\n // A callback function executed when a modal is shown, allowing custom side effects.\n onShow: (name: string, props?: any) => void;\n // A callback function executed when a modal is hidden, allowing custom side effects.\n onHide: (name?: string) => void;\n // Function to set or update the 'onShow' callback in the store.\n setOnShow: (onShow: (name: string, props?: any) => void) => void;\n // Function to set or update the 'onHide' callback in the store.\n setOnHide: (onHide: (name?: string) => void) => void;\n}\n// Initializes the Zustand store for managing modal states and actions.\nexport const useModalStore = create<ModalState>((set) => ({\n // The initial state property: an empty array of modals.\n modals: [],\n // Default implementation for the 'onHide' callback.\n onHide: (name?: string) => name,\n // Default implementation for the 'onShow' callback.\n onShow: (name: string, props?: any) => ({ name, props }),\n // Action to add a new modal to the 'modals' array, setting its 'isVisible' prop to true.\n show: (name, modalProps = {}, overlayProps = {}) => {\n set((state: ModalState) => ({\n ...state,\n modals: [\n ...state.modals,\n {\n name,\n props: { ...modalProps, isVisible: true },\n overlayProps,\n },\n ],\n }));\n },\n // Action to remove a modal from the 'modals' array based on its name, or clear all modals if no name is provided.\n hide: (name) => {\n set((state: ModalState) => {\n if (!name) {\n return { modals: [] };\n }\n return {\n ...state,\n modals: state.modals.filter((modal) => modal.name !== name),\n };\n });\n },\n // Action to update the 'onHide' callback function within the store.\n setOnHide: (onHide: (name?: string) => void) => {\n set((state: ModalState) => ({ ...state, onHide }));\n },\n // Action to update the 'onShow' callback function within the store.\n setOnShow: (onShow: (name: string, props?: any) => void) => {\n set((state: ModalState) => ({ ...state, onShow }));\n },\n}));\n// A convenience function to programmatically display a modal and trigger its 'onShow' callback.\nexport const showModal = (\n name: string,\n modalProps: any = {},\n overlayProps: any = {}\n) => {\n // Calls the 'show' action from the modal store to add the modal to the state.\n useModalStore.getState().show(name, modalProps, overlayProps);\n // Triggers the registered 'onShow' callback for the newly shown modal, allowing external effects.\n useModalStore.getState().onShow(name, modalProps);\n};\n// A convenience function to programmatically hide a modal and trigger its 'onHide' callback.\nexport const hideModal = (name?: string) => {\n // Triggers the registered 'onHide' callback for the hidden modal, allowing external effects.\n useModalStore.getState().onHide(name);\n // Calls the 'hide' action from the modal store to remove the modal from the state.\n useModalStore.getState().hide(typeof name === 'string' ? name : undefined);\n};\n","import { ViewProps } from 'app-studio';\nimport { Shape, Size } from './Modal.type';\n// Defines a mapping of modal container shapes to their corresponding border-radius styles.\nexport const ContainerShapes: Record<Shape, ViewProps> = {\n square: { borderRadius: 0 },\n rounded: { borderRadius: 8 },\n};\n// Specifies various alignment configurations for the modal's overlay content.\nexport const OverlayAlignments: Record<string, ViewProps> = {\n center: { justifyContent: 'center', alignItems: 'center' },\n top: {\n justifyContent: 'center',\n alignItems: 'flex-start',\n },\n right: {\n justifyContent: 'flex-end',\n alignItems: 'center',\n },\n bottom: {\n justifyContent: 'center',\n alignItems: 'flex-end',\n },\n left: {\n justifyContent: 'flex-start',\n alignItems: 'center',\n },\n};\n// Maps predefined size categories to specific pixel values for modal header icons.\nexport const HeaderIconSizes: Record<Size, number> = {\n xs: 12,\n sm: 16,\n md: 20,\n lg: 24,\n xl: 28,\n};\n// Contains keyframe definitions for the modal's entry and exit animations, including opacity and transform.\nexport const ModalAnimations = {\n enter: {\n opacity: [0, 1],\n transform: ['scale(0.95)', 'scale(1)'],\n transition: 'opacity 0.2s ease-out, transform 0.2s ease-out',\n },\n exit: {\n opacity: [1, 0],\n transform: ['scale(1)', 'scale(0.95)'],\n transition: 'opacity 0.15s ease-in, transform 0.15s ease-in',\n },\n};\n// Provides the default background and transition styles for the modal overlay.\nexport const OverlayStyles: ViewProps = {\n backgroundColor: 'color-dark-50-240',\n transition: 'background-color 0.2s ease',\n};\n// Sets the foundational background, shadow, and focus styles for the modal's content container.\nexport const ContainerBaseStyles: ViewProps = {\n backgroundColor: 'color-white',\n boxShadow: '0 10px 30px rgba(0, 0, 0, 0.12)',\n transition: 'box-shadow 0.2s ease',\n _focusVisible: {\n outline: 'none',\n boxShadow: '0 0 0 2px color-white, 0 0 0 4px theme-primary',\n },\n};\n// Groups typography settings for the modal's title and body text, including font size, weight, and color.\nexport const ModalTypography = {\n title: {\n fontSize: '20px',\n fontWeight: '600',\n lineHeight: '28px',\n color: 'color-gray-900',\n },\n body: {\n fontSize: '16px',\n fontWeight: '400',\n lineHeight: '24px',\n color: 'color-gray-700',\n },\n};\n","import React, { useCallback, useEffect, useMemo, useRef } from 'react';\nimport {\n Element,\n View,\n Horizontal,\n ViewProps,\n Vertical,\n Center,\n} from 'app-studio';\nimport { CloseIcon } from '../../Icon/FixedIcons';\nimport { hideModal } from './Modal.store';\nimport {\n BodyProps,\n ContainerProps,\n FooterProps,\n HeaderProps,\n} from '../Modal/Modal.props';\nimport {\n ContainerShapes,\n OverlayAlignments,\n HeaderIconSizes,\n ModalTypography,\n} from '../Modal/Modal.style';\nimport { Position } from './Modal.type';\n// Defines the properties available for configuring the ModalOverlay component, enabling customization of its appearance and behavior.\nexport interface OverlayProps {\n // Specifies custom style properties for the modal's internal container and view elements, allowing for granular visual adjustments.\n views?: {\n container?: ViewProps;\n view?: ViewProps;\n };\n // Sets the blur radius for the backdrop effect behind the modal, enhancing visual distinction and focus on the modal content.\n blur?: number;\n // Determines the visibility state of the modal overlay. When true, the modal is shown; when false, it is hidden.\n isOpen?: boolean;\n // A flag indicating whether clicking the overlay outside the modal content should trigger the onClose event, preventing accidental closures.\n isClosePrevented?: boolean;\n // A callback function that executes when the modal is requested to close, typically due to user interaction or internal logic.\n onClose?: () => void;\n // Dictates the alignment of the modal content within the overlay, such as 'center', 'top-left', etc.\n position?: Position;\n // The React nodes that will be rendered as the main content inside the modal overlay.\n children?: React.ReactNode;\n}\n// The ModalOverlay component serves as the backdrop and container for any modal content, managing its visibility and global positioning. It applies a customizable blur effect and handles close interactions.\nexport const ModalOverlay: React.FC<OverlayProps & any> = React.memo(\n ({\n children,\n blur,\n isOpen = false,\n isClosePrevented = false,\n onClose = () => {},\n position = 'center',\n views,\n ...props\n }) => {\n const dialog = useRef<HTMLDivElement>(null);\n const handleClick = useCallback(() => {\n if (!isClosePrevented) onClose();\n }, [isClosePrevented, onClose]);\n\n function focusable(node: HTMLElement) {\n return Array.from(\n node.querySelectorAll<HTMLElement>(\n 'a[href], button, input, select, textarea, [tabindex], [contenteditable=true]'\n )\n ).filter(\n (element) =>\n element.tabIndex >= 0 &&\n !element.matches(':disabled, input[type=hidden]') &&\n !element.closest('[hidden], [inert], [aria-hidden=true]') &&\n element.ownerDocument.defaultView?.getComputedStyle(element)\n .visibility !== 'hidden'\n );\n }\n\n useEffect(() => {\n const node = dialog.current;\n if (!isOpen || !node) return;\n const trigger = node.ownerDocument.activeElement as HTMLElement | null;\n (focusable(node)[0] ?? node).focus();\n return () => {\n if (trigger?.isConnected) trigger.focus();\n };\n }, [isOpen]);\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n if (event.defaultPrevented) return;\n if (event.key === 'Escape' && !isClosePrevented) {\n event.preventDefault();\n event.stopPropagation();\n handleClick();\n }\n if (event.key !== 'Tab') return;\n const node = event.currentTarget;\n const elements = focusable(node);\n const active = node.ownerDocument.activeElement;\n const atEdge =\n active === node ||\n active === (event.shiftKey ? elements[0] : elements.at(-1));\n if (!elements.length || atEdge) {\n event.preventDefault();\n (elements.at(event.shiftKey ? -1 : 0) ?? node).focus();\n }\n }\n\n return (\n <Center\n position=\"fixed\"\n top={0}\n left={0}\n width=\"100%\"\n height=\"100%\"\n zIndex={1000}\n onClick={handleClick}\n visibility={isOpen ? 'visible' : 'hidden'}\n opacity={isOpen ? 1 : 0}\n transition=\"opacity 0.2s ease, visibility 0.2s ease\"\n {...views?.container}\n >\n <Element\n as=\"div\"\n ref={dialog}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal={isOpen || undefined}\n aria-hidden={!isOpen || undefined}\n aria-label=\"Dialog\"\n onKeyDown={handleKeyDown}\n position=\"absolute\"\n top={0}\n left={0}\n zIndex={1000}\n width=\"100vw\"\n height=\"100vh\"\n display=\"flex\"\n backgroundColor=\"color-dark-50-360\"\n backdropFilter={blur ? `blur(${blur}px)` : undefined}\n transition=\"background-color 0.2s ease, backdrop-filter 0.2s ease\"\n {...OverlayAlignments[position]}\n {...props}\n {...views?.view}\n >\n {children}\n </Element>\n </Center>\n );\n }\n);\nconst webShadow = {\n boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.15)',\n};\nexport const ModalContainer: React.FC<ContainerProps> = React.memo(\n ({\n children,\n shadow,\n isFullScreen = false,\n shape = 'rounded',\n views,\n isOpen = true,\n // Strip ContainerProps's domain `position` (Modal-specific enum) so it\n // doesn't reach the underlying Vertical which expects CSS Property.Position.\n position: _position,\n ...props\n }) => {\n const defaultShadow = webShadow;\n const handleClick = useCallback((event: any) => {\n if (event && event.stopPropagation) event.stopPropagation();\n }, []);\n return (\n <Vertical\n cursor=\"default\"\n backgroundColor=\"color-white\"\n width={isFullScreen ? '100%' : 600}\n height={isFullScreen ? '100%' : 'fit-content'}\n onClick={handleClick}\n transition=\"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease\"\n opacity={isOpen ? 1 : 0}\n transform={isOpen ? 'translateY(0)' : 'translateY(8px)'}\n {...(shadow ? shadow : defaultShadow)}\n {...ContainerShapes[shape]}\n media={{\n mobile: {\n width: '90%',\n maxWidth: '100%',\n margin: '16px',\n },\n }}\n {...props}\n {...views?.container}\n >\n {children}\n </Vertical>\n );\n }\n);\nexport const ModalHeader: React.FC<HeaderProps> = React.memo(\n ({\n children,\n buttonColor = 'theme-primary',\n iconSize = 'md',\n buttonSize,\n buttonPosition = 'right',\n views,\n onClose: onCloseProp,\n ...props\n }) => {\n const onClose = onCloseProp ? onCloseProp : hideModal;\n const buttonIcon = (\n <View onClick={() => onClose()}>\n <CloseIcon\n widthHeight={HeaderIconSizes[buttonSize ?? iconSize]}\n color={buttonColor}\n />\n </View>\n );\n return (\n <Horizontal\n justifyContent={buttonPosition === 'none' ? 'center' : 'space-between'}\n alignItems=\"center\"\n paddingVertical={16}\n paddingHorizontal={24}\n borderBottomWidth=\"1px\"\n borderBottomStyle=\"solid\"\n borderBottomColor=\"color-gray-200\"\n media={{\n mobile: {\n paddingVertical: 12,\n paddingHorizontal: 16,\n },\n }}\n {...props}\n {...views?.header}\n >\n {buttonPosition === 'left' && buttonIcon}\n {children}\n {buttonPosition === 'right' && buttonIcon}\n </Horizontal>\n );\n }\n);\nexport const ModalBody: React.FC<BodyProps> = React.memo(\n ({ children, views, ...props }) => {\n return (\n <View\n paddingVertical={16}\n paddingHorizontal={24}\n fontSize={ModalTypography.body.fontSize}\n fontWeight={ModalTypography.body.fontWeight}\n color={ModalTypography.body.color}\n media={{\n mobile: {\n paddingVertical: 12,\n paddingHorizontal: 16,\n fontSize: '14px',\n },\n }}\n {...props}\n {...views?.view}\n >\n {children}\n </View>\n );\n }\n);\nexport const ModalFooter: React.FC<FooterProps> = React.memo(\n ({ children, views, ...props }) => {\n return (\n <Horizontal\n marginTop=\"auto\"\n alignItems=\"center\"\n justifyContent=\"flex-end\"\n paddingVertical={16}\n paddingHorizontal={24}\n borderTopWidth=\"1px\"\n borderTopStyle=\"solid\"\n borderTopColor=\"color-gray-200\"\n gap={12}\n media={{\n mobile: {\n paddingVertical: 12,\n paddingHorizontal: 16,\n gap: 8,\n },\n }}\n {...props}\n {...views?.container}\n >\n {children}\n </Horizontal>\n );\n }\n);\n","import React, { Fragment, useEffect } from 'react';\nimport { ModalState, hideModal, useModalStore } from './Modal.store';\nimport { ModalOverlay } from './Modal.view';\nimport { ModalLayoutProps } from './Modal.props';\n// Defines the `ModalLayout` functional component, which is responsible for orchestrating and rendering multiple active modals based on their state.\nexport const ModalLayout = ({\n // Prop: `availableModals` is an object containing all possible modal components, keyed by their unique names, allowing for dynamic selection and rendering.\n modals: availableModals,\n // Prop: `onShow` is an optional callback function to be executed whenever a modal is displayed.\n onShow,\n // Prop: `onHide` is an optional callback function to be executed whenever a modal is hidden.\n onHide,\n}: ModalLayoutProps) => {\n // Retrieves the list of currently active modals from the global modal store, determining which modals need to be rendered.\n const activeModals = useModalStore((state: ModalState) => state.modals);\n // Synchronizes the `onShow` callback prop with the modal store's internal `setOnShow` action, ensuring the store can trigger this callback.\n useEffect(() => {\n if (onShow) {\n useModalStore.getState().setOnShow(onShow);\n }\n }, [onShow]);\n // Synchronizes the `onHide` callback prop with the modal store's internal `setOnHide` action, ensuring the store can trigger this callback.\n useEffect(() => {\n if (onHide) {\n useModalStore.getState().setOnHide(onHide);\n }\n }, [onHide]);\n // Conditionally renders nothing if there are no active modals, optimizing performance by avoiding unnecessary component trees.\n if (activeModals.length === 0) {\n return null;\n }\n return (\n <Fragment>\n {activeModals.map((modal: any, index: number) => {\n const ModalComponent = availableModals[modal.name];\n if (!ModalComponent) {\n console.error(`${modal.name} modal doesn't exist`);\n return null;\n }\n return (\n <ModalOverlay\n key={index}\n isOpen={modal.props.isVisible}\n onClose={() => hideModal(modal.name)}\n blur={5}\n {...modal.overlayProps}\n style={{ zIndex: 1000 + index }}\n >\n <ModalComponent {...modal.props} />\n </ModalOverlay>\n );\n })}\n </Fragment>\n );\n};\n","import React from 'react';\nimport { ModalType } from './Modal/Modal.props';\nimport {\n ModalBody,\n ModalContainer,\n ModalFooter,\n ModalHeader,\n ModalOverlay,\n} from './Modal/Modal.view';\nimport { ModalLayout } from './Modal/Modal.layout';\n// This file defines the main Modal component, which acts as a compound component. It groups and exports various sub-components (Overlay, Container, Header, Body, Footer, and Layout) as static properties, providing a flexible and structured way to compose modal dialogs.\nexport const Modal: ModalType = ({ children }) => <>{children}</>;\nModal.Overlay = ModalOverlay;\nModal.Container = ModalContainer;\nModal.Header = ModalHeader;\nModal.Body = ModalBody;\nModal.Footer = ModalFooter;\nModal.Layout = ModalLayout;\nexport * from './Modal/Modal.store';\n\n// Surface the registry renderer as standalone named exports. `ModalRouter` is\n// the documented name for the app-demo \"modal router\" pattern: mount it once\n// (e.g. via `AppRoot modals={...}`), then call `showModal('Name', props)` /\n// `hideModal('Name')` from anywhere to drive named modals from the store.\nexport { ModalLayout } from './Modal/Modal.layout';\nexport { ModalLayout as ModalRouter } from './Modal/Modal.layout';\n"],"names":["useModalStore","create","set","name","props","modalProps","overlayProps","state","modal","onHide","onShow","showModal","hideModal","ContainerShapes","OverlayAlignments","HeaderIconSizes","ModalTypography","ModalOverlay","React","children","blur","isOpen","isClosePrevented","onClose","position","views","dialog","useRef","handleClick","useCallback","focusable","node","element","_a","useEffect","trigger","handleKeyDown","event","elements","active","atEdge","jsx","Center","Element","webShadow","ModalContainer","shadow","isFullScreen","shape","_position","defaultShadow","Vertical","ModalHeader","buttonColor","iconSize","buttonSize","buttonPosition","onCloseProp","buttonIcon","View","CloseIcon","jsxs","Horizontal","ModalBody","ModalFooter","ModalLayout","availableModals","activeModals","Fragment","index","ModalComponent","Modal"],"mappings":";;;;;AA4BO,MAAMA,IAAgBC,EAAmB,CAACC,OAAS;AAAA;AAAA,EAExD,QAAQ,CAAA;AAAA;AAAA,EAER,QAAQ,CAACC,MAAkBA;AAAA;AAAA,EAE3B,QAAQ,CAACA,GAAcC,OAAiB,EAAE,MAAAD,GAAM,OAAAC,EAAA;AAAA;AAAA,EAEhD,MAAM,CAACD,GAAME,IAAa,CAAA,GAAIC,IAAe,CAAA,MAAO;AAClD,IAAAJ,EAAI,CAACK,OAAuB;AAAA,MAC1B,GAAGA;AAAA,MACH,QAAQ;AAAA,QACN,GAAGA,EAAM;AAAA,QACT;AAAA,UACE,MAAAJ;AAAA,UACA,OAAO,EAAE,GAAGE,GAAY,WAAW,GAAA;AAAA,UACnC,cAAAC;AAAA,QAAA;AAAA,MACF;AAAA,IACF,EACA;AAAA,EACJ;AAAA;AAAA,EAEA,MAAM,CAACH,MAAS;AACd,IAAAD,EAAI,CAACK,MACEJ,IAGE;AAAA,M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,CAAO;AAAA,MAAA;AAAA,MAP5B6D;AAAA,IAAA,KALP,QAAQ,MAAM,GAAG7D,EAAM,IAAI,sBAAsB,GAC1C;AAAA,EAcX,CAAC,EAAA,CACH;AAEJ,GC3Ca+D,IAAmB,CAAC,EAAE,UAAApD,EAAA,6BAAkB,UAAAA,EAAA,CAAS;AAC9DoD,EAAM,UAAUtD;AAChBsD,EAAM,YAAY1B;AAClB0B,EAAM,SAASnB;AACfmB,EAAM,OAAOR;AACbQ,EAAM,SAASP;AACfO,EAAM,SAASN;"}
@@ -1,2 +0,0 @@
1
- "use strict";const l=require("react/jsx-runtime"),s=require("react"),g=require("app-studio"),k=require("./FixedIcons-Dz_f-yDL.cjs"),H=require("zustand"),u=H.create(e=>({modals:[],onHide:t=>t,onShow:(t,o)=>({name:t,props:o}),show:(t,o={},i={})=>{e(n=>({...n,modals:[...n.modals,{name:t,props:{...o,isVisible:!0},overlayProps:i}]}))},hide:t=>{e(o=>t?{...o,modals:o.modals.filter(i=>i.name!==t)}:{modals:[]})},setOnHide:t=>{e(o=>({...o,onHide:t}))},setOnShow:t=>{e(o=>({...o,onShow:t}))}})),V=(e,t={},o={})=>{u.getState().show(e,t,o),u.getState().onShow(e,t)},C=e=>{u.getState().onHide(e),u.getState().hide(typeof e=="string"?e:void 0)},D={square:{borderRadius:0},rounded:{borderRadius:8}},E={center:{justifyContent:"center",alignItems:"center"},top:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"flex-end",alignItems:"center"},bottom:{justifyContent:"center",alignItems:"flex-end"},left:{justifyContent:"flex-start",alignItems:"center"}},q={xs:12,sm:16,md:20,lg:24,xl:28},x={body:{fontSize:"16px",fontWeight:"400",color:"color-gray-700"}},j=s.memo(({children:e,blur:t,isOpen:o=!1,isClosePrevented:i=!1,onClose:n=()=>{},position:c="center",views:d,...b})=>{const m=s.useRef(null),f=s.useCallback(()=>{i||n()},[i,n]);function y(r){return Array.from(r.querySelectorAll("a[href], button, input, select, textarea, [tabindex], [contenteditable=true]")).filter(a=>{var p;return a.tabIndex>=0&&!a.matches(":disabled, input[type=hidden]")&&!a.closest("[hidden], [inert], [aria-hidden=true]")&&((p=a.ownerDocument.defaultView)==null?void 0:p.getComputedStyle(a).visibility)!=="hidden"})}s.useEffect(()=>{const r=m.current;if(!o||!r)return;const a=r.ownerDocument.activeElement;return(y(r)[0]??r).focus(),()=>{a!=null&&a.isConnected&&a.focus()}},[o]);function z(r){if(r.defaultPrevented||(r.key==="Escape"&&!i&&(r.preventDefault(),r.stopPropagation(),f()),r.key!=="Tab"))return;const a=r.currentTarget,p=y(a),S=a.ownerDocument.activeElement,I=S===a||S===(r.shiftKey?p[0]:p.at(-1));(!p.length||I)&&(r.preventDefault(),(p.at(r.shiftKey?-1:0)??a).focus())}return l.jsx(g.Center,{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e3,onClick:f,visibility:o?"visible":"hidden",opacity:o?1:0,transition:"opacity 0.2s ease, visibility 0.2s ease",...d==null?void 0:d.container,children:l.jsx(g.Element,{as:"div",ref:m,tabIndex:-1,role:"dialog","aria-modal":o||void 0,"aria-hidden":!o||void 0,"aria-label":"Dialog",onKeyDown:z,position:"absolute",top:0,left:0,zIndex:1e3,width:"100vw",height:"100vh",display:"flex",backgroundColor:"color-dark-50-360",backdropFilter:t?`blur(${t}px)`:void 0,transition:"background-color 0.2s ease, backdrop-filter 0.2s ease",...E[c],...b,...d==null?void 0:d.view,children:e})})}),T={boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.15)"},W=s.memo(({children:e,shadow:t,isFullScreen:o=!1,shape:i="rounded",views:n,isOpen:c=!0,position:d,...b})=>{const m=T,f=s.useCallback(y=>{y&&y.stopPropagation&&y.stopPropagation()},[]);return l.jsx(g.Vertical,{cursor:"default",backgroundColor:"color-white",width:o?"100%":600,height:o?"100%":"fit-content",onClick:f,transition:"opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease",opacity:c?1:0,transform:c?"translateY(0)":"translateY(8px)",...t||m,...D[i],media:{mobile:{width:"90%",maxWidth:"100%",margin:"16px"}},...b,...n==null?void 0:n.container,children:e})}),B=s.memo(({children:e,buttonColor:t="theme-primary",iconSize:o="md",buttonSize:i,buttonPosition:n="right",views:c,onClose:d,...b})=>{const m=d||C,f=l.jsx(g.View,{onClick:()=>m(),children:l.jsx(k.CloseIcon,{widthHeight:q[i??o],color:t})});return l.jsxs(g.Horizontal,{justifyContent:n==="none"?"center":"space-between",alignItems:"center",paddingVertical:16,paddingHorizontal:24,borderBottomWidth:"1px",borderBottomStyle:"solid",borderBottomColor:"color-gray-200",media:{mobile:{paddingVertical:12,paddingHorizontal:16}},...b,...c==null?void 0:c.header,children:[n==="left"&&f,e,n==="right"&&f]})}),F=s.memo(({children:e,views:t,...o})=>l.jsx(g.View,{paddingVertical:16,paddingHorizontal:24,fontSize:x.body.fontSize,fontWeight:x.body.fontWeight,color:x.body.color,media:{mobile:{paddingVertical:12,paddingHorizontal:16,fontSize:"14px"}},...o,...t==null?void 0:t.view,children:e})),R=s.memo(({children:e,views:t,...o})=>l.jsx(g.Horizontal,{marginTop:"auto",alignItems:"center",justifyContent:"flex-end",paddingVertical:16,paddingHorizontal:24,borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"color-gray-200",gap:12,media:{mobile:{paddingVertical:12,paddingHorizontal:16,gap:8}},...o,...t==null?void 0:t.container,children:e})),M=({modals:e,onShow:t,onHide:o})=>{const i=u(n=>n.modals);return s.useEffect(()=>{t&&u.getState().setOnShow(t)},[t]),s.useEffect(()=>{o&&u.getState().setOnHide(o)},[o]),i.length===0?null:l.jsx(s.Fragment,{children:i.map((n,c)=>{const d=e[n.name];return d?l.jsx(j,{isOpen:n.props.isVisible,onClose:()=>C(n.name),blur:5,...n.overlayProps,style:{zIndex:1e3+c},children:l.jsx(d,{...n.props})},c):(console.error(`${n.name} modal doesn't exist`),null)})})},h=({children:e})=>l.jsx(l.Fragment,{children:e});h.Overlay=j;h.Container=W;h.Header=B;h.Body=F;h.Footer=R;h.Layout=M;exports.Modal=h;exports.ModalLayout=M;exports.hideModal=C;exports.showModal=V;exports.useModalStore=u;
2
- //# sourceMappingURL=Modal-zok954As.cjs.map