themelia-react-ui 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/CHANGELOG.md +307 -131
  2. package/README.md +28 -8
  3. package/THIRD_PARTY_NOTICES.md +13 -0
  4. package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
  5. package/dist/accordion-Cjb6sx0G.js.map +1 -0
  6. package/dist/action-menu-CllU52Mm.js +280 -0
  7. package/dist/action-menu-CllU52Mm.js.map +1 -0
  8. package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
  9. package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
  10. package/dist/ai-artifact-DvTwDVyL.js +1148 -0
  11. package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
  12. package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
  13. package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
  14. package/dist/attachment-BxDfL2mw.js +246 -0
  15. package/dist/attachment-BxDfL2mw.js.map +1 -0
  16. package/dist/{auth-CYxKfo69.js → auth-ax2BqjrI.js} +58 -54
  17. package/dist/auth-ax2BqjrI.js.map +1 -0
  18. package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
  19. package/dist/avatar-DAPlDvhJ.js.map +1 -0
  20. package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
  21. package/dist/badge-HpFqoqSY.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +1 -1
  29. package/dist/base/cards.js +2 -2
  30. package/dist/base/carousel.js +40 -36
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +92 -92
  33. package/dist/base/cascader.js.map +1 -1
  34. package/dist/base/chart.js +1 -1
  35. package/dist/base/choice-inputs.js +2 -2
  36. package/dist/base/code-block.js +1 -1
  37. package/dist/base/combobox.js +2 -2
  38. package/dist/base/command.js +1 -1
  39. package/dist/base/copyable.js +1 -1
  40. package/dist/base/date-pickers.js +2 -2
  41. package/dist/base/display.js +6 -6
  42. package/dist/base/feedback.js +3 -3
  43. package/dist/base/forms-numeric.js +1 -1
  44. package/dist/base/forms.js +2 -2
  45. package/dist/base/inline-edit.js +14 -14
  46. package/dist/base/inline-edit.js.map +1 -1
  47. package/dist/base/item.js +1 -1
  48. package/dist/base/media-gallery.js +1 -1
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +6 -6
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +1 -1
  54. package/dist/base/repeaters.js +171 -176
  55. package/dist/base/repeaters.js.map +1 -1
  56. package/dist/base/sheet.js +1 -1
  57. package/dist/base/sidebar.js +1 -1
  58. package/dist/base/signature-pad.js +6 -6
  59. package/dist/base/skeleton.js +1 -1
  60. package/dist/base/spinner.js +79 -2
  61. package/dist/base/spinner.js.map +1 -0
  62. package/dist/base/structure.js +1 -1
  63. package/dist/base/table.js +1 -1
  64. package/dist/base/text-inputs.js +2 -2
  65. package/dist/base/toaster.js +46 -45
  66. package/dist/base/toaster.js.map +1 -1
  67. package/dist/base/tree.js +1 -1
  68. package/dist/base/upload-queue.js +1 -1
  69. package/dist/base/upload.js +3 -3
  70. package/dist/base/value-inputs.js +1 -1
  71. package/dist/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
  72. package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
  73. package/dist/blocks/admin.js +42 -42
  74. package/dist/blocks/admin.js.map +1 -1
  75. package/dist/blocks/ai.js +260 -240
  76. package/dist/blocks/ai.js.map +1 -1
  77. package/dist/blocks/analytics/usage-card.js +1 -1
  78. package/dist/blocks/analytics.js +620 -585
  79. package/dist/blocks/analytics.js.map +1 -1
  80. package/dist/blocks/collaboration.js +1 -1
  81. package/dist/blocks/commerce/receipt.js +1 -1
  82. package/dist/blocks/commerce.js +1152 -1109
  83. package/dist/blocks/commerce.js.map +1 -1
  84. package/dist/blocks/data-display.js +2 -2
  85. package/dist/blocks/onboarding.js +48 -39
  86. package/dist/blocks/onboarding.js.map +1 -1
  87. package/dist/blocks/planning.js +13 -12
  88. package/dist/blocks/planning.js.map +1 -1
  89. package/dist/blocks/timelines.js +1 -1
  90. package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
  91. package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
  92. package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
  93. package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
  94. package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
  95. package/dist/buttons-DPZekJFu.js.map +1 -0
  96. package/dist/cards-BaBZR-AU.js +68 -0
  97. package/dist/cards-BaBZR-AU.js.map +1 -0
  98. package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
  99. package/dist/chart-ZOYyK2xG.js.map +1 -0
  100. package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
  101. package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
  102. package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
  103. package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
  104. package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
  105. package/dist/code-block-DeneBJR_.js.map +1 -0
  106. package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
  107. package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
  108. package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
  109. package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
  110. package/dist/combobox-C0EQW6dr.js +875 -0
  111. package/dist/combobox-C0EQW6dr.js.map +1 -0
  112. package/dist/combobox-xCQ2RMNE.js +309 -0
  113. package/dist/combobox-xCQ2RMNE.js.map +1 -0
  114. package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
  115. package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
  116. package/dist/{comments-BpDuCUUu.js → comments-BYYlTA8E.js} +114 -105
  117. package/dist/comments-BYYlTA8E.js.map +1 -0
  118. package/dist/components/base/badge/badge.recipes.d.ts +1 -1
  119. package/dist/components/base/buttons/loader-button.d.ts +2 -1
  120. package/dist/components/base/cards/card.recipes.d.ts +2 -3
  121. package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
  122. package/dist/components/base/cards/smart-card.types.d.ts +11 -4
  123. package/dist/components/base/chart/chart.d.ts +2 -5
  124. package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
  125. package/dist/components/base/combobox/index.d.ts +30 -4
  126. package/dist/components/base/forms/form-sizing.d.ts +11 -3
  127. package/dist/components/base/navigation/pagination.d.ts +5 -2
  128. package/dist/components/base/popover/popover.recipes.d.ts +15 -1
  129. package/dist/components/base/table/index.d.ts +9 -2
  130. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  131. package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
  132. package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
  133. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
  134. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
  135. package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
  136. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
  137. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
  138. package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
  139. package/dist/components/features/appointment-calendar/index.d.ts +3 -0
  140. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
  141. package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
  142. package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
  143. package/dist/components/features/combobox/types.d.ts +4 -0
  144. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  145. package/dist/components/features/rich-text-editor/index.d.ts +1 -1
  146. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
  147. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
  148. package/dist/components/features/table/table-header.d.ts +1 -1
  149. package/dist/components/features/table/table.strings.d.ts +55 -1
  150. package/dist/components/features/table/table.types.d.ts +17 -4
  151. package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
  152. package/dist/components/primitives/number.d.ts +4 -2
  153. package/dist/components/primitives/value.d.ts +3 -1
  154. package/dist/components/typography/text-link.d.ts +4 -0
  155. package/dist/components/ui/combobox.d.ts +6 -2
  156. package/dist/components/ui/item.d.ts +8 -8
  157. package/dist/components/ui/tabs.d.ts +1 -1
  158. package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
  159. package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
  160. package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
  161. package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
  162. package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
  163. package/dist/data-display-DT_khPl_.js.map +1 -0
  164. package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
  165. package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
  166. package/dist/{date-picker-CF-DtUpF.js → date-picker-ay0Pha_a.js} +594 -593
  167. package/dist/date-picker-ay0Pha_a.js.map +1 -0
  168. package/dist/date-pickers-Ccw8DL2b.js +175 -0
  169. package/dist/date-pickers-Ccw8DL2b.js.map +1 -0
  170. package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
  171. package/dist/display-hAc1HjpI.js.map +1 -0
  172. package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
  173. package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
  174. package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
  175. package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
  176. package/dist/features/activities.js +398 -375
  177. package/dist/features/activities.js.map +1 -1
  178. package/dist/features/ai-chat.js +188 -179
  179. package/dist/features/ai-chat.js.map +1 -1
  180. package/dist/features/appointment-calendar.js +683 -0
  181. package/dist/features/appointment-calendar.js.map +1 -0
  182. package/dist/features/async-preview.js +109 -107
  183. package/dist/features/async-preview.js.map +1 -1
  184. package/dist/features/combobox.js +1 -1
  185. package/dist/features/comments.js +1 -1
  186. package/dist/features/data-view.js +137 -137
  187. package/dist/features/data-view.js.map +1 -1
  188. package/dist/features/email-composer.js +255 -255
  189. package/dist/features/email-composer.js.map +1 -1
  190. package/dist/features/event-calendar.js +254 -248
  191. package/dist/features/event-calendar.js.map +1 -1
  192. package/dist/features/filters.js +1 -1
  193. package/dist/features/global-search.js +35 -32
  194. package/dist/features/global-search.js.map +1 -1
  195. package/dist/features/kanban.js +118 -117
  196. package/dist/features/kanban.js.map +1 -1
  197. package/dist/features/map.js +233 -231
  198. package/dist/features/map.js.map +1 -1
  199. package/dist/features/media-library.js +789 -775
  200. package/dist/features/media-library.js.map +1 -1
  201. package/dist/features/mentions.js +1 -1
  202. package/dist/features/overlays.js +1 -1
  203. package/dist/features/products.js +922 -902
  204. package/dist/features/products.js.map +1 -1
  205. package/dist/features/questionnaire.js +28 -24
  206. package/dist/features/questionnaire.js.map +1 -1
  207. package/dist/features/resource-assignment.js +18 -15
  208. package/dist/features/resource-assignment.js.map +1 -1
  209. package/dist/features/resource.js +12 -12
  210. package/dist/features/resource.js.map +1 -1
  211. package/dist/features/rich-text-editor.js +2 -2
  212. package/dist/features/schema-form.js +15 -13
  213. package/dist/features/schema-form.js.map +1 -1
  214. package/dist/features/suggestions.js +3 -3
  215. package/dist/features/sync.js +11 -5
  216. package/dist/features/sync.js.map +1 -1
  217. package/dist/features/table.js +1 -1
  218. package/dist/features/theme-tweaker.js +493 -489
  219. package/dist/features/theme-tweaker.js.map +1 -1
  220. package/dist/feedback-BYIhtitP.js +239 -0
  221. package/dist/feedback-BYIhtitP.js.map +1 -0
  222. package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
  223. package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
  224. package/dist/{filters-BkHH53uv.js → filters-BGfvjP4d.js} +589 -580
  225. package/dist/filters-BGfvjP4d.js.map +1 -0
  226. package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
  227. package/dist/form-field-CwH9y77i.js.map +1 -0
  228. package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
  229. package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
  230. package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
  231. package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
  232. package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
  233. package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
  234. package/dist/{header-BOefOKd1.js → header-CGXuhcRm.js} +160 -153
  235. package/dist/header-CGXuhcRm.js.map +1 -0
  236. package/dist/{hooks-9k_TtmKh.js → hooks-Dkz0K2WT.js} +2 -2
  237. package/dist/{hooks-9k_TtmKh.js.map → hooks-Dkz0K2WT.js.map} +1 -1
  238. package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
  239. package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
  240. package/dist/index.js +3 -3
  241. package/dist/input-CZw8iU99.js +21 -0
  242. package/dist/input-CZw8iU99.js.map +1 -0
  243. package/dist/input-DQdEd0YD.js +263 -0
  244. package/dist/input-DQdEd0YD.js.map +1 -0
  245. package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
  246. package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
  247. package/dist/item-K5_ghvze.js +275 -0
  248. package/dist/item-K5_ghvze.js.map +1 -0
  249. package/dist/layout/app-shell.js +1 -1
  250. package/dist/layout/auth.js +1 -1
  251. package/dist/layout/containers.js +1 -1
  252. package/dist/layout/header.js +1 -1
  253. package/dist/layout/hooks.js +1 -1
  254. package/dist/layout/navigation.js +1 -1
  255. package/dist/layout/page.js +1 -1
  256. package/dist/layout/settings.js +1 -1
  257. package/dist/layout/sidebar.js +2 -2
  258. package/dist/layout/workspace.js +1 -1
  259. package/dist/layout.js +10 -10
  260. package/dist/lib/affordance-geometry.generated.d.ts +71 -0
  261. package/dist/lib/editable-text-recipe.d.ts +4 -4
  262. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  263. package/dist/lib/interaction-recipes.d.ts +5 -0
  264. package/dist/lib/theme-mode-css.d.ts +7 -0
  265. package/dist/lib/tone-recipes.d.ts +8 -0
  266. package/dist/lib/ui-provider/types.d.ts +2 -2
  267. package/dist/lib/utils.js +1 -1
  268. package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
  269. package/dist/media-gallery-3zIVLMWH.js.map +1 -0
  270. package/dist/{mentions-D-uyCh01.js → mentions-utuUvH1K.js} +144 -142
  271. package/dist/mentions-utuUvH1K.js.map +1 -0
  272. package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
  273. package/dist/message-DZ_ruyUV.js.map +1 -0
  274. package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
  275. package/dist/metadata-list-8N16ZMW_.js.map +1 -0
  276. package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
  277. package/dist/navigation-Bnotn4AQ.js.map +1 -0
  278. package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
  279. package/dist/navigation-BzhHI3lo.js.map +1 -0
  280. package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
  281. package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
  282. package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
  283. package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
  284. package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
  285. package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
  286. package/dist/{overlays-I0axtYA6.js → overlays-DNWmZrJ4.js} +14 -12
  287. package/dist/overlays-DNWmZrJ4.js.map +1 -0
  288. package/dist/{page-B5dTH9gE.js → page-Bgl1F560.js} +8 -8
  289. package/dist/{page-B5dTH9gE.js.map → page-Bgl1F560.js.map} +1 -1
  290. package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
  291. package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
  292. package/dist/pagination-BL25hu2s.js +158 -0
  293. package/dist/pagination-BL25hu2s.js.map +1 -0
  294. package/dist/{popover-Di55PyAI.js → popover-7_m66eYW.js} +8 -7
  295. package/dist/{popover-Di55PyAI.js.map → popover-7_m66eYW.js.map} +1 -1
  296. package/dist/popover-menu-B9WWygpa.js +100 -0
  297. package/dist/popover-menu-B9WWygpa.js.map +1 -0
  298. package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
  299. package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
  300. package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
  301. package/dist/primitives-BFK08r9M.js.map +1 -0
  302. package/dist/primitives.js +4 -4
  303. package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
  304. package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
  305. package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
  306. package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
  307. package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
  308. package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
  309. package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
  310. package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
  311. package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
  312. package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
  313. package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
  314. package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
  315. package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
  316. package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
  317. package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
  318. package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
  319. package/dist/services/actions.js +1 -1
  320. package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
  321. package/dist/settings-ybnjVwbd.js.map +1 -0
  322. package/dist/{sheet-4SEvVYzA.js → sheet-CGpB3omz.js} +8 -7
  323. package/dist/{sheet-4SEvVYzA.js.map → sheet-CGpB3omz.js.map} +1 -1
  324. package/dist/{sidebar-d7Dg80ln.js → sidebar-A0ElHINE.js} +14 -13
  325. package/dist/{sidebar-d7Dg80ln.js.map → sidebar-A0ElHINE.js.map} +1 -1
  326. package/dist/{sidebar-C7WWR29L.js → sidebar-CPx_7YBa.js} +183 -182
  327. package/dist/sidebar-CPx_7YBa.js.map +1 -0
  328. package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
  329. package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
  330. package/dist/smart-card-DiC5aac3.js +604 -0
  331. package/dist/smart-card-DiC5aac3.js.map +1 -0
  332. package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
  333. package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
  334. package/dist/style.css +1 -1
  335. package/dist/table-BweFy_P9.js +1530 -0
  336. package/dist/table-BweFy_P9.js.map +1 -0
  337. package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
  338. package/dist/table-DsfzoUia.js.map +1 -0
  339. package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
  340. package/dist/tabs-CDocW5D1.js.map +1 -0
  341. package/dist/text-inputs-f9Ia-aCi.js +353 -0
  342. package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
  343. package/dist/theme-mode-css-BB-_RYab.js +14 -0
  344. package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
  345. package/dist/theme-scope-BJ6eE2xt.js +50 -0
  346. package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
  347. package/dist/theme.css +285 -228
  348. package/dist/themes/green.css +16 -12
  349. package/dist/timelines-CwM_9IhD.js +457 -0
  350. package/dist/timelines-CwM_9IhD.js.map +1 -0
  351. package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
  352. package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
  353. package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
  354. package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
  355. package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
  356. package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
  357. package/dist/typography/rich-text.js +1 -1
  358. package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
  359. package/dist/typography-UTnveOEy.js.map +1 -0
  360. package/dist/typography.js +2 -2
  361. package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
  362. package/dist/ui-provider-C_U0Xma4.js.map +1 -0
  363. package/dist/ui-provider.js +2 -2
  364. package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
  365. package/dist/upload-CXyxmQBP.js.map +1 -0
  366. package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
  367. package/dist/upload-queue-Boscubn9.js.map +1 -0
  368. package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
  369. package/dist/usage-card-BhO5eqkX.js.map +1 -0
  370. package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
  371. package/dist/utils-BRhFDwuU.js.map +1 -0
  372. package/dist/{value-inputs-TAYMX111.js → value-inputs-DXPDjvBU.js} +268 -252
  373. package/dist/value-inputs-DXPDjvBU.js.map +1 -0
  374. package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
  375. package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
  376. package/dist/{workspace-DH0v0KcB.js → workspace-Cdrg7k9f.js} +34 -33
  377. package/dist/workspace-Cdrg7k9f.js.map +1 -0
  378. package/docs/consumer-skill/SKILL.md +2 -2
  379. package/docs/consumer-skill/references/agents-md.md +1 -1
  380. package/docs/consumer-skill/references/composition.md +8 -6
  381. package/docs/consumer-skill/references/integration.md +4 -3
  382. package/docs/consumer-skill/references/public-api.json +105 -2
  383. package/docs/consumer-skill/references/review.md +7 -0
  384. package/docs/consumer-skill/references/theming.md +71 -6
  385. package/docs/consumer-skill/references/tokens.json +1 -1
  386. package/docs/consumer-skill/references/workflows.md +25 -0
  387. package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
  388. package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
  389. package/package.json +8 -4
  390. package/dist/accordion-B6a3vVgA.js.map +0 -1
  391. package/dist/action-menu-TzCoSlwL.js +0 -280
  392. package/dist/action-menu-TzCoSlwL.js.map +0 -1
  393. package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
  394. package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
  395. package/dist/ai-artifact-BMJdv-6q.js +0 -1115
  396. package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
  397. package/dist/attachment-BtfhGm8i.js +0 -245
  398. package/dist/attachment-BtfhGm8i.js.map +0 -1
  399. package/dist/auth-CYxKfo69.js.map +0 -1
  400. package/dist/avatar-BBnEJIx8.js.map +0 -1
  401. package/dist/badge-MrKVNzW9.js.map +0 -1
  402. package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
  403. package/dist/breadcrumbs-D5t7I023.js.map +0 -1
  404. package/dist/buttons-SbIcm1HJ.js.map +0 -1
  405. package/dist/cards-CiiHpKYd.js +0 -66
  406. package/dist/cards-CiiHpKYd.js.map +0 -1
  407. package/dist/chart-QfrARkXl.js.map +0 -1
  408. package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
  409. package/dist/code-block-Dgbu-CU3.js.map +0 -1
  410. package/dist/combobox-2Ic8N9bL.js +0 -278
  411. package/dist/combobox-2Ic8N9bL.js.map +0 -1
  412. package/dist/combobox-DLl0bfiq.js +0 -867
  413. package/dist/combobox-DLl0bfiq.js.map +0 -1
  414. package/dist/comments-BpDuCUUu.js.map +0 -1
  415. package/dist/data-display-DafIvCl5.js.map +0 -1
  416. package/dist/date-picker-CF-DtUpF.js.map +0 -1
  417. package/dist/date-pickers-BmzxJl5l.js +0 -174
  418. package/dist/date-pickers-BmzxJl5l.js.map +0 -1
  419. package/dist/display-DsQTVzMz.js.map +0 -1
  420. package/dist/dropdown-menu-E2qmdC7o.js +0 -193
  421. package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
  422. package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
  423. package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
  424. package/dist/feedback-qNuMBtRH.js +0 -233
  425. package/dist/feedback-qNuMBtRH.js.map +0 -1
  426. package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
  427. package/dist/filters-BkHH53uv.js.map +0 -1
  428. package/dist/form-field-DUt4UxSV.js.map +0 -1
  429. package/dist/form-sizing-By94KzXE.js.map +0 -1
  430. package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
  431. package/dist/header-BOefOKd1.js.map +0 -1
  432. package/dist/input-DWhBBBww.js +0 -262
  433. package/dist/input-DWhBBBww.js.map +0 -1
  434. package/dist/input-Ddi_LSYv.js +0 -20
  435. package/dist/input-Ddi_LSYv.js.map +0 -1
  436. package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
  437. package/dist/item-DEmDiTlD.js +0 -265
  438. package/dist/item-DEmDiTlD.js.map +0 -1
  439. package/dist/media-gallery-DcTtAaeC.js.map +0 -1
  440. package/dist/mentions-D-uyCh01.js.map +0 -1
  441. package/dist/message-CdHgIWKf.js.map +0 -1
  442. package/dist/metadata-list-X5rYAKSB.js.map +0 -1
  443. package/dist/navigation-D3KwXmaq.js.map +0 -1
  444. package/dist/navigation-HJf5zxlH.js.map +0 -1
  445. package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
  446. package/dist/overlays-I0axtYA6.js.map +0 -1
  447. package/dist/pagination-3bPA_a6K.js +0 -149
  448. package/dist/pagination-3bPA_a6K.js.map +0 -1
  449. package/dist/popover-menu-B71Tn2Qz.js +0 -99
  450. package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
  451. package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
  452. package/dist/primitives-B-CkiEMU.js.map +0 -1
  453. package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
  454. package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
  455. package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
  456. package/dist/settings-CQW3b-Cu.js.map +0 -1
  457. package/dist/sidebar-C7WWR29L.js.map +0 -1
  458. package/dist/smart-card-lFKxn5Hu.js +0 -595
  459. package/dist/smart-card-lFKxn5Hu.js.map +0 -1
  460. package/dist/spinner-fa3h1Aif.js +0 -80
  461. package/dist/spinner-fa3h1Aif.js.map +0 -1
  462. package/dist/table-CIKyLUsy.js.map +0 -1
  463. package/dist/table-CrcLN9Io.js +0 -1458
  464. package/dist/table-CrcLN9Io.js.map +0 -1
  465. package/dist/tabs-DwBJfjxX.js.map +0 -1
  466. package/dist/text-inputs-aaK9wcDT.js +0 -326
  467. package/dist/text-inputs-aaK9wcDT.js.map +0 -1
  468. package/dist/theme-scope-kStaAer0.js +0 -39
  469. package/dist/theme-scope-kStaAer0.js.map +0 -1
  470. package/dist/timelines-C_SBwHNP.js +0 -442
  471. package/dist/timelines-C_SBwHNP.js.map +0 -1
  472. package/dist/tone-recipes-CPoExcTE.js.map +0 -1
  473. package/dist/typography-DTRkE9zL.js.map +0 -1
  474. package/dist/ui-provider-1D_NSYzO.js.map +0 -1
  475. package/dist/upload-BO8-CLN6.js.map +0 -1
  476. package/dist/upload-queue-EOC8g1gf.js.map +0 -1
  477. package/dist/usage-card-obRaBskq.js.map +0 -1
  478. package/dist/utils-l5LpDw2z.js.map +0 -1
  479. package/dist/value-inputs-TAYMX111.js.map +0 -1
  480. package/dist/workspace-DH0v0KcB.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"number-DMhe-Vsk.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,IAAQC,IAAM,MAAM,KACvCE,IAAoBD,MAAqB,MAAM,MAAM;EAC3D,OAAOJ,EACL,QAAY,OAAO,KAAKK,KAAqB,GAAG,GAAG,EAAE,CAAC,CACtD,QAAQD,GAAkB,GAAG;CAChC;CAEA,IAAIF,KAAS,GAAG;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sB,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"}
