themelia-react-ui 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (625) hide show
  1. package/CHANGELOG.md +351 -0
  2. package/README.md +26 -13
  3. package/dist/{accordion-CQXVcd7Q.js → accordion-B6a3vVgA.js} +84 -82
  4. package/dist/accordion-B6a3vVgA.js.map +1 -0
  5. package/dist/action-menu-TzCoSlwL.js +280 -0
  6. package/dist/action-menu-TzCoSlwL.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-CCIXb2A1.js → affordance-geometry.generated-B5iu-Mkr.js} +3 -2
  8. package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +1 -0
  9. package/dist/{ai-artifact-2PQ2fItc.js → ai-artifact-BMJdv-6q.js} +379 -376
  10. package/dist/ai-artifact-BMJdv-6q.js.map +1 -0
  11. package/dist/{app-shell-BE_j8-AT.js → app-shell-ZK5RWdo6.js} +4 -4
  12. package/dist/{app-shell-BE_j8-AT.js.map → app-shell-ZK5RWdo6.js.map} +1 -1
  13. package/dist/attachment-BtfhGm8i.js +245 -0
  14. package/dist/attachment-BtfhGm8i.js.map +1 -0
  15. package/dist/{auth-M3vGMgDR.js → auth-CYxKfo69.js} +237 -235
  16. package/dist/auth-CYxKfo69.js.map +1 -0
  17. package/dist/{avatar-djdaaQ_s.js → avatar-BBnEJIx8.js} +66 -65
  18. package/dist/avatar-BBnEJIx8.js.map +1 -0
  19. package/dist/badge-MrKVNzW9.js +93 -0
  20. package/dist/badge-MrKVNzW9.js.map +1 -0
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/batch-action-bar.js +3 -0
  27. package/dist/base/buttons.js +2 -3
  28. package/dist/base/cards.js +2 -2
  29. package/dist/base/carousel.js +13 -13
  30. package/dist/base/carousel.js.map +1 -1
  31. package/dist/base/cascader.js +103 -115
  32. package/dist/base/cascader.js.map +1 -1
  33. package/dist/base/chart.js +1 -1
  34. package/dist/base/choice-inputs.js +3 -3
  35. package/dist/base/code-block.js +1 -1
  36. package/dist/base/combobox.js +1 -1
  37. package/dist/base/command.js +1 -1
  38. package/dist/base/copyable.js +1 -1
  39. package/dist/base/date-pickers.js +2 -2
  40. package/dist/base/display.js +7 -7
  41. package/dist/base/feedback.js +3 -3
  42. package/dist/base/forms-numeric.js +1 -1
  43. package/dist/base/forms.js +2 -2
  44. package/dist/base/inline-edit.js +17 -17
  45. package/dist/base/inline-edit.js.map +1 -1
  46. package/dist/base/item.js +1 -1
  47. package/dist/base/media-gallery.js +1 -1
  48. package/dist/base/metadata-list.js +3 -0
  49. package/dist/base/navigation.js +7 -7
  50. package/dist/base/popover-menu.js +1 -1
  51. package/dist/base/popover.js +1 -1
  52. package/dist/base/qr-code.js +1 -1
  53. package/dist/base/repeaters.js +171 -170
  54. package/dist/base/repeaters.js.map +1 -1
  55. package/dist/base/sheet.js +1 -1
  56. package/dist/base/sidebar.js +1 -1
  57. package/dist/base/signature-pad.js +147 -137
  58. package/dist/base/signature-pad.js.map +1 -1
  59. package/dist/base/skeleton.js +1 -1
  60. package/dist/base/spinner.js +1 -1
  61. package/dist/base/structure.js +1 -1
  62. package/dist/base/table.js +1 -1
  63. package/dist/base/text-inputs.js +2 -2
  64. package/dist/base/toaster.js +2 -2
  65. package/dist/base/tree.js +1 -1
  66. package/dist/base/upload-queue.js +1 -1
  67. package/dist/base/upload.js +3 -3
  68. package/dist/base/value-inputs.js +2 -2
  69. package/dist/batch-action-bar-BZGDG-Si.js +104 -0
  70. package/dist/batch-action-bar-BZGDG-Si.js.map +1 -0
  71. package/dist/blocks/admin.js +173 -171
  72. package/dist/blocks/admin.js.map +1 -1
  73. package/dist/blocks/ai.js +266 -263
  74. package/dist/blocks/ai.js.map +1 -1
  75. package/dist/blocks/analytics/usage-card.js +1 -1
  76. package/dist/blocks/analytics.js +440 -438
  77. package/dist/blocks/analytics.js.map +1 -1
  78. package/dist/blocks/collaboration.js +1 -1
  79. package/dist/blocks/commerce/receipt.js +1 -1
  80. package/dist/blocks/commerce.js +1945 -1266
  81. package/dist/blocks/commerce.js.map +1 -1
  82. package/dist/blocks/data-display.js +3 -2
  83. package/dist/blocks/onboarding.js +50 -49
  84. package/dist/blocks/onboarding.js.map +1 -1
  85. package/dist/blocks/planning.js +25 -25
  86. package/dist/blocks/planning.js.map +1 -1
  87. package/dist/blocks/timelines.js +1 -1
  88. package/dist/breadcrumbs-D5t7I023.js +129 -0
  89. package/dist/breadcrumbs-D5t7I023.js.map +1 -0
  90. package/dist/{button-R9CCoH7A.js → button-QYwiyhD2.js} +15 -14
  91. package/dist/button-QYwiyhD2.js.map +1 -0
  92. package/dist/{button-BS3KDg00.js → buttons-SbIcm1HJ.js} +200 -213
  93. package/dist/buttons-SbIcm1HJ.js.map +1 -0
  94. package/dist/{cards-QoJ4syG9.js → cards-CiiHpKYd.js} +8 -8
  95. package/dist/cards-CiiHpKYd.js.map +1 -0
  96. package/dist/{chart-DwYRKKc-.js → chart-QfrARkXl.js} +5 -5
  97. package/dist/{chart-DwYRKKc-.js.map → chart-QfrARkXl.js.map} +1 -1
  98. package/dist/checkbox-DhB6K0bK.js +36 -0
  99. package/dist/checkbox-DhB6K0bK.js.map +1 -0
  100. package/dist/choice-inputs-t6w3ATNz.js +766 -0
  101. package/dist/choice-inputs-t6w3ATNz.js.map +1 -0
  102. package/dist/code-block-Dgbu-CU3.js +185 -0
  103. package/dist/code-block-Dgbu-CU3.js.map +1 -0
  104. package/dist/{collapsible-oMUGM4tr.js → collapsible-D8AEGU1-.js} +4 -4
  105. package/dist/{collapsible-oMUGM4tr.js.map → collapsible-D8AEGU1-.js.map} +1 -1
  106. package/dist/{collection-content-Ys-OZOkY.js → collection-content-uK16Grv0.js} +3 -3
  107. package/dist/{collection-content-Ys-OZOkY.js.map → collection-content-uK16Grv0.js.map} +1 -1
  108. package/dist/{combobox-6dvVny2q.js → combobox-2Ic8N9bL.js} +74 -68
  109. package/dist/combobox-2Ic8N9bL.js.map +1 -0
  110. package/dist/{combobox-CB7039j7.js → combobox-DLl0bfiq.js} +307 -305
  111. package/dist/combobox-DLl0bfiq.js.map +1 -0
  112. package/dist/{command-kPMPjIxJ.js → command-kNR20o7x.js} +7 -7
  113. package/dist/{command-kPMPjIxJ.js.map → command-kNR20o7x.js.map} +1 -1
  114. package/dist/{comments-You0Bzbr.js → comments-BpDuCUUu.js} +341 -339
  115. package/dist/comments-BpDuCUUu.js.map +1 -0
  116. package/dist/components/base/action-menu/action-menu.d.ts +21 -4
  117. package/dist/components/base/action-menu/action-menu.recipes.d.ts +21 -0
  118. package/dist/components/base/action-menu/index.d.ts +1 -0
  119. package/dist/components/base/badge/badge.recipes.d.ts +4 -4
  120. package/dist/components/base/batch-action-bar/batch-action-bar.d.ts +50 -0
  121. package/dist/components/base/batch-action-bar/batch-action-bar.strings.d.ts +20 -0
  122. package/dist/components/base/batch-action-bar/index.d.ts +8 -0
  123. package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
  124. package/dist/components/base/buttons/button.recipes.d.ts +2 -2
  125. package/dist/components/base/choice-inputs/checkbox.d.ts +2 -2
  126. package/dist/components/base/choice-inputs/choice-types.d.ts +18 -6
  127. package/dist/components/base/display/alert-dialog.d.ts +6 -5
  128. package/dist/components/base/display/dialog.d.ts +4 -8
  129. package/dist/components/base/display/icon-badge/icon-badge.d.ts +1 -1
  130. package/dist/components/base/forms/form-sizing.d.ts +15 -12
  131. package/dist/components/base/metadata-list/index.d.ts +12 -0
  132. package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-list.d.ts +28 -25
  133. package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-value.d.ts +2 -2
  134. package/dist/components/base/navigation/index.d.ts +1 -1
  135. package/dist/components/base/navigation/page-header/index.d.ts +1 -0
  136. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +73 -0
  137. package/dist/components/base/navigation/page-header/page-header.d.ts +26 -3
  138. package/dist/components/base/sheet/sheet.d.ts +4 -8
  139. package/dist/components/base/signature-pad/signature-pad.types.d.ts +5 -1
  140. package/dist/components/base/signature-pad/signature-pad.utils.d.ts +11 -3
  141. package/dist/components/base/text-inputs/field-clear-button.d.ts +6 -0
  142. package/dist/components/base/upload/upload.recipes.d.ts +25 -3
  143. package/dist/components/base/value-inputs/index.d.ts +5 -5
  144. package/dist/components/base/value-inputs/tags-input.d.ts +36 -12
  145. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  146. package/dist/components/blocks/commerce/address-card/types.d.ts +2 -1
  147. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +3 -1
  148. package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
  149. package/dist/components/blocks/commerce/cart-summary/types.d.ts +6 -1
  150. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +3 -1
  151. package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
  152. package/dist/components/blocks/commerce/discount-stack/types.d.ts +16 -4
  153. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +5 -0
  154. package/dist/components/blocks/commerce/fulfillment-group/index.d.ts +2 -0
  155. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +43 -0
  156. package/dist/components/blocks/commerce/index.d.ts +13 -5
  157. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  158. package/dist/components/blocks/commerce/invoice-header/types.d.ts +4 -2
  159. package/dist/components/blocks/commerce/invoice-mini/invoice-mini.d.ts +1 -1
  160. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +2 -1
  161. package/dist/components/blocks/commerce/order-customer/index.d.ts +2 -0
  162. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +5 -0
  163. package/dist/components/blocks/commerce/order-customer/types.d.ts +48 -0
  164. package/dist/components/blocks/commerce/order-header/index.d.ts +2 -0
  165. package/dist/components/blocks/commerce/order-header/order-header.d.ts +5 -0
  166. package/dist/components/blocks/commerce/order-header/types.d.ts +37 -0
  167. package/dist/components/blocks/commerce/order-line-item/index.d.ts +2 -0
  168. package/dist/components/blocks/commerce/order-line-item/order-line-item.d.ts +5 -0
  169. package/dist/components/blocks/commerce/order-line-item/types.d.ts +46 -0
  170. package/dist/components/blocks/commerce/order-summary/index.d.ts +2 -0
  171. package/dist/components/blocks/commerce/order-summary/order-summary.d.ts +5 -0
  172. package/dist/components/blocks/commerce/order-summary/types.d.ts +42 -0
  173. package/dist/components/blocks/commerce/order-transactions/index.d.ts +2 -0
  174. package/dist/components/blocks/commerce/order-transactions/order-transactions.d.ts +5 -0
  175. package/dist/components/blocks/commerce/order-transactions/types.d.ts +46 -0
  176. package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
  177. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +9 -1
  178. package/dist/components/blocks/commerce/payment-method/types.d.ts +12 -1
  179. package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
  180. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +3 -1
  181. package/dist/components/blocks/commerce/refund-status/types.d.ts +6 -3
  182. package/dist/components/blocks/commerce/shared/address-lines.d.ts +21 -0
  183. package/dist/components/blocks/commerce/shared/line-thumbnail.d.ts +9 -0
  184. package/dist/components/blocks/commerce/shared/order-status.d.ts +51 -0
  185. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  186. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +27 -6
  187. package/dist/components/blocks/commerce/summary-panel/amount-row.d.ts +2 -0
  188. package/dist/components/blocks/commerce/summary-panel/index.d.ts +3 -0
  189. package/dist/components/blocks/commerce/summary-panel/summary-panel.d.ts +2 -0
  190. package/dist/components/blocks/commerce/summary-panel/types.d.ts +26 -0
  191. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  192. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +2 -1
  193. package/dist/components/blocks/data-display/metadata/index.d.ts +30 -4
  194. package/dist/components/features/activities/partials/activity-row.d.ts +6 -2
  195. package/dist/components/features/activities/partials/tone-tokens.d.ts +0 -6
  196. package/dist/components/features/global-search/partials/global-search-group-heading.d.ts +15 -0
  197. package/dist/components/features/global-search/partials/tone-palettes.d.ts +0 -5
  198. package/dist/components/features/kanban/kanban.d.ts +1 -1
  199. package/dist/components/features/kanban/kanban.strings.d.ts +1 -1
  200. package/dist/components/features/kanban/kanban.types.d.ts +2 -2
  201. package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
  202. package/dist/components/features/media-library/index.d.ts +1 -1
  203. package/dist/components/features/media-library/media-library.d.ts +1 -1
  204. package/dist/components/features/media-library/media-library.strings.d.ts +4 -0
  205. package/dist/components/features/media-library/media-library.types.d.ts +74 -1
  206. package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
  207. package/dist/components/features/mentions/partials/mention-kind-toggles.d.ts +16 -0
  208. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  209. package/dist/components/features/overlays/dialog.d.ts +1 -1
  210. package/dist/components/features/overlays/index.d.ts +1 -1
  211. package/dist/components/features/overlays/overlay-tone-icon.d.ts +3 -3
  212. package/dist/components/features/overlays/overlays.types.d.ts +20 -0
  213. package/dist/components/features/products/components/product-contract-overview.d.ts +5 -0
  214. package/dist/components/features/products/components/product-details-card.d.ts +5 -0
  215. package/dist/components/features/products/components/product-operations-card.d.ts +5 -0
  216. package/dist/components/features/products/components/product-option-action-menu.d.ts +5 -0
  217. package/dist/components/features/products/components/product-options-summary.d.ts +5 -0
  218. package/dist/components/features/products/components/product-policies-card.d.ts +5 -0
  219. package/dist/components/features/products/components/product-quote-preview-card.d.ts +5 -0
  220. package/dist/components/features/products/components/product-readiness-card.d.ts +5 -0
  221. package/dist/components/features/products/components/product-structure-card.d.ts +5 -0
  222. package/dist/components/features/products/components/product-variant-action-menu.d.ts +23 -1
  223. package/dist/components/features/products/products.types.d.ts +9 -2
  224. package/dist/components/features/resource/index.d.ts +1 -1
  225. package/dist/components/features/resource/resource.d.ts +1 -1
  226. package/dist/components/features/resource/resource.types.d.ts +34 -6
  227. package/dist/components/features/rich-text-editor/index.d.ts +2 -1
  228. package/dist/components/features/rich-text-editor/partials/image-nodes.d.ts +13 -0
  229. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +66 -0
  230. package/dist/components/features/rich-text-editor/partials/inline-reference-node.d.ts +19 -0
  231. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
  232. package/dist/components/features/rich-text-editor/rich-text-editor.strings.d.ts +14 -0
  233. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +45 -0
  234. package/dist/components/features/rich-text-editor/use-rich-text-images.d.ts +18 -0
  235. package/dist/components/features/sync/index.d.ts +26 -3
  236. package/dist/components/features/table/data-table.d.ts +1 -1
  237. package/dist/components/features/table/table.types.d.ts +32 -7
  238. package/dist/components/layout/page/index.d.ts +1 -1
  239. package/dist/components/layout/page/page.types.d.ts +33 -36
  240. package/dist/components/layout/page/partials/page-actions.d.ts +1 -0
  241. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  242. package/dist/components/layout/settings/settings.d.ts +16 -2
  243. package/dist/components/layout/workspace/workspace.types.d.ts +21 -4
  244. package/dist/components/typography/rich-text/index.d.ts +1 -1
  245. package/dist/components/typography/rich-text/rich-text-tree.d.ts +19 -0
  246. package/dist/components/typography/rich-text/rich-text.d.ts +16 -0
  247. package/dist/components/typography/text-link.d.ts +4 -3
  248. package/dist/components/ui/checkbox.d.ts +4 -3
  249. package/dist/components/ui/overlay.recipes.d.ts +0 -9
  250. package/dist/components/ui/switch.d.ts +2 -2
  251. package/dist/{containers-D_L4mTVb.js → containers-DmWiJa2I.js} +36 -35
  252. package/dist/containers-DmWiJa2I.js.map +1 -0
  253. package/dist/{copyable-DDjTeW_j.js → copyable-B3Gwgdqc.js} +6 -6
  254. package/dist/{copyable-DDjTeW_j.js.map → copyable-B3Gwgdqc.js.map} +1 -1
  255. package/dist/data-display-DafIvCl5.js +960 -0
  256. package/dist/data-display-DafIvCl5.js.map +1 -0
  257. package/dist/{date-uf3z37Nm.js → date-BgK3bTdo.js} +5 -5
  258. package/dist/{date-uf3z37Nm.js.map → date-BgK3bTdo.js.map} +1 -1
  259. package/dist/date-picker-CF-DtUpF.js +1529 -0
  260. package/dist/date-picker-CF-DtUpF.js.map +1 -0
  261. package/dist/{date-pickers-CnFCb0n2.js → date-pickers-BmzxJl5l.js} +19 -19
  262. package/dist/{date-pickers-CnFCb0n2.js.map → date-pickers-BmzxJl5l.js.map} +1 -1
  263. package/dist/{display-DrdvPwF0.js → display-DsQTVzMz.js} +88 -87
  264. package/dist/display-DsQTVzMz.js.map +1 -0
  265. package/dist/{dropdown-menu-CURh59jb.js → dropdown-menu-E2qmdC7o.js} +7 -7
  266. package/dist/{dropdown-menu-CURh59jb.js.map → dropdown-menu-E2qmdC7o.js.map} +1 -1
  267. package/dist/features/activities.js +414 -501
  268. package/dist/features/activities.js.map +1 -1
  269. package/dist/features/ai-chat.js +170 -169
  270. package/dist/features/ai-chat.js.map +1 -1
  271. package/dist/features/async-preview.js +8 -8
  272. package/dist/features/async-preview.js.map +1 -1
  273. package/dist/features/combobox.js +1 -1
  274. package/dist/features/comments.js +1 -1
  275. package/dist/features/data-view.js +139 -138
  276. package/dist/features/data-view.js.map +1 -1
  277. package/dist/features/email-composer/engine.js +1 -1
  278. package/dist/features/email-composer.js +73 -71
  279. package/dist/features/email-composer.js.map +1 -1
  280. package/dist/features/event-calendar.js +278 -275
  281. package/dist/features/event-calendar.js.map +1 -1
  282. package/dist/features/filters.js +1 -1
  283. package/dist/features/global-search.js +307 -310
  284. package/dist/features/global-search.js.map +1 -1
  285. package/dist/features/kanban.js +95 -97
  286. package/dist/features/kanban.js.map +1 -1
  287. package/dist/features/map.js +56 -57
  288. package/dist/features/map.js.map +1 -1
  289. package/dist/features/media-library.js +918 -825
  290. package/dist/features/media-library.js.map +1 -1
  291. package/dist/features/mentions.js +1 -1
  292. package/dist/features/overlays.js +1 -1
  293. package/dist/features/products.js +1115 -1122
  294. package/dist/features/products.js.map +1 -1
  295. package/dist/features/questionnaire.js +202 -194
  296. package/dist/features/questionnaire.js.map +1 -1
  297. package/dist/features/resource-assignment.js +25 -25
  298. package/dist/features/resource-assignment.js.map +1 -1
  299. package/dist/features/resource.js +77 -69
  300. package/dist/features/resource.js.map +1 -1
  301. package/dist/features/rich-text-editor.js +30 -11
  302. package/dist/features/rich-text-editor.js.map +1 -1
  303. package/dist/features/schema-form.js +33 -33
  304. package/dist/features/schema-form.js.map +1 -1
  305. package/dist/features/suggestions.js +3 -3
  306. package/dist/features/sync.js +3 -3
  307. package/dist/features/table.js +1 -1
  308. package/dist/features/theme-tweaker.js +397 -396
  309. package/dist/features/theme-tweaker.js.map +1 -1
  310. package/dist/{feedback-C7nR0UtT.js → feedback-qNuMBtRH.js} +84 -83
  311. package/dist/feedback-qNuMBtRH.js.map +1 -0
  312. package/dist/{field-affordance-recipes-CkOCdE2y.js → field-affordance-recipes-qQeIf4lG.js} +8 -6
  313. package/dist/field-affordance-recipes-qQeIf4lG.js.map +1 -0
  314. package/dist/field-state-recipes-BVA2CWHo.js +12 -0
  315. package/dist/field-state-recipes-BVA2CWHo.js.map +1 -0
  316. package/dist/{filters-Da-gNPsE.js → filters-BkHH53uv.js} +565 -563
  317. package/dist/filters-BkHH53uv.js.map +1 -0
  318. package/dist/focus-recipes-B653VaLq.js +12 -0
  319. package/dist/focus-recipes-B653VaLq.js.map +1 -0
  320. package/dist/{form-field-VZRULhUK.js → form-field-DUt4UxSV.js} +4 -4
  321. package/dist/{form-field-VZRULhUK.js.map → form-field-DUt4UxSV.js.map} +1 -1
  322. package/dist/{form-sizing-uWP4lzVh.js → form-sizing-By94KzXE.js} +19 -15
  323. package/dist/form-sizing-By94KzXE.js.map +1 -0
  324. package/dist/{forms-DDeEnXSY.js → forms-Bzha-Y3B.js} +22 -22
  325. package/dist/{forms-DDeEnXSY.js.map → forms-Bzha-Y3B.js.map} +1 -1
  326. package/dist/{forms-numeric-D3CO60IF.js → forms-numeric-C0bvjRPZ.js} +265 -264
  327. package/dist/forms-numeric-C0bvjRPZ.js.map +1 -0
  328. package/dist/{header-2ycNqGOR.js → header-BOefOKd1.js} +47 -51
  329. package/dist/header-BOefOKd1.js.map +1 -0
  330. package/dist/{hooks-DQ5SPwZw.js → hooks-9k_TtmKh.js} +2 -2
  331. package/dist/{hooks-DQ5SPwZw.js.map → hooks-9k_TtmKh.js.map} +1 -1
  332. package/dist/{http-CdEIHyQf.js → http-D_6rOnzU.js} +2 -2
  333. package/dist/{http-CdEIHyQf.js.map → http-D_6rOnzU.js.map} +1 -1
  334. package/dist/icon-badge-CAuKupo9.js +55 -0
  335. package/dist/icon-badge-CAuKupo9.js.map +1 -0
  336. package/dist/index.js +7 -7
  337. package/dist/input-DWhBBBww.js +262 -0
  338. package/dist/input-DWhBBBww.js.map +1 -0
  339. package/dist/{input-BoLm9Hks.js → input-Ddi_LSYv.js} +3 -3
  340. package/dist/{input-BoLm9Hks.js.map → input-Ddi_LSYv.js.map} +1 -1
  341. package/dist/interaction-recipes-CHr0dJUs.js +24 -0
  342. package/dist/interaction-recipes-CHr0dJUs.js.map +1 -0
  343. package/dist/{item-xzh8Df65.js → item-DEmDiTlD.js} +98 -97
  344. package/dist/item-DEmDiTlD.js.map +1 -0
  345. package/dist/layer-recipes-CCpklYME.js +13 -0
  346. package/dist/layer-recipes-CCpklYME.js.map +1 -0
  347. package/dist/layout/app-shell.js +1 -1
  348. package/dist/layout/auth.js +1 -1
  349. package/dist/layout/containers.js +1 -1
  350. package/dist/layout/header.js +1 -1
  351. package/dist/layout/hooks.js +1 -1
  352. package/dist/layout/navigation.js +1 -1
  353. package/dist/layout/page.js +1 -1
  354. package/dist/layout/settings.js +1 -1
  355. package/dist/layout/sidebar.js +2 -2
  356. package/dist/layout/workspace.js +1 -1
  357. package/dist/layout.js +10 -10
  358. package/dist/lib/affordance-geometry.generated.d.ts +1 -0
  359. package/dist/lib/field-affordance-recipes.d.ts +6 -1
  360. package/dist/lib/field-state-recipes.d.ts +9 -8
  361. package/dist/lib/focus-recipes.d.ts +24 -0
  362. package/dist/lib/interaction-recipes.d.ts +35 -0
  363. package/dist/lib/layer-recipes.d.ts +19 -0
  364. package/dist/lib/motion-recipes.d.ts +1 -0
  365. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -0
  366. package/dist/lib/safe-image-src.d.ts +10 -0
  367. package/dist/lib/sanitize-html.d.ts +15 -3
  368. package/dist/lib/surface-recipes.d.ts +47 -7
  369. package/dist/lib/token-merge.generated.d.ts +9 -6
  370. package/dist/lib/tone-recipes.d.ts +79 -0
  371. package/dist/lib/ui-provider/hooks.d.ts +2 -1
  372. package/dist/lib/ui-provider/index.d.ts +2 -2
  373. package/dist/lib/ui-provider/types.d.ts +9 -0
  374. package/dist/lib/utils.js +1 -1
  375. package/dist/media-gallery-DcTtAaeC.js +203 -0
  376. package/dist/media-gallery-DcTtAaeC.js.map +1 -0
  377. package/dist/mentions-D-uyCh01.js +568 -0
  378. package/dist/mentions-D-uyCh01.js.map +1 -0
  379. package/dist/{message-YfFmbXNP.js → message-CdHgIWKf.js} +5 -5
  380. package/dist/{message-YfFmbXNP.js.map → message-CdHgIWKf.js.map} +1 -1
  381. package/dist/metadata-list-X5rYAKSB.js +394 -0
  382. package/dist/metadata-list-X5rYAKSB.js.map +1 -0
  383. package/dist/{motion-recipes-B6jKXEcN.js → motion-recipes-ChBg4HBq.js} +3 -2
  384. package/dist/{motion-recipes-B6jKXEcN.js.map → motion-recipes-ChBg4HBq.js.map} +1 -1
  385. package/dist/navigation-D3KwXmaq.js +145 -0
  386. package/dist/navigation-D3KwXmaq.js.map +1 -0
  387. package/dist/navigation-HJf5zxlH.js +268 -0
  388. package/dist/navigation-HJf5zxlH.js.map +1 -0
  389. package/dist/{navigation-row-recipes-DlU-4QYO.js → navigation-row-recipes-BVowojQw.js} +2 -2
  390. package/dist/{navigation-row-recipes-DlU-4QYO.js.map → navigation-row-recipes-BVowojQw.js.map} +1 -1
  391. package/dist/{number-CKRBYmZK.js → number-DMhe-Vsk.js} +5 -5
  392. package/dist/{number-CKRBYmZK.js.map → number-DMhe-Vsk.js.map} +1 -1
  393. package/dist/overflow-tab-bar-sQHXLlwQ.js +280 -0
  394. package/dist/overflow-tab-bar-sQHXLlwQ.js.map +1 -0
  395. package/dist/overlay.recipes-8GHqmlb4.js +6 -0
  396. package/dist/overlay.recipes-8GHqmlb4.js.map +1 -0
  397. package/dist/overlays-I0axtYA6.js +999 -0
  398. package/dist/overlays-I0axtYA6.js.map +1 -0
  399. package/dist/page-B5dTH9gE.js +224 -0
  400. package/dist/page-B5dTH9gE.js.map +1 -0
  401. package/dist/page-header-commands-DjzFEq3E.js +126 -0
  402. package/dist/page-header-commands-DjzFEq3E.js.map +1 -0
  403. package/dist/{pagination-Cm0jqa3I.js → pagination-3bPA_a6K.js} +15 -15
  404. package/dist/{pagination-Cm0jqa3I.js.map → pagination-3bPA_a6K.js.map} +1 -1
  405. package/dist/{popover-Dcv_9jxr.js → popover-Di55PyAI.js} +8 -8
  406. package/dist/popover-Di55PyAI.js.map +1 -0
  407. package/dist/{popover-menu-DnRFKnHP.js → popover-menu-B71Tn2Qz.js} +6 -6
  408. package/dist/{popover-menu-DnRFKnHP.js.map → popover-menu-B71Tn2Qz.js.map} +1 -1
  409. package/dist/{popover.recipes-wmbvL8Ah.js → popover.recipes-Bdyhj2db.js} +2 -2
  410. package/dist/{popover.recipes-wmbvL8Ah.js.map → popover.recipes-Bdyhj2db.js.map} +1 -1
  411. package/dist/{primitives-BHrwQXFC.js → primitives-B-CkiEMU.js} +5 -5
  412. package/dist/{primitives-BHrwQXFC.js.map → primitives-B-CkiEMU.js.map} +1 -1
  413. package/dist/primitives.js +4 -4
  414. package/dist/{progress-Br9WTFya.js → progress-rnS8-uAW.js} +9 -9
  415. package/dist/{progress-Br9WTFya.js.map → progress-rnS8-uAW.js.map} +1 -1
  416. package/dist/{receipt-CV89q1fs.js → receipt-D0oswZ0p.js} +6 -6
  417. package/dist/{receipt-CV89q1fs.js.map → receipt-D0oswZ0p.js.map} +1 -1
  418. package/dist/rich-text-DvGulsNJ.js +78 -0
  419. package/dist/rich-text-DvGulsNJ.js.map +1 -0
  420. package/dist/rich-text-editor-sMU_Scqm.js +1204 -0
  421. package/dist/rich-text-editor-sMU_Scqm.js.map +1 -0
  422. package/dist/rich-text-editor.recipes-CadiF_Uu.js +88 -0
  423. package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +1 -0
  424. package/dist/rich-text-editor.strings-CB59ekH2.js +38 -0
  425. package/dist/rich-text-editor.strings-CB59ekH2.js.map +1 -0
  426. package/dist/safe-image-src-C6kQSMBZ.js +17 -0
  427. package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
  428. package/dist/sanitize-html-DsQmI48u.js +92 -0
  429. package/dist/sanitize-html-DsQmI48u.js.map +1 -0
  430. package/dist/scroll-area-Bt_vXY2b.js +48 -0
  431. package/dist/scroll-area-Bt_vXY2b.js.map +1 -0
  432. package/dist/{separator-Do5GWDYi.js → separator-C8DlRGwF.js} +3 -3
  433. package/dist/{separator-Do5GWDYi.js.map → separator-C8DlRGwF.js.map} +1 -1
  434. package/dist/{separator-BMEvwnSX.js → separator-CYHnjsAb.js} +2 -2
  435. package/dist/{separator-BMEvwnSX.js.map → separator-CYHnjsAb.js.map} +1 -1
  436. package/dist/services/actions/action-adapters.d.ts +18 -0
  437. package/dist/services/actions/index.d.ts +1 -1
  438. package/dist/services/actions.js +16 -4
  439. package/dist/services/actions.js.map +1 -1
  440. package/dist/settings-CQW3b-Cu.js +170 -0
  441. package/dist/settings-CQW3b-Cu.js.map +1 -0
  442. package/dist/sheet-4SEvVYzA.js +210 -0
  443. package/dist/sheet-4SEvVYzA.js.map +1 -0
  444. package/dist/{sidebar-Crc9M9JV.js → sidebar-C7WWR29L.js} +180 -179
  445. package/dist/sidebar-C7WWR29L.js.map +1 -0
  446. package/dist/{sidebar-Cb8WzOvE.js → sidebar-d7Dg80ln.js} +16 -16
  447. package/dist/sidebar-d7Dg80ln.js.map +1 -0
  448. package/dist/{skeleton-DVMXr15h.js → skeleton-Cz890JZF.js} +9 -9
  449. package/dist/{skeleton-DVMXr15h.js.map → skeleton-Cz890JZF.js.map} +1 -1
  450. package/dist/smart-card-lFKxn5Hu.js +595 -0
  451. package/dist/smart-card-lFKxn5Hu.js.map +1 -0
  452. package/dist/{spinner-CmTAbEp0.js → spinner-fa3h1Aif.js} +7 -7
  453. package/dist/{spinner-CmTAbEp0.js.map → spinner-fa3h1Aif.js.map} +1 -1
  454. package/dist/{structure-hzCW-XsV.js → structure-DC2dygdA.js} +2 -2
  455. package/dist/{structure-hzCW-XsV.js.map → structure-DC2dygdA.js.map} +1 -1
  456. package/dist/style.css +1 -1
  457. package/dist/surface-recipes-BKRVW8Os.js +43 -0
  458. package/dist/surface-recipes-BKRVW8Os.js.map +1 -0
  459. package/dist/{table-D6zKeYQX.js → table-CIKyLUsy.js} +59 -58
  460. package/dist/table-CIKyLUsy.js.map +1 -0
  461. package/dist/table-CrcLN9Io.js +1458 -0
  462. package/dist/table-CrcLN9Io.js.map +1 -0
  463. package/dist/{tabs-Dk8E_knt.js → tabs-DwBJfjxX.js} +58 -57
  464. package/dist/tabs-DwBJfjxX.js.map +1 -0
  465. package/dist/{text-inputs-BFpku0Qd.js → text-inputs-aaK9wcDT.js} +74 -79
  466. package/dist/text-inputs-aaK9wcDT.js.map +1 -0
  467. package/dist/theme.css +3 -3
  468. package/dist/{timelines-CxuAFIc2.js → timelines-C_SBwHNP.js} +153 -150
  469. package/dist/timelines-C_SBwHNP.js.map +1 -0
  470. package/dist/tone-recipes-CPoExcTE.js +70 -0
  471. package/dist/tone-recipes-CPoExcTE.js.map +1 -0
  472. package/dist/tooltip-CsfgrfS7.js +111 -0
  473. package/dist/tooltip-CsfgrfS7.js.map +1 -0
  474. package/dist/{tree-BotPlyiD.js → tree-BiKhg8AY.js} +68 -66
  475. package/dist/tree-BiKhg8AY.js.map +1 -0
  476. package/dist/typography/rich-text.js +1 -1
  477. package/dist/typography-DTRkE9zL.js +117 -0
  478. package/dist/typography-DTRkE9zL.js.map +1 -0
  479. package/dist/typography.js +1 -1
  480. package/dist/{ui-provider-D2_TeLqw.js → ui-provider-1D_NSYzO.js} +11 -3
  481. package/dist/ui-provider-1D_NSYzO.js.map +1 -0
  482. package/dist/ui-provider.js +3 -3
  483. package/dist/{upload-B0WHW7ak.js → upload-BO8-CLN6.js} +209 -209
  484. package/dist/upload-BO8-CLN6.js.map +1 -0
  485. package/dist/{upload-queue-BHZ_wBfd.js → upload-queue-EOC8g1gf.js} +109 -111
  486. package/dist/upload-queue-EOC8g1gf.js.map +1 -0
  487. package/dist/upload.recipes-BbxTqrCT.js +61 -0
  488. package/dist/upload.recipes-BbxTqrCT.js.map +1 -0
  489. package/dist/{usage-card-U0YBLTNT.js → usage-card-obRaBskq.js} +46 -46
  490. package/dist/{usage-card-U0YBLTNT.js.map → usage-card-obRaBskq.js.map} +1 -1
  491. package/dist/{utils-Cospvlj1.js → utils-l5LpDw2z.js} +56 -24
  492. package/dist/utils-l5LpDw2z.js.map +1 -0
  493. package/dist/value-inputs-TAYMX111.js +947 -0
  494. package/dist/value-inputs-TAYMX111.js.map +1 -0
  495. package/dist/{value-typography-Deb3yQZg.js → value-typography-b8wpz1eX.js} +2 -2
  496. package/dist/{value-typography-Deb3yQZg.js.map → value-typography-b8wpz1eX.js.map} +1 -1
  497. package/dist/workspace-DH0v0KcB.js +407 -0
  498. package/dist/workspace-DH0v0KcB.js.map +1 -0
  499. package/docs/consumer-skill/SKILL.md +19 -20
  500. package/docs/consumer-skill/examples/app-layout.tsx +1 -1
  501. package/docs/consumer-skill/examples/composition.tsx +3 -3
  502. package/docs/consumer-skill/examples/detail.tsx +59 -12
  503. package/docs/consumer-skill/examples/edit.tsx +1 -1
  504. package/docs/consumer-skill/examples/receipt.tsx +2 -2
  505. package/docs/consumer-skill/examples/scoped-directory.tsx +1 -1
  506. package/docs/consumer-skill/examples/website.tsx +1 -1
  507. package/docs/consumer-skill/references/agents-md.md +33 -0
  508. package/docs/consumer-skill/references/analytics.md +1 -1
  509. package/docs/consumer-skill/references/composition.md +51 -8
  510. package/docs/consumer-skill/references/design-contract.md +12 -3
  511. package/docs/consumer-skill/references/installation.md +11 -1
  512. package/docs/consumer-skill/references/public-api.json +847 -447
  513. package/docs/consumer-skill/references/review.md +25 -5
  514. package/docs/consumer-skill/references/theming.md +8 -4
  515. package/docs/consumer-skill/references/tokens.json +1 -1
  516. package/docs/consumer-skill/references/workflows.md +29 -10
  517. package/docs/consumer-skill/scripts/composition-policy.mjs +41 -11
  518. package/docs/consumer-skill/scripts/surface-policy.mjs +139 -5
  519. package/package.json +10 -2
  520. package/dist/accordion-CQXVcd7Q.js.map +0 -1
  521. package/dist/action-menu-BTpyPWJ2.js +0 -264
  522. package/dist/action-menu-BTpyPWJ2.js.map +0 -1
  523. package/dist/affordance-geometry.generated-CCIXb2A1.js.map +0 -1
  524. package/dist/ai-artifact-2PQ2fItc.js.map +0 -1
  525. package/dist/attachment-q69dlt5Y.js +0 -244
  526. package/dist/attachment-q69dlt5Y.js.map +0 -1
  527. package/dist/auth-M3vGMgDR.js.map +0 -1
  528. package/dist/avatar-djdaaQ_s.js.map +0 -1
  529. package/dist/badge-0tATj-tW.js +0 -92
  530. package/dist/badge-0tATj-tW.js.map +0 -1
  531. package/dist/breadcrumbs-BG_FfMK4.js +0 -128
  532. package/dist/breadcrumbs-BG_FfMK4.js.map +0 -1
  533. package/dist/button-BS3KDg00.js.map +0 -1
  534. package/dist/button-R9CCoH7A.js.map +0 -1
  535. package/dist/buttons-DS0ZIwJ_.js +0 -99
  536. package/dist/buttons-DS0ZIwJ_.js.map +0 -1
  537. package/dist/cards-QoJ4syG9.js.map +0 -1
  538. package/dist/checkbox-B7ygNTYp.js +0 -35
  539. package/dist/checkbox-B7ygNTYp.js.map +0 -1
  540. package/dist/choice-inputs-DrJ17tpL.js +0 -752
  541. package/dist/choice-inputs-DrJ17tpL.js.map +0 -1
  542. package/dist/code-block-CD0B7M93.js +0 -183
  543. package/dist/code-block-CD0B7M93.js.map +0 -1
  544. package/dist/combobox-6dvVny2q.js.map +0 -1
  545. package/dist/combobox-CB7039j7.js.map +0 -1
  546. package/dist/comments-You0Bzbr.js.map +0 -1
  547. package/dist/components/layout/page/partials/page-header-commands.d.ts +0 -13
  548. package/dist/containers-D_L4mTVb.js.map +0 -1
  549. package/dist/data-display-3xWQUnMA.js +0 -1335
  550. package/dist/data-display-3xWQUnMA.js.map +0 -1
  551. package/dist/date-picker-DrDFj8Lo.js +0 -1527
  552. package/dist/date-picker-DrDFj8Lo.js.map +0 -1
  553. package/dist/display-DrdvPwF0.js.map +0 -1
  554. package/dist/feedback-C7nR0UtT.js.map +0 -1
  555. package/dist/field-affordance-recipes-CkOCdE2y.js.map +0 -1
  556. package/dist/field-state-recipes-C-MFBX_8.js +0 -11
  557. package/dist/field-state-recipes-C-MFBX_8.js.map +0 -1
  558. package/dist/filters-Da-gNPsE.js.map +0 -1
  559. package/dist/form-sizing-uWP4lzVh.js.map +0 -1
  560. package/dist/forms-numeric-D3CO60IF.js.map +0 -1
  561. package/dist/header-2ycNqGOR.js.map +0 -1
  562. package/dist/icon-badge-DKlaKXoo.js +0 -53
  563. package/dist/icon-badge-DKlaKXoo.js.map +0 -1
  564. package/dist/input-DhQdBnV3.js +0 -255
  565. package/dist/input-DhQdBnV3.js.map +0 -1
  566. package/dist/item-xzh8Df65.js.map +0 -1
  567. package/dist/media-gallery-DQUQ0m3O.js +0 -201
  568. package/dist/media-gallery-DQUQ0m3O.js.map +0 -1
  569. package/dist/mentions-DwnO1hh4.js +0 -564
  570. package/dist/mentions-DwnO1hh4.js.map +0 -1
  571. package/dist/navigation-Cbp5V8gG.js +0 -264
  572. package/dist/navigation-Cbp5V8gG.js.map +0 -1
  573. package/dist/navigation-Cs1npsPm.js +0 -300
  574. package/dist/navigation-Cs1npsPm.js.map +0 -1
  575. package/dist/overlay.recipes-CNO2S9V6.js +0 -34
  576. package/dist/overlay.recipes-CNO2S9V6.js.map +0 -1
  577. package/dist/overlays-DhZO7N-I.js +0 -994
  578. package/dist/overlays-DhZO7N-I.js.map +0 -1
  579. package/dist/page-C6R_8jFt.js +0 -325
  580. package/dist/page-C6R_8jFt.js.map +0 -1
  581. package/dist/page-header-hUTzcRZX.js +0 -112
  582. package/dist/page-header-hUTzcRZX.js.map +0 -1
  583. package/dist/popover-Dcv_9jxr.js.map +0 -1
  584. package/dist/rich-text-editor-CF8QYt5p.js +0 -574
  585. package/dist/rich-text-editor-CF8QYt5p.js.map +0 -1
  586. package/dist/rich-text-editor.recipes-CnrbmTS1.js +0 -81
  587. package/dist/rich-text-editor.recipes-CnrbmTS1.js.map +0 -1
  588. package/dist/rich-text-editor.strings-BpnIQgMl.js +0 -25
  589. package/dist/rich-text-editor.strings-BpnIQgMl.js.map +0 -1
  590. package/dist/rich-text-j-FGAeZW.js +0 -32
  591. package/dist/rich-text-j-FGAeZW.js.map +0 -1
  592. package/dist/sanitize-html-BG9FGe-j.js +0 -64
  593. package/dist/sanitize-html-BG9FGe-j.js.map +0 -1
  594. package/dist/scroll-area-DRdr16Pt.js +0 -47
  595. package/dist/scroll-area-DRdr16Pt.js.map +0 -1
  596. package/dist/settings-DHk0L2MF.js +0 -161
  597. package/dist/settings-DHk0L2MF.js.map +0 -1
  598. package/dist/sheet-DRFNY1_D.js +0 -207
  599. package/dist/sheet-DRFNY1_D.js.map +0 -1
  600. package/dist/sidebar-Cb8WzOvE.js.map +0 -1
  601. package/dist/sidebar-Crc9M9JV.js.map +0 -1
  602. package/dist/smart-card-Bek-TwUp.js +0 -599
  603. package/dist/smart-card-Bek-TwUp.js.map +0 -1
  604. package/dist/surface-recipes-DOdoBXGm.js +0 -28
  605. package/dist/surface-recipes-DOdoBXGm.js.map +0 -1
  606. package/dist/table-D6zKeYQX.js.map +0 -1
  607. package/dist/table-Dn4XSrSB.js +0 -1444
  608. package/dist/table-Dn4XSrSB.js.map +0 -1
  609. package/dist/tabs-Dk8E_knt.js.map +0 -1
  610. package/dist/text-inputs-BFpku0Qd.js.map +0 -1
  611. package/dist/timelines-CxuAFIc2.js.map +0 -1
  612. package/dist/tree-BotPlyiD.js.map +0 -1
  613. package/dist/typography-CAr3dQhX.js +0 -116
  614. package/dist/typography-CAr3dQhX.js.map +0 -1
  615. package/dist/ui-provider-D2_TeLqw.js.map +0 -1
  616. package/dist/upload-B0WHW7ak.js.map +0 -1
  617. package/dist/upload-queue-BHZ_wBfd.js.map +0 -1
  618. package/dist/use-file-drop-target-BX7GnhoQ.js +0 -39
  619. package/dist/use-file-drop-target-BX7GnhoQ.js.map +0 -1
  620. package/dist/utils-Cospvlj1.js.map +0 -1
  621. package/dist/value-inputs-CjfzGMsN.js +0 -854
  622. package/dist/value-inputs-CjfzGMsN.js.map +0 -1
  623. package/dist/workspace-YoFjXi6i.js +0 -394
  624. package/dist/workspace-YoFjXi6i.js.map +0 -1
  625. /package/dist/components/{blocks/data-display/metadata → base/metadata-list}/metadata-list.strings.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"questionnaire.js","names":["_Fragment","Label","Heading","Text","Button","Stack","Progress","Input","FormField","Textarea","Select","CardRadioGroup","Checkbox","Fragment$1","QuestionnaireControl","context","common","error","labelId","descriptionId","question","answer","onAnswerChange","event","values","optionId","index","disabled","option","checked","entry","defaultQuestionnaireStrings","current","total","getVisibleQuestions","questions","answers","getQuestionnaireAnswer","id","validateQuestion","value","empty","strings","selected","url","result","getSubmissionAnswers","emptyAnswers","Questionnaire","forwardRef","controlledValue","stringsProp","formProps","props","controlled","stepControlled","internalValue","setInternalValue","useState","defaultValue","answersRef","useRef","visible","internalId","setInternalId","defaultQuestionId","requestedId","questionId","position","errors","setErrors","submitError","setSubmitError","busy","setBusy","completed","setCompleted","submission","resetTimer","mounted","stageRef","useStrings","useId","locked","cancelReset","cancel","goTo","nextId","onQuestionChange","setAnswer","next","onValueChange","previous","useEffect","advance","submit","validation","firstInvalid","controller","snapshot","onSubmit","onComplete","formatSubmitError","onError","currentError","description","cn","className","nativeEvent","initialVisible","initialQuestion","headerSlot","completionSlot","emptySlot"],"sources":["../../src/components/features/questionnaire/questionnaire-control.tsx","../../src/components/features/questionnaire/questionnaire.types.ts","../../src/components/features/questionnaire/questionnaire.utils.ts","../../src/components/features/questionnaire/questionnaire.tsx"],"sourcesContent":["import { CardRadioGroup, Checkbox, Select } from '../../base/choice-inputs';\nimport { Input, Textarea } from '../../base/text-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport type { QuestionnaireQuestionContext } from './questionnaire.types';\n\n/** All interactive behavior remains with public Base UI-backed field owners. */\nexport function QuestionnaireControl({ question, answer, disabled, error, labelId, descriptionId, onAnswerChange, ...context }: QuestionnaireQuestionContext) {\n\tconst common = { disabled, invalid: Boolean(error), 'aria-labelledby': labelId, 'aria-describedby': descriptionId, required: question.required };\n\tif (question.type === 'custom') return question.render({ ...context, question, answer, disabled, error, labelId, descriptionId, onAnswerChange });\n\tif (question.type === 'text') return <Input {...common} type={question.inputType ?? 'text'} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'textarea') return <Textarea {...common} rows={question.rows ?? 4} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'select') return <Select {...common} options={question.options} value={typeof answer === 'string' ? answer : null} onValueChange={onAnswerChange} />;\n\tif (question.type === 'single') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><CardRadioGroup options={question.options} value={typeof answer === 'string' ? answer : ''} disabled={disabled} invalid={Boolean(error)} onValueChange={onAnswerChange} columns={1} /></fieldset>;\n\tif (question.type === 'multiple') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><Stack gap=\"sm\">{question.options.map((option, index) => {\n\t\tconst values = Array.isArray(answer) ? answer : [];\n\t\tconst optionId = `${labelId}-option-${index}`;\n\t\treturn <Stack key={option.value} direction=\"horizontal\" align=\"start\" gap=\"sm\">\n\t\t\t<Checkbox id={optionId} disabled={disabled || option.disabled} aria-invalid={Boolean(error) || undefined} aria-describedby={[descriptionId, option.description ? `${optionId}-description` : undefined].filter(Boolean).join(' ') || undefined} checked={values.includes(option.value)} onCheckedChange={(checked) => onAnswerChange(checked ? [...values, option.value] : values.filter((entry) => entry !== option.value))} />\n\t\t\t<Stack gap=\"dense\"><Label htmlFor={optionId}>{option.label}</Label>{option.description && <Text id={`${optionId}-description`} size=\"xs\" type=\"secondary\">{option.description}</Text>}</Stack>\n\t\t</Stack>;\n\t})}</Stack></fieldset>;\n\tif (question.type === 'boolean') return <Stack direction=\"horizontal\" align=\"center\" gap=\"sm\"><Checkbox {...common} aria-labelledby={undefined} id={`${labelId}-checkbox`} checked={answer === true} onCheckedChange={(checked) => onAnswerChange(checked)} /><Label htmlFor={`${labelId}-checkbox`}>{question.label ?? question.title}</Label></Stack>;\n\treturn null;\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport type { StringsProp } from '../../../lib/strings';\n\nexport type QuestionnaireAnswer = string | string[] | boolean | undefined;\nexport type QuestionnaireAnswers = Record<string, QuestionnaireAnswer>;\nexport interface QuestionnaireOption { value: string; label: string; description?: string; disabled?: boolean }\nexport interface QuestionnaireQuestionBase {\n\t/** Unique stable key, used to retain answers across conditional visibility changes. */\n\tid: string;\n\ttitle: string;\n\tdescription?: string;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\t/** Hidden answers are retained for editing, but excluded from validation/submission. */\n\twhen?: (answers: QuestionnaireAnswers) => boolean;\n\t/** Return an error message, or undefined/true for a valid answer. */\n\tvalidate?: (answer: QuestionnaireAnswer, answers: QuestionnaireAnswers) => string | true | undefined;\n}\nexport interface QuestionnaireTextQuestion extends QuestionnaireQuestionBase {\n\ttype: 'text' | 'textarea';\n\tplaceholder?: string;\n\t/** Native text input type. */\n\tinputType?: 'text' | 'email' | 'url' | 'tel';\n\trows?: number;\n\tmaxLength?: number;\n}\nexport interface QuestionnaireChoiceQuestion extends QuestionnaireQuestionBase {\n\ttype: 'single' | 'multiple' | 'select';\n\toptions: QuestionnaireOption[];\n}\nexport interface QuestionnaireBooleanQuestion extends QuestionnaireQuestionBase { type: 'boolean'; label?: string }\nexport interface QuestionnaireCustomQuestion extends QuestionnaireQuestionBase {\n\ttype: 'custom';\n\trender: (context: QuestionnaireQuestionContext) => ReactNode;\n}\nexport type QuestionnaireQuestion = QuestionnaireTextQuestion | QuestionnaireChoiceQuestion | QuestionnaireBooleanQuestion | QuestionnaireCustomQuestion;\nexport interface QuestionnaireQuestionContext {\n\tquestion: QuestionnaireQuestion;\n\tanswer: QuestionnaireAnswer;\n\tanswers: QuestionnaireAnswers;\n\tdisabled: boolean;\n\terror?: string;\n\t/** Connect custom controls to the visible title and description/error. */\n\tlabelId: string;\n\tdescriptionId?: string;\n\tonAnswerChange: (answer: QuestionnaireAnswer) => void;\n}\nexport interface QuestionnaireSubmitContext { signal: AbortSignal }\nexport interface QuestionnaireStrings {\n\tprevious: string; next: string; submit: string; retry: string; cancel: string;\n\tsubmitting: string; submitted: string; editAnswers: string; empty: string;\n\trequired: string; invalidChoice: string; invalidFormat: string; progress: string;\n\tstep: (current: number, total: number) => string;\n\tsubmitError: string;\n}\nexport const defaultQuestionnaireStrings: QuestionnaireStrings = {\n\tprevious: 'Previous', next: 'Next', submit: 'Submit answers', retry: 'Try again', cancel: 'Cancel submission',\n\tsubmitting: 'Submitting answers…', submitted: 'Your answers have been submitted.', editAnswers: 'Edit answers',\n\tempty: 'There are no questions to answer.', required: 'Please answer this question.', invalidChoice: 'Choose an available option.',\n\tinvalidFormat: 'Enter a valid answer.', progress: 'Questionnaire progress', step: (current, total) => `Question ${current} of ${total}`,\n\tsubmitError: 'Answers could not be submitted. Please try again.',\n};\nexport interface QuestionnaireProps extends Omit<ComponentPropsWithoutRef<'form'>, 'children' | 'onSubmit' | 'defaultValue' | 'onChange'> {\n\tquestions: readonly QuestionnaireQuestion[];\n\t/** Controlled answers. */\n\tvalue?: QuestionnaireAnswers;\n\t/** Initial answers for uncontrolled use. */\n\tdefaultValue?: QuestionnaireAnswers;\n\tonValueChange?: (answers: QuestionnaireAnswers) => void;\n\t/** Controlled active question key. */\n\tquestionId?: string;\n\tdefaultQuestionId?: string;\n\tonQuestionChange?: (id: string) => void;\n\tdisabled?: boolean;\n\t/** Receives only visible, enabled questions. Respect signal to cancel application requests. */\n\tonSubmit?: (answers: QuestionnaireAnswers, context: QuestionnaireSubmitContext) => void | Promise<void>;\n\tonComplete?: (answers: QuestionnaireAnswers) => void;\n\tonError?: (error: unknown) => void;\n\tformatSubmitError?: (error: unknown) => string;\n\theaderSlot?: ReactNode;\n\temptySlot?: ReactNode;\n\t/** Replaces the completion state; default includes an edit-answers action. */\n\tcompletionSlot?: ReactNode;\n\tstrings?: StringsProp<QuestionnaireStrings>;\n}\n","import type { QuestionnaireAnswers, QuestionnaireQuestion, QuestionnaireStrings } from './questionnaire.types';\n\nexport function getVisibleQuestions(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers) {\n\treturn questions.filter((question) => !question.when || question.when(answers));\n}\nexport function getQuestionnaireAnswer(answers: QuestionnaireAnswers, id: string) {\n\treturn Object.hasOwn(answers, id) ? answers[id] : undefined;\n}\nexport function validateQuestion(question: QuestionnaireQuestion, answers: QuestionnaireAnswers, strings: QuestionnaireStrings): string | undefined {\n\tif (question.disabled) return;\n\tconst value = getQuestionnaireAnswer(answers, question.id);\n\tconst empty = value === undefined || (typeof value === 'string' && !value.trim()) || (Array.isArray(value) && value.length === 0);\n\tif (question.required && (empty || (question.type === 'boolean' && value !== true))) return strings.required;\n\tif (value !== undefined) {\n\t\tif ((question.type === 'text' || question.type === 'textarea') && typeof value !== 'string') return strings.invalidFormat;\n\t\tif (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t\tif ((question.type === 'multiple' && !Array.isArray(value)) || ((question.type === 'single' || question.type === 'select') && typeof value !== 'string')) return strings.invalidChoice;\n\t}\n\tif (!empty) {\n\t\tif (question.type === 'single' || question.type === 'select' || question.type === 'multiple') {\n\t\t\tconst selected = Array.isArray(value) ? value : [value];\n\t\t\tif ((question.type === 'multiple' ? !Array.isArray(value) : typeof value !== 'string') || selected.some((entry) => !question.options.some((option) => option.value === entry && !option.disabled))) return strings.invalidChoice;\n\t\t} else if (question.type === 'text' || question.type === 'textarea') {\n\t\t\tif (typeof value !== 'string' || (question.maxLength !== undefined && value.length > question.maxLength)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'email' && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'url') { try { const url = new URL(value); if (!url.host || !['http:', 'https:'].includes(url.protocol)) return strings.invalidFormat; } catch { return strings.invalidFormat; } }\n\t\t} else if (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t}\n\tconst result = question.validate?.(value, answers);\n\treturn typeof result === 'string' && result.length > 0 ? result : undefined;\n}\n\nexport function getSubmissionAnswers(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers): QuestionnaireAnswers {\n\treturn Object.fromEntries(getVisibleQuestions(questions, answers).filter((question) => !question.disabled).map((question) => {\n\t\tconst answer = getQuestionnaireAnswer(answers, question.id);\n\t\treturn [question.id, Array.isArray(answer) ? [...answer] : answer];\n\t}));\n}\n","import { forwardRef, useEffect, useId, useRef, useState } from 'react';\nimport { Button } from '../../base/buttons';\nimport { FormField } from '../../base/forms/form-field';\nimport { Progress } from '../../base/feedback';\nimport { Stack } from '../../base/structure';\nimport { Heading, Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { QuestionnaireControl } from './questionnaire-control';\nimport { defaultQuestionnaireStrings, type QuestionnaireAnswer, type QuestionnaireAnswers, type QuestionnaireProps } from './questionnaire.types';\nimport { getQuestionnaireAnswer, getSubmissionAnswers, getVisibleQuestions, validateQuestion } from './questionnaire.utils';\n\nconst emptyAnswers: QuestionnaireAnswers = {};\n\nexport const Questionnaire = forwardRef<HTMLFormElement, QuestionnaireProps>(function Questionnaire(props, ref) {\n\tconst { questions, value: controlledValue, defaultValue = {}, onValueChange, questionId, defaultQuestionId, onQuestionChange,\n\t\tdisabled = false, onSubmit, onComplete, onError, formatSubmitError, headerSlot, emptySlot, completionSlot, strings: stringsProp,\n\t\tclassName, onReset, ...formProps } = props;\n\tconst controlled = Object.prototype.hasOwnProperty.call(props, 'value');\n\tconst stepControlled = Object.prototype.hasOwnProperty.call(props, 'questionId');\n\tconst [internalValue, setInternalValue] = useState<QuestionnaireAnswers>(defaultValue);\n\tconst answers = controlled ? controlledValue ?? emptyAnswers : internalValue;\n\tconst answersRef = useRef(answers); answersRef.current = answers;\n\tconst visible = getVisibleQuestions(questions, answers);\n\tconst [internalId, setInternalId] = useState<string | undefined>(defaultQuestionId ?? visible[0]?.id);\n\tconst requestedId = stepControlled ? questionId : internalId;\n\tconst current = visible.find((question) => question.id === requestedId) ?? visible[0];\n\tconst position = current ? visible.indexOf(current) : 0;\n\tconst [errors, setErrors] = useState<Record<string, string | undefined>>({});\n\tconst [submitError, setSubmitError] = useState<string>();\n\tconst [busy, setBusy] = useState(false);\n\tconst [completed, setCompleted] = useState(false);\n\tconst submission = useRef<AbortController | null>(null);\n\tconst resetTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\tconst mounted = useRef(true);\n\tconst stageRef = useRef<HTMLDivElement>(null);\n\tconst strings = useStrings(defaultQuestionnaireStrings, stringsProp);\n\tconst id = useId();\n\tconst labelId = `${id}-title`;\n\tconst descriptionId = `${id}-description`;\n\tconst locked = busy || disabled;\n\tconst cancelReset = () => { clearTimeout(resetTimer.current); resetTimer.current = undefined; };\n\tconst cancel = () => { submission.current?.abort(); submission.current = null; setBusy(false); };\n\tconst goTo = (nextId: string) => { if (!stepControlled) setInternalId(nextId); onQuestionChange?.(nextId); };\n\tconst setAnswer = (answer: QuestionnaireAnswer) => {\n\t\tif (!current || current.disabled || locked) return;\n\t\tconst next = { ...answersRef.current, [current.id]: answer };\n\t\tif (!controlled) { answersRef.current = next; setInternalValue(next); }\n\t\tonValueChange?.(next);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: undefined })); setSubmitError(undefined); setCompleted(false);\n\t};\n\tuseEffect(() => { stageRef.current?.focus(); }, [current?.id, completed]);\n\tuseEffect(() => {\n\t\t// Replacing data/schema or disabling during a request invalidates that result.\n\t\tcancelReset(); cancel(); setErrors({}); setSubmitError(undefined); setCompleted(false);\n\t}, [answers, questions, disabled]);\n\tuseEffect(() => { mounted.current = true; return () => { mounted.current = false; cancelReset(); submission.current?.abort(); submission.current = null; }; }, []);\n\tconst advance = () => {\n\t\tif (!current || locked) return;\n\t\tconst error = validateQuestion(current, answersRef.current, strings);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: error }));\n\t\tif (error) { stageRef.current?.focus(); return; }\n\t\tif (visible[position + 1]) goTo(visible[position + 1].id);\n\t};\n\tconst submit = async () => {\n\t\tif (submission.current || disabled || !visible.length) return;\n\t\tconst validation = Object.fromEntries(visible.map((question) => [question.id, validateQuestion(question, answersRef.current, strings)]));\n\t\tsetErrors(validation);\n\t\tconst firstInvalid = visible.find((question) => validation[question.id]);\n\t\tif (firstInvalid) { goTo(firstInvalid.id); stageRef.current?.focus(); return; }\n\t\tconst controller = new AbortController(); submission.current = controller;\n\t\tsetSubmitError(undefined); setBusy(true);\n\t\tconst snapshot = getSubmissionAnswers(questions, answersRef.current);\n\t\ttry {\n\t\t\tawait onSubmit?.(snapshot, { signal: controller.signal });\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetCompleted(true); onComplete?.(snapshot);\n\t\t} catch (error) {\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetSubmitError(formatSubmitError?.(error) ?? strings.submitError); onError?.(error);\n\t\t} finally { if (submission.current === controller) { submission.current = null; setBusy(false); } }\n\t};\n\tconst currentError = current && Object.hasOwn(errors, current.id) ? errors[current.id] : undefined;\n\tconst description = current && (currentError || current.description);\n\treturn <form {...formProps} ref={ref} noValidate aria-busy={busy || undefined} className={cn('questionnaire--component min-w-0', className)} onSubmit={(event) => { event.preventDefault(); if (position < visible.length - 1) advance(); else void submit(); }} onReset={(event) => {\n\t\tonReset?.(event); const nativeEvent = event.nativeEvent;\n\t\t// Trusted events can run microtasks before native ancestor listeners have cancelled reset.\n\t\tcancelReset(); resetTimer.current = setTimeout(() => {\n\t\t\tresetTimer.current = undefined;\n\t\t\tif (!mounted.current || nativeEvent.defaultPrevented || disabled) return; cancel();\n\t\t\tif (!controlled) { answersRef.current = defaultValue; setInternalValue(defaultValue); } onValueChange?.(defaultValue);\n\t\t\tsetErrors({}); setSubmitError(undefined); setCompleted(false);\n\t\t\tconst initialVisible = getVisibleQuestions(questions, defaultValue);\n\t\t\tconst initialQuestion = initialVisible.find((question) => question.id === defaultQuestionId) ?? initialVisible[0];\n\t\t\tif (initialQuestion) goTo(initialQuestion.id); else if (!stepControlled) setInternalId(undefined);\n\t\t}, 0);\n\t}}>\n\t\t<Stack gap=\"lg\">\n\t\t\t{headerSlot}\n\t\t\t{!current ? emptySlot ?? <Text type=\"secondary\">{strings.empty}</Text> : completed ? completionSlot ?? <Stack gap=\"sm\"><Text role=\"status\">{strings.submitted}</Text><Button disabled={disabled} type=\"button\" buttonStyle=\"outline\" onClick={() => { setCompleted(false); if (visible[0]) goTo(visible[0].id); }}>{strings.editAnswers}</Button></Stack> : <>\n\t\t\t\t<Progress value={position + 1} max={visible.length} label={strings.progress} valueSlot={<Text size=\"xs\" type=\"secondary\" aria-live=\"polite\">{strings.step(position + 1, visible.length)}</Text>} />\n\t\t\t\t<Stack ref={stageRef} gap=\"normal\" tabIndex={-1} role=\"group\" aria-labelledby={labelId} className=\"questionnaire--question outline-none\">\n\t\t\t\t\t<Heading id={labelId} tag=\"h3\">{current.title}</Heading>\n\t\t\t\t\t<FormField required={current.required} error={currentError} hint={current.description} supportingTextId={descriptionId}>\n\t\t\t\t\t\t<QuestionnaireControl key={current.id} question={current} answer={getQuestionnaireAnswer(answers, current.id)} answers={answers} disabled={locked || Boolean(current.disabled)} error={currentError} labelId={labelId} descriptionId={description ? descriptionId : undefined} onAnswerChange={setAnswer} />\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t\t{submitError && <Text role=\"alert\" type=\"error\">{submitError}</Text>}\n\t\t\t\t{busy && <Text role=\"status\" type=\"secondary\">{strings.submitting}</Text>}\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap>\n\t\t\t\t\t<Button type=\"button\" buttonStyle=\"outline\" disabled={locked || position === 0} onClick={() => { setSubmitError(undefined); goTo(visible[position - 1].id); }}>{strings.previous}</Button>\n\t\t\t\t\t{position < visible.length - 1 ? <Button tone=\"primary\" type=\"button\" disabled={locked} onClick={advance}>{strings.next}</Button> : <Button tone=\"primary\" type=\"submit\" disabled={locked}>{submitError ? strings.retry : strings.submit}</Button>}\n\t\t\t\t\t{busy && <Button type=\"button\" buttonStyle=\"outline\" disabled={disabled} onClick={cancel}>{strings.cancel}</Button>}\n\t\t\t\t</Stack>\n\t\t\t</>}\n\t\t</Stack>\n\t</form>;\n});\n"],"mappings":";;;;;;;;;;;;;;;AAOA,SAAgBc,GAAqB,EAAE,aAAU,WAAQ,aAAU,UAAO,YAAS,kBAAe,mBAAgB,GAAGC,KAAyC;CAC7J,IAAMC,IAAS;EAAE;EAAU,SAAS,EAAQC;EAAQ,mBAAmBC;EAAS,oBAAoBC;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Z,IAAc7B,EAAQ,QAAQA,EAAQ;MAAe,CAAA;MAChP+B,KAAQ,kBAACrE,GAAD;OAAQ,MAAK;OAAS,aAAY;OAAoB;OAAU,SAASiF;OAAS,UAAA3C,EAAQ;MAAe,CAAA;KAC5G;;GACN,EAAA,CAAA,IAfUuE,MAAa,kBAAC9G,GAAD;IAAM,MAAK;IAAa,UAAAuC,EAAQ;GAAY,CAAA,CAgB/D;;CACF,CAAA;AACP,CAAC"}
