themelia-react-ui 2.0.1 → 2.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 (480) hide show
  1. package/CHANGELOG.md +307 -131
  2. package/README.md +28 -8
  3. package/THIRD_PARTY_NOTICES.md +13 -0
  4. package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
  5. package/dist/accordion-Cjb6sx0G.js.map +1 -0
  6. package/dist/action-menu-CllU52Mm.js +280 -0
  7. package/dist/action-menu-CllU52Mm.js.map +1 -0
  8. package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
  9. package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
  10. package/dist/ai-artifact-DvTwDVyL.js +1148 -0
  11. package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
  12. package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
  13. package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
  14. package/dist/attachment-BxDfL2mw.js +246 -0
  15. package/dist/attachment-BxDfL2mw.js.map +1 -0
  16. package/dist/{auth-CYxKfo69.js → auth-ax2BqjrI.js} +58 -54
  17. package/dist/auth-ax2BqjrI.js.map +1 -0
  18. package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
  19. package/dist/avatar-DAPlDvhJ.js.map +1 -0
  20. package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
  21. package/dist/badge-HpFqoqSY.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +1 -1
  29. package/dist/base/cards.js +2 -2
  30. package/dist/base/carousel.js +40 -36
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +92 -92
  33. package/dist/base/cascader.js.map +1 -1
  34. package/dist/base/chart.js +1 -1
  35. package/dist/base/choice-inputs.js +2 -2
  36. package/dist/base/code-block.js +1 -1
  37. package/dist/base/combobox.js +2 -2
  38. package/dist/base/command.js +1 -1
  39. package/dist/base/copyable.js +1 -1
  40. package/dist/base/date-pickers.js +2 -2
  41. package/dist/base/display.js +6 -6
  42. package/dist/base/feedback.js +3 -3
  43. package/dist/base/forms-numeric.js +1 -1
  44. package/dist/base/forms.js +2 -2
  45. package/dist/base/inline-edit.js +14 -14
  46. package/dist/base/inline-edit.js.map +1 -1
  47. package/dist/base/item.js +1 -1
  48. package/dist/base/media-gallery.js +1 -1
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +6 -6
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +1 -1
  54. package/dist/base/repeaters.js +171 -176
  55. package/dist/base/repeaters.js.map +1 -1
  56. package/dist/base/sheet.js +1 -1
  57. package/dist/base/sidebar.js +1 -1
  58. package/dist/base/signature-pad.js +6 -6
  59. package/dist/base/skeleton.js +1 -1
  60. package/dist/base/spinner.js +79 -2
  61. package/dist/base/spinner.js.map +1 -0
  62. package/dist/base/structure.js +1 -1
  63. package/dist/base/table.js +1 -1
  64. package/dist/base/text-inputs.js +2 -2
  65. package/dist/base/toaster.js +46 -45
  66. package/dist/base/toaster.js.map +1 -1
  67. package/dist/base/tree.js +1 -1
  68. package/dist/base/upload-queue.js +1 -1
  69. package/dist/base/upload.js +3 -3
  70. package/dist/base/value-inputs.js +1 -1
  71. package/dist/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
  72. package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
  73. package/dist/blocks/admin.js +42 -42
  74. package/dist/blocks/admin.js.map +1 -1
  75. package/dist/blocks/ai.js +260 -240
  76. package/dist/blocks/ai.js.map +1 -1
  77. package/dist/blocks/analytics/usage-card.js +1 -1
  78. package/dist/blocks/analytics.js +620 -585
  79. package/dist/blocks/analytics.js.map +1 -1
  80. package/dist/blocks/collaboration.js +1 -1
  81. package/dist/blocks/commerce/receipt.js +1 -1
  82. package/dist/blocks/commerce.js +1152 -1109
  83. package/dist/blocks/commerce.js.map +1 -1
  84. package/dist/blocks/data-display.js +2 -2
  85. package/dist/blocks/onboarding.js +48 -39
  86. package/dist/blocks/onboarding.js.map +1 -1
  87. package/dist/blocks/planning.js +13 -12
  88. package/dist/blocks/planning.js.map +1 -1
  89. package/dist/blocks/timelines.js +1 -1
  90. package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
  91. package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
  92. package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
  93. package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
  94. package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
  95. package/dist/buttons-DPZekJFu.js.map +1 -0
  96. package/dist/cards-BaBZR-AU.js +68 -0
  97. package/dist/cards-BaBZR-AU.js.map +1 -0
  98. package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
  99. package/dist/chart-ZOYyK2xG.js.map +1 -0
  100. package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
  101. package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
  102. package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
  103. package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
  104. package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
  105. package/dist/code-block-DeneBJR_.js.map +1 -0
  106. package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
  107. package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
  108. package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
  109. package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
  110. package/dist/combobox-C0EQW6dr.js +875 -0
  111. package/dist/combobox-C0EQW6dr.js.map +1 -0
  112. package/dist/combobox-xCQ2RMNE.js +309 -0
  113. package/dist/combobox-xCQ2RMNE.js.map +1 -0
  114. package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
  115. package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
  116. package/dist/{comments-BpDuCUUu.js → comments-BYYlTA8E.js} +114 -105
  117. package/dist/comments-BYYlTA8E.js.map +1 -0
  118. package/dist/components/base/badge/badge.recipes.d.ts +1 -1
  119. package/dist/components/base/buttons/loader-button.d.ts +2 -1
  120. package/dist/components/base/cards/card.recipes.d.ts +2 -3
  121. package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
  122. package/dist/components/base/cards/smart-card.types.d.ts +11 -4
  123. package/dist/components/base/chart/chart.d.ts +2 -5
  124. package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
  125. package/dist/components/base/combobox/index.d.ts +30 -4
  126. package/dist/components/base/forms/form-sizing.d.ts +11 -3
  127. package/dist/components/base/navigation/pagination.d.ts +5 -2
  128. package/dist/components/base/popover/popover.recipes.d.ts +15 -1
  129. package/dist/components/base/table/index.d.ts +9 -2
  130. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  131. package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
  132. package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
  133. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
  134. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
  135. package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
  136. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
  137. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
  138. package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
  139. package/dist/components/features/appointment-calendar/index.d.ts +3 -0
  140. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
  141. package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
  142. package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
  143. package/dist/components/features/combobox/types.d.ts +4 -0
  144. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  145. package/dist/components/features/rich-text-editor/index.d.ts +1 -1
  146. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
  147. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
  148. package/dist/components/features/table/table-header.d.ts +1 -1
  149. package/dist/components/features/table/table.strings.d.ts +55 -1
  150. package/dist/components/features/table/table.types.d.ts +17 -4
  151. package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
  152. package/dist/components/primitives/number.d.ts +4 -2
  153. package/dist/components/primitives/value.d.ts +3 -1
  154. package/dist/components/typography/text-link.d.ts +4 -0
  155. package/dist/components/ui/combobox.d.ts +6 -2
  156. package/dist/components/ui/item.d.ts +8 -8
  157. package/dist/components/ui/tabs.d.ts +1 -1
  158. package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
  159. package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
  160. package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
  161. package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
  162. package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
  163. package/dist/data-display-DT_khPl_.js.map +1 -0
  164. package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
  165. package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
  166. package/dist/{date-picker-CF-DtUpF.js → date-picker-ay0Pha_a.js} +594 -593
  167. package/dist/date-picker-ay0Pha_a.js.map +1 -0
  168. package/dist/date-pickers-Ccw8DL2b.js +175 -0
  169. package/dist/date-pickers-Ccw8DL2b.js.map +1 -0
  170. package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
  171. package/dist/display-hAc1HjpI.js.map +1 -0
  172. package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
  173. package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
  174. package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
  175. package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
  176. package/dist/features/activities.js +398 -375
  177. package/dist/features/activities.js.map +1 -1
  178. package/dist/features/ai-chat.js +188 -179
  179. package/dist/features/ai-chat.js.map +1 -1
  180. package/dist/features/appointment-calendar.js +683 -0
  181. package/dist/features/appointment-calendar.js.map +1 -0
  182. package/dist/features/async-preview.js +109 -107
  183. package/dist/features/async-preview.js.map +1 -1
  184. package/dist/features/combobox.js +1 -1
  185. package/dist/features/comments.js +1 -1
  186. package/dist/features/data-view.js +137 -137
  187. package/dist/features/data-view.js.map +1 -1
  188. package/dist/features/email-composer.js +255 -255
  189. package/dist/features/email-composer.js.map +1 -1
  190. package/dist/features/event-calendar.js +254 -248
  191. package/dist/features/event-calendar.js.map +1 -1
  192. package/dist/features/filters.js +1 -1
  193. package/dist/features/global-search.js +35 -32
  194. package/dist/features/global-search.js.map +1 -1
  195. package/dist/features/kanban.js +118 -117
  196. package/dist/features/kanban.js.map +1 -1
  197. package/dist/features/map.js +233 -231
  198. package/dist/features/map.js.map +1 -1
  199. package/dist/features/media-library.js +789 -775
  200. package/dist/features/media-library.js.map +1 -1
  201. package/dist/features/mentions.js +1 -1
  202. package/dist/features/overlays.js +1 -1
  203. package/dist/features/products.js +922 -902
  204. package/dist/features/products.js.map +1 -1
  205. package/dist/features/questionnaire.js +28 -24
  206. package/dist/features/questionnaire.js.map +1 -1
  207. package/dist/features/resource-assignment.js +18 -15
  208. package/dist/features/resource-assignment.js.map +1 -1
  209. package/dist/features/resource.js +12 -12
  210. package/dist/features/resource.js.map +1 -1
  211. package/dist/features/rich-text-editor.js +2 -2
  212. package/dist/features/schema-form.js +15 -13
  213. package/dist/features/schema-form.js.map +1 -1
  214. package/dist/features/suggestions.js +3 -3
  215. package/dist/features/sync.js +11 -5
  216. package/dist/features/sync.js.map +1 -1
  217. package/dist/features/table.js +1 -1
  218. package/dist/features/theme-tweaker.js +493 -489
  219. package/dist/features/theme-tweaker.js.map +1 -1
  220. package/dist/feedback-BYIhtitP.js +239 -0
  221. package/dist/feedback-BYIhtitP.js.map +1 -0
  222. package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
  223. package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
  224. package/dist/{filters-BkHH53uv.js → filters-BGfvjP4d.js} +589 -580
  225. package/dist/filters-BGfvjP4d.js.map +1 -0
  226. package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
  227. package/dist/form-field-CwH9y77i.js.map +1 -0
  228. package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
  229. package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
  230. package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
  231. package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
  232. package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
  233. package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
  234. package/dist/{header-BOefOKd1.js → header-CGXuhcRm.js} +160 -153
  235. package/dist/header-CGXuhcRm.js.map +1 -0
  236. package/dist/{hooks-9k_TtmKh.js → hooks-Dkz0K2WT.js} +2 -2
  237. package/dist/{hooks-9k_TtmKh.js.map → hooks-Dkz0K2WT.js.map} +1 -1
  238. package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
  239. package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
  240. package/dist/index.js +3 -3
  241. package/dist/input-CZw8iU99.js +21 -0
  242. package/dist/input-CZw8iU99.js.map +1 -0
  243. package/dist/input-DQdEd0YD.js +263 -0
  244. package/dist/input-DQdEd0YD.js.map +1 -0
  245. package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
  246. package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
  247. package/dist/item-K5_ghvze.js +275 -0
  248. package/dist/item-K5_ghvze.js.map +1 -0
  249. package/dist/layout/app-shell.js +1 -1
  250. package/dist/layout/auth.js +1 -1
  251. package/dist/layout/containers.js +1 -1
  252. package/dist/layout/header.js +1 -1
  253. package/dist/layout/hooks.js +1 -1
  254. package/dist/layout/navigation.js +1 -1
  255. package/dist/layout/page.js +1 -1
  256. package/dist/layout/settings.js +1 -1
  257. package/dist/layout/sidebar.js +2 -2
  258. package/dist/layout/workspace.js +1 -1
  259. package/dist/layout.js +10 -10
  260. package/dist/lib/affordance-geometry.generated.d.ts +71 -0
  261. package/dist/lib/editable-text-recipe.d.ts +4 -4
  262. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  263. package/dist/lib/interaction-recipes.d.ts +5 -0
  264. package/dist/lib/theme-mode-css.d.ts +7 -0
  265. package/dist/lib/tone-recipes.d.ts +8 -0
  266. package/dist/lib/ui-provider/types.d.ts +2 -2
  267. package/dist/lib/utils.js +1 -1
  268. package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
  269. package/dist/media-gallery-3zIVLMWH.js.map +1 -0
  270. package/dist/{mentions-D-uyCh01.js → mentions-utuUvH1K.js} +144 -142
  271. package/dist/mentions-utuUvH1K.js.map +1 -0
  272. package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
  273. package/dist/message-DZ_ruyUV.js.map +1 -0
  274. package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
  275. package/dist/metadata-list-8N16ZMW_.js.map +1 -0
  276. package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
  277. package/dist/navigation-Bnotn4AQ.js.map +1 -0
  278. package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
  279. package/dist/navigation-BzhHI3lo.js.map +1 -0
  280. package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
  281. package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
  282. package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
  283. package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
  284. package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
  285. package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
  286. package/dist/{overlays-I0axtYA6.js → overlays-DNWmZrJ4.js} +14 -12
  287. package/dist/overlays-DNWmZrJ4.js.map +1 -0
  288. package/dist/{page-B5dTH9gE.js → page-Bgl1F560.js} +8 -8
  289. package/dist/{page-B5dTH9gE.js.map → page-Bgl1F560.js.map} +1 -1
  290. package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
  291. package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
  292. package/dist/pagination-BL25hu2s.js +158 -0
  293. package/dist/pagination-BL25hu2s.js.map +1 -0
  294. package/dist/{popover-Di55PyAI.js → popover-7_m66eYW.js} +8 -7
  295. package/dist/{popover-Di55PyAI.js.map → popover-7_m66eYW.js.map} +1 -1
  296. package/dist/popover-menu-B9WWygpa.js +100 -0
  297. package/dist/popover-menu-B9WWygpa.js.map +1 -0
  298. package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
  299. package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
  300. package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
  301. package/dist/primitives-BFK08r9M.js.map +1 -0
  302. package/dist/primitives.js +4 -4
  303. package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
  304. package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
  305. package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
  306. package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
  307. package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
  308. package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
  309. package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
  310. package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
  311. package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
  312. package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
  313. package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
  314. package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
  315. package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
  316. package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
  317. package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
  318. package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
  319. package/dist/services/actions.js +1 -1
  320. package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
  321. package/dist/settings-ybnjVwbd.js.map +1 -0
  322. package/dist/{sheet-4SEvVYzA.js → sheet-CGpB3omz.js} +8 -7
  323. package/dist/{sheet-4SEvVYzA.js.map → sheet-CGpB3omz.js.map} +1 -1
  324. package/dist/{sidebar-d7Dg80ln.js → sidebar-A0ElHINE.js} +14 -13
  325. package/dist/{sidebar-d7Dg80ln.js.map → sidebar-A0ElHINE.js.map} +1 -1
  326. package/dist/{sidebar-C7WWR29L.js → sidebar-CPx_7YBa.js} +183 -182
  327. package/dist/sidebar-CPx_7YBa.js.map +1 -0
  328. package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
  329. package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
  330. package/dist/smart-card-DiC5aac3.js +604 -0
  331. package/dist/smart-card-DiC5aac3.js.map +1 -0
  332. package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
  333. package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
  334. package/dist/style.css +1 -1
  335. package/dist/table-BweFy_P9.js +1530 -0
  336. package/dist/table-BweFy_P9.js.map +1 -0
  337. package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
  338. package/dist/table-DsfzoUia.js.map +1 -0
  339. package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
  340. package/dist/tabs-CDocW5D1.js.map +1 -0
  341. package/dist/text-inputs-f9Ia-aCi.js +353 -0
  342. package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
  343. package/dist/theme-mode-css-BB-_RYab.js +14 -0
  344. package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
  345. package/dist/theme-scope-BJ6eE2xt.js +50 -0
  346. package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
  347. package/dist/theme.css +285 -228
  348. package/dist/themes/green.css +16 -12
  349. package/dist/timelines-CwM_9IhD.js +457 -0
  350. package/dist/timelines-CwM_9IhD.js.map +1 -0
  351. package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
  352. package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
  353. package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
  354. package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
  355. package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
  356. package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
  357. package/dist/typography/rich-text.js +1 -1
  358. package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
  359. package/dist/typography-UTnveOEy.js.map +1 -0
  360. package/dist/typography.js +2 -2
  361. package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
  362. package/dist/ui-provider-C_U0Xma4.js.map +1 -0
  363. package/dist/ui-provider.js +2 -2
  364. package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
  365. package/dist/upload-CXyxmQBP.js.map +1 -0
  366. package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
  367. package/dist/upload-queue-Boscubn9.js.map +1 -0
  368. package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
  369. package/dist/usage-card-BhO5eqkX.js.map +1 -0
  370. package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
  371. package/dist/utils-BRhFDwuU.js.map +1 -0
  372. package/dist/{value-inputs-TAYMX111.js → value-inputs-DXPDjvBU.js} +268 -252
  373. package/dist/value-inputs-DXPDjvBU.js.map +1 -0
  374. package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
  375. package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
  376. package/dist/{workspace-DH0v0KcB.js → workspace-Cdrg7k9f.js} +34 -33
  377. package/dist/workspace-Cdrg7k9f.js.map +1 -0
  378. package/docs/consumer-skill/SKILL.md +2 -2
  379. package/docs/consumer-skill/references/agents-md.md +1 -1
  380. package/docs/consumer-skill/references/composition.md +8 -6
  381. package/docs/consumer-skill/references/integration.md +4 -3
  382. package/docs/consumer-skill/references/public-api.json +105 -2
  383. package/docs/consumer-skill/references/review.md +7 -0
  384. package/docs/consumer-skill/references/theming.md +71 -6
  385. package/docs/consumer-skill/references/tokens.json +1 -1
  386. package/docs/consumer-skill/references/workflows.md +25 -0
  387. package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
  388. package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
  389. package/package.json +8 -4
  390. package/dist/accordion-B6a3vVgA.js.map +0 -1
  391. package/dist/action-menu-TzCoSlwL.js +0 -280
  392. package/dist/action-menu-TzCoSlwL.js.map +0 -1
  393. package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
  394. package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
  395. package/dist/ai-artifact-BMJdv-6q.js +0 -1115
  396. package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
  397. package/dist/attachment-BtfhGm8i.js +0 -245
  398. package/dist/attachment-BtfhGm8i.js.map +0 -1
  399. package/dist/auth-CYxKfo69.js.map +0 -1
  400. package/dist/avatar-BBnEJIx8.js.map +0 -1
  401. package/dist/badge-MrKVNzW9.js.map +0 -1
  402. package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
  403. package/dist/breadcrumbs-D5t7I023.js.map +0 -1
  404. package/dist/buttons-SbIcm1HJ.js.map +0 -1
  405. package/dist/cards-CiiHpKYd.js +0 -66
  406. package/dist/cards-CiiHpKYd.js.map +0 -1
  407. package/dist/chart-QfrARkXl.js.map +0 -1
  408. package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
  409. package/dist/code-block-Dgbu-CU3.js.map +0 -1
  410. package/dist/combobox-2Ic8N9bL.js +0 -278
  411. package/dist/combobox-2Ic8N9bL.js.map +0 -1
  412. package/dist/combobox-DLl0bfiq.js +0 -867
  413. package/dist/combobox-DLl0bfiq.js.map +0 -1
  414. package/dist/comments-BpDuCUUu.js.map +0 -1
  415. package/dist/data-display-DafIvCl5.js.map +0 -1
  416. package/dist/date-picker-CF-DtUpF.js.map +0 -1
  417. package/dist/date-pickers-BmzxJl5l.js +0 -174
  418. package/dist/date-pickers-BmzxJl5l.js.map +0 -1
  419. package/dist/display-DsQTVzMz.js.map +0 -1
  420. package/dist/dropdown-menu-E2qmdC7o.js +0 -193
  421. package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
  422. package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
  423. package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
  424. package/dist/feedback-qNuMBtRH.js +0 -233
  425. package/dist/feedback-qNuMBtRH.js.map +0 -1
  426. package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
  427. package/dist/filters-BkHH53uv.js.map +0 -1
  428. package/dist/form-field-DUt4UxSV.js.map +0 -1
  429. package/dist/form-sizing-By94KzXE.js.map +0 -1
  430. package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
  431. package/dist/header-BOefOKd1.js.map +0 -1
  432. package/dist/input-DWhBBBww.js +0 -262
  433. package/dist/input-DWhBBBww.js.map +0 -1
  434. package/dist/input-Ddi_LSYv.js +0 -20
  435. package/dist/input-Ddi_LSYv.js.map +0 -1
  436. package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
  437. package/dist/item-DEmDiTlD.js +0 -265
  438. package/dist/item-DEmDiTlD.js.map +0 -1
  439. package/dist/media-gallery-DcTtAaeC.js.map +0 -1
  440. package/dist/mentions-D-uyCh01.js.map +0 -1
  441. package/dist/message-CdHgIWKf.js.map +0 -1
  442. package/dist/metadata-list-X5rYAKSB.js.map +0 -1
  443. package/dist/navigation-D3KwXmaq.js.map +0 -1
  444. package/dist/navigation-HJf5zxlH.js.map +0 -1
  445. package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
  446. package/dist/overlays-I0axtYA6.js.map +0 -1
  447. package/dist/pagination-3bPA_a6K.js +0 -149
  448. package/dist/pagination-3bPA_a6K.js.map +0 -1
  449. package/dist/popover-menu-B71Tn2Qz.js +0 -99
  450. package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
  451. package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
  452. package/dist/primitives-B-CkiEMU.js.map +0 -1
  453. package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
  454. package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
  455. package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
  456. package/dist/settings-CQW3b-Cu.js.map +0 -1
  457. package/dist/sidebar-C7WWR29L.js.map +0 -1
  458. package/dist/smart-card-lFKxn5Hu.js +0 -595
  459. package/dist/smart-card-lFKxn5Hu.js.map +0 -1
  460. package/dist/spinner-fa3h1Aif.js +0 -80
  461. package/dist/spinner-fa3h1Aif.js.map +0 -1
  462. package/dist/table-CIKyLUsy.js.map +0 -1
  463. package/dist/table-CrcLN9Io.js +0 -1458
  464. package/dist/table-CrcLN9Io.js.map +0 -1
  465. package/dist/tabs-DwBJfjxX.js.map +0 -1
  466. package/dist/text-inputs-aaK9wcDT.js +0 -326
  467. package/dist/text-inputs-aaK9wcDT.js.map +0 -1
  468. package/dist/theme-scope-kStaAer0.js +0 -39
  469. package/dist/theme-scope-kStaAer0.js.map +0 -1
  470. package/dist/timelines-C_SBwHNP.js +0 -442
  471. package/dist/timelines-C_SBwHNP.js.map +0 -1
  472. package/dist/tone-recipes-CPoExcTE.js.map +0 -1
  473. package/dist/typography-DTRkE9zL.js.map +0 -1
  474. package/dist/ui-provider-1D_NSYzO.js.map +0 -1
  475. package/dist/upload-BO8-CLN6.js.map +0 -1
  476. package/dist/upload-queue-EOC8g1gf.js.map +0 -1
  477. package/dist/usage-card-obRaBskq.js.map +0 -1
  478. package/dist/utils-l5LpDw2z.js.map +0 -1
  479. package/dist/value-inputs-TAYMX111.js.map +0 -1
  480. package/dist/workspace-DH0v0KcB.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"resource.js","names":["Text","Stack","LoadingState","ErrorState","Initials","IconBadge","AvatarFallback","Avatar","AvatarImage","ContentBlock","MetadataList","PageHeading","OverflowTabBar","EmptyState","defaultResourceStrings","ResourceHeader","Icon","icon","titleText","title","resolvedMedia","media","avatarUrl","avatarFallback","cn","mediaClassName","avatarAlt","iconTone","badges","metadata","className","ResourceActionBar","sticky","leading","children","trailing","ResourceEmptyState","props","ResourceShellFrame","emptyState","stringsProp","strings","useStrings","header","slots","headerClassName","toolbarNode","toolbar","loadingNode","emptyNode","emptySlot","defaultErrorNode","error","errorNode","body","loading","variant","contentClassName","asideClassName","ResourceIndexShell","ResourceShowShell","TabbedResourceShell","tabs","activeTab","onTabChange","tabsClassName","moreLabel","tabsAriaLabel","ResourceCard","name","footer","ResourceDetailsSection","metadataColumns","metadataDense","help"],"sources":["../../src/components/features/resource/resource.strings.ts","../../src/components/features/resource/resource.tsx"],"sourcesContent":["/** Default copy for state-aware resource workspace replacement states. */\nexport interface ResourceStrings {\n\tloadingLabel: string;\n\tloadingDescription: string;\n\temptyTitle: string;\n\temptyDescription: string;\n\terrorTitle: string;\n\terrorDescription: string;\n\tretryLabel: string;\n\ttabsAriaLabel: string;\n}\n\nexport const defaultResourceStrings: ResourceStrings = {\n\tloadingLabel: 'Loading resources',\n\tloadingDescription: 'Preparing the latest data for this view.',\n\temptyTitle: 'No resources found',\n\temptyDescription: 'There are no records available for this view.',\n\terrorTitle: 'Resources unavailable',\n\terrorDescription: 'The resource data could not be loaded.',\n\tretryLabel: 'Try again',\n\ttabsAriaLabel: 'Resource sections',\n};\n","/** State-aware resource workspace primitives for coordinated index/show surfaces. */\nimport { ContentBlock, IconBadge } from '../../base/display';\nimport { Avatar, AvatarFallback, AvatarImage } from '../../base/avatar';\nimport { ErrorState, LoadingState } from '../../base/feedback';\nimport { MetadataList } from '../../base/metadata-list';\nimport { EmptyState } from '../../blocks/data-display';\nimport { OverflowTabBar, PageHeading } from '../../base/navigation';\nimport { Stack } from '../../base/structure';\nimport { Initials } from '../../primitives';\nimport { Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { defaultResourceStrings } from './resource.strings';\nimport type {\n\tResourceActionBarProps,\n\tResourceDetailsSectionProps,\n\tResourceEmptyStateProps,\n\tResourceHeaderProps,\n\tResourceIndexShellProps,\n\tResourceShowShellProps,\n\tTabbedResourceShellProps,\n} from './resource.types';\n\nexport function ResourceHeader({\n\ttitle,\n\tdescription,\n\teyebrow,\n\tmedia,\n\tavatarUrl,\n\tavatarAlt,\n\tavatarFallback,\n\ticon,\n\ticonTone = 'neutral',\n\tbadges,\n\tmetadata,\n\tactions,\n\tprimaryAction,\n\tsecondaryActions,\n\tmoreActionsLabel,\n\trenderLink,\n\tclassName,\n\tcontentClassName,\n\tmediaClassName,\n}: ResourceHeaderProps) {\n\tconst Icon = icon;\n\tconst titleText = typeof title === 'string' ? title : '';\n\tconst resolvedMedia =\n\t\tmedia ??\n\t\t(avatarUrl || avatarFallback ? (\n\t\t\t<Avatar className={cn('resource-header--avatar size-avatar-lg', mediaClassName)}>\n\t\t\t\t{!!avatarUrl && <AvatarImage src={avatarUrl} alt={avatarAlt ?? titleText} />}\n\t\t\t\t<AvatarFallback>{avatarFallback ?? <Initials value={titleText} strategy=\"first-words\" />}</AvatarFallback>\n\t\t\t</Avatar>\n\t\t) : Icon ? (\n\t\t\t<IconBadge\n\t\t\t\ticon={Icon}\n\t\t\t\tshape=\"square\"\n\t\t\t\ttone={iconTone}\n\t\t\t\tclassName={cn('resource-header--icon size-avatar-lg [&>svg]:size-icon-lg', mediaClassName)}\n\t\t\t/>\n\t\t) : null);\n\n\treturn (\n\t\t<PageHeading\n\t\t\teyebrow={eyebrow}\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tleading={resolvedMedia}\n\t\t\ttitleSuffix={\n\t\t\t\tbadges ? (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdata-slot=\"resource-header-badges\"\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\tclassName=\"resource-header--badges shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{badges}\n\t\t\t\t\t</Stack>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tafterDescription={\n\t\t\t\tmetadata ? (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdata-slot=\"resource-header-metadata\"\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\tgap=\"md\"\n\t\t\t\t\t\tclassName=\"resource-header--metadata mt-space-sm\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{metadata}\n\t\t\t\t\t</Stack>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tactions={actions}\n\t\t\tprimaryAction={primaryAction}\n\t\t\tsecondaryActions={secondaryActions}\n\t\t\tmoreActionsLabel={moreActionsLabel}\n\t\t\trenderLink={renderLink}\n\t\t\twithSeparator={false}\n\t\t\tclassName={cn('resource-header--component', className)}\n\t\t\tcontentClassName={contentClassName}\n\t\t\teyebrowClassName=\"resource-header--eyebrow\"\n\t\t\ttitleClassName=\"resource-header--title truncate\"\n\t\t\tdescriptionClassName=\"resource-header--description max-w-3xl\"\n\t\t\tactionsClassName=\"resource-header--actions flex-wrap\"\n\t\t/>\n\t);\n}\n\nexport function ResourceActionBar({ children, leading, trailing, sticky = false, className }: ResourceActionBarProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"resource-action-bar\"\n\t\t\tdata-slot=\"resource-action-bar\"\n\t\t\tclassName={cn(\n\t\t\t\t'resource-action-bar--component rounded-radius border border-border bg-card px-surface py-row-y-lg shadow-xs',\n\t\t\t\tsticky && 'sticky top-shell-header z-30',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack\n\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\tgap=\"lg\"\n\t\t\t\talign={{ sm: 'center' }}\n\t\t\t\tjustify={{ sm: 'between' }}\n\t\t\t\twrap={{ sm: false }}\n\t\t\t\tclassName=\"resource-action-bar--layout\"\n\t\t\t>\n\t\t\t\t<Stack\n\t\t\t\t\tdata-slot=\"resource-action-leading\"\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"resource-action-bar--leading flex-1\"\n\t\t\t\t>\n\t\t\t\t\t{leading ?? children}\n\t\t\t\t</Stack>\n\t\t\t\t{!!trailing && (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdata-slot=\"resource-action-trailing\"\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\tgap=\"md\"\n\t\t\t\t\t\tclassName=\"resource-action-bar--trailing shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{trailing}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport function ResourceEmptyState(props: ResourceEmptyStateProps) {\n\treturn (\n\t\t<EmptyState\n\t\t\t{...props}\n\t\t\tdata-component=\"resource-empty-state\"\n\t\t\tdata-slot=\"resource-empty-state\"\n\t\t\tclassName={cn('resource-empty-state--component', props.className)}\n\t\t/>\n\t);\n}\n\nfunction ResourceShellFrame({\n\tchildren,\n\ttitle,\n\tdescription,\n\tactions,\n\tprimaryAction,\n\tsecondaryActions,\n\tmoreActionsLabel,\n\trenderLink,\n\ttoolbar,\n\temptySlot,\n\tempty: emptyState = false,\n\tloading = false,\n\terror,\n\tonRetry,\n\tslots,\n\tclassName,\n\theaderClassName,\n\tcontentClassName,\n\tstrings: stringsProp,\n\tasideClassName,\n\tvariant,\n}: ResourceIndexShellProps & {\n\tasideClassName?: string;\n\tvariant: 'index' | 'show';\n}) {\n\tconst strings = useStrings(defaultResourceStrings, stringsProp);\n\tconst header =\n\t\tslots?.header ??\n\t\t(title ? (\n\t\t\t<ResourceHeader\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description}\n\t\t\t\tactions={actions}\n\t\t\t\tprimaryAction={primaryAction}\n\t\t\t\tsecondaryActions={secondaryActions}\n\t\t\t\tmoreActionsLabel={moreActionsLabel}\n\t\t\t\trenderLink={renderLink}\n\t\t\t\tclassName={headerClassName}\n\t\t\t/>\n\t\t) : null);\n\tconst toolbarNode = slots?.toolbar ?? toolbar;\n\tconst loadingNode = slots?.loading ?? (\n\t\t<LoadingState\n\t\t\tvariant=\"panel\"\n\t\t\tlabel={strings.loadingLabel}\n\t\t\tdescription={strings.loadingDescription}\n\t\t\tskeleton\n\t\t\tlines={4}\n\t\t\tclassName=\"resource-shell--loading rounded-radius border border-border bg-card\"\n\t\t/>\n\t);\n\tconst emptyNode = slots?.empty ?? emptySlot ?? (\n\t\t<ResourceEmptyState title={strings.emptyTitle} description={strings.emptyDescription} border />\n\t);\n\tconst defaultErrorNode = (\n\t\t<ErrorState\n\t\t\ttitle={strings.errorTitle}\n\t\t\tdescription={\n\t\t\t\terror instanceof Error\n\t\t\t\t\t? error.message\n\t\t\t\t\t: typeof error === 'string' || typeof error === 'number'\n\t\t\t\t\t\t? String(error)\n\t\t\t\t\t\t: strings.errorDescription\n\t\t\t}\n\t\t\tonRetry={onRetry}\n\t\t\tretryLabel={strings.retryLabel}\n\t\t/>\n\t);\n\tconst errorNode =\n\t\tslots?.error ??\n\t\t(error &&\n\t\ttypeof error !== 'boolean' &&\n\t\ttypeof error !== 'string' &&\n\t\ttypeof error !== 'number' &&\n\t\t!(error instanceof Error)\n\t\t\t? error\n\t\t\t: defaultErrorNode);\n\tconst body = loading ? loadingNode : error ? errorNode : emptyState ? emptyNode : children;\n\n\treturn (\n\t\t<section\n\t\t\tdata-component={`resource-${variant}-shell`}\n\t\t\tdata-slot={`resource-${variant}-shell`}\n\t\t\tclassName={cn(\n\t\t\t\t`resource-${variant}-shell--component min-w-0`,\n\t\t\t\tvariant === 'index' && '@container/resource-index',\n\t\t\t\tvariant === 'show' && '@container/resource-show',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot={`resource-${variant}-layout`}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`resource-${variant}-shell--layout grid min-w-0 gap-space-xl`,\n\t\t\t\t\tslots?.aside &&\n\t\t\t\t\t\tvariant === 'show' &&\n\t\t\t\t\t\t'@4xl/resource-show:grid-cols-[minmax(0,1fr)_var(--shell-sidebar-width)]',\n\t\t\t\t\tslots?.aside &&\n\t\t\t\t\t\tvariant === 'index' &&\n\t\t\t\t\t\t'@4xl/resource-index:grid-cols-[minmax(0,1fr)_var(--shell-sidebar-width)]',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<Stack gap=\"xl\">\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<div data-slot={`resource-${variant}-header`} className={`resource-${variant}-shell--header`}>\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!toolbarNode && (\n\t\t\t\t\t\t<div data-slot={`resource-${variant}-toolbar`} className={`resource-${variant}-shell--toolbar`}>\n\t\t\t\t\t\t\t{toolbarNode}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot={`resource-${variant}-content`}\n\t\t\t\t\t\tclassName={cn(`resource-${variant}-shell--content min-w-0`, contentClassName)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{body}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!slots?.footer && (\n\t\t\t\t\t\t<div data-slot={`resource-${variant}-footer`} className={`resource-${variant}-shell--footer`}>\n\t\t\t\t\t\t\t{slots.footer}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t{!!slots?.aside && (\n\t\t\t\t\t<aside\n\t\t\t\t\t\tdata-slot={`resource-${variant}-aside`}\n\t\t\t\t\t\tclassName={cn(`resource-${variant}-shell--aside min-w-0`, asideClassName)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{slots.aside}\n\t\t\t\t\t</aside>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</section>\n\t);\n}\n\nexport function ResourceIndexShell(props: ResourceIndexShellProps) {\n\treturn <ResourceShellFrame {...props} variant=\"index\" />;\n}\n\nexport function ResourceShowShell(props: ResourceShowShellProps) {\n\treturn <ResourceShellFrame {...props} variant=\"show\" />;\n}\n\nexport function TabbedResourceShell({\n\ttabs,\n\tactiveTab,\n\tonTabChange,\n\ttabsClassName,\n\tmoreLabel,\n\ttabsAriaLabel,\n\ttoolbar,\n\tslots,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: TabbedResourceShellProps) {\n\tconst strings = useStrings(defaultResourceStrings, stringsProp);\n\tconst toolbarNode = (\n\t\t<Stack gap=\"lg\" data-slot=\"tabbed-resource-toolbar\" className=\"tabbed-resource-shell--toolbar\">\n\t\t\t<OverflowTabBar\n\t\t\t\titems={tabs}\n\t\t\t\tvalue={activeTab}\n\t\t\t\tonValueChange={onTabChange}\n\t\t\t\tclassName={tabsClassName}\n\t\t\t\tstrings={{\n\t\t\t\t\tmore: moreLabel,\n\t\t\t\t\tnavigationLabel: tabsAriaLabel ?? strings.tabsAriaLabel,\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t{toolbar}\n\t\t</Stack>\n\t);\n\n\treturn (\n\t\t<ResourceShowShell\n\t\t\t{...props}\n\t\t\tstrings={stringsProp}\n\t\t\tclassName={cn('tabbed-resource-shell--component', className)}\n\t\t\ttoolbar={toolbarNode}\n\t\t\tslots={{ ...slots, toolbar: slots?.toolbar ?? toolbarNode }}\n\t\t/>\n\t);\n}\n\nfunction ResourceCard({\n\ttitle,\n\tdescription,\n\tactions,\n\theaderAction,\n\tchildren,\n\tfooter,\n\tpadding = 'md',\n\tsurface = 'card',\n\tclassName,\n\tcontentClassName,\n\tname,\n}: ResourceDetailsSectionProps & { name: string }) {\n\treturn (\n\t\t<ContentBlock\n\t\t\tdata-component={name}\n\t\t\tdata-slot={name}\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tactions={actions}\n\t\t\theaderAction={headerAction}\n\t\t\tfooterSlot={footer}\n\t\t\tpadding={padding}\n\t\t\tsurface={surface}\n\t\t\tclassName={cn(`${name}--component`, className)}\n\t\t\tcontentClassName={contentClassName}\n\t\t>\n\t\t\t{children}\n\t\t</ContentBlock>\n\t);\n}\n\nexport function ResourceDetailsSection({\n\tmetadata,\n\tmetadataColumns = 2,\n\tmetadataDense = false,\n\tbody,\n\thelp,\n\tchildren,\n\tcontentClassName,\n\t...props\n}: ResourceDetailsSectionProps) {\n\treturn (\n\t\t<ResourceCard\n\t\t\t{...props}\n\t\t\tname=\"resource-details-section\"\n\t\t\tcontentClassName={cn('resource-details-section--content grid gap-space-xl', contentClassName)}\n\t\t>\n\t\t\t{!!metadata?.length && (\n\t\t\t\t<MetadataList items={metadata} columns={metadataColumns} density={metadataDense ? 'compact' : 'default'} />\n\t\t\t)}\n\t\t\t{body}\n\t\t\t{children}\n\t\t\t{!!help && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"resource-details-section--help\">\n\t\t\t\t\t{help}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</ResourceCard>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,IAAac,IAA0C;CACtD,cAAc;CACd,oBAAoB;CACpB,YAAY;CACZ,kBAAkB;CAClB,YAAY;CACZ,kBAAkB;CAClB,YAAY;CACZ,eAAe;AAChB;;;ACGA,SAAgBC,EAAe,EAC9B,UACA,gBACA,YACA,UACA,cACA,cACA,mBACA,SACA,cAAW,WACX,WACA,aACA,YACA,kBACA,qBACA,qBACA,eACA,cACA,qBACA,qBACuB;CACvB,IAAMC,IAAOC,GACPC,IAAY,OAAOC,KAAU,WAAWA,IAAQ,IAChDC,IACLC,MACCC,KAAaC,IACb,kBAAChB,GAAD;EAAQ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,GAAD;IAAM,MAAK;IAAK,MAAK;IAAY,WAAU;IACzC,UAAA0E;GACI,CAAA;EAEM;;AAEhB"}
