themelia-react-ui 2.0.5 → 2.0.6
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.
- package/CHANGELOG.md +76 -0
- package/MIGRATION.md +119 -0
- package/README.md +13 -6
- package/dist/{accordion-B9MHG0cT.js → accordion-0tQUZ20r.js} +7 -7
- package/dist/accordion-0tQUZ20r.js.map +1 -0
- package/dist/{action-menu-Dr8K-ghE.js → action-menu-C0gjzLyE.js} +7 -7
- package/dist/{action-menu-Dr8K-ghE.js.map → action-menu-C0gjzLyE.js.map} +1 -1
- package/dist/{ai-artifact-C58tQcBy.js → ai-artifact-CGGpQryR.js} +172 -157
- package/dist/ai-artifact-CGGpQryR.js.map +1 -0
- package/dist/{app-shell-B_IuNWOo.js → app-shell-EHuuRDGy.js} +5 -5
- package/dist/{app-shell-B_IuNWOo.js.map → app-shell-EHuuRDGy.js.map} +1 -1
- package/dist/{attachment-Dg_69lPS.js → attachment-BCpA4e7i.js} +8 -8
- package/dist/{attachment-Dg_69lPS.js.map → attachment-BCpA4e7i.js.map} +1 -1
- package/dist/{auth-DTkkshS8.js → auth-B0girIk_.js} +15 -15
- package/dist/auth-B0girIk_.js.map +1 -0
- package/dist/{avatar-CeZaFmNH.js → avatar-B9Jnp-T-.js} +3 -3
- package/dist/{avatar-CeZaFmNH.js.map → avatar-B9Jnp-T-.js.map} +1 -1
- package/dist/{badge-xIiV_E7f.js → badge-wWauMgAt.js} +3 -3
- package/dist/{badge-xIiV_E7f.js.map → badge-wWauMgAt.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +3 -3
- package/dist/base/cascader.js +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +8 -8
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +195 -188
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +7 -7
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +5 -5
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-BoqWIIpV.js} +5 -5
- package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-BoqWIIpV.js.map} +1 -1
- package/dist/blocks/admin.js +17 -17
- package/dist/blocks/ai.js +227 -221
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +424 -449
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +1 -1
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +225 -220
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-J-K2kl4c.js → breadcrumbs-Bp9Ke7kd.js} +4 -4
- package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
- package/dist/{button-S2Cubiiz.js → button-ChBovTx0.js} +2 -2
- package/dist/{button-S2Cubiiz.js.map → button-ChBovTx0.js.map} +1 -1
- package/dist/{buttons-BedGfygC.js → buttons-DeW0bQeK.js} +6 -6
- package/dist/{buttons-BedGfygC.js.map → buttons-DeW0bQeK.js.map} +1 -1
- package/dist/{cards-rNX1M4Xn.js → cards-CNXnmvV5.js} +8 -8
- package/dist/{cards-rNX1M4Xn.js.map → cards-CNXnmvV5.js.map} +1 -1
- package/dist/{cascader-B1MiqkBq.js → cascader-CrAl9zD5.js} +15 -15
- package/dist/{cascader-B1MiqkBq.js.map → cascader-CrAl9zD5.js.map} +1 -1
- package/dist/{chart-Darg_0Kv.js → chart-I7ROnsl8.js} +5 -5
- package/dist/{chart-Darg_0Kv.js.map → chart-I7ROnsl8.js.map} +1 -1
- package/dist/{checkbox-fflqmODR.js → checkbox-MoyHIAPs.js} +3 -3
- package/dist/{checkbox-fflqmODR.js.map → checkbox-MoyHIAPs.js.map} +1 -1
- package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-DHGtx0QV.js} +122 -110
- package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
- package/dist/{code-block-BzmM9Eig.js → code-block-BSJyq9e-.js} +7 -7
- package/dist/{code-block-BzmM9Eig.js.map → code-block-BSJyq9e-.js.map} +1 -1
- package/dist/{collapsible-BkAI_XD4.js → collapsible-BzJ91LUG.js} +3 -3
- package/dist/{collapsible-BkAI_XD4.js.map → collapsible-BzJ91LUG.js.map} +1 -1
- package/dist/{collection-content-gDh1v6O4.js → collection-content-CSnwtOTH.js} +3 -3
- package/dist/{collection-content-gDh1v6O4.js.map → collection-content-CSnwtOTH.js.map} +1 -1
- package/dist/{combobox-BEx0vJgF.js → combobox-Bcvu5J8O.js} +11 -10
- package/dist/{combobox-BEx0vJgF.js.map → combobox-Bcvu5J8O.js.map} +1 -1
- package/dist/combobox-C2JiSQPc.js +915 -0
- package/dist/combobox-C2JiSQPc.js.map +1 -0
- package/dist/{command-CrlPIL6m.js → command-9e52NPgK.js} +6 -6
- package/dist/{command-CrlPIL6m.js.map → command-9e52NPgK.js.map} +1 -1
- package/dist/{comments-Dmpp0YIc.js → comments-BsgErEqd.js} +33 -28
- package/dist/comments-BsgErEqd.js.map +1 -0
- package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
- package/dist/components/base/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- package/dist/components/base/feedback/state-display.d.ts +5 -1
- package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
- package/dist/components/base/forms/form-field.d.ts +7 -2
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
- package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
- package/dist/components/base/navigation/language-switcher.d.ts +12 -4
- package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
- package/dist/components/base/sidebar/sidebar.d.ts +2 -0
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/image-upload.d.ts +2 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +2 -0
- package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
- package/dist/components/blocks/analytics/types.d.ts +2 -2
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
- package/dist/components/features/activities/activities.types.d.ts +18 -11
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +2 -2
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
- package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
- package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
- package/dist/components/features/combobox/types.d.ts +37 -8
- package/dist/components/features/email-composer/types.d.ts +3 -1
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
- package/dist/components/features/filters/filters.types.d.ts +3 -3
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/utils/filter-utils.d.ts +5 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +6 -0
- package/dist/components/features/media-library/media-library.types.d.ts +36 -8
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/products/products.types.d.ts +2 -2
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
- package/dist/components/features/resource/resource.d.ts +1 -1
- package/dist/components/features/resource/resource.types.d.ts +2 -0
- package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +6 -3
- package/dist/components/features/table/table.strings.d.ts +3 -0
- package/dist/components/features/table/table.types.d.ts +17 -1
- package/dist/components/layout/header/header.types.d.ts +3 -2
- package/dist/components/layout/layout.types.d.ts +5 -3
- package/dist/components/layout/navigation/side-nav.d.ts +3 -2
- package/dist/components/layout/normalize-layout-path.d.ts +1 -0
- package/dist/components/layout/settings/settings.d.ts +1 -1
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +3 -1
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.types.d.ts +2 -0
- package/dist/components/primitives/link.d.ts +3 -2
- package/dist/components/primitives/money.d.ts +1 -1
- package/dist/components/primitives/number.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/{containers-CIxwbZt5.js → containers-CSdc32h9.js} +2 -2
- package/dist/{containers-CIxwbZt5.js.map → containers-CSdc32h9.js.map} +1 -1
- package/dist/{copyable-DIznBqiT.js → copyable-3fdHfMR3.js} +4 -4
- package/dist/{copyable-DIznBqiT.js.map → copyable-3fdHfMR3.js.map} +1 -1
- package/dist/{data-display-BdgCAw8T.js → data-display-Cmj-xZYl.js} +16 -15
- package/dist/data-display-Cmj-xZYl.js.map +1 -0
- package/dist/{date-Cq8ioE4o.js → date-Br0FicVv.js} +4 -4
- package/dist/{date-Cq8ioE4o.js.map → date-Br0FicVv.js.map} +1 -1
- package/dist/date-picker-CyQlFYsP.js +1617 -0
- package/dist/date-picker-CyQlFYsP.js.map +1 -0
- package/dist/date-pickers-tj2MXmXd.js +185 -0
- package/dist/date-pickers-tj2MXmXd.js.map +1 -0
- package/dist/{display-KsZLw9Ov.js → display-CT_N2a3w.js} +7 -7
- package/dist/{display-KsZLw9Ov.js.map → display-CT_N2a3w.js.map} +1 -1
- package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-C08iIugv.js} +6 -6
- package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-C08iIugv.js.map} +1 -1
- package/dist/features/activities.js +283 -270
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +40 -27
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +126 -126
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +10 -10
- package/dist/features/email-composer.js +24 -19
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +129 -125
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +16 -20
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +18 -28
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +331 -314
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1044 -866
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +978 -964
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +159 -152
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +74 -71
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +28 -19
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +297 -256
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +57 -50
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +400 -399
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-Dzo1xtAU.js +246 -0
- package/dist/feedback-Dzo1xtAU.js.map +1 -0
- package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-D6H7tVJi.js} +2 -2
- package/dist/{field-affordance-recipes-DWcNcOjh.js.map → field-affordance-recipes-D6H7tVJi.js.map} +1 -1
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
- package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
- package/dist/{filters-DzgSJpMK.js → filters-Dl80yYtN.js} +763 -605
- package/dist/filters-Dl80yYtN.js.map +1 -0
- package/dist/form-field-CAPdwdnZ.js +74 -0
- package/dist/form-field-CAPdwdnZ.js.map +1 -0
- package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-CgcrUbLU.js} +2 -2
- package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-CgcrUbLU.js.map} +1 -1
- package/dist/{forms-C0RGnJTe.js → forms-B3W8CH7-.js} +8 -8
- package/dist/{forms-C0RGnJTe.js.map → forms-B3W8CH7-.js.map} +1 -1
- package/dist/forms-numeric-CwjQJe-O.js +991 -0
- package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
- package/dist/{header-DMMxG__r.js → header-ZIIsRKxP.js} +113 -113
- package/dist/header-ZIIsRKxP.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-DB6CJ4MR.js → hooks-BitHSh-Y.js} +3 -3
- package/dist/{hooks-DB6CJ4MR.js.map → hooks-BitHSh-Y.js.map} +1 -1
- package/dist/{icon-badge-DZF-YjQp.js → icon-badge-npxF1SLX.js} +2 -2
- package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-npxF1SLX.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{input-CvyDQlY7.js → input-7KAc7XQL.js} +6 -6
- package/dist/{input-CvyDQlY7.js.map → input-7KAc7XQL.js.map} +1 -1
- package/dist/{input-DMBwAZmr.js → input-DIREVYHs.js} +3 -3
- package/dist/{input-DMBwAZmr.js.map → input-DIREVYHs.js.map} +1 -1
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
- package/dist/{item-DjCcM18E.js → item-FfWnaYST.js} +99 -98
- package/dist/item-FfWnaYST.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +11 -11
- package/dist/layout.types-E_GAApzO.js +30 -0
- package/dist/layout.types-E_GAApzO.js.map +1 -0
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +2 -0
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/surface-recipes.d.ts +1 -1
- package/dist/lib/token-merge.generated.d.ts +6 -6
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-C-vChPmE.js → media-gallery-C81DAnKI.js} +6 -6
- package/dist/{media-gallery-C-vChPmE.js.map → media-gallery-C81DAnKI.js.map} +1 -1
- package/dist/{mentions-0_4nWuI-.js → mentions-qOnedSt4.js} +236 -167
- package/dist/mentions-qOnedSt4.js.map +1 -0
- package/dist/message-BJHnn43M.js +135 -0
- package/dist/message-BJHnn43M.js.map +1 -0
- package/dist/{metadata-list-C3MkU-Om.js → metadata-list-XkqZ_UXH.js} +11 -11
- package/dist/{metadata-list-C3MkU-Om.js.map → metadata-list-XkqZ_UXH.js.map} +1 -1
- package/dist/{navigation-DaRjthVk.js → navigation-BgtPJAhi.js} +119 -119
- package/dist/navigation-BgtPJAhi.js.map +1 -0
- package/dist/{navigation-C90-oQFq.js → navigation-Bt-v7rWP.js} +52 -46
- package/dist/navigation-Bt-v7rWP.js.map +1 -0
- package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
- package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
- package/dist/{number-CRU3kGuk.js → number-CYqBcrSj.js} +78 -86
- package/dist/number-CYqBcrSj.js.map +1 -0
- package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-BQCA2Zn2.js} +7 -7
- package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-BQCA2Zn2.js.map} +1 -1
- package/dist/{overlays-BSgCtM2v.js → overlays-CC8zI3Du.js} +264 -260
- package/dist/overlays-CC8zI3Du.js.map +1 -0
- package/dist/{page-DUUKDAjo.js → page-BoQ1VaFJ.js} +13 -13
- package/dist/{page-DUUKDAjo.js.map → page-BoQ1VaFJ.js.map} +1 -1
- package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-DIKspJfx.js} +4 -4
- package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-DIKspJfx.js.map} +1 -1
- package/dist/{pagination-CgCjElfu.js → pagination-Br8TdV9A.js} +4 -4
- package/dist/{pagination-CgCjElfu.js.map → pagination-Br8TdV9A.js.map} +1 -1
- package/dist/{popover-B85RenIl.js → popover-k8TdUcAt.js} +10 -10
- package/dist/popover-k8TdUcAt.js.map +1 -0
- package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-yn-o0kyA.js} +7 -7
- package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
- package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-DJ0AkUan.js} +2 -2
- package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-DJ0AkUan.js.map} +1 -1
- package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-DyUXqUtD.js} +2 -2
- package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-DyUXqUtD.js.map} +1 -1
- package/dist/{primitives-ByWgGUgt.js → primitives-BkkQjYl7.js} +22 -17
- package/dist/primitives-BkkQjYl7.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BJhQP9WX.js → progress-DZFXXzPs.js} +4 -4
- package/dist/{progress-BJhQP9WX.js.map → progress-DZFXXzPs.js.map} +1 -1
- package/dist/{receipt-tOc7B3hw.js → receipt-C7LhOg7Q.js} +6 -6
- package/dist/{receipt-tOc7B3hw.js.map → receipt-C7LhOg7Q.js.map} +1 -1
- package/dist/rich-text-BnTzZjIo.js +45 -0
- package/dist/rich-text-BnTzZjIo.js.map +1 -0
- package/dist/rich-text-editor-CAurDwT5.js +1273 -0
- package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
- package/dist/{rich-text-editor-toolbar-laT3tpBT.js → rich-text-editor-toolbar-DbXig7Jk.js} +36 -35
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
- package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
- package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
- package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
- package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
- package/dist/{scroll-area-B0dB2cBi.js → scroll-area-Bj6CRUif.js} +2 -2
- package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
- package/dist/{separator-Bb17I4pu.js → separator-B9ewiCGO.js} +2 -2
- package/dist/{separator-Bb17I4pu.js.map → separator-B9ewiCGO.js.map} +1 -1
- package/dist/{separator-Ct_WSWTJ.js → separator-DM6gs2vu.js} +3 -3
- package/dist/{separator-Ct_WSWTJ.js.map → separator-DM6gs2vu.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-DZPHgpx4.js +155 -0
- package/dist/settings-DZPHgpx4.js.map +1 -0
- package/dist/{sheet-BGPERY55.js → sheet-C4DHsgLk.js} +6 -6
- package/dist/{sheet-BGPERY55.js.map → sheet-C4DHsgLk.js.map} +1 -1
- package/dist/sidebar-C8BnDwTH.js +709 -0
- package/dist/sidebar-C8BnDwTH.js.map +1 -0
- package/dist/{sidebar-f9gRWXIR.js → sidebar-CmD6a-HK.js} +16 -13
- package/dist/sidebar-CmD6a-HK.js.map +1 -0
- package/dist/{skeleton-BapcJd9C.js → skeleton-DDgdhmu9.js} +5 -5
- package/dist/{skeleton-BapcJd9C.js.map → skeleton-DDgdhmu9.js.map} +1 -1
- package/dist/{smart-card-CW0hjetE.js → smart-card-B6vLxqa_.js} +8 -8
- package/dist/{smart-card-CW0hjetE.js.map → smart-card-B6vLxqa_.js.map} +1 -1
- package/dist/{structure-DuxKl954.js → structure-DZJ2wbAU.js} +2 -2
- package/dist/{structure-DuxKl954.js.map → structure-DZJ2wbAU.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
- package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
- package/dist/{table-CFOWY9pQ.js → table-CBonSdTp.js} +534 -486
- package/dist/table-CBonSdTp.js.map +1 -0
- package/dist/{table-B4TE7iOV.js → table-CXSPHH25.js} +75 -71
- package/dist/table-CXSPHH25.js.map +1 -0
- package/dist/{tabs-e7ko9S2o.js → tabs-C4Kr_hCr.js} +50 -49
- package/dist/tabs-C4Kr_hCr.js.map +1 -0
- package/dist/{text-inputs-B1culiSK.js → text-inputs-jdkS3ReG.js} +9 -9
- package/dist/{text-inputs-B1culiSK.js.map → text-inputs-jdkS3ReG.js.map} +1 -1
- package/dist/{timelines-D3Sl9ueq.js → timelines-CoPwdJP0.js} +10 -10
- package/dist/{timelines-D3Sl9ueq.js.map → timelines-CoPwdJP0.js.map} +1 -1
- package/dist/{tooltip-8wz5S_Zr.js → tooltip-31NwIpTo.js} +4 -4
- package/dist/{tooltip-8wz5S_Zr.js.map → tooltip-31NwIpTo.js.map} +1 -1
- package/dist/{tree-CzUJHnFs.js → tree-CeYVzdFE.js} +6 -6
- package/dist/{tree-CzUJHnFs.js.map → tree-CeYVzdFE.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-BQnine1k.js → typography-C7-YMW1S.js} +2 -2
- package/dist/{typography-BQnine1k.js.map → typography-C7-YMW1S.js.map} +1 -1
- package/dist/typography.js +1 -1
- package/dist/{upload-BOW6U2tI.js → upload-Hdm5gObf.js} +303 -291
- package/dist/upload-Hdm5gObf.js.map +1 -0
- package/dist/{upload-queue-qUXn1ykN.js → upload-queue-D0sYPuqo.js} +8 -8
- package/dist/{upload-queue-qUXn1ykN.js.map → upload-queue-D0sYPuqo.js.map} +1 -1
- package/dist/{usage-card-BeSLY0i0.js → usage-card-9s8hLDfn.js} +9 -9
- package/dist/{usage-card-BeSLY0i0.js.map → usage-card-9s8hLDfn.js.map} +1 -1
- package/dist/{utils-B6kKb8jB.js → utils-DhuoqFy4.js} +31 -37
- package/dist/utils-DhuoqFy4.js.map +1 -0
- package/dist/{value-inputs-skdVB2zh.js → value-inputs-D3aPgq9H.js} +15 -15
- package/dist/{value-inputs-skdVB2zh.js.map → value-inputs-D3aPgq9H.js.map} +1 -1
- package/dist/{value-typography-uAmWUAL1.js → value-typography-uSzzG9Gf.js} +32 -26
- package/dist/value-typography-uSzzG9Gf.js.map +1 -0
- package/dist/{workspace-DHeHv0qw.js → workspace-CC8Vchiu.js} +12 -12
- package/dist/{workspace-DHeHv0qw.js.map → workspace-CC8Vchiu.js.map} +1 -1
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/references/agents-md.md +19 -19
- package/docs/consumer-skill/references/analytics.md +15 -0
- package/docs/consumer-skill/references/component-contracts.json +14724 -13057
- package/docs/consumer-skill/references/composition.md +21 -4
- package/docs/consumer-skill/references/design-contract.md +1 -0
- package/docs/consumer-skill/references/installation.md +51 -8
- package/docs/consumer-skill/references/integration.md +24 -1
- package/docs/consumer-skill/references/public-api.json +172 -34
- package/docs/consumer-skill/references/review.md +51 -11
- package/docs/consumer-skill/references/rhf-workflows.md +72 -0
- package/docs/consumer-skill/references/theming.md +7 -2
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +144 -30
- package/docs/consumer-skill/scripts/setup-skills.mjs +46 -9
- package/package.json +4 -2
- package/templates/admin-shell-template.tsx +1 -2
- package/templates/customers-template.tsx +18 -16
- package/dist/accordion-B9MHG0cT.js.map +0 -1
- package/dist/ai-artifact-C58tQcBy.js.map +0 -1
- package/dist/auth-DTkkshS8.js.map +0 -1
- package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
- package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
- package/dist/combobox-BwzoXFSG.js +0 -884
- package/dist/combobox-BwzoXFSG.js.map +0 -1
- package/dist/comments-Dmpp0YIc.js.map +0 -1
- package/dist/data-display-BdgCAw8T.js.map +0 -1
- package/dist/date-picker-RlIzKom_.js +0 -1551
- package/dist/date-picker-RlIzKom_.js.map +0 -1
- package/dist/date-pickers-DY-CpXS1.js +0 -179
- package/dist/date-pickers-DY-CpXS1.js.map +0 -1
- package/dist/feedback-Dm4izqFn.js +0 -240
- package/dist/feedback-Dm4izqFn.js.map +0 -1
- package/dist/filters-DzgSJpMK.js.map +0 -1
- package/dist/form-field-BriWAXyg.js +0 -63
- package/dist/form-field-BriWAXyg.js.map +0 -1
- package/dist/forms-numeric-DIhghX1Q.js +0 -910
- package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
- package/dist/header-DMMxG__r.js.map +0 -1
- package/dist/item-DjCcM18E.js.map +0 -1
- package/dist/layout.types-Cn7aUzJp.js +0 -20
- package/dist/layout.types-Cn7aUzJp.js.map +0 -1
- package/dist/mentions-0_4nWuI-.js.map +0 -1
- package/dist/message-g8p7eVtN.js +0 -128
- package/dist/message-g8p7eVtN.js.map +0 -1
- package/dist/navigation-C90-oQFq.js.map +0 -1
- package/dist/navigation-DaRjthVk.js.map +0 -1
- package/dist/number-CRU3kGuk.js.map +0 -1
- package/dist/overlays-BSgCtM2v.js.map +0 -1
- package/dist/popover-B85RenIl.js.map +0 -1
- package/dist/primitives-ByWgGUgt.js.map +0 -1
- package/dist/rich-text-Dth5E882.js +0 -78
- package/dist/rich-text-Dth5E882.js.map +0 -1
- package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
- package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
- package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
- package/dist/safe-image-src-C6kQSMBZ.js +0 -17
- package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/settings-Bar5wiSo.js +0 -167
- package/dist/settings-Bar5wiSo.js.map +0 -1
- package/dist/sidebar-D-JYMMbY.js +0 -686
- package/dist/sidebar-D-JYMMbY.js.map +0 -1
- package/dist/sidebar-f9gRWXIR.js.map +0 -1
- package/dist/table-B4TE7iOV.js.map +0 -1
- package/dist/table-CFOWY9pQ.js.map +0 -1
- package/dist/tabs-e7ko9S2o.js.map +0 -1
- package/dist/upload-BOW6U2tI.js.map +0 -1
- package/dist/utils-B6kKb8jB.js.map +0 -1
- package/dist/value-typography-uAmWUAL1.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mentions-0_4nWuI-.js","names":["_Fragment","_Fragment","Text","DisplayLabel","TextLink","focusRecipes","Stack","surfaceDividerRecipes","popoverWidthRecipes","collectionRowClasses","popoverRecipes","collectionRecipes","interactionRecipes","sanitizeHtml","contentTypographyClassName","Badge","CommandItem","CommandInput","CommandEmpty","CommandList","CommandGroup","Command","PopoverHeader","PopoverContent","useDebouncedCallback","Fragment$1","isAbortError","error","useMentionsSearch","options","kindsKey","resources","kinds","useMemo","activeKind","setActiveKindState","useState","manualKindOverride","setManualKindOverride","query","setQueryState","suggestionsByKind","setSuggestionsByKind","isLoading","setIsLoading","setError","errorsByKind","setErrorsByKind","retryTick","setRetryTick","mentions","setMentionsState","initialMentions","requestIdRef","useRef","abortControllerRef","resourcesRef","onResourceSearchRef","onResourceSearch","onErrorRef","onError","useEffect","activeResource","searchOneKind","useCallback","config","kind","q","s","stat","runSearch","entries","searchKinds","nextQuery","signal","searchError","requestId","next","nextErrors","firstError","entry","debounceMs","controller","detach","retry","current","first","k","setActiveKind","setQuery","addMention","prev","m","mention","removeMention","id","setMentions","reset","selectSuggestion","suggestion","cfg","href","buildMentionHtml","safeLabel","tone","trigger","useMentions","search","pickerOpen","setPickerOpenState","triggerActive","setTriggerActive","triggerStateRef","lastTriggerCharRef","setPickerOpen","open","editorRef","handleCaretChange","triggerMap","trig","ctx","triggers","c","re","match","triggerChar","needle","consumedLength","pickSuggestion","html","TONE_TO_VARIANT","MentionChip","resource","variant","Icon","inner","cn","className","trailing","asLink","onClick","MENTION_RE","splitHtmlByMentions","segments","lastIndex","full","refId","before","tail","DEFAULT_PROSE_CLASS","MentionContent","resourcesProp","props","sanitized","sanitizer","mentionsById","renderRef","renderMention","body","segment","Fragment","index","prose","MentionKindToggles","active","count","counts","Button","onKindChange","defaultMentionPickerStrings","defaultMentionInlineSuggestionsStrings","MentionPicker","stringsProp","strings","useStrings","loading","Loader2","suggestions","onSelect","MentionInlineSuggestions","onManualKindChange","REF_RE","KIND_ATTR_RE","parseMentionsFromHtml","out","seen","tagText","label"],"sources":["../src/components/features/mentions/hooks/use-mentions-search.ts","../src/components/features/mentions/utils/build-mention-html.ts","../src/components/features/mentions/hooks/use-mentions.ts","../src/components/features/mentions/partials/mention-chip.tsx","../src/components/features/mentions/utils/split-html-by-mentions.ts","../src/components/features/mentions/partials/mention-content.tsx","../src/components/features/mentions/partials/mention-kind-toggles.tsx","../src/components/features/mentions/mentions.strings.ts","../src/components/features/mentions/partials/mention-picker.tsx","../src/components/features/mentions/partials/mention-inline-suggestions.tsx","../src/components/features/mentions/utils/parse-mentions-from-html.ts"],"sourcesContent":["/**\n * useMentionsSearch — pure search state for the mention picker.\n *\n * Runs **all registered kinds in parallel** for the same needle so the\n * caller can render mixed results in tabs and the picker can auto-\n * switch when the active kind has zero matches but another does. The\n * caller still controls which kind is *active* (the one whose\n * suggestions render); manual switches are remembered and not\n * overridden by subsequent caret-driven re-detections.\n *\n * Suggestion lookup order per kind:\n * 1. `resources[kind].search(needle)` — per-kind callback\n * 2. `resources[kind].suggestions` — static catalogue\n * 3. global `onResourceSearch(needle, kind)` — fallback\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { DEFAULT_DEBOUNCE_MS, useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\n\nimport type {\n\tMention,\n\tMentionResource,\n\tMentionSuggestion,\n\tMentionsResourceSearch,\n\tMentionsSearchErrorHandler,\n} from '../mentions.types';\n\nfunction isAbortError(error: unknown): boolean {\n\treturn Boolean(error && (error as { name?: string }).name === 'AbortError');\n}\n\nexport interface UseMentionsSearchOptions<TResource extends string = string> {\n\tresources?: Partial<Record<TResource, MentionResource<TResource>>>;\n\tonResourceSearch?: MentionsResourceSearch<TResource>;\n\tinitialMentions?: ReadonlyArray<Mention<TResource>>;\n\t/** Debounce window for async search. Defaults to `DEFAULT_DEBOUNCE_MS`. */\n\tdebounceMs?: number;\n\t/** Receives non-abort failures for each resource kind that could not be searched. */\n\tonError?: MentionsSearchErrorHandler<TResource>;\n}\n\nexport interface UseMentionsSearchReturn<TResource extends string = string> {\n\tkinds: ReadonlyArray<TResource>;\n\tactiveKind: TResource | null;\n\tsetActiveKind: (kind: TResource | null) => void;\n\tactiveResource: MentionResource<TResource> | null;\n\n\tquery: string;\n\tsetQuery: (q: string) => void;\n\n\t/** Suggestions for the active kind (`suggestionsByKind[activeKind]`). */\n\tsuggestions: ReadonlyArray<MentionSuggestion<TResource>>;\n\t/** Per-kind suggestion buckets — useful for cross-kind UIs. */\n\tsuggestionsByKind: Readonly<Record<string, ReadonlyArray<MentionSuggestion<TResource>>>>;\n\t/** Replaces the content with the loading state. */\n\tisLoading: boolean;\n\terror: unknown | null;\n\tisError: boolean;\n\terrorsByKind: Readonly<Partial<Record<TResource, unknown>>>;\n\tretry: () => void;\n\n\tmentions: ReadonlyArray<Mention<TResource>>;\n\taddMention: (mention: Mention<TResource>) => void;\n\tremoveMention: (id: string) => void;\n\tsetMentions: (next: ReadonlyArray<Mention<TResource>>) => void;\n\treset: () => void;\n\n\tselectSuggestion: (\n\t\tsuggestion: MentionSuggestion<TResource>,\n\t) => Mention<TResource>;\n\n\t/** True if the consumer manually picked a tab. The trigger detector\n\t * checks this and refuses to override the active kind on next caret\n\t * change while it's true. Reset on `setManualKindOverride(false)` or\n\t * `reset()`. */\n\tmanualKindOverride: boolean;\n\tsetManualKindOverride: (override: boolean) => void;\n}\n\nexport function useMentionsSearch<TResource extends string = string>(\n\toptions: UseMentionsSearchOptions<TResource> = {},\n): UseMentionsSearchReturn<TResource> {\n\tconst {\n\t\tresources,\n\t\tonResourceSearch,\n\t\tinitialMentions,\n\t\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\t\tonError,\n\t} = options;\n\n\tconst kindsKey = JSON.stringify(Object.keys(resources ?? {}));\n\tconst kinds = useMemo<ReadonlyArray<TResource>>(\n\t\t() => JSON.parse(kindsKey) as TResource[],\n\t\t[kindsKey],\n\t);\n\n\tconst [activeKind, setActiveKindState] = useState<TResource | null>(\n\t\t() => kinds[0] ?? null,\n\t);\n\tconst [manualKindOverride, setManualKindOverride] = useState(false);\n\tconst [query, setQueryState] = useState('');\n\tconst [suggestionsByKind, setSuggestionsByKind] = useState<\n\t\tRecord<string, ReadonlyArray<MentionSuggestion<TResource>>>\n\t>({});\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst [error, setError] = useState<unknown | null>(null);\n\tconst [errorsByKind, setErrorsByKind] = useState<\n\t\tPartial<Record<TResource, unknown>>\n\t>({});\n\tconst [retryTick, setRetryTick] = useState(0);\n\tconst [mentions, setMentionsState] = useState<Mention<TResource>[]>(() =>\n\t\tinitialMentions ? [...initialMentions] : [],\n\t);\n\n\tconst requestIdRef = useRef(0);\n\tconst abortControllerRef = useRef<AbortController | null>(null);\n\tconst resourcesRef = useRef(resources);\n\tconst onResourceSearchRef = useRef(onResourceSearch);\n\tconst onErrorRef = useRef(onError);\n\tresourcesRef.current = resources;\n\tonResourceSearchRef.current = onResourceSearch;\n\tonErrorRef.current = onError;\n\n\tuseEffect(() => {\n\t\tif (kinds.length === 0) {\n\t\t\tsetActiveKindState(null);\n\t\t\treturn;\n\t\t}\n\t\tif (!activeKind || !kinds.includes(activeKind)) {\n\t\t\tsetActiveKindState(kinds[0]);\n\t\t}\n\t}, [activeKind, kinds]);\n\n\tconst activeResource = useMemo(\n\t\t() => (activeKind && resources ? resources[activeKind] ?? null : null),\n\t\t[activeKind, resources],\n\t);\n\n\t/**\n\t * Search a single kind. Per-kind `search` wins, then static\n\t * `suggestions`, then the global `onResourceSearch` fallback.\n\t */\n\tconst searchOneKind = useCallback(\n\t\tasync (\n\t\t\tkind: TResource,\n\t\t\tq: string,\n\t\t\tsignal: AbortSignal,\n\t\t): Promise<ReadonlyArray<MentionSuggestion<TResource>>> => {\n\t\t\tconst config = resourcesRef.current?.[kind];\n\t\t\tif (config?.search) {\n\t\t\t\tconst result = await config.search(q, { kind, signal });\n\t\t\t\treturn result.map((s) => ({ ...s, kind }));\n\t\t\t}\n\t\t\tif (config?.suggestions) {\n\t\t\t\tconst stat = config.suggestions;\n\t\t\t\tconst filtered =\n\t\t\t\t\tq.trim().length === 0\n\t\t\t\t\t\t? stat\n\t\t\t\t\t\t: stat.filter((s) =>\n\t\t\t\t\t\t\t\ts.label.toLowerCase().includes(q.toLowerCase()),\n\t\t\t\t\t\t\t);\n\t\t\t\treturn filtered.map((s) => ({ ...s, kind }));\n\t\t\t}\n\t\t\tif (onResourceSearchRef.current) {\n\t\t\t\tconst result = await onResourceSearchRef.current(\n\t\t\t\t\tq,\n\t\t\t\t\tkind,\n\t\t\t\t\t{ kind, signal },\n\t\t\t\t);\n\t\t\t\treturn result.map((s) => ({ ...s, kind }));\n\t\t\t}\n\t\t\treturn [];\n\t\t},\n\t\t[],\n\t);\n\n\t// Debounced cross-kind search runner. Populates `suggestionsByKind`\n\t// for every registered kind in parallel.\n\tconst runSearch = useDebouncedCallback(\n\t\t(\n\t\t\tsearchKinds: ReadonlyArray<TResource>,\n\t\t\tnextQuery: string,\n\t\t\trequestId: number,\n\t\t\tsignal: AbortSignal,\n\t\t) => {\n\t\t\tvoid (async () => {\n\t\t\t\tsetIsLoading(true);\n\t\t\t\ttry {\n\t\t\t\t\tconst entries = await Promise.all(\n\t\t\t\t\t\tsearchKinds.map(async (kind) => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst list = await searchOneKind(kind, nextQuery, signal);\n\t\t\t\t\t\t\t\treturn { kind, list, error: null };\n\t\t\t\t\t\t\t} catch (searchError) {\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tkind,\n\t\t\t\t\t\t\t\t\tlist: [] as ReadonlyArray<MentionSuggestion<TResource>>,\n\t\t\t\t\t\t\t\t\terror: searchError,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\tif (requestId !== requestIdRef.current || signal.aborted) return;\n\t\t\t\t\tconst next: Record<string, ReadonlyArray<MentionSuggestion<TResource>>> = {};\n\t\t\t\t\tconst nextErrors: Partial<Record<TResource, unknown>> = {};\n\t\t\t\t\tlet firstError: unknown | null = null;\n\t\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\t\tnext[entry.kind] = entry.list;\n\t\t\t\t\t\tif (entry.error !== null && !isAbortError(entry.error)) {\n\t\t\t\t\t\t\tnextErrors[entry.kind] = entry.error;\n\t\t\t\t\t\t\tfirstError ??= entry.error;\n\t\t\t\t\t\t\tonErrorRef.current?.(entry.error, {\n\t\t\t\t\t\t\t\tquery: nextQuery,\n\t\t\t\t\t\t\t\tkind: entry.kind,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetSuggestionsByKind(next);\n\t\t\t\t\tsetErrorsByKind(nextErrors);\n\t\t\t\t\tsetError(firstError);\n\t\t\t\t} finally {\n\t\t\t\t\tif (requestId === requestIdRef.current && !signal.aborted) {\n\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t},\n\t\tdebounceMs,\n\t);\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController();\n\t\tabortControllerRef.current = controller;\n\n\t\tconst detach = () => {\n\t\t\tcontroller.abort();\n\t\t\tif (abortControllerRef.current === controller) {\n\t\t\t\tabortControllerRef.current = null;\n\t\t\t}\n\t\t};\n\n\t\tif (kinds.length === 0) {\n\t\t\tsetSuggestionsByKind({});\n\t\t\tsetIsLoading(false);\n\t\t\tsetError(null);\n\t\t\tsetErrorsByKind({});\n\t\t\treturn detach;\n\t\t}\n\n\t\tconst requestId = ++requestIdRef.current;\n\t\tsetError(null);\n\t\tsetErrorsByKind({});\n\t\trunSearch(kinds, query, requestId, controller.signal);\n\n\t\treturn () => {\n\t\t\trunSearch.cancel();\n\t\t\tdetach();\n\t\t};\n\t}, [kinds, query, retryTick, runSearch]);\n\n\tconst retry = useCallback(() => {\n\t\tsetRetryTick((current) => current + 1);\n\t}, []);\n\n\t/**\n\t * Auto-switch behaviour: when the active kind has zero results but\n\t * another kind has matches, jump to the first kind with results.\n\t * Skipped while `manualKindOverride` is true so the consumer's tab\n\t * choice sticks.\n\t */\n\tuseEffect(() => {\n\t\tif (manualKindOverride) return;\n\t\tif (!activeKind) return;\n\t\tconst activeList = suggestionsByKind[activeKind] ?? [];\n\t\tif (activeList.length > 0) return;\n\t\tconst first = kinds.find((k) => (suggestionsByKind[k]?.length ?? 0) > 0);\n\t\tif (first && first !== activeKind) {\n\t\t\tsetActiveKindState(first);\n\t\t}\n\t}, [activeKind, kinds, manualKindOverride, suggestionsByKind]);\n\n\t/**\n\t * Set the active kind. **Does not** toggle `manualKindOverride` —\n\t * the picker UI is responsible for calling\n\t * `setManualKindOverride(true)` when the user explicitly clicks a\n\t * tab so the auto-switch / auto-detect logic respects their choice.\n\t */\n\tconst setActiveKind = useCallback((kind: TResource | null) => {\n\t\tsetActiveKindState(kind);\n\t}, []);\n\n\tconst setQuery = useCallback((q: string) => {\n\t\tsetQueryState(q);\n\t}, []);\n\n\tconst addMention = useCallback((mention: Mention<TResource>) => {\n\t\tsetMentionsState((prev) => {\n\t\t\tif (prev.some((m) => m.id === mention.id)) return prev;\n\t\t\treturn [...prev, mention];\n\t\t});\n\t}, []);\n\n\tconst removeMention = useCallback((id: string) => {\n\t\tsetMentionsState((prev) => prev.filter((m) => m.id !== id));\n\t}, []);\n\n\tconst setMentions = useCallback(\n\t\t(next: ReadonlyArray<Mention<TResource>>) => {\n\t\t\tsetMentionsState([...next]);\n\t\t},\n\t\t[],\n\t);\n\n\tconst reset = useCallback(() => {\n\t\tabortControllerRef.current?.abort();\n\t\tsetMentionsState([]);\n\t\tsetQueryState('');\n\t\tsetManualKindOverride(false);\n\t\tsetSuggestionsByKind({});\n\t\tsetIsLoading(false);\n\t\tsetError(null);\n\t\tsetErrorsByKind({});\n\t\trequestIdRef.current++;\n\t}, []);\n\n\tconst selectSuggestion = useCallback(\n\t\t(suggestion: MentionSuggestion<TResource>) => {\n\t\t\tconst kind = (suggestion.kind ?? activeKind) as TResource;\n\t\t\tconst id = `${kind}:${suggestion.id}`;\n\t\t\tconst cfg = resources?.[kind];\n\t\t\tconst href = suggestion.href ?? cfg?.buildHref?.(suggestion);\n\t\t\tconst mention: Mention<TResource> = {\n\t\t\t\tid,\n\t\t\t\tkind,\n\t\t\t\tlabel: suggestion.label,\n\t\t\t\thref,\n\t\t\t\tdata: suggestion.data,\n\t\t\t};\n\t\t\taddMention(mention);\n\t\t\treturn mention;\n\t\t},\n\t\t[activeKind, addMention, resources],\n\t);\n\n\tconst suggestions = useMemo<ReadonlyArray<MentionSuggestion<TResource>>>(\n\t\t() => (activeKind ? suggestionsByKind[activeKind] ?? [] : []),\n\t\t[activeKind, suggestionsByKind],\n\t);\n\n\treturn {\n\t\tkinds,\n\t\tactiveKind,\n\t\tsetActiveKind,\n\t\tactiveResource,\n\t\tquery,\n\t\tsetQuery,\n\t\tsuggestions,\n\t\tsuggestionsByKind,\n\t\tisLoading,\n\t\terror,\n\t\tisError: error !== null,\n\t\terrorsByKind,\n\t\tretry,\n\t\tmentions,\n\t\taddMention,\n\t\tremoveMention,\n\t\tsetMentions,\n\t\treset,\n\t\tselectSuggestion,\n\t\tmanualKindOverride,\n\t\tsetManualKindOverride,\n\t};\n}\n","import type { Mention, MentionTone } from '../mentions.types';\n\n/**\n * Serialize a `Mention` into the HTML span that gets inserted into a\n * rich-text body. The structure mirrors `<MentionChip>` so the editor\n * can style it via the `.rsc-mention` / `[data-ref-tone]` rules (see\n * mention-chip.css, co-located in this feature) and the read-time\n * renderer (`<MentionContent>`) can find it again.\n *\n * <span class=\"rsc-mention\" data-ref-id=\"kind:id\" data-ref-kind=\"kind\"\n * data-ref-tone=\"info\" contenteditable=\"false\">@Maria Petrova</span> \n *\n * `data-ref-tone` is what drives the badge colour in both the editor\n * (CSS-only, since contenteditable can't host React) and the read-time\n * renderer (which respects it as a hint when the resource registry\n * isn't available).\n *\n * `contenteditable=\"false\"` tells the browser to treat the chip as an\n * atomic glyph — backspace deletes the whole span, the cursor moves\n * past it, and the inner label can't be edited character-by-character.\n */\nexport function buildMentionHtml<TKind extends string = string>(\n\tmention: Mention<TKind>,\n\toptions?: { triggerChar?: string; tone?: MentionTone },\n): string {\n\tconst safeLabel = String(mention.label ?? '')\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>');\n\tconst id = String(mention.id).replace(/\"/g, '"');\n\tconst kind = String(mention.kind).replace(/\"/g, '"');\n\tconst tone = options?.tone ? String(options.tone).replace(/\"/g, '"') : '';\n\tconst trigger =\n\t\toptions?.triggerChar ?? (mention.kind === 'user' ? '@' : '');\n\tconst toneAttr = tone ? ` data-ref-tone=\"${tone}\"` : '';\n\treturn (\n\t\t`<span class=\"rsc-mention\" data-ref-id=\"${id}\" data-ref-kind=\"${kind}\"${toneAttr} contenteditable=\"false\">` +\n\t\t`${trigger}${safeLabel}` +\n\t\t`</span> `\n\t);\n}\n","/**\n * useMentions — picker state + caret-trigger detection bound to an editor.\n *\n * Composes `useMentionsSearch` (suggestion state) with caret-watch\n * logic. The editor it binds to must implement the minimal handle\n * surface in `MentionEditorHandle` — `<RichTextEditor>` from\n * `features/rich-text-editor` already does. Other editors (Slate,\n * Lexical, ProseMirror, plain contenteditable, …) can be plugged in by\n * implementing the same four methods on their imperative handle.\n *\n * Behaviour summary:\n * - On every editor `onCaretChange`, the hook reads `getCaretContext()`\n * and looks for a registered trigger char (`@`, `#`, …) preceded by\n * start-of-line / whitespace and followed by `\\p{L}\\p{N}_-` chars.\n * - On match, the picker opens, `activeKind` is seeded from the\n * trigger char (only on a *fresh* trigger session — manual tab\n * switches survive subsequent keystrokes), and `query` syncs from\n * the typed needle.\n * - All registered kinds are searched in parallel; the active kind\n * auto-switches to the first kind with results when the current\n * active is empty (skipped if `manualKindOverride` is true).\n * - `pickSuggestion` deletes the trigger range and inserts the chip\n * atomically via `replaceBeforeCaret` — selection-extension means\n * no manual text mutation, no race between delete + insert.\n * - When opened via the manual button (no trigger detected), the\n * selection runs `insertHTML` instead — caret stays where it was.\n *\n * Returned API:\n * pickerOpen, setPickerOpen, triggerActive,\n * kinds, activeKind, setActiveKind, manualKindOverride, setManualKindOverride,\n * query, setQuery, suggestions, suggestionsByKind, isLoading,\n * mentions, addMention, removeMention, setMentions, reset,\n * handleCaretChange() — wire to the editor's `onCaretChange`\n * pickSuggestion(s) — convert suggestion → Mention + insert chip\n *\n * @example\n * const editorRef = useRef<RichTextEditorHandle>(null);\n * const mentions = useMentions<'user' | 'order'>({ editorRef });\n *\n * <RichTextEditor ref={editorRef} onCaretChange={mentions.handleCaretChange} />\n * <MentionInlineSuggestions\n * open={mentions.triggerActive && mentions.pickerOpen}\n * activeKind={mentions.activeKind}\n * setActiveKind={mentions.setActiveKind}\n * onManualKindChange={() => mentions.setManualKindOverride(true)}\n * {...mentions}\n * onSelect={mentions.pickSuggestion}\n * />\n */\nimport { useCallback, useRef, useState } from 'react';\nimport type { RefObject } from 'react';\n\nimport type {\n\tMention,\n\tMentionResource,\n\tMentionSuggestion,\n\tMentionsResourceSearch,\n} from '../mentions.types';\nimport { buildMentionHtml } from '../utils/build-mention-html';\nimport {\n\tuseMentionsSearch,\n\ttype UseMentionsSearchOptions,\n\ttype UseMentionsSearchReturn,\n} from './use-mentions-search';\n\n/**\n * Minimal editor handle the trigger detector needs. Compatible with the\n * library's `<RichTextEditor>` handle — implement these on any custom\n * editor to plug in.\n */\nexport interface MentionEditorHandle {\n\tgetCaretContext(): { textBefore: string } | null;\n\tinsertHTML(html: string): void;\n\treplaceBeforeCaret(length: number, html: string): void;\n\tfocus(): void;\n}\n\nexport interface UseMentionsOptions<TResource extends string = string>\n\textends UseMentionsSearchOptions<TResource> {\n\t/** Ref to the editor surface the trigger detector reads from. */\n\teditorRef?: RefObject<MentionEditorHandle | null>;\n}\n\nexport interface UseMentionsReturn<TResource extends string = string>\n\textends UseMentionsSearchReturn<TResource> {\n\tpickerOpen: boolean;\n\tsetPickerOpen: (open: boolean) => void;\n\t/** True while the picker is open from an inline `@`/`#` trigger. */\n\ttriggerActive: boolean;\n\t/** Wire to the editor's `onCaretChange` to enable inline triggers. */\n\thandleCaretChange: () => void;\n\t/**\n\t * Convert a suggestion into a Mention, register it, insert the chip\n\t * into the editor (replacing the trigger range when one is active),\n\t * and close the picker. Returns the Mention.\n\t */\n\tpickSuggestion: (\n\t\tsuggestion: MentionSuggestion<TResource>,\n\t) => Mention<TResource>;\n}\n\ninterface TriggerState {\n\tkind: string;\n\ttriggerChar: string;\n\tconsumedLength: number;\n}\n\nexport function useMentions<TResource extends string = string>(\n\toptions: UseMentionsOptions<TResource> = {},\n): UseMentionsReturn<TResource> {\n\tconst resources = options.resources;\n\tconst onResourceSearch: MentionsResourceSearch<TResource> | undefined =\n\t\toptions.onResourceSearch;\n\n\tconst search = useMentionsSearch<TResource>({\n\t\t...options,\n\t\tresources,\n\t\tonResourceSearch,\n\t});\n\n\tconst [pickerOpen, setPickerOpenState] = useState(false);\n\tconst [triggerActive, setTriggerActive] = useState(false);\n\tconst triggerStateRef = useRef<TriggerState | null>(null);\n\t/** Tracks the trigger char from the most recent detection — lets us\n\t * set the initial active kind on a fresh trigger without overriding\n\t * the user's manual tab switch on every subsequent keystroke. */\n\tconst lastTriggerCharRef = useRef<string | null>(null);\n\n\tconst setPickerOpen = useCallback((open: boolean) => {\n\t\tsetPickerOpenState(open);\n\t\tif (!open) {\n\t\t\ttriggerStateRef.current = null;\n\t\t\tlastTriggerCharRef.current = null;\n\t\t\tsetTriggerActive(false);\n\t\t\tsearch.setManualKindOverride(false);\n\t\t}\n\t}, [search]);\n\n\tconst editorRef = options.editorRef;\n\n\tconst handleCaretChange = useCallback(() => {\n\t\tif (!resources) return;\n\t\tconst triggerMap: Record<string, string> = {};\n\t\tfor (const [kind, cfg] of Object.entries(resources)) {\n\t\t\tconst trig = (cfg as MentionResource | undefined)?.trigger;\n\t\t\tif (typeof trig === 'string' && trig.length > 0) {\n\t\t\t\ttriggerMap[trig] = kind;\n\t\t\t}\n\t\t}\n\t\tif (Object.keys(triggerMap).length === 0) return;\n\n\t\tconst ctx = editorRef?.current?.getCaretContext();\n\t\tif (!ctx) {\n\t\t\tif (triggerStateRef.current) {\n\t\t\t\ttriggerStateRef.current = null;\n\t\t\t\tsetPickerOpen(false);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst triggers = Object.keys(triggerMap)\n\t\t\t.map((c) => c.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n\t\t\t.join('');\n\t\tconst re = new RegExp(`(?:^|\\\\s)([${triggers}])([\\\\p{L}\\\\p{N}_-]*)$`, 'u');\n\t\tconst match = ctx.textBefore.match(re);\n\t\tif (!match) {\n\t\t\tif (triggerStateRef.current) {\n\t\t\t\ttriggerStateRef.current = null;\n\t\t\t\tsetPickerOpen(false);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst triggerChar = match[1];\n\t\tconst needle = match[2] ?? '';\n\t\tconst kind = triggerMap[triggerChar];\n\t\tconst consumedLength = triggerChar.length + needle.length;\n\n\t\ttriggerStateRef.current = { kind, triggerChar, consumedLength };\n\t\tsetTriggerActive(true);\n\n\t\t// Only seed the initial active kind on a *fresh* trigger session.\n\t\t// If the user has already picked a tab in the panel,\n\t\t// `manualKindOverride` is true and we skip — their choice sticks\n\t\t// even as they keep typing or deleting characters.\n\t\tconst isNewTriggerSession = lastTriggerCharRef.current !== triggerChar;\n\t\tif (isNewTriggerSession) {\n\t\t\tif (search.activeKind !== kind) {\n\t\t\t\tsearch.setActiveKind(kind as TResource);\n\t\t\t}\n\t\t\tsearch.setManualKindOverride(false);\n\t\t\tlastTriggerCharRef.current = triggerChar;\n\t\t}\n\n\t\tif (search.query !== needle) {\n\t\t\tsearch.setQuery(needle);\n\t\t}\n\t\tsetPickerOpenState(true);\n\t}, [editorRef, resources, search, setPickerOpen]);\n\n\tconst pickSuggestion = useCallback(\n\t\t(suggestion: MentionSuggestion<TResource>) => {\n\t\t\tconst mention = search.selectSuggestion(suggestion);\n\t\t\tconst trigger = triggerStateRef.current;\n\t\t\tconst tone = (resources?.[mention.kind] as MentionResource | undefined)?.tone;\n\t\t\tconst html = buildMentionHtml(mention, {\n\t\t\t\ttriggerChar: trigger?.triggerChar,\n\t\t\t\ttone,\n\t\t\t});\n\n\t\t\tif (trigger && trigger.consumedLength > 0 && editorRef?.current) {\n\t\t\t\teditorRef.current.replaceBeforeCaret(trigger.consumedLength, html);\n\t\t\t\ttriggerStateRef.current = null;\n\t\t\t} else if (editorRef?.current) {\n\t\t\t\teditorRef.current.insertHTML(html);\n\t\t\t}\n\t\t\tsetPickerOpen(false);\n\t\t\treturn mention;\n\t\t},\n\t\t[editorRef, resources, search, setPickerOpen],\n\t);\n\n\treturn {\n\t\t...search,\n\t\tpickerOpen,\n\t\tsetPickerOpen,\n\t\ttriggerActive,\n\t\thandleCaretChange,\n\t\tpickSuggestion,\n\t};\n}\n","/**\n * MentionChip — default rendering for an inline mention/reference.\n *\n * Wraps the lib's `<Badge>` base component with the variant driven by\n * the resource registry's `tone` field. The mapping between the\n * mentions module's `MentionTone` and the badge's variant lives below\n * (`TONE_TO_VARIANT`) so consumers can rebrand by editing one table.\n *\n * Override paths:\n * - `renderMention` on `<MentionContent>` — full takeover\n * - `resources.<kind>.renderChip(mention)` — per-kind takeover\n * - `resources.<kind>.tone` — quickest \"just change the color\" override\n */\nimport type { FC, ReactNode } from 'react';\n\nimport { Badge, type BadgeTone } from '../../../base/badge';\nimport { Text, TextLink } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport type {\n\t\tMention,\n\t\tMentionResource,\n\t\tMentionTone,\n} from '../mentions.types';\n\nexport interface MentionChipProps {\n\t\t/** The mention this chip represents. */\n\t\tmention: Mention;\n\t\t/** The referenced resource. */\n\t\tresource?: MentionResource<string>;\n\t\t/** Force-disable the chip's link (useful inside the composer draft list). */\n\t\tasLink?: boolean;\n\t\tonClick?: () => void;\n\t\t/** Trailing slot — typically a remove button when shown in the composer. */\n\t\ttrailing?: ReactNode;\n\t\t/** Merged onto the outermost node. */\n\t\tclassName?: string;\n}\n\n/**\n * Single source of truth for `MentionTone → Badge variant`. Edit here\n * to rebrand all chips library-wide; override per-kind via\n * `resources.<kind>.tone`.\n */\nconst TONE_TO_VARIANT: Record<MentionTone, BadgeTone> = {\n\t\tprimary: 'secondary', // calm primary — saturated `primary` overwhelms body copy\n\t\tsuccess: 'success',\n\t\twarning: 'warning',\n\t\tdestructive: 'destructive',\n\t\tinfo: 'info',\n\t\tsecondary: 'secondary',\n};\n\nexport const MentionChip: FC<MentionChipProps> = ({\n\t\tmention,\n\t\tresource,\n\t\tasLink = true,\n\t\tonClick,\n\t\ttrailing,\n\t\tclassName,\n}) => {\n\t\tif (resource?.renderChip) {\n\t\t\t\treturn <>{resource.renderChip(mention)}</>;\n\t\t}\n\n\t\tconst tone = resource?.tone ?? 'secondary';\n\t\tconst variant = TONE_TO_VARIANT[tone] ?? TONE_TO_VARIANT.secondary;\n\t\tconst Icon = resource?.icon;\n\n\t\tconst inner = (\n\t\t\t\t<Badge\n\t\t\t\t\t\ttone={variant}\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tinline\n\t\t\t\t\t\tdata-ref-id={mention.id}\n\t\t\t\t\t\tdata-ref-kind={mention.kind}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'mention-chip--component',\n\t\t\t\t\t\t\t\t/* Inline-flow tweaks: align to the surrounding text baseline\n\t\t\t\t\t\t\t\t\t instead of the line's mid-point, which causes wobble next\n\t\t\t\t\t\t\t\t\t to text. Keep the badge as `inline-flex` (from `inline`),\n\t\t\t\t\t\t\t\t\t add a subtle vertical offset via translate so the icon\n\t\t\t\t\t\t\t\t\t sits on the cap-height. */\n\t\t\t\t\t\t\t\t'align-[-0.15em] cursor-default whitespace-nowrap',\n\t\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t\t{Icon ? <Icon className=\"size-icon-sm shrink-0\" aria-hidden /> : null}\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\t\t\tlineHeight=\"none\"\n\t\t\t\t\t\t\t\tclassName=\"max-w-[14rem] truncate text-inherit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{mention.label}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{trailing}\n\t\t\t\t</Badge>\n\t\t);\n\n\t\tif (asLink && mention.href) {\n\t\treturn (\n\t\t\t<TextLink\n\t\t\t\thref={mention.href}\n\t\t\t\tsize=\"inherit\"\n\t\t\t\tunderline={false}\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noreferrer noopener\"\n\t\t\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t\t\t\tclassName=\"inline align-baseline no-underline\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{inner}\n\t\t\t</TextLink>\n\t\t);\n\t\t}\n\n\t\tif (onClick) {\n\t\t\t\treturn (\n\t\t\t\t\t\t<span onClick={onClick} className=\"inline align-baseline\">\n\t\t\t\t\t\t\t\t{inner}\n\t\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t}\n\n\t\treturn inner;\n};\n","/**\n * Split an HTML string into a list of `html` chunks and `mention`\n * placeholders, keyed by the `data-ref-id` attribute the writer set.\n *\n * Used by `<MentionContent>` to render the body once with React chips\n * for the references and `dangerouslySetInnerHTML` for everything else.\n */\nexport type MentionHtmlSegment =\n\t| { kind: 'html'; value: string }\n\t| { kind: 'mention'; refId: string; fallback: string };\n\nconst MENTION_RE =\n\t/<(span|a)\\b([^>]*?)data-ref-id\\s*=\\s*\"([^\"]+)\"([^>]*)>([\\s\\S]*?)<\\/\\1>/gi;\n\nexport function splitHtmlByMentions(html: string): MentionHtmlSegment[] {\n\tif (!html) return [];\n\n\tconst segments: MentionHtmlSegment[] = [];\n\tlet lastIndex = 0;\n\tlet match: RegExpExecArray | null;\n\tMENTION_RE.lastIndex = 0;\n\n\twhile ((match = MENTION_RE.exec(html)) !== null) {\n\t\tconst [full, , , refId] = match;\n\t\tconst before = html.slice(lastIndex, match.index);\n\t\tif (before.length > 0) {\n\t\t\tsegments.push({ kind: 'html', value: before });\n\t\t}\n\t\tsegments.push({\n\t\t\tkind: 'mention',\n\t\t\trefId,\n\t\t\tfallback: full,\n\t\t});\n\t\tlastIndex = match.index + full.length;\n\t}\n\n\tconst tail = html.slice(lastIndex);\n\tif (tail.length > 0) {\n\t\tsegments.push({ kind: 'html', value: tail });\n\t}\n\n\treturn segments;\n}\n","/**\n * MentionContent — render an HTML body that may contain inline mention\n * spans (`<span data-ref-id=\"kind:id\">…</span>`) by swapping each ref\n * for a React `<MentionChip>` while leaving the rest of the HTML\n * untouched.\n *\n * Used by:\n * - `features/comments` — comment bodies\n * - `features/activities` — activity descriptions\n * - any other surface that renders rich-text with embedded refs\n *\n * Consumer can override per-mention rendering via `renderMention`, or\n * per-kind via the resource registry's `renderChip`.\n */\nimport { Fragment } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { contentTypographyClassName } from '../../../typography/content-typography';\n\nimport { Text } from '../../../typography';\nimport { sanitizeHtml } from '../../../../lib/sanitize-html';\nimport { cn } from '../../../../lib/utils';\n\nimport type {\n\tMention,\n\tMentionResource,\n\tMentionsConfig,\n} from '../mentions.types';\nimport { splitHtmlByMentions } from '../utils/split-html-by-mentions';\nimport { MentionChip } from './mention-chip';\n\nexport interface MentionContentProps<TResource extends string = string> {\n\t/** HTML body to render. */\n\thtml: string;\n\t/** Mentions resolved on the data — keyed by `data-ref-id`. */\n\tmentions?: ReadonlyArray<Mention<TResource>>;\n\t/** Resource registry — pass at the call site. */\n\tresources?: MentionsConfig<TResource>['resources'];\n\t/** Custom per-mention renderer — overrides resource.renderChip. */\n\trenderMention?: (mention: Mention<TResource>) => ReactNode;\n\t/** Optional sanitizer override. The package safe allowlist is the default. */\n\tsanitizer?: (html: string) => string;\n\t/** Outer wrapper class. Defaults to a tight prose surface. */\n\tclassName?: string;\n\t/**\n\t * Set to `false` to skip the default prose wrapper — useful when\n\t * embedding inside an existing typed surface (e.g. timeline rows).\n\t */\n\tprose?: boolean;\n}\n\nconst DEFAULT_PROSE_CLASS = contentTypographyClassName;\n\nexport function MentionContent<TResource extends string = string>(\n\tprops: MentionContentProps<TResource>,\n): ReactNode {\n\tconst {\n\t\thtml,\n\t\tmentions,\n\t\tresources: resourcesProp,\n\t\trenderMention,\n\t\tsanitizer,\n\t\tclassName,\n\t\tprose = true,\n\t} = props;\n\n\tconst resources = resourcesProp;\n\n\tconst sanitized = sanitizer\n\t\t? sanitizer(html ?? '')\n\t\t: sanitizeHtml(html ?? '');\n\n\tconst mentionsById = new Map<string, Mention<TResource>>();\n\tfor (const m of mentions ?? []) mentionsById.set(m.id, m);\n\n\tconst hasMentions = mentionsById.size > 0;\n\tconst segments = hasMentions\n\t\t? splitHtmlByMentions(sanitized)\n\t\t: [{ kind: 'html' as const, value: sanitized }];\n\n\tconst renderRef = (mention: Mention<TResource>): ReactNode => {\n\t\tif (renderMention) return renderMention(mention);\n\t\tconst resource = resources?.[mention.kind] as\n\t\t\t| MentionResource<string>\n\t\t\t| undefined;\n\t\treturn <MentionChip mention={mention} resource={resource} />;\n\t};\n\n\tconst body = segments.map((segment, index) => {\n\t\tif (segment.kind === 'mention') {\n\t\t\tconst mention = mentionsById.get(segment.refId);\n\t\t\tif (!mention) {\n\t\t\t\treturn (\n\t\t\t\t\t<span\n\t\t\t\t\t\tkey={`fallback-${index}`}\n\t\t\t\t\t\tdangerouslySetInnerHTML={{ __html: segment.fallback }}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Fragment key={`ref-${index}-${segment.refId}`}>\n\t\t\t\t\t{renderRef(mention)}\n\t\t\t\t</Fragment>\n\t\t\t);\n\t\t}\n\t\t// Segments have already passed through the package allowlist (or the\n\t\t// consumer's explicit sanitizer override) before mention extraction.\n\t\treturn (\n\t\t\t<span\n\t\t\t\tkey={`html-${index}`}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: segment.value }}\n\t\t\t/>\n\t\t);\n\t});\n\n\tif (!prose) {\n\t\treturn <>{body}</>;\n\t}\n\n\treturn (\n\t\t<Text tag=\"div\" className={cn('mention-content--component', DEFAULT_PROSE_CLASS, className)}>{body}</Text>\n\t);\n}\n","import { Button } from '../../../base/buttons';\nimport { Text } from '../../../typography';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\n\nimport type { MentionResource, MentionSuggestion } from '../mentions.types';\n\ninterface MentionKindTogglesProps<TResource extends string> {\n\tkinds: ReadonlyArray<TResource>;\n\tactiveKind: TResource | null;\n\tresources?: Partial<Record<TResource, MentionResource<TResource>>>;\n\t/** Per-kind results; a count follows the label when present. */\n\tcounts?: Readonly<Record<string, ReadonlyArray<MentionSuggestion<TResource>>>>;\n\tonKindChange: (kind: TResource) => void;\n}\n\n/**\n * The resource-kind filter shared by the inline suggestions and the picker:\n * compact toggles that press with the accent fill and hover with muted, like\n * every other toggle, rather than a primary command fill.\n */\nexport function MentionKindToggles<TResource extends string>({\n\tkinds,\n\tactiveKind,\n\tresources,\n\tcounts,\n\tonKindChange,\n}: MentionKindTogglesProps<TResource>) {\n\treturn (\n\t\t<div className=\"mention-kind-toggles--component flex flex-wrap gap-space-xs\">\n\t\t\t{kinds.map((kind) => {\n\t\t\t\tconst cfg = resources?.[kind];\n\t\t\t\tconst Icon = cfg?.icon;\n\t\t\t\tconst active = kind === activeKind;\n\t\t\t\tconst count = counts?.[kind as string]?.length ?? 0;\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={kind}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-pressed={active}\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tclassName={active ? interactionRecipes.togglePressed : interactionRecipes.toggleHoverButton}\n\t\t\t\t\t\tonClick={() => onKindChange(kind)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{Icon ? <Icon className=\"size-icon-sm\" /> : null}\n\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" className=\"text-inherit\">\n\t\t\t\t\t\t\t{cfg?.label ?? String(kind)}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t{count > 0 && (\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t{count}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}\n","/**\n * Default user-facing strings for the `features/mentions` partials.\n *\n * Both `<MentionPicker>` and `<MentionInlineSuggestions>` consume their\n * respective slice; `<MentionInlineSuggestions>` is a strict subset.\n * Consumers wire backend i18n at the call site:\n *\n * <MentionPicker strings={{ empty: t('mentions.empty') }} … />\n */\n\nexport interface MentionPickerStrings {\n\t/** Surface title. */\n\ttitle: string;\n\tsearchPlaceholder: string;\n\t/** Shown in place of the collection when it has no entries. */\n\tempty: string;\n\tloading: string;\n}\n\nexport const defaultMentionPickerStrings: MentionPickerStrings = {\n\ttitle: 'Insert reference',\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No matches.',\n\tloading: 'Searching…',\n};\n\nexport interface MentionInlineSuggestionsStrings {\n\t/** Surface title. */\n\ttitle: string;\n\t/** Shown in place of the collection when it has no entries. */\n\tempty: string;\n\tloading: string;\n}\n\nexport const defaultMentionInlineSuggestionsStrings: MentionInlineSuggestionsStrings = {\n\ttitle: 'Insert reference',\n\tempty: 'No matches.',\n\tloading: 'Searching…',\n};\n","/**\n * MentionPicker — popover content for the mention/reference picker.\n *\n * Pure UI: takes the state from `useMentions` (or any equivalent hook)\n * and renders kind tabs + a cmdk search list. Wrapped in `<Popover>` by\n * the consumer:\n *\n * <Popover open={mentions.pickerOpen} onOpenChange={mentions.setPickerOpen}>\n * <PopoverTrigger ... />\n * <MentionPicker ... />\n * </Popover>\n */\nimport { Loader2 } from 'lucide-react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../../../base/command';\nimport { PopoverHeader, PopoverContent } from '../../../base/popover';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\nimport { MentionKindToggles } from './mention-kind-toggles';\n\nimport {\n\tdefaultMentionPickerStrings,\n\ttype MentionPickerStrings,\n} from '../mentions.strings';\nimport type {\n\tMentionResource,\n\tMentionSuggestion,\n} from '../mentions.types';\nimport { popoverWidthRecipes } from '../../../base/popover/popover.recipes';\n\nexport type { MentionPickerStrings };\n\nexport interface MentionPickerProps<TResource extends string = string> {\n\t/** Whether the picker is showing. */\n\topen: boolean;\n\t/** Resource kind currently being browsed. */\n\tactiveKind: TResource | null;\n\t/** Switches which resource kind is browsed. */\n\tsetActiveKind: (kind: TResource | null) => void;\n\t/** Resource kinds offered as tabs. */\n\tkinds: ReadonlyArray<TResource>;\n\t/** Resource definitions supplying each kind's label and icon. */\n\tresources?: Partial<Record<TResource, MentionResource<TResource>>>;\n\t/** Current search text. */\n\tquery: string;\n\t/** Updates the search text. */\n\tsetQuery: (query: string) => void;\n\t/** Matches for the current query. */\n\tsuggestions: ReadonlyArray<MentionSuggestion<TResource>>;\n\t/** Replaces the content with the loading state. */\n\tloading: boolean;\n\t/** Fired when an entry is activated. */\n\tonSelect: (suggestion: MentionSuggestion<TResource>) => void;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<MentionPickerStrings>;\n\t/** Merged onto the outermost node. */\n\tclassName?: string;\n}\n\nexport function MentionPicker<TResource extends string = string>({\n\topen,\n\tactiveKind,\n\tsetActiveKind,\n\tkinds,\n\tresources,\n\tquery,\n\tsetQuery,\n\tsuggestions,\n\tloading,\n\tonSelect,\n\tstrings: stringsProp,\n\tclassName,\n}: MentionPickerProps<TResource>) {\n\tconst strings = useStrings(defaultMentionPickerStrings, stringsProp);\n\tif (!open) return null;\n\n\treturn (\n\t\t<PopoverContent\n\t\t\talign=\"start\"\n\t\t\tinset=\"flush\"\n type=\"menu\"\n\t\t\tclassName={cn('mention-picker--component', popoverWidthRecipes.md, 'gap-0 overflow-hidden', className)}\n\t\t>\n\t\t\t<PopoverHeader>\n\t\t\t\t<Stack gap=\"sm\">\n\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t{strings.title}\n\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t{kinds.length > 1 && (\n\t\t\t\t\t\t<MentionKindToggles kinds={kinds} activeKind={activeKind} resources={resources} onKindChange={setActiveKind} />\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t</PopoverHeader>\n\n\t\t\t<Command shouldFilter={false} inset=\"flush\" className=\"rounded-none\">\n\t\t\t\t<CommandInput\n\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\tvalue={query}\n\t\t\t\t\tonValueChange={setQuery}\n\t\t\t\t/>\n\t\t\t\t<CommandList>\n\t\t\t\t\t{loading ? (\n\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" className=\"px-row-x py-row-y text-muted-foreground\">\n\t\t\t\t\t\t\t<Loader2 className=\"size-icon-sm animate-spin\" aria-hidden />\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t{strings.loading}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t) : null}\n\t\t\t\t\t<CommandEmpty>{strings.empty}</CommandEmpty>\n\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t{suggestions.map((suggestion) => {\n\t\t\t\t\t\t\tconst kind = suggestion.kind ?? activeKind ?? '';\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\tkey={`${kind}:${suggestion.id}`}\n\t\t\t\t\t\t\t\t\tvalue={`${kind}:${suggestion.id}`}\n\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(suggestion)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Stack gap=\"dense\" className=\"flex min-w-0 flex-1 flex-col leading-tight\">\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t{suggestion.label}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t{suggestion.description ? (\n\t\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"truncate\"\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{suggestion.description}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</CommandGroup>\n\t\t\t\t</CommandList>\n\t\t\t</Command>\n\t\t</PopoverContent>\n\t);\n}\n","/**\n * MentionInlineSuggestions — non-focus-stealing suggestion list.\n *\n * Used in the *inline-trigger* flow (user typed `@` / `#` / …): the\n * editor stays focused while this panel renders below the surface and\n * updates live as the user keeps typing. No popover, no focus trap,\n * no CommandInput — the editor IS the input, we read the needle from\n * the caret context and stream results in.\n *\n * Position is \"anchored to a wrapping element\" — the consumer puts this\n * inside a `relative`-positioned wrapper around the editor and we\n * absolute-position ourselves below it.\n */\nimport { Loader2 } from 'lucide-react';\n\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { Stack } from '../../../base/structure';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\t\tdefaultMentionInlineSuggestionsStrings,\n\t\ttype MentionInlineSuggestionsStrings,\n} from '../mentions.strings';\nimport type {\n\t\tMentionResource,\n\t\tMentionSuggestion,\n} from '../mentions.types';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { surfaceDividerRecipes } from '../../../../lib/surface-recipes';\nimport { collectionRecipes, collectionRowClasses, popoverRecipes, popoverWidthRecipes } from '../../../base/popover/popover.recipes';\nimport { MentionKindToggles } from './mention-kind-toggles';\n\nexport type { MentionInlineSuggestionsStrings };\n\nexport interface MentionInlineSuggestionsProps<TResource extends string = string> {\n\t\t/** Whether the inline list is showing. */\n\t\topen: boolean;\n\t\t/** Resource kind currently being matched. */\n\t\tactiveKind: TResource | null;\n\t\t/** Switches which resource kind is matched. */\n\t\tsetActiveKind: (kind: TResource | null) => void;\n\t\t/** Resource kinds available to match. */\n\t\tkinds: ReadonlyArray<TResource>;\n\t\t/** Resource definitions supplying each kind's label and icon. */\n\t\tresources?: Partial<Record<TResource, MentionResource<TResource>>>;\n\t\t/** Per-kind suggestion buckets — used to render result counts on tabs. */\n\t\tsuggestionsByKind?: Readonly<Record<string, ReadonlyArray<MentionSuggestion<TResource>>>>;\n\t\t/** Matches for the text typed after the trigger character. */\n\t\tsuggestions: ReadonlyArray<MentionSuggestion<TResource>>;\n\t\t/** Replaces the content with the loading state. */\n\t\tloading: boolean;\n\t\t/** Live query the panel echoes in the header; the consumer owns the editor input. */\n\t\tquery?: string;\n\t\t/**\n\t\t * Notifies the consumer that the user manually picked a tab, so it\n\t\t * can flip the `manualKindOverride` flag on `useMentionsSearch`.\n\t\t */\n\t\tonManualKindChange?: () => void;\n\t\t/** Fired when an entry is activated. */\n\t\tonSelect: (suggestion: MentionSuggestion<TResource>) => void;\n\t\t/** Overrides this surface's own copy. */\n\t\tstrings?: StringsProp<MentionInlineSuggestionsStrings>;\n\t\t/** Merged onto the outermost node. */\n\t\tclassName?: string;\n}\n\nexport function MentionInlineSuggestions<TResource extends string = string>({\n\t\topen,\n\t\tactiveKind,\n\t\tsetActiveKind,\n\t\tkinds,\n\t\tresources,\n\t\tsuggestionsByKind,\n\t\tsuggestions,\n\t\tloading,\n\t\tquery,\n\t\tonManualKindChange,\n\t\tonSelect,\n\t\tstrings: stringsProp,\n\t\tclassName,\n}: MentionInlineSuggestionsProps<TResource>) {\n\t\tconst strings = useStrings(defaultMentionInlineSuggestionsStrings, stringsProp);\n\t\tif (!open) return null;\n\n\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\t\t// `mousedown.preventDefault` keeps focus in the editor when\n\t\t\t\t\t\t// the user clicks inside the panel — clicks still bubble to\n\t\t\t\t\t\t// the underlying button so selection works normally.\n\t\t\t\t\t\tonMouseDown={(e) => e.preventDefault()}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'mention-inline-suggestions--component',\n\t\t\t\t\t\t\t\t// An anchored popup: the shared popover chrome on the popup layer.\n\t\t\t\t\t\t\t\tpopoverRecipes.surface,\n\t\t\t\t\t\t\t\t// A fixed 20rem panel that never outgrows its anchor's container.\n\t\t\t\t\t\t\t\t'absolute left-0 top-full z-50 mt-space-xs max-w-full',\n\t\t\t\t\t\t\t\tpopoverWidthRecipes.lg,\n\t\t\t\t\t\t\t\t'overflow-hidden',\n\t\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t\t{/* The compact menu header band, as PopoverHeader draws it in a flush menu surface. */}\n\t\t\t\t\t\t<div className={cn('mention-inline-suggestions--header', popoverRecipes.menuRegion, surfaceDividerRecipes.anchored.header)}>\n\t\t\t\t\t\t\t\t<Stack gap=\"sm\" className={popoverRecipes.menuCopyInset}>\n\t\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"baseline\" justify=\"between\" gap=\"md\">\n\t\t\t\t\t\t\t\t\t\t\t\t<DisplayLabel>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{strings.title}\n\t\t\t\t\t\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t\t\t\t\t\t{query ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"truncate font-mono\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t“{query}”\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t\t{kinds.length > 1 && (\n\t\t\t\t\t\t\t\t\t\t\t\t<MentionKindToggles\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkinds={kinds}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tactiveKind={activeKind}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tresources={resources}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcounts={suggestionsByKind}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonKindChange={(kind) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetActiveKind(kind);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonManualKindChange?.();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={cn('mention-inline-suggestions--list max-h-72 overflow-y-auto', popoverRecipes.menu)}\n\t\t\t\t\t\t\t\t{...(suggestions.length > 0\n\t\t\t\t\t\t\t\t\t\t? { role: 'listbox', 'aria-label': strings.title }\n\t\t\t\t\t\t\t\t\t\t: {})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{loading ? (\n\t\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"sm\" className=\"px-row-x py-row-y text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Loader2 className=\"size-icon-sm animate-spin\" aria-hidden />\n\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{strings.loading}\n\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t) : null}\n\n\t\t\t\t\t\t\t\t{!loading && suggestions.length === 0 ? (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"div\" size=\"xs\" type=\"secondary\" className=\"px-row-x py-row-y\">\n\t\t\t\t\t\t\t\t\t\t\t\t{strings.empty}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t) : null}\n\n\t\t\t\t\t\t\t\t{suggestions.map((suggestion) => {\n\t\t\t\t\t\t\t\t\t\tconst kind = suggestion.kind ?? activeKind ?? '';\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t// One shared collection row: the menu row height, inset and highlight.\n\t\t\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={`${kind}:${suggestion.id}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-selected={false}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-ref-id={`${kind}:${suggestion.id}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => onSelect(suggestion)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'mention-inline-suggestions--option w-full min-w-0 text-inherit text-left',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinteractionRecipes.nativeButtonReset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcollectionRowClasses('compact'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcollectionRecipes.interactive,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinteractionRecipes.rowHover,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfocusRecipes.inset,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight=\"medium\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{suggestion.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{suggestion.description ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{suggestion.description}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t);\n}\n","/**\n * Walk an HTML string and extract `data-ref-id=\"kind:id\"` spans /\n * anchors as a list of `Mention` records. Used by the comment composer\n * to keep its `mentions` state in sync with what's actually present in\n * the editor — when the user backspaces a chip out of the body, the\n * draft's mentions list shrinks too.\n *\n * The output preserves first-occurrence order and deduplicates by id.\n * Caller can merge the resulting Mentions with previously known ones to\n * preserve `href` / `data` payloads that aren't expressible in HTML.\n */\nimport type { Mention } from '../mentions.types';\n\nconst REF_RE =\n\t/<(?:span|a)\\b[^>]*?data-ref-id\\s*=\\s*\"([^\"]+)\"[^>]*?>([\\s\\S]*?)<\\/(?:span|a)>/gi;\nconst KIND_ATTR_RE = /data-ref-kind\\s*=\\s*\"([^\"]+)\"/i;\n\nexport function parseMentionsFromHtml<TKind extends string = string>(\n\thtml: string,\n): Array<Mention<TKind>> {\n\tconst out: Mention<TKind>[] = [];\n\tif (!html) return out;\n\n\tconst seen = new Set<string>();\n\tlet match: RegExpExecArray | null;\n\tREF_RE.lastIndex = 0;\n\n\twhile ((match = REF_RE.exec(html)) !== null) {\n\t\tconst [tagText, id, inner] = match;\n\t\tif (seen.has(id)) continue;\n\t\tseen.add(id);\n\n\t\tconst kindMatch = tagText.match(KIND_ATTR_RE);\n\t\tconst kind = (kindMatch?.[1] ?? id.split(':')[0] ?? '') as TKind;\n\t\tconst label = (inner ?? '')\n\t\t\t.replace(/<[^>]*>/g, '')\n\t\t\t.replace(/ /g, ' ')\n\t\t\t.replace(/^[@#$&%!~]\\s*/, '')\n\t\t\t.trim();\n\n\t\tout.push({ id, kind, label });\n\t}\n\n\treturn out;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,SAAS0B,EAAa,GAAyB;CAC9C,OAAO,GAAQC,KAAUA,EAA4B,SAAS;AAC/D;AAkDA,SAAgBC,EACf,IAA+C,CAAC,GACX;CACrC,IAAM,EACL,cACA,qBACA,oBACA,gBAAA,KACA,eACGC,GAEEC,IAAW,KAAK,UAAU,OAAO,KAAKC,KAAa,CAAC,CAAC,CAAC,GACtDC,IAAQC,QACP,KAAK,MAAMH,CAAQ,GACzB,CAACA,CAAQ,CACV,GAEM,CAACI,GAAYC,KAAsBC,QAClCJ,EAAM,MAAM,IACnB,GACM,CAACK,GAAoBC,KAAyBF,EAAS,EAAK,GAC5D,CAACG,GAAOC,KAAiBJ,EAAS,EAAE,GACpC,CAACK,GAAmBC,KAAwBN,EAEhD,CAAC,CAAC,GACE,CAACO,GAAWC,KAAgBR,EAAS,EAAK,GAC1C,CAACT,GAAOkB,KAAYT,EAAyB,IAAI,GACjD,CAACU,GAAcC,KAAmBX,EAEtC,CAAC,CAAC,GACE,CAACY,GAAWC,KAAgBb,EAAS,CAAC,GAC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ASX;EAC7B,IAAI6D,EAAK,IAAI1F,CAAE,GAAG;EAClB,EAAK,IAAIA,CAAE;EAGX,IAAM7B,IADYwH,EAAQ,MAAMJ,CAClB,CAAA,GAAY,MAAMvF,EAAG,MAAM,GAAG,CAAC,CAAC,MAAM,IAC9C4F,KAASpD,KAAS,GAAA,CACtB,QAAQ,YAAY,EAAE,CAAC,CACvB,QAAQ,WAAW,GAAG,CAAC,CACvB,QAAQ,iBAAiB,EAAE,CAAC,CAC5B,KAAK;EAEP,EAAI,KAAK;GAAE;GAAI;GAAM;EAAM,CAAC;CAC7B;CAEA,OAAOiD;AACR"}
|
package/dist/message-g8p7eVtN.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useStrings as e } from "./lib/strings.js";
|
|
3
|
-
import { t } from "./utils-B6kKb8jB.js";
|
|
4
|
-
import { c as n } from "./typography-BQnine1k.js";
|
|
5
|
-
import { t as r } from "./structure-DuxKl954.js";
|
|
6
|
-
import { a as i } from "./surface-recipes-BKRVW8Os.js";
|
|
7
|
-
import { forwardRef as a } from "react";
|
|
8
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
-
//#region src/components/blocks/collaboration/message/message.types.ts
|
|
10
|
-
var c = {
|
|
11
|
-
typing: "Typing…",
|
|
12
|
-
loading: "Loading message…"
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/components/blocks/collaboration/message/message.recipes.ts
|
|
16
|
-
function l(e) {
|
|
17
|
-
return Array.isArray(e) ? e.some(l) : e != null && typeof e != "boolean" && e !== "";
|
|
18
|
-
}
|
|
19
|
-
var u = {
|
|
20
|
-
start: "grid-cols-[auto_minmax(0,1fr)]",
|
|
21
|
-
end: "grid-cols-[minmax(0,1fr)_auto]"
|
|
22
|
-
}, d = {
|
|
23
|
-
start: "col-start-2",
|
|
24
|
-
end: "col-start-1"
|
|
25
|
-
}, f = a(function({ className: e, ...n }, i) {
|
|
26
|
-
return /* @__PURE__ */ o(r, {
|
|
27
|
-
...n,
|
|
28
|
-
ref: i,
|
|
29
|
-
gap: "dense",
|
|
30
|
-
className: t("message--content min-w-0 max-w-full flex-1", e)
|
|
31
|
-
});
|
|
32
|
-
}), p = a(function({ className: e, ...n }, i) {
|
|
33
|
-
return /* @__PURE__ */ o(r, {
|
|
34
|
-
...n,
|
|
35
|
-
ref: i,
|
|
36
|
-
direction: "horizontal",
|
|
37
|
-
align: "baseline",
|
|
38
|
-
gap: "sm",
|
|
39
|
-
wrap: !0,
|
|
40
|
-
className: t("message--header", e)
|
|
41
|
-
});
|
|
42
|
-
}), m = a(function({ className: e, ...n }, i) {
|
|
43
|
-
return /* @__PURE__ */ o(r, {
|
|
44
|
-
...n,
|
|
45
|
-
ref: i,
|
|
46
|
-
direction: "horizontal",
|
|
47
|
-
align: "center",
|
|
48
|
-
gap: "xs",
|
|
49
|
-
wrap: !0,
|
|
50
|
-
className: t("message--actions", e)
|
|
51
|
-
});
|
|
52
|
-
}), h = a(function({ tone: e = "muted", className: r, children: a, ...s }, c) {
|
|
53
|
-
let l = typeof a == "string" || typeof a == "number" || typeof a == "bigint";
|
|
54
|
-
return /* @__PURE__ */ o("div", {
|
|
55
|
-
...s,
|
|
56
|
-
ref: c,
|
|
57
|
-
"data-tone": e,
|
|
58
|
-
className: t("message--bubble min-w-0 max-w-prose rounded-radius p-surface-xs break-words", e === "primary" ? "bg-primary text-primary-foreground" : e === "muted" ? "bg-muted text-muted-foreground" : e === "surface" ? t("bg-card text-card-foreground", i.frame.shell) : "text-inherit", r),
|
|
59
|
-
children: l ? /* @__PURE__ */ o(n, {
|
|
60
|
-
className: "text-inherit whitespace-pre-wrap",
|
|
61
|
-
lineHeight: "relaxed",
|
|
62
|
-
children: a
|
|
63
|
-
}) : a
|
|
64
|
-
});
|
|
65
|
-
}), g = a(function({ children: e, className: r, ...i }, a) {
|
|
66
|
-
return /* @__PURE__ */ o("span", {
|
|
67
|
-
...i,
|
|
68
|
-
ref: a,
|
|
69
|
-
role: "status",
|
|
70
|
-
className: t("message--status", r),
|
|
71
|
-
children: /* @__PURE__ */ o(n, {
|
|
72
|
-
tag: "span",
|
|
73
|
-
size: "xs",
|
|
74
|
-
type: "secondary",
|
|
75
|
-
children: e
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
}), _ = a(function({ align: i = "start", tone: a = "muted", avatar: _, author: v, timestamp: y, dateTime: b, actions: x, status: S, loading: C = !1, typing: w = !1, strings: T, children: E, className: D, ...O }, k) {
|
|
79
|
-
let A = e(c, T), j = l(_);
|
|
80
|
-
return /* @__PURE__ */ s(r, {
|
|
81
|
-
...O,
|
|
82
|
-
ref: k,
|
|
83
|
-
direction: "horizontal",
|
|
84
|
-
align: "start",
|
|
85
|
-
gap: "md",
|
|
86
|
-
"data-align": i,
|
|
87
|
-
"aria-busy": C || w || void 0,
|
|
88
|
-
className: t("message--component grid w-full min-w-0", j ? u[i] : "grid-cols-1", D),
|
|
89
|
-
children: [j && /* @__PURE__ */ o(r, {
|
|
90
|
-
direction: "horizontal",
|
|
91
|
-
align: "start",
|
|
92
|
-
gap: "md",
|
|
93
|
-
wrap: !1,
|
|
94
|
-
className: "message--avatar shrink-0",
|
|
95
|
-
children: _
|
|
96
|
-
}), /* @__PURE__ */ s(f, {
|
|
97
|
-
className: t("row-start-1", j && d[i], i === "end" ? "items-end" : "items-start"),
|
|
98
|
-
children: [
|
|
99
|
-
(v !== void 0 || y !== void 0) && /* @__PURE__ */ s(p, { children: [v !== void 0 && /* @__PURE__ */ o(n, {
|
|
100
|
-
type: "inherit",
|
|
101
|
-
tag: "span",
|
|
102
|
-
weight: "medium",
|
|
103
|
-
children: v
|
|
104
|
-
}), y !== void 0 && /* @__PURE__ */ o("time", {
|
|
105
|
-
dateTime: b,
|
|
106
|
-
children: /* @__PURE__ */ o(n, {
|
|
107
|
-
tag: "span",
|
|
108
|
-
size: "xs",
|
|
109
|
-
type: "secondary",
|
|
110
|
-
className: "tabular-nums",
|
|
111
|
-
children: y
|
|
112
|
-
})
|
|
113
|
-
})] }),
|
|
114
|
-
l(E) && /* @__PURE__ */ o(h, {
|
|
115
|
-
tone: a,
|
|
116
|
-
children: E
|
|
117
|
-
}),
|
|
118
|
-
(w || C || S !== void 0) && /* @__PURE__ */ o(g, { children: w ? A.typing : C ? A.loading : S }),
|
|
119
|
-
x !== void 0 && /* @__PURE__ */ o(m, { children: x })
|
|
120
|
-
]
|
|
121
|
-
})]
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
_.displayName = "Message";
|
|
125
|
-
//#endregion
|
|
126
|
-
export { p as a, u as c, f as i, d as l, m as n, g as o, h as r, l as s, _ as t, c as u };
|
|
127
|
-
|
|
128
|
-
//# sourceMappingURL=message-g8p7eVtN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-g8p7eVtN.js","names":["Text","Stack","surfaceDividerRecipes","defaultMessageStrings","hasMessageMedia","media","messageColumns","messageContentColumn","MessageContent","forwardRef","props","cn","className","MessageHeader","MessageActions","MessageBubble","scalar","children","tone","MessageStatus","Message","stringsProp","strings","useStrings","hasAvatar","avatar","align","loading","typing","author","timestamp","status","actions"],"sources":["../src/components/blocks/collaboration/message/message.types.ts","../src/components/blocks/collaboration/message/message.recipes.ts","../src/components/blocks/collaboration/message/message.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport type { StringsProp } from '../../../../lib/strings';\nexport interface MessageStrings { typing: string; loading: string }\nexport const defaultMessageStrings: MessageStrings = { typing: 'Typing…', loading: 'Loading message…' };\nexport interface MessageProps extends ComponentPropsWithoutRef<'div'> {\n /** Message direction, independent of author or service role. */\n align?: 'start' | 'end';\n /** Bubble treatment. @default muted */\n tone?: 'muted' | 'primary' | 'plain' | 'surface';\n avatar?: ReactNode;\n author?: ReactNode;\n /** Caller-formatted time; datetime supplies machine-readable time when available. */\n timestamp?: ReactNode;\n dateTime?: string;\n actions?: ReactNode;\n status?: ReactNode;\n loading?: boolean;\n typing?: boolean;\n strings?: StringsProp<MessageStrings>;\n}\nexport interface MessagePartProps extends ComponentPropsWithoutRef<'div'> {}\nexport interface MessageBubbleProps extends MessagePartProps { tone?: 'muted' | 'primary' | 'plain' | 'surface' }\nexport interface MessageStatusProps extends ComponentPropsWithoutRef<'span'> {}\n","import type { ReactNode } from 'react';\n\n/** Obvious empty slot values have no media track; rich React nodes remain untouched. */\nexport function hasMessageMedia(media: ReactNode): boolean {\n\tif (Array.isArray(media)) return media.some(hasMessageMedia);\n\treturn media !== null && media !== undefined && typeof media !== 'boolean' && media !== '';\n}\n\n/** Transcript rows and their continuation regions share the actual media track. */\nexport const messageColumns = {\n\tstart: 'grid-cols-[auto_minmax(0,1fr)]',\n\tend: 'grid-cols-[minmax(0,1fr)_auto]',\n} as const;\n\nexport const messageContentColumn = {\n\tstart: 'col-start-2',\n\tend: 'col-start-1',\n} as const;\n","import { forwardRef } from 'react';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { surfaceDividerRecipes } from '../../../../lib/surface-recipes';\nimport { cn } from '../../../../lib/utils';\nimport { useStrings } from '../../../../lib/strings';\nimport { defaultMessageStrings, type MessageProps, type MessagePartProps, type MessageBubbleProps, type MessageStatusProps } from './message.types';\nimport { hasMessageMedia, messageColumns, messageContentColumn } from './message.recipes';\nexport const MessageContent = forwardRef<HTMLDivElement, MessagePartProps>(function MessageContent({ className, ...props }, ref) { return <Stack {...props} ref={ref} gap=\"dense\" className={cn('message--content min-w-0 max-w-full flex-1', className)} />; });\nexport const MessageHeader = forwardRef<HTMLDivElement, MessagePartProps>(function MessageHeader({ className, ...props }, ref) { return <Stack {...props} ref={ref} direction=\"horizontal\" align=\"baseline\" gap=\"sm\" wrap className={cn('message--header', className)} />; });\nexport const MessageActions = forwardRef<HTMLDivElement, MessagePartProps>(function MessageActions({ className, ...props }, ref) { return <Stack {...props} ref={ref} direction=\"horizontal\" align=\"center\" gap=\"xs\" wrap className={cn('message--actions', className)} />; });\nexport const MessageBubble = forwardRef<HTMLDivElement, MessageBubbleProps>(function MessageBubble({ tone = 'muted', className, children, ...props }, ref) {\n const scalar = typeof children === 'string' || typeof children === 'number' || typeof children === 'bigint';\n return <div {...props} ref={ref} data-tone={tone} className={cn('message--bubble min-w-0 max-w-prose rounded-radius p-surface-xs break-words', tone === 'primary' ? 'bg-primary text-primary-foreground' : tone === 'muted' ? 'bg-muted text-muted-foreground' : tone === 'surface' ? cn('bg-card text-card-foreground', surfaceDividerRecipes.frame.shell) : 'text-inherit', className)}>{scalar ? <Text className=\"text-inherit whitespace-pre-wrap\" lineHeight=\"relaxed\">{children}</Text> : children}</div>;\n});\nexport const MessageStatus = forwardRef<HTMLSpanElement, MessageStatusProps>(function MessageStatus({ children, className, ...props }, ref) { return <span {...props} ref={ref} role=\"status\" className={cn('message--status', className)}><Text tag=\"span\" size=\"xs\" type=\"secondary\">{children}</Text></span>; });\n/** Callback-free transcript presentation. Consumers own rich text, requests and delivery state. */\nexport const Message = forwardRef<HTMLDivElement, MessageProps>(function Message({ align = 'start', tone = 'muted', avatar, author, timestamp, dateTime, actions, status, loading = false, typing = false, strings: stringsProp, children, className, ...props }, ref) {\n const strings = useStrings(defaultMessageStrings, stringsProp);\n const hasAvatar = hasMessageMedia(avatar);\n return <Stack {...props} ref={ref} direction=\"horizontal\" align=\"start\" gap=\"md\" data-align={align} aria-busy={loading || typing || undefined} className={cn('message--component grid w-full min-w-0', hasAvatar ? messageColumns[align] : 'grid-cols-1', className)}>\n {hasAvatar && <Stack direction=\"horizontal\" align=\"start\" gap=\"md\" wrap={false} className=\"message--avatar shrink-0\">{avatar}</Stack>}\n {/* Incoming and outgoing bubbles both hug their content, up to the bubble's reading measure. */}\n <MessageContent className={cn('row-start-1', hasAvatar && messageContentColumn[align], align === 'end' ? 'items-end' : 'items-start')}>\n {(author !== undefined || timestamp !== undefined) && <MessageHeader>\n {author !== undefined && <Text type=\"inherit\" tag=\"span\" weight=\"medium\">{author}</Text>}\n {timestamp !== undefined && <time dateTime={dateTime}><Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"tabular-nums\">{timestamp}</Text></time>}\n </MessageHeader>}\n {/* A pending message with no content yet states itself through the status line, not an empty bubble. */}\n {hasMessageMedia(children) && <MessageBubble tone={tone}>{children}</MessageBubble>}\n {(typing || loading || status !== undefined) && <MessageStatus>{typing ? strings.typing : loading ? strings.loading : status}</MessageStatus>}\n {actions !== undefined && <MessageActions>{actions}</MessageActions>}\n </MessageContent>\n </Stack>;\n});\nMessage.displayName = 'Message';\n"],"mappings":";;;;;;;;;AAGA,IAAaG,IAAwC;CAAE,QAAQ;CAAW,SAAS;AAAmB;;;ACAtG,SAAgBC,EAAgB,GAA2B;CAE1D,OADI,MAAM,QAAQC,CAAK,IAAUA,EAAM,KAAKD,CAAe,IACpDC,KAAU,QAA+B,OAAOA,KAAU,aAAaA,MAAU;AACzF;AAGA,IAAaC,IAAiB;CAC7B,OAAO;CACP,KAAK;AACN,GAEaC,IAAuB;CACnC,OAAO;CACP,KAAK;AACN,GCTaC,IAAiBC,EAA6C,SAAwB,EAAE,cAAW,GAAGC,KAAS,GAAK;CAAE,OAAO,kBAACT,GAAD;EAAO,GAAIS;EAAY;EAAK,KAAI;EAAQ,WAAWC,EAAG,8CAA8CC,CAAS;CAAI,CAAA;AAAG,CAAC,GAClPC,IAAgBJ,EAA6C,SAAuB,EAAE,cAAW,GAAGC,KAAS,GAAK;CAAE,OAAO,kBAACT,GAAD;EAAO,GAAIS;EAAY;EAAK,WAAU;EAAa,OAAM;EAAW,KAAI;EAAK,MAAA;EAAK,WAAWC,EAAG,mBAAmBC,CAAS;CAAI,CAAA;AAAG,CAAC,GAC/PE,IAAiBL,EAA6C,SAAwB,EAAE,cAAW,GAAGC,KAAS,GAAK;CAAE,OAAO,kBAACT,GAAD;EAAO,GAAIS;EAAY;EAAK,WAAU;EAAa,OAAM;EAAS,KAAI;EAAK,MAAA;EAAK,WAAWC,EAAG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,kBAACvB,GAAD;GAAO,WAAU;GAAa,OAAM;GAAQ,KAAI;GAAK,MAAM;GAAO,WAAU;GAA4B,UAAAwB;EAAc,CAAA,GAEpI,kBAACjB,GAAD;GAAgB,WAAWG,EAAG,eAAea,KAAajB,EAAqBmB,IAAQA,MAAU,QAAQ,cAAc,aAAa;GAApI,UAAA;KACGG,MAAW,KAAA,KAAaC,MAAc,KAAA,MAAc,kBAACjB,GAAD,EAAA,UAAA,CACpDgB,MAAW,KAAA,KAAa,kBAAC7B,GAAD;KAAM,MAAK;KAAU,KAAI;KAAO,QAAO;KAAU,UAAA6B;IAAa,CAAA,GACtFC,MAAc,KAAA,KAAa,kBAAC,QAAD;KAAgB;KAAU,UAAA,kBAAC9B,GAAD;MAAM,KAAI;MAAO,MAAK;MAAK,MAAK;MAAY,WAAU;MAAgB,UAAA8B;KAAgB,CAAA;IAAO,CAAA,CACrI,EAAA,CAAA;IAEd1B,EAAgBa,CAAQ,KAAK,kBAACF,GAAD;KAAqB;KAAO;IAAwB,CAAA;KAChFa,KAAUD,KAAWI,MAAW,KAAA,MAAc,kBAACZ,GAAD,EAAA,UAAgBS,IAASN,EAAQ,SAASK,IAAUL,EAAQ,UAAUS,EAAsB,CAAA;IAC3IC,MAAY,KAAA,KAAa,kBAAClB,GAAD,EAAA,UAAiBkB,EAAwB,CAAA;GACpD;EACV,CAAA,CAAA;;AACR,CAAC;AACD,EAAQ,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-C90-oQFq.js","names":["_Fragment","Text","DisplayLabel","Heading","headingRoleSizes","copyRoleProps","focusRecipes","Stack","interactionRecipes","Badge","Separator","TabScrollViewport","hasPageHeaderCommands","PageHeaderCommands","Fragment$1","LanguageSwitcher","handleSelect","useCallback","isActive","onSelect","value","locales","variant","Globe","label","onRenderLabel","locale","Fragment","cn","index","Button","defaultNavigationTabsStrings","normalizePath","hashRouteIndex","rawUrl","origin","NavigationTabs","forwardRef","stringsProp","strings","useStrings","activePath","currentPath","prominent","list","items","item","Icon","scrollable","className","scrollStrings","isSimpleText","PageHeading","resolvedBadges","badges","badge","hasCommands","primaryAction","secondaryActions","actionsRegion","actions","breadcrumbs","leading","contentClassName","eyebrow","eyebrowClassName","beforeTitle","titlePrefix","titleRowClassName","textGap","title","headingTag","titleSize","titleClassName","titleSuffix","description","afterDescription","descriptionClassName","actionsClassName","children","withSeparator"],"sources":["../src/components/base/navigation/language-switcher.tsx","../src/components/base/navigation/navigation-tabs.tsx","../src/components/base/navigation/page-header/page-header.tsx"],"sourcesContent":["/**\n * LanguageSwitcher — locale picker with two layouts: `buttons` (chunky\n * primary buttons) and `inline` (small text links separated by dots, prefixed\n * with a globe icon). Defaults to `buttons`.\n *\n * The library never navigates on its own. The consumer wires routing /\n * locale switching by passing `onSelect` (e.g. a Tanstack Router\n * `navigate(...)` or Inertia `router.visit(...)`). When `onSelect` is\n * absent the click is a no-op.\n */\nimport { Globe } from 'lucide-react';\nimport { Fragment, useCallback } from 'react';\n\nimport { Button } from '../buttons';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport type { LocaleOption } from '../../../types/locale.types';\nimport { focusRecipes } from '../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nexport interface LanguageSwitcherProps {\n\t/** Locales to offer, in order. The entry with `active: true` is marked as current. */\n\tlocales: LocaleOption[];\n\t/** Custom label for each locale. Defaults to `nativeLabel`. */\n\tonRenderLabel?: (options: LocaleOption) => string;\n\t/** Layout: `buttons` (default) for a row of buttons, `inline` for compact dot-separated text links. */\n\tvariant?: 'buttons' | 'inline';\n\t/** Called with the chosen locale's value. Not called for the current locale. */\n\tonSelect?: (value: string) => void;\n}\n\nexport function LanguageSwitcher({\n\tlocales,\n\tonRenderLabel,\n\tvariant = 'buttons',\n\tonSelect,\n}: LanguageSwitcherProps) {\n\tconst handleSelect = useCallback((value: string, isActive: boolean) => {\n\t\tif (isActive) {\n\t\t\treturn;\n\t\t}\n\n\t\tonSelect?.(value);\n\t}, [onSelect]);\n\n\tif (locales.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (variant === 'inline') {\n\t\treturn (\n\t\t\t// Both layouts start at the parent's start edge, like other inline controls; a\n\t\t\t// parent that centres its content (a footer, say) centres the switcher too.\n\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\" wrap={false} className=\"language-switcher--component\">\n\t\t\t\t<Globe className=\"size-icon shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n\t\t\t\t<Stack direction=\"horizontal\" align=\"center\" gap=\"md\" wrap className=\"min-w-0\">\n\t\t\t\t\t{locales.map((locale, index) => {\n\t\t\t\t\t\tconst label = onRenderLabel\n\t\t\t\t\t\t\t? onRenderLabel(locale)\n\t\t\t\t\t\t\t: locale.nativeLabel;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Fragment key={locale.value}>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\taria-current={locale.active ? 'true' : undefined}\n\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\thandleSelect(locale.value, locale.active)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t`${interactionRecipes.nativeButtonReset} cursor-pointer rounded-radius text-pxs outline-none transition-colors ${focusRecipes.text}`,\n\t\t\t\t\t\t\t\t\t\tlocale.active\n\t\t\t\t\t\t\t\t\t\t\t? 'text-primary-accent font-medium'\n\t\t\t\t\t\t\t\t\t\t\t: 'text-muted-foreground hover:text-foreground',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"pxs\" weight={locale.active ? 'medium' : 'regular'} className=\"text-inherit\">\n\t\t\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t{index < locales.length - 1 && (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"size-1 rounded-full bg-border\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Stack direction=\"horizontal\" align=\"center\" wrap gap=\"md\" className=\"language-switcher--component\">\n\t\t\t{locales.map((locale) => {\n\t\t\t\tconst label = onRenderLabel ? onRenderLabel(locale) : locale.nativeLabel;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={locale.value}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\tbuttonStyle={locale.active ? 'solid' : 'ghost'}\n\t\t\t\t\t\taria-current={locale.active ? 'true' : undefined}\n\t\t\t\t\t\tonClick={() => handleSelect(locale.value, locale.active)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'min-w-18 justify-center transition-colors',\n\t\t\t\t\t\t\tlocale.active ? 'text-foreground' : 'text-muted-foreground',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Stack>\n\t);\n}\n\nLanguageSwitcher.displayName = 'LanguageSwitcher';\n","/**\n * NavigationTabs — canonical route-tab navigation.\n *\n * The default compact treatment works for ordinary application navigation;\n * `variant=\"prominent\"` provides the stronger filled treatment without\n * introducing a second component or item vocabulary.\n */\nimport { forwardRef, type ReactNode } from 'react';\nimport type { LucideIcon } from 'lucide-react';\n\nimport { Badge } from '../badge';\nimport { Button } from '../buttons';\nimport { Stack } from '../structure';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { TabScrollViewport, type TabsScrollStrings } from './tab-scroll-viewport';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nexport interface NavigationTabItem {\n\ttitle: string;\n\thref: string;\n\ticon?: LucideIcon | string;\n\tbadge?: ReactNode;\n\tactive?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface NavigationTabsStrings {\n\ttabsAria: string;\n}\n\nexport const defaultNavigationTabsStrings: NavigationTabsStrings = {\n\ttabsAria: 'Tab navigation',\n};\n\nexport type NavigationTabsVariant = 'default' | 'prominent';\n\nexport interface NavigationTabsProps {\n\t/** Tabs to render, in order. */\n\titems: readonly NavigationTabItem[];\n\t/** Path of the active route, used to mark the current tab. */\n\tcurrentPath?: string;\n\t/** Visual treatment of the tab row. */\n\tvariant?: NavigationTabsVariant;\n\t/** Show previous/next controls when route tabs overflow. Defaults to true. */\n\tscrollable?: boolean;\n\t/** Accessible labels for the previous/next scroll controls. */\n\tscrollStrings?: StringsProp<TabsScrollStrings>;\n\t/** Overrides the tab row's own copy. */\n\tstrings?: StringsProp<NavigationTabsStrings>;\n\tclassName?: string;\n}\n\nfunction normalizePath(rawUrl: string): string {\n\tconst hashRouteIndex = rawUrl.indexOf('#/');\n\tif (hashRouteIndex >= 0) {\n\t\treturn rawUrl.slice(hashRouteIndex).split('?')[0]?.replace(/\\/+$/, '') || '#/';\n\t}\n\n\ttry {\n\t\tconst origin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n\t\tconst parsed = new URL(rawUrl, origin);\n\t\treturn parsed.pathname.replace(/\\/+$/, '') || '/';\n\t} catch {\n\t\treturn rawUrl.split('?')[0]?.replace(/\\/+$/, '') || '/';\n\t}\n}\n\nexport const NavigationTabs = forwardRef<HTMLDivElement, NavigationTabsProps>(function NavigationTabs({\n\titems,\n\tcurrentPath,\n\tvariant = 'default',\n\tscrollable = true,\n\tscrollStrings,\n\tstrings: stringsProp,\n\tclassName,\n}: NavigationTabsProps, ref) {\n\tconst strings = useStrings(defaultNavigationTabsStrings, stringsProp);\n\tconst activePath = normalizePath(\n\t\tcurrentPath ?? (typeof window !== 'undefined' ? window.location.pathname : '/'),\n\t);\n\tconst prominent = variant === 'prominent';\n\n\tconst list = <Stack\n\t\t\t\trender={<nav aria-label={strings.tabsAria} />}\n\t\t\t\tdirection=\"horizontal\"\n\t\t\t\tgap=\"2xs\"\n\t\t\t\twrap={false}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'navigation-tabs--list w-max rounded-radius bg-muted p-space-2xs',\n\t\t\t\t\tprominent && 'rounded-radius bg-muted',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{items.map((item) => {\n\t\t\t\t\tconst isActive = item.active ?? activePath === normalizePath(item.href);\n\t\t\t\t\tconst Icon = typeof item.icon === 'string' ? undefined : item.icon;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={item.href}\n\t\t\t\t\t\t\thref={item.href}\n\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\ttone={isActive && prominent ? 'primary' : 'secondary'}\n\t\t\t\t\t\t\tbuttonStyle={isActive && prominent ? 'solid' : 'ghost'}\n\t\t\t\t\t\t\ticon={Icon}\n\t\t\t\t\t\t\taria-current={isActive ? 'page' : undefined}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'navigation-tabs--item shrink-0',\n\t\t\t\t\t\t\t\t'rounded-radius',\n\t\t\t\t\t\t\t\t// Shared segmented recipe (Tabs, OverflowTabBar): a lifted card-coloured\n\t\t\t\t\t\t\t\t// active tab on the muted track, in light and dark alike. The current tab\n\t\t\t\t\t\t\t\t// holds its state under hover and press; the others change colour only.\n\t\t\t\t\t\t\t\t!prominent && isActive && interactionRecipes.segmentActiveButton,\n\t\t\t\t\t\t\t\t!prominent && !isActive && interactionRecipes.segmentInactiveButton,\n\t\t\t\t\t\t\t\tprominent && isActive && interactionRecipes.currentButtonHold,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{typeof item.icon === 'string' && (\n\t\t\t\t\t\t\t\t<span className=\"navigation-tabs--icon text-inherit\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t\t{item.icon}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\t\t\tlineHeight=\"none\"\n\t\t\t\t\t\t\t\tclassName=\"navigation-tabs--title text-inherit\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item.title}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t{item.badge !== undefined && item.badge !== null && (\n\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tclassName=\"navigation-tabs--badge\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{item.badge}\n\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Stack>;\n\treturn <div ref={ref} className={cn('navigation-tabs--component', 'w-full min-w-0', !scrollable && 'overflow-x-auto', className)}>\n\t\t{scrollable ? <TabScrollViewport strings={scrollStrings}>{list}</TabScrollViewport> : list}\n\t</div>;\n});\n\nNavigationTabs.displayName = 'NavigationTabs';\n","/**\n * 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. `primaryAction` and `secondaryActions` describe commands by\n * role; the heading owns their treatment and placement for every header built\n * on it.\n */\nimport type { Key, ReactNode } from 'react';\nimport { DisplayLabel, Heading, Text, type HeadingSize, type HeadingTag } from '../../../typography';\nimport {copyRoleProps, headingRoleSizes} from '../../../typography/text.styles';\nimport { Badge, type BadgeTone } from '../../badge';\nimport { Separator } from '../../display/separator';\nimport { Stack, type TextGap } from '../../structure';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\thasPageHeaderCommands,\n\tPageHeaderCommands,\n\ttype PageHeaderAction,\n\ttype PageHeaderLinkRenderer,\n} from './page-header-commands';\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/** Visual title scale, independent of heading level. Defaults to the subject role (`base`). */\n\ttitleSize?: HeadingSize;\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/**\n\t * Independent actions column beside the copy; follows it on narrow widths.\n\t * Holds non-command controls such as a period select; they render before\n\t * the role-based commands.\n\t */\n\tactions?: ReactNode;\n\t/**\n\t * The header's one main command: a solid primary button after the secondary\n\t * commands, placed in the command menu below 40rem of header width.\n\t */\n\tprimaryAction?: PageHeaderAction;\n\t/**\n\t * Supporting commands in priority order. The first two render as outline\n\t * buttons before the primary command; the rest, and every destructive\n\t * command, move into the More actions menu, which always closes the row.\n\t * Below 40rem of header width, every command collapses into that menu.\n\t */\n\tsecondaryActions?: readonly PageHeaderAction[];\n\t/**\n\t * How many routine secondary commands render as outline buttons on wide\n\t * headers; later ones join the More actions menu. Use `1` or `0` when long\n\t * labels beside the primary command would crowd the header; `Infinity`\n\t * keeps every routine command inline. @default 2\n\t */\n\tmaxVisibleSecondaryActions?: number;\n\t/** Accessible name of the More actions menu trigger. Default: `'More actions'`. */\n\tmoreActionsLabel?: string;\n\t/** Renders `href` commands as framework links. Defaults to a native anchor. */\n\trenderLink?: PageHeaderLinkRenderer;\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/**\n\t * Draws a rule beneath the header. Default: `false` — the page rhythm (gap\n\t * between header and body) separates them; opt in where a rule is the design.\n\t */\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\ttitleSize = headingRoleSizes.subject,\n\tbadge,\n\tbadges,\n\tbreadcrumbs,\n\tleading,\n\tbeforeTitle,\n\ttitlePrefix,\n\ttitleSuffix,\n\tafterDescription,\n\tactions,\n\tprimaryAction,\n\tsecondaryActions,\n\tmaxVisibleSecondaryActions,\n\tmoreActionsLabel = 'More actions',\n\trenderLink,\n\tchildren,\n\tclassName,\n\tcontentClassName,\n\teyebrowClassName,\n\ttitleClassName,\n\ttitleRowClassName,\n\tdescriptionClassName,\n\tactionsClassName,\n\twithSeparator = false,\n}: PageHeadingProps) {\n\tconst resolvedBadges = badges ?? (badge ? [badge] : []);\n\t// Custom `actions` content leads; role-based commands close the region.\n\tconst hasCommands = hasPageHeaderCommands(primaryAction, secondaryActions);\n\tconst actionsRegion = hasCommands ? (\n\t\t<>\n\t\t\t{actions}\n\t\t\t<PageHeaderCommands\n\t\t\t\tprimaryAction={primaryAction}\n\t\t\t\tsecondaryActions={secondaryActions}\n\t\t\t\tmaxVisibleSecondaryActions={maxVisibleSecondaryActions}\n\t\t\t\tmoreActionsLabel={moreActionsLabel}\n\t\t\t\trenderLink={renderLink}\n\t\t\t/>\n\t\t</>\n\t) : actions;\n\n\treturn (\n\t\t<header className={cn('page-heading--component page-header--component @container/page-header', '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=\"dense\" 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={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} size={titleSize} 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=\"dense\" 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 {...copyRoleProps.structuralDescription} 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{!!actionsRegion && (\n\t\t\t\t\t\t\t<Stack\n\t\t\t\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\t\t\t\tgap=\"md\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'page-header--actions max-w-full shrink-0',\n\t\t\t\t\t\t\t\t\thasCommands && 'self-end justify-end sm:self-auto',\n\t\t\t\t\t\t\t\t\tactionsClassName,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{actionsRegion}\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":";;;;;;;;;;;;;;;;;AAgCA,SAAgBe,EAAiB,EAChC,YACA,kBACA,aAAU,WACV,eACyB;CACzB,IAAMC,IAAeC,GAAa,GAAe,MAAsB;EACtE,AAAIC,KAIJC,IAAWC,CAAK;CACjB,GAAG,CAACD,CAAQ,CAAC;CAmDb,OAjDIE,EAAQ,WAAW,IACf,OAGJC,MAAY,WAId,kBAACf,GAAD;EAAO,WAAU;EAAa,OAAM;EAAS,KAAI;EAAK,MAAM;EAAO,WAAU;EAA7E,UAAA,CACC,kBAACgB,GAAD;GAAO,WAAU;GAA2C,eAAY;EAAQ,CAAA,GAChF,kBAAChB,GAAD;GAAO,WAAU;GAAa,OAAM;GAAS,KAAI;GAAK,MAAA;GAAK,WAAU;GACnE,UAAAc,EAAQ,KAAK,GAAQ,MAAU;IAC/B,IAAMG,IAAQC,IACXA,EAAcC,CAAM,IACpBA,EAAO;IAEV,OACC,kBAACC,GAAD,EAAA,UAAA,CACC,kBAAC,UAAD;KACC,MAAK;KACL,gBAA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BxB,EAAawB,CAAW,IAC1C,kBAAC1E,GAAD;WAAM,GAAII,EAAc;WAAuB,WAAWuB,EAAG,+DAA+DiD,CAAoB;WAC9I,UAAAF;UACI,CAAA,IACHA,IACHC,CACK;;QAEJ;OACJ,CAAA,GAAA,CAAC,CAACjB,KACF,kBAACpD,GAAD;QACC,WAAU;QACV,KAAI;QACJ,WAAWqB,EACV,4CACA4B,KAAe,qCACfsB,CACD;QAEC,UAAAnB;OACK,CAAA,CAEF;;KACD;IACD,CAAA,CAAA;;GAEN,CAAC,CAACoB,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAe;GAAc,CAAA;GAE1D,CAAC,CAACC,KAAiB,kBAACtE,GAAD,EAAW,WAAU,cAAe,CAAA;EACjD;;AAEV;AAEA,EAAY,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-DaRjthVk.js","names":["Text","DisplayLabel","focusRecipes","Stack","toneRecipes","interactionRecipes","Percent","Badge","ItemMedia","ItemDescription","ItemActions","ItemGroup","ItemContent","Item","ItemTitle","defaultBreadcrumbProgressStrings","BreadcrumbProgress","stringsProp","strings","useStrings","cn","className","currentIndex","steps","isCompleted","idx","isCurrent","isClickable","onStepClick","Button","step","Check","CategoryNav","title","items","Icon","it","active","activeId","onSelect","ChevronRight","defaultSectionNavStrings","SCROLL_SETTLE_MS","SectionNav","forwardRef","ariaLabel","rootProps","setActive","useState","clickLock","useRef","settleTimer","sectionIds","scheduleSettle","useCallback","useEffect","onScroll","lock","ids","intersecting","obs","entries","entry","next","id","el","rootMargin","isActive","e","defaultSideNavStrings","normalizePath","rawUrl","baseOrigin","trimmed","isSimpleText","value","SideNav","groupsProp","groups","useMemo","activePath","currentPath","activeNormalized","g","item","normalizedPath","b","a","collapsed","setCollapsed","toggleGroup","prev","resolvedActive","activeItemClassName","isCollapsed","group","showLabel","shouldRenderItems","ChevronDown","itemClassName"],"sources":["../src/components/layout/navigation/breadcrumb-progress/types.ts","../src/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.tsx","../src/components/layout/navigation/category-nav/category-nav.tsx","../src/components/layout/navigation/section-nav/section-nav.tsx","../src/components/layout/navigation/side-nav.tsx"],"sourcesContent":["import type { StringsProp } from '../../../../lib/strings';\n\nexport interface BreadcrumbProgressStep {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\t/** Short guidance shown beneath the control. */\n\thint?: string;\n}\n\nexport interface BreadcrumbProgressStrings {\n\tstepLabel: string;\n\tofLabel: string;\n}\n\nexport const defaultBreadcrumbProgressStrings: BreadcrumbProgressStrings = {\n\tstepLabel: 'Step',\n\tofLabel: 'of',\n};\n\nexport interface BreadcrumbProgressProps {\n\t/** Steps in the flow, in order. */\n\tsteps: BreadcrumbProgressStep[];\n\t/** Zero-based position of the active step. */\n\tcurrentIndex: number;\n\tonStepClick?: (id: string, index: number) => void;\n\tclassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<BreadcrumbProgressStrings>;\n}\n","/**\n * BreadcrumbProgress — wizard / multi-step navigation with completed,\n * current, and upcoming states. Click any completed step to jump back.\n */\nimport { Check } from 'lucide-react';\nimport { Button } from '../../../base/buttons';\nimport { Percent } from '../../../primitives';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { useStrings } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\n\nimport {\n\tdefaultBreadcrumbProgressStrings,\n\ttype BreadcrumbProgressProps,\n} from './types';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { toneRecipes } from '../../../../lib/tone-recipes';\n\nexport function BreadcrumbProgress({ steps, currentIndex, onStepClick, className, strings: stringsProp }: BreadcrumbProgressProps) {\n\tconst strings = useStrings(defaultBreadcrumbProgressStrings, stringsProp);\n\n\treturn (\n\t\t<div className={cn('breadcrumb-progress--component', 'w-full', className)}>\n\t\t\t<div className=\"flex items-center justify-between mb-space-md\">\n\t\t\t\t<DisplayLabel>\n\t\t\t\t\t{strings.stepLabel} {currentIndex + 1} {strings.ofLabel} {steps.length}\n\t\t\t\t</DisplayLabel>\n\t\t\t\t<Percent value={Math.round(((currentIndex + 1) / steps.length) * 100)} scaled size=\"xs\" weight=\"semibold\" />\n\t\t\t</div>\n\t\t\t<ol className=\"m-0 list-none p-0 font-sans flex items-center gap-space-md\">\n\t\t\t\t{steps.map((step, idx) => {\n\t\t\t\t\tconst isCompleted = idx < currentIndex;\n\t\t\t\t\tconst isCurrent = idx === currentIndex;\n\t\t\t\t\tconst isClickable = onStepClick && (isCompleted || isCurrent);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<li key={step.id} className=\"flex min-w-0 flex-1 items-center gap-space-md\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-label={`${strings.stepLabel} ${idx + 1}: ${step.label}`}\n\t\t\t\t\t\t\t\tonClick={() => isClickable && onStepClick?.(step.id, idx)}\n\t\t\t\t\t\t\t\tdisabled={!isClickable}\n\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"md\"\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'min-w-0 justify-start gap-space-md text-left transition-colors',\n\t\t\t\t\t\t\t\t\tisClickable && interactionRecipes.rowHover,\n\t\t\t\t\t\t\t\t\t!isClickable && 'cursor-default',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'flex size-6 shrink-0 items-center justify-center rounded-full tabular-nums',\n\t\t\t\t\t\t\t\t\t\tisCompleted && 'bg-success text-success-foreground',\n\t\t\t\t\t\t\t\t\t\tisCurrent && `bg-primary text-primary-foreground ring-4 ${toneRecipes.primary.halo}`,\n\t\t\t\t\t\t\t\t\t\t!isCompleted && !isCurrent && 'bg-muted text-muted-foreground',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{isCompleted ? <Check className=\"size-icon-md\" /> : idx + 1}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<div className=\"hidden min-w-0 lg:block\">\n\t\t\t\t\t\t\t\t\t<Text weight=\"semibold\" className={cn(!isCurrent && !isCompleted && 'text-muted-foreground')}>{step.label}</Text>\n\t\t\t\t\t\t\t\t\t{!!step.hint && <Text size=\"xs\" type=\"discrete\" className=\"truncate\">{step.hint}</Text>}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t{idx < steps.length - 1 && (\n\t\t\t\t\t\t\t\t<div className={cn('h-px flex-1', isCompleted ? 'bg-success' : 'bg-border')} />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ol>\n\t\t</div>\n\t);\n}\n\nBreadcrumbProgress.displayName = 'BreadcrumbProgress';\n","/**\n * CategoryNav — vertical icon + label list with optional count badge per row.\n * Use as a sidebar nav for filtering or category browsing.\n */\nimport { ChevronRight } from 'lucide-react';\nimport { Badge } from '../../../base/badge';\nimport {\n\tItem,\n\tItemActions,\n\tItemContent,\n\tItemDescription,\n\tItemGroup,\n\tItemMedia,\n\tItemTitle,\n} from '../../../base/item';\nimport { cn } from '../../../../lib/utils';\n\nimport type { CategoryNavProps } from './types';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\n\nexport function CategoryNav({ title, items, activeId, onSelect, className }: CategoryNavProps) {\n\treturn (\n\t\t<nav\n\t\t\tdata-component=\"category-nav\"\n\t\t\tdata-slot=\"category-nav\"\n\t\t\taria-label={title}\n\t\t\tclassName={cn('category-nav--component min-w-0', className)}\n\t\t>\n\t\t\t<ItemGroup>\n\t\t\t\t{items.map((it) => {\n\t\t\t\t\tconst Icon = it.icon;\n\t\t\t\t\tconst active = it.id === activeId;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Item\n\t\t\t\t\t\t\tkey={it.id}\n\t\t\t\t\t\t\t// Not `size=\"sm\"`. That maps to the primitive `xs` scale, which\n\t\t\t\t\t\t\t// shrinks media icons to 12px for a genuinely compact row — but\n\t\t\t\t\t\t\t// this row carries a title, a description and a badge and stands\n\t\t\t\t\t\t\t// 58px tall. The result was a 12px leading icon beside a 16px\n\t\t\t\t\t\t\t// chevron, because a `size-` class opts an icon out of that\n\t\t\t\t\t\t\t// scaling rule. The default scale matches `base/item`'s own\n\t\t\t\t\t\t\t// reference row at the same height.\n\t\t\t\t\t\t\tonClick={() => onSelect?.(it.id)}\n\t\t\t\t\t\t\tdata-state={active ? 'active' : 'inactive'}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t// The selected tint spans the row, so the row needs horizontal\n\t\t\t\t\t\t\t\t// padding of its own or the icon sits 1px from the tint's edge.\n\t\t\t\t\t\t\t\t// `px-space-md` is what `SectionNav` uses for the same job.\n\t\t\t\t\t\t\t\t'cursor-pointer rounded-radius px-space-md transition-colors',\n\t\t\t\t\t\t\t\tactive ? interactionRecipes.rowCurrent : interactionRecipes.rowHover,\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t<ItemMedia variant=\"icon\" className={cn(active ? 'text-accent-foreground' : 'text-muted-foreground')}>\n\t\t\t\t\t\t\t\t\t<Icon />\n\t\t\t\t\t\t\t\t</ItemMedia>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<ItemContent>\n\t\t\t\t\t\t\t\t<ItemTitle bold={active}>{it.label}</ItemTitle>\n\t\t\t\t\t\t\t\t{!!it.hint && <ItemDescription clamp={1}>{it.hint}</ItemDescription>}\n\t\t\t\t\t\t\t</ItemContent>\n\t\t\t\t\t\t\t<ItemActions>\n\t\t\t\t\t\t\t\t{typeof it.count === 'number' && (\n\t\t\t\t\t\t\t\t\t<Badge tone=\"secondary\" className=\"tabular-nums\">\n\t\t\t\t\t\t\t\t\t\t{it.count}\n\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<ChevronRight\n\t\t\t\t\t\t\t\t\tclassName={cn('size-icon shrink-0 text-muted-foreground', active && 'text-accent-foreground')}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ItemActions>\n\t\t\t\t\t\t</Item>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ItemGroup>\n\t\t</nav>\n\t);\n}\n\nCategoryNav.displayName = 'CategoryNav';\n","/**\n * SectionNav — sticky in-page anchor nav. Pass a list of section ids; the active one\n * is tracked via IntersectionObserver and the matching item is highlighted. Click to\n * scroll to that section. Pure JS — no router required.\n *\n * A click owns the current state: the clicked section stays current while the smooth\n * scroll it started passes other sections, after that scroll settles (including when\n * the last sections are too short to reach the top), and until the reader scrolls\n * again. Only then does the observer resume.\n */\nimport { forwardRef, useCallback, useEffect, useRef, useState, type ComponentPropsWithoutRef } from 'react';\nimport type { LucideIcon } from 'lucide-react';\nimport { Text } from '../../../typography';\nimport { Stack } from '../../../base/structure';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\nimport { cn } from '../../../../lib/utils';\nimport { interactionRecipes } from '../../../../lib/interaction-recipes';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\n\nexport interface SectionNavStrings {\n\tnavigationLabel: string;\n}\n\nexport const defaultSectionNavStrings: SectionNavStrings = {\n\tnavigationLabel: 'Section navigation',\n};\n\n/** Quiet time after the last scroll event before a click's smooth scroll counts as settled. */\nconst SCROLL_SETTLE_MS = 150;\n\nexport interface SectionNavItem {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel: string;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n}\n\nexport interface SectionNavProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'children' | 'onSelect'> {\n\t/** Entries to render, in order. */\n\titems: SectionNavItem[];\n\trootMargin?: string;\n\tonSelect?: (id: string) => void;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SectionNavStrings>;\n}\n\nexport const SectionNav = forwardRef<HTMLElement, SectionNavProps>(function SectionNav({\n\titems,\n\trootMargin = '-40% 0px -50% 0px',\n\tclassName,\n\tonSelect,\n\tstrings: stringsProp,\n\t'aria-label': ariaLabel,\n\t...rootProps\n}, ref) {\n\tconst strings = useStrings(defaultSectionNavStrings, stringsProp);\n\tconst [active, setActive] = useState<string | null>(items[0]?.id ?? null);\n\t// The section a click selected, and whether the scroll it started has settled.\n\tconst clickLock = useRef<{ id: string; settled: boolean } | null>(null);\n\tconst settleTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\t// Observe by identity, not array instance, so a re-render keeps the observer.\n\tconst sectionIds = items.map((it) => it.id).join('\\u0000');\n\n\tconst scheduleSettle = useCallback(() => {\n\t\tclearTimeout(settleTimer.current);\n\t\tsettleTimer.current = setTimeout(() => {\n\t\t\tif (clickLock.current) clickLock.current.settled = true;\n\t\t}, SCROLL_SETTLE_MS);\n\t}, []);\n\n\tuseEffect(() => {\n\t\t// Scroll events do not bubble, so listen in the capture phase to hear every\n\t\t// scrolling ancestor that scrollIntoView moves.\n\t\tconst onScroll = () => {\n\t\t\tconst lock = clickLock.current;\n\t\t\tif (!lock) return;\n\t\t\t// A scroll after the click's own scroll settled is the reader's: release.\n\t\t\tif (lock.settled) clickLock.current = null;\n\t\t\telse scheduleSettle();\n\t\t};\n\t\tdocument.addEventListener('scroll', onScroll, { capture: true, passive: true });\n\t\treturn () => {\n\t\t\tdocument.removeEventListener('scroll', onScroll, { capture: true });\n\t\t\tclearTimeout(settleTimer.current);\n\t\t};\n\t}, [scheduleSettle]);\n\n\tuseEffect(() => {\n\t\tconst ids = sectionIds ? sectionIds.split('\\u0000') : [];\n\t\tconst intersecting = new Map<string, boolean>();\n\t\tconst obs = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => intersecting.set(entry.target.id, entry.isIntersecting));\n\t\t\t\tif (clickLock.current) return;\n\t\t\t\t// The first section in reading order inside the observed band is current.\n\t\t\t\tconst next = ids.find((id) => intersecting.get(id));\n\t\t\t\tif (next) setActive(next);\n\t\t\t},\n\t\t\t{ rootMargin, threshold: 0 },\n\t\t);\n\t\tids.forEach((id) => {\n\t\t\tconst el = document.getElementById(id);\n\t\t\tif (el) obs.observe(el);\n\t\t});\n\t\treturn () => obs.disconnect();\n\t}, [sectionIds, rootMargin]);\n\n\treturn (\n\t\t<nav\n\t\t\tref={ref}\n\t\t\tclassName={cn('section-nav--component', className)}\n\t\t\taria-label={ariaLabel ?? strings.navigationLabel}\n\t\t\t{...rootProps}\n\t\t>\n\t\t\t<Stack gap=\"2xs\" className=\"section-nav--items\">\n\t\t\t\t{items.map((it) => {\n\t\t\t\tconst Icon = it.icon;\n\t\t\t\tconst isActive = active === it.id;\n\t\t\t\treturn (\n\t\t\t\t\t<a\n\t\t\t\t\t\tkey={it.id}\n\t\t\t\t\t\thref={`#${it.id}`}\n\t\t\t\t\t\taria-current={isActive ? 'location' : undefined}\n\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tclickLock.current = { id: it.id, settled: false };\n\t\t\t\t\t\t\t// Settles on its own when the target is already in place and nothing scrolls.\n\t\t\t\t\t\t\tscheduleSettle();\n\t\t\t\t\t\t\tdocument.getElementById(it.id)?.scrollIntoView({ behavior: 'smooth', block: 'start' });\n\t\t\t\t\t\t\tsetActive(it.id);\n\t\t\t\t\t\t\tonSelect?.(it.id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t`flex items-center gap-space-md rounded-radius px-space-md py-row-y transition-colors outline-none ${focusRecipes.edge}`,\n\t\t\t\t\t\t\tisActive ? interactionRecipes.rowCurrent : `text-muted-foreground ${interactionRecipes.rowHover}`,\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!Icon && <Icon className=\"size-icon-md shrink-0\" />}\n\t\t\t\t\t\t<Text tag=\"span\" type=\"inherit\" weight={isActive ? 'semibold' : 'medium'}>{it.label}</Text>\n\t\t\t\t\t</a>\n\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Stack>\n\t\t</nav>\n\t);\n});\n\nSectionNav.displayName = 'SectionNav';\n","/**\n * SideNav — collapsible vertical sidebar navigation. Items can be grouped\n * with a heading and optionally collapsed; each item supports an icon, badge,\n * and active-state highlight. The active item is matched by deepest path\n * prefix so nested routes still highlight their parent group.\n *\n * Pass `items` for the short flat-list default. Use `groups` only when the\n * navigation needs headings or collapsible sections.\n */\nimport { ChevronDown, type LucideIcon } from 'lucide-react';\nimport { forwardRef, useMemo, useState, type ComponentPropsWithoutRef, type ReactNode } from 'react';\n\nimport { Badge } from '../../base/badge';\nimport { Button } from '../../base/buttons';\nimport { Stack } from '../../base/structure';\nimport { DisplayLabel, Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { focusRecipes } from '../../../lib/focus-recipes';\nimport { interactionRecipes } from '../../../lib/interaction-recipes';\n\nexport interface SideNavStrings {\n\tnavigationLabel: string;\n}\n\nexport const defaultSideNavStrings: SideNavStrings = {\n\tnavigationLabel: 'Side navigation',\n};\n\nexport interface SideNavItem {\n\t/** Display label. */\n\tlabel: ReactNode;\n\t/** Destination for the entry, when it navigates. */\n\thref: string;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Chip rendered beside the label. */\n\tbadge?: ReactNode;\n\t/** Disables the control. */\n\tdisabled?: boolean;\n}\n\nexport interface SideNavGroup {\n\t/** Stable identity for this entry. */\n\tid: string;\n\t/** Display label. */\n\tlabel?: ReactNode;\n\t/** Entries to render, in order. */\n\titems: SideNavItem[];\n\tdefaultCollapsed?: boolean;\n\tcollapsible?: boolean;\n}\n\ninterface SideNavSharedProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'children'> {\n\t/** Path of the active route, used to mark the current entry. */\n\tcurrentPath?: string;\n\titemClassName?: string;\n\tactiveItemClassName?: string;\n\t/** Overrides this surface's own copy. */\n\tstrings?: StringsProp<SideNavStrings>;\n}\n\nexport type SideNavProps = SideNavSharedProps & (\n\t| {\n\t\t/** Short default for one flat navigation list. */\n\t\titems: SideNavItem[];\n\t\t/** Sections of the settings navigation. */\n\t\tgroups?: never;\n\t}\n\t| {\n\t\t/** Grouped navigation with optional headings and collapse behavior. */\n\t\tgroups: SideNavGroup[];\n\t\titems?: never;\n\t}\n);\n\nfunction normalizePath(rawUrl: string): string {\n\tif (rawUrl.length === 0) return '/';\n\ttry {\n\t\tconst baseOrigin = typeof window !== 'undefined' ? window.location.origin : 'http://localhost';\n\t\tconst parsed = new URL(rawUrl, baseOrigin);\n\t\tconst trimmed = parsed.pathname.replace(/\\/+$/, '');\n\t\treturn trimmed.length > 0 ? trimmed : '/';\n\t} catch {\n\t\tconst clean = rawUrl.split('?')[0] ?? rawUrl;\n\t\tconst trimmed = clean.replace(/\\/+$/, '');\n\t\treturn trimmed.length > 0 ? trimmed : '/';\n\t}\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 const SideNav = forwardRef<HTMLElement, SideNavProps>(function SideNav({\n\titems,\n\tgroups: groupsProp,\n\tcurrentPath,\n\tclassName,\n\titemClassName,\n\tactiveItemClassName,\n\tstrings: stringsProp,\n\t'aria-label': ariaLabel,\n\t...rootProps\n}, ref) {\n\tconst strings = useStrings(defaultSideNavStrings, stringsProp);\n\tconst groups = useMemo<SideNavGroup[]>(\n\t\t() => groupsProp ?? [\n\t\t\t{ id: 'side-nav-items', items: items ?? [], collapsible: false },\n\t\t],\n\t\t[groupsProp, items],\n\t);\n\tconst rawActivePath = currentPath ?? (typeof window !== 'undefined' ? window.location.pathname : '');\n\tconst activePath = normalizePath(rawActivePath);\n\n\tconst allNormalized = useMemo(() => {\n\t\treturn groups.flatMap((g) =>\n\t\t\tg.items.map((item) => ({ groupId: g.id, normalizedPath: normalizePath(item.href) })),\n\t\t);\n\t}, [groups]);\n\n\tconst activeNormalized =\n\t\tallNormalized\n\t\t\t.filter(\n\t\t\t\t({ normalizedPath }) =>\n\t\t\t\t\tactivePath === normalizedPath || activePath.startsWith(`${normalizedPath}/`),\n\t\t\t)\n\t\t\t.sort((a, b) => b.normalizedPath.length - a.normalizedPath.length)[0]?.normalizedPath ??\n\t\tnull;\n\n\tconst [collapsed, setCollapsed] = useState<Record<string, boolean>>(() =>\n\t\tObject.fromEntries(groups.map((g) => [g.id, Boolean(g.defaultCollapsed)])),\n\t);\n\n\tconst toggleGroup = (id: string) =>\n\t\tsetCollapsed((prev) => ({ ...prev, [id]: !prev[id] }));\n\n\tconst resolvedActive =\n\t\tactiveItemClassName && activeItemClassName.length > 0\n\t\t\t? activeItemClassName\n\t\t\t: interactionRecipes.rowCurrent;\n\n\treturn (\n\t\t<nav\n\t\t\tref={ref}\n\t\t\taria-label={ariaLabel ?? strings.navigationLabel}\n\t\t\tclassName={cn('side-nav--component', className)}\n\t\t\t{...rootProps}\n\t\t>\n\t\t\t<Stack gap=\"xl\" className=\"side-nav--groups\">\n\t\t\t\t{groups.map((group) => {\n\t\t\t\tconst isCollapsed = group.collapsible !== false && collapsed[group.id];\n\t\t\t\tconst showLabel = !!group.label;\n\t\t\t\tconst shouldRenderItems = !isCollapsed;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Stack key={group.id} gap=\"2xs\" className=\"side-nav--group\">\n\t\t\t\t\t\t{!!showLabel && (\n\t\t\t\t\t\t\tgroup.collapsible !== false ? (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\tfullWidth\n\t\t\t\t\t\t\t\t\tonClick={() => toggleGroup(group.id)}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'h-auto min-h-action-sm justify-between px-row-x py-row-y',\n\t\t\t\t\t\t\t\t\t\t'text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t'hover:text-foreground transition-colors',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\taria-expanded={!isCollapsed}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{isSimpleText(group.label) ? (\n\t\t\t\t\t\t\t\t\t\t<DisplayLabel tag=\"span\">\n\t\t\t\t\t\t\t\t\t\t\t{group.label}\n\t\t\t\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t\t\t) : group.label}\n\t\t\t\t\t\t\t\t\t<ChevronDown\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'size-icon-md transition-transform',\n\t\t\t\t\t\t\t\t\t\t\tisCollapsed && '-rotate-90',\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\tisSimpleText(group.label) ? (\n\t\t\t\t\t\t\t\t\t<DisplayLabel tag=\"div\" className=\"px-row-x py-row-y\">\n\t\t\t\t\t\t\t\t\t\t{group.label}\n\t\t\t\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t\t\t\t) : group.label\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{!!shouldRenderItems && (\n\t\t\t\t\t\t\t<Stack gap=\"2xs\" className=\"side-nav--items\">\n\t\t\t\t\t\t\t\t{group.items.map((item) => {\n\t\t\t\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\t\t\t\tconst itemPath = normalizePath(item.href);\n\t\t\t\t\t\t\t\t\tconst isActive = itemPath === activeNormalized;\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tkey={item.href}\n\t\t\t\t\t\t\t\t\t\t\thref={item.disabled ? undefined : item.href}\n\t\t\t\t\t\t\t\t\t\t\taria-current={isActive ? 'page' : undefined}\n\t\t\t\t\t\t\t\t\t\t\taria-disabled={item.disabled || undefined}\n\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'group flex items-center gap-space-md rounded-radius px-row-x py-row-y',\n\t\t\t\t\t\t\t\t\t\t\t\t'text-sm transition-colors',\n\t\t\t\t\t\t\t\t\t\t\t\t`focus-visible:outline-none ${focusRecipes.edge}`,\n\t\t\t\t\t\t\t\t\t\t\t\tinteractionRecipes.rowHover,\n\t\t\t\t\t\t\t\t\t\t\t\titem.disabled && 'pointer-events-none opacity-50',\n\t\t\t\t\t\t\t\t\t\t\t\tisActive && resolvedActive,\n\t\t\t\t\t\t\t\t\t\t\t\titemClassName,\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'size-icon shrink-0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisActive ? 'text-accent-foreground' : 'text-muted-foreground',\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t{isSimpleText(item.label) ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"min-w-0 flex-1 truncate text-inherit\">\n\t\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\t</Text>\n\t\t\t\t\t\t\t\t\t\t) : item.label}\n\t\t\t\t\t\t\t\t\t\t\t{!!item.badge && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Badge\n\t\t\t\t\t\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"shrink-0\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{item.badge}\n\t\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Stack>\n\t\t</nav>\n\t);\n});\n\nSideNav.displayName = 'SideNav';\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAae,IAA8D;CAC1E,WAAW;CACX,SAAS;AACV;;;ACDA,SAAgBC,EAAmB,EAAE,UAAO,iBAAc,gBAAa,cAAW,SAASC,KAAwC;CAClI,IAAMC,IAAUC,EAAWJ,GAAkCE,CAAW;CAExE,OACC,kBAAC,OAAD;EAAK,WAAWG,EAAG,kCAAkC,UAAUC,CAAS;EAAxE,UAAA,CACC,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,kBAACpB,GAAD,EAAA,UAAA;IACEiB,EA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ChB;OACA,eAAY;MACZ,CAAA,CACM;KAER,CAAA,IAOD,CAAC,CAACG,KACF,kBAAC9F,GAAD;MAAO,KAAI;MAAM,WAAU;MACzB,UAAA4F,EAAM,MAAM,KAAK,MAAS;OAC1B,IAAM5D,IAAOiD,EAAK,MAEZjB,IADWG,EAAcc,EAAK,IACnB,MAAaF;OAC9B,OACC,kBAAC,KAAD;QAEC,MAAME,EAAK,WAAW,KAAA,IAAYA,EAAK;QACvC,gBAAcjB,IAAW,SAAS,KAAA;QAClC,iBAAeiB,EAAK,YAAY,KAAA;QAChC,WAAWhE,EACX,yEACC,6BACA,8BAA8BlB,EAAa,QAC3CG,EAAmB,UACnB+E,EAAK,YAAY,kCACjBjB,KAAYyB,GACZO,CACD;QAbD,UAAA;SAeE,CAAC,CAAChE,KACF,kBAACA,GAAD,EACC,WAAWf,EACV,sBACA+C,IAAW,2BAA2B,uBACvC,EACA,CAAA;SAEDO,EAAaU,EAAK,KAAK,IACvB,kBAACpF,GAAD;UAAM,KAAI;UAAO,MAAK;UAAU,QAAO;UAAS,YAAW;UAAQ,WAAU;UAC3E,UAAAoF,EAAK;SACD,CAAA,IACJA,EAAK;SACP,CAAC,CAACA,EAAK,SACP,kBAAC7E,GAAD;UACC,MAAK;UACL,WAAU;UAET,UAAA6E,EAAK;SACA,CAAA;QAEN;OAnCG,GAAAA,EAAK,IAmCR;MAEL,CAAC;KACK,CAAA,CAEF;IAtFK,GAAAW,EAAM,EAsFX;GAER,CAAC;EACK,CAAA;CACH,CAAA;AAEP,CAAC;AAED,EAAQ,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number-CRU3kGuk.js","names":["Number","useFormattingConfig","useMoneyConfig","cn","Text","useValueTypography","formatWithMinusSign","emptyValueTypography","normalizeDecimalString","trimmed","value","comma","dot","decimalSeparator","groupingSeparator","head","tail","parseMoneyAmount","amount","parsed","normalizeFractionDigits","fallback","resolveFractionDigits","normalizedMaximum","maximumFractionDigits","normalizedMinimum","minimumFractionDigits","resolveCurrencyFractionDigits","currency","resolved","locale","replaceCurrencyPart","formatter","part","symbol","formatMoneyAmount","resolvedCurrency","numberOptions","formatMode","formattedNumber","normalizeMinorUnitScale","resolveMajorAmount","useMoneyFormatter","formatting","money","defaults","useCallback","options","overrides","resolvedEmptyLabel","major","unit","minorUnitScale","currencyDisplay","emptyLabel","MONEY_ROLE","getAlignmentClasses","align","Money","sizeProp","weightProp","typeProp","lineHeightProp","props","typography","primaryAmount","primaryLabel","empty","className","secondaryAmount","secondary","resolvedSecondaryCurrency","resolvedDisplayMode","displayMode","secondaryEmphasis","secondaryLabel","resolvedLayout","layout","secondarySize","size","secondaryType","type","secondaryWeight","weight","alignment","separator","NUMBER_ROLE","parseNumericValue","renderNumberLabel","Number$1","label","Percent","scaled"],"sources":["../src/lib/money-format.ts","../src/components/primitives/money.tsx","../src/components/primitives/number.tsx"],"sourcesContent":["/**\n * Shared money formatting for the Money primitive and metric surfaces.\n *\n * One formatter keeps currency labels, fraction digits and format modes\n * identical wherever an amount is shown. Components resolve locale, currency\n * and format mode from UIProvider before calling it.\n */\nimport type { MoneyFormatMode } from './ui-provider/types';\nimport { formatWithMinusSign, MINUS_SIGN } from './format';\n\n/** A numeric amount or an unformatted decimal string. */\nexport type MoneyAmountInput = number | string | null | undefined;\n\nexport interface FormatMoneyAmountOptions {\n\t/** Major-unit amount. Strings accept either decimal separator. */\n\tamount: MoneyAmountInput;\n\t/** ISO 4217 currency code; an empty value formats as a plain decimal. */\n\tcurrency?: string | null;\n\t/** BCP-47 locale for Intl formatting. */\n\tlocale?: string;\n\t/** Intl currency label style when the format mode uses currency formatting. */\n\tcurrencyDisplay?: Intl.NumberFormatOptions['currencyDisplay'];\n\t/** Minimum decimal digits. Defaults to the currency's Intl convention. */\n\tminimumFractionDigits?: number;\n\t/** Maximum decimal digits. Defaults to the currency's Intl convention. */\n\tmaximumFractionDigits?: number;\n\t/** Provider format policy: decimal, with_code, with_symbol or locale_aware. */\n\tformatMode?: MoneyFormatMode;\n\t/** Consumer-resolved symbol; Intl placement is preserved. */\n\tsymbol?: string | null;\n}\n\nfunction normalizeDecimalString(value: string) {\n\tconst trimmed = value.trim();\n\tif (!trimmed) return '';\n\n\tconst comma = trimmed.lastIndexOf(',');\n\tconst dot = trimmed.lastIndexOf('.');\n\n\tif (comma >= 0 && dot >= 0) {\n\t\tconst decimalSeparator = comma > dot ? ',' : '.';\n\t\tconst groupingSeparator = decimalSeparator === ',' ? '.' : ',';\n\t\treturn trimmed\n\t\t\t.replace(new RegExp(`\\\\${groupingSeparator}`, 'g'), '')\n\t\t\t.replace(decimalSeparator, '.');\n\t}\n\n\tif (comma >= 0) {\n\t\tconst [head, tail = ''] = trimmed.split(',');\n\t\tif (tail.length > 0 && tail.length <= 2) return `${head.replace(/,/g, '')}.${tail}`;\n\t\treturn trimmed.replace(/,/g, '');\n\t}\n\n\tif (dot >= 0) {\n\t\tconst [head, tail = ''] = trimmed.split('.');\n\t\tif (tail.length === 3 && head.length > 0) return trimmed.replace(/\\./g, '');\n\t}\n\n\treturn trimmed;\n}\n\nexport function parseMoneyAmount(amount: MoneyAmountInput): number | null {\n\tif (amount === null || amount === undefined || amount === '') return null;\n\tif (typeof amount === 'number') return Number.isFinite(amount) ? amount : null;\n\tconst parsed = Number.parseFloat(normalizeDecimalString(amount));\n\treturn Number.isFinite(parsed) ? parsed : null;\n}\n\nfunction normalizeFractionDigits(value: number | undefined, fallback: number) {\n\tif (value === undefined || !Number.isFinite(value)) return fallback;\n\treturn Math.min(100, Math.max(0, Math.trunc(value)));\n}\n\nfunction resolveFractionDigits(\n\tminimumFractionDigits?: number,\n\tmaximumFractionDigits?: number,\n\tfallback = { minimumFractionDigits: 2, maximumFractionDigits: 2 },\n) {\n\tconst normalizedMaximum = normalizeFractionDigits(\n\t\tmaximumFractionDigits,\n\t\tfallback.maximumFractionDigits,\n\t);\n\tconst normalizedMinimum = normalizeFractionDigits(\n\t\tminimumFractionDigits,\n\t\tMath.min(fallback.minimumFractionDigits, normalizedMaximum),\n\t);\n\n\treturn {\n\t\tminimumFractionDigits: normalizedMinimum,\n\t\tmaximumFractionDigits: Math.max(normalizedMinimum, normalizedMaximum),\n\t};\n}\n\nfunction resolveCurrencyFractionDigits(currency: string, locale?: string) {\n\tif (!currency) return { minimumFractionDigits: 2, maximumFractionDigits: 2 };\n\ttry {\n\t\tconst resolved = new Intl.NumberFormat(locale, {\n\t\t\tstyle: 'currency',\n\t\t\tcurrency,\n\t\t}).resolvedOptions();\n\t\treturn {\n\t\t\tminimumFractionDigits: resolved.minimumFractionDigits ?? 2,\n\t\t\tmaximumFractionDigits: resolved.maximumFractionDigits ?? 2,\n\t\t};\n\t} catch {\n\t\treturn { minimumFractionDigits: 2, maximumFractionDigits: 2 };\n\t}\n}\n\nfunction replaceCurrencyPart(\n\tformatter: Intl.NumberFormat,\n\tvalue: number,\n\tsymbol: string,\n) {\n\treturn formatter\n\t\t.formatToParts(value)\n\t\t.map((part) => part.type === 'currency' ? symbol : part.type === 'minusSign' ? part.value.replace('-', MINUS_SIGN) : part.value)\n\t\t.join('');\n}\n\nexport function formatMoneyAmount({\n\tamount,\n\tcurrency,\n\tlocale,\n\tcurrencyDisplay = 'symbol',\n\tminimumFractionDigits,\n\tmaximumFractionDigits,\n\tformatMode,\n\tsymbol,\n}: FormatMoneyAmountOptions) {\n\tconst value = parseMoneyAmount(amount);\n\tif (value === null) return null;\n\n\tconst resolvedCurrency = currency ?? '';\n\tconst numberOptions: Intl.NumberFormatOptions = resolveFractionDigits(\n\t\tminimumFractionDigits,\n\t\tmaximumFractionDigits,\n\t\tresolveCurrencyFractionDigits(resolvedCurrency, locale),\n\t);\n\n\tif (formatMode === 'decimal' || !resolvedCurrency) {\n\t\treturn formatWithMinusSign(new Intl.NumberFormat(locale, numberOptions), value);\n\t}\n\n\tif (formatMode === 'with_code') {\n\t\treturn `${formatWithMinusSign(new Intl.NumberFormat(locale, numberOptions), value)} ${resolvedCurrency}`.trim();\n\t}\n\n\ttry {\n\t\tconst formatter = new Intl.NumberFormat(locale, {\n\t\t\t...numberOptions,\n\t\t\tstyle: 'currency',\n\t\t\tcurrency: resolvedCurrency,\n\t\t\tcurrencyDisplay,\n\t\t});\n\t\treturn symbol\n\t\t\t? replaceCurrencyPart(formatter, value, symbol)\n\t\t\t: formatWithMinusSign(formatter, value);\n\t} catch {\n\t\tconst formattedNumber = formatWithMinusSign(new Intl.NumberFormat(locale, numberOptions), value);\n\t\treturn symbol\n\t\t\t? `${symbol}${formattedNumber}`\n\t\t\t: `${formattedNumber} ${resolvedCurrency}`.trim();\n\t}\n}\n","import { useCallback, type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY } from '../../lib/format';\nimport { formatMoneyAmount, parseMoneyAmount } from '../../lib/money-format';\nimport {\n\tuseFormattingConfig,\n\tuseMoneyConfig,\n\ttype MoneyDisplayMode,\n\ttype MoneyFormatMode,\n} from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n\nexport type MoneyUnit = 'major' | 'minor';\nexport type MoneyLayout = 'inline' | 'stacked';\nexport type MoneySecondaryEmphasis = 'discrete' | 'muted' | 'match' | 'hidden';\n\n/** A secondary monetary value rendered by the canonical `<Money>` primitive. */\nexport interface MoneyValue {\n\t/** Numeric amount or an unformatted decimal string. */\n\tamount?: number | string | null;\n\t/** ISO 4217 currency code. Falls back to `UIProvider.money.defaultCurrency`. */\n\tcurrency?: string | null;\n\t/** Unit of the incoming amount. `minor` converts cents/pence before formatting. */\n\tunit?: MoneyUnit;\n\t/** Number of minor units in one major unit. Defaults to 100. */\n\tminorUnitScale?: number;\n\t/** Optional consumer-resolved symbol. Intl placement is preserved. */\n\tsymbol?: string | null;\n\t/** Intl currency label style when the resolved format mode uses currency formatting. */\n\tcurrencyDisplay?: Intl.NumberFormatOptions['currencyDisplay'];\n\t/** Minimum decimal digits. Defaults to the currency's Intl convention. */\n\tminimumFractionDigits?: number;\n\t/** Maximum decimal digits. Defaults to the currency's Intl convention. */\n\tmaximumFractionDigits?: number;\n\t/** Per-value override for the UIProvider money format policy. */\n\tformatMode?: MoneyFormatMode;\n}\n\nexport interface MoneyProps extends SpanProps, MoneyValue {\n\t/** Ref to the semantic root selected by `tag`. */\n\tref?: Ref<HTMLElement>;\n\t/** BCP-47 locale override. Falls back to `UIProvider.formatting.locale`. */\n\tlocale?: string;\n\t/** Content rendered, with the shared empty treatment, when the amount is absent or cannot be parsed. */\n\temptyLabel?: ReactNode;\n\t/**\n\t * Typography size for the primary value (and a `match` secondary). Defaults to\n\t * the provider text size; inside running text, the surrounding size.\n\t */\n\tsize?: TextSize;\n\t/** Inline text alignment. Defaults to right alignment for numeric scanning. */\n\talign?: TextProps['align'];\n\t/** Weight of the primary value. Defaults to `medium`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\t/** Semantic root element used by the typography primitive. */\n\ttag?: TextProps['tag'];\n\t/** Line-height preset applied to the root value. Defaults to `normal`; inside running text, the surrounding leading. */\n\tlineHeight?: TextProps['lineHeight'];\n\t/**\n\t * Opt-in monospace figures. Amounts already render in the sans UI font with\n\t * tabular figures; reserve this for code-like ledgers. Defaults to `false`.\n\t */\n\tnumeric?: TextProps['numeric'];\n\t/**\n\t * Optional converted/display value. Passing it is an explicit request to\n\t * render both values unless `displayMode=\"default_only\"` or\n\t * `secondaryEmphasis=\"hidden\"` is set.\n\t */\n\tsecondary?: MoneyValue | null;\n\t/**\n\t * Controls whether the secondary value is visible. `dynamic` shows it only\n\t * when the two currency codes differ. When omitted, an explicitly supplied\n\t * `secondary` renders; an enabled UIProvider money policy can narrow it.\n\t */\n\tdisplayMode?: MoneyDisplayMode;\n\t/** Pair layout. Falls back to the UIProvider `dualPricingDisplay` policy. */\n\tlayout?: MoneyLayout;\n\t/** Visual prominence of a secondary value. */\n\tsecondaryEmphasis?: MoneySecondaryEmphasis;\n\t/** Inline separator. Defaults to a quiet middle dot; pass an arrow for conversion flows. */\n\tseparator?: ReactNode;\n}\n\nfunction normalizeMinorUnitScale(value: number | undefined) {\n\tif (value === undefined || !Number.isFinite(value) || value <= 0) return 100;\n\treturn value;\n}\n\nfunction resolveMajorAmount(value: MoneyValue): number | null {\n\tconst parsed = parseMoneyAmount(value.amount);\n\tif (parsed === null) return null;\n\treturn value.unit === 'minor'\n\t\t? parsed / normalizeMinorUnitScale(value.minorUnitScale)\n\t\t: parsed;\n}\n\n/** Options for formatting money as text; they mirror the Money primitive's value props. */\nexport type MoneyFormatterOptions = Omit<MoneyValue, 'amount'> & {\n\t/** BCP-47 locale override. Falls back to `UIProvider.formatting.locale`. */\n\tlocale?: string;\n\t/** Text returned when the amount is absent or cannot be parsed. */\n\temptyLabel?: string;\n};\n\n/** Formats an amount as text; per-call options win over the hook's defaults. */\nexport type MoneyFormatter = (amount: MoneyValue['amount'], options?: MoneyFormatterOptions) => string;\n\n/**\n * Text formatting with the Money primitive's rules and UIProvider defaults, for\n * places that need a string: button labels, toasts, activity text, aria labels.\n * Pass defaults such as `{ currency: 'USD' }` once for a screen whose amounts\n * share a currency.\n */\nexport function useMoneyFormatter(defaults: MoneyFormatterOptions = {}): MoneyFormatter {\n\tconst formatting = useFormattingConfig();\n\tconst money = useMoneyConfig();\n\tconst {\n\t\tcurrency, unit, minorUnitScale, symbol, locale, currencyDisplay,\n\t\tminimumFractionDigits, maximumFractionDigits, formatMode, emptyLabel,\n\t} = defaults;\n\treturn useCallback<MoneyFormatter>((amount, overrides = {}) => {\n\t\tconst options: MoneyFormatterOptions = {\n\t\t\tcurrency, unit, minorUnitScale, symbol, locale, currencyDisplay,\n\t\t\tminimumFractionDigits, maximumFractionDigits, formatMode, emptyLabel,\n\t\t\t...overrides,\n\t\t};\n\t\tconst resolvedEmptyLabel = options.emptyLabel ?? EMPTY;\n\t\tconst major = resolveMajorAmount({ amount, unit: options.unit, minorUnitScale: options.minorUnitScale });\n\t\tif (major === null) return resolvedEmptyLabel;\n\t\treturn formatMoneyAmount({\n\t\t\tamount: major,\n\t\t\tcurrency: options.currency ?? money.defaultCurrency ?? 'USD',\n\t\t\tsymbol: options.symbol,\n\t\t\tlocale: options.locale ?? formatting.locale,\n\t\t\tcurrencyDisplay: options.currencyDisplay,\n\t\t\tminimumFractionDigits: options.minimumFractionDigits,\n\t\t\tmaximumFractionDigits: options.maximumFractionDigits,\n\t\t\tformatMode: options.formatMode ?? money.formatMode ?? 'with_code',\n\t\t}) ?? resolvedEmptyLabel;\n\t}, [\n\t\tcurrency, unit, minorUnitScale, symbol, locale, currencyDisplay,\n\t\tminimumFractionDigits, maximumFractionDigits, formatMode, emptyLabel,\n\t\tformatting.locale, money.defaultCurrency, money.formatMode,\n\t]);\n}\n\n/** Standalone amounts read as foreground medium; in a sentence they take its typography. */\nconst MONEY_ROLE: ValueTypographyRole = { type: 'main', weight: 'medium' };\n\n/** Logical alignment: `left`/`right` follow the reading direction, like `Text`. */\nfunction getAlignmentClasses(align: TextProps['align']) {\n\tif (align === 'left') return { text: 'text-start', justify: 'justify-start' };\n\tif (align === 'center') return { text: 'text-center', justify: 'justify-center' };\n\treturn { text: 'text-end', justify: 'justify-end' };\n}\n\n/**\n * Canonical monetary display primitive.\n *\n * It owns major/minor-unit conversion, locale-aware formatting, empty values,\n * and optional inline/stacked dual-currency display. Consumers should use\n * this component instead of composing separate money-display or currency-pair\n * wrappers.\n */\nexport function Money({\n\tamount,\n\tcurrency,\n\tunit = 'major',\n\tminorUnitScale,\n\tsymbol,\n\tlocale,\n\tcurrencyDisplay,\n\tminimumFractionDigits,\n\tmaximumFractionDigits,\n\tformatMode,\n\temptyLabel = EMPTY,\n\tsize: sizeProp,\n\talign = 'right',\n\tweight: weightProp,\n\ttype: typeProp,\n\ttag = 'span',\n\tlineHeight: lineHeightProp,\n\tnumeric,\n\tsecondary,\n\tdisplayMode,\n\tlayout,\n\tsecondaryEmphasis = 'discrete',\n\tseparator = '·',\n\tclassName,\n\tref,\n\t...props\n}: MoneyProps) {\n\tconst formatting = useFormattingConfig();\n\tconst money = useMoneyConfig();\n\tconst typography = useValueTypography(\n\t\t{ size: sizeProp, type: typeProp, weight: weightProp, lineHeight: lineHeightProp },\n\t\tMONEY_ROLE,\n\t);\n\tconst { size, type, weight, lineHeight } = typography;\n\tconst resolvedCurrency = currency ?? money.defaultCurrency ?? 'USD';\n\tconst primaryAmount = resolveMajorAmount({ amount, unit, minorUnitScale });\n\tconst primaryLabel = primaryAmount === null\n\t\t? null\n\t\t: formatMoneyAmount({\n\t\t\t\tamount: primaryAmount,\n\t\t\t\tcurrency: resolvedCurrency,\n\t\t\t\tsymbol,\n\t\t\t\tlocale: locale ?? formatting.locale,\n\t\t\t\tcurrencyDisplay,\n\t\t\t\tminimumFractionDigits,\n\t\t\t\tmaximumFractionDigits,\n\t\t\t\tformatMode: formatMode ?? money.formatMode ?? 'with_code',\n\t\t\t});\n\n\tif (primaryLabel === null) {\n\t\tconst empty = emptyValueTypography(typography, weightProp);\n\t\treturn (\n\t\t\t<Text\n\t\t\t\tref={ref}\n\t\t\t\ttag={tag}\n\t\t\t\tsize={empty.size}\n\t\t\t\talign={align}\n\t\t\t\tweight={empty.weight}\n\t\t\t\ttype={empty.type}\n\t\t\t\tlineHeight={empty.lineHeight}\n\t\t\t\tnumeric={numeric}\n\t\t\t\tclassName={cn('money--component inline tabular-nums', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{emptyLabel}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\tconst secondaryAmount = secondary ? resolveMajorAmount(secondary) : null;\n\tconst resolvedSecondaryCurrency = secondary?.currency ?? money.displayCurrency ?? resolvedCurrency;\n\tconst resolvedDisplayMode = displayMode\n\t\t?? (money.dualPricingEnabled ? money.displayMode : undefined)\n\t\t?? 'dual';\n\tconst hasDifferentCurrencies = resolvedSecondaryCurrency !== resolvedCurrency;\n\tconst shouldRenderSecondary = secondaryAmount !== null\n\t\t&& secondaryEmphasis !== 'hidden'\n\t\t&& resolvedDisplayMode !== 'default_only'\n\t\t&& (resolvedDisplayMode !== 'dynamic' || hasDifferentCurrencies);\n\n\tif (!shouldRenderSecondary || !secondary) {\n\t\treturn (\n\t\t\t<Text\n\t\t\t\tref={ref}\n\t\t\t\ttag={tag}\n\t\t\t\tsize={size}\n\t\t\t\talign={align}\n\t\t\t\tweight={weight}\n\t\t\t\ttype={type}\n\t\t\t\tlineHeight={lineHeight}\n\t\t\t\tnumeric={numeric}\n\t\t\t\tclassName={cn('money--component inline whitespace-nowrap tabular-nums', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{primaryLabel}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\tconst secondaryLabel = formatMoneyAmount({\n\t\tamount: secondaryAmount,\n\t\tcurrency: resolvedSecondaryCurrency,\n\t\tsymbol: secondary.symbol,\n\t\tlocale: locale ?? formatting.locale,\n\t\tcurrencyDisplay: secondary.currencyDisplay ?? currencyDisplay,\n\t\tminimumFractionDigits: secondary.minimumFractionDigits ?? minimumFractionDigits,\n\t\tmaximumFractionDigits: secondary.maximumFractionDigits ?? maximumFractionDigits,\n\t\tformatMode: secondary.formatMode ?? formatMode ?? money.formatMode ?? 'with_code',\n\t});\n\tconst resolvedLayout: MoneyLayout = layout\n\t\t?? (money.dualPricingDisplay === 'inline' ? 'inline' : 'stacked');\n\tconst secondarySize: TextSize | undefined = secondaryEmphasis === 'match'\n\t\t? size\n\t\t: secondaryEmphasis === 'muted'\n\t\t\t? 'xs'\n\t\t\t: 'xxs';\n\tconst secondaryType: TextProps['type'] = secondaryEmphasis === 'match'\n\t\t? type\n\t\t: secondaryEmphasis === 'muted'\n\t\t\t? 'secondary'\n\t\t\t: 'discrete';\n\tconst secondaryWeight: TextProps['weight'] = secondaryEmphasis === 'match' ? weight : 'regular';\n\tconst alignment = getAlignmentClasses(align);\n\n\tif (resolvedLayout === 'inline') {\n\t\treturn (\n\t\t\t<Text\n\t\t\t\tref={ref}\n\t\t\t\ttag={tag}\n\t\t\t\tsize={size}\n\t\t\t\talign={align}\n\t\t\t\ttype={type}\n\t\t\t\tweight={weight === 'inherit' ? 'inherit' : undefined}\n\t\t\t\tlineHeight={lineHeight}\n\t\t\t\tnumeric={numeric}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'money--component money--inline inline-flex items-baseline gap-space-xs whitespace-nowrap tabular-nums',\n\t\t\t\t\talignment.justify,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<Text tag=\"span\" size={size} weight={weight} type={type} lineHeight={lineHeight} numeric={numeric} className=\"money--primary\">\n\t\t\t\t\t{primaryLabel}\n\t\t\t\t</Text>\n\t\t\t\t<span className=\"money--separator inline-flex shrink-0 items-center text-muted-foreground\" aria-hidden=\"true\">\n\t\t\t\t\t{separator}\n\t\t\t\t</span>\n\t\t\t\t<Text tag=\"span\" size={secondarySize} weight={secondaryWeight} type={secondaryType} lineHeight={lineHeight} numeric={numeric} className=\"money--secondary\">\n\t\t\t\t\t{secondaryLabel}\n\t\t\t\t</Text>\n\t\t\t</Text>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag={tag}\n\t\t\tsize={size}\n\t\t\talign={align}\n\t\t\ttype={type}\n\t\t\tweight={weight === 'inherit' ? 'inherit' : undefined}\n\t\t\tlineHeight=\"tight\"\n\t\t\tnumeric={numeric}\n\t\t\tclassName={cn(\n\t\t\t\t'money--component money--stacked inline-flex flex-col whitespace-nowrap tabular-nums',\n\t\t\t\talignment.text,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Text tag=\"span\" size={size} align={align} weight={weight} type={type} lineHeight=\"tight\" numeric={numeric} className=\"money--primary\">\n\t\t\t\t{primaryLabel}\n\t\t\t</Text>\n\t\t\t<Text tag=\"span\" size={secondarySize} align={align} weight={secondaryWeight} type={secondaryType} lineHeight=\"tight\" numeric={numeric} className=\"money--secondary\">\n\t\t\t\t{secondaryLabel}\n\t\t\t</Text>\n\t\t</Text>\n\t);\n}\n","import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from 'react';\n\nimport { Text, type TextProps } from '../typography';\nimport type { TextSize } from '../../lib/ui-provider';\nimport { EMPTY, formatWithMinusSign } from '../../lib/format';\nimport { useFormattingConfig } from '../../lib/ui-provider';\nimport { cn } from '../../lib/utils';\n\nimport { emptyValueTypography, useValueTypography, type ValueTypographyRole } from './value-typography';\n\ntype SpanProps = Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'color'>;\n\nexport interface NumberProps extends SpanProps {\n\tvalue?: number | string | null;\n\t/** BCP-47 locale override. Falls back to `UIProvider.formatting.locale`. */\n\tlocale?: string;\n\t/** Passed to `Intl.NumberFormat`; for example `signDisplay: 'exceptZero'` for deltas. */\n\toptions?: Intl.NumberFormatOptions;\n\t/** Rendered with the shared empty treatment when the value is absent or unparsable. Defaults to an em dash. */\n\temptyLabel?: ReactNode;\n\t/** Text size. Defaults to the provider text size; inside running text, the surrounding size. */\n\tsize?: TextSize;\n\t/** Text alignment. Defaults to `right` so columns of figures line up. */\n\talign?: TextProps['align'];\n\t/** Font weight. Defaults to `regular`; inside running text, the surrounding weight. */\n\tweight?: TextProps['weight'];\n\t/** Colour role. Defaults to `main`; inside running text, the surrounding colour. */\n\ttype?: TextProps['type'];\n\t/** Line height. Defaults to the role leading; inside running text, the surrounding leading. */\n\tlineHeight?: TextProps['lineHeight'];\n\tref?: Ref<HTMLSpanElement>;\n}\n\nexport interface PercentProps extends Omit<NumberProps, 'options'> {\n\t/** The value is already 0–100 rather than a 0–1 ratio. Defaults to `false`. */\n\tscaled?: boolean;\n\t/** Passed to `Intl.NumberFormat` after the percent style and one-decimal default. */\n\toptions?: Intl.NumberFormatOptions;\n\tref?: Ref<HTMLSpanElement>;\n}\n\nconst NUMBER_ROLE: ValueTypographyRole = { type: 'main', weight: 'regular' };\n\nfunction parseNumericValue(value: NumberProps['value']) {\n\tif (value === null || value === undefined || value === '') return null;\n\tconst parsed = typeof value === 'number' ? value : globalThis.Number.parseFloat(value);\n\treturn globalThis.Number.isFinite(parsed) ? parsed : null;\n}\n\nfunction renderNumberLabel(value: NumberProps['value'], locale?: string, options?: Intl.NumberFormatOptions) {\n\tconst parsed = parseNumericValue(value);\n\tif (parsed === null) return null;\n\treturn formatWithMinusSign(new Intl.NumberFormat(locale, options), parsed);\n}\n\n/**\n * A locale-formatted count or quantity in the sans UI font with tabular figures.\n * Negative values use the typographic minus sign (U+2212).\n */\nexport function Number({\n\tvalue,\n\tlocale,\n\toptions,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tlineHeight,\n\tclassName,\n\tref,\n\t...props\n}: NumberProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight, lineHeight }, NUMBER_ROLE);\n\tconst label = renderNumberLabel(value, locale ?? formatting.locale, options);\n\tconst typography = label === null ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('number--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label ?? emptyLabel}\n\t\t</Text>\n\t);\n}\n\n/**\n * A percentage in the sans UI font with tabular figures. Expects a 0–1 ratio\n * unless `scaled`; one decimal place by default; negative values use U+2212.\n */\nexport function Percent({\n\tvalue,\n\tlocale,\n\tscaled = false,\n\toptions,\n\temptyLabel = EMPTY,\n\tsize,\n\talign = 'right',\n\tweight,\n\ttype,\n\tlineHeight,\n\tclassName,\n\tref,\n\t...props\n}: PercentProps) {\n\tconst formatting = useFormattingConfig();\n\tconst resolved = useValueTypography({ size, type, weight, lineHeight }, NUMBER_ROLE);\n\tconst parsed = parseNumericValue(value);\n\tconst label = parsed === null\n\t\t? null\n\t\t: formatWithMinusSign(new Intl.NumberFormat(locale ?? formatting.locale, {\n\t\t\t\tstyle: 'percent',\n\t\t\t\tmaximumFractionDigits: 1,\n\t\t\t\t...options,\n\t\t\t}), scaled ? parsed / 100 : parsed);\n\tconst typography = label === null ? emptyValueTypography(resolved, weight) : resolved;\n\n\treturn (\n\t\t<Text\n\t\t\tref={ref}\n\t\t\ttag=\"span\"\n\t\t\tsize={typography.size}\n\t\t\talign={align}\n\t\t\tweight={typography.weight}\n\t\t\ttype={typography.type}\n\t\t\tlineHeight={typography.lineHeight}\n\t\t\tclassName={cn('percent--component inline tabular-nums', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label ?? emptyLabel}\n\t\t</Text>\n\t);\n}\n"],"mappings":";;;;;;;;AAgCA,SAASQ,EAAuB,GAAe;CAC9C,IAAMC,IAAUC,EAAM,KAAK;CAC3B,IAAI,CAACD,GAAS,OAAO;CAErB,IAAME,IAAQF,EAAQ,YAAY,GAAG,GAC/BG,IAAMH,EAAQ,YAAY,GAAG;CAEnC,IAAIE,KAAS,KAAKC,KAAO,GAAG;EAC3B,IAAMC,IAAmBF,IAAQC,IAAM,MAAM,KACvCE,IAAoBD,MAAqB,MAAM,MAAM;EAC3D,OAAOJ,EACL,QAAY,OAAO,KAAKK,KAAqB,GAAG,GAAG,EAAE,CAAC,CACtD,QAAQD,GAAkB,GAAG;CAChC;CAEA,IAAIF,KAAS,GAAG;EACf,IAAM,CAACI,GAAMC,IAAO,MAAMP,EAAQ,MAAM,GAAG;EAE3C,OADIO,EAAK,SAAS,KAAKA,EAAK,UAAU,IAAU,GAAGD,EAAK,QAAQ,MAAM,EAAE,E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