themelia-react-ui 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +211 -0
- package/MIGRATION.md +119 -0
- package/README.md +122 -20
- package/dist/{accordion-96o0pN62.js → accordion-0tQUZ20r.js} +13 -13
- package/dist/accordion-0tQUZ20r.js.map +1 -0
- package/dist/{action-menu-CHgs8vmj.js → action-menu-C0gjzLyE.js} +48 -45
- package/dist/action-menu-C0gjzLyE.js.map +1 -0
- package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
- package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
- package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-CGGpQryR.js} +281 -230
- package/dist/ai-artifact-CGGpQryR.js.map +1 -0
- package/dist/app-shell-EHuuRDGy.js +321 -0
- package/dist/app-shell-EHuuRDGy.js.map +1 -0
- package/dist/{attachment-DkoqHPPl.js → attachment-BCpA4e7i.js} +10 -10
- package/dist/{attachment-DkoqHPPl.js.map → attachment-BCpA4e7i.js.map} +1 -1
- package/dist/{auth-D2FVZ1MH.js → auth-B0girIk_.js} +49 -52
- package/dist/auth-B0girIk_.js.map +1 -0
- package/dist/{avatar-DWO_HHhB.js → avatar-B9Jnp-T-.js} +8 -8
- package/dist/avatar-B9Jnp-T-.js.map +1 -0
- package/dist/{badge-DErMA7ul.js → badge-wWauMgAt.js} +5 -5
- package/dist/{badge-DErMA7ul.js.map → badge-wWauMgAt.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +3 -3
- package/dist/base/cascader.js +2 -372
- 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 +2 -2
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +10 -10
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +7 -7
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +200 -193
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +8 -8
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +6 -6
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +36 -36
- 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/{batch-action-bar-CdfIkCsV.js → batch-action-bar-BoqWIIpV.js} +7 -7
- package/dist/batch-action-bar-BoqWIIpV.js.map +1 -0
- package/dist/blocks/admin.js +21 -21
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +267 -247
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +537 -543
- 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 +1330 -1250
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-Bp9Ke7kd.js} +7 -7
- package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
- package/dist/{button-DkmK-z8E.js → button-ChBovTx0.js} +3 -3
- package/dist/button-ChBovTx0.js.map +1 -0
- package/dist/{buttons-BbfzgczK.js → buttons-DeW0bQeK.js} +16 -16
- package/dist/buttons-DeW0bQeK.js.map +1 -0
- package/dist/cards-CNXnmvV5.js +69 -0
- package/dist/cards-CNXnmvV5.js.map +1 -0
- package/dist/cascader-CrAl9zD5.js +439 -0
- package/dist/cascader-CrAl9zD5.js.map +1 -0
- package/dist/chart-I7ROnsl8.js +162 -0
- package/dist/chart-I7ROnsl8.js.map +1 -0
- package/dist/{checkbox-CzYUTPeJ.js → checkbox-MoyHIAPs.js} +3 -3
- package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-MoyHIAPs.js.map} +1 -1
- package/dist/choice-inputs-DHGtx0QV.js +789 -0
- package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
- package/dist/{code-block-CGNaUtAE.js → code-block-BSJyq9e-.js} +9 -9
- package/dist/code-block-BSJyq9e-.js.map +1 -0
- package/dist/{collapsible-Do4G0zcC.js → collapsible-BzJ91LUG.js} +5 -5
- package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BzJ91LUG.js.map} +1 -1
- package/dist/{collection-content-C0e8SsTm.js → collection-content-CSnwtOTH.js} +3 -3
- package/dist/{collection-content-C0e8SsTm.js.map → collection-content-CSnwtOTH.js.map} +1 -1
- package/dist/combobox-Bcvu5J8O.js +363 -0
- package/dist/combobox-Bcvu5J8O.js.map +1 -0
- package/dist/combobox-C2JiSQPc.js +915 -0
- package/dist/combobox-C2JiSQPc.js.map +1 -0
- package/dist/{command-D8NrBj-b.js → command-9e52NPgK.js} +11 -11
- package/dist/command-9e52NPgK.js.map +1 -0
- package/dist/{comments-Di4w0H_S.js → comments-BsgErEqd.js} +44 -39
- package/dist/comments-BsgErEqd.js.map +1 -0
- package/dist/components/base/action-menu/action-menu.d.ts +7 -1
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/cards/card.recipes.d.ts +6 -4
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
- package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
- package/dist/components/base/cards/smart-card.types.d.ts +3 -4
- package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
- package/dist/components/base/chart/chart.d.ts +6 -1
- package/dist/components/base/choice-inputs/choice-types.d.ts +5 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
- package/dist/components/base/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/combobox/index.d.ts +4 -2
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -1
- package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
- package/dist/components/base/forms/form-field.d.ts +7 -2
- package/dist/components/base/forms/form-sizing.d.ts +7 -7
- package/dist/components/base/forms/workflow.d.ts +7 -1
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +8 -1
- package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
- package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
- package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
- package/dist/components/base/navigation/language-switcher.d.ts +12 -4
- package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
- package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
- package/dist/components/base/popover/popover.d.ts +3 -3
- package/dist/components/base/popover/popover.recipes.d.ts +10 -6
- package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
- package/dist/components/base/sheet/sheet.d.ts +2 -0
- package/dist/components/base/sidebar/index.d.ts +1 -1
- package/dist/components/base/sidebar/sidebar.d.ts +29 -5
- package/dist/components/base/toaster/index.d.ts +1 -0
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/image-upload.d.ts +2 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +5 -1
- package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +4 -0
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
- package/dist/components/blocks/analytics/types.d.ts +2 -2
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
- package/dist/components/blocks/commerce/index.d.ts +7 -6
- package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
- package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
- package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
- package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
- package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
- package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
- package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
- package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
- package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
- package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
- package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
- package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
- package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
- package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
- package/dist/components/features/activities/activities.types.d.ts +26 -13
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
- package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +2 -2
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
- package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
- package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
- package/dist/components/features/combobox/types.d.ts +37 -8
- package/dist/components/features/email-composer/types.d.ts +3 -1
- package/dist/components/features/event-calendar/colors.d.ts +2 -2
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
- package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
- package/dist/components/features/filters/filters.strings.d.ts +4 -0
- package/dist/components/features/filters/filters.types.d.ts +6 -3
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +5 -3
- package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
- package/dist/components/features/filters/utils/filter-utils.d.ts +25 -3
- package/dist/components/features/global-search/global-search.types.d.ts +2 -0
- package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
- package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +8 -0
- package/dist/components/features/media-library/media-library.types.d.ts +50 -12
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +4 -4
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
- package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/products.strings.d.ts +9 -1
- package/dist/components/features/products/products.types.d.ts +45 -8
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
- package/dist/components/features/resource/resource.d.ts +6 -2
- package/dist/components/features/resource/resource.types.d.ts +14 -1
- package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +6 -3
- package/dist/components/features/table/table.strings.d.ts +3 -0
- package/dist/components/features/table/table.types.d.ts +18 -2
- package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
- package/dist/components/layout/app-shell/index.d.ts +1 -1
- package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
- package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
- package/dist/components/layout/header/header.recipes.d.ts +6 -0
- package/dist/components/layout/header/header.types.d.ts +9 -8
- package/dist/components/layout/layout.types.d.ts +5 -3
- package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
- package/dist/components/layout/navigation/side-nav.d.ts +3 -2
- package/dist/components/layout/normalize-layout-path.d.ts +1 -0
- package/dist/components/layout/page/index.d.ts +2 -1
- package/dist/components/layout/page/page.d.ts +1 -0
- package/dist/components/layout/page/page.strings.d.ts +11 -0
- package/dist/components/layout/page/page.types.d.ts +69 -17
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +10 -3
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/index.d.ts +2 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +38 -0
- package/dist/components/layout/sidebar/sidebar.context.d.ts +6 -7
- package/dist/components/layout/sidebar/sidebar.types.d.ts +50 -10
- package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
- package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
- package/dist/components/primitives/link.d.ts +3 -2
- package/dist/components/primitives/money.d.ts +1 -1
- package/dist/components/primitives/number.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/combobox.d.ts +1 -1
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/overlay-layer.d.ts +18 -0
- package/dist/components/ui/sheet.d.ts +5 -1
- package/dist/components/ui/sidebar-state.d.ts +82 -0
- package/dist/components/ui/sidebar.d.ts +5 -17
- package/dist/{containers-CRmHf7GP.js → containers-CSdc32h9.js} +26 -18
- package/dist/containers-CSdc32h9.js.map +1 -0
- package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
- package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
- package/dist/{copyable-CnGCZdX4.js → copyable-3fdHfMR3.js} +7 -7
- package/dist/{copyable-CnGCZdX4.js.map → copyable-3fdHfMR3.js.map} +1 -1
- package/dist/{data-display-D4oujtx0.js → data-display-Cmj-xZYl.js} +271 -279
- package/dist/data-display-Cmj-xZYl.js.map +1 -0
- package/dist/{date-Q7jnXxpk.js → date-Br0FicVv.js} +5 -5
- package/dist/{date-Q7jnXxpk.js.map → date-Br0FicVv.js.map} +1 -1
- package/dist/date-picker-CyQlFYsP.js +1617 -0
- package/dist/date-picker-CyQlFYsP.js.map +1 -0
- package/dist/date-pickers-tj2MXmXd.js +185 -0
- package/dist/date-pickers-tj2MXmXd.js.map +1 -0
- package/dist/{display-BB4BL_-K.js → display-CT_N2a3w.js} +9 -9
- package/dist/{display-BB4BL_-K.js.map → display-CT_N2a3w.js.map} +1 -1
- package/dist/dropdown-menu-C08iIugv.js +194 -0
- package/dist/dropdown-menu-C08iIugv.js.map +1 -0
- package/dist/features/activities.js +388 -326
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +46 -32
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +130 -130
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +11 -10
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +13 -13
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer.js +243 -239
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +197 -199
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +168 -143
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +19 -30
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +369 -343
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1202 -975
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1270 -1183
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +160 -153
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +119 -113
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +28 -19
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +297 -256
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +57 -50
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +470 -470
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-Dzo1xtAU.js +246 -0
- package/dist/feedback-Dzo1xtAU.js.map +1 -0
- package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-D6H7tVJi.js} +5 -5
- package/dist/field-affordance-recipes-D6H7tVJi.js.map +1 -0
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
- package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
- package/dist/filters-Dl80yYtN.js +2415 -0
- package/dist/filters-Dl80yYtN.js.map +1 -0
- package/dist/form-field-CAPdwdnZ.js +74 -0
- package/dist/form-field-CAPdwdnZ.js.map +1 -0
- package/dist/{form-sizing-NXgjkmBG.js → form-sizing-CgcrUbLU.js} +5 -5
- package/dist/form-sizing-CgcrUbLU.js.map +1 -0
- package/dist/{forms-BV5m5aQF.js → forms-B3W8CH7-.js} +17 -13
- package/dist/forms-B3W8CH7-.js.map +1 -0
- package/dist/forms-numeric-CwjQJe-O.js +991 -0
- package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
- package/dist/{header-BA697l4a.js → header-ZIIsRKxP.js} +145 -141
- package/dist/header-ZIIsRKxP.js.map +1 -0
- package/dist/header.recipes-BigdJjw1.js +6 -0
- package/dist/header.recipes-BigdJjw1.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-BQ-L7Uu2.js → hooks-BitHSh-Y.js} +27 -15
- package/dist/hooks-BitHSh-Y.js.map +1 -0
- package/dist/{icon-badge-COWbCCWu.js → icon-badge-npxF1SLX.js} +4 -4
- package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-npxF1SLX.js.map} +1 -1
- package/dist/index.js +4 -5
- package/dist/{input-Cdw4k0fb.js → input-7KAc7XQL.js} +9 -9
- package/dist/{input-Cdw4k0fb.js.map → input-7KAc7XQL.js.map} +1 -1
- package/dist/input-DIREVYHs.js +21 -0
- package/dist/input-DIREVYHs.js.map +1 -0
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
- package/dist/item-FfWnaYST.js +278 -0
- package/dist/item-FfWnaYST.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +2 -2
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +3 -3
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +12 -12
- package/dist/layout.types-E_GAApzO.js +30 -0
- package/dist/layout.types-E_GAApzO.js.map +1 -0
- package/dist/lib/affordance-geometry.generated.d.ts +35 -35
- package/dist/lib/control-group-recipes.d.ts +5 -5
- package/dist/lib/field-affordance-recipes.d.ts +2 -2
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +2 -0
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/motion-recipes.d.ts +3 -0
- package/dist/lib/navigation-row-recipes.d.ts +7 -7
- package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
- package/dist/lib/portal-recipes.d.ts +3 -0
- package/dist/lib/surface-recipes.d.ts +1 -1
- package/dist/lib/token-merge.generated.d.ts +18 -15
- package/dist/lib/utils.js +1 -1
- package/dist/map-demo-tile.svg +1 -1
- package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C81DAnKI.js} +6 -6
- package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C81DAnKI.js.map} +1 -1
- package/dist/{mentions-RKOQaaIB.js → mentions-qOnedSt4.js} +237 -168
- package/dist/mentions-qOnedSt4.js.map +1 -0
- package/dist/message-BJHnn43M.js +135 -0
- package/dist/message-BJHnn43M.js.map +1 -0
- package/dist/{metadata-list-qVV7AVxa.js → metadata-list-XkqZ_UXH.js} +64 -64
- package/dist/metadata-list-XkqZ_UXH.js.map +1 -0
- package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
- package/dist/motion-recipes-DitYv6P2.js.map +1 -0
- package/dist/navigation-BgtPJAhi.js +288 -0
- package/dist/navigation-BgtPJAhi.js.map +1 -0
- package/dist/navigation-Bt-v7rWP.js +261 -0
- package/dist/navigation-Bt-v7rWP.js.map +1 -0
- package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
- package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
- package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
- package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
- package/dist/{number-E_OiIfJz.js → number-CYqBcrSj.js} +79 -87
- package/dist/number-CYqBcrSj.js.map +1 -0
- package/dist/overflow-tab-bar-BQCA2Zn2.js +172 -0
- package/dist/overflow-tab-bar-BQCA2Zn2.js.map +1 -0
- package/dist/overlays-CC8zI3Du.js +1017 -0
- package/dist/overlays-CC8zI3Du.js.map +1 -0
- package/dist/page-BoQ1VaFJ.js +331 -0
- package/dist/page-BoQ1VaFJ.js.map +1 -0
- package/dist/page-header-commands-DIKspJfx.js +193 -0
- package/dist/page-header-commands-DIKspJfx.js.map +1 -0
- package/dist/{pagination-Ch8X_47u.js → pagination-Br8TdV9A.js} +7 -7
- package/dist/{pagination-Ch8X_47u.js.map → pagination-Br8TdV9A.js.map} +1 -1
- package/dist/popover-k8TdUcAt.js +201 -0
- package/dist/popover-k8TdUcAt.js.map +1 -0
- package/dist/{popover-menu-BYaCdFhf.js → popover-menu-yn-o0kyA.js} +7 -7
- package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
- package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DJ0AkUan.js} +19 -12
- package/dist/popover.recipes-DJ0AkUan.js.map +1 -0
- package/dist/portal-recipes-DyUXqUtD.js +9 -0
- package/dist/portal-recipes-DyUXqUtD.js.map +1 -0
- package/dist/{primitives-Du64iDbb.js → primitives-BkkQjYl7.js} +23 -18
- package/dist/primitives-BkkQjYl7.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BvF2oCdV.js → progress-DZFXXzPs.js} +9 -9
- package/dist/{progress-BvF2oCdV.js.map → progress-DZFXXzPs.js.map} +1 -1
- package/dist/{receipt-D789Jwyy.js → receipt-C7LhOg7Q.js} +7 -7
- package/dist/receipt-C7LhOg7Q.js.map +1 -0
- package/dist/rich-text-BnTzZjIo.js +45 -0
- package/dist/rich-text-BnTzZjIo.js.map +1 -0
- package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-CAurDwT5.js} +501 -424
- package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js +99 -0
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
- package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
- package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
- package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
- package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
- package/dist/{scroll-area-La5RXsEk.js → scroll-area-Bj6CRUif.js} +2 -2
- package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
- package/dist/{separator-DAEV0w65.js → separator-B9ewiCGO.js} +2 -2
- package/dist/{separator-DAEV0w65.js.map → separator-B9ewiCGO.js.map} +1 -1
- package/dist/{separator-GNfPG-90.js → separator-DM6gs2vu.js} +3 -3
- package/dist/{separator-GNfPG-90.js.map → separator-DM6gs2vu.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-DZPHgpx4.js +155 -0
- package/dist/settings-DZPHgpx4.js.map +1 -0
- package/dist/sheet-C4DHsgLk.js +250 -0
- package/dist/sheet-C4DHsgLk.js.map +1 -0
- package/dist/sidebar-C8BnDwTH.js +709 -0
- package/dist/sidebar-C8BnDwTH.js.map +1 -0
- package/dist/sidebar-CmD6a-HK.js +1004 -0
- package/dist/sidebar-CmD6a-HK.js.map +1 -0
- package/dist/skeleton-DDgdhmu9.js +265 -0
- package/dist/skeleton-DDgdhmu9.js.map +1 -0
- package/dist/smart-card-B6vLxqa_.js +617 -0
- package/dist/smart-card-B6vLxqa_.js.map +1 -0
- package/dist/{structure-C0V0_Fyf.js → structure-DZJ2wbAU.js} +2 -2
- package/dist/{structure-C0V0_Fyf.js.map → structure-DZJ2wbAU.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
- package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
- package/dist/{table-DH7rozUv.js → table-CBonSdTp.js} +573 -519
- package/dist/table-CBonSdTp.js.map +1 -0
- package/dist/{table-CpvnzJn9.js → table-CXSPHH25.js} +75 -71
- package/dist/table-CXSPHH25.js.map +1 -0
- package/dist/tabs-C4Kr_hCr.js +192 -0
- package/dist/tabs-C4Kr_hCr.js.map +1 -0
- package/dist/{text-inputs-DXItiR0O.js → text-inputs-jdkS3ReG.js} +18 -18
- package/dist/text-inputs-jdkS3ReG.js.map +1 -0
- package/dist/theme.css +40 -37
- package/dist/{timelines-DmtztAY_.js → timelines-CoPwdJP0.js} +13 -12
- package/dist/timelines-CoPwdJP0.js.map +1 -0
- package/dist/tooltip-31NwIpTo.js +113 -0
- package/dist/tooltip-31NwIpTo.js.map +1 -0
- package/dist/{tree-CV11PURP.js → tree-CeYVzdFE.js} +9 -9
- package/dist/{tree-CV11PURP.js.map → tree-CeYVzdFE.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-CSyJrh28.js → typography-C7-YMW1S.js} +12 -12
- package/dist/{typography-CSyJrh28.js.map → typography-C7-YMW1S.js.map} +1 -1
- package/dist/typography.js +1 -1
- package/dist/ui-provider-C-74NVLc.js +178 -0
- package/dist/ui-provider-C-74NVLc.js.map +1 -0
- package/dist/ui-provider.js +2 -3
- package/dist/{upload-C9SA0X-8.js → upload-Hdm5gObf.js} +309 -296
- package/dist/upload-Hdm5gObf.js.map +1 -0
- package/dist/{upload-queue-DhQJiSRc.js → upload-queue-D0sYPuqo.js} +16 -14
- package/dist/upload-queue-D0sYPuqo.js.map +1 -0
- package/dist/{usage-card-DVTRDmGz.js → usage-card-9s8hLDfn.js} +24 -17
- package/dist/usage-card-9s8hLDfn.js.map +1 -0
- package/dist/{utils-CF3c95Io.js → utils-DhuoqFy4.js} +255 -165
- package/dist/utils-DhuoqFy4.js.map +1 -0
- package/dist/value-inputs-D3aPgq9H.js +980 -0
- package/dist/value-inputs-D3aPgq9H.js.map +1 -0
- package/dist/{value-typography-ClupF0Gz.js → value-typography-uSzzG9Gf.js} +32 -26
- package/dist/value-typography-uSzzG9Gf.js.map +1 -0
- package/dist/{workspace-9EFVXUyk.js → workspace-CC8Vchiu.js} +51 -50
- package/dist/workspace-CC8Vchiu.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +4 -3
- package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
- package/docs/consumer-skill/examples/app-layout.tsx +52 -1
- package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
- package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
- package/docs/consumer-skill/examples/detail.tsx +5 -4
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
- package/docs/consumer-skill/examples/index-table.tsx +4 -4
- package/docs/consumer-skill/examples/manifest.json +38 -1
- package/docs/consumer-skill/examples/product-media.tsx +41 -0
- package/docs/consumer-skill/examples/product-parts.tsx +81 -0
- package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
- package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
- package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
- package/docs/consumer-skill/references/agents-md.md +21 -19
- package/docs/consumer-skill/references/analytics.md +33 -1
- package/docs/consumer-skill/references/commerce-composition.md +97 -0
- package/docs/consumer-skill/references/component-contracts.json +21249 -14205
- package/docs/consumer-skill/references/composition-mapping.md +17 -3
- package/docs/consumer-skill/references/composition.md +177 -32
- package/docs/consumer-skill/references/critique-rubric.md +98 -0
- package/docs/consumer-skill/references/custom-composition.md +261 -0
- package/docs/consumer-skill/references/data-reading.md +79 -0
- package/docs/consumer-skill/references/design-contract.md +12 -9
- package/docs/consumer-skill/references/discovery.md +27 -3
- package/docs/consumer-skill/references/domain-structures.md +124 -0
- package/docs/consumer-skill/references/installation.md +62 -8
- package/docs/consumer-skill/references/integration.md +59 -1
- package/docs/consumer-skill/references/product-composition.md +94 -0
- package/docs/consumer-skill/references/public-api.json +3044 -445
- package/docs/consumer-skill/references/review.md +87 -10
- package/docs/consumer-skill/references/rhf-workflows.md +79 -0
- package/docs/consumer-skill/references/screen-archetypes.md +19 -7
- package/docs/consumer-skill/references/screen-decisions.md +126 -0
- package/docs/consumer-skill/references/theming.md +24 -20
- package/docs/consumer-skill/references/tokens.json +9 -9
- package/docs/consumer-skill/references/view-craft.md +153 -0
- package/docs/consumer-skill/references/view-spec.md +73 -0
- package/docs/consumer-skill/references/workflows.md +7 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +176 -26
- package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
- package/docs/consumer-skill/scripts/composition.mjs +61 -5
- package/docs/consumer-skill/scripts/discovery.mjs +54 -0
- package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
- package/docs/consumer-skill/scripts/inspection.mjs +73 -18
- package/docs/consumer-skill/scripts/setup-skills.mjs +79 -7
- package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
- package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
- package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
- package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
- package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
- package/package.json +4 -2
- package/templates/admin-shell-template.tsx +1 -2
- package/templates/customers-template.tsx +18 -16
- package/dist/accordion-96o0pN62.js.map +0 -1
- package/dist/action-menu-CHgs8vmj.js.map +0 -1
- package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
- package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
- package/dist/app-shell-D63ATkIK.js +0 -237
- package/dist/app-shell-D63ATkIK.js.map +0 -1
- package/dist/auth-D2FVZ1MH.js.map +0 -1
- package/dist/avatar-DWO_HHhB.js.map +0 -1
- package/dist/base/cascader.js.map +0 -1
- package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
- package/dist/breadcrumbs-B-WFKecD.js.map +0 -1
- package/dist/button-DkmK-z8E.js.map +0 -1
- package/dist/buttons-BbfzgczK.js.map +0 -1
- package/dist/cards-4JTWqvVe.js +0 -68
- package/dist/cards-4JTWqvVe.js.map +0 -1
- package/dist/chart-C19flDQb.js +0 -155
- package/dist/chart-C19flDQb.js.map +0 -1
- package/dist/choice-inputs-JLtij2y4.js +0 -776
- package/dist/choice-inputs-JLtij2y4.js.map +0 -1
- package/dist/code-block-CGNaUtAE.js.map +0 -1
- package/dist/combobox-CBJDs6w_.js +0 -877
- package/dist/combobox-CBJDs6w_.js.map +0 -1
- package/dist/combobox-hbhSS18O.js +0 -355
- package/dist/combobox-hbhSS18O.js.map +0 -1
- package/dist/command-D8NrBj-b.js.map +0 -1
- package/dist/comments-Di4w0H_S.js.map +0 -1
- package/dist/containers-CRmHf7GP.js.map +0 -1
- package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
- package/dist/data-display-D4oujtx0.js.map +0 -1
- package/dist/date-picker-zOt1oNss.js +0 -1542
- package/dist/date-picker-zOt1oNss.js.map +0 -1
- package/dist/date-pickers-cj8IXbDC.js +0 -179
- package/dist/date-pickers-cj8IXbDC.js.map +0 -1
- package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
- package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
- package/dist/feedback-DZNL5Lg1.js +0 -239
- package/dist/feedback-DZNL5Lg1.js.map +0 -1
- package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
- package/dist/filters-BcT-uoFy.js +0 -2209
- package/dist/filters-BcT-uoFy.js.map +0 -1
- package/dist/form-field-CsgRmdit.js +0 -63
- package/dist/form-field-CsgRmdit.js.map +0 -1
- package/dist/form-sizing-NXgjkmBG.js.map +0 -1
- package/dist/forms-BV5m5aQF.js.map +0 -1
- package/dist/forms-numeric-Cd33AKbD.js +0 -906
- package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
- package/dist/header-BA697l4a.js.map +0 -1
- package/dist/hooks-BQ-L7Uu2.js.map +0 -1
- package/dist/input-DOPL5_QE.js +0 -21
- package/dist/input-DOPL5_QE.js.map +0 -1
- package/dist/item-BvZ2DR_x.js +0 -277
- package/dist/item-BvZ2DR_x.js.map +0 -1
- package/dist/layout.types-Cn7aUzJp.js +0 -20
- package/dist/layout.types-Cn7aUzJp.js.map +0 -1
- package/dist/mentions-RKOQaaIB.js.map +0 -1
- package/dist/message-INU2xsxu.js +0 -128
- package/dist/message-INU2xsxu.js.map +0 -1
- package/dist/metadata-list-qVV7AVxa.js.map +0 -1
- package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
- package/dist/navigation-BQNcg1jT.js +0 -269
- package/dist/navigation-BQNcg1jT.js.map +0 -1
- package/dist/navigation-DLF3E1IC.js +0 -145
- package/dist/navigation-DLF3E1IC.js.map +0 -1
- package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
- package/dist/number-E_OiIfJz.js.map +0 -1
- package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
- package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
- package/dist/overlays-BlKynmde.js +0 -1004
- package/dist/overlays-BlKynmde.js.map +0 -1
- package/dist/page-CIwNUtGr.js +0 -227
- package/dist/page-CIwNUtGr.js.map +0 -1
- package/dist/page-header-commands-DFMlNYzN.js +0 -128
- package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
- package/dist/popover-uwzX2vo7.js +0 -198
- package/dist/popover-uwzX2vo7.js.map +0 -1
- package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
- package/dist/primitives-Du64iDbb.js.map +0 -1
- package/dist/receipt-D789Jwyy.js.map +0 -1
- package/dist/rich-text-CLJEf76s.js +0 -78
- package/dist/rich-text-CLJEf76s.js.map +0 -1
- package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
- package/dist/rich-text-editor-toolbar-L__e4x47.js +0 -94
- package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
- package/dist/safe-image-src-C6kQSMBZ.js +0 -17
- package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/settings-BA2iboic.js +0 -174
- package/dist/settings-BA2iboic.js.map +0 -1
- package/dist/sheet-DoAxTb2J.js +0 -213
- package/dist/sheet-DoAxTb2J.js.map +0 -1
- package/dist/sidebar-ByqKR_W5.js +0 -512
- package/dist/sidebar-ByqKR_W5.js.map +0 -1
- package/dist/sidebar-D2iSnGJ7.js +0 -619
- package/dist/sidebar-D2iSnGJ7.js.map +0 -1
- package/dist/skeleton-CUj8O5Bd.js +0 -264
- package/dist/skeleton-CUj8O5Bd.js.map +0 -1
- package/dist/smart-card-CqkzQsK-.js +0 -614
- package/dist/smart-card-CqkzQsK-.js.map +0 -1
- package/dist/table-CpvnzJn9.js.map +0 -1
- package/dist/table-DH7rozUv.js.map +0 -1
- package/dist/tabs-eqVsJZWO.js +0 -191
- package/dist/tabs-eqVsJZWO.js.map +0 -1
- package/dist/text-inputs-DXItiR0O.js.map +0 -1
- package/dist/theme-scope-BJ6eE2xt.js +0 -50
- package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
- package/dist/timelines-DmtztAY_.js.map +0 -1
- package/dist/tooltip-B4hjKtoV.js +0 -111
- package/dist/tooltip-B4hjKtoV.js.map +0 -1
- package/dist/ui-provider-CQCuCBcy.js +0 -136
- package/dist/ui-provider-CQCuCBcy.js.map +0 -1
- package/dist/upload-C9SA0X-8.js.map +0 -1
- package/dist/upload-queue-DhQJiSRc.js.map +0 -1
- package/dist/usage-card-DVTRDmGz.js.map +0 -1
- package/dist/use-mobile-vaLKwgyf.js +0 -15
- package/dist/use-mobile-vaLKwgyf.js.map +0 -1
- package/dist/utils-CF3c95Io.js.map +0 -1
- package/dist/value-inputs-C0o70p-U.js +0 -980
- package/dist/value-inputs-C0o70p-U.js.map +0 -1
- package/dist/value-typography-ClupF0Gz.js.map +0 -1
- package/dist/workspace-9EFVXUyk.js.map +0 -1
package/dist/filters-BcT-uoFy.js
DELETED
|
@@ -1,2209 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { s as e, v as t } from "./ui-provider-CQCuCBcy.js";
|
|
3
|
-
import { useStrings as n } from "./lib/strings.js";
|
|
4
|
-
import { t as r } from "./utils-CF3c95Io.js";
|
|
5
|
-
import { n as i } from "./buttons-BbfzgczK.js";
|
|
6
|
-
import { a, c as o, o as s } from "./typography-CSyJrh28.js";
|
|
7
|
-
import { t as c } from "./focus-recipes-B653VaLq.js";
|
|
8
|
-
import { r as l, t as u } from "./structure-C0V0_Fyf.js";
|
|
9
|
-
import { i as d } from "./tone-recipes-BPsRAvhu.js";
|
|
10
|
-
import { n as f, t as p } from "./feedback-DZNL5Lg1.js";
|
|
11
|
-
import { i as m } from "./popover.recipes-D3j8R8Yp.js";
|
|
12
|
-
import { _ as h, g, m as _ } from "./primitives-Du64iDbb.js";
|
|
13
|
-
import { t as v } from "./number-E_OiIfJz.js";
|
|
14
|
-
import { n as y, t as b } from "./date-Q7jnXxpk.js";
|
|
15
|
-
import { t as x } from "./badge-DErMA7ul.js";
|
|
16
|
-
import { t as S } from "./layer-recipes-CCpklYME.js";
|
|
17
|
-
import { n as C } from "./field-affordance-recipes-DjwGx8eM.js";
|
|
18
|
-
import { a as w, i as T, n as E, o as D, r as O, s as k, t as A } from "./command-D8NrBj-b.js";
|
|
19
|
-
import { d as j, p as M, y as N } from "./form-sizing-NXgjkmBG.js";
|
|
20
|
-
import { t as P } from "./input-Cdw4k0fb.js";
|
|
21
|
-
import { t as F } from "./date-picker-zOt1oNss.js";
|
|
22
|
-
import { a as I, c as L, i as R, o as ee, r as z, t as te } from "./popover-uwzX2vo7.js";
|
|
23
|
-
import { n as B, r as ne, t as re } from "./control-group-recipes-DBXmfh2E.js";
|
|
24
|
-
import { i as ie, r as ae, t as oe } from "./tabs-eqVsJZWO.js";
|
|
25
|
-
import { t as se } from "./popover-menu-BYaCdFhf.js";
|
|
26
|
-
import { t as ce } from "./use-debounced-callback-Cx1h-hdv.js";
|
|
27
|
-
import { t as le } from "./use-debounce-DZ_1ZBPa.js";
|
|
28
|
-
import V, { Component as ue, createContext as de, useCallback as H, useContext as fe, useEffect as U, useId as pe, useMemo as W, useRef as G, useState as K } from "react";
|
|
29
|
-
import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
30
|
-
import { CalendarIcon as me, Check as he, ChevronDown as ge, ChevronLeft as _e, ChevronsUpDown as ve, Filter as ye, Loader2 as be, Plus as xe, X as Se } from "lucide-react";
|
|
31
|
-
import { format as Ce, isValid as we, parse as Te } from "date-fns";
|
|
32
|
-
//#region src/components/features/filters/filters.strings.ts
|
|
33
|
-
var Ee = {
|
|
34
|
-
loading: "Loading",
|
|
35
|
-
loadingOptions: "Loading {filterLabel} options...",
|
|
36
|
-
addFilter: "Add filter",
|
|
37
|
-
clear: "Clear",
|
|
38
|
-
confirm: "Confirm",
|
|
39
|
-
clearFilters: "Clear filters",
|
|
40
|
-
clearAll: "Clear all",
|
|
41
|
-
selectDate: "Select date",
|
|
42
|
-
selectDateRange: "Select date range",
|
|
43
|
-
calendar: {
|
|
44
|
-
dateSelected: "Date selected",
|
|
45
|
-
notDateSelected: "No date selected",
|
|
46
|
-
notDateRangeSelected: "No date range selected",
|
|
47
|
-
selectedEndDate: "Select end date",
|
|
48
|
-
today: "Today",
|
|
49
|
-
yesterday: "Yesterday",
|
|
50
|
-
lastSevenDays: "Last 7 days",
|
|
51
|
-
lastThirtyDays: "Last 30 days",
|
|
52
|
-
thisMonth: "This month",
|
|
53
|
-
lastMonth: "Last month",
|
|
54
|
-
thisYear: "This year",
|
|
55
|
-
lastYear: "Last year",
|
|
56
|
-
customRange: "Custom range"
|
|
57
|
-
},
|
|
58
|
-
selectValues: "Select values",
|
|
59
|
-
searchPlaceholder: "Search {filterLabel}...",
|
|
60
|
-
noOptionsFound: "No options found",
|
|
61
|
-
selected: "{count} {filterLabel} selected",
|
|
62
|
-
nothingSelected: "Nothing selected",
|
|
63
|
-
enterTag: "Enter tag",
|
|
64
|
-
addTag: "Add tag",
|
|
65
|
-
removeTag: "Remove",
|
|
66
|
-
tag: "tag",
|
|
67
|
-
tags: "tags",
|
|
68
|
-
enterTags: "Enter tags",
|
|
69
|
-
searchFilters: "Search filters...",
|
|
70
|
-
noFiltersAvailable: "No filters available",
|
|
71
|
-
availableFilters: "Available filters",
|
|
72
|
-
activeFilters: "Active filters",
|
|
73
|
-
clearSearch: "Clear search",
|
|
74
|
-
backToFilters: "Back to filters",
|
|
75
|
-
select: "Select",
|
|
76
|
-
options: "options",
|
|
77
|
-
operator: "Operator",
|
|
78
|
-
operators: {
|
|
79
|
-
contains: "contains",
|
|
80
|
-
equals: "is",
|
|
81
|
-
notContains: "does not contain",
|
|
82
|
-
is: "is",
|
|
83
|
-
isNot: "is not",
|
|
84
|
-
greaterThan: "greater than",
|
|
85
|
-
lessThan: "less than",
|
|
86
|
-
before: "before",
|
|
87
|
-
after: "after",
|
|
88
|
-
between: "between",
|
|
89
|
-
has: "has",
|
|
90
|
-
hasAny: "has any",
|
|
91
|
-
hasAll: "has all"
|
|
92
|
-
},
|
|
93
|
-
min: "Min",
|
|
94
|
-
max: "Max",
|
|
95
|
-
fetchError: "Failed to load options",
|
|
96
|
-
retryFetch: "Retry",
|
|
97
|
-
minQueryHint: "Type at least {min} characters...",
|
|
98
|
-
searching: "Searching...",
|
|
99
|
-
error: {
|
|
100
|
-
title: "Filter error",
|
|
101
|
-
descriptionWithKey: "There was a problem with \"{filterKey}\" filter.",
|
|
102
|
-
generic: "There was a problem loading this filter.",
|
|
103
|
-
unknown: "Unknown error"
|
|
104
|
-
},
|
|
105
|
-
validation: {
|
|
106
|
-
required: "This filter is required",
|
|
107
|
-
minValue: "Value must be at least {min}",
|
|
108
|
-
maxValue: "Value must be at most {max}",
|
|
109
|
-
invalidFormat: "Invalid format"
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
function X(e, t) {
|
|
113
|
-
return e.replace(/{(\w+)}/g, (e, n) => String(t[n] ?? e)).replace(/:(\w+)/g, (e, n) => t[n] === void 0 ? e : String(t[n]));
|
|
114
|
-
}
|
|
115
|
-
function De(e, t, n) {
|
|
116
|
-
let r = t.split("."), i = e;
|
|
117
|
-
for (let e of r) {
|
|
118
|
-
if (typeof i != "object" || !i) return t;
|
|
119
|
-
i = i[e];
|
|
120
|
-
}
|
|
121
|
-
return typeof i == "string" ? n ? X(i, n) : i : t;
|
|
122
|
-
}
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/components/features/filters/filters.types.ts
|
|
125
|
-
var Z = {
|
|
126
|
-
SELECT: "select",
|
|
127
|
-
MULTI_SELECT: "multi_select",
|
|
128
|
-
ASYNC_SELECT: "async_select",
|
|
129
|
-
SEARCH: "search",
|
|
130
|
-
RANGE: "range",
|
|
131
|
-
DATE: "date",
|
|
132
|
-
TAGS: "tags"
|
|
133
|
-
}, Q = {
|
|
134
|
-
EQUALS: "equals",
|
|
135
|
-
CONTAINS: "contains",
|
|
136
|
-
IN: "in",
|
|
137
|
-
NOT_IN: "not_in",
|
|
138
|
-
NOT: "not",
|
|
139
|
-
BEFORE: "before",
|
|
140
|
-
AFTER: "after",
|
|
141
|
-
BETWEEN: "between",
|
|
142
|
-
GT: "gt",
|
|
143
|
-
LT: "lt",
|
|
144
|
-
GTE: "gte",
|
|
145
|
-
LTE: "lte",
|
|
146
|
-
HAS: "has",
|
|
147
|
-
HAS_ANY: "has_any",
|
|
148
|
-
HAS_ALL: "has_all"
|
|
149
|
-
};
|
|
150
|
-
function Oe(e) {
|
|
151
|
-
return e;
|
|
152
|
-
}
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region src/components/features/filters/operator-options.ts
|
|
155
|
-
function ke(e) {
|
|
156
|
-
return [
|
|
157
|
-
{
|
|
158
|
-
label: e.contains,
|
|
159
|
-
value: Q.CONTAINS
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
label: e.equals,
|
|
163
|
-
value: Q.EQUALS
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
label: e.notContains,
|
|
167
|
-
value: Q.NOT
|
|
168
|
-
}
|
|
169
|
-
];
|
|
170
|
-
}
|
|
171
|
-
function Ae(e) {
|
|
172
|
-
return [{
|
|
173
|
-
label: e.is,
|
|
174
|
-
value: Q.EQUALS
|
|
175
|
-
}, {
|
|
176
|
-
label: e.isNot,
|
|
177
|
-
value: Q.NOT
|
|
178
|
-
}];
|
|
179
|
-
}
|
|
180
|
-
function je(e) {
|
|
181
|
-
return [
|
|
182
|
-
{
|
|
183
|
-
label: e.equals,
|
|
184
|
-
value: Q.EQUALS
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
label: e.greaterThan,
|
|
188
|
-
value: Q.GT
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
label: e.lessThan,
|
|
192
|
-
value: Q.LT
|
|
193
|
-
}
|
|
194
|
-
];
|
|
195
|
-
}
|
|
196
|
-
function Me(e) {
|
|
197
|
-
return [
|
|
198
|
-
{
|
|
199
|
-
label: e.before,
|
|
200
|
-
value: Q.BEFORE
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
label: e.after,
|
|
204
|
-
value: Q.AFTER
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
label: e.between,
|
|
208
|
-
value: Q.BETWEEN
|
|
209
|
-
}
|
|
210
|
-
];
|
|
211
|
-
}
|
|
212
|
-
function Ne(e) {
|
|
213
|
-
return [{
|
|
214
|
-
label: e.equals,
|
|
215
|
-
value: Q.EQUALS
|
|
216
|
-
}];
|
|
217
|
-
}
|
|
218
|
-
function Pe(e, t) {
|
|
219
|
-
switch (e) {
|
|
220
|
-
case Z.SEARCH: return ke(t);
|
|
221
|
-
case Z.TAGS: return [
|
|
222
|
-
{
|
|
223
|
-
label: t.has,
|
|
224
|
-
value: Q.HAS
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
label: t.hasAny,
|
|
228
|
-
value: Q.HAS_ANY
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
label: t.hasAll,
|
|
232
|
-
value: Q.HAS_ALL
|
|
233
|
-
}
|
|
234
|
-
];
|
|
235
|
-
case Z.SELECT:
|
|
236
|
-
case Z.ASYNC_SELECT: return Ae(t);
|
|
237
|
-
case Z.RANGE: return je(t);
|
|
238
|
-
case Z.DATE: return Me(t);
|
|
239
|
-
default: return ke(t);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function Fe(e) {
|
|
243
|
-
switch (e) {
|
|
244
|
-
case Z.SEARCH: return Q.CONTAINS;
|
|
245
|
-
case Z.TAGS: return Q.HAS;
|
|
246
|
-
case Z.SELECT:
|
|
247
|
-
case Z.ASYNC_SELECT: return Q.EQUALS;
|
|
248
|
-
case Z.RANGE: return Q.EQUALS;
|
|
249
|
-
case Z.DATE: return Q.BEFORE;
|
|
250
|
-
default: return Q.EQUALS;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
//#endregion
|
|
254
|
-
//#region src/components/features/filters/utils/filter-utils.ts
|
|
255
|
-
function Ie(e, t, n) {
|
|
256
|
-
if (e.type === "date" && Array.isArray(t) && t.every((e) => typeof e == "string")) return !0;
|
|
257
|
-
if (e.validation?.required && (!t || Array.isArray(t) && t.length === 0)) return n("validation.required");
|
|
258
|
-
if (typeof t == "number") {
|
|
259
|
-
if (e.validation?.min !== void 0 && t < e.validation.min) return n("validation.minValue").replace("{min}", String(e.validation.min));
|
|
260
|
-
if (e.validation?.max !== void 0 && t > e.validation.max) return n("validation.maxValue").replace("{max}", String(e.validation.max));
|
|
261
|
-
}
|
|
262
|
-
if (e.validation?.pattern && typeof t == "string" && !new RegExp(e.validation.pattern).test(t)) return n("validation.invalidFormat");
|
|
263
|
-
if (e.validation?.custom) {
|
|
264
|
-
let n = e.validation.custom(t);
|
|
265
|
-
if (typeof n == "string" || !n) return n;
|
|
266
|
-
}
|
|
267
|
-
return !0;
|
|
268
|
-
}
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region src/components/features/filters/filter-context.tsx
|
|
271
|
-
var Le = de(void 0);
|
|
272
|
-
function Re({ children: e, filters: t, activeFilters: r, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
|
|
273
|
-
let c = G(t), l = G(i), u = G(s);
|
|
274
|
-
u.current = s;
|
|
275
|
-
let [d, f] = K(0), p = G(/* @__PURE__ */ new Map()), m = W(() => {
|
|
276
|
-
let e = /* @__PURE__ */ new Map();
|
|
277
|
-
for (let n of t) {
|
|
278
|
-
if (n.type !== Z.ASYNC_SELECT) continue;
|
|
279
|
-
let t = n.asyncConfig?.fetcher, r = n.asyncConfig?.mapToOption, i = n.asyncConfig?.limit ?? 10, a = p.current.get(n.key), o = a && a.fetcher === t && a.mapToOption === r;
|
|
280
|
-
e.set(n.key, o && a.limit === i ? a : {
|
|
281
|
-
fetcher: t,
|
|
282
|
-
mapToOption: r,
|
|
283
|
-
limit: i,
|
|
284
|
-
options: o ? a.options : /* @__PURE__ */ new Map()
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
return e.size === p.current.size && [...e].every(([e, t]) => p.current.get(e) === t) ? p.current : (p.current = e, e);
|
|
288
|
-
}, [t]), h = JSON.stringify(r.filter((e) => m.has(e.key)).map(({ key: e, value: t }) => [e, t])), g = n(Ee, o);
|
|
289
|
-
U(() => {
|
|
290
|
-
c.current = t;
|
|
291
|
-
}, [t]), U(() => {
|
|
292
|
-
l.current = i;
|
|
293
|
-
}, [i]);
|
|
294
|
-
let _ = H((e) => {
|
|
295
|
-
let t = [...r, e];
|
|
296
|
-
l.current(t);
|
|
297
|
-
}, [r]), v = H((e) => {
|
|
298
|
-
let t = r.filter((t) => t.id !== e && t.key !== e);
|
|
299
|
-
l.current(t);
|
|
300
|
-
}, [r]), y = H((e, t) => {
|
|
301
|
-
let n = r.map((n) => n.id === e || n.key === e ? {
|
|
302
|
-
...n,
|
|
303
|
-
...t
|
|
304
|
-
} : n);
|
|
305
|
-
l.current(n);
|
|
306
|
-
}, [r]), b = H(() => {
|
|
307
|
-
l.current([]);
|
|
308
|
-
}, []), x = H((e) => {
|
|
309
|
-
l.current(e);
|
|
310
|
-
}, []), S = H((e) => c.current.find((t) => t.key === e), []), C = H((e) => r.find((t) => t.key === e)?.value || [], [r]), w = H((e, t) => {
|
|
311
|
-
let n = r.find((t) => t.key === e);
|
|
312
|
-
if (t.length === 0) n && v(e);
|
|
313
|
-
else if (n) y(e, { value: t });
|
|
314
|
-
else {
|
|
315
|
-
let n = c.current.find((t) => t.key === e), r = n?.operator ?? n?.operators?.[0]?.value ?? (n ? Fe(n.type) : "equals");
|
|
316
|
-
_({
|
|
317
|
-
id: e,
|
|
318
|
-
key: e,
|
|
319
|
-
value: t,
|
|
320
|
-
operator: r
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
}, [
|
|
324
|
-
r,
|
|
325
|
-
_,
|
|
326
|
-
v,
|
|
327
|
-
y
|
|
328
|
-
]), T = H((e) => r.some((t) => t.key === e && t.value.length > 0), [r]), E = H((e) => r.find((t) => t.key === e)?.operator || "equals", [r]), D = H((e, t) => {
|
|
329
|
-
r.find((t) => t.key === e) && y(e, { operator: t });
|
|
330
|
-
}, [r, y]), O = H((e, t) => {
|
|
331
|
-
let n = c.current.find((t) => t.key === e);
|
|
332
|
-
return n ? Ie(n, t, (e) => De(g, e)) : !1;
|
|
333
|
-
}, [g]), k = H((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), A = H((e, t) => {
|
|
334
|
-
let n = m.get(e)?.options;
|
|
335
|
-
if (!n) return;
|
|
336
|
-
let r = !1;
|
|
337
|
-
for (let e of t) n.get(e.value)?.label !== e.label && (r = !0), n.set(e.value, e);
|
|
338
|
-
r && f((e) => e + 1);
|
|
339
|
-
}, [m]), j = H((e, t) => m.get(e)?.options.get(t)?.label, [m, d]), M = H((e, t) => {
|
|
340
|
-
u.current?.(e, t);
|
|
341
|
-
}, []);
|
|
342
|
-
U(() => {
|
|
343
|
-
let e = new AbortController(), t = (t, n) => {
|
|
344
|
-
e.signal.aborted || t && t.name === "AbortError" || u.current?.(t, {
|
|
345
|
-
phase: "fetch-options",
|
|
346
|
-
filterKey: n
|
|
347
|
-
});
|
|
348
|
-
}, n = new Map(JSON.parse(h));
|
|
349
|
-
for (let [r, i] of m) {
|
|
350
|
-
let a = n.get(r);
|
|
351
|
-
if (!a || a.length === 0 || a.every((e) => i.options.has(e))) continue;
|
|
352
|
-
let { fetcher: o, mapToOption: s, limit: c } = i;
|
|
353
|
-
o && s && o({
|
|
354
|
-
query: "",
|
|
355
|
-
limit: c,
|
|
356
|
-
signal: e.signal
|
|
357
|
-
}).then((t) => {
|
|
358
|
-
e.signal.aborted || A(r, t.map(s));
|
|
359
|
-
}).catch((e) => t(e, r));
|
|
360
|
-
}
|
|
361
|
-
return () => e.abort();
|
|
362
|
-
}, [
|
|
363
|
-
h,
|
|
364
|
-
m,
|
|
365
|
-
A
|
|
366
|
-
]);
|
|
367
|
-
let N = W(() => ({
|
|
368
|
-
activeFilters: r,
|
|
369
|
-
filters: t,
|
|
370
|
-
addFilter: _,
|
|
371
|
-
removeFilter: v,
|
|
372
|
-
updateFilter: y,
|
|
373
|
-
clearFilters: b,
|
|
374
|
-
replaceFilters: x,
|
|
375
|
-
getFilterByKey: S,
|
|
376
|
-
getFilterValue: C,
|
|
377
|
-
setFilterValue: w,
|
|
378
|
-
isFilterActive: T,
|
|
379
|
-
getFilterOperator: E,
|
|
380
|
-
setFilterOperator: D,
|
|
381
|
-
validateFilter: O,
|
|
382
|
-
getDependentFilters: k,
|
|
383
|
-
isNavigating: a,
|
|
384
|
-
strings: g,
|
|
385
|
-
cacheAsyncOptions: A,
|
|
386
|
-
getAsyncOptionLabel: j,
|
|
387
|
-
reportError: M
|
|
388
|
-
}), [
|
|
389
|
-
r,
|
|
390
|
-
t,
|
|
391
|
-
_,
|
|
392
|
-
v,
|
|
393
|
-
y,
|
|
394
|
-
b,
|
|
395
|
-
x,
|
|
396
|
-
S,
|
|
397
|
-
C,
|
|
398
|
-
w,
|
|
399
|
-
T,
|
|
400
|
-
E,
|
|
401
|
-
D,
|
|
402
|
-
O,
|
|
403
|
-
k,
|
|
404
|
-
a,
|
|
405
|
-
g,
|
|
406
|
-
A,
|
|
407
|
-
j,
|
|
408
|
-
M
|
|
409
|
-
]);
|
|
410
|
-
return /* @__PURE__ */ J(Le.Provider, {
|
|
411
|
-
value: N,
|
|
412
|
-
children: e
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
function $() {
|
|
416
|
-
let e = fe(Le);
|
|
417
|
-
if (!e) throw Error("useFilters must be used within a FilterProvider");
|
|
418
|
-
return e;
|
|
419
|
-
}
|
|
420
|
-
//#endregion
|
|
421
|
-
//#region src/components/features/filters/hooks/use-filter-groups.ts
|
|
422
|
-
function ze(e = {}) {
|
|
423
|
-
let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i = W(() => t ? n.map((e) => {
|
|
424
|
-
let n = t[e.key];
|
|
425
|
-
return Array.isArray(n) ? {
|
|
426
|
-
...e,
|
|
427
|
-
options: n
|
|
428
|
-
} : e;
|
|
429
|
-
}) : n, [n, t]);
|
|
430
|
-
return W(() => {
|
|
431
|
-
let e = i.filter((e) => e.type === Z.SEARCH), t = i.filter((e) => !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden"), n = i.filter((e) => e.type !== Z.SEARCH && !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden" && r(e.key)), a = t.filter((e) => e.type !== Z.SEARCH && !r(e.key) && e.displayConfig?.display === "always"), o = t.filter((e) => e.type !== Z.SEARCH && !r(e.key) && e.displayConfig?.display !== "always"), s = n.map((e) => e.key);
|
|
432
|
-
return {
|
|
433
|
-
processedFilters: i,
|
|
434
|
-
searchFilters: e,
|
|
435
|
-
alwaysVisibleFilters: a,
|
|
436
|
-
activeRegularFilters: n,
|
|
437
|
-
popoverFilters: o,
|
|
438
|
-
activeFilterKeys: s,
|
|
439
|
-
hasActive: s.length > 0
|
|
440
|
-
};
|
|
441
|
-
}, [i, r]);
|
|
442
|
-
}
|
|
443
|
-
//#endregion
|
|
444
|
-
//#region src/components/features/filters/partials/filter-operator-select.tsx
|
|
445
|
-
function Be({ operator: e, operators: t, onOperatorChange: n, segmentResetClass: a }) {
|
|
446
|
-
let [c, l] = K(!1), { strings: u } = $(), d = t.find((t) => t.value === e)?.label || e;
|
|
447
|
-
return /* @__PURE__ */ J(se, {
|
|
448
|
-
open: c,
|
|
449
|
-
onOpenChange: l,
|
|
450
|
-
search: !1,
|
|
451
|
-
contentLabel: u.operator,
|
|
452
|
-
trigger: /* @__PURE__ */ J(i, {
|
|
453
|
-
tone: "secondary",
|
|
454
|
-
buttonStyle: "ghost",
|
|
455
|
-
className: r("filter-operator-select--component", a, "h-full min-h-0 px-control text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
456
|
-
onClick: (e) => {
|
|
457
|
-
e.stopPropagation();
|
|
458
|
-
},
|
|
459
|
-
type: "button",
|
|
460
|
-
children: /* @__PURE__ */ J(o, {
|
|
461
|
-
tag: "span",
|
|
462
|
-
type: "inherit",
|
|
463
|
-
children: d
|
|
464
|
-
})
|
|
465
|
-
}),
|
|
466
|
-
header: /* @__PURE__ */ J(s, {
|
|
467
|
-
tag: "span",
|
|
468
|
-
children: u.operator
|
|
469
|
-
}),
|
|
470
|
-
contentClassName: m.xs,
|
|
471
|
-
items: t.map((t) => ({
|
|
472
|
-
value: t.value,
|
|
473
|
-
label: t.label,
|
|
474
|
-
selected: t.value === e
|
|
475
|
-
})),
|
|
476
|
-
onSelect: (e) => {
|
|
477
|
-
n(e.value), l(!1);
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
//#endregion
|
|
482
|
-
//#region src/components/features/filters/partials/filter-value-display.tsx
|
|
483
|
-
function Ve({ filter: e, value: t }) {
|
|
484
|
-
let { strings: n } = $();
|
|
485
|
-
return t.length === 0 && e.type !== Z.DATE ? /* @__PURE__ */ J(o, {
|
|
486
|
-
tag: "span",
|
|
487
|
-
type: "secondary",
|
|
488
|
-
lineHeight: "none",
|
|
489
|
-
className: "filter-value-display--component",
|
|
490
|
-
children: n.nothingSelected
|
|
491
|
-
}) : e.type === Z.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ J(o, {
|
|
492
|
-
tag: "span",
|
|
493
|
-
type: "inherit",
|
|
494
|
-
weight: "semibold",
|
|
495
|
-
lineHeight: "none",
|
|
496
|
-
className: "filter-value-display--component",
|
|
497
|
-
children: Ue(e, t, n)
|
|
498
|
-
}) : e.options && e.type !== Z.DATE ? /* @__PURE__ */ Y(u, {
|
|
499
|
-
direction: "horizontal",
|
|
500
|
-
gap: "xs",
|
|
501
|
-
wrap: !1,
|
|
502
|
-
className: "filter-value-display--component",
|
|
503
|
-
children: [/* @__PURE__ */ Y("div", {
|
|
504
|
-
className: "relative isolate flex",
|
|
505
|
-
children: [t.slice(0, 2).map((t, n) => {
|
|
506
|
-
let i = e.options?.find((e) => e.value === t);
|
|
507
|
-
return i?.icon ? /* @__PURE__ */ J("div", {
|
|
508
|
-
className: r("border-background bg-background relative rounded-full border", n > 0 ? "-ml-space-sm z-[1]" : S.raised),
|
|
509
|
-
children: i.icon
|
|
510
|
-
}, t) : null;
|
|
511
|
-
}), t.length > 2 && /* @__PURE__ */ J("div", {
|
|
512
|
-
className: "bg-muted border-background relative z-0 -ml-space-sm flex size-icon items-center justify-center rounded-full border",
|
|
513
|
-
children: /* @__PURE__ */ Y(o, {
|
|
514
|
-
tag: "span",
|
|
515
|
-
size: "xs",
|
|
516
|
-
weight: "medium",
|
|
517
|
-
children: ["+", /* @__PURE__ */ J(v, {
|
|
518
|
-
value: t.length - 2,
|
|
519
|
-
size: "inherit",
|
|
520
|
-
align: "center"
|
|
521
|
-
})]
|
|
522
|
-
})
|
|
523
|
-
})]
|
|
524
|
-
}), /* @__PURE__ */ J(o, {
|
|
525
|
-
tag: "span",
|
|
526
|
-
type: "inherit",
|
|
527
|
-
weight: "semibold",
|
|
528
|
-
lineHeight: "none",
|
|
529
|
-
className: "truncate",
|
|
530
|
-
children: We(e, t, n)
|
|
531
|
-
})]
|
|
532
|
-
}) : e.type === Z.DATE ? /* @__PURE__ */ Y(u, {
|
|
533
|
-
direction: "horizontal",
|
|
534
|
-
gap: "xs",
|
|
535
|
-
wrap: !1,
|
|
536
|
-
className: "filter-value-display--component",
|
|
537
|
-
children: [/* @__PURE__ */ J(me, { className: "text-muted-foreground size-icon-sm" }), /* @__PURE__ */ J(o, {
|
|
538
|
-
tag: "span",
|
|
539
|
-
type: "inherit",
|
|
540
|
-
weight: "semibold",
|
|
541
|
-
lineHeight: "none",
|
|
542
|
-
className: "min-w-0 truncate",
|
|
543
|
-
children: He(e, t, n)
|
|
544
|
-
})]
|
|
545
|
-
}) : /* @__PURE__ */ J(o, {
|
|
546
|
-
tag: "span",
|
|
547
|
-
type: "inherit",
|
|
548
|
-
weight: "semibold",
|
|
549
|
-
lineHeight: "none",
|
|
550
|
-
className: "filter-value-display--component truncate",
|
|
551
|
-
children: We(e, t, n)
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
function He(e, t, n) {
|
|
555
|
-
return e.operator === "between" && t.length === 2 ? qe(t[0], t[1], e.dateFormat?.display) : t.length === 1 ? Ke(t[0], e.dateFormat?.display) : t.length === 2 ? qe(t[0], t[1], e.dateFormat?.display) : /* @__PURE__ */ J(h, { children: e.datePickerConfig?.noDatePlaceholder || n.calendar.notDateSelected });
|
|
556
|
-
}
|
|
557
|
-
function Ue(e, t, n) {
|
|
558
|
-
return t.length === 0 ? "" : X(n.selected, {
|
|
559
|
-
count: t.length,
|
|
560
|
-
filterLabel: (t.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
561
|
-
});
|
|
562
|
-
}
|
|
563
|
-
function We(e, t, n) {
|
|
564
|
-
return t.length > 1 ? X(n.selected, {
|
|
565
|
-
count: t.length,
|
|
566
|
-
filterLabel: e.pluralLabel ?? e.label
|
|
567
|
-
}) : t.map((t) => e.options?.find((e) => e.value === t)?.label || t).join(", ");
|
|
568
|
-
}
|
|
569
|
-
function Ge(e) {
|
|
570
|
-
let t = new Date(e);
|
|
571
|
-
return !Number.isNaN(t.getTime());
|
|
572
|
-
}
|
|
573
|
-
function Ke(e, t) {
|
|
574
|
-
return Ge(e) ? /* @__PURE__ */ J(b, {
|
|
575
|
-
value: e,
|
|
576
|
-
format: t
|
|
577
|
-
}) : /* @__PURE__ */ J(h, { children: e });
|
|
578
|
-
}
|
|
579
|
-
function qe(e, t, n) {
|
|
580
|
-
return Ge(e) && Ge(t) ? /* @__PURE__ */ J(y, {
|
|
581
|
-
from: e,
|
|
582
|
-
to: t,
|
|
583
|
-
format: n
|
|
584
|
-
}) : /* @__PURE__ */ Y("span", {
|
|
585
|
-
className: "inline-flex min-w-0 items-center gap-space-xs",
|
|
586
|
-
children: [
|
|
587
|
-
Ke(e, n),
|
|
588
|
-
/* @__PURE__ */ J(h, { children: "–" }),
|
|
589
|
-
Ke(t, n)
|
|
590
|
-
]
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
//#endregion
|
|
594
|
-
//#region src/components/features/filters/partials/active-filter-item.tsx
|
|
595
|
-
function Je({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, operators: d, operator: f, onOperatorChange: p, onFilterClear: m, onFilterClick: h }) {
|
|
596
|
-
let { defaultScale: g } = e(), _ = t(void 0, g), { strings: v } = $(), y = V.useId(), b = V.useId(), x = `${ne.joinedItem} !border-0 !rounded-none !shadow-none ${c.inset}`, S = () => /* @__PURE__ */ J("div", {
|
|
597
|
-
"aria-hidden": !0,
|
|
598
|
-
className: "w-px self-stretch bg-border"
|
|
599
|
-
});
|
|
600
|
-
return /* @__PURE__ */ Y("div", {
|
|
601
|
-
role: "group",
|
|
602
|
-
"aria-label": n.label,
|
|
603
|
-
"data-active": s || void 0,
|
|
604
|
-
className: r("active-filter-item--component", ne.joinedFrame, re[_], "bg-background", n.displayConfig?.className),
|
|
605
|
-
children: [
|
|
606
|
-
/* @__PURE__ */ Y(i, {
|
|
607
|
-
type: "button",
|
|
608
|
-
tone: "secondary",
|
|
609
|
-
buttonStyle: "ghost",
|
|
610
|
-
className: r(x, "flex h-full min-h-0 items-center gap-space-sm px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
611
|
-
ref: u,
|
|
612
|
-
"aria-haspopup": "dialog",
|
|
613
|
-
"aria-expanded": l,
|
|
614
|
-
onClick: h,
|
|
615
|
-
children: [
|
|
616
|
-
!!n.icon && /* @__PURE__ */ J("span", {
|
|
617
|
-
className: "flex items-center text-muted-foreground",
|
|
618
|
-
children: n.icon
|
|
619
|
-
}),
|
|
620
|
-
/* @__PURE__ */ J(o, {
|
|
621
|
-
id: y,
|
|
622
|
-
tag: "span",
|
|
623
|
-
type: "inherit",
|
|
624
|
-
weight: "semibold",
|
|
625
|
-
children: n.label
|
|
626
|
-
}),
|
|
627
|
-
/* @__PURE__ */ J(ge, { className: "size-icon-sm" })
|
|
628
|
-
]
|
|
629
|
-
}),
|
|
630
|
-
/* @__PURE__ */ J(S, {}),
|
|
631
|
-
/* @__PURE__ */ J(Be, {
|
|
632
|
-
operator: f,
|
|
633
|
-
operators: d,
|
|
634
|
-
onOperatorChange: p,
|
|
635
|
-
segmentResetClass: x
|
|
636
|
-
}),
|
|
637
|
-
/* @__PURE__ */ J(S, {}),
|
|
638
|
-
/* @__PURE__ */ J(i, {
|
|
639
|
-
type: "button",
|
|
640
|
-
tone: "secondary",
|
|
641
|
-
buttonStyle: "ghost",
|
|
642
|
-
"aria-labelledby": `${y} ${b}`,
|
|
643
|
-
"aria-haspopup": "dialog",
|
|
644
|
-
"aria-expanded": l,
|
|
645
|
-
onClick: h,
|
|
646
|
-
className: r(x, "flex h-full min-h-0 min-w-0 flex-1 items-center justify-start px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
647
|
-
children: /* @__PURE__ */ J("span", {
|
|
648
|
-
id: b,
|
|
649
|
-
className: "min-w-0",
|
|
650
|
-
children: /* @__PURE__ */ J(Ve, {
|
|
651
|
-
filter: n,
|
|
652
|
-
value: a
|
|
653
|
-
})
|
|
654
|
-
})
|
|
655
|
-
}),
|
|
656
|
-
!!s && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(S, {}), /* @__PURE__ */ Y(i, {
|
|
657
|
-
type: "button",
|
|
658
|
-
tone: "secondary",
|
|
659
|
-
buttonStyle: "ghost",
|
|
660
|
-
className: r(x, "flex h-full min-h-0 shrink-0 items-center justify-center px-space-sm text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
|
|
661
|
-
onClick: (e) => {
|
|
662
|
-
e.stopPropagation(), e.preventDefault(), m();
|
|
663
|
-
},
|
|
664
|
-
children: [/* @__PURE__ */ J(Se, {
|
|
665
|
-
"aria-hidden": "true",
|
|
666
|
-
className: "size-icon"
|
|
667
|
-
}), /* @__PURE__ */ J(o, {
|
|
668
|
-
tag: "span",
|
|
669
|
-
className: "sr-only",
|
|
670
|
-
children: v.clear
|
|
671
|
-
})]
|
|
672
|
-
})] })
|
|
673
|
-
]
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
//#endregion
|
|
677
|
-
//#region src/components/features/filters/hooks/use-async-options.ts
|
|
678
|
-
function Ye(e, t, n) {
|
|
679
|
-
for (let [t, r] of e) Date.now() - r.timestamp > n && e.delete(t);
|
|
680
|
-
return e.get(t);
|
|
681
|
-
}
|
|
682
|
-
function Xe(e, t, n, r = {}) {
|
|
683
|
-
let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = W(() => /* @__PURE__ */ new Map(), [
|
|
684
|
-
e.key,
|
|
685
|
-
a,
|
|
686
|
-
o
|
|
687
|
-
]), c = G(r.onError);
|
|
688
|
-
c.current = r.onError;
|
|
689
|
-
let l = i?.debounceMs ?? e.delay ?? 300, u = (le(t, l) ?? "").trim(), d = i?.limit ?? 10, f = i?.minQueryLength ?? 0, p = i?.preload ?? !0, m = i?.staleTime ?? 6e4, h = i?.gcTime ?? 3e5, g = u.length === 0 && p, _ = u.length >= f, v = !!i?.fetcher && n && (g || u.length > 0 && _), y = n && !g && u.length > 0 && u.length < f, b = W(() => i?.queryKey ? JSON.stringify(i.queryKey({
|
|
690
|
-
query: u,
|
|
691
|
-
limit: d
|
|
692
|
-
})) : JSON.stringify([
|
|
693
|
-
"filter",
|
|
694
|
-
e.key,
|
|
695
|
-
u,
|
|
696
|
-
d
|
|
697
|
-
]), [
|
|
698
|
-
i,
|
|
699
|
-
e.key,
|
|
700
|
-
u,
|
|
701
|
-
d
|
|
702
|
-
]), x = H(async (e) => a && o ? (await a({
|
|
703
|
-
query: u,
|
|
704
|
-
limit: d,
|
|
705
|
-
signal: e
|
|
706
|
-
})).map(o) : [], [
|
|
707
|
-
a,
|
|
708
|
-
o,
|
|
709
|
-
u,
|
|
710
|
-
d
|
|
711
|
-
]), [S, C] = K(() => {
|
|
712
|
-
let e = Ye(s, b, h);
|
|
713
|
-
return {
|
|
714
|
-
cache: s,
|
|
715
|
-
data: e?.data ?? [],
|
|
716
|
-
loading: !1,
|
|
717
|
-
fetching: !1,
|
|
718
|
-
error: !1
|
|
719
|
-
};
|
|
720
|
-
}), [w, T] = K(0), E = H(() => T((e) => e + 1), []), D = G(0);
|
|
721
|
-
return U(() => {
|
|
722
|
-
let t = D.current !== w;
|
|
723
|
-
if (D.current = w, !v) return;
|
|
724
|
-
let n = Ye(s, b, h), r = n !== void 0 && Date.now() - n.timestamp < m, i = new AbortController();
|
|
725
|
-
if (r && !t) return C({
|
|
726
|
-
cache: s,
|
|
727
|
-
data: n.data,
|
|
728
|
-
loading: !1,
|
|
729
|
-
fetching: !1,
|
|
730
|
-
error: !1
|
|
731
|
-
}), () => i.abort();
|
|
732
|
-
C((e) => ({
|
|
733
|
-
cache: s,
|
|
734
|
-
data: n?.data ?? (e.cache === s ? e.data : []),
|
|
735
|
-
loading: n === void 0,
|
|
736
|
-
fetching: !0,
|
|
737
|
-
error: !1
|
|
738
|
-
}));
|
|
739
|
-
let a = !1;
|
|
740
|
-
return x(i.signal).then((e) => {
|
|
741
|
-
a || (s.set(b, {
|
|
742
|
-
timestamp: Date.now(),
|
|
743
|
-
data: e
|
|
744
|
-
}), C({
|
|
745
|
-
cache: s,
|
|
746
|
-
data: e,
|
|
747
|
-
loading: !1,
|
|
748
|
-
fetching: !1,
|
|
749
|
-
error: !1
|
|
750
|
-
}));
|
|
751
|
-
}).catch((t) => {
|
|
752
|
-
a || i.signal.aborted || t && t.name === "AbortError" || (C((e) => ({
|
|
753
|
-
cache: s,
|
|
754
|
-
data: e.cache === s ? e.data : [],
|
|
755
|
-
loading: !1,
|
|
756
|
-
fetching: !1,
|
|
757
|
-
error: !0
|
|
758
|
-
})), c.current?.(t, {
|
|
759
|
-
phase: "fetch-options",
|
|
760
|
-
filterKey: e.key
|
|
761
|
-
}));
|
|
762
|
-
}), () => {
|
|
763
|
-
a = !0, i.abort();
|
|
764
|
-
};
|
|
765
|
-
}, [
|
|
766
|
-
s,
|
|
767
|
-
b,
|
|
768
|
-
x,
|
|
769
|
-
v,
|
|
770
|
-
m,
|
|
771
|
-
h,
|
|
772
|
-
w,
|
|
773
|
-
e.key
|
|
774
|
-
]), {
|
|
775
|
-
options: v && S.cache === s ? S.data : [],
|
|
776
|
-
isLoading: v && S.cache === s && S.loading,
|
|
777
|
-
isFetching: v && S.cache === s && S.fetching,
|
|
778
|
-
isError: v && S.cache === s && S.error,
|
|
779
|
-
refetch: E,
|
|
780
|
-
isBelowMinQuery: y,
|
|
781
|
-
minQueryLength: f
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
//#endregion
|
|
785
|
-
//#region src/components/features/filters/partials/async-filter-content.tsx
|
|
786
|
-
function Ze({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
|
|
787
|
-
let { strings: c, cacheAsyncOptions: l, getAsyncOptionLabel: d, reportError: m } = $(), [h, g] = K(""), [_, v] = K(t ?? []), y = G(t);
|
|
788
|
-
if (t !== y.current) {
|
|
789
|
-
let e = y.current ?? [], n = t ?? [];
|
|
790
|
-
y.current = t, (n.length !== e.length || n.some((t, n) => t !== e[n])) && v(n);
|
|
791
|
-
}
|
|
792
|
-
let { options: b, isLoading: x, isFetching: S, isError: C, refetch: k, isBelowMinQuery: j, minQueryLength: M } = Xe(e, h, !0, { onError: m });
|
|
793
|
-
U(() => {
|
|
794
|
-
b.length > 0 && l(e.key, b);
|
|
795
|
-
}, [
|
|
796
|
-
l,
|
|
797
|
-
e.key,
|
|
798
|
-
b
|
|
799
|
-
]);
|
|
800
|
-
let N = e.multiple !== !1, P = e.maxSelected, F = s === "toolbar", I = _.length !== t.length || _.some((e) => !t.includes(e)), L = W(() => {
|
|
801
|
-
let t = new Set(_), n = new Set(b.map((e) => e.value)), r = [];
|
|
802
|
-
for (let t of _) if (!n.has(t)) {
|
|
803
|
-
let n = d(e.key, t);
|
|
804
|
-
n && r.push({
|
|
805
|
-
value: t,
|
|
806
|
-
label: n,
|
|
807
|
-
icon: e.icon
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
return [...r, ...b].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
|
|
811
|
-
}, [
|
|
812
|
-
b,
|
|
813
|
-
_,
|
|
814
|
-
e.key,
|
|
815
|
-
e.icon,
|
|
816
|
-
d
|
|
817
|
-
]), ee = (t) => {
|
|
818
|
-
if (N) {
|
|
819
|
-
if (_.includes(t)) v(_.filter((e) => e !== t));
|
|
820
|
-
else {
|
|
821
|
-
if (P && _.length >= P) return;
|
|
822
|
-
v([..._, t]);
|
|
823
|
-
}
|
|
824
|
-
} else v([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
825
|
-
}, te = () => {
|
|
826
|
-
n(_), a();
|
|
827
|
-
}, B = W(() => x || S ? /* @__PURE__ */ J(f, { label: c.searching }) : C ? /* @__PURE__ */ J(p, {
|
|
828
|
-
variant: "inline",
|
|
829
|
-
title: c.fetchError,
|
|
830
|
-
action: /* @__PURE__ */ J(i, {
|
|
831
|
-
tone: "secondary",
|
|
832
|
-
buttonStyle: "outline",
|
|
833
|
-
size: "sm",
|
|
834
|
-
onClick: (e) => {
|
|
835
|
-
e.stopPropagation(), k();
|
|
836
|
-
},
|
|
837
|
-
children: c.retryFetch
|
|
838
|
-
})
|
|
839
|
-
}) : j ? /* @__PURE__ */ J("div", {
|
|
840
|
-
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
841
|
-
children: /* @__PURE__ */ J(o, {
|
|
842
|
-
tag: "span",
|
|
843
|
-
size: "xs",
|
|
844
|
-
type: "secondary",
|
|
845
|
-
children: X(c.minQueryHint, { min: M })
|
|
846
|
-
})
|
|
847
|
-
}) : c.noOptionsFound, [
|
|
848
|
-
x,
|
|
849
|
-
S,
|
|
850
|
-
C,
|
|
851
|
-
j,
|
|
852
|
-
M,
|
|
853
|
-
c,
|
|
854
|
-
k
|
|
855
|
-
]);
|
|
856
|
-
return /* @__PURE__ */ Y(q, { children: [
|
|
857
|
-
/* @__PURE__ */ Y(R, {
|
|
858
|
-
start: F ? /* @__PURE__ */ J(i, {
|
|
859
|
-
tone: "secondary",
|
|
860
|
-
buttonStyle: "ghost",
|
|
861
|
-
size: "sm",
|
|
862
|
-
iconOnly: !0,
|
|
863
|
-
className: "shrink-0",
|
|
864
|
-
onClick: r,
|
|
865
|
-
"aria-label": c.backToFilters,
|
|
866
|
-
children: /* @__PURE__ */ J(_e, {
|
|
867
|
-
"aria-hidden": "true",
|
|
868
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
869
|
-
})
|
|
870
|
-
}) : void 0,
|
|
871
|
-
children: [/* @__PURE__ */ J(o, {
|
|
872
|
-
tag: "span",
|
|
873
|
-
type: "inherit",
|
|
874
|
-
weight: "semibold",
|
|
875
|
-
children: e.label
|
|
876
|
-
}), /* @__PURE__ */ J(o, {
|
|
877
|
-
tag: "span",
|
|
878
|
-
size: "xs",
|
|
879
|
-
type: "secondary",
|
|
880
|
-
children: c.selectValues
|
|
881
|
-
})]
|
|
882
|
-
}),
|
|
883
|
-
/* @__PURE__ */ Y(A, {
|
|
884
|
-
shouldFilter: !1,
|
|
885
|
-
inset: "flush",
|
|
886
|
-
className: "rounded-none",
|
|
887
|
-
children: [/* @__PURE__ */ J(T, {
|
|
888
|
-
placeholder: X(c.searchPlaceholder, { filterLabel: e.label.toLowerCase() }),
|
|
889
|
-
value: h,
|
|
890
|
-
onValueChange: g
|
|
891
|
-
}), /* @__PURE__ */ J(D, { children: L.length === 0 ? /* @__PURE__ */ J(E, { children: B }) : /* @__PURE__ */ Y(O, { children: [!(!S || x) && /* @__PURE__ */ Y(u, {
|
|
892
|
-
direction: "horizontal",
|
|
893
|
-
gap: "sm",
|
|
894
|
-
wrap: !1,
|
|
895
|
-
className: "px-control-sm py-space-xs",
|
|
896
|
-
children: [/* @__PURE__ */ J(be, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ J(o, {
|
|
897
|
-
tag: "span",
|
|
898
|
-
size: "xs",
|
|
899
|
-
type: "secondary",
|
|
900
|
-
children: c.searching
|
|
901
|
-
})]
|
|
902
|
-
}), L.map((e) => /* @__PURE__ */ Y(w, {
|
|
903
|
-
onSelect: () => ee(e.value),
|
|
904
|
-
"data-checked": _.includes(e.value) || void 0,
|
|
905
|
-
disabled: e.disabled || !!P && _.length >= P && !_.includes(e.value),
|
|
906
|
-
className: "flex items-center gap-space-sm",
|
|
907
|
-
children: [e.icon, /* @__PURE__ */ J(o, {
|
|
908
|
-
tag: "span",
|
|
909
|
-
type: "inherit",
|
|
910
|
-
lineHeight: "tight",
|
|
911
|
-
children: e.label
|
|
912
|
-
})]
|
|
913
|
-
}, e.value))] }) })]
|
|
914
|
-
}),
|
|
915
|
-
I && /* @__PURE__ */ J(z, {
|
|
916
|
-
caption: X(c.selected, {
|
|
917
|
-
count: _.length,
|
|
918
|
-
filterLabel: (_.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
919
|
-
}),
|
|
920
|
-
children: /* @__PURE__ */ J(i, {
|
|
921
|
-
tone: "primary",
|
|
922
|
-
size: "sm",
|
|
923
|
-
onClick: te,
|
|
924
|
-
children: c.confirm
|
|
925
|
-
})
|
|
926
|
-
})
|
|
927
|
-
] });
|
|
928
|
-
}
|
|
929
|
-
//#endregion
|
|
930
|
-
//#region src/components/features/filters/facets/date-facet.tsx
|
|
931
|
-
var Qe = [];
|
|
932
|
-
function $e({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
933
|
-
let { strings: a } = $(), o = e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between"), s = e.dateFormat?.param ?? "yyyy-MM-dd", c = e.dateFormat?.display ?? "PPP", l = o ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? a.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? a.calendar.notDateSelected, u = !!e.datePickerConfig?.showConfirmButton, d = e.datePickerConfig?.autoApply ?? !u, f = e.datePickerConfig?.showShortcuts ?? !0, p = o && (t.start || t.end) ? {
|
|
934
|
-
from: t.start,
|
|
935
|
-
to: t.end
|
|
936
|
-
} : void 0, m = !o && t.start && we(t.start) ? t.start : void 0, h = {
|
|
937
|
-
format: s,
|
|
938
|
-
readableFormat: c,
|
|
939
|
-
placeholder: l,
|
|
940
|
-
disablePortal: !0,
|
|
941
|
-
numberOfMonths: 1,
|
|
942
|
-
className: r("date-facet--component", "w-full", i)
|
|
943
|
-
};
|
|
944
|
-
return o ? /* @__PURE__ */ J(F, {
|
|
945
|
-
mode: "range",
|
|
946
|
-
value: p,
|
|
947
|
-
onValueChange: (e) => {
|
|
948
|
-
n({
|
|
949
|
-
start: e.range?.from ?? void 0,
|
|
950
|
-
end: e.range?.to ?? void 0
|
|
951
|
-
});
|
|
952
|
-
},
|
|
953
|
-
withConfirm: u,
|
|
954
|
-
closeOnSelect: d,
|
|
955
|
-
presets: f ? void 0 : Qe,
|
|
956
|
-
...h
|
|
957
|
-
}) : /* @__PURE__ */ J(F, {
|
|
958
|
-
mode: "single",
|
|
959
|
-
value: m,
|
|
960
|
-
onValueChange: (e) => {
|
|
961
|
-
n({
|
|
962
|
-
start: e.date ?? void 0,
|
|
963
|
-
end: void 0
|
|
964
|
-
});
|
|
965
|
-
},
|
|
966
|
-
closeOnSelect: d,
|
|
967
|
-
...h
|
|
968
|
-
});
|
|
969
|
-
}
|
|
970
|
-
//#endregion
|
|
971
|
-
//#region src/components/features/filters/partials/date-filter-content.tsx
|
|
972
|
-
function et({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, triggerSource: a = "chip" }) {
|
|
973
|
-
let { strings: o } = $(), s = (t) => {
|
|
974
|
-
if (!t) return;
|
|
975
|
-
if (e.dateFormat?.param) {
|
|
976
|
-
let n = Te(t, e.dateFormat.param, /* @__PURE__ */ new Date());
|
|
977
|
-
return we(n) ? n : void 0;
|
|
978
|
-
}
|
|
979
|
-
let n = new Date(t);
|
|
980
|
-
return we(n) ? n : void 0;
|
|
981
|
-
}, c = s(t[0]), l = s(t[1]), u = (t) => {
|
|
982
|
-
if (t && we(t)) return Ce(t, e.dateFormat?.param ?? "yyyy-MM-dd");
|
|
983
|
-
}, d = ({ start: e, end: t }) => {
|
|
984
|
-
let r = [], i = u(e), a = u(t);
|
|
985
|
-
i && r.push(i), a && r.push(a), n(r);
|
|
986
|
-
}, f = a === "toolbar", p = {
|
|
987
|
-
start: c,
|
|
988
|
-
end: l
|
|
989
|
-
};
|
|
990
|
-
return /* @__PURE__ */ Y("div", {
|
|
991
|
-
className: "flex flex-col",
|
|
992
|
-
children: [/* @__PURE__ */ J(R, {
|
|
993
|
-
start: f ? /* @__PURE__ */ J(i, {
|
|
994
|
-
type: "button",
|
|
995
|
-
tone: "secondary",
|
|
996
|
-
buttonStyle: "ghost",
|
|
997
|
-
size: "sm",
|
|
998
|
-
iconOnly: !0,
|
|
999
|
-
onClick: r,
|
|
1000
|
-
className: "shrink-0",
|
|
1001
|
-
"aria-label": o.backToFilters,
|
|
1002
|
-
children: /* @__PURE__ */ J(_e, {
|
|
1003
|
-
"aria-hidden": "true",
|
|
1004
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
1005
|
-
})
|
|
1006
|
-
}) : void 0,
|
|
1007
|
-
children: /* @__PURE__ */ J(I, { children: e.label })
|
|
1008
|
-
}), /* @__PURE__ */ J("div", {
|
|
1009
|
-
className: "p-surface",
|
|
1010
|
-
children: /* @__PURE__ */ J($e, {
|
|
1011
|
-
filter: e,
|
|
1012
|
-
value: p,
|
|
1013
|
-
onValueChange: d
|
|
1014
|
-
})
|
|
1015
|
-
})]
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
//#endregion
|
|
1019
|
-
//#region src/components/features/filters/partials/filter-error-boundary.tsx
|
|
1020
|
-
var tt = class extends ue {
|
|
1021
|
-
state = {
|
|
1022
|
-
hasError: !1,
|
|
1023
|
-
error: null
|
|
1024
|
-
};
|
|
1025
|
-
static getDerivedStateFromError(e) {
|
|
1026
|
-
return {
|
|
1027
|
-
hasError: !0,
|
|
1028
|
-
error: e
|
|
1029
|
-
};
|
|
1030
|
-
}
|
|
1031
|
-
componentDidCatch(e, t) {
|
|
1032
|
-
this.props.onError(e, {
|
|
1033
|
-
phase: "render",
|
|
1034
|
-
filterKey: this.props.filterKey
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
handleReset = () => {
|
|
1038
|
-
this.setState({
|
|
1039
|
-
hasError: !1,
|
|
1040
|
-
error: null
|
|
1041
|
-
});
|
|
1042
|
-
};
|
|
1043
|
-
render() {
|
|
1044
|
-
if (this.state.hasError) {
|
|
1045
|
-
let { fallback: e, filterKey: t, labels: n } = this.props;
|
|
1046
|
-
return e ? /* @__PURE__ */ J("div", {
|
|
1047
|
-
className: "filter-error-boundary--component contents",
|
|
1048
|
-
children: e
|
|
1049
|
-
}) : /* @__PURE__ */ Y("div", {
|
|
1050
|
-
className: r("filter-error-boundary--component rounded-radius border p-surface-xs", d.destructive.edge, d.destructive.wash, d.destructive.ink),
|
|
1051
|
-
children: [
|
|
1052
|
-
/* @__PURE__ */ Y("div", {
|
|
1053
|
-
className: "mb-space-xs flex items-center justify-between",
|
|
1054
|
-
children: [/* @__PURE__ */ J(o, {
|
|
1055
|
-
tag: "span",
|
|
1056
|
-
weight: "semibold",
|
|
1057
|
-
children: n.title
|
|
1058
|
-
}), /* @__PURE__ */ J(i, {
|
|
1059
|
-
type: "button",
|
|
1060
|
-
tone: "destructive",
|
|
1061
|
-
buttonStyle: "ghost",
|
|
1062
|
-
size: "sm",
|
|
1063
|
-
iconOnly: !0,
|
|
1064
|
-
onClick: this.handleReset,
|
|
1065
|
-
"aria-label": n.reset,
|
|
1066
|
-
children: /* @__PURE__ */ J(Se, { className: "size-icon-sm" })
|
|
1067
|
-
})]
|
|
1068
|
-
}),
|
|
1069
|
-
/* @__PURE__ */ J(o, { children: n.getDescription(t) }),
|
|
1070
|
-
/* @__PURE__ */ J(_, {
|
|
1071
|
-
size: "xs",
|
|
1072
|
-
className: "mt-space-xs text-destructive",
|
|
1073
|
-
children: this.state.error?.message || n.unknownError
|
|
1074
|
-
})
|
|
1075
|
-
]
|
|
1076
|
-
});
|
|
1077
|
-
}
|
|
1078
|
-
return /* @__PURE__ */ J("div", {
|
|
1079
|
-
className: "filter-error-boundary--component contents",
|
|
1080
|
-
children: this.props.children
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
};
|
|
1084
|
-
function nt(e) {
|
|
1085
|
-
let { strings: t, reportError: n } = $(), r = W(() => ({
|
|
1086
|
-
title: t.error.title,
|
|
1087
|
-
reset: t.clear,
|
|
1088
|
-
getDescription: (e) => e ? X(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
|
|
1089
|
-
unknownError: t.error.unknown
|
|
1090
|
-
}), [t]);
|
|
1091
|
-
return /* @__PURE__ */ J(tt, {
|
|
1092
|
-
...e,
|
|
1093
|
-
labels: r,
|
|
1094
|
-
onError: n
|
|
1095
|
-
});
|
|
1096
|
-
}
|
|
1097
|
-
//#endregion
|
|
1098
|
-
//#region src/components/features/filters/partials/filter-list-item.tsx
|
|
1099
|
-
function rt({ filter: e, onSelect: t }) {
|
|
1100
|
-
let { strings: n } = $(), r = e.type === Z.DATE ? e.operator === "between" ? n?.selectDateRange : n?.selectDate : e.options ? `${e.options.length} ${n?.options ?? ""}`.trim() : null;
|
|
1101
|
-
return /* @__PURE__ */ Y(w, {
|
|
1102
|
-
onSelect: t,
|
|
1103
|
-
children: [!!e.icon && /* @__PURE__ */ J("span", {
|
|
1104
|
-
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1105
|
-
children: e.icon
|
|
1106
|
-
}), /* @__PURE__ */ Y("div", {
|
|
1107
|
-
className: "flex min-w-0 flex-col gap-dense leading-tight",
|
|
1108
|
-
children: [/* @__PURE__ */ J(o, {
|
|
1109
|
-
tag: "span",
|
|
1110
|
-
type: "inherit",
|
|
1111
|
-
lineHeight: "tight",
|
|
1112
|
-
weight: "medium",
|
|
1113
|
-
className: "truncate",
|
|
1114
|
-
children: e.label
|
|
1115
|
-
}), !!r && /* @__PURE__ */ J(o, {
|
|
1116
|
-
tag: "span",
|
|
1117
|
-
lineHeight: "tight",
|
|
1118
|
-
size: "xs",
|
|
1119
|
-
type: "secondary",
|
|
1120
|
-
className: "truncate",
|
|
1121
|
-
children: r
|
|
1122
|
-
})]
|
|
1123
|
-
})]
|
|
1124
|
-
}, e.key);
|
|
1125
|
-
}
|
|
1126
|
-
//#endregion
|
|
1127
|
-
//#region src/components/features/filters/partials/filter-list-content.tsx
|
|
1128
|
-
function it({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
|
|
1129
|
-
let { strings: r } = $(), i = (e) => {
|
|
1130
|
-
n(e);
|
|
1131
|
-
};
|
|
1132
|
-
return /* @__PURE__ */ Y(A, {
|
|
1133
|
-
inset: "compact",
|
|
1134
|
-
className: "rounded-none",
|
|
1135
|
-
children: [/* @__PURE__ */ J(T, { placeholder: r.searchFilters }), /* @__PURE__ */ Y(D, { children: [
|
|
1136
|
-
/* @__PURE__ */ J(E, { children: r.noFiltersAvailable }),
|
|
1137
|
-
e.length > 0 && /* @__PURE__ */ J(O, {
|
|
1138
|
-
heading: r.availableFilters,
|
|
1139
|
-
children: e.map((e) => /* @__PURE__ */ J(rt, {
|
|
1140
|
-
filter: e,
|
|
1141
|
-
onSelect: () => i(e)
|
|
1142
|
-
}, e.key))
|
|
1143
|
-
}),
|
|
1144
|
-
t.length > 0 && /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ J(k, {}), /* @__PURE__ */ J(O, {
|
|
1145
|
-
heading: r.activeFilters,
|
|
1146
|
-
children: t.map((e) => /* @__PURE__ */ J(rt, {
|
|
1147
|
-
filter: e,
|
|
1148
|
-
onSelect: () => i(e)
|
|
1149
|
-
}, e.key))
|
|
1150
|
-
})] })
|
|
1151
|
-
] })]
|
|
1152
|
-
});
|
|
1153
|
-
}
|
|
1154
|
-
//#endregion
|
|
1155
|
-
//#region src/components/features/filters/partials/regular-filter-content.tsx
|
|
1156
|
-
function at({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
|
|
1157
|
-
let { strings: c, reportError: l } = $(), d = e.multiple === !0 || e.type === Z.MULTI_SELECT, f = s === "toolbar", [p, m] = K(t || []);
|
|
1158
|
-
U(() => {
|
|
1159
|
-
m(t || []);
|
|
1160
|
-
}, [t]);
|
|
1161
|
-
let h = (t) => {
|
|
1162
|
-
if (d) {
|
|
1163
|
-
let e = p.includes(t) ? p.filter((e) => e !== t) : [...p, t];
|
|
1164
|
-
m(e);
|
|
1165
|
-
} else m([t]), e.closeOnSelect === !0 && (n([t]), a());
|
|
1166
|
-
}, g = () => {
|
|
1167
|
-
try {
|
|
1168
|
-
n(p), a();
|
|
1169
|
-
} catch (t) {
|
|
1170
|
-
l(t, {
|
|
1171
|
-
phase: "apply",
|
|
1172
|
-
filterKey: e.key
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
1175
|
-
}, _ = JSON.stringify(p.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1176
|
-
return /* @__PURE__ */ Y("div", {
|
|
1177
|
-
className: "flex flex-col",
|
|
1178
|
-
children: [
|
|
1179
|
-
/* @__PURE__ */ J(R, {
|
|
1180
|
-
start: f ? /* @__PURE__ */ J(i, {
|
|
1181
|
-
type: "button",
|
|
1182
|
-
tone: "secondary",
|
|
1183
|
-
buttonStyle: "ghost",
|
|
1184
|
-
size: "sm",
|
|
1185
|
-
iconOnly: !0,
|
|
1186
|
-
onClick: r,
|
|
1187
|
-
className: "shrink-0",
|
|
1188
|
-
"aria-label": c.backToFilters,
|
|
1189
|
-
children: /* @__PURE__ */ J(_e, {
|
|
1190
|
-
"aria-hidden": "true",
|
|
1191
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
1192
|
-
})
|
|
1193
|
-
}) : void 0,
|
|
1194
|
-
children: /* @__PURE__ */ J(o, {
|
|
1195
|
-
tag: "span",
|
|
1196
|
-
type: "inherit",
|
|
1197
|
-
weight: "semibold",
|
|
1198
|
-
children: e.label
|
|
1199
|
-
})
|
|
1200
|
-
}),
|
|
1201
|
-
/* @__PURE__ */ Y(A, {
|
|
1202
|
-
inset: "flush",
|
|
1203
|
-
className: "rounded-none",
|
|
1204
|
-
children: [/* @__PURE__ */ J(T, { placeholder: X(c.searchPlaceholder, { filterLabel: e.label.toLowerCase() }) }), /* @__PURE__ */ Y(D, {
|
|
1205
|
-
className: "max-h-64",
|
|
1206
|
-
children: [/* @__PURE__ */ J(E, { children: /* @__PURE__ */ J(o, {
|
|
1207
|
-
type: "secondary",
|
|
1208
|
-
align: "center",
|
|
1209
|
-
className: "py-space-xl",
|
|
1210
|
-
children: c.noOptionsFound
|
|
1211
|
-
}) }), /* @__PURE__ */ J(O, { children: e.options?.map((e) => {
|
|
1212
|
-
let t = p.includes(e.value);
|
|
1213
|
-
return /* @__PURE__ */ Y(w, {
|
|
1214
|
-
onSelect: () => h(e.value),
|
|
1215
|
-
"data-checked": t || void 0,
|
|
1216
|
-
disabled: e.disabled,
|
|
1217
|
-
className: "data-[checked=true]:**:[svg]:text-primary-accent",
|
|
1218
|
-
children: [!!e.icon && /* @__PURE__ */ J("span", {
|
|
1219
|
-
className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
|
|
1220
|
-
children: e.icon
|
|
1221
|
-
}), /* @__PURE__ */ Y(u, {
|
|
1222
|
-
gap: "dense",
|
|
1223
|
-
className: "flex min-w-0 flex-1 flex-col leading-tight",
|
|
1224
|
-
children: [/* @__PURE__ */ J(o, {
|
|
1225
|
-
tag: "span",
|
|
1226
|
-
type: "inherit",
|
|
1227
|
-
lineHeight: "tight",
|
|
1228
|
-
weight: t ? "medium" : "regular",
|
|
1229
|
-
className: "truncate",
|
|
1230
|
-
children: e.label
|
|
1231
|
-
}), !!e.description && /* @__PURE__ */ J(o, {
|
|
1232
|
-
tag: "span",
|
|
1233
|
-
size: "xs",
|
|
1234
|
-
lineHeight: "tight",
|
|
1235
|
-
type: "secondary",
|
|
1236
|
-
className: "truncate",
|
|
1237
|
-
children: e.description
|
|
1238
|
-
})]
|
|
1239
|
-
})]
|
|
1240
|
-
}, e.value);
|
|
1241
|
-
}) })]
|
|
1242
|
-
})]
|
|
1243
|
-
}),
|
|
1244
|
-
!!_ && /* @__PURE__ */ J(z, {
|
|
1245
|
-
caption: X(c.selected, {
|
|
1246
|
-
count: p.length,
|
|
1247
|
-
filterLabel: (p.length > 1 ? e.pluralLabel : e.label) ?? e.label
|
|
1248
|
-
}),
|
|
1249
|
-
children: /* @__PURE__ */ J(i, {
|
|
1250
|
-
tone: "primary",
|
|
1251
|
-
size: "sm",
|
|
1252
|
-
onClick: g,
|
|
1253
|
-
children: c.confirm
|
|
1254
|
-
})
|
|
1255
|
-
})
|
|
1256
|
-
]
|
|
1257
|
-
});
|
|
1258
|
-
}
|
|
1259
|
-
//#endregion
|
|
1260
|
-
//#region src/components/features/filters/facets/tags-facet.tsx
|
|
1261
|
-
function ot({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
1262
|
-
let { defaultScale: c } = e(), l = N(void 0, c), { strings: d } = $(), [f, p] = K(""), m = H(() => {
|
|
1263
|
-
let e = f.trim();
|
|
1264
|
-
e && !n.includes(e) && (a([...n, e]), p(""));
|
|
1265
|
-
}, [
|
|
1266
|
-
f,
|
|
1267
|
-
n,
|
|
1268
|
-
a
|
|
1269
|
-
]), h = H((e) => {
|
|
1270
|
-
a(n.filter((t) => t !== e));
|
|
1271
|
-
}, [n, a]), g = (e) => {
|
|
1272
|
-
e.key === "Enter" && (e.preventDefault(), m());
|
|
1273
|
-
}, _ = H(() => {
|
|
1274
|
-
a([]), p("");
|
|
1275
|
-
}, [a]), v = n.length > 0, y = n.length === 1 ? d.tag : d.tags, b = v ? /* @__PURE__ */ Y(u, {
|
|
1276
|
-
gap: "md",
|
|
1277
|
-
className: "tags-facet--summary",
|
|
1278
|
-
children: [/* @__PURE__ */ Y(u, {
|
|
1279
|
-
direction: "horizontal",
|
|
1280
|
-
gap: "sm",
|
|
1281
|
-
justify: "between",
|
|
1282
|
-
wrap: !1,
|
|
1283
|
-
children: [/* @__PURE__ */ Y(o, {
|
|
1284
|
-
tag: "span",
|
|
1285
|
-
size: "xs",
|
|
1286
|
-
type: "secondary",
|
|
1287
|
-
children: [
|
|
1288
|
-
n.length,
|
|
1289
|
-
" ",
|
|
1290
|
-
y
|
|
1291
|
-
]
|
|
1292
|
-
}), /* @__PURE__ */ J(i, {
|
|
1293
|
-
onClick: _,
|
|
1294
|
-
tone: "secondary",
|
|
1295
|
-
buttonStyle: "ghost",
|
|
1296
|
-
size: "sm",
|
|
1297
|
-
className: "text-muted-foreground hover:text-foreground",
|
|
1298
|
-
type: "button",
|
|
1299
|
-
"aria-label": d.clearAll,
|
|
1300
|
-
children: d.clearAll
|
|
1301
|
-
})]
|
|
1302
|
-
}), /* @__PURE__ */ J(u, {
|
|
1303
|
-
direction: "horizontal",
|
|
1304
|
-
gap: "md",
|
|
1305
|
-
children: n.map((e) => /* @__PURE__ */ Y(x, {
|
|
1306
|
-
tone: "secondary",
|
|
1307
|
-
className: "flex items-center gap-space-sm py-space-2xs pl-space-md pr-space-sm",
|
|
1308
|
-
children: [/* @__PURE__ */ J(o, {
|
|
1309
|
-
tag: "span",
|
|
1310
|
-
size: "xs",
|
|
1311
|
-
children: e
|
|
1312
|
-
}), /* @__PURE__ */ J("button", {
|
|
1313
|
-
onClick: () => h(e),
|
|
1314
|
-
className: r(C.target, C.focus, C.toggle),
|
|
1315
|
-
type: "button",
|
|
1316
|
-
"aria-label": `${d.removeTag} ${e}`,
|
|
1317
|
-
children: /* @__PURE__ */ J(Se, {
|
|
1318
|
-
className: C.icon,
|
|
1319
|
-
"aria-hidden": "true"
|
|
1320
|
-
})
|
|
1321
|
-
})]
|
|
1322
|
-
}, e))
|
|
1323
|
-
})]
|
|
1324
|
-
}) : null;
|
|
1325
|
-
return /* @__PURE__ */ Y(u, {
|
|
1326
|
-
gap: "lg",
|
|
1327
|
-
className: r("tags-facet--component", s),
|
|
1328
|
-
children: [/* @__PURE__ */ Y(u, {
|
|
1329
|
-
direction: "horizontal",
|
|
1330
|
-
gap: "md",
|
|
1331
|
-
wrap: !1,
|
|
1332
|
-
children: [/* @__PURE__ */ J("div", {
|
|
1333
|
-
className: "relative flex-1",
|
|
1334
|
-
children: /* @__PURE__ */ J(P, {
|
|
1335
|
-
type: "text",
|
|
1336
|
-
value: f,
|
|
1337
|
-
onChange: (e) => p(e.target.value),
|
|
1338
|
-
onKeyDown: g,
|
|
1339
|
-
placeholder: t.placeholder ?? d.enterTag
|
|
1340
|
-
})
|
|
1341
|
-
}), /* @__PURE__ */ Y(i, {
|
|
1342
|
-
tone: "primary",
|
|
1343
|
-
onClick: m,
|
|
1344
|
-
disabled: !f.trim(),
|
|
1345
|
-
size: l,
|
|
1346
|
-
iconOnly: !0,
|
|
1347
|
-
className: r(j[l], B[l]),
|
|
1348
|
-
type: "button",
|
|
1349
|
-
children: [/* @__PURE__ */ J(xe, { className: "size-icon" }), /* @__PURE__ */ J(o, {
|
|
1350
|
-
tag: "span",
|
|
1351
|
-
size: "pxs",
|
|
1352
|
-
className: "sr-only",
|
|
1353
|
-
children: d.addTag
|
|
1354
|
-
})]
|
|
1355
|
-
})]
|
|
1356
|
-
}), b]
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
var st = V.memo(ot);
|
|
1360
|
-
st.displayName = "TagsFacet";
|
|
1361
|
-
//#endregion
|
|
1362
|
-
//#region src/components/features/filters/partials/tags-filter-content.tsx
|
|
1363
|
-
function ct({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: o = "chip" }) {
|
|
1364
|
-
let { strings: s, reportError: c } = $(), [l, u] = K(t || []), d = o === "toolbar", f = l.length === 1 ? s.tag : s.tags;
|
|
1365
|
-
U(() => {
|
|
1366
|
-
u(t || []);
|
|
1367
|
-
}, [t]);
|
|
1368
|
-
let p = () => {
|
|
1369
|
-
try {
|
|
1370
|
-
n(l), a();
|
|
1371
|
-
} catch (t) {
|
|
1372
|
-
c(t, {
|
|
1373
|
-
phase: "apply",
|
|
1374
|
-
filterKey: e.key
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
}, m = JSON.stringify(l.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
|
|
1378
|
-
return /* @__PURE__ */ Y("div", {
|
|
1379
|
-
className: "flex flex-col",
|
|
1380
|
-
children: [
|
|
1381
|
-
/* @__PURE__ */ J(R, {
|
|
1382
|
-
start: d ? /* @__PURE__ */ J(i, {
|
|
1383
|
-
type: "button",
|
|
1384
|
-
tone: "secondary",
|
|
1385
|
-
buttonStyle: "ghost",
|
|
1386
|
-
size: "sm",
|
|
1387
|
-
iconOnly: !0,
|
|
1388
|
-
onClick: r,
|
|
1389
|
-
className: "shrink-0",
|
|
1390
|
-
"aria-label": s.backToFilters,
|
|
1391
|
-
children: /* @__PURE__ */ J(_e, {
|
|
1392
|
-
"aria-hidden": "true",
|
|
1393
|
-
className: "size-icon-sm rtl:rotate-180"
|
|
1394
|
-
})
|
|
1395
|
-
}) : void 0,
|
|
1396
|
-
children: /* @__PURE__ */ J(I, { children: e.label })
|
|
1397
|
-
}),
|
|
1398
|
-
/* @__PURE__ */ J("div", {
|
|
1399
|
-
className: "p-surface",
|
|
1400
|
-
children: /* @__PURE__ */ J(st, {
|
|
1401
|
-
filter: e,
|
|
1402
|
-
value: l,
|
|
1403
|
-
onValueChange: u
|
|
1404
|
-
})
|
|
1405
|
-
}),
|
|
1406
|
-
!!m && /* @__PURE__ */ J(z, {
|
|
1407
|
-
caption: /* @__PURE__ */ Y(g, {
|
|
1408
|
-
size: "xs",
|
|
1409
|
-
className: "tabular-nums",
|
|
1410
|
-
children: [
|
|
1411
|
-
l.length,
|
|
1412
|
-
" ",
|
|
1413
|
-
f
|
|
1414
|
-
]
|
|
1415
|
-
}),
|
|
1416
|
-
children: /* @__PURE__ */ J(i, {
|
|
1417
|
-
tone: "primary",
|
|
1418
|
-
size: "sm",
|
|
1419
|
-
onClick: p,
|
|
1420
|
-
children: s.confirm
|
|
1421
|
-
})
|
|
1422
|
-
})
|
|
1423
|
-
]
|
|
1424
|
-
});
|
|
1425
|
-
}
|
|
1426
|
-
//#endregion
|
|
1427
|
-
//#region src/components/features/filters/partials/filter-popover-content.tsx
|
|
1428
|
-
function lt({ activeFilterInPopover: e, availableFilters: t, activeFilters: n, getFilterValue: i, setFilterValue: a, onFilterSelect: o, onBackToFilterList: s, onClose: c, triggerSource: l = "chip", finalFocus: u }) {
|
|
1429
|
-
let { strings: d } = $(), f = e?.type === Z.DATE || e?.type === Z.TAGS ? "w-auto min-w-80 gap-0 overflow-hidden" : (e?.type, Z.ASYNC_SELECT, r(m.md, "gap-0 overflow-hidden")), p = (e, t) => {
|
|
1430
|
-
a(e, t);
|
|
1431
|
-
};
|
|
1432
|
-
return /* @__PURE__ */ J(te, {
|
|
1433
|
-
finalFocus: u,
|
|
1434
|
-
type: e?.type === Z.DATE || e?.type === Z.TAGS ? "display" : "menu",
|
|
1435
|
-
"aria-label": e?.label ?? d.addFilter,
|
|
1436
|
-
inset: "flush",
|
|
1437
|
-
className: r("filter-popover-content--component", f),
|
|
1438
|
-
align: "start",
|
|
1439
|
-
children: e ? e.type === Z.DATE ? /* @__PURE__ */ J(et, {
|
|
1440
|
-
filter: e,
|
|
1441
|
-
value: i(e.key),
|
|
1442
|
-
onFilterChange: (t) => p(e.key, t),
|
|
1443
|
-
onBackToFilterList: s,
|
|
1444
|
-
triggerSource: l
|
|
1445
|
-
}) : e.type === Z.TAGS ? /* @__PURE__ */ J(ct, {
|
|
1446
|
-
filter: e,
|
|
1447
|
-
value: i(e.key),
|
|
1448
|
-
onFilterChange: (t) => p(e.key, t),
|
|
1449
|
-
onBackToFilterList: s,
|
|
1450
|
-
onClose: c,
|
|
1451
|
-
triggerSource: l
|
|
1452
|
-
}) : e.type === Z.ASYNC_SELECT ? /* @__PURE__ */ J(Ze, {
|
|
1453
|
-
filter: e,
|
|
1454
|
-
value: i(e.key),
|
|
1455
|
-
onFilterChange: (t) => p(e.key, t),
|
|
1456
|
-
onBackToFilterList: s,
|
|
1457
|
-
onClose: c,
|
|
1458
|
-
triggerSource: l
|
|
1459
|
-
}) : /* @__PURE__ */ J(at, {
|
|
1460
|
-
filter: e,
|
|
1461
|
-
value: i(e.key),
|
|
1462
|
-
onFilterChange: (t) => p(e.key, t),
|
|
1463
|
-
onBackToFilterList: s,
|
|
1464
|
-
onClose: c,
|
|
1465
|
-
triggerSource: l
|
|
1466
|
-
}) : /* @__PURE__ */ J(it, {
|
|
1467
|
-
availableFilters: t,
|
|
1468
|
-
activeFilters: n,
|
|
1469
|
-
onFilterSelect: o
|
|
1470
|
-
})
|
|
1471
|
-
});
|
|
1472
|
-
}
|
|
1473
|
-
//#endregion
|
|
1474
|
-
//#region src/components/features/filters/partials/filter-pill.tsx
|
|
1475
|
-
function ut({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
|
|
1476
|
-
let d = G(!1), f = u ?? d, [p, m] = K(!1), h = G(null), g = G(null);
|
|
1477
|
-
return /* @__PURE__ */ J(nt, {
|
|
1478
|
-
filterKey: e.key,
|
|
1479
|
-
children: /* @__PURE__ */ Y(ee, {
|
|
1480
|
-
open: p,
|
|
1481
|
-
onOpenChange: (e) => {
|
|
1482
|
-
e && f.current || m(e);
|
|
1483
|
-
},
|
|
1484
|
-
children: [/* @__PURE__ */ Y("div", {
|
|
1485
|
-
className: "filter-pill--component filter-pill--anchor relative",
|
|
1486
|
-
children: [/* @__PURE__ */ J(L, {
|
|
1487
|
-
render: /* @__PURE__ */ J("span", {}),
|
|
1488
|
-
nativeButton: !1,
|
|
1489
|
-
tabIndex: -1,
|
|
1490
|
-
"aria-hidden": "true",
|
|
1491
|
-
className: "pointer-events-none absolute inset-0"
|
|
1492
|
-
}), /* @__PURE__ */ J(Je, {
|
|
1493
|
-
filter: e,
|
|
1494
|
-
popoverOpen: p,
|
|
1495
|
-
triggerRef: h,
|
|
1496
|
-
value: t,
|
|
1497
|
-
active: n,
|
|
1498
|
-
operators: i,
|
|
1499
|
-
operator: r,
|
|
1500
|
-
onOperatorChange: (e) => {
|
|
1501
|
-
f.current = !0, a(e), m(!1), setTimeout(() => {
|
|
1502
|
-
f.current = !1;
|
|
1503
|
-
}, 100);
|
|
1504
|
-
},
|
|
1505
|
-
onFilterClear: () => {
|
|
1506
|
-
m(!1), s(), h.current?.focus();
|
|
1507
|
-
},
|
|
1508
|
-
onFilterClick: (e) => {
|
|
1509
|
-
f.current || (g.current = e?.currentTarget ?? h.current, m(!0));
|
|
1510
|
-
}
|
|
1511
|
-
})]
|
|
1512
|
-
}), /* @__PURE__ */ J(lt, {
|
|
1513
|
-
finalFocus: g,
|
|
1514
|
-
activeFilterInPopover: e,
|
|
1515
|
-
availableFilters: c,
|
|
1516
|
-
activeFilters: l,
|
|
1517
|
-
getFilterValue: () => t,
|
|
1518
|
-
setFilterValue: (e, t) => o(t),
|
|
1519
|
-
onFilterSelect: () => {},
|
|
1520
|
-
onBackToFilterList: () => {},
|
|
1521
|
-
onClose: () => m(!1),
|
|
1522
|
-
triggerSource: "chip"
|
|
1523
|
-
})]
|
|
1524
|
-
})
|
|
1525
|
-
});
|
|
1526
|
-
}
|
|
1527
|
-
ut.displayName = "FilterPill";
|
|
1528
|
-
//#endregion
|
|
1529
|
-
//#region src/components/features/filters/partials/filters-button.tsx
|
|
1530
|
-
function dt({ triggerRef: t, availableFilters: n, activeFilters: a, activeFilterInPopover: o, getFilterValue: s, setFilterValue: c, setActiveFilterInPopover: l }) {
|
|
1531
|
-
let { defaultScale: u } = e(), d = N(void 0, u), [f, p] = K(!1), { strings: m } = $();
|
|
1532
|
-
return U(() => {
|
|
1533
|
-
f || l(null);
|
|
1534
|
-
}, [f, l]), /* @__PURE__ */ Y(ee, {
|
|
1535
|
-
open: f,
|
|
1536
|
-
onOpenChange: p,
|
|
1537
|
-
children: [/* @__PURE__ */ J(L, {
|
|
1538
|
-
asChild: !0,
|
|
1539
|
-
children: /* @__PURE__ */ J(i, {
|
|
1540
|
-
ref: t,
|
|
1541
|
-
tone: "secondary",
|
|
1542
|
-
buttonStyle: "outline",
|
|
1543
|
-
size: d,
|
|
1544
|
-
iconOnly: !0,
|
|
1545
|
-
"aria-label": m.addFilter,
|
|
1546
|
-
className: r("filters-button--component shrink-0", j[d], B[d]),
|
|
1547
|
-
children: /* @__PURE__ */ J(ye, { className: "size-icon-sm" })
|
|
1548
|
-
})
|
|
1549
|
-
}), /* @__PURE__ */ J(lt, {
|
|
1550
|
-
activeFilterInPopover: o,
|
|
1551
|
-
availableFilters: n,
|
|
1552
|
-
activeFilters: a,
|
|
1553
|
-
getFilterValue: s,
|
|
1554
|
-
setFilterValue: c,
|
|
1555
|
-
onFilterSelect: (e) => {
|
|
1556
|
-
l(e);
|
|
1557
|
-
},
|
|
1558
|
-
onBackToFilterList: () => {
|
|
1559
|
-
l(null);
|
|
1560
|
-
},
|
|
1561
|
-
onClose: () => {
|
|
1562
|
-
l(null), p(!1);
|
|
1563
|
-
},
|
|
1564
|
-
triggerSource: "toolbar"
|
|
1565
|
-
})]
|
|
1566
|
-
});
|
|
1567
|
-
}
|
|
1568
|
-
//#endregion
|
|
1569
|
-
//#region src/components/features/filters/partials/filter-tabs.tsx
|
|
1570
|
-
function ft({ tabs: e }) {
|
|
1571
|
-
let { activeFilters: t, filters: n, replaceFilters: r } = $(), i = W(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== Z.SEARCH), [t, n]), a = W(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === Z.SEARCH), [t, n]), s = W(() => {
|
|
1572
|
-
for (let t of e) {
|
|
1573
|
-
if (t.presets.length === 0) {
|
|
1574
|
-
if (i.length === 0) return t.id;
|
|
1575
|
-
continue;
|
|
1576
|
-
}
|
|
1577
|
-
if (t.presets.length === i.length && t.presets.every((e) => {
|
|
1578
|
-
let t = i.find((t) => t.key === e.key);
|
|
1579
|
-
if (!t) return !1;
|
|
1580
|
-
let n = [...e.value].sort(), r = [...t.value].sort();
|
|
1581
|
-
return !(n.length !== r.length || n.some((e, t) => e !== r[t]) || e.operator && t.operator !== e.operator);
|
|
1582
|
-
})) return t.id;
|
|
1583
|
-
}
|
|
1584
|
-
return null;
|
|
1585
|
-
}, [e, i]), c = H((e) => {
|
|
1586
|
-
if (e.presets.length === 0) {
|
|
1587
|
-
r([...a]);
|
|
1588
|
-
return;
|
|
1589
|
-
}
|
|
1590
|
-
let t = e.presets.map((e) => {
|
|
1591
|
-
let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ? Fe(t.type) : "equals");
|
|
1592
|
-
return {
|
|
1593
|
-
id: e.key,
|
|
1594
|
-
key: e.key,
|
|
1595
|
-
value: e.value,
|
|
1596
|
-
operator: r
|
|
1597
|
-
};
|
|
1598
|
-
});
|
|
1599
|
-
r([...a, ...t]);
|
|
1600
|
-
}, [
|
|
1601
|
-
n,
|
|
1602
|
-
a,
|
|
1603
|
-
r
|
|
1604
|
-
]);
|
|
1605
|
-
return e.length === 0 ? null : /* @__PURE__ */ J(oe, {
|
|
1606
|
-
value: s,
|
|
1607
|
-
onValueChange: (t) => {
|
|
1608
|
-
let n = e.find((e) => e.id === t);
|
|
1609
|
-
n && c(n);
|
|
1610
|
-
},
|
|
1611
|
-
className: "filter-tabs--component",
|
|
1612
|
-
children: /* @__PURE__ */ J(ae, {
|
|
1613
|
-
variant: "chips",
|
|
1614
|
-
role: "group",
|
|
1615
|
-
"aria-orientation": void 0,
|
|
1616
|
-
activateOnFocus: !0,
|
|
1617
|
-
className: "gap-space-md",
|
|
1618
|
-
children: e.map((e) => {
|
|
1619
|
-
let t = s === e.id;
|
|
1620
|
-
return /* @__PURE__ */ Y(ie, {
|
|
1621
|
-
value: e.id,
|
|
1622
|
-
role: "button",
|
|
1623
|
-
"aria-selected": void 0,
|
|
1624
|
-
"aria-controls": void 0,
|
|
1625
|
-
"aria-pressed": t,
|
|
1626
|
-
className: "filter-tabs--tab",
|
|
1627
|
-
children: [/* @__PURE__ */ J(o, {
|
|
1628
|
-
tag: "span",
|
|
1629
|
-
weight: "medium",
|
|
1630
|
-
className: "text-inherit",
|
|
1631
|
-
children: e.label
|
|
1632
|
-
}), e.count !== void 0 && /* @__PURE__ */ J(o, {
|
|
1633
|
-
tag: "span",
|
|
1634
|
-
size: "xs",
|
|
1635
|
-
type: "secondary",
|
|
1636
|
-
className: "tabular-nums",
|
|
1637
|
-
children: e.count
|
|
1638
|
-
})]
|
|
1639
|
-
}, e.id);
|
|
1640
|
-
})
|
|
1641
|
-
})
|
|
1642
|
-
});
|
|
1643
|
-
}
|
|
1644
|
-
//#endregion
|
|
1645
|
-
//#region src/components/features/filters/facets/search-facet.tsx
|
|
1646
|
-
var pt = V.forwardRef(function(e, t) {
|
|
1647
|
-
return /* @__PURE__ */ J(be, {
|
|
1648
|
-
...e,
|
|
1649
|
-
ref: t,
|
|
1650
|
-
className: r("animate-spin", e.className)
|
|
1651
|
-
});
|
|
1652
|
-
});
|
|
1653
|
-
function mt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
1654
|
-
let { strings: a, isNavigating: o } = $(), [s, c] = K(t[0] || ""), l = G(s);
|
|
1655
|
-
U(() => {
|
|
1656
|
-
l.current = s;
|
|
1657
|
-
}, [s]);
|
|
1658
|
-
let u = G(t[0] || null), d = G(!1);
|
|
1659
|
-
U(() => {
|
|
1660
|
-
if (d.current || o) return;
|
|
1661
|
-
let e = l.current;
|
|
1662
|
-
if (!t.length || t[0] === "") {
|
|
1663
|
-
e !== "" && (c(""), u.current = "");
|
|
1664
|
-
return;
|
|
1665
|
-
}
|
|
1666
|
-
t[0] !== void 0 && t[0] !== e && t[0] !== u.current && (c(t[0]), u.current = t[0]);
|
|
1667
|
-
}, [t, o]);
|
|
1668
|
-
let f = ce((e) => {
|
|
1669
|
-
u.current = e, d.current = !1, n([e]);
|
|
1670
|
-
}, e.delay ?? 300), p = (e) => {
|
|
1671
|
-
u.current !== e && f(e);
|
|
1672
|
-
};
|
|
1673
|
-
return /* @__PURE__ */ J("div", {
|
|
1674
|
-
className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-inner bg-background", i),
|
|
1675
|
-
children: /* @__PURE__ */ J(P, {
|
|
1676
|
-
type: "text",
|
|
1677
|
-
"aria-label": e.label,
|
|
1678
|
-
value: s,
|
|
1679
|
-
onChange: (e) => {
|
|
1680
|
-
d.current = !0;
|
|
1681
|
-
let t = e.target.value;
|
|
1682
|
-
c(t), p(t);
|
|
1683
|
-
},
|
|
1684
|
-
onFocus: () => {
|
|
1685
|
-
d.current = !0;
|
|
1686
|
-
},
|
|
1687
|
-
onBlur: () => {
|
|
1688
|
-
setTimeout(() => {
|
|
1689
|
-
d.current = !1;
|
|
1690
|
-
}, 100);
|
|
1691
|
-
},
|
|
1692
|
-
placeholder: e.placeholder ?? (() => {
|
|
1693
|
-
let t = e.label.trim().toLowerCase();
|
|
1694
|
-
return !t || t === "search" ? X(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim() : X(a.searchPlaceholder, { filterLabel: t });
|
|
1695
|
-
})(),
|
|
1696
|
-
clearable: s.trim() !== "" && !o,
|
|
1697
|
-
endIcon: o ? pt : void 0,
|
|
1698
|
-
strings: { clear: a.clearSearch }
|
|
1699
|
-
})
|
|
1700
|
-
});
|
|
1701
|
-
}
|
|
1702
|
-
var ht = V.memo(mt);
|
|
1703
|
-
ht.displayName = "SearchFacet";
|
|
1704
|
-
//#endregion
|
|
1705
|
-
//#region src/components/features/filters/partials/search-filters-list.tsx
|
|
1706
|
-
function gt({ filters: e, getFilterValue: t, setFilterValue: n, className: i }) {
|
|
1707
|
-
return /* @__PURE__ */ J(q, { children: e.map((e) => /* @__PURE__ */ Y(u, {
|
|
1708
|
-
gap: "lg",
|
|
1709
|
-
className: r("search-filters-list--component", "w-full min-w-0 sm:w-64 sm:flex-none", e.displayConfig.className, i),
|
|
1710
|
-
children: [/* @__PURE__ */ J(ht, {
|
|
1711
|
-
filter: e,
|
|
1712
|
-
value: t(e.key),
|
|
1713
|
-
onValueChange: (t) => n(e.key, t)
|
|
1714
|
-
}), !!e.description && /* @__PURE__ */ J(o, {
|
|
1715
|
-
size: "xs",
|
|
1716
|
-
type: "secondary",
|
|
1717
|
-
children: e.description
|
|
1718
|
-
})]
|
|
1719
|
-
}, e.key)) });
|
|
1720
|
-
}
|
|
1721
|
-
//#endregion
|
|
1722
|
-
//#region src/components/features/filters/filter-layout.tsx
|
|
1723
|
-
var _t = {
|
|
1724
|
-
compact: "lg",
|
|
1725
|
-
default: "xl"
|
|
1726
|
-
}, vt = {
|
|
1727
|
-
compact: "sm",
|
|
1728
|
-
default: "md"
|
|
1729
|
-
};
|
|
1730
|
-
function yt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: a = "default", showClearFilters: s = !1, tabs: c }) {
|
|
1731
|
-
let { getFilterValue: l, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = $(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } = ze({ dynamicFilterOptions: t }), [w, T] = K(null), E = v.find((e) => e.key === w) ?? null, D = H((e) => {
|
|
1732
|
-
T(e?.key ?? null);
|
|
1733
|
-
}, []);
|
|
1734
|
-
U(() => {
|
|
1735
|
-
w !== null && E === null && T(null);
|
|
1736
|
-
}, [w, E]);
|
|
1737
|
-
let O = G(null), k = G(null);
|
|
1738
|
-
function A(e, t) {
|
|
1739
|
-
t.length === 0 && e.displayConfig?.display !== "always" && (k.current = e.key), d(e.key, t);
|
|
1740
|
-
}
|
|
1741
|
-
U(() => {
|
|
1742
|
-
let e = k.current;
|
|
1743
|
-
e !== null && !f(e) && (O.current?.focus(), k.current = null);
|
|
1744
|
-
}, [f]);
|
|
1745
|
-
function j(e) {
|
|
1746
|
-
return e.operators && e.operators.length > 0 ? e.operators : Pe(e.type, _.operators);
|
|
1747
|
-
}
|
|
1748
|
-
function M(e, t) {
|
|
1749
|
-
h(e, t);
|
|
1750
|
-
}
|
|
1751
|
-
return /* @__PURE__ */ Y(u, {
|
|
1752
|
-
gap: _t[a],
|
|
1753
|
-
className: r("filter-layout--component", e),
|
|
1754
|
-
children: [!!c && c.length > 0 && /* @__PURE__ */ J(ft, { tabs: c }), /* @__PURE__ */ Y(u, {
|
|
1755
|
-
direction: "horizontal",
|
|
1756
|
-
align: "center",
|
|
1757
|
-
gap: vt[a],
|
|
1758
|
-
children: [/* @__PURE__ */ J(nt, {
|
|
1759
|
-
filterKey: "search-filters",
|
|
1760
|
-
children: /* @__PURE__ */ J(gt, {
|
|
1761
|
-
filters: y,
|
|
1762
|
-
getFilterValue: l,
|
|
1763
|
-
setFilterValue: d
|
|
1764
|
-
})
|
|
1765
|
-
}), /* @__PURE__ */ Y("div", {
|
|
1766
|
-
className: r("contents", g && "pointer-events-none opacity-60"),
|
|
1767
|
-
children: [
|
|
1768
|
-
Object.entries(n).filter(([, e]) => e).map(([e]) => {
|
|
1769
|
-
let t = v.find((t) => t.key === e)?.label || e;
|
|
1770
|
-
return /* @__PURE__ */ Y(u, {
|
|
1771
|
-
direction: "horizontal",
|
|
1772
|
-
gap: "sm",
|
|
1773
|
-
wrap: !1,
|
|
1774
|
-
className: "rounded-radius bg-muted/50 px-control-sm py-space-xs",
|
|
1775
|
-
children: [/* @__PURE__ */ J("div", { className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2" }), /* @__PURE__ */ J(o, {
|
|
1776
|
-
tag: "span",
|
|
1777
|
-
type: "secondary",
|
|
1778
|
-
children: X(_.loadingOptions, { filterLabel: t })
|
|
1779
|
-
})]
|
|
1780
|
-
}, `loading-${e}`);
|
|
1781
|
-
}),
|
|
1782
|
-
[...b, ...x].map((e) => /* @__PURE__ */ J(ut, {
|
|
1783
|
-
filter: e,
|
|
1784
|
-
value: l(e.key) ?? [],
|
|
1785
|
-
active: f(e.key),
|
|
1786
|
-
operator: m(e.key) || "equals",
|
|
1787
|
-
operators: j(e),
|
|
1788
|
-
onOperatorChange: (t) => M(e.key, t),
|
|
1789
|
-
onValueChange: (t) => A(e, t),
|
|
1790
|
-
onClear: () => A(e, []),
|
|
1791
|
-
availableFilters: S,
|
|
1792
|
-
activeFilters: [...x, ...b]
|
|
1793
|
-
}, e.key)),
|
|
1794
|
-
S.length > 0 && /* @__PURE__ */ J(nt, {
|
|
1795
|
-
filterKey: "filters-button",
|
|
1796
|
-
children: /* @__PURE__ */ J(dt, {
|
|
1797
|
-
triggerRef: O,
|
|
1798
|
-
availableFilters: S,
|
|
1799
|
-
activeFilters: x,
|
|
1800
|
-
activeFilterInPopover: E,
|
|
1801
|
-
getFilterValue: l,
|
|
1802
|
-
setFilterValue: d,
|
|
1803
|
-
setActiveFilterInPopover: D
|
|
1804
|
-
})
|
|
1805
|
-
}),
|
|
1806
|
-
!!s && C && /* @__PURE__ */ J(i, {
|
|
1807
|
-
tone: "secondary",
|
|
1808
|
-
buttonStyle: "ghost",
|
|
1809
|
-
onClick: p,
|
|
1810
|
-
className: "text-muted-foreground ml-auto",
|
|
1811
|
-
children: _.clearFilters
|
|
1812
|
-
})
|
|
1813
|
-
]
|
|
1814
|
-
})]
|
|
1815
|
-
})]
|
|
1816
|
-
});
|
|
1817
|
-
}
|
|
1818
|
-
//#endregion
|
|
1819
|
-
//#region src/components/features/filters/filter-query.ts
|
|
1820
|
-
var bt = "__op", xt = ["page"], St = new Set(Object.values(Q));
|
|
1821
|
-
function Ct(e) {
|
|
1822
|
-
let t = {};
|
|
1823
|
-
if (!e) return t;
|
|
1824
|
-
if (e instanceof URLSearchParams) return e.forEach((e, n) => {
|
|
1825
|
-
t[n] = [...t[n] ?? [], e];
|
|
1826
|
-
}), t;
|
|
1827
|
-
for (let [n, r] of Object.entries(e)) {
|
|
1828
|
-
let e = (Array.isArray(r) ? r : [r]).filter((e) => e != null && String(e).length > 0).map((e) => String(e));
|
|
1829
|
-
e.length > 0 && (t[n] = e);
|
|
1830
|
-
}
|
|
1831
|
-
return t;
|
|
1832
|
-
}
|
|
1833
|
-
function wt(e) {
|
|
1834
|
-
let t = {};
|
|
1835
|
-
for (let [n, r] of Object.entries(e)) r.length !== 0 && (t[n] = r.length === 1 ? r[0] : r);
|
|
1836
|
-
return t;
|
|
1837
|
-
}
|
|
1838
|
-
function Tt(e, t, n) {
|
|
1839
|
-
let r = e[t] ?? [];
|
|
1840
|
-
return n === "comma" ? r.flatMap((e) => e.split(",")) : r;
|
|
1841
|
-
}
|
|
1842
|
-
function Et(e, t) {
|
|
1843
|
-
return t.map((e) => e.trim()).filter((e) => e.length > 0).map((t) => {
|
|
1844
|
-
if (!e.parse) return t;
|
|
1845
|
-
let n = e.parse(t);
|
|
1846
|
-
return n == null ? "" : String(n);
|
|
1847
|
-
}).filter((e) => e.length > 0);
|
|
1848
|
-
}
|
|
1849
|
-
function Dt(e, t) {
|
|
1850
|
-
return t.map((t) => {
|
|
1851
|
-
let n = e.transform ? e.transform(t) : t, r = e.format ? e.format(n) : n;
|
|
1852
|
-
return r == null ? "" : String(r);
|
|
1853
|
-
}).filter((e) => e.length > 0);
|
|
1854
|
-
}
|
|
1855
|
-
function Ot(e) {
|
|
1856
|
-
return e.operator ?? e.operators?.[0]?.value ?? Fe(e.type);
|
|
1857
|
-
}
|
|
1858
|
-
function kt(e, t, n) {
|
|
1859
|
-
let [r] = t[`${e.key}${n}`] ?? [];
|
|
1860
|
-
return r && St.has(r) ? r : Ot(e);
|
|
1861
|
-
}
|
|
1862
|
-
function At(e, t, n) {
|
|
1863
|
-
return e === "always" || e !== "never" && t !== n;
|
|
1864
|
-
}
|
|
1865
|
-
function jt(e) {
|
|
1866
|
-
return e.type === Z.MULTI_SELECT || e.type === Z.TAGS || e.multiple === !0;
|
|
1867
|
-
}
|
|
1868
|
-
function Mt(e, t, n = {}) {
|
|
1869
|
-
let r = n.operatorSuffix ?? bt, i = n.arrayFormat ?? "repeat", a = Ct(t);
|
|
1870
|
-
return e.flatMap((e) => {
|
|
1871
|
-
let t = Et(e, Tt(a, e.key, i));
|
|
1872
|
-
return t.length === 0 ? [] : [{
|
|
1873
|
-
id: e.key,
|
|
1874
|
-
key: e.key,
|
|
1875
|
-
operator: kt(e, a, r),
|
|
1876
|
-
value: jt(e) ? t : [t[0]]
|
|
1877
|
-
}];
|
|
1878
|
-
});
|
|
1879
|
-
}
|
|
1880
|
-
function Nt(e, t, n, r = {}) {
|
|
1881
|
-
let i = r.operatorSuffix ?? bt, a = r.arrayFormat ?? "repeat", o = r.preserveUnrelated ?? !0, s = r.includeOperators ?? "changed", c = r.resetPageKeys ?? xt, l = o ? Ct(n) : {}, u = new Map(e.map((e) => [e.key, e]));
|
|
1882
|
-
for (let t of e) delete l[t.key], delete l[`${t.key}${i}`];
|
|
1883
|
-
for (let e of c) delete l[e];
|
|
1884
|
-
for (let e of t) {
|
|
1885
|
-
let t = u.get(e.key);
|
|
1886
|
-
if (!t) continue;
|
|
1887
|
-
let n = Dt(t, e.value);
|
|
1888
|
-
if (n.length === 0) continue;
|
|
1889
|
-
l[e.key] = a === "comma" ? [n.join(",")] : n;
|
|
1890
|
-
let r = Ot(t);
|
|
1891
|
-
At(s, e.operator, r) && (l[`${e.key}${i}`] = [e.operator]);
|
|
1892
|
-
}
|
|
1893
|
-
return wt(l);
|
|
1894
|
-
}
|
|
1895
|
-
function Pt(e, t, n = {}) {
|
|
1896
|
-
let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ?? xt, a = r ? Ct(e) : {}, o = Ct(t);
|
|
1897
|
-
for (let e of i) delete a[e];
|
|
1898
|
-
for (let [e, t] of Object.entries(o)) t.length === 0 ? delete a[e] : a[e] = t;
|
|
1899
|
-
return wt(a);
|
|
1900
|
-
}
|
|
1901
|
-
//#endregion
|
|
1902
|
-
//#region src/components/features/filters/facets/select-facet.tsx
|
|
1903
|
-
function Ft({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
1904
|
-
let { defaultScale: c } = e(), l = N(void 0, c), { strings: u } = $(), [d, f] = K(!1), [p, m] = K(""), h = n.length > 0, g = t.options, _ = (e) => {
|
|
1905
|
-
t.multiple ? n.includes(e) ? a(n.filter((t) => t !== e)) : a([...n, e]) : (a([e]), t.closeOnSelect !== !1 && f(!1));
|
|
1906
|
-
}, v = (e) => g?.find((t) => t.value === e)?.label ?? e, y = W(() => (g ?? []).map((e) => ({
|
|
1907
|
-
value: e.value,
|
|
1908
|
-
label: e.label,
|
|
1909
|
-
description: e.description,
|
|
1910
|
-
icon: e.icon,
|
|
1911
|
-
selected: n.includes(e.value),
|
|
1912
|
-
disabled: e.disabled
|
|
1913
|
-
})), [g, n]), b = X(u.searchPlaceholder, { filterLabel: t.label.toLowerCase() });
|
|
1914
|
-
return /* @__PURE__ */ J("div", {
|
|
1915
|
-
className: r("select-facet--component", "relative", s),
|
|
1916
|
-
children: /* @__PURE__ */ J(se, {
|
|
1917
|
-
open: d,
|
|
1918
|
-
onOpenChange: f,
|
|
1919
|
-
search: !0,
|
|
1920
|
-
searchValue: p,
|
|
1921
|
-
onSearchChange: m,
|
|
1922
|
-
strings: {
|
|
1923
|
-
searchPlaceholder: b,
|
|
1924
|
-
empty: u.noOptionsFound
|
|
1925
|
-
},
|
|
1926
|
-
contentClassName: "w-(--anchor-width) min-w-56",
|
|
1927
|
-
trigger: /* @__PURE__ */ Y(i, {
|
|
1928
|
-
tone: "secondary",
|
|
1929
|
-
buttonStyle: "outline",
|
|
1930
|
-
size: l,
|
|
1931
|
-
role: "combobox",
|
|
1932
|
-
"aria-expanded": d,
|
|
1933
|
-
className: M(l),
|
|
1934
|
-
children: [h ? n.length === 1 ? /* @__PURE__ */ J(o, {
|
|
1935
|
-
tag: "span",
|
|
1936
|
-
weight: "semibold",
|
|
1937
|
-
className: "truncate",
|
|
1938
|
-
children: v(n[0])
|
|
1939
|
-
}) : /* @__PURE__ */ J(o, {
|
|
1940
|
-
tag: "span",
|
|
1941
|
-
weight: "semibold",
|
|
1942
|
-
children: X(u.selected, {
|
|
1943
|
-
count: n.length,
|
|
1944
|
-
filterLabel: (n.length > 1 ? t.pluralLabel : t.label) ?? t.label
|
|
1945
|
-
})
|
|
1946
|
-
}) : /* @__PURE__ */ J(o, {
|
|
1947
|
-
tag: "span",
|
|
1948
|
-
type: "secondary",
|
|
1949
|
-
children: t.placeholder ?? u.select
|
|
1950
|
-
}), /* @__PURE__ */ J(ve, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
1951
|
-
}),
|
|
1952
|
-
items: y,
|
|
1953
|
-
onSelect: (e) => _(e.value)
|
|
1954
|
-
})
|
|
1955
|
-
});
|
|
1956
|
-
}
|
|
1957
|
-
//#endregion
|
|
1958
|
-
//#region src/components/features/filters/facets/async-select-facet.tsx
|
|
1959
|
-
function It({ filter: t, value: n, onValueChange: a, className: s }) {
|
|
1960
|
-
let { defaultScale: c } = e(), l = N(void 0, c), { strings: d, cacheAsyncOptions: m, getAsyncOptionLabel: h, reportError: g } = $(), [_, v] = K(!1), [y, b] = K(""), x = W(() => /* @__PURE__ */ new Map(), [
|
|
1961
|
-
t.key,
|
|
1962
|
-
t.asyncConfig?.fetcher,
|
|
1963
|
-
t.asyncConfig?.mapToOption
|
|
1964
|
-
]), { options: S, isLoading: C, isFetching: k, isError: j, refetch: P, isBelowMinQuery: F, minQueryLength: I } = Xe(t, y, _, { onError: g });
|
|
1965
|
-
U(() => {
|
|
1966
|
-
if (S.length !== 0) {
|
|
1967
|
-
for (let e of S) x.set(e.value, e);
|
|
1968
|
-
m(t.key, S);
|
|
1969
|
-
}
|
|
1970
|
-
}, [
|
|
1971
|
-
m,
|
|
1972
|
-
t.key,
|
|
1973
|
-
x,
|
|
1974
|
-
S
|
|
1975
|
-
]);
|
|
1976
|
-
let R = t.multiple !== !1, z = t.maxSelected, B = W(() => t.options ?? [], [t.options]), ne = W(() => {
|
|
1977
|
-
let e = new Set(n), r = new Set([...B, ...S].map((e) => e.value)), i = [];
|
|
1978
|
-
for (let e of n) if (!r.has(e)) {
|
|
1979
|
-
let n = x.get(e);
|
|
1980
|
-
if (n) i.push(n);
|
|
1981
|
-
else {
|
|
1982
|
-
let n = B.find((t) => t.value === e);
|
|
1983
|
-
if (n) {
|
|
1984
|
-
i.push(n);
|
|
1985
|
-
continue;
|
|
1986
|
-
}
|
|
1987
|
-
let r = h(t.key, e);
|
|
1988
|
-
r && i.push({
|
|
1989
|
-
value: e,
|
|
1990
|
-
label: r,
|
|
1991
|
-
icon: t.icon
|
|
1992
|
-
});
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
return [
|
|
1996
|
-
...i,
|
|
1997
|
-
...B,
|
|
1998
|
-
...S
|
|
1999
|
-
].sort((t, n) => +!e.has(t.value) - !e.has(n.value));
|
|
2000
|
-
}, [
|
|
2001
|
-
B,
|
|
2002
|
-
S,
|
|
2003
|
-
n,
|
|
2004
|
-
t.key,
|
|
2005
|
-
t.icon,
|
|
2006
|
-
x,
|
|
2007
|
-
h
|
|
2008
|
-
]), re = (e) => {
|
|
2009
|
-
if (R) {
|
|
2010
|
-
if (n.includes(e)) a(n.filter((t) => t !== e));
|
|
2011
|
-
else {
|
|
2012
|
-
if (z && n.length >= z) return;
|
|
2013
|
-
a([...n, e]);
|
|
2014
|
-
}
|
|
2015
|
-
} else a([e]), t.closeOnSelect !== !1 && v(!1);
|
|
2016
|
-
}, ie = (e) => {
|
|
2017
|
-
let n = S.find((t) => t.value === e);
|
|
2018
|
-
if (n) return n.label;
|
|
2019
|
-
let r = B.find((t) => t.value === e);
|
|
2020
|
-
if (r) return r.label;
|
|
2021
|
-
let i = x.get(e);
|
|
2022
|
-
return i ? i.label : h(t.key, e) ?? e;
|
|
2023
|
-
}, ae = n.length > 0, oe = W(() => C || k ? /* @__PURE__ */ J(f, {
|
|
2024
|
-
className: "async-select-facet--component",
|
|
2025
|
-
label: d.searching
|
|
2026
|
-
}) : j ? /* @__PURE__ */ J(p, {
|
|
2027
|
-
variant: "inline",
|
|
2028
|
-
title: d.fetchError,
|
|
2029
|
-
action: /* @__PURE__ */ J(i, {
|
|
2030
|
-
tone: "secondary",
|
|
2031
|
-
buttonStyle: "outline",
|
|
2032
|
-
size: "sm",
|
|
2033
|
-
onClick: (e) => {
|
|
2034
|
-
e.stopPropagation(), P();
|
|
2035
|
-
},
|
|
2036
|
-
children: d.retryFetch
|
|
2037
|
-
})
|
|
2038
|
-
}) : F ? /* @__PURE__ */ J("div", {
|
|
2039
|
-
className: "text-muted-foreground flex items-center justify-center py-space-xl",
|
|
2040
|
-
children: /* @__PURE__ */ J(o, {
|
|
2041
|
-
tag: "span",
|
|
2042
|
-
size: "xs",
|
|
2043
|
-
type: "secondary",
|
|
2044
|
-
children: X(d.minQueryHint, { min: I })
|
|
2045
|
-
})
|
|
2046
|
-
}) : /* @__PURE__ */ J(o, {
|
|
2047
|
-
tag: "span",
|
|
2048
|
-
type: "secondary",
|
|
2049
|
-
children: d.noOptionsFound
|
|
2050
|
-
}), [
|
|
2051
|
-
C,
|
|
2052
|
-
k,
|
|
2053
|
-
j,
|
|
2054
|
-
F,
|
|
2055
|
-
I,
|
|
2056
|
-
d,
|
|
2057
|
-
P
|
|
2058
|
-
]);
|
|
2059
|
-
return /* @__PURE__ */ J("div", {
|
|
2060
|
-
className: r("async-select-facet--component relative", s),
|
|
2061
|
-
children: /* @__PURE__ */ Y(ee, {
|
|
2062
|
-
open: _,
|
|
2063
|
-
onOpenChange: (e) => {
|
|
2064
|
-
v(e), e || b("");
|
|
2065
|
-
},
|
|
2066
|
-
children: [/* @__PURE__ */ J(L, { render: /* @__PURE__ */ Y(i, {
|
|
2067
|
-
tone: "secondary",
|
|
2068
|
-
buttonStyle: "outline",
|
|
2069
|
-
size: l,
|
|
2070
|
-
role: "combobox",
|
|
2071
|
-
"aria-expanded": _,
|
|
2072
|
-
className: M(l),
|
|
2073
|
-
children: [ae ? n.length === 1 ? /* @__PURE__ */ J(o, {
|
|
2074
|
-
tag: "span",
|
|
2075
|
-
weight: "semibold",
|
|
2076
|
-
className: "truncate",
|
|
2077
|
-
children: ie(n[0])
|
|
2078
|
-
}) : /* @__PURE__ */ J(o, {
|
|
2079
|
-
tag: "span",
|
|
2080
|
-
weight: "semibold",
|
|
2081
|
-
children: X(d.selected, {
|
|
2082
|
-
count: n.length,
|
|
2083
|
-
filterLabel: (n.length > 1 ? t.pluralLabel : t.label) ?? t.label
|
|
2084
|
-
})
|
|
2085
|
-
}) : /* @__PURE__ */ J(o, {
|
|
2086
|
-
tag: "span",
|
|
2087
|
-
type: "secondary",
|
|
2088
|
-
children: t.placeholder ?? d.select
|
|
2089
|
-
}), /* @__PURE__ */ J(ve, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
|
|
2090
|
-
}) }), /* @__PURE__ */ J(te, {
|
|
2091
|
-
type: "menu",
|
|
2092
|
-
inset: "flush",
|
|
2093
|
-
className: "w-full min-w-70 gap-0",
|
|
2094
|
-
children: /* @__PURE__ */ Y(A, {
|
|
2095
|
-
shouldFilter: !1,
|
|
2096
|
-
inset: "flush",
|
|
2097
|
-
className: "rounded-none",
|
|
2098
|
-
children: [/* @__PURE__ */ J(T, {
|
|
2099
|
-
placeholder: X(d.searchPlaceholder, { filterLabel: t.label }),
|
|
2100
|
-
value: y,
|
|
2101
|
-
onValueChange: b
|
|
2102
|
-
}), /* @__PURE__ */ J(D, { children: ne.length === 0 ? /* @__PURE__ */ J(E, { children: oe }) : /* @__PURE__ */ Y(O, { children: [!(!k || C) && /* @__PURE__ */ Y(u, {
|
|
2103
|
-
direction: "horizontal",
|
|
2104
|
-
gap: "sm",
|
|
2105
|
-
wrap: !1,
|
|
2106
|
-
className: "px-control-sm py-space-xs",
|
|
2107
|
-
children: [/* @__PURE__ */ J(be, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ J(o, {
|
|
2108
|
-
tag: "span",
|
|
2109
|
-
size: "xs",
|
|
2110
|
-
type: "secondary",
|
|
2111
|
-
children: d.searching
|
|
2112
|
-
})]
|
|
2113
|
-
}), ne.map((e) => /* @__PURE__ */ Y(w, {
|
|
2114
|
-
value: e.value,
|
|
2115
|
-
onSelect: () => re(e.value),
|
|
2116
|
-
disabled: e.disabled || !!z && n.length >= z && !n.includes(e.value),
|
|
2117
|
-
children: [
|
|
2118
|
-
/* @__PURE__ */ J(he, { className: r("mr-control-gap size-icon-sm", n.includes(e.value) ? "opacity-100" : "opacity-0") }),
|
|
2119
|
-
!!e.icon && /* @__PURE__ */ J("span", {
|
|
2120
|
-
className: "mr-1.5",
|
|
2121
|
-
children: e.icon
|
|
2122
|
-
}),
|
|
2123
|
-
/* @__PURE__ */ J(o, {
|
|
2124
|
-
tag: "span",
|
|
2125
|
-
children: e.label
|
|
2126
|
-
})
|
|
2127
|
-
]
|
|
2128
|
-
}, e.value))] }) })]
|
|
2129
|
-
})
|
|
2130
|
-
})]
|
|
2131
|
-
})
|
|
2132
|
-
});
|
|
2133
|
-
}
|
|
2134
|
-
//#endregion
|
|
2135
|
-
//#region src/components/features/filters/facets/range-facet.tsx
|
|
2136
|
-
function Lt({ filter: e, value: t, onValueChange: n, className: i }) {
|
|
2137
|
-
let { strings: o } = $(), [s, c] = K(t.min?.toString() ?? ""), [d, f] = K(t.max?.toString() ?? ""), p = pe(), m = ce((e) => {
|
|
2138
|
-
(e.min !== t.min || e.max !== t.max) && n(e);
|
|
2139
|
-
}, e.delay ?? 300);
|
|
2140
|
-
return U(() => (m({
|
|
2141
|
-
min: s ? Number(s) : void 0,
|
|
2142
|
-
max: d ? Number(d) : void 0
|
|
2143
|
-
}), m.cancel), [
|
|
2144
|
-
s,
|
|
2145
|
-
d,
|
|
2146
|
-
m
|
|
2147
|
-
]), /* @__PURE__ */ J(u, {
|
|
2148
|
-
gap: "md",
|
|
2149
|
-
className: r("range-facet--component", i),
|
|
2150
|
-
children: /* @__PURE__ */ Y(l, {
|
|
2151
|
-
columns: {
|
|
2152
|
-
base: 1,
|
|
2153
|
-
sm: 2
|
|
2154
|
-
},
|
|
2155
|
-
gap: "md",
|
|
2156
|
-
children: [/* @__PURE__ */ Y(u, {
|
|
2157
|
-
gap: "xs",
|
|
2158
|
-
children: [/* @__PURE__ */ J(a, {
|
|
2159
|
-
htmlFor: `${p}-min`,
|
|
2160
|
-
className: "text-inherit",
|
|
2161
|
-
children: o.min
|
|
2162
|
-
}), /* @__PURE__ */ J(P, {
|
|
2163
|
-
id: `${p}-min`,
|
|
2164
|
-
type: "text",
|
|
2165
|
-
value: s,
|
|
2166
|
-
onChange: (e) => {
|
|
2167
|
-
let t = e.target.value;
|
|
2168
|
-
(t === "" || /^\d*\.?\d*$/.test(t)) && c(t);
|
|
2169
|
-
},
|
|
2170
|
-
placeholder: o.min,
|
|
2171
|
-
className: "w-full"
|
|
2172
|
-
})]
|
|
2173
|
-
}), /* @__PURE__ */ Y(u, {
|
|
2174
|
-
gap: "xs",
|
|
2175
|
-
children: [/* @__PURE__ */ J(a, {
|
|
2176
|
-
htmlFor: `${p}-max`,
|
|
2177
|
-
className: "text-inherit",
|
|
2178
|
-
children: o.max
|
|
2179
|
-
}), /* @__PURE__ */ J(P, {
|
|
2180
|
-
id: `${p}-max`,
|
|
2181
|
-
type: "text",
|
|
2182
|
-
value: d,
|
|
2183
|
-
onChange: (e) => {
|
|
2184
|
-
let t = e.target.value;
|
|
2185
|
-
(t === "" || /^\d*\.?\d*$/.test(t)) && f(t);
|
|
2186
|
-
},
|
|
2187
|
-
placeholder: o.max,
|
|
2188
|
-
className: "w-full"
|
|
2189
|
-
})]
|
|
2190
|
-
})]
|
|
2191
|
-
})
|
|
2192
|
-
});
|
|
2193
|
-
}
|
|
2194
|
-
//#endregion
|
|
2195
|
-
//#region src/components/features/filters/validators.ts
|
|
2196
|
-
function Rt(e) {
|
|
2197
|
-
return (t) => {
|
|
2198
|
-
if (t == null || typeof t == "string" && t.length === 0) return !0;
|
|
2199
|
-
let n = e.safeParse(t);
|
|
2200
|
-
return n.success ? !0 : n.error?.issues?.[0]?.message ?? n.error?.message ?? !1;
|
|
2201
|
-
};
|
|
2202
|
-
}
|
|
2203
|
-
function zt(e, t) {
|
|
2204
|
-
return (n) => e(n) ? !0 : t;
|
|
2205
|
-
}
|
|
2206
|
-
//#endregion
|
|
2207
|
-
export { Pe as A, ze as C, Me as D, Ne as E, Oe as F, Ee as I, De as L, ke as M, Q as N, Fe as O, Z as P, X as R, Be as S, $ as T, nt as _, Ft as a, Je as b, Nt as c, ht as d, ft as f, st as g, lt as h, It as i, Ae as j, je as k, yt as l, ut as m, Rt as n, Pt as o, dt as p, Lt as r, Mt as s, zt as t, gt as u, $e as v, Re as w, Ve as x, Xe as y };
|
|
2208
|
-
|
|
2209
|
-
//# sourceMappingURL=filters-BcT-uoFy.js.map
|