themelia-react-ui 1.0.0 → 1.0.2

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 (507) hide show
  1. package/CHANGELOG.md +190 -1
  2. package/README.md +92 -13
  3. package/dist/{accordion-BRWh3BM1.js → accordion-BRTcsp8J.js} +8 -8
  4. package/dist/accordion-BRTcsp8J.js.map +1 -0
  5. package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
  6. package/dist/action-menu-Drxw_vJk.js.map +1 -0
  7. package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
  8. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
  9. package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-DLVdK0Py.js} +151 -155
  10. package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
  11. package/dist/{app-shell-BH_bGcE2.js → app-shell-C_fKpljx.js} +11 -10
  12. package/dist/app-shell-C_fKpljx.js.map +1 -0
  13. package/dist/{attachment-DsLgNHXt.js → attachment-DbjUWsP0.js} +12 -12
  14. package/dist/{attachment-DsLgNHXt.js.map → attachment-DbjUWsP0.js.map} +1 -1
  15. package/dist/auth-CAQcasMV.js +723 -0
  16. package/dist/auth-CAQcasMV.js.map +1 -0
  17. package/dist/{avatar-CsnWaYmt.js → avatar-Bu2HhitA.js} +76 -71
  18. package/dist/avatar-Bu2HhitA.js.map +1 -0
  19. package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
  20. package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.js.map} +1 -1
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/buttons.js +3 -2
  27. package/dist/base/cards.js +3 -3
  28. package/dist/base/carousel.js +25 -27
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +150 -148
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +3 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +1 -1
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +3 -3
  39. package/dist/base/display.js +7 -7
  40. package/dist/base/feedback.js +4 -3
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +233 -0
  44. package/dist/base/inline-edit.js.map +1 -0
  45. package/dist/base/item.js +1 -1
  46. package/dist/base/media-gallery.js +1 -1
  47. package/dist/base/navigation.js +6 -6
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +1 -1
  51. package/dist/base/repeaters.js +33 -33
  52. package/dist/base/repeaters.js.map +1 -1
  53. package/dist/base/sheet.js +1 -1
  54. package/dist/base/sidebar.js +1 -1
  55. package/dist/base/signature-pad.js +83 -81
  56. package/dist/base/signature-pad.js.map +1 -1
  57. package/dist/base/skeleton.js +1 -1
  58. package/dist/base/spinner.js +1 -1
  59. package/dist/base/structure.js +1 -1
  60. package/dist/base/table.js +1 -1
  61. package/dist/base/text-inputs.js +2 -2
  62. package/dist/base/toaster.js +6 -6
  63. package/dist/base/toaster.js.map +1 -1
  64. package/dist/base/tree.js +1 -1
  65. package/dist/base/upload-queue.js +1 -1
  66. package/dist/base/upload.js +3 -3
  67. package/dist/base/value-inputs.js +1 -1
  68. package/dist/blocks/admin.js +134 -134
  69. package/dist/blocks/admin.js.map +1 -1
  70. package/dist/blocks/ai.js +120 -117
  71. package/dist/blocks/ai.js.map +1 -1
  72. package/dist/blocks/analytics/usage-card.js +3 -0
  73. package/dist/blocks/analytics.js +530 -491
  74. package/dist/blocks/analytics.js.map +1 -1
  75. package/dist/blocks/collaboration.js +2 -2
  76. package/dist/blocks/commerce/receipt.js +1 -1
  77. package/dist/blocks/commerce.js +395 -383
  78. package/dist/blocks/commerce.js.map +1 -1
  79. package/dist/blocks/data-display.js +1 -1
  80. package/dist/blocks/onboarding.js +6 -6
  81. package/dist/blocks/onboarding.js.map +1 -1
  82. package/dist/blocks/planning.js +311 -0
  83. package/dist/blocks/planning.js.map +1 -0
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
  86. package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
  87. package/dist/button-BZDasD04.js +651 -0
  88. package/dist/button-BZDasD04.js.map +1 -0
  89. package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
  90. package/dist/button-BZyfTvwm.js.map +1 -0
  91. package/dist/buttons-D_6KJvEE.js +99 -0
  92. package/dist/buttons-D_6KJvEE.js.map +1 -0
  93. package/dist/{cards-BMB0laLG.js → cards-qGSErLw_.js} +12 -12
  94. package/dist/{cards-BMB0laLG.js.map → cards-qGSErLw_.js.map} +1 -1
  95. package/dist/chart-Bsc5BICK.js +150 -0
  96. package/dist/chart-Bsc5BICK.js.map +1 -0
  97. package/dist/checkbox-BQNDjUCh.js +34 -0
  98. package/dist/checkbox-BQNDjUCh.js.map +1 -0
  99. package/dist/choice-inputs-Mk3iWbhr.js +725 -0
  100. package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
  101. package/dist/{code-block-DIlqzoiD.js → code-block-DzHKRybS.js} +23 -23
  102. package/dist/code-block-DzHKRybS.js.map +1 -0
  103. package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
  104. package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
  105. package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
  106. package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
  107. package/dist/{combobox-HDftpzxt.js → combobox-BFnbJJp3.js} +18 -18
  108. package/dist/combobox-BFnbJJp3.js.map +1 -0
  109. package/dist/{combobox-CHD750do.js → combobox-hozNwUcc.js} +313 -316
  110. package/dist/combobox-hozNwUcc.js.map +1 -0
  111. package/dist/{command-D0kWBZfd.js → command-BnmSchli.js} +9 -9
  112. package/dist/command-BnmSchli.js.map +1 -0
  113. package/dist/comments-u5L0OGip.js +1156 -0
  114. package/dist/comments-u5L0OGip.js.map +1 -0
  115. package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
  116. package/dist/components/base/buttons/button.recipes.d.ts +10 -19
  117. package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
  118. package/dist/components/base/cards/card.recipes.d.ts +13 -5
  119. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
  120. package/dist/components/base/cards/smart-card.types.d.ts +3 -1
  121. package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
  122. package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
  123. package/dist/components/base/forms/form-field.d.ts +1 -0
  124. package/dist/components/base/forms/form-sizing.d.ts +3 -3
  125. package/dist/components/base/inline-edit/index.d.ts +2 -0
  126. package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
  127. package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
  128. package/dist/components/base/navigation/tabs.d.ts +3 -5
  129. package/dist/components/base/popover/popover.recipes.d.ts +3 -3
  130. package/dist/components/base/structure/structure.recipes.d.ts +6 -0
  131. package/dist/components/base/table/index.d.ts +1 -1
  132. package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
  133. package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
  134. package/dist/components/blocks/analytics/index.d.ts +1 -0
  135. package/dist/components/blocks/analytics/types.d.ts +1 -1
  136. package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
  137. package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
  138. package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
  139. package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
  140. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
  141. package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
  142. package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
  143. package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
  144. package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
  145. package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
  146. package/dist/components/blocks/planning/index.d.ts +3 -0
  147. package/dist/components/blocks/planning/task-card.d.ts +3 -0
  148. package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
  149. package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
  150. package/dist/components/features/combobox/components/error-message.d.ts +1 -1
  151. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
  152. package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
  153. package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
  154. package/dist/components/features/media-library/media-library.d.ts +1 -1
  155. package/dist/components/features/media-library/media-library.types.d.ts +9 -1
  156. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  157. package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
  158. package/dist/components/features/overlays/overlays.types.d.ts +5 -4
  159. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
  160. package/dist/components/features/table/data-table.d.ts +1 -1
  161. package/dist/components/features/table/table.types.d.ts +1 -1
  162. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
  163. package/dist/components/layout/auth/auth.types.d.ts +1 -0
  164. package/dist/components/layout/page/page.d.ts +0 -1
  165. package/dist/components/layout/page/page.types.d.ts +9 -3
  166. package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
  167. package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
  168. package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
  169. package/dist/components/typography/heading.d.ts +5 -2
  170. package/dist/components/typography/index.d.ts +1 -1
  171. package/dist/components/typography/text.styles.d.ts +10 -0
  172. package/dist/components/ui/popover.d.ts +1 -1
  173. package/dist/components/ui/sidebar.d.ts +1 -1
  174. package/dist/components/ui/table.d.ts +2 -1
  175. package/dist/container.recipes-D9t8MHR3.js +27 -0
  176. package/dist/container.recipes-D9t8MHR3.js.map +1 -0
  177. package/dist/{containers-CPNyNo1_.js → containers-DqB-bSYE.js} +34 -56
  178. package/dist/containers-DqB-bSYE.js.map +1 -0
  179. package/dist/control-group-recipes-DBXmfh2E.js +21 -0
  180. package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
  181. package/dist/{copyable-B7SBXJMr.js → copyable-BTSByfmq.js} +6 -6
  182. package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
  183. package/dist/{data-display-b3d1TfL4.js → data-display-Bihs9Ven.js} +542 -329
  184. package/dist/data-display-Bihs9Ven.js.map +1 -0
  185. package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
  186. package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
  187. package/dist/{date-picker-DI6kPNof.js → date-picker-DzP5HQq7.js} +492 -472
  188. package/dist/date-picker-DzP5HQq7.js.map +1 -0
  189. package/dist/date-pickers-BpgGz7S-.js +196 -0
  190. package/dist/date-pickers-BpgGz7S-.js.map +1 -0
  191. package/dist/{display-ByI5tkqy.js → display-CS6Hbk18.js} +8 -8
  192. package/dist/{display-ByI5tkqy.js.map → display-CS6Hbk18.js.map} +1 -1
  193. package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
  194. package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
  195. package/dist/features/activities.js +152 -141
  196. package/dist/features/activities.js.map +1 -1
  197. package/dist/features/ai-chat.js +182 -179
  198. package/dist/features/ai-chat.js.map +1 -1
  199. package/dist/features/async-preview.js +9 -9
  200. package/dist/features/async-preview.js.map +1 -1
  201. package/dist/features/combobox.js +1 -1
  202. package/dist/features/comments.js +1 -1
  203. package/dist/features/data-view.js +25 -23
  204. package/dist/features/data-view.js.map +1 -1
  205. package/dist/features/email-composer/engine.js +1 -1
  206. package/dist/features/email-composer.js +103 -104
  207. package/dist/features/email-composer.js.map +1 -1
  208. package/dist/features/event-calendar.js +375 -373
  209. package/dist/features/event-calendar.js.map +1 -1
  210. package/dist/features/filters.js +1 -1
  211. package/dist/features/global-search.js +222 -224
  212. package/dist/features/global-search.js.map +1 -1
  213. package/dist/features/kanban.js +29 -29
  214. package/dist/features/kanban.js.map +1 -1
  215. package/dist/features/map.js +59 -58
  216. package/dist/features/map.js.map +1 -1
  217. package/dist/features/media-library.js +856 -855
  218. package/dist/features/media-library.js.map +1 -1
  219. package/dist/features/mentions.js +1 -1
  220. package/dist/features/overlays.js +1 -1
  221. package/dist/features/products.js +1210 -1209
  222. package/dist/features/products.js.map +1 -1
  223. package/dist/features/questionnaire.js +133 -132
  224. package/dist/features/questionnaire.js.map +1 -1
  225. package/dist/features/resource-assignment.js +29 -31
  226. package/dist/features/resource-assignment.js.map +1 -1
  227. package/dist/features/resource.js +13 -13
  228. package/dist/features/resource.js.map +1 -1
  229. package/dist/features/rich-text-editor.js +2 -2
  230. package/dist/features/schema-form.js +82 -82
  231. package/dist/features/schema-form.js.map +1 -1
  232. package/dist/features/suggestions.js +3 -3
  233. package/dist/features/sync.js +4 -4
  234. package/dist/features/sync.js.map +1 -1
  235. package/dist/features/table.js +1 -1
  236. package/dist/features/theme-tweaker.js +456 -450
  237. package/dist/features/theme-tweaker.js.map +1 -1
  238. package/dist/feedback-CJkUAapr.js +233 -0
  239. package/dist/feedback-CJkUAapr.js.map +1 -0
  240. package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
  241. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
  242. package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
  243. package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
  244. package/dist/{filters-qtrcv1hf.js → filters-D6FF8L6s.js} +715 -720
  245. package/dist/filters-D6FF8L6s.js.map +1 -0
  246. package/dist/{form-field-C6W-y2hR.js → form-field-CZwrkP7m.js} +17 -9
  247. package/dist/form-field-CZwrkP7m.js.map +1 -0
  248. package/dist/{form-sizing-39NohSqn.js → form-sizing-QP8aIRaW.js} +10 -6
  249. package/dist/form-sizing-QP8aIRaW.js.map +1 -0
  250. package/dist/{forms-BF-HSbff.js → forms-B5NCbkSC.js} +35 -35
  251. package/dist/{forms-BF-HSbff.js.map → forms-B5NCbkSC.js.map} +1 -1
  252. package/dist/forms-numeric-Crrm80Lm.js +867 -0
  253. package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
  254. package/dist/{header-B8ex54cY.js → header-kxruN3RM.js} +53 -49
  255. package/dist/header-kxruN3RM.js.map +1 -0
  256. package/dist/{hooks-D6UBVzf2.js → hooks-BrlnCwQd.js} +2 -2
  257. package/dist/{hooks-D6UBVzf2.js.map → hooks-BrlnCwQd.js.map} +1 -1
  258. package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
  259. package/dist/http-CdEIHyQf.js.map +1 -0
  260. package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-Btc6pQrp.js} +4 -4
  261. package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
  262. package/dist/index.js +2 -2
  263. package/dist/input-SX9V0AL3.js +255 -0
  264. package/dist/input-SX9V0AL3.js.map +1 -0
  265. package/dist/input-vxcaNCYC.js +20 -0
  266. package/dist/input-vxcaNCYC.js.map +1 -0
  267. package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
  268. package/dist/item-DE4YnuJx.js.map +1 -0
  269. package/dist/layout/app-shell.js +1 -1
  270. package/dist/layout/auth.js +1 -1
  271. package/dist/layout/containers.js +1 -1
  272. package/dist/layout/header.js +1 -1
  273. package/dist/layout/hooks.js +1 -1
  274. package/dist/layout/navigation.js +1 -1
  275. package/dist/layout/page.js +1 -1
  276. package/dist/layout/settings.js +1 -1
  277. package/dist/layout/sidebar.js +2 -2
  278. package/dist/layout/workspace.js +1 -1
  279. package/dist/layout.js +10 -10
  280. package/dist/lib/affordance-geometry.generated.d.ts +44 -4
  281. package/dist/lib/control-group-recipes.d.ts +22 -0
  282. package/dist/lib/field-affordance-recipes.d.ts +35 -2
  283. package/dist/lib/field-state-recipes.d.ts +2 -2
  284. package/dist/lib/navigation-row-recipes.d.ts +3 -2
  285. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
  286. package/dist/lib/surface-recipes.d.ts +5 -2
  287. package/dist/lib/token-merge.generated.d.ts +144 -2
  288. package/dist/lib/ui-provider/types.d.ts +4 -2
  289. package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
  290. package/dist/lib/utils.js +1 -1
  291. package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DLp3HAz0.js} +75 -74
  292. package/dist/media-gallery-DLp3HAz0.js.map +1 -0
  293. package/dist/{mentions-CRio8mTm.js → mentions-Cl0Kt_Pd.js} +52 -50
  294. package/dist/{mentions-CRio8mTm.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
  295. package/dist/message-SZUNB1eX.js +127 -0
  296. package/dist/message-SZUNB1eX.js.map +1 -0
  297. package/dist/{navigation-BTrEb5u4.js → navigation-DnQSNMT0.js} +64 -55
  298. package/dist/navigation-DnQSNMT0.js.map +1 -0
  299. package/dist/{navigation-DqEITuD2.js → navigation-DyytsLRB.js} +37 -37
  300. package/dist/navigation-DyytsLRB.js.map +1 -0
  301. package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
  302. package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
  303. package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
  304. package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
  305. package/dist/overlays-DUbs1KEi.js +1011 -0
  306. package/dist/overlays-DUbs1KEi.js.map +1 -0
  307. package/dist/{page-BMBGjJY8.js → page-hGmT4nWK.js} +75 -64
  308. package/dist/page-hGmT4nWK.js.map +1 -0
  309. package/dist/{page-header-BH41wCyY.js → page-header-D8nERkn5.js} +9 -9
  310. package/dist/page-header-D8nERkn5.js.map +1 -0
  311. package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
  312. package/dist/pagination-NLGqRirf.js.map +1 -0
  313. package/dist/{popover-TInGXsjg.js → popover-CghIYdQf.js} +23 -22
  314. package/dist/popover-CghIYdQf.js.map +1 -0
  315. package/dist/{popover-menu-BzqXqE72.js → popover-menu-B4PoWhRl.js} +6 -6
  316. package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
  317. package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
  318. package/dist/popover.recipes-QlD4JenO.js.map +1 -0
  319. package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
  320. package/dist/primitives-C7ff0QaI.js.map +1 -0
  321. package/dist/primitives.js +3 -3
  322. package/dist/progress-BroqrAyV.js +169 -0
  323. package/dist/progress-BroqrAyV.js.map +1 -0
  324. package/dist/{receipt-DYWTQGEc.js → receipt-BuJynLgf.js} +8 -8
  325. package/dist/{receipt-DYWTQGEc.js.map → receipt-BuJynLgf.js.map} +1 -1
  326. package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
  327. package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
  328. package/dist/rich-text-editor-BKyG7rWz.js +574 -0
  329. package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
  330. package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
  331. package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
  332. package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
  333. package/dist/scroll-area-D-pIhEKl.js.map +1 -0
  334. package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
  335. package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
  336. package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
  337. package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
  338. package/dist/services/actions.js +1 -1
  339. package/dist/{settings-D9f_wdIC.js → settings-DOTOzeZ2.js} +10 -9
  340. package/dist/{settings-D9f_wdIC.js.map → settings-DOTOzeZ2.js.map} +1 -1
  341. package/dist/{sheet-vOUloJ4O.js → sheet-BFhrNehm.js} +11 -11
  342. package/dist/sheet-BFhrNehm.js.map +1 -0
  343. package/dist/{sidebar-CNBKFDRW.js → sidebar-CyR4XKwR.js} +219 -200
  344. package/dist/sidebar-CyR4XKwR.js.map +1 -0
  345. package/dist/{sidebar-C3UKkbC5.js → sidebar-SvGJ0Zwi.js} +63 -58
  346. package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
  347. package/dist/{skeleton-BvRhK8y-.js → skeleton-3F0uhYn3.js} +4 -4
  348. package/dist/{skeleton-BvRhK8y-.js.map → skeleton-3F0uhYn3.js.map} +1 -1
  349. package/dist/{smart-card-B5FcKODh.js → smart-card-DjGVV2xr.js} +206 -199
  350. package/dist/smart-card-DjGVV2xr.js.map +1 -0
  351. package/dist/{spinner-JtlFJ7Nc.js → spinner-Cpf7oRkF.js} +5 -5
  352. package/dist/{spinner-JtlFJ7Nc.js.map → spinner-Cpf7oRkF.js.map} +1 -1
  353. package/dist/{structure-BvW4vG4H.js → structure-CRdqVawd.js} +14 -14
  354. package/dist/{structure-BvW4vG4H.js.map → structure-CRdqVawd.js.map} +1 -1
  355. package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
  356. package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
  357. package/dist/style.css +1 -1
  358. package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
  359. package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
  360. package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
  361. package/dist/table-CLtJTxoR.js.map +1 -0
  362. package/dist/table-CcRDZiLP.js +1444 -0
  363. package/dist/table-CcRDZiLP.js.map +1 -0
  364. package/dist/tabs-BNgu7g0u.js +188 -0
  365. package/dist/tabs-BNgu7g0u.js.map +1 -0
  366. package/dist/text-inputs-DsR56TR-.js +330 -0
  367. package/dist/text-inputs-DsR56TR-.js.map +1 -0
  368. package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
  369. package/dist/text.styles-Q4sGAIgA.js.map +1 -0
  370. package/dist/theme.css +77 -115
  371. package/dist/{timelines-CnZ2S_Gr.js → timelines-D1pkt3se.js} +84 -78
  372. package/dist/timelines-D1pkt3se.js.map +1 -0
  373. package/dist/{tree-COD9BGdU.js → tree-BtmYyMZV.js} +8 -8
  374. package/dist/{tree-COD9BGdU.js.map → tree-BtmYyMZV.js.map} +1 -1
  375. package/dist/typography/rich-text.js +1 -1
  376. package/dist/typography-BxQgiZyw.js +96 -0
  377. package/dist/typography-BxQgiZyw.js.map +1 -0
  378. package/dist/typography.js +1 -1
  379. package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
  380. package/dist/ui-provider-DRPn3qNl.js.map +1 -0
  381. package/dist/ui-provider.js +1 -1
  382. package/dist/{upload-DIzw1dx1.js → upload-CDbYw1WN.js} +326 -323
  383. package/dist/upload-CDbYw1WN.js.map +1 -0
  384. package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-CNd_hH_a.js} +25 -25
  385. package/dist/upload-queue-CNd_hH_a.js.map +1 -0
  386. package/dist/usage-card-VyJLUwRr.js +457 -0
  387. package/dist/usage-card-VyJLUwRr.js.map +1 -0
  388. package/dist/utils-BvH9PSmq.js +4275 -0
  389. package/dist/utils-BvH9PSmq.js.map +1 -0
  390. package/dist/value-inputs-D0KCrfVC.js +840 -0
  391. package/dist/value-inputs-D0KCrfVC.js.map +1 -0
  392. package/dist/{workspace-Cbqz4FzN.js → workspace-CcR8r-Nt.js} +115 -122
  393. package/dist/workspace-CcR8r-Nt.js.map +1 -0
  394. package/docs/consumer-skill/SKILL.md +112 -18
  395. package/docs/consumer-skill/examples/analytics.tsx +34 -0
  396. package/docs/consumer-skill/examples/app-layout.tsx +42 -12
  397. package/docs/consumer-skill/examples/detail.tsx +24 -9
  398. package/docs/consumer-skill/examples/manifest.json +27 -1
  399. package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
  400. package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
  401. package/docs/consumer-skill/examples/website.tsx +56 -0
  402. package/docs/consumer-skill/references/analytics.md +70 -0
  403. package/docs/consumer-skill/references/composition.md +219 -2
  404. package/docs/consumer-skill/references/design-contract.md +37 -10
  405. package/docs/consumer-skill/references/discovery.md +93 -5
  406. package/docs/consumer-skill/references/installation.md +20 -3
  407. package/docs/consumer-skill/references/integration.md +26 -0
  408. package/docs/consumer-skill/references/public-api.json +2416 -388
  409. package/docs/consumer-skill/references/review.md +126 -0
  410. package/docs/consumer-skill/references/theming.md +52 -7
  411. package/docs/consumer-skill/references/tokens.json +177 -9
  412. package/docs/consumer-skill/references/workflows.md +129 -1
  413. package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
  414. package/docs/consumer-skill/scripts/composition-policy.mjs +317 -0
  415. package/docs/consumer-skill/scripts/discovery.mjs +65 -8
  416. package/docs/consumer-skill/scripts/surface-policy.mjs +66 -0
  417. package/package.json +30 -6
  418. package/dist/accordion-BRWh3BM1.js.map +0 -1
  419. package/dist/action-menu-Cx3SdfbN.js.map +0 -1
  420. package/dist/affordance-geometry.generated-DXl-Zb3Z.js +0 -23
  421. package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
  422. package/dist/ai-artifact-DkOArd3-.js.map +0 -1
  423. package/dist/app-shell-BH_bGcE2.js.map +0 -1
  424. package/dist/auth-BDB1V_2q.js +0 -704
  425. package/dist/auth-BDB1V_2q.js.map +0 -1
  426. package/dist/avatar-CsnWaYmt.js.map +0 -1
  427. package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
  428. package/dist/button-BS6l5JUw.js.map +0 -1
  429. package/dist/buttons-Co6GavvM.js +0 -674
  430. package/dist/buttons-Co6GavvM.js.map +0 -1
  431. package/dist/chart-DVfcwQu6.js +0 -149
  432. package/dist/chart-DVfcwQu6.js.map +0 -1
  433. package/dist/choice-inputs-CavA-SGV.js +0 -644
  434. package/dist/choice-inputs-CavA-SGV.js.map +0 -1
  435. package/dist/code-block-DIlqzoiD.js.map +0 -1
  436. package/dist/combobox-CHD750do.js.map +0 -1
  437. package/dist/combobox-HDftpzxt.js.map +0 -1
  438. package/dist/command-D0kWBZfd.js.map +0 -1
  439. package/dist/comments-CvYeglMS.js +0 -1132
  440. package/dist/comments-CvYeglMS.js.map +0 -1
  441. package/dist/containers-CPNyNo1_.js.map +0 -1
  442. package/dist/data-display-b3d1TfL4.js.map +0 -1
  443. package/dist/date-picker-DI6kPNof.js.map +0 -1
  444. package/dist/date-pickers-ByP6Cv2z.js +0 -224
  445. package/dist/date-pickers-ByP6Cv2z.js.map +0 -1
  446. package/dist/feedback-a9j9J-9A.js +0 -391
  447. package/dist/feedback-a9j9J-9A.js.map +0 -1
  448. package/dist/field-affordance-recipes-CHdUtn2Z.js +0 -17
  449. package/dist/field-affordance-recipes-CHdUtn2Z.js.map +0 -1
  450. package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
  451. package/dist/filters-qtrcv1hf.js.map +0 -1
  452. package/dist/form-field-C6W-y2hR.js.map +0 -1
  453. package/dist/form-sizing-39NohSqn.js.map +0 -1
  454. package/dist/forms-numeric-Y15Bg5Nr.js +0 -867
  455. package/dist/forms-numeric-Y15Bg5Nr.js.map +0 -1
  456. package/dist/header-B8ex54cY.js.map +0 -1
  457. package/dist/http-CLTVJc5I.js.map +0 -1
  458. package/dist/input-DMorJiTI.js +0 -202
  459. package/dist/input-DMorJiTI.js.map +0 -1
  460. package/dist/input-ci9fIgFH.js +0 -20
  461. package/dist/input-ci9fIgFH.js.map +0 -1
  462. package/dist/item-pJ0GsOiJ.js.map +0 -1
  463. package/dist/media-gallery-Ca4YmvBi.js.map +0 -1
  464. package/dist/message-B5-6LeYl.js +0 -108
  465. package/dist/message-B5-6LeYl.js.map +0 -1
  466. package/dist/navigation-BTrEb5u4.js.map +0 -1
  467. package/dist/navigation-DqEITuD2.js.map +0 -1
  468. package/dist/navigation-row-recipes-BFpvGPGE.js.map +0 -1
  469. package/dist/overlays-DBqV0J_V.js +0 -982
  470. package/dist/overlays-DBqV0J_V.js.map +0 -1
  471. package/dist/page-BMBGjJY8.js.map +0 -1
  472. package/dist/page-header-BH41wCyY.js.map +0 -1
  473. package/dist/pagination-C29vvt3I.js.map +0 -1
  474. package/dist/popover-TInGXsjg.js.map +0 -1
  475. package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
  476. package/dist/primitives-DKPOGVpj.js.map +0 -1
  477. package/dist/rich-text-editor-BZSJchAF.js +0 -575
  478. package/dist/rich-text-editor-BZSJchAF.js.map +0 -1
  479. package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
  480. package/dist/scroll-area-BheMQ270.js.map +0 -1
  481. package/dist/select-B2mb-qN2.js +0 -108
  482. package/dist/select-B2mb-qN2.js.map +0 -1
  483. package/dist/sheet-vOUloJ4O.js.map +0 -1
  484. package/dist/sidebar-C3UKkbC5.js.map +0 -1
  485. package/dist/sidebar-CNBKFDRW.js.map +0 -1
  486. package/dist/smart-card-B5FcKODh.js.map +0 -1
  487. package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
  488. package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
  489. package/dist/table-DnlAJ-xR.js.map +0 -1
  490. package/dist/table-ghtAQ-JJ.js +0 -1424
  491. package/dist/table-ghtAQ-JJ.js.map +0 -1
  492. package/dist/tabs-DY09eoZg.js +0 -187
  493. package/dist/tabs-DY09eoZg.js.map +0 -1
  494. package/dist/text-inputs-BhOcedTo.js +0 -331
  495. package/dist/text-inputs-BhOcedTo.js.map +0 -1
  496. package/dist/text.styles-BwB7vAF2.js.map +0 -1
  497. package/dist/timelines-CnZ2S_Gr.js.map +0 -1
  498. package/dist/typography-Cv8MT-82.js +0 -96
  499. package/dist/typography-Cv8MT-82.js.map +0 -1
  500. package/dist/ui-provider-CftIB6TY.js.map +0 -1
  501. package/dist/upload-DIzw1dx1.js.map +0 -1
  502. package/dist/upload-queue-xRJ3qDmd.js.map +0 -1
  503. package/dist/utils-C2EKeIw3.js +0 -72
  504. package/dist/utils-C2EKeIw3.js.map +0 -1
  505. package/dist/value-inputs-Co1fu-xv.js +0 -824
  506. package/dist/value-inputs-Co1fu-xv.js.map +0 -1
  507. package/dist/workspace-Cbqz4FzN.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"schema-form.js","names":["Text","Stack","Input","Textarea","ContentBlock","FormField","ToggleField","CardCheckboxGroup","Select","SwitchCard","CardRadioGroup","TagsInput","DecimalInput","EmptyState","SCHEMA_FORM_COLUMNS","SCHEMA_FORM_FIELD_WIDTH","isFieldHidden","field","values","error","onError","isFieldDisabled","getVisibleFields","fields","resolveSchemaSections","visibleFields","schema","fieldsByKey","usedKeys","sections","section","sectionFields","key","defaultColumns","unsectioned","defaultSectionTitle","toStringValue","value","toStringArray","item","toBooleanValue","parseNumberValue","trimmed","rawValue","parsed","integer","formatJsonValue","indent","parseJsonValue","getDefaultValues","defaultValue","shouldRequireValue","normalizeErrors","next","message","errors","useSchemaForm","externalErrors","isControlled","initialValues","useMemo","internalValues","setInternalValues","useState","validationErrors","setValidationErrors","mergedErrors","setValues","useCallback","nextValues","onValueChange","setFieldValue","fieldValue","current","onFieldChange","reset","validate","nextErrors","formatRequiredError","validators","validator","result","validationError","SchemaFormActions","cn","className","showReset","Button","disabled","resetDisabled","submitting","onReset","resetLabel","submitDisabled","submitLabel","SchemaFormEmpty","getFieldHint","getTextDisplayValue","parseTextValue","parseNumberFieldValue","parseJsonFieldValue","optionIconNode","option","Icon","JsonFieldControl","text","setText","parseError","setParseError","isFocused","setIsFocused","useEffect","commit","strings","fieldId","event","SchemaFormFieldRenderer","fieldType","commonFieldProps","controlClassName","describedBy","checked","displayValue","decimalPlaces","options","inputType","nativeInputProps","defaultSchemaFormStrings","label","toDomId","SectionHeading","SchemaForm","stringsProp","generatedId","useId","formId","id","useStrings","form","columns","hasFields","helpers","shouldShowActions","showActions","onSubmit","actionsSlot","resolvedSubmitLabel","resolvedResetLabel","renderFieldNode","fieldDisabled","context","nextValue","defaultField","fieldClassName","renderField","renderSectionFields","renderPlainSection","custom","renderSection","sectionClassName","Fragment","renderCardSection","actions","empty","emptySlot","layout","contentClassName","title","description","headerSlot","footerSlot"],"sources":["../../src/components/features/schema-form/schema-form.utils.ts","../../src/components/features/schema-form/hooks/use-schema-form.ts","../../src/components/features/schema-form/partials/schema-form-actions.tsx","../../src/components/features/schema-form/partials/schema-form-empty.tsx","../../src/components/features/schema-form/partials/schema-form-field.tsx","../../src/components/features/schema-form/schema-form.strings.ts","../../src/components/features/schema-form/schema-form.tsx"],"sourcesContent":["import type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldWidth,\n\tSchemaFormSchema,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from './schema-form.types';\n\ntype SchemaFormErrorHandler = (error: unknown) => void;\n\n/*\n * Container widths, not viewport widths — a schema form is as often rendered in\n * a drawer or a side panel as at page width, and keyed to the screen it kept\n * three field columns inside a 320px drawer. 448/576 clears every width these\n * forms render at today (672-814px) while collapsing below a real drawer.\n */\nexport const SCHEMA_FORM_COLUMNS: Record<1 | 2 | 3, string> = {\n\t1: 'grid grid-cols-1 gap-4',\n\t2: 'grid grid-cols-1 gap-4 @md/schema-form:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-4 @md/schema-form:grid-cols-2 @xl/schema-form:grid-cols-3',\n};\n\nexport const SCHEMA_FORM_FIELD_WIDTH: Record<SchemaFormFieldWidth, string> = {\n\tauto: '',\n\thalf: '@md/schema-form:col-span-1',\n\tthird: '@xl/schema-form:col-span-1',\n\tfull: '@md/schema-form:col-span-full @xl/schema-form:col-span-full',\n};\n\nexport function isFieldHidden(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.hidden === 'function') {\n\t\ttry {\n\t\t\treturn field.hidden(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn field.hidden ?? false;\n}\n\nexport function isFieldDisabled(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.disabled === 'function') {\n\t\ttry {\n\t\t\treturn field.disabled(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn field.disabled ?? false;\n}\n\nexport function getVisibleFields(\n\tfields: SchemaFormField[],\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): SchemaFormField[] {\n\treturn fields.filter((field) => !isFieldHidden(field, values, onError));\n}\n\nexport function resolveSchemaSections(\n\tschema: SchemaFormSchema,\n\tvalues: SchemaFormValues,\n\tdefaultSectionTitle: string,\n\tdefaultColumns: 1 | 2 | 3,\n\tonError?: SchemaFormErrorHandler,\n): ResolvedSchemaFormSection[] {\n\tconst visibleFields = getVisibleFields(schema.fields, values, onError);\n\tconst fieldsByKey = new Map(visibleFields.map((field) => [field.key, field]));\n\tconst usedKeys = new Set<string>();\n\tconst sections: ResolvedSchemaFormSection[] = [];\n\n\tfor (const section of schema.sections ?? []) {\n\t\tconst sectionFields = section.fields\n\t\t\t? section.fields\n\t\t\t\t\t.map((key) => fieldsByKey.get(key))\n\t\t\t\t\t.filter((field): field is SchemaFormField => field !== undefined)\n\t\t\t: visibleFields.filter((field) => field.sectionId === section.id);\n\n\t\tfor (const field of sectionFields) {\n\t\t\tusedKeys.add(field.key);\n\t\t}\n\n\t\tsections.push({\n\t\t\tid: section.id,\n\t\t\ttitle: section.title,\n\t\t\tdescription: section.description,\n\t\t\ticon: section.icon,\n\t\t\tfields: sectionFields,\n\t\t\tcolumns: section.columns ?? defaultColumns,\n\t\t\tfooterSlot: section.footerSlot,\n\t\t\tclassName: section.className,\n\t\t});\n\t}\n\n\tconst unsectioned = visibleFields.filter((field) => !usedKeys.has(field.key));\n\tif (unsectioned.length > 0 || sections.length === 0) {\n\t\tsections.unshift({\n\t\t\tid: 'default',\n\t\t\ttitle: schema.sections?.length ? defaultSectionTitle : undefined,\n\t\t\tfields: unsectioned,\n\t\t\tcolumns: defaultColumns,\n\t\t});\n\t}\n\n\treturn sections.filter((section) => section.fields.length > 0);\n}\n\nexport function toStringValue(value: SchemaFormValue): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\treturn JSON.stringify(value);\n}\n\nexport function toStringArray(value: SchemaFormValue): string[] {\n\tif (!Array.isArray(value)) return [];\n\treturn value.map((item) => String(item));\n}\n\nexport function toBooleanValue(value: SchemaFormValue): boolean {\n\treturn value === true || value === 'true' || value === 1;\n}\n\nexport function parseNumberValue(rawValue: string, integer = false): number | null {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return null;\n\tconst parsed = integer ? Number.parseInt(trimmed, 10) : Number.parseFloat(trimmed);\n\treturn Number.isNaN(parsed) ? null : parsed;\n}\n\nexport function formatJsonValue(value: SchemaFormValue, indent = 2): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return value;\n\ttry {\n\t\treturn JSON.stringify(value, null, indent);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nexport function parseJsonValue(rawValue: string): { value: SchemaFormValue; valid: boolean } {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return { value: null, valid: true };\n\n\ttry {\n\t\treturn { value: JSON.parse(trimmed) as SchemaFormValue, valid: true };\n\t} catch {\n\t\treturn { value: rawValue, valid: false };\n\t}\n}\n","import { useCallback, useMemo, useState } from 'react';\n\nimport type {\n\tSchemaFormErrors,\n\tSchemaFormField,\n\tSchemaFormSubmitHelpers,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport { isFieldHidden } from '../schema-form.utils';\n\nexport interface UseSchemaFormOptions {\n\tfields: SchemaFormField[];\n\tvalue?: SchemaFormValues;\n\tdefaultValue?: SchemaFormValues;\n\terrors?: SchemaFormErrors;\n\tonValueChange?: (values: SchemaFormValues) => void;\n\tonFieldChange?: (key: string, value: SchemaFormValue, values: SchemaFormValues) => void;\n\tformatRequiredError: (label: string) => string;\n\tvalidationError: string;\n\tonError?: (error: unknown) => void;\n}\n\nexport interface UseSchemaFormResult extends SchemaFormSubmitHelpers {\n\tvalues: SchemaFormValues;\n\terrors: SchemaFormErrors;\n\tgetFieldError: (key: string) => string | undefined;\n\tgetFieldValue: (key: string) => SchemaFormValue;\n\tsetFieldValue: (key: string, value: SchemaFormValue) => void;\n\tsetValues: (values: SchemaFormValues) => void;\n\treset: () => SchemaFormValues;\n\tvalidate: () => boolean;\n}\n\nfunction getDefaultValues(fields: SchemaFormField[], defaultValue?: SchemaFormValues): SchemaFormValues {\n\tconst values: SchemaFormValues = { ...(defaultValue ?? {}) };\n\n\tfor (const field of fields) {\n\t\tif (field.defaultValue !== undefined && values[field.key] === undefined) {\n\t\t\tvalues[field.key] = field.defaultValue;\n\t\t}\n\t}\n\n\treturn values;\n}\n\nfunction shouldRequireValue(value: SchemaFormValue): boolean {\n\tif (value === undefined || value === null) return true;\n\tif (typeof value === 'string') return value.trim().length === 0;\n\tif (Array.isArray(value)) return value.length === 0;\n\treturn false;\n}\n\nfunction normalizeErrors(errors?: SchemaFormErrors): SchemaFormErrors {\n\tconst next: SchemaFormErrors = {};\n\tfor (const [key, message] of Object.entries(errors ?? {})) {\n\t\tif (message) next[key] = message;\n\t}\n\treturn next;\n}\n\nexport function useSchemaForm({\n\tfields,\n\tvalue,\n\tdefaultValue,\n\terrors: externalErrors,\n\tonValueChange,\n\tonFieldChange,\n\tformatRequiredError,\n\tvalidationError,\n\tonError,\n}: UseSchemaFormOptions): UseSchemaFormResult {\n\tconst isControlled = value !== undefined;\n\tconst initialValues = useMemo(\n\t\t() => getDefaultValues(fields, defaultValue),\n\t\t[defaultValue, fields],\n\t);\n\tconst [internalValues, setInternalValues] = useState<SchemaFormValues>(() => initialValues);\n\tconst [validationErrors, setValidationErrors] = useState<SchemaFormErrors>({});\n\tconst values = useMemo(\n\t\t() => (isControlled ? { ...initialValues, ...(value ?? {}) } : internalValues),\n\t\t[initialValues, internalValues, isControlled, value],\n\t);\n\n\tconst mergedErrors = useMemo(\n\t\t() => ({\n\t\t\t...validationErrors,\n\t\t\t...normalizeErrors(externalErrors),\n\t\t}),\n\t\t[externalErrors, validationErrors],\n\t);\n\n\tconst setValues = useCallback(\n\t\t(nextValues: SchemaFormValues) => {\n\t\t\tif (!isControlled) setInternalValues(nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onValueChange],\n\t);\n\n\tconst setFieldValue = useCallback(\n\t\t(key: string, fieldValue: SchemaFormValue) => {\n\t\t\tconst nextValues = { ...values, [key]: fieldValue };\n\t\t\tif (!isControlled) setInternalValues(nextValues);\n\t\t\tsetValidationErrors((current) => {\n\t\t\t\tif (!current[key]) return current;\n\t\t\t\tconst next = { ...current };\n\t\t\t\tdelete next[key];\n\t\t\t\treturn next;\n\t\t\t});\n\t\t\tonFieldChange?.(key, fieldValue, nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onFieldChange, onValueChange, values],\n\t);\n\n\tconst reset = useCallback(() => {\n\t\tconst nextValues = getDefaultValues(fields, defaultValue);\n\t\tif (!isControlled) setInternalValues(nextValues);\n\t\tsetValidationErrors({});\n\t\tonValueChange?.(nextValues);\n\t\treturn nextValues;\n\t}, [defaultValue, fields, isControlled, onValueChange]);\n\n\tconst validate = useCallback(() => {\n\t\tconst nextErrors: SchemaFormErrors = {};\n\n\t\tfor (const field of fields) {\n\t\t\tif (isFieldHidden(field, values, onError)) continue;\n\n\t\t\tconst fieldValue = values[field.key];\n\t\t\tif (field.required && shouldRequireValue(fieldValue)) {\n\t\t\t\tnextErrors[field.key] = formatRequiredError(field.label);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst validators = Array.isArray(field.validate)\n\t\t\t\t? field.validate\n\t\t\t\t: field.validate\n\t\t\t\t\t? [field.validate]\n\t\t\t\t\t: [];\n\n\t\t\tfor (const validator of validators) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = validator(fieldValue, values, field);\n\t\t\t\t\tif (typeof result === 'string' && result.length > 0) {\n\t\t\t\t\t\tnextErrors[field.key] = result;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\tnextErrors[field.key] = validationError;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsetValidationErrors(nextErrors);\n\t\treturn Object.keys(nextErrors).length === 0;\n\t}, [fields, formatRequiredError, onError, validationError, values]);\n\n\tconst getFieldError = useCallback(\n\t\t(key: string) => mergedErrors[key],\n\t\t[mergedErrors],\n\t);\n\n\tconst getFieldValue = useCallback(\n\t\t(key: string) => values[key],\n\t\t[values],\n\t);\n\n\treturn {\n\t\tvalues,\n\t\terrors: mergedErrors,\n\t\tgetFieldError,\n\t\tgetFieldValue,\n\t\tsetFieldValue,\n\t\tsetValues,\n\t\treset,\n\t\tvalidate,\n\t};\n}\n","import { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormActionsProps {\n\t/** Copy for the submit button. */\n\tsubmitLabel: string;\n\t/** Copy for the reset button. */\n\tresetLabel: string;\n\t/** Renders the reset. */\n\tshowReset?: boolean;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Disables the submit button. */\n\tsubmitDisabled?: boolean;\n\t/** Disables the reset button. */\n\tresetDisabled?: boolean;\n\t/** Shows the pending state on submit. */\n\tsubmitting?: boolean;\n\tonReset?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormActions({\n\tsubmitLabel,\n\tresetLabel,\n\tshowReset = false,\n\tdisabled = false,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonReset,\n\tclassName,\n}: SchemaFormActionsProps) {\n\treturn (\n\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"end\" gap=\"md\" className={cn('schema-form-actions--component', className)}>\n\t\t\t{!!showReset && (\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\tdisabled={disabled || resetDisabled || submitting}\n\t\t\t\t\tonClick={onReset}\n\t\t\t\t>\n\t\t\t\t\t{resetLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\ttone=\"primary\"\n\t\t\t\tloading={submitting}\n\t\t\t\tdisabled={disabled || submitDisabled}\n\t\t\t>\n\t\t\t\t{submitLabel}\n\t\t\t</Button>\n\t\t</Stack>\n\t);\n}\n\nSchemaFormActions.displayName = 'SchemaFormActions';\n","import { EmptyState } from '../../../blocks/data-display';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormEmptyProps {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormEmpty({ title, description, className }: SchemaFormEmptyProps) {\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tpadding=\"md\"\n\t\t\tborder\n\t\t\tclassName={cn('schema-form-empty--component bg-muted/20', className)}\n\t\t/>\n\t);\n}\n\nSchemaFormEmpty.displayName = 'SchemaFormEmpty';\n","import { useEffect, useState, type ElementType } from 'react';\n\nimport { CardCheckboxGroup, CardRadioGroup, Select, SwitchCard, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input, Textarea } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput } from '../../../base/forms-numeric';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SchemaFormStrings } from '../schema-form.strings';\nimport type {\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport {\n\tformatJsonValue,\n\tparseJsonValue,\n\tparseNumberValue,\n\ttoBooleanValue,\n\ttoStringArray,\n\ttoStringValue,\n} from '../schema-form.utils';\n\nexport interface SchemaFormFieldRendererProps extends SchemaFormFieldContext {\n\t/** Overrides this surface's own copy. */\n\tstrings: SchemaFormStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nfunction getFieldHint(field: SchemaFormField): string | undefined {\n\treturn field.hint ?? field.description;\n}\n\nfunction getTextDisplayValue(\n\tfield: SchemaFormField,\n\tvalue: SchemaFormValue,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): string {\n\tif (field.formatValue) {\n\t\ttry {\n\t\t\treturn field.formatValue(value, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn toStringValue(value);\n}\n\nfunction parseTextValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn rawValue;\n}\n\nfunction parseNumberFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tinteger: boolean,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn parseNumberValue(rawValue, integer);\n}\n\nfunction parseJsonFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): { value: SchemaFormValue; valid: boolean } {\n\tif (field.type === 'json' && field.parseValue) {\n\t\ttry {\n\t\t\treturn { value: field.parseValue(rawValue, values), valid: true };\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn { value: rawValue, valid: false };\n\t\t}\n\t}\n\treturn parseJsonValue(rawValue);\n}\n\nfunction optionIconNode(option: { icon?: ElementType }) {\n\tif (!option.icon) return undefined;\n\tconst Icon = option.icon;\n\treturn <Icon className=\"size-icon\" aria-hidden=\"true\" />;\n}\n\nfunction JsonFieldControl({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n}: SchemaFormFieldContext & { strings: SchemaFormStrings }) {\n\tconst indent = field.type === 'json' ? field.jsonIndent ?? 2 : 2;\n\tconst [text, setText] = useState(() => formatJsonValue(value, indent));\n\tconst [parseError, setParseError] = useState<string | undefined>();\n\tconst [isFocused, setIsFocused] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) setText(formatJsonValue(value, indent));\n\t}, [indent, isFocused, value]);\n\n\tif (field.type !== 'json') return null;\n\n\tconst commit = (rawValue: string) => {\n\t\tconst parsed = parseJsonFieldValue(field, rawValue, values, onError);\n\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\tonValueChange(parsed.value);\n\t\treturn parsed;\n\t};\n\n\treturn (\n\t\t<FormField\n\t\t\tlabel={field.label}\n\t\t\trequired={field.required}\n\t\t\thint={getFieldHint(field)}\n\t\t\thelperText={field.helperText}\n\t\t\terror={error ?? parseError}\n\t\t\thtmlFor={fieldId}\n\t\t\tsupportingTextId={`${fieldId}-supporting`}\n\t\t\tclassName=\"schema-form-field--component schema-form-field--json\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\tvalue={text}\n\t\t\t\trows={field.rows ?? 6}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tinvalid={Boolean(error ?? parseError)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tspellCheck={false}\n\t\t\t\tclassName={cn('font-mono', field.controlClassName)}\n\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\tonChange={(event) => {\n\t\t\t\t\tconst next = event.target.value;\n\t\t\t\t\tsetText(next);\n\t\t\t\t\tconst parsed = parseJsonFieldValue(field, next, values, onError);\n\t\t\t\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\t\t\t\tonValueChange(parsed.value);\n\t\t\t\t}}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tsetIsFocused(false);\n\t\t\t\t\tconst parsed = commit(text);\n\t\t\t\t\tif (parsed.valid) setText(formatJsonValue(parsed.value, indent));\n\t\t\t\t}}\n\t\t\t\t{...field.textareaProps}\n\t\t\t\t\taria-describedby={[field.textareaProps?.['aria-describedby'], error || parseError || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nexport function SchemaFormFieldRenderer({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\trequired,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n\tclassName,\n}: SchemaFormFieldRendererProps) {\n\tconst fieldType = field.type ?? 'text';\n\tconst commonFieldProps = {\n\t\tlabel: field.label,\n\t\trequired,\n\t\thint: getFieldHint(field),\n\t\thelperText: field.helperText,\n\t\terror,\n\t\thtmlFor: fieldId,\n\t\tsupportingTextId: `${fieldId}-supporting`,\n\t\tclassName: cn('schema-form-field--component', className),\n\t};\n\n\tconst controlClassName = field.controlClassName;\n\tconst describedBy = error || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined;\n\n\tif (fieldType === 'custom' && field.type === 'custom') {\n\t\treturn (\n\t\t\t<div className={cn('schema-form-field--component schema-form-field--custom', className)}>\n\t\t\t\t{field.render({ field, value, values, error, disabled, required, fieldId, onValueChange, onError })}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (fieldType === 'switch' && field.type === 'switch') {\n\t\tconst checked = toBooleanValue(value);\n\t\tif (field.switchStyle === 'card') {\n\t\t\treturn (\n\t\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch-card', className)}>\n\t\t\t\t\t<SwitchCard\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\t\tdescription={field.description}\n\t\t\t\t\t\thint={field.hint}\n\t\t\t\t\t\tname={field.key}\n\t\t\t\t\t\tvalue={checked}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t\t{...field.switchCardProps}\n\t\t\t\t\taria-describedby={[field.switchCardProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t\t/>\n\t\t\t\t</FormField>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch', className)}>\n\t\t\t\t<ToggleField\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\tdescription={field.description ?? field.hint}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={checked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.switchProps}\n\t\t\t\t\taria-describedby={[field.switchProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'json') {\n\t\treturn (\n\t\t\t<JsonFieldControl\n\t\t\t\tfield={field}\n\t\t\t\tvalue={value}\n\t\t\t\tvalues={values}\n\t\t\t\terror={error}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tfieldId={fieldId}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tonError={onError}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (fieldType === 'textarea' && field.type === 'textarea') {\n\t\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Textarea\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\trows={field.rows}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t\t{...field.textareaProps}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif ((fieldType === 'number' || fieldType === 'integer' || fieldType === 'decimal') && (\n\t\tfield.type === 'number' || field.type === 'integer' || field.type === 'decimal'\n\t)) {\n\t\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\t\tconst integer = field.type === 'integer';\n\t\tconst decimalPlaces = integer ? 0 : field.decimalPlaces ?? (field.type === 'decimal' ? 2 : 4);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<DecimalInput\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\tmin={field.min}\n\t\t\t\t\tmax={field.max}\n\t\t\t\t\tstep={field.step}\n\t\t\t\t\tdecimalPlaces={decimalPlaces}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tconst rawValue = event.target.value;\n\t\t\t\t\t\tonValueChange(parseNumberFieldValue(field, rawValue, values, integer, onError));\n\t\t\t\t\t}}\n\t\t\t\t\t{...field.numberProps}\n\t\t\t\t\taria-describedby={[field.numberProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'select' && field.type === 'select') {\n\t\tconst options = field.options.map((option) => ({\n\t\t\tvalue: option.value,\n\t\t\tlabel: option.label,\n\t\t\tdisabled: option.disabled,\n\t\t\ticon: optionIconNode(option),\n\t\t}));\n\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Select\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={options}\n\t\t\t\t\tallowClear={field.allowClear}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\taria-label={field.label}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next ?? null)}\n\t\t\t\t\t{...field.selectProps}\n\t\t\t\t\taria-describedby={[field.selectProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'radio-cards' && field.type === 'radio-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardRadioGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.radioProps}\n\t\t\t\t\taria-describedby={[field.radioProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'checkbox-cards' && field.type === 'checkbox-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.checkboxProps}\n\t\t\t\t\taria-describedby={[field.checkboxProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'tags' && field.type === 'tags') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<TagsInput\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\trecommendations={field.recommendations}\n\t\t\t\t\tmaxTags={field.maxTags}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.tagsProps}\n\t\t\t\t\taria-describedby={[field.tagsProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tconst inputType = fieldType === 'text' ? 'text' : fieldType;\n\tconst nativeInputProps = field.type === undefined || field.type === 'text' || field.type === 'email' || field.type === 'password' || field.type === 'url' || field.type === 'tel' || field.type === 'search' ? field.inputProps : undefined;\n\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\n\treturn (\n\t\t<FormField {...commonFieldProps}>\n\t\t\t<Input\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\ttype={inputType}\n\t\t\t\tvalue={displayValue}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tclassName={controlClassName}\n\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t{...nativeInputProps}\n\t\t\t\taria-describedby={[nativeInputProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nSchemaFormFieldRenderer.displayName = 'SchemaFormFieldRenderer';\n","export interface SchemaFormStrings {\n\tsubmitLabel: string;\n\tresetLabel: string;\n\tdefaultSectionTitle: string;\n\temptyTitle: string;\n\temptyDescription: string;\n\tjsonParseError: string;\n\tvalidationError: string;\n\tformatRequiredError: (label: string) => string;\n}\n\nexport const defaultSchemaFormStrings: SchemaFormStrings = {\n\tsubmitLabel: 'Save changes',\n\tresetLabel: 'Reset',\n\tdefaultSectionTitle: 'General',\n\temptyTitle: 'No fields configured',\n\temptyDescription: 'Add fields to the schema to render a form.',\n\tjsonParseError: 'Enter valid JSON.',\n\tvalidationError: 'Invalid value.',\n\tformatRequiredError: (label) => `${label} is required.`,\n};\n","import { Fragment, useId, useMemo } from 'react';\n\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { useSchemaForm } from './hooks';\nimport {\n\tSchemaFormActions,\n\tSchemaFormEmpty,\n\tSchemaFormFieldRenderer,\n} from './partials';\nimport {\n\tdefaultSchemaFormStrings,\n\ttype SchemaFormStrings,\n} from './schema-form.strings';\nimport type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormProps,\n\tSchemaFormSubmitHelpers,\n} from './schema-form.types';\nimport {\n\tSCHEMA_FORM_COLUMNS,\n\tSCHEMA_FORM_FIELD_WIDTH,\n\tisFieldDisabled,\n\tresolveSchemaSections,\n} from './schema-form.utils';\n\nfunction toDomId(value: string): string {\n\treturn value.replace(/[^a-zA-Z0-9_-]/g, '-');\n}\n\nfunction SectionHeading({ section }: { section: ResolvedSchemaFormSection }) {\n\tif (!section.title && !section.description) return null;\n\n\treturn (\n\t\t<Stack gap=\"normal\" className=\"schema-form--section-heading mb-space-lg\">\n\t\t\t{!!section.title && (\n\t\t\t\t<Text weight=\"semibold\" className=\"schema-form--section-title\">\n\t\t\t\t\t{section.title}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t\t{!!section.description && (\n\t\t\t\t<Text type=\"secondary\" className=\"schema-form--section-description\">\n\t\t\t\t\t{section.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function SchemaForm({\n\tschema,\n\tvalue,\n\tdefaultValue,\n\terrors,\n\tdisabled = false,\n\tlayout = 'form',\n\tcolumns = 2,\n\tid,\n\tname,\n\ttitle,\n\tdescription,\n\theaderSlot,\n\tfooterSlot,\n\tactionsSlot,\n\temptySlot,\n\tshowActions,\n\tsubmitLabel,\n\tresetLabel,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonValueChange,\n\tonFieldChange,\n\tonSubmit,\n\tonReset,\n\tonError,\n\trenderField,\n\trenderSection,\n\tstrings: stringsProp,\n\tclassName,\n\tcontentClassName,\n\tsectionClassName,\n\tfieldClassName,\n}: SchemaFormProps) {\n\tconst generatedId = useId();\n\tconst formId = id ?? `schema-form-${generatedId}`;\n\tconst strings: SchemaFormStrings = useStrings(defaultSchemaFormStrings, stringsProp);\n\tconst form = useSchemaForm({\n\t\tfields: schema.fields,\n\t\tvalue,\n\t\tdefaultValue,\n\t\terrors,\n\t\tonValueChange,\n\t\tonFieldChange,\n\t\tformatRequiredError: strings.formatRequiredError,\n\t\tvalidationError: strings.validationError,\n\t\tonError,\n\t});\n\n\tconst sections = useMemo(\n\t\t() => resolveSchemaSections(schema, form.values, strings.defaultSectionTitle, columns, onError),\n\t\t[columns, form.values, onError, schema, strings.defaultSectionTitle],\n\t);\n\tconst hasFields = sections.some((section) => section.fields.length > 0);\n\n\tconst helpers: SchemaFormSubmitHelpers = {\n\t\tsetFieldValue: form.setFieldValue,\n\t\tsetValues: form.setValues,\n\t\treset: form.reset,\n\t\tvalidate: form.validate,\n\t};\n\n\tconst shouldShowActions = showActions ?? Boolean(onSubmit || onReset || actionsSlot);\n\tconst resolvedSubmitLabel = submitLabel ?? strings.submitLabel;\n\tconst resolvedResetLabel = resetLabel ?? strings.resetLabel;\n\n\tconst renderFieldNode = (field: SchemaFormField) => {\n\t\tconst fieldId = `${formId}-${toDomId(field.key)}`;\n\t\tconst fieldDisabled = disabled || isFieldDisabled(field, form.values, onError);\n\t\tconst context: SchemaFormFieldContext = {\n\t\t\tfield,\n\t\t\tvalue: form.getFieldValue(field.key),\n\t\t\tvalues: form.values,\n\t\t\terror: form.getFieldError(field.key),\n\t\t\tdisabled: fieldDisabled,\n\t\t\trequired: Boolean(field.required),\n\t\t\tfieldId,\n\t\t\tonValueChange: (nextValue) => form.setFieldValue(field.key, nextValue),\n\t\t\tonError,\n\t\t};\n\t\tconst defaultField = (\n\t\t\t<SchemaFormFieldRenderer\n\t\t\t\t{...context}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tkey={field.key}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'schema-form--field',\n\t\t\t\t\tSCHEMA_FORM_FIELD_WIDTH[field.width ?? 'auto'],\n\t\t\t\t\tfield.className,\n\t\t\t\t\tfieldClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{renderField?.({ ...context, defaultField }) ?? defaultField}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderSectionFields = (section: ResolvedSchemaFormSection) => (\n\t\t<div className={cn('schema-form--section-fields', SCHEMA_FORM_COLUMNS[section.columns])}>\n\t\t\t{section.fields.map(renderFieldNode)}\n\t\t</div>\n\t);\n\n\tconst renderPlainSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\tkey={section.id}\n\t\t\t\tclassName={cn('schema-form--section', section.className, sectionClassName)}\n\t\t\t>\n\t\t\t\t<SectionHeading section={section} />\n\t\t\t\t{fields}\n\t\t\t\t{!!section.footerSlot && (\n\t\t\t\t\t<div className=\"schema-form--section-footer mt-space-lg\">\n\t\t\t\t\t\t{section.footerSlot}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</section>\n\t\t);\n\t};\n\n\tconst renderCardSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\tkey={section.id}\n\t\t\t\tclassName={cn('schema-form--section-card', section.className, sectionClassName)}\n\t\t\t\ticon={section.icon}\n\t\t\t\ttitle={section.title}\n\t\t\t\tdescription={section.description}\n\t\t\t\tfooterSlot={section.footerSlot}\n\t\t\t\theaderDivider\n\t\t\t>\n\t\t\t\t{fields}\n\t\t\t</ContentBlock>\n\t\t);\n\t};\n\n\tconst actions = actionsSlot ?? (\n\t\tshouldShowActions ? (\n\t\t\t<SchemaFormActions\n\t\t\t\tsubmitLabel={resolvedSubmitLabel}\n\t\t\t\tresetLabel={resolvedResetLabel}\n\t\t\t\tshowReset={Boolean(onReset)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tsubmitDisabled={submitDisabled}\n\t\t\t\tresetDisabled={resetDisabled}\n\t\t\t\tsubmitting={submitting}\n\t\t\t\tonReset={() => {\n\t\t\t\t\tconst nextValues = form.reset();\n\t\t\t\t\tonReset?.(nextValues, helpers);\n\t\t\t\t}}\n\t\t\t/>\n\t\t) : null\n\t);\n\n\tconst empty = emptySlot ?? (\n\t\t<SchemaFormEmpty\n\t\t\ttitle={strings.emptyTitle}\n\t\t\tdescription={strings.emptyDescription}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<form\n\t\t\tid={formId}\n\t\t\tname={name}\n\t\t\tnoValidate\n\t\t\tclassName={cn('schema-form--component @container/schema-form', className)}\n\t\t\tonSubmit={async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (disabled || submitDisabled || submitting) return;\n\t\t\t\tconst valid = form.validate();\n\t\t\t\tif (!valid) return;\n\t\t\t\ttry {\n\t\t\t\t\tawait onSubmit?.(form.values, helpers, event);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{layout === 'cards' ? (\n\t\t\t\t<Stack gap=\"xl\" className={cn('schema-form--cards', contentClassName)}>\n\t\t\t\t\t{!!(title ?? schema.title ?? description ?? schema.description ?? headerSlot) && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"start\" justify=\"between\" gap=\"xl\" className=\"schema-form--header\">\n\t\t\t\t\t\t<Stack gap=\"normal\" className=\"min-w-0\">\n\t\t\t\t\t\t\t\t{!!(title ?? schema.title) && (\n\t\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className=\"schema-form--title\">\n\t\t\t\t\t\t\t\t\t\t{title ?? schema.title}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!(description ?? schema.description) && (\n\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className=\"schema-form--description\">\n\t\t\t\t\t\t\t\t\t\t{description ?? schema.description}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{headerSlot}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t\t{hasFields ? sections.map(renderCardSection) : empty}\n\t\t\t\t\t{footerSlot}\n\t\t\t\t\t{actions}\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t\t<ContentBlock\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tcontentGap=\"2xl\"\n\t\t\t\t\t\tcontentClassName={cn('schema-form--content', contentClassName)}\n\t\t\t\t\ttitle={title ?? schema.title}\n\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t) : undefined\n\t\t\t\t\t}\n\t\t\t\t\theaderDivider={Boolean(title ?? schema.title ?? description ?? schema.description ?? headerSlot)}\n\t\t\t\t\tfooterDivider={Boolean(footerSlot || actions)}\n\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</ContentBlock>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAac,IAAiD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GAEaC,IAAgE;CAC5E,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACP;AAEA,SAAgBC,EACf,GACA,GACA,GACU;CACV,IAAI,OAAOC,EAAM,UAAW,YAC3B,IAAI;EACH,OAAOA,EAAM,OAAOC,CAAM;CAC3B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,UAAU;AACxB;AAEA,SAAgBI,EACf,GACA,GACA,GACU;CACV,IAAI,OAAOJ,EAAM,YAAa,YAC7B,IAAI;EACH,OAAOA,EAAM,SAASC,CAAM;CAC7B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,YAAY;AAC1B;AAEA,SAAgBK,EACf,GACA,GACA,GACoB;CACpB,OAAOC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,CAAA,IAAA,kBAAC9J,GAAD;GACC,WAAU;GACV,YAAW;GACX,kBAAkBgF,EAAG,wBAAwBkF,CAAgB;GAC9D,OAAOC,KAAS7I,EAAO;GACvB,aAAa8I,KAAe9I,EAAO;GACnC,WAAW+I;GACX,YACCC,KAAcR,IACb,kBAACjK,GAAD;IAAO,KAAI;IAAK,WAAU;IAA1B,UAAA,CACEyK,GACAR,CACK;GACJ,CAAA,IAAA,KAAA;GAEL,eAAe,GAAQK,KAAS7I,EAAO,SAAS8I,KAAe9I,EAAO,eAAe+I;GACrF,eAAe,GAAQC,KAAcR;GAEnC,UAAAtB,KAAY/G,EAAS,IAAI+H,EAAkB,IAAIO;EACnC,CAAA;CAEX,CAAA;AAER;AAEA,EAAW,cAAc"}