1
+ {"version":3,"file":"number-DbV1Dija.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\t/** Line height. Defaults to the role leading; inside running text, the surrounding leading. */\n\tlineHeight?: TextProps['lineHeight'];\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\tlineHeight,\n\tclassName,\n\tref,\n\t...props\n}: NumberProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight, lineHeight }, 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\tlineHeight,\n\tclassName,\n\tref,\n\t...props\n}: PercentProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight, lineHeight }, 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,IAAQC,IAAM,MAAM,KACvCE,IAAoBD,MAAqB,MAAM,MAAM;EAC3D,OAAOJ,EACL,QAAY,OAAO,KAAKK,KAAqB,GAAG,GAAG,EAAE,CAAC,CACtD,QAAQD,GAAkB,GAAG;CAChC;CAEA,IAAIF,KAAS,GAAG;EACf,IAAM,CAACI,GAAMC,IAAO,MAAMP,EAAQ,MAAM,GAAG;EAE3C,OADIO,EAAK,SAAS,KAAKA,EAAK,UAAU,IAAU,GAAGD,EAAK,QAAQ,MAAM,EAAE,EAAE,GAAGC,MACtEP,EAAQ,QAAQ,MAAM,EAAE;CAChC;CAEA,IAAIG,KAAO,GAAG;EACb,IA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2B,KAASpC;CACL,CAAA;AAER;AAMA,SAAgBqC,EAAQ,EACvB,UACA,WACA,YAAS,IACT,YACA,gBAAA,KACA,SACA,WAAQ,SACR,WACA,SACA,eACA,cACA,QACA,GAAG5B,KACa;CAChB,IAAMpB,IAAa1C,EAAoB,GACjC4B,IAAWxB,EAAmB;EAAE;EAAM;EAAM;EAAQ;CAAW,GAAGiF,CAAW,GAC7EnE,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"}
@@ -1,51 +1,52 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "./lib/strings.js";
3
- import { t } from "./utils-l5LpDw2z.js";
4
- import { a as n, o as r, s as i } from "./typography-DTRkE9zL.js";
3
+ import { t } from "./utils-BRhFDwuU.js";
4
+ import { c as n, o as r, s as i } from "./typography-UTnveOEy.js";
5
5
  import { t as a } from "./focus-recipes-B653VaLq.js";