1
+ {"version":3,"file":"resource.js","names":["Text","Stack","LoadingState","ErrorState","Initials","IconBadge","AvatarFallback","Avatar","AvatarImage","ContentBlock","MetadataList","PageHeading","OverflowTabBar","EmptyState","defaultResourceStrings","ResourceHeader","Icon","icon","titleText","title","resolvedMedia","media","avatarUrl","avatarFallback","cn","mediaClassName","avatarAlt","iconTone","badges","metadata","className","ResourceActionBar","sticky","leading","children","trailing","ResourceEmptyState","props","ResourceShellFrame","emptyState","stringsProp","strings","useStrings","header","slots","headerClassName","toolbarNode","toolbar","loadingNode","emptyNode","emptySlot","defaultErrorNode","error","errorNode","body","loading","variant","contentClassName","asideClassName","ResourceIndexShell","ResourceShowShell","TabbedResourceShell","tabs","activeTab","onTabChange","tabsClassName","moreLabel","tabsAriaLabel","ResourceCard","name","footer","ResourceDetailsSection","metadataColumns","metadataDense","help"],"sources":["../../src/components/features/resource/resource.strings.ts","../../src/components/features/resource/resource.tsx"],"sourcesContent":["/** Default copy for state-aware resource workspace replacement states. */\nexport interface ResourceStrings {\n\tloadingLabel: string;\n\tloadingDescription: string;\n\temptyTitle: string;\n\temptyDescription: string;\n\terrorTitle: string;\n\terrorDescription: string;\n\tretryLabel: string;\n\ttabsAriaLabel: string;\n}\n\nexport const defaultResourceStrings: ResourceStrings = {\n\tloadingLabel: 'Loading resources',\n\tloadingDescription: 'Preparing the latest data for this view.',\n\temptyTitle: 'No resources found',\n\temptyDescription: 'There are no records available for this view.',\n\terrorTitle: 'Resources unavailable',\n\terrorDescription: 'The resource data could not be loaded.',\n\tretryLabel: 'Try again',\n\ttabsAriaLabel: 'Resource sections',\n};\n","/** State-aware resource workspace primitives for coordinated index/show surfaces. */\nimport { ContentBlock, IconBadge } from '../../base/display';\nimport { Avatar, AvatarFallback, AvatarImage } from '../../base/avatar';\nimport { ErrorState, LoadingState } from '../../base/feedback';\nimport { MetadataList } from '../../base/metadata-list';\nimport { EmptyState } from '../../blocks/data-display';\nimport { OverflowTabBar, PageHeading } from '../../base/navigation';\nimport { Stack } from '../../base/structure';\nimport { Initials } from '../../primitives';\nimport { Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { defaultResourceStrings } from './resource.strings';\nimport type {\n\tResourceActionBarProps,\n\tResourceDetailsSectionProps,\n\tResourceEmptyStateProps,\n\tResourceHeaderProps,\n\tResourceIndexShellProps,\n\tResourceShowShellProps,\n\tTabbedResourceShellProps,\n} from './resource.types';\n\nexport function ResourceHeader({\n\ttitle,\n\tdescription,\n\teyebrow,\n\tmedia,\n\tavatarUrl,\n\tavatarAlt,\n\tavatarFallback,\n\ticon,\n\ticonTone = 'neutral',\n\tbadges,\n\tmetadata,\n\tactions,\n\tprimaryAction,\n\tsecondaryActions,\n\tmoreActionsLabel,\n\trenderLink,\n\tclassName,\n\tcontentClassName,\n\tmediaClassName,\n}: ResourceHeaderProps) {\n\tconst Icon = icon;\n\tconst titleText = typeof title === 'string' ? title : '';\n\tconst resolvedMedia =\n\t\tmedia ??\n\t\t(avatarUrl || avatarFallback ? (\n\t\t\t<Avatar className={cn('resource-header--avatar size-avatar-lg', mediaClassName)}>\n\t\t\t\t{!!avatarUrl && <AvatarImage src={avatarUrl} alt={avatarAlt ?? titleText} />}\n\t\t\t\t<AvatarFallback>{avatarFallback ?? <Initials value={titleText} strategy=\"first-words\" />}</AvatarFallback>\n\t\t\t</Avatar>\n\t\t) : Icon ? (\n\t\t\t<IconBadge\n\t\t\t\ticon={Icon}\n\t\t\t\tshape=\"square\"\n\t\t\t\ttone={iconTone}\n\t\t\t\tclassName={cn('resource-header--icon size-avatar-lg [&>svg]:size-icon-lg', mediaClassName)}\n\t\t\t/>\n\t\t) : null);\n\n\treturn (\n\t\t<PageHeading\n\t\t\teyebrow={eyebrow}\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tleading={resolvedMedia}\n\t\t\ttitleSuffix={\n\t\t\t\tbadges ? (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdata-slot=\"resource-header-badges\"\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\tclassName=\"resource-header--badges shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{badges}\n\t\t\t\t\t</Stack>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tafterDescription={\n\t\t\t\tmetadata ? (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdata-slot=\"resource-header-metadata\"\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\tgap=\"md\"\n\t\t\t\t\t\tclassName=\"resource-header--metadata mt-space-sm\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{metadata}\n\t\t\t\t\t</Stack>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tactions={actions}\n\t\t\tprimaryAction={primaryAction}\n\t\t\tsecondaryActions={secondaryActions}\n\t\t\tmoreActionsLabel={moreActionsLabel}\n\t\t\trenderLink={renderLink}\n\t\t\twithSeparator={false}\n\t\t\tclassName={cn('resource-header--component', className)}\n\t\t\tcontentClassName={contentClassName}\n\t\t\teyebrowClassName=\"resource-header--eyebrow\"\n\t\t\ttitleClassName=\"resource-header--title truncate\"\n\t\t\tdescriptionClassName=\"resource-header--description max-w-3xl\"\n\t\t\tactionsClassName=\"resource-header--actions flex-wrap\"\n\t\t/>\n\t);\n}\n\nexport function ResourceActionBar({ children, leading, trailing, sticky = false, className }: ResourceActionBarProps) {\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"resource-action-bar\"\n\t\t\tdata-slot=\"resource-action-bar\"\n\t\t\tclassName={cn(\n\t\t\t\t'resource-action-bar--component box-border rounded-radius border border-border bg-card text-card-foreground px-surface py-row-y-lg shadow-xs',\n\t\t\t\tsticky && 'sticky top-shell-header z-30',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<Stack\n\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\tgap=\"lg\"\n\t\t\t\talign={{ sm: 'center' }}\n\t\t\t\tjustify={{ sm: 'between' }}\n\t\t\t\twrap={{ sm: false }}\n\t\t\t\tclassName=\"resource-action-bar--layout\"\n\t\t\t>\n\t\t\t\t<Stack\n\t\t\t\t\tdata-slot=\"resource-action-leading\"\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"resource-action-bar--leading flex-1\"\n\t\t\t\t>\n\t\t\t\t\t{leading ?? children}\n\t\t\t\t</Stack>\n\t\t\t\t{!!trailing && (\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdata-slot=\"resource-action-trailing\"\n\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\tgap=\"md\"\n\t\t\t\t\t\tclassName=\"resource-action-bar--trailing shrink-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{trailing}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport function ResourceEmptyState(props: ResourceEmptyStateProps) {\n\treturn (\n\t\t<EmptyState\n\t\t\t{...props}\n\t\t\tdata-component=\"resource-empty-state\"\n\t\t\tdata-slot=\"resource-empty-state\"\n\t\t\tclassName={cn('resource-empty-state--component', props.className)}\n\t\t/>\n\t);\n}\n\nfunction ResourceShellFrame({\n\tchildren,\n\ttitle,\n\tdescription,\n\tactions,\n\tprimaryAction,\n\tsecondaryActions,\n\tmoreActionsLabel,\n\trenderLink,\n\ttoolbar,\n\temptySlot,\n\tempty: emptyState = false,\n\tloading = false,\n\terror,\n\tonRetry,\n\tslots,\n\tclassName,\n\theaderClassName,\n\tcontentClassName,\n\tstrings: stringsProp,\n\tasideClassName,\n\tvariant,\n}: ResourceIndexShellProps & {\n\tasideClassName?: string;\n\tvariant: 'index' | 'show';\n}) {\n\tconst strings = useStrings(defaultResourceStrings, stringsProp);\n\tconst header =\n\t\tslots?.header ??\n\t\t(title ? (\n\t\t\t<ResourceHeader\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description}\n\t\t\t\tactions={actions}\n\t\t\t\tprimaryAction={primaryAction}\n\t\t\t\tsecondaryActions={secondaryActions}\n\t\t\t\tmoreActionsLabel={moreActionsLabel}\n\t\t\t\trenderLink={renderLink}\n\t\t\t\tclassName={headerClassName}\n\t\t\t/>\n\t\t) : null);\n\tconst toolbarNode = slots?.toolbar ?? toolbar;\n\tconst loadingNode = slots?.loading ?? (\n\t\t<LoadingState\n\t\t\tvariant=\"panel\"\n\t\t\tlabel={strings.loadingLabel}\n\t\t\tdescription={strings.loadingDescription}\n\t\t\tskeleton\n\t\t\tlines={4}\n\t\t\tclassName=\"resource-shell--loading rounded-radius border border-border bg-card\"\n\t\t/>\n\t);\n\tconst emptyNode = slots?.empty ?? emptySlot ?? (\n\t\t<ResourceEmptyState title={strings.emptyTitle} description={strings.emptyDescription} border />\n\t);\n\tconst defaultErrorNode = (\n\t\t<ErrorState\n\t\t\ttitle={strings.errorTitle}\n\t\t\tdescription={\n\t\t\t\terror instanceof Error\n\t\t\t\t\t? error.message\n\t\t\t\t\t: typeof error === 'string' || typeof error === 'number'\n\t\t\t\t\t\t? String(error)\n\t\t\t\t\t\t: strings.errorDescription\n\t\t\t}\n\t\t\tonRetry={onRetry}\n\t\t\tretryLabel={strings.retryLabel}\n\t\t/>\n\t);\n\tconst errorNode =\n\t\tslots?.error ??\n\t\t(error &&\n\t\ttypeof error !== 'boolean' &&\n\t\ttypeof error !== 'string' &&\n\t\ttypeof error !== 'number' &&\n\t\t!(error instanceof Error)\n\t\t\t? error\n\t\t\t: defaultErrorNode);\n\tconst body = loading ? loadingNode : error ? errorNode : emptyState ? emptyNode : children;\n\n\treturn (\n\t\t<section\n\t\t\tdata-component={`resource-${variant}-shell`}\n\t\t\tdata-slot={`resource-${variant}-shell`}\n\t\t\tclassName={cn(\n\t\t\t\t`resource-${variant}-shell--component min-w-0`,\n\t\t\t\tvariant === 'index' && '@container/resource-index',\n\t\t\t\tvariant === 'show' && '@container/resource-show',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<div\n\t\t\t\tdata-slot={`resource-${variant}-layout`}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t`resource-${variant}-shell--layout grid min-w-0 gap-space-xl`,\n\t\t\t\t\tslots?.aside &&\n\t\t\t\t\t\tvariant === 'show' &&\n\t\t\t\t\t\t'@4xl/resource-show:grid-cols-[minmax(0,1fr)_var(--shell-sidebar-width)]',\n\t\t\t\t\tslots?.aside &&\n\t\t\t\t\t\tvariant === 'index' &&\n\t\t\t\t\t\t'@4xl/resource-index:grid-cols-[minmax(0,1fr)_var(--shell-sidebar-width)]',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<Stack gap=\"xl\">\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<div data-slot={`resource-${variant}-header`} className={`resource-${variant}-shell--header`}>\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!toolbarNode && (\n\t\t\t\t\t\t<div data-slot={`resource-${variant}-toolbar`} className={`resource-${variant}-shell--toolbar`}>\n\t\t\t\t\t\t\t{toolbarNode}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot={`resource-${variant}-content`}\n\t\t\t\t\t\tclassName={cn(`resource-${variant}-shell--content min-w-0`, contentClassName)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{body}\n\t\t\t\t\t</div>\n\t\t\t\t\t{!!slots?.footer && (\n\t\t\t\t\t\t<div data-slot={`resource-${variant}-footer`} className={`resource-${variant}-shell--footer`}>\n\t\t\t\t\t\t\t{slots.footer}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t\t{!!slots?.aside && (\n\t\t\t\t\t<aside\n\t\t\t\t\t\tdata-slot={`resource-${variant}-aside`}\n\t\t\t\t\t\tclassName={cn(`resource-${variant}-shell--aside min-w-0`, asideClassName)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{slots.aside}\n\t\t\t\t\t</aside>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</section>\n\t);\n}\n\nexport function ResourceIndexShell(props: ResourceIndexShellProps) {\n\treturn <ResourceShellFrame {...props} variant=\"index\" />;\n}\n\nexport function ResourceShowShell(props: ResourceShowShellProps) {\n\treturn <ResourceShellFrame {...props} variant=\"show\" />;\n}\n\nexport function TabbedResourceShell({\n\ttabs,\n\tactiveTab,\n\tonTabChange,\n\ttabsClassName,\n\tmoreLabel,\n\ttabsAriaLabel,\n\ttoolbar,\n\tslots,\n\tclassName,\n\tstrings: stringsProp,\n\t...props\n}: TabbedResourceShellProps) {\n\tconst strings = useStrings(defaultResourceStrings, stringsProp);\n\tconst toolbarNode = (\n\t\t<Stack gap=\"lg\" data-slot=\"tabbed-resource-toolbar\" className=\"tabbed-resource-shell--toolbar\">\n\t\t\t<OverflowTabBar\n\t\t\t\titems={tabs}\n\t\t\t\tvalue={activeTab}\n\t\t\t\tonValueChange={onTabChange}\n\t\t\t\tclassName={tabsClassName}\n\t\t\t\tstrings={{\n\t\t\t\t\tmore: moreLabel,\n\t\t\t\t\tnavigationLabel: tabsAriaLabel ?? strings.tabsAriaLabel,\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t{toolbar}\n\t\t</Stack>\n\t);\n\n\treturn (\n\t\t<ResourceShowShell\n\t\t\t{...props}\n\t\t\tstrings={stringsProp}\n\t\t\tclassName={cn('tabbed-resource-shell--component', className)}\n\t\t\ttoolbar={toolbarNode}\n\t\t\tslots={{ ...slots, toolbar: slots?.toolbar ?? toolbarNode }}\n\t\t/>\n\t);\n}\n\nfunction ResourceCard({\n\ttitle,\n\tdescription,\n\tactions,\n\theaderAction,\n\tchildren,\n\tfooter,\n\tpadding = 'md',\n\tsurface = 'card',\n\tclassName,\n\tcontentClassName,\n\tname,\n}: ResourceDetailsSectionProps & { name: string }) {\n\treturn (\n\t\t<ContentBlock\n\t\t\tdata-component={name}\n\t\t\tdata-slot={name}\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tactions={actions}\n\t\t\theaderAction={headerAction}\n\t\t\tfooterSlot={footer}\n\t\t\tpadding={padding}\n\t\t\tsurface={surface}\n\t\t\tclassName={cn(`${name}--component`, className)}\n\t\t\tcontentClassName={contentClassName}\n\t\t>\n\t\t\t{children}\n\t\t</ContentBlock>\n\t);\n}\n\nexport function ResourceDetailsSection({\n\tmetadata,\n\tmetadataColumns = 2,\n\tmetadataDense = false,\n\tbody,\n\thelp,\n\tchildren,\n\tcontentClassName,\n\t...props\n}: ResourceDetailsSectionProps) {\n\treturn (\n\t\t<ResourceCard\n\t\t\t{...props}\n\t\t\tname=\"resource-details-section\"\n\t\t\tcontentClassName={cn('resource-details-section--content grid gap-space-xl', contentClassName)}\n\t\t>\n\t\t\t{!!metadata?.length && (\n\t\t\t\t<MetadataList items={metadata} columns={metadataColumns} density={metadataDense ? 'compact' : 'default'} />\n\t\t\t)}\n\t\t\t{body}\n\t\t\t{children}\n\t\t\t{!!help && (\n\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"resource-details-section--help\">\n\t\t\t\t\t{help}\n\t\t\t\t</Text>\n\t\t\t)}\n\t\t</ResourceCard>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,IAAac,IAA0C;CACtD,cAAc;CACd,oBAAoB;CACpB,YAAY;CACZ,kBAAkB;CAClB,YAAY;CACZ,kBAAkB;CAClB,YAAY;CACZ,eAAe;AAChB;;;ACGA,SAAgBC,EAAe,EAC9B,UACA,gBACA,YACA,UACA,cACA,cACA,mBACA,SACA,cAAW,WACX,WACA,aACA,YACA,kBACA,qBACA,qBACA,eACA,cACA,qBACA,qBACuB;CACvB,IAAMC,IAAOC,GACPC,IAAY,O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SAASC,IAAgB,YAAY;GAAY,CAAA;GAE1GnB;GACApB;GACA,CAAC,CAACwC,KACF,kBAAC1E,GAAD;IAAM,MAAK;IAAK,MAAK;IAAY,WAAU;IACzC,UAAA0E;GACI,CAAA;EAEM;;AAEhB"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { n as e } from "../rich-text-editor.recipes-CadiF_Uu.js";
2
+ import { t as e } from "../rich-text-editor-toolbar-DfXg0-VC.js";
3
3
  import { t } from "../rich-text-editor.strings-CB59ekH2.js";
4
- import { n, t as r } from "../rich-text-editor-sMU_Scqm.js";
4
+ import { n, t as r } from "../rich-text-editor-cRLC-eBK.js";
5
5
  import { useMemo as i, useRef as a } from "react";
6
6
  import { jsx as o } from "react/jsx-runtime";
7
7
  import { useController as s, useFormContext as c } from "react-hook-form";
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "../lib/strings.js";
3
- import { t } from "../utils-l5LpDw2z.js";
4
- import { n } from "../buttons-SbIcm1HJ.js";
5
- import { s as r } from "../typography-DTRkE9zL.js";
6
- import { t as i } from "../structure-DC2dygdA.js";
7
- import { t as a } from "../smart-card-lFKxn5Hu.js";
8
- import { t as o } from "../input-DWhBBBww.js";
9
- import { t as s } from "../form-field-DUt4UxSV.js";
10
- import { d as c } from "../text-inputs-aaK9wcDT.js";
11
- import { a as l, i as u, l as d, o as f, r as p } from "../choice-inputs-t6w3ATNz.js";
12
- import { n as m } from "../display-DsQTVzMz.js";
13
- import { u as h } from "../value-inputs-TAYMX111.js";
14
- import { d as g } from "../forms-numeric-C0bvjRPZ.js";
15
- import { s as _ } from "../data-display-DafIvCl5.js";
3
+ import { t } from "../utils-BRhFDwuU.js";
4
+ import { n } from "../buttons-DPZekJFu.js";
5
+ import { c as r } from "../typography-UTnveOEy.js";
6
+ import { t as i } from "../structure-BmisBK-3.js";
7
+ import { t as a } from "../smart-card-DiC5aac3.js";
8
+ import { t as o } from "../input-DQdEd0YD.js";
9
+ import { t as s } from "../form-field-CwH9y77i.js";
10
+ import { d as c } from "../text-inputs-f9Ia-aCi.js";
11
+ import { a as l, i as u, l as d, o as f, r as p } from "../choice-inputs-CNHvARCJ.js";
12
+ import { n as m } from "../display-hAc1HjpI.js";
13
+ import { u as h } from "../value-inputs-DXPDjvBU.js";
14
+ import { d as g } from "../forms-numeric-B_jraJaQ.js";
15
+ import { s as _ } from "../data-display-DT_khPl_.js";
16
16
  import { Fragment as v, useCallback as y, useEffect as b, useId as x, useMemo as S, useState as C } from "react";
17
17
  import { jsx as w, jsxs as T } from "react/jsx-runtime";
18
18
  //#region src/components/features/schema-form/schema-form.utils.ts
@@ -575,6 +575,7 @@ function ae({ section: e }) {
575
575
  gap: "normal",
576
576
  className: "schema-form--section-heading",
577
577
  children: [!!e.title && /* @__PURE__ */ w(r, {
578
+ type: "inherit",
578
579
  weight: "semibold",
579
580
  className: "schema-form--section-title",
580
581
  children: e.title
@@ -707,6 +708,7 @@ function Y({ schema: n, value: o, defaultValue: s, errors: c, disabled: l = !1,
707
708
  gap: "normal",
708
709
  className: "min-w-0",
709
710
  children: [!!(h ?? n.title) && /* @__PURE__ */ w(r, {
711
+ type: "inherit",
710
712
  size: "base",
711
713
  weight: "semibold",
712
714
  className: "schema-form--title",
@@ -1 +1 @@
1
- {"version":3,"file":"schema-form.js","names":["Text","Stack","Card","Input","FormField","Textarea","ToggleField","CardCheckboxGroup","Select","SwitchCard","CardRadioGroup","ContentBlock","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-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/30', 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 { Card } from '../../base/cards';\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\">\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<Stack\n\t\t\t\tkey={section.id}\n\t\t\t\trender={<section />}\n\t\t\t\tgap=\"lg\"\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\">\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</Stack>\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>\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=\"2xl\" 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 size=\"base\" 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<Card\n\t\t\t\t\t\tsurface=\"flat\"\n\t\t\t\t\t\tpadding=\"none\"\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tgap=\"2xl\"\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\t\ttitle={title ?? schema.title}\n\t\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</Card>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAae,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,GACf,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,OAA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CO;IACAR;GACK;EAEN,CAAA,IAAA,kBAACjK,GAAD;GACC,SAAQ;GACR,SAAQ;GACR,WAAU;GACV,KAAI;GACJ,YAAW;GACX,kBAAkBmF,EAAG,wBAAwBkF,CAAgB;GAC7D,OAAOC,KAAS7I,EAAO;GACvB,aAAa8I,KAAe9I,EAAO;GACnC,WAAW+I;GACX,YACCC,KAAcR,IACb,kBAAClK,GAAD;IAAO,KAAI;IAAK,WAAU;IAA1B,UAAA,CACE0K,GACAR,CACK;GACJ,CAAA,IAAA,KAAA;GAGJ,UAAAtB,KAAY/G,EAAS,IAAI+H,EAAkB,IAAIO;EAC3C,CAAA;CAEH,CAAA;AAER;AAEA,EAAW,cAAc"}
1
+ {"version":3,"file":"schema-form.js","names":["Text","Stack","Card","Input","FormField","Textarea","ToggleField","CardCheckboxGroup","Select","SwitchCard","CardRadioGroup","ContentBlock","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-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/30', 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 { Card } from '../../base/cards';\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\">\n\t\t\t{!!section.title && (\n\t\t\t\t<Text type=\"inherit\" 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<Stack\n\t\t\t\tkey={section.id}\n\t\t\t\trender={<section />}\n\t\t\t\tgap=\"lg\"\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\">\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</Stack>\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>\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=\"2xl\" 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 type=\"inherit\" size=\"base\" 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<Card\n\t\t\t\t\t\tsurface=\"flat\"\n\t\t\t\t\t\tpadding=\"none\"\n\t\t\t\t\t\tclassName=\"schema-form--surface\"\n\t\t\t\t\t\tgap=\"2xl\"\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\t\ttitle={title ?? schema.title}\n\t\t\t\t\t\tdescription={description ?? schema.description}\n\t\t\t\t\t\theaderEnd={headerSlot}\n\t\t\t\t\t\tfooterSlot={\n\t\t\t\t\t\t\tfooterSlot || actions ? (\n\t\t\t\t\t\t\t\t<Stack gap=\"lg\" className=\"schema-form--footer\">\n\t\t\t\t\t\t\t\t\t{footerSlot}\n\t\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{hasFields ? sections.map(renderPlainSection) : empty}\n\t\t\t\t\t</Card>\n\t\t\t)}\n\t\t</form>\n\t);\n}\n\nSchemaForm.displayName = 'SchemaForm';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAae,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,GACf,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,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K;GACJ,CAAA,IAAA,KAAA;GAGJ,UAAAtB,KAAY/G,EAAS,IAAI+H,EAAkB,IAAIO;EAC3C,CAAA;CAEH,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-l5LpDw2z.js";
4
- import { t as n } from "../feedback-qNuMBtRH.js";
3
+ import { t } from "../utils-BRhFDwuU.js";
4
+ import { t as n } from "../feedback-BYIhtitP.js";
5
5
  import { t as r } from "../use-debounced-callback-Cx1h-hdv.js";
6
- import { r as i } from "../combobox-DLl0bfiq.js";
6
+ import { r as i } from "../combobox-C0EQW6dr.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 { i as t, s as n } from "../typography-DTRkE9zL.js";
4
- import { t as r } from "../structure-DC2dygdA.js";
5
- import { i, r as a } from "../choice-inputs-t6w3ATNz.js";
3
+ import { a as t, c as n } from "../typography-UTnveOEy.js";
4
+ import { t as r } from "../structure-BmisBK-3.js";
5
+ import { i, r as a } from "../choice-inputs-CNHvARCJ.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";
@@ -67,7 +67,10 @@ function h(h) {
67
67
  /* @__PURE__ */ l(r, {
68
68
  gap: "dense",
69
69
  className: "sync-range-dialog-form--section-header",
70
- children: [/* @__PURE__ */ c(t, { children: A.hoursLabel }), /* @__PURE__ */ c(n, {
70
+ children: [/* @__PURE__ */ c(t, {
71
+ className: "text-inherit",
72
+ children: A.hoursLabel
73
+ }), /* @__PURE__ */ c(n, {
71
74
  size: "xs",
72
75
  type: "secondary",
73
76
  children: A.hoursDescription
@@ -104,7 +107,10 @@ function h(h) {
104
107
  children: [/* @__PURE__ */ l(r, {
105
108
  gap: "dense",
106
109
  className: "sync-range-dialog-form--section-header",
107
- children: [/* @__PURE__ */ c(t, { children: A.optionsLabel }), /* @__PURE__ */ c(n, {
110
+ children: [/* @__PURE__ */ c(t, {
111
+ className: "text-inherit",
112
+ children: A.optionsLabel
113
+ }), /* @__PURE__ */ c(n, {
108
114
  size: "xs",
109
115
  type: "secondary",
110
116
  children: A.optionsDescription
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","names":["Label","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","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\">\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,IAAaI,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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","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","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 className=\"text-inherit\">{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\">\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 className=\"text-inherit\">{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,IAAaI,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,WAAW,EAAE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,MAAMD,EAAM;MACZ,SAAS;MACT,SAAS,EAAQE,EAAS,OAAO;MACjC,UAAUhB;KACV,CAAA;IAEF,CAAA;IAEAgB,EAAS,OAAO,KAAK,kBAACtC,GAAD;KAAM,MAAK;KAAS,UAAAsC,EAAS,OAAO;IAAQ,CAAA;GAC5D;EAEN,CAAA,GAAA,CAAC,CAACC,KAAeA,EAAY,SAAS,KACtC,kBAAC,WAAD;GAAS,WAAU;GAClB,UAAA,kBAACtC,GAAD;IAAO,KAAI;IAAX,UAAA,CACC,kBAACA,GAAD;KAAO,KAAI;KAAQ,WAAU;KAA7B,UAAA,CACC,kBAACF,GAAD;MAAO,WAAU;MAAgB,UAAAc,EAAQ;KAAoB,CAAA,GAC7D,kBAACb,GAAD;MAAM,MAAK;MAAK,MAAK;MACnB,UAAAa,EAAQ;KACJ,CAAA,CACA;IACP,CAAA,GAAA,kBAACsB,GAAD;KACC,MAAK;KACI;KACT,SAAS,EAAE,eACV,kBAACK,GAAD;MACC,SAASD;MACT,OAAOH,EAAM;MACb,gBAAgB,MAAgB;OAE/B,AADAA,EAAM,SAASK,CAAW,GAC1Bb,EAAW;QACV,GAAGS,EAAU;QACb,SAASI;OACV,CAAC;MACF;MACA,SAAS;MACT,UAAUnB;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-CrcLN9Io.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-BweFy_P9.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 };