@povio/ui 5.0.0-rc.1 → 5.0.0-rc.3

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 (419) hide show
  1. package/.rulesync/rules/ui-buttons-and-content.md +56 -0
  2. package/.rulesync/rules/ui-inputs-and-forms.md +62 -0
  3. package/.rulesync/rules/ui-overlays-navigation-and-styling.md +49 -0
  4. package/.rulesync/rules/ui-overview.md +33 -0
  5. package/README.md +49 -16
  6. package/dist/{Accordion-CzFKi8Bp.js → Accordion-BzwO4_ml.js} +20 -136
  7. package/dist/{Alert-T25LY8ZL.js → Alert-CnvEb1D_.js} +16 -12
  8. package/dist/{Alert-f1dG-4Uy.d.ts → Alert-DfiJbKH0.d.ts} +2 -1
  9. package/dist/{AlertDialog-B6R2MbNg.d.ts → AlertDialog-OWTbR4km.d.ts} +3 -3
  10. package/dist/{Autocomplete-CQ63Cynd.d.ts → Autocomplete-BwNHp8fy.d.ts} +1 -1
  11. package/dist/{Badge-YKlKz-Jy.d.ts → Badge-CBNpj823.d.ts} +8 -5
  12. package/dist/BadgeButton-Ccgt3oGO.d.ts +15 -0
  13. package/dist/{BottomSheet-DvqBvth_.js → BottomSheet-BXLE3161.js} +7 -6
  14. package/dist/{BottomSheet-xaymO7aQ.d.ts → BottomSheet-DbQuzfAB.d.ts} +1 -1
  15. package/dist/{BottomSheet.lazy-CGBRPve_.d.ts → BottomSheet.lazy-D9LCEo7s.d.ts} +1 -1
  16. package/dist/{Breadcrumbs-DyriI-Bi.d.ts → Breadcrumbs-CUV6CU8Q.d.ts} +1 -1
  17. package/dist/{Breadcrumbs-DiIYJAWf.js → Breadcrumbs-CbKzAq1v.js} +24 -38
  18. package/dist/Button-C5rv4Cr2.js +506 -0
  19. package/dist/{Button-BZ3is6IU.d.ts → Button-D-4qb0IR.d.ts} +3 -3
  20. package/dist/{ButtonContent-B2_dZ6vA.js → ButtonContent-c7lJayVQ.js} +10 -8
  21. package/dist/{Calendar-DzQApBCy.js → Calendar-CVSQH-rC.js} +22 -15
  22. package/dist/{CheckContent-DZ7Gk8GS.js → CheckContent-D7sZPmzx.js} +2 -2
  23. package/dist/{Checkbox-BepzfVfK.js → Checkbox-BU0d702K.js} +6 -6
  24. package/dist/{Checkbox-CHpgW3fI.d.ts → Checkbox-DVTWaMKa.d.ts} +1 -1
  25. package/dist/{CheckboxCheckmark-B3lnOjsU.js → CheckboxCheckmark-usHsolNj.js} +10 -10
  26. package/dist/{CheckboxGroup-CXrR3A-c.d.ts → CheckboxGroup-DGF12cmB.d.ts} +3 -3
  27. package/dist/ComponentGallery-DIFeJqGx.js +2528 -0
  28. package/dist/{DatePicker-B3l9TEjW.d.ts → DatePicker-8xSs_jNd.d.ts} +3 -3
  29. package/dist/{DatePicker-CI87jC4_.js → DatePicker-D95gDPhg.js} +12 -11
  30. package/dist/{DatePickerInput-UBZcTmdv.js → DatePickerInput-CX6NYim4.js} +12 -23
  31. package/dist/{DatePickerInput-CZTEsrS0.d.ts → DatePickerInput-D81ZJ3fT.d.ts} +3 -3
  32. package/dist/{DateRangePicker-DKkc2B3n.d.ts → DateRangePicker-Bfq-yDm7.d.ts} +3 -3
  33. package/dist/{DateRangePicker-BX2O5zA8.js → DateRangePicker-_uTQk_ae.js} +16 -15
  34. package/dist/{DateTimePicker-CVfkp45w.js → DateTimePicker-BB058Z34.js} +11 -10
  35. package/dist/{DateTimePicker-IHr-wPq8.d.ts → DateTimePicker-D4lHyf6P.d.ts} +3 -3
  36. package/dist/{Dialog-DdRP4YFC.js → Dialog-9manOgMA.js} +4 -4
  37. package/dist/{Dialog-CXoVeIkU.js → Dialog-CKLkS00H.js} +10 -2
  38. package/dist/{Dialog-DEbI_9S-.d.ts → Dialog-CW93T9X1.d.ts} +3 -2
  39. package/dist/{DropdownMenu-zrodtd44.js → DropdownMenu-5jmtgLXd.js} +8 -6
  40. package/dist/{DropdownMenu-CWDhk3XA.d.ts → DropdownMenu-JNpYT4-3.d.ts} +3 -2
  41. package/dist/{DropdownMenuDesktop-CGYxsavQ.js → DropdownMenuDesktop-Cl9gZVq0.js} +9 -38
  42. package/dist/{FileInput-Dz1eESr_.js → FileInput-C0-6bw4w.js} +8 -8
  43. package/dist/{FileInput-BQbn77bE.d.ts → FileInput-C4CE5kuP.d.ts} +5 -4
  44. package/dist/{FileUpload-qySCMcLn.d.ts → FileUpload-CR7bZxV1.d.ts} +1 -1
  45. package/dist/{FileUpload-D3Io7Is5.js → FileUpload-DDpYMn8f.js} +51 -139
  46. package/dist/{FileUploadContainer-qOyGvb5J.d.ts → FileUploadContainer-042ztsaL.d.ts} +1 -1
  47. package/dist/{Form-u_N_6mwo.d.ts → Form-BJ12MjE-.d.ts} +1 -1
  48. package/dist/{FormField-B0miX3gu.d.ts → FormField-Byiehm9y.d.ts} +1 -1
  49. package/dist/{FormField-CHD4OJOt.js → FormField-U_-d4V_g.js} +9 -9
  50. package/dist/{FormFieldError-QRAFHUTt.js → FormFieldError-DeOHHLo2.js} +1 -1
  51. package/dist/FormFieldHeaderTooltip-DXbuu88v.js +17 -0
  52. package/dist/{IconButton-KXecZgYX.d.ts → IconButton-D4thBurp.d.ts} +2 -2
  53. package/dist/IconSlot-DSK7qNxc.js +79 -0
  54. package/dist/{InlineIconButton-CbKZ2U_a.d.ts → InlineIconButton-BeJCjl-q.d.ts} +2 -2
  55. package/dist/{InlineTooltipWrapper-g5yoeH1B.js → InlineTooltipWrapper-Bpmd--e7.js} +3 -3
  56. package/dist/{Input-efmPwk8f.d.ts → Input-DOanwj3l.d.ts} +3 -3
  57. package/dist/{InputContent-DuBa9FuI.d.ts → InputContent-CXuP1ghQ.d.ts} +3 -3
  58. package/dist/{InputItem-2zf6QI5L.js → InputItem-D-KuiNSc.js} +11 -11
  59. package/dist/{Inputs-C-w03Q_F.d.ts → Inputs-DA73LmLc.d.ts} +1 -1
  60. package/dist/{Inputs-BceDTmdT.js → Inputs-j3JmcLWR.js} +1 -1
  61. package/dist/{Link-QYpprkN1.d.ts → Link-Ow9H7kNv.d.ts} +3 -2
  62. package/dist/{ListBox-B7DW1S7n.js → ListBox-CL8Ar4Q_.js} +5 -4
  63. package/dist/{MenuItem--Mjd_yK8.d.ts → MenuItem-DHyqOqln.d.ts} +1 -1
  64. package/dist/{Modal-CoFt5PGP.js → Modal-w60dVQcb.js} +1 -1
  65. package/dist/{NumberField-z2JatYK0.d.ts → NumberField-Cb9Gf6QJ.d.ts} +3 -3
  66. package/dist/{NumberRangeInput-Chai3iEi.d.ts → NumberRangeInput-BfbJQqzn.d.ts} +2 -2
  67. package/dist/{NumberRangeInput-BxVrHq8R.js → NumberRangeInput-C-8U05wF.js} +6 -6
  68. package/dist/{Pagination-CXtIDclf.d.ts → Pagination-CwQu5Py8.d.ts} +1 -1
  69. package/dist/{PaginationList-CXG4jWFD.d.ts → PaginationList-DMRUGtf8.d.ts} +1 -1
  70. package/dist/{PaginationList-0bAmvXC0.js → PaginationList-DtvuP63b.js} +2 -2
  71. package/dist/{PasswordInput-ub2TQxef.d.ts → PasswordInput-CLwFUgl0.d.ts} +1 -1
  72. package/dist/{Popover-DUKH0q9u.d.ts → Popover-BTHPteIh.d.ts} +2 -2
  73. package/dist/{Progress-DQWiFP0L.js → Progress-B3mY9rIP.js} +2 -2
  74. package/dist/{Progress-Dho39FDs.d.ts → Progress-CjWOR38H.d.ts} +2 -1
  75. package/dist/{QuerySelect-Bo1K6gi_.d.ts → QuerySelect-BGxb6Y0K.d.ts} +2 -2
  76. package/dist/{RadioGroup-SSZYch-J.js → RadioGroup-B7_pNwn9.js} +13 -13
  77. package/dist/{RadioGroup-B_zJdn4y.d.ts → RadioGroup-CZg2kIMk.d.ts} +3 -3
  78. package/dist/{RichTextEditor-D6RewmRj.js → RichTextEditor-D9-B1Cze.js} +52 -133
  79. package/dist/{RichTextEditor-B_JX3nor.d.ts → RichTextEditor-YxuRUlI7.d.ts} +1 -1
  80. package/dist/{Select-CuZDkeQs.js → Select-CkujlTjm.js} +5 -4
  81. package/dist/{Select-DeapZMYx.d.ts → Select-pHbyJdZJ.d.ts} +1 -1
  82. package/dist/{SelectBase-7SE9Za2r.d.ts → SelectBase-Omiq2D3M.d.ts} +3 -3
  83. package/dist/{Slider-DJ9K_a-x.js → Slider-BHPl0OPy.js} +11 -11
  84. package/dist/{Slider-BFViQmM3.d.ts → Slider-EYlGCLWe.d.ts} +1 -1
  85. package/dist/{Spinner-BEYBu85B.js → Spinner-BeVTUzzx.js} +1 -1
  86. package/dist/{Spinner-BbcI6IOb.d.ts → Spinner-DbXeDOa2.d.ts} +2 -1
  87. package/dist/{SplitButton-lL87EcBL.d.ts → SplitButton-D9ngY1rJ.d.ts} +3 -3
  88. package/dist/{Stepper-C1YPgTBG.js → Stepper-Cp5vbL5g.js} +4 -117
  89. package/dist/{Stepper-hlhViuaK.d.ts → Stepper-TATlHZhQ.d.ts} +9 -8
  90. package/dist/{Switch-JxRmH1dX.js → Switch-CqnGEdeD.js} +11 -11
  91. package/dist/{Switch-DPftmB1b.d.ts → Switch-s_EPn0Jz.d.ts} +1 -1
  92. package/dist/Table-BDNSuEWc.js +689 -0
  93. package/dist/Tag-AHfV_XSf.d.ts +44 -0
  94. package/dist/{Tag-HiDH438e.js → Tag-DPg5sL1Z.js} +22 -21
  95. package/dist/{TextArea-gikUKKDl.js → TextArea-DqHDiRGJ.js} +6 -6
  96. package/dist/{TextArea-BhrCBGbq.d.ts → TextArea-l_keyLK7.d.ts} +2 -2
  97. package/dist/{TextButton-DnXRykhF.d.ts → TextButton-XUhV_1s0.d.ts} +4 -4
  98. package/dist/{TimePicker-CmT89X7v.d.ts → TimePicker-B1POvGWs.d.ts} +2 -2
  99. package/dist/{TimePicker-DtNTOOGr.js → TimePicker-DQ6JCkGB.js} +10 -10
  100. package/dist/Toast-DtG3pA61.js +53 -0
  101. package/dist/{Toast-B4cXs2rj.d.ts → Toast-ruXqONDA.d.ts} +1 -1
  102. package/dist/{ToastContainer-BbsMIwtC.js → ToastContainer-qgpzMFD4.js} +4 -3
  103. package/dist/{ToggleButton-BGuzPJDO.d.ts → ToggleButton-7aP8Jb11.d.ts} +2 -2
  104. package/dist/{ToggleGroup-D9CFdM5-.d.ts → ToggleGroup-CRFDIPGZ.d.ts} +1 -1
  105. package/dist/{ToggleGroup-Cl0NS3fe.js → ToggleGroup-DX0VYXwP.js} +25 -58
  106. package/dist/{Tooltip-aE1Vswxz.js → Tooltip-B9DKcYvr.js} +6 -47
  107. package/dist/{Tooltip-D7dNwGy9.d.ts → Tooltip-DHv6vAqW.d.ts} +6 -5
  108. package/dist/{TooltipWrapper-CRf-JFeo.js → TooltipWrapper-DznDgVJB.js} +4 -4
  109. package/dist/{Typography-B0Gp1lpc.js → Typography-LU4z2pR1.js} +2 -2
  110. package/dist/{Typography-BiuidzDC.d.ts → Typography-XljT9s02.d.ts} +1 -1
  111. package/dist/accordion.cva-CL1bVscW.js +129 -0
  112. package/dist/{autocomplete-BJ7rqWa4.d.ts → autocomplete-DeERHN8W.d.ts} +2 -2
  113. package/dist/badgeButton.cva-B2bgCQP6.d.ts +41 -0
  114. package/dist/badgeButton.cva-CvN4CTx5.js +300 -0
  115. package/dist/breadcrumbs.cva-7zzdDhVR.js +27 -0
  116. package/dist/{button.cva-BvRI-3Gn.d.ts → button.cva-C7kEhgoA.d.ts} +7 -6
  117. package/dist/{buttonContent.cva-BDT_CReI.d.ts → buttonContent.cva-DPIlROA9.d.ts} +2 -2
  118. package/dist/{checkbox-BfcE8J5P.d.ts → checkbox-DxIPDTK5.d.ts} +1 -1
  119. package/dist/{checkbox-group-CHs2wFHS.d.ts → checkbox-group-B3BOVshI.d.ts} +1 -1
  120. package/dist/{checkbox.cva-gv87kr1W.d.ts → checkbox.cva-t1Ox50hy.d.ts} +4 -3
  121. package/dist/components/accordion.js +1 -1
  122. package/dist/components/alert-dialog.d.ts +1 -1
  123. package/dist/components/alert-dialog.js +4 -4
  124. package/dist/components/alert.d.ts +1 -1
  125. package/dist/components/alert.js +1 -1
  126. package/dist/components/autocomplete.d.ts +1 -1
  127. package/dist/components/autocomplete.js +5 -4
  128. package/dist/components/badge-button.d.ts +2 -0
  129. package/dist/components/{pill-button.js → badge-button.js} +13 -12
  130. package/dist/components/badge.d.ts +1 -1
  131. package/dist/components/badge.js +56 -37
  132. package/dist/components/bottom-sheet.d.ts +2 -2
  133. package/dist/components/bottom-sheet.js +2 -2
  134. package/dist/components/breadcrumbs.d.ts +1 -1
  135. package/dist/components/breadcrumbs.js +1 -1
  136. package/dist/components/button.d.ts +2 -2
  137. package/dist/components/button.js +1 -1
  138. package/dist/components/checkbox-group.d.ts +1 -1
  139. package/dist/components/checkbox-group.js +6 -6
  140. package/dist/components/checkbox.d.ts +1 -1
  141. package/dist/components/checkbox.js +1 -1
  142. package/dist/components/date-picker.d.ts +1 -1
  143. package/dist/components/date-picker.js +1 -1
  144. package/dist/components/date-range-picker.d.ts +1 -1
  145. package/dist/components/date-range-picker.js +1 -1
  146. package/dist/components/date-time-picker.d.ts +1 -1
  147. package/dist/components/date-time-picker.js +1 -1
  148. package/dist/components/dialog.d.ts +1 -1
  149. package/dist/components/dialog.js +1 -1
  150. package/dist/components/drawer.js +3 -3
  151. package/dist/components/dropdown-menu.d.ts +2 -2
  152. package/dist/components/dropdown-menu.js +2 -2
  153. package/dist/components/file-input.d.ts +1 -1
  154. package/dist/components/file-input.js +1 -1
  155. package/dist/components/file-upload-container.d.ts +2 -2
  156. package/dist/components/file-upload-container.js +1 -1
  157. package/dist/components/file-upload.d.ts +2 -2
  158. package/dist/components/file-upload.js +1 -1
  159. package/dist/components/form-field.d.ts +1 -1
  160. package/dist/components/form-field.js +1 -1
  161. package/dist/components/icon-button.d.ts +1 -1
  162. package/dist/components/icon-button.js +2 -2
  163. package/dist/components/icon-slot.d.ts +2 -0
  164. package/dist/components/icon-slot.js +2 -0
  165. package/dist/components/inline-icon-button.d.ts +1 -1
  166. package/dist/components/inline-icon-button.js +1 -1
  167. package/dist/components/input.d.ts +1 -1
  168. package/dist/components/input.js +7 -7
  169. package/dist/components/link.d.ts +1 -1
  170. package/dist/components/link.js +32 -1
  171. package/dist/components/number-field.d.ts +1 -1
  172. package/dist/components/number-field.js +7 -7
  173. package/dist/components/number-range-input.d.ts +1 -1
  174. package/dist/components/number-range-input.js +1 -1
  175. package/dist/components/pagination-list.d.ts +1 -1
  176. package/dist/components/pagination-list.js +1 -1
  177. package/dist/components/pagination.d.ts +1 -1
  178. package/dist/components/pagination.js +2 -2
  179. package/dist/components/password-input.d.ts +1 -1
  180. package/dist/components/popover.d.ts +1 -1
  181. package/dist/components/popover.js +6 -5
  182. package/dist/components/progress.d.ts +1 -1
  183. package/dist/components/progress.js +1 -1
  184. package/dist/components/query-autocomplete.d.ts +2 -2
  185. package/dist/components/query-autocomplete.js +2 -2
  186. package/dist/components/query-select.d.ts +1 -1
  187. package/dist/components/query-select.js +3 -3
  188. package/dist/components/radio-group.d.ts +1 -1
  189. package/dist/components/radio-group.js +1 -1
  190. package/dist/components/select.d.ts +2 -2
  191. package/dist/components/select.js +1 -1
  192. package/dist/components/slider.d.ts +1 -1
  193. package/dist/components/slider.js +1 -1
  194. package/dist/components/spinner.d.ts +1 -1
  195. package/dist/components/spinner.js +1 -1
  196. package/dist/components/split-button.d.ts +1 -1
  197. package/dist/components/split-button.js +3 -3
  198. package/dist/components/stepper.d.ts +1 -1
  199. package/dist/components/stepper.js +1 -1
  200. package/dist/components/switch.d.ts +1 -1
  201. package/dist/components/switch.js +1 -1
  202. package/dist/components/tag.d.ts +1 -1
  203. package/dist/components/tag.js +1 -1
  204. package/dist/components/text-area.d.ts +1 -1
  205. package/dist/components/text-area.js +1 -1
  206. package/dist/components/text-button.d.ts +1 -1
  207. package/dist/components/text-button.js +1 -1
  208. package/dist/components/time-picker.d.ts +1 -1
  209. package/dist/components/time-picker.js +1 -1
  210. package/dist/components/toast.d.ts +2 -2
  211. package/dist/components/toast.js +2 -2
  212. package/dist/components/toggle-button.d.ts +1 -1
  213. package/dist/components/toggle-button.js +1 -1
  214. package/dist/components/toggle-group.d.ts +2 -2
  215. package/dist/components/toggle-group.js +1 -1
  216. package/dist/components/tooltip-ellipsis.js +1 -1
  217. package/dist/components/tooltip.d.ts +1 -1
  218. package/dist/components/tooltip.js +1 -1
  219. package/dist/components/typography.d.ts +2 -2
  220. package/dist/components/typography.js +1 -1
  221. package/dist/components/use-toast.d.ts +1 -1
  222. package/dist/components/use-toast.js +2 -2
  223. package/dist/config/confirmation.d.ts +1 -1
  224. package/dist/config/link-context.d.ts +2 -2
  225. package/dist/config/ui-config.d.ts +2 -2
  226. package/dist/config/ui-config.js +1 -1
  227. package/dist/config/ui-configurator-theme.d.ts +2 -0
  228. package/dist/config/ui-configurator-theme.js +2 -0
  229. package/dist/config/ui-configurator-vite.d.ts +10 -0
  230. package/dist/config/ui-configurator-vite.js +174 -0
  231. package/dist/config/ui-configurator.d.ts +934 -0
  232. package/dist/config/ui-configurator.js +3731 -0
  233. package/dist/config/ui-overrides.d.ts +1 -1
  234. package/dist/config/ui-overrides.js +1 -1
  235. package/dist/{confirmation.context-DPAKsLYl.d.ts → confirmation.context-BOeEVczb.d.ts} +1 -1
  236. package/dist/{date-picker-BYFWSbN8.d.ts → date-picker-DnxDmlOW.d.ts} +1 -1
  237. package/dist/{date-range-picker-BaaXOObm.d.ts → date-range-picker-DHDOSvHN.d.ts} +1 -1
  238. package/dist/{date-time-picker-D42cTCgx.d.ts → date-time-picker-UkTa0OJ8.d.ts} +1 -1
  239. package/dist/datePickerInput.cva-Cd7UUN61.js +14 -0
  240. package/dist/{datePickerValue.utils-CFCY-fRJ.js → datePickerValue.utils-CUzkWie8.js} +5 -5
  241. package/dist/{dialog.cva---xiOXMQ.js → dialog.cva-COhDZaVl.js} +4 -4
  242. package/dist/{dist-B8h0VT0E.js → dist-CAdwxJbe.js} +1 -208
  243. package/dist/{dom.utils-DjuRTR6U.js → dom.utils-D1AopHx9.js} +1 -1
  244. package/dist/dropdownMenu.cva-DvEmX0bs.js +34 -0
  245. package/dist/{dynamicInputs-wEEikYeg.d.ts → dynamicInputs-iP39lVKf.d.ts} +102 -100
  246. package/dist/{fieldAdapter-C0lCFmf0.js → fieldAdapter-DjYls12j.js} +1 -1
  247. package/dist/{file-input-C56GXRwz.d.ts → file-input-DkbkdI7l.d.ts} +1 -1
  248. package/dist/{file-upload-Bx0X534g.d.ts → file-upload-CTsPhxJk.d.ts} +2 -2
  249. package/dist/fileUpload.cva-ujmStxB1.js +42 -0
  250. package/dist/{fileUpload.types-DWuQKA2l.d.ts → fileUpload.types-n5FxK_F-.d.ts} +2 -2
  251. package/dist/iconSlot.cva-CnpFzAOR.d.ts +21 -0
  252. package/dist/icons.d.ts +2 -1
  253. package/dist/icons.js +2 -1
  254. package/dist/index.d.ts +87 -86
  255. package/dist/index.js +55 -44
  256. package/dist/info-iUmX3uDk.js +32 -0
  257. package/dist/{input-D2kGX0hW.d.ts → input-CdQNCPgH.d.ts} +1 -1
  258. package/dist/{input.cva-BhDJxc7r.d.ts → input.cva-BsHgYa-L.d.ts} +3 -2
  259. package/dist/{input.cva-BcXyC1vZ.js → input.cva-DJA8ovm_.js} +9 -9
  260. package/dist/{link.context-CDZn6oL2.d.ts → link.context-D5qyz9Rf.d.ts} +1 -1
  261. package/dist/link.cva-DMTHZiJG.js +12 -0
  262. package/dist/{number-field-Bw2GKr0s.d.ts → number-field-CUDbenNV.d.ts} +1 -1
  263. package/dist/{number-range-input-Dqe6x2dR.d.ts → number-range-input-DZGrcvjL.d.ts} +1 -1
  264. package/dist/{password-input-DepKyhh3.d.ts → password-input-fYN20cQO.d.ts} +1 -1
  265. package/dist/{popover.cva-BJSkLndY.js → popover.cva-Bhud1wnp.js} +1 -1
  266. package/dist/popoverAnimation-DEZSvKP8.js +4 -0
  267. package/dist/{query-autocomplete-BSpHin_R.d.ts → query-autocomplete-CfuQeiYG.d.ts} +2 -2
  268. package/dist/{query-select-m1DCp4UF.d.ts → query-select-CuT_sE6a.d.ts} +2 -2
  269. package/dist/{queryAutocomplete.types-CrbVUmvl.d.ts → queryAutocomplete.types-tl3r6iaY.d.ts} +2 -2
  270. package/dist/{radio-group-Civ3Fb70.d.ts → radio-group-B3ccPf0p.d.ts} +1 -1
  271. package/dist/{radio.cva-BlOrmxzf.d.ts → radio.cva-DN9VQ3Kb.d.ts} +4 -3
  272. package/dist/rhf/autocomplete.d.ts +2 -2
  273. package/dist/rhf/autocomplete.js +1 -1
  274. package/dist/rhf/checkbox-group.d.ts +2 -2
  275. package/dist/rhf/checkbox-group.js +1 -1
  276. package/dist/rhf/checkbox.d.ts +2 -2
  277. package/dist/rhf/checkbox.js +2 -2
  278. package/dist/rhf/date-picker.d.ts +2 -2
  279. package/dist/rhf/date-picker.js +2 -2
  280. package/dist/rhf/date-range-picker.d.ts +2 -2
  281. package/dist/rhf/date-range-picker.js +2 -2
  282. package/dist/rhf/date-time-picker.d.ts +2 -2
  283. package/dist/rhf/date-time-picker.js +2 -2
  284. package/dist/rhf/file-input.d.ts +2 -2
  285. package/dist/rhf/file-input.js +2 -2
  286. package/dist/rhf/file-upload.d.ts +2 -2
  287. package/dist/rhf/file-upload.js +2 -2
  288. package/dist/rhf/input.d.ts +2 -2
  289. package/dist/rhf/input.js +1 -1
  290. package/dist/rhf/inputs.d.ts +2 -2
  291. package/dist/rhf/number-field.d.ts +2 -2
  292. package/dist/rhf/number-field.js +1 -1
  293. package/dist/rhf/number-range-input.d.ts +2 -2
  294. package/dist/rhf/number-range-input.js +2 -2
  295. package/dist/rhf/password-input.d.ts +2 -2
  296. package/dist/rhf/password-input.js +1 -1
  297. package/dist/rhf/query-autocomplete.d.ts +1 -1
  298. package/dist/rhf/query-autocomplete.js +1 -1
  299. package/dist/rhf/query-select.d.ts +1 -1
  300. package/dist/rhf/query-select.js +1 -1
  301. package/dist/rhf/radio-group.d.ts +2 -2
  302. package/dist/rhf/radio-group.js +2 -2
  303. package/dist/rhf/rich-text-editor.d.ts +2 -2
  304. package/dist/rhf/rich-text-editor.js +2 -2
  305. package/dist/rhf/select.d.ts +2 -2
  306. package/dist/rhf/select.js +2 -2
  307. package/dist/rhf/slider.d.ts +2 -2
  308. package/dist/rhf/slider.js +2 -2
  309. package/dist/rhf/switch.d.ts +2 -2
  310. package/dist/rhf/switch.js +2 -2
  311. package/dist/rhf/text-area.d.ts +2 -2
  312. package/dist/rhf/text-area.js +2 -2
  313. package/dist/rhf/time-picker.d.ts +2 -2
  314. package/dist/rhf/time-picker.js +2 -2
  315. package/dist/rhf/toggle-group.d.ts +2 -2
  316. package/dist/rhf/toggle-group.js +2 -2
  317. package/dist/{rhf-D8B7mLO1.js → rhf-t348TCCL.js} +1 -1
  318. package/dist/rhf.d.ts +87 -86
  319. package/dist/rhf.js +55 -44
  320. package/dist/{rich-text-editor-DvNEOIux.d.ts → rich-text-editor-B-Onl7T8.d.ts} +1 -1
  321. package/dist/rich-text-editor.d.ts +1 -1
  322. package/dist/rich-text-editor.js +1 -1
  323. package/dist/{select-DY5QtwqI.d.ts → select-B4a52eWW.d.ts} +2 -2
  324. package/dist/selectDesktop.cva-CHAMxhfO.js +69 -0
  325. package/dist/{slider-CrB-Gkcv.d.ts → slider-dNj9jruO.d.ts} +1 -1
  326. package/dist/{staticDateTimeSegments-DR8bJw-F.js → staticDateTimeSegments-CsCE9Buo.js} +26 -27
  327. package/dist/{staticSelect.utils-Cm7MoDVG.js → staticSelect.utils-BemUyaaA.js} +31 -90
  328. package/dist/stepper.cva-CZ0Kj-s7.js +116 -0
  329. package/dist/style-merge.util-zLimKwt6.d.ts +40 -0
  330. package/dist/styles/color-utilities.css +13 -25
  331. package/dist/styles/configurator.css +1852 -0
  332. package/dist/styles/input.d.ts +1 -1
  333. package/dist/{switch-8WzXfTS8.d.ts → switch-C--iWnY8.d.ts} +1 -1
  334. package/dist/switch.cva-CWNzmdRc.d.ts +16 -0
  335. package/dist/table.cva-BikE8qJH.js +49 -0
  336. package/dist/tanstack/autocomplete.d.ts +1 -1
  337. package/dist/tanstack/checkbox-group.d.ts +1 -1
  338. package/dist/tanstack/checkbox.d.ts +1 -1
  339. package/dist/tanstack/checkbox.js +1 -1
  340. package/dist/tanstack/date-picker.d.ts +1 -1
  341. package/dist/tanstack/date-picker.js +1 -1
  342. package/dist/tanstack/date-range-picker.d.ts +1 -1
  343. package/dist/tanstack/date-range-picker.js +1 -1
  344. package/dist/tanstack/date-time-picker.d.ts +1 -1
  345. package/dist/tanstack/date-time-picker.js +1 -1
  346. package/dist/tanstack/file-input.d.ts +1 -1
  347. package/dist/tanstack/file-input.js +1 -1
  348. package/dist/tanstack/file-upload.d.ts +2 -2
  349. package/dist/tanstack/file-upload.js +1 -1
  350. package/dist/tanstack/form.d.ts +1 -1
  351. package/dist/tanstack/form.js +1 -1
  352. package/dist/tanstack/input.d.ts +1 -1
  353. package/dist/tanstack/inputs.d.ts +3 -3
  354. package/dist/tanstack/inputs.js +1 -1
  355. package/dist/tanstack/number-field.d.ts +1 -1
  356. package/dist/tanstack/number-range-input.d.ts +1 -1
  357. package/dist/tanstack/number-range-input.js +1 -1
  358. package/dist/tanstack/password-input.d.ts +1 -1
  359. package/dist/tanstack/query-select.d.ts +1 -1
  360. package/dist/tanstack/radio-group.d.ts +1 -1
  361. package/dist/tanstack/radio-group.js +1 -1
  362. package/dist/tanstack/rich-text-editor.d.ts +1 -1
  363. package/dist/tanstack/rich-text-editor.js +1 -1
  364. package/dist/tanstack/select.d.ts +1 -1
  365. package/dist/tanstack/select.js +1 -1
  366. package/dist/tanstack/slider.d.ts +1 -1
  367. package/dist/tanstack/slider.js +1 -1
  368. package/dist/tanstack/switch.d.ts +1 -1
  369. package/dist/tanstack/switch.js +1 -1
  370. package/dist/tanstack/table.d.ts +1 -1
  371. package/dist/tanstack/table.js +2 -1
  372. package/dist/tanstack/text-area.d.ts +1 -1
  373. package/dist/tanstack/text-area.js +1 -1
  374. package/dist/tanstack/time-picker.d.ts +1 -1
  375. package/dist/tanstack/time-picker.js +1 -1
  376. package/dist/tanstack/toggle-group.d.ts +2 -2
  377. package/dist/tanstack/toggle-group.js +1 -1
  378. package/dist/tanstack.d.ts +71 -70
  379. package/dist/tanstack.js +66 -53
  380. package/dist/{text-area-CqnKRWKq.d.ts → text-area-DQAtpOQp.d.ts} +1 -1
  381. package/dist/theme-model-C-QMCksE.js +136 -0
  382. package/dist/theme-model-T1zIdBg8.d.ts +12 -0
  383. package/dist/{time-picker-Cz1GIzpF.d.ts → time-picker-DoGfbil6.d.ts} +1 -1
  384. package/dist/{toast.cva-Cj6o2Rmu.d.ts → toast.cva-By5lvAfr.d.ts} +3 -2
  385. package/dist/toast.cva-C_L_RffH.js +163 -0
  386. package/dist/{toast.runtime-CIKvmkjo.js → toast.runtime-cxex9e4E.js} +2 -1
  387. package/dist/{toggle-group-CPkKHm1t.d.ts → toggle-group-C1nMDOwz.d.ts} +1 -1
  388. package/dist/toggleGroup.cva-MbpaEBg1.js +35 -0
  389. package/dist/{toggleGroup.types-DD6uRI5G.d.ts → toggleGroup.types-Bp43zbSQ.d.ts} +2 -1
  390. package/dist/tooltip.cva-BIzlOXHH.js +48 -0
  391. package/dist/{tooltipWrapper.cva-CUu8pI-a.js → tooltipWrapper.cva-BBQ4ic3D.js} +1 -1
  392. package/dist/{typography.cva-jtp6WWUH.d.ts → typography.cva-D1JOEYl-.d.ts} +2 -1
  393. package/dist/{typography.cva-CJZZSGXW.js → typography.cva-iD15k56p.js} +1 -1
  394. package/dist/{uiConfig.context-D2eUIPHn.js → uiConfig.context-BS3r_kTS.js} +1 -1
  395. package/dist/{uiConfig.context-aoarCLYX.d.ts → uiConfig.context-DeBX2beU.d.ts} +8 -8
  396. package/dist/{uiOverrides.context-Bfm2n-n8.js → uiOverrides.context-BTCH9y5a.js} +2 -2
  397. package/dist/{uiOverrides.context-C3xb4Ttq.d.ts → uiOverrides.context-DEp139He.d.ts} +11 -44
  398. package/dist/underline-66hmELxa.js +81 -0
  399. package/dist/{useBreakpoint-BOA-MyoT.js → useBreakpoint-DQoMN-BG.js} +1 -1
  400. package/dist/{useFieldAccessibility-D2_Qm26-.js → useFieldAccessibility-B4MVL6fz.js} +15 -8
  401. package/dist/{useFormAutosave-BYFn3LH8.js → useFormAutosave-Mg-tdwMh.js} +2 -2
  402. package/dist/{useStaticInputHandoff-DB9PgioW.js → useStaticInputHandoff-CvSBPUB3.js} +13 -10
  403. package/dist/useTableColumnConfig-gfVame8v.js +892 -0
  404. package/dist/{useTableNav-D9mICzNW.d.ts → useTableNav-Ckj5PBRk.d.ts} +3 -2
  405. package/dist/{useToast-DMSm59Y6.d.ts → useToast-yreVCUer.d.ts} +1 -1
  406. package/package.json +38 -6
  407. package/rulesync.jsonc +11 -0
  408. package/scripts/generate-rules.mjs +34 -0
  409. package/src/configurator/README.md +71 -0
  410. package/dist/Button-sn52l1Yv.js +0 -506
  411. package/dist/FormFieldHeaderTooltip-Dl24v4_j.js +0 -45
  412. package/dist/Link-Btxj2gzg.js +0 -42
  413. package/dist/PillButton-DASBXLFB.d.ts +0 -15
  414. package/dist/Tag-Cch_68QO.d.ts +0 -43
  415. package/dist/components/pill-button.d.ts +0 -2
  416. package/dist/pillButton.cva-BEWuu0qm.d.ts +0 -34
  417. package/dist/pillButton.cva-DlP5tOT5.js +0 -197
  418. package/dist/switch.cva-8T0fw31t.d.ts +0 -15
  419. package/dist/useTableColumnConfig-CcJxu14U.js +0 -1625