1
+ {"version":3,"file":"questionnaire.js","names":["_Fragment","useDensityConfig","resolveComponentScale","cn","Button","Label","Stack","Progress","formLabelSizeClasses","Input","FormField","Textarea","Select","CardRadioGroup","choiceControlTrackClasses","Checkbox","Fragment$1","QuestionnaireControl","context","checkTrack","defaultScale","common","error","labelId","descriptionId","question","answer","onAnswerChange","event","values","optionId","index","disabled","option","checked","entry","Text","defaultQuestionnaireStrings","current","total","getVisibleQuestions","questions","answers","getQuestionnaireAnswer","id","validateQuestion","value","empty","strings","selected","url","result","getSubmissionAnswers","emptyAnswers","Questionnaire","forwardRef","controlledValue","stringsProp","formProps","props","controlled","stepControlled","internalValue","setInternalValue","useState","defaultValue","answersRef","useRef","visible","internalId","setInternalId","defaultQuestionId","requestedId","questionId","position","errors","setErrors","submitError","setSubmitError","busy","setBusy","completed","setCompleted","submission","resetTimer","mounted","stageRef","useStrings","useId","locked","cancelReset","cancel","goTo","nextId","onQuestionChange","setAnswer","next","onValueChange","previous","useEffect","advance","submit","validation","firstInvalid","controller","snapshot","onSubmit","onComplete","formatSubmitError","onError","currentError","description","className","nativeEvent","initialVisible","initialQuestion","headerSlot","completionSlot","Heading","emptySlot"],"sources":["../../src/components/features/questionnaire/questionnaire-control.tsx","../../src/components/features/questionnaire/questionnaire.types.ts","../../src/components/features/questionnaire/questionnaire.utils.ts","../../src/components/features/questionnaire/questionnaire.tsx"],"sourcesContent":["import { CardRadioGroup, Checkbox, Select } from '../../base/choice-inputs';\nimport { choiceControlTrackClasses } from '../../base/choice-inputs/choice-types';\nimport { formLabelSizeClasses } from '../../base/forms/form-sizing';\nimport { Input, Textarea } from '../../base/text-inputs';\nimport { Stack } from '../../base/structure';\nimport { Label, Text } from '../../typography';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\nimport type { QuestionnaireQuestionContext } from './questionnaire.types';\n\n/** All interactive behavior remains with public Base UI-backed field owners. */\nexport function QuestionnaireControl({ question, answer, disabled, error, labelId, descriptionId, onAnswerChange, ...context }: QuestionnaireQuestionContext) {\n\tconst { defaultScale } = useDensityConfig();\n\t// Each checkbox sits in a track one Label line tall, so it centres on the\n\t// option's first line whether or not the label wraps.\n\tconst checkTrack = cn('questionnaire--check', choiceControlTrackClasses, formLabelSizeClasses[resolveComponentScale(undefined, defaultScale)]);\n\tconst common = { disabled, invalid: Boolean(error), 'aria-labelledby': labelId, 'aria-describedby': descriptionId, required: question.required };\n\tif (question.type === 'custom') return question.render({ ...context, question, answer, disabled, error, labelId, descriptionId, onAnswerChange });\n\tif (question.type === 'text') return <Input {...common} type={question.inputType ?? 'text'} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'textarea') return <Textarea {...common} rows={question.rows ?? 4} maxLength={question.maxLength} placeholder={question.placeholder} value={typeof answer === 'string' ? answer : ''} onChange={(event) => onAnswerChange(event.target.value)} />;\n\tif (question.type === 'select') return <Select {...common} options={question.options} value={typeof answer === 'string' ? answer : null} onValueChange={onAnswerChange} />;\n\tif (question.type === 'single') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><CardRadioGroup options={question.options} value={typeof answer === 'string' ? answer : ''} disabled={disabled} invalid={Boolean(error)} onValueChange={onAnswerChange} columns={1} /></fieldset>;\n\tif (question.type === 'multiple') return <fieldset aria-labelledby={labelId} aria-describedby={descriptionId} className=\"questionnaire--choices m-0 min-w-0 border-0 p-0\"><Stack gap=\"sm\">{question.options.map((option, index) => {\n\t\tconst values = Array.isArray(answer) ? answer : [];\n\t\tconst optionId = `${labelId}-option-${index}`;\n\t\treturn <Stack key={option.value} direction=\"horizontal\" align=\"start\" gap=\"sm\">\n\t\t\t<span className={checkTrack}><Checkbox id={optionId} disabled={disabled || option.disabled} aria-invalid={Boolean(error) || undefined} aria-describedby={[descriptionId, option.description ? `${optionId}-description` : undefined].filter(Boolean).join(' ') || undefined} checked={values.includes(option.value)} onCheckedChange={(checked) => onAnswerChange(checked ? [...values, option.value] : values.filter((entry) => entry !== option.value))} /></span>\n\t\t\t<Stack gap=\"dense\"><Label htmlFor={optionId}>{option.label}</Label>{option.description && <Text id={`${optionId}-description`} size=\"xs\" type=\"secondary\">{option.description}</Text>}</Stack>\n\t\t</Stack>;\n\t})}</Stack></fieldset>;\n\tif (question.type === 'boolean') return <Stack direction=\"horizontal\" align=\"start\" gap=\"sm\"><span className={checkTrack}><Checkbox {...common} aria-labelledby={undefined} id={`${labelId}-checkbox`} checked={answer === true} onCheckedChange={(checked) => onAnswerChange(checked)} /></span><Label htmlFor={`${labelId}-checkbox`}>{question.label ?? question.title}</Label></Stack>;\n\treturn null;\n}\n","import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport type { StringsProp } from '../../../lib/strings';\n\nexport type QuestionnaireAnswer = string | string[] | boolean | undefined;\nexport type QuestionnaireAnswers = Record<string, QuestionnaireAnswer>;\nexport interface QuestionnaireOption { value: string; label: string; description?: string; disabled?: boolean }\nexport interface QuestionnaireQuestionBase {\n\t/** Unique stable key, used to retain answers across conditional visibility changes. */\n\tid: string;\n\ttitle: string;\n\tdescription?: string;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\t/** Hidden answers are retained for editing, but excluded from validation/submission. */\n\twhen?: (answers: QuestionnaireAnswers) => boolean;\n\t/** Return an error message, or undefined/true for a valid answer. */\n\tvalidate?: (answer: QuestionnaireAnswer, answers: QuestionnaireAnswers) => string | true | undefined;\n}\nexport interface QuestionnaireTextQuestion extends QuestionnaireQuestionBase {\n\ttype: 'text' | 'textarea';\n\tplaceholder?: string;\n\t/** Native text input type. */\n\tinputType?: 'text' | 'email' | 'url' | 'tel';\n\trows?: number;\n\tmaxLength?: number;\n}\nexport interface QuestionnaireChoiceQuestion extends QuestionnaireQuestionBase {\n\ttype: 'single' | 'multiple' | 'select';\n\toptions: QuestionnaireOption[];\n}\nexport interface QuestionnaireBooleanQuestion extends QuestionnaireQuestionBase { type: 'boolean'; label?: string }\nexport interface QuestionnaireCustomQuestion extends QuestionnaireQuestionBase {\n\ttype: 'custom';\n\trender: (context: QuestionnaireQuestionContext) => ReactNode;\n}\nexport type QuestionnaireQuestion = QuestionnaireTextQuestion | QuestionnaireChoiceQuestion | QuestionnaireBooleanQuestion | QuestionnaireCustomQuestion;\nexport interface QuestionnaireQuestionContext {\n\tquestion: QuestionnaireQuestion;\n\tanswer: QuestionnaireAnswer;\n\tanswers: QuestionnaireAnswers;\n\tdisabled: boolean;\n\terror?: string;\n\t/** Connect custom controls to the visible title and description/error. */\n\tlabelId: string;\n\tdescriptionId?: string;\n\tonAnswerChange: (answer: QuestionnaireAnswer) => void;\n}\nexport interface QuestionnaireSubmitContext { signal: AbortSignal }\nexport interface QuestionnaireStrings {\n\tprevious: string; next: string; submit: string; retry: string; cancel: string;\n\tsubmitting: string; submitted: string; editAnswers: string; empty: string;\n\trequired: string; invalidChoice: string; invalidFormat: string; progress: string;\n\tstep: (current: number, total: number) => string;\n\tsubmitError: string;\n}\nexport const defaultQuestionnaireStrings: QuestionnaireStrings = {\n\tprevious: 'Previous', next: 'Next', submit: 'Submit answers', retry: 'Try again', cancel: 'Cancel submission',\n\tsubmitting: 'Submitting answers…', submitted: 'Your answers have been submitted.', editAnswers: 'Edit answers',\n\tempty: 'There are no questions to answer.', required: 'Please answer this question.', invalidChoice: 'Choose an available option.',\n\tinvalidFormat: 'Enter a valid answer.', progress: 'Questionnaire progress', step: (current, total) => `Question ${current} of ${total}`,\n\tsubmitError: 'Answers could not be submitted. Please try again.',\n};\nexport interface QuestionnaireProps extends Omit<ComponentPropsWithoutRef<'form'>, 'children' | 'onSubmit' | 'defaultValue' | 'onChange'> {\n\tquestions: readonly QuestionnaireQuestion[];\n\t/** Controlled answers. */\n\tvalue?: QuestionnaireAnswers;\n\t/** Initial answers for uncontrolled use. */\n\tdefaultValue?: QuestionnaireAnswers;\n\tonValueChange?: (answers: QuestionnaireAnswers) => void;\n\t/** Controlled active question key. */\n\tquestionId?: string;\n\tdefaultQuestionId?: string;\n\tonQuestionChange?: (id: string) => void;\n\tdisabled?: boolean;\n\t/** Receives only visible, enabled questions. Respect signal to cancel application requests. */\n\tonSubmit?: (answers: QuestionnaireAnswers, context: QuestionnaireSubmitContext) => void | Promise<void>;\n\tonComplete?: (answers: QuestionnaireAnswers) => void;\n\tonError?: (error: unknown) => void;\n\tformatSubmitError?: (error: unknown) => string;\n\theaderSlot?: ReactNode;\n\temptySlot?: ReactNode;\n\t/** Replaces the completion state; default includes an edit-answers action. */\n\tcompletionSlot?: ReactNode;\n\tstrings?: StringsProp<QuestionnaireStrings>;\n}\n","import type { QuestionnaireAnswers, QuestionnaireQuestion, QuestionnaireStrings } from './questionnaire.types';\n\nexport function getVisibleQuestions(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers) {\n\treturn questions.filter((question) => !question.when || question.when(answers));\n}\nexport function getQuestionnaireAnswer(answers: QuestionnaireAnswers, id: string) {\n\treturn Object.hasOwn(answers, id) ? answers[id] : undefined;\n}\nexport function validateQuestion(question: QuestionnaireQuestion, answers: QuestionnaireAnswers, strings: QuestionnaireStrings): string | undefined {\n\tif (question.disabled) return;\n\tconst value = getQuestionnaireAnswer(answers, question.id);\n\tconst empty = value === undefined || (typeof value === 'string' && !value.trim()) || (Array.isArray(value) && value.length === 0);\n\tif (question.required && (empty || (question.type === 'boolean' && value !== true))) return strings.required;\n\tif (value !== undefined) {\n\t\tif ((question.type === 'text' || question.type === 'textarea') && typeof value !== 'string') return strings.invalidFormat;\n\t\tif (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t\tif ((question.type === 'multiple' && !Array.isArray(value)) || ((question.type === 'single' || question.type === 'select') && typeof value !== 'string')) return strings.invalidChoice;\n\t}\n\tif (!empty) {\n\t\tif (question.type === 'single' || question.type === 'select' || question.type === 'multiple') {\n\t\t\tconst selected = Array.isArray(value) ? value : [value];\n\t\t\tif ((question.type === 'multiple' ? !Array.isArray(value) : typeof value !== 'string') || selected.some((entry) => !question.options.some((option) => option.value === entry && !option.disabled))) return strings.invalidChoice;\n\t\t} else if (question.type === 'text' || question.type === 'textarea') {\n\t\t\tif (typeof value !== 'string' || (question.maxLength !== undefined && value.length > question.maxLength)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'email' && !/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(value)) return strings.invalidFormat;\n\t\t\tif (question.inputType === 'url') { try { const url = new URL(value); if (!url.host || !['http:', 'https:'].includes(url.protocol)) return strings.invalidFormat; } catch { return strings.invalidFormat; } }\n\t\t} else if (question.type === 'boolean' && typeof value !== 'boolean') return strings.invalidFormat;\n\t}\n\tconst result = question.validate?.(value, answers);\n\treturn typeof result === 'string' && result.length > 0 ? result : undefined;\n}\n\nexport function getSubmissionAnswers(questions: readonly QuestionnaireQuestion[], answers: QuestionnaireAnswers): QuestionnaireAnswers {\n\treturn Object.fromEntries(getVisibleQuestions(questions, answers).filter((question) => !question.disabled).map((question) => {\n\t\tconst answer = getQuestionnaireAnswer(answers, question.id);\n\t\treturn [question.id, Array.isArray(answer) ? [...answer] : answer];\n\t}));\n}\n","import { forwardRef, useEffect, useId, useRef, useState } from 'react';\nimport { Button } from '../../base/buttons';\nimport { FormField } from '../../base/forms/form-field';\nimport { Progress } from '../../base/feedback';\nimport { Stack } from '../../base/structure';\nimport { Heading, Text } from '../../typography';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { QuestionnaireControl } from './questionnaire-control';\nimport { defaultQuestionnaireStrings, type QuestionnaireAnswer, type QuestionnaireAnswers, type QuestionnaireProps } from './questionnaire.types';\nimport { getQuestionnaireAnswer, getSubmissionAnswers, getVisibleQuestions, validateQuestion } from './questionnaire.utils';\n\nconst emptyAnswers: QuestionnaireAnswers = {};\n\nexport const Questionnaire = forwardRef<HTMLFormElement, QuestionnaireProps>(function Questionnaire(props, ref) {\n\tconst { questions, value: controlledValue, defaultValue = {}, onValueChange, questionId, defaultQuestionId, onQuestionChange,\n\t\tdisabled = false, onSubmit, onComplete, onError, formatSubmitError, headerSlot, emptySlot, completionSlot, strings: stringsProp,\n\t\tclassName, onReset, ...formProps } = props;\n\tconst controlled = Object.prototype.hasOwnProperty.call(props, 'value');\n\tconst stepControlled = Object.prototype.hasOwnProperty.call(props, 'questionId');\n\tconst [internalValue, setInternalValue] = useState<QuestionnaireAnswers>(defaultValue);\n\tconst answers = controlled ? controlledValue ?? emptyAnswers : internalValue;\n\tconst answersRef = useRef(answers); answersRef.current = answers;\n\tconst visible = getVisibleQuestions(questions, answers);\n\tconst [internalId, setInternalId] = useState<string | undefined>(defaultQuestionId ?? visible[0]?.id);\n\tconst requestedId = stepControlled ? questionId : internalId;\n\tconst current = visible.find((question) => question.id === requestedId) ?? visible[0];\n\tconst position = current ? visible.indexOf(current) : 0;\n\tconst [errors, setErrors] = useState<Record<string, string | undefined>>({});\n\tconst [submitError, setSubmitError] = useState<string>();\n\tconst [busy, setBusy] = useState(false);\n\tconst [completed, setCompleted] = useState(false);\n\tconst submission = useRef<AbortController | null>(null);\n\tconst resetTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\tconst mounted = useRef(true);\n\tconst stageRef = useRef<HTMLDivElement>(null);\n\tconst strings = useStrings(defaultQuestionnaireStrings, stringsProp);\n\tconst id = useId();\n\tconst labelId = `${id}-title`;\n\tconst descriptionId = `${id}-description`;\n\tconst locked = busy || disabled;\n\tconst cancelReset = () => { clearTimeout(resetTimer.current); resetTimer.current = undefined; };\n\tconst cancel = () => { submission.current?.abort(); submission.current = null; setBusy(false); };\n\tconst goTo = (nextId: string) => { if (!stepControlled) setInternalId(nextId); onQuestionChange?.(nextId); };\n\tconst setAnswer = (answer: QuestionnaireAnswer) => {\n\t\tif (!current || current.disabled || locked) return;\n\t\tconst next = { ...answersRef.current, [current.id]: answer };\n\t\tif (!controlled) { answersRef.current = next; setInternalValue(next); }\n\t\tonValueChange?.(next);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: undefined })); setSubmitError(undefined); setCompleted(false);\n\t};\n\tuseEffect(() => { stageRef.current?.focus(); }, [current?.id, completed]);\n\tuseEffect(() => {\n\t\t// Replacing data/schema or disabling during a request invalidates that result.\n\t\tcancelReset(); cancel(); setErrors({}); setSubmitError(undefined); setCompleted(false);\n\t}, [answers, questions, disabled]);\n\tuseEffect(() => { mounted.current = true; return () => { mounted.current = false; cancelReset(); submission.current?.abort(); submission.current = null; }; }, []);\n\tconst advance = () => {\n\t\tif (!current || locked) return;\n\t\tconst error = validateQuestion(current, answersRef.current, strings);\n\t\tsetErrors((previous) => ({ ...previous, [current.id]: error }));\n\t\tif (error) { stageRef.current?.focus(); return; }\n\t\tif (visible[position + 1]) goTo(visible[position + 1].id);\n\t};\n\tconst submit = async () => {\n\t\tif (submission.current || disabled || !visible.length) return;\n\t\tconst validation = Object.fromEntries(visible.map((question) => [question.id, validateQuestion(question, answersRef.current, strings)]));\n\t\tsetErrors(validation);\n\t\tconst firstInvalid = visible.find((question) => validation[question.id]);\n\t\tif (firstInvalid) { goTo(firstInvalid.id); stageRef.current?.focus(); return; }\n\t\tconst controller = new AbortController(); submission.current = controller;\n\t\tsetSubmitError(undefined); setBusy(true);\n\t\tconst snapshot = getSubmissionAnswers(questions, answersRef.current);\n\t\ttry {\n\t\t\tawait onSubmit?.(snapshot, { signal: controller.signal });\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetCompleted(true); onComplete?.(snapshot);\n\t\t} catch (error) {\n\t\t\tif (submission.current !== controller || controller.signal.aborted) return;\n\t\t\tsetSubmitError(formatSubmitError?.(error) ?? strings.submitError); onError?.(error);\n\t\t} finally { if (submission.current === controller) { submission.current = null; setBusy(false); } }\n\t};\n\tconst currentError = current && Object.hasOwn(errors, current.id) ? errors[current.id] : undefined;\n\tconst description = current && (currentError || current.description);\n\treturn <form {...formProps} ref={ref} noValidate aria-busy={busy || undefined} className={cn('questionnaire--component min-w-0', className)} onSubmit={(event) => { event.preventDefault(); if (position < visible.length - 1) advance(); else void submit(); }} onReset={(event) => {\n\t\tonReset?.(event); const nativeEvent = event.nativeEvent;\n\t\t// Trusted events can run microtasks before native ancestor listeners have cancelled reset.\n\t\tcancelReset(); resetTimer.current = setTimeout(() => {\n\t\t\tresetTimer.current = undefined;\n\t\t\tif (!mounted.current || nativeEvent.defaultPrevented || disabled) return; cancel();\n\t\t\tif (!controlled) { answersRef.current = defaultValue; setInternalValue(defaultValue); } onValueChange?.(defaultValue);\n\t\t\tsetErrors({}); setSubmitError(undefined); setCompleted(false);\n\t\t\tconst initialVisible = getVisibleQuestions(questions, defaultValue);\n\t\t\tconst initialQuestion = initialVisible.find((question) => question.id === defaultQuestionId) ?? initialVisible[0];\n\t\t\tif (initialQuestion) goTo(initialQuestion.id); else if (!stepControlled) setInternalId(undefined);\n\t\t}, 0);\n\t}}>\n\t\t<Stack gap=\"lg\">\n\t\t\t{headerSlot}\n\t\t\t{!current ? emptySlot ?? <Text type=\"secondary\">{strings.empty}</Text> : completed ? completionSlot ?? <Stack gap=\"sm\"><Text role=\"status\">{strings.submitted}</Text><Button disabled={disabled} type=\"button\" buttonStyle=\"outline\" onClick={() => { setCompleted(false); if (visible[0]) goTo(visible[0].id); }}>{strings.editAnswers}</Button></Stack> : <>\n\t\t\t\t<Progress value={position + 1} max={visible.length} label={strings.progress} valueSlot={<Text size=\"xs\" type=\"secondary\" aria-live=\"polite\">{strings.step(position + 1, visible.length)}</Text>} />\n\t\t\t\t<Stack ref={stageRef} gap=\"normal\" tabIndex={-1} role=\"group\" aria-labelledby={labelId} className=\"questionnaire--question outline-none\">\n\t\t\t\t\t<Heading id={labelId} tag=\"h3\">{current.title}</Heading>\n\t\t\t\t\t<FormField required={current.required} error={currentError} hint={current.description} supportingTextId={descriptionId}>\n\t\t\t\t\t\t<QuestionnaireControl key={current.id} question={current} answer={getQuestionnaireAnswer(answers, current.id)} answers={answers} disabled={locked || Boolean(current.disabled)} error={currentError} labelId={labelId} descriptionId={description ? descriptionId : undefined} onAnswerChange={setAnswer} />\n\t\t\t\t\t</FormField>\n\t\t\t\t</Stack>\n\t\t\t\t{submitError && <Text role=\"alert\" type=\"error\">{submitError}</Text>}\n\t\t\t\t{busy && <Text role=\"status\" type=\"secondary\">{strings.submitting}</Text>}\n\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap>\n\t\t\t\t\t<Button type=\"button\" buttonStyle=\"outline\" disabled={locked || position === 0} onClick={() => { setSubmitError(undefined); goTo(visible[position - 1].id); }}>{strings.previous}</Button>\n\t\t\t\t\t{position < visible.length - 1 ? <Button tone=\"primary\" type=\"button\" disabled={locked} onClick={advance}>{strings.next}</Button> : <Button tone=\"primary\" type=\"submit\" disabled={locked}>{submitError ? strings.retry : strings.submit}</Button>}\n\t\t\t\t\t{busy && <Button type=\"button\" buttonStyle=\"outline\" disabled={disabled} onClick={cancel}>{strings.cancel}</Button>}\n\t\t\t\t</Stack>\n\t\t\t</>}\n\t\t</Stack>\n\t</form>;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,SAAgBiB,GAAqB,EAAE,aAAU,WAAQ,aAAU,UAAO,YAAS,kBAAe,mBAAgB,GAAGC,KAAyC;CAC7J,IAAM,EAAE,oBAAiBjB,EAAiB,GAGpCkB,IAAahB,EAAG,wBAAwBW,GAA2BN,EAAqBN,EAAsB,KAAA,GAAWkB,CAAY,EAAE,GACvIC,I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,SAAS,IAAI,kBAAChE,GAAD;OAAQ,MAAK;OAAU,MAAK;OAAS,UAAUqF;OAAQ,SAASW;OAAU,UAAApD,EAAQ;MAAa,CAAA,IAAI,kBAAC5C,GAAD;OAAQ,MAAK;OAAU,MAAK;OAAS,UAAUqF;OAAS,UAAAZ,IAAc7B,EAAQ,QAAQA,EAAQ;MAAe,CAAA;MAChP+B,KAAQ,kBAAC3E,GAAD;OAAQ,MAAK;OAAS,aAAY;OAAoB;OAAU,SAASuF;OAAS,UAAA3C,EAAQ;MAAe,CAAA;KAC5G;;GACN,EAAA,CAAA,IAfUuE,MAAa,kBAACnF,GAAD;IAAM,MAAK;IAAa,UAAAY,EAAQ;GAAY,CAAA,CAgB/D;;CACF,CAAA;AACP,CAAC"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "../lib/strings.js";
3
- import { t } from "../utils-Cospvlj1.js";
4
- import { a as n, s as r } from "../typography-CAr3dQhX.js";
5
- import { t as i } from "../button-BS3KDg00.js";
6
- import { t as a } from "../structure-hzCW-XsV.js";
7
- import { n as o } from "../cards-QoJ4syG9.js";
8
- import { r as s } from "../overlays-DhZO7N-I.js";
9
- import { n as c } from "../display-DrdvPwF0.js";
10
- import { l } from "../data-display-3xWQUnMA.js";
3
+ import { t } from "../utils-l5LpDw2z.js";
4
+ import { n } from "../buttons-SbIcm1HJ.js";
5
+ import { a as r, s as i } from "../typography-DTRkE9zL.js";
6
+ import { t as a } from "../structure-DC2dygdA.js";
7
+ import { n as o } from "../cards-CiiHpKYd.js";
8
+ import { r as s } from "../overlays-I0axtYA6.js";
9
+ import { n as c } from "../display-DsQTVzMz.js";
10
+ import { s as l } from "../data-display-DafIvCl5.js";
11
11
  import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
12
12
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
13
13
  import { Eye as v, PackageOpen as y } from "lucide-react";
@@ -101,39 +101,39 @@ function x({ resource: e, mapInitialSelected: t, onConfirmSelection: n, isConfir
101
101
  }
102
102
  //#endregion
103
103
  //#region src/components/features/resource-assignment/partials/default-shared-resource-partials.tsx
104
- function S({ context: t, strings: i, getSelectionLabel: o }) {
105
- let s = e(b, i), c = t.selectedSuggestion;
104
+ function S({ context: t, strings: n, getSelectionLabel: o }) {
105
+ let s = e(b, n), c = t.selectedSuggestion;
106
106
  if (c === null) return null;
107
107
  let l = o?.(c) ?? (typeof c == "object" && c && "label" in c && typeof c.label == "string" ? c.label : null);
108
108
  return l == null || l === "" ? null : /* @__PURE__ */ _(a, {
109
109
  gap: "dense",
110
110
  className: "default-dialog-summary--component shared-resource-card--dialog-summary",
111
- children: [/* @__PURE__ */ g(n, { children: s.currentlySelected }), /* @__PURE__ */ g(r, { children: l })]
111
+ children: [/* @__PURE__ */ g(r, { children: s.currentlySelected }), /* @__PURE__ */ g(i, { children: l })]
112
112
  });
113
113
  }
114
114
  S.displayName = "DefaultDialogSummary";
115
115
  function C({ context: t, strings: n }) {
116
- let i = e(b, n);
117
- return /* @__PURE__ */ g(r, {
116
+ let r = e(b, n);
117
+ return /* @__PURE__ */ g(i, {
118
118
  type: "secondary",
119
119
  className: "default-resource-content--component",
120
- children: i.noResourceContent
120
+ children: r.noResourceContent
121
121
  });
122
122
  }
123
123
  C.displayName = "DefaultResourceContent";
124
- function w({ context: t, strings: n }) {
125
- let r = e(b, n);
124
+ function w({ context: t, strings: r }) {
125
+ let i = e(b, r);
126
126
  return /* @__PURE__ */ g(l, {
127
- title: r.noResourceSelected,
127
+ title: i.noResourceSelected,
128
128
  description: !1,
129
129
  media: /* @__PURE__ */ g(y, { className: "size-icon" }),
130
130
  mediaVariant: "icon-soft",
131
- actions: /* @__PURE__ */ g(i, {
131
+ actions: /* @__PURE__ */ g(n, {
132
132
  tone: "secondary",
133
133
  buttonStyle: "outline",
134
134
  onClick: t.openSelector,
135
135
  type: "button",
136
- children: r.changeAction
136
+ children: i.changeAction
137
137
  }),
138
138
  className: "default-empty-content--component"
139
139
  });
@@ -156,7 +156,7 @@ function T({ SelectorComponent: e, selectorProps: t, context: n }) {
156
156
  T.displayName = "DefaultDialogContent";
157
157
  //#endregion
158
158
  //#region src/components/features/resource-assignment/resource-assignment.tsx
159
- function E({ icon: n, title: l, description: u, className: d, contentClassName: p, alert: m, alertTone: y, actions: E, headerAction: D, footerText: O, resource: k, selector: A, sections: j, sectionsClassName: M, viewAction: N, viewLink: P, ResourceContentComponent: F, EmptyContentComponent: I, renderResourceContent: L, renderEmptyContent: R, strings: ee }) {
159
+ function E({ icon: r, title: l, description: u, className: d, contentClassName: p, alert: m, alertTone: y, actions: E, headerAction: D, footerText: O, resource: k, selector: A, sections: j, sectionsClassName: M, viewAction: N, viewLink: P, ResourceContentComponent: F, EmptyContentComponent: I, renderResourceContent: L, renderEmptyContent: R, strings: ee }) {
160
160
  let z = e(b, ee), B = x({
161
161
  resource: k,
162
162
  mapInitialSelected: A?.mapInitialSelected ?? (() => null),
@@ -185,7 +185,7 @@ function E({ icon: n, title: l, description: u, className: d, contentClassName:
185
185
  B.openSelector,
186
186
  G,
187
187
  W
188
- ]), te = D || G ? /* @__PURE__ */ _(h, { children: [D, G && /* @__PURE__ */ g(i, {
188
+ ]), te = D || G ? /* @__PURE__ */ _(h, { children: [D, G && /* @__PURE__ */ g(n, {
189
189
  type: "button",
190
190
  tone: "secondary",
191
191
  buttonStyle: "outline",
@@ -223,7 +223,7 @@ function E({ icon: n, title: l, description: u, className: d, contentClassName:
223
223
  ]), re = f(() => R ? R(B) : I ? /* @__PURE__ */ g(I, { context: B }) : V ? /* @__PURE__ */ g(w, {
224
224
  context: B,
225
225
  strings: z
226
- }) : /* @__PURE__ */ g(r, {
226
+ }) : /* @__PURE__ */ g(i, {
227
227
  type: "secondary",
228
228
  children: z.noResourceSelected
229
229
  }), [
@@ -263,14 +263,14 @@ function E({ icon: n, title: l, description: u, className: d, contentClassName:
263
263
  },
264
264
  justify: "end",
265
265
  className: "w-full",
266
- children: [/* @__PURE__ */ g(i, {
266
+ children: [/* @__PURE__ */ g(n, {
267
267
  tone: "secondary",
268
268
  buttonStyle: "outline",
269
269
  onClick: B.closeSelector,
270
270
  disabled: B.isConfirming,
271
271
  type: "button",
272
272
  children: A.cancelText
273
- }), /* @__PURE__ */ g(i, {
273
+ }), /* @__PURE__ */ g(n, {
274
274
  tone: "primary",
275
275
  onClick: () => {
276
276
  B.confirmSelection();
@@ -301,7 +301,7 @@ function E({ icon: n, title: l, description: u, className: d, contentClassName:
301
301
  })
302
302
  }) : null;
303
303
  return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(c, {
304
- icon: n,
304
+ icon: r,
305
305
  title: l,
306
306
  description: u,
307
307
  "data-state": Z ? "selected" : "empty",
@@ -1 +1 @@
1
- {"version":3,"file":"resource-assignment.js","names":["_Fragment","ContentComponent","DisplayLabel","Text","Button","Stack","CardPrimaryAction","ActionDialog","ContentBlock","Fragment$1","defaultSharedResourceCardStrings","useSharedResourceCard","internalOpen","setInternalOpen","useState","defaultOpen","isConfirming","setIsConfirming","internalSelectedSuggestion","setInternalSelectedSuggestion","defaultValue","isOpenControlled","open","isValueControlled","value","isSelectorOpen","selectedSuggestion","hasResource","resource","initializedOpenCycleRef","useRef","hasOpenedRef","hasExplicitDefaultValueRef","setSelectorOpen","useCallback","nextOpen","onOpenChange","setSelectedSuggestion","selection","onValueChange","openSelector","isFirstOpen","initial","mapInitialSelected","onDialogOpen","closeSelector","onDialogClose","canConfirmSelection","useMemo","isConfirmDisabled","confirmSelection","onConfirmSelection","error","onError","DefaultDialogSummary","useStrings","strings","selected","context","label","getSelectionLabel","DefaultResourceContent","_context","s","DefaultEmptyContent","EmptyState","PackageOpen","DefaultDialogContent","componentProps","selectorProps","SelectorComponent","SharedResourceCard","stringsProp","selectorContext","selector","canUseSelector","selectorActionLabel","visibleBaseActionCount","actions","action","usesDefaultEmptyAction","renderEmptyContent","EmptyContentComponent","shouldInlineSelectorAction","resolvedActions","baseActions","resolvedHeaderAction","headerAction","resourceContent","renderResourceContent","ResourceContentComponent","sections","visibleSections","section","sectionsClassName","SectionComponent","emptyContent","DialogContentComponent","DialogSummaryComponent","dialogContentProps","cardBody","shouldRenderDialog","hasCustomViewAction","viewAction","viewActionContent","viewLink","Eye","viewActionNode","cn","dialogNode","className"],"sources":["../../src/components/features/resource-assignment/resource-assignment.strings.ts","../../src/components/features/resource-assignment/hooks/use-shared-resource-card.ts","../../src/components/features/resource-assignment/partials/default-shared-resource-partials.tsx","../../src/components/features/resource-assignment/resource-assignment.tsx"],"sourcesContent":["/**\n * Default user-facing strings for the resource-assignment feature.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SharedResourceCard\n * strings={{ noResourceSelected: t('resourceAssignment.empty') }}\n * …\n * />\n */\n\nexport interface SharedResourceCardStrings {\n\tcurrentlySelected: string;\n\tnoResourceContent: string;\n\tnoResourceSelected: string;\n\tchangeAction: string;\n}\n\nexport const defaultSharedResourceCardStrings: SharedResourceCardStrings = {\n\tcurrentlySelected: 'Currently selected:',\n\tnoResourceContent: 'No resource content configured.',\n\tnoResourceSelected: 'No resource selected.',\n\tchangeAction: 'Change',\n};\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { SharedResourceCardContext } from '../resource-assignment.types';\n\nexport type UseSharedResourceCardOptions<TResource, TSuggestion> = {\n\t/** Persisted assignment. `null` is the only empty state. */\n\tresource: TResource | null;\n\t/** Map persisted data when neither `value` nor first-open `defaultValue` supplies selection. */\n\tmapInitialSelected: (resource: TResource | null) => TSuggestion | null;\n\t/** Persist a confirmed suggestion. Returned promises are awaited. */\n\tonConfirmSelection: (selection: TSuggestion) => void | Promise<void>;\n\t/** Disable confirmation for a pending candidate. */\n\tisConfirmDisabled?: (selection: TSuggestion | null) => boolean;\n\t/** Called once per closed-to-open cycle, including an initially open selector. */\n\tonDialogOpen?: (selection: TSuggestion | null) => void;\n\t/** Called after selection mode closes or confirmation succeeds. */\n\tonDialogClose?: () => void;\n\t/** Called when `onConfirmSelection` throws. Library DEV-logs the error;\n\t * consumer wires telemetry. */\n\tonError?: (error: unknown, selection: TSuggestion) => void;\n\t/** Controlled selector visibility. An initial `true` value initializes selection. */\n\topen?: boolean;\n\t/** Initial selector visibility; `true` initializes selection after mount. */\n\tdefaultOpen?: boolean;\n\t/** Controlled visibility callback and uncontrolled visibility observer. */\n\tonOpenChange?: (open: boolean) => void;\n\t/** Controlled pending suggestion; authoritative over mapping on every open. */\n\tvalue?: TSuggestion | null;\n\t/** Initial uncontrolled suggestion; authoritative over mapping on the first open. */\n\tdefaultValue?: TSuggestion | null;\n\t/** Controlled selection callback and uncontrolled selection observer. */\n\tonValueChange?: (selection: TSuggestion | null) => void;\n};\n\nexport type UseSharedResourceCardResult<TResource, TSuggestion> =\n\tSharedResourceCardContext<TResource, TSuggestion>;\n\nexport function useSharedResourceCard<TResource, TSuggestion>({\n\tresource,\n\tmapInitialSelected,\n\tonConfirmSelection,\n\tisConfirmDisabled,\n\tonDialogOpen,\n\tonDialogClose,\n\tonError,\n\topen,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n}: UseSharedResourceCardOptions<TResource, TSuggestion>): UseSharedResourceCardResult<TResource, TSuggestion> {\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst [isConfirming, setIsConfirming] = useState(false);\n\tconst [internalSelectedSuggestion, setInternalSelectedSuggestion] =\n\t\tuseState<TSuggestion | null>(defaultValue ?? null);\n\tconst isOpenControlled = open !== undefined;\n\tconst isValueControlled = value !== undefined;\n\tconst isSelectorOpen = isOpenControlled ? open : internalOpen;\n\tconst selectedSuggestion = isValueControlled ? value : internalSelectedSuggestion;\n\tconst hasResource = resource !== null;\n\tconst initializedOpenCycleRef = useRef(false);\n\tconst hasOpenedRef = useRef(false);\n\tconst hasExplicitDefaultValueRef = useRef(defaultValue !== undefined);\n\n\tconst setSelectorOpen = useCallback((nextOpen: boolean) => {\n\t\tif (!isOpenControlled) setInternalOpen(nextOpen);\n\t\tonOpenChange?.(nextOpen);\n\t}, [isOpenControlled, onOpenChange]);\n\n\tconst setSelectedSuggestion = useCallback((selection: TSuggestion | null) => {\n\t\tif (!isValueControlled) setInternalSelectedSuggestion(selection);\n\t\tonValueChange?.(selection);\n\t}, [isValueControlled, onValueChange]);\n\n\tconst openSelector = useCallback(() => {\n\t\tsetSelectorOpen(true);\n\t}, [setSelectorOpen]);\n\n\tuseEffect(() => {\n\t\tif (!isSelectorOpen) {\n\t\t\tinitializedOpenCycleRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (initializedOpenCycleRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tinitializedOpenCycleRef.current = true;\n\t\tconst isFirstOpen = !hasOpenedRef.current;\n\t\tlet initial: TSuggestion | null;\n\n\t\tif (isValueControlled) {\n\t\t\tinitial = value;\n\t\t} else if (isFirstOpen && hasExplicitDefaultValueRef.current) {\n\t\t\tinitial = internalSelectedSuggestion;\n\t\t} else {\n\t\t\tinitial = mapInitialSelected(resource);\n\t\t\tsetSelectedSuggestion(initial);\n\t\t}\n\n\t\thasOpenedRef.current = true;\n\t\tonDialogOpen?.(initial);\n\t}, [\n\t\tinternalSelectedSuggestion,\n\t\tisSelectorOpen,\n\t\tisValueControlled,\n\t\tmapInitialSelected,\n\t\tonDialogOpen,\n\t\tresource,\n\t\tsetSelectedSuggestion,\n\t\tvalue,\n\t]);\n\n\tconst closeSelector = useCallback(() => {\n\t\tif (isConfirming) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectorOpen(false);\n\t\tsetSelectedSuggestion(null);\n\t\tonDialogClose?.();\n\t}, [isConfirming, onDialogClose, setSelectedSuggestion, setSelectorOpen]);\n\n\tconst canConfirmSelection = useMemo(() => {\n\t\tif (selectedSuggestion === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!isConfirmDisabled) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn !isConfirmDisabled(selectedSuggestion);\n\t}, [isConfirmDisabled, selectedSuggestion]);\n\n\tconst confirmSelection = useCallback(async () => {\n\t\tif (\n\t\t\tisConfirming ||\n\t\t\t!canConfirmSelection ||\n\t\t\tselectedSuggestion === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsConfirming(true);\n\n\t\ttry {\n\t\t\tawait onConfirmSelection(selectedSuggestion);\n\t\t\tsetSelectorOpen(false);\n\t\t\tsetSelectedSuggestion(null);\n\t\t\tonDialogClose?.();\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('SharedResourceCard confirmation failed:', error);\n\t\t\t}\n\t\t\tonError?.(error, selectedSuggestion);\n\t\t} finally {\n\t\t\tsetIsConfirming(false);\n\t\t}\n\t}, [\n\t\tcanConfirmSelection,\n\t\tisConfirming,\n\t\tonConfirmSelection,\n\t\tonDialogClose,\n\t\tonError,\n\t\tselectedSuggestion,\n\t\tsetSelectedSuggestion,\n\t\tsetSelectorOpen,\n\t]);\n\n\treturn useMemo(\n\t\t() => ({\n\t\t\tresource,\n\t\t\thasResource,\n\t\t\tisSelectorOpen,\n\t\t\tisConfirming,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t\topenSelector,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\tcanConfirmSelection,\n\t\t}),\n\t\t[\n\t\t\tcanConfirmSelection,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\thasResource,\n\t\t\tisConfirming,\n\t\t\tisSelectorOpen,\n\t\t\topenSelector,\n\t\t\tresource,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t],\n\t);\n}\n","import { Stack } from '../../../base/structure';\n/**\n * Default partial implementations for `<SharedResourceCard>`.\n *\n * Consumers can override any of these by passing\n * `ResourceContentComponent` / `EmptyContentComponent` /\n * `selector.DialogContentComponent` / `selector.DialogSummaryComponent`\n * to `<SharedResourceCard>`. Strings flow through the `strings` prop\n * deep-merged over `defaultSharedResourceCardStrings`.\n */\nimport { Button } from '../../../base/buttons';\nimport { EmptyState } from '../../../blocks/data-display';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { PackageOpen } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { defaultSharedResourceCardStrings, type SharedResourceCardStrings } from '../resource-assignment.strings';\nimport type {\n\tSharedResourceCardContentProps,\n\tSharedResourceCardDialogContentProps,\n\tSharedResourceCardDialogSummaryProps,\n\tSharedResourceSelectorComponentProps,\n} from '../resource-assignment.types';\n\ntype DefaultStrings = StringsProp<SharedResourceCardStrings>;\n\nexport function DefaultDialogSummary<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n\tgetSelectionLabel,\n}: SharedResourceCardDialogSummaryProps<TResource, TSuggestion> & {\n\t/** Overrides this surface's own copy. */\n\tstrings?: DefaultStrings;\n\t/** Builds the summary shown for the current selection. */\n\tgetSelectionLabel?: (selection: TSuggestion) => ReactNode;\n}) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\tconst selected = context.selectedSuggestion;\n\n\tif (selected === null) {\n\t\treturn null;\n\t}\n\n\tconst label = getSelectionLabel?.(selected) ?? (\n\t\ttypeof selected === 'object' &&\n\t\tselected !== null &&\n\t\t'label' in selected &&\n\t\ttypeof selected.label === 'string'\n\t\t\t? selected.label\n\t\t\t: null\n\t);\n\n\tif (label === null || label === undefined || label === '') {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"default-dialog-summary--component shared-resource-card--dialog-summary\">\n\t\t\t<DisplayLabel>{s.currentlySelected}</DisplayLabel>\n\t\t\t<Text>{label}</Text>\n\t\t</Stack>\n\t);\n}\nDefaultDialogSummary.displayName = 'DefaultDialogSummary';\n\nexport function DefaultResourceContent<TResource, TSuggestion>({\n\tcontext: _context,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn <Text type=\"secondary\" className=\"default-resource-content--component\">{s.noResourceContent}</Text>;\n}\nDefaultResourceContent.displayName = 'DefaultResourceContent';\n\nexport function DefaultEmptyContent<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={s.noResourceSelected}\n\t\t\tdescription={false}\n\t\t\tmedia={<PackageOpen className=\"size-icon\" />}\n\t\t\tmediaVariant=\"icon-soft\"\n\t\t\tactions={<Button\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\tonClick={context.openSelector}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{s.changeAction}\n\t\t\t</Button>}\n\t\t\tclassName=\"default-empty-content--component\"\n\t\t/>\n\t);\n}\nDefaultEmptyContent.displayName = 'DefaultEmptyContent';\n\nexport function DefaultDialogContent<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\tSelectorComponent,\n\tselectorProps,\n\tcontext,\n}: SharedResourceCardDialogContentProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst componentProps = {\n\t\t...(selectorProps ?? {} as TSelectorProps),\n\t\tonSelect: context.setSelectedSuggestion,\n\t\tselected: context.selectedSuggestion,\n\t\tinModal: true,\n\t\tlockOnSelect: false,\n\t\tcontext: 'dialog' as const,\n\t} as SharedResourceSelectorComponentProps<TSuggestion, TSelectorProps>;\n\n\treturn (\n\t\t<div className=\"default-dialog-content--component\">\n\t\t\t<SelectorComponent {...componentProps} />\n\t\t</div>\n\t);\n}\nDefaultDialogContent.displayName = 'DefaultDialogContent';\n","import { Eye } from 'lucide-react';\nimport { type ReactNode, useMemo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { CardPrimaryAction } from '../../base/cards';\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { ActionDialog } from '../overlays';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { defaultSharedResourceCardStrings } from './resource-assignment.strings';\nimport { type SharedResourceCardProps } from './resource-assignment.types';\nimport { useSharedResourceCard } from './hooks';\nimport {\n\tDefaultDialogContent,\n\tDefaultDialogSummary,\n\tDefaultEmptyContent,\n\tDefaultResourceContent,\n} from './partials';\n\n/**\n * Stateful, card-free relationship assignment workflow.\n *\n * Consumers own persisted resources, selector data, mutations, routing, and\n * translations. The feature owns pending selection, confirmation state,\n * failure handling, and the default assignment presentation.\n */\nexport function SharedResourceCard<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\ticon,\n\ttitle,\n\tdescription,\n\tclassName,\n\tcontentClassName,\n\talert,\n\talertTone,\n\tactions,\n\theaderAction,\n\tfooterText,\n\tresource,\n\tselector,\n\tsections,\n\tsectionsClassName,\n\tviewAction,\n\tviewLink,\n\tResourceContentComponent,\n\tEmptyContentComponent,\n\trenderResourceContent,\n\trenderEmptyContent,\n\tstrings: stringsProp,\n}: SharedResourceCardProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst strings = useStrings(defaultSharedResourceCardStrings, stringsProp);\n\tconst selectorContext = useSharedResourceCard<TResource, TSuggestion>({\n\t\tresource,\n\t\tmapInitialSelected:\n\t\t\tselector?.mapInitialSelected ?? (() => null as TSuggestion | null),\n\t\tonConfirmSelection:\n\t\t\tselector?.onConfirmSelection ?? (() => undefined),\n\t\tisConfirmDisabled: selector?.isConfirmDisabled,\n\t\tonDialogOpen: selector?.onDialogOpen,\n\t\tonDialogClose: selector?.onDialogClose,\n\t\tonError: selector?.onError,\n\t\topen: selector?.open,\n\t\tdefaultOpen: selector?.defaultOpen,\n\t\tonOpenChange: selector?.onOpenChange,\n\t\tvalue: selector?.value,\n\t\tdefaultValue: selector?.defaultValue,\n\t\tonValueChange: selector?.onValueChange,\n\t});\n\n\tconst canUseSelector = selector !== undefined;\n\tconst selectorActionLabel = selector?.actionLabel?.trim();\n\tconst visibleBaseActionCount = actions?.filter((action) => action.visible !== false).length ?? 0;\n\t// The default empty state already carries the selector call to action, so\n\t// the header does not repeat it until a resource is assigned.\n\tconst usesDefaultEmptyAction = canUseSelector\n\t\t&& !selectorContext.hasResource\n\t\t&& !renderEmptyContent\n\t\t&& !EmptyContentComponent;\n\tconst shouldInlineSelectorAction = Boolean(\n\t\tcanUseSelector && selectorActionLabel && visibleBaseActionCount === 0 && !usesDefaultEmptyAction,\n\t);\n\tconst resolvedActions = useMemo(() => {\n\t\tconst baseActions = actions ?? [];\n\n\t\tif (!canUseSelector || !selectorActionLabel || usesDefaultEmptyAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\tif (shouldInlineSelectorAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\treturn [\n\t\t\t...baseActions,\n\t\t\t{\n\t\t\t\tid: 'shared-resource-selector-change',\n\t\t\t\tlabel: selectorActionLabel,\n\t\t\t\tonClick: selectorContext.openSelector,\n\t\t\t},\n\t\t];\n\t}, [\n\t\tactions,\n\t\tcanUseSelector,\n\t\tselectorActionLabel,\n\t\tselectorContext.openSelector,\n\t\tshouldInlineSelectorAction,\n\t\tusesDefaultEmptyAction,\n\t]);\n\tconst resolvedHeaderAction = headerAction || shouldInlineSelectorAction ? (\n\t\t<>\n\t\t\t{headerAction}\n\t\t\t{shouldInlineSelectorAction && (\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\tsize=\"sm\"\n\t\t\t\t\tonClick={selectorContext.openSelector}\n\t\t\t\t\tclassName=\"shared-resource-card--selector-action\"\n\t\t\t\t>\n\t\t\t\t\t{selectorActionLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</>\n\t) : undefined;\n\n\tconst resourceContent: ReactNode = useMemo(() => {\n\t\tif (renderResourceContent) {\n\t\t\treturn renderResourceContent(selectorContext);\n\t\t}\n\n\t\tif (ResourceContentComponent) {\n\t\t\tconst ContentComponent = ResourceContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (Array.isArray(sections) && sections.length > 0) {\n\t\t\tconst visibleSections = sections.filter((section) => {\n\t\t\t\treturn section.when ? section.when(selectorContext) : true;\n\t\t\t});\n\n\t\t\tif (visibleSections.length > 0) {\n\t\t\t\treturn (\n\t\t\t\t\t<div className={sectionsClassName ?? 'grid gap-space-lg'}>\n\t\t\t\t\t\t{visibleSections.map((section) => {\n\t\t\t\t\t\t\tconst SectionComponent = section.Component;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div key={section.id} className={section.className}>\n\t\t\t\t\t\t\t\t\t<SectionComponent context={selectorContext} />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn <DefaultResourceContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tResourceContentComponent,\n\t\trenderResourceContent,\n\t\tsections,\n\t\tsectionsClassName,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst emptyContent: ReactNode = useMemo(() => {\n\t\tif (renderEmptyContent) {\n\t\t\treturn renderEmptyContent(selectorContext);\n\t\t}\n\n\t\tif (EmptyContentComponent) {\n\t\t\tconst ContentComponent = EmptyContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (!canUseSelector) {\n\t\t\treturn <Text type=\"secondary\">{strings.noResourceSelected}</Text>;\n\t\t}\n\n\t\treturn <DefaultEmptyContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tEmptyContentComponent,\n\t\tcanUseSelector,\n\t\trenderEmptyContent,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst DialogContentComponent = selector?.DialogContentComponent;\n\tconst DialogSummaryComponent = selector?.DialogSummaryComponent;\n\tconst SelectorComponent = selector?.SelectorComponent;\n\tconst selectorProps = selector?.selectorProps;\n\tconst dialogContentProps = selector?.dialogContentProps ?? {};\n\tconst hasResource = selectorContext.hasResource;\n\tconst cardBody = hasResource ? resourceContent : emptyContent;\n\tconst shouldRenderDialog = Boolean(\n\t\tcanUseSelector && selector && SelectorComponent,\n\t);\n\tconst hasCustomViewAction = viewAction !== undefined;\n\tlet viewActionContent: ReactNode = null;\n\n\tif (hasResource && hasCustomViewAction) {\n\t\tviewActionContent = viewAction;\n\t} else if (hasResource && viewLink) {\n\t\tviewActionContent = (\n\t\t\t<CardPrimaryAction href={viewLink.href} icon={Eye}>\n\t\t\t\t{viewLink.label}\n\t\t\t</CardPrimaryAction>\n\t\t);\n\t}\n\n\tconst viewActionNode = viewActionContent === null || viewActionContent === false\n\t\t? null\n\t\t: (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'shared-resource-card--view-action',\n\t\t\t\t\t!hasCustomViewAction && viewLink?.className,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{viewActionContent}\n\t\t\t</div>\n\t\t);\n\tconst dialogNode =\n\t\tshouldRenderDialog && selector && SelectorComponent ? (\n\t\t<ActionDialog\n\t\t\t\topen={selectorContext.isSelectorOpen}\n\t\t\t\tonOpenChange={(open) => {\n\t\t\t\t\tif (!open) {\n\t\t\t\t\t\tselectorContext.closeSelector();\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\ttitle={selector.title}\n\t\t\t\tdescription={selector.description}\n\t\t\t\tsize={selector.dialogSize ?? '2xl'}\n\t\t\t\tshowCancel={false}\n\t\t\t\tshowConfirm={false}\n\t\t\t\tfooter={\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\tjustify=\"end\"\n\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={selectorContext.closeSelector}\n\t\t\t\t\t\t\tdisabled={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.cancelText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tvoid selectorContext.confirmSelection();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t!selectorContext.canConfirmSelection ||\n\t\t\t\t\t\t\t\tselectorContext.isConfirming\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tloading={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.confirmText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Stack gap=\"lg\" className=\"shared-resource-card--dialog-body\">\n\t\t\t\t\t{DialogContentComponent ? (\n\t\t\t\t\t\t<DialogContentComponent\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\t{...dialogContentProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogContent<TResource, TSuggestion, TSelectorProps>\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{DialogSummaryComponent ? (\n\t\t\t\t\t\t<DialogSummaryComponent context={selectorContext} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogSummary\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\tgetSelectionLabel={selector.getSelectionLabel}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t</ActionDialog>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t<ContentBlock\n\t\t\t\ticon={icon}\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description}\n\t\t\t\tdata-state={hasResource ? 'selected' : 'empty'}\n\t\t\t\tclassName={cn('shared-resource-card--component', className)}\n\t\t\t\tcontentGap=\"lg\"\n\t\t\t\tcontentClassName={contentClassName}\n\t\t\t\talert={alert}\n\t\t\t\talertTone={alertTone}\n\t\t\t\tactions={resolvedActions}\n\t\t\t\theaderAction={resolvedHeaderAction}\n\t\t\t\tfooterText={footerText}\n\t\t\t>\n\t\t\t\t{cardBody}\n\t\t\t\t{viewActionNode}\n\t\t\t</ContentBlock>\n\t\t\t{dialogNode}\n\t\t</>\n\t);\n}\n\nSharedResourceCard.displayName = 'SharedResourceCard';\n"],"mappings":";;;;;;;;;;;;;;AAkBA,IAAaU,IAA8D;CAC1E,mBAAmB;CACnB,mBAAmB;CACnB,oBAAoB;CACpB,cAAc;AACf;;;ACcA,SAAgBC,EAA8C,EAC7D,aACA,uBACA,uBACA,sBACA,iBACA,kBACA,YACA,SACA,iBAAc,IACd,iBACA,UACA,iBACA,oBAC6G;CAC7G,IAAM,CAACC,GAAcC,KAAmBC,EAASC,CAAW,GACtD,CAACC,GAAcC,KAAmBH,EAAS,EAAK,GAChD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AACrE,GAAD;GACC,WAAW;IAAE,MAAM;IAAY,IAAI;GAAa;GAChD,KAAI;GACJ,OAAO;IAAE,MAAM;IAAW,IAAI;GAAS;GACvC,SAAQ;GACR,WAAU;GALX,UAAA,CAOC,kBAACD,GAAD;IACC,MAAK;IACL,aAAY;IACZ,SAASqE,EAAgB;IACzB,UAAUA,EAAgB;IAC1B,MAAK;IAEJ,UAAAC,EAAS;GACH,CAAA,GACR,kBAACtE,GAAD;IAAQ,MAAK;IACZ,eAAe;KACd,EAAqB,iBAAiB;IACvC;IACA,UACC,CAACqE,EAAgB,uBACjBA,EAAgB;IAEjB,SAASA,EAAgB;IACzB,MAAK;IAEJ,UAAAC,EAAS;GACH,CAAA,CACF;;EAGR,UAAA,kBAACrE,GAAD;GAAO,KAAI;GAAK,WAAU;GAA1B,UAAA,CACE4F,IACA,kBAACA,GAAD;IACoB;IACJ;IACf,SAASxB;IACT,GAAI0B;GACJ,CAAA,IAED,kBAAChC,GAAD;IACoB;IACJ;IACf,SAASM;GACT,CAAA,GAGDyB,IACA,kBAACA,GAAD,EAAwB,SAASzB,EAAkB,CAAA,IAEnD,kBAACnB,GAAD;IACC,SAASmB;IACA;IACT,mBAAmBC,EAAS;GAC5B,CAAA,CAEI;;CACK,CAAA,IACV;CAEL,OACC,kBAAA1E,GAAA,EAAA,UAAA,CACC,kBAACQ,GAAD;EACO;EACC;EACM;EACb,cAAYmB,IAAc,aAAa;EACvC,WAAWiF,EAAG,mCAAmCE,CAAS;EAC1D,YAAW;EACO;EACX;EACI;EACX,SAAS1B;EACT,cAAcE;EACF;EAZb,UAAA,CAcEc,IACAO,EACY;CACb,CAAA,GAAAE,EACA,EAAA,CAAA;AAEJ;AAEA,EAAmB,cAAc"}
1
+ {"version":3,"file":"resource-assignment.js","names":["_Fragment","ContentComponent","DisplayLabel","Text","Stack","CardPrimaryAction","ActionDialog","ContentBlock","EmptyState","Fragment$1","defaultSharedResourceCardStrings","useSharedResourceCard","internalOpen","setInternalOpen","useState","defaultOpen","isConfirming","setIsConfirming","internalSelectedSuggestion","setInternalSelectedSuggestion","defaultValue","isOpenControlled","open","isValueControlled","value","isSelectorOpen","selectedSuggestion","hasResource","resource","initializedOpenCycleRef","useRef","hasOpenedRef","hasExplicitDefaultValueRef","setSelectorOpen","useCallback","nextOpen","onOpenChange","setSelectedSuggestion","selection","onValueChange","openSelector","isFirstOpen","initial","mapInitialSelected","onDialogOpen","closeSelector","onDialogClose","canConfirmSelection","useMemo","isConfirmDisabled","confirmSelection","onConfirmSelection","error","onError","DefaultDialogSummary","useStrings","strings","selected","context","label","getSelectionLabel","DefaultResourceContent","_context","s","DefaultEmptyContent","PackageOpen","Button","DefaultDialogContent","componentProps","selectorProps","SelectorComponent","SharedResourceCard","stringsProp","selectorContext","selector","canUseSelector","selectorActionLabel","visibleBaseActionCount","actions","action","usesDefaultEmptyAction","renderEmptyContent","EmptyContentComponent","shouldInlineSelectorAction","resolvedActions","baseActions","resolvedHeaderAction","headerAction","resourceContent","renderResourceContent","ResourceContentComponent","sections","visibleSections","section","sectionsClassName","SectionComponent","emptyContent","DialogContentComponent","DialogSummaryComponent","dialogContentProps","cardBody","shouldRenderDialog","hasCustomViewAction","viewAction","viewActionContent","viewLink","Eye","viewActionNode","cn","dialogNode","className"],"sources":["../../src/components/features/resource-assignment/resource-assignment.strings.ts","../../src/components/features/resource-assignment/hooks/use-shared-resource-card.ts","../../src/components/features/resource-assignment/partials/default-shared-resource-partials.tsx","../../src/components/features/resource-assignment/resource-assignment.tsx"],"sourcesContent":["/**\n * Default user-facing strings for the resource-assignment feature.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <SharedResourceCard\n * strings={{ noResourceSelected: t('resourceAssignment.empty') }}\n * …\n * />\n */\n\nexport interface SharedResourceCardStrings {\n\tcurrentlySelected: string;\n\tnoResourceContent: string;\n\tnoResourceSelected: string;\n\tchangeAction: string;\n}\n\nexport const defaultSharedResourceCardStrings: SharedResourceCardStrings = {\n\tcurrentlySelected: 'Currently selected:',\n\tnoResourceContent: 'No resource content configured.',\n\tnoResourceSelected: 'No resource selected.',\n\tchangeAction: 'Change',\n};\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport type { SharedResourceCardContext } from '../resource-assignment.types';\n\nexport type UseSharedResourceCardOptions<TResource, TSuggestion> = {\n\t/** Persisted assignment. `null` is the only empty state. */\n\tresource: TResource | null;\n\t/** Map persisted data when neither `value` nor first-open `defaultValue` supplies selection. */\n\tmapInitialSelected: (resource: TResource | null) => TSuggestion | null;\n\t/** Persist a confirmed suggestion. Returned promises are awaited. */\n\tonConfirmSelection: (selection: TSuggestion) => void | Promise<void>;\n\t/** Disable confirmation for a pending candidate. */\n\tisConfirmDisabled?: (selection: TSuggestion | null) => boolean;\n\t/** Called once per closed-to-open cycle, including an initially open selector. */\n\tonDialogOpen?: (selection: TSuggestion | null) => void;\n\t/** Called after selection mode closes or confirmation succeeds. */\n\tonDialogClose?: () => void;\n\t/** Called when `onConfirmSelection` throws. Library DEV-logs the error;\n\t * consumer wires telemetry. */\n\tonError?: (error: unknown, selection: TSuggestion) => void;\n\t/** Controlled selector visibility. An initial `true` value initializes selection. */\n\topen?: boolean;\n\t/** Initial selector visibility; `true` initializes selection after mount. */\n\tdefaultOpen?: boolean;\n\t/** Controlled visibility callback and uncontrolled visibility observer. */\n\tonOpenChange?: (open: boolean) => void;\n\t/** Controlled pending suggestion; authoritative over mapping on every open. */\n\tvalue?: TSuggestion | null;\n\t/** Initial uncontrolled suggestion; authoritative over mapping on the first open. */\n\tdefaultValue?: TSuggestion | null;\n\t/** Controlled selection callback and uncontrolled selection observer. */\n\tonValueChange?: (selection: TSuggestion | null) => void;\n};\n\nexport type UseSharedResourceCardResult<TResource, TSuggestion> =\n\tSharedResourceCardContext<TResource, TSuggestion>;\n\nexport function useSharedResourceCard<TResource, TSuggestion>({\n\tresource,\n\tmapInitialSelected,\n\tonConfirmSelection,\n\tisConfirmDisabled,\n\tonDialogOpen,\n\tonDialogClose,\n\tonError,\n\topen,\n\tdefaultOpen = false,\n\tonOpenChange,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n}: UseSharedResourceCardOptions<TResource, TSuggestion>): UseSharedResourceCardResult<TResource, TSuggestion> {\n\tconst [internalOpen, setInternalOpen] = useState(defaultOpen);\n\tconst [isConfirming, setIsConfirming] = useState(false);\n\tconst [internalSelectedSuggestion, setInternalSelectedSuggestion] =\n\t\tuseState<TSuggestion | null>(defaultValue ?? null);\n\tconst isOpenControlled = open !== undefined;\n\tconst isValueControlled = value !== undefined;\n\tconst isSelectorOpen = isOpenControlled ? open : internalOpen;\n\tconst selectedSuggestion = isValueControlled ? value : internalSelectedSuggestion;\n\tconst hasResource = resource !== null;\n\tconst initializedOpenCycleRef = useRef(false);\n\tconst hasOpenedRef = useRef(false);\n\tconst hasExplicitDefaultValueRef = useRef(defaultValue !== undefined);\n\n\tconst setSelectorOpen = useCallback((nextOpen: boolean) => {\n\t\tif (!isOpenControlled) setInternalOpen(nextOpen);\n\t\tonOpenChange?.(nextOpen);\n\t}, [isOpenControlled, onOpenChange]);\n\n\tconst setSelectedSuggestion = useCallback((selection: TSuggestion | null) => {\n\t\tif (!isValueControlled) setInternalSelectedSuggestion(selection);\n\t\tonValueChange?.(selection);\n\t}, [isValueControlled, onValueChange]);\n\n\tconst openSelector = useCallback(() => {\n\t\tsetSelectorOpen(true);\n\t}, [setSelectorOpen]);\n\n\tuseEffect(() => {\n\t\tif (!isSelectorOpen) {\n\t\t\tinitializedOpenCycleRef.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (initializedOpenCycleRef.current) {\n\t\t\treturn;\n\t\t}\n\n\t\tinitializedOpenCycleRef.current = true;\n\t\tconst isFirstOpen = !hasOpenedRef.current;\n\t\tlet initial: TSuggestion | null;\n\n\t\tif (isValueControlled) {\n\t\t\tinitial = value;\n\t\t} else if (isFirstOpen && hasExplicitDefaultValueRef.current) {\n\t\t\tinitial = internalSelectedSuggestion;\n\t\t} else {\n\t\t\tinitial = mapInitialSelected(resource);\n\t\t\tsetSelectedSuggestion(initial);\n\t\t}\n\n\t\thasOpenedRef.current = true;\n\t\tonDialogOpen?.(initial);\n\t}, [\n\t\tinternalSelectedSuggestion,\n\t\tisSelectorOpen,\n\t\tisValueControlled,\n\t\tmapInitialSelected,\n\t\tonDialogOpen,\n\t\tresource,\n\t\tsetSelectedSuggestion,\n\t\tvalue,\n\t]);\n\n\tconst closeSelector = useCallback(() => {\n\t\tif (isConfirming) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectorOpen(false);\n\t\tsetSelectedSuggestion(null);\n\t\tonDialogClose?.();\n\t}, [isConfirming, onDialogClose, setSelectedSuggestion, setSelectorOpen]);\n\n\tconst canConfirmSelection = useMemo(() => {\n\t\tif (selectedSuggestion === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!isConfirmDisabled) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn !isConfirmDisabled(selectedSuggestion);\n\t}, [isConfirmDisabled, selectedSuggestion]);\n\n\tconst confirmSelection = useCallback(async () => {\n\t\tif (\n\t\t\tisConfirming ||\n\t\t\t!canConfirmSelection ||\n\t\t\tselectedSuggestion === null\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsConfirming(true);\n\n\t\ttry {\n\t\t\tawait onConfirmSelection(selectedSuggestion);\n\t\t\tsetSelectorOpen(false);\n\t\t\tsetSelectedSuggestion(null);\n\t\t\tonDialogClose?.();\n\t\t} catch (error) {\n\t\t\tif (import.meta.env?.DEV) {\n\t\t\t\tconsole.warn('SharedResourceCard confirmation failed:', error);\n\t\t\t}\n\t\t\tonError?.(error, selectedSuggestion);\n\t\t} finally {\n\t\t\tsetIsConfirming(false);\n\t\t}\n\t}, [\n\t\tcanConfirmSelection,\n\t\tisConfirming,\n\t\tonConfirmSelection,\n\t\tonDialogClose,\n\t\tonError,\n\t\tselectedSuggestion,\n\t\tsetSelectedSuggestion,\n\t\tsetSelectorOpen,\n\t]);\n\n\treturn useMemo(\n\t\t() => ({\n\t\t\tresource,\n\t\t\thasResource,\n\t\t\tisSelectorOpen,\n\t\t\tisConfirming,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t\topenSelector,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\tcanConfirmSelection,\n\t\t}),\n\t\t[\n\t\t\tcanConfirmSelection,\n\t\t\tcloseSelector,\n\t\t\tconfirmSelection,\n\t\t\thasResource,\n\t\t\tisConfirming,\n\t\t\tisSelectorOpen,\n\t\t\topenSelector,\n\t\t\tresource,\n\t\t\tselectedSuggestion,\n\t\t\tsetSelectedSuggestion,\n\t\t],\n\t);\n}\n","import { Stack } from '../../../base/structure';\n/**\n * Default partial implementations for `<SharedResourceCard>`.\n *\n * Consumers can override any of these by passing\n * `ResourceContentComponent` / `EmptyContentComponent` /\n * `selector.DialogContentComponent` / `selector.DialogSummaryComponent`\n * to `<SharedResourceCard>`. Strings flow through the `strings` prop\n * deep-merged over `defaultSharedResourceCardStrings`.\n */\nimport { Button } from '../../../base/buttons';\nimport { EmptyState } from '../../../blocks/data-display';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { PackageOpen } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { defaultSharedResourceCardStrings, type SharedResourceCardStrings } from '../resource-assignment.strings';\nimport type {\n\tSharedResourceCardContentProps,\n\tSharedResourceCardDialogContentProps,\n\tSharedResourceCardDialogSummaryProps,\n\tSharedResourceSelectorComponentProps,\n} from '../resource-assignment.types';\n\ntype DefaultStrings = StringsProp<SharedResourceCardStrings>;\n\nexport function DefaultDialogSummary<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n\tgetSelectionLabel,\n}: SharedResourceCardDialogSummaryProps<TResource, TSuggestion> & {\n\t/** Overrides this surface's own copy. */\n\tstrings?: DefaultStrings;\n\t/** Builds the summary shown for the current selection. */\n\tgetSelectionLabel?: (selection: TSuggestion) => ReactNode;\n}) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\tconst selected = context.selectedSuggestion;\n\n\tif (selected === null) {\n\t\treturn null;\n\t}\n\n\tconst label = getSelectionLabel?.(selected) ?? (\n\t\ttypeof selected === 'object' &&\n\t\tselected !== null &&\n\t\t'label' in selected &&\n\t\ttypeof selected.label === 'string'\n\t\t\t? selected.label\n\t\t\t: null\n\t);\n\n\tif (label === null || label === undefined || label === '') {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"default-dialog-summary--component shared-resource-card--dialog-summary\">\n\t\t\t<DisplayLabel>{s.currentlySelected}</DisplayLabel>\n\t\t\t<Text>{label}</Text>\n\t\t</Stack>\n\t);\n}\nDefaultDialogSummary.displayName = 'DefaultDialogSummary';\n\nexport function DefaultResourceContent<TResource, TSuggestion>({\n\tcontext: _context,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn <Text type=\"secondary\" className=\"default-resource-content--component\">{s.noResourceContent}</Text>;\n}\nDefaultResourceContent.displayName = 'DefaultResourceContent';\n\nexport function DefaultEmptyContent<TResource, TSuggestion>({\n\tcontext,\n\tstrings,\n}: SharedResourceCardContentProps<TResource, TSuggestion> & { strings?: DefaultStrings }) {\n\tconst s = useStrings(defaultSharedResourceCardStrings, strings);\n\treturn (\n\t\t<EmptyState\n\t\t\ttitle={s.noResourceSelected}\n\t\t\tdescription={false}\n\t\t\tmedia={<PackageOpen className=\"size-icon\" />}\n\t\t\tmediaVariant=\"icon-soft\"\n\t\t\tactions={<Button\n\t\t\t\ttone=\"secondary\"\n\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\tonClick={context.openSelector}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{s.changeAction}\n\t\t\t</Button>}\n\t\t\tclassName=\"default-empty-content--component\"\n\t\t/>\n\t);\n}\nDefaultEmptyContent.displayName = 'DefaultEmptyContent';\n\nexport function DefaultDialogContent<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\tSelectorComponent,\n\tselectorProps,\n\tcontext,\n}: SharedResourceCardDialogContentProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst componentProps = {\n\t\t...(selectorProps ?? {} as TSelectorProps),\n\t\tonSelect: context.setSelectedSuggestion,\n\t\tselected: context.selectedSuggestion,\n\t\tinModal: true,\n\t\tlockOnSelect: false,\n\t\tcontext: 'dialog' as const,\n\t} as SharedResourceSelectorComponentProps<TSuggestion, TSelectorProps>;\n\n\treturn (\n\t\t<div className=\"default-dialog-content--component\">\n\t\t\t<SelectorComponent {...componentProps} />\n\t\t</div>\n\t);\n}\nDefaultDialogContent.displayName = 'DefaultDialogContent';\n","import { Eye } from 'lucide-react';\nimport { type ReactNode, useMemo } from 'react';\n\nimport { Button } from '../../base/buttons';\nimport { CardPrimaryAction } from '../../base/cards';\nimport { ContentBlock } from '../../base/display';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { ActionDialog } from '../overlays';\nimport { useStrings } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { defaultSharedResourceCardStrings } from './resource-assignment.strings';\nimport { type SharedResourceCardProps } from './resource-assignment.types';\nimport { useSharedResourceCard } from './hooks';\nimport {\n\tDefaultDialogContent,\n\tDefaultDialogSummary,\n\tDefaultEmptyContent,\n\tDefaultResourceContent,\n} from './partials';\n\n/**\n * Stateful, card-free relationship assignment workflow.\n *\n * Consumers own persisted resources, selector data, mutations, routing, and\n * translations. The feature owns pending selection, confirmation state,\n * failure handling, and the default assignment presentation.\n */\nexport function SharedResourceCard<\n\tTResource,\n\tTSuggestion,\n\tTSelectorProps extends object = Record<never, never>,\n>({\n\ticon,\n\ttitle,\n\tdescription,\n\tclassName,\n\tcontentClassName,\n\talert,\n\talertTone,\n\tactions,\n\theaderAction,\n\tfooterText,\n\tresource,\n\tselector,\n\tsections,\n\tsectionsClassName,\n\tviewAction,\n\tviewLink,\n\tResourceContentComponent,\n\tEmptyContentComponent,\n\trenderResourceContent,\n\trenderEmptyContent,\n\tstrings: stringsProp,\n}: SharedResourceCardProps<TResource, TSuggestion, TSelectorProps>) {\n\tconst strings = useStrings(defaultSharedResourceCardStrings, stringsProp);\n\tconst selectorContext = useSharedResourceCard<TResource, TSuggestion>({\n\t\tresource,\n\t\tmapInitialSelected:\n\t\t\tselector?.mapInitialSelected ?? (() => null as TSuggestion | null),\n\t\tonConfirmSelection:\n\t\t\tselector?.onConfirmSelection ?? (() => undefined),\n\t\tisConfirmDisabled: selector?.isConfirmDisabled,\n\t\tonDialogOpen: selector?.onDialogOpen,\n\t\tonDialogClose: selector?.onDialogClose,\n\t\tonError: selector?.onError,\n\t\topen: selector?.open,\n\t\tdefaultOpen: selector?.defaultOpen,\n\t\tonOpenChange: selector?.onOpenChange,\n\t\tvalue: selector?.value,\n\t\tdefaultValue: selector?.defaultValue,\n\t\tonValueChange: selector?.onValueChange,\n\t});\n\n\tconst canUseSelector = selector !== undefined;\n\tconst selectorActionLabel = selector?.actionLabel?.trim();\n\tconst visibleBaseActionCount = actions?.filter((action) => action.visible !== false).length ?? 0;\n\t// The default empty state already carries the selector call to action, so\n\t// the header does not repeat it until a resource is assigned.\n\tconst usesDefaultEmptyAction = canUseSelector\n\t\t&& !selectorContext.hasResource\n\t\t&& !renderEmptyContent\n\t\t&& !EmptyContentComponent;\n\tconst shouldInlineSelectorAction = Boolean(\n\t\tcanUseSelector && selectorActionLabel && visibleBaseActionCount === 0 && !usesDefaultEmptyAction,\n\t);\n\tconst resolvedActions = useMemo(() => {\n\t\tconst baseActions = actions ?? [];\n\n\t\tif (!canUseSelector || !selectorActionLabel || usesDefaultEmptyAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\tif (shouldInlineSelectorAction) {\n\t\t\treturn baseActions.length > 0 ? baseActions : undefined;\n\t\t}\n\n\t\treturn [\n\t\t\t...baseActions,\n\t\t\t{\n\t\t\t\tid: 'shared-resource-selector-change',\n\t\t\t\tlabel: selectorActionLabel,\n\t\t\t\tonClick: selectorContext.openSelector,\n\t\t\t},\n\t\t];\n\t}, [\n\t\tactions,\n\t\tcanUseSelector,\n\t\tselectorActionLabel,\n\t\tselectorContext.openSelector,\n\t\tshouldInlineSelectorAction,\n\t\tusesDefaultEmptyAction,\n\t]);\n\tconst resolvedHeaderAction = headerAction || shouldInlineSelectorAction ? (\n\t\t<>\n\t\t\t{headerAction}\n\t\t\t{shouldInlineSelectorAction && (\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\tsize=\"sm\"\n\t\t\t\t\tonClick={selectorContext.openSelector}\n\t\t\t\t\tclassName=\"shared-resource-card--selector-action\"\n\t\t\t\t>\n\t\t\t\t\t{selectorActionLabel}\n\t\t\t\t</Button>\n\t\t\t)}\n\t\t</>\n\t) : undefined;\n\n\tconst resourceContent: ReactNode = useMemo(() => {\n\t\tif (renderResourceContent) {\n\t\t\treturn renderResourceContent(selectorContext);\n\t\t}\n\n\t\tif (ResourceContentComponent) {\n\t\t\tconst ContentComponent = ResourceContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (Array.isArray(sections) && sections.length > 0) {\n\t\t\tconst visibleSections = sections.filter((section) => {\n\t\t\t\treturn section.when ? section.when(selectorContext) : true;\n\t\t\t});\n\n\t\t\tif (visibleSections.length > 0) {\n\t\t\t\treturn (\n\t\t\t\t\t<div className={sectionsClassName ?? 'grid gap-space-lg'}>\n\t\t\t\t\t\t{visibleSections.map((section) => {\n\t\t\t\t\t\t\tconst SectionComponent = section.Component;\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div key={section.id} className={section.className}>\n\t\t\t\t\t\t\t\t\t<SectionComponent context={selectorContext} />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn <DefaultResourceContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tResourceContentComponent,\n\t\trenderResourceContent,\n\t\tsections,\n\t\tsectionsClassName,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst emptyContent: ReactNode = useMemo(() => {\n\t\tif (renderEmptyContent) {\n\t\t\treturn renderEmptyContent(selectorContext);\n\t\t}\n\n\t\tif (EmptyContentComponent) {\n\t\t\tconst ContentComponent = EmptyContentComponent;\n\t\t\treturn <ContentComponent context={selectorContext} />;\n\t\t}\n\n\t\tif (!canUseSelector) {\n\t\t\treturn <Text type=\"secondary\">{strings.noResourceSelected}</Text>;\n\t\t}\n\n\t\treturn <DefaultEmptyContent context={selectorContext} strings={strings} />;\n\t}, [\n\t\tEmptyContentComponent,\n\t\tcanUseSelector,\n\t\trenderEmptyContent,\n\t\tselectorContext,\n\t\tstrings,\n\t]);\n\n\tconst DialogContentComponent = selector?.DialogContentComponent;\n\tconst DialogSummaryComponent = selector?.DialogSummaryComponent;\n\tconst SelectorComponent = selector?.SelectorComponent;\n\tconst selectorProps = selector?.selectorProps;\n\tconst dialogContentProps = selector?.dialogContentProps ?? {};\n\tconst hasResource = selectorContext.hasResource;\n\tconst cardBody = hasResource ? resourceContent : emptyContent;\n\tconst shouldRenderDialog = Boolean(\n\t\tcanUseSelector && selector && SelectorComponent,\n\t);\n\tconst hasCustomViewAction = viewAction !== undefined;\n\tlet viewActionContent: ReactNode = null;\n\n\tif (hasResource && hasCustomViewAction) {\n\t\tviewActionContent = viewAction;\n\t} else if (hasResource && viewLink) {\n\t\tviewActionContent = (\n\t\t\t<CardPrimaryAction href={viewLink.href} icon={Eye}>\n\t\t\t\t{viewLink.label}\n\t\t\t</CardPrimaryAction>\n\t\t);\n\t}\n\n\tconst viewActionNode = viewActionContent === null || viewActionContent === false\n\t\t? null\n\t\t: (\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'shared-resource-card--view-action',\n\t\t\t\t\t!hasCustomViewAction && viewLink?.className,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{viewActionContent}\n\t\t\t</div>\n\t\t);\n\tconst dialogNode =\n\t\tshouldRenderDialog && selector && SelectorComponent ? (\n\t\t<ActionDialog\n\t\t\t\topen={selectorContext.isSelectorOpen}\n\t\t\t\tonOpenChange={(open) => {\n\t\t\t\t\tif (!open) {\n\t\t\t\t\t\tselectorContext.closeSelector();\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\ttitle={selector.title}\n\t\t\t\tdescription={selector.description}\n\t\t\t\tsize={selector.dialogSize ?? '2xl'}\n\t\t\t\tshowCancel={false}\n\t\t\t\tshowConfirm={false}\n\t\t\t\tfooter={\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"sm\"\n\t\t\t\t\t\talign={{ base: 'stretch', sm: 'center' }}\n\t\t\t\t\t\tjustify=\"end\"\n\t\t\t\t\t\tclassName=\"w-full\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"outline\"\n\t\t\t\t\t\t\tonClick={selectorContext.closeSelector}\n\t\t\t\t\t\t\tdisabled={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.cancelText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button tone=\"primary\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tvoid selectorContext.confirmSelection();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t!selectorContext.canConfirmSelection ||\n\t\t\t\t\t\t\t\tselectorContext.isConfirming\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tloading={selectorContext.isConfirming}\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{selector.confirmText}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Stack gap=\"lg\" className=\"shared-resource-card--dialog-body\">\n\t\t\t\t\t{DialogContentComponent ? (\n\t\t\t\t\t\t<DialogContentComponent\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\t{...dialogContentProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogContent<TResource, TSuggestion, TSelectorProps>\n\t\t\t\t\t\t\tSelectorComponent={SelectorComponent}\n\t\t\t\t\t\t\tselectorProps={selectorProps}\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{DialogSummaryComponent ? (\n\t\t\t\t\t\t<DialogSummaryComponent context={selectorContext} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DefaultDialogSummary\n\t\t\t\t\t\t\tcontext={selectorContext}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t\tgetSelectionLabel={selector.getSelectionLabel}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t</ActionDialog>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t<ContentBlock\n\t\t\t\ticon={icon}\n\t\t\t\ttitle={title}\n\t\t\t\tdescription={description}\n\t\t\t\tdata-state={hasResource ? 'selected' : 'empty'}\n\t\t\t\tclassName={cn('shared-resource-card--component', className)}\n\t\t\t\tcontentGap=\"lg\"\n\t\t\t\tcontentClassName={contentClassName}\n\t\t\t\talert={alert}\n\t\t\t\talertTone={alertTone}\n\t\t\t\tactions={resolvedActions}\n\t\t\t\theaderAction={resolvedHeaderAction}\n\t\t\t\tfooterText={footerText}\n\t\t\t>\n\t\t\t\t{cardBody}\n\t\t\t\t{viewActionNode}\n\t\t\t</ContentBlock>\n\t\t\t{dialogNode}\n\t\t</>\n\t);\n}\n\nSharedResourceCard.displayName = 'SharedResourceCard';\n"],"mappings":";;;;;;;;;;;;;;AAkBA,IAAaU,IAA8D;CAC1E,mBAAmB;CACnB,mBAAmB;CACnB,oBAAoB;CACpB,cAAc;AACf;;;ACcA,SAAgBC,EAA8C,EAC7D,aACA,uBACA,uBACA,sBACA,iBACA,kBACA,YACA,SACA,iBAAc,IACd,iBACA,UACA,iBACA,oBAC6G;CAC7G,IAAM,CAACC,GAAcC,KAAmBC,EAASC,CAAW,GACtD,CAACC,GAAcC,KAAmBH,EAAS,EAAK,GAChD,CAACI,GAA4BC,KAClCL,EAA6BM,KAAgB,IAAI,GAC5CC,IAAmBC,MAAS,KAAA,GAC5BC,IAAoBC,MAAU,KAAA,GAC9BC,IAAiBJ,IAAmBC,IAAOV,GAC3Cc,IAAqBH,IAAoBC,IAAQN,GACjDS,IAAcC,MAAa,MAC3BC,IAA0BC,EAAO,EAAK,GACtCC,IAAeD,EAAO,EAAK,GAC3BE,IAA6BF,EAAOV,MAAiB,KAAA,CAAS,GAE9Da,IAAkBC,GAAa,MAAsB;EAE1D,AADKb,KAAkBR,EAAgBsB,CAAQ,GAC/CC,IAAeD,CAAQ;CACxB,GAAG,CAACd,GAAkBe,CAAY,CAAC,GAE7BC,IAAwBH,GAAa,MAAkC;EAE5E,AADKX,KAAmBJ,EAA8BmB,CAAS,GAC/DC,IAAgBD,CAAS;CAC1B,GAAG,CAACf,GAAmBgB,CAAa,CAAC,GAE/BC,IAAeN,QAAkB;EACtC,EAAgB,EAAI;CACrB,GAAG,CAACD,CAAe,CAAC;CAEpB,QAA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