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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header-commands-7P3sfE9u.js","names":["_Fragment","resolveComponentScale","useThemeScopeHost","useDensityConfig","cn","Button","focusRecipes","compositionClasses","ActionMenu","Fragment$1","defaultPageHeaderLinkRenderer","props","target","external","rel","INLINE_COMMAND_CLASS","COMPACT_MENU_CLASS","MENU_CONTENT_CLASS","isVisible","action","isVisibleControl","style","node","hasPageHeaderCommands","primaryAction","secondaryActions","presentation","role","linkDestination","CommandButton","href","Icon","hookClassName","className","renderLink","buttonVariants","defaultScale","toMenuAction","key","PageHeaderCommands","menuOpen","setMenuOpen","useState","resizeFocus","useRef","ownedFocus","finalFocus","useCallback","captureFocus","event","captureBlur","next","host","root","header","view","inlineCommand","inlineVisible","recoverFocus","nextInlineVisible","active","droppedHiddenFocus","candidates","observer","context","maxVisibleSecondaryActions","secondary","index","routine","destructive","inlineLimit","inline","overflow","primary","primaryEntry","destructiveMenuEntries","entry","menuActions","compactMenuOnly","ThemeScopeHostProvider","attachHost","nextOpen","moreActionsLabel"],"sources":["../src/components/base/navigation/page-header/page-header-commands.tsx"],"sourcesContent":["/**\n * PageHeaderCommands — role-based commands for page and record headers.\n *\n * The role chooses each command's treatment and place: outline secondary\n * commands, then one solid primary command, then the More actions menu for\n * overflow and destructive commands, which always closes the row. Below the\n * named header container breakpoint, every command collapses into that menu\n * through CSS alone, so server and client markup agree. Both page and section\n * headers use this owner for the same command behavior.\n */\nimport { useCallback, useEffect, useRef, useState, type ComponentType, type FocusEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport {\n\tActionMenu,\n\ttype ActionMenuAction,\n\ttype ActionMenuLinkRenderProps,\n} from '../../action-menu';\nimport { Button } from '../../buttons';\nimport { buttonVariants } from '../../buttons/button.variants';\nimport {compositionClasses} from '../../structure/composition.recipes';\nimport { resolveComponentScale, useDensityConfig } from '../../../../lib/ui-provider';\nimport { cn } from '../../../../lib/utils';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\nimport { ThemeScopeHostProvider, useThemeScopeHost } from '../../../../lib/theme-scope';\n\n/**\n * A page command described by its role. `primaryAction` and `secondaryActions`\n * choose the treatment, so a command carries no tone or button style.\n */\nexport interface PageHeaderAction {\n\t/** Stable key. Defaults to the command's position. */\n\tid?: string;\n\t/** Visible command text. */\n\tlabel: ReactNode;\n\t/** Runs the command. When both are set, `onClick` wins over `href`. */\n\tonClick?: () => void;\n\t/** Navigates through the header's `renderLink` instead of running a callback. */\n\thref?: string;\n\ttarget?: string;\n\trel?: string;\n\t/** Marks the destination as leaving the app; forwarded to `renderLink`. */\n\texternal?: boolean;\n\t/** Leading glyph. Pass a Lucide icon component. */\n\ticon?: ComponentType<{ className?: string }>;\n\t/** Shows the pending indicator and blocks activation. */\n\tloading?: boolean;\n\t/** Blocks activation while keeping the command visible. */\n\tdisabled?: boolean;\n\t/** Set false to omit the command, for example without permission. */\n\tvisible?: boolean;\n\t/**\n\t * Irreversible or harmful command. A destructive secondary command moves to\n\t * the More actions menu; a destructive primary command keeps its place with\n\t * the destructive treatment. Confirm it from the handler, e.g. ConfirmDialog.\n\t */\n\tdestructive?: boolean;\n}\n\n/** What a header hands its link renderer for an `href` command. */\nexport interface PageHeaderLinkRenderProps {\n\thref: string;\n\tchildren: ReactNode;\n\tclassName?: string;\n\ttarget?: string;\n\trel?: string;\n\t/** Marks the destination as leaving the app. */\n\texternal?: boolean;\n\tonClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t'aria-label'?: string;\n}\n\n/** Renders framework links for `href` commands. Layout `renderLink` functions fit. */\nexport type PageHeaderLinkRenderer = (props: PageHeaderLinkRenderProps) => ReactNode;\n\n/** Native anchor fallback, matching the layout default: external links open a new tab. */\nexport const defaultPageHeaderLinkRenderer: PageHeaderLinkRenderer = ({ href, external, target, rel, children, ...props }) => (\n\t<a\n\t\thref={href}\n\t\ttarget={target ?? (external ? '_blank' : undefined)}\n\t\trel={rel ?? (external ? 'noopener noreferrer' : undefined)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</a>\n);\n\n/** Secondary commands rendered as buttons on wide headers; later ones overflow. */\nexport const PAGE_HEADER_INLINE_SECONDARY_LIMIT = 2;\n\nconst INLINE_COMMAND_CLASS = '@max-[40rem]/page-header:hidden';\nconst COMPACT_MENU_CLASS = '@min-[40rem]/page-header:hidden';\nconst MENU_CONTENT_CLASS = 'max-h-[80vh] overflow-y-auto overscroll-contain';\n\ntype CommandRole = 'primary' | 'secondary';\n\ninterface CommandEntry {\n\taction: PageHeaderAction;\n\tkey: string;\n}\n\nexport interface PageHeaderCommandsProps {\n\tprimaryAction?: PageHeaderAction;\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. */\n\tmoreActionsLabel: string;\n\trenderLink?: PageHeaderLinkRenderer;\n}\n\nfunction isVisible(action: PageHeaderAction | undefined): action is PageHeaderAction {\n\treturn !!action && action.visible !== false;\n}\n\nfunction isVisibleControl(node: HTMLElement) {\n\tconst style = node.ownerDocument.defaultView?.getComputedStyle(node);\n\treturn !!style && style.display !== 'none' && style.visibility !== 'hidden' && !node.closest('[hidden],[inert]');\n}\n\n/** Whether the header has any role-based command to render. */\nexport function hasPageHeaderCommands(\n\tprimaryAction: PageHeaderAction | undefined,\n\tsecondaryActions: readonly PageHeaderAction[] | undefined,\n) {\n\treturn isVisible(primaryAction) || (secondaryActions ?? []).some(isVisible);\n}\n\nfunction presentation(action: PageHeaderAction, role: CommandRole) {\n\tif (role === 'secondary') return { tone: 'secondary', buttonStyle: 'outline' } as const;\n\treturn { tone: action.destructive ? 'destructive' : 'primary', buttonStyle: 'solid' } as const;\n}\n\n/** `onClick` wins over `href`, matching PageAction. */\nfunction linkDestination(action: PageHeaderAction) {\n\treturn action.href && !action.onClick ? action.href : undefined;\n}\n\nfunction CommandButton({\n\taction,\n\trole,\n\trenderLink,\n\tclassName,\n}: {\n\taction: PageHeaderAction;\n\trole: CommandRole;\n\trenderLink: PageHeaderLinkRenderer;\n\tclassName?: string;\n}) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst { tone, buttonStyle } = presentation(action, role);\n\tconst href = linkDestination(action);\n\tconst Icon = action.icon;\n\tconst hookClassName = cn(`page-header--${role}-action`, className);\n\n\tif (href && !action.disabled && !action.loading) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{renderLink({\n\t\t\t\t\thref,\n\t\t\t\t\ttarget: action.target,\n\t\t\t\t\trel: action.rel,\n\t\t\t\t\texternal: action.external,\n\t\t\t\t\tclassName: cn(\n\t\t\t\t\t\t'button--component base-button--component',\n\t\t\t\t\t\tbuttonVariants({ tone, buttonStyle, size: resolveComponentScale(undefined, defaultScale) }),\n\t\t\t\t\t\thookClassName,\n\t\t\t\t\t),\n\t\t\t\t\tchildren: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{Icon && <Icon className=\"size-icon shrink-0\" aria-hidden=\"true\" />}\n\t\t\t\t\t\t\t{action.label}\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t})}\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ttype=\"button\"\n\t\t\ttone={tone}\n\t\t\tbuttonStyle={buttonStyle}\n\t\t\ticon={Icon}\n\t\t\tloading={action.loading}\n\t\t\thandlesLoading={action.loading !== undefined}\n\t\t\tdisabled={action.disabled}\n\t\t\tonClick={action.onClick}\n\t\t\tclassName={hookClassName}\n\t\t>\n\t\t\t{action.label}\n\t\t</Button>\n\t);\n}\n\nfunction toMenuAction({ action, key }: CommandEntry, className?: string): ActionMenuAction {\n\treturn {\n\t\tid: key,\n\t\tlabel: action.label,\n\t\ticon: action.icon,\n\t\tonClick: action.onClick,\n\t\thref: linkDestination(action),\n\t\ttarget: action.target,\n\t\trel: action.rel,\n\t\texternal: action.external,\n\t\tdisabled: !!action.disabled || !!action.loading,\n\t\ttone: action.destructive ? 'destructive' : 'secondary',\n\t\tclassName,\n\t};\n}\n\nexport function PageHeaderCommands({\n\tprimaryAction,\n\tsecondaryActions,\n\tmaxVisibleSecondaryActions,\n\tmoreActionsLabel,\n\trenderLink = defaultPageHeaderLinkRenderer,\n}: PageHeaderCommandsProps) {\n\t// Keep the popup inside its header container so responsive menu entries and\n\t// CSS theme inheritance follow the same boundary as the inline commands.\n\tconst { host, attachHost, context } = useThemeScopeHost<HTMLDivElement>();\n\tconst [menuOpen, setMenuOpen] = useState(false);\n\tconst resizeFocus = useRef<HTMLElement | null>(null);\n\tconst ownedFocus = useRef<HTMLElement | null>(null);\n\tconst finalFocus = useCallback(() => resizeFocus.current ?? true, []);\n\tconst captureFocus = useCallback((event: FocusEvent<HTMLDivElement>) => {\n\t\tif (event.target instanceof HTMLElement) ownedFocus.current = event.target;\n\t}, []);\n\tconst captureBlur = useCallback((event: FocusEvent<HTMLDivElement>) => {\n\t\tconst next = event.relatedTarget;\n\t\tif (next instanceof Node && host.current?.contains(next)) return;\n\t\tconst target = event.target;\n\t\tconst hiddenBlur = target instanceof HTMLElement && target === ownedFocus.current && !isVisibleControl(target)\n\t\t\t&& (next == null || next instanceof HTMLElement && !isVisibleControl(next));\n\t\tif (!hiddenBlur) ownedFocus.current = null;\n\t}, [host]);\n\tuseEffect(() => {\n\t\tconst root = host.current;\n\t\tconst header = root?.closest('.page-header--component');\n\t\tconst view = root?.ownerDocument.defaultView;\n\t\tif (!root || !header || !view) return;\n\t\tconst inlineCommand = root.querySelector<HTMLElement>('.page-header--primary-action,.page-header--secondary-action');\n\t\tif (!inlineCommand) return;\n\t\tlet inlineVisible = isVisibleControl(inlineCommand);\n\t\tconst recoverFocus = () => {\n\t\t\tconst nextInlineVisible = isVisibleControl(inlineCommand);\n\t\t\tif (nextInlineVisible === inlineVisible) return;\n\t\t\tinlineVisible = nextInlineVisible;\n\t\t\tconst active = root.ownerDocument.activeElement;\n\t\t\tconst droppedHiddenFocus = active === root.ownerDocument.body && ownedFocus.current\n\t\t\t\t&& root.contains(ownedFocus.current) && !isVisibleControl(ownedFocus.current);\n\t\t\tif (!active || !root.contains(active) && !droppedHiddenFocus) {\n\t\t\t\townedFocus.current = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// CSS owns the breakpoint. Only react when its actual presentation\n\t\t\t// changes, keeping focus out of a newly hidden row or trigger.\n\t\t\tconst candidates = root.querySelectorAll<HTMLElement>('.page-header--more-actions,.page-header--primary-action,.page-header--secondary-action');\n\t\t\tconst target = [...candidates].find(node => node.matches('.page-header--more-actions') && isVisibleControl(node) && !node.matches(':disabled,[aria-disabled=\"true\"],[data-disabled]'))\n\t\t\t\t?? [...candidates].find(node => isVisibleControl(node) && !node.matches(':disabled,[aria-disabled=\"true\"],[data-disabled]'))\n\t\t\t\t?? root;\n\t\t\tresizeFocus.current = target;\n\t\t\tif (menuOpen) setMenuOpen(false);\n\t\t\ttarget.focus({ preventScroll: true });\n\t\t};\n\t\tconst observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(recoverFocus);\n\t\tobserver?.observe(header);\n\t\tview.addEventListener('resize', recoverFocus);\n\t\treturn () => {\n\t\t\tobserver?.disconnect();\n\t\t\tview.removeEventListener('resize', recoverFocus);\n\t\t};\n\t}, [context.mounted, host, maxVisibleSecondaryActions, menuOpen, primaryAction, secondaryActions]);\n\tconst secondary: CommandEntry[] = (secondaryActions ?? [])\n\t\t.map((action, index) => ({ action, key: action.id ?? `secondary-${index}` }))\n\t\t.filter(({ action }) => isVisible(action));\n\tconst routine = secondary.filter(({ action }) => !action.destructive);\n\tconst destructive = secondary.filter(({ action }) => action.destructive);\n\t// `Infinity` keeps every routine command inline; NaN keeps the default.\n\tconst inlineLimit = maxVisibleSecondaryActions === undefined || Number.isNaN(maxVisibleSecondaryActions)\n\t\t? PAGE_HEADER_INLINE_SECONDARY_LIMIT\n\t\t: Math.max(0, Math.floor(maxVisibleSecondaryActions));\n\tconst inline = routine.slice(0, inlineLimit);\n\tconst overflow = routine.slice(inlineLimit);\n\tconst primary = isVisible(primaryAction) ? primaryAction : undefined;\n\n\tif (!primary && secondary.length === 0) return null;\n\n\tconst primaryEntry = primary ? { action: primary, key: `primary-${primary.id ?? 'action'}` } : undefined;\n\tconst destructiveMenuEntries = [\n\t\t...(primaryEntry && primary?.destructive ? [{ ...primaryEntry, className: COMPACT_MENU_CLASS }] : []),\n\t\t...destructive.map(entry => ({ ...entry, className: undefined })),\n\t];\n\t// Compact entries share one menu with permanent overflow. The primary leads\n\t// routine commands; destructive commands form the final group at any width.\n\tconst menuActions: ActionMenuAction[] = [\n\t\t...(primaryEntry && !primary?.destructive ? [toMenuAction(primaryEntry, COMPACT_MENU_CLASS)] : []),\n\t\t...inline.map(entry => toMenuAction(entry, COMPACT_MENU_CLASS)),\n\t\t...overflow.map(entry => toMenuAction(entry)),\n\t\t...destructiveMenuEntries.map(entry => ({\n\t\t\t...toMenuAction(entry, entry.className),\n\t\t\tgroup: true as const,\n\t\t\t// A boundary survives on wide headers only when both groups have a\n\t\t\t// permanent entry. Otherwise it follows the compact-only commands.\n\t\t\tgroupClassName: overflow.length > 0 && destructive.length > 0 ? undefined : COMPACT_MENU_CLASS,\n\t\t})),\n\t];\n\tconst compactMenuOnly = overflow.length === 0 && destructive.length === 0;\n\tconst renderMenuLink = (props: ActionMenuLinkRenderProps) =>\n\t\trenderLink({ ...props, children: props.children ?? null }) as ReactElement;\n\n\t// Secondary commands lead, the primary command follows them, and the More\n\t// actions menu closes the row. The trigger is one more secondary command:\n\t// outline, at the commands' own height.\n\treturn (\n\t\t<ThemeScopeHostProvider value={context}>\n\t\t\t<div\n\t\t\t\tref={attachHost}\n\t\t\t\tonFocusCapture={captureFocus}\n\t\t\t\tonBlurCapture={captureBlur}\n\t\t\t\ttabIndex={-1}\n\t\t\t\tdata-slot=\"page-header-commands\"\n\t\t\t\tclassName={cn('page-header--commands flex min-w-0 max-w-full flex-wrap items-center justify-end outline-none', compositionClasses.commands, focusRecipes.inset)}\n\t\t\t>\n\t\t\t\t{inline.map((entry) => (\n\t\t\t\t\t<CommandButton\n\t\t\t\t\t\tkey={entry.key}\n\t\t\t\t\t\taction={entry.action}\n\t\t\t\t\t\trole=\"secondary\"\n\t\t\t\t\t\trenderLink={renderLink}\n\t\t\t\t\t\tclassName={INLINE_COMMAND_CLASS}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t{primary && <CommandButton action={primary} role=\"primary\" renderLink={renderLink} className={INLINE_COMMAND_CLASS} />}\n\t\t\t\t{menuActions.length > 0 && (\n\t\t\t\t\t<ActionMenu\n\t\t\t\t\t\topen={menuOpen}\n\t\t\t\t\t\tonOpenChange={nextOpen => {\n\t\t\t\t\t\t\tif (nextOpen) resizeFocus.current = null;\n\t\t\t\t\t\t\tsetMenuOpen(nextOpen);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t// Only resizing owns an explicit target. The default close path\n\t\t\t\t\t\t// must respect focus already handed to a command's new overlay.\n\t\t\t\t\t\tfinalFocus={resizeFocus.current ? finalFocus : undefined}\n\t\t\t\t\t\tactions={menuActions}\n\t\t\t\t\t\tcontext=\"commands\"\n\t\t\t\t\t\tsrText={moreActionsLabel}\n\t\t\t\t\t\talign=\"end\"\n\t\t\t\t\t\tcloseOnSelect\n\t\t\t\t\t\tpreserveOrder\n\t\t\t\t\t\tcontentClassName={MENU_CONTENT_CLASS}\n\t\t\t\t\t\trenderLink={renderMenuLink}\n\t\t\t\t\t\t// The shared outline overflow square follows the provider scale, like the commands.\n\t\t\t\t\t\tbuttonProps={{ className: cn('page-header--more-actions', compactMenuOnly && COMPACT_MENU_CLASS) }}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</ThemeScopeHostProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;AA2EA,IAAaU,KAAyD,EAAE,SAAM,aAAU,WAAQ,QAAK,aAAU,GAAGC,QACjH,kBAAC,KAAD;CACO;CACN,QAAQC,MAAWC,IAAW,WAAW,KAAA;CACzC,KAAKC,MAAQD,IAAW,wBAAwB,KAAA;CAChD,GAAIF;CAEH;AACC,CAAA,GAMEI,IAAuB,mCACvBC,IAAqB,mCACrBC,IAAqB;AAwB3B,SAASC,EAAU,GAAkE;CACpF,OAAO,CAAC,CAACC,KAAUA,EAAO,YAAY;AACvC;AAEA,SAASC,EAAiB,GAAmB;CAC5C,IAAMC,IAAQC,EAAK,cAAc,aAAa,iBAAiBA,CAAI;CACnE,OAAO,CAAC,CAACD,KAASA,EAAM,YAAY,UAAUA,EAAM,eAAe,YAAY,CAACC,EAAK,QAAQ,kBAAkB;AAChH;AAGA,SAAgBC,EACf,GACA,GACC;CACD,OAAOL,EAAUM,CAAa,MAAMC,KAAoB,CAAC,EAAA,CAAG,KAAKP,CAAS;AAC3E;AAEA,SAASQ,EAAa,GAA0B,GAAmB;CAElE,OADIC,MAAS,cAAoB;EAAE,MAAM;EAAa,aAAa;CAAU,IACtE;EAAE,MAAMR,EAAO,cAAc,gBAAgB;EAAW,aAAa;CAAQ;AACrF;AAGA,SAASS,EAAgB,GAA0B;CAClD,OAAOT,EAAO,QAAQ,CAACA,EAAO,UAAUA,EAAO,OAAO,KAAA;AACvD;AAEA,SAASU,EAAc,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MAEzB,AADIyC,MAAU,EAAY,UAAU,OACpCxC,EAAYwC,CAAQ;KACrB;KAGA,YAAYtC,EAAY,UAAUG,IAAa,KAAA;KAC/C,SAAS+B;KACT,SAAQ;KACR,QAAQK;KACR,OAAM;KACN,eAAA;KACA,eAAA;KACA,kBAAkBjE;KAClB,aA3CmB,MACvBiB,EAAW;MAAE,GAAGvB;MAAO,UAAUA,EAAM,YAAY;KAAK,CAAC;KA4CrD,aAAa,EAAE,WAAWP,EAAG,6BAA6B0E,KAAmB9D,CAAkB,EAAE;IACjG,CAAA;GAEE;;CACkB,CAAA;AAE1B"}
|
|
1
|
+
{"version":3,"file":"page-header-commands-DIKspJfx.js","names":["_Fragment","resolveComponentScale","useThemeScopeHost","useDensityConfig","cn","Button","focusRecipes","compositionClasses","ActionMenu","Fragment$1","defaultPageHeaderLinkRenderer","props","target","external","rel","INLINE_COMMAND_CLASS","COMPACT_MENU_CLASS","MENU_CONTENT_CLASS","isVisible","action","isVisibleControl","style","node","hasPageHeaderCommands","primaryAction","secondaryActions","presentation","role","linkDestination","CommandButton","href","Icon","hookClassName","className","renderLink","buttonVariants","defaultScale","toMenuAction","key","PageHeaderCommands","menuOpen","setMenuOpen","useState","resizeFocus","useRef","ownedFocus","finalFocus","useCallback","captureFocus","event","captureBlur","next","host","root","header","view","inlineCommand","inlineVisible","recoverFocus","nextInlineVisible","active","droppedHiddenFocus","candidates","observer","context","maxVisibleSecondaryActions","secondary","index","routine","destructive","inlineLimit","inline","overflow","primary","primaryEntry","destructiveMenuEntries","entry","menuActions","compactMenuOnly","ThemeScopeHostProvider","attachHost","nextOpen","moreActionsLabel"],"sources":["../src/components/base/navigation/page-header/page-header-commands.tsx"],"sourcesContent":["/**\n * PageHeaderCommands — role-based commands for page and record headers.\n *\n * The role chooses each command's treatment and place: outline secondary\n * commands, then one solid primary command, then the More actions menu for\n * overflow and destructive commands, which always closes the row. Below the\n * named header container breakpoint, every command collapses into that menu\n * through CSS alone, so server and client markup agree. Both page and section\n * headers use this owner for the same command behavior.\n */\nimport { useCallback, useEffect, useRef, useState, type ComponentType, type FocusEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport {\n\tActionMenu,\n\ttype ActionMenuAction,\n\ttype ActionMenuLinkRenderProps,\n} from '../../action-menu';\nimport { Button } from '../../buttons';\nimport { buttonVariants } from '../../buttons/button.variants';\nimport {compositionClasses} from '../../structure/composition.recipes';\nimport { resolveComponentScale, useDensityConfig } from '../../../../lib/ui-provider';\nimport { cn } from '../../../../lib/utils';\nimport { focusRecipes } from '../../../../lib/focus-recipes';\nimport { ThemeScopeHostProvider, useThemeScopeHost } from '../../../../lib/theme-scope';\n\n/**\n * A page command described by its role. `primaryAction` and `secondaryActions`\n * choose the treatment, so a command carries no tone or button style.\n */\nexport interface PageHeaderAction {\n\t/** Stable key. Defaults to the command's position. */\n\tid?: string;\n\t/** Visible command text. */\n\tlabel: ReactNode;\n\t/** Runs the command. When both are set, `onClick` wins over `href`. */\n\tonClick?: () => void;\n\t/** Navigates through the header's `renderLink` instead of running a callback. */\n\thref?: string;\n\ttarget?: string;\n\trel?: string;\n\t/** Marks the destination as leaving the app; forwarded to `renderLink`. */\n\texternal?: boolean;\n\t/** Leading glyph. Pass a Lucide icon component. */\n\ticon?: ComponentType<{ className?: string }>;\n\t/** Shows the pending indicator and blocks activation. */\n\tloading?: boolean;\n\t/** Blocks activation while keeping the command visible. */\n\tdisabled?: boolean;\n\t/** Set false to omit the command, for example without permission. */\n\tvisible?: boolean;\n\t/**\n\t * Irreversible or harmful command. A destructive secondary command moves to\n\t * the More actions menu; a destructive primary command keeps its place with\n\t * the destructive treatment. Confirm it from the handler, e.g. ConfirmDialog.\n\t */\n\tdestructive?: boolean;\n}\n\n/** What a header hands its link renderer for an `href` command. */\nexport interface PageHeaderLinkRenderProps {\n\thref: string;\n\tchildren: ReactNode;\n\tclassName?: string;\n\ttarget?: string;\n\trel?: string;\n\t/** Marks the destination as leaving the app. */\n\texternal?: boolean;\n\tonClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n\t'aria-label'?: string;\n}\n\n/** Renders framework links for `href` commands. Layout `renderLink` functions fit. */\nexport type PageHeaderLinkRenderer = (props: PageHeaderLinkRenderProps) => ReactNode;\n\n/** Native anchor fallback, matching the layout default: external links open a new tab. */\nexport const defaultPageHeaderLinkRenderer: PageHeaderLinkRenderer = ({ href, external, target, rel, children, ...props }) => (\n\t<a\n\t\thref={href}\n\t\ttarget={target ?? (external ? '_blank' : undefined)}\n\t\trel={rel ?? (external ? 'noopener noreferrer' : undefined)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t</a>\n);\n\n/** Secondary commands rendered as buttons on wide headers; later ones overflow. */\nexport const PAGE_HEADER_INLINE_SECONDARY_LIMIT = 2;\n\nconst INLINE_COMMAND_CLASS = '@max-[40rem]/page-header:hidden';\nconst COMPACT_MENU_CLASS = '@min-[40rem]/page-header:hidden';\nconst MENU_CONTENT_CLASS = 'max-h-[80vh] overflow-y-auto overscroll-contain';\n\ntype CommandRole = 'primary' | 'secondary';\n\ninterface CommandEntry {\n\taction: PageHeaderAction;\n\tkey: string;\n}\n\nexport interface PageHeaderCommandsProps {\n\tprimaryAction?: PageHeaderAction;\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. */\n\tmoreActionsLabel: string;\n\trenderLink?: PageHeaderLinkRenderer;\n}\n\nfunction isVisible(action: PageHeaderAction | undefined): action is PageHeaderAction {\n\treturn !!action && action.visible !== false;\n}\n\nfunction isVisibleControl(node: HTMLElement) {\n\tconst style = node.ownerDocument.defaultView?.getComputedStyle(node);\n\treturn !!style && style.display !== 'none' && style.visibility !== 'hidden' && !node.closest('[hidden],[inert]');\n}\n\n/** Whether the header has any role-based command to render. */\nexport function hasPageHeaderCommands(\n\tprimaryAction: PageHeaderAction | undefined,\n\tsecondaryActions: readonly PageHeaderAction[] | undefined,\n) {\n\treturn isVisible(primaryAction) || (secondaryActions ?? []).some(isVisible);\n}\n\nfunction presentation(action: PageHeaderAction, role: CommandRole) {\n\tif (role === 'secondary') return { tone: 'secondary', buttonStyle: 'outline' } as const;\n\treturn { tone: action.destructive ? 'destructive' : 'primary', buttonStyle: 'solid' } as const;\n}\n\n/** `onClick` wins over `href`, matching PageAction. */\nfunction linkDestination(action: PageHeaderAction) {\n\treturn action.href && !action.onClick ? action.href : undefined;\n}\n\nfunction CommandButton({\n\taction,\n\trole,\n\trenderLink,\n\tclassName,\n}: {\n\taction: PageHeaderAction;\n\trole: CommandRole;\n\trenderLink: PageHeaderLinkRenderer;\n\tclassName?: string;\n}) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst { tone, buttonStyle } = presentation(action, role);\n\tconst href = linkDestination(action);\n\tconst Icon = action.icon;\n\tconst hookClassName = cn(`page-header--${role}-action`, className);\n\n\tif (href && !action.disabled && !action.loading) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{renderLink({\n\t\t\t\t\thref,\n\t\t\t\t\ttarget: action.target,\n\t\t\t\t\trel: action.rel,\n\t\t\t\t\texternal: action.external,\n\t\t\t\t\tclassName: cn(\n\t\t\t\t\t\t'button--component base-button--component',\n\t\t\t\t\t\tbuttonVariants({ tone, buttonStyle, size: resolveComponentScale(undefined, defaultScale) }),\n\t\t\t\t\t\thookClassName,\n\t\t\t\t\t),\n\t\t\t\t\tchildren: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{Icon && <Icon className=\"size-icon shrink-0\" aria-hidden=\"true\" />}\n\t\t\t\t\t\t\t{action.label}\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t})}\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ttype=\"button\"\n\t\t\ttone={tone}\n\t\t\tbuttonStyle={buttonStyle}\n\t\t\ticon={Icon}\n\t\t\tloading={action.loading}\n\t\t\thandlesLoading={action.loading !== undefined}\n\t\t\tdisabled={action.disabled}\n\t\t\tonClick={action.onClick}\n\t\t\tclassName={hookClassName}\n\t\t>\n\t\t\t{action.label}\n\t\t</Button>\n\t);\n}\n\nfunction toMenuAction({ action, key }: CommandEntry, className?: string): ActionMenuAction {\n\treturn {\n\t\tid: key,\n\t\tlabel: action.label,\n\t\ticon: action.icon,\n\t\tonClick: action.onClick,\n\t\thref: linkDestination(action),\n\t\ttarget: action.target,\n\t\trel: action.rel,\n\t\texternal: action.external,\n\t\tdisabled: !!action.disabled || !!action.loading,\n\t\ttone: action.destructive ? 'destructive' : 'secondary',\n\t\tclassName,\n\t};\n}\n\nexport function PageHeaderCommands({\n\tprimaryAction,\n\tsecondaryActions,\n\tmaxVisibleSecondaryActions,\n\tmoreActionsLabel,\n\trenderLink = defaultPageHeaderLinkRenderer,\n}: PageHeaderCommandsProps) {\n\t// Keep the popup inside its header container so responsive menu entries and\n\t// CSS theme inheritance follow the same boundary as the inline commands.\n\tconst { host, attachHost, context } = useThemeScopeHost<HTMLDivElement>();\n\tconst [menuOpen, setMenuOpen] = useState(false);\n\tconst resizeFocus = useRef<HTMLElement | null>(null);\n\tconst ownedFocus = useRef<HTMLElement | null>(null);\n\tconst finalFocus = useCallback(() => resizeFocus.current ?? true, []);\n\tconst captureFocus = useCallback((event: FocusEvent<HTMLDivElement>) => {\n\t\tif (event.target instanceof HTMLElement) ownedFocus.current = event.target;\n\t}, []);\n\tconst captureBlur = useCallback((event: FocusEvent<HTMLDivElement>) => {\n\t\tconst next = event.relatedTarget;\n\t\tif (next instanceof Node && host.current?.contains(next)) return;\n\t\tconst target = event.target;\n\t\tconst hiddenBlur = target instanceof HTMLElement && target === ownedFocus.current && !isVisibleControl(target)\n\t\t\t&& (next == null || next instanceof HTMLElement && !isVisibleControl(next));\n\t\tif (!hiddenBlur) ownedFocus.current = null;\n\t}, [host]);\n\tuseEffect(() => {\n\t\tconst root = host.current;\n\t\tconst header = root?.closest('.page-header--component');\n\t\tconst view = root?.ownerDocument.defaultView;\n\t\tif (!root || !header || !view) return;\n\t\tconst inlineCommand = root.querySelector<HTMLElement>('.page-header--primary-action,.page-header--secondary-action');\n\t\tif (!inlineCommand) return;\n\t\tlet inlineVisible = isVisibleControl(inlineCommand);\n\t\tconst recoverFocus = () => {\n\t\t\tconst nextInlineVisible = isVisibleControl(inlineCommand);\n\t\t\tif (nextInlineVisible === inlineVisible) return;\n\t\t\tinlineVisible = nextInlineVisible;\n\t\t\tconst active = root.ownerDocument.activeElement;\n\t\t\tconst droppedHiddenFocus = active === root.ownerDocument.body && ownedFocus.current\n\t\t\t\t&& root.contains(ownedFocus.current) && !isVisibleControl(ownedFocus.current);\n\t\t\tif (!active || !root.contains(active) && !droppedHiddenFocus) {\n\t\t\t\townedFocus.current = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// CSS owns the breakpoint. Only react when its actual presentation\n\t\t\t// changes, keeping focus out of a newly hidden row or trigger.\n\t\t\tconst candidates = root.querySelectorAll<HTMLElement>('.page-header--more-actions,.page-header--primary-action,.page-header--secondary-action');\n\t\t\tconst target = [...candidates].find(node => node.matches('.page-header--more-actions') && isVisibleControl(node) && !node.matches(':disabled,[aria-disabled=\"true\"],[data-disabled]'))\n\t\t\t\t?? [...candidates].find(node => isVisibleControl(node) && !node.matches(':disabled,[aria-disabled=\"true\"],[data-disabled]'))\n\t\t\t\t?? root;\n\t\t\tresizeFocus.current = target;\n\t\t\tif (menuOpen) setMenuOpen(false);\n\t\t\ttarget.focus({ preventScroll: true });\n\t\t};\n\t\tconst observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(recoverFocus);\n\t\tobserver?.observe(header);\n\t\tview.addEventListener('resize', recoverFocus);\n\t\treturn () => {\n\t\t\tobserver?.disconnect();\n\t\t\tview.removeEventListener('resize', recoverFocus);\n\t\t};\n\t}, [context.mounted, host, maxVisibleSecondaryActions, menuOpen, primaryAction, secondaryActions]);\n\tconst secondary: CommandEntry[] = (secondaryActions ?? [])\n\t\t.map((action, index) => ({ action, key: action.id ?? `secondary-${index}` }))\n\t\t.filter(({ action }) => isVisible(action));\n\tconst routine = secondary.filter(({ action }) => !action.destructive);\n\tconst destructive = secondary.filter(({ action }) => action.destructive);\n\t// `Infinity` keeps every routine command inline; NaN keeps the default.\n\tconst inlineLimit = maxVisibleSecondaryActions === undefined || Number.isNaN(maxVisibleSecondaryActions)\n\t\t? PAGE_HEADER_INLINE_SECONDARY_LIMIT\n\t\t: Math.max(0, Math.floor(maxVisibleSecondaryActions));\n\tconst inline = routine.slice(0, inlineLimit);\n\tconst overflow = routine.slice(inlineLimit);\n\tconst primary = isVisible(primaryAction) ? primaryAction : undefined;\n\n\tif (!primary && secondary.length === 0) return null;\n\n\tconst primaryEntry = primary ? { action: primary, key: `primary-${primary.id ?? 'action'}` } : undefined;\n\tconst destructiveMenuEntries = [\n\t\t...(primaryEntry && primary?.destructive ? [{ ...primaryEntry, className: COMPACT_MENU_CLASS }] : []),\n\t\t...destructive.map(entry => ({ ...entry, className: undefined })),\n\t];\n\t// Compact entries share one menu with permanent overflow. The primary leads\n\t// routine commands; destructive commands form the final group at any width.\n\tconst menuActions: ActionMenuAction[] = [\n\t\t...(primaryEntry && !primary?.destructive ? [toMenuAction(primaryEntry, COMPACT_MENU_CLASS)] : []),\n\t\t...inline.map(entry => toMenuAction(entry, COMPACT_MENU_CLASS)),\n\t\t...overflow.map(entry => toMenuAction(entry)),\n\t\t...destructiveMenuEntries.map(entry => ({\n\t\t\t...toMenuAction(entry, entry.className),\n\t\t\tgroup: true as const,\n\t\t\t// A boundary survives on wide headers only when both groups have a\n\t\t\t// permanent entry. Otherwise it follows the compact-only commands.\n\t\t\tgroupClassName: overflow.length > 0 && destructive.length > 0 ? undefined : COMPACT_MENU_CLASS,\n\t\t})),\n\t];\n\tconst compactMenuOnly = overflow.length === 0 && destructive.length === 0;\n\tconst renderMenuLink = (props: ActionMenuLinkRenderProps) =>\n\t\trenderLink({ ...props, children: props.children ?? null }) as ReactElement;\n\n\t// Secondary commands lead, the primary command follows them, and the More\n\t// actions menu closes the row. The trigger is one more secondary command:\n\t// outline, at the commands' own height.\n\treturn (\n\t\t<ThemeScopeHostProvider value={context}>\n\t\t\t<div\n\t\t\t\tref={attachHost}\n\t\t\t\tonFocusCapture={captureFocus}\n\t\t\t\tonBlurCapture={captureBlur}\n\t\t\t\ttabIndex={-1}\n\t\t\t\tdata-slot=\"page-header-commands\"\n\t\t\t\tclassName={cn('page-header--commands flex min-w-0 max-w-full flex-wrap items-center justify-end outline-none', compositionClasses.commands, focusRecipes.inset)}\n\t\t\t>\n\t\t\t\t{inline.map((entry) => (\n\t\t\t\t\t<CommandButton\n\t\t\t\t\t\tkey={entry.key}\n\t\t\t\t\t\taction={entry.action}\n\t\t\t\t\t\trole=\"secondary\"\n\t\t\t\t\t\trenderLink={renderLink}\n\t\t\t\t\t\tclassName={INLINE_COMMAND_CLASS}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t\t{primary && <CommandButton action={primary} role=\"primary\" renderLink={renderLink} className={INLINE_COMMAND_CLASS} />}\n\t\t\t\t{menuActions.length > 0 && (\n\t\t\t\t\t<ActionMenu\n\t\t\t\t\t\topen={menuOpen}\n\t\t\t\t\t\tonOpenChange={nextOpen => {\n\t\t\t\t\t\t\tif (nextOpen) resizeFocus.current = null;\n\t\t\t\t\t\t\tsetMenuOpen(nextOpen);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t// Only resizing owns an explicit target. The default close path\n\t\t\t\t\t\t// must respect focus already handed to a command's new overlay.\n\t\t\t\t\t\tfinalFocus={resizeFocus.current ? finalFocus : undefined}\n\t\t\t\t\t\tactions={menuActions}\n\t\t\t\t\t\tcontext=\"commands\"\n\t\t\t\t\t\tsrText={moreActionsLabel}\n\t\t\t\t\t\talign=\"end\"\n\t\t\t\t\t\tcloseOnSelect\n\t\t\t\t\t\tpreserveOrder\n\t\t\t\t\t\tcontentClassName={MENU_CONTENT_CLASS}\n\t\t\t\t\t\trenderLink={renderMenuLink}\n\t\t\t\t\t\t// The shared outline overflow square follows the provider scale, like the commands.\n\t\t\t\t\t\tbuttonProps={{ className: cn('page-header--more-actions', compactMenuOnly && COMPACT_MENU_CLASS) }}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</ThemeScopeHostProvider>\n\t);\n}\n"],"mappings":";;;;;;;;;;AA2EA,IAAaU,KAAyD,EAAE,SAAM,aAAU,WAAQ,QAAK,aAAU,GAAGC,QACjH,kBAAC,KAAD;CACO;CACN,QAAQC,MAAWC,IAAW,WAAW,KAAA;CACzC,KAAKC,MAAQD,IAAW,wBAAwB,KAAA;CAChD,GAAIF;CAEH;AACC,CAAA,GAMEI,IAAuB,mCACvBC,IAAqB,mCACrBC,IAAqB;AAwB3B,SAASC,EAAU,GAAkE;CACpF,OAAO,CAAC,CAACC,KAAUA,EAAO,YAAY;AACvC;AAEA,SAASC,EAAiB,GAAmB;CAC5C,IAAMC,IAAQC,EAAK,cAAc,aAAa,iBAAiBA,CAAI;CACnE,OAAO,CAAC,CAACD,KAASA,EAAM,YAAY,UAAUA,EAAM,eAAe,YAAY,CAACC,EAAK,QAAQ,kBAAkB;AAChH;AAGA,SAAgBC,EACf,GACA,GACC;CACD,OAAOL,EAAUM,CAAa,MAAMC,KAAoB,CAAC,EAAA,CAAG,KAAKP,CAAS;AAC3E;AAEA,SAASQ,EAAa,GAA0B,GAAmB;CAElE,OADIC,MAAS,cAAoB;EAAE,MAAM;EAAa,aAAa;CAAU,IACtE;EAAE,MAAMR,EAAO,cAAc,gBAAgB;EAAW,aAAa;CAAQ;AACrF;AAGA,SAASS,EAAgB,GAA0B;CAClD,OAAOT,EAAO,QAAQ,CAACA,EAAO,UAAUA,EAAO,OAAO,KAAA;AACvD;AAEA,SAASU,EAAc,EACtB,WACA,SACA,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AAU,EAAY,UAAU,OACpCxC,EAAYwC,CAAQ;KACrB;KAGA,YAAYtC,EAAY,UAAUG,IAAa,KAAA;KAC/C,SAAS+B;KACT,SAAQ;KACR,QAAQK;KACR,OAAM;KACN,eAAA;KACA,eAAA;KACA,kBAAkBjE;KAClB,aA3CmB,MACvBiB,EAAW;MAAE,GAAGvB;MAAO,UAAUA,EAAM,YAAY;KAAK,CAAC;KA4CrD,aAAa,EAAE,WAAWP,EAAG,6BAA6B0E,KAAmB9D,CAAkB,EAAE;IACjG,CAAA;GAEE;;CACkB,CAAA;AAE1B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { S as e, d as t } from "./ui-provider-C-74NVLc.js";
|
|
3
3
|
import { useStrings as n } from "./lib/strings.js";
|
|
4
|
-
import { t as r } from "./utils-
|
|
5
|
-
import { n as i } from "./buttons-
|
|
6
|
-
import { c as a } from "./typography-
|
|
4
|
+
import { t as r } from "./utils-DhuoqFy4.js";
|
|
5
|
+
import { n as i } from "./buttons-DeW0bQeK.js";
|
|
6
|
+
import { c as a } from "./typography-C7-YMW1S.js";
|
|
7
7
|
import { createContext as o, useContext as s } from "react";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { ChevronLeftIcon as u, ChevronRightIcon as d, MoreHorizontalIcon as f } from "lucide-react";
|
|
@@ -155,4 +155,4 @@ function O({ className: e, text: t, strings: n, children: i, ...o }) {
|
|
|
155
155
|
//#endregion
|
|
156
156
|
export { O as a, v as c, E as i, w as n, D as o, T as r, S as s, C as t };
|
|
157
157
|
|
|
158
|
-
//# sourceMappingURL=pagination-
|
|
158
|
+
//# sourceMappingURL=pagination-Br8TdV9A.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-CgCjElfu.js","names":["PaginationContent","PaginationItem","UIPagination","UIPaginationContent","UIPaginationItem","resolveComponentScale","useDensityConfig","cn","Button","Text","Pagination","props","className","PaginationContent$1","PaginationItem$1","pageMinWidthClasses","pageSquareClasses","defaultPaginationStrings","PaginationStringsContext","createContext","usePaginationStrings","inheritedStrings","useContext","useStrings","stringsProp","isSimpleText","value","PaginationPrimitive","ariaLabel","strings","PaginationContent","PaginationEllipsis","sizeProp","size","defaultScale","MoreHorizontalIcon","label","PaginationItem","PaginationLink","active","children","PaginationPrevious","_children","ChevronLeftIcon","text","PaginationNext","ChevronRightIcon"],"sources":["../src/components/ui/pagination.tsx","../src/components/base/navigation/pagination.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\n \"mx-auto flex w-full justify-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <Button\n variant={isActive ? \"outline\" : \"ghost\"}\n size={size}\n className={cn(className)}\n nativeButton={false}\n render={\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n {...props}\n />\n }\n />\n )\n}\n\nfunction PaginationPrevious({\n className,\n text = \"Previous\",\n ...props\n}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"pl-2!\", className)}\n {...props}\n >\n <ChevronLeftIcon data-icon=\"inline-start\" />\n <span className=\"hidden sm:block\">\n {text}\n </span>\n </PaginationLink>\n )\n}\n\nfunction PaginationNext({\n className,\n text = \"Next\",\n ...props\n}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"pr-2!\", className)}\n {...props}\n >\n <span className=\"hidden sm:block\">{text}</span>\n <ChevronRightIcon data-icon=\"inline-end\" />\n </PaginationLink>\n )\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\n \"size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-icon flex items-center justify-center\",\n className\n )}\n {...props}\n >\n <MoreHorizontalIcon\n />\n <span className=\"sr-only\">More pages</span>\n </span>\n )\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n}\n","import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\nimport { createContext, useContext, type ComponentProps, type ReactNode } from 'react';\n\nimport {\n\tPagination as UIPagination,\n\tPaginationContent as UIPaginationContent,\n\tPaginationItem as UIPaginationItem,\n} from '../../ui/pagination';\nimport { Button, type ButtonProps } from '../buttons';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { resolveComponentScale, useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\n\nconst pageMinWidthClasses: Record<ComponentScale, string> = {\n\tsm: 'min-w-action-sm', md: 'min-w-action', lg: 'min-w-action-lg',\n};\nconst pageSquareClasses: Record<ComponentScale, string> = {\n\tsm: 'size-action-sm', md: 'size-action', lg: 'size-action-lg',\n};\n\nexport interface PaginationStrings {\n\tnavigationLabel: string;\n\tmorePages: string;\n\tprevious: string;\n\tnext: string;\n\tpreviousLabel: string;\n\tnextLabel: string;\n}\n\nexport const defaultPaginationStrings: PaginationStrings = {\n\tnavigationLabel: 'pagination',\n\tmorePages: 'More pages',\n\tprevious: 'Previous',\n\tnext: 'Next',\n\tpreviousLabel: 'Go to previous page',\n\tnextLabel: 'Go to next page',\n};\n\nconst PaginationStringsContext = createContext<PaginationStrings>(defaultPaginationStrings);\n\nfunction usePaginationStrings(stringsProp?: StringsProp<PaginationStrings>) {\n\tconst inheritedStrings = useContext(PaginationStringsContext);\n\treturn useStrings(inheritedStrings, stringsProp);\n}\n\nexport interface PaginationProps extends ComponentProps<typeof UIPagination> {\n\t/** Pagination items, normally blocks through `PaginationContent`. */\n\tchildren?: ReactNode;\n\t/** Accessible label for the pagination navigation landmark. */\n\t'aria-label'?: string;\n\t/** Additional classes merged with the package pagination root hook. */\n\tclassName?: string;\n\t/** Localizable navigation, direction, and ellipsis labels inherited by compound parts. */\n\tstrings?: StringsProp<PaginationStrings>;\n}\nexport type PaginationContentProps = ComponentProps<typeof UIPaginationContent>;\nexport type PaginationEllipsisProps = ComponentProps<'span'> & {\n\t/** Matches page-link geometry; falls back to the provider scale. */\n\tsize?: ComponentScale;\n\t/** Copy for the control. */\n\tlabel?: string;\n\t/** Overrides the pagination copy. */\n\tstrings?: StringsProp<PaginationStrings>;\n};\nexport type PaginationItemProps = ComponentProps<typeof UIPaginationItem>;\nexport interface PaginationLinkProps extends Omit<\n\tButtonProps,\n\t'buttonStyle' | 'children' | 'variant'\n> {\n\tchildren?: ReactNode;\n\t/** Marks the current page. */\n\tactive?: boolean;\n}\nexport type PaginationNextProps = PaginationLinkProps & {\n\t/** Visible label for the control. */\n\ttext?: string;\n\t/** Overrides the pagination copy. */\n\tstrings?: StringsProp<PaginationStrings>;\n};\nexport type PaginationPreviousProps = PaginationLinkProps & {\n\t/** Visible label for the control. */\n\ttext?: string;\n\t/** Overrides the pagination copy. */\n\tstrings?: StringsProp<PaginationStrings>;\n};\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/**\n * Tokenized pagination navigation root.\n *\n * Compose it with the exported content, item, link, previous, next, and\n * ellipsis parts when consumers need explicit page navigation markup.\n */\n\nexport function PaginationPrimitive({ className, strings: stringsProp, children, 'aria-label': ariaLabel, ...props }: PaginationProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<PaginationStringsContext.Provider value={strings}>\n\t\t\t<UIPagination\n\t\t\t\taria-label={ariaLabel ?? strings.navigationLabel}\n\t\t\t\tclassName={cn('pagination-primitives--component', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</UIPagination>\n\t\t</PaginationStringsContext.Provider>\n\t);\n}\n\nexport function PaginationContent({ className, ...props }: PaginationContentProps) {\n\treturn (\n\t\t<UIPaginationContent\n\t\t\tclassName={cn('pagination-primitives--content m-0 p-0 list-none gap-space-2xs', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n\nexport function PaginationEllipsis({ className, label, size: sizeProp, strings: stringsProp, ...props }: PaginationEllipsisProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"pagination-ellipsis\"\n\t\t\t// Same square as a page link, so the row keeps one rhythm around the gap.\n\t\t\tclassName={cn('pagination-primitives--ellipsis inline-flex shrink-0 items-center justify-center text-muted-foreground', pageSquareClasses[size], className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<MoreHorizontalIcon className=\"size-icon\" aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"inherit\" className=\"sr-only\">\n\t\t\t\t{label ?? strings.morePages}\n\t\t\t</Text>\n\t\t</span>\n\t);\n}\n\nexport function PaginationItem(props: PaginationItemProps) {\n\treturn <UIPaginationItem {...props} />;\n}\n\nexport function PaginationLink({ className, children, active = false, size: sizeProp, ...props }: PaginationLinkProps) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<Button\n\t\t\tsize={size}\n\t\t\ttone=\"secondary\"\n\t\t\tbuttonStyle={active ? 'outline' : 'ghost'}\n\t\t\taria-current={active ? 'page' : undefined}\n\t\t\tdata-slot=\"pagination-link\"\n\t\t\tdata-active={active || undefined}\n\t\t\t// Page numbers are action-height squares that widen only for long numbers.\n\t\t\tclassName={cn('pagination-primitives--link px-control-xs', pageMinWidthClasses[size], className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</Button>\n\t);\n}\n\n\nexport function PaginationPrevious({ className, text, strings: stringsProp, children: _children, ...props }: PaginationPreviousProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<PaginationLink\n\t\t\taria-label={strings.previousLabel}\n\t\t\tclassName={cn('pagination-primitives--previous sm:!ps-control-sm sm:!pe-control', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<ChevronLeftIcon data-icon=\"inline-start\" aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"hidden text-inherit sm:block\">\n\t\t\t\t{text ?? strings.previous}\n\t\t\t</Text>\n\t\t</PaginationLink>\n\t);\n}\n\n\nexport function PaginationNext({ className, text, strings: stringsProp, children: _children, ...props }: PaginationNextProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<PaginationLink\n\t\t\taria-label={strings.nextLabel}\n\t\t\tclassName={cn('pagination-primitives--next sm:!ps-control sm:!pe-control-sm', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"hidden text-inherit sm:block\">\n\t\t\t\t{text ?? strings.next}\n\t\t\t</Text>\n\t\t\t<ChevronRightIcon data-icon=\"inline-end\" aria-hidden=\"true\" />\n\t\t</PaginationLink>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAMA,SAASU,EAAW,EAAE,cAAW,GAAGC,KAAsC;CACxE,OACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,aAAU;EACV,WAAWJ,EACT,sCACAK,CACF;EACA,GAAID;CACL,CAAA;AAEL;AAEA,SAASX,EAAkB,EACzB,cACA,GAAGW,KAC0B;CAC7B,OACE,kBAAC,MAAD;EACE,aAAU;EACV,WAAWJ,EAAG,qBAAqBK,CAAS;EAC5C,GAAID;CACL,CAAA;AAEL;AAEA,SAASV,EAAe,EAAE,GAAGU,KAAqC;CAChE,OAAO,kBAAC,MAAD;EAAI,aAAU;EAAkB,GAAIA;CAAQ,CAAA;AACrD;;;ACtBA,IAAMI,IAAsD;CAC3D,IAAI;CAAmB,IAAI;CAAgB,IAAI;AAChD,GACMC,IAAoD;CACzD,IAAI;CAAkB,IAAI;CAAe,IAAI;AAC9C,GAWaC,IAA8C;CAC1D,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,MAAM;CACN,eAAe;CACf,WAAW;AACZ,GAEMC,IAA2BC,EAAiCF,CAAwB;AAE1F,SAASG,EAAqB,GAA8C;CAC3E,IAAMC,IAAmBC,EAAWJ,CAAwB;CAC5D,OAAOK,EAAWF,GAAkBG,CAAW;AAChD;AA2CA,SAASC,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AASA,SAAgBC,EAAoB,EAAE,cAAW,SAASH,GAAa,aAAU,cAAcI,GAAW,GAAGjB,KAA0B;CACtI,IAAMkB,IAAUT,E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AAOrB,CAAS;EAC/F,GAAID;EAEH,UAAAc,EAAae,CAAQ,IACrB,kBAAC/B,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E;EACI,CAAA,IACH+B;CACG,CAAA;AAEV;AAGA,SAAgBC,EAAmB,EAAE,cAAW,SAAM,SAASjB,GAAa,UAAUkB,GAAW,GAAG/B,KAAkC;CACrI,IAAMkB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACc,GAAD;EACC,cAAYT,EAAQ;EACpB,WAAWtB,EAAG,oEAAoEK,CAAS;EAC3F,GAAID;EAHL,UAAA,CAKC,kBAACgC,GAAD;GAAiB,aAAU;GAAe,eAAY;EAAQ,CAAA,GAC9D,kBAAClC,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAmC,KAAQf,EAAQ;EACZ,CAAA,CACS;;AAElB;AAGA,SAAgBgB,EAAe,EAAE,cAAW,SAAM,SAASrB,GAAa,UAAUkB,GAAW,GAAG/B,KAA8B;CAC7H,IAAMkB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACc,GAAD;EACC,cAAYT,EAAQ;EACpB,WAAWtB,EAAG,gEAAgEK,CAAS;EACvF,GAAID;EAHL,UAAA,CAKC,kBAACF,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAmC,KAAQf,EAAQ;EACZ,CAAA,GACN,kBAACiB,GAAD;GAAkB,aAAU;GAAa,eAAY;EAAQ,CAAA,CAC9C;;AAElB"}
|
|
1
|
+
{"version":3,"file":"pagination-Br8TdV9A.js","names":["PaginationContent","PaginationItem","UIPagination","UIPaginationContent","UIPaginationItem","resolveComponentScale","useDensityConfig","cn","Button","Text","Pagination","props","className","PaginationContent$1","PaginationItem$1","pageMinWidthClasses","pageSquareClasses","defaultPaginationStrings","PaginationStringsContext","createContext","usePaginationStrings","inheritedStrings","useContext","useStrings","stringsProp","isSimpleText","value","PaginationPrimitive","ariaLabel","strings","PaginationContent","PaginationEllipsis","sizeProp","size","defaultScale","MoreHorizontalIcon","label","PaginationItem","PaginationLink","active","children","PaginationPrevious","_children","ChevronLeftIcon","text","PaginationNext","ChevronRightIcon"],"sources":["../src/components/ui/pagination.tsx","../src/components/base/navigation/pagination.tsx"],"sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { Button } from \"./button\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\n \"mx-auto flex w-full justify-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <Button\n variant={isActive ? \"outline\" : \"ghost\"}\n size={size}\n className={cn(className)}\n nativeButton={false}\n render={\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n {...props}\n />\n }\n />\n )\n}\n\nfunction PaginationPrevious({\n className,\n text = \"Previous\",\n ...props\n}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"pl-2!\", className)}\n {...props}\n >\n <ChevronLeftIcon data-icon=\"inline-start\" />\n <span className=\"hidden sm:block\">\n {text}\n </span>\n </PaginationLink>\n )\n}\n\nfunction PaginationNext({\n className,\n text = \"Next\",\n ...props\n}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"pr-2!\", className)}\n {...props}\n >\n <span className=\"hidden sm:block\">{text}</span>\n <ChevronRightIcon data-icon=\"inline-end\" />\n </PaginationLink>\n )\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\n \"size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-icon flex items-center justify-center\",\n className\n )}\n {...props}\n >\n <MoreHorizontalIcon\n />\n <span className=\"sr-only\">More pages</span>\n </span>\n )\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n}\n","import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';\nimport { createContext, useContext, type ComponentProps, type ReactNode } from 'react';\n\nimport {\n\tPagination as UIPagination,\n\tPaginationContent as UIPaginationContent,\n\tPaginationItem as UIPaginationItem,\n} from '../../ui/pagination';\nimport { Button, type ButtonProps } from '../buttons';\nimport { Text } from '../../typography';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { resolveComponentScale, useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\n\nconst pageMinWidthClasses: Record<ComponentScale, string> = {\n\tsm: 'min-w-action-sm', md: 'min-w-action', lg: 'min-w-action-lg',\n};\nconst pageSquareClasses: Record<ComponentScale, string> = {\n\tsm: 'size-action-sm', md: 'size-action', lg: 'size-action-lg',\n};\n\nexport interface PaginationStrings {\n\tnavigationLabel: string;\n\tmorePages: string;\n\tprevious: string;\n\tnext: string;\n\tpreviousLabel: string;\n\tnextLabel: string;\n}\n\nexport const defaultPaginationStrings: PaginationStrings = {\n\tnavigationLabel: 'pagination',\n\tmorePages: 'More pages',\n\tprevious: 'Previous',\n\tnext: 'Next',\n\tpreviousLabel: 'Go to previous page',\n\tnextLabel: 'Go to next page',\n};\n\nconst PaginationStringsContext = createContext<PaginationStrings>(defaultPaginationStrings);\n\nfunction usePaginationStrings(stringsProp?: StringsProp<PaginationStrings>) {\n\tconst inheritedStrings = useContext(PaginationStringsContext);\n\treturn useStrings(inheritedStrings, stringsProp);\n}\n\nexport interface PaginationProps extends ComponentProps<typeof UIPagination> {\n\t/** Pagination items, normally blocks through `PaginationContent`. */\n\tchildren?: ReactNode;\n\t/** Accessible label for the pagination navigation landmark. */\n\t'aria-label'?: string;\n\t/** Additional classes merged with the package pagination root hook. */\n\tclassName?: string;\n\t/** Localizable navigation, direction, and ellipsis labels inherited by compound parts. */\n\tstrings?: StringsProp<PaginationStrings>;\n}\nexport type PaginationContentProps = ComponentProps<typeof UIPaginationContent>;\nexport type PaginationEllipsisProps = ComponentProps<'span'> & {\n\t/** Matches page-link geometry; falls back to the provider scale. */\n\tsize?: ComponentScale;\n\t/** Copy for the control. */\n\tlabel?: string;\n\t/** Overrides the pagination copy. */\n\tstrings?: StringsProp<PaginationStrings>;\n};\nexport type PaginationItemProps = ComponentProps<typeof UIPaginationItem>;\nexport interface PaginationLinkProps extends Omit<\n\tButtonProps,\n\t'buttonStyle' | 'children' | 'variant'\n> {\n\tchildren?: ReactNode;\n\t/** Marks the current page. */\n\tactive?: boolean;\n}\nexport type PaginationNextProps = PaginationLinkProps & {\n\t/** Visible label for the control. */\n\ttext?: string;\n\t/** Overrides the pagination copy. */\n\tstrings?: StringsProp<PaginationStrings>;\n};\nexport type PaginationPreviousProps = PaginationLinkProps & {\n\t/** Visible label for the control. */\n\ttext?: string;\n\t/** Overrides the pagination copy. */\n\tstrings?: StringsProp<PaginationStrings>;\n};\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/**\n * Tokenized pagination navigation root.\n *\n * Compose it with the exported content, item, link, previous, next, and\n * ellipsis parts when consumers need explicit page navigation markup.\n */\n\nexport function PaginationPrimitive({ className, strings: stringsProp, children, 'aria-label': ariaLabel, ...props }: PaginationProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<PaginationStringsContext.Provider value={strings}>\n\t\t\t<UIPagination\n\t\t\t\taria-label={ariaLabel ?? strings.navigationLabel}\n\t\t\t\tclassName={cn('pagination-primitives--component', className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</UIPagination>\n\t\t</PaginationStringsContext.Provider>\n\t);\n}\n\nexport function PaginationContent({ className, ...props }: PaginationContentProps) {\n\treturn (\n\t\t<UIPaginationContent\n\t\t\tclassName={cn('pagination-primitives--content m-0 p-0 list-none gap-space-2xs', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n\nexport function PaginationEllipsis({ className, label, size: sizeProp, strings: stringsProp, ...props }: PaginationEllipsisProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"pagination-ellipsis\"\n\t\t\t// Same square as a page link, so the row keeps one rhythm around the gap.\n\t\t\tclassName={cn('pagination-primitives--ellipsis inline-flex shrink-0 items-center justify-center text-muted-foreground', pageSquareClasses[size], className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<MoreHorizontalIcon className=\"size-icon\" aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"inherit\" className=\"sr-only\">\n\t\t\t\t{label ?? strings.morePages}\n\t\t\t</Text>\n\t\t</span>\n\t);\n}\n\nexport function PaginationItem(props: PaginationItemProps) {\n\treturn <UIPaginationItem {...props} />;\n}\n\nexport function PaginationLink({ className, children, active = false, size: sizeProp, ...props }: PaginationLinkProps) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\treturn (\n\t\t<Button\n\t\t\tsize={size}\n\t\t\ttone=\"secondary\"\n\t\t\tbuttonStyle={active ? 'outline' : 'ghost'}\n\t\t\taria-current={active ? 'page' : undefined}\n\t\t\tdata-slot=\"pagination-link\"\n\t\t\tdata-active={active || undefined}\n\t\t\t// Page numbers are action-height squares that widen only for long numbers.\n\t\t\tclassName={cn('pagination-primitives--link px-control-xs', pageMinWidthClasses[size], className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</Button>\n\t);\n}\n\n\nexport function PaginationPrevious({ className, text, strings: stringsProp, children: _children, ...props }: PaginationPreviousProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<PaginationLink\n\t\t\taria-label={strings.previousLabel}\n\t\t\tclassName={cn('pagination-primitives--previous sm:!ps-control-sm sm:!pe-control', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<ChevronLeftIcon data-icon=\"inline-start\" aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"hidden text-inherit sm:block\">\n\t\t\t\t{text ?? strings.previous}\n\t\t\t</Text>\n\t\t</PaginationLink>\n\t);\n}\n\n\nexport function PaginationNext({ className, text, strings: stringsProp, children: _children, ...props }: PaginationNextProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<PaginationLink\n\t\t\taria-label={strings.nextLabel}\n\t\t\tclassName={cn('pagination-primitives--next sm:!ps-control sm:!pe-control-sm', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"hidden text-inherit sm:block\">\n\t\t\t\t{text ?? strings.next}\n\t\t\t</Text>\n\t\t\t<ChevronRightIcon data-icon=\"inline-end\" aria-hidden=\"true\" />\n\t\t</PaginationLink>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAMA,SAASU,EAAW,EAAE,cAAW,GAAGC,KAAsC;CACxE,OACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,aAAU;EACV,WAAWJ,EACT,sCACAK,CACF;EACA,GAAID;CACL,CAAA;AAEL;AAEA,SAASX,EAAkB,EACzB,cACA,GAAGW,KAC0B;CAC7B,OACE,kBAAC,MAAD;EACE,aAAU;EACV,WAAWJ,EAAG,qBAAqBK,CAAS;EAC5C,GAAID;CACL,CAAA;AAEL;AAEA,SAASV,EAAe,EAAE,GAAGU,KAAqC;CAChE,OAAO,kBAAC,MAAD;EAAI,aAAU;EAAkB,GAAIA;CAAQ,CAAA;AACrD;;;ACtBA,IAAMI,IAAsD;CAC3D,IAAI;CAAmB,IAAI;CAAgB,IAAI;AAChD,GACMC,IAAoD;CACzD,IAAI;CAAkB,IAAI;CAAe,IAAI;AAC9C,GAWaC,IAA8C;CAC1D,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,MAAM;CACN,eAAe;CACf,WAAW;AACZ,GAEMC,IAA2BC,EAAiCF,CAAwB;AAE1F,SAASG,EAAqB,GAA8C;CAC3E,IAAMC,IAAmBC,EAAWJ,CAAwB;CAC5D,OAAOK,EAAWF,GAAkBG,CAAW;AAChD;AA2CA,SAASC,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AASA,SAAgBC,EAAoB,EAAE,cAAW,SAASH,GAAa,aAAU,cAAcI,GAAW,GAAGjB,KAA0B;CACtI,IAAMkB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACN,EAAyB,UAA1B;EAAmC,OAAOW;EACzC,UAAA,kBAAC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M,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E;EACI,CAAA,IACH+B;CACG,CAAA;AAEV;AAGA,SAAgBC,EAAmB,EAAE,cAAW,SAAM,SAASjB,GAAa,UAAUkB,GAAW,GAAG/B,KAAkC;CACrI,IAAMkB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACc,GAAD;EACC,cAAYT,EAAQ;EACpB,WAAWtB,EAAG,oEAAoEK,CAAS;EAC3F,GAAID;EAHL,UAAA,CAKC,kBAACgC,GAAD;GAAiB,aAAU;GAAe,eAAY;EAAQ,CAAA,GAC9D,kBAAClC,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAmC,KAAQf,EAAQ;EACZ,CAAA,CACS;;AAElB;AAGA,SAAgBgB,EAAe,EAAE,cAAW,SAAM,SAASrB,GAAa,UAAUkB,GAAW,GAAG/B,KAA8B;CAC7H,IAAMkB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACc,GAAD;EACC,cAAYT,EAAQ;EACpB,WAAWtB,EAAG,gEAAgEK,CAAS;EACvF,GAAID;EAHL,UAAA,CAKC,kBAACF,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAmC,KAAQf,EAAQ;EACZ,CAAA,GACN,kBAACiB,GAAD;GAAkB,aAAU;GAAa,eAAY;EAAQ,CAAA,CAC9C;;AAElB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { i as e } from "./ui-provider-C-74NVLc.js";
|
|
3
|
-
import { t } from "./utils-
|
|
4
|
-
import { c as n } from "./typography-
|
|
3
|
+
import { t } from "./utils-DhuoqFy4.js";
|
|
4
|
+
import { c as n } from "./typography-C7-YMW1S.js";
|
|
5
5
|
import { t as r } from "./anchored-positioning-DPnKTvNs.js";
|
|
6
|
-
import { t as i } from "./portal-recipes-
|
|
6
|
+
import { t as i } from "./portal-recipes-DyUXqUtD.js";
|
|
7
7
|
import { t as a } from "./motion-recipes-DitYv6P2.js";
|
|
8
8
|
import { t as o } from "./slot-CLF9kLrS.js";
|
|
9
|
-
import { t as s } from "./structure-
|
|
10
|
-
import { a as c } from "./surface-recipes-
|
|
11
|
-
import { a as l, r as u } from "./popover.recipes-
|
|
9
|
+
import { t as s } from "./structure-DZJ2wbAU.js";
|
|
10
|
+
import { a as c } from "./surface-recipes-C8mNycaY.js";
|
|
11
|
+
import { a as l, r as u } from "./popover.recipes-DJ0AkUan.js";
|
|
12
12
|
import { t as d } from "./use-popup-focus-recovery-C0QPvgOR.js";
|
|
13
13
|
import * as f from "react";
|
|
14
14
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
@@ -49,7 +49,7 @@ function y({ className: n, container: o, anchor: s, align: c = "center", alignOf
|
|
|
49
49
|
alignOffset: l,
|
|
50
50
|
side: u,
|
|
51
51
|
sideOffset: m,
|
|
52
|
-
className: "isolate z-50",
|
|
52
|
+
className: "box-border isolate z-50",
|
|
53
53
|
children: /* @__PURE__ */ p(h.Popup, {
|
|
54
54
|
"data-slot": "popover-content",
|
|
55
55
|
className: t(a.popup, "bg-popover text-popover-foreground ring-foreground/10 flex flex-col gap-space-xl rounded-surface p-surface text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden", n),
|
|
@@ -82,14 +82,14 @@ function b({ className: e, ...n }) {
|
|
|
82
82
|
function x({ className: e, ...n }) {
|
|
83
83
|
return /* @__PURE__ */ p(h.Title, {
|
|
84
84
|
"data-slot": "popover-title",
|
|
85
|
-
className: t("font-medium", e),
|
|
85
|
+
className: t("m-0 font-sans font-medium", e),
|
|
86
86
|
...n
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
function S({ className: e, ...n }) {
|
|
90
90
|
return /* @__PURE__ */ p(h.Description, {
|
|
91
91
|
"data-slot": "popover-description",
|
|
92
|
-
className: t("text-muted-foreground", e),
|
|
92
|
+
className: t("m-0 font-sans text-muted-foreground", e),
|
|
93
93
|
...n
|
|
94
94
|
});
|
|
95
95
|
}
|
|
@@ -198,4 +198,4 @@ function k({ className: e, children: r, caption: i, ...a }) {
|
|
|
198
198
|
//#endregion
|
|
199
199
|
export { D as a, _ as c, E as i, O as n, g as o, k as r, v as s, T as t };
|
|
200
200
|
|
|
201
|
-
//# sourceMappingURL=popover-
|
|
201
|
+
//# sourceMappingURL=popover-k8TdUcAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover-k8TdUcAt.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","portalClassName","motionRecipes","Slot","Stack","surfaceDividerRecipes","surfaceInsetClasses","popoverRecipes","usePopupFocusRecovery","React$1","Popover$1","props","Popover","PopoverTrigger","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","inferredNativeButton","children","resolvedNativeButton","nativeButton","PopoverAnchor","PopoverContent$1","disablePortal","resolvedContainer","container","recoverFocus","onFocusCapture","inlineHost","setInlineHost","content","cn","className","PopoverHeader$1","PopoverTitle$1","PopoverDescription$1","isSimpleText","value","PopoverSurfaceContext","PopoverContent","resolvedType","type","inset","PopoverHeader","surface","copyGap","textGap","band","menu","hasStart","start","PopoverTitle","compact","PopoverDescription","PopoverFooter","childrenAsCaption","caption"],"sources":["../src/components/ui/popover.tsx","../src/components/base/popover/popover.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { portalClassName } from '../../lib/portal-recipes';\nimport { usePopupFocusRecovery } from '../../lib/use-popup-focus-recovery';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport * as React from \"react\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Popover({ ...props }: PopoverPrimitive.Root.Props) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n asChild = false,\n nativeButton,\n render,\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props & { asChild?: boolean; nativeButton?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: PopoverPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n let inferredNativeButton = true\n if (asChild && React.isValidElement(children)) {\n if (typeof children.type === \"string\") {\n inferredNativeButton = children.type === \"button\"\n } else {\n const childProps = (children.props ?? {}) as Record<string, unknown>\n inferredNativeButton = !(\"href\" in childProps)\n }\n }\n const resolvedNativeButton = nativeButton ?? (asChild ? inferredNativeButton : true)\n return (\n <PopoverPrimitive.Trigger\n data-slot=\"popover-trigger\"\n render={slotRender ?? safeRender}\n nativeButton={resolvedNativeButton}\n {...props}\n >\n {children}\n </PopoverPrimitive.Trigger>\n )\n}\n\nfunction PopoverAnchor({\n asChild = false,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\"> & { asChild?: boolean }) {\n if (asChild) {\n return <Slot {...props} />\n }\n\n return <span data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n container,\n anchor,\n align = \"center\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n disablePortal = false,\n positionMethod = disablePortal ? \"absolute\" : anchoredPositionMethod,\n onOpenAutoFocus,\n onInteractOutside,\n onFocusCapture,\n ...props\n}: PopoverPrimitive.Popup.Props &\n Pick<\n PopoverPrimitive.Positioner.Props,\n \"anchor\" | \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"positionMethod\"\n > & {\n disablePortal?: boolean\n onOpenAutoFocus?: (event: Event) => void\n onInteractOutside?: (event: Event) => void\n } & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n const recoverFocus = usePopupFocusRecovery(onFocusCapture)\n const [inlineHost, setInlineHost] = React.useState<HTMLDivElement | null>(null)\n void onOpenAutoFocus\n void onInteractOutside\n\n const content = (\n <PopoverPrimitive.Positioner\n anchor={anchor}\n positionMethod={positionMethod}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className=\"box-border isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={cn(\n motionRecipes.popup,\n \"bg-popover text-popover-foreground ring-foreground/10 flex flex-col gap-space-xl rounded-surface p-surface text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden\",\n className\n )}\n {...props}\n onFocusCapture={recoverFocus}\n />\n </PopoverPrimitive.Positioner>\n )\n\n if (disablePortal) {\n // Base UI requires Portal context; a local host preserves inline DOM locality.\n return <div data-popover-inline-host=\"\" className=\"contents\" ref={setInlineHost}>\n <PopoverPrimitive.Portal container={inlineHost} className={portalClassName()}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer} className={portalClassName()}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"m-0 font-sans font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"m-0 font-sans text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for item collections (or the small surface tier with explicit\n\t * type=\"display\"), and `flush` when child regions own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tresolvedType === 'display' && inset === 'compact'\n\t\t\t\t\t? popoverRecipes.displayCompact\n\t\t\t\t\t: surfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && popoverRecipes.menuCopyInset)}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\t// Plain text sets its own leading; the heading's inherited line box would\n\t\t\t// otherwise add a strut above the description.\n\t\t\tclassName={cn('popover-title--component', isSimpleText(children) && 'leading-none', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"inherit\"\n\t\t\t\t\tsize={compact ? undefined : 'base'}\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"popover-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverTitlePrimitive>\n\t);\n}\n\ntype PopoverDescriptionBaseProps = React.ComponentProps<typeof PopoverDescriptionPrimitive>;\n\nfunction PopoverDescription({ children, className, ...props }: PopoverDescriptionBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverDescriptionPrimitive\n\t\t\tclassName={cn('popover-description--component', isSimpleText(children) && 'leading-none', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, one small step inside the region edge like the header; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && popoverRecipes.menuCopyInset)}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,SAASA,EAAQ,EAAE,GAAGyB,KAAsC;CAC1D,OAAO,kBAACxB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIwB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACZ,GAAD,CAAO,CAAA,IAAI,KAAA,GAClCa,IAAuD,OAAOC,KAAW,eACzE,GAAa,MAAU;EACzB,IAAM,EAAE,cAAcC,GAAe,GAAGC,MAASC;EAEjD,OAAOH,EAAOE,GAA4BE,CAAK;CACjD,KACEJ,GACAK,IAAuB;CAC3B,AAAIP,KAAW3B,EAAM,eAAemC,CAAQ,MAC1C,AAIED,IAJE,OAAOC,EAAS,QAAS,WACJA,EAAS,SAAS,WAGlB,EAAE,WADLA,EAAS,SAAS,CAAC;CAI3C,IAAMC,IAAuBC,MAAiB,MAAUH;CACxD,OACE,kBAACnC,EAAiB,SAAlB;EACE,aAAU;EACV,QAAQ2B,KAAcE;EACtB,cAAcQ;EACd,GAAIb;EAEH;CACuB,CAAA;AAE9B;AAEA,SAASe,EAAc,EACrB,aAAU,IACV,GAAGf,KAC8D;CAKjE,OAJII,IACK,kBAACZ,GAAD,EAAM,GAAIQ,EAAQ,CAAA,IAGpB,kBAAC,QAAD;EAAM,aAAU;EAAiB,GAAIA;CAAQ,CAAA;AACtD;AAEA,SAAStB,EAAe,EACtB,cACA,cACA,WACA,WAAQ,UACR,iBAAc,GACd,UAAO,UACP,gBAAa,GACb,mBAAgB,IAChB,oBAAiBuC,IAAgB,aAAa5B,GAC9C,oBACA,sBACA,mBACA,GAAGW,KASuC;CAC1C,IAA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,GAAI1B;EAEJ,UAAA,kBAACgC,EAAsB,UAAvB;GAAgC,OAAO;IAAE,GAAGM;IAAS,aAAa;GAAK;GAAvE,UAAA,CACEd,KAAW,QAAQ,kBAAC,OAAD;IAAK,WAAWC,EAAG,sDAAsDa,EAAQ,SAAS,UAAU,CAACA,EAAQ,eAAe1C,EAAe,aAAa;IAC1K,UAAAkC,EAAaN,CAAO,IAAI,kBAACpC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAoC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBrC,CACQ;;CAC1B,CAAA;AAET"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "./lib/strings.js";
|
|
3
|
-
import { t } from "./utils-
|
|
4
|
-
import { n, t as r } from "./feedback-
|
|
5
|
-
import { i } from "./popover.recipes-
|
|
6
|
-
import { t as a } from "./collection-content-
|
|
7
|
-
import { a as o, i as s, l as c, n as l, o as u, r as d, t as f } from "./command-
|
|
8
|
-
import { c as p, i as m, o as h, r as g, t as _ } from "./popover-
|
|
3
|
+
import { t } from "./utils-DhuoqFy4.js";
|
|
4
|
+
import { n, t as r } from "./feedback-Dzo1xtAU.js";
|
|
5
|
+
import { i } from "./popover.recipes-DJ0AkUan.js";
|
|
6
|
+
import { t as a } from "./collection-content-CSnwtOTH.js";
|
|
7
|
+
import { a as o, i as s, l as c, n as l, o as u, r as d, t as f } from "./command-9e52NPgK.js";
|
|
8
|
+
import { c as p, i as m, o as h, r as g, t as _ } from "./popover-k8TdUcAt.js";
|
|
9
9
|
import * as v from "react";
|
|
10
10
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/base/popover-menu/popover-menu.types.ts
|
|
@@ -97,4 +97,4 @@ C.displayName = "PopoverMenu";
|
|
|
97
97
|
//#endregion
|
|
98
98
|
export { S as n, C as t };
|
|
99
99
|
|
|
100
|
-
//# sourceMappingURL=popover-menu-
|
|
100
|
+
//# sourceMappingURL=popover-menu-yn-o0kyA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-menu-DlnQ2zlR.js","names":["React","_Fragment","ErrorState","CollectionContent","CommandItem","CommandInput","commandFilter","CommandEmpty","CommandList","CommandGroup","Command","PopoverTrigger","PopoverHeader","Popover","PopoverFooter","PopoverContent","React$1","Fragment$1","defaultPopoverMenuStrings","PopoverMenu","stringsProp","strings","useStrings","searchRef","triggerRef","keyboardDismissal","contentRef","searchOverrides","items","item","filter","value","search","keywords","next","details","onOpenChange","trigger","contentLabelledBy","contentLabel","cn","popoverWidthRecipes","contentClassName","onSearchChange","header","searchValue","loading","loadingSlot","LoadingState","error","onRetry","empty","onSelect","renderItem","footer"],"sources":["../src/components/base/popover-menu/popover-menu.types.ts","../src/components/base/popover-menu/popover-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface PopoverMenuItem<T = unknown> {\n\t/** Unique identifier; remains distinct from visible search labels. */\n\tvalue: string;\n\t/** Visible label rendered in the row. Override entirely via `renderItem`. */\n\tlabel: ReactNode;\n\t/** Optional secondary line rendered under the label. */\n\tdescription?: ReactNode;\n\t/** Leading icon — keep small (size-icon-md/size-icon max). */\n\ticon?: ReactNode;\n\t/** Show the trailing checkmark when `true`. */\n\tselected?: boolean;\n\t/** Disable the row. */\n\tdisabled?: boolean;\n\t/** Explicit search keywords, useful when the label is structured content. */\n\tsearchValue?: string;\n\t/** Arbitrary payload for `onSelect` consumers. */\n\tdata?: T;\n}\n\nexport interface PopoverMenuStrings {\n\t/** Placeholder for the search input (when `search` is enabled). */\n\tsearchPlaceholder: string;\n\t/** Empty-state copy when filtering yields no items. */\n\tempty: string;\n\t/** Loading-state copy. */\n\tloading: string;\n\t/** Retry action copy when a resource fails. */\n\tretry?: string;\n}\n\nexport const defaultPopoverMenuStrings: PopoverMenuStrings = {\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No results.',\n\tloading: 'Loading…',\n\tretry: 'Retry',\n};\n","import { commandFilter } from '../../../lib/command-filter';\n/**\n * PopoverMenu — blocks wrapper around `base/popover` + `base/command`.\n *\n * Captures the recurring \"trigger → optional header → search → command list\"\n * pattern used by filter facets, operator selects, and similar pickers\n * across the library.\n *\n * Slots (all optional):\n * - `header` — rendered above the search input / list\n * - `footer` — rendered below the list (e.g. confirm/clear buttons)\n * - `empty` — replaces the default empty-state copy\n * - `loading` — replaces the list when `loading` is true\n *\n * Render-prop:\n * - `renderItem={(item, ctx) => ReactNode}` — full control over a row\n *\n * Strings:\n * - `strings={{ searchPlaceholder, empty, loading }}` — merged with defaults\n *\n * For headless usage (custom UI against the same selection state),\n * compose `base/popover` + `base/command` directly.\n */\nimport * as React from 'react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../command';\nimport {\n\tPopover,\n\tPopoverContent,\n PopoverHeader,\n PopoverFooter,\n\tPopoverTrigger,\n} from '../popover';\nimport { LoadingState, ErrorState } from '../feedback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { popoverWidthRecipes, type CollectionDensity } from '../popover/popover.recipes';\nimport { CollectionContent } from '../popover/collection-content';\n\nimport {\n\tdefaultPopoverMenuStrings,\n\ttype PopoverMenuItem,\n\ttype PopoverMenuStrings,\n} from './popover-menu.types';\n\nexport interface PopoverMenuRenderItemContext {\n\t/** True when the item is the user's currently-active match (keyboard or pointer highlight). */\n\tisHighlighted: boolean;\n}\n\nexport interface PopoverMenuProps<T = unknown> {\n\t/** Vertical row rhythm. Compact and comfortable preserve primary label size and inline room. */\n\tdensity?: CollectionDensity;\n\t/** Trigger element. The popover anchors to it. Pass any clickable. */\n\ttrigger: React.ReactNode;\n\t/** Items to render in the list. */\n\titems: ReadonlyArray<PopoverMenuItem<T>>;\n\t/** Selection callback — fires on row click / Enter. */\n\tonSelect: (item: PopoverMenuItem<T>) => void;\n\n\t/** Controlled open state. Omit for uncontrolled. */\n\topen?: boolean;\n\t/** Open-state callback for controlled / uncontrolled flows. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Show the search input above the list. Default: true. */\n\tsearch?: boolean;\n\t/** Search input value (controlled). */\n\tsearchValue?: string;\n\t/** Search input change callback. */\n\tonSearchChange?: (value: string) => void;\n\n\t/** Async loading flag — replaces stale options and the empty state. */\n\tloading?: boolean;\n\t/** Resource failure replaces the list. The application owns retry and fetching. */\n\terror?: React.ReactNode;\n\tonRetry?: () => void;\n\n\t/** Optional pre-list slot (e.g. a label / eyebrow). */\n\theader?: React.ReactNode;\n\t/** Optional post-list slot (e.g. confirm / clear buttons). */\n\tfooter?: React.ReactNode;\n\t/** Override empty-state slot (defaults to `strings.empty`). */\n\tempty?: React.ReactNode;\n\t/** Override loading slot (defaults to spinner + `strings.loading`). */\n\tloadingSlot?: React.ReactNode;\n\n\t/** Per-item render override. */\n\trenderItem?: (\n\t\titem: PopoverMenuItem<T>,\n\t\tctx: PopoverMenuRenderItemContext,\n\t) => React.ReactNode;\n\n\t/** Override copy. Deep-merged over defaults. */\n\tstrings?: StringsProp<PopoverMenuStrings>;\n\n\t/** Popover content positioning props (forwarded). */\n\talign?: React.ComponentProps<typeof PopoverContent>['align'];\n\t/** Distance from the trigger, in pixels. */\n\tsideOffset?: React.ComponentProps<typeof PopoverContent>['sideOffset'];\n\n\t/** Width override for the popover content. Default: w-56. */\n\tcontentClassName?: string;\n /** Accessible name for the popup. Defaults to the localized search label. */\n contentLabel?: string;\n /** ID of a consumer-owned title used instead of contentLabel. */\n contentLabelledBy?: string;\n}\n\nexport function PopoverMenu<T = unknown>({\n\tdensity = 'default',\n\ttrigger,\n\titems,\n\tonSelect,\n\topen,\n\tonOpenChange,\n\tsearch = true,\n\tsearchValue,\n\tonSearchChange,\n\tloading = false,\n\terror,\n\tonRetry,\n\theader,\n\tfooter,\n\tempty,\n\tloadingSlot,\n\trenderItem,\n\tstrings: stringsProp,\n\talign = 'start',\n\tsideOffset,\n\tcontentClassName,\n contentLabel,\n contentLabelledBy,\n}: PopoverMenuProps<T>) {\n\tconst strings = useStrings(defaultPopoverMenuStrings, stringsProp);\n\tconst searchRef = React.useRef<HTMLInputElement>(null);\n\tconst triggerRef = React.useRef<HTMLButtonElement>(null);\n\tconst keyboardDismissal = React.useRef(false);\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n const searchOverrides = React.useMemo(() => new Map(\n items.filter(item => item.searchValue !== undefined).map(item => [item.value, item.searchValue!]),\n ), [items]);\n const filter = React.useCallback((value: string, search: string, keywords?: string[]) => (\n searchOverrides.has(value)\n ? commandFilter(searchOverrides.get(value)!, search)\n : commandFilter(value, search, keywords)\n ), [searchOverrides]);\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={(next, details) => {\n keyboardDismissal.current = !next && details.reason === 'escape-key';\n onOpenChange?.(next);\n }} onOpenChangeComplete={next => {\n // Rapid reopen during a focus-out exit can retain Base UI's no-return flag.\n // Restore only an accepted, completed Escape dismissal; outside focus stays owned.\n if (!next && keyboardDismissal.current) {\n keyboardDismissal.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n }\n }}>\n\t\t\t<PopoverTrigger ref={triggerRef} render={trigger as React.ReactElement} />\n\t\t\t<PopoverContent\n\t\t\t\tref={contentRef}\n\t\t\t\taria-label={contentLabelledBy ? undefined : contentLabel ?? strings.searchPlaceholder}\n aria-labelledby={contentLabelledBy}\n align={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\ttype=\"menu\"\n\t\t\t\tinset=\"flush\"\n\t\t\t\tclassName={cn('popover-menu--component', popoverWidthRecipes.sm, 'gap-0 overflow-hidden', contentClassName)}\n\t\t\t>\n\t\t\t\t<Command\n\t\t\t\t\tshouldFilter={!onSearchChange}\n filter={filter}\n\t\t\t\t\tinset=\"flush\"\n\t\t\t\t\tclassName=\"popover-menu--collection\"\n\t\t\t\t>\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<PopoverHeader className=\"popover-menu--header\">\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{!!search && (\n\t\t\t\t\t\t<CommandInput\n\t\t\t\t\t\t\tref={searchRef}\n\t\t\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\t\tonValueChange={onSearchChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<CommandList aria-busy={loading || undefined}>\n\t\t\t\t\t\t{loading ? (loadingSlot !== undefined ? <div role=\"status\" aria-live=\"polite\">{loadingSlot}</div> : <LoadingState label={strings.loading} />) : error ? <ErrorState variant=\"inline\" description={error} onRetry={onRetry ? () => {\n // Retry feedback is replaced by loading. Keep focus on persistent anatomy\n // before its button is removed, including in search-free pickers.\n (searchRef.current ?? contentRef.current)?.focus();\n onRetry();\n } : undefined} retryLabel={strings.retry ?? 'Retry'} /> : <>\n\n\t\t\t\t\t\t<CommandEmpty>{empty ?? strings.empty}</CommandEmpty>\n\n\t\t\t\t\t\t{items.length > 0 && (\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\t\tvalue={item.value}\n keywords={item.searchValue !== undefined ? [item.searchValue] : [item.label, item.description].filter((value): value is string => typeof value === 'string')}\n\t\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(item)}\n\t\t\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t\t\t\tdata-checked={item.selected || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName=\"data-[checked=true]:**:[svg]:text-primary-accent\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{({ isHighlighted }) => renderItem\n\t\t\t\t\t\t\t\t\t\t\t? renderItem(item, { isHighlighted })\n\t\t\t\t\t\t\t\t\t\t\t: (\n\t\t\t\t\t\t\t\t\t\t\t\t<CollectionContent label={item.label} description={item.description} leading={item.icon} leadingClassName=\"[&_svg]:size-icon\"/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>}\n\t\t\t\t\t</CommandList>\n\n\t\t\t\t\t{/* The public surface anatomy owns header and footer bands. */}\n\t\t\t\t\t{!!footer && (\n\t\t\t\t\t\t<PopoverFooter className=\"popover-menu--footer justify-start\">\n\t\t\t\t\t\t\t{footer}\n\t\t\t\t\t\t</PopoverFooter>\n\t\t\t\t\t)}\n\t\t\t\t</Command>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\nPopoverMenu.displayName = 'PopoverMenu';\n"],"mappings":";;;;;;;;;;;AAgCA,IAAakB,IAAgD;CAC5D,mBAAmB;CACnB,OAAO;CACP,SAAS;CACT,OAAO;AACR;;;AC+EA,SAAgBC,EAAyB,EACxC,aAAU,WACV,YACA,UACA,aACA,SACA,iBACA,YAAS,IACT,gBACA,mBACA,aAAU,IACV,UACA,YACA,WACA,WACA,UACA,gBACA,eACA,SAASC,GACT,WAAQ,SACR,eACA,qBACG,iBACA,wBACoB;CACvB,IAAMC,IAAUC,EAAWJ,GAA2BE,CAAW,GAC3DG,IAAYvB,EAAM,OAAyB,IAAI,GAC/CwB,IAAaxB,EAAM,OAA0B,IAAI,GACjDyB,IAAoBzB,EAAM,OAAO,EAAK,GACtC0B,IAAa1B,EAAM,OAAuB,IAAI,GAC3C2B,IAAkB3B,EAAM,cAAc,IAAI,IAC5C4B,EAAM,QAAO,MAAQC,EAAK,gBAAgB,KAAA,CAAS,CAA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AK;OAAS,aAAU;OAAU,UAAA0B;MAAiB,CAAA,IAAgDE,IAAQ,kBAAC/C,GAAD;OAAY,SAAQ;OAAS,aAAa+C;OAAO,SAASC,UAAgB;QAI5M,CADC3B,EAAU,WAAWG,EAAW,QAAA,EAAU,MAAM,GACjDwB,EAAQ;OACZ,IAAI,KAAA;OAAW,YAAY7B,EAAQ,SAAS;MAAU,CAAA,IAAI,kBAAApB,GAAA,EAAA,UAAA,CAE5E,kBAACM,GAAD,EAAA,UAAe4C,KAAS9B,EAAQ,MAAoB,CAAA,GAEnDO,EAAM,SAAS,KACf,kBAACnB,GAAD,EAAA,UACEmB,EAAM,KAAK,MACX,kBAACxB,GAAD;OAEU;OACT,OAAOyB,EAAK;OACkB,UAAUA,EAAK,gBAAgB,KAAA,IAAiC,CAACA,EAAK,OAAOA,EAAK,WAAW,CAAC,CAAC,QAAQ,MAA2B,OAAOE,KAAU,QAAQ,IAAhH,CAACF,EAAK,WAAW;OAC1F,gBAAgBuB,EAASvB,CAAI;OAC7B,UAAUA,EAAK;OACf,gBAAcA,EAAK,YAAY,KAAA;OAC/B,WAAU;OAER,WAAA,EAAE,uBAAoBwB,IACrBA,EAAWxB,GAAM,EAAE,iBAAc,CAAC,IAEnC,kBAAC1B,GAAD;QAAmB,OAAO0B,EAAK;QAAO,aAAaA,EAAK;QAAa,SAASA,EAAK;QAAM,kBAAiB;OAAoB,CAAA;MAEpH,GAdPA,EAAK,KAcE,CACb,EACY,CAAA,CAEb,EAAA,CAAA;KACU,CAAA;KAGZ,CAAC,CAACyB,KACF,kBAACxC,GAAD;MAAe,WAAU;MACvB,UAAAwC;KACa,CAAA;IAER;;EACM,CAAA,CACR;;AAEX;AAEA,EAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"popover-menu-yn-o0kyA.js","names":["React","_Fragment","ErrorState","CollectionContent","CommandItem","CommandInput","commandFilter","CommandEmpty","CommandList","CommandGroup","Command","PopoverTrigger","PopoverHeader","Popover","PopoverFooter","PopoverContent","React$1","Fragment$1","defaultPopoverMenuStrings","PopoverMenu","stringsProp","strings","useStrings","searchRef","triggerRef","keyboardDismissal","contentRef","searchOverrides","items","item","filter","value","search","keywords","next","details","onOpenChange","trigger","contentLabelledBy","contentLabel","cn","popoverWidthRecipes","contentClassName","onSearchChange","header","searchValue","loading","loadingSlot","LoadingState","error","onRetry","empty","onSelect","renderItem","footer"],"sources":["../src/components/base/popover-menu/popover-menu.types.ts","../src/components/base/popover-menu/popover-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface PopoverMenuItem<T = unknown> {\n\t/** Unique identifier; remains distinct from visible search labels. */\n\tvalue: string;\n\t/** Visible label rendered in the row. Override entirely via `renderItem`. */\n\tlabel: ReactNode;\n\t/** Optional secondary line rendered under the label. */\n\tdescription?: ReactNode;\n\t/** Leading icon — keep small (size-icon-md/size-icon max). */\n\ticon?: ReactNode;\n\t/** Show the trailing checkmark when `true`. */\n\tselected?: boolean;\n\t/** Disable the row. */\n\tdisabled?: boolean;\n\t/** Explicit search keywords, useful when the label is structured content. */\n\tsearchValue?: string;\n\t/** Arbitrary payload for `onSelect` consumers. */\n\tdata?: T;\n}\n\nexport interface PopoverMenuStrings {\n\t/** Placeholder for the search input (when `search` is enabled). */\n\tsearchPlaceholder: string;\n\t/** Empty-state copy when filtering yields no items. */\n\tempty: string;\n\t/** Loading-state copy. */\n\tloading: string;\n\t/** Retry action copy when a resource fails. */\n\tretry?: string;\n}\n\nexport const defaultPopoverMenuStrings: PopoverMenuStrings = {\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No results.',\n\tloading: 'Loading…',\n\tretry: 'Retry',\n};\n","import { commandFilter } from '../../../lib/command-filter';\n/**\n * PopoverMenu — blocks wrapper around `base/popover` + `base/command`.\n *\n * Captures the recurring \"trigger → optional header → search → command list\"\n * pattern used by filter facets, operator selects, and similar pickers\n * across the library.\n *\n * Slots (all optional):\n * - `header` — rendered above the search input / list\n * - `footer` — rendered below the list (e.g. confirm/clear buttons)\n * - `empty` — replaces the default empty-state copy\n * - `loading` — replaces the list when `loading` is true\n *\n * Render-prop:\n * - `renderItem={(item, ctx) => ReactNode}` — full control over a row\n *\n * Strings:\n * - `strings={{ searchPlaceholder, empty, loading }}` — merged with defaults\n *\n * For headless usage (custom UI against the same selection state),\n * compose `base/popover` + `base/command` directly.\n */\nimport * as React from 'react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../command';\nimport {\n\tPopover,\n\tPopoverContent,\n PopoverHeader,\n PopoverFooter,\n\tPopoverTrigger,\n} from '../popover';\nimport { LoadingState, ErrorState } from '../feedback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { popoverWidthRecipes, type CollectionDensity } from '../popover/popover.recipes';\nimport { CollectionContent } from '../popover/collection-content';\n\nimport {\n\tdefaultPopoverMenuStrings,\n\ttype PopoverMenuItem,\n\ttype PopoverMenuStrings,\n} from './popover-menu.types';\n\nexport interface PopoverMenuRenderItemContext {\n\t/** True when the item is the user's currently-active match (keyboard or pointer highlight). */\n\tisHighlighted: boolean;\n}\n\nexport interface PopoverMenuProps<T = unknown> {\n\t/** Vertical row rhythm. Compact and comfortable preserve primary label size and inline room. */\n\tdensity?: CollectionDensity;\n\t/** Trigger element. The popover anchors to it. Pass any clickable. */\n\ttrigger: React.ReactNode;\n\t/** Items to render in the list. */\n\titems: ReadonlyArray<PopoverMenuItem<T>>;\n\t/** Selection callback — fires on row click / Enter. */\n\tonSelect: (item: PopoverMenuItem<T>) => void;\n\n\t/** Controlled open state. Omit for uncontrolled. */\n\topen?: boolean;\n\t/** Open-state callback for controlled / uncontrolled flows. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Show the search input above the list. Default: true. */\n\tsearch?: boolean;\n\t/** Search input value (controlled). */\n\tsearchValue?: string;\n\t/** Search input change callback. */\n\tonSearchChange?: (value: string) => void;\n\n\t/** Async loading flag — replaces stale options and the empty state. */\n\tloading?: boolean;\n\t/** Resource failure replaces the list. The application owns retry and fetching. */\n\terror?: React.ReactNode;\n\tonRetry?: () => void;\n\n\t/** Optional pre-list slot (e.g. a label / eyebrow). */\n\theader?: React.ReactNode;\n\t/** Optional post-list slot (e.g. confirm / clear buttons). */\n\tfooter?: React.ReactNode;\n\t/** Override empty-state slot (defaults to `strings.empty`). */\n\tempty?: React.ReactNode;\n\t/** Override loading slot (defaults to spinner + `strings.loading`). */\n\tloadingSlot?: React.ReactNode;\n\n\t/** Per-item render override. */\n\trenderItem?: (\n\t\titem: PopoverMenuItem<T>,\n\t\tctx: PopoverMenuRenderItemContext,\n\t) => React.ReactNode;\n\n\t/** Override copy. Deep-merged over defaults. */\n\tstrings?: StringsProp<PopoverMenuStrings>;\n\n\t/** Popover content positioning props (forwarded). */\n\talign?: React.ComponentProps<typeof PopoverContent>['align'];\n\t/** Distance from the trigger, in pixels. */\n\tsideOffset?: React.ComponentProps<typeof PopoverContent>['sideOffset'];\n\n\t/** Width override for the popover content. Default: w-56. */\n\tcontentClassName?: string;\n /** Accessible name for the popup. Defaults to the localized search label. */\n contentLabel?: string;\n /** ID of a consumer-owned title used instead of contentLabel. */\n contentLabelledBy?: string;\n}\n\nexport function PopoverMenu<T = unknown>({\n\tdensity = 'default',\n\ttrigger,\n\titems,\n\tonSelect,\n\topen,\n\tonOpenChange,\n\tsearch = true,\n\tsearchValue,\n\tonSearchChange,\n\tloading = false,\n\terror,\n\tonRetry,\n\theader,\n\tfooter,\n\tempty,\n\tloadingSlot,\n\trenderItem,\n\tstrings: stringsProp,\n\talign = 'start',\n\tsideOffset,\n\tcontentClassName,\n contentLabel,\n contentLabelledBy,\n}: PopoverMenuProps<T>) {\n\tconst strings = useStrings(defaultPopoverMenuStrings, stringsProp);\n\tconst searchRef = React.useRef<HTMLInputElement>(null);\n\tconst triggerRef = React.useRef<HTMLButtonElement>(null);\n\tconst keyboardDismissal = React.useRef(false);\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n const searchOverrides = React.useMemo(() => new Map(\n items.filter(item => item.searchValue !== undefined).map(item => [item.value, item.searchValue!]),\n ), [items]);\n const filter = React.useCallback((value: string, search: string, keywords?: string[]) => (\n searchOverrides.has(value)\n ? commandFilter(searchOverrides.get(value)!, search)\n : commandFilter(value, search, keywords)\n ), [searchOverrides]);\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={(next, details) => {\n keyboardDismissal.current = !next && details.reason === 'escape-key';\n onOpenChange?.(next);\n }} onOpenChangeComplete={next => {\n // Rapid reopen during a focus-out exit can retain Base UI's no-return flag.\n // Restore only an accepted, completed Escape dismissal; outside focus stays owned.\n if (!next && keyboardDismissal.current) {\n keyboardDismissal.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n }\n }}>\n\t\t\t<PopoverTrigger ref={triggerRef} render={trigger as React.ReactElement} />\n\t\t\t<PopoverContent\n\t\t\t\tref={contentRef}\n\t\t\t\taria-label={contentLabelledBy ? undefined : contentLabel ?? strings.searchPlaceholder}\n aria-labelledby={contentLabelledBy}\n align={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\ttype=\"menu\"\n\t\t\t\tinset=\"flush\"\n\t\t\t\tclassName={cn('popover-menu--component', popoverWidthRecipes.sm, 'gap-0 overflow-hidden', contentClassName)}\n\t\t\t>\n\t\t\t\t<Command\n\t\t\t\t\tshouldFilter={!onSearchChange}\n filter={filter}\n\t\t\t\t\tinset=\"flush\"\n\t\t\t\t\tclassName=\"popover-menu--collection\"\n\t\t\t\t>\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<PopoverHeader className=\"popover-menu--header\">\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{!!search && (\n\t\t\t\t\t\t<CommandInput\n\t\t\t\t\t\t\tref={searchRef}\n\t\t\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\t\tonValueChange={onSearchChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<CommandList aria-busy={loading || undefined}>\n\t\t\t\t\t\t{loading ? (loadingSlot !== undefined ? <div role=\"status\" aria-live=\"polite\">{loadingSlot}</div> : <LoadingState label={strings.loading} />) : error ? <ErrorState variant=\"inline\" description={error} onRetry={onRetry ? () => {\n // Retry feedback is replaced by loading. Keep focus on persistent anatomy\n // before its button is removed, including in search-free pickers.\n (searchRef.current ?? contentRef.current)?.focus();\n onRetry();\n } : undefined} retryLabel={strings.retry ?? 'Retry'} /> : <>\n\n\t\t\t\t\t\t<CommandEmpty>{empty ?? strings.empty}</CommandEmpty>\n\n\t\t\t\t\t\t{items.length > 0 && (\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\t\tvalue={item.value}\n keywords={item.searchValue !== undefined ? [item.searchValue] : [item.label, item.description].filter((value): value is string => typeof value === 'string')}\n\t\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(item)}\n\t\t\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t\t\t\tdata-checked={item.selected || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName=\"data-[checked=true]:**:[svg]:text-primary-accent\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{({ isHighlighted }) => renderItem\n\t\t\t\t\t\t\t\t\t\t\t? renderItem(item, { isHighlighted })\n\t\t\t\t\t\t\t\t\t\t\t: (\n\t\t\t\t\t\t\t\t\t\t\t\t<CollectionContent label={item.label} description={item.description} leading={item.icon} leadingClassName=\"[&_svg]:size-icon\"/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>}\n\t\t\t\t\t</CommandList>\n\n\t\t\t\t\t{/* The public surface anatomy owns header and footer bands. */}\n\t\t\t\t\t{!!footer && (\n\t\t\t\t\t\t<PopoverFooter className=\"popover-menu--footer justify-start\">\n\t\t\t\t\t\t\t{footer}\n\t\t\t\t\t\t</PopoverFooter>\n\t\t\t\t\t)}\n\t\t\t\t</Command>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\nPopoverMenu.displayName = 'PopoverMenu';\n"],"mappings":";;;;;;;;;;;AAgCA,IAAakB,IAAgD;CAC5D,mBAAmB;CACnB,OAAO;CACP,SAAS;CACT,OAAO;AACR;;;AC+EA,SAAgBC,EAAyB,EACxC,aAAU,WACV,YACA,UACA,aACA,SACA,iBACA,YAAS,IACT,gBACA,mBACA,aAAU,IACV,UACA,YACA,WACA,WACA,UACA,gBACA,eACA,SAASC,GACT,WAAQ,SACR,eACA,qBACG,iBACA,wBACoB;CACvB,IAAMC,IAAUC,EAAWJ,GAA2BE,CAAW,GAC3DG,IAAYvB,EAAM,OAAyB,IAAI,GAC/CwB,IAAaxB,EAAM,OAA0B,IAAI,GACjDyB,IAAoBzB,EAAM,OAAO,EAAK,GACtC0B,IAAa1B,EAAM,OAAuB,IAAI,GAC3C2B,IAAkB3B,EAAM,cAAc,IAAI,IAC5C4B,EAAM,QAAO,MAAQC,EAAK,gBAAgB,KAAA,CAAS,CAAC,CAAC,KAAI,MAAQ,CAACA,EAAK,OAAOA,EAAK,WAAY,CAAC,CACpG,GAAG,CAACD,CAAK,CAAC,GACJE,IAAS9B,EAAM,aAAa,GAAe,GAAgB,MAC7D2B,EAAgB,IAAII,CAAK,IACnBzB,EAAcqB,EAAgB,IAAII,CAAK,GAAIC,CAAM,IACjD1B,EAAcyB,GAAOC,GAAQC,CAAQ,GAC5C,CAACN,C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,GAAA,EAAA,UAAA,CAE5E,kBAACM,GAAD,EAAA,UAAe4C,KAAS9B,EAAQ,MAAoB,CAAA,GAEnDO,EAAM,SAAS,KACf,kBAACnB,GAAD,EAAA,UACEmB,EAAM,KAAK,MACX,kBAACxB,GAAD;OAEU;OACT,OAAOyB,EAAK;OACkB,UAAUA,EAAK,gBAAgB,KAAA,IAAiC,CAACA,EAAK,OAAOA,EAAK,WAAW,CAAC,CAAC,QAAQ,MAA2B,OAAOE,KAAU,QAAQ,IAAhH,CAACF,EAAK,WAAW;OAC1F,gBAAgBuB,EAASvB,CAAI;OAC7B,UAAUA,EAAK;OACf,gBAAcA,EAAK,YAAY,KAAA;OAC/B,WAAU;OAER,WAAA,EAAE,uBAAoBwB,IACrBA,EAAWxB,GAAM,EAAE,iBAAc,CAAC,IAEnC,kBAAC1B,GAAD;QAAmB,OAAO0B,EAAK;QAAO,aAAaA,EAAK;QAAa,SAASA,EAAK;QAAM,kBAAiB;OAAoB,CAAA;MAEpH,GAdPA,EAAK,KAcE,CACb,EACY,CAAA,CAEb,EAAA,CAAA;KACU,CAAA;KAGZ,CAAC,CAACyB,KACF,kBAACxC,GAAD;MAAe,WAAU;MACvB,UAAAwC;KACa,CAAA;IAER;;EACM,CAAA,CACR;;AAEX;AAEA,EAAY,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e } from "./surface-recipes-
|
|
1
|
+
import { a as e } from "./surface-recipes-C8mNycaY.js";
|
|
2
2
|
//#region src/components/base/popover/popover.recipes.ts
|
|
3
3
|
var t = "px-space-md", n = {
|
|
4
4
|
xs: "w-48",
|
|
@@ -45,4 +45,4 @@ var c = {
|
|
|
45
45
|
//#endregion
|
|
46
46
|
export { i as a, n as i, s as n, r, c as t };
|
|
47
47
|
|
|
48
|
-
//# sourceMappingURL=popover.recipes-
|
|
48
|
+
//# sourceMappingURL=popover.recipes-DJ0AkUan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.recipes-
|
|
1
|
+
{"version":3,"file":"popover.recipes-DJ0AkUan.js","names":["surfaceDividerRecipes","menuInlineInset","popoverWidthRecipes","popoverRecipes","surfaceInsetClasses","collectionDensityClasses","collectionBlockPaddingClasses","collectionRowClasses","density","collectionRecipes"],"sources":["../src/components/base/popover/popover.recipes.ts"],"sourcesContent":["import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\nimport type { RowDensity } from '../../../lib/row-recipes';\n// Menu surfaces inset their regions and lists by md on both axes, so header,\n// search and row text share one start edge (md plus the row inset).\nconst menuInlineInset = 'px-space-md';\n/** Shared anchored-surface chrome; Menu and Popover retain their own accessible behavior. */\n/**\n * One width scale for anchored surfaces. Menus, pickers and popovers choose a\n * step rather than a number; the viewport bound in `popoverRecipes.surface`\n * still keeps every step clear of a narrow screen's edges.\n */\nexport const popoverWidthRecipes = {\n\txs: 'w-48',\n\tsm: 'w-56',\n\tmd: 'w-72',\n\tlg: 'w-80',\n\txl: 'w-90',\n\t/** Floor for a menu that otherwise follows its trigger's width. */\n\tmenuMin: 'min-w-40',\n} as const;\n\nexport const popoverRecipes = {\n // Every anchored surface keeps a 1rem gap to the viewport edges, so a wide\n // menu or popover never touches or overruns a narrow screen.\n surface: `box-border max-w-[calc(100vw-2rem)] rounded-surface ${surfaceDividerRecipes.anchored.shell} bg-popover text-popover-foreground shadow-md ring-0`,\n display: 'p-surface',\n // Explicitly compact rich content retains the existing small surface tier.\n displayCompact: 'p-surface-xs',\n menu: 'p-space-md',\n menuInline: menuInlineInset,\n // Collection bands share the list shell; text bodies add the row inset once.\n menuRegion: `${menuInlineInset} py-space-md`,\n // Header and footer copy in a menu band sits one small step inside the region\n // edge, so it does not touch the search field and row highlights below.\n menuCopyInset: 'px-space-xs',\n // Keep the literal descendant candidate with the shared compact shell owner.\n menuSearch: '[&_[data-slot=command-input-wrapper]]:p-space-md',\n separator: `mx-0 my-space-xs h-px w-full shrink-0 ${surfaceDividerRecipes.anchored.separator}`,\n row: 'box-border min-h-control rounded-radius px-row-x gap-space-sm font-medium leading-tight',\n} as const;\nexport type PopoverContentType = 'display' | 'menu';\n\n/** One surface inset vocabulary for Popover, Command and their collections. */\nexport const surfaceInsetClasses = {\n default: popoverRecipes.display,\n compact: popoverRecipes.menu,\n flush: 'p-0',\n} as const;\n\n/** Collection density changes vertical rhythm; inline room and primary text stay stable. */\nexport type CollectionDensity = RowDensity;\n\nconst collectionDensityClasses: Record<CollectionDensity, string> = {\n default: '',\n compact: 'min-h-control-sm',\n comfortable: 'min-h-control-lg',\n};\n\n// The height role sizes a single-line row; block padding is only the floor for\n// wrapped content, one step below Item's ladder so one line never outgrows it.\nconst collectionBlockPaddingClasses: Record<CollectionDensity, string> = {\n default: 'py-row-y-sm',\n compact: 'py-space-2xs',\n comfortable: 'py-row-y',\n};\n\nexport function collectionRowClasses(density: CollectionDensity = 'default'): string {\n return `${popoverRecipes.row} ${collectionDensityClasses[density]} ${collectionBlockPaddingClasses[density]}`;\n}\n\n/** Shared interactive collection states, independent of Menu/listbox state ownership. */\nexport const collectionRecipes = {\n icons: '[&_svg]:pointer-events-none [&_svg]:size-icon [&_svg]:shrink-0',\n interactive: 'relative flex cursor-default items-center outline-none select-none transition-colors',\n highlighted: 'data-highlighted:bg-accent data-highlighted:text-accent-foreground data-highlighted:[&_svg]:text-accent-foreground',\n disabled: 'data-disabled:pointer-events-none data-disabled:opacity-50',\n destructive: 'data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive dark:data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:[&_svg]:text-destructive data-[variant=destructive]:data-highlighted:[&_svg]:text-destructive',\n // Compatibility for existing table and overflow-tab ActionMenu consumers.\n tableRow: 'min-h-action-xs py-space-2xs',\n} as const;\n"],"mappings":";;AAIA,IAAMC,IAAkB,eAOXC,IAAsB;CAClC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,SAAS;AACV,GAEaC,IAAiB;CAG7B,SAAS,uDAAuDH,EAAsB,SAAS,MAAM;CACrG,SAAS;CAET,gBAAgB;CAChB,MAAM;CACN,YAAYC;CAEZ,YAAY,GAAGA,EAAgB;CAG/B,eAAe;CAEf,YAAY;CACZ,WAAW,yCAAyCD,EAAsB,SAAS;CACnF,KAAK;AACN,GAIaI,IAAsB;CAClC,SAASD,EAAe;CACxB,SAASA,EAAe;CACxB,OAAO;AACR,GAKME,IAA8D;CACnE,SAAS;CACT,SAAS;CACT,aAAa;AACd,GAIMC,IAAmE;CACxE,SAAS;CACT,SAAS;CACT,aAAa;AACd;AAEA,SAAgBC,EAAqB,IAA6B,WAAmB;CACpF,OAAO,GAAGJ,EAAe,IAAI,GAAGE,EAAyBG,GAAS,GAAGF,EAA8BE;AACpG;AAGA,IAAaC,IAAoB;CAChC,OAAO;CACP,aAAa;CACb,aAAa;CACb,UAAU;CACV,aAAa;CAEb,UAAU;AACX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./utils-
|
|
1
|
+
import { t as e } from "./utils-DhuoqFy4.js";
|
|
2
2
|
//#region src/lib/portal-recipes.ts
|
|
3
3
|
function t(t) {
|
|
4
4
|
return (n) => e("contents", typeof t == "function" ? t(n) : t);
|
|
@@ -6,4 +6,4 @@ function t(t) {
|
|
|
6
6
|
//#endregion
|
|
7
7
|
export { t };
|
|
8
8
|
|
|
9
|
-
//# sourceMappingURL=portal-recipes-
|
|
9
|
+
//# sourceMappingURL=portal-recipes-DyUXqUtD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal-recipes-
|
|
1
|
+
{"version":3,"file":"portal-recipes-DyUXqUtD.js","names":["cn","portalClassName","className","state"],"sources":["../src/lib/portal-recipes.ts"],"sourcesContent":["import { cn } from './utils';\n\n/** Native portals retain their DOM/theme boundary without becoming flex/grid\n * items. Native class callbacks and deliberate display overrides still win. */\nexport function portalClassName<State>(className?: string | ((state: State) => string | undefined)) {\n return (state: State) => cn('contents', typeof className === 'function' ? className(state) : className);\n}\n"],"mappings":";;AAIA,SAAgBC,EAAuB,GAA6D;CACnG,QAAQ,MAAiBD,EAAG,YAAY,OAAOE,KAAc,aAAaA,EAAUC,CAAK,IAAID,CAAS;AACvG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { f as e, v as t } from "./ui-provider-C-74NVLc.js";
|
|
3
|
-
import { t as n } from "./utils-
|
|
4
|
-
import { c as r, i, l as a, r as o, u as s } from "./typography-
|
|
3
|
+
import { t as n } from "./utils-DhuoqFy4.js";
|
|
4
|
+
import { c as r, i, l as a, r as o, u as s } from "./typography-C7-YMW1S.js";
|
|
5
5
|
import { i as c } from "./text.styles-B64My8RZ.js";
|
|
6
|
-
import { n as l,
|
|
6
|
+
import { n as l, r as u, s as d, t as f } from "./value-typography-uSzzG9Gf.js";
|
|
7
7
|
import { t as p } from "./initials-format-CDoQEOd_.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
@@ -153,8 +153,13 @@ function z({ value: e, strategy: t, maxCharacters: r, locale: i, fallback: a, si
|
|
|
153
153
|
//#endregion
|
|
154
154
|
//#region src/components/primitives/link.tsx
|
|
155
155
|
function B({ children: e, emptyLabel: r = "—", className: l, ref: u, ...d }) {
|
|
156
|
-
let f = s(), { defaultTextSize: p } = t()
|
|
157
|
-
return /* @__PURE__ */ h(
|
|
156
|
+
let f = s(), { defaultTextSize: p } = t();
|
|
157
|
+
return e == null || e === "" ? /* @__PURE__ */ h(V, {
|
|
158
|
+
ref: u,
|
|
159
|
+
className: n("link--component", l),
|
|
160
|
+
emptyLabel: r,
|
|
161
|
+
linkProps: d
|
|
162
|
+
}) : /* @__PURE__ */ h("a", {
|
|
158
163
|
ref: u,
|
|
159
164
|
"data-typography": "link",
|
|
160
165
|
className: n(c({
|
|
@@ -167,11 +172,11 @@ function B({ children: e, emptyLabel: r = "—", className: l, ref: u, ...d }) {
|
|
|
167
172
|
...d,
|
|
168
173
|
children: /* @__PURE__ */ h(a.Provider, {
|
|
169
174
|
value: !0,
|
|
170
|
-
children:
|
|
175
|
+
children: e
|
|
171
176
|
})
|
|
172
177
|
});
|
|
173
178
|
}
|
|
174
|
-
function V({ className: e, emptyLabel: t, ref: n,
|
|
179
|
+
function V({ className: e, emptyLabel: t, ref: n, linkProps: r }) {
|
|
175
180
|
let { href: i, target: a, rel: o, download: s, hrefLang: c, ping: l, referrerPolicy: u, media: d, type: f, ...p } = r;
|
|
176
181
|
return /* @__PURE__ */ h(E, {
|
|
177
182
|
...p,
|
|
@@ -185,7 +190,7 @@ function H({ value: e, display: t, subject: r, body: i, className: a, emptyLabel
|
|
|
185
190
|
ref: s,
|
|
186
191
|
className: n("email--component", a),
|
|
187
192
|
emptyLabel: o,
|
|
188
|
-
|
|
193
|
+
linkProps: c
|
|
189
194
|
});
|
|
190
195
|
let l = new URLSearchParams();
|
|
191
196
|
r && l.set("subject", r), i && l.set("body", i);
|
|
@@ -205,7 +210,7 @@ function U(e) {
|
|
|
205
210
|
function W({ value: e, display: t, className: r, emptyLabel: i = "—", ref: a, ...o }) {
|
|
206
211
|
return e ? /* @__PURE__ */ h(B, {
|
|
207
212
|
ref: a,
|
|
208
|
-
className: n("phone--component", r),
|
|
213
|
+
className: n("phone--component wrap-normal", r),
|
|
209
214
|
href: `tel:${U(e)}`,
|
|
210
215
|
emptyLabel: i,
|
|
211
216
|
...o,
|
|
@@ -214,7 +219,7 @@ function W({ value: e, display: t, className: r, emptyLabel: i = "—", ref: a,
|
|
|
214
219
|
ref: a,
|
|
215
220
|
className: n("phone--component", r),
|
|
216
221
|
emptyLabel: i,
|
|
217
|
-
|
|
222
|
+
linkProps: o
|
|
218
223
|
});
|
|
219
224
|
}
|
|
220
225
|
function G(e) {
|
|
@@ -225,7 +230,7 @@ function K({ value: e, display: t, external: r, target: i, rel: a, className: o,
|
|
|
225
230
|
ref: c,
|
|
226
231
|
className: n("url--component", o),
|
|
227
232
|
emptyLabel: s,
|
|
228
|
-
|
|
233
|
+
linkProps: {
|
|
229
234
|
...l,
|
|
230
235
|
target: i,
|
|
231
236
|
rel: a
|
|
@@ -302,18 +307,18 @@ var ne = {
|
|
|
302
307
|
type: "main",
|
|
303
308
|
weight: "regular"
|
|
304
309
|
};
|
|
305
|
-
function re({ value: t, from: i = "seconds", locale: a, maxParts: o = 2, unitDisplay: s = "narrow", minimumFractionDigits: c, maximumFractionDigits:
|
|
310
|
+
function re({ value: t, from: i = "seconds", locale: a, maxParts: o = 2, unitDisplay: s = "narrow", minimumFractionDigits: c, maximumFractionDigits: d, emptyLabel: p = "—", size: m, align: g = "right", weight: _, type: v, className: y, ref: b, ...x }) {
|
|
306
311
|
let S = e(), C = l({
|
|
307
312
|
size: m,
|
|
308
313
|
type: v,
|
|
309
314
|
weight: _
|
|
310
|
-
}, ne), w = t == null ? null :
|
|
315
|
+
}, ne), w = t == null ? null : u(t, {
|
|
311
316
|
from: i,
|
|
312
317
|
locale: a ?? S.locale,
|
|
313
318
|
maxParts: o,
|
|
314
319
|
unitDisplay: s,
|
|
315
320
|
minimumFractionDigits: c,
|
|
316
|
-
maximumFractionDigits:
|
|
321
|
+
maximumFractionDigits: d ?? (i === "milliseconds" ? 1 : void 0)
|
|
317
322
|
}), T = w === null || w === "—", E = T ? f(C, _) : C;
|
|
318
323
|
return /* @__PURE__ */ h(r, {
|
|
319
324
|
ref: b,
|
|
@@ -345,9 +350,9 @@ function Q(e) {
|
|
|
345
350
|
function $(e, t, { depth: n, unit: r, separator: i = " × ", locale: a, options: o } = {}) {
|
|
346
351
|
let s = Q(e), c = Q(t), l = Q(n);
|
|
347
352
|
if (s === null || c === null || n != null && n !== "" && l === null) return null;
|
|
348
|
-
let
|
|
353
|
+
let u = new Intl.NumberFormat(a, o), f = [s, c];
|
|
349
354
|
l !== null && f.push(l);
|
|
350
|
-
let p = f.map((e) => u
|
|
355
|
+
let p = f.map((e) => d(u, e)).join(i);
|
|
351
356
|
return r ? `${p} ${r}` : p;
|
|
352
357
|
}
|
|
353
358
|
function ae({ width: t, height: i, depth: a, unit: o, separator: s = " × ", locale: c, options: u, emptyLabel: d = "—", size: p, align: _ = "right", weight: v, type: y, className: b, ref: x, ...S }) {
|
|
@@ -377,4 +382,4 @@ function ae({ width: t, height: i, depth: a, unit: o, separator: s = " × ", loc
|
|
|
377
382
|
//#endregion
|
|
378
383
|
export { S as _, Z as a, W as c, R as d, L as f, C as g, w as h, te as i, K as l, T as m, $ as n, H as o, E as p, re as r, B as s, ae as t, z as u };
|
|
379
384
|
|
|
380
|
-
//# sourceMappingURL=primitives-
|
|
385
|
+
//# sourceMappingURL=primitives-BkkQjYl7.js.map
|