@@ -0,0 +1,3731 @@
1
+ import { t as createLucideIcon } from "../createLucideIcon-LcezOE4z.js";
2
+ import { t as UIConfig } from "../uiConfig.context-BS3r_kTS.js";
3
+ import { t as Check } from "../check-DYMBkp_Z.js";
4
+ import { t as ChevronDown } from "../chevron-down-B4Pr8bD3.js";
5
+ import { t as ChevronRight } from "../chevron-right-3nKJR5Bb.js";
6
+ import { t as Info } from "../info-iUmX3uDk.js";
7
+ import { a as checkboxDefinition, i as checkboxContentWrapperDefinition, o as checkboxGroupLabelDefinition, r as checkboxContentRowDefinition, s as checkboxIconDefinition } from "../CheckboxCheckmark-usHsolNj.js";
8
+ import { i as Search, n as selectListBoxItemDefinition, r as selectInputTagsContentWrapperDefinition, t as selectPopoverDefinition } from "../selectDesktop.cva-CHAMxhfO.js";
9
+ import { t as X } from "../x-B6vfz8Ps.js";
10
+ import { t as clsx } from "../clsx-CnD0nOiA.js";
11
+ import { n as StyleMergeUtils, r as cva, t as UIOverrides } from "../uiOverrides.context-BTCH9y5a.js";
12
+ import { c as $7230ffa83bc0c2cf$export$ef03459518577ad4, i as $7230ffa83bc0c2cf$export$9d4c57ee4c6ffdd8, l as $7230ffa83bc0c2cf$export$fabf2dc03a41866e, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, s as $7230ffa83bc0c2cf$export$df3a06d6289f983e, t as $7230ffa83bc0c2cf$export$2881499e37b75b9a } from "../utils-Czcqspm7.js";
13
+ import { c as $542a13ca2fa5b484$export$5b6b19405a83ff9d, d as $53e61d82d8b8611d$export$8b251419efc915eb, l as $542a13ca2fa5b484$export$9b9a0cd73afb7ca4, n as $f2ff30fde7b014be$export$3ddf2d174ce01153, r as $f2ff30fde7b014be$export$d2f961adcb0afbe } from "../Dialog-CKLkS00H.js";
14
+ import { t as $43a3b93638fe5db9$export$75b6ee27786ba447 } from "../Label-B2-B-uFY.js";
15
+ import { n as $7705c033048f6da7$export$353f5b6fc5456de1, t as $7705c033048f6da7$export$24d547caef80ccd1 } from "../Button-D6KlWSFL.js";
16
+ import { t as $2ec61d1d4f780267$export$a8a3e93435678ff9 } from "../Heading-nI1_VOaE.js";
17
+ import { t as $efe09c6d1c304b50$export$9afb8bc826b033ea } from "../Text-D2MPZ3sY.js";
18
+ import { n as $1f3c3b1a70cec653$export$ff05c3ac10437e03, t as $cdaed739b1139372$export$c24727297075ec6a } from "../Form-DlQcyN1f.js";
19
+ import { t as Checkbox } from "../Checkbox-BU0d702K.js";
20
+ import { a as $928221da08ecbc62$export$dca12b0bb56e4fc, i as $928221da08ecbc62$export$a11e76429ed99b4, n as $928221da08ecbc62$export$7c5906fe4f1f2af2, r as $928221da08ecbc62$export$7ff8f37d2d81a48d, t as $928221da08ecbc62$export$41f133550aa26f48 } from "../ListBox-CL8Ar4Q_.js";
21
+ import { n as $8b8d26808cb8cb53$export$8948f78d83984c69, t as $8b8d26808cb8cb53$export$2b77a92f1a5ad772 } from "../Modal-w60dVQcb.js";
22
+ import { i as radioDefinition, n as radioContentRowDefinition, r as radioContentWrapperDefinition, t as RadioGroup } from "../RadioGroup-B7_pNwn9.js";
23
+ import { n as switchDefinition, t as Switch } from "../Switch-CqnGEdeD.js";
24
+ import { n as textAreaWrapperDefinition, t as TextArea } from "../TextArea-DqHDiRGJ.js";
25
+ import { a as breadcrumbsDefinition, i as breadcrumbSegmentDefinition, n as breadcrumbIconDefinition, r as breadcrumbItemDefinition, t as breadcrumbChevronDefinition } from "../breadcrumbs.cva-7zzdDhVR.js";
26
+ import { i as menuPopoverWrapperDefinition, n as menuItemDefinition, r as menuPopoverDefinition, t as dropdownMenuDefinition } from "../dropdownMenu.cva-DvEmX0bs.js";
27
+ import { i as tooltipTextDefinition, n as tooltipPointerHorizontalDefinition, r as tooltipPointerVerticalDefinition, t as tooltipDefinition } from "../tooltip.cva-BIzlOXHH.js";
28
+ import { t as typographyDefinition } from "../typography.cva-iD15k56p.js";
29
+ import { a as buttonSizeDefinition, i as buttonIconSizeDefinition, n as buttonContentDefinition, r as buttonDefinition, t as Button } from "../Button-C5rv4Cr2.js";
30
+ import { r as badgeButtonDefinition } from "../badgeButton.cva-CvN4CTx5.js";
31
+ import { BadgeButton } from "../components/badge-button.js";
32
+ import { n as formFieldErrorDefinition } from "../FormFieldError-DeOHHLo2.js";
33
+ import { a as formFieldHeaderDefinition, i as labelDefinition, n as formFieldHelperDefinition } from "../FormField-U_-d4V_g.js";
34
+ import { n as tagDefinition, t as Tag } from "../Tag-DPg5sL1Z.js";
35
+ import { a as inputSizeDefinition, i as inputSideDefinition, n as inputClearClassDefinition, r as inputContentWrapperDefinition, t as inputBaseDefinition } from "../input.cva-DJA8ovm_.js";
36
+ import { t as popoverDefinition } from "../popover.cva-Bhud1wnp.js";
37
+ import { Input } from "../components/input.js";
38
+ import { t as datePickerInputContentRowDefinition } from "../datePickerInput.cva-Cd7UUN61.js";
39
+ import { a as progressTrackWrapperDefinition, i as progressTrackDefinition, n as progressDefinition, o as progressValueDefinition, r as progressFillDefinition, t as Progress } from "../Progress-B3mY9rIP.js";
40
+ import { t as fileUploadDropZoneDefinition } from "../fileUpload.cva-ujmStxB1.js";
41
+ import { n as toggleGroupItemDefinition, t as toggleGroupDefinition } from "../toggleGroup.cva-MbpaEBg1.js";
42
+ import { a as accordionHeadingTitleDefinition, c as accordionPanelContentDefinition, i as accordionHeadingSubtitleDefinition, l as accordionPanelDefinition, n as accordionDefinition, o as accordionIconDefinition, r as accordionHeadingDefinition, s as accordionItemDefinition, t as accordionChevronDefinition, u as accordionTriggerDefinition } from "../accordion.cva-CL1bVscW.js";
43
+ import { a as stepperSeparatorDefinition, i as stepperNumberDefinition, n as stepperIconDefinition, o as stepperSubtextDefinition, r as stepperItemDefinition, s as stepperTitleDefinition, t as stepperDefinition } from "../stepper.cva-CZ0Kj-s7.js";
44
+ import { i as dialogOverlayDefinition, n as dialogMainDefinition, t as dialogContentDefinition } from "../dialog.cva-COhDZaVl.js";
45
+ import { i as alertDefinition, n as statusIconDefinition, r as statusSeparatorDefinition, t as Alert } from "../Alert-CnvEb1D_.js";
46
+ import { a as toastDefinition, i as toastContainerDefinition } from "../toast.cva-C_L_RffH.js";
47
+ import { a as tableHeaderTextDefinition, i as tableHeadRowDefinition, n as tableDataDefinition, o as tableRowDefinition, r as tableHeadDataDefinition, s as theadDefinition, t as tableCellTextDefinition } from "../table.cva-BikE8qJH.js";
48
+ import { t as linkDefinition } from "../link.cva-DMTHZiJG.js";
49
+ import { t as tooltipWrapperTriggerDefinition } from "../tooltipWrapper.cva-BBQ4ic3D.js";
50
+ import { a as groupFor, c as labelFor, d as runtimeCss, f as toHex, i as generateShades, l as parseThemeCss, m as validToken, n as emptyTheme, o as groups, p as toRgb, r as exportCss, s as isRgb, t as baseColorNames, u as previewTokens } from "../theme-model-C-QMCksE.js";
51
+ import $ahdqC$react, { Suspense, createContext, lazy, use, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
52
+ import { c } from "react/compiler-runtime";
53
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
54
+ import { mergeProps } from "react-aria/mergeProps";
55
+ import { CollectionBuilder } from "react-aria/CollectionBuilder";
56
+ import { filterDOMProps } from "react-aria/filterDOMProps";
57
+ import { useFocusRing } from "react-aria/useFocusRing";
58
+ import { createHideableComponent } from "react-aria/private/collections/Hidden";
59
+ import "react-aria/useLocalizedStringFormatter";
60
+ import "react-aria/useListFormatter";
61
+ import { HiddenSelect, useSelect } from "react-aria/useSelect";
62
+ import { useSelectState } from "react-stately/useSelectState";
63
+ //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/arrow-down-to-line.mjs
64
+ /**
65
+ * @license lucide-react v1.43.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */
70
+ const __iconData$5 = {
71
+ name: "arrow-down-to-line",
72
+ size: 24,
73
+ node: [
74
+ ["path", {
75
+ d: "M12 17V3",
76
+ key: "1cwfxf"
77
+ }],
78
+ ["path", {
79
+ d: "m6 11 6 6 6-6",
80
+ key: "12ii2o"
81
+ }],
82
+ ["path", {
83
+ d: "M19 21H5",
84
+ key: "150jfl"
85
+ }]
86
+ ]
87
+ };
88
+ __iconData$5.node;
89
+ const ArrowDownToLine = createLucideIcon(__iconData$5);
90
+ //#endregion
91
+ //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/chevrons-up-down.mjs
92
+ /**
93
+ * @license lucide-react v1.43.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */
98
+ const __iconData$4 = {
99
+ name: "chevrons-up-down",
100
+ size: 24,
101
+ node: [["path", {
102
+ d: "m7 15 5 5 5-5",
103
+ key: "1hf1tw"
104
+ }], ["path", {
105
+ d: "m7 9 5-5 5 5",
106
+ key: "sgt6xg"
107
+ }]]
108
+ };
109
+ __iconData$4.node;
110
+ const ChevronsUpDown = createLucideIcon(__iconData$4);
111
+ //#endregion
112
+ //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/moon.mjs
113
+ /**
114
+ * @license lucide-react v1.43.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */
119
+ const __iconData$3 = {
120
+ name: "moon",
121
+ size: 24,
122
+ node: [["path", {
123
+ d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
124
+ key: "kfwtm"
125
+ }]]
126
+ };
127
+ __iconData$3.node;
128
+ const Moon = createLucideIcon(__iconData$3);
129
+ //#endregion
130
+ //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/plus.mjs
131
+ /**
132
+ * @license lucide-react v1.43.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */
137
+ const __iconData$2 = {
138
+ name: "plus",
139
+ size: 24,
140
+ node: [["path", {
141
+ d: "M5 12h14",
142
+ key: "1ays0h"
143
+ }], ["path", {
144
+ d: "M12 5v14",
145
+ key: "s699le"
146
+ }]]
147
+ };
148
+ __iconData$2.node;
149
+ const Plus = createLucideIcon(__iconData$2);
150
+ //#endregion
151
+ //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/rotate-ccw.mjs
152
+ /**
153
+ * @license lucide-react v1.43.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */
158
+ const __iconData$1 = {
159
+ name: "rotate-ccw",
160
+ size: 24,
161
+ node: [["path", {
162
+ d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
163
+ key: "1357e3"
164
+ }], ["path", {
165
+ d: "M3 3v5h5",
166
+ key: "1xhq8a"
167
+ }]]
168
+ };
169
+ __iconData$1.node;
170
+ const RotateCcw = createLucideIcon(__iconData$1);
171
+ //#endregion
172
+ //#region ../../node_modules/.bun/lucide-react@1.43.0+83d5fd7b249dbeef/node_modules/lucide-react/dist/esm/icons/sun.mjs
173
+ /**
174
+ * @license lucide-react v1.43.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */
179
+ const __iconData = {
180
+ name: "sun",
181
+ size: 24,
182
+ node: [
183
+ ["circle", {
184
+ cx: "12",
185
+ cy: "12",
186
+ r: "4",
187
+ key: "4exip2"
188
+ }],
189
+ ["path", {
190
+ d: "M12 2v2",
191
+ key: "tus03m"
192
+ }],
193
+ ["path", {
194
+ d: "M12 20v2",
195
+ key: "1lh1kg"
196
+ }],
197
+ ["path", {
198
+ d: "m4.93 4.93 1.41 1.41",
199
+ key: "149t6j"
200
+ }],
201
+ ["path", {
202
+ d: "m17.66 17.66 1.41 1.41",
203
+ key: "ptbguv"
204
+ }],
205
+ ["path", {
206
+ d: "M2 12h2",
207
+ key: "1t8f8n"
208
+ }],
209
+ ["path", {
210
+ d: "M20 12h2",
211
+ key: "1q8mjw"
212
+ }],
213
+ ["path", {
214
+ d: "m6.34 17.66-1.41 1.41",
215
+ key: "1m8zz5"
216
+ }],
217
+ ["path", {
218
+ d: "m19.07 4.93-1.41 1.41",
219
+ key: "1shlcs"
220
+ }]
221
+ ]
222
+ };
223
+ __iconData.node;
224
+ const Sun = createLucideIcon(__iconData);
225
+ //#endregion
226
+ //#region ../../node_modules/.bun/react-aria-components@1.21.1+67f6792bdf102c28/node_modules/react-aria-components/dist/private/Select.mjs
227
+ const $c8bb816105474884$export$7540cee5be7dc19b = /*#__PURE__*/ createContext(null);
228
+ const $c8bb816105474884$export$ef445b55be0601bd = /*#__PURE__*/ createContext(null);
229
+ const $c8bb816105474884$export$ef9b1a59e592288f = /*#__PURE__*/ createHideableComponent(function Select(props, ref) {
230
+ [props, ref] = $7230ffa83bc0c2cf$export$29f1550f4b0d4415(props, ref, $c8bb816105474884$export$7540cee5be7dc19b);
231
+ let { children, isDisabled = false, isInvalid = false, isRequired = false } = props;
232
+ let content = useMemo(() => typeof children === "function" ? children({
233
+ isOpen: false,
234
+ isDisabled,
235
+ isInvalid,
236
+ isRequired,
237
+ isFocused: false,
238
+ isFocusVisible: false,
239
+ defaultChildren: null
240
+ }) : children, [
241
+ children,
242
+ isDisabled,
243
+ isInvalid,
244
+ isRequired
245
+ ]);
246
+ return /*#__PURE__*/ $ahdqC$react.createElement(CollectionBuilder, { content }, (collection) => /*#__PURE__*/ $ahdqC$react.createElement($c8bb816105474884$var$SelectInner, {
247
+ props,
248
+ collection,
249
+ selectRef: ref
250
+ }));
251
+ });
252
+ const $c8bb816105474884$var$CLEAR_CONTEXTS = [
253
+ $43a3b93638fe5db9$export$75b6ee27786ba447,
254
+ $7705c033048f6da7$export$24d547caef80ccd1,
255
+ $efe09c6d1c304b50$export$9afb8bc826b033ea
256
+ ];
257
+ function $c8bb816105474884$var$SelectInner({ props, selectRef: ref, collection }) {
258
+ let { validationBehavior: formValidationBehavior } = $7230ffa83bc0c2cf$export$fabf2dc03a41866e($cdaed739b1139372$export$c24727297075ec6a) || {};
259
+ let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? "native";
260
+ let state = useSelectState({
261
+ ...props,
262
+ collection,
263
+ children: void 0,
264
+ validationBehavior
265
+ });
266
+ let { isFocusVisible, focusProps } = useFocusRing({ within: true });
267
+ let buttonRef = useRef(null);
268
+ let [labelRef, label] = $7230ffa83bc0c2cf$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
269
+ let { labelProps, triggerProps, valueProps, menuProps, descriptionProps, errorMessageProps, hiddenSelectProps, ...validation } = useSelect({
270
+ ...$7230ffa83bc0c2cf$export$ef03459518577ad4(props),
271
+ label,
272
+ validationBehavior
273
+ }, state, buttonRef);
274
+ let renderPropsState = useMemo(() => ({
275
+ isOpen: state.isOpen,
276
+ isFocused: state.isFocused,
277
+ isFocusVisible,
278
+ isDisabled: props.isDisabled || false,
279
+ isInvalid: validation.isInvalid || false,
280
+ isRequired: props.isRequired || false
281
+ }), [
282
+ state.isOpen,
283
+ state.isFocused,
284
+ isFocusVisible,
285
+ props.isDisabled,
286
+ validation.isInvalid,
287
+ props.isRequired
288
+ ]);
289
+ let renderProps = $7230ffa83bc0c2cf$export$4d86445c2cf5e3({
290
+ ...props,
291
+ values: renderPropsState,
292
+ defaultClassName: "react-aria-Select"
293
+ });
294
+ let DOMProps = filterDOMProps(props, { global: true });
295
+ delete DOMProps.id;
296
+ let scrollRef = useRef(null);
297
+ return /*#__PURE__*/ $ahdqC$react.createElement($7230ffa83bc0c2cf$export$2881499e37b75b9a, { values: [
298
+ [$c8bb816105474884$export$7540cee5be7dc19b, props],
299
+ [$c8bb816105474884$export$ef445b55be0601bd, state],
300
+ [$c8bb816105474884$export$f8f745c04421623f, valueProps],
301
+ [$43a3b93638fe5db9$export$75b6ee27786ba447, {
302
+ ...labelProps,
303
+ ref: labelRef,
304
+ elementType: "span"
305
+ }],
306
+ [$7705c033048f6da7$export$24d547caef80ccd1, {
307
+ ...triggerProps,
308
+ ref: buttonRef,
309
+ isPressed: state.isOpen,
310
+ autoFocus: props.autoFocus
311
+ }],
312
+ [$f2ff30fde7b014be$export$d2f961adcb0afbe, state],
313
+ [$542a13ca2fa5b484$export$9b9a0cd73afb7ca4, {
314
+ trigger: "Select",
315
+ triggerRef: buttonRef,
316
+ scrollRef,
317
+ placement: "bottom start",
318
+ "aria-labelledby": menuProps["aria-labelledby"],
319
+ clearContexts: $c8bb816105474884$var$CLEAR_CONTEXTS
320
+ }],
321
+ [$928221da08ecbc62$export$7ff8f37d2d81a48d, {
322
+ ...menuProps,
323
+ ref: scrollRef
324
+ }],
325
+ [$928221da08ecbc62$export$7c5906fe4f1f2af2, state],
326
+ [$efe09c6d1c304b50$export$9afb8bc826b033ea, { slots: {
327
+ description: descriptionProps,
328
+ errorMessage: errorMessageProps
329
+ } }],
330
+ [$1f3c3b1a70cec653$export$ff05c3ac10437e03, validation]
331
+ ] }, /*#__PURE__*/ $ahdqC$react.createElement($7230ffa83bc0c2cf$export$df3a06d6289f983e.div, {
332
+ ...mergeProps(DOMProps, renderProps, focusProps),
333
+ ref,
334
+ slot: props.slot || void 0,
335
+ "data-focused": state.isFocused || void 0,
336
+ "data-focus-visible": isFocusVisible || void 0,
337
+ "data-open": state.isOpen || void 0,
338
+ "data-disabled": props.isDisabled || void 0,
339
+ "data-invalid": validation.isInvalid || void 0,
340
+ "data-required": props.isRequired || void 0
341
+ }, renderProps.children, /*#__PURE__*/ $ahdqC$react.createElement(HiddenSelect, {
342
+ ...hiddenSelectProps,
343
+ autoComplete: props.autoComplete
344
+ })));
345
+ }
346
+ const $c8bb816105474884$export$f8f745c04421623f = /*#__PURE__*/ createContext(null);
347
+ //#endregion
348
+ //#region src/configurator/cva-definitions.ts
349
+ const cvaDefinitions = {
350
+ "datePickerInput.contentRowCva": datePickerInputContentRowDefinition,
351
+ "select.tagsContentWrapperCva": selectInputTagsContentWrapperDefinition,
352
+ "tooltip.pointerHorizontalCva": tooltipPointerHorizontalDefinition,
353
+ "accordion.chevronCva": accordionChevronDefinition,
354
+ "accordion.cva": accordionDefinition,
355
+ "accordion.headingCva": accordionHeadingDefinition,
356
+ "accordion.headingSubtitleCva": accordionHeadingSubtitleDefinition,
357
+ "accordion.headingTitleCva": accordionHeadingTitleDefinition,
358
+ "accordion.iconCva": accordionIconDefinition,
359
+ "accordion.itemCva": accordionItemDefinition,
360
+ "accordion.panelContentCva": accordionPanelContentDefinition,
361
+ "accordion.panelCva": accordionPanelDefinition,
362
+ "accordion.triggerCva": accordionTriggerDefinition,
363
+ "alert.cva": alertDefinition,
364
+ "breadcrumbs.chevronCva": breadcrumbChevronDefinition,
365
+ "breadcrumbs.cva": breadcrumbsDefinition,
366
+ "breadcrumbs.iconCva": breadcrumbIconDefinition,
367
+ "breadcrumbs.itemCva": breadcrumbItemDefinition,
368
+ "breadcrumbs.segmentCva": breadcrumbSegmentDefinition,
369
+ "button.contentCva": buttonContentDefinition,
370
+ "button.cva": buttonDefinition,
371
+ "button.iconSize": buttonIconSizeDefinition,
372
+ "button.sizeCva": buttonSizeDefinition,
373
+ "checkbox.contentRowCva": checkboxContentRowDefinition,
374
+ "checkbox.contentWrapperCva": checkboxContentWrapperDefinition,
375
+ "checkbox.cva": checkboxDefinition,
376
+ "checkbox.groupLabelCva": checkboxGroupLabelDefinition,
377
+ "checkbox.iconCva": checkboxIconDefinition,
378
+ "dialog.contentCva": dialogContentDefinition,
379
+ "dialog.mainCva": dialogMainDefinition,
380
+ "dialog.overlayCva": dialogOverlayDefinition,
381
+ "dropdownMenu.cva": dropdownMenuDefinition,
382
+ "dropdownMenu.itemCva": menuItemDefinition,
383
+ "dropdownMenu.popoverCva": menuPopoverDefinition,
384
+ "dropdownMenu.popoverWrapperCva": menuPopoverWrapperDefinition,
385
+ "fileUpload.dropZoneCva": fileUploadDropZoneDefinition,
386
+ "formField.errorLabelCva": formFieldErrorDefinition,
387
+ "formField.headerCva": formFieldHeaderDefinition,
388
+ "formField.helperLabelCva": formFieldHelperDefinition,
389
+ "input.baseCva": inputBaseDefinition,
390
+ "input.clearClassCva": inputClearClassDefinition,
391
+ "input.contentWrapperCva": inputContentWrapperDefinition,
392
+ "input.sideCva": inputSideDefinition,
393
+ "input.sizeCva": inputSizeDefinition,
394
+ "label.cva": labelDefinition,
395
+ "link.cva": linkDefinition,
396
+ "badgeButton.cva": badgeButtonDefinition,
397
+ "popover.cva": popoverDefinition,
398
+ "progress.cva": progressDefinition,
399
+ "progress.fillCva": progressFillDefinition,
400
+ "progress.trackCva": progressTrackDefinition,
401
+ "progress.trackWrapperCva": progressTrackWrapperDefinition,
402
+ "progress.valueCva": progressValueDefinition,
403
+ "radio.contentRowCva": radioContentRowDefinition,
404
+ "radio.contentWrapperCva": radioContentWrapperDefinition,
405
+ "radio.cva": radioDefinition,
406
+ "select.listBoxItemCva": selectListBoxItemDefinition,
407
+ "select.popoverCva": selectPopoverDefinition,
408
+ "status.iconCva": statusIconDefinition,
409
+ "status.separatorCva": statusSeparatorDefinition,
410
+ "stepper.cva": stepperDefinition,
411
+ "stepper.iconCva": stepperIconDefinition,
412
+ "stepper.itemCva": stepperItemDefinition,
413
+ "stepper.numberCva": stepperNumberDefinition,
414
+ "stepper.separatorCva": stepperSeparatorDefinition,
415
+ "stepper.subtextCva": stepperSubtextDefinition,
416
+ "stepper.titleCva": stepperTitleDefinition,
417
+ "switch.cva": switchDefinition,
418
+ "table.cellTextCva": tableCellTextDefinition,
419
+ "table.dataCva": tableDataDefinition,
420
+ "table.headDataCva": tableHeadDataDefinition,
421
+ "table.headRowCva": tableHeadRowDefinition,
422
+ "table.headerTextCva": tableHeaderTextDefinition,
423
+ "table.rowCva": tableRowDefinition,
424
+ "table.theadCva": theadDefinition,
425
+ "tag.cva": tagDefinition,
426
+ "textArea.wrapperCva": textAreaWrapperDefinition,
427
+ "toast.containerCva": toastContainerDefinition,
428
+ "toast.cva": toastDefinition,
429
+ "toggleGroup.cva": toggleGroupDefinition,
430
+ "toggleGroup.itemCva": toggleGroupItemDefinition,
431
+ "tooltip.cva": tooltipDefinition,
432
+ "tooltip.pointerVerticalCva": tooltipPointerVerticalDefinition,
433
+ "tooltip.textCva": tooltipTextDefinition,
434
+ "tooltipWrapper.triggerCva": tooltipWrapperTriggerDefinition,
435
+ "typography.cva": typographyDefinition
436
+ };
437
+ //#endregion
438
+ //#region src/configurator/cva-model.ts
439
+ function resolveCvaDefinition(slot, inherited) {
440
+ const [component, part] = slot.split(".");
441
+ const override = (inherited?.[component])?.[part];
442
+ if (typeof override === "function") return null;
443
+ const fallback = cvaDefinitions[slot];
444
+ const definition = override && typeof override === "object" && "mode" in override ? StyleMergeUtils.mergeCvaDefinition(fallback, override) : fallback;
445
+ const config = definition.config;
446
+ return {
447
+ base: [...definition.base],
448
+ config: {
449
+ variants: Object.fromEntries(Object.entries(config?.variants ?? {}).map(([name, options]) => [name, Object.fromEntries(Object.entries(options).map(([value, classes]) => [value, clsx(classes)]))])),
450
+ defaultVariants: config?.defaultVariants ?? {},
451
+ compoundVariants: (config?.compoundVariants ?? []).map(({ class: classes, className, ...selectors }) => Object.assign(selectors, { className: clsx(classes, className) }))
452
+ }
453
+ };
454
+ }
455
+ function applyCvaEdits(inherited, edits = {}) {
456
+ const result = { ...inherited };
457
+ for (const [slot, definition] of Object.entries(edits)) {
458
+ const [component, part] = slot.split(".");
459
+ const key = component;
460
+ result[key] = {
461
+ ...result[key],
462
+ [part]: {
463
+ mode: "overrideCva",
464
+ ...definition
465
+ }
466
+ };
467
+ }
468
+ return result;
469
+ }
470
+ function exportCvaEdits(edits = {}) {
471
+ const overrides = applyCvaEdits(void 0, edits);
472
+ const components = Object.keys(overrides).map((name) => ` ${name}: { ...existing.${name}, ...edited.${name} },`).join("\n");
473
+ return `import { UIOverrides } from "@povio/ui/ui-overrides";\n\nconst edited = ${JSON.stringify(overrides, null, 2)} satisfies UIOverrides.Config;\n\nexport function withUIOverrides(existing: UIOverrides.Config = {}): UIOverrides.Config {\n return {\n ...existing,\n${components}\n };\n}\n\n// <UIOverrides.Provider config={withUIOverrides(appOverrides)}>{children}</UIOverrides.Provider>\n`;
474
+ }
475
+ //#endregion
476
+ //#region src/configurator/configuration.context.tsx
477
+ const emptyConfiguration = () => ({
478
+ theme: emptyTheme(),
479
+ config: {}
480
+ });
481
+ const ConfigurationContext = createContext(null);
482
+ function UIConfigurationProvider(t0) {
483
+ const $ = c(34);
484
+ const { defaults, initialValue, onApply, children } = t0;
485
+ const inheritedOverrides = UIOverrides.useConfig();
486
+ const [applied, setApplied] = useState(initialValue ?? emptyConfiguration);
487
+ const [draft, setDraft] = useState(applied);
488
+ const [isOpen, setOpen] = useState(false);
489
+ const [revision, setRevision] = useState(0);
490
+ const active = isOpen ? draft : applied;
491
+ let t1;
492
+ if ($[0] !== applied) {
493
+ t1 = () => {
494
+ setDraft(structuredClone(applied));
495
+ setRevision(_temp$5);
496
+ setOpen(true);
497
+ };
498
+ $[0] = applied;
499
+ $[1] = t1;
500
+ } else t1 = $[1];
501
+ const open = t1;
502
+ let t2;
503
+ if ($[2] !== applied) {
504
+ t2 = () => {
505
+ setDraft(structuredClone(applied));
506
+ setOpen(false);
507
+ };
508
+ $[2] = applied;
509
+ $[3] = t2;
510
+ } else t2 = $[3];
511
+ const cancel = t2;
512
+ let t3;
513
+ if ($[4] !== draft || $[5] !== onApply) {
514
+ t3 = () => {
515
+ onApply?.(structuredClone(draft));
516
+ setApplied(structuredClone(draft));
517
+ setOpen(false);
518
+ };
519
+ $[4] = draft;
520
+ $[5] = onApply;
521
+ $[6] = t3;
522
+ } else t3 = $[6];
523
+ const apply = t3;
524
+ let t4;
525
+ if ($[7] !== active.overrides || $[8] !== inheritedOverrides) {
526
+ t4 = applyCvaEdits(inheritedOverrides, active.overrides);
527
+ $[7] = active.overrides;
528
+ $[8] = inheritedOverrides;
529
+ $[9] = t4;
530
+ } else t4 = $[9];
531
+ const overrides = t4;
532
+ let t5;
533
+ if ($[10] !== apply || $[11] !== cancel || $[12] !== defaults || $[13] !== draft || $[14] !== inheritedOverrides || $[15] !== isOpen || $[16] !== open || $[17] !== revision) {
534
+ t5 = {
535
+ defaults,
536
+ inheritedOverrides,
537
+ draft,
538
+ setDraft,
539
+ isOpen,
540
+ open,
541
+ cancel,
542
+ apply,
543
+ revision
544
+ };
545
+ $[10] = apply;
546
+ $[11] = cancel;
547
+ $[12] = defaults;
548
+ $[13] = draft;
549
+ $[14] = inheritedOverrides;
550
+ $[15] = isOpen;
551
+ $[16] = open;
552
+ $[17] = revision;
553
+ $[18] = t5;
554
+ } else t5 = $[18];
555
+ const contextValue = t5;
556
+ let t6;
557
+ if ($[19] !== active.theme || $[20] !== defaults) {
558
+ t6 = runtimeCss(defaults, active.theme);
559
+ $[19] = active.theme;
560
+ $[20] = defaults;
561
+ $[21] = t6;
562
+ } else t6 = $[21];
563
+ let t7;
564
+ if ($[22] !== t6) {
565
+ t7 = /* @__PURE__ */ jsx("style", {
566
+ "data-povio-ui-configuration": true,
567
+ children: t6
568
+ });
569
+ $[22] = t6;
570
+ $[23] = t7;
571
+ } else t7 = $[23];
572
+ let t8;
573
+ if ($[24] !== active.config || $[25] !== children) {
574
+ t8 = /* @__PURE__ */ jsx(UIConfig.Provider, {
575
+ config: active.config,
576
+ children
577
+ });
578
+ $[24] = active.config;
579
+ $[25] = children;
580
+ $[26] = t8;
581
+ } else t8 = $[26];
582
+ let t9;
583
+ if ($[27] !== overrides || $[28] !== t8) {
584
+ t9 = /* @__PURE__ */ jsx(UIOverrides.Provider, {
585
+ config: overrides,
586
+ children: t8
587
+ });
588
+ $[27] = overrides;
589
+ $[28] = t8;
590
+ $[29] = t9;
591
+ } else t9 = $[29];
592
+ let t10;
593
+ if ($[30] !== contextValue || $[31] !== t7 || $[32] !== t9) {
594
+ t10 = /* @__PURE__ */ jsxs(ConfigurationContext.Provider, {
595
+ value: contextValue,
596
+ children: [t7, t9]
597
+ });
598
+ $[30] = contextValue;
599
+ $[31] = t7;
600
+ $[32] = t9;
601
+ $[33] = t10;
602
+ } else t10 = $[33];
603
+ return t10;
604
+ }
605
+ function _temp$5(value) {
606
+ return value + 1;
607
+ }
608
+ function useUIConfiguration() {
609
+ const context = use(ConfigurationContext);
610
+ if (!context) throw new Error("useUIConfiguration requires UIConfigurationProvider");
611
+ return context;
612
+ }
613
+ //#endregion
614
+ //#region src/configurator/ContextualPreview.tsx
615
+ function CvaPreview(t0) {
616
+ const $ = c(84);
617
+ const { slot, variants, setVariants } = t0;
618
+ const overrides = UIOverrides.useConfig();
619
+ const [disabled, setDisabled] = useState(false);
620
+ const [selected, setSelected] = useState(false);
621
+ const [text, setText] = useState("Example value");
622
+ let component;
623
+ let definition;
624
+ let sample;
625
+ let t1;
626
+ let t2;
627
+ let t3;
628
+ if ($[0] !== disabled || $[1] !== overrides || $[2] !== selected || $[3] !== slot || $[4] !== text || $[5] !== variants) {
629
+ definition = resolveCvaDefinition(slot, overrides);
630
+ component = slot.split(".")[0];
631
+ const props = {
632
+ ...definition?.config.defaultVariants,
633
+ ...Object.fromEntries(Object.entries(variants).filter(_temp$4).map(_temp2$1))
634
+ };
635
+ const classes = (key, t4) => {
636
+ const extra = t4 === void 0 ? {} : t4;
637
+ const [group, part] = key.split(".");
638
+ const inherited = (overrides?.[group])?.[part];
639
+ if (typeof inherited === "function") return inherited({
640
+ ...props,
641
+ ...extra
642
+ });
643
+ const resolved = resolveCvaDefinition(key, overrides);
644
+ return cva(resolved.base, resolved.config)({
645
+ ...props,
646
+ ...extra
647
+ });
648
+ };
649
+ const exact = classes(slot);
650
+ bb0: switch (component) {
651
+ case "button":
652
+ sample = /* @__PURE__ */ jsx(Button, {
653
+ ...props,
654
+ isDisabled: disabled,
655
+ icon: Plus,
656
+ children: "Example button"
657
+ });
658
+ break bb0;
659
+ case "badgeButton":
660
+ sample = /* @__PURE__ */ jsx(BadgeButton, {
661
+ ...props,
662
+ isDisabled: disabled,
663
+ icon: Plus,
664
+ children: "Example badge button"
665
+ });
666
+ break bb0;
667
+ case "input":
668
+ case "label":
669
+ case "formField":
670
+ case "tooltipWrapper":
671
+ sample = /* @__PURE__ */ jsx(Input, {
672
+ ...props,
673
+ label: "Example input",
674
+ value: text,
675
+ onChange: setText,
676
+ isDisabled: disabled,
677
+ isClearable: true,
678
+ leadingIcon: Info,
679
+ tooltipText: "Helpful field information",
680
+ ...component === "tooltipWrapper" ? { as: "inline" } : {},
681
+ helperText: "Helpful supporting text",
682
+ error: slot === "formField.errorLabelCva" ? "This field needs attention." : void 0
683
+ });
684
+ break bb0;
685
+ case "checkbox":
686
+ sample = /* @__PURE__ */ jsxs("div", {
687
+ className: classes("checkbox.contentWrapperCva"),
688
+ children: [/* @__PURE__ */ jsx("span", {
689
+ className: classes("checkbox.groupLabelCva"),
690
+ children: "Example group"
691
+ }), /* @__PURE__ */ jsx("div", {
692
+ className: classes("checkbox.contentRowCva"),
693
+ children: /* @__PURE__ */ jsx(Checkbox, {
694
+ ...props,
695
+ isDisabled: disabled,
696
+ isSelected: selected,
697
+ onChange: setSelected,
698
+ children: "Example checkbox"
699
+ })
700
+ })]
701
+ });
702
+ break bb0;
703
+ case "switch":
704
+ sample = /* @__PURE__ */ jsx(Switch, {
705
+ ...props,
706
+ isDisabled: disabled,
707
+ isSelected: selected,
708
+ onChange: setSelected,
709
+ children: "Example switch"
710
+ });
711
+ break bb0;
712
+ case "tag":
713
+ sample = /* @__PURE__ */ jsx(Tag, {
714
+ ...props,
715
+ isDisabled: disabled,
716
+ children: "Example tag"
717
+ });
718
+ break bb0;
719
+ case "alert":
720
+ case "status": {
721
+ let t5;
722
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
723
+ t5 = /* @__PURE__ */ jsx(Button, {
724
+ variant: "text",
725
+ children: "View"
726
+ });
727
+ $[12] = t5;
728
+ } else t5 = $[12];
729
+ sample = /* @__PURE__ */ jsx(Alert, {
730
+ ...props,
731
+ text: "Your changes have been saved.",
732
+ icon: Info,
733
+ hasSeparator: true,
734
+ rightContent: t5
735
+ });
736
+ break bb0;
737
+ }
738
+ case "progress":
739
+ sample = /* @__PURE__ */ jsx(Progress, {
740
+ ...props,
741
+ progress: 65
742
+ });
743
+ break bb0;
744
+ case "typography": {
745
+ let t5;
746
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
747
+ t5 = /* @__PURE__ */ jsx("br", {});
748
+ $[13] = t5;
749
+ } else t5 = $[13];
750
+ sample = /* @__PURE__ */ jsxs("div", {
751
+ className: exact,
752
+ children: [
753
+ "The quick brown fox jumps over the lazy dog.",
754
+ t5,
755
+ "Aa Bb Cc · 0123456789"
756
+ ]
757
+ });
758
+ break bb0;
759
+ }
760
+ case "link":
761
+ sample = /* @__PURE__ */ jsx("a", {
762
+ className: exact,
763
+ href: "#preview",
764
+ onClick: _temp3$1,
765
+ children: "Example link"
766
+ });
767
+ break bb0;
768
+ case "table": {
769
+ let t5;
770
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
771
+ t5 = { width: "100%" };
772
+ $[14] = t5;
773
+ } else t5 = $[14];
774
+ sample = /* @__PURE__ */ jsxs("table", {
775
+ style: t5,
776
+ children: [/* @__PURE__ */ jsx("thead", {
777
+ className: classes("table.theadCva"),
778
+ children: /* @__PURE__ */ jsxs("tr", {
779
+ className: classes("table.headRowCva"),
780
+ children: [/* @__PURE__ */ jsx("th", {
781
+ className: classes("table.headDataCva"),
782
+ children: /* @__PURE__ */ jsx("span", {
783
+ className: classes("table.headerTextCva"),
784
+ children: "Workspace"
785
+ })
786
+ }), /* @__PURE__ */ jsx("th", {
787
+ className: classes("table.headDataCva"),
788
+ children: "Status"
789
+ })]
790
+ })
791
+ }), /* @__PURE__ */ jsx("tbody", { children: ["Design system", "Website"].map((name_0) => /* @__PURE__ */ jsxs("tr", {
792
+ className: classes("table.rowCva"),
793
+ "data-selected": selected || void 0,
794
+ children: [/* @__PURE__ */ jsx("td", {
795
+ className: classes("table.dataCva"),
796
+ children: /* @__PURE__ */ jsx("span", {
797
+ className: classes("table.cellTextCva"),
798
+ children: name_0
799
+ })
800
+ }), /* @__PURE__ */ jsx("td", {
801
+ className: classes("table.dataCva"),
802
+ children: "Active"
803
+ })]
804
+ }, name_0)) })]
805
+ });
806
+ break bb0;
807
+ }
808
+ case "tooltip": {
809
+ let t5;
810
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
811
+ t5 = /* @__PURE__ */ jsx("path", { d: "M0 0 L6 6 L12 0 Z" });
812
+ $[15] = t5;
813
+ } else t5 = $[15];
814
+ sample = /* @__PURE__ */ jsxs("div", {
815
+ className: classes("tooltip.cva"),
816
+ children: [/* @__PURE__ */ jsx("div", {
817
+ className: classes("tooltip.textCva"),
818
+ children: "Helpful tooltip text"
819
+ }), /* @__PURE__ */ jsx("svg", {
820
+ width: "12",
821
+ height: "6",
822
+ className: classes(slot === "tooltip.pointerHorizontalCva" ? slot : "tooltip.pointerVerticalCva"),
823
+ children: t5
824
+ })]
825
+ });
826
+ break bb0;
827
+ }
828
+ case "textArea": {
829
+ let t5;
830
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
831
+ t5 = (event_0) => setText(event_0.target.value);
832
+ $[16] = t5;
833
+ } else t5 = $[16];
834
+ let t6;
835
+ if ($[17] !== disabled || $[18] !== text) {
836
+ t6 = /* @__PURE__ */ jsx("textarea", {
837
+ "aria-label": "Example text area",
838
+ value: text,
839
+ onChange: t5,
840
+ disabled
841
+ });
842
+ $[17] = disabled;
843
+ $[18] = text;
844
+ $[19] = t6;
845
+ } else t6 = $[19];
846
+ sample = /* @__PURE__ */ jsx("div", {
847
+ className: exact,
848
+ children: t6
849
+ });
850
+ break bb0;
851
+ }
852
+ case "radio": {
853
+ let t5;
854
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
855
+ t5 = [{
856
+ label: "First option",
857
+ value: "first"
858
+ }, {
859
+ label: "Second option",
860
+ value: "second"
861
+ }];
862
+ $[20] = t5;
863
+ } else t5 = $[20];
864
+ let t6;
865
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
866
+ t6 = (value_1) => setSelected(value_1 === "second");
867
+ $[21] = t6;
868
+ } else t6 = $[21];
869
+ sample = /* @__PURE__ */ jsx(RadioGroup, {
870
+ ...props,
871
+ label: "Choose an option",
872
+ options: t5,
873
+ value: selected ? "second" : "first",
874
+ onChange: t6,
875
+ isDisabled: disabled
876
+ });
877
+ break bb0;
878
+ }
879
+ case "accordion": {
880
+ let t5;
881
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
882
+ t5 = { width: "100%" };
883
+ $[22] = t5;
884
+ } else t5 = $[22];
885
+ let t6;
886
+ if ($[23] !== selected) {
887
+ t6 = () => setSelected(!selected);
888
+ $[23] = selected;
889
+ $[24] = t6;
890
+ } else t6 = $[24];
891
+ sample = /* @__PURE__ */ jsxs("div", {
892
+ style: t5,
893
+ className: `${classes("accordion.cva")} ${classes("accordion.itemCva")}`,
894
+ children: [/* @__PURE__ */ jsxs("button", {
895
+ className: classes("accordion.triggerCva"),
896
+ onClick: t6,
897
+ "aria-expanded": selected,
898
+ disabled,
899
+ children: [
900
+ /* @__PURE__ */ jsx(Info, { className: classes("accordion.iconCva") }),
901
+ /* @__PURE__ */ jsxs("div", {
902
+ className: classes("accordion.headingCva"),
903
+ children: [/* @__PURE__ */ jsx("div", {
904
+ className: classes("accordion.headingTitleCva"),
905
+ children: "Account settings"
906
+ }), /* @__PURE__ */ jsx("div", {
907
+ className: classes("accordion.headingSubtitleCva"),
908
+ children: "Manage your preferences"
909
+ })]
910
+ }),
911
+ /* @__PURE__ */ jsx(Check, { className: classes("accordion.chevronCva") })
912
+ ]
913
+ }), /* @__PURE__ */ jsx("div", {
914
+ className: classes("accordion.panelCva"),
915
+ children: /* @__PURE__ */ jsx("div", {
916
+ className: classes("accordion.panelContentCva"),
917
+ children: "Update your account preferences here."
918
+ })
919
+ })]
920
+ });
921
+ break bb0;
922
+ }
923
+ case "breadcrumbs":
924
+ sample = /* @__PURE__ */ jsxs("nav", {
925
+ "aria-label": "Preview breadcrumbs",
926
+ className: classes("breadcrumbs.cva"),
927
+ children: [/* @__PURE__ */ jsxs("div", {
928
+ className: classes("breadcrumbs.itemCva"),
929
+ children: [
930
+ /* @__PURE__ */ jsx(Info, { className: classes("breadcrumbs.iconCva") }),
931
+ /* @__PURE__ */ jsx("span", {
932
+ className: classes("breadcrumbs.segmentCva"),
933
+ children: "Workspace"
934
+ }),
935
+ /* @__PURE__ */ jsx("span", {
936
+ className: classes("breadcrumbs.chevronCva"),
937
+ children: "›"
938
+ })
939
+ ]
940
+ }), /* @__PURE__ */ jsx("div", {
941
+ className: classes("breadcrumbs.itemCva"),
942
+ children: /* @__PURE__ */ jsx("span", {
943
+ className: classes("breadcrumbs.segmentCva"),
944
+ children: "Settings"
945
+ })
946
+ })]
947
+ });
948
+ break bb0;
949
+ case "stepper":
950
+ sample = /* @__PURE__ */ jsx("div", {
951
+ className: classes("stepper.cva"),
952
+ children: ["Details", "Review"].map((label_2, index) => /* @__PURE__ */ jsxs("div", {
953
+ className: classes("stepper.itemCva"),
954
+ children: [
955
+ /* @__PURE__ */ jsx(Info, { className: classes("stepper.iconCva") }),
956
+ /* @__PURE__ */ jsx("span", {
957
+ className: classes("stepper.numberCva"),
958
+ children: index + 1
959
+ }),
960
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
961
+ className: classes("stepper.titleCva"),
962
+ children: label_2
963
+ }), /* @__PURE__ */ jsx("div", {
964
+ className: classes("stepper.subtextCva"),
965
+ children: "Step description"
966
+ })] }),
967
+ /* @__PURE__ */ jsx("div", { className: classes("stepper.separatorCva") })
968
+ ]
969
+ }, label_2))
970
+ });
971
+ break bb0;
972
+ case "toggleGroup":
973
+ sample = /* @__PURE__ */ jsx("div", {
974
+ className: classes("toggleGroup.cva"),
975
+ children: [
976
+ "Day",
977
+ "Week",
978
+ "Month"
979
+ ].map((label_1) => /* @__PURE__ */ jsx("button", {
980
+ className: classes("toggleGroup.itemCva"),
981
+ "data-selected": text === label_1 || void 0,
982
+ onClick: () => setText(label_1),
983
+ disabled,
984
+ children: label_1
985
+ }, label_1))
986
+ });
987
+ break bb0;
988
+ case "select":
989
+ sample = slot === "select.tagsContentWrapperCva" ? /* @__PURE__ */ jsxs("div", {
990
+ className: exact,
991
+ children: [/* @__PURE__ */ jsx(Tag, { children: "Design" }), /* @__PURE__ */ jsx(Tag, { children: "Engineering" })]
992
+ }) : /* @__PURE__ */ jsx("div", {
993
+ className: classes("select.popoverCva"),
994
+ role: "listbox",
995
+ "aria-label": "Preview options",
996
+ children: [
997
+ "Design",
998
+ "Engineering",
999
+ "Marketing"
1000
+ ].map((label_0) => /* @__PURE__ */ jsx("div", {
1001
+ role: "option",
1002
+ "aria-selected": text === label_0,
1003
+ className: classes("select.listBoxItemCva"),
1004
+ "data-selected": text === label_0 || void 0,
1005
+ onClick: () => setText(label_0),
1006
+ tabIndex: 0,
1007
+ onKeyDown: (event) => {
1008
+ if (event.key === "Enter" || event.key === " ") {
1009
+ event.preventDefault();
1010
+ setText(label_0);
1011
+ }
1012
+ },
1013
+ children: label_0
1014
+ }, label_0))
1015
+ });
1016
+ break bb0;
1017
+ case "dropdownMenu":
1018
+ sample = /* @__PURE__ */ jsx("div", {
1019
+ className: classes("dropdownMenu.popoverWrapperCva"),
1020
+ children: /* @__PURE__ */ jsx("div", {
1021
+ className: classes("dropdownMenu.popoverCva"),
1022
+ children: /* @__PURE__ */ jsx("div", {
1023
+ className: classes("dropdownMenu.cva"),
1024
+ children: [
1025
+ "Edit",
1026
+ "Duplicate",
1027
+ "Delete"
1028
+ ].map((label) => /* @__PURE__ */ jsx("button", {
1029
+ className: classes("dropdownMenu.itemCva"),
1030
+ disabled,
1031
+ children: label
1032
+ }, label))
1033
+ })
1034
+ })
1035
+ });
1036
+ break bb0;
1037
+ case "dialog": {
1038
+ let t5;
1039
+ let t6;
1040
+ let t7;
1041
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
1042
+ t5 = /* @__PURE__ */ jsx("strong", { children: "Save changes?" });
1043
+ t6 = /* @__PURE__ */ jsx("p", { children: "Your preferences will be updated." });
1044
+ t7 = /* @__PURE__ */ jsx(Button, { children: "Save" });
1045
+ $[25] = t5;
1046
+ $[26] = t6;
1047
+ $[27] = t7;
1048
+ } else {
1049
+ t5 = $[25];
1050
+ t6 = $[26];
1051
+ t7 = $[27];
1052
+ }
1053
+ sample = /* @__PURE__ */ jsxs("div", {
1054
+ className: "studio-mini-dialog",
1055
+ children: [/* @__PURE__ */ jsx("div", { className: classes("dialog.overlayCva") }), /* @__PURE__ */ jsx("div", {
1056
+ className: classes("dialog.mainCva"),
1057
+ children: /* @__PURE__ */ jsxs("div", {
1058
+ className: classes("dialog.contentCva"),
1059
+ children: [
1060
+ t5,
1061
+ t6,
1062
+ t7
1063
+ ]
1064
+ })
1065
+ })]
1066
+ });
1067
+ break bb0;
1068
+ }
1069
+ case "popover": {
1070
+ let t5;
1071
+ let t6;
1072
+ let t7;
1073
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
1074
+ t5 = /* @__PURE__ */ jsx("strong", { children: "Quick settings" });
1075
+ t6 = /* @__PURE__ */ jsx("p", { children: "Adjust preferences for this workspace." });
1076
+ t7 = /* @__PURE__ */ jsx(Checkbox, { children: "Enable notifications" });
1077
+ $[28] = t5;
1078
+ $[29] = t6;
1079
+ $[30] = t7;
1080
+ } else {
1081
+ t5 = $[28];
1082
+ t6 = $[29];
1083
+ t7 = $[30];
1084
+ }
1085
+ sample = /* @__PURE__ */ jsxs("div", {
1086
+ className: exact,
1087
+ children: [
1088
+ t5,
1089
+ t6,
1090
+ t7
1091
+ ]
1092
+ });
1093
+ break bb0;
1094
+ }
1095
+ case "toast": {
1096
+ let t5;
1097
+ let t6;
1098
+ if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
1099
+ t5 = /* @__PURE__ */ jsx(Info, {});
1100
+ t6 = /* @__PURE__ */ jsx("span", { children: "Your changes have been saved." });
1101
+ $[31] = t5;
1102
+ $[32] = t6;
1103
+ } else {
1104
+ t5 = $[31];
1105
+ t6 = $[32];
1106
+ }
1107
+ sample = /* @__PURE__ */ jsx("div", {
1108
+ className: classes("toast.containerCva"),
1109
+ children: /* @__PURE__ */ jsxs("div", {
1110
+ className: classes("toast.cva"),
1111
+ children: [t5, t6]
1112
+ })
1113
+ });
1114
+ break bb0;
1115
+ }
1116
+ case "datePickerInput": {
1117
+ let t5;
1118
+ let t6;
1119
+ let t7;
1120
+ let t8;
1121
+ let t9;
1122
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
1123
+ t5 = /* @__PURE__ */ jsx("span", { children: "24" });
1124
+ t6 = /* @__PURE__ */ jsx("span", { children: "/" });
1125
+ t7 = /* @__PURE__ */ jsx("span", { children: "09" });
1126
+ t8 = /* @__PURE__ */ jsx("span", { children: "/" });
1127
+ t9 = /* @__PURE__ */ jsx("span", { children: "2026" });
1128
+ $[33] = t5;
1129
+ $[34] = t6;
1130
+ $[35] = t7;
1131
+ $[36] = t8;
1132
+ $[37] = t9;
1133
+ } else {
1134
+ t5 = $[33];
1135
+ t6 = $[34];
1136
+ t7 = $[35];
1137
+ t8 = $[36];
1138
+ t9 = $[37];
1139
+ }
1140
+ let t10;
1141
+ if ($[38] !== exact) {
1142
+ t10 = /* @__PURE__ */ jsxs("div", {
1143
+ className: exact,
1144
+ children: [
1145
+ t5,
1146
+ t6,
1147
+ t7,
1148
+ t8,
1149
+ t9
1150
+ ]
1151
+ });
1152
+ $[38] = exact;
1153
+ $[39] = t10;
1154
+ } else t10 = $[39];
1155
+ sample = t10;
1156
+ break bb0;
1157
+ }
1158
+ case "fileUpload": {
1159
+ let t5;
1160
+ let t6;
1161
+ let t7;
1162
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
1163
+ t5 = /* @__PURE__ */ jsx(Plus, {});
1164
+ t6 = /* @__PURE__ */ jsx("strong", { children: "Drop files here" });
1165
+ t7 = /* @__PURE__ */ jsx("div", { children: "or choose a file" });
1166
+ $[40] = t5;
1167
+ $[41] = t6;
1168
+ $[42] = t7;
1169
+ } else {
1170
+ t5 = $[40];
1171
+ t6 = $[41];
1172
+ t7 = $[42];
1173
+ }
1174
+ let t8;
1175
+ if ($[43] !== exact) {
1176
+ t8 = /* @__PURE__ */ jsxs("div", {
1177
+ className: exact,
1178
+ children: [
1179
+ t5,
1180
+ t6,
1181
+ t7
1182
+ ]
1183
+ });
1184
+ $[43] = exact;
1185
+ $[44] = t8;
1186
+ } else t8 = $[44];
1187
+ sample = t8;
1188
+ break bb0;
1189
+ }
1190
+ default: {
1191
+ let t5;
1192
+ if ($[45] !== exact) {
1193
+ t5 = /* @__PURE__ */ jsx("div", {
1194
+ className: exact,
1195
+ children: "Example"
1196
+ });
1197
+ $[45] = exact;
1198
+ $[46] = t5;
1199
+ } else t5 = $[46];
1200
+ sample = t5;
1201
+ }
1202
+ }
1203
+ if (slot === "input.sideCva") {
1204
+ let t5;
1205
+ if ($[47] !== disabled || $[48] !== props || $[49] !== text) {
1206
+ t5 = /* @__PURE__ */ jsx(TextArea, {
1207
+ ...props,
1208
+ as: "floating",
1209
+ label: "Example text area",
1210
+ value: text,
1211
+ onChange: setText,
1212
+ isDisabled: disabled
1213
+ });
1214
+ $[47] = disabled;
1215
+ $[48] = props;
1216
+ $[49] = text;
1217
+ $[50] = t5;
1218
+ } else t5 = $[50];
1219
+ sample = t5;
1220
+ }
1221
+ t2 = "cva-preview";
1222
+ t3 = slot;
1223
+ let t5;
1224
+ if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
1225
+ t5 = /([a-z])([A-Z])/g;
1226
+ $[51] = t5;
1227
+ } else t5 = $[51];
1228
+ t1 = component.replace(t5, "$1 $2");
1229
+ $[0] = disabled;
1230
+ $[1] = overrides;
1231
+ $[2] = selected;
1232
+ $[3] = slot;
1233
+ $[4] = text;
1234
+ $[5] = variants;
1235
+ $[6] = component;
1236
+ $[7] = definition;
1237
+ $[8] = sample;
1238
+ $[9] = t1;
1239
+ $[10] = t2;
1240
+ $[11] = t3;
1241
+ } else {
1242
+ component = $[6];
1243
+ definition = $[7];
1244
+ sample = $[8];
1245
+ t1 = $[9];
1246
+ t2 = $[10];
1247
+ t3 = $[11];
1248
+ }
1249
+ let t4;
1250
+ if ($[52] !== t1) {
1251
+ t4 = /* @__PURE__ */ jsx("h3", { children: t1 });
1252
+ $[52] = t1;
1253
+ $[53] = t4;
1254
+ } else t4 = $[53];
1255
+ let t5;
1256
+ if ($[54] !== definition?.config.variants) {
1257
+ t5 = Object.entries(definition?.config.variants ?? {});
1258
+ $[54] = definition?.config.variants;
1259
+ $[55] = t5;
1260
+ } else t5 = $[55];
1261
+ let t6;
1262
+ if ($[56] !== setVariants || $[57] !== t5 || $[58] !== variants) {
1263
+ t6 = t5.map((t7) => {
1264
+ const [name_1, options] = t7;
1265
+ return /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("span", { children: name_1 }), /* @__PURE__ */ jsxs("select", {
1266
+ "aria-label": `Preview ${name_1}`,
1267
+ value: variants[name_1] ?? "",
1268
+ onChange: (event_2) => setVariants({
1269
+ ...variants,
1270
+ [name_1]: event_2.target.value
1271
+ }),
1272
+ children: [/* @__PURE__ */ jsx("option", {
1273
+ value: "",
1274
+ children: "Default"
1275
+ }), Object.keys(options).map(_temp4$1)]
1276
+ })] }, name_1);
1277
+ });
1278
+ $[56] = setVariants;
1279
+ $[57] = t5;
1280
+ $[58] = variants;
1281
+ $[59] = t6;
1282
+ } else t6 = $[59];
1283
+ let t7;
1284
+ if ($[60] !== component || $[61] !== disabled) {
1285
+ t7 = [
1286
+ "button",
1287
+ "badgeButton",
1288
+ "input",
1289
+ "label",
1290
+ "formField",
1291
+ "tooltipWrapper",
1292
+ "checkbox",
1293
+ "switch",
1294
+ "tag",
1295
+ "radio",
1296
+ "textArea",
1297
+ "dropdownMenu",
1298
+ "toggleGroup",
1299
+ "accordion"
1300
+ ].includes(component) && /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("span", { children: "Disabled" }), /* @__PURE__ */ jsx("input", {
1301
+ type: "checkbox",
1302
+ checked: disabled,
1303
+ onChange: (event_3) => setDisabled(event_3.target.checked)
1304
+ })] });
1305
+ $[60] = component;
1306
+ $[61] = disabled;
1307
+ $[62] = t7;
1308
+ } else t7 = $[62];
1309
+ let t8;
1310
+ if ($[63] !== component || $[64] !== selected) {
1311
+ t8 = [
1312
+ "checkbox",
1313
+ "switch",
1314
+ "radio",
1315
+ "table"
1316
+ ].includes(component) && /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("span", { children: "Selected" }), /* @__PURE__ */ jsx("input", {
1317
+ type: "checkbox",
1318
+ checked: selected,
1319
+ onChange: (event_4) => setSelected(event_4.target.checked)
1320
+ })] });
1321
+ $[63] = component;
1322
+ $[64] = selected;
1323
+ $[65] = t8;
1324
+ } else t8 = $[65];
1325
+ let t9;
1326
+ if ($[66] !== t6 || $[67] !== t7 || $[68] !== t8) {
1327
+ t9 = /* @__PURE__ */ jsxs("div", {
1328
+ className: "studio-preview-controls",
1329
+ children: [
1330
+ t6,
1331
+ t7,
1332
+ t8
1333
+ ]
1334
+ });
1335
+ $[66] = t6;
1336
+ $[67] = t7;
1337
+ $[68] = t8;
1338
+ $[69] = t9;
1339
+ } else t9 = $[69];
1340
+ let t10;
1341
+ if ($[70] !== sample) {
1342
+ t10 = /* @__PURE__ */ jsx("div", {
1343
+ className: "studio-cva-stage",
1344
+ "data-testid": "cva-preview-stage",
1345
+ children: sample
1346
+ });
1347
+ $[70] = sample;
1348
+ $[71] = t10;
1349
+ } else t10 = $[71];
1350
+ let t11;
1351
+ if ($[72] !== slot) {
1352
+ let t12;
1353
+ if ($[74] === Symbol.for("react.memo_cache_sentinel")) {
1354
+ t12 = /Cva$/;
1355
+ $[74] = t12;
1356
+ } else t12 = $[74];
1357
+ t11 = slot.split(".")[1].replace(t12, "");
1358
+ $[72] = slot;
1359
+ $[73] = t11;
1360
+ } else t11 = $[73];
1361
+ let t12;
1362
+ if ($[75] !== t11) {
1363
+ t12 = /* @__PURE__ */ jsxs("div", {
1364
+ className: "studio-preview-caption",
1365
+ children: [t11, " · Preview controls don’t change your configuration."]
1366
+ });
1367
+ $[75] = t11;
1368
+ $[76] = t12;
1369
+ } else t12 = $[76];
1370
+ let t13;
1371
+ if ($[77] !== t10 || $[78] !== t12 || $[79] !== t2 || $[80] !== t3 || $[81] !== t4 || $[82] !== t9) {
1372
+ t13 = /* @__PURE__ */ jsxs("div", {
1373
+ "data-testid": t2,
1374
+ "data-slot": t3,
1375
+ children: [
1376
+ t4,
1377
+ t9,
1378
+ t10,
1379
+ t12
1380
+ ]
1381
+ });
1382
+ $[77] = t10;
1383
+ $[78] = t12;
1384
+ $[79] = t2;
1385
+ $[80] = t3;
1386
+ $[81] = t4;
1387
+ $[82] = t9;
1388
+ $[83] = t13;
1389
+ } else t13 = $[83];
1390
+ return t13;
1391
+ }
1392
+ function _temp4$1(value_2) {
1393
+ return /* @__PURE__ */ jsx("option", { children: value_2 }, value_2);
1394
+ }
1395
+ function _temp3$1(event_1) {
1396
+ return event_1.preventDefault();
1397
+ }
1398
+ function _temp2$1(t0) {
1399
+ const [name, value_0] = t0;
1400
+ return [name, value_0 === "true" ? true : value_0 === "false" ? false : value_0];
1401
+ }
1402
+ function _temp$4(t0) {
1403
+ const [, value] = t0;
1404
+ return value !== "";
1405
+ }
1406
+ function ContextualPreview(t0) {
1407
+ const $ = c(18);
1408
+ const { section, slot, mode, entries, variants, setVariants } = t0;
1409
+ const { defaults, draft } = useUIConfiguration();
1410
+ let t1;
1411
+ if ($[0] !== defaults || $[1] !== draft.theme || $[2] !== mode) {
1412
+ t1 = previewTokens(defaults, draft.theme, mode);
1413
+ $[0] = defaults;
1414
+ $[1] = draft.theme;
1415
+ $[2] = mode;
1416
+ $[3] = t1;
1417
+ } else t1 = $[3];
1418
+ const tokens = t1;
1419
+ let t2;
1420
+ if ($[4] !== defaults || $[5] !== entries || $[6] !== section) {
1421
+ t2 = section === "Typography" ? [...new Map(entries.map((t3) => {
1422
+ const [name, original] = t3;
1423
+ const base = name.replace(/--(?:line-height|letter-spacing)$/, "");
1424
+ return [base, [base, defaults.theme[base] ?? original]];
1425
+ })).values()] : entries;
1426
+ $[4] = defaults;
1427
+ $[5] = entries;
1428
+ $[6] = section;
1429
+ $[7] = t2;
1430
+ } else t2 = $[7];
1431
+ const samples = t2;
1432
+ const t3 = `studio-context-preview ${mode}`;
1433
+ let t4;
1434
+ if ($[8] !== samples || $[9] !== section || $[10] !== setVariants || $[11] !== slot || $[12] !== variants) {
1435
+ t4 = section === "Variants & overrides" ? /* @__PURE__ */ jsx(CvaPreview, {
1436
+ slot,
1437
+ variants,
1438
+ setVariants
1439
+ }, slot) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("h3", { children: section }), /* @__PURE__ */ jsxs("div", {
1440
+ className: "studio-token-samples",
1441
+ children: [samples.map((t5) => {
1442
+ const [name_0, original_0] = t5;
1443
+ const value = `var(${name_0})`;
1444
+ let style;
1445
+ let content = "";
1446
+ if (section === "Colors") style = {
1447
+ background: name_0.endsWith("-base") && (/^\d+\s+\d+\s+\d+$/.test(original_0) || original_0.startsWith("var(")) ? `rgb(${value})` : value,
1448
+ height: 44
1449
+ };
1450
+ else if (section === "Typography") {
1451
+ style = name_0.startsWith("--text-") ? {
1452
+ fontSize: value,
1453
+ lineHeight: `var(${name_0}--line-height, 1.4)`,
1454
+ letterSpacing: `var(${name_0}--letter-spacing, normal)`
1455
+ } : name_0.startsWith("--font-weight-") ? { fontWeight: value } : name_0.startsWith("--font-") ? { fontFamily: value } : { letterSpacing: value };
1456
+ content = "The quick brown fox";
1457
+ } else if (section === "Radius") style = {
1458
+ borderRadius: value,
1459
+ height: 56,
1460
+ background: "rgb(var(--interactive-primary-background-base))"
1461
+ };
1462
+ else if (section === "Effects") {
1463
+ style = {
1464
+ height: 56,
1465
+ background: "rgb(var(--surface-default-card-base))",
1466
+ ...name_0.startsWith("--blur-") ? { filter: `blur(${value})` } : { boxShadow: value }
1467
+ };
1468
+ content = "Aa";
1469
+ } else style = {
1470
+ width: value,
1471
+ maxWidth: "100%",
1472
+ minWidth: 1,
1473
+ height: 20,
1474
+ background: "rgb(var(--interactive-primary-background-base))"
1475
+ };
1476
+ return /* @__PURE__ */ jsxs("div", {
1477
+ className: "studio-token-sample",
1478
+ children: [/* @__PURE__ */ jsx("span", { children: labelFor(name_0) }), /* @__PURE__ */ jsx("div", {
1479
+ className: "studio-token-specimen",
1480
+ style,
1481
+ children: content
1482
+ })]
1483
+ }, name_0);
1484
+ }), !samples.length && /* @__PURE__ */ jsx("div", { children: "No matching tokens." })]
1485
+ })] });
1486
+ $[8] = samples;
1487
+ $[9] = section;
1488
+ $[10] = setVariants;
1489
+ $[11] = slot;
1490
+ $[12] = variants;
1491
+ $[13] = t4;
1492
+ } else t4 = $[13];
1493
+ let t5;
1494
+ if ($[14] !== t3 || $[15] !== t4 || $[16] !== tokens) {
1495
+ t5 = /* @__PURE__ */ jsx("div", {
1496
+ className: t3,
1497
+ style: tokens,
1498
+ "data-testid": "component-preview",
1499
+ children: t4
1500
+ });
1501
+ $[14] = t3;
1502
+ $[15] = t4;
1503
+ $[16] = tokens;
1504
+ $[17] = t5;
1505
+ } else t5 = $[17];
1506
+ return t5;
1507
+ }
1508
+ //#endregion
1509
+ //#region src/configurator/CvaEditor.tsx
1510
+ const title = (value) => value.replace(/Cva$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/^cva$/, "Appearance");
1511
+ function ClassField(t0) {
1512
+ const $ = c(18);
1513
+ const { label, value, onCommit, onFocus } = t0;
1514
+ const [text, setText] = useState(value);
1515
+ let t1;
1516
+ let t2;
1517
+ if ($[0] !== value) {
1518
+ t1 = () => setText(value);
1519
+ t2 = [value];
1520
+ $[0] = value;
1521
+ $[1] = t1;
1522
+ $[2] = t2;
1523
+ } else {
1524
+ t1 = $[1];
1525
+ t2 = $[2];
1526
+ }
1527
+ useEffect(t1, t2);
1528
+ let t3;
1529
+ if ($[3] !== label) {
1530
+ t3 = /* @__PURE__ */ jsx("span", { children: label });
1531
+ $[3] = label;
1532
+ $[4] = t3;
1533
+ } else t3 = $[4];
1534
+ let t4;
1535
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1536
+ t4 = (event) => setText(event.target.value);
1537
+ $[5] = t4;
1538
+ } else t4 = $[5];
1539
+ let t5;
1540
+ if ($[6] !== onCommit || $[7] !== text || $[8] !== value) {
1541
+ t5 = () => {
1542
+ if (text !== value) onCommit(text.trim());
1543
+ };
1544
+ $[6] = onCommit;
1545
+ $[7] = text;
1546
+ $[8] = value;
1547
+ $[9] = t5;
1548
+ } else t5 = $[9];
1549
+ let t6;
1550
+ if ($[10] !== label || $[11] !== onFocus || $[12] !== t5 || $[13] !== text) {
1551
+ t6 = /* @__PURE__ */ jsx("input", {
1552
+ "aria-label": label,
1553
+ value: text,
1554
+ spellCheck: false,
1555
+ onFocus,
1556
+ onChange: t4,
1557
+ onBlur: t5,
1558
+ onKeyDown: _temp$3
1559
+ });
1560
+ $[10] = label;
1561
+ $[11] = onFocus;
1562
+ $[12] = t5;
1563
+ $[13] = text;
1564
+ $[14] = t6;
1565
+ } else t6 = $[14];
1566
+ let t7;
1567
+ if ($[15] !== t3 || $[16] !== t6) {
1568
+ t7 = /* @__PURE__ */ jsxs("label", {
1569
+ className: "studio-cva-field",
1570
+ tabIndex: -1,
1571
+ children: [t3, t6]
1572
+ });
1573
+ $[15] = t3;
1574
+ $[16] = t6;
1575
+ $[17] = t7;
1576
+ } else t7 = $[17];
1577
+ return t7;
1578
+ }
1579
+ function _temp$3(event_0) {
1580
+ if (event_0.key === "Enter" && !event_0.nativeEvent.isComposing) {
1581
+ event_0.preventDefault();
1582
+ event_0.currentTarget.parentElement?.focus();
1583
+ }
1584
+ }
1585
+ function CvaEditor(t0) {
1586
+ const $ = c(69);
1587
+ const { slot, setSlot, onPreview } = t0;
1588
+ const { draft, setDraft, inheritedOverrides } = useUIConfiguration();
1589
+ let t1;
1590
+ if ($[0] !== slot) {
1591
+ t1 = slot.split(".");
1592
+ $[0] = slot;
1593
+ $[1] = t1;
1594
+ } else t1 = $[1];
1595
+ const component = t1[0];
1596
+ let definition;
1597
+ let original;
1598
+ let slots;
1599
+ let t2;
1600
+ let t3;
1601
+ let t4;
1602
+ let t5;
1603
+ let t6;
1604
+ let t7;
1605
+ let t8;
1606
+ let t9;
1607
+ let update;
1608
+ if ($[2] !== component || $[3] !== draft.overrides || $[4] !== inheritedOverrides || $[5] !== setDraft || $[6] !== setSlot || $[7] !== slot) {
1609
+ slots = Object.keys(cvaDefinitions);
1610
+ const components = [...new Set(slots.map(_temp2))];
1611
+ let t10;
1612
+ if ($[20] !== inheritedOverrides || $[21] !== slot) {
1613
+ t10 = resolveCvaDefinition(slot, inheritedOverrides);
1614
+ $[20] = inheritedOverrides;
1615
+ $[21] = slot;
1616
+ $[22] = t10;
1617
+ } else t10 = $[22];
1618
+ original = t10;
1619
+ definition = draft.overrides?.[slot] ?? original;
1620
+ let t11;
1621
+ if ($[23] !== definition || $[24] !== setDraft || $[25] !== slot) {
1622
+ t11 = (change) => {
1623
+ if (!definition) return;
1624
+ const next = structuredClone(definition);
1625
+ change(next);
1626
+ setDraft((current) => ({
1627
+ ...current,
1628
+ overrides: {
1629
+ ...current.overrides,
1630
+ [slot]: next
1631
+ }
1632
+ }));
1633
+ };
1634
+ $[23] = definition;
1635
+ $[24] = setDraft;
1636
+ $[25] = slot;
1637
+ $[26] = t11;
1638
+ } else t11 = $[26];
1639
+ update = t11;
1640
+ t9 = "studio-cva-editor";
1641
+ t8 = "studio-settings";
1642
+ t6 = "studio-setting";
1643
+ if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
1644
+ t7 = /* @__PURE__ */ jsx("span", { children: "Component" });
1645
+ $[27] = t7;
1646
+ } else t7 = $[27];
1647
+ t2 = "CVA component";
1648
+ t3 = component;
1649
+ t4 = (event) => {
1650
+ const next_0 = event.target.value;
1651
+ setSlot(slots.find((key_0) => key_0.startsWith(`${next_0}.`)));
1652
+ };
1653
+ t5 = components.map(_temp3);
1654
+ $[2] = component;
1655
+ $[3] = draft.overrides;
1656
+ $[4] = inheritedOverrides;
1657
+ $[5] = setDraft;
1658
+ $[6] = setSlot;
1659
+ $[7] = slot;
1660
+ $[8] = definition;
1661
+ $[9] = original;
1662
+ $[10] = slots;
1663
+ $[11] = t2;
1664
+ $[12] = t3;
1665
+ $[13] = t4;
1666
+ $[14] = t5;
1667
+ $[15] = t6;
1668
+ $[16] = t7;
1669
+ $[17] = t8;
1670
+ $[18] = t9;
1671
+ $[19] = update;
1672
+ } else {
1673
+ definition = $[8];
1674
+ original = $[9];
1675
+ slots = $[10];
1676
+ t2 = $[11];
1677
+ t3 = $[12];
1678
+ t4 = $[13];
1679
+ t5 = $[14];
1680
+ t6 = $[15];
1681
+ t7 = $[16];
1682
+ t8 = $[17];
1683
+ t9 = $[18];
1684
+ update = $[19];
1685
+ }
1686
+ let t10;
1687
+ if ($[28] !== t2 || $[29] !== t3 || $[30] !== t4 || $[31] !== t5) {
1688
+ t10 = /* @__PURE__ */ jsx("select", {
1689
+ "aria-label": t2,
1690
+ value: t3,
1691
+ onChange: t4,
1692
+ children: t5
1693
+ });
1694
+ $[28] = t2;
1695
+ $[29] = t3;
1696
+ $[30] = t4;
1697
+ $[31] = t5;
1698
+ $[32] = t10;
1699
+ } else t10 = $[32];
1700
+ let t11;
1701
+ if ($[33] !== t10 || $[34] !== t6 || $[35] !== t7) {
1702
+ t11 = /* @__PURE__ */ jsxs("label", {
1703
+ className: t6,
1704
+ children: [t7, t10]
1705
+ });
1706
+ $[33] = t10;
1707
+ $[34] = t6;
1708
+ $[35] = t7;
1709
+ $[36] = t11;
1710
+ } else t11 = $[36];
1711
+ let t12;
1712
+ if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
1713
+ t12 = /* @__PURE__ */ jsx("span", { children: "Slot" });
1714
+ $[37] = t12;
1715
+ } else t12 = $[37];
1716
+ let t13;
1717
+ if ($[38] !== setSlot) {
1718
+ t13 = (event_0) => setSlot(event_0.target.value);
1719
+ $[38] = setSlot;
1720
+ $[39] = t13;
1721
+ } else t13 = $[39];
1722
+ let t14;
1723
+ if ($[40] !== component || $[41] !== slots) {
1724
+ t14 = slots.filter((key_1) => key_1.startsWith(`${component}.`)).map(_temp4);
1725
+ $[40] = component;
1726
+ $[41] = slots;
1727
+ $[42] = t14;
1728
+ } else t14 = $[42];
1729
+ let t15;
1730
+ if ($[43] !== slot || $[44] !== t13 || $[45] !== t14) {
1731
+ t15 = /* @__PURE__ */ jsxs("label", {
1732
+ className: "studio-setting",
1733
+ children: [t12, /* @__PURE__ */ jsx("select", {
1734
+ "aria-label": "CVA slot",
1735
+ value: slot,
1736
+ onChange: t13,
1737
+ children: t14
1738
+ })]
1739
+ });
1740
+ $[43] = slot;
1741
+ $[44] = t13;
1742
+ $[45] = t14;
1743
+ $[46] = t15;
1744
+ } else t15 = $[46];
1745
+ let t16;
1746
+ if ($[47] !== t11 || $[48] !== t15 || $[49] !== t8) {
1747
+ t16 = /* @__PURE__ */ jsxs("div", {
1748
+ className: t8,
1749
+ children: [t11, t15]
1750
+ });
1751
+ $[47] = t11;
1752
+ $[48] = t15;
1753
+ $[49] = t8;
1754
+ $[50] = t16;
1755
+ } else t16 = $[50];
1756
+ let t17;
1757
+ if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
1758
+ t17 = /* @__PURE__ */ jsx("p", {
1759
+ className: "studio-help",
1760
+ children: "Edits replace this slot’s effective definition, including app overrides. Classes must already be compiled by Tailwind to preview live."
1761
+ });
1762
+ $[51] = t17;
1763
+ } else t17 = $[51];
1764
+ let t18;
1765
+ if ($[52] !== definition || $[53] !== onPreview || $[54] !== original || $[55] !== slot || $[56] !== update) {
1766
+ t18 = !original ? /* @__PURE__ */ jsx("p", { children: "This slot uses a function override. Edit it in the application source; it cannot be inspected here." }) : definition && /* @__PURE__ */ jsxs("div", { children: [
1767
+ /* @__PURE__ */ jsx(ClassField, {
1768
+ label: "Base classes",
1769
+ onFocus: () => onPreview({}),
1770
+ value: definition.base.join(" "),
1771
+ onCommit: (value) => update((next_1) => {
1772
+ next_1.base = [value];
1773
+ })
1774
+ }),
1775
+ Object.entries(definition.config.variants).map((t19) => {
1776
+ const [variant, options] = t19;
1777
+ return /* @__PURE__ */ jsxs("fieldset", {
1778
+ className: "studio-token-group",
1779
+ children: [
1780
+ /* @__PURE__ */ jsx("legend", { children: title(variant) }),
1781
+ /* @__PURE__ */ jsxs("label", {
1782
+ className: "studio-setting",
1783
+ children: [/* @__PURE__ */ jsx("span", { children: "Default" }), /* @__PURE__ */ jsxs("select", {
1784
+ "aria-label": `Default ${variant}`,
1785
+ onFocus: () => onPreview({}),
1786
+ value: String(definition.config.defaultVariants[variant] ?? ""),
1787
+ onChange: (event_1) => update((next_2) => {
1788
+ const value_0 = event_1.target.value;
1789
+ next_2.config.defaultVariants[variant] = value_0 === "" ? null : value_0 === "true" ? true : value_0 === "false" ? false : value_0;
1790
+ }),
1791
+ children: [/* @__PURE__ */ jsx("option", {
1792
+ value: "",
1793
+ children: "None"
1794
+ }), Object.keys(options).map(_temp5)]
1795
+ })]
1796
+ }),
1797
+ Object.entries(options).map((t20) => {
1798
+ const [value_2, classes] = t20;
1799
+ return /* @__PURE__ */ jsx(ClassField, {
1800
+ label: `${variant}: ${value_2}`,
1801
+ onFocus: () => onPreview({ [variant]: value_2 }),
1802
+ value: classes,
1803
+ onCommit: (classes_0) => update((next_3) => {
1804
+ next_3.config.variants[variant][value_2] = classes_0;
1805
+ })
1806
+ }, value_2);
1807
+ })
1808
+ ]
1809
+ }, variant);
1810
+ }),
1811
+ definition.config.compoundVariants.length > 0 && /* @__PURE__ */ jsxs("fieldset", {
1812
+ className: "studio-token-group",
1813
+ children: [/* @__PURE__ */ jsx("legend", { children: "Compound variants" }), definition.config.compoundVariants.map((entry, index) => /* @__PURE__ */ jsx(ClassField, {
1814
+ label: Object.entries(entry).filter(_temp7).map(_temp8).join(", "),
1815
+ value: String(entry.className ?? ""),
1816
+ onFocus: () => onPreview(Object.fromEntries(Object.entries(entry).filter(_temp9).map(_temp0))),
1817
+ onCommit: (classes_1) => update((next_4) => {
1818
+ next_4.config.compoundVariants[index].className = classes_1;
1819
+ })
1820
+ }, JSON.stringify(Object.entries(entry).filter(_temp6))))]
1821
+ })
1822
+ ] }, slot);
1823
+ $[52] = definition;
1824
+ $[53] = onPreview;
1825
+ $[54] = original;
1826
+ $[55] = slot;
1827
+ $[56] = update;
1828
+ $[57] = t18;
1829
+ } else t18 = $[57];
1830
+ const t19 = !draft.overrides?.[slot];
1831
+ let t20;
1832
+ if ($[58] !== setDraft || $[59] !== slot) {
1833
+ t20 = () => setDraft((current_0) => {
1834
+ const overrides = { ...current_0.overrides };
1835
+ delete overrides[slot];
1836
+ return {
1837
+ ...current_0,
1838
+ overrides
1839
+ };
1840
+ });
1841
+ $[58] = setDraft;
1842
+ $[59] = slot;
1843
+ $[60] = t20;
1844
+ } else t20 = $[60];
1845
+ let t21;
1846
+ if ($[61] !== t19 || $[62] !== t20) {
1847
+ t21 = /* @__PURE__ */ jsx("button", {
1848
+ className: "studio-cva-reset",
1849
+ disabled: t19,
1850
+ onClick: t20,
1851
+ children: "Reset slot"
1852
+ });
1853
+ $[61] = t19;
1854
+ $[62] = t20;
1855
+ $[63] = t21;
1856
+ } else t21 = $[63];
1857
+ let t22;
1858
+ if ($[64] !== t16 || $[65] !== t18 || $[66] !== t21 || $[67] !== t9) {
1859
+ t22 = /* @__PURE__ */ jsxs("div", {
1860
+ className: t9,
1861
+ children: [
1862
+ t16,
1863
+ t17,
1864
+ t18,
1865
+ t21
1866
+ ]
1867
+ });
1868
+ $[64] = t16;
1869
+ $[65] = t18;
1870
+ $[66] = t21;
1871
+ $[67] = t9;
1872
+ $[68] = t22;
1873
+ } else t22 = $[68];
1874
+ return t22;
1875
+ }
1876
+ function _temp0(t0) {
1877
+ const [key_7, value_4] = t0;
1878
+ return [key_7, String(Array.isArray(value_4) ? value_4[0] : value_4)];
1879
+ }
1880
+ function _temp9(t0) {
1881
+ const [key_6] = t0;
1882
+ return key_6 !== "className";
1883
+ }
1884
+ function _temp8(t0) {
1885
+ const [key_5, value_3] = t0;
1886
+ return `${key_5}: ${Array.isArray(value_3) ? value_3.join(" / ") : value_3}`;
1887
+ }
1888
+ function _temp7(t0) {
1889
+ const [key_4] = t0;
1890
+ return key_4 !== "className";
1891
+ }
1892
+ function _temp6(t0) {
1893
+ const [key_3] = t0;
1894
+ return key_3 !== "className";
1895
+ }
1896
+ function _temp5(value_1) {
1897
+ return /* @__PURE__ */ jsx("option", {
1898
+ value: value_1,
1899
+ children: value_1
1900
+ }, value_1);
1901
+ }
1902
+ function _temp4(key_2) {
1903
+ return /* @__PURE__ */ jsx("option", {
1904
+ value: key_2,
1905
+ children: title(key_2.split(".")[1])
1906
+ }, key_2);
1907
+ }
1908
+ function _temp3(name) {
1909
+ return /* @__PURE__ */ jsx("option", {
1910
+ value: name,
1911
+ children: title(name)
1912
+ }, name);
1913
+ }
1914
+ function _temp2(key) {
1915
+ return key.split(".")[0];
1916
+ }
1917
+ //#endregion
1918
+ //#region src/configurator/theme-writer-protocol.ts
1919
+ /** Shared by the browser configurator and the isolated Node Vite entry. */
1920
+ const themeWriterMetaName = "povio-ui-theme-writer";
1921
+ const themeWriterTokenHeader = "x-povio-ui-theme-token";
1922
+ //#endregion
1923
+ //#region src/configurator/theme-writer-client.ts
1924
+ function getThemeWriter() {
1925
+ if (typeof document === "undefined") return null;
1926
+ const content = document.querySelector(`meta[name="${themeWriterMetaName}"]`)?.content;
1927
+ if (!content) return null;
1928
+ try {
1929
+ const connection = JSON.parse(content);
1930
+ if (typeof connection.endpoint === "string" && connection.endpoint.startsWith("/") && !connection.endpoint.startsWith("//") && typeof connection.token === "string" && typeof connection.file === "string") return connection;
1931
+ } catch {}
1932
+ return null;
1933
+ }
1934
+ async function saveThemeCss(connection, css) {
1935
+ const response = await fetch(connection.endpoint, {
1936
+ method: "POST",
1937
+ headers: {
1938
+ "Content-Type": "application/json",
1939
+ [themeWriterTokenHeader]: connection.token
1940
+ },
1941
+ body: JSON.stringify({ css })
1942
+ });
1943
+ if (!response.ok) {
1944
+ const result = await response.json().catch(() => null);
1945
+ throw new Error(result?.error ?? `Theme save failed (${response.status}).`);
1946
+ }
1947
+ }
1948
+ //#endregion
1949
+ //#region src/configurator/ColorModeSwitch.tsx
1950
+ /** Controlled color-mode switch, shared by configurators and application settings. */
1951
+ function ColorModeSwitch(t0) {
1952
+ const $ = c(7);
1953
+ const { value, onChange, label: t1 } = t0;
1954
+ const label = t1 === void 0 ? "Color mode" : t1;
1955
+ let t2;
1956
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1957
+ t2 = ["light", "dark"];
1958
+ $[0] = t2;
1959
+ } else t2 = $[0];
1960
+ let t3;
1961
+ if ($[1] !== onChange || $[2] !== value) {
1962
+ t3 = t2.map((mode) => /* @__PURE__ */ jsxs("button", {
1963
+ type: "button",
1964
+ "aria-pressed": value === mode,
1965
+ onClick: () => onChange(mode),
1966
+ children: [mode === "light" ? /* @__PURE__ */ jsx(Sun, {
1967
+ size: 14,
1968
+ "aria-hidden": "true"
1969
+ }) : /* @__PURE__ */ jsx(Moon, {
1970
+ size: 14,
1971
+ "aria-hidden": "true"
1972
+ }), mode]
1973
+ }, mode));
1974
+ $[1] = onChange;
1975
+ $[2] = value;
1976
+ $[3] = t3;
1977
+ } else t3 = $[3];
1978
+ let t4;
1979
+ if ($[4] !== label || $[5] !== t3) {
1980
+ t4 = /* @__PURE__ */ jsx("div", {
1981
+ className: "studio-mode studio-color-mode",
1982
+ role: "group",
1983
+ "aria-label": label,
1984
+ children: t3
1985
+ });
1986
+ $[4] = label;
1987
+ $[5] = t3;
1988
+ $[6] = t4;
1989
+ } else t4 = $[6];
1990
+ return t4;
1991
+ }
1992
+ //#endregion
1993
+ //#region src/configurator/AlphaColorField.tsx
1994
+ /** Whether a token value is an 8-digit hex color with an alpha channel, e.g. `#00000066`. */
1995
+ const isAlphaHex = (value) => /^#[0-9a-f]{8}$/i.test(value.trim());
1996
+ const toPercent = (alpha) => Math.round(parseInt(alpha, 16) / 255 * 100);
1997
+ const toAlpha = (percent) => Math.round(Math.min(Math.max(percent, 0), 100) / 100 * 255).toString(16).padStart(2, "0");
1998
+ /**
1999
+ * Edits a translucent color the way Figma shows it: a half solid, half checkerboard swatch, the hex color and its
2000
+ * opacity as a percentage. The value is kept as an 8-digit hex so exports are unchanged.
2001
+ */
2002
+ function AlphaColorField(t0) {
2003
+ const $ = c(23);
2004
+ const { name, label, value, onChange } = t0;
2005
+ const color = value.trim().slice(1, 7);
2006
+ const alpha = value.trim().slice(7, 9);
2007
+ const [hexText, setHexText] = useState(null);
2008
+ const [percentText, setPercentText] = useState(null);
2009
+ const commitHex = () => {
2010
+ if (hexText === null) return;
2011
+ const entered = hexText.trim().replace(/^#/, "");
2012
+ setHexText(null);
2013
+ const hex = /^[0-9a-f]{3}$/i.test(entered) ? entered.replace(/./g, "$&$&") : entered;
2014
+ if (/^[0-9a-f]{6}$/i.test(hex)) onChange(`#${hex.toLowerCase()}${alpha}`);
2015
+ };
2016
+ const commitPercent = () => {
2017
+ if (percentText === null) return;
2018
+ const entered_0 = Number.parseFloat(percentText.replace("%", ""));
2019
+ setPercentText(null);
2020
+ if (Number.isFinite(entered_0)) onChange(`#${color}${toAlpha(entered_0)}`);
2021
+ };
2022
+ const blurOnEnter = _temp$2;
2023
+ const t1 = `#${color}`;
2024
+ let t2;
2025
+ if ($[0] !== t1 || $[1] !== value) {
2026
+ t2 = {
2027
+ "--swatch-solid": t1,
2028
+ "--swatch-color": value
2029
+ };
2030
+ $[0] = t1;
2031
+ $[1] = value;
2032
+ $[2] = t2;
2033
+ } else t2 = $[2];
2034
+ const t3 = `token-${name}`;
2035
+ const t4 = `${label} color`;
2036
+ const t5 = hexText ?? `#${color.toUpperCase()}`;
2037
+ let t6;
2038
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
2039
+ t6 = (event_1) => setHexText(event_1.target.value);
2040
+ $[3] = t6;
2041
+ } else t6 = $[3];
2042
+ let t7;
2043
+ if ($[4] !== blurOnEnter || $[5] !== commitHex || $[6] !== t3 || $[7] !== t4 || $[8] !== t5) {
2044
+ t7 = /* @__PURE__ */ jsx("input", {
2045
+ id: t3,
2046
+ className: "studio-alpha-hex",
2047
+ "aria-label": t4,
2048
+ value: t5,
2049
+ spellCheck: false,
2050
+ onChange: t6,
2051
+ onBlur: commitHex,
2052
+ onKeyDown: blurOnEnter
2053
+ });
2054
+ $[4] = blurOnEnter;
2055
+ $[5] = commitHex;
2056
+ $[6] = t3;
2057
+ $[7] = t4;
2058
+ $[8] = t5;
2059
+ $[9] = t7;
2060
+ } else t7 = $[9];
2061
+ const t8 = "studio-alpha-opacity";
2062
+ const t9 = `${label} opacity`;
2063
+ const t10 = "numeric";
2064
+ const t11 = percentText ?? `${toPercent(alpha)}%`;
2065
+ let t12;
2066
+ if ($[10] !== setPercentText) {
2067
+ t12 = (event_2) => setPercentText(event_2.target.value);
2068
+ $[10] = setPercentText;
2069
+ $[11] = t12;
2070
+ } else t12 = $[11];
2071
+ let t13;
2072
+ if ($[12] !== alpha || $[13] !== blurOnEnter || $[14] !== color || $[15] !== onChange) {
2073
+ t13 = (event_3) => {
2074
+ const step = event_3.key === "ArrowUp" ? 1 : event_3.key === "ArrowDown" ? -1 : 0;
2075
+ if (step) {
2076
+ event_3.preventDefault();
2077
+ onChange(`#${color}${toAlpha(toPercent(alpha) + step * (event_3.shiftKey ? 10 : 1))}`);
2078
+ } else blurOnEnter(event_3);
2079
+ };
2080
+ $[12] = alpha;
2081
+ $[13] = blurOnEnter;
2082
+ $[14] = color;
2083
+ $[15] = onChange;
2084
+ $[16] = t13;
2085
+ } else t13 = $[16];
2086
+ let t14;
2087
+ if ($[17] !== commitPercent || $[18] !== t11 || $[19] !== t12 || $[20] !== t13 || $[21] !== t9) {
2088
+ t14 = /* @__PURE__ */ jsx("span", {
2089
+ className: t8,
2090
+ children: /* @__PURE__ */ jsx("input", {
2091
+ "aria-label": t9,
2092
+ inputMode: t10,
2093
+ value: t11,
2094
+ onChange: t12,
2095
+ onBlur: commitPercent,
2096
+ onKeyDown: t13
2097
+ })
2098
+ });
2099
+ $[17] = commitPercent;
2100
+ $[18] = t11;
2101
+ $[19] = t12;
2102
+ $[20] = t13;
2103
+ $[21] = t9;
2104
+ $[22] = t14;
2105
+ } else t14 = $[22];
2106
+ return /* @__PURE__ */ jsxs("div", {
2107
+ className: "studio-alpha-color",
2108
+ children: [
2109
+ /* @__PURE__ */ jsx("span", {
2110
+ className: "studio-alpha-swatch",
2111
+ style: t2,
2112
+ children: /* @__PURE__ */ jsx("input", {
2113
+ type: "color",
2114
+ "aria-label": `Pick ${label}`,
2115
+ value: `#${color}`,
2116
+ onChange: (event_0) => onChange(`${event_0.target.value}${alpha}`)
2117
+ })
2118
+ }),
2119
+ t7,
2120
+ t14
2121
+ ]
2122
+ });
2123
+ }
2124
+ function _temp$2(event) {
2125
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) event.currentTarget.blur();
2126
+ }
2127
+ //#endregion
2128
+ //#region src/configurator/PaletteSelect.tsx
2129
+ const customPaletteKey = "custom";
2130
+ /** Groups `--primary-800-base` style tokens by palette, darkest step first, as a design tool's swatch list does. */
2131
+ function paletteFamilies(options) {
2132
+ const families = /* @__PURE__ */ new Map();
2133
+ for (const option of options) {
2134
+ const [, family = option.name, step = "0"] = option.name.match(/^--(.+)-(\d+)-base$/) ?? [];
2135
+ if (!families.has(family)) families.set(family, []);
2136
+ families.get(family).push({
2137
+ step: Number(step),
2138
+ option
2139
+ });
2140
+ }
2141
+ return [...families].map(([family, steps]) => ({
2142
+ family,
2143
+ steps: steps.sort((a, b) => b.step - a.step)
2144
+ }));
2145
+ }
2146
+ /** Centres the selected color when the list opens; the list is its own scroll container. */
2147
+ function scrollSelectedIntoView(list) {
2148
+ if (!list) return;
2149
+ requestAnimationFrame(() => {
2150
+ const item = list.querySelector("[data-selected]");
2151
+ if (item) list.scrollTop = item.offsetTop - (list.clientHeight - item.offsetHeight) / 2;
2152
+ });
2153
+ }
2154
+ /** Picks a base palette color for a semantic token, showing each option's swatch, step and hex value. */
2155
+ function PaletteSelect(t0) {
2156
+ const $ = c(28);
2157
+ const { id, label, options, selected, onSelect } = t0;
2158
+ let current;
2159
+ let t1;
2160
+ if ($[0] !== options || $[1] !== selected) {
2161
+ let t2;
2162
+ if ($[4] !== selected) {
2163
+ t2 = (option) => option.name === selected;
2164
+ $[4] = selected;
2165
+ $[5] = t2;
2166
+ } else t2 = $[5];
2167
+ current = options.find(t2);
2168
+ t1 = current?.name.match(/^--(.+)-(\d+)-base$/) ?? [];
2169
+ $[0] = options;
2170
+ $[1] = selected;
2171
+ $[2] = current;
2172
+ $[3] = t1;
2173
+ } else {
2174
+ current = $[2];
2175
+ t1 = $[3];
2176
+ }
2177
+ const [, family, step] = t1;
2178
+ const t2 = `studio-palette-picker ${current ? "" : "is-custom"}`;
2179
+ let t3;
2180
+ if ($[6] !== onSelect) {
2181
+ t3 = (key) => key !== null && onSelect(String(key));
2182
+ $[6] = onSelect;
2183
+ $[7] = t3;
2184
+ } else t3 = $[7];
2185
+ let t4;
2186
+ if ($[8] !== current || $[9] !== family || $[10] !== step) {
2187
+ t4 = current && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
2188
+ className: "studio-palette-swatch",
2189
+ style: { backgroundColor: `rgb(${current.value})` },
2190
+ "aria-hidden": "true"
2191
+ }), /* @__PURE__ */ jsxs("span", {
2192
+ className: "studio-palette-trigger-label",
2193
+ children: [
2194
+ family,
2195
+ " ",
2196
+ step
2197
+ ]
2198
+ })] });
2199
+ $[8] = current;
2200
+ $[9] = family;
2201
+ $[10] = step;
2202
+ $[11] = t4;
2203
+ } else t4 = $[11];
2204
+ let t5;
2205
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
2206
+ t5 = /* @__PURE__ */ jsx(ChevronDown, {
2207
+ size: 13,
2208
+ "aria-hidden": "true"
2209
+ });
2210
+ $[12] = t5;
2211
+ } else t5 = $[12];
2212
+ let t6;
2213
+ if ($[13] !== t4) {
2214
+ t6 = /* @__PURE__ */ jsxs($7705c033048f6da7$export$353f5b6fc5456de1, {
2215
+ className: "studio-palette-trigger",
2216
+ children: [t4, t5]
2217
+ });
2218
+ $[13] = t4;
2219
+ $[14] = t6;
2220
+ } else t6 = $[14];
2221
+ let t7;
2222
+ if ($[15] !== options) {
2223
+ t7 = paletteFamilies(options).map(_temp$1);
2224
+ $[15] = options;
2225
+ $[16] = t7;
2226
+ } else t7 = $[16];
2227
+ let t8;
2228
+ if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
2229
+ t8 = /* @__PURE__ */ jsx($928221da08ecbc62$export$dca12b0bb56e4fc, {
2230
+ id: "other",
2231
+ children: /* @__PURE__ */ jsx($928221da08ecbc62$export$a11e76429ed99b4, {
2232
+ id: customPaletteKey,
2233
+ className: "studio-palette-item is-custom",
2234
+ children: "Custom value…"
2235
+ })
2236
+ });
2237
+ $[17] = t8;
2238
+ } else t8 = $[17];
2239
+ let t9;
2240
+ if ($[18] !== t7) {
2241
+ t9 = /* @__PURE__ */ jsx($542a13ca2fa5b484$export$5b6b19405a83ff9d, {
2242
+ className: "studio-palette-popover",
2243
+ placement: "bottom end",
2244
+ children: /* @__PURE__ */ jsxs($928221da08ecbc62$export$41f133550aa26f48, {
2245
+ className: "studio-palette-list",
2246
+ ref: scrollSelectedIntoView,
2247
+ children: [t7, t8]
2248
+ })
2249
+ });
2250
+ $[18] = t7;
2251
+ $[19] = t9;
2252
+ } else t9 = $[19];
2253
+ let t10;
2254
+ if ($[20] !== id || $[21] !== label || $[22] !== selected || $[23] !== t2 || $[24] !== t3 || $[25] !== t6 || $[26] !== t9) {
2255
+ t10 = /* @__PURE__ */ jsxs($c8bb816105474884$export$ef9b1a59e592288f, {
2256
+ id,
2257
+ "aria-label": label,
2258
+ className: t2,
2259
+ selectedKey: selected,
2260
+ onSelectionChange: t3,
2261
+ children: [t6, t9]
2262
+ });
2263
+ $[20] = id;
2264
+ $[21] = label;
2265
+ $[22] = selected;
2266
+ $[23] = t2;
2267
+ $[24] = t3;
2268
+ $[25] = t6;
2269
+ $[26] = t9;
2270
+ $[27] = t10;
2271
+ } else t10 = $[27];
2272
+ return t10;
2273
+ }
2274
+ function _temp$1(t0) {
2275
+ const { family: name, steps } = t0;
2276
+ return /* @__PURE__ */ jsxs($928221da08ecbc62$export$dca12b0bb56e4fc, {
2277
+ id: name,
2278
+ children: [/* @__PURE__ */ jsxs($53e61d82d8b8611d$export$8b251419efc915eb, { children: ["Base palette / ", name] }), steps.map((t1) => {
2279
+ const { step: value, option: option_0 } = t1;
2280
+ return /* @__PURE__ */ jsxs($928221da08ecbc62$export$a11e76429ed99b4, {
2281
+ id: option_0.name,
2282
+ textValue: `${name} ${value}`,
2283
+ "aria-label": `${name} ${value}`,
2284
+ className: "studio-palette-item",
2285
+ children: [
2286
+ /* @__PURE__ */ jsx("span", {
2287
+ className: "studio-palette-swatch",
2288
+ style: { backgroundColor: `rgb(${option_0.value})` },
2289
+ "aria-hidden": "true"
2290
+ }),
2291
+ /* @__PURE__ */ jsx("span", { children: value }),
2292
+ /* @__PURE__ */ jsx("code", { children: toHex(option_0.value).toUpperCase() })
2293
+ ]
2294
+ }, option_0.name);
2295
+ })]
2296
+ }, name);
2297
+ }
2298
+ //#endregion
2299
+ //#region src/configurator/PanelResizeHandle.tsx
2300
+ const keyboardStep = 16;
2301
+ /**
2302
+ * A draggable divider between two configurator panels. It reports the width of the panel on its left; the parent owns
2303
+ * the width and its limits. Double-click (or Enter) restores the default layout.
2304
+ */
2305
+ function PanelResizeHandle(t0) {
2306
+ const $ = c(28);
2307
+ const { label, column, width, min, max, onResize, onReset } = t0;
2308
+ const drag = useRef(null);
2309
+ let t1;
2310
+ if ($[0] !== max || $[1] !== min) {
2311
+ t1 = (next) => Math.round(Math.min(Math.max(next, min), Math.max(min, max())));
2312
+ $[0] = max;
2313
+ $[1] = min;
2314
+ $[2] = t1;
2315
+ } else t1 = $[2];
2316
+ const clamp = t1;
2317
+ let t2;
2318
+ if ($[3] !== column || $[4] !== min) {
2319
+ t2 = (handle) => (handle.parentElement?.children[column - 2])?.getBoundingClientRect().width ?? min;
2320
+ $[3] = column;
2321
+ $[4] = min;
2322
+ $[5] = t2;
2323
+ } else t2 = $[5];
2324
+ const measured = t2;
2325
+ let t3;
2326
+ if ($[6] !== measured) {
2327
+ t3 = (event) => {
2328
+ if (event.button !== 0) return;
2329
+ event.preventDefault();
2330
+ event.currentTarget.setPointerCapture(event.pointerId);
2331
+ drag.current = {
2332
+ x: event.clientX,
2333
+ width: measured(event.currentTarget)
2334
+ };
2335
+ };
2336
+ $[6] = measured;
2337
+ $[7] = t3;
2338
+ } else t3 = $[7];
2339
+ const onPointerDown = t3;
2340
+ let t4;
2341
+ if ($[8] !== clamp || $[9] !== onResize) {
2342
+ t4 = (event_0) => {
2343
+ if (drag.current) onResize(clamp(drag.current.width + event_0.clientX - drag.current.x));
2344
+ };
2345
+ $[8] = clamp;
2346
+ $[9] = onResize;
2347
+ $[10] = t4;
2348
+ } else t4 = $[10];
2349
+ const onPointerMove = t4;
2350
+ let t5;
2351
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
2352
+ t5 = (event_1) => {
2353
+ drag.current = null;
2354
+ event_1.currentTarget.releasePointerCapture(event_1.pointerId);
2355
+ };
2356
+ $[11] = t5;
2357
+ } else t5 = $[11];
2358
+ const onPointerUp = t5;
2359
+ let t6;
2360
+ if ($[12] !== clamp || $[13] !== measured || $[14] !== onReset || $[15] !== onResize) {
2361
+ t6 = (event_2) => {
2362
+ const step = event_2.key === "ArrowLeft" ? -16 : event_2.key === "ArrowRight" ? keyboardStep : 0;
2363
+ if (step) {
2364
+ event_2.preventDefault();
2365
+ onResize(clamp(measured(event_2.currentTarget) + step));
2366
+ } else if (event_2.key === "Enter") {
2367
+ event_2.preventDefault();
2368
+ onReset();
2369
+ }
2370
+ };
2371
+ $[12] = clamp;
2372
+ $[13] = measured;
2373
+ $[14] = onReset;
2374
+ $[15] = onResize;
2375
+ $[16] = t6;
2376
+ } else t6 = $[16];
2377
+ const onKeyDown = t6;
2378
+ let t7;
2379
+ if ($[17] !== column) {
2380
+ t7 = { gridColumn: column };
2381
+ $[17] = column;
2382
+ $[18] = t7;
2383
+ } else t7 = $[18];
2384
+ let t8;
2385
+ if ($[19] !== label || $[20] !== min || $[21] !== onKeyDown || $[22] !== onPointerDown || $[23] !== onPointerMove || $[24] !== onReset || $[25] !== t7 || $[26] !== width) {
2386
+ t8 = /* @__PURE__ */ jsx("div", {
2387
+ className: "studio-resize-handle",
2388
+ style: t7,
2389
+ role: "separator",
2390
+ "aria-orientation": "vertical",
2391
+ "aria-label": label,
2392
+ "aria-valuenow": width,
2393
+ "aria-valuemin": min,
2394
+ tabIndex: 0,
2395
+ title: "Drag to resize · double-click to reset",
2396
+ onPointerDown,
2397
+ onPointerMove,
2398
+ onPointerUp,
2399
+ onPointerCancel: onPointerUp,
2400
+ onDoubleClick: onReset,
2401
+ onKeyDown
2402
+ });
2403
+ $[19] = label;
2404
+ $[20] = min;
2405
+ $[21] = onKeyDown;
2406
+ $[22] = onPointerDown;
2407
+ $[23] = onPointerMove;
2408
+ $[24] = onReset;
2409
+ $[25] = t7;
2410
+ $[26] = width;
2411
+ $[27] = t8;
2412
+ } else t8 = $[27];
2413
+ return t8;
2414
+ }
2415
+ //#endregion
2416
+ //#region src/configurator/ShadesGenerator.tsx
2417
+ /**
2418
+ * Generates a whole base palette scale from one color, which becomes its 500 step.
2419
+ */
2420
+ function ShadesGenerator(t0) {
2421
+ const $ = c(52);
2422
+ const { title, steps, initial, onApply } = t0;
2423
+ let t1;
2424
+ if ($[0] !== initial) {
2425
+ t1 = isRgb(initial) ? toHex(initial).slice(1).toUpperCase() : "";
2426
+ $[0] = initial;
2427
+ $[1] = t1;
2428
+ } else t1 = $[1];
2429
+ const [text, setText] = useState(t1);
2430
+ let base;
2431
+ let pending;
2432
+ let shades;
2433
+ let t10;
2434
+ let t2;
2435
+ let t3;
2436
+ let t4;
2437
+ let t5;
2438
+ let t6;
2439
+ let t7;
2440
+ let t8;
2441
+ let t9;
2442
+ if ($[2] !== initial || $[3] !== steps || $[4] !== text || $[5] !== title) {
2443
+ const hex = text.trim().replace(/^#/, "");
2444
+ base = /^[0-9a-f]{6}$/i.test(hex) ? toRgb(`#${hex}`) : /^[0-9a-f]{3}$/i.test(hex) ? toRgb(`#${hex.replace(/./g, "$&$&")}`) : null;
2445
+ shades = base ? generateShades(base, steps.map(_temp)) : null;
2446
+ pending = !!shades && base !== initial;
2447
+ t8 = "studio-shades";
2448
+ t9 = "group";
2449
+ t10 = `Generate ${title} shades`;
2450
+ t5 = "studio-shades-input";
2451
+ const t11 = `shades-${title}`;
2452
+ if ($[18] !== t11) {
2453
+ t6 = /* @__PURE__ */ jsx("label", {
2454
+ htmlFor: t11,
2455
+ children: "Base color (500)"
2456
+ });
2457
+ $[18] = t11;
2458
+ $[19] = t6;
2459
+ } else t6 = $[19];
2460
+ let t12;
2461
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
2462
+ t12 = /* @__PURE__ */ jsx("span", {
2463
+ "aria-hidden": "true",
2464
+ children: "#"
2465
+ });
2466
+ $[20] = t12;
2467
+ } else t12 = $[20];
2468
+ const t13 = `shades-${title}`;
2469
+ const t14 = !base;
2470
+ let t15;
2471
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
2472
+ t15 = (event) => setText(event.target.value.replace(/^#/, ""));
2473
+ $[21] = t15;
2474
+ } else t15 = $[21];
2475
+ if ($[22] !== t13 || $[23] !== t14 || $[24] !== text) {
2476
+ t7 = /* @__PURE__ */ jsxs("span", {
2477
+ className: "studio-token-input",
2478
+ children: [t12, /* @__PURE__ */ jsx("input", {
2479
+ id: t13,
2480
+ value: text,
2481
+ "aria-invalid": t14,
2482
+ spellCheck: false,
2483
+ onChange: t15
2484
+ })]
2485
+ });
2486
+ $[22] = t13;
2487
+ $[23] = t14;
2488
+ $[24] = text;
2489
+ $[25] = t7;
2490
+ } else t7 = $[25];
2491
+ t2 = "color";
2492
+ t3 = "Pick base color";
2493
+ t4 = base ? toHex(base) : "#000000";
2494
+ $[2] = initial;
2495
+ $[3] = steps;
2496
+ $[4] = text;
2497
+ $[5] = title;
2498
+ $[6] = base;
2499
+ $[7] = pending;
2500
+ $[8] = shades;
2501
+ $[9] = t10;
2502
+ $[10] = t2;
2503
+ $[11] = t3;
2504
+ $[12] = t4;
2505
+ $[13] = t5;
2506
+ $[14] = t6;
2507
+ $[15] = t7;
2508
+ $[16] = t8;
2509
+ $[17] = t9;
2510
+ } else {
2511
+ base = $[6];
2512
+ pending = $[7];
2513
+ shades = $[8];
2514
+ t10 = $[9];
2515
+ t2 = $[10];
2516
+ t3 = $[11];
2517
+ t4 = $[12];
2518
+ t5 = $[13];
2519
+ t6 = $[14];
2520
+ t7 = $[15];
2521
+ t8 = $[16];
2522
+ t9 = $[17];
2523
+ }
2524
+ let t11;
2525
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
2526
+ t11 = (event_0) => setText(event_0.target.value.slice(1).toUpperCase());
2527
+ $[26] = t11;
2528
+ } else t11 = $[26];
2529
+ let t12;
2530
+ if ($[27] !== t2 || $[28] !== t3 || $[29] !== t4) {
2531
+ t12 = /* @__PURE__ */ jsx("input", {
2532
+ type: t2,
2533
+ "aria-label": t3,
2534
+ value: t4,
2535
+ onChange: t11
2536
+ });
2537
+ $[27] = t2;
2538
+ $[28] = t3;
2539
+ $[29] = t4;
2540
+ $[30] = t12;
2541
+ } else t12 = $[30];
2542
+ const t13 = !pending;
2543
+ let t14;
2544
+ if ($[31] !== onApply || $[32] !== shades || $[33] !== steps) {
2545
+ t14 = () => {
2546
+ if (shades) onApply(Object.fromEntries(steps.map((t15) => {
2547
+ const { name, step: step_0 } = t15;
2548
+ return [name, shades[step_0]];
2549
+ })));
2550
+ };
2551
+ $[31] = onApply;
2552
+ $[32] = shades;
2553
+ $[33] = steps;
2554
+ $[34] = t14;
2555
+ } else t14 = $[34];
2556
+ let t15;
2557
+ if ($[35] !== t13 || $[36] !== t14) {
2558
+ t15 = /* @__PURE__ */ jsx("div", {
2559
+ className: "studio-shades-actions",
2560
+ children: /* @__PURE__ */ jsx("button", {
2561
+ type: "button",
2562
+ className: "studio-primary",
2563
+ disabled: t13,
2564
+ onClick: t14,
2565
+ children: "Change shades"
2566
+ })
2567
+ });
2568
+ $[35] = t13;
2569
+ $[36] = t14;
2570
+ $[37] = t15;
2571
+ } else t15 = $[37];
2572
+ let t16;
2573
+ if ($[38] !== t12 || $[39] !== t15 || $[40] !== t5 || $[41] !== t6 || $[42] !== t7) {
2574
+ t16 = /* @__PURE__ */ jsxs("div", {
2575
+ className: t5,
2576
+ children: [
2577
+ t6,
2578
+ t7,
2579
+ t12,
2580
+ t15
2581
+ ]
2582
+ });
2583
+ $[38] = t12;
2584
+ $[39] = t15;
2585
+ $[40] = t5;
2586
+ $[41] = t6;
2587
+ $[42] = t7;
2588
+ $[43] = t16;
2589
+ } else t16 = $[43];
2590
+ let t17;
2591
+ if ($[44] !== base) {
2592
+ t17 = !base && /* @__PURE__ */ jsx("p", {
2593
+ className: "studio-error",
2594
+ children: "Enter a hex color such as #75ACFF."
2595
+ });
2596
+ $[44] = base;
2597
+ $[45] = t17;
2598
+ } else t17 = $[45];
2599
+ let t18;
2600
+ if ($[46] !== t10 || $[47] !== t16 || $[48] !== t17 || $[49] !== t8 || $[50] !== t9) {
2601
+ t18 = /* @__PURE__ */ jsxs("div", {
2602
+ className: t8,
2603
+ role: t9,
2604
+ "aria-label": t10,
2605
+ children: [t16, t17]
2606
+ });
2607
+ $[46] = t10;
2608
+ $[47] = t16;
2609
+ $[48] = t17;
2610
+ $[49] = t8;
2611
+ $[50] = t9;
2612
+ $[51] = t18;
2613
+ } else t18 = $[51];
2614
+ return t18;
2615
+ }
2616
+ function _temp(t0) {
2617
+ const { step } = t0;
2618
+ return step;
2619
+ }
2620
+ //#endregion
2621
+ //#region src/configurator/TwLogo.tsx
2622
+ /** The TW mark (from the admin app's `LogoSmall`), cropped to its outline for the configurator's top bar. */
2623
+ const TwLogo = (props) => {
2624
+ const $ = c(5);
2625
+ let t0;
2626
+ let t1;
2627
+ let t2;
2628
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2629
+ t0 = /* @__PURE__ */ jsx("path", {
2630
+ d: "M20.5919 21H13.2263V22.1988H16.1963V27.9876H17.6327V22.1988H20.5919V21Z",
2631
+ fill: "#2B51D4"
2632
+ });
2633
+ t1 = /* @__PURE__ */ jsx("path", {
2634
+ d: "M21.1681 21L24.1165 27.9876H25.8769L27.9931 22.5165L30.0997 27.9876H31.8601L34.7761 21H33.2209L30.962 26.6031L28.8145 21H27.1621L25.0145 26.6031L22.7557 21H21.1681Z",
2635
+ fill: "#2B51D4"
2636
+ });
2637
+ t2 = /* @__PURE__ */ jsx("path", {
2638
+ fillRule: "evenodd",
2639
+ clipRule: "evenodd",
2640
+ d: "M10.2002 19.2C10.2002 18.2059 11.0061 17.4 12.0002 17.4H36.0002C36.9943 17.4 37.8002 18.2059 37.8002 19.2V29.4C37.8002 30.3941 36.9943 31.2 36.0002 31.2H12.0002C11.0061 31.2 10.2002 30.3941 10.2002 29.4V19.2ZM12.0002 18.6H36.0002C36.3316 18.6 36.6002 18.8686 36.6002 19.2V29.4C36.6002 29.7314 36.3316 30 36.0002 30H12.0002C11.6688 30 11.4002 29.7314 11.4002 29.4V19.2C11.4002 18.8686 11.6688 18.6 12.0002 18.6Z",
2641
+ fill: "#2B51D4"
2642
+ });
2643
+ $[0] = t0;
2644
+ $[1] = t1;
2645
+ $[2] = t2;
2646
+ } else {
2647
+ t0 = $[0];
2648
+ t1 = $[1];
2649
+ t2 = $[2];
2650
+ }
2651
+ let t3;
2652
+ if ($[3] !== props) {
2653
+ t3 = /* @__PURE__ */ jsxs("svg", {
2654
+ viewBox: "10.2 17.4 27.6 13.8",
2655
+ fill: "none",
2656
+ xmlns: "http://www.w3.org/2000/svg",
2657
+ "aria-hidden": "true",
2658
+ ...props,
2659
+ children: [
2660
+ t0,
2661
+ t1,
2662
+ t2
2663
+ ]
2664
+ });
2665
+ $[3] = props;
2666
+ $[4] = t3;
2667
+ } else t3 = $[4];
2668
+ return t3;
2669
+ };
2670
+ //#endregion
2671
+ //#region src/configurator/UIConfigurator.tsx
2672
+ const colorNamespaces = {
2673
+ surface: "Surfaces",
2674
+ border: "Borders",
2675
+ interactive: "Interactive",
2676
+ support: "Support",
2677
+ states: "States",
2678
+ shadow: "Shadows"
2679
+ };
2680
+ const componentNamespaces = [
2681
+ ["floating-label-input", "Floating label inputs"],
2682
+ ["file-upload", "File upload"],
2683
+ ["segmented-control", "Segmented controls"],
2684
+ ["global", "Global"],
2685
+ ["button", "Buttons"],
2686
+ ["input", "Inputs"],
2687
+ ["list", "Lists"],
2688
+ ["modal", "Modals"],
2689
+ ["toast", "Toasts"],
2690
+ ["tooltip", "Tooltips"],
2691
+ ["avatar", "Avatars"],
2692
+ ["table", "Tables"],
2693
+ ["alert", "Alerts"],
2694
+ ["pill", "Pills"],
2695
+ ["progress", "Progress"],
2696
+ ["slider", "Sliders"],
2697
+ ["stepper", "Steppers"],
2698
+ ["accordion", "Accordions"],
2699
+ ["breadcrumbs", "Breadcrumbs"],
2700
+ ["pagination", "Pagination"],
2701
+ ["icons", "Icons"],
2702
+ ["icon", "Icons"]
2703
+ ];
2704
+ function componentToken(name) {
2705
+ const token = name.replace(/^--(?:spacing|radius|container)-/, "");
2706
+ const namespace = componentNamespaces.find(([prefix]) => token === prefix || token.startsWith(`${prefix}-`));
2707
+ return {
2708
+ title: namespace?.[1] ?? "Base scale",
2709
+ label: (namespace ? token.slice(namespace[0].length + 1) : token).replace(/(?:^|-)rounding-/g, "-").replace(/^-/, "").replaceAll("-", " ")
2710
+ };
2711
+ }
2712
+ function effectToken(name) {
2713
+ const namespace = [
2714
+ ["--drop-shadow-", "Drop shadows"],
2715
+ ["--shadow-", "Shadows"],
2716
+ ["--blur-", "Blur"]
2717
+ ].find(([prefix]) => name.startsWith(prefix));
2718
+ const label = namespace ? name.slice(namespace[0].length).replaceAll("-", " ") : labelFor(name);
2719
+ return {
2720
+ title: namespace?.[1] ?? "Other effects",
2721
+ label: /^\d+$/.test(label) ? `Level ${label}` : label
2722
+ };
2723
+ }
2724
+ const textStylesTab = "Text styles";
2725
+ /** Text styles share a tab; font families, weights and letter spacing each get their own. */
2726
+ const typographyTabFor = (groupKey) => groupKey.startsWith("--text-") ? textStylesTab : groupKey;
2727
+ const baseSystemTab = "Base system";
2728
+ const semanticPaletteTab = "Semantic palette";
2729
+ /** The editor group a token is listed under within its section. */
2730
+ function groupKeyFor(section, name, defaults) {
2731
+ const textStyle = section === "Typography" ? name.match(/^--text-(.+?)(?:--.+)?$/)?.[1] : void 0;
2732
+ return textStyle ? `--text-${textStyle}` : section === "Typography" ? name.startsWith("--font-weight-") ? "Font weights" : name.startsWith("--font-") ? "Font families" : "Letter spacing" : section === "Colors" ? baseColorNames(defaults).has(name) ? `Base system · ${name.slice(2).split("-")[0]}` : colorNamespaces[name.slice(2).split("-")[0]] ?? "Other" : section === "Spacing" || section === "Radius" || section === "Sizing" ? componentToken(name).title : section === "Effects" ? effectToken(name).title : "tokens";
2733
+ }
2734
+ const ComponentGallery = lazy(() => import("../ComponentGallery-DIFeJqGx.js"));
2735
+ function ComponentPreview(t0) {
2736
+ const $ = c(14);
2737
+ const { value, mode, inspector } = t0;
2738
+ const { defaults } = useUIConfiguration();
2739
+ const t1 = value.config;
2740
+ const t2 = `studio-sample ${mode}`;
2741
+ let t3;
2742
+ if ($[0] !== defaults || $[1] !== mode || $[2] !== value.theme) {
2743
+ t3 = previewTokens(defaults, value.theme, mode);
2744
+ $[0] = defaults;
2745
+ $[1] = mode;
2746
+ $[2] = value.theme;
2747
+ $[3] = t3;
2748
+ } else t3 = $[3];
2749
+ const t4 = t3;
2750
+ let t5;
2751
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
2752
+ t5 = /* @__PURE__ */ jsx("p", {
2753
+ className: "studio-gallery-loading",
2754
+ children: "Loading components…"
2755
+ });
2756
+ $[4] = t5;
2757
+ } else t5 = $[4];
2758
+ let t6;
2759
+ if ($[5] !== inspector) {
2760
+ t6 = /* @__PURE__ */ jsx(Suspense, {
2761
+ fallback: t5,
2762
+ children: /* @__PURE__ */ jsx(ComponentGallery, { inspector })
2763
+ });
2764
+ $[5] = inspector;
2765
+ $[6] = t6;
2766
+ } else t6 = $[6];
2767
+ let t7;
2768
+ if ($[7] !== t2 || $[8] !== t4 || $[9] !== t6) {
2769
+ t7 = /* @__PURE__ */ jsx("div", {
2770
+ className: t2,
2771
+ style: t4,
2772
+ "data-testid": "component-preview",
2773
+ children: t6
2774
+ });
2775
+ $[7] = t2;
2776
+ $[8] = t4;
2777
+ $[9] = t6;
2778
+ $[10] = t7;
2779
+ } else t7 = $[10];
2780
+ let t8;
2781
+ if ($[11] !== t7 || $[12] !== value.config) {
2782
+ t8 = /* @__PURE__ */ jsx(UIConfig.Provider, {
2783
+ config: t1,
2784
+ children: t7
2785
+ });
2786
+ $[11] = t7;
2787
+ $[12] = value.config;
2788
+ $[13] = t8;
2789
+ } else t8 = $[13];
2790
+ return t8;
2791
+ }
2792
+ /** Changing a text style's font size sets its line height to this multiple of it; the line height stays editable. */
2793
+ const fontSizeLineHeight = "1.5";
2794
+ const remPresets = [
2795
+ 0,
2796
+ .0625,
2797
+ .125,
2798
+ .1875,
2799
+ .25,
2800
+ .375,
2801
+ .5,
2802
+ .625,
2803
+ .75,
2804
+ .875,
2805
+ 1,
2806
+ 1.25,
2807
+ 1.5,
2808
+ 2,
2809
+ 2.5,
2810
+ 3,
2811
+ 4,
2812
+ 5,
2813
+ 6
2814
+ ];
2815
+ function TokenField({ name, value, original, changed, onChange, onReset, onValidity, invalidValue, compactLabel, sizeUnit, fontSize, highlighted, paletteOptions, aliasOptions }) {
2816
+ const [text, setText] = useState(invalidValue ?? value);
2817
+ const [invalid, setInvalid] = useState(invalidValue !== void 0);
2818
+ const [editingText, setEditingText] = useState(null);
2819
+ const [customPaletteValue, setCustomPaletteValue] = useState(invalidValue !== void 0);
2820
+ const [syncedValue, setSyncedValue] = useState(value);
2821
+ if (value !== syncedValue) {
2822
+ setSyncedValue(value);
2823
+ if (!invalid) setText(value);
2824
+ }
2825
+ const hasSizePresets = /^-?(?:\d*\.)?\d+(?:rem|px)$/.test(original);
2826
+ const literalSize = hasSizePresets ? text.trim().match(/^(-?(?:\d*\.)?\d+)(rem|px)$/) : null;
2827
+ const rootFontSize = typeof document === "undefined" ? 16 : parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
2828
+ const storedUnit = original.endsWith("px") ? "px" : "rem";
2829
+ const toStoredUnit = (amount, unit) => `${Number((unit === storedUnit ? amount : unit === "px" ? amount / rootFontSize : amount * rootFontSize).toFixed(6))}${storedUnit}`;
2830
+ const fontSizePx = fontSize?.trim().match(/^(-?(?:\d*\.)?\d+)(rem|px)$/);
2831
+ const fontPx = fontSizePx ? Number(fontSizePx[1]) * (fontSizePx[2] === "rem" ? rootFontSize : 1) : 0;
2832
+ const relativeSuffix = name.endsWith("--line-height") ? "" : name.endsWith("--letter-spacing") ? "em" : null;
2833
+ const relativeSize = sizeUnit === "px" && fontPx && relativeSuffix !== null ? text.trim().match(new RegExp(`^(-?(?:\\d*\\.)?\\d+)${relativeSuffix}$`)) : null;
2834
+ const displayedSize = literalSize ? `${Number((Number(literalSize[1]) * (literalSize[2] === sizeUnit ? 1 : sizeUnit === "px" ? rootFontSize : 1 / rootFontSize)).toFixed(6))}` : relativeSize ? `${Number((Number(relativeSize[1]) * fontPx).toFixed(2))}` : text;
2835
+ const alias = aliasOptions?.find((option) => text.trim() === `var(${option.name})`);
2836
+ const inUnit = (size) => {
2837
+ const match = size.trim().match(/^(-?(?:\d*\.)?\d+)(rem|px)$/);
2838
+ if (!match) return size;
2839
+ const amount_0 = Number(match[1]) * (match[2] === sizeUnit ? 1 : sizeUnit === "px" ? rootFontSize : 1 / rootFontSize);
2840
+ return `${Number(amount_0.toFixed(4))}${sizeUnit}`;
2841
+ };
2842
+ const rgb = isRgb(original);
2843
+ const displayed = alias ? alias.label : rgb && !invalid && isRgb(text) ? toHex(text).toUpperCase() : displayedSize;
2844
+ const showsUnit = literalSize || relativeSize || alias;
2845
+ const color = rgb || /^#[0-9a-f]{6}$/i.test(original);
2846
+ const alphaColor = isAlphaHex(original) && isAlphaHex(text);
2847
+ const paletteAlias = !!paletteOptions?.length && /^var\(--[\w-]+\)$/.test(original);
2848
+ const selectedPalette = text.match(/^var\((--[\w-]+)\)$/)?.[1];
2849
+ const selectedOption = paletteOptions?.find((option_0) => option_0.name === selectedPalette);
2850
+ const showCustomValue = !paletteAlias || customPaletteValue || !selectedOption;
2851
+ const update = (next) => {
2852
+ setText(next);
2853
+ if (paletteAlias) setCustomPaletteValue(!paletteOptions?.some((option_1) => `var(${option_1.name})` === next));
2854
+ const valid = validToken(name, next, original);
2855
+ setInvalid(!valid);
2856
+ onValidity(name, !valid, next);
2857
+ if (valid) onChange(next);
2858
+ };
2859
+ return /* @__PURE__ */ jsxs("div", {
2860
+ className: `studio-token ${changed ? "is-changed" : ""} ${highlighted ? "is-highlighted" : ""}`,
2861
+ children: [
2862
+ /* @__PURE__ */ jsx("label", {
2863
+ htmlFor: paletteAlias && !showCustomValue ? `palette-${name}` : `token-${name}`,
2864
+ children: /* @__PURE__ */ jsx("span", { children: compactLabel ?? labelFor(name) })
2865
+ }),
2866
+ /* @__PURE__ */ jsxs("div", {
2867
+ className: "studio-token-value",
2868
+ children: [
2869
+ color && /* @__PURE__ */ jsx("input", {
2870
+ "aria-label": `Pick ${labelFor(name)}`,
2871
+ type: "color",
2872
+ value: rgb ? toHex(value) : value,
2873
+ onChange: (event) => update(rgb ? toRgb(event.target.value) : event.target.value)
2874
+ }),
2875
+ paletteAlias && /* @__PURE__ */ jsx(PaletteSelect, {
2876
+ id: `palette-${name}`,
2877
+ label: `Base color for ${labelFor(name)}`,
2878
+ options: paletteOptions,
2879
+ selected: showCustomValue ? "custom" : selectedOption.name,
2880
+ onSelect: (key) => {
2881
+ if (key === "custom") setCustomPaletteValue(true);
2882
+ else update(`var(${key})`);
2883
+ }
2884
+ }),
2885
+ alphaColor && /* @__PURE__ */ jsx(AlphaColorField, {
2886
+ name,
2887
+ label: labelFor(name),
2888
+ value: text,
2889
+ onChange: update
2890
+ }),
2891
+ showCustomValue && !alphaColor && /* @__PURE__ */ jsxs("span", {
2892
+ className: "studio-token-input",
2893
+ tabIndex: -1,
2894
+ children: [/* @__PURE__ */ jsx("input", {
2895
+ id: `token-${name}`,
2896
+ "aria-label": compactLabel ? labelFor(name) : void 0,
2897
+ value: editingText ?? displayed,
2898
+ "aria-invalid": invalid,
2899
+ "aria-describedby": [invalid ? `error-${name}` : "", showsUnit ? `unit-${name}` : ""].filter(Boolean).join(" ") || void 0,
2900
+ onChange: (event_0) => setEditingText(event_0.target.value),
2901
+ onKeyDown: (event_1) => {
2902
+ if (event_1.key === "Enter" && !event_1.nativeEvent.isComposing) {
2903
+ event_1.preventDefault();
2904
+ event_1.currentTarget.parentElement?.focus();
2905
+ }
2906
+ },
2907
+ onBlur: () => {
2908
+ if (editingText === null) return;
2909
+ const entered = editingText.trim();
2910
+ setEditingText(null);
2911
+ if (alias && entered === alias.label) return;
2912
+ const hex = rgb ? entered.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i)?.[1] : void 0;
2913
+ if (hex) {
2914
+ update(toRgb(`#${hex.length === 3 ? hex.replace(/./g, "$&$&") : hex}`));
2915
+ return;
2916
+ }
2917
+ const bare = /^-?(?:\d*\.)?\d+$/.test(entered);
2918
+ update(hasSizePresets && bare ? toStoredUnit(Number(entered), sizeUnit) : relativeSize && bare ? `${Number((Number(entered) / fontPx).toFixed(4))}${relativeSuffix}` : entered);
2919
+ },
2920
+ spellCheck: false
2921
+ }), showsUnit && /* @__PURE__ */ jsx("span", {
2922
+ className: "studio-token-unit",
2923
+ id: `unit-${name}`,
2924
+ children: alias ? inUnit(alias.value) : sizeUnit
2925
+ })]
2926
+ }),
2927
+ hasSizePresets && /* @__PURE__ */ jsxs("select", {
2928
+ className: "studio-size-presets",
2929
+ "aria-label": `Standard sizes for ${labelFor(name)}`,
2930
+ title: "Choose a standard size",
2931
+ value: "",
2932
+ onChange: (event_2) => update(event_2.target.value.startsWith("var(") ? event_2.target.value : toStoredUnit(parseFloat(event_2.target.value), "rem")),
2933
+ children: [
2934
+ /* @__PURE__ */ jsx("option", {
2935
+ value: "",
2936
+ disabled: true,
2937
+ children: "⌄"
2938
+ }),
2939
+ !!aliasOptions?.length && /* @__PURE__ */ jsx("optgroup", {
2940
+ label: "Global tokens",
2941
+ children: aliasOptions.map((option_2) => /* @__PURE__ */ jsx("option", {
2942
+ value: `var(${option_2.name})`,
2943
+ children: `${option_2.label} · ${inUnit(option_2.value)}`
2944
+ }, option_2.name))
2945
+ }),
2946
+ /* @__PURE__ */ jsx("optgroup", {
2947
+ label: "Standard sizes",
2948
+ children: remPresets.map((rem) => /* @__PURE__ */ jsx("option", {
2949
+ value: `${rem}rem`,
2950
+ children: `${Number((rem * rootFontSize).toFixed(2))}px · ${rem}rem${name.startsWith("--spacing-") ? ` · spacing ${rem * 4}` : ""}`
2951
+ }, rem))
2952
+ })
2953
+ ]
2954
+ }),
2955
+ /* @__PURE__ */ jsx("button", {
2956
+ type: "button",
2957
+ "aria-label": `Reset ${labelFor(name)}`,
2958
+ disabled: !changed && !invalid,
2959
+ onClick: () => {
2960
+ setText(original);
2961
+ setInvalid(false);
2962
+ setCustomPaletteValue(false);
2963
+ onValidity(name, false);
2964
+ onReset();
2965
+ },
2966
+ children: /* @__PURE__ */ jsx(RotateCcw, { size: 13 })
2967
+ })
2968
+ ]
2969
+ }),
2970
+ invalid && /* @__PURE__ */ jsx("small", {
2971
+ id: `error-${name}`,
2972
+ className: "studio-error",
2973
+ children: rgb ? "Use a hex color such as #1A2B3C, or three RGB values from 0 to 255." : "Enter a valid CSS value, including units where needed."
2974
+ })
2975
+ ]
2976
+ });
2977
+ }
2978
+ function ConfigurationModalContent({ memory }) {
2979
+ const inherited = UIConfig.useConfig();
2980
+ const { defaults, draft, setDraft, isOpen, cancel, apply, revision } = useUIConfiguration();
2981
+ const remembered = memory.current;
2982
+ const [mode, setMode] = useState(remembered.mode ?? "light");
2983
+ const [sizeUnit, setSizeUnit] = useState("px");
2984
+ const [editorWidth, setEditorWidth] = useState(remembered.editorWidth);
2985
+ const [confirmingReset, setConfirmingReset] = useState(false);
2986
+ const [nothingToReset, setNothingToReset] = useState(false);
2987
+ const bodyRef = useRef(null);
2988
+ const [cvaVariants, setCvaVariants] = useState({});
2989
+ const [cvaSlot, setCvaSlot] = useState(remembered.cvaSlot ?? "button.cva");
2990
+ const [section, setSection] = useState(remembered.section ?? "Colors");
2991
+ const [previewMode, setPreviewMode] = useState(remembered.previewMode ?? "gallery");
2992
+ const [search, setSearch] = useState("");
2993
+ const [expandedGroups, setExpandedGroups] = useState(remembered.expandedGroups ?? {});
2994
+ const [sectionTabs, setSectionTabs] = useState(remembered.sectionTabs ?? {});
2995
+ const [resetRevision, setResetRevision] = useState(0);
2996
+ const [invalidFields, setInvalidFields] = useState({});
2997
+ const [message, setMessage] = useState("");
2998
+ const [themeWriter, setThemeWriter] = useState(null);
2999
+ const [savingTheme, setSavingTheme] = useState(false);
3000
+ useEffect(() => {
3001
+ setThemeWriter(getThemeWriter());
3002
+ }, []);
3003
+ const [exportTab, setExportTab] = useState(remembered.exportTab ?? "css");
3004
+ const editorRef = useRef(null);
3005
+ const previewRef = useRef(null);
3006
+ useEffect(() => {
3007
+ Object.assign(memory.current, {
3008
+ section,
3009
+ sectionTabs,
3010
+ expandedGroups,
3011
+ mode,
3012
+ cvaSlot,
3013
+ previewMode,
3014
+ exportTab,
3015
+ editorWidth
3016
+ });
3017
+ }, [
3018
+ memory,
3019
+ section,
3020
+ sectionTabs,
3021
+ expandedGroups,
3022
+ mode,
3023
+ cvaSlot,
3024
+ previewMode,
3025
+ exportTab,
3026
+ editorWidth
3027
+ ]);
3028
+ useLayoutEffect(() => {
3029
+ const frame = requestAnimationFrame(() => {
3030
+ editorRef.current?.scrollTo({ top: memory.current.editorScroll ?? 0 });
3031
+ previewRef.current?.scrollTo({ top: memory.current.previewScroll ?? 0 });
3032
+ });
3033
+ return () => cancelAnimationFrame(frame);
3034
+ }, [memory]);
3035
+ const exportRef = useRef(null);
3036
+ const changedCount = Object.keys(draft.overrides ?? {}).length + Object.values(draft.theme).reduce((count, tokens) => count + Object.keys(tokens).length, 0) + Object.values(draft.config).reduce((count_0, value) => count_0 + (typeof value === "object" && value !== null ? Object.keys(value).length : 1), 0);
3037
+ const config = inherited;
3038
+ const exportText = exportTab === "css" ? exportCss(draft.theme, defaults) : exportTab === "overrides" ? exportCvaEdits(draft.overrides) : `import { UIConfig } from "@povio/ui/ui-config";\n\nconst config = ${JSON.stringify(draft.config, null, 2)} satisfies Partial<UIConfig.Options>;\n\n// Wrap your application:\n// <UIConfig.Provider config={config}>{children}</UIConfig.Provider>\n`;
3039
+ const changeSection = (next) => {
3040
+ setSection(next);
3041
+ setSearch("");
3042
+ setMessage("");
3043
+ setHighlightedToken(null);
3044
+ };
3045
+ const [highlightedToken, setHighlightedToken] = useState(null);
3046
+ const isInspectable = useCallback((name) => (name in defaults.theme || name in defaults.light || name in defaults.dark) && groups.includes(groupFor(name)) && !name.startsWith("--color-"), [defaults]);
3047
+ const describeToken = useCallback((name_0) => {
3048
+ const section_0 = groupFor(name_0);
3049
+ const bucket = mode === "dark" && name_0 in defaults.dark ? "dark" : name_0 in defaults.light ? "light" : "theme";
3050
+ const value_0 = draft.theme[bucket][name_0] ?? defaults[bucket][name_0];
3051
+ return `${groupKeyFor(section_0, name_0, defaults)} · ${componentToken(name_0).label} · ${value_0}`;
3052
+ }, [
3053
+ defaults,
3054
+ draft,
3055
+ mode
3056
+ ]);
3057
+ /** Opens the editor on a token picked in the inspector: its section, its group, scrolled into view and highlighted. */
3058
+ const focusToken = useCallback((name_1) => {
3059
+ const next_0 = groupFor(name_1);
3060
+ setSection(next_0);
3061
+ setSearch("");
3062
+ setMessage("");
3063
+ const key = groupKeyFor(next_0, name_1, defaults);
3064
+ setExpandedGroups((current) => ({
3065
+ ...current,
3066
+ [`${next_0}:${key}`]: true
3067
+ }));
3068
+ if (next_0 === "Typography") setSectionTabs((current_0) => ({
3069
+ ...current_0,
3070
+ Typography: typographyTabFor(key)
3071
+ }));
3072
+ if (next_0 === "Colors") setSectionTabs((current_1) => ({
3073
+ ...current_1,
3074
+ Colors: baseColorNames(defaults).has(name_1) ? baseSystemTab : semanticPaletteTab
3075
+ }));
3076
+ setHighlightedToken(name_1);
3077
+ }, [defaults]);
3078
+ useEffect(() => {
3079
+ if (!highlightedToken) return;
3080
+ const frame_0 = requestAnimationFrame(() => {
3081
+ (document.getElementById(`token-${highlightedToken}`)?.closest(".studio-token"))?.scrollIntoView({
3082
+ block: "center",
3083
+ behavior: "smooth"
3084
+ });
3085
+ });
3086
+ return () => cancelAnimationFrame(frame_0);
3087
+ }, [highlightedToken, section]);
3088
+ const validity = (name_2, invalid, value_1 = "") => setInvalidFields((current_2) => {
3089
+ const next_1 = { ...current_2 };
3090
+ if (invalid) next_1[name_2] = value_1;
3091
+ else delete next_1[name_2];
3092
+ return next_1;
3093
+ });
3094
+ const reset = () => {
3095
+ setDraft(emptyConfiguration());
3096
+ setInvalidFields({});
3097
+ setResetRevision((value_2) => value_2 + 1);
3098
+ setMessage("All settings reset to the application defaults.");
3099
+ };
3100
+ const setToken = (name_3, value_3) => {
3101
+ const bucket_0 = mode === "dark" && name_3 in defaults.dark ? "dark" : name_3 in defaults.light ? "light" : "theme";
3102
+ setDraft((current_3) => {
3103
+ const tokens_0 = { ...current_3.theme[bucket_0] };
3104
+ if (value_3 === void 0 || value_3 === defaults[bucket_0][name_3]) delete tokens_0[name_3];
3105
+ else tokens_0[name_3] = value_3;
3106
+ return {
3107
+ ...current_3,
3108
+ theme: {
3109
+ ...current_3.theme,
3110
+ [bucket_0]: tokens_0
3111
+ }
3112
+ };
3113
+ });
3114
+ };
3115
+ const setComponent = (key_0, field, value_4) => {
3116
+ setDraft((current_4) => ({
3117
+ ...current_4,
3118
+ config: {
3119
+ ...current_4.config,
3120
+ [key_0]: {
3121
+ ...current_4.config[key_0],
3122
+ [field]: value_4
3123
+ }
3124
+ }
3125
+ }));
3126
+ };
3127
+ const radiusAliasOptions = Object.keys(defaults.theme).filter((name_4) => name_4.startsWith("--radius-global-rounding-")).map((name_5) => ({
3128
+ name: name_5,
3129
+ label: `Global ${name_5.replace("--radius-global-rounding-", "").toUpperCase()}`,
3130
+ value: draft.theme.theme[name_5] ?? defaults.theme[name_5]
3131
+ }));
3132
+ const palette = baseColorNames(defaults);
3133
+ const paletteOptions = [...palette].map((name_6) => ({
3134
+ name: name_6,
3135
+ value: draft.theme.light[name_6] ?? defaults.light[name_6]
3136
+ }));
3137
+ const sectionEntries = Object.entries({
3138
+ ...defaults.light,
3139
+ ...mode === "dark" ? defaults.dark : {},
3140
+ ...defaults.theme
3141
+ }).filter(([name_7]) => groupFor(name_7) === section && !name_7.startsWith("--color-"));
3142
+ const groupedEntries = /* @__PURE__ */ new Map();
3143
+ for (const entry of sectionEntries) {
3144
+ const [name_8] = entry;
3145
+ const textStyle = section === "Typography" ? name_8.match(/^--text-(.+?)(?:--.+)?$/)?.[1] : void 0;
3146
+ const key_1 = groupKeyFor(section, name_8, defaults);
3147
+ if (!groupedEntries.has(key_1)) groupedEntries.set(key_1, {
3148
+ title: textStyle ? textStyle.replaceAll("-", " ") : key_1 === "tokens" ? "" : key_1,
3149
+ compact: !!textStyle,
3150
+ entries: []
3151
+ });
3152
+ groupedEntries.get(key_1).entries.push(entry);
3153
+ }
3154
+ const paletteStep = (name_9) => Number(name_9.match(/-(\d+)-base$/)?.[1]);
3155
+ const isPaletteGroup = (entries) => entries.every(([name_10]) => palette.has(name_10));
3156
+ for (const group of groupedEntries.values()) if (isPaletteGroup(group.entries)) group.entries.sort(([left], [right]) => paletteStep(right) - paletteStep(left));
3157
+ const paletteValue = (name_11) => draft.theme.light[name_11] ?? defaults.light[name_11];
3158
+ const renderPaletteShades = (title, entries_0) => {
3159
+ const base = paletteValue((entries_0.find(([name_12]) => paletteStep(name_12) === 500) ?? entries_0[Math.floor(entries_0.length / 2)])[0]);
3160
+ return /* @__PURE__ */ jsx(ShadesGenerator, {
3161
+ title,
3162
+ steps: entries_0.map(([name_13]) => ({
3163
+ name: name_13,
3164
+ step: paletteStep(name_13)
3165
+ })),
3166
+ initial: base,
3167
+ onApply: (values) => {
3168
+ for (const [name_14, value_5] of Object.entries(values)) setToken(name_14, value_5);
3169
+ }
3170
+ }, base);
3171
+ };
3172
+ const tokenGroups = [...groupedEntries.entries()].filter(([key_2, group_0]) => `${key_2} ${group_0.title} ${group_0.entries.map(([name_15]) => `${name_15} ${labelFor(name_15)}`).join(" ")}`.toLowerCase().includes(search.toLowerCase().trim()));
3173
+ const visibleGroups = section === "Typography" ? tokenGroups : tokenGroups.map(([key_3, group_1]) => [key_3, {
3174
+ ...group_1,
3175
+ entries: group_1.entries.filter(([name_16]) => `${group_1.title} ${name_16} ${labelFor(name_16)}`.toLowerCase().includes(search.toLowerCase().trim()))
3176
+ }]).filter(([, group_2]) => group_2.entries.length);
3177
+ const groupRank = (key_4) => key_4 === "Global" ? -1 : key_4 === "Base scale" ? 1 : 0;
3178
+ const sectionKeys = [...groupedEntries.keys()].sort((a, b) => groupRank(a) - groupRank(b));
3179
+ const searching = !!search.trim();
3180
+ const tabFor = (key_5) => section === "Typography" ? typographyTabFor(key_5) : section === "Colors" ? isPaletteGroup(groupedEntries.get(key_5)?.entries ?? []) ? baseSystemTab : semanticPaletteTab : void 0;
3181
+ const sectionTabList = [...new Set(sectionKeys.map(tabFor))].filter((tab) => !!tab);
3182
+ const activeSectionTab = sectionTabList.includes(sectionTabs[section]) ? sectionTabs[section] : sectionTabList[0];
3183
+ const tabbed = sectionTabList.length > 1 && !searching;
3184
+ const inActiveTab = (key_6) => !tabbed || tabFor(key_6) === activeSectionTab;
3185
+ const flatTab = tabbed && section === "Typography" && activeSectionTab !== textStylesTab;
3186
+ const orderedGroups = [...visibleGroups].filter(([key_7]) => inActiveTab(key_7)).sort(([a_0], [b_0]) => groupRank(a_0) - groupRank(b_0));
3187
+ const collapsibleKeys = sectionKeys.filter(inActiveTab);
3188
+ const primaryGroup = collapsibleKeys[0];
3189
+ const isExpanded = (key_8) => searching || (expandedGroups[`${section}:${key_8}`] ?? key_8 === primaryGroup);
3190
+ const toggleGroup = (key_9) => setExpandedGroups((current_5) => ({
3191
+ ...current_5,
3192
+ [`${section}:${key_9}`]: !isExpanded(key_9)
3193
+ }));
3194
+ const allExpanded = collapsibleKeys.every(isExpanded);
3195
+ const setAllGroups = (expanded) => setExpandedGroups((current_6) => ({
3196
+ ...current_6,
3197
+ ...Object.fromEntries(collapsibleKeys.map((key_10) => [`${section}:${key_10}`, expanded]))
3198
+ }));
3199
+ const groupChanged = (entries_1) => entries_1.some(([name_17]) => {
3200
+ const bucket_1 = mode === "dark" && name_17 in defaults.dark ? "dark" : name_17 in defaults.light ? "light" : "theme";
3201
+ return name_17 in draft.theme[bucket_1];
3202
+ });
3203
+ /** The current font size of a text style's line height or letter spacing token. */
3204
+ const fontSizeFor = (name_18) => {
3205
+ const fontSizeName = name_18.match(/^(--text-.+?)--(?:line-height|letter-spacing)$/)?.[1];
3206
+ if (!fontSizeName) return void 0;
3207
+ const bucket_2 = mode === "dark" && fontSizeName in defaults.dark ? "dark" : fontSizeName in defaults.light ? "light" : "theme";
3208
+ return draft.theme[bucket_2][fontSizeName] ?? defaults[bucket_2][fontSizeName];
3209
+ };
3210
+ const renderToken = ([name_19, original], compact = false) => {
3211
+ const bucket_3 = mode === "dark" && name_19 in defaults.dark ? "dark" : name_19 in defaults.light ? "light" : "theme";
3212
+ const compactLabel = compact ? name_19.endsWith("--line-height") ? "Line height" : name_19.endsWith("--letter-spacing") ? "Letter spacing" : "Font size" : section === "Colors" ? palette.has(name_19) ? labelFor(name_19).split(" ").slice(1).join(" ") : labelFor(name_19).replace(/^(surface|border|interactive|support|states|shadow) /, "") : section === "Spacing" || section === "Radius" || section === "Sizing" ? componentToken(name_19).label : section === "Effects" ? effectToken(name_19).label : void 0;
3213
+ return /* @__PURE__ */ jsx(TokenField, {
3214
+ name: name_19,
3215
+ original,
3216
+ compactLabel,
3217
+ sizeUnit,
3218
+ fontSize: fontSizeFor(name_19),
3219
+ highlighted: highlightedToken === name_19,
3220
+ paletteOptions: section === "Colors" && /^var\(--[\w-]+\)$/.test(original) ? paletteOptions : void 0,
3221
+ aliasOptions: section === "Radius" && !name_19.startsWith("--radius-global-") && componentToken(name_19).title !== "Base scale" ? radiusAliasOptions : void 0,
3222
+ value: draft.theme[bucket_3][name_19] ?? original,
3223
+ changed: name_19 in draft.theme[bucket_3],
3224
+ onChange: (value_6) => {
3225
+ setToken(name_19, value_6);
3226
+ const lineHeight = `${name_19}--line-height`;
3227
+ if (/^--text-[\w-]+$/.test(name_19) && !name_19.includes("--", 2) && (lineHeight in defaults.theme || lineHeight in defaults.light)) setToken(lineHeight, fontSizeLineHeight);
3228
+ },
3229
+ onReset: () => setToken(name_19),
3230
+ invalidValue: invalidFields[`${bucket_3}:${name_19}`],
3231
+ onValidity: (field_0, invalid_0, value_7) => validity(`${bucket_3}:${field_0}`, invalid_0, value_7)
3232
+ }, `${revision}-${resetRevision}-${mode}-${name_19}`);
3233
+ };
3234
+ const showTabs = sectionTabList.length > 1 && groups.includes(section);
3235
+ const toggleAllButton = groups.includes(section) && !flatTab && collapsibleKeys.length > 1 && /* @__PURE__ */ jsxs("button", {
3236
+ type: "button",
3237
+ className: "studio-toggle-all",
3238
+ disabled: searching,
3239
+ onClick: () => setAllGroups(!allExpanded),
3240
+ children: [/* @__PURE__ */ jsx(ChevronsUpDown, {
3241
+ size: 13,
3242
+ "aria-hidden": "true"
3243
+ }), allExpanded ? "Collapse all" : "Expand all"]
3244
+ });
3245
+ const selectControl = (label, key_11, field_1, options) => /* @__PURE__ */ jsxs("label", {
3246
+ className: "studio-setting",
3247
+ children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx("select", {
3248
+ "aria-label": label,
3249
+ value: String(config[key_11][field_1]),
3250
+ onChange: (event) => setComponent(key_11, field_1, event.target.value),
3251
+ children: options.map((option) => /* @__PURE__ */ jsx("option", { children: option }, option))
3252
+ })]
3253
+ }, `${key_11}-${field_1}`);
3254
+ return /* @__PURE__ */ jsx($8b8d26808cb8cb53$export$8948f78d83984c69, {
3255
+ className: "studio-overlay",
3256
+ isOpen,
3257
+ onOpenChange: (next_2) => {
3258
+ if (!next_2) cancel();
3259
+ },
3260
+ isDismissable: false,
3261
+ children: /* @__PURE__ */ jsx($8b8d26808cb8cb53$export$2b77a92f1a5ad772, {
3262
+ className: "studio-modal",
3263
+ children: /* @__PURE__ */ jsxs($f2ff30fde7b014be$export$3ddf2d174ce01153, {
3264
+ className: "studio-dialog",
3265
+ children: [
3266
+ /* @__PURE__ */ jsxs("header", {
3267
+ className: "studio-topbar",
3268
+ children: [
3269
+ /* @__PURE__ */ jsxs("div", {
3270
+ className: "studio-title",
3271
+ children: [/* @__PURE__ */ jsx(TwLogo, { className: "studio-topbar-logo" }), /* @__PURE__ */ jsx($2ec61d1d4f780267$export$a8a3e93435678ff9, {
3272
+ slot: "title",
3273
+ children: "UI configuration"
3274
+ })]
3275
+ }),
3276
+ /* @__PURE__ */ jsxs("nav", {
3277
+ className: "studio-nav",
3278
+ "aria-label": "Configuration sections",
3279
+ children: [
3280
+ groups.map((group_3) => /* @__PURE__ */ jsx("button", {
3281
+ "aria-current": section === group_3 ? "page" : void 0,
3282
+ onClick: () => changeSection(group_3),
3283
+ children: group_3
3284
+ }, group_3)),
3285
+ /* @__PURE__ */ jsx("span", {
3286
+ className: "studio-nav-divider",
3287
+ "aria-hidden": "true"
3288
+ }),
3289
+ /* @__PURE__ */ jsx("button", {
3290
+ "aria-current": section === "Components" ? "page" : void 0,
3291
+ onClick: () => changeSection("Components"),
3292
+ children: "Defaults & behavior"
3293
+ }),
3294
+ /* @__PURE__ */ jsx("button", {
3295
+ "aria-current": section === "Variants & overrides" ? "page" : void 0,
3296
+ onClick: () => changeSection("Variants & overrides"),
3297
+ children: "Variants & overrides"
3298
+ }),
3299
+ /* @__PURE__ */ jsx("span", {
3300
+ className: "studio-nav-divider",
3301
+ "aria-hidden": "true"
3302
+ }),
3303
+ /* @__PURE__ */ jsx("button", {
3304
+ "aria-current": section === "Export" ? "page" : void 0,
3305
+ onClick: () => changeSection("Export"),
3306
+ children: "Export"
3307
+ })
3308
+ ]
3309
+ }),
3310
+ /* @__PURE__ */ jsxs("div", {
3311
+ className: "studio-topbar-controls",
3312
+ children: [
3313
+ /* @__PURE__ */ jsxs("label", {
3314
+ className: "studio-search",
3315
+ children: [/* @__PURE__ */ jsx(Search, { size: 14 }), /* @__PURE__ */ jsx("input", {
3316
+ "aria-label": "Search tokens",
3317
+ placeholder: "Search tokens",
3318
+ value: search,
3319
+ disabled: !groups.includes(section),
3320
+ onChange: (event_0) => setSearch(event_0.target.value)
3321
+ })]
3322
+ }),
3323
+ /* @__PURE__ */ jsx("div", {
3324
+ className: "studio-mode studio-unit-mode",
3325
+ role: "group",
3326
+ "aria-label": "Size units",
3327
+ children: ["rem", "px"].map((unit) => /* @__PURE__ */ jsx("button", {
3328
+ type: "button",
3329
+ "aria-pressed": sizeUnit === unit,
3330
+ onClick: () => setSizeUnit(unit),
3331
+ children: unit
3332
+ }, unit))
3333
+ }),
3334
+ /* @__PURE__ */ jsx(ColorModeSwitch, {
3335
+ value: mode,
3336
+ onChange: setMode
3337
+ }),
3338
+ /* @__PURE__ */ jsx("button", {
3339
+ className: "studio-icon",
3340
+ "aria-label": "Close configuration without applying",
3341
+ onClick: () => cancel(),
3342
+ children: /* @__PURE__ */ jsx(X, { size: 17 })
3343
+ })
3344
+ ]
3345
+ })
3346
+ ]
3347
+ }),
3348
+ /* @__PURE__ */ jsxs("div", {
3349
+ ref: bodyRef,
3350
+ className: "studio-body",
3351
+ style: { "--studio-editor-track": editorWidth ? `minmax(260px, ${editorWidth}px)` : void 0 },
3352
+ children: [
3353
+ /* @__PURE__ */ jsxs("main", {
3354
+ ref: editorRef,
3355
+ className: "studio-editor",
3356
+ onScroll: (event_1) => memory.current.editorScroll = event_1.currentTarget.scrollTop,
3357
+ children: [
3358
+ showTabs ? /* @__PURE__ */ jsxs("div", {
3359
+ className: "studio-subtabs-bar",
3360
+ children: [/* @__PURE__ */ jsx("div", {
3361
+ className: "studio-subtabs",
3362
+ role: "tablist",
3363
+ "aria-label": `${section} tokens`,
3364
+ children: sectionTabList.map((tab_0) => /* @__PURE__ */ jsxs("button", {
3365
+ type: "button",
3366
+ role: "tab",
3367
+ "aria-selected": !searching && tab_0 === activeSectionTab,
3368
+ disabled: searching,
3369
+ onClick: () => setSectionTabs((current_7) => ({
3370
+ ...current_7,
3371
+ [section]: tab_0
3372
+ })),
3373
+ children: [tab_0, groupChanged([...groupedEntries].filter(([key_12]) => tabFor(key_12) === tab_0).flatMap(([, group_4]) => group_4.entries)) && /* @__PURE__ */ jsx("span", {
3374
+ className: "studio-group-changed",
3375
+ "aria-label": "has changes"
3376
+ })]
3377
+ }, tab_0))
3378
+ }), toggleAllButton]
3379
+ }) : /* @__PURE__ */ jsxs("div", {
3380
+ className: "studio-editor-heading",
3381
+ children: [/* @__PURE__ */ jsx("h2", { children: section === "Components" ? "Defaults & behavior" : section }), toggleAllButton]
3382
+ }),
3383
+ groups.includes(section) && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsxs("div", {
3384
+ className: `studio-token-list ${section !== "Typography" ? "studio-token-list-inline" : "studio-token-list-rows"}`,
3385
+ children: [orderedGroups.map(([key_13, group_5]) => group_5.title && !flatTab ? /* @__PURE__ */ jsxs("fieldset", {
3386
+ className: `studio-token-group ${group_5.compact ? "studio-type-style" : ""} ${!isExpanded(key_13) ? "is-collapsed" : ""}`,
3387
+ children: [/* @__PURE__ */ jsxs("legend", { children: [/* @__PURE__ */ jsxs("button", {
3388
+ type: "button",
3389
+ className: "studio-group-toggle",
3390
+ "aria-expanded": isExpanded(key_13),
3391
+ "aria-controls": `group-${section}-${key_13.replaceAll(" ", "-")}`,
3392
+ onClick: () => toggleGroup(key_13),
3393
+ children: [
3394
+ /* @__PURE__ */ jsx(ChevronRight, {
3395
+ size: 14,
3396
+ "aria-hidden": "true"
3397
+ }),
3398
+ group_5.title,
3399
+ groupChanged(group_5.entries) && /* @__PURE__ */ jsx("span", {
3400
+ className: "studio-group-changed",
3401
+ "aria-label": "has changes"
3402
+ })
3403
+ ]
3404
+ }), section === "Colors" && isPaletteGroup(group_5.entries) && /* @__PURE__ */ jsx("span", {
3405
+ className: "studio-palette-actions",
3406
+ children: /* @__PURE__ */ jsx("button", {
3407
+ type: "button",
3408
+ className: "studio-palette-reset",
3409
+ "aria-label": `Reset ${group_5.title} palette`,
3410
+ title: "Reset every shade in this palette to its default",
3411
+ disabled: !groupChanged(group_5.entries),
3412
+ onClick: () => {
3413
+ for (const [name_20] of group_5.entries) setToken(name_20);
3414
+ },
3415
+ children: /* @__PURE__ */ jsx(RotateCcw, {
3416
+ size: 13,
3417
+ "aria-hidden": "true"
3418
+ })
3419
+ })
3420
+ })] }), /* @__PURE__ */ jsxs("div", {
3421
+ id: `group-${section}-${key_13.replaceAll(" ", "-")}`,
3422
+ hidden: !isExpanded(key_13),
3423
+ className: group_5.compact ? "studio-type-fields" : void 0,
3424
+ children: [section === "Colors" && isPaletteGroup(group_5.entries) && renderPaletteShades(group_5.title, group_5.entries), group_5.entries.map((entry_0) => renderToken(entry_0, group_5.compact))]
3425
+ })]
3426
+ }, key_13) : group_5.entries.map((entry_1) => renderToken(entry_1))), !orderedGroups.length && /* @__PURE__ */ jsx("p", { children: "No matching tokens. Try a component name such as “button”." })]
3427
+ }) }),
3428
+ section === "Variants & overrides" && /* @__PURE__ */ jsx(CvaEditor, {
3429
+ slot: cvaSlot,
3430
+ setSlot: (slot) => {
3431
+ setCvaSlot(slot);
3432
+ setCvaVariants({});
3433
+ },
3434
+ onPreview: setCvaVariants
3435
+ }),
3436
+ section === "Components" && /* @__PURE__ */ jsxs("div", {
3437
+ className: "studio-settings",
3438
+ children: [
3439
+ /* @__PURE__ */ jsx("h3", { children: "Buttons" }),
3440
+ selectControl("Appearance", "button", "variant", [
3441
+ "contained",
3442
+ "outlined",
3443
+ "subtle",
3444
+ "ghost",
3445
+ "text"
3446
+ ]),
3447
+ selectControl("Button size", "button", "size", [
3448
+ "default",
3449
+ "sm",
3450
+ "s"
3451
+ ]),
3452
+ /* @__PURE__ */ jsx("h3", { children: "Inputs" }),
3453
+ selectControl("Input appearance", "input", "variant", ["outlined", "filled"]),
3454
+ selectControl("Label layout", "input", "as", [
3455
+ "default",
3456
+ "floating",
3457
+ "inline",
3458
+ "filter"
3459
+ ]),
3460
+ selectControl("Input size", "input", "size", ["default", "small"]),
3461
+ [
3462
+ "isClearable",
3463
+ "hideLabel",
3464
+ "alwaysShowClear"
3465
+ ].map((field_2) => /* @__PURE__ */ jsxs("label", {
3466
+ className: "studio-setting",
3467
+ children: [/* @__PURE__ */ jsx("span", { children: {
3468
+ isClearable: "Allow clearing",
3469
+ hideLabel: "Hide labels",
3470
+ alwaysShowClear: "Always show clear button"
3471
+ }[field_2] }), /* @__PURE__ */ jsx("input", {
3472
+ type: "checkbox",
3473
+ checked: config.input[field_2],
3474
+ onChange: (event_2) => setComponent("input", field_2, event_2.target.checked)
3475
+ })]
3476
+ }, field_2)),
3477
+ /* @__PURE__ */ jsx("h3", { children: "Rendering" }),
3478
+ /* @__PURE__ */ jsxs("label", {
3479
+ className: "studio-setting",
3480
+ children: [/* @__PURE__ */ jsxs("span", { children: ["Use static inputs until interaction", /* @__PURE__ */ jsx("small", { children: "Reduce work when rendering large forms." })] }), /* @__PURE__ */ jsx("input", {
3481
+ type: "checkbox",
3482
+ checked: config.renderStaticInput,
3483
+ onChange: (event_3) => setDraft((current_8) => ({
3484
+ ...current_8,
3485
+ config: {
3486
+ ...current_8.config,
3487
+ renderStaticInput: event_3.target.checked
3488
+ }
3489
+ }))
3490
+ })]
3491
+ }),
3492
+ /* @__PURE__ */ jsx("p", {
3493
+ className: "studio-help",
3494
+ children: "Component props override these defaults. The preview uses inherited defaults unless an example needs a specific state."
3495
+ })
3496
+ ]
3497
+ }),
3498
+ section === "Export" && /* @__PURE__ */ jsxs("div", {
3499
+ className: "studio-export",
3500
+ children: [
3501
+ /* @__PURE__ */ jsxs("div", {
3502
+ className: "studio-mode",
3503
+ children: [
3504
+ /* @__PURE__ */ jsx("button", {
3505
+ "aria-pressed": exportTab === "css",
3506
+ onClick: () => setExportTab("css"),
3507
+ children: "Tailwind CSS"
3508
+ }),
3509
+ /* @__PURE__ */ jsx("button", {
3510
+ "aria-pressed": exportTab === "config",
3511
+ onClick: () => setExportTab("config"),
3512
+ children: "UIConfig"
3513
+ }),
3514
+ /* @__PURE__ */ jsx("button", {
3515
+ "aria-pressed": exportTab === "overrides",
3516
+ onClick: () => setExportTab("overrides"),
3517
+ children: "UIOverrides"
3518
+ })
3519
+ ]
3520
+ }),
3521
+ /* @__PURE__ */ jsx("p", { children: exportTab === "css" ? "Import after your existing theme. Only changed tokens are included; light and dark colors remain separate." : exportTab === "overrides" ? "Merge these edited slots with your existing app overrides. New Tailwind classes require a rebuild." : "Wrap your application with this provider. Only changed component settings are included." }),
3522
+ /* @__PURE__ */ jsx("textarea", {
3523
+ ref: exportRef,
3524
+ "aria-label": "Exported configuration",
3525
+ readOnly: true,
3526
+ value: exportText,
3527
+ spellCheck: false
3528
+ }),
3529
+ /* @__PURE__ */ jsxs("div", {
3530
+ className: "studio-export-actions",
3531
+ children: [
3532
+ exportTab === "css" && themeWriter && /* @__PURE__ */ jsx("button", {
3533
+ disabled: savingTheme || !!Object.keys(invalidFields).length,
3534
+ title: `Save to ${themeWriter.file}`,
3535
+ onClick: async () => {
3536
+ setSavingTheme(true);
3537
+ setMessage("");
3538
+ try {
3539
+ await saveThemeCss(themeWriter, exportText);
3540
+ setMessage(`Saved theme to ${themeWriter.file}.`);
3541
+ } catch (error) {
3542
+ setMessage(error instanceof Error ? error.message : "Could not save theme.");
3543
+ } finally {
3544
+ setSavingTheme(false);
3545
+ }
3546
+ },
3547
+ children: savingTheme ? "Saving theme…" : "Save theme"
3548
+ }),
3549
+ /* @__PURE__ */ jsx("button", {
3550
+ disabled: !!Object.keys(invalidFields).length,
3551
+ onClick: async () => {
3552
+ try {
3553
+ await navigator.clipboard.writeText(exportText);
3554
+ setMessage("Copied to clipboard.");
3555
+ } catch {
3556
+ exportRef.current?.select();
3557
+ setMessage("Clipboard unavailable. The export is selected for manual copying.");
3558
+ }
3559
+ },
3560
+ children: "Copy code"
3561
+ }),
3562
+ /* @__PURE__ */ jsxs("button", {
3563
+ disabled: !!Object.keys(invalidFields).length,
3564
+ onClick: () => {
3565
+ const url = URL.createObjectURL(new Blob([exportText], { type: "text/plain" }));
3566
+ const link = document.createElement("a");
3567
+ link.href = url;
3568
+ link.download = exportTab === "css" ? "povio-theme.css" : exportTab === "overrides" ? "povio-ui-overrides.ts" : "povio-ui-config.ts";
3569
+ link.click();
3570
+ setTimeout(() => URL.revokeObjectURL(url), 1e3);
3571
+ setMessage("Export downloaded.");
3572
+ },
3573
+ children: [/* @__PURE__ */ jsx(ArrowDownToLine, { size: 14 }), " Download"]
3574
+ })
3575
+ ]
3576
+ })
3577
+ ]
3578
+ })
3579
+ ]
3580
+ }),
3581
+ /* @__PURE__ */ jsxs("aside", {
3582
+ ref: previewRef,
3583
+ className: "studio-preview",
3584
+ onScroll: (event_4) => memory.current.previewScroll = event_4.currentTarget.scrollTop,
3585
+ children: [
3586
+ /* @__PURE__ */ jsxs("div", {
3587
+ className: "studio-preview-heading",
3588
+ children: [/* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("i", {}), " LIVE PREVIEW"] }), groups.includes(section) && /* @__PURE__ */ jsxs("div", {
3589
+ className: "studio-preview-modes",
3590
+ role: "group",
3591
+ "aria-label": "Preview mode",
3592
+ children: [/* @__PURE__ */ jsx("button", {
3593
+ type: "button",
3594
+ "aria-pressed": previewMode === "gallery",
3595
+ onClick: () => setPreviewMode("gallery"),
3596
+ children: "Gallery"
3597
+ }), /* @__PURE__ */ jsx("button", {
3598
+ type: "button",
3599
+ "aria-pressed": previewMode === "focused",
3600
+ onClick: () => setPreviewMode("focused"),
3601
+ children: "Token preview"
3602
+ })]
3603
+ })]
3604
+ }),
3605
+ section === "Variants & overrides" || groups.includes(section) && previewMode === "focused" ? /* @__PURE__ */ jsx(ContextualPreview, {
3606
+ variants: cvaVariants,
3607
+ setVariants: setCvaVariants,
3608
+ section,
3609
+ slot: cvaSlot,
3610
+ mode,
3611
+ entries: visibleGroups.flatMap(([, group_6]) => group_6.entries)
3612
+ }) : /* @__PURE__ */ jsx(ComponentPreview, {
3613
+ value: draft,
3614
+ mode,
3615
+ inspector: {
3616
+ isKnown: isInspectable,
3617
+ describe: describeToken,
3618
+ onSelect: focusToken,
3619
+ revision: draft
3620
+ }
3621
+ }),
3622
+ /* @__PURE__ */ jsx("p", {
3623
+ className: "studio-preview-note",
3624
+ children: section === "Variants & overrides" || previewMode === "focused" ? "Preview follows the current section. Variant controls affect only the preview." : "Click a component to inspect its padding, gaps and radius."
3625
+ })
3626
+ ]
3627
+ }),
3628
+ /* @__PURE__ */ jsx(PanelResizeHandle, {
3629
+ label: "Resize editor and preview",
3630
+ column: 2,
3631
+ width: editorWidth,
3632
+ min: 260,
3633
+ max: () => (bodyRef.current?.clientWidth ?? 0) - 320,
3634
+ onResize: setEditorWidth,
3635
+ onReset: () => setEditorWidth(void 0)
3636
+ })
3637
+ ]
3638
+ }),
3639
+ /* @__PURE__ */ jsxs("footer", {
3640
+ className: "studio-footer",
3641
+ children: [
3642
+ /* @__PURE__ */ jsxs("button", {
3643
+ onClick: () => {
3644
+ const hasChanges = !!changedCount || !!Object.keys(invalidFields).length;
3645
+ setNothingToReset(!hasChanges);
3646
+ setConfirmingReset(hasChanges);
3647
+ },
3648
+ children: [/* @__PURE__ */ jsx(RotateCcw, { size: 14 }), " Reset all"]
3649
+ }),
3650
+ /* @__PURE__ */ jsx("span", {
3651
+ role: "status",
3652
+ children: Object.keys(invalidFields).length ? "Fix invalid values or reset before applying or exporting." : nothingToReset && !changedCount ? "No active changes to reset." : message || `${changedCount} overrides · Changes stay in this session`
3653
+ }),
3654
+ /* @__PURE__ */ jsx("button", {
3655
+ onClick: () => cancel(),
3656
+ children: "Cancel"
3657
+ }),
3658
+ /* @__PURE__ */ jsxs("button", {
3659
+ className: "studio-primary",
3660
+ disabled: !!Object.keys(invalidFields).length,
3661
+ onClick: () => {
3662
+ apply();
3663
+ },
3664
+ children: [/* @__PURE__ */ jsx(Check, { size: 15 }), " Apply settings"]
3665
+ })
3666
+ ]
3667
+ }),
3668
+ /* @__PURE__ */ jsx($8b8d26808cb8cb53$export$8948f78d83984c69, {
3669
+ className: "studio-overlay studio-confirm-overlay",
3670
+ isOpen: confirmingReset,
3671
+ onOpenChange: setConfirmingReset,
3672
+ isDismissable: true,
3673
+ children: /* @__PURE__ */ jsx($8b8d26808cb8cb53$export$2b77a92f1a5ad772, {
3674
+ className: "studio-confirm",
3675
+ children: /* @__PURE__ */ jsxs($f2ff30fde7b014be$export$3ddf2d174ce01153, {
3676
+ role: "alertdialog",
3677
+ className: "studio-confirm-dialog",
3678
+ children: [
3679
+ /* @__PURE__ */ jsx($2ec61d1d4f780267$export$a8a3e93435678ff9, {
3680
+ slot: "title",
3681
+ children: "Reset all settings?"
3682
+ }),
3683
+ /* @__PURE__ */ jsxs("p", { children: [
3684
+ "Are you sure you want to reset all settings to the application defaults? All ",
3685
+ changedCount,
3686
+ " overrides will be discarded."
3687
+ ] }),
3688
+ /* @__PURE__ */ jsxs("div", {
3689
+ className: "studio-confirm-actions",
3690
+ children: [/* @__PURE__ */ jsx("button", {
3691
+ autoFocus: true,
3692
+ onClick: () => setConfirmingReset(false),
3693
+ children: "Keep changes"
3694
+ }), /* @__PURE__ */ jsxs("button", {
3695
+ className: "studio-danger",
3696
+ onClick: () => {
3697
+ reset();
3698
+ setConfirmingReset(false);
3699
+ },
3700
+ children: [/* @__PURE__ */ jsx(RotateCcw, { size: 14 }), " Yes, reset all"]
3701
+ })]
3702
+ })
3703
+ ]
3704
+ })
3705
+ })
3706
+ })
3707
+ ]
3708
+ })
3709
+ })
3710
+ });
3711
+ }
3712
+ function UIConfigurationModal() {
3713
+ const $ = c(4);
3714
+ const { isOpen, revision } = useUIConfiguration();
3715
+ let t0;
3716
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
3717
+ t0 = {};
3718
+ $[0] = t0;
3719
+ } else t0 = $[0];
3720
+ const memory = useRef(t0);
3721
+ let t1;
3722
+ if ($[1] !== isOpen || $[2] !== revision) {
3723
+ t1 = isOpen ? /* @__PURE__ */ jsx(ConfigurationModalContent, { memory }, revision) : null;
3724
+ $[1] = isOpen;
3725
+ $[2] = revision;
3726
+ $[3] = t1;
3727
+ } else t1 = $[3];
3728
+ return t1;
3729
+ }
3730
+ //#endregion
3731
+ export { ColorModeSwitch, UIConfigurationModal, UIConfigurationProvider, exportCss, parseThemeCss, useUIConfiguration };