themelia-react-ui 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/README.md +39 -6
  3. package/dist/{accordion-BRWh3BM1.js → accordion-B-5Focs8.js} +2 -2
  4. package/dist/{accordion-BRWh3BM1.js.map → accordion-B-5Focs8.js.map} +1 -1
  5. package/dist/{affordance-geometry.generated-DXl-Zb3Z.js → affordance-geometry.generated-D8Jcfb0G.js} +10 -1
  6. package/dist/affordance-geometry.generated-D8Jcfb0G.js.map +1 -0
  7. package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-B5tPpXnS.js} +5 -5
  8. package/dist/{ai-artifact-DkOArd3-.js.map → ai-artifact-B5tPpXnS.js.map} +1 -1
  9. package/dist/{app-shell-BH_bGcE2.js → app-shell-at8Kt4l_.js} +3 -3
  10. package/dist/{app-shell-BH_bGcE2.js.map → app-shell-at8Kt4l_.js.map} +1 -1
  11. package/dist/{attachment-DsLgNHXt.js → attachment-BO2R47wn.js} +2 -2
  12. package/dist/{attachment-DsLgNHXt.js.map → attachment-BO2R47wn.js.map} +1 -1
  13. package/dist/{auth-BDB1V_2q.js → auth-OFwWSAap.js} +4 -4
  14. package/dist/{auth-BDB1V_2q.js.map → auth-OFwWSAap.js.map} +1 -1
  15. package/dist/{avatar-CsnWaYmt.js → avatar-Bpzty83c.js} +73 -68
  16. package/dist/avatar-Bpzty83c.js.map +1 -0
  17. package/dist/base/accordion.js +1 -1
  18. package/dist/base/attachment.js +1 -1
  19. package/dist/base/avatar.js +1 -1
  20. package/dist/base/cards.js +2 -2
  21. package/dist/base/cascader.js +6 -6
  22. package/dist/base/choice-inputs.js +3 -2
  23. package/dist/base/code-block.js +1 -1
  24. package/dist/base/combobox.js +1 -1
  25. package/dist/base/command.js +1 -1
  26. package/dist/base/date-pickers.js +2 -2
  27. package/dist/base/display.js +1 -1
  28. package/dist/base/feedback.js +4 -3
  29. package/dist/base/forms-numeric.js +1 -1
  30. package/dist/base/forms.js +2 -2
  31. package/dist/base/inline-edit.js +236 -0
  32. package/dist/base/inline-edit.js.map +1 -0
  33. package/dist/base/media-gallery.js +1 -1
  34. package/dist/base/navigation.js +3 -3
  35. package/dist/base/popover-menu.js +1 -1
  36. package/dist/base/popover.js +1 -1
  37. package/dist/base/repeaters.js +4 -4
  38. package/dist/base/sheet.js +1 -1
  39. package/dist/base/sidebar.js +1 -1
  40. package/dist/base/signature-pad.js +3 -3
  41. package/dist/base/skeleton.js +1 -1
  42. package/dist/base/spinner.js +1 -1
  43. package/dist/base/structure.js +1 -1
  44. package/dist/base/text-inputs.js +2 -2
  45. package/dist/base/tree.js +1 -1
  46. package/dist/base/upload-queue.js +1 -1
  47. package/dist/base/upload.js +3 -3
  48. package/dist/base/value-inputs.js +1 -1
  49. package/dist/blocks/admin.js +6 -6
  50. package/dist/blocks/ai.js +6 -6
  51. package/dist/blocks/analytics/usage-card.js +3 -0
  52. package/dist/blocks/analytics.js +361 -360
  53. package/dist/blocks/analytics.js.map +1 -1
  54. package/dist/blocks/collaboration.js +1 -1
  55. package/dist/blocks/commerce/receipt.js +1 -1
  56. package/dist/blocks/commerce.js +15 -15
  57. package/dist/blocks/data-display.js +1 -1
  58. package/dist/blocks/onboarding.js +3 -3
  59. package/dist/blocks/planning.js +311 -0
  60. package/dist/blocks/planning.js.map +1 -0
  61. package/dist/blocks/timelines.js +1 -1
  62. package/dist/{cards-BMB0laLG.js → cards-Cum56XOF.js} +3 -3
  63. package/dist/{cards-BMB0laLG.js.map → cards-Cum56XOF.js.map} +1 -1
  64. package/dist/checkbox-BavDRjF7.js +34 -0
  65. package/dist/checkbox-BavDRjF7.js.map +1 -0
  66. package/dist/{choice-inputs-CavA-SGV.js → choice-inputs-CC7XqPQO.js} +166 -191
  67. package/dist/choice-inputs-CC7XqPQO.js.map +1 -0
  68. package/dist/{code-block-DIlqzoiD.js → code-block-xHKbAJDj.js} +2 -2
  69. package/dist/{code-block-DIlqzoiD.js.map → code-block-xHKbAJDj.js.map} +1 -1
  70. package/dist/{combobox-HDftpzxt.js → combobox-DEbdr-3u.js} +2 -2
  71. package/dist/{combobox-HDftpzxt.js.map → combobox-DEbdr-3u.js.map} +1 -1
  72. package/dist/{combobox-CHD750do.js → combobox-xv3yJbzl.js} +7 -7
  73. package/dist/{combobox-CHD750do.js.map → combobox-xv3yJbzl.js.map} +1 -1
  74. package/dist/{command-D0kWBZfd.js → command-C0xe7u9B.js} +2 -2
  75. package/dist/{command-D0kWBZfd.js.map → command-C0xe7u9B.js.map} +1 -1
  76. package/dist/{comments-CvYeglMS.js → comments-DviPLnwy.js} +8 -8
  77. package/dist/{comments-CvYeglMS.js.map → comments-DviPLnwy.js.map} +1 -1
  78. package/dist/components/base/cards/smart-card.types.d.ts +2 -0
  79. package/dist/components/base/inline-edit/index.d.ts +2 -0
  80. package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
  81. package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
  82. package/dist/components/base/structure/structure.recipes.d.ts +6 -0
  83. package/dist/components/blocks/analytics/index.d.ts +1 -0
  84. package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
  85. package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
  86. package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
  87. package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
  88. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
  89. package/dist/components/blocks/planning/index.d.ts +3 -0
  90. package/dist/components/blocks/planning/task-card.d.ts +3 -0
  91. package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
  92. package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
  93. package/dist/{containers-CPNyNo1_.js → containers-6s-ucRQQ.js} +3 -2
  94. package/dist/containers-6s-ucRQQ.js.map +1 -0
  95. package/dist/{data-display-b3d1TfL4.js → data-display-cWIRdeaf.js} +8 -8
  96. package/dist/{data-display-b3d1TfL4.js.map → data-display-cWIRdeaf.js.map} +1 -1
  97. package/dist/{date-picker-DI6kPNof.js → date-picker-CA6ogMQB.js} +5 -5
  98. package/dist/{date-picker-DI6kPNof.js.map → date-picker-CA6ogMQB.js.map} +1 -1
  99. package/dist/{date-pickers-ByP6Cv2z.js → date-pickers-BPIKLdsD.js} +4 -4
  100. package/dist/{date-pickers-ByP6Cv2z.js.map → date-pickers-BPIKLdsD.js.map} +1 -1
  101. package/dist/{display-ByI5tkqy.js → display-CFM5myut.js} +3 -3
  102. package/dist/{display-ByI5tkqy.js.map → display-CFM5myut.js.map} +1 -1
  103. package/dist/features/activities.js +4 -4
  104. package/dist/features/ai-chat.js +4 -4
  105. package/dist/features/async-preview.js +4 -4
  106. package/dist/features/combobox.js +1 -1
  107. package/dist/features/comments.js +1 -1
  108. package/dist/features/data-view.js +5 -5
  109. package/dist/features/email-composer.js +11 -11
  110. package/dist/features/event-calendar.js +2 -2
  111. package/dist/features/event-calendar.js.map +1 -1
  112. package/dist/features/filters.js +1 -1
  113. package/dist/features/global-search.js +6 -6
  114. package/dist/features/map.js +3 -3
  115. package/dist/features/media-library.js +8 -8
  116. package/dist/features/mentions.js +1 -1
  117. package/dist/features/overlays.js +1 -1
  118. package/dist/features/products.js +43 -42
  119. package/dist/features/products.js.map +1 -1
  120. package/dist/features/questionnaire.js +107 -106
  121. package/dist/features/questionnaire.js.map +1 -1
  122. package/dist/features/resource-assignment.js +5 -5
  123. package/dist/features/resource.js +7 -7
  124. package/dist/features/rich-text-editor.js +1 -1
  125. package/dist/features/schema-form.js +11 -11
  126. package/dist/features/schema-form.js.map +1 -1
  127. package/dist/features/suggestions.js +2 -2
  128. package/dist/features/sync.js +2 -2
  129. package/dist/features/table.js +1 -1
  130. package/dist/features/theme-tweaker.js +11 -11
  131. package/dist/feedback-DWUkgEjR.js +233 -0
  132. package/dist/feedback-DWUkgEjR.js.map +1 -0
  133. package/dist/{field-affordance-recipes-CHdUtn2Z.js → field-affordance-recipes-IjzPrCTw.js} +2 -2
  134. package/dist/{field-affordance-recipes-CHdUtn2Z.js.map → field-affordance-recipes-IjzPrCTw.js.map} +1 -1
  135. package/dist/{filters-qtrcv1hf.js → filters-BhsUtsxW.js} +9 -9
  136. package/dist/{filters-qtrcv1hf.js.map → filters-BhsUtsxW.js.map} +1 -1
  137. package/dist/{form-field-C6W-y2hR.js → form-field-Bn7ZH1rA.js} +2 -2
  138. package/dist/{form-field-C6W-y2hR.js.map → form-field-Bn7ZH1rA.js.map} +1 -1
  139. package/dist/{form-sizing-39NohSqn.js → form-sizing-BWs70_a2.js} +4 -3
  140. package/dist/{form-sizing-39NohSqn.js.map → form-sizing-BWs70_a2.js.map} +1 -1
  141. package/dist/{forms-BF-HSbff.js → forms-B7pzS25o.js} +5 -5
  142. package/dist/{forms-BF-HSbff.js.map → forms-B7pzS25o.js.map} +1 -1
  143. package/dist/{forms-numeric-Y15Bg5Nr.js → forms-numeric-BUBxELBv.js} +18 -18
  144. package/dist/{forms-numeric-Y15Bg5Nr.js.map → forms-numeric-BUBxELBv.js.map} +1 -1
  145. package/dist/{header-B8ex54cY.js → header-C59QZyxV.js} +6 -6
  146. package/dist/{header-B8ex54cY.js.map → header-C59QZyxV.js.map} +1 -1
  147. package/dist/{hooks-D6UBVzf2.js → hooks-CM1Vp9Pe.js} +2 -2
  148. package/dist/{hooks-D6UBVzf2.js.map → hooks-CM1Vp9Pe.js.map} +1 -1
  149. package/dist/{input-DMorJiTI.js → input-WwYQZJzG.js} +3 -3
  150. package/dist/{input-DMorJiTI.js.map → input-WwYQZJzG.js.map} +1 -1
  151. package/dist/layout/app-shell.js +1 -1
  152. package/dist/layout/auth.js +1 -1
  153. package/dist/layout/containers.js +1 -1
  154. package/dist/layout/header.js +1 -1
  155. package/dist/layout/hooks.js +1 -1
  156. package/dist/layout/navigation.js +1 -1
  157. package/dist/layout/page.js +1 -1
  158. package/dist/layout/settings.js +1 -1
  159. package/dist/layout/sidebar.js +2 -2
  160. package/dist/layout/workspace.js +1 -1
  161. package/dist/layout.js +10 -10
  162. package/dist/lib/affordance-geometry.generated.d.ts +9 -0
  163. package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DhDRgnVZ.js} +2 -2
  164. package/dist/{media-gallery-Ca4YmvBi.js.map → media-gallery-DhDRgnVZ.js.map} +1 -1
  165. package/dist/{mentions-CRio8mTm.js → mentions-B8Ko-fhS.js} +4 -4
  166. package/dist/{mentions-CRio8mTm.js.map → mentions-B8Ko-fhS.js.map} +1 -1
  167. package/dist/{message-B5-6LeYl.js → message-COsdEvXT.js} +2 -2
  168. package/dist/{message-B5-6LeYl.js.map → message-COsdEvXT.js.map} +1 -1
  169. package/dist/{navigation-DqEITuD2.js → navigation-BUIn2Qxx.js} +2 -2
  170. package/dist/{navigation-DqEITuD2.js.map → navigation-BUIn2Qxx.js.map} +1 -1
  171. package/dist/{navigation-BTrEb5u4.js → navigation-DBEu4POU.js} +3 -3
  172. package/dist/{navigation-BTrEb5u4.js.map → navigation-DBEu4POU.js.map} +1 -1
  173. package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-GVh11KiT.js} +2 -2
  174. package/dist/{navigation-row-recipes-BFpvGPGE.js.map → navigation-row-recipes-GVh11KiT.js.map} +1 -1
  175. package/dist/{overlays-DBqV0J_V.js → overlays-B11wZka6.js} +4 -4
  176. package/dist/{overlays-DBqV0J_V.js.map → overlays-B11wZka6.js.map} +1 -1
  177. package/dist/{page-BMBGjJY8.js → page-BV6ioQg3.js} +5 -5
  178. package/dist/{page-BMBGjJY8.js.map → page-BV6ioQg3.js.map} +1 -1
  179. package/dist/{page-header-BH41wCyY.js → page-header-DQRa0jug.js} +2 -2
  180. package/dist/{page-header-BH41wCyY.js.map → page-header-DQRa0jug.js.map} +1 -1
  181. package/dist/{popover-TInGXsjg.js → popover-CoLDEg19.js} +2 -2
  182. package/dist/{popover-TInGXsjg.js.map → popover-CoLDEg19.js.map} +1 -1
  183. package/dist/{popover-menu-BzqXqE72.js → popover-menu-GLIQTJTx.js} +4 -4
  184. package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-GLIQTJTx.js.map} +1 -1
  185. package/dist/progress-BOe8l_FZ.js +168 -0
  186. package/dist/progress-BOe8l_FZ.js.map +1 -0
  187. package/dist/{receipt-DYWTQGEc.js → receipt-BM8xsGFy.js} +3 -3
  188. package/dist/{receipt-DYWTQGEc.js.map → receipt-BM8xsGFy.js.map} +1 -1
  189. package/dist/{rich-text-editor-BZSJchAF.js → rich-text-editor-CoVrTiSv.js} +2 -2
  190. package/dist/{rich-text-editor-BZSJchAF.js.map → rich-text-editor-CoVrTiSv.js.map} +1 -1
  191. package/dist/services/actions.js +1 -1
  192. package/dist/{settings-D9f_wdIC.js → settings-BnCyyPOJ.js} +3 -3
  193. package/dist/{settings-D9f_wdIC.js.map → settings-BnCyyPOJ.js.map} +1 -1
  194. package/dist/{sheet-vOUloJ4O.js → sheet-B-q914Ad.js} +2 -2
  195. package/dist/{sheet-vOUloJ4O.js.map → sheet-B-q914Ad.js.map} +1 -1
  196. package/dist/{sidebar-C3UKkbC5.js → sidebar-C_2p3Tfj.js} +6 -6
  197. package/dist/{sidebar-C3UKkbC5.js.map → sidebar-C_2p3Tfj.js.map} +1 -1
  198. package/dist/{sidebar-CNBKFDRW.js → sidebar-DPR7fmqN.js} +4 -4
  199. package/dist/{sidebar-CNBKFDRW.js.map → sidebar-DPR7fmqN.js.map} +1 -1
  200. package/dist/{skeleton-BvRhK8y-.js → skeleton-CmT1ppqb.js} +2 -2
  201. package/dist/{skeleton-BvRhK8y-.js.map → skeleton-CmT1ppqb.js.map} +1 -1
  202. package/dist/{smart-card-B5FcKODh.js → smart-card-CYLn46e6.js} +119 -118
  203. package/dist/smart-card-CYLn46e6.js.map +1 -0
  204. package/dist/{spinner-JtlFJ7Nc.js → spinner-BY9HbUEh.js} +2 -2
  205. package/dist/{spinner-JtlFJ7Nc.js.map → spinner-BY9HbUEh.js.map} +1 -1
  206. package/dist/{structure-BvW4vG4H.js → structure-MvKVq-oL.js} +13 -13
  207. package/dist/{structure-BvW4vG4H.js.map → structure-MvKVq-oL.js.map} +1 -1
  208. package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
  209. package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
  210. package/dist/style.css +1 -1
  211. package/dist/{table-ghtAQ-JJ.js → table-BS39xnlq.js} +6 -6
  212. package/dist/{table-ghtAQ-JJ.js.map → table-BS39xnlq.js.map} +1 -1
  213. package/dist/{tabs-DY09eoZg.js → tabs-B5cNMWiP.js} +2 -2
  214. package/dist/{tabs-DY09eoZg.js.map → tabs-B5cNMWiP.js.map} +1 -1
  215. package/dist/{text-inputs-BhOcedTo.js → text-inputs-Dh9XGyiS.js} +4 -4
  216. package/dist/{text-inputs-BhOcedTo.js.map → text-inputs-Dh9XGyiS.js.map} +1 -1
  217. package/dist/{timelines-CnZ2S_Gr.js → timelines-B9ICkQcV.js} +2 -2
  218. package/dist/{timelines-CnZ2S_Gr.js.map → timelines-B9ICkQcV.js.map} +1 -1
  219. package/dist/{tree-COD9BGdU.js → tree-BdWSaoFT.js} +2 -2
  220. package/dist/{tree-COD9BGdU.js.map → tree-BdWSaoFT.js.map} +1 -1
  221. package/dist/{upload-DIzw1dx1.js → upload-D8Za5x_c.js} +4 -4
  222. package/dist/{upload-DIzw1dx1.js.map → upload-D8Za5x_c.js.map} +1 -1
  223. package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-hIIYBLS7.js} +3 -3
  224. package/dist/{upload-queue-xRJ3qDmd.js.map → upload-queue-hIIYBLS7.js.map} +1 -1
  225. package/dist/usage-card-DnmnJ58D.js +458 -0
  226. package/dist/usage-card-DnmnJ58D.js.map +1 -0
  227. package/dist/{value-inputs-Co1fu-xv.js → value-inputs-DX2dbxjj.js} +7 -7
  228. package/dist/{value-inputs-Co1fu-xv.js.map → value-inputs-DX2dbxjj.js.map} +1 -1
  229. package/dist/{workspace-Cbqz4FzN.js → workspace-C1PZmk8L.js} +4 -4
  230. package/dist/{workspace-Cbqz4FzN.js.map → workspace-C1PZmk8L.js.map} +1 -1
  231. package/docs/consumer-skill/SKILL.md +120 -17
  232. package/docs/consumer-skill/examples/detail.tsx +7 -8
  233. package/docs/consumer-skill/examples/manifest.json +14 -0
  234. package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
  235. package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
  236. package/docs/consumer-skill/references/composition.md +103 -0
  237. package/docs/consumer-skill/references/design-contract.md +4 -3
  238. package/docs/consumer-skill/references/discovery.md +17 -0
  239. package/docs/consumer-skill/references/installation.md +20 -3
  240. package/docs/consumer-skill/references/integration.md +12 -0
  241. package/docs/consumer-skill/references/public-api.json +452 -229
  242. package/docs/consumer-skill/references/review.md +74 -0
  243. package/docs/consumer-skill/references/tokens.json +1 -1
  244. package/docs/consumer-skill/references/workflows.md +97 -1
  245. package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
  246. package/docs/consumer-skill/scripts/composition-policy.mjs +155 -0
  247. package/docs/consumer-skill/scripts/discovery.mjs +6 -1
  248. package/docs/consumer-skill/scripts/surface-policy.mjs +22 -0
  249. package/package.json +24 -3
  250. package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
  251. package/dist/avatar-CsnWaYmt.js.map +0 -1
  252. package/dist/choice-inputs-CavA-SGV.js.map +0 -1
  253. package/dist/containers-CPNyNo1_.js.map +0 -1
  254. package/dist/feedback-a9j9J-9A.js +0 -391
  255. package/dist/feedback-a9j9J-9A.js.map +0 -1
  256. package/dist/smart-card-B5FcKODh.js.map +0 -1
  257. package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"page-header-BH41wCyY.js","names":["cn","Text","Heading","Stack","Badge","Separator","isSimpleText","value","PageHeading","resolvedBadges","badges","badge","className","breadcrumbs","leading","contentClassName","eyebrow","DisplayLabel","eyebrowClassName","beforeTitle","titlePrefix","titleRowClassName","textGap","title","headingTag","titleClassName","item","index","titleSuffix","description","afterDescription","descriptionClassName","actions","actionsClassName","children","withSeparator"],"sources":["../src/components/base/navigation/page-header/page-header.tsx"],"sourcesContent":["/**\n * PageHeading — reusable visual heading block for sections and resources.\n * Higher-level layout components add routing/back behavior around this base\n * visual primitive instead of reimplementing title, description, badge, and\n * action spacing.\n */\nimport type { Key, ReactNode } from 'react';\nimport { DisplayLabel, Heading, Text, type HeadingTag } from '../../../typography';\nimport { Badge, type BadgeTone } from '../../badge';\nimport { Separator } from '../../display/separator';\nimport { Stack, type TextGap } from '../../structure';\nimport { cn } from '../../../../lib/utils';\n\nexport interface PageHeadingBadge {\n\tlabel: ReactNode;\n\ttone?: BadgeTone;\n\tkey?: Key;\n}\n\n/**\n * Slot map, top to bottom and outside in:\n *\n * ```text\n * breadcrumbs\n * leading │ eyebrow\n * │ beforeTitle\n * │ titlePrefix │ title badges titleSuffix │ actions\n * │ │ description\n * │ │ afterDescription\n * children\n * ─────────────────────────────────────────── (withSeparator)\n * ```\n */\nexport interface PageHeadingProps {\n\t/** Small label above the title. Plain text is rendered as a `DisplayLabel`. */\n\teyebrow?: ReactNode;\n\t/** The page title. Plain text is rendered as a `Heading`; pass an element to own the markup. */\n\ttitle: ReactNode;\n\t/** Supporting sentence under the title, capped at `max-w-2xl` and aligned to the title's left edge. */\n\tdescription?: ReactNode;\n\t/** Title/description rhythm. Defaults to normal. */\n\ttextGap?: TextGap;\n\t/** Heading level for a plain-text `title`. Default: `'h2'`. Set for correct document outline. */\n\theadingTag?: HeadingTag;\n\t/** Convenience for a single badge beside the title. Ignored when `badges` is set. */\n\tbadge?: PageHeadingBadge;\n\t/** Badges beside the title, in order. Takes precedence over `badge`. */\n\tbadges?: PageHeadingBadge[];\n\t/** Breadcrumb trail rendered above the header block. */\n\tbreadcrumbs?: ReactNode;\n\t/** Content to the left of the entire header column — an avatar or back button. Top-aligned. */\n\tleading?: ReactNode;\n\t/** Free slot between the eyebrow and the title row, for a banner or status strip. */\n\tbeforeTitle?: ReactNode;\n\t/**\n\t * Content immediately left of the title, vertically centred on the title\n\t * line alone. Unlike `leading`, the description aligns to the title's left\n\t * edge rather than to this slot, so an icon here never shifts the copy.\n\t */\n\ttitlePrefix?: ReactNode;\n\t/** Content after the title and badges, on the same line. */\n\ttitleSuffix?: ReactNode;\n\t/** Content directly beneath the description, sharing its alignment — a metadata line. */\n\tafterDescription?: ReactNode;\n\t/** Independent actions column beside the copy; follows it on narrow widths. */\n\tactions?: ReactNode;\n\t/** Content below the whole header block, above the separator. */\n\tchildren?: ReactNode;\n\t/** Merged onto the `<header>` root. */\n\tclassName?: string;\n\t/** Merged onto the column holding eyebrow, title, and description. */\n\tcontentClassName?: string;\n\t/** Merged onto the eyebrow. Only applies when `eyebrow` is plain text. */\n\teyebrowClassName?: string;\n\t/** Merged onto the title. Only applies when `title` is plain text. */\n\ttitleClassName?: string;\n\t/**\n\t * Merged onto the title row's grid. A `gap-space-md` here sets the\n\t * `titlePrefix`-to-title rhythm without also opening the gap under the title.\n\t */\n\ttitleRowClassName?: string;\n\t/** Merged onto the description. Only applies when `description` is plain text. */\n\tdescriptionClassName?: string;\n\t/** Merged onto the actions cluster. */\n\tactionsClassName?: string;\n\t/** Draws the rule beneath the header. Default: `true`. */\n\twithSeparator?: boolean;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport function PageHeading({\n\teyebrow,\n\ttitle,\n\tdescription,\n\ttextGap = 'normal',\n\theadingTag = 'h2',\n\tbadge,\n\tbadges,\n\tbreadcrumbs,\n\tleading,\n\tbeforeTitle,\n\ttitlePrefix,\n\ttitleSuffix,\n\tafterDescription,\n\tactions,\n\tchildren,\n\tclassName,\n\tcontentClassName,\n\teyebrowClassName,\n\ttitleClassName,\n\ttitleRowClassName,\n\tdescriptionClassName,\n\tactionsClassName,\n\twithSeparator = true,\n}: PageHeadingProps) {\n\tconst resolvedBadges = badges ?? (badge ? [badge] : []);\n\n\treturn (\n\t\t<header className={cn('page-heading--component page-header--component', 'w-full', className)}>\n\t\t\t{!!breadcrumbs && <div className=\"mb-space-lg\">{breadcrumbs}</div>}\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"start\" wrap={false}>\n\t\t\t\t{leading}\n\t\t\t\t<Stack gap=\"2xs\" className={cn('page-header--content-row flex-1', contentClassName)}>\n\t\t\t\t\t{!!eyebrow && (isSimpleText(eyebrow) ? (\n\t\t\t\t\t\t<DisplayLabel tag=\"div\" className={cn('mb-space-xs', eyebrowClassName)}>\n\t\t\t\t\t\t\t{eyebrow}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t) : eyebrow)}\n\t\t\t\t\t{beforeTitle}\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"lg\"\n\t\t\t\t\t\talign=\"start\"\n\t\t\t\t\t\twrap={{ base: false, sm: true }}\n\t\t\t\t\t\tclassName=\"page-header--headline-row min-w-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* The copy owns its width independently of actions. The inner\n\t\t\t\t\t\t grid keeps the description aligned after a title prefix. */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\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',\n\t\t\t\t\t\t\t\ttitlePrefix ? 'grid-cols-[auto_minmax(0,1fr)]' : 'grid-cols-[minmax(0,1fr)]',\n\t\t\t\t\t\t\t\ttitleRowClassName,\n\t\t\t\t\t\t\t\ttextGap === 'normal' ? 'gap-y-normal' : 'gap-y-dense',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!titlePrefix && (\n\t\t\t\t\t\t\t\t<span className=\"page-header--title-prefix inline-flex shrink-0 items-center self-center\">\n\t\t\t\t\t\t\t\t\t{titlePrefix}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap className=\"page-header--title-line min-h-action-sm min-w-0\">\n\t\t\t\t\t\t\t\t{isSimpleText(title) ? (\n\t\t\t\t\t\t\t\t\t<Heading tag={headingTag} className={cn('page-header--title min-w-0 [overflow-wrap:anywhere] border-0 pb-0', titleClassName)}>\n\t\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t\t) : title}\n\t\t\t\t\t\t\t\t{resolvedBadges.length > 0 && (\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap className=\"page-header--badges min-w-0 max-w-full\">\n\t\t\t\t\t\t\t\t\t\t{resolvedBadges.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Badge key={item.key ?? index} tone={item.tone ?? 'secondary'}>\n\t\t\t\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{titleSuffix}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{(!!description || !!afterDescription) && (\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" className={cn('page-header--title-block min-w-0', !!titlePrefix && 'col-start-2')}>\n\t\t\t\t\t\t\t\t\t{!!description && (isSimpleText(description) ? (\n\t\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className={cn('page-header--description max-w-2xl [overflow-wrap:anywhere]', descriptionClassName)}>\n\t\t\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : description)}\n\t\t\t\t\t\t\t\t\t{afterDescription}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!actions && (\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" className={cn('page-header--actions max-w-full shrink-0', actionsClassName)}>\n\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\n\t\t\t{!!children && <div className=\"mt-space-xl\">{children}</div>}\n\n\t\t\t{!!withSeparator && <Separator className=\"mt-space-xl\" />}\n\t\t</header>\n\t);\n}\n\nPageHeading.displayName = 'PageHeading';\n"],"mappings":";;;;;;;;AAyFA,SAASM,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AAEA,SAAgBC,EAAY,EAC3B,YACA,UACA,gBACA,aAAU,UACV,gBAAa,MACb,UACA,WACA,gBACA,YACA,gBACA,gBACA,gBACA,qBACA,YACA,aACA,cACA,qBACA,qBACA,mBACA,sBACA,yBACA,qBACA,mBAAgB,MACI;CACpB,IAAMC,IAAiBC,MAAWC,IAAQ,CAACA,CAAK,IAAI,CAAC;CAErD,OACC,kBAAC,UAAD;EAAQ,WAAWX,EAAG,kDAAkD,UAAUY,CAAS;EAA3F,UAAA;GACE,CAAC,CAACC,KAAe,kBAAC,OAAD;IAAK,WAAU;IAAe,UAAAA;GAAiB,CAAA;GAEjE,kBAACV,GAAD;IAAO,WAAU;IAAa,KAAI;IAAK,OAAM;IAAQ,MAAM;IAA3D,UAAA,CACEW,GACD,kBAACX,GAAD;KAAO,KAAI;KAAM,WAAWH,EAAG,mCAAmCe,CAAgB;KAAlF,UAAA;MACE,CAAC,CAACC,MAAYV,EAAaU,CAAO,IAClC,kBAACC,GAAD;OAAc,KAAI;O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QAAK,WAAWH,EAAG,4CAA4CiC,CAAgB;QAC/G,UAAAD;OACK,CAAA,CAEF;;KACD;IACD,CAAA,CAAA;;GAEN,CAAC,CAACE,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAe;GAAc,CAAA;GAE1D,CAAC,CAACC,KAAiB,kBAAC9B,GAAD,EAAW,WAAU,cAAe,CAAA;EACjD;;AAEV;AAEA,EAAY,cAAc"}
1
+ {"version":3,"file":"page-header-DQRa0jug.js","names":["cn","Text","Heading","Stack","Badge","Separator","isSimpleText","value","PageHeading","resolvedBadges","badges","badge","className","breadcrumbs","leading","contentClassName","eyebrow","DisplayLabel","eyebrowClassName","beforeTitle","titlePrefix","titleRowClassName","textGap","title","headingTag","titleClassName","item","index","titleSuffix","description","afterDescription","descriptionClassName","actions","actionsClassName","children","withSeparator"],"sources":["../src/components/base/navigation/page-header/page-header.tsx"],"sourcesContent":["/**\n * PageHeading — reusable visual heading block for sections and resources.\n * Higher-level layout components add routing/back behavior around this base\n * visual primitive instead of reimplementing title, description, badge, and\n * action spacing.\n */\nimport type { Key, ReactNode } from 'react';\nimport { DisplayLabel, Heading, Text, type HeadingTag } from '../../../typography';\nimport { Badge, type BadgeTone } from '../../badge';\nimport { Separator } from '../../display/separator';\nimport { Stack, type TextGap } from '../../structure';\nimport { cn } from '../../../../lib/utils';\n\nexport interface PageHeadingBadge {\n\tlabel: ReactNode;\n\ttone?: BadgeTone;\n\tkey?: Key;\n}\n\n/**\n * Slot map, top to bottom and outside in:\n *\n * ```text\n * breadcrumbs\n * leading │ eyebrow\n * │ beforeTitle\n * │ titlePrefix │ title badges titleSuffix │ actions\n * │ │ description\n * │ │ afterDescription\n * children\n * ─────────────────────────────────────────── (withSeparator)\n * ```\n */\nexport interface PageHeadingProps {\n\t/** Small label above the title. Plain text is rendered as a `DisplayLabel`. */\n\teyebrow?: ReactNode;\n\t/** The page title. Plain text is rendered as a `Heading`; pass an element to own the markup. */\n\ttitle: ReactNode;\n\t/** Supporting sentence under the title, capped at `max-w-2xl` and aligned to the title's left edge. */\n\tdescription?: ReactNode;\n\t/** Title/description rhythm. Defaults to normal. */\n\ttextGap?: TextGap;\n\t/** Heading level for a plain-text `title`. Default: `'h2'`. Set for correct document outline. */\n\theadingTag?: HeadingTag;\n\t/** Convenience for a single badge beside the title. Ignored when `badges` is set. */\n\tbadge?: PageHeadingBadge;\n\t/** Badges beside the title, in order. Takes precedence over `badge`. */\n\tbadges?: PageHeadingBadge[];\n\t/** Breadcrumb trail rendered above the header block. */\n\tbreadcrumbs?: ReactNode;\n\t/** Content to the left of the entire header column — an avatar or back button. Top-aligned. */\n\tleading?: ReactNode;\n\t/** Free slot between the eyebrow and the title row, for a banner or status strip. */\n\tbeforeTitle?: ReactNode;\n\t/**\n\t * Content immediately left of the title, vertically centred on the title\n\t * line alone. Unlike `leading`, the description aligns to the title's left\n\t * edge rather than to this slot, so an icon here never shifts the copy.\n\t */\n\ttitlePrefix?: ReactNode;\n\t/** Content after the title and badges, on the same line. */\n\ttitleSuffix?: ReactNode;\n\t/** Content directly beneath the description, sharing its alignment — a metadata line. */\n\tafterDescription?: ReactNode;\n\t/** Independent actions column beside the copy; follows it on narrow widths. */\n\tactions?: ReactNode;\n\t/** Content below the whole header block, above the separator. */\n\tchildren?: ReactNode;\n\t/** Merged onto the `<header>` root. */\n\tclassName?: string;\n\t/** Merged onto the column holding eyebrow, title, and description. */\n\tcontentClassName?: string;\n\t/** Merged onto the eyebrow. Only applies when `eyebrow` is plain text. */\n\teyebrowClassName?: string;\n\t/** Merged onto the title. Only applies when `title` is plain text. */\n\ttitleClassName?: string;\n\t/**\n\t * Merged onto the title row's grid. A `gap-space-md` here sets the\n\t * `titlePrefix`-to-title rhythm without also opening the gap under the title.\n\t */\n\ttitleRowClassName?: string;\n\t/** Merged onto the description. Only applies when `description` is plain text. */\n\tdescriptionClassName?: string;\n\t/** Merged onto the actions cluster. */\n\tactionsClassName?: string;\n\t/** Draws the rule beneath the header. Default: `true`. */\n\twithSeparator?: boolean;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport function PageHeading({\n\teyebrow,\n\ttitle,\n\tdescription,\n\ttextGap = 'normal',\n\theadingTag = 'h2',\n\tbadge,\n\tbadges,\n\tbreadcrumbs,\n\tleading,\n\tbeforeTitle,\n\ttitlePrefix,\n\ttitleSuffix,\n\tafterDescription,\n\tactions,\n\tchildren,\n\tclassName,\n\tcontentClassName,\n\teyebrowClassName,\n\ttitleClassName,\n\ttitleRowClassName,\n\tdescriptionClassName,\n\tactionsClassName,\n\twithSeparator = true,\n}: PageHeadingProps) {\n\tconst resolvedBadges = badges ?? (badge ? [badge] : []);\n\n\treturn (\n\t\t<header className={cn('page-heading--component page-header--component', 'w-full', className)}>\n\t\t\t{!!breadcrumbs && <div className=\"mb-space-lg\">{breadcrumbs}</div>}\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"start\" wrap={false}>\n\t\t\t\t{leading}\n\t\t\t\t<Stack gap=\"2xs\" className={cn('page-header--content-row flex-1', contentClassName)}>\n\t\t\t\t\t{!!eyebrow && (isSimpleText(eyebrow) ? (\n\t\t\t\t\t\t<DisplayLabel tag=\"div\" className={cn('mb-space-xs', eyebrowClassName)}>\n\t\t\t\t\t\t\t{eyebrow}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t) : eyebrow)}\n\t\t\t\t\t{beforeTitle}\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"lg\"\n\t\t\t\t\t\talign=\"start\"\n\t\t\t\t\t\twrap={{ base: false, sm: true }}\n\t\t\t\t\t\tclassName=\"page-header--headline-row min-w-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* The copy owns its width independently of actions. The inner\n\t\t\t\t\t\t grid keeps the description aligned after a title prefix. */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\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',\n\t\t\t\t\t\t\t\ttitlePrefix ? 'grid-cols-[auto_minmax(0,1fr)]' : 'grid-cols-[minmax(0,1fr)]',\n\t\t\t\t\t\t\t\ttitleRowClassName,\n\t\t\t\t\t\t\t\ttextGap === 'normal' ? 'gap-y-normal' : 'gap-y-dense',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!titlePrefix && (\n\t\t\t\t\t\t\t\t<span className=\"page-header--title-prefix inline-flex shrink-0 items-center self-center\">\n\t\t\t\t\t\t\t\t\t{titlePrefix}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap className=\"page-header--title-line min-h-action-sm min-w-0\">\n\t\t\t\t\t\t\t\t{isSimpleText(title) ? (\n\t\t\t\t\t\t\t\t\t<Heading tag={headingTag} className={cn('page-header--title min-w-0 [overflow-wrap:anywhere] border-0 pb-0', titleClassName)}>\n\t\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t\t) : title}\n\t\t\t\t\t\t\t\t{resolvedBadges.length > 0 && (\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap className=\"page-header--badges min-w-0 max-w-full\">\n\t\t\t\t\t\t\t\t\t\t{resolvedBadges.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Badge key={item.key ?? index} tone={item.tone ?? 'secondary'}>\n\t\t\t\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{titleSuffix}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{(!!description || !!afterDescription) && (\n\t\t\t\t\t\t\t\t<Stack gap=\"2xs\" className={cn('page-header--title-block min-w-0', !!titlePrefix && 'col-start-2')}>\n\t\t\t\t\t\t\t\t\t{!!description && (isSimpleText(description) ? (\n\t\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className={cn('page-header--description max-w-2xl [overflow-wrap:anywhere]', descriptionClassName)}>\n\t\t\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : description)}\n\t\t\t\t\t\t\t\t\t{afterDescription}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!actions && (\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" className={cn('page-header--actions max-w-full shrink-0', actionsClassName)}>\n\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\n\t\t\t{!!children && <div className=\"mt-space-xl\">{children}</div>}\n\n\t\t\t{!!withSeparator && <Separator className=\"mt-space-xl\" />}\n\t\t</header>\n\t);\n}\n\nPageHeading.displayName = 'PageHeading';\n"],"mappings":";;;;;;;;AAyFA,SAASM,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AAEA,SAAgBC,EAAY,EAC3B,YACA,UACA,gBACA,aAAU,UACV,gBAAa,MACb,UACA,WACA,gBACA,YACA,gBACA,gBACA,gBACA,qBACA,YACA,aACA,cACA,qBACA,qBACA,mBACA,sBACA,yBACA,qBACA,mBAAgB,MACI;CACpB,IAAMC,IAAiBC,MAAWC,IAAQ,CAACA,CAAK,IAAI,CAAC;CAErD,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A;WAEPC;UACK;;UACL,CAAC,CAACC,KAAe,CAAC,CAACC,MACpB,kBAAC3B,GAAD;UAAO,KAAI;UAAM,WAAWH,EAAG,oCAAoC,CAAC,CAACoB,KAAe,aAAa;UAAjG,UAAA,CACE,CAAC,CAACS,MAAgBvB,EAAauB,CAAW,IAC1C,kBAAC5B,GAAD;WAAM,MAAK;WAAY,WAAWD,EAAG,+DAA+D+B,CAAoB;WACtH,UAAAF;UACI,CAAA,IACHA,IACHC,CACK;;QAEJ;OACJ,CAAA,GAAA,CAAC,CAACE,KACF,kBAAC7B,GAAD;QAAO,WAAU;QAAa,KAAI;QAAK,WAAWH,EAAG,4CAA4CiC,CAAgB;QAC/G,UAAAD;OACK,CAAA,CAEF;;KACD;IACD,CAAA,CAAA;;GAEN,CAAC,CAACE,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAe;GAAc,CAAA;GAE1D,CAAC,CAACC,KAAiB,kBAAC9B,GAAD,EAAW,WAAU,cAAe,CAAA;EACjD;;AAEV;AAEA,EAAY,cAAc"}
@@ -5,7 +5,7 @@ import { a as n } from "./typography-Cv8MT-82.js";
5
5
  import { t as r } from "./anchored-positioning-DPnKTvNs.js";
6
6
  import { t as i } from "./motion-recipes-B6jKXEcN.js";
7
7
  import { t as a } from "./slot-CLF9kLrS.js";
8
- import { t as o } from "./structure-BvW4vG4H.js";
8
+ import { t as o } from "./structure-MvKVq-oL.js";
9
9
  import { n as s } from "./surface-recipes-CQfRr-VL.js";
10
10
  import { i as c, r as l } from "./popover.recipes-zgBhMlUu.js";
11
11
  import * as u from "react";
@@ -191,4 +191,4 @@ function D({ className: e, children: r, caption: i, ...a }) {
191
191
  //#endregion
192
192
  export { T as a, h as c, w as i, E as n, m as o, D as r, g as s, C as t };
193
193
 
194
- //# sourceMappingURL=popover-TInGXsjg.js.map
194
+ //# sourceMappingURL=popover-CoLDEg19.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-TInGXsjg.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","motionRecipes","Slot","Stack","surfaceDividerRecipes","surfaceInsetClasses","popoverRecipes","React$1","Popover$1","props","Popover","PopoverTrigger","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","inferredNativeButton","children","resolvedNativeButton","nativeButton","PopoverAnchor","PopoverContent$1","disablePortal","resolvedContainer","container","inlineHost","setInlineHost","content","cn","className","PopoverHeader$1","PopoverTitle$1","PopoverDescription$1","isSimpleText","value","PopoverSurfaceContext","PopoverContent","resolvedType","type","inset","PopoverHeader","surface","copyGap","textGap","band","menu","hasStart","start","PopoverTitle","compact","PopoverDescription","PopoverFooter","childrenAsCaption","caption"],"sources":["../src/components/ui/popover.tsx","../src/components/base/popover/popover.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport * as React from \"react\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Popover({ ...props }: PopoverPrimitive.Root.Props) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n asChild = false,\n nativeButton,\n render,\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props & { asChild?: boolean; nativeButton?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: PopoverPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n let inferredNativeButton = true\n if (asChild && React.isValidElement(children)) {\n if (typeof children.type === \"string\") {\n inferredNativeButton = children.type === \"button\"\n } else {\n const childProps = (children.props ?? {}) as Record<string, unknown>\n inferredNativeButton = !(\"href\" in childProps)\n }\n }\n const resolvedNativeButton = nativeButton ?? (asChild ? inferredNativeButton : true)\n return (\n <PopoverPrimitive.Trigger\n data-slot=\"popover-trigger\"\n render={slotRender ?? safeRender}\n nativeButton={resolvedNativeButton}\n {...props}\n >\n {children}\n </PopoverPrimitive.Trigger>\n )\n}\n\nfunction PopoverAnchor({\n asChild = false,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\"> & { asChild?: boolean }) {\n if (asChild) {\n return <Slot {...props} />\n }\n\n return <span data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n container,\n align = \"center\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n disablePortal = false,\n positionMethod = disablePortal ? \"absolute\" : anchoredPositionMethod,\n onOpenAutoFocus,\n onInteractOutside,\n ...props\n}: PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"positionMethod\"\n > & {\n disablePortal?: boolean\n onOpenAutoFocus?: (event: Event) => void\n onInteractOutside?: (event: Event) => void\n } & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n const [inlineHost, setInlineHost] = React.useState<HTMLDivElement | null>(null)\n void onOpenAutoFocus\n void onInteractOutside\n\n const content = (\n <PopoverPrimitive.Positioner\n positionMethod={positionMethod}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n motionRecipes.popup,\n \"bg-popover text-popover-foreground ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n )\n\n if (disablePortal) {\n // Base UI requires Portal context; a local host preserves inline DOM locality.\n return <div data-popover-inline-host=\"\" className=\"contents\" ref={setInlineHost}>\n <PopoverPrimitive.Portal container={inlineHost}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col gap-1 text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] max-w-[calc(100vw-2rem)] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\tsize={compact ? undefined : 'base'}\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"popover-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverTitlePrimitive>\n\t);\n}\n\ntype PopoverDescriptionBaseProps = React.ComponentProps<typeof PopoverDescriptionPrimitive>;\n\nfunction PopoverDescription({ children, className, ...props }: PopoverDescriptionBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverDescriptionPrimitive\n\t\t\tclassName={cn('popover-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,SAASA,EAAQ,EAAE,GAAGuB,KAAsC;CAC1D,OAAO,kBAACtB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIsB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACX,GAAD,CAAO,CAAA,IAAI,KAAA,GAClCY,IAAuD,OAAOC,KAAW,eACzE,GAAa,MAAU;EACzB,IAAM,EAAE,cAAcC,GAAe,GAAGC,MAASC;EAEjD,OAAOH,EAAOE,GAA4BE,CAAK;CACjD,KACEJ,GACAK,IAAuB;CAC3B,AAAIP,KAAWzB,EAAM,eAAeiC,CAAQ,MAC1C,AAIED,IAJE,OAAOC,EAAS,QAAS,WACJA,EAAS,SAAS,WAGlB,EAAE,WADLA,EAAS,SAAS,CAAC;CA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ahB,CAAQ,GAC5DU,IAAU0B,MAAYD,IAAoBnC,IAAW,KAAA;CAC3D,OACC,kBAAClB,GAAD;EACC,WAAU;EACV,KAAI;EACJ,SAAQ;EACR,MAAA;EACA,WAAW6B,EACV,yCAAyC5B,EAAsB,SAAS,QACxEyC,EAAQ,SAAS,CAACA,EAAQ,gBAAgBA,EAAQ,SAAS,SAASvC,EAAe,aAAaA,EAAe,UAE/G2B,CACD;EACA,GAAIxB;EAEJ,UAAA,kBAAC8B,EAAsB,UAAvB;GAAgC,OAAO;IAAE,GAAGM;IAAS,aAAa;GAAK;GAAvE,UAAA,CACEd,KAAW,QAAQ,kBAAC,OAAD;IAAK,WAAWC,EAAG,sDAAsDa,EAAQ,SAAS,UAAU,CAACA,EAAQ,eAAe,UAAU;IACxJ,UAAAR,EAAaN,CAAO,IAAI,kBAAChC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAgC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBnC,CACQ;;CAC1B,CAAA;AAET"}
1
+ {"version":3,"file":"popover-CoLDEg19.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","motionRecipes","Slot","Stack","surfaceDividerRecipes","surfaceInsetClasses","popoverRecipes","React$1","Popover$1","props","Popover","PopoverTrigger","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","inferredNativeButton","children","resolvedNativeButton","nativeButton","PopoverAnchor","PopoverContent$1","disablePortal","resolvedContainer","container","inlineHost","setInlineHost","content","cn","className","PopoverHeader$1","PopoverTitle$1","PopoverDescription$1","isSimpleText","value","PopoverSurfaceContext","PopoverContent","resolvedType","type","inset","PopoverHeader","surface","copyGap","textGap","band","menu","hasStart","start","PopoverTitle","compact","PopoverDescription","PopoverFooter","childrenAsCaption","caption"],"sources":["../src/components/ui/popover.tsx","../src/components/base/popover/popover.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport * as React from \"react\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Popover({ ...props }: PopoverPrimitive.Root.Props) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n asChild = false,\n nativeButton,\n render,\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props & { asChild?: boolean; nativeButton?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: PopoverPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n let inferredNativeButton = true\n if (asChild && React.isValidElement(children)) {\n if (typeof children.type === \"string\") {\n inferredNativeButton = children.type === \"button\"\n } else {\n const childProps = (children.props ?? {}) as Record<string, unknown>\n inferredNativeButton = !(\"href\" in childProps)\n }\n }\n const resolvedNativeButton = nativeButton ?? (asChild ? inferredNativeButton : true)\n return (\n <PopoverPrimitive.Trigger\n data-slot=\"popover-trigger\"\n render={slotRender ?? safeRender}\n nativeButton={resolvedNativeButton}\n {...props}\n >\n {children}\n </PopoverPrimitive.Trigger>\n )\n}\n\nfunction PopoverAnchor({\n asChild = false,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\"> & { asChild?: boolean }) {\n if (asChild) {\n return <Slot {...props} />\n }\n\n return <span data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n container,\n align = \"center\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n disablePortal = false,\n positionMethod = disablePortal ? \"absolute\" : anchoredPositionMethod,\n onOpenAutoFocus,\n onInteractOutside,\n ...props\n}: PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"positionMethod\"\n > & {\n disablePortal?: boolean\n onOpenAutoFocus?: (event: Event) => void\n onInteractOutside?: (event: Event) => void\n } & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n const [inlineHost, setInlineHost] = React.useState<HTMLDivElement | null>(null)\n void onOpenAutoFocus\n void onInteractOutside\n\n const content = (\n <PopoverPrimitive.Positioner\n positionMethod={positionMethod}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n motionRecipes.popup,\n \"bg-popover text-popover-foreground ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n )\n\n if (disablePortal) {\n // Base UI requires Portal context; a local host preserves inline DOM locality.\n return <div data-popover-inline-host=\"\" className=\"contents\" ref={setInlineHost}>\n <PopoverPrimitive.Portal container={inlineHost}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col gap-1 text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] max-w-[calc(100vw-2rem)] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\tsize={compact ? undefined : 'base'}\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"popover-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverTitlePrimitive>\n\t);\n}\n\ntype PopoverDescriptionBaseProps = React.ComponentProps<typeof PopoverDescriptionPrimitive>;\n\nfunction PopoverDescription({ children, className, ...props }: PopoverDescriptionBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverDescriptionPrimitive\n\t\t\tclassName={cn('popover-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,SAASA,EAAQ,EAAE,GAAGuB,KAAsC;CAC1D,OAAO,kBAACtB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIsB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACX,GAAD,CAAO,CAAA,IAAI,KAAA,GAClCY,IAAuD,OAAOC,KAAW,eACzE,GAAa,MAAU;EACzB,IAAM,EAAE,cAAcC,GAAe,GAAGC,MAASC;EAEjD,OAAOH,EAAOE,GAA4BE,CAAK;CACjD,KACEJ,GACAK,IAAuB;CAC3B,AAAIP,KAAWzB,EAAM,eAAeiC,CAAQ,MAC1C,AAIED,IAJE,OAAOC,EAAS,QAAS,WACJA,EAAS,SAAS,WAGlB,EAAE,WADLA,EAAS,SAAS,CAAC;CAI3C,IAAMC,IAAuBC,MAAiB,MAAUH;CACxD,OACE,kBAACjC,EAAiB,SAAlB;EACE,aAAU;EACV,QAAQyB,KAAcE;EACtB,cAAcQ;EACd,GAAIb;EAEH;CACuB,CAAA;AAE9B;AAEA,SAASe,EAAc,EACrB,aAAU,IACV,GAAGf,KAC8D;CAKjE,OAJII,IACK,kBAACX,GAAD,EAAM,GAAIO,EAAQ,CAAA,IAGpB,kBAAC,QAAD;EAAM,aAAU;EAAiB,GAAIA;CAAQ,CAAA;AACtD;AAEA,SAASpB,EAAe,EACtB,cACA,cACA,WAAQ,UACR,iBAAc,GACd,UAAO,UACP,gBAAa,GACb,mBAAgB,IAChB,oBAAiBqC,IAAgB,aAAa1B,GAC9C,oBACA,sBACA,GAAGS,KASuC;CAC1C,IAAMkB,IAAoB7B,EAAwB8B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AI,kBAAChC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAgC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBnC,CACQ;;CAC1B,CAAA;AAET"}
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { useStrings as e } from "./lib/strings.js";
3
3
  import { t } from "./utils-C2EKeIw3.js";
4
- import { n, t as r } from "./feedback-a9j9J-9A.js";
4
+ import { n, t as r } from "./feedback-DWUkgEjR.js";
5
5
  import { t as i } from "./collection-content-C4fthJV_.js";
6
- import { a, i as o, l as s, n as c, o as l, r as u, t as d } from "./command-D0kWBZfd.js";
7
- import { c as f, i as p, o as m, r as h, t as g } from "./popover-TInGXsjg.js";
6
+ import { a, i as o, l as s, n as c, o as l, r as u, t as d } from "./command-C0xe7u9B.js";
7
+ import { c as f, i as p, o as m, r as h, t as g } from "./popover-CoLDEg19.js";
8
8
  import * as _ from "react";
9
9
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
10
10
  //#region src/components/base/popover-menu/popover-menu.types.ts
@@ -96,4 +96,4 @@ S.displayName = "PopoverMenu";
96
96
  //#endregion
97
97
  export { x as n, S as t };
98
98
 
99
- //# sourceMappingURL=popover-menu-BzqXqE72.js.map
99
+ //# sourceMappingURL=popover-menu-GLIQTJTx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-menu-BzqXqE72.js","names":["React","_Fragment","ErrorState","CollectionContent","CommandInput","commandFilter","CommandEmpty","CommandList","CommandGroup","Command","PopoverTrigger","PopoverHeader","Popover","PopoverFooter","PopoverContent","React$1","Fragment$1","defaultPopoverMenuStrings","PopoverMenu","stringsProp","strings","useStrings","searchRef","triggerRef","keyboardDismissal","contentRef","searchOverrides","items","item","filter","value","search","keywords","next","details","onOpenChange","trigger","contentLabelledBy","contentLabel","cn","contentClassName","onSearchChange","header","searchValue","loading","loadingSlot","LoadingState","error","onRetry","empty","CommandItem","onSelect","renderItem","footer"],"sources":["../src/components/base/popover-menu/popover-menu.types.ts","../src/components/base/popover-menu/popover-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface PopoverMenuItem<T = unknown> {\n\t/** Unique identifier; remains distinct from visible search labels. */\n\tvalue: string;\n\t/** Visible label rendered in the row. Override entirely via `renderItem`. */\n\tlabel: ReactNode;\n\t/** Optional secondary line rendered under the label. */\n\tdescription?: ReactNode;\n\t/** Leading icon — keep small (size-icon-md/size-icon max). */\n\ticon?: ReactNode;\n\t/** Show the trailing checkmark when `true`. */\n\tselected?: boolean;\n\t/** Disable the row. */\n\tdisabled?: boolean;\n\t/** Explicit search keywords, useful when the label is structured content. */\n\tsearchValue?: string;\n\t/** Arbitrary payload for `onSelect` consumers. */\n\tdata?: T;\n}\n\nexport interface PopoverMenuStrings {\n\t/** Placeholder for the search input (when `search` is enabled). */\n\tsearchPlaceholder: string;\n\t/** Empty-state copy when filtering yields no items. */\n\tempty: string;\n\t/** Loading-state copy. */\n\tloading: string;\n\t/** Retry action copy when a resource fails. */\n\tretry?: string;\n}\n\nexport const defaultPopoverMenuStrings: PopoverMenuStrings = {\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No results.',\n\tloading: 'Loading…',\n\tretry: 'Retry',\n};\n","import { commandFilter } from '../../../lib/command-filter';\n/**\n * PopoverMenu — blocks wrapper around `base/popover` + `base/command`.\n *\n * Captures the recurring \"trigger → optional header → search → command list\"\n * pattern used by filter facets, operator selects, and similar pickers\n * across the library.\n *\n * Slots (all optional):\n * - `header` — rendered above the search input / list\n * - `footer` — rendered below the list (e.g. confirm/clear buttons)\n * - `empty` — replaces the default empty-state copy\n * - `loading` — replaces the list when `loading` is true\n *\n * Render-prop:\n * - `renderItem={(item, ctx) => ReactNode}` — full control over a row\n *\n * Strings:\n * - `strings={{ searchPlaceholder, empty, loading }}` — merged with defaults\n *\n * For headless usage (custom UI against the same selection state),\n * compose `base/popover` + `base/command` directly.\n */\nimport * as React from 'react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../command';\nimport {\n\tPopover,\n\tPopoverContent,\n PopoverHeader,\n PopoverFooter,\n\tPopoverTrigger,\n} from '../popover';\nimport { LoadingState, ErrorState } from '../feedback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { type CollectionDensity } from '../popover/popover.recipes';\nimport { CollectionContent } from '../popover/collection-content';\n\nimport {\n\tdefaultPopoverMenuStrings,\n\ttype PopoverMenuItem,\n\ttype PopoverMenuStrings,\n} from './popover-menu.types';\n\nexport interface PopoverMenuRenderItemContext {\n\t/** True when the item is the user's currently-active match (keyboard or pointer highlight). */\n\tisHighlighted: boolean;\n}\n\nexport interface PopoverMenuProps<T = unknown> {\n\t/** Vertical row rhythm. Compact and comfortable preserve primary label size and inline room. */\n\tdensity?: CollectionDensity;\n\t/** Trigger element. The popover anchors to it. Pass any clickable. */\n\ttrigger: React.ReactNode;\n\t/** Items to render in the list. */\n\titems: ReadonlyArray<PopoverMenuItem<T>>;\n\t/** Selection callback — fires on row click / Enter. */\n\tonSelect: (item: PopoverMenuItem<T>) => void;\n\n\t/** Controlled open state. Omit for uncontrolled. */\n\topen?: boolean;\n\t/** Open-state callback for controlled / uncontrolled flows. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Show the search input above the list. Default: true. */\n\tsearch?: boolean;\n\t/** Search input value (controlled). */\n\tsearchValue?: string;\n\t/** Search input change callback. */\n\tonSearchChange?: (value: string) => void;\n\n\t/** Async loading flag — replaces stale options and the empty state. */\n\tloading?: boolean;\n\t/** Resource failure replaces the list. The application owns retry and fetching. */\n\terror?: React.ReactNode;\n\tonRetry?: () => void;\n\n\t/** Optional pre-list slot (e.g. a label / eyebrow). */\n\theader?: React.ReactNode;\n\t/** Optional post-list slot (e.g. confirm / clear buttons). */\n\tfooter?: React.ReactNode;\n\t/** Override empty-state slot (defaults to `strings.empty`). */\n\tempty?: React.ReactNode;\n\t/** Override loading slot (defaults to spinner + `strings.loading`). */\n\tloadingSlot?: React.ReactNode;\n\n\t/** Per-item render override. */\n\trenderItem?: (\n\t\titem: PopoverMenuItem<T>,\n\t\tctx: PopoverMenuRenderItemContext,\n\t) => React.ReactNode;\n\n\t/** Override copy. Deep-merged over defaults. */\n\tstrings?: StringsProp<PopoverMenuStrings>;\n\n\t/** Popover content positioning props (forwarded). */\n\talign?: React.ComponentProps<typeof PopoverContent>['align'];\n\t/** Distance from the trigger, in pixels. */\n\tsideOffset?: React.ComponentProps<typeof PopoverContent>['sideOffset'];\n\n\t/** Width override for the popover content. Default: w-56. */\n\tcontentClassName?: string;\n /** Accessible name for the popup. Defaults to the localized search label. */\n contentLabel?: string;\n /** ID of a consumer-owned title used instead of contentLabel. */\n contentLabelledBy?: string;\n}\n\nexport function PopoverMenu<T = unknown>({\n\tdensity = 'default',\n\ttrigger,\n\titems,\n\tonSelect,\n\topen,\n\tonOpenChange,\n\tsearch = true,\n\tsearchValue,\n\tonSearchChange,\n\tloading = false,\n\terror,\n\tonRetry,\n\theader,\n\tfooter,\n\tempty,\n\tloadingSlot,\n\trenderItem,\n\tstrings: stringsProp,\n\talign = 'start',\n\tsideOffset,\n\tcontentClassName,\n contentLabel,\n contentLabelledBy,\n}: PopoverMenuProps<T>) {\n\tconst strings = useStrings(defaultPopoverMenuStrings, stringsProp);\n\tconst searchRef = React.useRef<HTMLInputElement>(null);\n\tconst triggerRef = React.useRef<HTMLButtonElement>(null);\n\tconst keyboardDismissal = React.useRef(false);\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n const searchOverrides = React.useMemo(() => new Map(\n items.filter(item => item.searchValue !== undefined).map(item => [item.value, item.searchValue!]),\n ), [items]);\n const filter = React.useCallback((value: string, search: string, keywords?: string[]) => (\n searchOverrides.has(value)\n ? commandFilter(searchOverrides.get(value)!, search)\n : commandFilter(value, search, keywords)\n ), [searchOverrides]);\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={(next, details) => {\n keyboardDismissal.current = !next && details.reason === 'escape-key';\n onOpenChange?.(next);\n }} onOpenChangeComplete={next => {\n // Rapid reopen during a focus-out exit can retain Base UI's no-return flag.\n // Restore only an accepted, completed Escape dismissal; outside focus stays owned.\n if (!next && keyboardDismissal.current) {\n keyboardDismissal.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n }\n }}>\n\t\t\t<PopoverTrigger ref={triggerRef} render={trigger as React.ReactElement} />\n\t\t\t<PopoverContent\n\t\t\t\tref={contentRef}\n\t\t\t\taria-label={contentLabelledBy ? undefined : contentLabel ?? strings.searchPlaceholder}\n aria-labelledby={contentLabelledBy}\n align={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\ttype=\"menu\"\n\t\t\t\tinset=\"flush\"\n\t\t\t\tclassName={cn('popover-menu--component', 'w-56 gap-0 overflow-hidden', contentClassName)}\n\t\t\t>\n\t\t\t\t<Command\n\t\t\t\t\tshouldFilter={!onSearchChange}\n filter={filter}\n\t\t\t\t\tinset=\"flush\"\n\t\t\t\t\tclassName=\"popover-menu--collection\"\n\t\t\t\t>\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<PopoverHeader className=\"popover-menu--header\">\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{!!search && (\n\t\t\t\t\t\t<CommandInput\n\t\t\t\t\t\t\tref={searchRef}\n\t\t\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\t\tonValueChange={onSearchChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<CommandList aria-busy={loading || undefined}>\n\t\t\t\t\t\t{loading ? (loadingSlot !== undefined ? <div role=\"status\" aria-live=\"polite\">{loadingSlot}</div> : <LoadingState label={strings.loading} />) : error ? <ErrorState variant=\"inline\" description={error} onRetry={onRetry ? () => {\n // Retry feedback is replaced by loading. Keep focus on persistent anatomy\n // before its button is removed, including in search-free pickers.\n (searchRef.current ?? contentRef.current)?.focus();\n onRetry();\n } : undefined} retryLabel={strings.retry ?? 'Retry'} /> : <>\n\n\t\t\t\t\t\t<CommandEmpty>{empty ?? strings.empty}</CommandEmpty>\n\n\t\t\t\t\t\t{items.length > 0 && (\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\t\tvalue={item.value}\n keywords={item.searchValue !== undefined ? [item.searchValue] : [item.label, item.description].filter((value): value is string => typeof value === 'string')}\n\t\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(item)}\n\t\t\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t\t\t\tdata-checked={item.selected || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName=\"data-[checked=true]:**:[svg]:text-primary-accent\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{({ isHighlighted }) => renderItem\n\t\t\t\t\t\t\t\t\t\t\t? renderItem(item, { isHighlighted })\n\t\t\t\t\t\t\t\t\t\t\t: (\n\t\t\t\t\t\t\t\t\t\t\t\t<CollectionContent label={item.label} description={item.description} leading={item.icon} leadingClassName=\"[&_svg]:size-icon\"/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>}\n\t\t\t\t\t</CommandList>\n\n\t\t\t\t\t{/* The public surface anatomy owns header and footer bands. */}\n\t\t\t\t\t{!!footer && (\n\t\t\t\t\t\t<PopoverFooter className=\"popover-menu--footer justify-start\">\n\t\t\t\t\t\t\t{foot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,MAA2B,OAAOE,KAAU,QAAQ,IAAhH,CAACF,EAAK,WAAW;OAC1F,gBAAgBuB,EAASvB,CAAI;OAC7B,UAAUA,EAAK;OACf,gBAAcA,EAAK,YAAY,KAAA;OAC/B,WAAU;OAER,WAAA,EAAE,uBAAoBwB,IACrBA,EAAWxB,GAAM,EAAE,iBAAc,CAAC,IAEnC,kBAACzB,GAAD;QAAmB,OAAOyB,EAAK;QAAO,aAAaA,EAAK;QAAa,SAASA,EAAK;QAAM,kBAAiB;OAAoB,CAAA;MAEpH,GAdPA,EAAK,KAcE,CACb,EACY,CAAA,CAEb,EAAA,CAAA;KACU,CAAA;KAGZ,CAAC,CAACyB,KACF,kBAACxC,GAAD;MAAe,WAAU;MACvB,UAAAwC;KACa,CAAA;IAER;;EACM,CAAA,CACR;;AAEX;AAEA,EAAY,cAAc"}
1
+ {"version":3,"file":"popover-menu-GLIQTJTx.js","names":["React","_Fragment","ErrorState","CollectionContent","CommandInput","commandFilter","CommandEmpty","CommandList","CommandGroup","Command","PopoverTrigger","PopoverHeader","Popover","PopoverFooter","PopoverContent","React$1","Fragment$1","defaultPopoverMenuStrings","PopoverMenu","stringsProp","strings","useStrings","searchRef","triggerRef","keyboardDismissal","contentRef","searchOverrides","items","item","filter","value","search","keywords","next","details","onOpenChange","trigger","contentLabelledBy","contentLabel","cn","contentClassName","onSearchChange","header","searchValue","loading","loadingSlot","LoadingState","error","onRetry","empty","CommandItem","onSelect","renderItem","footer"],"sources":["../src/components/base/popover-menu/popover-menu.types.ts","../src/components/base/popover-menu/popover-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface PopoverMenuItem<T = unknown> {\n\t/** Unique identifier; remains distinct from visible search labels. */\n\tvalue: string;\n\t/** Visible label rendered in the row. Override entirely via `renderItem`. */\n\tlabel: ReactNode;\n\t/** Optional secondary line rendered under the label. */\n\tdescription?: ReactNode;\n\t/** Leading icon — keep small (size-icon-md/size-icon max). */\n\ticon?: ReactNode;\n\t/** Show the trailing checkmark when `true`. */\n\tselected?: boolean;\n\t/** Disable the row. */\n\tdisabled?: boolean;\n\t/** Explicit search keywords, useful when the label is structured content. */\n\tsearchValue?: string;\n\t/** Arbitrary payload for `onSelect` consumers. */\n\tdata?: T;\n}\n\nexport interface PopoverMenuStrings {\n\t/** Placeholder for the search input (when `search` is enabled). */\n\tsearchPlaceholder: string;\n\t/** Empty-state copy when filtering yields no items. */\n\tempty: string;\n\t/** Loading-state copy. */\n\tloading: string;\n\t/** Retry action copy when a resource fails. */\n\tretry?: string;\n}\n\nexport const defaultPopoverMenuStrings: PopoverMenuStrings = {\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No results.',\n\tloading: 'Loading…',\n\tretry: 'Retry',\n};\n","import { commandFilter } from '../../../lib/command-filter';\n/**\n * PopoverMenu — blocks wrapper around `base/popover` + `base/command`.\n *\n * Captures the recurring \"trigger → optional header → search → command list\"\n * pattern used by filter facets, operator selects, and similar pickers\n * across the library.\n *\n * Slots (all optional):\n * - `header` — rendered above the search input / list\n * - `footer` — rendered below the list (e.g. confirm/clear buttons)\n * - `empty` — replaces the default empty-state copy\n * - `loading` — replaces the list when `loading` is true\n *\n * Render-prop:\n * - `renderItem={(item, ctx) => ReactNode}` — full control over a row\n *\n * Strings:\n * - `strings={{ searchPlaceholder, empty, loading }}` — merged with defaults\n *\n * For headless usage (custom UI against the same selection state),\n * compose `base/popover` + `base/command` directly.\n */\nimport * as React from 'react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../command';\nimport {\n\tPopover,\n\tPopoverContent,\n PopoverHeader,\n PopoverFooter,\n\tPopoverTrigger,\n} from '../popover';\nimport { LoadingState, ErrorState } from '../feedback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { type CollectionDensity } from '../popover/popover.recipes';\nimport { CollectionContent } from '../popover/collection-content';\n\nimport {\n\tdefaultPopoverMenuStrings,\n\ttype PopoverMenuItem,\n\ttype PopoverMenuStrings,\n} from './popover-menu.types';\n\nexport interface PopoverMenuRenderItemContext {\n\t/** True when the item is the user's currently-active match (keyboard or pointer highlight). */\n\tisHighlighted: boolean;\n}\n\nexport interface PopoverMenuProps<T = unknown> {\n\t/** Vertical row rhythm. Compact and comfortable preserve primary label size and inline room. */\n\tdensity?: CollectionDensity;\n\t/** Trigger element. The popover anchors to it. Pass any clickable. */\n\ttrigger: React.ReactNode;\n\t/** Items to render in the list. */\n\titems: ReadonlyArray<PopoverMenuItem<T>>;\n\t/** Selection callback — fires on row click / Enter. */\n\tonSelect: (item: PopoverMenuItem<T>) => void;\n\n\t/** Controlled open state. Omit for uncontrolled. */\n\topen?: boolean;\n\t/** Open-state callback for controlled / uncontrolled flows. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Show the search input above the list. Default: true. */\n\tsearch?: boolean;\n\t/** Search input value (controlled). */\n\tsearchValue?: string;\n\t/** Search input change callback. */\n\tonSearchChange?: (value: string) => void;\n\n\t/** Async loading flag — replaces stale options and the empty state. */\n\tloading?: boolean;\n\t/** Resource failure replaces the list. The application owns retry and fetching. */\n\terror?: React.ReactNode;\n\tonRetry?: () => void;\n\n\t/** Optional pre-list slot (e.g. a label / eyebrow). */\n\theader?: React.ReactNode;\n\t/** Optional post-list slot (e.g. confirm / clear buttons). */\n\tfooter?: React.ReactNode;\n\t/** Override empty-state slot (defaults to `strings.empty`). */\n\tempty?: React.ReactNode;\n\t/** Override loading slot (defaults to spinner + `strings.loading`). */\n\tloadingSlot?: React.ReactNode;\n\n\t/** Per-item render override. */\n\trenderItem?: (\n\t\titem: PopoverMenuItem<T>,\n\t\tctx: PopoverMenuRenderItemContext,\n\t) => React.ReactNode;\n\n\t/** Override copy. Deep-merged over defaults. */\n\tstrings?: StringsProp<PopoverMenuStrings>;\n\n\t/** Popover content positioning props (forwarded). */\n\talign?: React.ComponentProps<typeof PopoverContent>['align'];\n\t/** Distance from the trigger, in pixels. */\n\tsideOffset?: React.ComponentProps<typeof PopoverContent>['sideOffset'];\n\n\t/** Width override for the popover content. Default: w-56. */\n\tcontentClassName?: string;\n /** Accessible name for the popup. Defaults to the localized search label. */\n contentLabel?: string;\n /** ID of a consumer-owned title used instead of contentLabel. */\n contentLabelledBy?: string;\n}\n\nexport function PopoverMenu<T = unknown>({\n\tdensity = 'default',\n\ttrigger,\n\titems,\n\tonSelect,\n\topen,\n\tonOpenChange,\n\tsearch = true,\n\tsearchValue,\n\tonSearchChange,\n\tloading = false,\n\terror,\n\tonRetry,\n\theader,\n\tfooter,\n\tempty,\n\tloadingSlot,\n\trenderItem,\n\tstrings: stringsProp,\n\talign = 'start',\n\tsideOffset,\n\tcontentClassName,\n contentLabel,\n contentLabelledBy,\n}: PopoverMenuProps<T>) {\n\tconst strings = useStrings(defaultPopoverMenuStrings, stringsProp);\n\tconst searchRef = React.useRef<HTMLInputElement>(null);\n\tconst triggerRef = React.useRef<HTMLButtonElement>(null);\n\tconst keyboardDismissal = React.useRef(false);\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n const searchOverrides = React.useMemo(() => new Map(\n items.filter(item => item.searchValue !== undefined).map(item => [item.value, item.searchValue!]),\n ), [items]);\n const filter = React.useCallback((value: string, search: string, keywords?: string[]) => (\n searchOverrides.has(value)\n ? commandFilter(searchOverrides.get(value)!, search)\n : commandFilter(value, search, keywords)\n ), [searchOverrides]);\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={(next, details) => {\n keyboardDismissal.current = !next && details.reason === 'escape-key';\n onOpenChange?.(next);\n }} onOpenChangeComplete={next => {\n // Rapid reopen during a focus-out exit can retain Base UI's no-return flag.\n // Restore only an accepted, completed Escape dismissal; outside focus stays owned.\n if (!next && keyboardDismissal.current) {\n keyboardDismissal.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n }\n }}>\n\t\t\t<PopoverTrigger ref={triggerRef} render={trigger as React.ReactElement} />\n\t\t\t<PopoverContent\n\t\t\t\tref={contentRef}\n\t\t\t\taria-label={contentLabelledBy ? undefined : contentLabel ?? strings.searchPlaceholder}\n aria-labelledby={contentLabelledBy}\n align={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\ttype=\"menu\"\n\t\t\t\tinset=\"flush\"\n\t\t\t\tclassName={cn('popover-menu--component', 'w-56 gap-0 overflow-hidden', contentClassName)}\n\t\t\t>\n\t\t\t\t<Command\n\t\t\t\t\tshouldFilter={!onSearchChange}\n filter={filter}\n\t\t\t\t\tinset=\"flush\"\n\t\t\t\t\tclassName=\"popover-menu--collection\"\n\t\t\t\t>\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<PopoverHeader className=\"popover-menu--header\">\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{!!search && (\n\t\t\t\t\t\t<CommandInput\n\t\t\t\t\t\t\tref={searchRef}\n\t\t\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\t\tonValueChange={onSearchChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<CommandList aria-busy={loading || undefined}>\n\t\t\t\t\t\t{loading ? (loadingSlot !== undefined ? <div role=\"status\" aria-live=\"polite\">{loadingSlot}</div> : <LoadingState label={strings.loading} />) : error ? <ErrorState variant=\"inline\" description={error} onRetry={onRetry ? () => {\n // Retry feedback is replaced by loading. Keep focus on persistent anatomy\n // before its button is removed, including in search-free pickers.\n (searchRef.current ?? contentRef.current)?.focus();\n onRetry();\n } : undefined} retryLabel={strings.retry ?? 'Retry'} /> : <>\n\n\t\t\t\t\t\t<CommandEmpty>{empty ?? strings.empty}</CommandEmpty>\n\n\t\t\t\t\t\t{items.length > 0 && (\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\t\tvalue={item.value}\n keywords={item.searchValue !== undefined ? [item.searchValue] : [item.label, item.description].filter((value): value is string => typeof value === 'string')}\n\t\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(item)}\n\t\t\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t\t\t\tdata-checked={item.selected || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName=\"data-[checked=true]:**:[svg]:text-primary-accent\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{({ isHighlighted }) => renderItem\n\t\t\t\t\t\t\t\t\t\t\t? renderItem(item, { isHighlighted })\n\t\t\t\t\t\t\t\t\t\t\t: (\n\t\t\t\t\t\t\t\t\t\t\t\t<CollectionContent label={item.label} description={item.description} leading={item.icon} leadingClassName=\"[&_svg]:size-icon\"/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>}\n\t\t\t\t\t</CommandList>\n\n\t\t\t\t\t{/* The public surface anatomy owns header and footer bands. */}\n\t\t\t\t\t{!!footer && (\n\t\t\t\t\t\t<PopoverFooter className=\"popover-menu--footer justify-start\">\n\t\t\t\t\t\t\t{footer}\n\t\t\t\t\t\t</PopoverFooter>\n\t\t\t\t\t)}\n\t\t\t\t</Command>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\nPopoverMenu.displayName = 'PopoverMenu';\n"],"mappings":";;;;;;;;;;AAgCA,IAAaiB,IAAgD;CAC5D,mBAAmB;CACnB,OAAO;CACP,SAAS;CACT,OAAO;AACR;;;AC+EA,SAAgBC,EAAyB,EACxC,aAAU,WACV,YACA,UACA,aACA,SACA,iBACA,YAAS,IACT,gBACA,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,CAAA;MAEpH,GAdPA,EAAK,KAcE,CACb,EACY,CAAA,CAEb,EAAA,CAAA;KACU,CAAA;KAGZ,CAAC,CAACyB,KACF,kBAACxC,GAAD;MAAe,WAAU;MACvB,UAAAwC;KACa,CAAA;IAER;;EACM,CAAA,CACR;;AAEX;AAEA,EAAY,cAAc"}
@@ -0,0 +1,168 @@
1
+ "use client";
2
+ import { _ as e, c as t, s as n } from "./ui-provider-CftIB6TY.js";
3
+ import { useStrings as r } from "./lib/strings.js";
4
+ import { t as i } from "./utils-C2EKeIw3.js";
5
+ import { a } from "./typography-Cv8MT-82.js";
6
+ import { t as o } from "./structure-MvKVq-oL.js";
7
+ import { n as s } from "./track-recipes-LLPNVwFg.js";
8
+ import { createContext as c, forwardRef as l, useContext as u, useId as d, useMemo as f } from "react";
9
+ import { Fragment as ee, jsx as p, jsxs as m } from "react/jsx-runtime";
10
+ import { Progress as h } from "@base-ui/react/progress";
11
+ //#region src/components/base/feedback/progress.strings.ts
12
+ var g = { indeterminateValue: "In progress" }, _ = c(null);
13
+ function v(e) {
14
+ return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
15
+ }
16
+ var y = {
17
+ neutral: "bg-muted-foreground",
18
+ primary: "bg-primary",
19
+ secondary: "bg-secondary-foreground",
20
+ success: "bg-success",
21
+ info: "bg-info",
22
+ warning: "bg-warning",
23
+ destructive: "bg-destructive"
24
+ };
25
+ function b(e, t) {
26
+ return typeof t == "function" ? (n) => i(e, t(n)) : i(e, t);
27
+ }
28
+ function te(e, t) {
29
+ let n = Number.isFinite(e) ? e : 0, r = Number.isFinite(t) ? t : 100;
30
+ return {
31
+ min: n,
32
+ max: r > n ? r : n + 100
33
+ };
34
+ }
35
+ function x(e, t, n) {
36
+ return e === null || !Number.isFinite(e) ? null : Math.min(n, Math.max(t, e));
37
+ }
38
+ function S(e, t, n, r, i) {
39
+ if (e === null) return null;
40
+ if (i) return new Intl.NumberFormat(r, i).format(e);
41
+ let a = n === t ? 0 : (e - t) / (n - t);
42
+ return new Intl.NumberFormat(r, {
43
+ style: "percent",
44
+ maximumFractionDigits: 0
45
+ }).format(a);
46
+ }
47
+ var C = l(function({ value: i, min: s, max: c, format: l, locale: u, getAriaValueText: y, children: C, label: O, description: k, metadata: A, showValue: j, valueSlot: M, headerSlot: N, trackSlot: P, size: F, tone: I = "primary", trackProps: L, indicatorProps: R, strings: ne, className: z, "aria-describedby": B, ...V }, H) {
48
+ let U = r(g, ne), W = t(), { defaultScale: G } = n(), K = e(F, G), q = u ?? W.locale, J = d(), { min: Y, max: X } = te(s, c), Z = x(i, Y, X), Q = S(Z, Y, X, q, l), re = N === void 0 && C === void 0, $ = j ?? O !== void 0, ie = O !== void 0 || k !== void 0 || A !== void 0 || M !== void 0 || $, ae = [B, re && k !== void 0 ? J : void 0].filter(Boolean).join(" ") || void 0, oe = (e, t) => {
49
+ let n = S(t, Y, X, q, l);
50
+ return y ? y(n, t) : n ?? U.indeterminateValue;
51
+ }, se = f(() => ({
52
+ formattedValue: Q,
53
+ value: Z
54
+ }), [Q, Z]), ce = N ?? C ?? (ie ? /* @__PURE__ */ m(ee, { children: [/* @__PURE__ */ m("div", {
55
+ className: "progress--summary min-w-0",
56
+ children: [O !== void 0 && /* @__PURE__ */ p(E, { children: O }), k !== void 0 && (v(k) ? /* @__PURE__ */ p(a, {
57
+ id: J,
58
+ tag: "span",
59
+ size: "xs",
60
+ type: "secondary",
61
+ className: "progress--description mt-space-2xs block",
62
+ children: k
63
+ }) : /* @__PURE__ */ p("div", {
64
+ id: J,
65
+ className: "progress--description mt-space-2xs",
66
+ children: k
67
+ }))]
68
+ }), ($ || M !== void 0 || A !== void 0) && /* @__PURE__ */ m(o, {
69
+ gap: "2xs",
70
+ align: "end",
71
+ className: "progress--details text-right",
72
+ children: [M ?? ($ ? /* @__PURE__ */ p(D, {}) : null), A !== void 0 && (v(A) ? /* @__PURE__ */ p(a, {
73
+ tag: "span",
74
+ size: "xs",
75
+ type: "secondary",
76
+ className: "progress--metadata tabular-nums",
77
+ children: A
78
+ }) : A)]
79
+ })] }) : null), le = P ?? /* @__PURE__ */ p(w, {
80
+ ...L,
81
+ size: L?.size ?? K,
82
+ children: L?.children ?? /* @__PURE__ */ p(T, {
83
+ ...R,
84
+ tone: R?.tone ?? I
85
+ })
86
+ });
87
+ return /* @__PURE__ */ p(_.Provider, {
88
+ value: se,
89
+ children: /* @__PURE__ */ m(h.Root, {
90
+ ref: H,
91
+ value: Z,
92
+ min: Y,
93
+ max: X,
94
+ format: l,
95
+ locale: q,
96
+ getAriaValueText: oe,
97
+ "aria-describedby": ae,
98
+ "data-slot": "progress",
99
+ "data-size": K,
100
+ "data-tone": I,
101
+ className: b("progress--component grid min-w-0 w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-space-lg gap-y-space-sm", z),
102
+ ...V,
103
+ children: [ce, le]
104
+ })
105
+ });
106
+ });
107
+ C.displayName = "Progress";
108
+ var w = l(function({ className: t, size: r, ...a }, o) {
109
+ let { defaultScale: c } = n(), l = e(r, c);
110
+ return /* @__PURE__ */ p(h.Track, {
111
+ ref: o,
112
+ "data-slot": "progress-track",
113
+ "data-size": l,
114
+ className: b(i("progress-track--component progress--track relative col-span-full flex w-full items-center overflow-hidden rounded-full bg-muted", s[l]), t),
115
+ ...a
116
+ });
117
+ });
118
+ w.displayName = "ProgressTrack";
119
+ var T = l(function({ className: e, tone: t = "primary", ...n }, r) {
120
+ return /* @__PURE__ */ p(h.Indicator, {
121
+ ref: r,
122
+ "data-slot": "progress-indicator",
123
+ "data-tone": t,
124
+ className: b(i("progress-indicator--component progress--indicator h-full rounded-full transition-[width] duration-300 ease-out motion-reduce:transition-none", "data-[indeterminate]:w-full motion-safe:data-[indeterminate]:animate-pulse", y[t]), e),
125
+ ...n
126
+ });
127
+ });
128
+ T.displayName = "ProgressIndicator";
129
+ var E = l(function({ className: e, children: t, ...n }, r) {
130
+ return /* @__PURE__ */ p(h.Label, {
131
+ ref: r,
132
+ "data-slot": "progress-label",
133
+ className: b("progress-label--component progress--label min-w-0", e),
134
+ ...n,
135
+ children: v(t) ? /* @__PURE__ */ p(a, {
136
+ tag: "span",
137
+ weight: "medium",
138
+ lineHeight: "tight",
139
+ className: "block",
140
+ children: t
141
+ }) : t
142
+ });
143
+ });
144
+ E.displayName = "ProgressLabel";
145
+ var D = l(function({ className: e, children: t, ...n }, r) {
146
+ let i = u(_);
147
+ return /* @__PURE__ */ p(h.Value, {
148
+ ref: r,
149
+ "data-slot": "progress-value",
150
+ className: b("progress-value--component progress--value whitespace-nowrap", e),
151
+ ...n,
152
+ children: (e, n) => {
153
+ let r = i?.value ?? n, o = i?.formattedValue ?? e, s = t ? t(o, r) : o;
154
+ return s == null ? null : v(s) ? /* @__PURE__ */ p(a, {
155
+ tag: "span",
156
+ weight: "medium",
157
+ lineHeight: "tight",
158
+ className: "block tabular-nums",
159
+ children: s
160
+ }) : s;
161
+ }
162
+ });
163
+ });
164
+ D.displayName = "ProgressValue";
165
+ //#endregion
166
+ export { D as a, w as i, T as n, g as o, E as r, C as t };
167
+
168
+ //# sourceMappingURL=progress-BOe8l_FZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress-BOe8l_FZ.js","names":["Progress","_Fragment","ProgressPrimitive","resolveComponentScale","useFormattingConfig","useDensityConfig","cn","Stack","trackHeightClasses","Fragment$1","defaultProgressStrings","ProgressContext","createContext","isSimpleText","value","INDICATOR_TONE_CLASSNAMES","mergeStateClassName","className","baseClassName","state","normalizeRange","min","minProp","maxCandidate","maxProp","normalizeValue","max","formatProgressValue","format","locale","normalized","Progress$1","forwardRef","valueProp","showValueProp","sizeProp","stringsProp","ariaDescribedBy","props","strings","useStrings","formatting","size","defaultScale","resolvedLocale","descriptionId","useId","formattedValue","usesGeneratedHeader","headerSlot","children","showValue","label","hasSummary","description","metadata","valueSlot","descriptionIds","resolvedGetAriaValueText","normalizedFormattedValue","currentValue","getAriaValueText","contextValue","useMemo","resolvedHeader","ProgressLabel","Text","ProgressValue","resolvedTrack","trackSlot","ProgressTrack","trackProps","ProgressIndicator","indicatorProps","tone","Progress","context","useContext","primitiveValue","_primitiveFormattedValue","content"],"sources":["../src/components/base/feedback/progress.strings.ts","../src/components/base/feedback/progress.tsx"],"sourcesContent":["export interface ProgressStrings {\n\t/** Screen-reader value announced while progress is indeterminate. */\n\tindeterminateValue: string;\n}\n\nexport const defaultProgressStrings: ProgressStrings = {\n\tindeterminateValue: 'In progress',\n};\n","import { trackHeightClasses } from '../../../lib/track-recipes';\n/**\n * Progress — token-driven Base UI progress wrapper for completion, quota,\n * and long-running task states.\n *\n * The root keeps the Base UI accessibility contract while adding a concise\n * admin summary API (`label`, `description`, `metadata`, `showValue`),\n * semantic tones, structural sizes, stable DOM hooks, and composition slots.\n * Consumers can still assemble `ProgressLabel`, `ProgressValue`,\n * `ProgressTrack`, and `ProgressIndicator` directly.\n */\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress';\nimport { createContext, forwardRef, useContext, useId, useMemo, type ReactNode } from 'react';\n\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { useDensityConfig, useFormattingConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport type { SemanticTone } from '../../../lib/component-vocabulary';\n\nimport { defaultProgressStrings, type ProgressStrings } from './progress.strings';\n\nexport type ProgressSize = ComponentScale;\nexport type ProgressTone = SemanticTone;\n\ntype ProgressRootState = ProgressPrimitive.Root.State;\ntype ProgressTrackState = ProgressPrimitive.Track.State;\ntype ProgressIndicatorState = ProgressPrimitive.Indicator.State;\ntype ProgressLabelState = ProgressPrimitive.Label.State;\ntype ProgressValueState = ProgressPrimitive.Value.State;\n\ntype StatefulClassName<TState> = string | ((state: TState) => string | undefined) | undefined;\n\nexport interface ProgressProps extends Omit<\n\tProgressPrimitive.Root.Props,\n\t'children' | 'format' | 'getAriaValueText' | 'locale' | 'max' | 'min' | 'value'\n> {\n\t/** Current value. `null` renders an indeterminate state. */\n\tvalue: number | null;\n\t/** Minimum value used to normalize the visual percentage. @default 0 */\n\tmin?: number;\n\t/** Maximum value used to normalize the visual percentage. @default 100 */\n\tmax?: number;\n\t/** Intl options for formatting the raw value instead of the default normalized percentage. */\n\tformat?: Intl.NumberFormatOptions;\n\t/** Locale forwarded to `Intl.NumberFormat`. */\n\tlocale?: Intl.LocalesArgument;\n\t/** Human-readable text for the current value. Receives the wrapper's normalized display value. */\n\tgetAriaValueText?: (formattedValue: string | null, value: number | null) => string;\n\t/** Low-level compound content. `headerSlot` takes precedence when both are supplied. */\n\tchildren?: ReactNode;\n\t/** Accessible visual label. Supplying it also enables `showValue` by default. */\n\tlabel?: ReactNode;\n\t/** Supporting text automatically connected with `aria-describedby`. */\n\tdescription?: ReactNode;\n\t/** Optional right-aligned task metadata, such as \"18,400 of 25,000 rows\". */\n\tmetadata?: ReactNode;\n\t/** Show the formatted value beside the label. Defaults to `true` when `label` is supplied. */\n\tshowValue?: boolean;\n\t/** Replaces the formatted value while retaining the default summary layout. */\n\tvalueSlot?: ReactNode;\n\t/** Replaces the entire content above the track. */\n\theaderSlot?: ReactNode;\n\t/** Replaces the default track and indicator composition. */\n\ttrackSlot?: ReactNode;\n\t/** Track thickness. @default \"default\" */\n\tsize?: ProgressSize;\n\t/** Semantic indicator color. @default \"primary\" */\n\ttone?: ProgressTone;\n\t/** Props forwarded to the default track. Ignored when `trackSlot` is supplied. */\n\ttrackProps?: ProgressTrackProps;\n\t/** Props forwarded to the default indicator. Ignored when `trackSlot` is supplied. */\n\tindicatorProps?: ProgressIndicatorProps;\n\t/** Override the indeterminate screen-reader copy. */\n\tstrings?: StringsProp<ProgressStrings>;\n}\n\nexport interface ProgressTrackProps extends ProgressPrimitive.Track.Props {\n\t/** Track thickness. @default \"default\" */\n\tsize?: ProgressSize;\n}\n\nexport interface ProgressIndicatorProps extends ProgressPrimitive.Indicator.Props {\n\t/** Semantic fill color. @default \"primary\" */\n\ttone?: ProgressTone;\n}\n\nexport interface ProgressLabelProps extends ProgressPrimitive.Label.Props {\n\t/** Accessible label content. */\n\tchildren?: ReactNode;\n}\n\nexport interface ProgressValueProps extends Omit<ProgressPrimitive.Value.Props, 'children'> {\n\t/** Customize the formatted display while preserving the value semantics. */\n\tchildren?: (formattedValue: string | null, value: number | null) => ReactNode;\n}\n\ninterface ProgressContextValue {\n\tformattedValue: string | null;\n\tvalue: number | null;\n}\n\nconst ProgressContext = createContext<ProgressContextValue | null>(null);\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n\n\nconst INDICATOR_TONE_CLASSNAMES: Record<ProgressTone, string> = {\n\tneutral: 'bg-muted-foreground',\n\tprimary: 'bg-primary',\n\tsecondary: 'bg-secondary-foreground',\n\tsuccess: 'bg-success',\n\tinfo: 'bg-info',\n\twarning: 'bg-warning',\n\tdestructive: 'bg-destructive',\n};\n\nfunction mergeStateClassName<TState>(\n\tbaseClassName: string,\n\tclassName: StatefulClassName<TState>,\n): string | ((state: TState) => string) {\n\tif (typeof className === 'function') {\n\t\treturn (state) => cn(baseClassName, className(state));\n\t}\n\n\treturn cn(baseClassName, className);\n}\n\nfunction normalizeRange(minProp: number | undefined, maxProp: number | undefined) {\n\tconst min = Number.isFinite(minProp) ? (minProp as number) : 0;\n\tconst maxCandidate = Number.isFinite(maxProp) ? (maxProp as number) : 100;\n\tconst max = maxCandidate > min ? maxCandidate : min + 100;\n\n\treturn { min, max };\n}\n\nfunction normalizeValue(value: number | null, min: number, max: number): number | null {\n\tif (value === null || !Number.isFinite(value)) return null;\n\treturn Math.min(max, Math.max(min, value));\n}\n\nfunction formatProgressValue(\n\tvalue: number | null,\n\tmin: number,\n\tmax: number,\n\tlocale: Intl.LocalesArgument | undefined,\n\tformat: Intl.NumberFormatOptions | undefined,\n): string | null {\n\tif (value === null) return null;\n\n\tif (format) {\n\t\treturn new Intl.NumberFormat(locale, format).format(value);\n\t}\n\n\tconst normalized = max === min ? 0 : (value - min) / (max - min);\n\treturn new Intl.NumberFormat(locale, {\n\t\tstyle: 'percent',\n\t\tmaximumFractionDigits: 0,\n\t}).format(normalized);\n}\n\nconst Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n\t{\n\t\tvalue: valueProp,\n\t\tmin: minProp,\n\t\tmax: maxProp,\n\t\tformat,\n\t\tlocale,\n\t\tgetAriaValueText,\n\t\tchildren,\n\t\tlabel,\n\t\tdescription,\n\t\tmetadata,\n\t\tshowValue: showValueProp,\n\t\tvalueSlot,\n\t\theaderSlot,\n\t\ttrackSlot,\n\t\tsize: sizeProp,\n\t\ttone = 'primary',\n\t\ttrackProps,\n\t\tindicatorProps,\n\t\tstrings: stringsProp,\n\t\tclassName,\n\t\t'aria-describedby': ariaDescribedBy,\n\t\t...props\n\t},\n\tref,\n) {\n\tconst strings = useStrings(defaultProgressStrings, stringsProp);\n\tconst formatting = useFormattingConfig();\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst resolvedLocale = locale ?? formatting.locale;\n\tconst descriptionId = useId();\n\tconst { min, max } = normalizeRange(minProp, maxProp);\n\tconst value = normalizeValue(valueProp, min, max);\n\tconst formattedValue = formatProgressValue(value, min, max, resolvedLocale, format);\n\tconst usesGeneratedHeader = headerSlot === undefined && children === undefined;\n\tconst showValue = showValueProp ?? label !== undefined;\n\tconst hasSummary =\n\t\tlabel !== undefined || description !== undefined || metadata !== undefined || valueSlot !== undefined || showValue;\n\tconst descriptionIds =\n\t\t[ariaDescribedBy, usesGeneratedHeader && description !== undefined ? descriptionId : undefined]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ') || undefined;\n\tconst resolvedGetAriaValueText = (_formattedValue: string | null, currentValue: number | null) => {\n\t\tconst normalizedFormattedValue = formatProgressValue(currentValue, min, max, resolvedLocale, format);\n\t\tif (getAriaValueText) {\n\t\t\treturn getAriaValueText(normalizedFormattedValue, currentValue);\n\t\t}\n\t\treturn normalizedFormattedValue ?? strings.indeterminateValue;\n\t};\n\tconst contextValue = useMemo(() => ({ formattedValue, value }), [formattedValue, value]);\n\tconst resolvedHeader =\n\t\theaderSlot ??\n\t\tchildren ??\n\t\t(hasSummary ? (\n\t\t\t<>\n\t\t\t\t<div className=\"progress--summary min-w-0\">\n\t\t\t\t\t{label !== undefined && <ProgressLabel>{label}</ProgressLabel>}\n\t\t\t\t\t{description !== undefined &&\n\t\t\t\t\t\t(isSimpleText(description) ? (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tid={descriptionId}\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\t\tclassName=\"progress--description mt-space-2xs block\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div id={descriptionId} className=\"progress--description mt-space-2xs\">\n\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t\t{(showValue || valueSlot !== undefined || metadata !== undefined) && (\n\t\t\t\t\t<Stack gap=\"2xs\" align=\"end\" className=\"progress--details text-right\">\n\t\t\t\t\t\t{valueSlot ?? (showValue ? <ProgressValue /> : null)}\n\t\t\t\t\t\t{metadata !== undefined &&\n\t\t\t\t\t\t\t(isSimpleText(metadata) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"progress--metadata tabular-nums\">\n\t\t\t\t\t\t\t\t\t{metadata}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\tmetadata\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</>\n\t\t) : null);\n\tconst resolvedTrack = trackSlot ?? (\n\t\t<ProgressTrack {...trackProps} size={trackProps?.size ?? size}>\n\t\t\t{trackProps?.children ?? <ProgressIndicator {...indicatorProps} tone={indicatorProps?.tone ?? tone} />}\n\t\t</ProgressTrack>\n\t);\n\n\treturn (\n\t\t<ProgressContext.Provider value={contextValue}>\n\t\t\t<ProgressPrimitive.Root\n\t\t\t\tref={ref}\n\t\t\t\tvalue={value}\n\t\t\t\tmin={min}\n\t\t\t\tmax={max}\n\t\t\t\tformat={format}\n\t\t\t\tlocale={resolvedLocale}\n\t\t\t\tgetAriaValueText={resolvedGetAriaValueText}\n\t\t\t\taria-describedby={descriptionIds}\n\t\t\t\tdata-slot=\"progress\"\n\t\t\t\tdata-size={size}\n\t\t\t\tdata-tone={tone}\n\t\t\t\tclassName={mergeStateClassName<ProgressRootState>(\n\t\t\t\t\t'progress--component grid min-w-0 w-full grid-cols-[minmax(0,1fr)_auto] items-start gap-x-space-lg gap-y-space-sm',\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{resolvedHeader}\n\t\t\t\t{resolvedTrack}\n\t\t\t</ProgressPrimitive.Root>\n\t\t</ProgressContext.Provider>\n\t);\n});\nProgress.displayName = 'Progress';\n\nconst ProgressTrack = forwardRef<HTMLDivElement, ProgressTrackProps>(function ProgressTrack(\n\t{ className, size: sizeProp, ...props },\n\tref,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<ProgressPrimitive.Track\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-track\"\n\t\t\tdata-size={size}\n\t\t\tclassName={mergeStateClassName<ProgressTrackState>(\n\t\t\t\tcn(\n\t\t\t\t\t'progress-track--component progress--track relative col-span-full flex w-full items-center overflow-hidden rounded-full bg-muted',\n\t\t\t\t\ttrackHeightClasses[size],\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nProgressTrack.displayName = 'ProgressTrack';\n\nconst ProgressIndicator = forwardRef<HTMLDivElement, ProgressIndicatorProps>(function ProgressIndicator(\n\t{ className, tone = 'primary', ...props },\n\tref,\n) {\n\treturn (\n\t\t<ProgressPrimitive.Indicator\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-indicator\"\n\t\t\tdata-tone={tone}\n\t\t\tclassName={mergeStateClassName<ProgressIndicatorState>(\n\t\t\t\tcn(\n\t\t\t\t\t'progress-indicator--component progress--indicator h-full rounded-full transition-[width] duration-300 ease-out motion-reduce:transition-none',\n\t\t\t\t\t'data-[indeterminate]:w-full motion-safe:data-[indeterminate]:animate-pulse',\n\t\t\t\t\tINDICATOR_TONE_CLASSNAMES[tone],\n\t\t\t\t),\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n});\nProgressIndicator.displayName = 'ProgressIndicator';\n\nconst ProgressLabel = forwardRef<HTMLSpanElement, ProgressLabelProps>(function ProgressLabel(\n\t{ className, children, ...props },\n\tref,\n) {\n\treturn (\n\t\t<ProgressPrimitive.Label\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-label\"\n\t\t\tclassName={mergeStateClassName<ProgressLabelState>(\n\t\t\t\t'progress-label--component progress--label min-w-0',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</ProgressPrimitive.Label>\n\t);\n});\nProgressLabel.displayName = 'ProgressLabel';\n\nconst ProgressValue = forwardRef<HTMLSpanElement, ProgressValueProps>(function ProgressValue(\n\t{ className, children, ...props },\n\tref,\n) {\n\tconst context = useContext(ProgressContext);\n\n\treturn (\n\t\t<ProgressPrimitive.Value\n\t\t\tref={ref}\n\t\t\tdata-slot=\"progress-value\"\n\t\t\tclassName={mergeStateClassName<ProgressValueState>(\n\t\t\t\t'progress-value--component progress--value whitespace-nowrap',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{(_primitiveFormattedValue, primitiveValue) => {\n\t\t\t\tconst value = context?.value ?? primitiveValue;\n\t\t\t\tconst formattedValue = context?.formattedValue ?? _primitiveFormattedValue;\n\t\t\t\tconst content = children ? children(formattedValue, value) : formattedValue;\n\n\t\t\t\tif (content === null || content === undefined) return null;\n\t\t\t\treturn isSimpleText(content) ? (\n\t\t\t\t\t// The percentage is the bar's primary value, so it mirrors\n\t\t\t\t\t// ProgressLabel: provider-default size and medium weight. Pinning\n\t\t\t\t\t// it to `xs`/secondary demoted the headline number below its own\n\t\t\t\t\t// caption and left the two off a shared baseline.\n\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block tabular-nums\">\n\t\t\t\t\t\t{content}\n\t\t\t\t\t</Text>\n\t\t\t\t) : (\n\t\t\t\t\tcontent\n\t\t\t\t);\n\t\t\t}}\n\t\t</ProgressPrimitive.Value>\n\t);\n});\nProgressValue.displayName = 'ProgressValue';\n\nexport { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, defaultProgressStrings };\nexport type { ProgressStrings };\n"],"mappings":";;;;;;;;;;;AAKA,IAAaU,IAA0C,EACtD,oBAAoB,cACrB,GCiGMC,IAAkBC,EAA2C,IAAI;AAEvE,SAASC,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AAIA,IAAMC,IAA0D;CAC/D,SAAS;CACT,SAAS;CACT,WAAW;CACX,SAAS;CACT,MAAM;CACN,SAAS;CACT,aAAa;AACd;AAEA,SAASC,EACR,GACA,GACuC;CAKvC,OAJI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B,GACAzD,CACD;EACA,GAAIqB;CACJ,CAAA;AAEH,CAAC;AACD,EAAkB,cAAc;AAEhC,IAAM2B,IAAgBjC,EAAgD,SACrE,EAAE,cAAW,aAAU,GAAGM,KAC1B,GACC;CACD,OACC,kBAACpC,EAAkB,OAAnB;EACM;EACL,aAAU;EACV,WAAWc,EACV,qDACAC,CACD;EACA,GAAIqB;EAEH,UAAAzB,EAAaqC,CAAQ,IACrB,kBAACgB,GAAD;GAAM,KAAI;GAAO,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC5D;EACI,CAAA,IAENhB;CAEuB,CAAA;AAE3B,CAAC;AACD,EAAc,cAAc;AAE5B,IAAMiB,IAAgBnC,EAAgD,SACrE,EAAE,cAAW,aAAU,GAAGM,KAC1B,GACC;CACD,IAAMsC,IAAUC,EAAWlE,CAAe;CAE1C,OACC,kBAACT,EAAkB,OAAnB;EACM;EACL,aAAU;EACV,WAAWc,EACV,+DACAC,CACD;EACA,GAAIqB;EAEF,WAAA,GAA0B,MAAmB;GAC9C,IAAMxB,IAAQ8D,GAAS,SAASE,GAC1B/B,IAAiB6B,GAAS,kBAAkBG,GAC5CC,IAAU9B,IAAWA,EAASH,GAAgBjC,CAAK,IAAIiC;GAG7D,OADIiC,KAAY,OAAsC,OAC/CnE,EAAamE,CAAO,IAK1B,kBAACd,GAAD;IAAM,KAAI;IAAO,QAAO;IAAS,YAAW;IAAQ,WAAU;IAC5D,UAAAc;GACI,CAAA,IAENA;EAEF;CACwB,CAAA;AAE3B,CAAC;AACD,EAAc,cAAc"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { t as e } from "./utils-C2EKeIw3.js";
3
3
  import { a as t } from "./typography-Cv8MT-82.js";
4
- import { t as n } from "./structure-BvW4vG4H.js";
5
- import { t as r, u as i } from "./smart-card-B5FcKODh.js";
4
+ import { t as n } from "./structure-MvKVq-oL.js";
5
+ import { t as r, u as i } from "./smart-card-CYLn46e6.js";
6
6
  import { r as a, t as o } from "./number-BNT_BIzJ.js";
7
7
  import { forwardRef as s, useEffect as c, useRef as l, useState as u } from "react";
8
8
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -110,4 +110,4 @@ function h({ items: r, currency: i, locale: s, unit: c, minorUnitScale: l, forma
110
110
  //#endregion
111
111
  export { m as n, h as t };
112
112
 
113
- //# sourceMappingURL=receipt-DYWTQGEc.js.map
113
+ //# sourceMappingURL=receipt-BM8xsGFy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"receipt-DYWTQGEc.js","names":["NumberValue","cn","Text","Stack","Card","hasRenderableContent","Money","Number$1","paperClip","width","height","depth","inset","count","toothWidth","step","point","x","y","points","segment","Receipt","forwardRef","props","paper","useRef","clipPath","setClipPath","useState","toothDepth","element","update","rectangle","observer","children","header","footer","qrCode","hasFooter","className","shadow","ReceiptItems","items","item"],"sources":["../src/components/blocks/commerce/receipt/receipt.tsx","../src/components/blocks/commerce/receipt/receipt-items.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Card, hasRenderableContent } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptProps } from './types';\n\nfunction paperClip(width: number, height: number, depth: number, toothWidth: number) {\n\tif (!(width > 0 && height > 0 && depth > 0)) return undefined;\n\tconst inset = Math.min(depth, height / 4);\n\tconst count = Math.max(1, Math.min(1024, Math.round(width / toothWidth)));\n\tconst step = width / count;\n\tconst point = (x: number, y: number) => `${Number(x.toFixed(2))}px ${Number(y.toFixed(2))}px`;\n\tconst points: string[] = [point(0, inset)];\n\tfor (let segment = 0; segment < count; segment++) {\n\t\tpoints.push(point((segment + 0.5) * step, 0), point((segment + 1) * step, inset));\n\t}\n\tpoints.push(point(width, height - inset));\n\tfor (let segment = count - 1; segment >= 0; segment--) {\n\t\tpoints.push(point((segment + 0.5) * step, height), point(segment * step, height - inset));\n\t}\n\treturn `polygon(${points.join(', ')})`;\n}\n\n/** Explicit paper surface: Card owns all content insets; clipping is decorative geometry. */\nexport const Receipt = forwardRef<HTMLDivElement, ReceiptProps>(function Receipt({\n\tchildren, header, footer, qrCode, padding = 'md', toothDepth = 5, toothWidth = 8,\n\tshadow = true, className, ...props\n}, ref) {\n\tconst paper = useRef<HTMLDivElement>(null);\n\tconst [clipPath, setClipPath] = useState<string>();\n\tconst depth = Number.isFinite(toothDepth) ? Math.max(0, toothDepth) : 5;\n\tconst width = Number.isFinite(toothWidth) ? Math.max(2, toothWidth) : 8;\n\tuseEffect(() => {\n\t\tconst element = paper.current;\n\t\tif (!element) return;\n\t\tconst update = () => {\n\t\t\tconst rectangle = element.getBoundingClientRect();\n\t\t\tsetClipPath(paperClip(rectangle.width, rectangle.height, depth, width));\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') {\n\t\t\twindow.addEventListener('resize', update);\n\t\t\treturn () => window.removeEventListener('resize', update);\n\t\t}\n\t\tconst observer = new ResizeObserver(update);\n\t\tobserver.observe(element);\n\t\treturn () => observer.disconnect();\n\t}, [depth, width, children, header, footer, qrCode]);\n\tconst hasFooter = hasRenderableContent(footer) || hasRenderableContent(qrCode);\n\treturn <div {...props} ref={ref} className={cn('receipt--component relative isolate w-full min-w-0', className)}>\n\t\t{shadow && <div aria-hidden=\"true\" className=\"receipt--shadow pointer-events-none absolute inset-x-0 rounded-radius shadow-sm\" style={{ insetBlock: depth }} />}\n\t\t<Card ref={paper} surface=\"flat\" padding={padding} headerStart={header}\n\t\t\tfooterSlot={hasFooter ? <Stack gap=\"normal\" align=\"center\" className=\"receipt--footer w-full min-w-0\">{qrCode}{footer}</Stack> : undefined}\n\t\t\tclassName=\"receipt--paper relative bg-card text-card-foreground\" style={{ clipPath }}>\n\t\t\t{children}\n\t\t</Card>\n\t</div>;\n});\n","import { Stack } from '../../../base/structure';\nimport { Money } from '../../../primitives/money';\nimport { Number as NumberValue } from '../../../primitives/number';\nimport { Text } from '../../../typography/text';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptItemsProps } from './types';\n\nexport function ReceiptItems({ items, currency, locale, unit, minorUnitScale, formatMode, className, ...props }: ReceiptItemsProps) {\n\tif (items.length === 0) return null;\n\treturn <Stack {...props} gap=\"md\" className={cn('receipt-items--component min-w-0', className)}>\n\t\t{items.map(item => <Stack key={item.id} direction=\"horizontal\" gap=\"md\" justify=\"between\" align=\"start\" wrap={false} className=\"receipt-items--item min-w-0\">\n\t\t\t<Stack gap=\"dense\" className=\"receipt-items--copy min-w-0 flex-1\">\n\t\t\t\t<Text className=\"break-words [overflow-wrap:anywhere]\">{item.name} × <NumberValue value={item.quantity} locale={locale} align=\"left\" /></Text>\n\t\t\t\t{item.description != null && <Text size=\"xs\" type=\"secondary\" className=\"break-words [overflow-wrap:anywhere]\">{item.description}</Text>}\n\t\t\t</Stack>\n\t\t\t<Money amount={item.total ?? item.quantity * item.unitPrice} currency={currency} locale={locale} unit={unit} minorUnitScale={minorUnitScale} formatMode={formatMode} className=\"receipt-items--amount min-w-0 max-w-full whitespace-normal [overflow-wrap:anywhere]\" />\n\t\t</Stack>)}\n\t</Stack>;\n}\n"],"mappings":";;;;;;;;;AAMA,SAASQ,EAAU,GAAe,GAAgB,GAAe,GAAoB;CACpF,IAAI,EAAEC,IAAQ,KAAKC,IAAS,KAAKC,IAAQ,IAAI;CAC7C,IAAMC,IAAQ,KAAK,IAAID,GAAOD,IAAS,CAAC,GAClCG,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,KAAK,MAAMJ,IAAQK,CAAU,CAAC,CAAC,GAClEC,IAAON,IAAQI,GACfG,KAAS,GAAW,MAAc,GAAG,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KACpFC,IAAmB,CAACH,EAAM,GAAGJ,CAAK,CAAC;CACzC,KAAK,IAAIQ,IAAU,GAAGA,IAAUP,GAAO,KACtC,EAAO,KAAKG,GAAOI,IAAU,MAAOL,GAAM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,CAAA,CAChQ;EANwB,GAAAA,EAAK,EAM7B,CAAC;CACF,CAAA;AACR"}
1
+ {"version":3,"file":"receipt-BM8xsGFy.js","names":["NumberValue","cn","Text","Stack","Card","hasRenderableContent","Money","Number$1","paperClip","width","height","depth","inset","count","toothWidth","step","point","x","y","points","segment","Receipt","forwardRef","props","paper","useRef","clipPath","setClipPath","useState","toothDepth","element","update","rectangle","observer","children","header","footer","qrCode","hasFooter","className","shadow","ReceiptItems","items","item"],"sources":["../src/components/blocks/commerce/receipt/receipt.tsx","../src/components/blocks/commerce/receipt/receipt-items.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Card, hasRenderableContent } from '../../../base/cards';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptProps } from './types';\n\nfunction paperClip(width: number, height: number, depth: number, toothWidth: number) {\n\tif (!(width > 0 && height > 0 && depth > 0)) return undefined;\n\tconst inset = Math.min(depth, height / 4);\n\tconst count = Math.max(1, Math.min(1024, Math.round(width / toothWidth)));\n\tconst step = width / count;\n\tconst point = (x: number, y: number) => `${Number(x.toFixed(2))}px ${Number(y.toFixed(2))}px`;\n\tconst points: string[] = [point(0, inset)];\n\tfor (let segment = 0; segment < count; segment++) {\n\t\tpoints.push(point((segment + 0.5) * step, 0), point((segment + 1) * step, inset));\n\t}\n\tpoints.push(point(width, height - inset));\n\tfor (let segment = count - 1; segment >= 0; segment--) {\n\t\tpoints.push(point((segment + 0.5) * step, height), point(segment * step, height - inset));\n\t}\n\treturn `polygon(${points.join(', ')})`;\n}\n\n/** Explicit paper surface: Card owns all content insets; clipping is decorative geometry. */\nexport const Receipt = forwardRef<HTMLDivElement, ReceiptProps>(function Receipt({\n\tchildren, header, footer, qrCode, padding = 'md', toothDepth = 5, toothWidth = 8,\n\tshadow = true, className, ...props\n}, ref) {\n\tconst paper = useRef<HTMLDivElement>(null);\n\tconst [clipPath, setClipPath] = useState<string>();\n\tconst depth = Number.isFinite(toothDepth) ? Math.max(0, toothDepth) : 5;\n\tconst width = Number.isFinite(toothWidth) ? Math.max(2, toothWidth) : 8;\n\tuseEffect(() => {\n\t\tconst element = paper.current;\n\t\tif (!element) return;\n\t\tconst update = () => {\n\t\t\tconst rectangle = element.getBoundingClientRect();\n\t\t\tsetClipPath(paperClip(rectangle.width, rectangle.height, depth, width));\n\t\t};\n\t\tupdate();\n\t\tif (typeof ResizeObserver === 'undefined') {\n\t\t\twindow.addEventListener('resize', update);\n\t\t\treturn () => window.removeEventListener('resize', update);\n\t\t}\n\t\tconst observer = new ResizeObserver(update);\n\t\tobserver.observe(element);\n\t\treturn () => observer.disconnect();\n\t}, [depth, width, children, header, footer, qrCode]);\n\tconst hasFooter = hasRenderableContent(footer) || hasRenderableContent(qrCode);\n\treturn <div {...props} ref={ref} className={cn('receipt--component relative isolate w-full min-w-0', className)}>\n\t\t{shadow && <div aria-hidden=\"true\" className=\"receipt--shadow pointer-events-none absolute inset-x-0 rounded-radius shadow-sm\" style={{ insetBlock: depth }} />}\n\t\t<Card ref={paper} surface=\"flat\" padding={padding} headerStart={header}\n\t\t\tfooterSlot={hasFooter ? <Stack gap=\"normal\" align=\"center\" className=\"receipt--footer w-full min-w-0\">{qrCode}{footer}</Stack> : undefined}\n\t\t\tclassName=\"receipt--paper relative bg-card text-card-foreground\" style={{ clipPath }}>\n\t\t\t{children}\n\t\t</Card>\n\t</div>;\n});\n","import { Stack } from '../../../base/structure';\nimport { Money } from '../../../primitives/money';\nimport { Number as NumberValue } from '../../../primitives/number';\nimport { Text } from '../../../typography/text';\nimport { cn } from '../../../../lib/utils';\nimport type { ReceiptItemsProps } from './types';\n\nexport function ReceiptItems({ items, currency, locale, unit, minorUnitScale, formatMode, className, ...props }: ReceiptItemsProps) {\n\tif (items.length === 0) return null;\n\treturn <Stack {...props} gap=\"md\" className={cn('receipt-items--component min-w-0', className)}>\n\t\t{items.map(item => <Stack key={item.id} direction=\"horizontal\" gap=\"md\" justify=\"between\" align=\"start\" wrap={false} className=\"receipt-items--item min-w-0\">\n\t\t\t<Stack gap=\"dense\" className=\"receipt-items--copy min-w-0 flex-1\">\n\t\t\t\t<Text className=\"break-words [overflow-wrap:anywhere]\">{item.name} × <NumberValue value={item.quantity} locale={locale} align=\"left\" /></Text>\n\t\t\t\t{item.description != null && <Text size=\"xs\" type=\"secondary\" className=\"break-words [overflow-wrap:anywhere]\">{item.description}</Text>}\n\t\t\t</Stack>\n\t\t\t<Money amount={item.total ?? item.quantity * item.unitPrice} currency={currency} locale={locale} unit={unit} minorUnitScale={minorUnitScale} formatMode={formatMode} className=\"receipt-items--amount min-w-0 max-w-full whitespace-normal [overflow-wrap:anywhere]\" />\n\t\t</Stack>)}\n\t</Stack>;\n}\n"],"mappings":";;;;;;;;;AAMA,SAASQ,EAAU,GAAe,GAAgB,GAAe,GAAoB;CACpF,IAAI,EAAEC,IAAQ,KAAKC,IAAS,KAAKC,IAAQ,IAAI;CAC7C,IAAMC,IAAQ,KAAK,IAAID,GAAOD,IAAS,CAAC,GAClCG,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,MAAM,KAAK,MAAMJ,IAAQK,CAAU,CAAC,CAAC,GAClEC,IAAON,IAAQI,GACfG,KAAS,GAAW,MAAc,GAAG,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,OAAOC,EAAE,QAAQ,CAAC,CAAC,EAAE,KACpFC,IAAmB,CAACH,EAAM,GAAGJ,CAAK,CAAC;CACzC,KAAK,IAAIQ,IAAU,GAAGA,IAAUP,GAAO,KACtC,EAAO,KAAKG,GAAOI,IAAU,MAAOL,GAAM,CAAC,GAAGC,GAAOI,IAAU,KAAKL,GAAMH,CAAK,CAAC;CAEjF,EAAO,KAAKI,EAAMP,GAAOC,IAASE,CAAK,CAAC;CACxC,KAAK,IAAIQ,IAAUP,IAAQ,GAAGO,KAAW,GAAG,KAC3C,EAAO,KAAKJ,GAAOI,IAAU,MAAOL,GAAML,CAAM,GAAGM,EAA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D,YAAYG,IAAY,kBAACnC,GAAD;IAAO,KAAI;IAAS,OAAM;IAAS,WAAU;IAA7C,UAAA,CAA+EkC,GAAQD,CAAc;GAAI,CAAA,IAAA,KAAA;GACjI,WAAU;GAAuD,OAAO,EAAE,YAAS;GAClF;EACI,CAAA,CACF;;AACN,CAAC;;;AClDD,SAAgBK,EAAa,EAAE,UAAO,aAAU,WAAQ,SAAM,mBAAgB,eAAY,cAAW,GAAGlB,KAA4B;CAEnI,OADImB,EAAM,WAAW,IAAU,OACxB,kBAACvC,GAAD;EAAO,GAAIoB;EAAO,KAAI;EAAK,WAAWtB,EAAG,oCAAoCsC,CAAS;EAC3F,UAAAG,EAAM,KAAI,MAAQ,kBAACvC,GAAD;GAAqB,WAAU;GAAa,KAAI;GAAK,SAAQ;GAAU,OAAM;GAAQ,MAAM;GAAO,WAAU;GAA5G,UAAA,CAClB,kBAACA,GAAD;IAAO,KAAI;IAAQ,WAAU;IAA7B,UAAA,CACC,kBAACD,GAAD;KAAM,WAAU;KAAhB,UAAA;MAAwDyC,EAAK;MAAK;MAAG,kBAAC3C,GAAD;OAAa,OAAO2C,EAAK;OAAkB;OAAQ,OAAM;MAAQ,CAAA;KAAO;IAC5I,CAAA,GAAAA,EAAK,eAAe,QAAQ,kBAACzC,GAAD;KAAM,MAAK;KAAK,MAAK;KAAY,WAAU;KAAwC,UAAAyC,EAAK;IAAkB,CAAA,CACjI;GACP,CAAA,GAAA,kBAACrC,GAAD;IAAO,QAAQqC,EAAK,SAASA,EAAK,WAAWA,EAAK;IAAqB;IAAkB;IAAc;IAAsB;IAA4B;IAAY,WAAU;GAAuF,CAAA,CAChQ;EANwB,GAAAA,EAAK,EAM7B,CAAC;CACF,CAAA;AACR"}
@@ -5,7 +5,7 @@ import { a as n } from "./typography-Cv8MT-82.js";
5
5
  import { n as r } from "./content-typography-CnwgMJ37.js";
6
6
  import { g as i } from "./primitives-DKPOGVpj.js";
7
7
  import { t as a } from "./number-BNT_BIzJ.js";
8
- import { d as o } from "./text-inputs-BhOcedTo.js";
8
+ import { d as o } from "./text-inputs-Dh9XGyiS.js";
9
9
  import { n as s, t as c } from "./rich-text-editor.recipes-DxvOE0Lp.js";
10
10
  import { t as l } from "./rich-text-editor.strings-BpnIQgMl.js";
11
11
  import { forwardRef as u, useCallback as d, useEffect as f, useImperativeHandle as ee, useMemo as p, useRef as m, useState as h } from "react";
@@ -572,4 +572,4 @@ P.displayName = "RichTextEditor";
572
572
  //#endregion
573
573
  export { w as n, P as t };
574
574
 
575
- //# sourceMappingURL=rich-text-editor-BZSJchAF.js.map
575
+ //# sourceMappingURL=rich-text-editor-CoVrTiSv.js.map