6
- import { t as o } from "./structure-DC2dygdA.js";
7
- import { n as s } from "./action-menu-TzCoSlwL.js";
8
- import { t as c } from "./interaction-recipes-CHr0dJUs.js";
9
- import { t as l } from "./badge-MrKVNzW9.js";
10
- import { t as u } from "./separator-C8DlRGwF.js";
11
- import { n as d, t as f } from "./page-header-commands-DjzFEq3E.js";
12
- import { forwardRef as p, useCallback as m, useLayoutEffect as h, useMemo as g, useRef as _, useState as v } from "react";
13
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
14
- import { MoreHorizontal as S } from "lucide-react";
6
+ import { t as o } from "./structure-BmisBK-3.js";
7
+ import { i as s } from "./popover.recipes-D3j8R8Yp.js";
8
+ import { n as c } from "./action-menu-CllU52Mm.js";
9
+ import { t as l } from "./interaction-recipes-XR9ZpVYL.js";
10
+ import { t as u } from "./badge-HpFqoqSY.js";
11
+ import { t as d } from "./separator-BDV-Y648.js";
12
+ import { n as f, t as p } from "./page-header-commands-DOb6WsfD.js";
13
+ import { forwardRef as m, useCallback as h, useLayoutEffect as g, useMemo as _, useRef as v, useState as y } from "react";
14
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
15
+ import { MoreHorizontal as C } from "lucide-react";
15
16
  //#region src/components/base/navigation/page-header/page-header.tsx
