themelia-react-ui 1.0.2 → 2.0.0
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 +281 -1
- package/README.md +10 -5
- package/dist/{accordion-BRTcsp8J.js → accordion-CQXVcd7Q.js} +13 -13
- package/dist/accordion-CQXVcd7Q.js.map +1 -0
- package/dist/action-menu-BTpyPWJ2.js +264 -0
- package/dist/action-menu-BTpyPWJ2.js.map +1 -0
- package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-CCIXb2A1.js} +7 -2
- package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
- package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-2PQ2fItc.js} +171 -176
- package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
- package/dist/{app-shell-C_fKpljx.js → app-shell-BE_j8-AT.js} +4 -4
- package/dist/{app-shell-C_fKpljx.js.map → app-shell-BE_j8-AT.js.map} +1 -1
- package/dist/{attachment-DbjUWsP0.js → attachment-q69dlt5Y.js} +9 -9
- package/dist/{attachment-DbjUWsP0.js.map → attachment-q69dlt5Y.js.map} +1 -1
- package/dist/{auth-CAQcasMV.js → auth-M3vGMgDR.js} +42 -42
- package/dist/{auth-CAQcasMV.js.map → auth-M3vGMgDR.js.map} +1 -1
- package/dist/{avatar-Bu2HhitA.js → avatar-djdaaQ_s.js} +14 -12
- package/dist/avatar-djdaaQ_s.js.map +1 -0
- package/dist/{badge-CzId1Wlm.js → badge-0tATj-tW.js} +9 -9
- package/dist/badge-0tATj-tW.js.map +1 -0
- 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/buttons.js +2 -2
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +11 -11
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +244 -222
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +81 -76
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.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 +7 -4
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +42 -42
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +9 -9
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +4 -4
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +229 -220
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +147 -180
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +530 -523
- 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 +1390 -1516
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +82 -91
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-BuYz5SDU.js → breadcrumbs-BG_FfMK4.js} +5 -5
- package/dist/{breadcrumbs-BuYz5SDU.js.map → breadcrumbs-BG_FfMK4.js.map} +1 -1
- package/dist/{button-BZDasD04.js → button-BS3KDg00.js} +185 -162
- package/dist/button-BS3KDg00.js.map +1 -0
- package/dist/{button-BZyfTvwm.js → button-R9CCoH7A.js} +2 -2
- package/dist/{button-BZyfTvwm.js.map → button-R9CCoH7A.js.map} +1 -1
- package/dist/{buttons-D_6KJvEE.js → buttons-DS0ZIwJ_.js} +11 -11
- package/dist/buttons-DS0ZIwJ_.js.map +1 -0
- package/dist/{cards-qGSErLw_.js → cards-QoJ4syG9.js} +7 -7
- package/dist/{cards-qGSErLw_.js.map → cards-QoJ4syG9.js.map} +1 -1
- package/dist/{chart-Bsc5BICK.js → chart-DwYRKKc-.js} +17 -15
- package/dist/chart-DwYRKKc-.js.map +1 -0
- package/dist/checkbox-B7ygNTYp.js +35 -0
- package/dist/checkbox-B7ygNTYp.js.map +1 -0
- package/dist/choice-inputs-DrJ17tpL.js +752 -0
- package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
- package/dist/{code-block-DzHKRybS.js → code-block-CD0B7M93.js} +19 -19
- package/dist/{code-block-DzHKRybS.js.map → code-block-CD0B7M93.js.map} +1 -1
- package/dist/{collapsible-ClvC7Bj3.js → collapsible-oMUGM4tr.js} +3 -3
- package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-oMUGM4tr.js.map} +1 -1
- package/dist/{collection-content-D6S8cv_n.js → collection-content-Ys-OZOkY.js} +3 -3
- package/dist/{collection-content-D6S8cv_n.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
- package/dist/{combobox-BFnbJJp3.js → combobox-6dvVny2q.js} +96 -97
- package/dist/combobox-6dvVny2q.js.map +1 -0
- package/dist/{combobox-hozNwUcc.js → combobox-CB7039j7.js} +326 -308
- package/dist/combobox-CB7039j7.js.map +1 -0
- package/dist/{command-BnmSchli.js → command-kPMPjIxJ.js} +34 -30
- package/dist/command-kPMPjIxJ.js.map +1 -0
- package/dist/{comments-u5L0OGip.js → comments-You0Bzbr.js} +349 -348
- package/dist/comments-You0Bzbr.js.map +1 -0
- package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
- package/dist/components/base/action-menu/action-menu.d.ts +7 -2
- package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
- package/dist/components/base/badge/badge.d.ts +1 -1
- package/dist/components/base/badge/badge.recipes.d.ts +4 -4
- package/dist/components/base/buttons/base-button.d.ts +7 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/buttons/button.variants.d.ts +1 -0
- package/dist/components/base/buttons/loader-button.d.ts +3 -1
- package/dist/components/base/buttons/text-button.d.ts +2 -2
- package/dist/components/base/carousel/carousel.d.ts +3 -1
- package/dist/components/base/chart/chart.d.ts +7 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
- package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
- package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
- package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
- package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
- package/dist/components/base/display/alert-dialog.d.ts +8 -2
- package/dist/components/base/display/content-block.d.ts +4 -2
- package/dist/components/base/display/date-block.d.ts +1 -1
- package/dist/components/base/display/dialog.d.ts +12 -5
- package/dist/components/base/display/surface-title.d.ts +6 -1
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -4
- package/dist/components/base/forms/form-sizing.d.ts +32 -0
- package/dist/components/base/forms/workflow.d.ts +2 -0
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
- package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +4 -1
- package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
- package/dist/components/base/qr-code/qr-code.d.ts +2 -0
- package/dist/components/base/sheet/index.d.ts +29 -1
- package/dist/components/base/sheet/sheet.d.ts +14 -5
- package/dist/components/base/spinner/spinner.d.ts +3 -2
- package/dist/components/base/structure/structure.types.d.ts +1 -1
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/base/upload/upload.recipes.d.ts +11 -0
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
- package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
- package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
- package/dist/components/blocks/analytics/index.d.ts +1 -1
- package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
- package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
- package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
- package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
- package/dist/components/features/overlays/overlays.types.d.ts +42 -19
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/partials/index.d.ts +1 -1
- package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
- package/dist/components/features/products/partials/product-tone.d.ts +11 -1
- package/dist/components/features/products/products.types.d.ts +2 -1
- package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
- package/dist/components/layout/page/index.d.ts +1 -1
- package/dist/components/layout/page/page.types.d.ts +53 -3
- package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/primitives/date.d.ts +16 -3
- package/dist/components/primitives/dimensions.d.ts +6 -0
- package/dist/components/primitives/duration.d.ts +6 -0
- package/dist/components/primitives/file-size.d.ts +6 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +11 -2
- package/dist/components/primitives/link.d.ts +7 -0
- package/dist/components/primitives/money.d.ts +29 -7
- package/dist/components/primitives/number.d.ts +17 -0
- package/dist/components/primitives/value-typography.d.ts +54 -0
- package/dist/components/primitives/value.d.ts +31 -6
- package/dist/components/typography/heading.d.ts +9 -1
- package/dist/components/typography/label.d.ts +3 -0
- package/dist/components/typography/running-text.d.ts +12 -0
- package/dist/components/typography/text-link.d.ts +23 -1
- package/dist/components/typography/text.d.ts +12 -0
- package/dist/components/typography/text.styles.d.ts +35 -13
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/overlay.recipes.d.ts +15 -2
- package/dist/components/ui/select.d.ts +3 -1
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/{containers-DqB-bSYE.js → containers-D_L4mTVb.js} +3 -3
- package/dist/{containers-DqB-bSYE.js.map → containers-D_L4mTVb.js.map} +1 -1
- package/dist/{copyable-BTSByfmq.js → copyable-DDjTeW_j.js} +4 -4
- package/dist/{copyable-BTSByfmq.js.map → copyable-DDjTeW_j.js.map} +1 -1
- package/dist/{data-display-Bihs9Ven.js → data-display-3xWQUnMA.js} +471 -478
- package/dist/data-display-3xWQUnMA.js.map +1 -0
- package/dist/date-picker-DrDFj8Lo.js +1527 -0
- package/dist/date-picker-DrDFj8Lo.js.map +1 -0
- package/dist/date-pickers-CnFCb0n2.js +174 -0
- package/dist/date-pickers-CnFCb0n2.js.map +1 -0
- package/dist/date-uf3z37Nm.js +144 -0
- package/dist/date-uf3z37Nm.js.map +1 -0
- package/dist/{display-CS6Hbk18.js → display-DrdvPwF0.js} +25 -25
- package/dist/display-DrdvPwF0.js.map +1 -0
- package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-CURh59jb.js} +22 -15
- package/dist/dropdown-menu-CURh59jb.js.map +1 -0
- package/dist/features/activities.js +38 -35
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +36 -35
- package/dist/features/ai-chat.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 +325 -326
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +190 -200
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +77 -77
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +4 -4
- package/dist/features/map.js +8 -8
- package/dist/features/media-library.js +499 -502
- 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 +1216 -1248
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +46 -44
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +96 -88
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +11 -11
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +188 -184
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +7 -7
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +469 -470
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-CJkUAapr.js → feedback-C7nR0UtT.js} +9 -10
- package/dist/feedback-C7nR0UtT.js.map +1 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
- package/dist/{field-state-recipes-DQQpiLWC.js → field-state-recipes-C-MFBX_8.js} +3 -3
- package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
- package/dist/{filters-D6FF8L6s.js → filters-Da-gNPsE.js} +467 -467
- package/dist/filters-Da-gNPsE.js.map +1 -0
- package/dist/{form-field-CZwrkP7m.js → form-field-VZRULhUK.js} +7 -7
- package/dist/{form-field-CZwrkP7m.js.map → form-field-VZRULhUK.js.map} +1 -1
- package/dist/form-sizing-uWP4lzVh.js +126 -0
- package/dist/form-sizing-uWP4lzVh.js.map +1 -0
- package/dist/{forms-B5NCbkSC.js → forms-DDeEnXSY.js} +11 -11
- package/dist/forms-DDeEnXSY.js.map +1 -0
- package/dist/forms-numeric-D3CO60IF.js +905 -0
- package/dist/forms-numeric-D3CO60IF.js.map +1 -0
- package/dist/{header-kxruN3RM.js → header-2ycNqGOR.js} +43 -42
- package/dist/header-2ycNqGOR.js.map +1 -0
- package/dist/{hooks-BrlnCwQd.js → hooks-DQ5SPwZw.js} +2 -2
- package/dist/{hooks-BrlnCwQd.js.map → hooks-DQ5SPwZw.js.map} +1 -1
- package/dist/{icon-badge-Btc6pQrp.js → icon-badge-DKlaKXoo.js} +3 -3
- package/dist/{icon-badge-Btc6pQrp.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{input-vxcaNCYC.js → input-BoLm9Hks.js} +3 -3
- package/dist/{input-vxcaNCYC.js.map → input-BoLm9Hks.js.map} +1 -1
- package/dist/input-DhQdBnV3.js +255 -0
- package/dist/{input-SX9V0AL3.js.map → input-DhQdBnV3.js.map} +1 -1
- package/dist/item-xzh8Df65.js +264 -0
- package/dist/item-xzh8Df65.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 -1
- package/dist/lib/field-affordance-recipes.d.ts +35 -0
- package/dist/lib/field-state-recipes.d.ts +4 -2
- package/dist/lib/format.d.ts +9 -0
- package/dist/lib/money-format.d.ts +30 -0
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +8 -6
- package/dist/lib/token-merge.generated.d.ts +11 -11
- package/dist/lib/track-recipes.d.ts +1 -1
- package/dist/lib/ui-provider/provider.d.ts +7 -2
- package/dist/lib/ui-provider/store.d.ts +6 -2
- package/dist/lib/ui-provider/types.d.ts +5 -2
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-DLp3HAz0.js → media-gallery-DQUQ0m3O.js} +8 -8
- package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
- package/dist/{mentions-Cl0Kt_Pd.js → mentions-DwnO1hh4.js} +34 -35
- package/dist/{mentions-Cl0Kt_Pd.js.map → mentions-DwnO1hh4.js.map} +1 -1
- package/dist/{message-SZUNB1eX.js → message-YfFmbXNP.js} +5 -5
- package/dist/{message-SZUNB1eX.js.map → message-YfFmbXNP.js.map} +1 -1
- package/dist/{navigation-DyytsLRB.js → navigation-Cbp5V8gG.js} +33 -34
- package/dist/navigation-Cbp5V8gG.js.map +1 -0
- package/dist/{navigation-DnQSNMT0.js → navigation-Cs1npsPm.js} +111 -87
- package/dist/navigation-Cs1npsPm.js.map +1 -0
- package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-DlU-4QYO.js} +2 -2
- package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-DlU-4QYO.js.map} +1 -1
- package/dist/number-CKRBYmZK.js +352 -0
- package/dist/number-CKRBYmZK.js.map +1 -0
- package/dist/overlay.recipes-CNO2S9V6.js +34 -0
- package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
- package/dist/overlays-DhZO7N-I.js +994 -0
- package/dist/overlays-DhZO7N-I.js.map +1 -0
- package/dist/page-C6R_8jFt.js +325 -0
- package/dist/page-C6R_8jFt.js.map +1 -0
- package/dist/{page-header-D8nERkn5.js → page-header-hUTzcRZX.js} +9 -9
- package/dist/page-header-hUTzcRZX.js.map +1 -0
- package/dist/{pagination-NLGqRirf.js → pagination-Cm0jqa3I.js} +8 -8
- package/dist/{pagination-NLGqRirf.js.map → pagination-Cm0jqa3I.js.map} +1 -1
- package/dist/{popover-CghIYdQf.js → popover-Dcv_9jxr.js} +6 -6
- package/dist/{popover-CghIYdQf.js.map → popover-Dcv_9jxr.js.map} +1 -1
- package/dist/{popover-menu-B4PoWhRl.js → popover-menu-DnRFKnHP.js} +6 -6
- package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
- package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-wmbvL8Ah.js} +2 -2
- package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-wmbvL8Ah.js.map} +1 -1
- package/dist/primitives-BHrwQXFC.js +379 -0
- package/dist/primitives-BHrwQXFC.js.map +1 -0
- package/dist/primitives.js +5 -5
- package/dist/{progress-BroqrAyV.js → progress-Br9WTFya.js} +7 -7
- package/dist/progress-Br9WTFya.js.map +1 -0
- package/dist/{receipt-BuJynLgf.js → receipt-CV89q1fs.js} +6 -6
- package/dist/{receipt-BuJynLgf.js.map → receipt-CV89q1fs.js.map} +1 -1
- package/dist/{rich-text-editor-BKyG7rWz.js → rich-text-editor-CF8QYt5p.js} +6 -6
- package/dist/{rich-text-editor-BKyG7rWz.js.map → rich-text-editor-CF8QYt5p.js.map} +1 -1
- package/dist/{rich-text-editor.recipes-B72Nfuze.js → rich-text-editor.recipes-CnrbmTS1.js} +4 -4
- package/dist/{rich-text-editor.recipes-B72Nfuze.js.map → rich-text-editor.recipes-CnrbmTS1.js.map} +1 -1
- package/dist/{rich-text-DlxDOtf4.js → rich-text-j-FGAeZW.js} +4 -4
- package/dist/{rich-text-DlxDOtf4.js.map → rich-text-j-FGAeZW.js.map} +1 -1
- package/dist/{scroll-area-D-pIhEKl.js → scroll-area-DRdr16Pt.js} +3 -3
- package/dist/scroll-area-DRdr16Pt.js.map +1 -0
- package/dist/{separator-BhtFyo4x.js → separator-BMEvwnSX.js} +2 -2
- package/dist/{separator-BhtFyo4x.js.map → separator-BMEvwnSX.js.map} +1 -1
- package/dist/{separator-BNIgG3au.js → separator-Do5GWDYi.js} +4 -4
- package/dist/separator-Do5GWDYi.js.map +1 -0
- package/dist/services/actions/action-adapters.d.ts +4 -0
- package/dist/services/actions.js +8 -3
- package/dist/services/actions.js.map +1 -1
- package/dist/{settings-DOTOzeZ2.js → settings-DHk0L2MF.js} +17 -17
- package/dist/settings-DHk0L2MF.js.map +1 -0
- package/dist/sheet-DRFNY1_D.js +207 -0
- package/dist/sheet-DRFNY1_D.js.map +1 -0
- package/dist/sidebar-Cb8WzOvE.js +511 -0
- package/dist/sidebar-Cb8WzOvE.js.map +1 -0
- package/dist/{sidebar-CyR4XKwR.js → sidebar-Crc9M9JV.js} +18 -18
- package/dist/sidebar-Crc9M9JV.js.map +1 -0
- package/dist/{skeleton-3F0uhYn3.js → skeleton-DVMXr15h.js} +4 -4
- package/dist/{skeleton-3F0uhYn3.js.map → skeleton-DVMXr15h.js.map} +1 -1
- package/dist/{smart-card-DjGVV2xr.js → smart-card-Bek-TwUp.js} +222 -207
- package/dist/smart-card-Bek-TwUp.js.map +1 -0
- package/dist/{spinner-Cpf7oRkF.js → spinner-CmTAbEp0.js} +8 -6
- package/dist/spinner-CmTAbEp0.js.map +1 -0
- package/dist/{structure-CRdqVawd.js → structure-hzCW-XsV.js} +3 -3
- package/dist/{structure-CRdqVawd.js.map → structure-hzCW-XsV.js.map} +1 -1
- package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
- package/dist/structure.recipes-EPz60cU8.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/surface-recipes-DOdoBXGm.js +28 -0
- package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
- package/dist/table-D6zKeYQX.js +162 -0
- package/dist/table-D6zKeYQX.js.map +1 -0
- package/dist/{table-CcRDZiLP.js → table-Dn4XSrSB.js} +348 -348
- package/dist/table-Dn4XSrSB.js.map +1 -0
- package/dist/{tabs-BNgu7g0u.js → tabs-Dk8E_knt.js} +14 -13
- package/dist/tabs-Dk8E_knt.js.map +1 -0
- package/dist/{text-inputs-DsR56TR-.js → text-inputs-BFpku0Qd.js} +150 -149
- package/dist/text-inputs-BFpku0Qd.js.map +1 -0
- package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
- package/dist/text.styles-g4He6UIW.js.map +1 -0
- package/dist/theme.css +16 -12
- package/dist/themes/green.css +24 -0
- package/dist/{timelines-D1pkt3se.js → timelines-CxuAFIc2.js} +25 -38
- package/dist/timelines-CxuAFIc2.js.map +1 -0
- package/dist/track-recipes-CDcKmndW.js +10 -0
- package/dist/track-recipes-CDcKmndW.js.map +1 -0
- package/dist/{tree-BtmYyMZV.js → tree-BotPlyiD.js} +13 -13
- package/dist/{tree-BtmYyMZV.js.map → tree-BotPlyiD.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CAr3dQhX.js +116 -0
- package/dist/typography-CAr3dQhX.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-DRPn3qNl.js → ui-provider-D2_TeLqw.js} +20 -21
- package/dist/ui-provider-D2_TeLqw.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-CDbYw1WN.js → upload-B0WHW7ak.js} +221 -220
- package/dist/upload-B0WHW7ak.js.map +1 -0
- package/dist/{upload-queue-CNd_hH_a.js → upload-queue-BHZ_wBfd.js} +59 -62
- package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
- package/dist/{usage-card-VyJLUwRr.js → usage-card-U0YBLTNT.js} +42 -43
- package/dist/{usage-card-VyJLUwRr.js.map → usage-card-U0YBLTNT.js.map} +1 -1
- package/dist/{utils-BvH9PSmq.js → utils-Cospvlj1.js} +221 -51
- package/dist/utils-Cospvlj1.js.map +1 -0
- package/dist/value-inputs-CjfzGMsN.js +854 -0
- package/dist/value-inputs-CjfzGMsN.js.map +1 -0
- package/dist/value-typography-Deb3yQZg.js +116 -0
- package/dist/value-typography-Deb3yQZg.js.map +1 -0
- package/dist/{workspace-CcR8r-Nt.js → workspace-YoFjXi6i.js} +44 -45
- package/dist/workspace-YoFjXi6i.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +51 -38
- package/docs/consumer-skill/examples/app-layout.tsx +2 -4
- package/docs/consumer-skill/examples/detail.tsx +3 -4
- package/docs/consumer-skill/examples/edit.tsx +1 -1
- package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
- package/docs/consumer-skill/examples/manifest.json +28 -6
- package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
- package/docs/consumer-skill/references/composition.md +89 -17
- package/docs/consumer-skill/references/discovery.md +4 -0
- package/docs/consumer-skill/references/installation.md +22 -0
- package/docs/consumer-skill/references/integration.md +32 -1
- package/docs/consumer-skill/references/public-api.json +111 -70
- package/docs/consumer-skill/references/review.md +20 -4
- package/docs/consumer-skill/references/theming.md +7 -1
- package/docs/consumer-skill/references/tokens.json +5 -2
- package/docs/consumer-skill/references/workflows.md +4 -2
- package/docs/consumer-skill/scripts/composition-policy.mjs +93 -2
- package/docs/consumer-skill/scripts/discovery.mjs +11 -3
- package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
- package/package.json +5 -3
- package/dist/accordion-BRTcsp8J.js.map +0 -1
- package/dist/action-menu-Drxw_vJk.js +0 -265
- package/dist/action-menu-Drxw_vJk.js.map +0 -1
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
- package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
- package/dist/avatar-Bu2HhitA.js.map +0 -1
- package/dist/badge-CzId1Wlm.js.map +0 -1
- package/dist/button-BZDasD04.js.map +0 -1
- package/dist/buttons-D_6KJvEE.js.map +0 -1
- package/dist/chart-Bsc5BICK.js.map +0 -1
- package/dist/checkbox-BQNDjUCh.js +0 -34
- package/dist/checkbox-BQNDjUCh.js.map +0 -1
- package/dist/choice-inputs-Mk3iWbhr.js +0 -725
- package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
- package/dist/combobox-BFnbJJp3.js.map +0 -1
- package/dist/combobox-hozNwUcc.js.map +0 -1
- package/dist/command-BnmSchli.js.map +0 -1
- package/dist/comments-u5L0OGip.js.map +0 -1
- package/dist/data-display-Bihs9Ven.js.map +0 -1
- package/dist/date-DOKhJPu7.js +0 -140
- package/dist/date-DOKhJPu7.js.map +0 -1
- package/dist/date-picker-DzP5HQq7.js +0 -1541
- package/dist/date-picker-DzP5HQq7.js.map +0 -1
- package/dist/date-pickers-BpgGz7S-.js +0 -196
- package/dist/date-pickers-BpgGz7S-.js.map +0 -1
- package/dist/display-CS6Hbk18.js.map +0 -1
- package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
- package/dist/feedback-CJkUAapr.js.map +0 -1
- package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
- package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
- package/dist/filters-D6FF8L6s.js.map +0 -1
- package/dist/form-sizing-QP8aIRaW.js +0 -103
- package/dist/form-sizing-QP8aIRaW.js.map +0 -1
- package/dist/format-iamDSqs2.js +0 -110
- package/dist/format-iamDSqs2.js.map +0 -1
- package/dist/forms-B5NCbkSC.js.map +0 -1
- package/dist/forms-numeric-Crrm80Lm.js +0 -867
- package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
- package/dist/header-kxruN3RM.js.map +0 -1
- package/dist/input-SX9V0AL3.js +0 -255
- package/dist/item-DE4YnuJx.js +0 -258
- package/dist/item-DE4YnuJx.js.map +0 -1
- package/dist/media-gallery-DLp3HAz0.js.map +0 -1
- package/dist/navigation-DnQSNMT0.js.map +0 -1
- package/dist/navigation-DyytsLRB.js.map +0 -1
- package/dist/number-DasMFWEG.js +0 -269
- package/dist/number-DasMFWEG.js.map +0 -1
- package/dist/overlay.recipes-BxW5FIfK.js +0 -6
- package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
- package/dist/overlays-DUbs1KEi.js +0 -1011
- package/dist/overlays-DUbs1KEi.js.map +0 -1
- package/dist/page-hGmT4nWK.js +0 -213
- package/dist/page-hGmT4nWK.js.map +0 -1
- package/dist/page-header-D8nERkn5.js.map +0 -1
- package/dist/primitives-C7ff0QaI.js +0 -337
- package/dist/primitives-C7ff0QaI.js.map +0 -1
- package/dist/progress-BroqrAyV.js.map +0 -1
- package/dist/scroll-area-D-pIhEKl.js.map +0 -1
- package/dist/separator-BNIgG3au.js.map +0 -1
- package/dist/settings-DOTOzeZ2.js.map +0 -1
- package/dist/sheet-BFhrNehm.js +0 -205
- package/dist/sheet-BFhrNehm.js.map +0 -1
- package/dist/sidebar-CyR4XKwR.js.map +0 -1
- package/dist/sidebar-SvGJ0Zwi.js +0 -506
- package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
- package/dist/smart-card-DjGVV2xr.js.map +0 -1
- package/dist/spinner-Cpf7oRkF.js.map +0 -1
- package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
- package/dist/surface-recipes-Dd__PD-w.js +0 -28
- package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
- package/dist/table-CLtJTxoR.js +0 -147
- package/dist/table-CLtJTxoR.js.map +0 -1
- package/dist/table-CcRDZiLP.js.map +0 -1
- package/dist/tabs-BNgu7g0u.js.map +0 -1
- package/dist/text-inputs-DsR56TR-.js.map +0 -1
- package/dist/text.styles-Q4sGAIgA.js.map +0 -1
- package/dist/timelines-D1pkt3se.js.map +0 -1
- package/dist/track-recipes-LLPNVwFg.js +0 -10
- package/dist/track-recipes-LLPNVwFg.js.map +0 -1
- package/dist/typography-BxQgiZyw.js +0 -96
- package/dist/typography-BxQgiZyw.js.map +0 -1
- package/dist/ui-provider-DRPn3qNl.js.map +0 -1
- package/dist/upload-CDbYw1WN.js.map +0 -1
- package/dist/upload-queue-CNd_hH_a.js.map +0 -1
- package/dist/utils-BvH9PSmq.js.map +0 -1
- package/dist/value-inputs-D0KCrfVC.js +0 -840
- package/dist/value-inputs-D0KCrfVC.js.map +0 -1
- package/dist/workspace-CcR8r-Nt.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./utils-
|
|
3
|
-
import { a as t,
|
|
4
|
-
import { t as i } from "./structure-
|
|
5
|
-
import { t as a } from "./badge-
|
|
6
|
-
import { t as o } from "./separator-
|
|
2
|
+
import { t as e } from "./utils-Cospvlj1.js";
|
|
3
|
+
import { a as t, o as n, s as r } from "./typography-CAr3dQhX.js";
|
|
4
|
+
import { t as i } from "./structure-hzCW-XsV.js";
|
|
5
|
+
import { t as a } from "./badge-0tATj-tW.js";
|
|
6
|
+
import { t as o } from "./separator-Do5GWDYi.js";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/base/navigation/page-header/page-header.tsx
|
|
9
9
|
function l(e) {
|
|
10
10
|
return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
|
|
11
11
|
}
|
|
12
|
-
function u({ eyebrow: u, title: d, description: f, textGap: p = "normal", headingTag: m = "h2", badge: h, badges: g, breadcrumbs: _, leading: v, beforeTitle: y, titlePrefix: b, titleSuffix: x, afterDescription: S, actions: C, children: w, className: T, contentClassName: E, eyebrowClassName: D, titleClassName: O, titleRowClassName: k, descriptionClassName: A, actionsClassName: j, withSeparator: M = !
|
|
12
|
+
function u({ eyebrow: u, title: d, description: f, textGap: p = "normal", headingTag: m = "h2", badge: h, badges: g, breadcrumbs: _, leading: v, beforeTitle: y, titlePrefix: b, titleSuffix: x, afterDescription: S, actions: C, children: w, className: T, contentClassName: E, eyebrowClassName: D, titleClassName: O, titleRowClassName: k, descriptionClassName: A, actionsClassName: j, withSeparator: M = !1 }) {
|
|
13
13
|
let N = g ?? (h ? [h] : []);
|
|
14
14
|
return /* @__PURE__ */ c("header", {
|
|
15
15
|
className: e("page-heading--component page-header--component", "w-full", T),
|
|
@@ -27,7 +27,7 @@ function u({ eyebrow: u, title: d, description: f, textGap: p = "normal", headin
|
|
|
27
27
|
gap: "dense",
|
|
28
28
|
className: e("page-header--content-row flex-1", E),
|
|
29
29
|
children: [
|
|
30
|
-
!!u && (l(u) ? /* @__PURE__ */ s(
|
|
30
|
+
!!u && (l(u) ? /* @__PURE__ */ s(t, {
|
|
31
31
|
tag: "div",
|
|
32
32
|
className: D,
|
|
33
33
|
children: u
|
|
@@ -80,7 +80,7 @@ function u({ eyebrow: u, title: d, description: f, textGap: p = "normal", headin
|
|
|
80
80
|
(!!f || !!S) && /* @__PURE__ */ c(i, {
|
|
81
81
|
gap: "dense",
|
|
82
82
|
className: e("page-header--title-block min-w-0", !!b && "col-start-2"),
|
|
83
|
-
children: [!!f && (l(f) ? /* @__PURE__ */ s(
|
|
83
|
+
children: [!!f && (l(f) ? /* @__PURE__ */ s(r, {
|
|
84
84
|
type: "secondary",
|
|
85
85
|
className: e("page-header--description max-w-2xl [overflow-wrap:anywhere]", A),
|
|
86
86
|
children: f
|
|
@@ -109,4 +109,4 @@ u.displayName = "PageHeading";
|
|
|
109
109
|
//#endregion
|
|
110
110
|
export { u as t };
|
|
111
111
|
|
|
112
|
-
//# sourceMappingURL=page-header-
|
|
112
|
+
//# sourceMappingURL=page-header-hUTzcRZX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header-hUTzcRZX.js","names":["cn","DisplayLabel","Heading","Text","Stack","Badge","Separator","isSimpleText","value","PageHeading","resolvedBadges","badges","badge","className","breadcrumbs","leading","contentClassName","eyebrow","eyebrowClassName","beforeTitle","titlePrefix","titleRowClassName","textGap","title","headingTag","titleClassName","item","index","titleSuffix","description","afterDescription","descriptionClassName","actions","actionsClassName","children","withSeparator"],"sources":["../src/components/base/navigation/page-header/page-header.tsx"],"sourcesContent":["/**\n * PageHeading — reusable visual heading block for sections and resources.\n * Higher-level layout components add routing/back behavior around this base\n * visual primitive instead of reimplementing title, description, badge, and\n * action spacing.\n */\nimport type { Key, ReactNode } from 'react';\nimport { DisplayLabel, Heading, Text, type HeadingTag } from '../../../typography';\nimport { Badge, type BadgeTone } from '../../badge';\nimport { Separator } from '../../display/separator';\nimport { Stack, type TextGap } from '../../structure';\nimport { cn } from '../../../../lib/utils';\n\nexport interface PageHeadingBadge {\n\tlabel: ReactNode;\n\ttone?: BadgeTone;\n\tkey?: Key;\n}\n\n/**\n * Slot map, top to bottom and outside in:\n *\n * ```text\n * breadcrumbs\n * leading │ eyebrow\n * │ beforeTitle\n * │ titlePrefix │ title badges titleSuffix │ actions\n * │ │ description\n * │ │ afterDescription\n * children\n * ─────────────────────────────────────────── (withSeparator)\n * ```\n */\nexport interface PageHeadingProps {\n\t/** Small label above the title. Plain text is rendered as a `DisplayLabel`. */\n\teyebrow?: ReactNode;\n\t/** The page title. Plain text is rendered as a `Heading`; pass an element to own the markup. */\n\ttitle: ReactNode;\n\t/** Supporting sentence under the title, capped at `max-w-2xl` and aligned to the title's left edge. */\n\tdescription?: ReactNode;\n\t/** Title/description rhythm. Defaults to normal. */\n\ttextGap?: TextGap;\n\t/** Heading level for a plain-text `title`. Default: `'h2'`. Set for correct document outline. */\n\theadingTag?: HeadingTag;\n\t/** Convenience for a single badge beside the title. Ignored when `badges` is set. */\n\tbadge?: PageHeadingBadge;\n\t/** Badges beside the title, in order. Takes precedence over `badge`. */\n\tbadges?: PageHeadingBadge[];\n\t/** Breadcrumb trail rendered above the header block. */\n\tbreadcrumbs?: ReactNode;\n\t/** Content to the left of the entire header column — an avatar or back button. Top-aligned. */\n\tleading?: ReactNode;\n\t/** Free slot between the eyebrow and the title row, for a banner or status strip. */\n\tbeforeTitle?: ReactNode;\n\t/**\n\t * Content immediately left of the title, vertically centred on the title\n\t * line alone. Unlike `leading`, the description aligns to the title's left\n\t * edge rather than to this slot, so an icon here never shifts the copy.\n\t */\n\ttitlePrefix?: ReactNode;\n\t/** Content after the title and badges, on the same line. */\n\ttitleSuffix?: ReactNode;\n\t/** Content directly beneath the description, sharing its alignment — a metadata line. */\n\tafterDescription?: ReactNode;\n\t/** Independent actions column beside the copy; follows it on narrow widths. */\n\tactions?: ReactNode;\n\t/** Content below the whole header block, above the separator. */\n\tchildren?: ReactNode;\n\t/** Merged onto the `<header>` root. */\n\tclassName?: string;\n\t/** Merged onto the column holding eyebrow, title, and description. */\n\tcontentClassName?: string;\n\t/** Merged onto the eyebrow. Only applies when `eyebrow` is plain text. */\n\teyebrowClassName?: string;\n\t/** Merged onto the title. Only applies when `title` is plain text. */\n\ttitleClassName?: string;\n\t/**\n\t * Merged onto the title row's grid. A `gap-space-md` here sets the\n\t * `titlePrefix`-to-title rhythm without also opening the gap under the title.\n\t */\n\ttitleRowClassName?: string;\n\t/** Merged onto the description. Only applies when `description` is plain text. */\n\tdescriptionClassName?: string;\n\t/** Merged onto the actions cluster. */\n\tactionsClassName?: string;\n\t/**\n\t * Draws a rule beneath the header. Default: `false` — the page rhythm (gap\n\t * between header and body) separates them; opt in where a rule is the design.\n\t */\n\twithSeparator?: boolean;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport function PageHeading({\n\teyebrow,\n\ttitle,\n\tdescription,\n\ttextGap = 'normal',\n\theadingTag = 'h2',\n\tbadge,\n\tbadges,\n\tbreadcrumbs,\n\tleading,\n\tbeforeTitle,\n\ttitlePrefix,\n\ttitleSuffix,\n\tafterDescription,\n\tactions,\n\tchildren,\n\tclassName,\n\tcontentClassName,\n\teyebrowClassName,\n\ttitleClassName,\n\ttitleRowClassName,\n\tdescriptionClassName,\n\tactionsClassName,\n\twithSeparator = false,\n}: PageHeadingProps) {\n\tconst resolvedBadges = badges ?? (badge ? [badge] : []);\n\n\treturn (\n\t\t<header className={cn('page-heading--component page-header--component', 'w-full', className)}>\n\t\t\t{!!breadcrumbs && <div className=\"mb-space-lg\">{breadcrumbs}</div>}\n\n\t\t\t<Stack direction=\"horizontal\" gap=\"lg\" align=\"start\" wrap={false}>\n\t\t\t\t{leading}\n\t\t\t\t<Stack gap=\"dense\" className={cn('page-header--content-row flex-1', contentClassName)}>\n\t\t\t\t\t{!!eyebrow && (isSimpleText(eyebrow) ? (\n\t\t\t\t\t\t<DisplayLabel tag=\"div\" className={eyebrowClassName}>\n\t\t\t\t\t\t\t{eyebrow}\n\t\t\t\t\t\t</DisplayLabel>\n\t\t\t\t\t) : eyebrow)}\n\t\t\t\t\t{beforeTitle}\n\t\t\t\t\t<Stack\n\t\t\t\t\t\tdirection={{ base: 'vertical', sm: 'horizontal' }}\n\t\t\t\t\t\tgap=\"lg\"\n\t\t\t\t\t\talign=\"start\"\n\t\t\t\t\t\twrap={{ base: false, sm: true }}\n\t\t\t\t\t\tclassName=\"page-header--headline-row min-w-0\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* The copy owns its width independently of actions. The inner\n\t\t\t\t\t\t grid keeps the description aligned after a title prefix. */}\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'page-header--copy-column page-header--title-row grid min-w-0 w-full flex-1 basis-full items-center gap-x-space-md sm:w-auto sm:basis-64',\n\t\t\t\t\t\t\t\ttitlePrefix ? 'grid-cols-[auto_minmax(0,1fr)]' : 'grid-cols-[minmax(0,1fr)]',\n\t\t\t\t\t\t\t\ttitleRowClassName,\n\t\t\t\t\t\t\t\ttextGap === 'normal' ? 'gap-y-normal' : 'gap-y-dense',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!!titlePrefix && (\n\t\t\t\t\t\t\t\t<span className=\"page-header--title-prefix inline-flex shrink-0 items-center self-center\">\n\t\t\t\t\t\t\t\t\t{titlePrefix}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" align=\"center\" wrap className=\"page-header--title-line min-h-action-sm min-w-0\">\n\t\t\t\t\t\t\t\t{isSimpleText(title) ? (\n\t\t\t\t\t\t\t\t\t<Heading tag={headingTag} className={cn('page-header--title min-w-0 [overflow-wrap:anywhere] border-0 pb-0', titleClassName)}>\n\t\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t\t) : title}\n\t\t\t\t\t\t\t\t{resolvedBadges.length > 0 && (\n\t\t\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"sm\" wrap className=\"page-header--badges min-w-0 max-w-full\">\n\t\t\t\t\t\t\t\t\t\t{resolvedBadges.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Badge key={item.key ?? index} tone={item.tone ?? 'secondary'}>\n\t\t\t\t\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{titleSuffix}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{(!!description || !!afterDescription) && (\n\t\t\t\t\t\t\t\t<Stack gap=\"dense\" className={cn('page-header--title-block min-w-0', !!titlePrefix && 'col-start-2')}>\n\t\t\t\t\t\t\t\t\t{!!description && (isSimpleText(description) ? (\n\t\t\t\t\t\t\t\t\t\t<Text type=\"secondary\" className={cn('page-header--description max-w-2xl [overflow-wrap:anywhere]', descriptionClassName)}>\n\t\t\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : description)}\n\t\t\t\t\t\t\t\t\t{afterDescription}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{!!actions && (\n\t\t\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" className={cn('page-header--actions max-w-full shrink-0', actionsClassName)}>\n\t\t\t\t\t\t\t\t{actions}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\n\t\t\t{!!children && <div className=\"mt-space-xl\">{children}</div>}\n\n\t\t\t{!!withSeparator && <Separator className=\"mt-space-xl\" />}\n\t\t</header>\n\t);\n}\n\nPageHeading.displayName = 'PageHeading';\n"],"mappings":";;;;;;;;AA4FA,SAASO,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,KAAKsB;YAAY,WAAWxB,EAAG,qEAAqEyB,CAAc;YACzH,UAAAF;WACO,CAAA,IACNA;WACHb,EAAe,SAAS,KACxB,kBAACN,GAAD;YAAO,WAAU;YAAa,KAAI;YAAK,MAAA;YAAK,WAAU;YACpD,UAAAM,EAAe,KAAK,GAAM,MAC1B,kBAACL,GAAD;aAA+B,MAAMqB,EAAK,QAAQ;aAChD,UAAAA,EAAK;YACA,GAFKA,EAAK,OAAOC,CAEjB,CACP;WACK,CAAA;WAEPC;UACK;;UACL,CAAC,CAACC,KAAe,CAAC,CAACC,MACpB,kBAAC1B,GAAD;UAAO,KAAI;UAAQ,WAAWJ,EAAG,oCAAoC,CAAC,CAACoB,KAAe,aAAa;UAAnG,UAAA,CACE,CAAC,CAACS,MAAgBtB,EAAasB,CAAW,IAC1C,kBAAC1B,GAAD;WAAM,MAAK;WAAY,WAAWH,EAAG,+DAA+D+B,CAAoB;WACtH,UAAAF;UACI,CAAA,IACHA,IACHC,CACK;;QAEJ;OACJ,CAAA,GAAA,CAAC,CAACE,KACF,kBAAC5B,GAAD;QAAO,WAAU;QAAa,KAAI;QAAK,WAAWJ,EAAG,4CAA4CiC,CAAgB;QAC/G,UAAAD;OACK,CAAA,CAEF;;KACD;IACD,CAAA,CAAA;;GAEN,CAAC,CAACE,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAe;GAAc,CAAA;GAE1D,CAAC,CAACC,KAAiB,kBAAC7B,GAAD,EAAW,WAAU,cAAe,CAAA;EACjD;;AAEV;AAEA,EAAY,cAAc"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "./lib/strings.js";
|
|
3
|
-
import { t } from "./utils-
|
|
4
|
-
import {
|
|
5
|
-
import { t as r } from "./button-
|
|
3
|
+
import { t } from "./utils-Cospvlj1.js";
|
|
4
|
+
import { s as n } from "./typography-CAr3dQhX.js";
|
|
5
|
+
import { t as r } from "./button-BS3KDg00.js";
|
|
6
6
|
import { createContext as i, useContext as a } from "react";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
import { ChevronLeftIcon as c, ChevronRightIcon as l, MoreHorizontalIcon as u } from "lucide-react";
|
|
@@ -68,7 +68,7 @@ function b({ className: e, label: r, strings: i, ...a }) {
|
|
|
68
68
|
let c = g(i);
|
|
69
69
|
return /* @__PURE__ */ s("span", {
|
|
70
70
|
"data-slot": "pagination-ellipsis",
|
|
71
|
-
className: t("pagination-primitives--ellipsis size-action-
|
|
71
|
+
className: t("pagination-primitives--ellipsis inline-flex size-action shrink-0 items-center justify-center text-muted-foreground", e),
|
|
72
72
|
...a,
|
|
73
73
|
children: [/* @__PURE__ */ o(u, {
|
|
74
74
|
className: "size-icon",
|
|
@@ -91,7 +91,7 @@ function S({ className: e, children: i, active: a = !1, ...s }) {
|
|
|
91
91
|
"aria-current": a ? "page" : void 0,
|
|
92
92
|
"data-slot": "pagination-link",
|
|
93
93
|
"data-active": a || void 0,
|
|
94
|
-
className: t("pagination-primitives--link", e),
|
|
94
|
+
className: t("pagination-primitives--link min-w-action px-control-xs", e),
|
|
95
95
|
...s,
|
|
96
96
|
children: _(i) ? /* @__PURE__ */ o(n, {
|
|
97
97
|
tag: "span",
|
|
@@ -108,7 +108,7 @@ function C({ className: e, text: r, strings: i, children: a, ...l }) {
|
|
|
108
108
|
return /* @__PURE__ */ s(S, {
|
|
109
109
|
"aria-label": u.previousLabel,
|
|
110
110
|
size: "md",
|
|
111
|
-
className: t("pagination-primitives--previous
|
|
111
|
+
className: t("pagination-primitives--previous sm:!ps-control-sm sm:!pe-control", e),
|
|
112
112
|
...l,
|
|
113
113
|
children: [/* @__PURE__ */ o(c, {
|
|
114
114
|
"data-icon": "inline-start",
|
|
@@ -128,7 +128,7 @@ function w({ className: e, text: r, strings: i, children: a, ...c }) {
|
|
|
128
128
|
return /* @__PURE__ */ s(S, {
|
|
129
129
|
"aria-label": u.nextLabel,
|
|
130
130
|
size: "md",
|
|
131
|
-
className: t("pagination-primitives--next
|
|
131
|
+
className: t("pagination-primitives--next sm:!ps-control sm:!pe-control-sm", e),
|
|
132
132
|
...c,
|
|
133
133
|
children: [/* @__PURE__ */ o(n, {
|
|
134
134
|
tag: "span",
|
|
@@ -146,4 +146,4 @@ function w({ className: e, text: r, strings: i, children: a, ...c }) {
|
|
|
146
146
|
//#endregion
|
|
147
147
|
export { w as a, m as c, S as i, b as n, C as o, x as r, v as s, y as t };
|
|
148
148
|
|
|
149
|
-
//# sourceMappingURL=pagination-
|
|
149
|
+
//# sourceMappingURL=pagination-Cm0jqa3I.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-NLGqRirf.js","names":["PaginationContent","PaginationItem","UIPagination","UIPaginationContent","UIPaginationItem","Text","Button","Pagination","props","cn","className","PaginationContent$1","PaginationItem$1","defaultPaginationStrings","PaginationStringsContext","createContext","usePaginationStrings","inheritedStrings","useContext","useStrings","stringsProp","isSimpleText","value","PaginationPrimitive","ariaLabel","strings","PaginationContent","PaginationEllipsis","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-4 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';\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/** 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, strings: stringsProp, ...props }: PaginationEllipsisProps) {\n\tconst strings = usePaginationStrings(stringsProp);\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"pagination-ellipsis\"\n\t\t\tclassName={cn('pagination-primitives--ellipsis size-action-sm', 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, ...props }: PaginationLinkProps) {\n\treturn (\n\t\t<Button\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\tclassName={cn('pagination-primitives--link', 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\tsize=\"md\"\n\t\t\tclassName={cn('pagination-primitives--previous pl-2!', 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\tsize=\"md\"\n\t\t\tclassName={cn('pagination-primitives--next pr-2!', 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,SAASO,EAAW,EAAE,cAAW,GAAGC,KAAsC;CACxE,OACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,aAAU;EACV,WAAWC,EACT,sCACAC,CACF;EACA,GAAIF;CACL,CAAA;AAEL;AAEA,SAASR,EAAkB,EACzB,cACA,GAAGQ,KAC0B;CAC7B,OACE,kBAAC,MAAD;EACE,aAAU;EACV,WAAWC,EAAG,qBAAqBC,CAAS;EAC5C,GAAIF;CACL,CAAA;AAEL;AAEA,SAASP,EAAe,EAAE,GAAGO,KAAqC;CAChE,OAAO,kBAAC,MAAD;EAAI,aAAU;EAAkB,GAAIA;CAAQ,CAAA;AACrD;;;ACdA,IAAaK,IAA8C;CAC1D,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,MAAM;CACN,eAAe;CACf,WAAW;AACZ,GAEMC,IAA2BC,EAAiCF,CAAwB;AAE1F,SAASG,EAAqB,GAA8C;CAC3E,IAAMC,IAAmBC,EAAWJ,CAAwB;CAC5D,OAAOK,EAAWF,GAAkBG,CAAW;AAChD;AAyCA,SAASC,EAAa,GAAqD;CAC1E,OAAO,OAAOC,KAAU,YAAY,OAAOA,KAAU,YAAY,OAAOA,KAAU;AACnF;AASA,SAAgBC,EAAoB,EAAE,cAAW,SAASH,GAAa,aAAU,cAAcI,GAAW,GAAGhB,KAA0B;CACtI,IAAMiB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACN,EAAyB,UAA1B;EAAmC,OAAOW;EACzC,UAAA,kBAACvB,GAAD;GACC,cAAYsB,KAAaC,EAAQ;GACjC,WAAWhB,EAAG,oCAAoCC,CAAS;GAC3D,GAAIF;GAEH;EACY,CAAA;CACoB,CAAA;AAErC;AAEA,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B,GAAD;GAAiB,aAAU;GAAe,eAAY;EAAQ,CAAA,GAC9D,kBAAC/B,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAgC,KAAQZ,EAAQ;EACZ,CAAA,CACS;;AAElB;AAGA,SAAgBa,EAAe,EAAE,cAAW,SAAM,SAASlB,GAAa,UAAUe,GAAW,GAAG3B,KAA8B;CAC7H,IAAMiB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACW,GAAD;EACC,cAAYN,EAAQ;EACpB,MAAK;EACL,WAAWhB,EAAG,qCAAqCC,CAAS;EAC5D,GAAIF;EAJL,UAAA,CAMC,kBAACH,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAgC,KAAQZ,EAAQ;EACZ,CAAA,GACN,kBAACc,GAAD;GAAkB,aAAU;GAAa,eAAY;EAAQ,CAAA,CAC9C;;AAElB"}
|
|
1
|
+
{"version":3,"file":"pagination-Cm0jqa3I.js","names":["PaginationContent","PaginationItem","UIPagination","UIPaginationContent","UIPaginationItem","Text","Button","Pagination","props","cn","className","PaginationContent$1","PaginationItem$1","defaultPaginationStrings","PaginationStringsContext","createContext","usePaginationStrings","inheritedStrings","useContext","useStrings","stringsProp","isSimpleText","value","PaginationPrimitive","ariaLabel","strings","PaginationContent","PaginationEllipsis","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-4 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';\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/** 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, strings: stringsProp, ...props }: PaginationEllipsisProps) {\n\tconst strings = usePaginationStrings(stringsProp);\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 size-action shrink-0 items-center justify-center text-muted-foreground', 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, ...props }: PaginationLinkProps) {\n\treturn (\n\t\t<Button\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 min-w-action px-control-xs', 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\tsize=\"md\"\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\tsize=\"md\"\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,SAASO,EAAW,EAAE,cAAW,GAAGC,KAAsC;CACxE,OACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,aAAU;EACV,WAAWC,EACT,sCACAC,CACF;EACA,GAAIF;CACL,CAAA;AAEL;AAEA,SAASR,EAAkB,EACzB,cACA,GAAGQ,KAC0B;CAC7B,OACE,kBAAC,MAAD;EACE,aAAU;EACV,WAAWC,EAAG,qBAAqBC,CAAS;EAC5C,GAAIF;CACL,CAAA;AAEL;AAEA,SAASP,EAAe,EAAE,GAAGO,KAAqC;CAChE,OAAO,kBAAC,MAAD;EAAI,aAAU;EAAkB,GAAIA;CAAQ,CAAA;AACrD;;;ACdA,IAAaK,IAA8C;CAC1D,iBAAiB;CACjB,WAAW;CACX,UAAU;CACV,MAAM;CACN,eAAe;CACf,WAAW;AACZ,GAEMC,IAA2BC,EAAiCF,CAAwB;AAE1F,SAASG,EAAqB,GAA8C;CAC3E,IAAMC,IAAmBC,EAAWJ,CAAwB;CAC5D,OAAOK,EAAWF,GAAkBG,CAAW;AAChD;AAyCA,SAASC,EAAa,GAAqD;CAC1E,OAAO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IACrB,kBAAC5B,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E;EACI,CAAA,IACH4B;CACG,CAAA;AAEV;AAGA,SAAgBC,EAAmB,EAAE,cAAW,SAAM,SAASd,GAAa,UAAUe,GAAW,GAAG3B,KAAkC;CACrI,IAAMiB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACW,GAAD;EACC,cAAYN,EAAQ;EACpB,MAAK;EACL,WAAWhB,EAAG,oEAAoEC,CAAS;EAC3F,GAAIF;EAJL,UAAA,CAMC,kBAAC4B,GAAD;GAAiB,aAAU;GAAe,eAAY;EAAQ,CAAA,GAC9D,kBAAC/B,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAgC,KAAQZ,EAAQ;EACZ,CAAA,CACS;;AAElB;AAGA,SAAgBa,EAAe,EAAE,cAAW,SAAM,SAASlB,GAAa,UAAUe,GAAW,GAAG3B,KAA8B;CAC7H,IAAMiB,IAAUT,EAAqBI,CAAW;CAChD,OACC,kBAACW,GAAD;EACC,cAAYN,EAAQ;EACpB,MAAK;EACL,WAAWhB,EAAG,gEAAgEC,CAAS;EACvF,GAAIF;EAJL,UAAA,CAMC,kBAACH,GAAD;GAAM,KAAI;GAAO,MAAK;GAAU,QAAO;GAAS,YAAW;GAAQ,WAAU;GAC3E,UAAAgC,KAAQZ,EAAQ;EACZ,CAAA,GACN,kBAACc,GAAD;GAAkB,aAAU;GAAa,eAAY;EAAQ,CAAA,CAC9C;;AAElB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { r as e } from "./theme-scope-kStaAer0.js";
|
|
3
|
-
import { t } from "./utils-
|
|
4
|
-
import {
|
|
3
|
+
import { t } from "./utils-Cospvlj1.js";
|
|
4
|
+
import { s as n } from "./typography-CAr3dQhX.js";
|
|
5
5
|
import { t as r } from "./anchored-positioning-DPnKTvNs.js";
|
|
6
6
|
import { t as i } from "./motion-recipes-B6jKXEcN.js";
|
|
7
7
|
import { t as a } from "./slot-CLF9kLrS.js";
|
|
8
|
-
import { t as o } from "./structure-
|
|
9
|
-
import { n as s } from "./surface-recipes-
|
|
10
|
-
import { i as c, r as l } from "./popover.recipes-
|
|
8
|
+
import { t as o } from "./structure-hzCW-XsV.js";
|
|
9
|
+
import { n as s } from "./surface-recipes-DOdoBXGm.js";
|
|
10
|
+
import { i as c, r as l } from "./popover.recipes-wmbvL8Ah.js";
|
|
11
11
|
import * as u from "react";
|
|
12
12
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
13
13
|
import { Popover as p } from "@base-ui/react/popover";
|
|
@@ -192,4 +192,4 @@ function D({ className: e, children: r, caption: i, ...a }) {
|
|
|
192
192
|
//#endregion
|
|
193
193
|
export { T as a, h as c, w as i, E as n, m as o, D as r, g as s, C as t };
|
|
194
194
|
|
|
195
|
-
//# sourceMappingURL=popover-
|
|
195
|
+
//# sourceMappingURL=popover-Dcv_9jxr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-CghIYdQf.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","motionRecipes","Slot","Stack","surfaceDividerRecipes","surfaceInsetClasses","popoverRecipes","React$1","Popover$1","props","Popover","PopoverTrigger","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","inferredNativeButton","children","resolvedNativeButton","nativeButton","PopoverAnchor","PopoverContent$1","disablePortal","resolvedContainer","container","inlineHost","setInlineHost","content","cn","className","PopoverHeader$1","PopoverTitle$1","PopoverDescription$1","isSimpleText","value","PopoverSurfaceContext","PopoverContent","resolvedType","type","inset","PopoverHeader","surface","copyGap","textGap","band","menu","hasStart","start","PopoverTitle","compact","PopoverDescription","PopoverFooter","childrenAsCaption","caption"],"sources":["../src/components/ui/popover.tsx","../src/components/base/popover/popover.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport * as React from \"react\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Popover({ ...props }: PopoverPrimitive.Root.Props) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n asChild = false,\n nativeButton,\n render,\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props & { asChild?: boolean; nativeButton?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: PopoverPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n let inferredNativeButton = true\n if (asChild && React.isValidElement(children)) {\n if (typeof children.type === \"string\") {\n inferredNativeButton = children.type === \"button\"\n } else {\n const childProps = (children.props ?? {}) as Record<string, unknown>\n inferredNativeButton = !(\"href\" in childProps)\n }\n }\n const resolvedNativeButton = nativeButton ?? (asChild ? inferredNativeButton : true)\n return (\n <PopoverPrimitive.Trigger\n data-slot=\"popover-trigger\"\n render={slotRender ?? safeRender}\n nativeButton={resolvedNativeButton}\n {...props}\n >\n {children}\n </PopoverPrimitive.Trigger>\n )\n}\n\nfunction PopoverAnchor({\n asChild = false,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\"> & { asChild?: boolean }) {\n if (asChild) {\n return <Slot {...props} />\n }\n\n return <span data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n container,\n 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 ...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 [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-md p-surface text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n )\n\n if (disablePortal) {\n // Base UI requires Portal context; a local host preserves inline DOM locality.\n return <div data-popover-inline-host=\"\" className=\"contents\" ref={setInlineHost}>\n <PopoverPrimitive.Portal container={inlineHost}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] max-w-[calc(100vw-2rem)] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\tsize={compact ? undefined : 'base'}\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"popover-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverTitlePrimitive>\n\t);\n}\n\ntype PopoverDescriptionBaseProps = React.ComponentProps<typeof PopoverDescriptionPrimitive>;\n\nfunction PopoverDescription({ children, className, ...props }: PopoverDescriptionBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverDescriptionPrimitive\n\t\t\tclassName={cn('popover-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,SAASA,EAAQ,EAAE,GAAGuB,KAAsC;CAC1D,OAAO,kBAACtB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIsB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACX,GAAD,CAAO,CAAA,IAAI,KAAA,GAClCY,IAAuD,OAAOC,KAAW,eACzE,GAAa,MAAU;EACzB,IAAM,EAAE,cAAcC,GAAe,GAAGC,MAASC;EAEjD,OAAOH,EAAOE,GAA4BE,CAAK;CACjD,KACEJ,GACAK,IAAuB;CAC3B,AAAIP,KAAWzB,EAAM,eAAeiC,CAAQ,MAC1C,AAIED,IAJE,OAAOC,EAAS,QAAS,WACJA,EAAS,SAAS,WAGlB,EAAE,WADLA,EAAS,SAAS,CAAC;CAI3C,IAAMC,IAAuBC,MAAiB,MAAUH;CACxD,OACE,kBAACjC,EAAiB,SAAlB;EACE,aAAU;EACV,QAAQyB,KAAcE;EACtB,cAAcQ;EACd,GAAIb;EAEH;CACuB,CAAA;AAE9B;AAEA,SAASe,EAAc,EACrB,aAAU,IACV,GAAGf,KAC8D;CAKjE,OAJII,IACK,kBAACX,GAAD,EAAM,GAAIO,EAAQ,CAAA,IAGpB,kBAAC,QAAD;EAAM,aAAU;EAAiB,GAAIA;CAAQ,CAAA;AACtD;AAEA,SAASpB,EAAe,EACtB,cACA,cACA,WACA,WAAQ,UACR,iBAAc,GACd,UAAO,UACP,gBAAa,GACb,mBAAgB,IAChB,oBAAiBqC,IAAgB,aAAa1B,GAC9C,oBACA,sB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CAACA,EAAQ,eAAe,UAAU;IACxJ,UAAAR,EAAaN,CAAO,IAAI,kBAAChC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAgC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBnC,CACQ;;CAC1B,CAAA;AAET"}
|
|
1
|
+
{"version":3,"file":"popover-Dcv_9jxr.js","names":["Popover","PopoverPrimitive","React","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","React","PopoverContentPrimitive","PopoverHeaderPrimitive","PopoverTitlePrimitive","PopoverDescriptionPrimitive","useThemePortalContainer","Text","anchoredPositionMethod","motionRecipes","Slot","Stack","surfaceDividerRecipes","surfaceInsetClasses","popoverRecipes","React$1","Popover$1","props","Popover","PopoverTrigger","slotRender","asChild","safeRender","render","_nativeButton","rest","renderProps","state","inferredNativeButton","children","resolvedNativeButton","nativeButton","PopoverAnchor","PopoverContent$1","disablePortal","resolvedContainer","container","inlineHost","setInlineHost","content","cn","className","PopoverHeader$1","PopoverTitle$1","PopoverDescription$1","isSimpleText","value","PopoverSurfaceContext","PopoverContent","resolvedType","type","inset","PopoverHeader","surface","copyGap","textGap","band","menu","hasStart","start","PopoverTitle","compact","PopoverDescription","PopoverFooter","childrenAsCaption","caption"],"sources":["../src/components/ui/popover.tsx","../src/components/base/popover/popover.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Popover as PopoverPrimitive } from \"@base-ui/react/popover\"\nimport * as React from \"react\"\n\nimport { Slot } from \"./slot\"\nimport { cn } from \"../../lib/utils\"\n\nfunction Popover({ ...props }: PopoverPrimitive.Root.Props) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({\n asChild = false,\n nativeButton,\n render,\n children,\n ...props\n}: PopoverPrimitive.Trigger.Props & { asChild?: boolean; nativeButton?: boolean }) {\n const slotRender = asChild ? <Slot /> : undefined\n const safeRender: PopoverPrimitive.Trigger.Props[\"render\"] = typeof render === \"function\"\n ? ((renderProps, state) => {\n const { nativeButton: _nativeButton, ...rest } = renderProps as Record<string, unknown>\n void _nativeButton\n return render(rest as typeof renderProps, state)\n })\n : render\n let inferredNativeButton = true\n if (asChild && React.isValidElement(children)) {\n if (typeof children.type === \"string\") {\n inferredNativeButton = children.type === \"button\"\n } else {\n const childProps = (children.props ?? {}) as Record<string, unknown>\n inferredNativeButton = !(\"href\" in childProps)\n }\n }\n const resolvedNativeButton = nativeButton ?? (asChild ? inferredNativeButton : true)\n return (\n <PopoverPrimitive.Trigger\n data-slot=\"popover-trigger\"\n render={slotRender ?? safeRender}\n nativeButton={resolvedNativeButton}\n {...props}\n >\n {children}\n </PopoverPrimitive.Trigger>\n )\n}\n\nfunction PopoverAnchor({\n asChild = false,\n ...props\n}: React.ComponentPropsWithoutRef<\"span\"> & { asChild?: boolean }) {\n if (asChild) {\n return <Slot {...props} />\n }\n\n return <span data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverContent({\n className,\n container,\n 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 ...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 [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-md p-surface text-sm shadow-md ring-1 z-50 w-72 origin-(--transform-origin) outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Positioner>\n )\n\n if (disablePortal) {\n // Base UI requires Portal context; a local host preserves inline DOM locality.\n return <div data-popover-inline-host=\"\" className=\"contents\" ref={setInlineHost}>\n <PopoverPrimitive.Portal container={inlineHost}>{content}</PopoverPrimitive.Portal>\n </div>\n }\n\n return <PopoverPrimitive.Portal container={resolvedContainer}>{content}</PopoverPrimitive.Portal>\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"flex flex-col text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={cn(\"font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction PopoverDescription({\n className,\n ...props\n}: PopoverPrimitive.Description.Props) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Popover,\n PopoverAnchor,\n PopoverContent,\n PopoverDescription,\n PopoverHeader,\n PopoverTitle,\n PopoverTrigger,\n}\n","import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\n/**\n * Popover — public wrapper around the internal Base UI popover implementation.\n *\n * What this layer adds on top of the primitive:\n * - Library-default `sideOffset` (6px) and an explicit inset contract:\n * card/multi-content popovers use `default`, item collections use\n * `compact`, and mixed region-owned compositions use `flush`.\n * - A consistent shadow + border treatment matching the rest of the\n * library (one semantic border, no extra primitive ring).\n * - Wraps the primitive parts with stable DOM hooks and adds a separated\n * footer region while preserving the compound-component pattern:\n * `<Popover>`, `<PopoverTrigger>`, `<PopoverContent>` exactly as\n * they would with the primitive.\n *\n * Use the shared inset role for padding; className owns placement. Override\n * `--surface-x` / `--surface-y` / `--space-scale` on a wrapper for surface-wide\n * density tweaks.\n */\nimport * as React from 'react';\n\nimport {\n\tPopover as PopoverPrimitive,\n\tPopoverAnchor,\n\tPopoverContent as PopoverContentPrimitive,\n\tPopoverDescription as PopoverDescriptionPrimitive,\n\tPopoverHeader as PopoverHeaderPrimitive,\n\tPopoverTitle as PopoverTitlePrimitive,\n\tPopoverTrigger,\n} from '../../ui/popover';\nimport { Text } from '../../typography';\nimport { Stack, type TextGap } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { popoverRecipes, surfaceInsetClasses, type PopoverContentType } from './popover.recipes';\nexport type { PopoverContentType } from './popover.recipes';\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\ntype PopoverContentBaseProps = React.ComponentProps<typeof PopoverContentPrimitive>;\n\nexport type PopoverContentInset = 'default' | 'compact' | 'flush';\n\nexport type PopoverContentProps = PopoverContentBaseProps & {\n\t/**\n\t * Surface inset role. `default` is for card-like or multi-content popovers,\n\t * `compact` for pure item/option collections, and `flush` when child regions\n\t * own their padding.\n\t */\n\tinset?: PopoverContentInset;\n\t/** Anatomy role; supplies the inferred inset only when inset is omitted. */\n\ttype?: PopoverContentType;\n};\n\nconst PopoverSurfaceContext = React.createContext({ type: 'display' as PopoverContentType, flush: false, regionOwned: false });\n\n/** Anchored content surface with a semantic inset role and package popover chrome. */\nfunction PopoverContent({\n\tclassName,\n\tsideOffset = 6,\n\tinset,\n\ttype,\n\tstyle,\n\t...props\n}: PopoverContentProps) {\n const resolvedType = type ?? (inset === 'compact' ? 'menu' : 'display');\n return (\n <PopoverSurfaceContext.Provider value={{ type: resolvedType, flush: inset === 'flush', regionOwned: false }}>\n\t\t<PopoverContentPrimitive\n\t\t\tdata-surface-type={resolvedType}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('popover--component',\n\t\t\t\t// A popover is a small surface, not a compressed tooltip. The\n\t\t\t\t// unsuffixed surface token is the package-wide default and remains\n\t\t\t\t// responsive to scoped spacing changes.\n\t\t\t\t'gap-space-md max-h-[min(var(--available-height),calc(100dvh-2rem))] max-w-[calc(100vw-2rem)] overflow-y-auto overscroll-contain',\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tsurfaceInsetClasses[inset ?? (resolvedType === 'menu' ? 'compact' : 'default')],\n\t\t\t\t// Raw shadcn/Base UI buttons still carry a generic 1px press\n\t\t\t\t// translation. Popovers are stable anchored surfaces; moving a\n\t\t\t\t// calendar day or menu action makes the interaction feel soft.\n\t\t\t\t'[&_button]:active:translate-y-0!',\n\t\t\t\t// The shared recipe owns the semantic hairline border and shadow.\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t/>\n </PopoverSurfaceContext.Provider>\n\t);\n}\n\ntype PopoverHeaderBaseProps = React.ComponentProps<typeof PopoverHeaderPrimitive> & {\n /** Leading control, aligned with collection highlight edges rather than label text. */\n start?: React.ReactNode;\n /** Copy rhythm. Defaults to dense for menus and normal for display surfaces. */\n textGap?: TextGap;\n};\n\nfunction PopoverHeader({ className, children, start, textGap, ...props }: PopoverHeaderBaseProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const copyGap = textGap ?? (surface.type === 'menu' ? 'dense' : 'normal');\n const band = surface.flush && !surface.regionOwned;\n const menu = surface.type === 'menu' && !surface.regionOwned;\n const hasStart = start != null && start !== false;\n return (\n\t\t<PopoverHeaderPrimitive\n\t\t\tclassName={cn(\n 'popover-header--component',\n copyGap === 'dense' ? 'gap-dense' : 'gap-normal',\n band && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n !band && menu && 'py-row-y',\n hasStart && 'flex-row items-center gap-space-md',\n band && surfaceDividerRecipes.anchored.header,\n className,\n )}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {start}\n <Stack gap={copyGap} className={cn('popover-header--body min-w-0 flex-1', menu && !hasStart && 'px-row-x')}>\n {children}\n </Stack>\n </PopoverSurfaceContext.Provider>\n </PopoverHeaderPrimitive>\n\t);\n}\n\ntype PopoverTitleBaseProps = React.ComponentProps<typeof PopoverTitlePrimitive>;\n\nfunction PopoverTitle({ children, className, ...props }: PopoverTitleBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverTitlePrimitive\n\t\t\tclassName={cn('popover-title--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\tsize={compact ? undefined : 'base'}\n\t\t\t\t\tweight=\"semibold\"\n\t\t\t\t\tlineHeight=\"snug\"\n\t\t\t\t\tclassName=\"popover-title--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverTitlePrimitive>\n\t);\n}\n\ntype PopoverDescriptionBaseProps = React.ComponentProps<typeof PopoverDescriptionPrimitive>;\n\nfunction PopoverDescription({ children, className, ...props }: PopoverDescriptionBaseProps) {\n const compact = React.useContext(PopoverSurfaceContext).type === 'menu';\n return (\n\t\t<PopoverDescriptionPrimitive\n\t\t\tclassName={cn('popover-description--component', className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isSimpleText(children) ? (\n\t\t\t\t<Text\n\t\t\t\t\ttag=\"span\"\n\t\t\t\t\ttype=\"secondary\"\n size={compact ? 'xs' : undefined}\n\t\t\t\t\tlineHeight={compact ? 'normal' : 'relaxed'}\n\t\t\t\t\tclassName=\"popover-description--text\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</PopoverDescriptionPrimitive>\n\t);\n}\n\ntype PopoverFooterProps = React.ComponentProps<'div'> & {\n /** Leading supporting content, aligned with collection labels; children are trailing actions. */\n caption?: React.ReactNode;\n};\n\nfunction PopoverFooter({ className, children, caption, ...props }: PopoverFooterProps) {\n const surface = React.useContext(PopoverSurfaceContext);\n const childrenAsCaption = caption == null && isSimpleText(children);\n const content = caption ?? (childrenAsCaption ? children : undefined);\n return (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"end\"\n\t\t\twrap\n\t\t\tclassName={cn(\n\t\t\t\t'popover-footer--component pt-space-sm', surfaceDividerRecipes.anchored.footer,\n surface.flush && !surface.regionOwned && (surface.type === 'menu' ? popoverRecipes.menuRegion : popoverRecipes.display),\n\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n <PopoverSurfaceContext.Provider value={{ ...surface, regionOwned: true }}>\n {content != null && <div className={cn('popover-footer--caption me-auto min-w-0 max-w-full', surface.type === 'menu' && !surface.regionOwned && 'px-row-x')}>\n {isSimpleText(content) ? <Text tag=\"span\" size=\"xs\" type=\"secondary\">{content}</Text> : content}\n </div>}\n {!childrenAsCaption && children}\n </PopoverSurfaceContext.Provider>\n </Stack>\n\t);\n}\n\nexport {\n\tPopoverPrimitive as Popover,\n\tPopoverAnchor,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverFooter,\n\tPopoverHeader,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,SAASA,EAAQ,EAAE,GAAGuB,KAAsC;CAC1D,OAAO,kBAACtB,EAAiB,MAAlB;EAAuB,aAAU;EAAU,GAAIsB;CAAQ,CAAA;AAChE;AAEA,SAASE,EAAe,EACtB,aAAU,IACV,iBACA,WACA,aACA,GAAGF,KAC8E;CACjF,IAAMG,IAAaC,IAAU,kBAACX,GAAD,CAAO,CAAA,IAAI,KAAA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AahB,CAAQ,IACrB,kBAACtB,GAAD;GACC,KAAI;GACJ,MAAK;GACL,MAAMsD,IAAU,OAAO,KAAA;GACvB,YAAYA,IAAU,WAAW;GACjC,WAAU;GAET;EACI,CAAA,IACHhC;CACwB,CAAA;AAE/B;AAOA,SAASkC,EAAc,EAAE,cAAW,aAAU,YAAS,GAAG9C,KAA6B;CACtF,IAAMoC,IAAUpD,EAAM,WAAW8C,CAAqB,GAChDiB,IAAoBC,KAAW,QAAQpB,EAAahB,CAAQ,GAC5DU,IAAU0B,MAAYD,IAAoBnC,IAAW,KAAA;CAC3D,OACC,kBAAClB,GAAD;EACC,WAAU;EACV,KAAI;EACJ,SAAQ;EACR,MAAA;EACA,WAAW6B,EACV,yCAAyC5B,EAAsB,SAAS,QACxEyC,EAAQ,SAAS,CAACA,EAAQ,gBAAgBA,EAAQ,SAAS,SAASvC,EAAe,aAAaA,EAAe,UAE/G2B,CACD;EACA,GAAIxB;EAEJ,UAAA,kBAAC8B,EAAsB,UAAvB;GAAgC,OAAO;IAAE,GAAGM;IAAS,aAAa;GAAK;GAAvE,UAAA,CACEd,KAAW,QAAQ,kBAAC,OAAD;IAAK,WAAWC,EAAG,sDAAsDa,EAAQ,SAAS,UAAU,CAACA,EAAQ,eAAe,UAAU;IACxJ,UAAAR,EAAaN,CAAO,IAAI,kBAAChC,GAAD;KAAM,KAAI;KAAO,MAAK;KAAK,MAAK;KAAa,UAAAgC;IAAc,CAAA,IAAIA;GACpF,CAAA,GACJ,CAACyB,KAAqBnC,CACQ;;CAC1B,CAAA;AAET"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useStrings as e } from "./lib/strings.js";
|
|
3
|
-
import { t } from "./utils-
|
|
4
|
-
import { n, t as r } from "./feedback-
|
|
5
|
-
import { t as i } from "./collection-content-
|
|
6
|
-
import { a, i as o, l as s, n as c, o as l, r as u, t as d } from "./command-
|
|
7
|
-
import { c as f, i as p, o as m, r as h, t as g } from "./popover-
|
|
3
|
+
import { t } from "./utils-Cospvlj1.js";
|
|
4
|
+
import { n, t as r } from "./feedback-C7nR0UtT.js";
|
|
5
|
+
import { t as i } from "./collection-content-Ys-OZOkY.js";
|
|
6
|
+
import { a, i as o, l as s, n as c, o as l, r as u, t as d } from "./command-kPMPjIxJ.js";
|
|
7
|
+
import { c as f, i as p, o as m, r as h, t as g } from "./popover-Dcv_9jxr.js";
|
|
8
8
|
import * as _ from "react";
|
|
9
9
|
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/base/popover-menu/popover-menu.types.ts
|
|
@@ -96,4 +96,4 @@ S.displayName = "PopoverMenu";
|
|
|
96
96
|
//#endregion
|
|
97
97
|
export { x as n, S as t };
|
|
98
98
|
|
|
99
|
-
//# sourceMappingURL=popover-menu-
|
|
99
|
+
//# sourceMappingURL=popover-menu-DnRFKnHP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-menu-B4PoWhRl.js","names":["React","_Fragment","ErrorState","CollectionContent","CommandInput","commandFilter","CommandEmpty","CommandList","CommandGroup","Command","PopoverTrigger","PopoverHeader","Popover","PopoverFooter","PopoverContent","React$1","Fragment$1","defaultPopoverMenuStrings","PopoverMenu","stringsProp","strings","useStrings","searchRef","triggerRef","keyboardDismissal","contentRef","searchOverrides","items","item","filter","value","search","keywords","next","details","onOpenChange","trigger","contentLabelledBy","contentLabel","cn","contentClassName","onSearchChange","header","searchValue","loading","loadingSlot","LoadingState","error","onRetry","empty","CommandItem","onSelect","renderItem","footer"],"sources":["../src/components/base/popover-menu/popover-menu.types.ts","../src/components/base/popover-menu/popover-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface PopoverMenuItem<T = unknown> {\n\t/** Unique identifier; remains distinct from visible search labels. */\n\tvalue: string;\n\t/** Visible label rendered in the row. Override entirely via `renderItem`. */\n\tlabel: ReactNode;\n\t/** Optional secondary line rendered under the label. */\n\tdescription?: ReactNode;\n\t/** Leading icon — keep small (size-icon-md/size-icon max). */\n\ticon?: ReactNode;\n\t/** Show the trailing checkmark when `true`. */\n\tselected?: boolean;\n\t/** Disable the row. */\n\tdisabled?: boolean;\n\t/** Explicit search keywords, useful when the label is structured content. */\n\tsearchValue?: string;\n\t/** Arbitrary payload for `onSelect` consumers. */\n\tdata?: T;\n}\n\nexport interface PopoverMenuStrings {\n\t/** Placeholder for the search input (when `search` is enabled). */\n\tsearchPlaceholder: string;\n\t/** Empty-state copy when filtering yields no items. */\n\tempty: string;\n\t/** Loading-state copy. */\n\tloading: string;\n\t/** Retry action copy when a resource fails. */\n\tretry?: string;\n}\n\nexport const defaultPopoverMenuStrings: PopoverMenuStrings = {\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No results.',\n\tloading: 'Loading…',\n\tretry: 'Retry',\n};\n","import { commandFilter } from '../../../lib/command-filter';\n/**\n * PopoverMenu — blocks wrapper around `base/popover` + `base/command`.\n *\n * Captures the recurring \"trigger → optional header → search → command list\"\n * pattern used by filter facets, operator selects, and similar pickers\n * across the library.\n *\n * Slots (all optional):\n * - `header` — rendered above the search input / list\n * - `footer` — rendered below the list (e.g. confirm/clear buttons)\n * - `empty` — replaces the default empty-state copy\n * - `loading` — replaces the list when `loading` is true\n *\n * Render-prop:\n * - `renderItem={(item, ctx) => ReactNode}` — full control over a row\n *\n * Strings:\n * - `strings={{ searchPlaceholder, empty, loading }}` — merged with defaults\n *\n * For headless usage (custom UI against the same selection state),\n * compose `base/popover` + `base/command` directly.\n */\nimport * as React from 'react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../command';\nimport {\n\tPopover,\n\tPopoverContent,\n PopoverHeader,\n PopoverFooter,\n\tPopoverTrigger,\n} from '../popover';\nimport { LoadingState, ErrorState } from '../feedback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { type CollectionDensity } from '../popover/popover.recipes';\nimport { CollectionContent } from '../popover/collection-content';\n\nimport {\n\tdefaultPopoverMenuStrings,\n\ttype PopoverMenuItem,\n\ttype PopoverMenuStrings,\n} from './popover-menu.types';\n\nexport interface PopoverMenuRenderItemContext {\n\t/** True when the item is the user's currently-active match (keyboard or pointer highlight). */\n\tisHighlighted: boolean;\n}\n\nexport interface PopoverMenuProps<T = unknown> {\n\t/** Vertical row rhythm. Compact and comfortable preserve primary label size and inline room. */\n\tdensity?: CollectionDensity;\n\t/** Trigger element. The popover anchors to it. Pass any clickable. */\n\ttrigger: React.ReactNode;\n\t/** Items to render in the list. */\n\titems: ReadonlyArray<PopoverMenuItem<T>>;\n\t/** Selection callback — fires on row click / Enter. */\n\tonSelect: (item: PopoverMenuItem<T>) => void;\n\n\t/** Controlled open state. Omit for uncontrolled. */\n\topen?: boolean;\n\t/** Open-state callback for controlled / uncontrolled flows. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Show the search input above the list. Default: true. */\n\tsearch?: boolean;\n\t/** Search input value (controlled). */\n\tsearchValue?: string;\n\t/** Search input change callback. */\n\tonSearchChange?: (value: string) => void;\n\n\t/** Async loading flag — replaces stale options and the empty state. */\n\tloading?: boolean;\n\t/** Resource failure replaces the list. The application owns retry and fetching. */\n\terror?: React.ReactNode;\n\tonRetry?: () => void;\n\n\t/** Optional pre-list slot (e.g. a label / eyebrow). */\n\theader?: React.ReactNode;\n\t/** Optional post-list slot (e.g. confirm / clear buttons). */\n\tfooter?: React.ReactNode;\n\t/** Override empty-state slot (defaults to `strings.empty`). */\n\tempty?: React.ReactNode;\n\t/** Override loading slot (defaults to spinner + `strings.loading`). */\n\tloadingSlot?: React.ReactNode;\n\n\t/** Per-item render override. */\n\trenderItem?: (\n\t\titem: PopoverMenuItem<T>,\n\t\tctx: PopoverMenuRenderItemContext,\n\t) => React.ReactNode;\n\n\t/** Override copy. Deep-merged over defaults. */\n\tstrings?: StringsProp<PopoverMenuStrings>;\n\n\t/** Popover content positioning props (forwarded). */\n\talign?: React.ComponentProps<typeof PopoverContent>['align'];\n\t/** Distance from the trigger, in pixels. */\n\tsideOffset?: React.ComponentProps<typeof PopoverContent>['sideOffset'];\n\n\t/** Width override for the popover content. Default: w-56. */\n\tcontentClassName?: string;\n /** Accessible name for the popup. Defaults to the localized search label. */\n contentLabel?: string;\n /** ID of a consumer-owned title used instead of contentLabel. */\n contentLabelledBy?: string;\n}\n\nexport function PopoverMenu<T = unknown>({\n\tdensity = 'default',\n\ttrigger,\n\titems,\n\tonSelect,\n\topen,\n\tonOpenChange,\n\tsearch = true,\n\tsearchValue,\n\tonSearchChange,\n\tloading = false,\n\terror,\n\tonRetry,\n\theader,\n\tfooter,\n\tempty,\n\tloadingSlot,\n\trenderItem,\n\tstrings: stringsProp,\n\talign = 'start',\n\tsideOffset,\n\tcontentClassName,\n contentLabel,\n contentLabelledBy,\n}: PopoverMenuProps<T>) {\n\tconst strings = useStrings(defaultPopoverMenuStrings, stringsProp);\n\tconst searchRef = React.useRef<HTMLInputElement>(null);\n\tconst triggerRef = React.useRef<HTMLButtonElement>(null);\n\tconst keyboardDismissal = React.useRef(false);\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n const searchOverrides = React.useMemo(() => new Map(\n items.filter(item => item.searchValue !== undefined).map(item => [item.value, item.searchValue!]),\n ), [items]);\n const filter = React.useCallback((value: string, search: string, keywords?: string[]) => (\n searchOverrides.has(value)\n ? commandFilter(searchOverrides.get(value)!, search)\n : commandFilter(value, search, keywords)\n ), [searchOverrides]);\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={(next, details) => {\n keyboardDismissal.current = !next && details.reason === 'escape-key';\n onOpenChange?.(next);\n }} onOpenChangeComplete={next => {\n // Rapid reopen during a focus-out exit can retain Base UI's no-return flag.\n // Restore only an accepted, completed Escape dismissal; outside focus stays owned.\n if (!next && keyboardDismissal.current) {\n keyboardDismissal.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n }\n }}>\n\t\t\t<PopoverTrigger ref={triggerRef} render={trigger as React.ReactElement} />\n\t\t\t<PopoverContent\n\t\t\t\tref={contentRef}\n\t\t\t\taria-label={contentLabelledBy ? undefined : contentLabel ?? strings.searchPlaceholder}\n aria-labelledby={contentLabelledBy}\n align={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\ttype=\"menu\"\n\t\t\t\tinset=\"flush\"\n\t\t\t\tclassName={cn('popover-menu--component', 'w-56 gap-0 overflow-hidden', contentClassName)}\n\t\t\t>\n\t\t\t\t<Command\n\t\t\t\t\tshouldFilter={!onSearchChange}\n filter={filter}\n\t\t\t\t\tinset=\"flush\"\n\t\t\t\t\tclassName=\"popover-menu--collection\"\n\t\t\t\t>\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<PopoverHeader className=\"popover-menu--header\">\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{!!search && (\n\t\t\t\t\t\t<CommandInput\n\t\t\t\t\t\t\tref={searchRef}\n\t\t\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\t\tonValueChange={onSearchChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<CommandList aria-busy={loading || undefined}>\n\t\t\t\t\t\t{loading ? (loadingSlot !== undefined ? <div role=\"status\" aria-live=\"polite\">{loadingSlot}</div> : <LoadingState label={strings.loading} />) : error ? <ErrorState variant=\"inline\" description={error} onRetry={onRetry ? () => {\n // Retry feedback is replaced by loading. Keep focus on persistent anatomy\n // before its button is removed, including in search-free pickers.\n (searchRef.current ?? contentRef.current)?.focus();\n onRetry();\n } : undefined} retryLabel={strings.retry ?? 'Retry'} /> : <>\n\n\t\t\t\t\t\t<CommandEmpty>{empty ?? strings.empty}</CommandEmpty>\n\n\t\t\t\t\t\t{items.length > 0 && (\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\t\tvalue={item.value}\n keywords={item.searchValue !== undefined ? [item.searchValue] : [item.label, item.description].filter((value): value is string => typeof value === 'string')}\n\t\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(item)}\n\t\t\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t\t\t\tdata-checked={item.selected || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName=\"data-[checked=true]:**:[svg]:text-primary-accent\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{({ isHighlighted }) => renderItem\n\t\t\t\t\t\t\t\t\t\t\t? renderItem(item, { isHighlighted })\n\t\t\t\t\t\t\t\t\t\t\t: (\n\t\t\t\t\t\t\t\t\t\t\t\t<CollectionContent label={item.label} description={item.description} leading={item.icon} leadingClassName=\"[&_svg]:size-icon\"/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>}\n\t\t\t\t\t</CommandList>\n\n\t\t\t\t\t{/* The public surface anatomy owns header and footer bands. */}\n\t\t\t\t\t{!!footer && (\n\t\t\t\t\t\t<PopoverFooter className=\"popover-menu--footer justify-start\">\n\t\t\t\t\t\t\t{footer}\n\t\t\t\t\t\t</PopoverFooter>\n\t\t\t\t\t)}\n\t\t\t\t</Command>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\nPopoverMenu.displayName = 'PopoverMenu';\n"],"mappings":";;;;;;;;;;AAgCA,IAAaiB,IAAgD;CAC5D,mBAAmB;CACnB,OAAO;CACP,SAAS;CACT,OAAO;AACR;;;AC+EA,SAAgB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OyB,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-DnRFKnHP.js","names":["React","_Fragment","ErrorState","CollectionContent","CommandInput","commandFilter","CommandEmpty","CommandList","CommandGroup","Command","PopoverTrigger","PopoverHeader","Popover","PopoverFooter","PopoverContent","React$1","Fragment$1","defaultPopoverMenuStrings","PopoverMenu","stringsProp","strings","useStrings","searchRef","triggerRef","keyboardDismissal","contentRef","searchOverrides","items","item","filter","value","search","keywords","next","details","onOpenChange","trigger","contentLabelledBy","contentLabel","cn","contentClassName","onSearchChange","header","searchValue","loading","loadingSlot","LoadingState","error","onRetry","empty","CommandItem","onSelect","renderItem","footer"],"sources":["../src/components/base/popover-menu/popover-menu.types.ts","../src/components/base/popover-menu/popover-menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nexport interface PopoverMenuItem<T = unknown> {\n\t/** Unique identifier; remains distinct from visible search labels. */\n\tvalue: string;\n\t/** Visible label rendered in the row. Override entirely via `renderItem`. */\n\tlabel: ReactNode;\n\t/** Optional secondary line rendered under the label. */\n\tdescription?: ReactNode;\n\t/** Leading icon — keep small (size-icon-md/size-icon max). */\n\ticon?: ReactNode;\n\t/** Show the trailing checkmark when `true`. */\n\tselected?: boolean;\n\t/** Disable the row. */\n\tdisabled?: boolean;\n\t/** Explicit search keywords, useful when the label is structured content. */\n\tsearchValue?: string;\n\t/** Arbitrary payload for `onSelect` consumers. */\n\tdata?: T;\n}\n\nexport interface PopoverMenuStrings {\n\t/** Placeholder for the search input (when `search` is enabled). */\n\tsearchPlaceholder: string;\n\t/** Empty-state copy when filtering yields no items. */\n\tempty: string;\n\t/** Loading-state copy. */\n\tloading: string;\n\t/** Retry action copy when a resource fails. */\n\tretry?: string;\n}\n\nexport const defaultPopoverMenuStrings: PopoverMenuStrings = {\n\tsearchPlaceholder: 'Search…',\n\tempty: 'No results.',\n\tloading: 'Loading…',\n\tretry: 'Retry',\n};\n","import { commandFilter } from '../../../lib/command-filter';\n/**\n * PopoverMenu — blocks wrapper around `base/popover` + `base/command`.\n *\n * Captures the recurring \"trigger → optional header → search → command list\"\n * pattern used by filter facets, operator selects, and similar pickers\n * across the library.\n *\n * Slots (all optional):\n * - `header` — rendered above the search input / list\n * - `footer` — rendered below the list (e.g. confirm/clear buttons)\n * - `empty` — replaces the default empty-state copy\n * - `loading` — replaces the list when `loading` is true\n *\n * Render-prop:\n * - `renderItem={(item, ctx) => ReactNode}` — full control over a row\n *\n * Strings:\n * - `strings={{ searchPlaceholder, empty, loading }}` — merged with defaults\n *\n * For headless usage (custom UI against the same selection state),\n * compose `base/popover` + `base/command` directly.\n */\nimport * as React from 'react';\n\nimport {\n\tCommand,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n} from '../command';\nimport {\n\tPopover,\n\tPopoverContent,\n PopoverHeader,\n PopoverFooter,\n\tPopoverTrigger,\n} from '../popover';\nimport { LoadingState, ErrorState } from '../feedback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport { type CollectionDensity } from '../popover/popover.recipes';\nimport { CollectionContent } from '../popover/collection-content';\n\nimport {\n\tdefaultPopoverMenuStrings,\n\ttype PopoverMenuItem,\n\ttype PopoverMenuStrings,\n} from './popover-menu.types';\n\nexport interface PopoverMenuRenderItemContext {\n\t/** True when the item is the user's currently-active match (keyboard or pointer highlight). */\n\tisHighlighted: boolean;\n}\n\nexport interface PopoverMenuProps<T = unknown> {\n\t/** Vertical row rhythm. Compact and comfortable preserve primary label size and inline room. */\n\tdensity?: CollectionDensity;\n\t/** Trigger element. The popover anchors to it. Pass any clickable. */\n\ttrigger: React.ReactNode;\n\t/** Items to render in the list. */\n\titems: ReadonlyArray<PopoverMenuItem<T>>;\n\t/** Selection callback — fires on row click / Enter. */\n\tonSelect: (item: PopoverMenuItem<T>) => void;\n\n\t/** Controlled open state. Omit for uncontrolled. */\n\topen?: boolean;\n\t/** Open-state callback for controlled / uncontrolled flows. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Show the search input above the list. Default: true. */\n\tsearch?: boolean;\n\t/** Search input value (controlled). */\n\tsearchValue?: string;\n\t/** Search input change callback. */\n\tonSearchChange?: (value: string) => void;\n\n\t/** Async loading flag — replaces stale options and the empty state. */\n\tloading?: boolean;\n\t/** Resource failure replaces the list. The application owns retry and fetching. */\n\terror?: React.ReactNode;\n\tonRetry?: () => void;\n\n\t/** Optional pre-list slot (e.g. a label / eyebrow). */\n\theader?: React.ReactNode;\n\t/** Optional post-list slot (e.g. confirm / clear buttons). */\n\tfooter?: React.ReactNode;\n\t/** Override empty-state slot (defaults to `strings.empty`). */\n\tempty?: React.ReactNode;\n\t/** Override loading slot (defaults to spinner + `strings.loading`). */\n\tloadingSlot?: React.ReactNode;\n\n\t/** Per-item render override. */\n\trenderItem?: (\n\t\titem: PopoverMenuItem<T>,\n\t\tctx: PopoverMenuRenderItemContext,\n\t) => React.ReactNode;\n\n\t/** Override copy. Deep-merged over defaults. */\n\tstrings?: StringsProp<PopoverMenuStrings>;\n\n\t/** Popover content positioning props (forwarded). */\n\talign?: React.ComponentProps<typeof PopoverContent>['align'];\n\t/** Distance from the trigger, in pixels. */\n\tsideOffset?: React.ComponentProps<typeof PopoverContent>['sideOffset'];\n\n\t/** Width override for the popover content. Default: w-56. */\n\tcontentClassName?: string;\n /** Accessible name for the popup. Defaults to the localized search label. */\n contentLabel?: string;\n /** ID of a consumer-owned title used instead of contentLabel. */\n contentLabelledBy?: string;\n}\n\nexport function PopoverMenu<T = unknown>({\n\tdensity = 'default',\n\ttrigger,\n\titems,\n\tonSelect,\n\topen,\n\tonOpenChange,\n\tsearch = true,\n\tsearchValue,\n\tonSearchChange,\n\tloading = false,\n\terror,\n\tonRetry,\n\theader,\n\tfooter,\n\tempty,\n\tloadingSlot,\n\trenderItem,\n\tstrings: stringsProp,\n\talign = 'start',\n\tsideOffset,\n\tcontentClassName,\n contentLabel,\n contentLabelledBy,\n}: PopoverMenuProps<T>) {\n\tconst strings = useStrings(defaultPopoverMenuStrings, stringsProp);\n\tconst searchRef = React.useRef<HTMLInputElement>(null);\n\tconst triggerRef = React.useRef<HTMLButtonElement>(null);\n\tconst keyboardDismissal = React.useRef(false);\n\tconst contentRef = React.useRef<HTMLDivElement>(null);\n const searchOverrides = React.useMemo(() => new Map(\n items.filter(item => item.searchValue !== undefined).map(item => [item.value, item.searchValue!]),\n ), [items]);\n const filter = React.useCallback((value: string, search: string, keywords?: string[]) => (\n searchOverrides.has(value)\n ? commandFilter(searchOverrides.get(value)!, search)\n : commandFilter(value, search, keywords)\n ), [searchOverrides]);\n\n\treturn (\n\t\t<Popover open={open} onOpenChange={(next, details) => {\n keyboardDismissal.current = !next && details.reason === 'escape-key';\n onOpenChange?.(next);\n }} onOpenChangeComplete={next => {\n // Rapid reopen during a focus-out exit can retain Base UI's no-return flag.\n // Restore only an accepted, completed Escape dismissal; outside focus stays owned.\n if (!next && keyboardDismissal.current) {\n keyboardDismissal.current = false;\n triggerRef.current?.focus({ preventScroll: true });\n }\n }}>\n\t\t\t<PopoverTrigger ref={triggerRef} render={trigger as React.ReactElement} />\n\t\t\t<PopoverContent\n\t\t\t\tref={contentRef}\n\t\t\t\taria-label={contentLabelledBy ? undefined : contentLabel ?? strings.searchPlaceholder}\n aria-labelledby={contentLabelledBy}\n align={align}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\ttype=\"menu\"\n\t\t\t\tinset=\"flush\"\n\t\t\t\tclassName={cn('popover-menu--component', 'w-56 gap-0 overflow-hidden', contentClassName)}\n\t\t\t>\n\t\t\t\t<Command\n\t\t\t\t\tshouldFilter={!onSearchChange}\n filter={filter}\n\t\t\t\t\tinset=\"flush\"\n\t\t\t\t\tclassName=\"popover-menu--collection\"\n\t\t\t\t>\n\t\t\t\t\t{!!header && (\n\t\t\t\t\t\t<PopoverHeader className=\"popover-menu--header\">\n\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t</PopoverHeader>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{!!search && (\n\t\t\t\t\t\t<CommandInput\n\t\t\t\t\t\t\tref={searchRef}\n\t\t\t\t\t\t\tplaceholder={strings.searchPlaceholder}\n\t\t\t\t\t\t\tvalue={searchValue}\n\t\t\t\t\t\t\tonValueChange={onSearchChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<CommandList aria-busy={loading || undefined}>\n\t\t\t\t\t\t{loading ? (loadingSlot !== undefined ? <div role=\"status\" aria-live=\"polite\">{loadingSlot}</div> : <LoadingState label={strings.loading} />) : error ? <ErrorState variant=\"inline\" description={error} onRetry={onRetry ? () => {\n // Retry feedback is replaced by loading. Keep focus on persistent anatomy\n // before its button is removed, including in search-free pickers.\n (searchRef.current ?? contentRef.current)?.focus();\n onRetry();\n } : undefined} retryLabel={strings.retry ?? 'Retry'} /> : <>\n\n\t\t\t\t\t\t<CommandEmpty>{empty ?? strings.empty}</CommandEmpty>\n\n\t\t\t\t\t\t{items.length > 0 && (\n\t\t\t\t\t\t\t<CommandGroup>\n\t\t\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t\t\t<CommandItem\n\t\t\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\t\tvalue={item.value}\n keywords={item.searchValue !== undefined ? [item.searchValue] : [item.label, item.description].filter((value): value is string => typeof value === 'string')}\n\t\t\t\t\t\t\t\t\t\tonSelect={() => onSelect(item)}\n\t\t\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t\t\t\tdata-checked={item.selected || undefined}\n\t\t\t\t\t\t\t\t\t\tclassName=\"data-[checked=true]:**:[svg]:text-primary-accent\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{({ isHighlighted }) => renderItem\n\t\t\t\t\t\t\t\t\t\t\t? renderItem(item, { isHighlighted })\n\t\t\t\t\t\t\t\t\t\t\t: (\n\t\t\t\t\t\t\t\t\t\t\t\t<CollectionContent label={item.label} description={item.description} leading={item.icon} leadingClassName=\"[&_svg]:size-icon\"/>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</CommandItem>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</CommandGroup>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>}\n\t\t\t\t\t</CommandList>\n\n\t\t\t\t\t{/* The public surface anatomy owns header and footer bands. */}\n\t\t\t\t\t{!!footer && (\n\t\t\t\t\t\t<PopoverFooter className=\"popover-menu--footer justify-start\">\n\t\t\t\t\t\t\t{footer}\n\t\t\t\t\t\t</PopoverFooter>\n\t\t\t\t\t)}\n\t\t\t\t</Command>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n\nPopoverMenu.displayName = 'PopoverMenu';\n"],"mappings":";;;;;;;;;;AAgCA,IAAaiB,IAAgD;CAC5D,mBAAmB;CACnB,OAAO;CACP,SAAS;CACT,OAAO;AACR;;;AC+EA,SAAgBC,EAAyB,EACxC,aAAU,WACV,YACA,UACA,aACA,SACA,iBACA,YAAS,IACT,gBACA,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,IAAYtB,EAAM,OAAyB,IAAI,GAC/CuB,IAAavB,EAAM,OAA0B,IAAI,GACjDwB,IAAoBxB,EAAM,OAAO,E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n as e } from "./surface-recipes-
|
|
1
|
+
import { n as e } from "./surface-recipes-DOdoBXGm.js";
|
|
2
2
|
import { t } from "./row-recipes-DL8n7t_b.js";
|
|
3
3
|
//#region src/components/base/popover/popover.recipes.ts
|
|
4
4
|
var n = {
|
|
@@ -31,4 +31,4 @@ var o = {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { r as i, a as n, n as r, o as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=popover.recipes-
|
|
34
|
+
//# sourceMappingURL=popover.recipes-wmbvL8Ah.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.recipes-
|
|
1
|
+
{"version":3,"file":"popover.recipes-wmbvL8Ah.js","names":["surfaceDividerRecipes","popoverRecipes","surfaceInsetClasses","collectionDensityClasses","collectionRowClasses","density","rowBlockPaddingClasses","collectionRecipes"],"sources":["../src/components/base/popover/popover.recipes.ts"],"sourcesContent":["import { surfaceDividerRecipes } from '../../../lib/surface-recipes';\nimport { rowBlockPaddingClasses, type RowDensity } from '../../../lib/row-recipes';\n/** Shared anchored-surface chrome; Menu and Popover retain their own accessible behavior. */\nexport const popoverRecipes = {\n surface: `box-border rounded-radius ${surfaceDividerRecipes.anchored.shell} bg-popover text-popover-foreground shadow-md ring-0`,\n display: 'p-surface',\n menu: 'p-surface-xs',\n // Collection bands share the list shell; text bodies add the row inset once.\n menuRegion: 'px-surface-xs py-space-md',\n separator: `mx-0 my-space-xs h-px w-full shrink-0 ${surfaceDividerRecipes.anchored.separator}`,\n row: 'box-border min-h-control rounded-inner px-row-x gap-space-sm font-medium leading-tight',\n} as const;\nexport type PopoverContentType = 'display' | 'menu';\n\n/** One surface inset vocabulary for Popover, Command and their collections. */\nexport const surfaceInsetClasses = {\n default: popoverRecipes.display,\n compact: popoverRecipes.menu,\n flush: 'p-0',\n} as const;\n\n/** Collection density changes vertical rhythm; inline room and primary text stay stable. */\nexport type CollectionDensity = RowDensity;\n\nconst collectionDensityClasses: Record<CollectionDensity, string> = {\n default: '',\n compact: 'min-h-control-sm',\n comfortable: 'min-h-control-lg',\n};\n\nexport function collectionRowClasses(density: CollectionDensity = 'default'): string {\n return `${popoverRecipes.row} ${collectionDensityClasses[density]} ${rowBlockPaddingClasses[density]}`;\n}\n\n/** Shared interactive collection states, independent of Menu/listbox state ownership. */\nexport const collectionRecipes = {\n icons: '[&_svg]:pointer-events-none [&_svg]:size-icon [&_svg]:shrink-0',\n interactive: 'relative flex cursor-default items-center outline-none select-none transition-colors',\n highlighted: 'data-highlighted:bg-accent data-highlighted:text-accent-foreground data-highlighted:[&_svg]:text-accent-foreground',\n disabled: 'data-disabled:pointer-events-none data-disabled:opacity-50',\n destructive: 'data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:data-highlighted:text-destructive dark:data-[variant=destructive]:data-highlighted:bg-destructive/10 data-[variant=destructive]:[&_svg]:text-destructive data-[variant=destructive]:data-highlighted:[&_svg]:text-destructive',\n // Compatibility for existing table and overflow-tab ActionMenu consumers.\n tableRow: 'min-h-action-xs py-space-2xs',\n} as const;\n"],"mappings":";;;AAGA,IAAaC,IAAiB;CAC7B,SAAS,6BAA6BD,EAAsB,SAAS,MAAM;CAC3E,SAAS;CACT,MAAM;CAEN,YAAY;CACZ,WAAW,yCAAyCA,EAAsB,SAAS;CACnF,KAAK;AACN,GAIaE,IAAsB;CAClC,SAASD,EAAe;CACxB,SAASA,EAAe;CACxB,OAAO;AACR,GAKME,IAA8D;CACnE,SAAS;CACT,SAAS;CACT,aAAa;AACd;AAEA,SAAgBC,EAAqB,IAA6B,WAAmB;CACpF,OAAO,GAAGH,EAAe,IAAI,GAAGE,EAAyBE,GAAS,GAAGC,EAAuBD;AAC7F;AAGA,IAAaE,IAAoB;CAChC,OAAO;CACP,aAAa;CACb,aAAa;CACb,UAAU;CACV,aAAa;CAEb,UAAU;AACX"}
|