1
+ {"version":3,"file":"schema-form.js","names":["Text","Button","Stack","Input","Textarea","ToggleField","CardCheckboxGroup","SwitchCard","CardRadioGroup","ContentBlock","FormField","TagsInput","DecimalInput","EmptyState","SCHEMA_FORM_COLUMNS","SCHEMA_FORM_FIELD_WIDTH","isFieldHidden","field","values","error","onError","isFieldDisabled","getVisibleFields","fields","resolveSchemaSections","visibleFields","schema","fieldsByKey","usedKeys","sections","section","sectionFields","key","defaultColumns","unsectioned","defaultSectionTitle","toStringValue","value","toStringArray","item","toBooleanValue","parseNumberValue","trimmed","rawValue","parsed","integer","formatJsonValue","indent","parseJsonValue","getDefaultValues","defaultValue","shouldRequireValue","normalizeErrors","next","message","errors","useSchemaForm","externalErrors","isControlled","initialValues","useMemo","internalValues","setInternalValues","useState","validationErrors","setValidationErrors","mergedErrors","setValues","useCallback","nextValues","onValueChange","setFieldValue","fieldValue","current","onFieldChange","reset","validate","nextErrors","formatRequiredError","validators","validator","result","validationError","SchemaFormActions","cn","className","showReset","disabled","resetDisabled","submitting","onReset","resetLabel","submitDisabled","submitLabel","SchemaFormEmpty","getFieldHint","getTextDisplayValue","parseTextValue","parseNumberFieldValue","parseJsonFieldValue","optionIconNode","option","Icon","JsonFieldControl","text","setText","parseError","setParseError","isFocused","setIsFocused","useEffect","commit","strings","fieldId","event","SchemaFormFieldRenderer","fieldType","commonFieldProps","controlClassName","describedBy","checked","displayValue","decimalPlaces","options","Select","inputType","nativeInputProps","defaultSchemaFormStrings","label","toDomId","SectionHeading","SchemaForm","stringsProp","generatedId","useId","formId","id","useStrings","form","columns","hasFields","helpers","shouldShowActions","showActions","onSubmit","actionsSlot","resolvedSubmitLabel","resolvedResetLabel","renderFieldNode","fieldDisabled","context","nextValue","defaultField","fieldClassName","renderField","renderSectionFields","renderPlainSection","custom","renderSection","sectionClassName","Fragment","renderCardSection","actions","empty","emptySlot","layout","contentClassName","title","description","headerSlot","footerSlot"],"sources":["../../src/components/features/schema-form/schema-form.utils.ts","../../src/components/features/schema-form/hooks/use-schema-form.ts","../../src/components/features/schema-form/partials/schema-form-actions.tsx","../../src/components/features/schema-form/partials/schema-form-empty.tsx","../../src/components/features/schema-form/partials/schema-form-field.tsx","../../src/components/features/schema-form/schema-form.strings.ts","../../src/components/features/schema-form/schema-form.tsx"],"sourcesContent":["import type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldWidth,\n\tSchemaFormSchema,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from './schema-form.types';\n\ntype SchemaFormErrorHandler = (error: unknown) => void;\n\n/*\n * Container widths, not viewport widths — a schema form is as often rendered in\n * a drawer or a side panel as at page width, and keyed to the screen it kept\n * three field columns inside a 320px drawer. 448/576 clears every width these\n * forms render at today (672-814px) while collapsing below a real drawer.\n */\nexport const SCHEMA_FORM_COLUMNS: Record<1 | 2 | 3, string> = {\n\t1: 'grid grid-cols-1 gap-space-xl',\n\t2: 'grid grid-cols-1 gap-space-xl @md/schema-form:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-xl @md/schema-form:grid-cols-2 @xl/schema-form:grid-cols-3',\n};\n\nexport const SCHEMA_FORM_FIELD_WIDTH: Record<SchemaFormFieldWidth, string> = {\n\tauto: '',\n\thalf: '@md/schema-form:col-span-1',\n\tthird: '@xl/schema-form:col-span-1',\n\tfull: '@md/schema-form:col-span-full @xl/schema-form:col-span-full',\n};\n\nexport function isFieldHidden(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.hidden === 'function') {\n\t\ttry {\n\t\t\treturn field.hidden(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn field.hidden ?? false;\n}\n\nexport function isFieldDisabled(\n\tfield: SchemaFormField,\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): boolean {\n\tif (typeof field.disabled === 'function') {\n\t\ttry {\n\t\t\treturn field.disabled(values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn field.disabled ?? false;\n}\n\nexport function getVisibleFields(\n\tfields: SchemaFormField[],\n\tvalues: SchemaFormValues,\n\tonError?: SchemaFormErrorHandler,\n): SchemaFormField[] {\n\treturn fields.filter((field) => !isFieldHidden(field, values, onError));\n}\n\nexport function resolveSchemaSections(\n\tschema: SchemaFormSchema,\n\tvalues: SchemaFormValues,\n\tdefaultSectionTitle: string,\n\tdefaultColumns: 1 | 2 | 3,\n\tonError?: SchemaFormErrorHandler,\n): ResolvedSchemaFormSection[] {\n\tconst visibleFields = getVisibleFields(schema.fields, values, onError);\n\tconst fieldsByKey = new Map(visibleFields.map((field) => [field.key, field]));\n\tconst usedKeys = new Set<string>();\n\tconst sections: ResolvedSchemaFormSection[] = [];\n\n\tfor (const section of schema.sections ?? []) {\n\t\tconst sectionFields = section.fields\n\t\t\t? section.fields\n\t\t\t\t\t.map((key) => fieldsByKey.get(key))\n\t\t\t\t\t.filter((field): field is SchemaFormField => field !== undefined)\n\t\t\t: visibleFields.filter((field) => field.sectionId === section.id);\n\n\t\tfor (const field of sectionFields) {\n\t\t\tusedKeys.add(field.key);\n\t\t}\n\n\t\tsections.push({\n\t\t\tid: section.id,\n\t\t\ttitle: section.title,\n\t\t\tdescription: section.description,\n\t\t\ticon: section.icon,\n\t\t\tfields: sectionFields,\n\t\t\tcolumns: section.columns ?? defaultColumns,\n\t\t\tfooterSlot: section.footerSlot,\n\t\t\tclassName: section.className,\n\t\t});\n\t}\n\n\tconst unsectioned = visibleFields.filter((field) => !usedKeys.has(field.key));\n\tif (unsectioned.length > 0 || sections.length === 0) {\n\t\tsections.unshift({\n\t\t\tid: 'default',\n\t\t\ttitle: schema.sections?.length ? defaultSectionTitle : undefined,\n\t\t\tfields: unsectioned,\n\t\t\tcolumns: defaultColumns,\n\t\t});\n\t}\n\n\treturn sections.filter((section) => section.fields.length > 0);\n}\n\nexport function toStringValue(value: SchemaFormValue): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return value;\n\tif (typeof value === 'number' || typeof value === 'boolean') return String(value);\n\treturn JSON.stringify(value);\n}\n\nexport function toStringArray(value: SchemaFormValue): string[] {\n\tif (!Array.isArray(value)) return [];\n\treturn value.map((item) => String(item));\n}\n\nexport function toBooleanValue(value: SchemaFormValue): boolean {\n\treturn value === true || value === 'true' || value === 1;\n}\n\nexport function parseNumberValue(rawValue: string, integer = false): number | null {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return null;\n\tconst parsed = integer ? Number.parseInt(trimmed, 10) : Number.parseFloat(trimmed);\n\treturn Number.isNaN(parsed) ? null : parsed;\n}\n\nexport function formatJsonValue(value: SchemaFormValue, indent = 2): string {\n\tif (value === undefined || value === null) return '';\n\tif (typeof value === 'string') return value;\n\ttry {\n\t\treturn JSON.stringify(value, null, indent);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nexport function parseJsonValue(rawValue: string): { value: SchemaFormValue; valid: boolean } {\n\tconst trimmed = rawValue.trim();\n\tif (trimmed.length === 0) return { value: null, valid: true };\n\n\ttry {\n\t\treturn { value: JSON.parse(trimmed) as SchemaFormValue, valid: true };\n\t} catch {\n\t\treturn { value: rawValue, valid: false };\n\t}\n}\n","import { useCallback, useMemo, useState } from 'react';\n\nimport type {\n\tSchemaFormErrors,\n\tSchemaFormField,\n\tSchemaFormSubmitHelpers,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport { isFieldHidden } from '../schema-form.utils';\n\nexport interface UseSchemaFormOptions {\n\tfields: SchemaFormField[];\n\tvalue?: SchemaFormValues;\n\tdefaultValue?: SchemaFormValues;\n\terrors?: SchemaFormErrors;\n\tonValueChange?: (values: SchemaFormValues) => void;\n\tonFieldChange?: (key: string, value: SchemaFormValue, values: SchemaFormValues) => void;\n\tformatRequiredError: (label: string) => string;\n\tvalidationError: string;\n\tonError?: (error: unknown) => void;\n}\n\nexport interface UseSchemaFormResult extends SchemaFormSubmitHelpers {\n\tvalues: SchemaFormValues;\n\terrors: SchemaFormErrors;\n\tgetFieldError: (key: string) => string | undefined;\n\tgetFieldValue: (key: string) => SchemaFormValue;\n\tsetFieldValue: (key: string, value: SchemaFormValue) => void;\n\tsetValues: (values: SchemaFormValues) => void;\n\treset: () => SchemaFormValues;\n\tvalidate: () => boolean;\n}\n\nfunction getDefaultValues(fields: SchemaFormField[], defaultValue?: SchemaFormValues): SchemaFormValues {\n\tconst values: SchemaFormValues = { ...defaultValue };\n\n\tfor (const field of fields) {\n\t\tif (field.defaultValue !== undefined && values[field.key] === undefined) {\n\t\t\tvalues[field.key] = field.defaultValue;\n\t\t}\n\t}\n\n\treturn values;\n}\n\nfunction shouldRequireValue(value: SchemaFormValue): boolean {\n\tif (value === undefined || value === null) return true;\n\tif (typeof value === 'string') return value.trim().length === 0;\n\tif (Array.isArray(value)) return value.length === 0;\n\treturn false;\n}\n\nfunction normalizeErrors(errors?: SchemaFormErrors): SchemaFormErrors {\n\tconst next: SchemaFormErrors = {};\n\tfor (const [key, message] of Object.entries(errors ?? {})) {\n\t\tif (message) next[key] = message;\n\t}\n\treturn next;\n}\n\nexport function useSchemaForm({\n\tfields,\n\tvalue,\n\tdefaultValue,\n\terrors: externalErrors,\n\tonValueChange,\n\tonFieldChange,\n\tformatRequiredError,\n\tvalidationError,\n\tonError,\n}: UseSchemaFormOptions): UseSchemaFormResult {\n\tconst isControlled = value !== undefined;\n\tconst initialValues = useMemo(\n\t\t() => getDefaultValues(fields, defaultValue),\n\t\t[defaultValue, fields],\n\t);\n\tconst [internalValues, setInternalValues] = useState<SchemaFormValues>(() => initialValues);\n\tconst [validationErrors, setValidationErrors] = useState<SchemaFormErrors>({});\n\tconst values = useMemo(\n\t\t() => (isControlled ? { ...initialValues, ...value } : internalValues),\n\t\t[initialValues, internalValues, isControlled, value],\n\t);\n\n\tconst mergedErrors = useMemo(\n\t\t() => ({\n\t\t\t...validationErrors,\n\t\t\t...normalizeErrors(externalErrors),\n\t\t}),\n\t\t[externalErrors, validationErrors],\n\t);\n\n\tconst setValues = useCallback(\n\t\t(nextValues: SchemaFormValues) => {\n\t\t\tif (!isControlled) setInternalValues(nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onValueChange],\n\t);\n\n\tconst setFieldValue = useCallback(\n\t\t(key: string, fieldValue: SchemaFormValue) => {\n\t\t\tconst nextValues = { ...values, [key]: fieldValue };\n\t\t\tif (!isControlled) setInternalValues(nextValues);\n\t\t\tsetValidationErrors((current) => {\n\t\t\t\tif (!current[key]) return current;\n\t\t\t\tconst next = { ...current };\n\t\t\t\tdelete next[key];\n\t\t\t\treturn next;\n\t\t\t});\n\t\t\tonFieldChange?.(key, fieldValue, nextValues);\n\t\t\tonValueChange?.(nextValues);\n\t\t},\n\t\t[isControlled, onFieldChange, onValueChange, values],\n\t);\n\n\tconst reset = useCallback(() => {\n\t\tconst nextValues = getDefaultValues(fields, defaultValue);\n\t\tif (!isControlled) setInternalValues(nextValues);\n\t\tsetValidationErrors({});\n\t\tonValueChange?.(nextValues);\n\t\treturn nextValues;\n\t}, [defaultValue, fields, isControlled, onValueChange]);\n\n\tconst validate = useCallback(() => {\n\t\tconst nextErrors: SchemaFormErrors = {};\n\n\t\tfor (const field of fields) {\n\t\t\tif (isFieldHidden(field, values, onError)) continue;\n\n\t\t\tconst fieldValue = values[field.key];\n\t\t\tif (field.required && shouldRequireValue(fieldValue)) {\n\t\t\t\tnextErrors[field.key] = formatRequiredError(field.label);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst validators = Array.isArray(field.validate)\n\t\t\t\t? field.validate\n\t\t\t\t: field.validate\n\t\t\t\t\t? [field.validate]\n\t\t\t\t\t: [];\n\n\t\t\tfor (const validator of validators) {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = validator(fieldValue, values, field);\n\t\t\t\t\tif (typeof result === 'string' && result.length > 0) {\n\t\t\t\t\t\tnextErrors[field.key] = result;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t\tnextErrors[field.key] = validationError;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsetValidationErrors(nextErrors);\n\t\treturn Object.keys(nextErrors).length === 0;\n\t}, [fields, formatRequiredError, onError, validationError, values]);\n\n\tconst getFieldError = useCallback(\n\t\t(key: string) => mergedErrors[key],\n\t\t[mergedErrors],\n\t);\n\n\tconst getFieldValue = useCallback(\n\t\t(key: string) => values[key],\n\t\t[values],\n\t);\n\n\treturn {\n\t\tvalues,\n\t\terrors: mergedErrors,\n\t\tgetFieldError,\n\t\tgetFieldValue,\n\t\tsetFieldValue,\n\t\tsetValues,\n\t\treset,\n\t\tvalidate,\n\t};\n}\n","import { Button } from '../../../base/buttons';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormActionsProps {\n\t/** Copy for the submit button. */\n\tsubmitLabel: string;\n\t/** Copy for the reset button. */\n\tresetLabel: string;\n\t/** Renders the reset. */\n\tshowReset?: boolean;\n\t/** Renders the entry as unselectable. */\n\tdisabled?: boolean;\n\t/** Disables the submit button. */\n\tsubmitDisabled?: boolean;\n\t/** Disables the reset button. */\n\tresetDisabled?: boolean;\n\t/** Shows the pending state on submit. */\n\tsubmitting?: boolean;\n\tonReset?: () => void;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormActions({\n\tsubmitLabel,\n\tresetLabel,\n\tshowReset = false,\n\tdisabled = false,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonReset,\n\tclassName,\n}: SchemaFormActionsProps) {\n\treturn (\n\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"end\" gap=\"md\" className={cn('schema-form-actions--component', className)}>\n\t\t\t{!!showReset && (\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\tdisabled={disabled || resetDisabled || submitting}\n\t\t\t\t\tonClick={onReset}\n\t\t\t\t>\n\t\t\t\t\t{resetLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t\t<Button\n\t\t\t\ttype=\"submit\"\n\t\t\t\ttone=\"primary\"\n\t\t\t\tloading={submitting}\n\t\t\t\tdisabled={disabled || submitDisabled}\n\t\t\t>\n\t\t\t\t{submitLabel}\n\t\t\t</Button>\n\t\t</Stack>\n\t);\n}\n\nSchemaFormActions.displayName = 'SchemaFormActions';\n","import { EmptyState } from '../../../blocks/data-display';\nimport { cn } from '../../../../lib/utils';\n\nexport interface SchemaFormEmptyProps {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Supporting copy shown under the label. */\n\tdescription: string;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function SchemaFormEmpty({ title, description, className }: SchemaFormEmptyProps) {\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tpadding=\"md\"\n\t\t\tborder\n\t\t\tclassName={cn('schema-form-empty--component bg-muted/20', className)}\n\t\t/>\n\t);\n}\n\nSchemaFormEmpty.displayName = 'SchemaFormEmpty';\n","import { useEffect, useState, type ElementType } from 'react';\n\nimport { CardCheckboxGroup, CardRadioGroup, Select, SwitchCard, ToggleField } from '../../../base/choice-inputs';\nimport { FormField } from '../../../base/forms';\nimport { Input, Textarea } from '../../../base/text-inputs';\nimport { TagsInput } from '../../../base/value-inputs';\nimport { DecimalInput } from '../../../base/forms-numeric';\nimport { cn } from '../../../../lib/utils';\n\nimport type { SchemaFormStrings } from '../schema-form.strings';\nimport type {\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormValue,\n\tSchemaFormValues,\n} from '../schema-form.types';\nimport {\n\tformatJsonValue,\n\tparseJsonValue,\n\tparseNumberValue,\n\ttoBooleanValue,\n\ttoStringArray,\n\ttoStringValue,\n} from '../schema-form.utils';\n\nexport interface SchemaFormFieldRendererProps extends SchemaFormFieldContext {\n\t/** Overrides this surface's own copy. */\n\tstrings: SchemaFormStrings;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nfunction getFieldHint(field: SchemaFormField): string | undefined {\n\treturn field.hint ?? field.description;\n}\n\nfunction getTextDisplayValue(\n\tfield: SchemaFormField,\n\tvalue: SchemaFormValue,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): string {\n\tif (field.formatValue) {\n\t\ttry {\n\t\t\treturn field.formatValue(value, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn toStringValue(value);\n}\n\nfunction parseTextValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn rawValue;\n}\n\nfunction parseNumberFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tinteger: boolean,\n\tonError?: (error: unknown) => void,\n): SchemaFormValue {\n\tif (field.parseValue) {\n\t\ttry {\n\t\t\treturn field.parseValue(rawValue, values);\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t}\n\t}\n\treturn parseNumberValue(rawValue, integer);\n}\n\nfunction parseJsonFieldValue(\n\tfield: SchemaFormField,\n\trawValue: string,\n\tvalues: SchemaFormValues,\n\tonError?: (error: unknown) => void,\n): { value: SchemaFormValue; valid: boolean } {\n\tif (field.type === 'json' && field.parseValue) {\n\t\ttry {\n\t\t\treturn { value: field.parseValue(rawValue, values), valid: true };\n\t\t} catch (error) {\n\t\t\tonError?.(error);\n\t\t\treturn { value: rawValue, valid: false };\n\t\t}\n\t}\n\treturn parseJsonValue(rawValue);\n}\n\nfunction optionIconNode(option: { icon?: ElementType }) {\n\tif (!option.icon) return undefined;\n\tconst Icon = option.icon;\n\treturn <Icon className=\"size-icon\" aria-hidden=\"true\" />;\n}\n\nfunction JsonFieldControl({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n}: SchemaFormFieldContext & { strings: SchemaFormStrings }) {\n\tconst indent = field.type === 'json' ? field.jsonIndent ?? 2 : 2;\n\tconst [text, setText] = useState(() => formatJsonValue(value, indent));\n\tconst [parseError, setParseError] = useState<string | undefined>();\n\tconst [isFocused, setIsFocused] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) setText(formatJsonValue(value, indent));\n\t}, [indent, isFocused, value]);\n\n\tif (field.type !== 'json') return null;\n\n\tconst commit = (rawValue: string) => {\n\t\tconst parsed = parseJsonFieldValue(field, rawValue, values, onError);\n\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\tonValueChange(parsed.value);\n\t\treturn parsed;\n\t};\n\n\treturn (\n\t\t<FormField\n\t\t\tlabel={field.label}\n\t\t\trequired={field.required}\n\t\t\thint={getFieldHint(field)}\n\t\t\thelperText={field.helperText}\n\t\t\terror={error ?? parseError}\n\t\t\thtmlFor={fieldId}\n\t\t\tsupportingTextId={`${fieldId}-supporting`}\n\t\t\tclassName=\"schema-form-field--component schema-form-field--json\"\n\t\t>\n\t\t\t<Textarea\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\tvalue={text}\n\t\t\t\trows={field.rows ?? 6}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tinvalid={Boolean(error ?? parseError)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tspellCheck={false}\n\t\t\t\tclassName={cn('font-mono', field.controlClassName)}\n\t\t\t\tonFocus={() => setIsFocused(true)}\n\t\t\t\tonChange={(event) => {\n\t\t\t\t\tconst next = event.target.value;\n\t\t\t\t\tsetText(next);\n\t\t\t\t\tconst parsed = parseJsonFieldValue(field, next, values, onError);\n\t\t\t\t\tsetParseError(parsed.valid ? undefined : strings.jsonParseError);\n\t\t\t\t\tonValueChange(parsed.value);\n\t\t\t\t}}\n\t\t\t\tonBlur={() => {\n\t\t\t\t\tsetIsFocused(false);\n\t\t\t\t\tconst parsed = commit(text);\n\t\t\t\t\tif (parsed.valid) setText(formatJsonValue(parsed.value, indent));\n\t\t\t\t}}\n\t\t\t\t{...field.textareaProps}\n\t\t\t\t\taria-describedby={[field.textareaProps?.['aria-describedby'], error || parseError || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nexport function SchemaFormFieldRenderer({\n\tfield,\n\tvalue,\n\tvalues,\n\terror,\n\tdisabled,\n\trequired,\n\tfieldId,\n\tonValueChange,\n\tonError,\n\tstrings,\n\tclassName,\n}: SchemaFormFieldRendererProps) {\n\tconst fieldType = field.type ?? 'text';\n\tconst commonFieldProps = {\n\t\tlabel: field.label,\n\t\trequired,\n\t\thint: getFieldHint(field),\n\t\thelperText: field.helperText,\n\t\terror,\n\t\thtmlFor: fieldId,\n\t\tsupportingTextId: `${fieldId}-supporting`,\n\t\tclassName: cn('schema-form-field--component', className),\n\t};\n\n\tconst controlClassName = field.controlClassName;\n\tconst describedBy = error || field.helperText || getFieldHint(field) ? `${fieldId}-supporting` : undefined;\n\n\tif (fieldType === 'custom' && field.type === 'custom') {\n\t\treturn (\n\t\t\t<div className={cn('schema-form-field--component schema-form-field--custom', className)}>\n\t\t\t\t{field.render({ field, value, values, error, disabled, required, fieldId, onValueChange, onError })}\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (fieldType === 'switch' && field.type === 'switch') {\n\t\tconst checked = toBooleanValue(value);\n\t\tif (field.switchStyle === 'card') {\n\t\t\treturn (\n\t\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch-card', className)}>\n\t\t\t\t\t<SwitchCard\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\t\tdescription={field.description}\n\t\t\t\t\t\thint={field.hint}\n\t\t\t\t\t\tname={field.key}\n\t\t\t\t\t\tvalue={checked}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t\t{...field.switchCardProps}\n\t\t\t\t\taria-describedby={[field.switchCardProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t\t/>\n\t\t\t\t</FormField>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<FormField error={error} supportingTextId={`${fieldId}-supporting`} className={cn('schema-form-field--component schema-form-field--switch', className)}>\n\t\t\t\t<ToggleField\n\t\t\t\t\tlabel={field.label}\n\t\t\t\t\tdescription={field.description ?? field.hint}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={checked}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.switchProps}\n\t\t\t\t\taria-describedby={[field.switchProps?.['aria-describedby'], error ? `${fieldId}-supporting` : undefined].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'json') {\n\t\treturn (\n\t\t\t<JsonFieldControl\n\t\t\t\tfield={field}\n\t\t\t\tvalue={value}\n\t\t\t\tvalues={values}\n\t\t\t\terror={error}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tfieldId={fieldId}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tonError={onError}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (fieldType === 'textarea' && field.type === 'textarea') {\n\t\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Textarea\n\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\trows={field.rows}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t\t{...field.textareaProps}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif ((fieldType === 'number' || fieldType === 'integer' || fieldType === 'decimal') && (\n\t\tfield.type === 'number' || field.type === 'integer' || field.type === 'decimal'\n\t)) {\n\t\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\t\tconst integer = field.type === 'integer';\n\t\tconst decimalPlaces = integer ? 0 : field.decimalPlaces ?? (field.type === 'decimal' ? 2 : 4);\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<DecimalInput\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={displayValue}\n\t\t\t\t\tmin={field.min}\n\t\t\t\t\tmax={field.max}\n\t\t\t\t\tstep={field.step}\n\t\t\t\t\tdecimalPlaces={decimalPlaces}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\tconst rawValue = event.target.value;\n\t\t\t\t\t\tonValueChange(parseNumberFieldValue(field, rawValue, values, integer, onError));\n\t\t\t\t\t}}\n\t\t\t\t\t{...field.numberProps}\n\t\t\t\t\taria-describedby={[field.numberProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'select' && field.type === 'select') {\n\t\tconst options = field.options.map((option) => ({\n\t\t\tvalue: option.value,\n\t\t\tlabel: option.label,\n\t\t\tdisabled: option.disabled,\n\t\t\ticon: optionIconNode(option),\n\t\t}));\n\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<Select\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={options}\n\t\t\t\t\tallowClear={field.allowClear}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\taria-label={field.label}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next ?? null)}\n\t\t\t\t\t{...field.selectProps}\n\t\t\t\t\taria-describedby={[field.selectProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'radio-cards' && field.type === 'radio-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardRadioGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringValue(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.radioProps}\n\t\t\t\t\taria-describedby={[field.radioProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'checkbox-cards' && field.type === 'checkbox-cards') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\tname={field.key}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\toptions={field.options}\n\t\t\t\t\tcolumns={field.columns}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.checkboxProps}\n\t\t\t\t\taria-describedby={[field.checkboxProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tif (fieldType === 'tags' && field.type === 'tags') {\n\t\treturn (\n\t\t\t<FormField {...commonFieldProps}>\n\t\t\t\t<TagsInput\n\t\t\t\t\tid={fieldId}\n\t\t\t\t\tvalue={toStringArray(value)}\n\t\t\t\t\trecommendations={field.recommendations}\n\t\t\t\t\tmaxTags={field.maxTags}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\t\tclassName={controlClassName}\n\t\t\t\t\tonValueChange={(next) => onValueChange(next)}\n\t\t\t\t\t{...field.tagsProps}\n\t\t\t\t\taria-describedby={[field.tagsProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</FormField>\n\t\t);\n\t}\n\n\tconst inputType = fieldType === 'text' ? 'text' : fieldType;\n\tconst nativeInputProps = field.type === undefined || field.type === 'text' || field.type === 'email' || field.type === 'password' || field.type === 'url' || field.type === 'tel' || field.type === 'search' ? field.inputProps : undefined;\n\tconst displayValue = getTextDisplayValue(field, value, values, onError);\n\n\treturn (\n\t\t<FormField {...commonFieldProps}>\n\t\t\t<Input\n\t\t\t\tid={fieldId}\n\t\t\t\tname={field.key}\n\t\t\t\ttype={inputType}\n\t\t\t\tvalue={displayValue}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\tinvalid={Boolean(error)}\n\t\t\t\tplaceholder={field.placeholder}\n\t\t\t\tclassName={controlClassName}\n\t\t\t\tonChange={(event) => onValueChange(parseTextValue(field, event.target.value, values, onError))}\n\t\t\t\t{...nativeInputProps}\n\t\t\t\taria-describedby={[nativeInputProps?.['aria-describedby'], describedBy].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t</FormField>\n\t);\n}\n\nSchemaFormFieldRenderer.displayName = 'SchemaFormFieldRenderer';\n","export interface SchemaFormStrings {\n\tsubmitLabel: string;\n\tresetLabel: string;\n\tdefaultSectionTitle: string;\n\temptyTitle: string;\n\temptyDescription: string;\n\tjsonParseError: string;\n\tvalidationError: string;\n\tformatRequiredError: (label: string) => string;\n}\n\nexport const defaultSchemaFormStrings: SchemaFormStrings = {\n\tsubmitLabel: 'Save changes',\n\tresetLabel: 'Reset',\n\tdefaultSectionTitle: 'General',\n\temptyTitle: 'No fields configured',\n\temptyDescription: 'Add fields to the schema to render a form.',\n\tjsonParseError: 'Enter valid JSON.',\n\tvalidationError: 'Invalid value.',\n\tformatRequiredError: (label) => `${label} is required.`,\n};\n","import { Fragment, useId, useMemo } from 'react';\n\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { useSchemaForm } from './hooks';\nimport {\n\tSchemaFormActions,\n\tSchemaFormEmpty,\n\tSchemaFormFieldRenderer,\n} from './partials';\nimport {\n\tdefaultSchemaFormStrings,\n\ttype SchemaFormStrings,\n} from './schema-form.strings';\nimport type {\n\tResolvedSchemaFormSection,\n\tSchemaFormField,\n\tSchemaFormFieldContext,\n\tSchemaFormProps,\n\tSchemaFormSubmitHelpers,\n} from './schema-form.types';\nimport {\n\tSCHEMA_FORM_COLUMNS,\n\tSCHEMA_FORM_FIELD_WIDTH,\n\tisFieldDisabled,\n\tresolveSchemaSections,\n} from './schema-form.utils';\n\nfunction toDomId(value: string): string {\n\treturn value.replace(/[^a-zA-Z0-9_-]/g, '-');\n}\n\nfunction SectionHeading({ section }: { section: ResolvedSchemaFormSection }) {\n\tif (!section.title && !section.description) return null;\n\n\treturn (\n\t\t<Stack gap=\"normal\" className=\"schema-form--section-heading mb-space-lg\">\n\t\t\t{!!section.title && (\n\t\t\t\t<Text weight=\"semibold\" className=\"schema-form--section-title\">\n\t\t\t\t\t{section.title}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t\t{!!section.description && (\n\t\t\t\t<Text type=\"secondary\" className=\"schema-form--section-description\">\n\t\t\t\t\t{section.description}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nexport function SchemaForm({\n\tschema,\n\tvalue,\n\tdefaultValue,\n\terrors,\n\tdisabled = false,\n\tlayout = 'form',\n\tcolumns = 2,\n\tid,\n\tname,\n\ttitle,\n\tdescription,\n\theaderSlot,\n\tfooterSlot,\n\tactionsSlot,\n\temptySlot,\n\tshowActions,\n\tsubmitLabel,\n\tresetLabel,\n\tsubmitDisabled = false,\n\tresetDisabled = false,\n\tsubmitting = false,\n\tonValueChange,\n\tonFieldChange,\n\tonSubmit,\n\tonReset,\n\tonError,\n\trenderField,\n\trenderSection,\n\tstrings: stringsProp,\n\tclassName,\n\tcontentClassName,\n\tsectionClassName,\n\tfieldClassName,\n}: SchemaFormProps) {\n\tconst generatedId = useId();\n\tconst formId = id ?? `schema-form-${generatedId}`;\n\tconst strings: SchemaFormStrings = useStrings(defaultSchemaFormStrings, stringsProp);\n\tconst form = useSchemaForm({\n\t\tfields: schema.fields,\n\t\tvalue,\n\t\tdefaultValue,\n\t\terrors,\n\t\tonValueChange,\n\t\tonFieldChange,\n\t\tformatRequiredError: strings.formatRequiredError,\n\t\tvalidationError: strings.validationError,\n\t\tonError,\n\t});\n\n\tconst sections = useMemo(\n\t\t() => resolveSchemaSections(schema, form.values, strings.defaultSectionTitle, columns, onError),\n\t\t[columns, form.values, onError, schema, strings.defaultSectionTitle],\n\t);\n\tconst hasFields = sections.some((section) => section.fields.length > 0);\n\n\tconst helpers: SchemaFormSubmitHelpers = {\n\t\tsetFieldValue: form.setFieldValue,\n\t\tsetValues: form.setValues,\n\t\treset: form.reset,\n\t\tvalidate: form.validate,\n\t};\n\n\tconst shouldShowActions = showActions ?? Boolean(onSubmit || onReset || actionsSlot);\n\tconst resolvedSubmitLabel = submitLabel ?? strings.submitLabel;\n\tconst resolvedResetLabel = resetLabel ?? strings.resetLabel;\n\n\tconst renderFieldNode = (field: SchemaFormField) => {\n\t\tconst fieldId = `${formId}-${toDomId(field.key)}`;\n\t\tconst fieldDisabled = disabled || isFieldDisabled(field, form.values, onError);\n\t\tconst context: SchemaFormFieldContext = {\n\t\t\tfield,\n\t\t\tvalue: form.getFieldValue(field.key),\n\t\t\tvalues: form.values,\n\t\t\terror: form.getFieldError(field.key),\n\t\t\tdisabled: fieldDisabled,\n\t\t\trequired: Boolean(field.required),\n\t\t\tfieldId,\n\t\t\tonValueChange: (nextValue) => form.setFieldValue(field.key, nextValue),\n\t\t\tonError,\n\t\t};\n\t\tconst defaultField = (\n\t\t\t<SchemaFormFieldRenderer\n\t\t\t\t{...context}\n\t\t\t\tstrings={strings}\n\t\t\t/>\n\t\t);\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tkey={field.key}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'schema-form--field',\n\t\t\t\t\tSCHEMA_FORM_FIELD_WIDTH[field.width ?? 'auto'],\n\t\t\t\t\tfield.className,\n\t\t\t\t\tfieldClassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{renderField?.({ ...context, defaultField }) ?? defaultField}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst renderSectionFields = (section: ResolvedSchemaFormSection) => (\n\t\t<div className={cn('schema-form--section-fields', SCHEMA_FORM_COLUMNS[section.columns])}>\n\t\t\t{section.fields.map(renderFieldNode)}\n\t\t</div>\n\t);\n\n\tconst renderPlainSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\tkey={section.id}\n\t\t\t\tclassName={cn('schema-form--section', section.className, sectionClassName)}\n\t\t\t>\n\t\t\t\t<SectionHeading section={section} />\n\t\t\t\t{fields}\n\t\t\t\t{!!section.footerSlot && (\n\t\t\t\t\t<div className=\"schema-form--section-footer mt-space-lg\">\n\t\t\t\t\t\t{section.footerSlot}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</section>\n\t\t);\n\t};\n\n\tconst renderCardSection = (section: ResolvedSchemaFormSection) => {\n\t\tconst fields = renderSectionFields(section);\n\t\tconst custom = renderSection?.({ section, fields, values: form.values });\n\t\tif (custom !== undefined && custom !== null) {\n\t\t\treturn <Fragment key={section.id}>{custom}</Fragment>;\n\t\t}\n\n\t\treturn (\n\t\t\t<ContentBlock\n\t\t\t\tkey={section.id}\n\t\t\t\tclassName={cn('schema-form--section-card', section.className, sectionClassName)}\n\t\t\t\ticon={section.icon}\n\t\t\t\ttitle={section.title}\n\t\t\t\tdescription={section.description}\n\t\t\t\tfooterSlot={section.footerSlot}\n\t\t\t\theaderDivider\n\t\t\t>\n\t\t\t\t{fields}\n\t\t\t</ContentBlock>\n\t\t);\n\t};\n\n\tconst actions = actionsSlot ?? (\n\t\tshouldShowActions ? (\n\t\t\t<SchemaFormActions\n\t\t\t\tsubmitLabel={resolvedSubmitLabel}\n\t\t\t\tresetLabel={resolvedResetLabel}\n\t\t\t\tshowReset={Boolean(onReset)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tsubmitDisabled={submitDisabled}\n\t\t\t\tresetDisabled={resetDisabled}\n\t\t\t\tsubmitting={submitting}\n\t\t\t\tonReset={() => {\n\t\t\t\t\tconst nextValues = form.reset();\n\t\t\t\t\tonReset?.(nextValues, helpers);\n\t\t\t\t}}\n\t\t\t/>\n\t\t) : null\n\t);\n\n\tconst empty = emptySlot ?? (\n\t\t<SchemaFormEmpty\n\t\t\ttitle={strings.emptyTitle}\n\t\t\tdescription={strings.emptyDescription}\n\t\t/>\n\t);\n\n\treturn (\n\t\t<form\n\t\t\tid={formId}\n\t\t\tname={name}\n\t\t\tnoValidate\n\t\t\tclassName={cn('schema-form--component @container/schema-form', className)}\n\t\t\tonSubmit={async (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (disabled || submitDisabled || submitting) return;\n\t\t\t\tconst valid = form.validate();\n\t\t\t\tif (!valid) return;\n\t\t\t\ttry {\n\t\t\t\t\tawait onSubmit?.(form.values, helpers, event);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tonError?.(error);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{layout === 'cards' ? (\n\t\t\t\t<Stack gap=\"xl\" className={cn('schema-form--cards', contentClassName)}>\n\t\t\t\t\t{!!(title ?? schema.title ?? description ?? schema.description ?? headerSlot) && (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"start\" justify=\"between\" gap=\"xl\" className=\"schema-form--header\">\n\t\t\t\t\t\t<Stack gap=\"normal\" className=\"min-w-0\">\n\t\t\t\t\t\t\t\t{!!(title ?? schema.title) && (\n\t\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className=\"schema-form--title\">\n\t\t\t\t\t\t\t\t\t\t{title ?? schema.title}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{!!(description ?? schema.description) && (\n\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className=\"schema-form--description\">\n\t\t\t\t\t\t\t\t\t\t{description ?? schema.description}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{headerSlot}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t)}\n\t\t\t\t\t{hasFields ? sections.map(renderCardSection) : empty}\n\t\t\t\t\t{footerSlot}\n\t\t\t\t\t{actions}\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t\t<ContentBlock\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tcontentGap=\"2xl\"\n\t\t\t\t\t\tcontentClassName={cn('schema-form--content', contentClassName)}\n\t\t\t\t\ttitle={title ?? schema.title}\n\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t) : undefined\n\t\t\t\t\t}\n\t\t\t\t\theaderDivider={Boolean(title ?? schema.title ?? description ?? schema.description ?? headerSlot)}\n\t\t\t\t\tfooterDivider={Boolean(footerSlot || actions)}\n\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</ContentBlock>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAac,IAAiD;CAC7D,GAAG;CACH,GAAG;CACH,GAAG;AACJ,GAEaC,IAAgE;CAC5E,MAAM;CACN,MAAM;CACN,OAAO;CACP,MAAM;AACP;AAEA,SAAgBC,EACf,GACA,GACA,GACU;CACV,IAAI,OAAOC,EAAM,UAAW,YAC3B,IAAI;EACH,OAAOA,EAAM,OAAOC,CAAM;CAC3B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,UAAU;AACxB;AAEA,SAAgBI,EACf,GACA,GACA,GACU;CACV,IAAI,OAAOJ,EAAM,YAAa,YAC7B,IAAI;EACH,OAAOA,EAAM,SAASC,CAAM;CAC7B,SAASC,GAAO;EAEf,OADAC,IAAUD,CAAK,GACR;CACR;CAED,OAAOF,EAAM,YAAY;AAC1B;AAEA,SAAgBK,EACf,GACA,GACA,GACoB;CACpB,OAAOC,EAAO,QAAQ,MAAU,CAACP,EAAcC,GAAOC,GAAQE,CAAO,CAAC;AACvE;AAEA,SAAgBI,GACf,GACA,GACA,GACA,GACA,GAC8B;CAC9B,IAAMC,IAAgBH,EAAiBI,EAAO,QAAQR,GAAQE,CAAO,GAC/DO,IAAc,IAAI,IAAIF,EAAc,KAAK,MAAU,CAACR,EAAM,KAAKA,CAAK,CAAC,CAAC,GACtEW,oBAAW,IAAI,IAAY,GAC3BC,IAAwC,CAAC;CAE/C,KAAK,IAAMC,KAAWJ,EAAO,YAAY,CAAC,GAAG;EAC5C,IA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/G,EAAS,IAAI+H,EAAkB,IAAIO;EACnC,CAAA;CAEX,CAAA;AAER;AAEA,EAAW,cAAc"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "../lib/strings.js";
3
- import { t } from "../utils-C2EKeIw3.js";
4
- import { t as n } from "../feedback-a9j9J-9A.js";
3
+ import { t } from "../utils-BvH9PSmq.js";
4
+ import { t as n } from "../feedback-CJkUAapr.js";
5
5
  import { t as r } from "../use-debounced-callback-Cx1h-hdv.js";
6
- import { r as i } from "../combobox-CHD750do.js";
6
+ import { r as i } from "../combobox-hozNwUcc.js";
7
7
  import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
8
8
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
9
  //#region src/components/features/suggestions/hooks/use-suggestions.ts
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "../lib/strings.js";
3
- import { a as t, n } from "../typography-Cv8MT-82.js";
4
- import { t as r } from "../structure-BvW4vG4H.js";
5
- import { i, r as a } from "../choice-inputs-CavA-SGV.js";
3
+ import { a as t, n } from "../typography-BxQgiZyw.js";
4
+ import { t as r } from "../structure-CRdqVawd.js";
5
+ import { i, r as a } from "../choice-inputs-Mk3iWbhr.js";
6
6
  import { useEffect as o, useMemo as s } from "react";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  import { Controller as u, useForm as d } from "react-hook-form";
@@ -98,7 +98,7 @@ function h(h) {
98
98
  })
99
99
  ]
