themelia-react-ui 2.0.3 → 2.0.4
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 +50 -0
- package/README.md +65 -28
- package/dist/{accordion-Cjb6sx0G.js → accordion-96o0pN62.js} +5 -5
- package/dist/{accordion-Cjb6sx0G.js.map → accordion-96o0pN62.js.map} +1 -1
- package/dist/action-menu-CHgs8vmj.js +281 -0
- package/dist/action-menu-CHgs8vmj.js.map +1 -0
- package/dist/{affordance-geometry.generated-tF36bREk.js → affordance-geometry.generated-B8yGOr8-.js} +7 -1
- package/dist/affordance-geometry.generated-B8yGOr8-.js.map +1 -0
- package/dist/{ai-artifact-DvTwDVyL.js → ai-artifact-BZUGwBq6.js} +277 -276
- package/dist/ai-artifact-BZUGwBq6.js.map +1 -0
- package/dist/{app-shell-C4FhvCqF.js → app-shell-D63ATkIK.js} +84 -83
- package/dist/app-shell-D63ATkIK.js.map +1 -0
- package/dist/{attachment-BxDfL2mw.js → attachment-DkoqHPPl.js} +7 -7
- package/dist/{attachment-BxDfL2mw.js.map → attachment-DkoqHPPl.js.map} +1 -1
- package/dist/{auth-BGua8ouh.js → auth-D2FVZ1MH.js} +10 -10
- package/dist/{auth-BGua8ouh.js.map → auth-D2FVZ1MH.js.map} +1 -1
- package/dist/{avatar-DAPlDvhJ.js → avatar-DWO_HHhB.js} +5 -5
- package/dist/{avatar-DAPlDvhJ.js.map → avatar-DWO_HHhB.js.map} +1 -1
- package/dist/{badge-HpFqoqSY.js → badge-DErMA7ul.js} +4 -4
- package/dist/{badge-HpFqoqSY.js.map → badge-DErMA7ul.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 +13 -13
- 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 +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +3 -3
- package/dist/base/inline-edit.js +10 -10
- 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 +9 -9
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +6 -6
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +4 -4
- 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 +3 -3
- 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-DnUJ21NQ.js → batch-action-bar-CdfIkCsV.js} +4 -4
- package/dist/{batch-action-bar-DnUJ21NQ.js.map → batch-action-bar-CdfIkCsV.js.map} +1 -1
- package/dist/blocks/admin.js +20 -20
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +15 -15
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +17 -17
- 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 +570 -567
- 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-C-oqs1sQ.js → breadcrumbs-B-WFKecD.js} +4 -4
- package/dist/{breadcrumbs-C-oqs1sQ.js.map → breadcrumbs-B-WFKecD.js.map} +1 -1
- package/dist/{button-DVzspB_G.js → button-DkmK-z8E.js} +2 -2
- package/dist/{button-DVzspB_G.js.map → button-DkmK-z8E.js.map} +1 -1
- package/dist/{buttons-DPZekJFu.js → buttons-BbfzgczK.js} +8 -8
- package/dist/{buttons-DPZekJFu.js.map → buttons-BbfzgczK.js.map} +1 -1
- package/dist/{cards-BaBZR-AU.js → cards-4JTWqvVe.js} +10 -10
- package/dist/cards-4JTWqvVe.js.map +1 -0
- package/dist/{chart-ZOYyK2xG.js → chart-C19flDQb.js} +4 -4
- package/dist/{chart-ZOYyK2xG.js.map → chart-C19flDQb.js.map} +1 -1
- package/dist/{checkbox-AWIhNhmo.js → checkbox-CzYUTPeJ.js} +9 -5
- package/dist/checkbox-CzYUTPeJ.js.map +1 -0
- package/dist/{choice-inputs-CNHvARCJ.js → choice-inputs-JLtij2y4.js} +182 -176
- package/dist/choice-inputs-JLtij2y4.js.map +1 -0
- package/dist/{code-block-DeneBJR_.js → code-block-CGNaUtAE.js} +7 -7
- package/dist/{code-block-DeneBJR_.js.map → code-block-CGNaUtAE.js.map} +1 -1
- package/dist/{collapsible-C-_l4hpy.js → collapsible-Do4G0zcC.js} +3 -3
- package/dist/{collapsible-C-_l4hpy.js.map → collapsible-Do4G0zcC.js.map} +1 -1
- package/dist/{collection-content-By56pLog.js → collection-content-C0e8SsTm.js} +3 -3
- package/dist/{collection-content-By56pLog.js.map → collection-content-C0e8SsTm.js.map} +1 -1
- package/dist/{combobox-Dxo2fAYQ.js → combobox-CBJDs6w_.js} +12 -12
- package/dist/{combobox-Dxo2fAYQ.js.map → combobox-CBJDs6w_.js.map} +1 -1
- package/dist/{combobox-DaHESuiL.js → combobox-hbhSS18O.js} +7 -7
- package/dist/{combobox-DaHESuiL.js.map → combobox-hbhSS18O.js.map} +1 -1
- package/dist/{command-C25VMRII.js → command-D8NrBj-b.js} +7 -7
- package/dist/{command-C25VMRII.js.map → command-D8NrBj-b.js.map} +1 -1
- package/dist/{comments-DD0DUPwJ.js → comments-Di4w0H_S.js} +383 -382
- package/dist/comments-Di4w0H_S.js.map +1 -0
- package/dist/components/base/action-menu/action-menu.d.ts +2 -0
- package/dist/components/base/cards/card.recipes.d.ts +12 -5
- package/dist/components/base/cards/smart-card.types.d.ts +12 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +7 -2
- package/dist/components/base/choice-inputs/switch-card.d.ts +7 -0
- package/dist/components/base/choice-inputs/toggle-field.d.ts +7 -0
- package/dist/components/base/date-pickers/datepicker.types.d.ts +7 -0
- package/dist/components/base/forms/controlled-form-field.d.ts +6 -6
- package/dist/components/base/forms/form-field.d.ts +5 -3
- package/dist/components/base/forms/index.d.ts +1 -0
- package/dist/components/base/forms/server-errors.d.ts +16 -0
- package/dist/components/base/forms/workflow.d.ts +5 -2
- package/dist/components/base/metadata-list/metadata-list.d.ts +3 -1
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -2
- package/dist/components/base/structure/composition.recipes.d.ts +17 -0
- package/dist/components/base/text-inputs/hooks/use-form-field-state.d.ts +7 -2
- package/dist/components/base/text-inputs/input.d.ts +4 -2
- package/dist/components/base/text-inputs/textarea.d.ts +4 -2
- package/dist/components/base/value-inputs/date-time-input.d.ts +2 -1
- package/dist/components/base/value-inputs/slider.d.ts +5 -1
- package/dist/components/base/value-inputs/tags-input.d.ts +5 -1
- package/dist/components/typography/text.styles.d.ts +26 -1
- package/dist/composition.recipes-COdiFhxB.js +19 -0
- package/dist/composition.recipes-COdiFhxB.js.map +1 -0
- package/dist/containers-CRmHf7GP.js +104 -0
- package/dist/containers-CRmHf7GP.js.map +1 -0
- package/dist/{copyable-ClBuk_UK.js → copyable-CnGCZdX4.js} +4 -4
- package/dist/{copyable-ClBuk_UK.js.map → copyable-CnGCZdX4.js.map} +1 -1
- package/dist/{data-display-DT_khPl_.js → data-display-D4oujtx0.js} +239 -238
- package/dist/data-display-D4oujtx0.js.map +1 -0
- package/dist/{date-DCrsDTZc.js → date-Q7jnXxpk.js} +5 -5
- package/dist/{date-DCrsDTZc.js.map → date-Q7jnXxpk.js.map} +1 -1
- package/dist/{date-picker-B2K3ucWn.js → date-picker-zOt1oNss.js} +102 -90
- package/dist/date-picker-zOt1oNss.js.map +1 -0
- package/dist/date-pickers-cj8IXbDC.js +179 -0
- package/dist/date-pickers-cj8IXbDC.js.map +1 -0
- package/dist/{display-hAc1HjpI.js → display-BB4BL_-K.js} +8 -8
- package/dist/{display-hAc1HjpI.js.map → display-BB4BL_-K.js.map} +1 -1
- package/dist/{dropdown-menu-Cl4X7L5S.js → dropdown-menu-CjY8Vt7W.js} +8 -8
- package/dist/{dropdown-menu-Cl4X7L5S.js.map → dropdown-menu-CjY8Vt7W.js.map} +1 -1
- package/dist/features/activities.js +11 -11
- package/dist/features/ai-chat.js +9 -9
- package/dist/features/appointment-calendar.js +222 -220
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +8 -8
- 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 +275 -274
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +199 -198
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +12 -12
- package/dist/features/kanban.js +4 -4
- package/dist/features/map.js +7 -7
- package/dist/features/media-library.js +623 -622
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +973 -969
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +12 -12
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +113 -112
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +254 -253
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +19 -19
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-BYIhtitP.js → feedback-DZNL5Lg1.js} +9 -9
- package/dist/{feedback-BYIhtitP.js.map → feedback-DZNL5Lg1.js.map} +1 -1
- package/dist/{field-affordance-recipes-DZhnIL_Y.js → field-affordance-recipes-DjwGx8eM.js} +2 -2
- package/dist/{field-affordance-recipes-DZhnIL_Y.js.map → field-affordance-recipes-DjwGx8eM.js.map} +1 -1
- package/dist/{filters-DJVAveHA.js → filters-BcT-uoFy.js} +19 -19
- package/dist/{filters-DJVAveHA.js.map → filters-BcT-uoFy.js.map} +1 -1
- package/dist/{form-field-CwH9y77i.js → form-field-CsgRmdit.js} +14 -8
- package/dist/form-field-CsgRmdit.js.map +1 -0
- package/dist/{form-sizing-BdP_Mf5p.js → form-sizing-NXgjkmBG.js} +3 -3
- package/dist/{form-sizing-BdP_Mf5p.js.map → form-sizing-NXgjkmBG.js.map} +1 -1
- package/dist/{forms-B9G_xwzi.js → forms-BV5m5aQF.js} +83 -65
- package/dist/forms-BV5m5aQF.js.map +1 -0
- package/dist/{forms-numeric-B_jraJaQ.js → forms-numeric-Cd33AKbD.js} +288 -288
- package/dist/forms-numeric-Cd33AKbD.js.map +1 -0
- package/dist/{header-BSfIEWbI.js → header-BA697l4a.js} +14 -14
- package/dist/{header-BSfIEWbI.js.map → header-BA697l4a.js.map} +1 -1
- package/dist/hooks/useFormErrors.d.ts +1 -1
- package/dist/{hooks-ClH9thn4.js → hooks-BQ-L7Uu2.js} +2 -2
- package/dist/{hooks-ClH9thn4.js.map → hooks-BQ-L7Uu2.js.map} +1 -1
- package/dist/{icon-badge-DYKIwvOV.js → icon-badge-COWbCCWu.js} +3 -3
- package/dist/{icon-badge-DYKIwvOV.js.map → icon-badge-COWbCCWu.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-Cdw4k0fb.js +289 -0
- package/dist/input-Cdw4k0fb.js.map +1 -0
- package/dist/{input-CZw8iU99.js → input-DOPL5_QE.js} +3 -3
- package/dist/{input-CZw8iU99.js.map → input-DOPL5_QE.js.map} +1 -1
- package/dist/item-BvZ2DR_x.js +277 -0
- package/dist/item-BvZ2DR_x.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 +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +6 -0
- package/dist/lib/ui-provider/types.d.ts +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-3zIVLMWH.js → media-gallery-CSl5W1Fy.js} +6 -6
- package/dist/{media-gallery-3zIVLMWH.js.map → media-gallery-CSl5W1Fy.js.map} +1 -1
- package/dist/{mentions-CGlEJ15c.js → mentions-RKOQaaIB.js} +8 -8
- package/dist/{mentions-CGlEJ15c.js.map → mentions-RKOQaaIB.js.map} +1 -1
- package/dist/{message-DZ_ruyUV.js → message-INU2xsxu.js} +4 -4
- package/dist/{message-DZ_ruyUV.js.map → message-INU2xsxu.js.map} +1 -1
- package/dist/metadata-list-qVV7AVxa.js +443 -0
- package/dist/metadata-list-qVV7AVxa.js.map +1 -0
- package/dist/{navigation-BzhHI3lo.js → navigation-BQNcg1jT.js} +8 -8
- package/dist/{navigation-BzhHI3lo.js.map → navigation-BQNcg1jT.js.map} +1 -1
- package/dist/{navigation-Bnotn4AQ.js → navigation-DLF3E1IC.js} +7 -7
- package/dist/{navigation-Bnotn4AQ.js.map → navigation-DLF3E1IC.js.map} +1 -1
- package/dist/{navigation-row-recipes-BFLCk_Aq.js → navigation-row-recipes-WZEs-hYo.js} +2 -2
- package/dist/{navigation-row-recipes-BFLCk_Aq.js.map → navigation-row-recipes-WZEs-hYo.js.map} +1 -1
- package/dist/{number-DbV1Dija.js → number-E_OiIfJz.js} +5 -5
- package/dist/{number-DbV1Dija.js.map → number-E_OiIfJz.js.map} +1 -1
- package/dist/{overflow-tab-bar-CWY7Nogn.js → overflow-tab-bar-CrbqMteP.js} +107 -105
- package/dist/overflow-tab-bar-CrbqMteP.js.map +1 -0
- package/dist/{overlays-tMkF-VAN.js → overlays-BlKynmde.js} +228 -227
- package/dist/overlays-BlKynmde.js.map +1 -0
- package/dist/page-CIwNUtGr.js +227 -0
- package/dist/page-CIwNUtGr.js.map +1 -0
- package/dist/page-header-commands-DFMlNYzN.js +128 -0
- package/dist/page-header-commands-DFMlNYzN.js.map +1 -0
- package/dist/{pagination-BL25hu2s.js → pagination-Ch8X_47u.js} +5 -5
- package/dist/{pagination-BL25hu2s.js.map → pagination-Ch8X_47u.js.map} +1 -1
- package/dist/{popover-menu-Cn9rUkdc.js → popover-menu-BYaCdFhf.js} +6 -6
- package/dist/{popover-menu-Cn9rUkdc.js.map → popover-menu-BYaCdFhf.js.map} +1 -1
- package/dist/{popover-gnTOhbFM.js → popover-uwzX2vo7.js} +4 -4
- package/dist/{popover-gnTOhbFM.js.map → popover-uwzX2vo7.js.map} +1 -1
- package/dist/{primitives-BFK08r9M.js → primitives-Du64iDbb.js} +6 -6
- package/dist/{primitives-BFK08r9M.js.map → primitives-Du64iDbb.js.map} +1 -1
- package/dist/primitives.js +4 -4
- package/dist/{progress-B1VnCT0K.js → progress-BvF2oCdV.js} +5 -5
- package/dist/{progress-B1VnCT0K.js.map → progress-BvF2oCdV.js.map} +1 -1
- package/dist/{receipt-BVSOH3Xo.js → receipt-D789Jwyy.js} +6 -6
- package/dist/{receipt-BVSOH3Xo.js.map → receipt-D789Jwyy.js.map} +1 -1
- package/dist/{rich-text-GOUyKQ-s.js → rich-text-CLJEf76s.js} +4 -4
- package/dist/{rich-text-GOUyKQ-s.js.map → rich-text-CLJEf76s.js.map} +1 -1
- package/dist/{rich-text-editor-cRLC-eBK.js → rich-text-editor-Cm1dpUpQ.js} +10 -10
- package/dist/{rich-text-editor-cRLC-eBK.js.map → rich-text-editor-Cm1dpUpQ.js.map} +1 -1
- package/dist/{rich-text-editor-toolbar-DfXg0-VC.js → rich-text-editor-toolbar-L__e4x47.js} +4 -4
- package/dist/{rich-text-editor-toolbar-DfXg0-VC.js.map → rich-text-editor-toolbar-L__e4x47.js.map} +1 -1
- package/dist/{scroll-area-DcI-M1UT.js → scroll-area-La5RXsEk.js} +2 -2
- package/dist/{scroll-area-DcI-M1UT.js.map → scroll-area-La5RXsEk.js.map} +1 -1
- package/dist/{separator-Bom7NsGO.js → separator-DAEV0w65.js} +2 -2
- package/dist/{separator-Bom7NsGO.js.map → separator-DAEV0w65.js.map} +1 -1
- package/dist/{separator-BDV-Y648.js → separator-GNfPG-90.js} +3 -3
- package/dist/{separator-BDV-Y648.js.map → separator-GNfPG-90.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-BA2iboic.js +174 -0
- package/dist/settings-BA2iboic.js.map +1 -0
- package/dist/{sheet-ijlsjq-n.js → sheet-DoAxTb2J.js} +7 -7
- package/dist/{sheet-ijlsjq-n.js.map → sheet-DoAxTb2J.js.map} +1 -1
- package/dist/{sidebar-DkTO4VTO.js → sidebar-ByqKR_W5.js} +13 -13
- package/dist/{sidebar-DkTO4VTO.js.map → sidebar-ByqKR_W5.js.map} +1 -1
- package/dist/{sidebar-Db6gkh3U.js → sidebar-D2iSnGJ7.js} +11 -11
- package/dist/{sidebar-Db6gkh3U.js.map → sidebar-D2iSnGJ7.js.map} +1 -1
- package/dist/{skeleton-Byjnt7qr.js → skeleton-CUj8O5Bd.js} +3 -3
- package/dist/{skeleton-Byjnt7qr.js.map → skeleton-CUj8O5Bd.js.map} +1 -1
- package/dist/smart-card-CqkzQsK-.js +614 -0
- package/dist/smart-card-CqkzQsK-.js.map +1 -0
- package/dist/{structure-BmisBK-3.js → structure-C0V0_Fyf.js} +3 -3
- package/dist/{structure-BmisBK-3.js.map → structure-C0V0_Fyf.js.map} +1 -1
- package/dist/{structure.recipes-EPz60cU8.js → structure.recipes-BB4-n58V.js} +2 -2
- package/dist/{structure.recipes-EPz60cU8.js.map → structure.recipes-BB4-n58V.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{table-DsfzoUia.js → table-CpvnzJn9.js} +3 -3
- package/dist/{table-DsfzoUia.js.map → table-CpvnzJn9.js.map} +1 -1
- package/dist/{table-BweFy_P9.js → table-DH7rozUv.js} +19 -19
- package/dist/{table-BweFy_P9.js.map → table-DH7rozUv.js.map} +1 -1
- package/dist/{tabs-CDocW5D1.js → tabs-eqVsJZWO.js} +7 -7
- package/dist/{tabs-CDocW5D1.js.map → tabs-eqVsJZWO.js.map} +1 -1
- package/dist/{text-inputs-f9Ia-aCi.js → text-inputs-DXItiR0O.js} +101 -98
- package/dist/text-inputs-DXItiR0O.js.map +1 -0
- package/dist/{text.styles-g4He6UIW.js → text.styles-B64My8RZ.js} +25 -10
- package/dist/text.styles-B64My8RZ.js.map +1 -0
- package/dist/theme.css +152 -112
- package/dist/{timelines-CwM_9IhD.js → timelines-DmtztAY_.js} +10 -10
- package/dist/{timelines-CwM_9IhD.js.map → timelines-DmtztAY_.js.map} +1 -1
- package/dist/{tooltip-yiRJUFjp.js → tooltip-B4hjKtoV.js} +3 -3
- package/dist/{tooltip-yiRJUFjp.js.map → tooltip-B4hjKtoV.js.map} +1 -1
- package/dist/{tree-WnKQzwbq.js → tree-CV11PURP.js} +8 -8
- package/dist/{tree-WnKQzwbq.js.map → tree-CV11PURP.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CSyJrh28.js +117 -0
- package/dist/typography-CSyJrh28.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-C_U0Xma4.js → ui-provider-CQCuCBcy.js} +3 -3
- package/dist/ui-provider-CQCuCBcy.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-CXyxmQBP.js → upload-C9SA0X-8.js} +11 -11
- package/dist/{upload-CXyxmQBP.js.map → upload-C9SA0X-8.js.map} +1 -1
- package/dist/{upload-queue-Boscubn9.js → upload-queue-DhQJiSRc.js} +9 -9
- package/dist/{upload-queue-Boscubn9.js.map → upload-queue-DhQJiSRc.js.map} +1 -1
- package/dist/{usage-card-BhO5eqkX.js → usage-card-DVTRDmGz.js} +134 -133
- package/dist/usage-card-DVTRDmGz.js.map +1 -0
- package/dist/{utils-BRhFDwuU.js → utils-CF3c95Io.js} +68 -5
- package/dist/utils-CF3c95Io.js.map +1 -0
- package/dist/value-inputs-C0o70p-U.js +980 -0
- package/dist/value-inputs-C0o70p-U.js.map +1 -0
- package/dist/{value-typography-BP8OG6h5.js → value-typography-ClupF0Gz.js} +2 -2
- package/dist/{value-typography-BP8OG6h5.js.map → value-typography-ClupF0Gz.js.map} +1 -1
- package/dist/workspace-9EFVXUyk.js +410 -0
- package/dist/workspace-9EFVXUyk.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +14 -129
- package/docs/consumer-skill/examples/app-layout.tsx +22 -12
- package/docs/consumer-skill/examples/authentication.tsx +77 -0
- package/docs/consumer-skill/examples/edit.tsx +30 -38
- package/docs/consumer-skill/examples/manifest.json +51 -1
- package/docs/consumer-skill/examples/rhf-bindings.tsx +86 -0
- package/docs/consumer-skill/examples/rhf-edit-page.tsx +141 -0
- package/docs/consumer-skill/examples/rhf-overlay-form.tsx +92 -0
- package/docs/consumer-skill/examples/rhf-transport.tsx +28 -0
- package/docs/consumer-skill/references/agents-md.md +17 -7
- package/docs/consumer-skill/references/authentication.md +42 -0
- package/docs/consumer-skill/references/component-contracts.json +319824 -0
- package/docs/consumer-skill/references/composition-mapping.md +92 -0
- package/docs/consumer-skill/references/composition.md +43 -19
- package/docs/consumer-skill/references/design-contract.md +32 -0
- package/docs/consumer-skill/references/discovery.md +84 -7
- package/docs/consumer-skill/references/installation.md +40 -36
- package/docs/consumer-skill/references/integration.md +6 -2
- package/docs/consumer-skill/references/public-api.json +1519 -65
- package/docs/consumer-skill/references/review.md +9 -4
- package/docs/consumer-skill/references/rhf-workflows.md +86 -0
- package/docs/consumer-skill/references/screen-archetypes.md +22 -0
- package/docs/consumer-skill/references/theming.md +8 -9
- package/docs/consumer-skill/references/tokens.json +12 -3
- package/docs/consumer-skill/references/workflows.md +2 -1
- package/docs/consumer-skill/scripts/composition-schema.d.mts +2 -0
- package/docs/consumer-skill/scripts/composition-schema.mjs +32 -0
- package/docs/consumer-skill/scripts/composition.mjs +198 -0
- package/docs/consumer-skill/scripts/discovery.mjs +42 -10
- package/docs/consumer-skill/scripts/inspect-component.mjs +11 -0
- package/docs/consumer-skill/scripts/inspect-tokens.mjs +11 -0
- package/docs/consumer-skill/scripts/inspection.mjs +138 -0
- package/docs/consumer-skill/scripts/map-composition.mjs +12 -0
- package/docs/consumer-skill/scripts/setup-skills.mjs +76 -0
- package/docs/consumer-skills/themelia-components/SKILL.md +30 -0
- package/docs/consumer-skills/themelia-composition/SKILL.md +35 -0
- package/docs/consumer-skills/themelia-forms/SKILL.md +12 -0
- package/docs/consumer-skills/themelia-foundation/SKILL.md +14 -0
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +35 -0
- package/package.json +4 -2
- package/templates/README.md +39 -0
- package/templates/admin-shell-template.tsx +382 -0
- package/templates/analytics-operations-template.tsx +376 -0
- package/templates/customers-template.tsx +509 -0
- package/templates/index.ts +29 -0
- package/templates/orders-template.tsx +1102 -0
- package/templates/products-template.tsx +834 -0
- package/templates/user-permissions-template.tsx +450 -0
- package/dist/action-menu-CllU52Mm.js +0 -280
- package/dist/action-menu-CllU52Mm.js.map +0 -1
- package/dist/affordance-geometry.generated-tF36bREk.js.map +0 -1
- package/dist/ai-artifact-DvTwDVyL.js.map +0 -1
- package/dist/app-shell-C4FhvCqF.js.map +0 -1
- package/dist/cards-BaBZR-AU.js.map +0 -1
- package/dist/checkbox-AWIhNhmo.js.map +0 -1
- package/dist/choice-inputs-CNHvARCJ.js.map +0 -1
- package/dist/comments-DD0DUPwJ.js.map +0 -1
- package/dist/containers-Mu1LMGV1.js +0 -103
- package/dist/containers-Mu1LMGV1.js.map +0 -1
- package/dist/data-display-DT_khPl_.js.map +0 -1
- package/dist/date-picker-B2K3ucWn.js.map +0 -1
- package/dist/date-pickers-Ds8gLaoP.js +0 -175
- package/dist/date-pickers-Ds8gLaoP.js.map +0 -1
- package/dist/form-field-CwH9y77i.js.map +0 -1
- package/dist/forms-B9G_xwzi.js.map +0 -1
- package/dist/forms-numeric-B_jraJaQ.js.map +0 -1
- package/dist/input-DQdEd0YD.js +0 -263
- package/dist/input-DQdEd0YD.js.map +0 -1
- package/dist/item-K5_ghvze.js +0 -275
- package/dist/item-K5_ghvze.js.map +0 -1
- package/dist/metadata-list-8N16ZMW_.js +0 -405
- package/dist/metadata-list-8N16ZMW_.js.map +0 -1
- package/dist/overflow-tab-bar-CWY7Nogn.js.map +0 -1
- package/dist/overlays-tMkF-VAN.js.map +0 -1
- package/dist/page-CL9YeH_V.js +0 -224
- package/dist/page-CL9YeH_V.js.map +0 -1
- package/dist/page-header-commands-DOb6WsfD.js +0 -126
- package/dist/page-header-commands-DOb6WsfD.js.map +0 -1
- package/dist/settings-ybnjVwbd.js +0 -171
- package/dist/settings-ybnjVwbd.js.map +0 -1
- package/dist/smart-card-DiC5aac3.js +0 -604
- package/dist/smart-card-DiC5aac3.js.map +0 -1
- package/dist/text-inputs-f9Ia-aCi.js.map +0 -1
- package/dist/text.styles-g4He6UIW.js.map +0 -1
- package/dist/typography-UTnveOEy.js +0 -117
- package/dist/typography-UTnveOEy.js.map +0 -1
- package/dist/ui-provider-C_U0Xma4.js.map +0 -1
- package/dist/usage-card-BhO5eqkX.js.map +0 -1
- package/dist/utils-BRhFDwuU.js.map +0 -1
- package/dist/value-inputs-TaX4OjNk.js +0 -963
- package/dist/value-inputs-TaX4OjNk.js.map +0 -1
- package/dist/workspace-B-OEm3Kf.js +0 -408
- package/dist/workspace-B-OEm3Kf.js.map +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { s as e, v as t } from "./ui-provider-CQCuCBcy.js";
|
|
3
|
+
import { t as n } from "./utils-CF3c95Io.js";
|
|
4
|
+
import { a as r, n as i } from "./buttons-BbfzgczK.js";
|
|
5
|
+
import { t as a } from "./composition.recipes-COdiFhxB.js";
|
|
6
|
+
import { n as o } from "./action-menu-CHgs8vmj.js";
|
|
7
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/base/navigation/page-header/page-header-commands.tsx
|
|
9
|
+
var u = ({ href: e, external: t, target: n, rel: r, children: i, ...a }) => /* @__PURE__ */ c("a", {
|
|
10
|
+
href: e,
|
|
11
|
+
target: n ?? (t ? "_blank" : void 0),
|
|
12
|
+
rel: r ?? (t ? "noopener noreferrer" : void 0),
|
|
13
|
+
...a,
|
|
14
|
+
children: i
|
|
15
|
+
}), d = "max-h-[80vh] overflow-y-auto overscroll-contain";
|
|
16
|
+
function f(e) {
|
|
17
|
+
return !!e && e.visible !== !1;
|
|
18
|
+
}
|
|
19
|
+
function p(e, t) {
|
|
20
|
+
return f(e) || (t ?? []).some(f);
|
|
21
|
+
}
|
|
22
|
+
function m(e, t) {
|
|
23
|
+
return t === "secondary" ? {
|
|
24
|
+
tone: "secondary",
|
|
25
|
+
buttonStyle: "outline"
|
|
26
|
+
} : {
|
|
27
|
+
tone: e.destructive ? "destructive" : "primary",
|
|
28
|
+
buttonStyle: "solid"
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function h(e) {
|
|
32
|
+
return e.href && !e.onClick ? e.href : void 0;
|
|
33
|
+
}
|
|
34
|
+
function g({ action: a, role: o, renderLink: u, className: d }) {
|
|
35
|
+
let { defaultScale: f } = e(), { tone: p, buttonStyle: g } = m(a, o), _ = h(a), v = a.icon, y = n(`page-header--${o}-action`, d);
|
|
36
|
+
return _ && !a.disabled && !a.loading ? /* @__PURE__ */ c(s, { children: u({
|
|
37
|
+
href: _,
|
|
38
|
+
target: a.target,
|
|
39
|
+
rel: a.rel,
|
|
40
|
+
external: a.external,
|
|
41
|
+
className: n("button--component base-button--component", r({
|
|
42
|
+
tone: p,
|
|
43
|
+
buttonStyle: g,
|
|
44
|
+
size: t(void 0, f)
|
|
45
|
+
}), y),
|
|
46
|
+
children: /* @__PURE__ */ l(s, { children: [v && /* @__PURE__ */ c(v, {
|
|
47
|
+
className: "size-icon shrink-0",
|
|
48
|
+
"aria-hidden": "true"
|
|
49
|
+
}), a.label] })
|
|
50
|
+
}) }) : /* @__PURE__ */ c(i, {
|
|
51
|
+
type: "button",
|
|
52
|
+
tone: p,
|
|
53
|
+
buttonStyle: g,
|
|
54
|
+
icon: v,
|
|
55
|
+
loading: a.loading,
|
|
56
|
+
handlesLoading: a.loading !== void 0,
|
|
57
|
+
disabled: a.disabled,
|
|
58
|
+
onClick: a.onClick,
|
|
59
|
+
className: y,
|
|
60
|
+
children: a.label
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function _({ action: e, key: t }, n) {
|
|
64
|
+
return {
|
|
65
|
+
id: t,
|
|
66
|
+
label: e.label,
|
|
67
|
+
icon: e.icon,
|
|
68
|
+
onClick: e.onClick,
|
|
69
|
+
href: h(e),
|
|
70
|
+
target: e.target,
|
|
71
|
+
rel: e.rel,
|
|
72
|
+
external: e.external,
|
|
73
|
+
disabled: !!e.disabled || !!e.loading,
|
|
74
|
+
tone: e.destructive ? "destructive" : "secondary",
|
|
75
|
+
className: n
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function v({ primaryAction: e, secondaryActions: t, moreActionsLabel: r, renderLink: i = u }) {
|
|
79
|
+
let s = (t ?? []).map((e, t) => ({
|
|
80
|
+
action: e,
|
|
81
|
+
key: e.id ?? `secondary-${t}`
|
|
82
|
+
})).filter(({ action: e }) => f(e)), p = s.filter(({ action: e }) => !e.destructive), m = s.filter(({ action: e }) => e.destructive), h = p.slice(0, 2), v = p.slice(2), y = f(e) ? e : void 0;
|
|
83
|
+
if (!y && s.length === 0) return null;
|
|
84
|
+
let b = [
|
|
85
|
+
...h.map((e) => _(e, "sm:hidden")),
|
|
86
|
+
...v.map((e) => _(e)),
|
|
87
|
+
...m.map((e, t) => ({
|
|
88
|
+
..._(e),
|
|
89
|
+
group: !0,
|
|
90
|
+
groupClassName: t === 0 && h.length > 0 && v.length === 0 ? "sm:hidden" : void 0
|
|
91
|
+
}))
|
|
92
|
+
], x = v.length === 0 && m.length === 0;
|
|
93
|
+
return /* @__PURE__ */ l("div", {
|
|
94
|
+
"data-slot": "page-header-commands",
|
|
95
|
+
className: n("page-header--commands flex min-w-0 max-w-full flex-wrap items-center justify-end", a.commands),
|
|
96
|
+
children: [
|
|
97
|
+
h.map((e) => /* @__PURE__ */ c(g, {
|
|
98
|
+
action: e.action,
|
|
99
|
+
role: "secondary",
|
|
100
|
+
renderLink: i,
|
|
101
|
+
className: "max-sm:hidden"
|
|
102
|
+
}, e.key)),
|
|
103
|
+
y && /* @__PURE__ */ c(g, {
|
|
104
|
+
action: y,
|
|
105
|
+
role: "primary",
|
|
106
|
+
renderLink: i
|
|
107
|
+
}),
|
|
108
|
+
b.length > 0 && /* @__PURE__ */ c(o, {
|
|
109
|
+
actions: b,
|
|
110
|
+
context: "commands",
|
|
111
|
+
srText: r,
|
|
112
|
+
align: "end",
|
|
113
|
+
closeOnSelect: !0,
|
|
114
|
+
preserveOrder: !0,
|
|
115
|
+
contentClassName: d,
|
|
116
|
+
renderLink: (e) => i({
|
|
117
|
+
...e,
|
|
118
|
+
children: e.children ?? null
|
|
119
|
+
}),
|
|
120
|
+
buttonProps: { className: n("page-header--more-actions", x && "sm:hidden") }
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { p as n, v as t };
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=page-header-commands-DFMlNYzN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header-commands-DFMlNYzN.js","names":["_Fragment","useDensityConfig","resolveComponentScale","cn","buttonVariants","Button","compositionClasses","ActionMenu","defaultPageHeaderLinkRenderer","props","target","external","rel","MENU_CONTENT_CLASS","isVisible","action","hasPageHeaderCommands","primaryAction","secondaryActions","presentation","role","linkDestination","CommandButton","href","Icon","hookClassName","className","Fragment","renderLink","defaultScale","toMenuAction","key","PageHeaderCommands","secondary","index","routine","destructive","inline","overflow","primary","menuActions","entry","menuOnlyBelowSm","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 `sm`,\n * secondary commands collapse into that menu through CSS alone, so server and\n * client markup agree. PageHeading owns the row, so every header that takes\n * `primaryAction` and `secondaryActions` places its commands the same way.\n */\nimport type { ComponentType, MouseEvent, ReactElement, 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';\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 from `sm` up; later ones overflow. */\nexport const PAGE_HEADER_INLINE_SECONDARY_LIMIT = 2;\n\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/** 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\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\tmoreActionsLabel,\n\trenderLink = defaultPageHeaderLinkRenderer,\n}: PageHeaderCommandsProps) {\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\tconst inline = routine.slice(0, PAGE_HEADER_INLINE_SECONDARY_LIMIT);\n\tconst overflow = routine.slice(PAGE_HEADER_INLINE_SECONDARY_LIMIT);\n\tconst primary = isVisible(primaryAction) ? primaryAction : undefined;\n\n\tif (!primary && secondary.length === 0) return null;\n\n\t// Inline commands reappear in the menu only below `sm`, where they collapse.\n\tconst menuActions: ActionMenuAction[] = [\n\t\t...inline.map((entry) => toMenuAction(entry, 'sm:hidden')),\n\t\t...overflow.map((entry) => toMenuAction(entry)),\n\t\t...destructive.map((entry, index) => ({\n\t\t\t...toMenuAction(entry),\n\t\t\tgroup: true as const,\n\t\t\t// Only collapsed inline commands precede this boundary. Keep it on\n\t\t\t// their CSS visibility schedule; permanent overflow keeps its rule.\n\t\t\tgroupClassName: index === 0 && inline.length > 0 && overflow.length === 0 ? 'sm:hidden' : undefined,\n\t\t})),\n\t];\n\tconst menuOnlyBelowSm = 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<div\n\t\t\tdata-slot=\"page-header-commands\"\n\t\t\tclassName={cn('page-header--commands flex min-w-0 max-w-full flex-wrap items-center justify-end', compositionClasses.commands)}\n\t\t>\n\t\t\t{inline.map((entry) => (\n\t\t\t\t<CommandButton\n\t\t\t\t\tkey={entry.key}\n\t\t\t\t\taction={entry.action}\n\t\t\t\t\trole=\"secondary\"\n\t\t\t\t\trenderLink={renderLink}\n\t\t\t\t\tclassName=\"max-sm:hidden\"\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{primary && <CommandButton action={primary} role=\"primary\" renderLink={renderLink} />}\n\t\t\t{menuActions.length > 0 && (\n\t\t\t\t<ActionMenu\n\t\t\t\t\tactions={menuActions}\n\t\t\t\t\tcontext=\"commands\"\n\t\t\t\t\tsrText={moreActionsLabel}\n\t\t\t\t\talign=\"end\"\n\t\t\t\t\tcloseOnSelect\n\t\t\t\t\tpreserveOrder\n\t\t\t\t\tcontentClassName={MENU_CONTENT_CLASS}\n\t\t\t\t\trenderLink={renderMenuLink}\n\t\t\t\t\t// The shared outline overflow square follows the provider scale, like the commands.\n\t\t\t\t\tbuttonProps={{ className: cn('page-header--more-actions', menuOnlyBelowSm && 'sm:hidden') }}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAyEA,IAAaQ,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,IAAqB;AAiB3B,SAASC,EAAU,GAAkE;CACpF,OAAO,CAAC,CAACC,KAAUA,EAAO,YAAY;AACvC;AAGA,SAAgBC,EACf,GACA,GACC;CACD,OAAOF,EAAUG,CAAa,MAAMC,KAAoB,CAAC,EAAA,CAAG,KAAKJ,CAAS;AAC3E;AAEA,SAASK,EAAa,GAA0B,GAAmB;CAElE,OADIC,MAAS,cAAoB;EAAE,MAAM;EAAa,aAAa;CAAU,IACtE;EAAE,MAAML,EAAO,cAAc,gBAAgB;EAAW,aAAa;CAAQ;AACrF;AAGA,SAASM,EAAgB,GAA0B;CAClD,OAAON,EAAO,QAAQ,CAACA,EAAO,UAAUA,EAAO,OAAO,KAAA;AACvD;AAEA,SAASO,EAAc,EACtB,WACA,SACA,eACA,gBAME;CACF,IAAM,EAAE,oBAAiBrB,EAAiB,GACpC,EAAE,SAAM,mBAAgBkB,EAAaJ,GAAQK,CAAI,GACjDG,IAAOF,EAAgBN,CAAM,GAC7BS,IAAOT,EAAO,MACdU,IAAgBtB,EAAG,gBAAgBiB,EAAK,UAAUM,CAAS;CA0BjE,OAxBIH,KAAQ,CAACR,EAAO,YAAY,CAACA,EAAO,UAEtC,kBAAAf,GAAA,EAAA,UACE4B,EAAW;EACX;EACA,QAAQb,EAAO;EACf,KAAKA,EAAO;EACZ,UAAUA,EAAO;EACjB,WAAWZ,EACV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B,KAAA;CAE3D,IAAI,CAACsB,KAAWN,EAAU,WAAW,GAAG,OAAO;CAG/C,IAAMO,IAAkC;EACvC,GAAGH,EAAO,KAAK,MAAUP,EAAaW,GAAO,WAAW,CAAC;EACzD,GAAGH,EAAS,KAAK,MAAUR,EAAaW,CAAK,CAAC;EAC9C,GAAGL,EAAY,KAAK,GAAO,OAAW;GACrC,GAAGN,EAAaW,CAAK;GACrB,OAAO;GAGP,gBAAgBP,MAAU,KAAKG,EAAO,SAAS,KAAKC,EAAS,WAAW,IAAI,cAAc,KAAA;EAC3F,EAAE;CACH,GACMI,IAAkBJ,EAAS,WAAW,KAAKF,EAAY,WAAW;CAOxE,OACC,kBAAC,OAAD;EACC,aAAU;EACV,WAAWjC,EAAG,oFAAoFG,EAAmB,QAAQ;EAF9H,UAAA;GAIE+B,EAAO,KAAK,MACZ,kBAACf,GAAD;IAEC,QAAQmB,EAAM;IACd,MAAK;IACO;IACZ,WAAU;GACV,GALKA,EAAM,GAKX,CACD;GACAF,KAAW,kBAACjB,GAAD;IAAe,QAAQiB;IAAS,MAAK;IAAsB;GAAa,CAAA;GACnFC,EAAY,SAAS,KACrB,kBAACjC,GAAD;IACC,SAASiC;IACT,SAAQ;IACR,QAAQG;IACR,OAAM;IACN,eAAA;IACA,eAAA;IACA,kBAAkB9B;IAClB,aA9BoB,MACvBe,EAAW;KAAE,GAAGnB;KAAO,UAAUA,EAAM,YAAY;IAAK,CAAC;IA+BtD,aAAa,EAAE,WAAWN,EAAG,6BAA6BuC,KAAmB,WAAW,EAAE;GAC1F,CAAA;EAEE;;AAEP"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { s as e, v as t } from "./ui-provider-
|
|
2
|
+
import { s as e, v as t } from "./ui-provider-CQCuCBcy.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-CF3c95Io.js";
|
|
5
|
+
import { n as i } from "./buttons-BbfzgczK.js";
|
|
6
|
+
import { c as a } from "./typography-CSyJrh28.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-Ch8X_47u.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-BL25hu2s.js","names":["PaginationContent","PaginationItem","UIPagination","UIPaginationContent","UIPaginationItem","useDensityConfig","resolveComponentScale","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,SAAS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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-Ch8X_47u.js","names":["PaginationContent","PaginationItem","UIPagination","UIPaginationContent","UIPaginationItem","useDensityConfig","resolveComponentScale","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,GAAI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AAUkB,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,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-
|
|
3
|
+
import { t } from "./utils-CF3c95Io.js";
|
|
4
|
+
import { n, t as r } from "./feedback-DZNL5Lg1.js";
|
|
5
5
|
import { i } from "./popover.recipes-D3j8R8Yp.js";
|
|
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-
|
|
6
|
+
import { t as a } from "./collection-content-C0e8SsTm.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-D8NrBj-b.js";
|
|
8
|
+
import { c as p, i as m, o as h, r as g, t as _ } from "./popover-uwzX2vo7.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-BYaCdFhf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-menu-Cn9rUkdc.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,CAC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AAC/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-BYaCdFhf.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,CAAe,CAAC;CAEvB,OACC,kBAACd,GAAD;EAAe;EAAM,eAAe,GAAM,M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,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,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { r as e } from "./theme-scope-BJ6eE2xt.js";
|
|
3
|
-
import { t } from "./utils-
|
|
4
|
-
import { c as n } from "./typography-
|
|
3
|
+
import { t } from "./utils-CF3c95Io.js";
|
|
4
|
+
import { c as n } from "./typography-CSyJrh28.js";
|
|
5
5
|
import { t as r } from "./anchored-positioning-DPnKTvNs.js";
|
|
6
6
|
import { t as i } from "./motion-recipes-ChBg4HBq.js";
|
|
7
7
|
import { t as a } from "./slot-CLF9kLrS.js";
|
|
8
|
-
import { t as o } from "./structure-
|
|
8
|
+
import { t as o } from "./structure-C0V0_Fyf.js";
|
|
9
9
|
import { a as s } from "./surface-recipes-BKRVW8Os.js";
|
|
10
10
|
import { a as c, r as l } from "./popover.recipes-D3j8R8Yp.js";
|
|
11
11
|
import { t as u } from "./use-popup-focus-recovery-C0QPvgOR.js";
|
|
@@ -195,4 +195,4 @@ function O({ className: e, children: r, caption: i, ...a }) {
|
|
|
195
195
|
//#endregion
|
|
196
196
|
export { E as a, g as c, T as i, D as n, h as o, O as r, _ as s, w as t };
|
|
197
197
|
|
|
198
|
-
//# sourceMappingURL=popover-
|
|
198
|
+
//# sourceMappingURL=popover-uwzX2vo7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-gnTOhbFM.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","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 { 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=\"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-radius 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}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\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', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"m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,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBrC,CACQ;;CAC1B,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"popover-uwzX2vo7.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","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 { 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=\"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-radius 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}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\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', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;;AAUA,SAASA,EAAQ,EAAE,GAAGwB,KAAsC;CAC1D,OAAO,kBAACvB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIuB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACZ,GAA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ACjE,OACC,kBAAC7C,GAAD;EACC,WAAWsC,EAAG,kCAAkCC,CAAS;EACzD,GAAI1B;EAEH,UAAA8B,EAAalB,CAAQ,IACrB,kBAACvB,GAAD;GACC,KAAI;GACJ,MAAK;GACL,MAAMyD,IAAU,OAAO,KAAA;GACvB,YAAYA,IAAU,WAAW;GACjC,WAAU;GAET;EACI,CAAA,IACHlC;CACwB,CAAA;AAE/B;AAOA,SAASoC,EAAc,EAAE,cAAW,aAAU,YAAS,GAAGhD,KAA6B;CACtF,IAAMsC,IAAUvD,EAAM,WAAWiD,CAAqB,GAChDiB,IAAoBC,KAAW,QAAQpB,EAAalB,CAAQ,GAC5DY,IAAU0B,MAAYD,IAAoBrC,IAAW,KAAA;CAC3D,OACC,kBAACnB,GAAD;EACC,WAAU;EACV,KAAI;EACJ,SAAQ;EACR,MAAA;EACA,WAAWgC,EACV,yCAAyC/B,EAAsB,SAAS,QACxE4C,EAAQ,SAAS,CAACA,EAAQ,gBAAgBA,EAAQ,SAAS,SAAS1C,EAAe,aAAaA,EAAe,UAE/G8B,CACD;EACA,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,eAAe,UAAU;IACxJ,UAAAR,EAAaN,CAAO,IAAI,kBAACnC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAmC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBrC,CACQ;;CAC1B,CAAA;AAET"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { c as e, m as t } from "./ui-provider-
|
|
3
|
-
import { t as n } from "./utils-
|
|
4
|
-
import { c as r, i, l as a, r as o, u as s } from "./typography-
|
|
5
|
-
import {
|
|
6
|
-
import { n as l, o as u, r as d, t as f } from "./value-typography-
|
|
2
|
+
import { c as e, m as t } from "./ui-provider-CQCuCBcy.js";
|
|
3
|
+
import { t as n } from "./utils-CF3c95Io.js";
|
|
4
|
+
import { c as r, i, l as a, r as o, u as s } from "./typography-CSyJrh28.js";
|
|
5
|
+
import { i as c } from "./text.styles-B64My8RZ.js";
|
|
6
|
+
import { n as l, o as u, r as d, t as f } from "./value-typography-ClupF0Gz.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";
|
|
@@ -377,4 +377,4 @@ function ae({ width: t, height: i, depth: a, unit: o, separator: s = " × ", loc
|
|
|
377
377
|
//#endregion
|
|
378
378
|
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
379
|
|
|
380
|
-
//# sourceMappingURL=primitives-
|
|
380
|
+
//# sourceMappingURL=primitives-Du64iDbb.js.map
|