16
- function C(e) {
17
+ function w(e) {
17
18
  return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
18
19
  }
19
- function w({ eyebrow: e, title: a, description: s, textGap: c = "normal", headingTag: p = "h2", badge: m, badges: h, breadcrumbs: g, leading: _, beforeTitle: v, titlePrefix: S, titleSuffix: w, afterDescription: T, actions: E, primaryAction: D, secondaryActions: O, moreActionsLabel: k = "More actions", renderLink: A, children: j, className: M, contentClassName: N, eyebrowClassName: P, titleClassName: F, titleRowClassName: I, descriptionClassName: L, actionsClassName: R, withSeparator: z = !1 }) {
20
- let B = h ?? (m ? [m] : []), V = d(D, O), H = V ? /* @__PURE__ */ x(y, { children: [E, /* @__PURE__ */ b(f, {
20
+ function T({ eyebrow: e, title: a, description: s, textGap: c = "normal", headingTag: l = "h2", badge: m, badges: h, breadcrumbs: g, leading: _, beforeTitle: v, titlePrefix: y, titleSuffix: C, afterDescription: T, actions: E, primaryAction: D, secondaryActions: O, moreActionsLabel: k = "More actions", renderLink: A, children: j, className: M, contentClassName: N, eyebrowClassName: P, titleClassName: F, titleRowClassName: I, descriptionClassName: L, actionsClassName: R, withSeparator: z = !1 }) {
21
+ let B = h ?? (m ? [m] : []), V = f(D, O), H = V ? /* @__PURE__ */ S(b, { children: [E, /* @__PURE__ */ x(p, {
21
22
  primaryAction: D,
22
23
  secondaryActions: O,
23
24
  moreActionsLabel: k,
24
25
  renderLink: A
25
26
  })] }) : E;
26
- return /* @__PURE__ */ x("header", {
27
+ return /* @__PURE__ */ S("header", {
27
28
  className: t("page-heading--component page-header--component", "w-full", M),
28
29
  children: [
29
- !!g && /* @__PURE__ */ b("div", {
30
+ !!g && /* @__PURE__ */ x("div", {
30
31
  className: "mb-space-lg",
31
32
  children: g
32
33
  }),
33
- /* @__PURE__ */ x(o, {
34
+ /* @__PURE__ */ S(o, {
34
35
  direction: "horizontal",
35
36
  gap: "lg",
36
37
  align: "start",
37
38
  wrap: !1,
38
- children: [_, /* @__PURE__ */ x(o, {
39
+ children: [_, /* @__PURE__ */ S(o, {
39
40
  gap: "dense",
40
41
  className: t("page-header--content-row flex-1", N),
41
42
  children: [
42
- !!e && (C(e) ? /* @__PURE__ */ b(n, {
43
+ !!e && (w(e) ? /* @__PURE__ */ x(r, {
43
44
  tag: "div",
44
45
  className: P,
45
46
  children: e
46
47
  }) : e),
47
48
  v,
48
- /* @__PURE__ */ x(o, {
49
+ /* @__PURE__ */ S(o, {
49
50
  direction: {
50
51
  base: "vertical",
51
52
  sm: "horizontal"
@@ -57,49 +58,49 @@ function w({ eyebrow: e, title: a, description: s, textGap: c = "normal", headin
57
58
  sm: !0
58
59
  },
59
60
  className: "page-header--headline-row min-w-0",
60
- children: [/* @__PURE__ */ x("div", {
61
- className: t("page-header--copy-column page-header--title-row grid min-w-0 w-full flex-1 basis-full items-center gap-x-space-md sm:w-auto sm:basis-64", S ? "grid-cols-[auto_minmax(0,1fr)]" : "grid-cols-[minmax(0,1fr)]", I, c === "normal" ? "gap-y-normal" : "gap-y-dense"),
61
+ children: [/* @__PURE__ */ S("div", {
62
+ className: t("page-header--copy-column page-header--title-row grid min-w-0 w-full flex-1 basis-full items-center gap-x-space-md sm:w-auto sm:basis-64", y ? "grid-cols-[auto_minmax(0,1fr)]" : "grid-cols-[minmax(0,1fr)]", I, c === "normal" ? "gap-y-normal" : "gap-y-dense"),
62
63
  children: [
63
- !!S && /* @__PURE__ */ b("span", {
64
+ !!y && /* @__PURE__ */ x("span", {
64
65
  className: "page-header--title-prefix inline-flex shrink-0 items-center self-center",
65
- children: S
66
+ children: y
66
67
  }),
67
- /* @__PURE__ */ x(o, {
68
+ /* @__PURE__ */ S(o, {
68
69
  direction: "horizontal",
69
70
  gap: "md",
70
71
  align: "center",
71
72
  wrap: !0,
72
73
  className: "page-header--title-line min-h-action-sm min-w-0",
73
74
  children: [
74
- C(a) ? /* @__PURE__ */ b(r, {
75
- tag: p,
75
+ w(a) ? /* @__PURE__ */ x(i, {
76
+ tag: l,
76
77
  className: t("page-header--title min-w-0 [overflow-wrap:anywhere] border-0 pb-0", F),
77
78
  children: a
78
79
  }) : a,
79
- B.length > 0 && /* @__PURE__ */ b(o, {
80
+ B.length > 0 && /* @__PURE__ */ x(o, {
80
81
  direction: "horizontal",
81
82
  gap: "sm",
82
83
  wrap: !0,
83
84
  className: "page-header--badges min-w-0 max-w-full",
84
- children: B.map((e, t) => /* @__PURE__ */ b(l, {
85
+ children: B.map((e, t) => /* @__PURE__ */ x(u, {
85
86
  tone: e.tone ?? "secondary",
86
87
  children: e.label
87
88
  }, e.key ?? t))
88
89
  }),
89
- w
90
+ C
90
91
  ]
91
92
  }),
92
- (!!s || !!T) && /* @__PURE__ */ x(o, {
93
+ (!!s || !!T) && /* @__PURE__ */ S(o, {
93
94
  gap: "dense",
94
- className: t("page-header--title-block min-w-0", !!S && "col-start-2"),
95
- children: [!!s && (C(s) ? /* @__PURE__ */ b(i, {
95
+ className: t("page-header--title-block min-w-0", !!y && "col-start-2"),
96
+ children: [!!s && (w(s) ? /* @__PURE__ */ x(n, {
96
97
  type: "secondary",
97
98
  className: t("page-header--description max-w-2xl [overflow-wrap:anywhere]", L),
98
99
  children: s
99
100
  }) : s), T]
100
101
  })
101
102
  ]
102
- }), !!H && /* @__PURE__ */ b(o, {
103
+ }), !!H && /* @__PURE__ */ x(o, {
103
104
  direction: "horizontal",
104
105
  gap: "md",
105
106
  className: t("page-header--actions max-w-full shrink-0", V && "self-end justify-end sm:self-auto", R),
@@ -109,25 +110,25 @@ function w({ eyebrow: e, title: a, description: s, textGap: c = "normal", headin
109
110
  ]
110
111
  })]
111
112
  }),
112
- !!j && /* @__PURE__ */ b("div", {
113
+ !!j && /* @__PURE__ */ x("div", {
113
114
  className: "mt-space-xl",
114
115
  children: j
115
116
  }),
116
- !!z && /* @__PURE__ */ b(u, { className: "mt-space-xl" })
117
+ !!z && /* @__PURE__ */ x(d, { className: "mt-space-xl" })
117
118
  ]
118
119
  });
119
120
  }
120
- w.displayName = "PageHeading";
121
+ T.displayName = "PageHeading";
121
122
  //#endregion
122
123
  //#region src/components/base/navigation/overflow-tab-bar.tsx
123
- var T = {
124
+ var E = {
124
125
  more: "More",
125
126
  navigationLabel: "Tab navigation"
126
- }, E = `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 ${a.edge} [&_svg]:size-icon [&_svg]:shrink-0`, D = c.segmentInactive, O = c.segmentActive;
127
- function k(e) {
127
+ }, D = `${l.nativeButtonReset} inline-flex h-action-sm shrink-0 cursor-pointer items-center gap-space-sm rounded-inner px-control-sm text-sm font-medium whitespace-nowrap no-underline outline-none transition-colors ${a.edge} [&_svg]:size-icon [&_svg]:shrink-0`, O = l.segmentInactive, k = l.segmentActive;
128
+ function A(e) {
128
129
  return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
129
130
  }
130
- function A(e, t, n, r) {
131
+ function j(e, t, n, r) {
131
132
  if (e.reduce((e, t) => e + t, 0) + n * Math.max(0, e.length - 1) <= t) return e.length;
132
133
  let i = 0, a = 0;
133
134
  for (let o of e) {
@@ -137,39 +138,39 @@ function A(e, t, n, r) {
137
138
  }
138
139
  return Math.max(1, a);
139
140
  }
140
- var j = p(function({ items: n, value: r, onValueChange: a, className: o, tabClassName: c, activeTabClassName: u, strings: d, ...f }, p) {
141
- let C = e(T, d), w = _(null), j = _(null), M = _(null), [N, P] = v(n.length), F = m((e) => {
142
- w.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
143
- }, [p]);
144
- h(() => {
145
- let e = w.current, t = j.current, r = M.current;
146
- if (!e || !t || !r) return;
141
+ var M = m(function({ items: r, value: i, onValueChange: a, className: o, tabClassName: l, activeTabClassName: d, strings: f, ...p }, m) {
142
+ let w = e(E, f), T = v(null), M = v(null), N = v(null), [P, F] = y(r.length), I = h((e) => {
143
+ T.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
144
+ }, [m]);
145
+ g(() => {
146
+ let e = T.current, t = M.current, n = N.current;
147
+ if (!e || !t || !n) return;
147
148
  let i = () => {
148
149
  let i = getComputedStyle(t), a = (parseFloat(i.paddingLeft) || 0) + (parseFloat(i.paddingRight) || 0), o = e.clientWidth - a;
149
150
  if (o <= 0) {
150
- P(n.length);
151
+ F(r.length);
151
152
  return;
152
153
  }
153
- let s = parseFloat(getComputedStyle(r).columnGap) || 0, c = Array.from(r.querySelectorAll("[data-tab-id]")).map((e) => e.offsetWidth), l = r.querySelector("[data-more-measure]")?.offsetWidth ?? 0;
154
- P(A(c, o, s, l));
154
+ let s = parseFloat(getComputedStyle(n).columnGap) || 0, c = Array.from(n.querySelectorAll("[data-tab-id]")).map((e) => e.offsetWidth), l = n.querySelector("[data-more-measure]")?.offsetWidth ?? 0;
155
+ F(j(c, o, s, l));
155
156
  };
156
157
  if (i(), typeof ResizeObserver > "u") return;
157
158
  let a = new ResizeObserver(i);
158
159
  return a.observe(e), () => a.disconnect();
159
- }, [n, C.more]);
160
- let I = g(() => {
161
- if (!r) return n;
162
- let e = n.findIndex((e) => e.id === r);
163
- if (e < 0 || e < N) return n;
164
- let t = [...n], i = Math.max(0, N - 1);
165
- return [t[e], t[i]] = [t[i], t[e]], t;
160
+ }, [r, w.more]);
161
+ let L = _(() => {
162
+ if (!i) return r;
163
+ let e = r.findIndex((e) => e.id === i);
164
+ if (e < 0 || e < P) return r;
165
+ let t = [...r], n = Math.max(0, P - 1);
166
+ return [t[e], t[n]] = [t[n], t[e]], t;
166
167
  }, [
167
- n,
168
168
  r,
169
- N
170
- ]), L = I.slice(0, N), R = I.slice(N), z = (e) => {
169
+ i,
170
+ P
171
+ ]), R = L.slice(0, P), z = L.slice(P), B = (e) => {
171
172
  a?.(e.id), e.onClick?.();
172
- }, B = (e) => {
173
+ }, V = (e) => {
173
174
  if (![
174
175
  "ArrowLeft",
175
176
  "ArrowRight",
@@ -180,10 +181,10 @@ var j = p(function({ items: n, value: r, onValueChange: a, className: o, tabClas
180
181
  if (n < 0 || t.length === 0) return;
181
182
  let r = getComputedStyle(e.currentTarget).direction === "rtl" ? "ArrowLeft" : "ArrowRight", i = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : e.key === r ? (n + 1) % t.length : (n - 1 + t.length) % t.length;
182
183
  e.preventDefault(), t[i]?.focus();
183
- }, V = (e, n, a) => {
184
- let o = e.icon, s = t(E, n ? t(O, u) : D, c), d = /* @__PURE__ */ x(y, { children: [
185
- !!o && /* @__PURE__ */ b(o, { "aria-hidden": "true" }),
186
- k(e.label) ? /* @__PURE__ */ b(i, {
184
+ }, H = (e, r, a) => {
185
+ let o = e.icon, s = t(D, r ? t(k, d) : O, l), c = /* @__PURE__ */ S(b, { children: [
186
+ !!o && /* @__PURE__ */ x(o, { "aria-hidden": "true" }),
187
+ A(e.label) ? /* @__PURE__ */ x(n, {
187
188
  tag: "span",
188
189
  size: "inherit",
189
190
  weight: "medium",
@@ -191,90 +192,91 @@ var j = p(function({ items: n, value: r, onValueChange: a, className: o, tabClas
191
192
  className: "text-inherit",
192
193
  children: e.label
193
194
  }) : e.label,
194
- e.badge !== void 0 && e.badge !== null && e.badge !== !1 && /* @__PURE__ */ b(l, {
195
+ e.badge !== void 0 && e.badge !== null && e.badge !== !1 && /* @__PURE__ */ x(u, {
195
196
  size: "sm",
196
197
  tone: "secondary",
197
198
  className: "overflow-tab-bar--badge",
198
199
  children: e.badge
199
200
  })
200
201
  ] });
201
- if (a?.measure) return /* @__PURE__ */ b("span", {
202
+ if (a?.measure) return /* @__PURE__ */ x("span", {
202
203
  "data-tab-id": e.id,
203
204
  className: t("overflow-tab-bar--measure", s),
204
- children: d
205
+ children: c
205
206
  }, e.id);
206
207
  let f = {
207
208
  "data-tab-id": e.id,
208
209
  role: "tab",
209
- "aria-selected": n,
210
- tabIndex: n || !r ? 0 : -1,
211
- onClick: () => z(e),
210
+ "aria-selected": r,
211
+ tabIndex: r || !i ? 0 : -1,
212
+ onClick: () => B(e),
212
213
  className: t("overflow-tab-bar--tab", s)
213
214
  };
214
- return e.href ? /* @__PURE__ */ b("a", {
215
+ return e.href ? /* @__PURE__ */ x("a", {
215
216
  href: e.href,
216
217
  ...f,
217
- children: d
218
- }, e.id) : /* @__PURE__ */ b("button", {
218
+ children: c
219
+ }, e.id) : /* @__PURE__ */ x("button", {
219
220
  type: "button",
220
221
  ...f,
221
- children: d
222
+ children: c
222
223
  }, e.id);
223
- }, H = /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(S, { "aria-hidden": "true" }), /* @__PURE__ */ b(i, {
224
+ }, U = /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(C, { "aria-hidden": "true" }), /* @__PURE__ */ x(n, {
224
225
  tag: "span",
225
226
  size: "inherit",
226
227
  weight: "medium",
227
228
  lineHeight: "tight",
228
229
  className: "text-inherit",
229
- children: C.more
230
+ children: w.more
230
231
  })] });
231
- return /* @__PURE__ */ x("div", {
232
- ref: F,
232
+ return /* @__PURE__ */ S("div", {
233
+ ref: I,
233
234
  className: t("overflow-tab-bar--component relative w-full min-w-0 max-w-full", o),
234
- ...f,
235
- children: [/* @__PURE__ */ x("div", {
236
- ref: M,
235
+ ...p,
236
+ children: [/* @__PURE__ */ S("div", {
237
+ ref: N,
237
238
  "aria-hidden": "true",
238
239
  className: "pointer-events-none invisible fixed left-0 top-0 z-[-1] flex h-0 w-0 items-center gap-space-2xs overflow-hidden",
239
- children: [n.map((e) => V(e, !1, { measure: !0 })), /* @__PURE__ */ b("span", {
240
+ children: [r.map((e) => H(e, !1, { measure: !0 })), /* @__PURE__ */ x("span", {
240
241
  "data-more-measure": "",
241
- className: t(E, D),
242
- children: H
242
+ className: t(D, O),
243
+ children: U
243
244
  })]
244
- }), /* @__PURE__ */ x("div", {
245
- ref: j,
245
+ }), /* @__PURE__ */ S("div", {
246
+ ref: M,
246
247
  className: "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",
247
- children: [/* @__PURE__ */ b("div", {
248
+ children: [/* @__PURE__ */ x("div", {
248
249
  role: "tablist",
249
- "aria-label": C.navigationLabel,
250
+ "aria-label": w.navigationLabel,
250
251
  "aria-orientation": "horizontal",
251
- onKeyDown: B,
252
+ onKeyDown: V,
252
253
  className: "overflow-tab-bar--tablist flex min-w-0 items-center gap-space-2xs overflow-hidden",
253
- children: L.map((e) => V(e, e.id === r))
254
- }), R.length > 0 && /* @__PURE__ */ b(s, {
255
- actions: R.map((e) => ({
254
+ children: R.map((e) => H(e, e.id === i))
255
+ }), z.length > 0 && /* @__PURE__ */ x(c, {
256
+ actions: z.map((e) => ({
256
257
  id: e.id,
257
258
  label: e.label,
258
259
  icon: e.icon,
259
- onClick: () => z(e)
260
+ href: e.href,
261
+ onClick: () => B(e)
260
262
  })),
261
263
  align: "end",
262
- contentClassName: "min-w-40",
264
+ contentClassName: s.menuMin,
263
265
  width: "w-auto",
264
266
  closeOnSelect: !0,
265
267
  preserveOrder: !0,
266
- renderTrigger: /* @__PURE__ */ b("button", {
268
+ renderTrigger: /* @__PURE__ */ x("button", {
267
269
  type: "button",
268
- "aria-label": C.more,
269
- className: t(E, D, "overflow-tab-bar--more"),
270
- children: H
270
+ "aria-label": w.more,
271
+ className: t(D, O, "overflow-tab-bar--more"),
272
+ children: U
271
273
  })
272
274
  })]
273
275
  })]
274
276
  });
275
277
  });
276
- j.displayName = "OverflowTabBar";
278
+ M.displayName = "OverflowTabBar";
277
279
  //#endregion
278
- export { T as n, w as r, j as t };
280
+ export { E as n, T as r, M as t };
279
281
 
280
- //# sourceMappingURL=overflow-tab-bar-sQHXLlwQ.js.map
282
+ //# sourceMappingURL=overflow-tab-bar-CWY7Nogn.js.map