100
100
  }), !!v && v.length > 0 && /* @__PURE__ */ c("section", {
101
- className: "sync-range-dialog-form--section rounded-radius-md border border-border/70 bg-muted/20 p-surface",
101
+ className: "sync-range-dialog-form--section rounded-inner border border-border/70 bg-muted/20 p-surface",
102
102
  children: /* @__PURE__ */ l(r, {
103
103
  gap: "md",
104
104
  children: [/* @__PURE__ */ l(r, {
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","names":["Text","Stack","CardRadioGroup","useFormErrors","errors","error","defaultSyncRangeDialogFormStrings","defaultTransformSubmit","hours","value","SyncRangeDialogForm","stringsProp","props","strings","useStrings","key","nextValue","initialValue","useMemo","defaultValue","formIsSubmitting","useForm","controlsDisabled","disabled","submitting","useEffect","reset","resetKey","emitChange","next","formId","handleSubmit","onSubmit","transformSubmit","values","Label","Controller","field","getValues","getError","syncOptions","CardCheckboxGroup","nextOptions"],"sources":["../../src/hooks/useFormErrors.ts","../../src/components/features/sync/sync.strings.ts","../../src/components/features/sync/sync-range-dialog-form.tsx"],"sourcesContent":["type ErrorKey<T> = Extract<keyof T, string>;\n\ntype ErrorBag<T> = Partial<Record<ErrorKey<T> | 'server' | 'general', string>>;\n\nexport const useFormErrors = <T extends Record<string, unknown> = Record<string, unknown>>(\n\terrors?: ErrorBag<T>,\n) => {\n\n\tconst getError = (error: ErrorKey<T>) => {\n\t\tif (!errors) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn errors[error];\n\t};\n\n\tconst hasError = (error: ErrorKey<T>) => {\n\t\treturn errors !== undefined && errors[error] !== undefined;\n\t};\n\n\treturn {\n\t\tgetError,\n\t\thasError,\n\t};\n};\n","/**\n * Default user-facing strings for `<SyncRangeDialogForm>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SyncRangeDialogForm strings={{ optionsLabel: t('sync.options') }} … />\n */\n\nexport interface SyncRangeDialogFormStrings {\n\t/** Label rendered above the required sync-window radio group. */\n\thoursLabel: string;\n\t/** Helper copy rendered below the sync-window label. */\n\thoursDescription: string;\n\t/** Label rendered above the optional sync-options checkbox group. */\n\toptionsLabel: string;\n\t/** Helper copy rendered below the optional sync-options label. */\n\toptionsDescription: string;\n}\n\nexport const defaultSyncRangeDialogFormStrings: SyncRangeDialogFormStrings = {\n\thoursLabel: 'Sync window',\n\thoursDescription: 'Choose how far back the integration should reconcile records.',\n\toptionsLabel: 'Options',\n\toptionsDescription: 'Limit the run when the repair only needs a specific record family.',\n};\n","import { useEffect, useMemo } from 'react';\nimport { Controller, type SubmitHandler, useForm } from 'react-hook-form';\nimport { CardCheckboxGroup, CardRadioGroup } from '../../base/choice-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useFormErrors } from '../../../hooks/useFormErrors';\nimport { useStrings } from '../../../lib/strings';\n\nimport { defaultSyncRangeDialogFormStrings } from './sync.strings';\nimport type { SyncRangeDialogFormProps, SyncRangeDialogFormSubmit, SyncRangeDialogFormValues } from './sync.types';\n\nfunction defaultTransformSubmit(value: SyncRangeDialogFormValues): SyncRangeDialogFormSubmit {\n\tconst hours = Number(value.hours);\n\tif (!Number.isFinite(hours)) {\n\t\tthrow new TypeError('SyncRangeDialogForm requires numeric range values unless transformSubmit is provided.');\n\t}\n\n\treturn {\n\t\thours,\n\t\toptions: [...value.options],\n\t};\n}\n\nexport function SyncRangeDialogForm<TSubmit = SyncRangeDialogFormSubmit>(props: SyncRangeDialogFormProps<TSubmit>) {\n\tconst {\n\t\tformId,\n\t\toptions,\n\t\tsyncOptions,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tonValueChange,\n\t\ttransformSubmit,\n\t\tonSubmit,\n\t\tonError,\n\t\tresetKey,\n\t\tdisabled = false,\n\t\tsubmitting = false,\n\t\terrors,\n\t\tstrings: stringsProp,\n\t} = props;\n\tconst strings = useStrings(defaultSyncRangeDialogFormStrings, stringsProp);\n\tconst normalizedErrors = Object.fromEntries(\n\t\tObject.entries(errors ?? {}).map(([key, nextValue]) => [key, Array.isArray(nextValue) ? nextValue[0] : nextValue]),\n\t) as Partial<Record<string, string>>;\n\tconst { getError } = useFormErrors(normalizedErrors);\n\tconst initialValue = useMemo<SyncRangeDialogFormValues>(\n\t\t() => ({\n\t\t\thours: defaultValue?.hours ?? '24',\n\t\t\toptions: [...(defaultValue?.options ?? [])],\n\t\t}),\n\t\t[defaultValue?.hours, defaultValue?.options],\n\t);\n\n\tconst {\n\t\tcontrol,\n\t\tgetValues,\n\t\thandleSubmit,\n\t\treset,\n\t\tformState: { isSubmitting: formIsSubmitting },\n\t} = useForm<SyncRangeDialogFormValues>({\n\t\tdefaultValues: value ?? initialValue,\n\t});\n\tconst controlsDisabled = disabled || submitting || formIsSubmitting;\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) reset(value);\n\t}, [reset, value]);\n\n\tuseEffect(() => {\n\t\tif (resetKey === undefined) return;\n\t\treset(value ?? initialValue);\n\t}, [initialValue, reset, resetKey, value]);\n\n\tconst emitChange = (next: SyncRangeDialogFormValues) => {\n\t\tonValueChange?.(next);\n\t};\n\n\tconst submit: SubmitHandler<SyncRangeDialogFormValues> = async (values) => {\n\t\ttry {\n\t\t\tconst transform =\n\t\t\t\ttransformSubmit ?? (defaultTransformSubmit as unknown as (value: SyncRangeDialogFormValues) => TSubmit);\n\t\t\tawait onSubmit(transform(values), values);\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('[SyncRangeDialogForm] Submit failed.', error);\n\t\t\t}\n\t\t\tonError?.(error);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\trender={<form />}\n\t\t\tgap=\"xl\"\n\t\t\tid={formId}\n\t\t\tonSubmit={handleSubmit(submit)}\n\t\t\tclassName=\"sync-range-dialog-form--component\"\n\t\t\taria-busy={submitting || formIsSubmitting || undefined}\n\t\t>\n\t\t\t<Stack render={<section />} gap=\"md\" className=\"sync-range-dialog-form--section\">\n\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t<Label>{strings.hoursLabel}</Label>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.hoursDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"hours\"\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\trules={{ required: true }}\n\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\toptions={options}\n\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\tonValueChange={(hours) => {\n\t\t\t\t\t\t\t\tfield.onChange(hours);\n\t\t\t\t\t\t\t\temitChange({ ...getValues(), hours });\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tname={field.name}\n\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\tinvalid={Boolean(getError('hours'))}\n\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t/>\n\n\t\t\t\t{getError('hours') && <Text type=\"error\">{getError('hours')}</Text>}\n\t\t\t</Stack>\n\n\t\t\t{!!syncOptions && syncOptions.length > 0 && (\n\t\t\t\t<section className=\"sync-range-dialog-form--section rounded-radius-md border border-border/70 bg-muted/20 p-surface\">\n\t\t\t\t\t<Stack gap=\"md\">\n\t\t\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t\t\t<Label>{strings.optionsLabel}</Label>\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t{strings.optionsDescription}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t<Controller\n\t\t\t\t\t\t\tname=\"options\"\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\t\t\t\t\toptions={syncOptions}\n\t\t\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\t\t\tonValueChange={(nextOptions) => {\n\t\t\t\t\t\t\t\t\t\tfield.onChange(nextOptions);\n\t\t\t\t\t\t\t\t\t\temitChange({\n\t\t\t\t\t\t\t\t\t\t\t...getValues(),\n\t\t\t\t\t\t\t\t\t\t\toptions: nextOptions,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\t\t\t\t</section>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nSyncRangeDialogForm.displayName = 'SyncRangeDialogForm';\n"],"mappings":";;;;;;;;;AAIA,IAAaG,KACZ,OAeO;CACN,WAbiB,MAAuB;EACxC,IAAKC,GAIL,OAAOA,EAAOC;CACf;CAQC,WANiB,MACVD,MAAW,KAAA,KAAaA,EAAOC,OAAW,KAAA;AAMlD,ICJYC,IAAgE;CAC5E,YAAY;CACZ,kBAAkB;CAClB,cAAc;CACd,oBAAoB;AACrB;;;ACbA,SAASC,EAAuB,GAA6D;CAC5F,IAAMC,IAAQ,OAAOC,EAAM,KAAK;CAChC,IAAI,CAAC,OAAO,SAASD,CAAK,GACzB,MAAU,UAAU,uFAAuF;CAG5G,OAAO;EACN;EACA,SAAS,CAAC,GAAGC,EAAM,OAAO;CAC3B;AACD;AAEA,SAAgBC,EAAyD,GAA0C;CAClH,IAAM,EACL,WACA,YACA,gBACA,UACA,iBACA,kBACA,oBACA,aACA,YACA,aACA,cAAW,IACX,gBAAa,IACb,WACA,SAASC,MACNC,GACEC,IAAUC,EAAWR,GAAmCK,CAAW,GAInE,EAAE,gBAAaR,EAHI,OAAO,YAC/B,OAAO,QAAQC,KAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAACW,GAAKC,OAAe,CAACD,GAAK,MAAM,QAAQC,CAAS,IAAIA,EAAU,KAAKA,CAAS,CAAC,CAE/E,CAAgB,GAC7CC,IAAeC,SACb;EACN,OAAOC,GAAc,SAAS;EAC9B,SAAS,CAAC,GAAIA,GAAc,WAAW,CAAC,CAAE;CAC3C,IACA,CAACA,GAAc,OAAOA,GAAc,OAAO,CAC5C,GAEM,EACL,YACA,cACA,iBACA,UACA,W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AAMD,EAAM;MACZ,SAAS;MACT,SAAS,EAAQE,EAAS,OAAO;MACjC,UAAUjB;KACV,CAAA;IAEF,CAAA;IAEAiB,EAAS,OAAO,KAAK,kBAACvC,GAAD;KAAM,MAAK;KAAS,UAAAuC,EAAS,OAAO;IAAQ,CAAA;GAC5D;EAEN,CAAA,GAAA,CAAC,CAACC,KAAeA,EAAY,SAAS,KACtC,kBAAC,WAAD;GAAS,WAAU;GAClB,UAAA,kBAACvC,GAAD;IAAO,KAAI;IAAX,UAAA,CACC,kBAACA,GAAD;KAAO,KAAI;KAAQ,WAAU;KAA7B,UAAA,CACC,kBAACkC,GAAD,EAAA,UAAQtB,EAAQ,aAAoB,CAAA,GACpC,kBAACb,GAAD;MAAM,MAAK;MAAK,MAAK;MACnB,UAAAa,EAAQ;KACJ,CAAA,CACA;IACP,CAAA,GAAA,kBAACuB,GAAD;KACC,MAAK;KACI;KACT,SAAS,EAAE,eACV,kBAACK,GAAD;MACC,SAASD;MACT,OAAOH,EAAM;MACb,gBAAgB,MAAgB;OAE/B,AADAA,EAAM,SAASK,CAAW,GAC1Bd,EAAW;QACV,GAAGU,EAAU;QACb,SAASI;OACV,CAAC;MACF;MACA,SAAS;MACT,UAAUpB;KACV,CAAA;IAEF,CAAA,CACK;;EACC,CAAA,CAEJ;;AAET;AAEA,EAAoB,cAAc"}
1
+ {"version":3,"file":"sync.js","names":["Text","Stack","CardRadioGroup","useFormErrors","errors","error","defaultSyncRangeDialogFormStrings","defaultTransformSubmit","hours","value","SyncRangeDialogForm","stringsProp","props","strings","useStrings","key","nextValue","initialValue","useMemo","defaultValue","formIsSubmitting","useForm","controlsDisabled","disabled","submitting","useEffect","reset","resetKey","emitChange","next","formId","handleSubmit","onSubmit","transformSubmit","values","Label","Controller","field","getValues","getError","syncOptions","CardCheckboxGroup","nextOptions"],"sources":["../../src/hooks/useFormErrors.ts","../../src/components/features/sync/sync.strings.ts","../../src/components/features/sync/sync-range-dialog-form.tsx"],"sourcesContent":["type ErrorKey<T> = Extract<keyof T, string>;\n\ntype ErrorBag<T> = Partial<Record<ErrorKey<T> | 'server' | 'general', string>>;\n\nexport const useFormErrors = <T extends Record<string, unknown> = Record<string, unknown>>(\n\terrors?: ErrorBag<T>,\n) => {\n\n\tconst getError = (error: ErrorKey<T>) => {\n\t\tif (!errors) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn errors[error];\n\t};\n\n\tconst hasError = (error: ErrorKey<T>) => {\n\t\treturn errors !== undefined && errors[error] !== undefined;\n\t};\n\n\treturn {\n\t\tgetError,\n\t\thasError,\n\t};\n};\n","/**\n * Default user-facing strings for `<SyncRangeDialogForm>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SyncRangeDialogForm strings={{ optionsLabel: t('sync.options') }} … />\n */\n\nexport interface SyncRangeDialogFormStrings {\n\t/** Label rendered above the required sync-window radio group. */\n\thoursLabel: string;\n\t/** Helper copy rendered below the sync-window label. */\n\thoursDescription: string;\n\t/** Label rendered above the optional sync-options checkbox group. */\n\toptionsLabel: string;\n\t/** Helper copy rendered below the optional sync-options label. */\n\toptionsDescription: string;\n}\n\nexport const defaultSyncRangeDialogFormStrings: SyncRangeDialogFormStrings = {\n\thoursLabel: 'Sync window',\n\thoursDescription: 'Choose how far back the integration should reconcile records.',\n\toptionsLabel: 'Options',\n\toptionsDescription: 'Limit the run when the repair only needs a specific record family.',\n};\n","import { useEffect, useMemo } from 'react';\nimport { Controller, type SubmitHandler, useForm } from 'react-hook-form';\nimport { CardCheckboxGroup, CardRadioGroup } from '../../base/choice-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useFormErrors } from '../../../hooks/useFormErrors';\nimport { useStrings } from '../../../lib/strings';\n\nimport { defaultSyncRangeDialogFormStrings } from './sync.strings';\nimport type { SyncRangeDialogFormProps, SyncRangeDialogFormSubmit, SyncRangeDialogFormValues } from './sync.types';\n\nfunction defaultTransformSubmit(value: SyncRangeDialogFormValues): SyncRangeDialogFormSubmit {\n\tconst hours = Number(value.hours);\n\tif (!Number.isFinite(hours)) {\n\t\tthrow new TypeError('SyncRangeDialogForm requires numeric range values unless transformSubmit is provided.');\n\t}\n\n\treturn {\n\t\thours,\n\t\toptions: [...value.options],\n\t};\n}\n\nexport function SyncRangeDialogForm<TSubmit = SyncRangeDialogFormSubmit>(props: SyncRangeDialogFormProps<TSubmit>) {\n\tconst {\n\t\tformId,\n\t\toptions,\n\t\tsyncOptions,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tonValueChange,\n\t\ttransformSubmit,\n\t\tonSubmit,\n\t\tonError,\n\t\tresetKey,\n\t\tdisabled = false,\n\t\tsubmitting = false,\n\t\terrors,\n\t\tstrings: stringsProp,\n\t} = props;\n\tconst strings = useStrings(defaultSyncRangeDialogFormStrings, stringsProp);\n\tconst normalizedErrors = Object.fromEntries(\n\t\tObject.entries(errors ?? {}).map(([key, nextValue]) => [key, Array.isArray(nextValue) ? nextValue[0] : nextValue]),\n\t) as Partial<Record<string, string>>;\n\tconst { getError } = useFormErrors(normalizedErrors);\n\tconst initialValue = useMemo<SyncRangeDialogFormValues>(\n\t\t() => ({\n\t\t\thours: defaultValue?.hours ?? '24',\n\t\t\toptions: [...(defaultValue?.options ?? [])],\n\t\t}),\n\t\t[defaultValue?.hours, defaultValue?.options],\n\t);\n\n\tconst {\n\t\tcontrol,\n\t\tgetValues,\n\t\thandleSubmit,\n\t\treset,\n\t\tformState: { isSubmitting: formIsSubmitting },\n\t} = useForm<SyncRangeDialogFormValues>({\n\t\tdefaultValues: value ?? initialValue,\n\t});\n\tconst controlsDisabled = disabled || submitting || formIsSubmitting;\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) reset(value);\n\t}, [reset, value]);\n\n\tuseEffect(() => {\n\t\tif (resetKey === undefined) return;\n\t\treset(value ?? initialValue);\n\t}, [initialValue, reset, resetKey, value]);\n\n\tconst emitChange = (next: SyncRangeDialogFormValues) => {\n\t\tonValueChange?.(next);\n\t};\n\n\tconst submit: SubmitHandler<SyncRangeDialogFormValues> = async (values) => {\n\t\ttry {\n\t\t\tconst transform =\n\t\t\t\ttransformSubmit ?? (defaultTransformSubmit as unknown as (value: SyncRangeDialogFormValues) => TSubmit);\n\t\t\tawait onSubmit(transform(values), values);\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('[SyncRangeDialogForm] Submit failed.', error);\n\t\t\t}\n\t\t\tonError?.(error);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Stack\n\t\t\trender={<form />}\n\t\t\tgap=\"xl\"\n\t\t\tid={formId}\n\t\t\tonSubmit={handleSubmit(submit)}\n\t\t\tclassName=\"sync-range-dialog-form--component\"\n\t\t\taria-busy={submitting || formIsSubmitting || undefined}\n\t\t>\n\t\t\t<Stack render={<section />} gap=\"md\" className=\"sync-range-dialog-form--section\">\n\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t<Label>{strings.hoursLabel}</Label>\n\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t{strings.hoursDescription}\n\t\t\t\t\t</Text>\n\t\t\t\t</Stack>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"hours\"\n\t\t\t\t\tcontrol={control}\n\t\t\t\t\trules={{ required: true }}\n\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t<CardRadioGroup\n\t\t\t\t\t\t\toptions={options}\n\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\tonValueChange={(hours) => {\n\t\t\t\t\t\t\t\tfield.onChange(hours);\n\t\t\t\t\t\t\t\temitChange({ ...getValues(), hours });\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tname={field.name}\n\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\tinvalid={Boolean(getError('hours'))}\n\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t/>\n\n\t\t\t\t{getError('hours') && <Text type=\"error\">{getError('hours')}</Text>}\n\t\t\t</Stack>\n\n\t\t\t{!!syncOptions && syncOptions.length > 0 && (\n\t\t\t\t<section className=\"sync-range-dialog-form--section rounded-inner border border-border/70 bg-muted/20 p-surface\">\n\t\t\t\t\t<Stack gap=\"md\">\n\t\t\t\t\t\t<Stack gap=\"dense\" className=\"sync-range-dialog-form--section-header\">\n\t\t\t\t\t\t\t<Label>{strings.optionsLabel}</Label>\n\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t{strings.optionsDescription}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t<Controller\n\t\t\t\t\t\t\tname=\"options\"\n\t\t\t\t\t\t\tcontrol={control}\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<CardCheckboxGroup\n\t\t\t\t\t\t\t\t\toptions={syncOptions}\n\t\t\t\t\t\t\t\t\tvalue={field.value}\n\t\t\t\t\t\t\t\t\tonValueChange={(nextOptions) => {\n\t\t\t\t\t\t\t\t\t\tfield.onChange(nextOptions);\n\t\t\t\t\t\t\t\t\t\temitChange({\n\t\t\t\t\t\t\t\t\t\t\t...getValues(),\n\t\t\t\t\t\t\t\t\t\t\toptions: nextOptions,\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tcolumns={2}\n\t\t\t\t\t\t\t\t\tdisabled={controlsDisabled}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\t\t\t\t</section>\n\t\t\t)}\n\t\t</Stack>\n\t);\n}\n\nSyncRangeDialogForm.displayName = 'SyncRangeDialogForm';\n"],"mappings":";;;;;;;;;AAIA,IAAaG,KACZ,OAeO;CACN,WAbiB,MAAuB;EACxC,IAAKC,GAIL,OAAOA,EAAOC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KAAQ,WAAU;KAA7B,UAAA,CACC,kBAACkC,GAAD,EAAA,UAAQtB,EAAQ,aAAoB,CAAA,GACpC,kBAACb,GAAD;MAAM,MAAK;MAAK,MAAK;MACnB,UAAAa,EAAQ;KACJ,CAAA,CACA;IACP,CAAA,GAAA,kBAACuB,GAAD;KACC,MAAK;KACI;KACT,SAAS,EAAE,eACV,kBAACK,GAAD;MACC,SAASD;MACT,OAAOH,EAAM;MACb,gBAAgB,MAAgB;OAE/B,AADAA,EAAM,SAASK,CAAW,GAC1Bd,EAAW;QACV,GAAGU,EAAU;QACb,SAASI;OACV,CAAC;MACF;MACA,SAAS;MACT,UAAUpB;KACV,CAAA;IAEF,CAAA,CACK;;EACC,CAAA,CAEJ;;AAET;AAEA,EAAoB,cAAc"}
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../table-ghtAQ-JJ.js";
2
+ import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, j as v, k as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, w as A, x as j, y as M } from "../table-CcRDZiLP.js";
3
3
  export { D as AvatarCell, b as CellStack, O as CellValue, h as ColumnVisibilityToggle, S as CurrencyCell, m as DataTable, o as DataTableActions, k as DataTableBody, p as DataTableFilterBar, l as DataTableHeader, x as DataTableToolbar, T as DateCell, _ as DateMetaCell, g as FullscreenToggle, y as Pagination, E as ResourceCell, u as StatusCell, C as StatusClusterCell, f as TableLink, M as addSelectionColumn, d as createHeaderSelectionCheckbox, j as createRowSelectionCheckbox, e as defaultDataTableStrings, s as getCellClassName, i as getDataTableScrollContainer, t as getRowClassName, A as getSelectedRowsData, c as handleColumnVisibilityChange, r as handleRowSelectionChange, n as handleSortingChange, v as mergeDataTableStrings, a as useDataTableScrollState, w as useDataTableSize };