themelia-react-ui 1.0.2 → 2.0.0

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 (542) hide show
  1. package/CHANGELOG.md +281 -1
  2. package/README.md +10 -5
  3. package/dist/{accordion-BRTcsp8J.js → accordion-CQXVcd7Q.js} +13 -13
  4. package/dist/accordion-CQXVcd7Q.js.map +1 -0
  5. package/dist/action-menu-BTpyPWJ2.js +264 -0
  6. package/dist/action-menu-BTpyPWJ2.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-CCIXb2A1.js} +7 -2
  8. package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
  9. package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-2PQ2fItc.js} +171 -176
  10. package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
  11. package/dist/{app-shell-C_fKpljx.js → app-shell-BE_j8-AT.js} +4 -4
  12. package/dist/{app-shell-C_fKpljx.js.map → app-shell-BE_j8-AT.js.map} +1 -1
  13. package/dist/{attachment-DbjUWsP0.js → attachment-q69dlt5Y.js} +9 -9
  14. package/dist/{attachment-DbjUWsP0.js.map → attachment-q69dlt5Y.js.map} +1 -1
  15. package/dist/{auth-CAQcasMV.js → auth-M3vGMgDR.js} +42 -42
  16. package/dist/{auth-CAQcasMV.js.map → auth-M3vGMgDR.js.map} +1 -1
  17. package/dist/{avatar-Bu2HhitA.js → avatar-djdaaQ_s.js} +14 -12
  18. package/dist/avatar-djdaaQ_s.js.map +1 -0
  19. package/dist/{badge-CzId1Wlm.js → badge-0tATj-tW.js} +9 -9
  20. package/dist/badge-0tATj-tW.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/buttons.js +2 -2
  27. package/dist/base/cards.js +2 -2
  28. package/dist/base/carousel.js +11 -11
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +244 -222
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +1 -1
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +2 -2
  39. package/dist/base/display.js +6 -6
  40. package/dist/base/feedback.js +3 -3
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +81 -76
  44. package/dist/base/inline-edit.js.map +1 -1
  45. package/dist/base/item.js +1 -1
  46. package/dist/base/media-gallery.js +1 -1
  47. package/dist/base/navigation.js +6 -6
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +7 -4
  51. package/dist/base/qr-code.js.map +1 -1
  52. package/dist/base/repeaters.js +42 -42
  53. package/dist/base/repeaters.js.map +1 -1
  54. package/dist/base/sheet.js +1 -1
  55. package/dist/base/sidebar.js +1 -1
  56. package/dist/base/signature-pad.js +9 -9
  57. package/dist/base/signature-pad.js.map +1 -1
  58. package/dist/base/skeleton.js +1 -1
  59. package/dist/base/spinner.js +1 -1
  60. package/dist/base/structure.js +1 -1
  61. package/dist/base/table.js +1 -1
  62. package/dist/base/text-inputs.js +2 -2
  63. package/dist/base/toaster.js +4 -4
  64. package/dist/base/toaster.js.map +1 -1
  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 +1 -1
  69. package/dist/blocks/admin.js +229 -220
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +147 -180
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +530 -523
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +1 -1
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1390 -1516
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +1 -1
  81. package/dist/blocks/onboarding.js +5 -5
  82. package/dist/blocks/planning.js +82 -91
  83. package/dist/blocks/planning.js.map +1 -1
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-BuYz5SDU.js → breadcrumbs-BG_FfMK4.js} +5 -5
  86. package/dist/{breadcrumbs-BuYz5SDU.js.map → breadcrumbs-BG_FfMK4.js.map} +1 -1
  87. package/dist/{button-BZDasD04.js → button-BS3KDg00.js} +185 -162
  88. package/dist/button-BS3KDg00.js.map +1 -0
  89. package/dist/{button-BZyfTvwm.js → button-R9CCoH7A.js} +2 -2
  90. package/dist/{button-BZyfTvwm.js.map → button-R9CCoH7A.js.map} +1 -1
  91. package/dist/{buttons-D_6KJvEE.js → buttons-DS0ZIwJ_.js} +11 -11
  92. package/dist/buttons-DS0ZIwJ_.js.map +1 -0
  93. package/dist/{cards-qGSErLw_.js → cards-QoJ4syG9.js} +7 -7
  94. package/dist/{cards-qGSErLw_.js.map → cards-QoJ4syG9.js.map} +1 -1
  95. package/dist/{chart-Bsc5BICK.js → chart-DwYRKKc-.js} +17 -15
  96. package/dist/chart-DwYRKKc-.js.map +1 -0
  97. package/dist/checkbox-B7ygNTYp.js +35 -0
  98. package/dist/checkbox-B7ygNTYp.js.map +1 -0
  99. package/dist/choice-inputs-DrJ17tpL.js +752 -0
  100. package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
  101. package/dist/{code-block-DzHKRybS.js → code-block-CD0B7M93.js} +19 -19
  102. package/dist/{code-block-DzHKRybS.js.map → code-block-CD0B7M93.js.map} +1 -1
  103. package/dist/{collapsible-ClvC7Bj3.js → collapsible-oMUGM4tr.js} +3 -3
  104. package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-oMUGM4tr.js.map} +1 -1
  105. package/dist/{collection-content-D6S8cv_n.js → collection-content-Ys-OZOkY.js} +3 -3
  106. package/dist/{collection-content-D6S8cv_n.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
  107. package/dist/{combobox-BFnbJJp3.js → combobox-6dvVny2q.js} +96 -97
  108. package/dist/combobox-6dvVny2q.js.map +1 -0
  109. package/dist/{combobox-hozNwUcc.js → combobox-CB7039j7.js} +326 -308
  110. package/dist/combobox-CB7039j7.js.map +1 -0
  111. package/dist/{command-BnmSchli.js → command-kPMPjIxJ.js} +34 -30
  112. package/dist/command-kPMPjIxJ.js.map +1 -0
  113. package/dist/{comments-u5L0OGip.js → comments-You0Bzbr.js} +349 -348
  114. package/dist/comments-You0Bzbr.js.map +1 -0
  115. package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
  116. package/dist/components/base/action-menu/action-menu.d.ts +7 -2
  117. package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
  118. package/dist/components/base/badge/badge.d.ts +1 -1
  119. package/dist/components/base/badge/badge.recipes.d.ts +4 -4
  120. package/dist/components/base/buttons/base-button.d.ts +7 -0
  121. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  122. package/dist/components/base/buttons/button.variants.d.ts +1 -0
  123. package/dist/components/base/buttons/loader-button.d.ts +3 -1
  124. package/dist/components/base/buttons/text-button.d.ts +2 -2
  125. package/dist/components/base/carousel/carousel.d.ts +3 -1
  126. package/dist/components/base/chart/chart.d.ts +7 -7
  127. package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
  128. package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
  129. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
  130. package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
  131. package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
  132. package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
  133. package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
  134. package/dist/components/base/display/alert-dialog.d.ts +8 -2
  135. package/dist/components/base/display/content-block.d.ts +4 -2
  136. package/dist/components/base/display/date-block.d.ts +1 -1
  137. package/dist/components/base/display/dialog.d.ts +12 -5
  138. package/dist/components/base/display/surface-title.d.ts +6 -1
  139. package/dist/components/base/feedback/alert.d.ts +1 -1
  140. package/dist/components/base/feedback/state-display.d.ts +5 -4
  141. package/dist/components/base/forms/form-sizing.d.ts +32 -0
  142. package/dist/components/base/forms/workflow.d.ts +2 -0
  143. package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
  144. package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
  145. package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
  146. package/dist/components/base/navigation/language-switcher.d.ts +4 -1
  147. package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
  148. package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
  149. package/dist/components/base/qr-code/qr-code.d.ts +2 -0
  150. package/dist/components/base/sheet/index.d.ts +29 -1
  151. package/dist/components/base/sheet/sheet.d.ts +14 -5
  152. package/dist/components/base/spinner/spinner.d.ts +3 -2
  153. package/dist/components/base/structure/structure.types.d.ts +1 -1
  154. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  155. package/dist/components/base/upload/upload.recipes.d.ts +11 -0
  156. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
  157. package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
  158. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
  159. package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
  160. package/dist/components/blocks/analytics/index.d.ts +1 -1
  161. package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
  162. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  163. package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
  164. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
  165. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
  166. package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
  167. package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
  168. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
  169. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  170. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
  171. package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
  172. package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
  173. package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
  174. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
  175. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
  176. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
  177. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
  178. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  179. package/dist/components/features/overlays/drawer.d.ts +1 -1
  180. package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
  181. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
  182. package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
  183. package/dist/components/features/overlays/overlays.types.d.ts +42 -19
  184. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  185. package/dist/components/features/products/partials/index.d.ts +1 -1
  186. package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
  187. package/dist/components/features/products/partials/product-tone.d.ts +11 -1
  188. package/dist/components/features/products/products.types.d.ts +2 -1
  189. package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
  190. package/dist/components/layout/page/index.d.ts +1 -1
  191. package/dist/components/layout/page/page.types.d.ts +53 -3
  192. package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
  193. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  194. package/dist/components/primitives/date.d.ts +16 -3
  195. package/dist/components/primitives/dimensions.d.ts +6 -0
  196. package/dist/components/primitives/duration.d.ts +6 -0
  197. package/dist/components/primitives/file-size.d.ts +6 -0
  198. package/dist/components/primitives/index.d.ts +1 -1
  199. package/dist/components/primitives/initials.d.ts +11 -2
  200. package/dist/components/primitives/link.d.ts +7 -0
  201. package/dist/components/primitives/money.d.ts +29 -7
  202. package/dist/components/primitives/number.d.ts +17 -0
  203. package/dist/components/primitives/value-typography.d.ts +54 -0
  204. package/dist/components/primitives/value.d.ts +31 -6
  205. package/dist/components/typography/heading.d.ts +9 -1
  206. package/dist/components/typography/label.d.ts +3 -0
  207. package/dist/components/typography/running-text.d.ts +12 -0
  208. package/dist/components/typography/text-link.d.ts +23 -1
  209. package/dist/components/typography/text.d.ts +12 -0
  210. package/dist/components/typography/text.styles.d.ts +35 -13
  211. package/dist/components/ui/button.d.ts +1 -1
  212. package/dist/components/ui/checkbox.d.ts +5 -0
  213. package/dist/components/ui/overlay.recipes.d.ts +15 -2
  214. package/dist/components/ui/select.d.ts +3 -1
  215. package/dist/components/ui/switch.d.ts +5 -0
  216. package/dist/{containers-DqB-bSYE.js → containers-D_L4mTVb.js} +3 -3
  217. package/dist/{containers-DqB-bSYE.js.map → containers-D_L4mTVb.js.map} +1 -1
  218. package/dist/{copyable-BTSByfmq.js → copyable-DDjTeW_j.js} +4 -4
  219. package/dist/{copyable-BTSByfmq.js.map → copyable-DDjTeW_j.js.map} +1 -1
  220. package/dist/{data-display-Bihs9Ven.js → data-display-3xWQUnMA.js} +471 -478
  221. package/dist/data-display-3xWQUnMA.js.map +1 -0
  222. package/dist/date-picker-DrDFj8Lo.js +1527 -0
  223. package/dist/date-picker-DrDFj8Lo.js.map +1 -0
  224. package/dist/date-pickers-CnFCb0n2.js +174 -0
  225. package/dist/date-pickers-CnFCb0n2.js.map +1 -0
  226. package/dist/date-uf3z37Nm.js +144 -0
  227. package/dist/date-uf3z37Nm.js.map +1 -0
  228. package/dist/{display-CS6Hbk18.js → display-DrdvPwF0.js} +25 -25
  229. package/dist/display-DrdvPwF0.js.map +1 -0
  230. package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-CURh59jb.js} +22 -15
  231. package/dist/dropdown-menu-CURh59jb.js.map +1 -0
  232. package/dist/features/activities.js +38 -35
  233. package/dist/features/activities.js.map +1 -1
  234. package/dist/features/ai-chat.js +36 -35
  235. package/dist/features/ai-chat.js.map +1 -1
  236. package/dist/features/async-preview.js +8 -8
  237. package/dist/features/combobox.js +1 -1
  238. package/dist/features/comments.js +1 -1
  239. package/dist/features/data-view.js +10 -10
  240. package/dist/features/email-composer.js +325 -326
  241. package/dist/features/email-composer.js.map +1 -1
  242. package/dist/features/event-calendar.js +190 -200
  243. package/dist/features/event-calendar.js.map +1 -1
  244. package/dist/features/filters.js +1 -1
  245. package/dist/features/global-search.js +77 -77
  246. package/dist/features/global-search.js.map +1 -1
  247. package/dist/features/kanban.js +4 -4
  248. package/dist/features/map.js +8 -8
  249. package/dist/features/media-library.js +499 -502
  250. package/dist/features/media-library.js.map +1 -1
  251. package/dist/features/mentions.js +1 -1
  252. package/dist/features/overlays.js +1 -1
  253. package/dist/features/products.js +1216 -1248
  254. package/dist/features/products.js.map +1 -1
  255. package/dist/features/questionnaire.js +46 -44
  256. package/dist/features/questionnaire.js.map +1 -1
  257. package/dist/features/resource-assignment.js +96 -88
  258. package/dist/features/resource-assignment.js.map +1 -1
  259. package/dist/features/resource.js +11 -11
  260. package/dist/features/rich-text-editor.js +2 -2
  261. package/dist/features/schema-form.js +188 -184
  262. package/dist/features/schema-form.js.map +1 -1
  263. package/dist/features/suggestions.js +3 -3
  264. package/dist/features/sync.js +7 -7
  265. package/dist/features/sync.js.map +1 -1
  266. package/dist/features/table.js +1 -1
  267. package/dist/features/theme-tweaker.js +469 -470
  268. package/dist/features/theme-tweaker.js.map +1 -1
  269. package/dist/{feedback-CJkUAapr.js → feedback-C7nR0UtT.js} +9 -10
  270. package/dist/feedback-C7nR0UtT.js.map +1 -0
  271. package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
  272. package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
  273. package/dist/{field-state-recipes-DQQpiLWC.js → field-state-recipes-C-MFBX_8.js} +3 -3
  274. package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
  275. package/dist/{filters-D6FF8L6s.js → filters-Da-gNPsE.js} +467 -467
  276. package/dist/filters-Da-gNPsE.js.map +1 -0
  277. package/dist/{form-field-CZwrkP7m.js → form-field-VZRULhUK.js} +7 -7
  278. package/dist/{form-field-CZwrkP7m.js.map → form-field-VZRULhUK.js.map} +1 -1
  279. package/dist/form-sizing-uWP4lzVh.js +126 -0
  280. package/dist/form-sizing-uWP4lzVh.js.map +1 -0
  281. package/dist/{forms-B5NCbkSC.js → forms-DDeEnXSY.js} +11 -11
  282. package/dist/forms-DDeEnXSY.js.map +1 -0
  283. package/dist/forms-numeric-D3CO60IF.js +905 -0
  284. package/dist/forms-numeric-D3CO60IF.js.map +1 -0
  285. package/dist/{header-kxruN3RM.js → header-2ycNqGOR.js} +43 -42
  286. package/dist/header-2ycNqGOR.js.map +1 -0
  287. package/dist/{hooks-BrlnCwQd.js → hooks-DQ5SPwZw.js} +2 -2
  288. package/dist/{hooks-BrlnCwQd.js.map → hooks-DQ5SPwZw.js.map} +1 -1
  289. package/dist/{icon-badge-Btc6pQrp.js → icon-badge-DKlaKXoo.js} +3 -3
  290. package/dist/{icon-badge-Btc6pQrp.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
  291. package/dist/index.js +2 -2
  292. package/dist/{input-vxcaNCYC.js → input-BoLm9Hks.js} +3 -3
  293. package/dist/{input-vxcaNCYC.js.map → input-BoLm9Hks.js.map} +1 -1
  294. package/dist/input-DhQdBnV3.js +255 -0
  295. package/dist/{input-SX9V0AL3.js.map → input-DhQdBnV3.js.map} +1 -1
  296. package/dist/item-xzh8Df65.js +264 -0
  297. package/dist/item-xzh8Df65.js.map +1 -0
  298. package/dist/layout/app-shell.js +1 -1
  299. package/dist/layout/auth.js +1 -1
  300. package/dist/layout/containers.js +1 -1
  301. package/dist/layout/header.js +1 -1
  302. package/dist/layout/hooks.js +1 -1
  303. package/dist/layout/navigation.js +1 -1
  304. package/dist/layout/page.js +1 -1
  305. package/dist/layout/settings.js +1 -1
  306. package/dist/layout/sidebar.js +2 -2
  307. package/dist/layout/workspace.js +1 -1
  308. package/dist/layout.js +10 -10
  309. package/dist/lib/affordance-geometry.generated.d.ts +6 -1
  310. package/dist/lib/field-affordance-recipes.d.ts +35 -0
  311. package/dist/lib/field-state-recipes.d.ts +4 -2
  312. package/dist/lib/format.d.ts +9 -0
  313. package/dist/lib/money-format.d.ts +30 -0
  314. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
  315. package/dist/lib/surface-recipes.d.ts +8 -6
  316. package/dist/lib/token-merge.generated.d.ts +11 -11
  317. package/dist/lib/track-recipes.d.ts +1 -1
  318. package/dist/lib/ui-provider/provider.d.ts +7 -2
  319. package/dist/lib/ui-provider/store.d.ts +6 -2
  320. package/dist/lib/ui-provider/types.d.ts +5 -2
  321. package/dist/lib/utils.js +1 -1
  322. package/dist/{media-gallery-DLp3HAz0.js → media-gallery-DQUQ0m3O.js} +8 -8
  323. package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
  324. package/dist/{mentions-Cl0Kt_Pd.js → mentions-DwnO1hh4.js} +34 -35
  325. package/dist/{mentions-Cl0Kt_Pd.js.map → mentions-DwnO1hh4.js.map} +1 -1
  326. package/dist/{message-SZUNB1eX.js → message-YfFmbXNP.js} +5 -5
  327. package/dist/{message-SZUNB1eX.js.map → message-YfFmbXNP.js.map} +1 -1
  328. package/dist/{navigation-DyytsLRB.js → navigation-Cbp5V8gG.js} +33 -34
  329. package/dist/navigation-Cbp5V8gG.js.map +1 -0
  330. package/dist/{navigation-DnQSNMT0.js → navigation-Cs1npsPm.js} +111 -87
  331. package/dist/navigation-Cs1npsPm.js.map +1 -0
  332. package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-DlU-4QYO.js} +2 -2
  333. package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-DlU-4QYO.js.map} +1 -1
  334. package/dist/number-CKRBYmZK.js +352 -0
  335. package/dist/number-CKRBYmZK.js.map +1 -0
  336. package/dist/overlay.recipes-CNO2S9V6.js +34 -0
  337. package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
  338. package/dist/overlays-DhZO7N-I.js +994 -0
  339. package/dist/overlays-DhZO7N-I.js.map +1 -0
  340. package/dist/page-C6R_8jFt.js +325 -0
  341. package/dist/page-C6R_8jFt.js.map +1 -0
  342. package/dist/{page-header-D8nERkn5.js → page-header-hUTzcRZX.js} +9 -9
  343. package/dist/page-header-hUTzcRZX.js.map +1 -0
  344. package/dist/{pagination-NLGqRirf.js → pagination-Cm0jqa3I.js} +8 -8
  345. package/dist/{pagination-NLGqRirf.js.map → pagination-Cm0jqa3I.js.map} +1 -1
  346. package/dist/{popover-CghIYdQf.js → popover-Dcv_9jxr.js} +6 -6
  347. package/dist/{popover-CghIYdQf.js.map → popover-Dcv_9jxr.js.map} +1 -1
  348. package/dist/{popover-menu-B4PoWhRl.js → popover-menu-DnRFKnHP.js} +6 -6
  349. package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
  350. package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-wmbvL8Ah.js} +2 -2
  351. package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-wmbvL8Ah.js.map} +1 -1
  352. package/dist/primitives-BHrwQXFC.js +379 -0
  353. package/dist/primitives-BHrwQXFC.js.map +1 -0
  354. package/dist/primitives.js +5 -5
  355. package/dist/{progress-BroqrAyV.js → progress-Br9WTFya.js} +7 -7
  356. package/dist/progress-Br9WTFya.js.map +1 -0
  357. package/dist/{receipt-BuJynLgf.js → receipt-CV89q1fs.js} +6 -6
  358. package/dist/{receipt-BuJynLgf.js.map → receipt-CV89q1fs.js.map} +1 -1
  359. package/dist/{rich-text-editor-BKyG7rWz.js → rich-text-editor-CF8QYt5p.js} +6 -6
  360. package/dist/{rich-text-editor-BKyG7rWz.js.map → rich-text-editor-CF8QYt5p.js.map} +1 -1
  361. package/dist/{rich-text-editor.recipes-B72Nfuze.js → rich-text-editor.recipes-CnrbmTS1.js} +4 -4
  362. package/dist/{rich-text-editor.recipes-B72Nfuze.js.map → rich-text-editor.recipes-CnrbmTS1.js.map} +1 -1
  363. package/dist/{rich-text-DlxDOtf4.js → rich-text-j-FGAeZW.js} +4 -4
  364. package/dist/{rich-text-DlxDOtf4.js.map → rich-text-j-FGAeZW.js.map} +1 -1
  365. package/dist/{scroll-area-D-pIhEKl.js → scroll-area-DRdr16Pt.js} +3 -3
  366. package/dist/scroll-area-DRdr16Pt.js.map +1 -0
  367. package/dist/{separator-BhtFyo4x.js → separator-BMEvwnSX.js} +2 -2
  368. package/dist/{separator-BhtFyo4x.js.map → separator-BMEvwnSX.js.map} +1 -1
  369. package/dist/{separator-BNIgG3au.js → separator-Do5GWDYi.js} +4 -4
  370. package/dist/separator-Do5GWDYi.js.map +1 -0
  371. package/dist/services/actions/action-adapters.d.ts +4 -0
  372. package/dist/services/actions.js +8 -3
  373. package/dist/services/actions.js.map +1 -1
  374. package/dist/{settings-DOTOzeZ2.js → settings-DHk0L2MF.js} +17 -17
  375. package/dist/settings-DHk0L2MF.js.map +1 -0
  376. package/dist/sheet-DRFNY1_D.js +207 -0
  377. package/dist/sheet-DRFNY1_D.js.map +1 -0
  378. package/dist/sidebar-Cb8WzOvE.js +511 -0
  379. package/dist/sidebar-Cb8WzOvE.js.map +1 -0
  380. package/dist/{sidebar-CyR4XKwR.js → sidebar-Crc9M9JV.js} +18 -18
  381. package/dist/sidebar-Crc9M9JV.js.map +1 -0
  382. package/dist/{skeleton-3F0uhYn3.js → skeleton-DVMXr15h.js} +4 -4
  383. package/dist/{skeleton-3F0uhYn3.js.map → skeleton-DVMXr15h.js.map} +1 -1
  384. package/dist/{smart-card-DjGVV2xr.js → smart-card-Bek-TwUp.js} +222 -207
  385. package/dist/smart-card-Bek-TwUp.js.map +1 -0
  386. package/dist/{spinner-Cpf7oRkF.js → spinner-CmTAbEp0.js} +8 -6
  387. package/dist/spinner-CmTAbEp0.js.map +1 -0
  388. package/dist/{structure-CRdqVawd.js → structure-hzCW-XsV.js} +3 -3
  389. package/dist/{structure-CRdqVawd.js.map → structure-hzCW-XsV.js.map} +1 -1
  390. package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
  391. package/dist/structure.recipes-EPz60cU8.js.map +1 -0
  392. package/dist/style.css +1 -1
  393. package/dist/surface-recipes-DOdoBXGm.js +28 -0
  394. package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
  395. package/dist/table-D6zKeYQX.js +162 -0
  396. package/dist/table-D6zKeYQX.js.map +1 -0
  397. package/dist/{table-CcRDZiLP.js → table-Dn4XSrSB.js} +348 -348
  398. package/dist/table-Dn4XSrSB.js.map +1 -0
  399. package/dist/{tabs-BNgu7g0u.js → tabs-Dk8E_knt.js} +14 -13
  400. package/dist/tabs-Dk8E_knt.js.map +1 -0
  401. package/dist/{text-inputs-DsR56TR-.js → text-inputs-BFpku0Qd.js} +150 -149
  402. package/dist/text-inputs-BFpku0Qd.js.map +1 -0
  403. package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
  404. package/dist/text.styles-g4He6UIW.js.map +1 -0
  405. package/dist/theme.css +16 -12
  406. package/dist/themes/green.css +24 -0
  407. package/dist/{timelines-D1pkt3se.js → timelines-CxuAFIc2.js} +25 -38
  408. package/dist/timelines-CxuAFIc2.js.map +1 -0
  409. package/dist/track-recipes-CDcKmndW.js +10 -0
  410. package/dist/track-recipes-CDcKmndW.js.map +1 -0
  411. package/dist/{tree-BtmYyMZV.js → tree-BotPlyiD.js} +13 -13
  412. package/dist/{tree-BtmYyMZV.js.map → tree-BotPlyiD.js.map} +1 -1
  413. package/dist/typography/rich-text.js +1 -1
  414. package/dist/typography-CAr3dQhX.js +116 -0
  415. package/dist/typography-CAr3dQhX.js.map +1 -0
  416. package/dist/typography.js +2 -2
  417. package/dist/{ui-provider-DRPn3qNl.js → ui-provider-D2_TeLqw.js} +20 -21
  418. package/dist/ui-provider-D2_TeLqw.js.map +1 -0
  419. package/dist/ui-provider.js +1 -1
  420. package/dist/{upload-CDbYw1WN.js → upload-B0WHW7ak.js} +221 -220
  421. package/dist/upload-B0WHW7ak.js.map +1 -0
  422. package/dist/{upload-queue-CNd_hH_a.js → upload-queue-BHZ_wBfd.js} +59 -62
  423. package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
  424. package/dist/{usage-card-VyJLUwRr.js → usage-card-U0YBLTNT.js} +42 -43
  425. package/dist/{usage-card-VyJLUwRr.js.map → usage-card-U0YBLTNT.js.map} +1 -1
  426. package/dist/{utils-BvH9PSmq.js → utils-Cospvlj1.js} +221 -51
  427. package/dist/utils-Cospvlj1.js.map +1 -0
  428. package/dist/value-inputs-CjfzGMsN.js +854 -0
  429. package/dist/value-inputs-CjfzGMsN.js.map +1 -0
  430. package/dist/value-typography-Deb3yQZg.js +116 -0
  431. package/dist/value-typography-Deb3yQZg.js.map +1 -0
  432. package/dist/{workspace-CcR8r-Nt.js → workspace-YoFjXi6i.js} +44 -45
  433. package/dist/workspace-YoFjXi6i.js.map +1 -0
  434. package/docs/consumer-skill/SKILL.md +51 -38
  435. package/docs/consumer-skill/examples/app-layout.tsx +2 -4
  436. package/docs/consumer-skill/examples/detail.tsx +3 -4
  437. package/docs/consumer-skill/examples/edit.tsx +1 -1
  438. package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
  439. package/docs/consumer-skill/examples/manifest.json +28 -6
  440. package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
  441. package/docs/consumer-skill/references/composition.md +89 -17
  442. package/docs/consumer-skill/references/discovery.md +4 -0
  443. package/docs/consumer-skill/references/installation.md +22 -0
  444. package/docs/consumer-skill/references/integration.md +32 -1
  445. package/docs/consumer-skill/references/public-api.json +111 -70
  446. package/docs/consumer-skill/references/review.md +20 -4
  447. package/docs/consumer-skill/references/theming.md +7 -1
  448. package/docs/consumer-skill/references/tokens.json +5 -2
  449. package/docs/consumer-skill/references/workflows.md +4 -2
  450. package/docs/consumer-skill/scripts/composition-policy.mjs +93 -2
  451. package/docs/consumer-skill/scripts/discovery.mjs +11 -3
  452. package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
  453. package/package.json +5 -3
  454. package/dist/accordion-BRTcsp8J.js.map +0 -1
  455. package/dist/action-menu-Drxw_vJk.js +0 -265
  456. package/dist/action-menu-Drxw_vJk.js.map +0 -1
  457. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
  458. package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
  459. package/dist/avatar-Bu2HhitA.js.map +0 -1
  460. package/dist/badge-CzId1Wlm.js.map +0 -1
  461. package/dist/button-BZDasD04.js.map +0 -1
  462. package/dist/buttons-D_6KJvEE.js.map +0 -1
  463. package/dist/chart-Bsc5BICK.js.map +0 -1
  464. package/dist/checkbox-BQNDjUCh.js +0 -34
  465. package/dist/checkbox-BQNDjUCh.js.map +0 -1
  466. package/dist/choice-inputs-Mk3iWbhr.js +0 -725
  467. package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
  468. package/dist/combobox-BFnbJJp3.js.map +0 -1
  469. package/dist/combobox-hozNwUcc.js.map +0 -1
  470. package/dist/command-BnmSchli.js.map +0 -1
  471. package/dist/comments-u5L0OGip.js.map +0 -1
  472. package/dist/data-display-Bihs9Ven.js.map +0 -1
  473. package/dist/date-DOKhJPu7.js +0 -140
  474. package/dist/date-DOKhJPu7.js.map +0 -1
  475. package/dist/date-picker-DzP5HQq7.js +0 -1541
  476. package/dist/date-picker-DzP5HQq7.js.map +0 -1
  477. package/dist/date-pickers-BpgGz7S-.js +0 -196
  478. package/dist/date-pickers-BpgGz7S-.js.map +0 -1
  479. package/dist/display-CS6Hbk18.js.map +0 -1
  480. package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
  481. package/dist/feedback-CJkUAapr.js.map +0 -1
  482. package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
  483. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
  484. package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
  485. package/dist/filters-D6FF8L6s.js.map +0 -1
  486. package/dist/form-sizing-QP8aIRaW.js +0 -103
  487. package/dist/form-sizing-QP8aIRaW.js.map +0 -1
  488. package/dist/format-iamDSqs2.js +0 -110
  489. package/dist/format-iamDSqs2.js.map +0 -1
  490. package/dist/forms-B5NCbkSC.js.map +0 -1
  491. package/dist/forms-numeric-Crrm80Lm.js +0 -867
  492. package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
  493. package/dist/header-kxruN3RM.js.map +0 -1
  494. package/dist/input-SX9V0AL3.js +0 -255
  495. package/dist/item-DE4YnuJx.js +0 -258
  496. package/dist/item-DE4YnuJx.js.map +0 -1
  497. package/dist/media-gallery-DLp3HAz0.js.map +0 -1
  498. package/dist/navigation-DnQSNMT0.js.map +0 -1
  499. package/dist/navigation-DyytsLRB.js.map +0 -1
  500. package/dist/number-DasMFWEG.js +0 -269
  501. package/dist/number-DasMFWEG.js.map +0 -1
  502. package/dist/overlay.recipes-BxW5FIfK.js +0 -6
  503. package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
  504. package/dist/overlays-DUbs1KEi.js +0 -1011
  505. package/dist/overlays-DUbs1KEi.js.map +0 -1
  506. package/dist/page-hGmT4nWK.js +0 -213
  507. package/dist/page-hGmT4nWK.js.map +0 -1
  508. package/dist/page-header-D8nERkn5.js.map +0 -1
  509. package/dist/primitives-C7ff0QaI.js +0 -337
  510. package/dist/primitives-C7ff0QaI.js.map +0 -1
  511. package/dist/progress-BroqrAyV.js.map +0 -1
  512. package/dist/scroll-area-D-pIhEKl.js.map +0 -1
  513. package/dist/separator-BNIgG3au.js.map +0 -1
  514. package/dist/settings-DOTOzeZ2.js.map +0 -1
  515. package/dist/sheet-BFhrNehm.js +0 -205
  516. package/dist/sheet-BFhrNehm.js.map +0 -1
  517. package/dist/sidebar-CyR4XKwR.js.map +0 -1
  518. package/dist/sidebar-SvGJ0Zwi.js +0 -506
  519. package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
  520. package/dist/smart-card-DjGVV2xr.js.map +0 -1
  521. package/dist/spinner-Cpf7oRkF.js.map +0 -1
  522. package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
  523. package/dist/surface-recipes-Dd__PD-w.js +0 -28
  524. package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
  525. package/dist/table-CLtJTxoR.js +0 -147
  526. package/dist/table-CLtJTxoR.js.map +0 -1
  527. package/dist/table-CcRDZiLP.js.map +0 -1
  528. package/dist/tabs-BNgu7g0u.js.map +0 -1
  529. package/dist/text-inputs-DsR56TR-.js.map +0 -1
  530. package/dist/text.styles-Q4sGAIgA.js.map +0 -1
  531. package/dist/timelines-D1pkt3se.js.map +0 -1
  532. package/dist/track-recipes-LLPNVwFg.js +0 -10
  533. package/dist/track-recipes-LLPNVwFg.js.map +0 -1
  534. package/dist/typography-BxQgiZyw.js +0 -96
  535. package/dist/typography-BxQgiZyw.js.map +0 -1
  536. package/dist/ui-provider-DRPn3qNl.js.map +0 -1
  537. package/dist/upload-CDbYw1WN.js.map +0 -1
  538. package/dist/upload-queue-CNd_hH_a.js.map +0 -1
  539. package/dist/utils-BvH9PSmq.js.map +0 -1
  540. package/dist/value-inputs-D0KCrfVC.js +0 -840
  541. package/dist/value-inputs-D0KCrfVC.js.map +0 -1
  542. package/dist/workspace-CcR8r-Nt.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-Cs1npsPm.js","names":["_Fragment","Text","Button","Stack","ActionMenu","Badge","TabScrollViewport","Fragment$1","LanguageSwitcher","handleSelect","useCallback","isActive","onSelect","value","locales","variant","Globe","label","onRenderLabel","locale","Fragment","cn","index","defaultNavigationTabsStrings","normalizePath","hashRouteIndex","rawUrl","origin","NavigationTabs","forwardRef","stringsProp","strings","useStrings","activePath","currentPath","prominent","list","items","item","Icon","scrollable","className","scrollStrings","defaultOverflowTabBarStrings","TAB_BUTTON_BASE","TAB_INACTIVE","TAB_ACTIVE","isSimpleText","fitOverflowTabs","widths","sum","width","gap","available","used","count","next","moreWidth","OverflowTabBar","rootProps","rootRef","useRef","trackRef","measureRef","visibleCount","setVisibleCount","useState","setRootRef","node","ref","root","track","measure","compute","trackStyle","inset","tab","observer","orderedItems","useMemo","activeIdx","i","lastVisibleIdx","visibleItems","overflowItems","onValueChange","handleKeyDown","event","tabs","forward","renderTab","tabClasses","activeTabClassName","tabClassName","inner","options","shared","moreContent","MoreHorizontal"],"sources":["../src/components/base/navigation/language-switcher.tsx","../src/components/base/navigation/navigation-tabs.tsx","../src/components/base/navigation/overflow-tab-bar.tsx"],"sourcesContent":["/**\n * LanguageSwitcher — locale picker with two layouts: `buttons` (chunky\n * primary buttons) and `inline` (small text links separated by dots, prefixed\n * with a globe icon). Defaults to `buttons`.\n *\n * The library never navigates on its own. The consumer wires routing /\n * locale switching by passing `onSelect` (e.g. a Tanstack Router\n * `navigate(...)` or Inertia `router.visit(...)`). When `onSelect` is\n * absent the click is a no-op.\n */\nimport { Globe } from 'lucide-react';\nimport { Fragment, useCallback } from 'react';\n\nimport { Button } from '../buttons';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport type { LocaleOption } from '../../../types/locale.types';\n\nexport interface LanguageSwitcherProps {\n\t/** Locales to offer, in order. The entry with `active: true` is marked as current. */\n\tlocales: LocaleOption[];\n\t/** Custom label for each locale. Defaults to `nativeLabel`. */\n\tonRenderLabel?: (options: LocaleOption) => string;\n\t/** Layout: `buttons` (default) for a row of buttons, `inline` for compact dot-separated text links. */\n\tvariant?: 'buttons' | 'inline';\n\t/** Called with the chosen locale's value. Not called for the current locale. */\n\tonSelect?: (value: string) => void;\n}\n\nexport function LanguageSwitcher({\n\tlocales,\n\tonRenderLabel,\n\tvariant = 'buttons',\n\tonSelect,\n}: LanguageSwitcherProps) {\n\tconst handleSelect = useCallback((value: string, isActive: boolean) => {\n\t\tif (isActive) {\n\t\t\treturn;\n\t\t}\n\n\t\tonSelect?.(value);\n\t}, [onSelect]);\n\n\tif (locales.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (variant === 'inline') {\n\t\treturn (\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"center\" gap=\"md\" wrap={false} className=\"language-switcher--component\">\n\t\t\t\t<Globe className=\"size-icon shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"center\" gap=\"md\" wrap className=\"min-w-0\">\n\t\t\t\t\t{locales.map((locale, index) => {\n\t\t\t\t\t\tconst label = onRenderLabel\n\t\t\t\t\t\t\t? onRenderLabel(locale)\n\t\t\t\t\t\t\t: locale.nativeLabel;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Fragment key={locale.value}>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\taria-current={locale.active ? 'true' : undefined}\n\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\thandleSelect(locale.value, locale.active)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'cursor-pointer rounded-inner border-0 bg-transparent p-0 font-sans text-pxs outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n\t\t\t\t\t\t\t\t\t\tlocale.active\n\t\t\t\t\t\t\t\t\t\t\t? 'text-primary-accent font-medium'\n\t\t\t\t\t\t\t\t\t\t\t: 'text-muted-foreground hover:text-foreground',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"pxs\" weight={locale.active ? 'medium' : 'regular'} className=\"text-inherit\">\n\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t{index < locales.length - 1 && (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"size-1 rounded-full bg-border\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Stack direction=\"horizontal\" align=\"center\" justify=\"center\" wrap gap=\"md\">\n\t\t\t{locales.map((locale) => {\n\t\t\t\tconst label = onRenderLabel ? onRenderLabel(locale) : locale.nativeLabel;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={locale.value}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle={locale.active ? 'solid' : 'ghost'}\n\t\t\t\t\t\taria-current={locale.active ? 'true' : undefined}\n\t\t\t\t\t\tonClick={() => handleSelect(locale.value, locale.active)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'min-w-18 justify-center transition-colors',\n\t\t\t\t\t\t\tlocale.active ? 'text-primary-accent' : 'text-muted-foreground',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Stack>\n\t);\n}\n\nLanguageSwitcher.displayName = 'LanguageSwitcher';\n","/**\n * NavigationTabs — canonical route-tab navigation.\n *\n * The default compact treatment works for ordinary application navigation;\n * `variant=\"prominent\"` provides the stronger filled treatment without\n * introducing a second component or item vocabulary.\n */\nimport { forwardRef, type ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\n\nimport { Badge } from '../badge';\nimport { Button } from '../buttons';\nimport { Stack } from '../structure';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { TabScrollViewport, type TabsScrollStrings } from './tab-scroll-viewport';\n\nexport interface NavigationTabItem {\n\ttitle: string;\n\thref: string;\n\ticon?: LucideIcon | string;\n\tbadge?: ReactNode;\n\tactive?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface NavigationTabsStrings {\n\ttabsAria: string;\n}\n\nexport const defaultNavigationTabsStrings: NavigationTabsStrings = {\n\ttabsAria: 'Tab navigation',\n};\n\nexport type NavigationTabsVariant = 'default' | 'prominent';\n\nexport interface NavigationTabsProps {\n\t/** Tabs to render, in order. */\n\titems: readonly NavigationTabItem[];\n\t/** Path of the active route, used to mark the current tab. */\n\tcurrentPath?: string;\n\t/** Visual treatment of the tab row. */\n\tvariant?: NavigationTabsVariant;\n\t/** Show previous/next controls when route tabs overflow. Defaults to true. */\n\tscrollable?: boolean;\n\t/** Accessible labels for the previous/next scroll controls. */\n\tscrollStrings?: StringsProp<TabsScrollStrings>;\n\t/** Overrides the tab row's own copy. */\n\tstrings?: StringsProp<NavigationTabsStrings>;\n\tclassName?: string;\n}\n\nfunction normalizePath(rawUrl: string): string {\n\tconst hashRouteIndex = rawUrl.indexOf('#/');\n\tif (hashRouteIndex >= 0) {\n\t\treturn rawUrl.slice(hashRouteIndex).split('?')[0]?.replace(/\\/+$/, '') || '#/';\n\t}\n\n\ttry {\n\t\tconst origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n\t\tconst parsed = new URL(rawUrl, origin);\n\t\treturn parsed.pathname.replace(/\\/+$/, '') || '/';\n\t} catch {\n\t\treturn rawUrl.split('?')[0]?.replace(/\\/+$/, '') || '/';\n\t}\n}\n\nexport const NavigationTabs = forwardRef<HTMLDivElement, NavigationTabsProps>(function NavigationTabs({\n\titems,\n\tcurrentPath,\n\tvariant = 'default',\n\tscrollable = true,\n\tscrollStrings,\n\tstrings: stringsProp,\n\tclassName,\n}: NavigationTabsProps, ref) {\n\tconst strings = useStrings(defaultNavigationTabsStrings, stringsProp);\n\tconst activePath = normalizePath(\n\t\tcurrentPath ?? (typeof window !== 'undefined' ? window.location.pathname : '/'),\n\t);\n\tconst prominent = variant === 'prominent';\n\n\tconst list = <Stack\n\t\t\t\trender={<nav aria-label={strings.tabsAria} />}\n\t\t\t\tdirection=\"horizontal\"\n\t\t\t\tgap=\"2xs\"\n\t\t\t\twrap={false}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'navigation-tabs--list w-max rounded-inner bg-muted p-space-2xs',\n\t\t\t\t\tprominent && 'rounded-inner bg-muted/60',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{items.map((item) => {\n\t\t\t\t\tconst isActive = item.active ?? activePath === normalizePath(item.href);\n\t\t\t\t\tconst Icon = typeof item.icon === 'string' ? undefined : item.icon;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={item.href}\n\t\t\t\t\t\t\thref={item.href}\n\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\ttone={isActive && prominent ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\tbuttonStyle={isActive ? 'solid' : 'ghost'}\n\t\t\t\t\t\t\ticon={Icon}\n\t\t\t\t\t\t\taria-current={isActive ? 'page' : undefined}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'navigation-tabs--item shrink-0',\n\t\t\t\t\t\t\t\t'rounded-inner',\n\t\t\t\t\t\t\t\t// Shared segmented recipe (Tabs, OverflowTabBar): a lifted card-coloured\n\t\t\t\t\t\t\t\t// active tab on the muted track, in light and dark alike.\n\t\t\t\t\t\t\t\t!prominent && isActive && 'bg-card text-foreground shadow-sm hover:bg-card',\n\t\t\t\t\t\t\t\t!prominent && !isActive && 'text-muted-foreground hover:bg-card/60 hover:text-foreground',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{typeof item.icon === 'string' && (\n\t\t\t\t\t\t\t\t<span className=\"navigation-tabs--icon text-inherit\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t{item.icon}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\t\t\tlineHeight=\"none\"\n\t\t\t\t\t\t\t\tclassName=\"navigation-tabs--title text-inherit\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item.title}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t{item.badge !== undefined && item.badge !== null && (\n\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tclassName=\"navigation-tabs--badge\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{item.badge}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Stack>;\n\treturn <div ref={ref} className={cn('navigation-tabs--component', 'w-full min-w-0', !scrollable && 'overflow-x-auto', className)}>\n\t\t{scrollable ? <TabScrollViewport strings={scrollStrings}>{list}</TabScrollViewport> : list}\n\t</div>;\n});\n\nNavigationTabs.displayName = 'NavigationTabs';\n","/**\n * OverflowTabBar — horizontal tab strip that gracefully degrades on narrow\n * containers. Tabs that would overflow are moved into a trailing \"More\"\n * dropdown so the strip never wraps. Uses a ResizeObserver to recompute on\n * container resize; the active tab is always kept visible by being moved\n * out of the overflow set when needed.\n *\n * The strip shares the segmented-tab recipe of `NavigationTabs` and `Tabs`:\n * a muted track, small action-height tabs with default-size labels, and a\n * lifted card-coloured active tab. Arrow keys, Home and End move focus between\n * tabs; Enter or Space activates the focused tab.\n *\n * Use `NavigationTabs` instead when a fixed route set cannot overflow.\n */\nimport { MoreHorizontal, type LucideIcon } from 'lucide-react';\nimport {\n\tforwardRef,\n\tuseCallback,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\ttype ComponentPropsWithoutRef,\n\ttype KeyboardEvent,\n\ttype ReactNode,\n} from 'react';\n\nimport { ActionMenu } from '../action-menu';\nimport { Badge } from '../badge';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nexport interface OverflowTabBarStrings {\n\tmore: string;\n\tnavigationLabel: string;\n}\n\nexport const defaultOverflowTabBarStrings: OverflowTabBarStrings = {\n\tmore: 'More',\n\tnavigationLabel: 'Tab navigation',\n};\n\nexport interface OverflowTabItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: ReactNode;\n\t/** Destination for the entry, when it navigates. */\n\thref?: string;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Chip rendered beside the label. */\n\tbadge?: ReactNode;\n\tonClick?: () => void;\n}\n\nexport interface OverflowTabBarProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {\n\t/** Entries to render, in order. */\n\titems: OverflowTabItem[];\n\t/** Currently active tab id. */\n\tvalue?: string;\n\t/** Fired with the id of the newly active tab. */\n\tonValueChange?: (id: string) => void;\n\ttabClassName?: string;\n\tactiveTabClassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<OverflowTabBarStrings>;\n}\n\n// Native buttons and anchors are reset explicitly: the package ships no preflight.\nconst TAB_BUTTON_BASE =\n\t'box-border inline-flex h-action-sm shrink-0 cursor-pointer items-center gap-space-sm rounded-inner border-0 bg-transparent px-control-sm font-sans text-sm font-medium whitespace-nowrap no-underline outline-none transition-colors ' +\n\t'focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-icon [&_svg]:shrink-0';\nconst TAB_INACTIVE = 'text-muted-foreground hover:bg-card/60 hover:text-foreground';\nconst TAB_ACTIVE = 'bg-card text-foreground shadow-sm';\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/** How many tabs fit, reserving room for the \"More\" trigger only when something overflows. */\nexport function fitOverflowTabs(widths: readonly number[], available: number, gap: number, moreWidth: number): number {\n\tconst total = widths.reduce((sum, width) => sum + width, 0) + gap * Math.max(0, widths.length - 1);\n\tif (total <= available) return widths.length;\n\tlet used = 0;\n\tlet count = 0;\n\tfor (const width of widths) {\n\t\tconst next = used + (count > 0 ? gap : 0) + width;\n\t\tif (next + gap + moreWidth > available) break;\n\t\tused = next;\n\t\tcount += 1;\n\t}\n\treturn Math.max(1, count);\n}\n\nexport const OverflowTabBar = forwardRef<HTMLDivElement, OverflowTabBarProps>(function OverflowTabBar({\n\titems,\n\tvalue,\n\tonValueChange,\n\tclassName,\n\ttabClassName,\n\tactiveTabClassName,\n\tstrings: stringsProp,\n\t...rootProps\n}, ref) {\n\tconst strings = useStrings(defaultOverflowTabBarStrings, stringsProp);\n\tconst rootRef = useRef<HTMLDivElement | null>(null);\n\tconst trackRef = useRef<HTMLDivElement | null>(null);\n\tconst measureRef = useRef<HTMLDivElement | null>(null);\n\tconst [visibleCount, setVisibleCount] = useState(items.length);\n\n\tconst setRootRef = useCallback((node: HTMLDivElement | null) => {\n\t\trootRef.current = node;\n\t\tif (typeof ref === 'function') ref(node);\n\t\telse if (ref) ref.current = node;\n\t}, [ref]);\n\n\t// Recompute how many tabs fit when the available width or the items change.\n\tuseLayoutEffect(() => {\n\t\tconst root = rootRef.current;\n\t\tconst track = trackRef.current;\n\t\tconst measure = measureRef.current;\n\t\tif (!root || !track || !measure) return;\n\n\t\tconst compute = () => {\n\t\t\tconst trackStyle = getComputedStyle(track);\n\t\t\tconst inset = (parseFloat(trackStyle.paddingLeft) || 0) + (parseFloat(trackStyle.paddingRight) || 0);\n\t\t\tconst available = root.clientWidth - inset;\n\t\t\tif (available <= 0) {\n\t\t\t\tsetVisibleCount(items.length);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst gap = parseFloat(getComputedStyle(measure).columnGap) || 0;\n\t\t\tconst widths = Array.from(measure.querySelectorAll<HTMLElement>('[data-tab-id]')).map((tab) => tab.offsetWidth);\n\t\t\tconst moreWidth = measure.querySelector<HTMLElement>('[data-more-measure]')?.offsetWidth ?? 0;\n\t\t\tsetVisibleCount(fitOverflowTabs(widths, available, gap, moreWidth));\n\t\t};\n\n\t\tcompute();\n\t\tif (typeof ResizeObserver === 'undefined') return;\n\t\tconst observer = new ResizeObserver(compute);\n\t\tobserver.observe(root);\n\t\treturn () => observer.disconnect();\n\t}, [items, strings.more]);\n\n\t// Ensure the active tab is always visible; if it falls into the overflow set,\n\t// swap it with the last visible tab.\n\tconst orderedItems = useMemo(() => {\n\t\tif (!value) return items;\n\t\tconst activeIdx = items.findIndex((i) => i.id === value);\n\t\tif (activeIdx < 0 || activeIdx < visibleCount) return items;\n\t\tconst next = [...items];\n\t\tconst lastVisibleIdx = Math.max(0, visibleCount - 1);\n\t\t[next[activeIdx], next[lastVisibleIdx]] = [next[lastVisibleIdx], next[activeIdx]];\n\t\treturn next;\n\t}, [items, value, visibleCount]);\n\n\tconst visibleItems = orderedItems.slice(0, visibleCount);\n\tconst overflowItems = orderedItems.slice(visibleCount);\n\n\tconst handleSelect = (item: OverflowTabItem) => {\n\t\tonValueChange?.(item.id);\n\t\titem.onClick?.();\n\t};\n\n\t// Roving focus: arrows, Home and End move between tabs; activation stays on\n\t// Enter/Space so moving focus never navigates a link tab by itself.\n\tconst handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n\t\tif (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;\n\t\tconst tabs = Array.from(event.currentTarget.querySelectorAll<HTMLElement>('[role=\"tab\"]'));\n\t\tconst index = tabs.indexOf(event.target as HTMLElement);\n\t\tif (index < 0 || tabs.length === 0) return;\n\t\tconst rtl = getComputedStyle(event.currentTarget).direction === 'rtl';\n\t\tconst forward = rtl ? 'ArrowLeft' : 'ArrowRight';\n\t\tconst next = event.key === 'Home'\n\t\t\t? 0\n\t\t\t: event.key === 'End'\n\t\t\t\t? tabs.length - 1\n\t\t\t\t: event.key === forward\n\t\t\t\t\t? (index + 1) % tabs.length\n\t\t\t\t\t: (index - 1 + tabs.length) % tabs.length;\n\t\tevent.preventDefault();\n\t\ttabs[next]?.focus();\n\t};\n\n\tconst renderTab = (item: OverflowTabItem, isActive: boolean, options?: { measure?: boolean }) => {\n\t\tconst Icon = item.icon;\n\t\tconst tabClasses = cn(\n\t\t\tTAB_BUTTON_BASE,\n\t\t\tisActive ? cn(TAB_ACTIVE, activeTabClassName) : TAB_INACTIVE,\n\t\t\ttabClassName,\n\t\t);\n\t\tconst inner = (\n\t\t\t<>\n\t\t\t\t{!!Icon && <Icon aria-hidden=\"true\" />}\n\t\t\t\t{isSimpleText(item.label) ? (\n\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t{item.label}\n\t\t\t\t\t</Text>\n\t\t\t\t) : item.label}\n\t\t\t\t{item.badge !== undefined && item.badge !== null && item.badge !== false && (\n\t\t\t\t\t<Badge size=\"sm\" tone=\"secondary\" className=\"overflow-tab-bar--badge\">\n\t\t\t\t\t\t{item.badge}\n\t\t\t\t\t</Badge>\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t\tif (options?.measure) {\n\t\t\treturn (\n\t\t\t\t<span key={item.id} data-tab-id={item.id} className={cn('overflow-tab-bar--measure', tabClasses)}>\n\t\t\t\t\t{inner}\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\t\tconst shared = {\n\t\t\t'data-tab-id': item.id,\n\t\t\trole: 'tab',\n\t\t\t'aria-selected': isActive,\n\t\t\ttabIndex: isActive || !value ? 0 : -1,\n\t\t\tonClick: () => handleSelect(item),\n\t\t\tclassName: cn('overflow-tab-bar--tab', tabClasses),\n\t\t} as const;\n\t\tif (item.href) {\n\t\t\treturn <a key={item.id} href={item.href} {...shared}>{inner}</a>;\n\t\t}\n\t\treturn <button key={item.id} type=\"button\" {...shared}>{inner}</button>;\n\t};\n\n\tconst moreContent = (\n\t\t<>\n\t\t\t<MoreHorizontal aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t{strings.more}\n\t\t\t</Text>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={setRootRef}\n\t\t\tclassName={cn('overflow-tab-bar--component relative w-full min-w-0 max-w-full', className)}\n\t\t\t{...rootProps}\n\t\t>\n\t\t\t{/* Hidden measure row: every tab plus the More trigger at native width,\n\t\t\t laid out but invisible, so the visible strip never has to guess. */}\n\t\t\t<div\n\t\t\t\tref={measureRef}\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName=\"pointer-events-none invisible fixed left-0 top-0 z-[-1] flex h-0 w-0 items-center gap-space-2xs overflow-hidden\"\n\t\t\t>\n\t\t\t\t{items.map((i) => renderTab(i, false, { measure: true }))}\n\t\t\t\t<span data-more-measure=\"\" className={cn(TAB_BUTTON_BASE, TAB_INACTIVE)}>{moreContent}</span>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tref={trackRef}\n\t\t\t\tclassName=\"overflow-tab-bar--viewport inline-flex max-w-full min-w-0 items-center gap-space-2xs overflow-hidden rounded-inner bg-muted p-space-2xs align-top\"\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\trole=\"tablist\"\n\t\t\t\t\taria-label={strings.navigationLabel}\n\t\t\t\t\taria-orientation=\"horizontal\"\n\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\tclassName=\"overflow-tab-bar--tablist flex min-w-0 items-center gap-space-2xs overflow-hidden\"\n\t\t\t\t>\n\t\t\t\t\t{visibleItems.map((item) => renderTab(item, item.id === value))}\n\t\t\t\t</div>\n\t\t\t\t{overflowItems.length > 0 && (\n\t\t\t\t\t<ActionMenu\n\t\t\t\t\t\tactions={overflowItems.map((item) => ({\n\t\t\t\t\t\t\tid: item.id,\n\t\t\t\t\t\t\tlabel: item.label,\n\t\t\t\t\t\t\ticon: item.icon,\n\t\t\t\t\t\t\tonClick: () => handleSelect(item),\n\t\t\t\t\t\t}))}\n\t\t\t\t\t\talign=\"end\"\n\t\t\t\t\t\tcontentClassName=\"min-w-40\"\n\t\t\t\t\t\twidth=\"w-auto\"\n\t\t\t\t\t\tcloseOnSelect\n\t\t\t\t\t\tpreserveOrder\n\t\t\t\t\t\trenderTrigger={\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-label={strings.more}\n\t\t\t\t\t\t\t\tclassName={cn(TAB_BUTTON_BASE, TAB_INACTIVE, 'overflow-tab-bar--more')}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{moreContent}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nOverflowTabBar.displayName = 'OverflowTabBar';\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgBQ,EAAiB,EAChC,YACA,kBACA,aAAU,WACV,eACyB;CACzB,IAAMC,IAAeC,GAAa,GAAe,MAAsB;EACtE,A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UAAAoD;IACM,CAAA;GAET,CAAA,CAEE;EACD,CAAA,CAAA;;AAEP,CAAC;AAED,EAAe,cAAc"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "./affordance-geometry.generated-CL84ZN9A.js";
1
+ import { t as e } from "./affordance-geometry.generated-CCIXb2A1.js";
2
2
  //#region src/lib/navigation-row-recipes.ts
3
3
  var t = "box-border min-w-0 gap-space-md rounded-inner px-control-sm text-sm", n = `mx-0 ${e.navigationGuideStart} translate-x-0 px-space-sm`, r = {
4
4
  compact: {
@@ -26,4 +26,4 @@ var t = "box-border min-w-0 gap-space-md rounded-inner px-control-sm text-sm", n
26
26
  //#endregion
27
27
  export { r as n, t as r, n as t };
28
28
 
29
- //# sourceMappingURL=navigation-row-recipes-DQEXQcqY.js.map
29
+ //# sourceMappingURL=navigation-row-recipes-DlU-4QYO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-row-recipes-DQEXQcqY.js","names":["affordanceGeometry","navigationRowInlineClasses","navigationChildInsetClasses","navigationRowDensityRecipes"],"sources":["../src/lib/navigation-row-recipes.ts"],"sourcesContent":["import type { RowDensity } from './row-recipes';\nimport { affordanceGeometry } from './affordance-geometry.generated';\n\n/** Shared navigation geometry and primary-copy fallback. Density changes height,\n * never primary text size; owners may retain an explicit typography override. */\nexport const navigationRowInlineClasses = 'box-border min-w-0 gap-space-md rounded-inner px-control-sm text-sm';\n// Start the guide at the small-control inset plus half of the small caret glyph.\n// Derive both terms from their existing roots; a guide is not another theme knob.\nexport const navigationChildInsetClasses = `mx-0 ${affordanceGeometry.navigationGuideStart} translate-x-0 px-space-sm`;\nexport const navigationRowDensityRecipes = {\n compact: { size: 'sm', gap: 'gap-0', childGap: 'gap-0 py-0', height: 'h-action-sm', childHeight: 'h-action-xs' },\n default: { size: 'sm', gap: 'gap-space-2xs', childGap: 'gap-0 py-0', height: 'h-action-sm', childHeight: 'h-action-xs' },\n comfortable: { size: 'md', gap: 'gap-space-2xs', childGap: 'gap-space-2xs py-space-2xs', height: 'h-action', childHeight: 'h-action-sm' },\n} as const satisfies Record<RowDensity, { size: 'sm' | 'md'; gap: string; childGap: string; height: string; childHeight: string }>;\n"],"mappings":";;AAKA,IAAaC,IAA6B,uEAG7BC,IAA8B,QAAQF,EAAmB,qBAAqB,6BAC9EG,IAA8B;CAC1C,SAAS;EAAE,MAAM;EAAM,KAAK;EAAS,UAAU;EAAc,QAAQ;EAAe,aAAa;CAAc;CAC/G,SAAS;EAAE,MAAM;EAAM,KAAK;EAAiB,UAAU;EAAc,QAAQ;EAAe,aAAa;CAAc;CACvH,aAAa;EAAE,MAAM;EAAM,KAAK;EAAiB,UAAU;EAA8B,QAAQ;EAAY,aAAa;CAAc;AACzI"}
1
+ {"version":3,"file":"navigation-row-recipes-DlU-4QYO.js","names":["affordanceGeometry","navigationRowInlineClasses","navigationChildInsetClasses","navigationRowDensityRecipes"],"sources":["../src/lib/navigation-row-recipes.ts"],"sourcesContent":["import type { RowDensity } from './row-recipes';\nimport { affordanceGeometry } from './affordance-geometry.generated';\n\n/** Shared navigation geometry and primary-copy fallback. Density changes height,\n * never primary text size; owners may retain an explicit typography override. */\nexport const navigationRowInlineClasses = 'box-border min-w-0 gap-space-md rounded-inner px-control-sm text-sm';\n// Start the guide at the small-control inset plus half of the small caret glyph.\n// Derive both terms from their existing roots; a guide is not another theme knob.\nexport const navigationChildInsetClasses = `mx-0 ${affordanceGeometry.navigationGuideStart} translate-x-0 px-space-sm`;\nexport const navigationRowDensityRecipes = {\n compact: { size: 'sm', gap: 'gap-0', childGap: 'gap-0 py-0', height: 'h-action-sm', childHeight: 'h-action-xs' },\n default: { size: 'sm', gap: 'gap-space-2xs', childGap: 'gap-0 py-0', height: 'h-action-sm', childHeight: 'h-action-xs' },\n comfortable: { size: 'md', gap: 'gap-space-2xs', childGap: 'gap-space-2xs py-space-2xs', height: 'h-action', childHeight: 'h-action-sm' },\n} as const satisfies Record<RowDensity, { size: 'sm' | 'md'; gap: string; childGap: string; height: string; childHeight: string }>;\n"],"mappings":";;AAKA,IAAaC,IAA6B,uEAG7BC,IAA8B,QAAQF,EAAmB,qBAAqB,6BAC9EG,IAA8B;CAC1C,SAAS;EAAE,MAAM;EAAM,KAAK;EAAS,UAAU;EAAc,QAAQ;EAAe,aAAa;CAAc;CAC/G,SAAS;EAAE,MAAM;EAAM,KAAK;EAAiB,UAAU;EAAc,QAAQ;EAAe,aAAa;CAAc;CACvH,aAAa;EAAE,MAAM;EAAM,KAAK;EAAiB,UAAU;EAA8B,QAAQ;EAAY,aAAa;CAAc;AACzI"}
@@ -0,0 +1,352 @@
1
+ "use client";
2
+ import { c as e, u as t } from "./ui-provider-D2_TeLqw.js";
3
+ import { t as n } from "./utils-Cospvlj1.js";
4
+ import { s as r } from "./typography-CAr3dQhX.js";
5
+ import { n as i, o as a, t as o } from "./value-typography-Deb3yQZg.js";
6
+ import { useCallback as s } from "react";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ //#region src/lib/money-format.ts
9
+ function u(e) {
10
+ let t = e.trim();
11
+ if (!t) return "";
12
+ let n = t.lastIndexOf(","), r = t.lastIndexOf(".");
13
+ if (n >= 0 && r >= 0) {
14
+ let e = n > r ? "," : ".", i = e === "," ? "." : ",";
15
+ return t.replace(RegExp(`\\${i}`, "g"), "").replace(e, ".");
16
+ }
17
+ if (n >= 0) {
18
+ let [e, n = ""] = t.split(",");
19
+ return n.length > 0 && n.length <= 2 ? `${e.replace(/,/g, "")}.${n}` : t.replace(/,/g, "");
20
+ }
21
+ if (r >= 0) {
22
+ let [e, n = ""] = t.split(".");
23
+ if (n.length === 3 && e.length > 0) return t.replace(/\./g, "");
24
+ }
25
+ return t;
26
+ }
27
+ function d(e) {
28
+ if (e == null || e === "") return null;
29
+ if (typeof e == "number") return Number.isFinite(e) ? e : null;
30
+ let t = Number.parseFloat(u(e));
31
+ return Number.isFinite(t) ? t : null;
32
+ }
33
+ function f(e, t) {
34
+ return e === void 0 || !Number.isFinite(e) ? t : Math.min(100, Math.max(0, Math.trunc(e)));
35
+ }
36
+ function p(e, t, n = {
37
+ minimumFractionDigits: 2,
38
+ maximumFractionDigits: 2
39
+ }) {
40
+ let r = f(t, n.maximumFractionDigits), i = f(e, Math.min(n.minimumFractionDigits, r));
41
+ return {
42
+ minimumFractionDigits: i,
43
+ maximumFractionDigits: Math.max(i, r)
44
+ };
45
+ }
46
+ function m(e, t) {
47
+ if (!e) return {
48
+ minimumFractionDigits: 2,
49
+ maximumFractionDigits: 2
50
+ };
51
+ try {
52
+ let n = new Intl.NumberFormat(t, {
53
+ style: "currency",
54
+ currency: e
55
+ }).resolvedOptions();
56
+ return {
57
+ minimumFractionDigits: n.minimumFractionDigits ?? 2,
58
+ maximumFractionDigits: n.maximumFractionDigits ?? 2
59
+ };
60
+ } catch {
61
+ return {
62
+ minimumFractionDigits: 2,
63
+ maximumFractionDigits: 2
64
+ };
65
+ }
66
+ }
67
+ function h(e, t, n) {
68
+ return e.formatToParts(t).map((e) => e.type === "currency" ? n : e.type === "minusSign" ? e.value.replace("-", "−") : e.value).join("");
69
+ }
70
+ function g({ amount: e, currency: t, locale: n, currencyDisplay: r = "symbol", minimumFractionDigits: i, maximumFractionDigits: o, formatMode: s, symbol: c }) {
71
+ let l = d(e);
72
+ if (l === null) return null;
73
+ let u = t ?? "", f = p(i, o, m(u, n));
74
+ if (s === "decimal" || !u) return a(new Intl.NumberFormat(n, f), l);
75
+ if (s === "with_code") return `${a(new Intl.NumberFormat(n, f), l)} ${u}`.trim();
76
+ try {
77
+ let e = new Intl.NumberFormat(n, {
78
+ ...f,
79
+ style: "currency",
80
+ currency: u,
81
+ currencyDisplay: r
82
+ });
83
+ return c ? h(e, l, c) : a(e, l);
84
+ } catch {
85
+ let e = a(new Intl.NumberFormat(n, f), l);
86
+ return c ? `${c}${e}` : `${e} ${u}`.trim();
87
+ }
88
+ }
89
+ //#endregion
90
+ //#region src/components/primitives/money.tsx
91
+ function _(e) {
92
+ return e === void 0 || !Number.isFinite(e) || e <= 0 ? 100 : e;
93
+ }
94
+ function v(e) {
95
+ let t = d(e.amount);
96
+ return t === null ? null : e.unit === "minor" ? t / _(e.minorUnitScale) : t;
97
+ }
98
+ function y(n = {}) {
99
+ let r = e(), i = t(), { currency: a, unit: o, minorUnitScale: c, symbol: l, locale: u, currencyDisplay: d, minimumFractionDigits: f, maximumFractionDigits: p, formatMode: m, emptyLabel: h } = n;
100
+ return s((e, t = {}) => {
101
+ let n = {
102
+ currency: a,
103
+ unit: o,
104
+ minorUnitScale: c,
105
+ symbol: l,
106
+ locale: u,
107
+ currencyDisplay: d,
108
+ minimumFractionDigits: f,
109
+ maximumFractionDigits: p,
110
+ formatMode: m,
111
+ emptyLabel: h,
112
+ ...t
113
+ }, s = n.emptyLabel ?? "—", _ = v({
114
+ amount: e,
115
+ unit: n.unit,
116
+ minorUnitScale: n.minorUnitScale
117
+ });
118
+ return _ === null ? s : g({
119
+ amount: _,
120
+ currency: n.currency ?? i.defaultCurrency ?? "USD",
121
+ symbol: n.symbol,
122
+ locale: n.locale ?? r.locale,
123
+ currencyDisplay: n.currencyDisplay,
124
+ minimumFractionDigits: n.minimumFractionDigits,
125
+ maximumFractionDigits: n.maximumFractionDigits,
126
+ formatMode: n.formatMode ?? i.formatMode ?? "with_code"
127
+ }) ?? s;
128
+ }, [
129
+ a,
130
+ o,
131
+ c,
132
+ l,
133
+ u,
134
+ d,
135
+ f,
136
+ p,
137
+ m,
138
+ h,
139
+ r.locale,
140
+ i.defaultCurrency,
141
+ i.formatMode
142
+ ]);
143
+ }
144
+ var b = {
145
+ type: "main",
146
+ weight: "medium"
147
+ };
148
+ function x(e) {
149
+ return e === "left" ? {
150
+ text: "text-start",
151
+ justify: "justify-start"
152
+ } : e === "center" ? {
153
+ text: "text-center",
154
+ justify: "justify-center"
155
+ } : {
156
+ text: "text-end",
157
+ justify: "justify-end"
158
+ };
159
+ }
160
+ function S({ amount: a, currency: s, unit: u = "major", minorUnitScale: d, symbol: f, locale: p, currencyDisplay: m, minimumFractionDigits: h, maximumFractionDigits: _, formatMode: y, emptyLabel: S = "—", size: C, align: w = "right", weight: T, type: E, tag: D = "span", lineHeight: O, numeric: k, secondary: A, displayMode: ee, layout: te, secondaryEmphasis: j = "discrete", separator: M = "·", className: N, ref: P, ...F }) {
161
+ let I = e(), L = t(), R = i({
162
+ size: C,
163
+ type: E,
164
+ weight: T,
165
+ lineHeight: O
166
+ }, b), { size: z, type: B, weight: V, lineHeight: H } = R, U = s ?? L.defaultCurrency ?? "USD", W = v({
167
+ amount: a,
168
+ unit: u,
169
+ minorUnitScale: d
170
+ }), G = W === null ? null : g({
171
+ amount: W,
172
+ currency: U,
173
+ symbol: f,
174
+ locale: p ?? I.locale,
175
+ currencyDisplay: m,
176
+ minimumFractionDigits: h,
177
+ maximumFractionDigits: _,
178
+ formatMode: y ?? L.formatMode ?? "with_code"
179
+ });
180
+ if (G === null) {
181
+ let e = o(R, T);
182
+ return /* @__PURE__ */ c(r, {
183
+ ref: P,
184
+ tag: D,
185
+ size: e.size,
186
+ align: w,
187
+ weight: e.weight,
188
+ type: e.type,
189
+ lineHeight: e.lineHeight,
190
+ numeric: k,
191
+ className: n("money--component inline tabular-nums", N),
192
+ ...F,
193
+ children: S
194
+ });
195
+ }
196
+ let K = A ? v(A) : null, q = A?.currency ?? L.displayCurrency ?? U, J = ee ?? (L.dualPricingEnabled ? L.displayMode : void 0) ?? "dual";
197
+ if (K === null || j === "hidden" || J === "default_only" || J === "dynamic" && q === U || !A) return /* @__PURE__ */ c(r, {
198
+ ref: P,
199
+ tag: D,
200
+ size: z,
201
+ align: w,
202
+ weight: V,
203
+ type: B,
204
+ lineHeight: H,
205
+ numeric: k,
206
+ className: n("money--component inline whitespace-nowrap tabular-nums", N),
207
+ ...F,
208
+ children: G
209
+ });
210
+ let Y = g({
211
+ amount: K,
212
+ currency: q,
213
+ symbol: A.symbol,
214
+ locale: p ?? I.locale,
215
+ currencyDisplay: A.currencyDisplay ?? m,
216
+ minimumFractionDigits: A.minimumFractionDigits ?? h,
217
+ maximumFractionDigits: A.maximumFractionDigits ?? _,
218
+ formatMode: A.formatMode ?? y ?? L.formatMode ?? "with_code"
219
+ }), ne = te ?? (L.dualPricingDisplay === "inline" ? "inline" : "stacked"), X = j === "match" ? z : j === "muted" ? "xs" : "xxs", Z = j === "match" ? B : j === "muted" ? "secondary" : "discrete", Q = j === "match" ? V : "regular", $ = x(w);
220
+ return ne === "inline" ? /* @__PURE__ */ l(r, {
221
+ ref: P,
222
+ tag: D,
223
+ size: z,
224
+ align: w,
225
+ type: B,
226
+ weight: V === "inherit" ? "inherit" : void 0,
227
+ lineHeight: H,
228
+ numeric: k,
229
+ className: n("money--component money--inline inline-flex items-baseline gap-space-xs whitespace-nowrap tabular-nums", $.justify, N),
230
+ ...F,
231
+ children: [
232
+ /* @__PURE__ */ c(r, {
233
+ tag: "span",
234
+ size: z,
235
+ weight: V,
236
+ type: B,
237
+ lineHeight: H,
238
+ numeric: k,
239
+ className: "money--primary",
240
+ children: G
241
+ }),
242
+ /* @__PURE__ */ c("span", {
243
+ className: "money--separator inline-flex shrink-0 items-center text-muted-foreground",
244
+ "aria-hidden": "true",
245
+ children: M
246
+ }),
247
+ /* @__PURE__ */ c(r, {
248
+ tag: "span",
249
+ size: X,
250
+ weight: Q,
251
+ type: Z,
252
+ lineHeight: H,
253
+ numeric: k,
254
+ className: "money--secondary",
255
+ children: Y
256
+ })
257
+ ]
258
+ }) : /* @__PURE__ */ l(r, {
259
+ ref: P,
260
+ tag: D,
261
+ size: z,
262
+ align: w,
263
+ type: B,
264
+ weight: V === "inherit" ? "inherit" : void 0,
265
+ lineHeight: "tight",
266
+ numeric: k,
267
+ className: n("money--component money--stacked inline-flex flex-col whitespace-nowrap tabular-nums", $.text, N),
268
+ ...F,
269
+ children: [/* @__PURE__ */ c(r, {
270
+ tag: "span",
271
+ size: z,
272
+ align: w,
273
+ weight: V,
274
+ type: B,
275
+ lineHeight: "tight",
276
+ numeric: k,
277
+ className: "money--primary",
278
+ children: G
279
+ }), /* @__PURE__ */ c(r, {
280
+ tag: "span",
281
+ size: X,
282
+ align: w,
283
+ weight: Q,
284
+ type: Z,
285
+ lineHeight: "tight",
286
+ numeric: k,
287
+ className: "money--secondary",
288
+ children: Y
289
+ })]
290
+ });
291
+ }
292
+ //#endregion
293
+ //#region src/components/primitives/number.tsx
294
+ var C = {
295
+ type: "main",
296
+ weight: "regular"
297
+ };
298
+ function w(e) {
299
+ if (e == null || e === "") return null;
300
+ let t = typeof e == "number" ? e : globalThis.Number.parseFloat(e);
301
+ return globalThis.Number.isFinite(t) ? t : null;
302
+ }
303
+ function T(e, t, n) {
304
+ let r = w(e);
305
+ return r === null ? null : a(new Intl.NumberFormat(t, n), r);
306
+ }
307
+ function E({ value: t, locale: a, options: s, emptyLabel: l = "—", size: u, align: d = "right", weight: f, type: p, className: m, ref: h, ...g }) {
308
+ let _ = e(), v = i({
309
+ size: u,
310
+ type: p,
311
+ weight: f
312
+ }, C), y = T(t, a ?? _.locale, s), b = y === null ? o(v, f) : v;
313
+ return /* @__PURE__ */ c(r, {
314
+ ref: h,
315
+ tag: "span",
316
+ size: b.size,
317
+ align: d,
318
+ weight: b.weight,
319
+ type: b.type,
320
+ lineHeight: b.lineHeight,
321
+ className: n("number--component inline tabular-nums", m),
322
+ ...g,
323
+ children: y ?? l
324
+ });
325
+ }
326
+ function D({ value: t, locale: s, scaled: l = !1, options: u, emptyLabel: d = "—", size: f, align: p = "right", weight: m, type: h, className: g, ref: _, ...v }) {
327
+ let y = e(), b = i({
328
+ size: f,
329
+ type: h,
330
+ weight: m
331
+ }, C), x = w(t), S = x === null ? null : a(new Intl.NumberFormat(s ?? y.locale, {
332
+ style: "percent",
333
+ maximumFractionDigits: 1,
334
+ ...u
335
+ }), l ? x / 100 : x), T = S === null ? o(b, m) : b;
336
+ return /* @__PURE__ */ c(r, {
337
+ ref: _,
338
+ tag: "span",
339
+ size: T.size,
340
+ align: p,
341
+ weight: T.weight,
342
+ type: T.type,
343
+ lineHeight: T.lineHeight,
344
+ className: n("percent--component inline tabular-nums", g),
345
+ ...v,
346
+ children: S ?? d
347
+ });
348
+ }
349
+ //#endregion
350
+ export { g as a, y as i, D as n, S as r, E as t };
351
+
352
+ //# sourceMappingURL=number-CKRBYmZK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-CKRBYmZK.js","names":["Number","useFormattingConfig","useMoneyConfig","cn","Text","useValueTypography","formatWithMinusSign","emptyValueTypography","normalizeDecimalString","trimmed","value","comma","dot","decimalSeparator","groupingSeparator","head","tail","parseMoneyAmount","amount","parsed","normalizeFractionDigits","fallback","resolveFractionDigits","normalizedMaximum","maximumFractionDigits","normalizedMinimum","minimumFractionDigits","resolveCurrencyFractionDigits","currency","resolved","locale","replaceCurrencyPart","formatter","part","symbol","formatMoneyAmount","resolvedCurrency","numberOptions","formatMode","formattedNumber","normalizeMinorUnitScale","resolveMajorAmount","useMoneyFormatter","formatting","money","defaults","useCallback","options","overrides","resolvedEmptyLabel","major","unit","minorUnitScale","currencyDisplay","emptyLabel","MONEY_ROLE","getAlignmentClasses","align","Money","sizeProp","weightProp","typeProp","lineHeightProp","props","typography","primaryAmount","primaryLabel","empty","className","secondaryAmount","secondary","resolvedSecondaryCurrency","resolvedDisplayMode","displayMode","secondaryEmphasis","secondaryLabel","resolvedLayout","layout","secondarySize","size","secondaryType","type","secondaryWeight","weight","alignment","separator","NUMBER_ROLE","parseNumericValue","renderNumberLabel","Number$1","label","Percent","scaled"],"sources":["../src/lib/money-format.ts","../src/components/primitives/money.tsx","../src/components/primitives/number.tsx"],"sourcesContent":["/**\n * Shared money formatting for the Money primitive and metric surfaces.\n *\n * One formatter keeps currency labels, fraction digits and format modes\n * identical wherever an amount is shown. Components resolve locale, currency\n * and format mode from UIProvider before calling it.\n */\nimport type { MoneyFormatMode } from './ui-provider/types';\nimport { formatWithMinusSign, MINUS_SIGN } from './format';\n\n/** A numeric amount or an unformatted decimal string. */\nexport type MoneyAmountInput = number | string | null | undefined;\n\nexport interface FormatMoneyAmountOptions {\n\t/** Major-unit amount. Strings accept either decimal separator. */\n\tamount: MoneyAmountInput;\n\t/** ISO 4217 currency code; an empty value formats as a plain decimal. */\n\tcurrency?: string | null;\n\t/** BCP-47 locale for Intl formatting. */\n\tlocale?: string;\n\t/** Intl currency label style when the format mode uses currency formatting. */\n\tcurrencyDisplay?: Intl.NumberFormatOptions['currencyDisplay'];\n\t/** Minimum decimal digits. Defaults to the currency's Intl convention. */\n\tminimumFractionDigits?: number;\n\t/** Maximum decimal digits. Defaults to the currency's Intl convention. */\n\tmaximumFractionDigits?: number;\n\t/** Provider format policy: decimal, with_code, with_symbol or locale_aware. */\n\tformatMode?: MoneyFormatMode;\n\t/** Consumer-resolved symbol; Intl placement is preserved. */\n\tsymbol?: string | null;\n}\n\nfunction normalizeDecimalString(value: string) {\n\tconst trimmed = value.trim();\n\tif (!trimmed) return '';\n\n\tconst comma = trimmed.lastIndexOf(',');\n\tconst dot = trimmed.lastIndexOf('.');\n\n\tif (comma >= 0 && dot >= 0) {\n\t\tconst decimalSeparator = comma > dot ? ',' : '.';\n\t\tconst groupingSeparator = decimalSeparator === ',' ? '.' : ',';\n\t\treturn trimmed\n\t\t\t.replace(new RegExp(`\\\\${groupingSeparator}`, 'g'), '')\n\t\t\t.replace(decimalSeparator, '.');\n\t}\n\n\tif (comma >= 0) {\n\t\tconst [head, tail = ''] = trimmed.split(',');\n\t\tif (tail.length > 0 && tail.length <= 2) return `${head.replace(/,/g, '')}.${tail}`;\n\t\treturn trimmed.replace(/,/g, '');\n\t}\n\n\tif (dot >= 0) {\n\t\tconst [head, tail = ''] = trimmed.split('.');\n\t\tif (tail.length === 3 && head.length > 0) return trimmed.replace(/\\./g, '');\n\t}\n\n\treturn trimmed;\n}\n\nexport function parseMoneyAmount(amount: MoneyAmountInput): number | null {\n\tif (amount === null || amount === undefined || amount === '') return null;\n\tif (typeof amount === 'number') return Number.isFinite(amount) ? amount : null;\n\tconst parsed = Number.parseFloat(normalizeDecimalString(amount));\n\treturn Number.isFinite(parsed) ? parsed : null;\n}\n\nfunction normalizeFractionDigits(value: number | undefined, fallback: number) {\n\tif (value === undefined || !Number.isFinite(value)) return fallback;\n\treturn Math.min(100, Math.max(0, Math.trunc(value)));\n}\n\nfunction resolveFractionDigits(\n\tminimumFractionDigits?: number,\n\tmaximumFractionDigits?: number,\n\tfallback = { minimumFractionDigits: 2, maximumFractionDigits: 2 },\n) {\n\tconst normalizedMaximum = normalizeFractionDigits(\n\t\tmaximumFractionDigits,\n\t\tfallback.maximumFractionDigits,\n\t);\n\tconst normalizedMinimum = normalizeFractionDigits(\n\t\tminimumFractionDigits,\n\t\tMath.min(fallback.minimumFractionDigits, normalizedMaximum),\n\t);\n\n\treturn {\n\t\tminimumFractionDigits: normalizedMinimum,\n\t\tmaximumFractionDigits: Math.max(normalizedMinimum, normalizedMaximum),\n\t};\n}\n\nfunction resolveCurrencyFractionDigits(currency: string, locale?: string) {\n\tif (!currency) return { minimumFractionDigits: 2, maximumFractionDigits: 2 };\n\ttry {\n\t\tconst resolved = new Intl.NumberFormat(locale, {\n\t\t\tstyle: 'currency',\n\t\t\tcurrency,\n\t\t}).resolvedOptions();\n\t\treturn {\n\t\t\tminimumFractionDigits: resolved.minimumFractionDigits ?? 2,\n\t\t\tmaximumFractionDigits: resolved.maximumFractionDigits ?? 2,\n\t\t};\n\t} catch {\n\t\treturn { minimumFractionDigits: 2, maximumFractionDigits: 2 };\n\t}\n}\n\nfunction replaceCurrencyPart(\n\tformatter: Intl.NumberFormat,\n\tvalue: number,\n\tsymbol: string,\n) {\n\treturn formatter\n\t\t.formatToParts(value)\n\t\t.map((part) => part.type === 'currency' ? symbol : part.type === 'minusSign' ? part.value.replace('-', MINUS_SIGN) : part.value)\n\t\t.join('');\n}\n\nexport function formatMoneyAmount({\n\tamount,\n\tcurrency,\n\tlocale,\n\tcurrencyDisplay = 'symbol',\n\tminimumFractionDigits,\n\tmaximumFractionDigits,\n\tformatMode,\n\tsymbol,\n}: FormatMoneyAmountOptions) {\n\tconst value = parseMoneyAmount(amount);\n\tif (value === null) return null;\n\n\tconst resolvedCurrency = currency ?? '';\n\tconst numberOptions: Intl.NumberFormatOptions = resolveFractionDigits(\n\t\tminimumFractionDigits,\n\t\tmaximumFractionDigits,\n\t\tresolveCurrencyFractionDigits(resolvedCurrency, locale),\n\t);\n\n\tif (formatMode === 'decimal' || !resolvedCurrency) {\n\t\treturn formatWithMinusSign(new Intl.NumberFormat(locale, numberOptions), value);\n\t}\n\n\tif (formatMode === 'with_code') {\n\t\treturn `${formatWithMinusSign(new Intl.NumberFormat(locale, numberOptions), value)} ${resolvedCurrency}`.trim();\n\t}\n\n\ttry {\n\t\tconst formatter = new Intl.NumberFormat(locale, {\n\t\t\t...numberOptions,\n\t\t\tstyle: 'currency',\n\t\t\tcurrency: resolvedCurrency,\n\t\t\tcurrencyDisplay,\n\t\t});\n\t\treturn symbol\n\t\t\t? replaceCurrencyPart(formatter, value, symbol)\n\t\t\t: formatWithMinusSign(formatter, value);\n\t} catch {\n\t\tconst formattedNumber = formatWithMinusSign(new Intl.NumberFormat(locale, numberOptions), value);\n\t\treturn symbol\n\t\t\t? `${symbol}${formattedNumber}`\n\t\t\t: `${formattedNumber} ${resolvedCurrency}`.trim();\n\t}\n}\n","import { useCallback, type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY } from '../../lib/format';\nimport { formatMoneyAmount, parseMoneyAmount } from '../../lib/money-format';\nimport {\n\tuseFormattingConfig,\n\tuseMoneyConfig,\n\ttype MoneyDisplayMode,\n\ttype MoneyFormatMode,\n} from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n\nexport type MoneyUnit = 'major' | 'minor';\nexport type MoneyLayout = 'inline' | 'stacked';\nexport type MoneySecondaryEmphasis = 'discrete' | 'muted' | 'match' | 'hidden';\n\n/** A secondary monetary value rendered by the canonical `<Money>` primitive. */\nexport interface MoneyValue {\n\t/** Numeric amount or an unformatted decimal string. */\n\tamount?: number | string | null;\n\t/** ISO 4217 currency code. Falls back to `UIProvider.money.defaultCurrency`. */\n\tcurrency?: string | null;\n\t/** Unit of the incoming amount. `minor` converts cents/pence before formatting. */\n\tunit?: MoneyUnit;\n\t/** Number of minor units in one major unit. Defaults to 100. */\n\tminorUnitScale?: number;\n\t/** Optional consumer-resolved symbol. Intl placement is preserved. */\n\tsymbol?: string | null;\n\t/** Intl currency label style when the resolved format mode uses currency formatting. */\n\tcurrencyDisplay?: Intl.NumberFormatOptions['currencyDisplay'];\n\t/** Minimum decimal digits. Defaults to the currency's Intl convention. */\n\tminimumFractionDigits?: number;\n\t/** Maximum decimal digits. Defaults to the currency's Intl convention. */\n\tmaximumFractionDigits?: number;\n\t/** Per-value override for the UIProvider money format policy. */\n\tformatMode?: MoneyFormatMode;\n}\n\nexport interface MoneyProps extends SpanProps, MoneyValue {\n\t/** Ref to the semantic root selected by `tag`. */\n\tref?: Ref<HTMLElement>;\n\t/** BCP-47 locale override. Falls back to `UIProvider.formatting.locale`. */\n\tlocale?: string;\n\t/** Content rendered, with the shared empty treatment, when the amount is absent or cannot be parsed. */\n\temptyLabel?: ReactNode;\n\t/**\n\t * Typography size for the primary value (and a `match` secondary). Defaults to\n\t * the provider text size; inside running text, the surrounding size.\n\t */\n\tsize?: TextSize;\n\t/** Inline text alignment. Defaults to right alignment for numeric scanning. */\n\talign?: TextProps['align'];\n\t/** Weight of the primary value. Defaults to `medium`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\t/** Semantic root element used by the typography primitive. */\n\ttag?: TextProps['tag'];\n\t/** Line-height preset applied to the root value. Defaults to `normal`; inside running text, the surrounding leading. */\n\tlineHeight?: TextProps['lineHeight'];\n\t/**\n\t * Opt-in monospace figures. Amounts already render in the sans UI font with\n\t * tabular figures; reserve this for code-like ledgers. Defaults to `false`.\n\t */\n\tnumeric?: TextProps['numeric'];\n\t/**\n\t * Optional converted/display value. Passing it is an explicit request to\n\t * render both values unless `displayMode=\"default_only\"` or\n\t * `secondaryEmphasis=\"hidden\"` is set.\n\t */\n\tsecondary?: MoneyValue | null;\n\t/**\n\t * Controls whether the secondary value is visible. `dynamic` shows it only\n\t * when the two currency codes differ. When omitted, an explicitly supplied\n\t * `secondary` renders; an enabled UIProvider money policy can narrow it.\n\t */\n\tdisplayMode?: MoneyDisplayMode;\n\t/** Pair layout. Falls back to the UIProvider `dualPricingDisplay` policy. */\n\tlayout?: MoneyLayout;\n\t/** Visual prominence of a secondary value. */\n\tsecondaryEmphasis?: MoneySecondaryEmphasis;\n\t/** Inline separator. Defaults to a quiet middle dot; pass an arrow for conversion flows. */\n\tseparator?: ReactNode;\n}\n\nfunction normalizeMinorUnitScale(value: number | undefined) {\n\tif (value === undefined || !Number.isFinite(value) || value <= 0) return 100;\n\treturn value;\n}\n\nfunction resolveMajorAmount(value: MoneyValue): number | null {\n\tconst parsed = parseMoneyAmount(value.amount);\n\tif (parsed === null) return null;\n\treturn value.unit === 'minor'\n\t\t? parsed / normalizeMinorUnitScale(value.minorUnitScale)\n\t\t: parsed;\n}\n\n/** Options for formatting money as text; they mirror the Money primitive's value props. */\nexport type MoneyFormatterOptions = Omit<MoneyValue, 'amount'> & {\n\t/** BCP-47 locale override. Falls back to `UIProvider.formatting.locale`. */\n\tlocale?: string;\n\t/** Text returned when the amount is absent or cannot be parsed. */\n\temptyLabel?: string;\n};\n\n/** Formats an amount as text; per-call options win over the hook's defaults. */\nexport type MoneyFormatter = (amount: MoneyValue['amount'], options?: MoneyFormatterOptions) => string;\n\n/**\n * Text formatting with the Money primitive's rules and UIProvider defaults, for\n * places that need a string: button labels, toasts, activity text, aria labels.\n * Pass defaults such as `{ currency: 'USD' }` once for a screen whose amounts\n * share a currency.\n */\nexport function useMoneyFormatter(defaults: MoneyFormatterOptions = {}): MoneyFormatter {\n\tconst formatting = useFormattingConfig();\n\tconst money = useMoneyConfig();\n\tconst {\n\t\tcurrency, unit, minorUnitScale, symbol, locale, currencyDisplay,\n\t\tminimumFractionDigits, maximumFractionDigits, formatMode, emptyLabel,\n\t} = defaults;\n\treturn useCallback<MoneyFormatter>((amount, overrides = {}) => {\n\t\tconst options: MoneyFormatterOptions = {\n\t\t\tcurrency, unit, minorUnitScale, symbol, locale, currencyDisplay,\n\t\t\tminimumFractionDigits, maximumFractionDigits, formatMode, emptyLabel,\n\t\t\t...overrides,\n\t\t};\n\t\tconst resolvedEmptyLabel = options.emptyLabel ?? EMPTY;\n\t\tconst major = resolveMajorAmount({ amount, unit: options.unit, minorUnitScale: options.minorUnitScale });\n\t\tif (major === null) return resolvedEmptyLabel;\n\t\treturn formatMoneyAmount({\n\t\t\tamount: major,\n\t\t\tcurrency: options.currency ?? money.defaultCurrency ?? 'USD',\n\t\t\tsymbol: options.symbol,\n\t\t\tlocale: options.locale ?? formatting.locale,\n\t\t\tcurrencyDisplay: options.currencyDisplay,\n\t\t\tminimumFractionDigits: options.minimumFractionDigits,\n\t\t\tmaximumFractionDigits: options.maximumFractionDigits,\n\t\t\tformatMode: options.formatMode ?? money.formatMode ?? 'with_code',\n\t\t}) ?? resolvedEmptyLabel;\n\t}, [\n\t\tcurrency, unit, minorUnitScale, symbol, locale, currencyDisplay,\n\t\tminimumFractionDigits, maximumFractionDigits, formatMode, emptyLabel,\n\t\tformatting.locale, money.defaultCurrency, money.formatMode,\n\t]);\n}\n\n/** Standalone amounts read as foreground medium; in a sentence they take its typography. */\nconst MONEY_ROLE: ValueTypographyRole = { type: 'main', weight: 'medium' };\n\n/** Logical alignment: `left`/`right` follow the reading direction, like `Text`. */\nfunction getAlignmentClasses(align: TextProps['align']) {\n\tif (align === 'left') return { text: 'text-start', justify: 'justify-start' };\n\tif (align === 'center') return { text: 'text-center', justify: 'justify-center' };\n\treturn { text: 'text-end', justify: 'justify-end' };\n}\n\n/**\n * Canonical monetary display primitive.\n *\n * It owns major/minor-unit conversion, locale-aware formatting, empty values,\n * and optional inline/stacked dual-currency display. Consumers should use\n * this component instead of composing separate money-display or currency-pair\n * wrappers.\n */\nexport function Money({\n\tamount,\n\tcurrency,\n\tunit = 'major',\n\tminorUnitScale,\n\tsymbol,\n\tlocale,\n\tcurrencyDisplay,\n\tminimumFractionDigits,\n\tmaximumFractionDigits,\n\tformatMode,\n\temptyLabel = EMPTY,\n\tsize: sizeProp,\n\talign = 'right',\n\tweight: weightProp,\n\ttype: typeProp,\n\ttag = 'span',\n\tlineHeight: lineHeightProp,\n\tnumeric,\n\tsecondary,\n\tdisplayMode,\n\tlayout,\n\tsecondaryEmphasis = 'discrete',\n\tseparator = '·',\n\tclassName,\n\tref,\n\t...props\n}: MoneyProps) {\n\tconst formatting = useFormattingConfig();\n\tconst money = useMoneyConfig();\n\tconst typography = useValueTypography(\n\t\t{ size: sizeProp, type: typeProp, weight: weightProp, lineHeight: lineHeightProp },\n\t\tMONEY_ROLE,\n\t);\n\tconst { size, type, weight, lineHeight } = typography;\n\tconst resolvedCurrency = currency ?? money.defaultCurrency ?? 'USD';\n\tconst primaryAmount = resolveMajorAmount({ amount, unit, minorUnitScale });\n\tconst primaryLabel = primaryAmount === null\n\t\t? null\n\t\t: formatMoneyAmount({\n\t\t\t\tamount: primaryAmount,\n\t\t\t\tcurrency: resolvedCurrency,\n\t\t\t\tsymbol,\n\t\t\t\tlocale: locale ?? formatting.locale,\n\t\t\t\tcurrencyDisplay,\n\t\t\t\tminimumFractionDigits,\n\t\t\t\tmaximumFractionDigits,\n\t\t\t\tformatMode: formatMode ?? money.formatMode ?? 'with_code',\n\t\t\t});\n\n\tif (primaryLabel === null) {\n\t\tconst empty = emptyValueTypography(typography, weightProp);\n\t\treturn (\n\t\t\t<Text\n\t\t\t\tref={ref}\n\t\t\t\ttag={tag}\n\t\t\t\tsize={empty.size}\n\t\t\t\talign={align}\n\t\t\t\tweight={empty.weight}\n\t\t\t\ttype={empty.type}\n\t\t\t\tlineHeight={empty.lineHeight}\n\t\t\t\tnumeric={numeric}\n\t\t\t\tclassName={cn('money--component inline tabular-nums', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{emptyLabel}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\tconst secondaryAmount = secondary ? resolveMajorAmount(secondary) : null;\n\tconst resolvedSecondaryCurrency = secondary?.currency ?? money.displayCurrency ?? resolvedCurrency;\n\tconst resolvedDisplayMode = displayMode\n\t\t?? (money.dualPricingEnabled ? money.displayMode : undefined)\n\t\t?? 'dual';\n\tconst hasDifferentCurrencies = resolvedSecondaryCurrency !== resolvedCurrency;\n\tconst shouldRenderSecondary = secondaryAmount !== null\n\t\t&& secondaryEmphasis !== 'hidden'\n\t\t&& resolvedDisplayMode !== 'default_only'\n\t\t&& (resolvedDisplayMode !== 'dynamic' || hasDifferentCurrencies);\n\n\tif (!shouldRenderSecondary || !secondary) {\n\t\treturn (\n\t\t\t<Text\n\t\t\t\tref={ref}\n\t\t\t\ttag={tag}\n\t\t\t\tsize={size}\n\t\t\t\talign={align}\n\t\t\t\tweight={weight}\n\t\t\t\ttype={type}\n\t\t\t\tlineHeight={lineHeight}\n\t\t\t\tnumeric={numeric}\n\t\t\t\tclassName={cn('money--component inline whitespace-nowrap tabular-nums', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{primaryLabel}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\tconst secondaryLabel = formatMoneyAmount({\n\t\tamount: secondaryAmount,\n\t\tcurrency: resolvedSecondaryCurrency,\n\t\tsymbol: secondary.symbol,\n\t\tlocale: locale ?? formatting.locale,\n\t\tcurrencyDisplay: secondary.currencyDisplay ?? currencyDisplay,\n\t\tminimumFractionDigits: secondary.minimumFractionDigits ?? minimumFractionDigits,\n\t\tmaximumFractionDigits: secondary.maximumFractionDigits ?? maximumFractionDigits,\n\t\tformatMode: secondary.formatMode ?? formatMode ?? money.formatMode ?? 'with_code',\n\t});\n\tconst resolvedLayout: MoneyLayout = layout\n\t\t?? (money.dualPricingDisplay === 'inline' ? 'inline' : 'stacked');\n\tconst secondarySize: TextSize | undefined = secondaryEmphasis === 'match'\n\t\t? size\n\t\t: secondaryEmphasis === 'muted'\n\t\t\t? 'xs'\n\t\t\t: 'xxs';\n\tconst secondaryType: TextProps['type'] = secondaryEmphasis === 'match'\n\t\t? type\n\t\t: secondaryEmphasis === 'muted'\n\t\t\t? 'secondary'\n\t\t\t: 'discrete';\n\tconst secondaryWeight: TextProps['weight'] = secondaryEmphasis === 'match' ? weight : 'regular';\n\tconst alignment = getAlignmentClasses(align);\n\n\tif (resolvedLayout === 'inline') {\n\t\treturn (\n\t\t\t<Text\n\t\t\t\tref={ref}\n\t\t\t\ttag={tag}\n\t\t\t\tsize={size}\n\t\t\t\talign={align}\n\t\t\t\ttype={type}\n\t\t\t\tweight={weight === 'inherit' ? 'inherit' : undefined}\n\t\t\t\tlineHeight={lineHeight}\n\t\t\t\tnumeric={numeric}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'money--component money--inline inline-flex items-baseline gap-space-xs whitespace-nowrap tabular-nums',\n\t\t\t\t\talignment.justify,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<Text tag=\"span\" size={size} weight={weight} type={type} lineHeight={lineHeight} numeric={numeric} className=\"money--primary\">\n\t\t\t\t\t{primaryLabel}\n\t\t\t\t</Text>\n\t\t\t\t<span className=\"money--separator inline-flex shrink-0 items-center text-muted-foreground\" aria-hidden=\"true\">\n\t\t\t\t\t{separator}\n\t\t\t\t</span>\n\t\t\t\t<Text tag=\"span\" size={secondarySize} weight={secondaryWeight} type={secondaryType} lineHeight={lineHeight} numeric={numeric} className=\"money--secondary\">\n\t\t\t\t\t{secondaryLabel}\n\t\t\t\t</Text>\n\t\t\t</Text>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag={tag}\n\t\t\tsize={size}\n\t\t\talign={align}\n\t\t\ttype={type}\n\t\t\tweight={weight === 'inherit' ? 'inherit' : undefined}\n\t\t\tlineHeight=\"tight\"\n\t\t\tnumeric={numeric}\n\t\t\tclassName={cn(\n\t\t\t\t'money--component money--stacked inline-flex flex-col whitespace-nowrap tabular-nums',\n\t\t\t\talignment.text,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Text tag=\"span\" size={size} align={align} weight={weight} type={type} lineHeight=\"tight\" numeric={numeric} className=\"money--primary\">\n\t\t\t\t{primaryLabel}\n\t\t\t</Text>\n\t\t\t<Text tag=\"span\" size={secondarySize} align={align} weight={secondaryWeight} type={secondaryType} lineHeight=\"tight\" numeric={numeric} className=\"money--secondary\">\n\t\t\t\t{secondaryLabel}\n\t\t\t</Text>\n\t\t</Text>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY, formatWithMinusSign } from '../../lib/format';\nimport { useFormattingConfig } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n\nexport interface NumberProps extends SpanProps {\n\tvalue?: number | string | null;\n\t/** BCP-47 locale override. Falls back to `UIProvider.formatting.locale`. */\n\tlocale?: string;\n\t/** Passed to `Intl.NumberFormat`; for example `signDisplay: 'exceptZero'` for deltas. */\n\toptions?: Intl.NumberFormatOptions;\n\t/** Rendered with the shared empty treatment when the value is absent or unparsable. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/** Text size. Defaults to the provider text size; inside running text, the surrounding size. */\n\tsize?: TextSize;\n\t/** Text alignment. Defaults to `right` so columns of figures line up. */\n\talign?: TextProps['align'];\n\t/** Font weight. Defaults to `regular`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\tref?: Ref<HTMLSpanElement>;\n}\n\nexport interface PercentProps extends Omit<NumberProps, 'options'> {\n\t/** The value is already 0–100 rather than a 0–1 ratio. Defaults to `false`. */\n\tscaled?: boolean;\n\t/** Passed to `Intl.NumberFormat` after the percent style and one-decimal default. */\n\toptions?: Intl.NumberFormatOptions;\n\tref?: Ref<HTMLSpanElement>;\n}\n\nconst NUMBER_ROLE: ValueTypographyRole = { type: 'main', weight: 'regular' };\n\nfunction parseNumericValue(value: NumberProps['value']) {\n\tif (value === null || value === undefined || value === '') return null;\n\tconst parsed = typeof value === 'number' ? value : globalThis.Number.parseFloat(value);\n\treturn globalThis.Number.isFinite(parsed) ? parsed : null;\n}\n\nfunction renderNumberLabel(value: NumberProps['value'], locale?: string, options?: Intl.NumberFormatOptions) {\n\tconst parsed = parseNumericValue(value);\n\tif (parsed === null) return null;\n\treturn formatWithMinusSign(new Intl.NumberFormat(locale, options), parsed);\n}\n\n/**\n * A locale-formatted count or quantity in the sans UI font with tabular figures.\n * Negative values use the typographic minus sign (U+2212).\n */\nexport function Number({\n\tvalue,\n\tlocale,\n\toptions,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tclassName,\n\tref,\n\t...props\n}: NumberProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight }, NUMBER_ROLE);\n\tconst label = renderNumberLabel(value, locale ?? formatting.locale, options);\n\tconst typography = label === null ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('number--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label ?? emptyLabel}\n\t\t</Text>\n\t);\n}\n\n/**\n * A percentage in the sans UI font with tabular figures. Expects a 0–1 ratio\n * unless `scaled`; one decimal place by default; negative values use U+2212.\n */\nexport function Percent({\n\tvalue,\n\tlocale,\n\tscaled = false,\n\toptions,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tclassName,\n\tref,\n\t...props\n}: PercentProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight }, NUMBER_ROLE);\n\tconst parsed = parseNumericValue(value);\n\tconst label = parsed === null\n\t\t? null\n\t\t: formatWithMinusSign(new Intl.NumberFormat(locale ?? formatting.locale, {\n\t\t\t\tstyle: 'percent',\n\t\t\t\tmaximumFractionDigits: 1,\n\t\t\t\t...options,\n\t\t\t}), scaled ? parsed / 100 : parsed);\n\tconst typography = label === null ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('percent--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label ?? emptyLabel}\n\t\t</Text>\n\t);\n}\n"],"mappings":";;;;;;;;AAgCA,SAASQ,EAAuB,GAAe;CAC9C,IAAMC,IAAUC,EAAM,KAAK;CAC3B,IAAI,CAACD,GAAS,OAAO;CAErB,IAAME,IAAQF,EAAQ,YAAY,GAAG,GAC/BG,IAAMH,EAAQ,YAAY,GAAG;CAEnC,IAAIE,KAAS,KAAKC,KAAO,GAAG;EAC3B,IAAMC,IAAmBF,IAAQ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pB,IAAa1C,EAAoB,GACjC4B,IAAWxB,EAAmB;EAAE;EAAM;EAAM;CAAO,GAAGiF,CAAW,GACjEI,IAAQF,EAAkB9E,GAAOoB,KAAUa,EAAW,QAAQI,CAAO,GACrEiB,IAAa0B,MAAU,OAAOnF,EAAqBsB,GAAUsD,CAAM,IAAItD;CAE7E,OACC,kBAACzB,GAAD;EACM;EACL,KAAI;EACJ,MAAM4D,EAAW;EACV;EACP,QAAQA,EAAW;EACnB,MAAMA,EAAW;EACjB,YAAYA,EAAW;EACvB,WAAW7D,EAAG,yCAAyCiE,CAAS;EAChE,GAAIL;EAEH,UAAA2B,KAASpC;CACL,CAAA;AAER;AAMA,SAAgBqC,EAAQ,EACvB,UACA,WACA,YAAS,IACT,YACA,gBAAA,KACA,SACA,WAAQ,SACR,WACA,SACA,cACA,QACA,GAAG5B,KACa;CAChB,IAAMpB,IAAa1C,EAAoB,GACjC4B,IAAWxB,EAAmB;EAAE;EAAM;EAAM;CAAO,GAAGiF,CAAW,GACjEnE,IAASoE,EAAkB7E,CAAK,GAChCgF,IAAQvE,MAAW,OACtB,OACAb,EAAoB,IAAI,KAAK,aAAawB,KAAUa,EAAW,QAAQ;EACvE,OAAO;EACP,uBAAuB;EACvB,GAAGI;CACJ,CAAC,GAAG6C,IAASzE,IAAS,MAAMA,CAAM,GAC9B6C,IAAa0B,MAAU,OAAOnF,EAAqBsB,GAAUsD,CAAM,IAAItD;CAE7E,OACC,kBAACzB,GAAD;EACM;EACL,KAAI;EACJ,MAAM4D,EAAW;EACV;EACP,QAAQA,EAAW;EACnB,MAAMA,EAAW;EACjB,YAAYA,EAAW;EACvB,WAAW7D,EAAG,0CAA0CiE,CAAS;EACjE,GAAIL;EAEH,UAAA2B,KAASpC;CACL,CAAA;AAER"}
@@ -0,0 +1,34 @@
1
+ import * as e from "react";
2
+ //#region src/components/ui/overlay.recipes.ts
3
+ var t = "fixed inset-0 z-50 bg-(--overlay-backdrop)";
4
+ function n(e, t) {
5
+ typeof e == "function" ? e(t) : e && (e.current = t);
6
+ }
7
+ function r(e) {
8
+ let t = e.scrollTop > 1, n = e.scrollTop + e.clientHeight < e.scrollHeight - 1;
9
+ e.hasAttribute("data-scroll-start") !== t && e.toggleAttribute("data-scroll-start", t), e.hasAttribute("data-scroll-end") !== n && e.toggleAttribute("data-scroll-end", n);
10
+ }
11
+ function i(t) {
12
+ return e.useCallback((e) => {
13
+ if (n(t, e), !e) return;
14
+ let i = () => r(e);
15
+ i(), e.addEventListener("scroll", i, { passive: !0 });
16
+ let a = typeof ResizeObserver > "u" ? null : new ResizeObserver(i), o = () => {
17
+ if (a) {
18
+ a.disconnect(), a.observe(e);
19
+ for (let t of Array.from(e.children)) a.observe(t);
20
+ }
21
+ };
22
+ o();
23
+ let s = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
24
+ o(), i();
25
+ });
26
+ return s?.observe(e, { childList: !0 }), () => {
27
+ e.removeEventListener("scroll", i), a?.disconnect(), s?.disconnect(), n(t, null);
28
+ };
29
+ }, [t]);
30
+ }
31
+ //#endregion
32
+ export { i as n, t };
33
+
34
+ //# sourceMappingURL=overlay.recipes-CNO2S9V6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.recipes-CNO2S9V6.js","names":["React","React$1","modalBackdropRecipe","assignRef","ref","value","syncScrollEdges","start","node","end","useScrollEdges","forwardedRef","update","resize","observe","child","mutation"],"sources":["../src/components/ui/overlay.recipes.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * One modal scrim recipe: a plain tint from the shared semantic token. No\n * backdrop blur — the page behind a modal stays recognisable and the tint alone\n * separates the surface.\n */\nexport const modalBackdropRecipe = 'fixed inset-0 z-50 bg-(--overlay-backdrop)';\n\nfunction assignRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n\tif (typeof ref === 'function') ref(value);\n\telse if (ref) (ref as React.RefObject<T | null>).current = value;\n}\n\nfunction syncScrollEdges(node: HTMLElement) {\n\t// One pixel of tolerance absorbs fractional scroll positions under zoom.\n\tconst start = node.scrollTop > 1;\n\tconst end = node.scrollTop + node.clientHeight < node.scrollHeight - 1;\n\tif (node.hasAttribute('data-scroll-start') !== start) node.toggleAttribute('data-scroll-start', start);\n\tif (node.hasAttribute('data-scroll-end') !== end) node.toggleAttribute('data-scroll-end', end);\n}\n\n/**\n * Marks which edges of a scrolling modal region are hiding content:\n * `data-scroll-start` while content is scrolled out above, `data-scroll-end`\n * while more content remains below. The modal region recipe draws a rule only\n * on those edges, so a body that fits draws none. Attributes are written to the\n * node directly, so scrolling never re-renders the region.\n */\nexport function useScrollEdges<T extends HTMLElement>(forwardedRef?: React.Ref<T>): React.RefCallback<T> {\n\treturn React.useCallback((node: T | null) => {\n\t\tassignRef(forwardedRef, node);\n\t\tif (!node) return;\n\t\tconst update = () => syncScrollEdges(node);\n\t\tupdate();\n\t\tnode.addEventListener('scroll', update, { passive: true });\n\t\t// Content growth resizes a child rather than the region, so observe both.\n\t\tconst resize = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(update);\n\t\tconst observe = () => {\n\t\t\tif (!resize) return;\n\t\t\tresize.disconnect();\n\t\t\tresize.observe(node);\n\t\t\tfor (const child of Array.from(node.children)) resize.observe(child);\n\t\t};\n\t\tobserve();\n\t\tconst mutation = typeof MutationObserver === 'undefined' ? null : new MutationObserver(() => { observe(); update(); });\n\t\tmutation?.observe(node, { childList: true });\n\t\treturn () => {\n\t\t\tnode.removeEventListener('scroll', update);\n\t\t\tresize?.disconnect();\n\t\t\tmutation?.disconnect();\n\t\t\tassignRef(forwardedRef, null);\n\t\t};\n\t}, [forwardedRef]);\n}\n"],"mappings":";;AAOA,IAAaE,IAAsB;AAEnC,SAASC,EAAa,GAA+B,GAAiB;CACrE,AAAI,OAAOC,KAAQ,aAAYA,EAAIC,CAAK,IAC/BD,MAAK,EAAmC,UAAUC;AAC5D;AAEA,SAASC,EAAgB,GAAmB;CAE3C,IAAMC,IAAQC,EAAK,YAAY,GACzBC,IAAMD,EAAK,YAA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