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
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
|
|
3
3
|
import { interpolateString as n, useStrings as r } from "../lib/strings.js";
|
|
4
|
-
import { t as i } from "../utils-
|
|
5
|
-
import { n as a } from "../buttons-
|
|
6
|
-
import { c as o, o as s } from "../typography-
|
|
4
|
+
import { t as i } from "../utils-DhuoqFy4.js";
|
|
5
|
+
import { n as a } from "../buttons-DeW0bQeK.js";
|
|
6
|
+
import { c as o, o as s } from "../typography-C7-YMW1S.js";
|
|
7
7
|
import { t as c } from "../focus-recipes-B653VaLq.js";
|
|
8
|
-
import { r as l, t as u } from "../structure-
|
|
8
|
+
import { r as l, t as u } from "../structure-DZJ2wbAU.js";
|
|
9
9
|
import { t as d } from "../tone-recipes-BPsRAvhu.js";
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { i as
|
|
14
|
-
import { t as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { n as
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { n as
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import { d as
|
|
24
|
-
import { c as
|
|
25
|
-
import { t as
|
|
26
|
-
import { n as
|
|
27
|
-
import { r as
|
|
28
|
-
import { c as
|
|
29
|
-
import { t as
|
|
30
|
-
import { c as
|
|
31
|
-
import { m as
|
|
32
|
-
import { O as
|
|
33
|
-
import { Fragment as
|
|
34
|
-
import { Fragment as
|
|
35
|
-
import { ArrowLeft as
|
|
10
|
+
import { h as f, p, t as m, v as h } from "../smart-card-B6vLxqa_.js";
|
|
11
|
+
import { t as g } from "../progress-DZFXXzPs.js";
|
|
12
|
+
import { n as _, t as v } from "../composition.recipes-COdiFhxB.js";
|
|
13
|
+
import { i as y, t as b } from "../overlays-CC8zI3Du.js";
|
|
14
|
+
import { t as x } from "../interaction-recipes-4wZ2tvfb.js";
|
|
15
|
+
import { _ as S, g as C } from "../primitives-BkkQjYl7.js";
|
|
16
|
+
import { n as w } from "../number-CYqBcrSj.js";
|
|
17
|
+
import { t as ee } from "../badge-wWauMgAt.js";
|
|
18
|
+
import { t as T } from "../batch-action-bar-BoqWIIpV.js";
|
|
19
|
+
import { t as E } from "../separator-DM6gs2vu.js";
|
|
20
|
+
import { n as D } from "../field-affordance-recipes-D6H7tVJi.js";
|
|
21
|
+
import { t as O } from "../input-7KAc7XQL.js";
|
|
22
|
+
import { t as k } from "../form-field-CAPdwdnZ.js";
|
|
23
|
+
import { d as te } from "../text-inputs-jdkS3ReG.js";
|
|
24
|
+
import { c as ne, l as re } from "../choice-inputs-DHGtx0QV.js";
|
|
25
|
+
import { t as ie } from "../checkbox-MoyHIAPs.js";
|
|
26
|
+
import { n as A } from "../display-CT_N2a3w.js";
|
|
27
|
+
import { r as ae, t as oe } from "../control-group-recipes-fMuFo0H7.js";
|
|
28
|
+
import { c as se, i as j, n as M, o as N, r as ce, t as P, u as F } from "../item-FfWnaYST.js";
|
|
29
|
+
import { t as I } from "../metadata-list-XkqZ_UXH.js";
|
|
30
|
+
import { c as L, i as le, n as ue, o as de, s as fe, t as pe } from "../table-CXSPHH25.js";
|
|
31
|
+
import { m as me, s as R } from "../data-display-Cmj-xZYl.js";
|
|
32
|
+
import { O as z, f as he } from "../table-CBonSdTp.js";
|
|
33
|
+
import { Fragment as ge, useCallback as B, useEffect as _e, useId as ve, useMemo as V, useRef as ye, useState as be } from "react";
|
|
34
|
+
import { Fragment as xe, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
35
|
+
import { ArrowLeft as Se, ChevronDown as W, Copy as Ce, Eye as G, ListFilter as K, Pencil as we, Plus as q, PlusCircle as Te, Search as Ee, SlidersHorizontal as De, Trash2 as J, X as Oe } from "lucide-react";
|
|
36
36
|
//#region src/components/features/products/products.strings.ts
|
|
37
|
-
var
|
|
37
|
+
var ke = {
|
|
38
38
|
title: "Readiness",
|
|
39
39
|
description: "Publishing checks and operational setup.",
|
|
40
40
|
scoreLabel: "Overall readiness",
|
|
@@ -46,7 +46,7 @@ var Ee = {
|
|
|
46
46
|
emptyTitle: "No readiness checks",
|
|
47
47
|
emptyDescription: "Pass readiness items from your product workflow to show progress.",
|
|
48
48
|
actionLabel: "Open"
|
|
49
|
-
},
|
|
49
|
+
}, Y = {
|
|
50
50
|
title: "Structure",
|
|
51
51
|
description: "Media, taxonomy, options, and content coverage.",
|
|
52
52
|
createLabel: "Add metric",
|
|
@@ -56,7 +56,7 @@ var Ee = {
|
|
|
56
56
|
actionsLabel: "Metric actions",
|
|
57
57
|
emptyTitle: "No structure metrics",
|
|
58
58
|
emptyDescription: "Pass structure metrics to summarize the product setup."
|
|
59
|
-
},
|
|
59
|
+
}, Ae = {
|
|
60
60
|
title: "Operations",
|
|
61
61
|
description: "Availability, channels, service rules, and fulfilment signals.",
|
|
62
62
|
createLabel: "Add signal",
|
|
@@ -66,13 +66,13 @@ var Ee = {
|
|
|
66
66
|
emptyTitle: "No operational signals",
|
|
67
67
|
emptyDescription: "Pass operational rows to show channel and availability health.",
|
|
68
68
|
actionLabel: "Open"
|
|
69
|
-
},
|
|
69
|
+
}, je = {
|
|
70
70
|
title: "Product details",
|
|
71
71
|
description: "Core identity and catalogue fields.",
|
|
72
72
|
editLabel: "Edit details",
|
|
73
73
|
emptyTitle: "No details",
|
|
74
74
|
emptyDescription: "Pass metadata rows to render product details."
|
|
75
|
-
},
|
|
75
|
+
}, Me = {
|
|
76
76
|
title: "Contract",
|
|
77
77
|
description: "Commercial terms, pricing rules, and customer-facing conditions.",
|
|
78
78
|
termsTitle: "Terms",
|
|
@@ -86,7 +86,7 @@ var Ee = {
|
|
|
86
86
|
ruleActionsLabel: "Rule actions",
|
|
87
87
|
emptyTitle: "No contract summary",
|
|
88
88
|
emptyDescription: "Pass metrics, terms, or rules to summarize the product contract."
|
|
89
|
-
},
|
|
89
|
+
}, X = {
|
|
90
90
|
title: "Options",
|
|
91
91
|
description: "Variant-driving choices and add-ons customers can select.",
|
|
92
92
|
manageLabel: "Manage options",
|
|
@@ -97,12 +97,12 @@ var Ee = {
|
|
|
97
97
|
actionsLabel: "Option actions",
|
|
98
98
|
emptyTitle: "No options",
|
|
99
99
|
emptyDescription: "Pass option groups to summarize configurable product choices."
|
|
100
|
-
},
|
|
100
|
+
}, Z = {
|
|
101
101
|
viewLabel: "Open option",
|
|
102
102
|
editLabel: "Edit option",
|
|
103
103
|
deleteLabel: "Delete option",
|
|
104
104
|
actionsLabel: "Option actions"
|
|
105
|
-
},
|
|
105
|
+
}, Ne = {
|
|
106
106
|
title: "Variant options",
|
|
107
107
|
description: "Define option groups and values before generating sellable variants.",
|
|
108
108
|
createLabel: "Add attribute",
|
|
@@ -114,11 +114,15 @@ var Ee = {
|
|
|
114
114
|
deleteValueLabel: "Delete value",
|
|
115
115
|
confirmDeleteOptionTitle: "Delete this option?",
|
|
116
116
|
confirmRemoveValuesTitle: "Save and remove these values?",
|
|
117
|
-
confirmRemoveValuesDescription: "Saving removes {count} value(s) from this option, and any variant built from them goes with it. This cannot be undone.",
|
|
117
|
+
confirmRemoveValuesDescription: "Saving removes {{count}} value(s) from this option, and any variant built from them goes with it. This cannot be undone.",
|
|
118
118
|
confirmRemoveValuesLabel: "Save changes",
|
|
119
119
|
confirmDeleteOptionDescription: "Its values are removed from the product, and any variant built from them goes with it. This cannot be undone.",
|
|
120
120
|
doneLabel: "Done",
|
|
121
121
|
saveLabel: "Save",
|
|
122
|
+
savingLabel: "Saving…",
|
|
123
|
+
saveErrorTitle: "Changes were not saved",
|
|
124
|
+
saveErrorMessage: "Your draft has been kept. Try again.",
|
|
125
|
+
retrySaveLabel: "Retry save",
|
|
122
126
|
cancelLabel: "Cancel",
|
|
123
127
|
expandOptionLabel: "Expand option",
|
|
124
128
|
collapseOptionLabel: "Collapse option",
|
|
@@ -132,7 +136,7 @@ var Ee = {
|
|
|
132
136
|
emptyTitle: "No option groups",
|
|
133
137
|
emptyDescription: "Add options such as size, color, or packaging to create variant combinations.",
|
|
134
138
|
noValuesLabel: "No values"
|
|
135
|
-
},
|
|
139
|
+
}, Pe = {
|
|
136
140
|
title: "Quote preview",
|
|
137
141
|
description: "How the product appears in a compact customer quote.",
|
|
138
142
|
subtotalLabel: "Subtotal",
|
|
@@ -147,7 +151,7 @@ var Ee = {
|
|
|
147
151
|
lineActionsLabel: "Line actions",
|
|
148
152
|
emptyTitle: "No quote lines",
|
|
149
153
|
emptyDescription: "Pass quote lines to preview pricing."
|
|
150
|
-
},
|
|
154
|
+
}, Fe = {
|
|
151
155
|
title: "Policies",
|
|
152
156
|
description: "Cancellation, booking, service, and customer-facing rules.",
|
|
153
157
|
createLabel: "Add policy",
|
|
@@ -157,7 +161,7 @@ var Ee = {
|
|
|
157
161
|
actionsLabel: "Policy actions",
|
|
158
162
|
emptyTitle: "No policies",
|
|
159
163
|
emptyDescription: "Pass policies to summarize customer-facing rules."
|
|
160
|
-
},
|
|
164
|
+
}, Ie = {
|
|
161
165
|
title: "Variants",
|
|
162
166
|
description: "Sellable combinations with price, availability, and SKU.",
|
|
163
167
|
createLabel: "Add variant",
|
|
@@ -176,7 +180,7 @@ var Ee = {
|
|
|
176
180
|
updated: "Updated",
|
|
177
181
|
actions: "Actions"
|
|
178
182
|
}
|
|
179
|
-
},
|
|
183
|
+
}, Le = {
|
|
180
184
|
title: "Variants",
|
|
181
185
|
description: "Review generated combinations, select rows, and apply bulk operations.",
|
|
182
186
|
createLabel: "Add variant",
|
|
@@ -204,7 +208,7 @@ var Ee = {
|
|
|
204
208
|
updated: "Updated",
|
|
205
209
|
actions: "Actions"
|
|
206
210
|
}
|
|
207
|
-
},
|
|
211
|
+
}, Q = {
|
|
208
212
|
title: "Variants",
|
|
209
213
|
description: "Configure option groups first, then manage the generated sellable variants.",
|
|
210
214
|
optionsTitle: "Variant options",
|
|
@@ -215,13 +219,13 @@ var Ee = {
|
|
|
215
219
|
generateLabel: "Generate variants",
|
|
216
220
|
createVariantLabel: "Add variant",
|
|
217
221
|
actionsLabel: "Variant manager actions"
|
|
218
|
-
},
|
|
222
|
+
}, Re = {
|
|
219
223
|
viewLabel: "Open variant",
|
|
220
224
|
editLabel: "Edit",
|
|
221
225
|
duplicateLabel: "Duplicate",
|
|
222
226
|
deleteLabel: "Delete",
|
|
223
227
|
actionsLabel: "Variant actions"
|
|
224
|
-
},
|
|
228
|
+
}, ze = {
|
|
225
229
|
title: "Variant",
|
|
226
230
|
description: "Sellable variant details, options, pricing, and fulfilment data.",
|
|
227
231
|
backLabel: "Back",
|
|
@@ -238,7 +242,7 @@ var Ee = {
|
|
|
238
242
|
channels: "Channels",
|
|
239
243
|
updated: "Updated"
|
|
240
244
|
}
|
|
241
|
-
},
|
|
245
|
+
}, Be = {
|
|
242
246
|
title: "Edit variant",
|
|
243
247
|
description: "Controlled form for variant identity, pricing, inventory, and option values.",
|
|
244
248
|
identityTitle: "Identity",
|
|
@@ -268,14 +272,14 @@ var Ee = {
|
|
|
268
272
|
status: "Active",
|
|
269
273
|
channels: "Online store, POS"
|
|
270
274
|
}
|
|
271
|
-
},
|
|
275
|
+
}, Ve = {
|
|
272
276
|
mainLabel: "Product overview",
|
|
273
277
|
railLabel: "Product supporting information"
|
|
274
278
|
};
|
|
275
279
|
//#endregion
|
|
276
280
|
//#region src/components/features/products/partials/product-empty-state.tsx
|
|
277
281
|
function $({ title: e, description: t, action: n, className: r }) {
|
|
278
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ H(R, {
|
|
279
283
|
padding: "md",
|
|
280
284
|
border: !0,
|
|
281
285
|
title: e,
|
|
@@ -286,34 +290,34 @@ function $({ title: e, description: t, action: n, className: r }) {
|
|
|
286
290
|
}
|
|
287
291
|
//#endregion
|
|
288
292
|
//#region src/components/features/products/partials/product-tone.tsx
|
|
289
|
-
var
|
|
293
|
+
var He = {
|
|
290
294
|
neutral: "secondary",
|
|
291
295
|
primary: "secondary",
|
|
292
296
|
success: "success",
|
|
293
297
|
warning: "warning",
|
|
294
298
|
destructive: "destructive",
|
|
295
299
|
info: "info"
|
|
296
|
-
},
|
|
300
|
+
}, Ue = {
|
|
297
301
|
neutral: void 0,
|
|
298
302
|
primary: void 0,
|
|
299
303
|
success: "text-success",
|
|
300
304
|
warning: "text-warning-accent",
|
|
301
305
|
destructive: "text-destructive",
|
|
302
306
|
info: "text-info"
|
|
303
|
-
},
|
|
307
|
+
}, We = /* @__PURE__ */ new Set([
|
|
304
308
|
"success",
|
|
305
309
|
"warning",
|
|
306
310
|
"destructive",
|
|
307
311
|
"info"
|
|
308
312
|
]);
|
|
309
|
-
function
|
|
310
|
-
return e !== void 0 &&
|
|
313
|
+
function Ge(e) {
|
|
314
|
+
return e !== void 0 && We.has(e);
|
|
311
315
|
}
|
|
312
|
-
function
|
|
316
|
+
function Ke(e) {
|
|
313
317
|
return Number.isFinite(e) ? Math.min(100, Math.max(0, Math.round(e))) : 0;
|
|
314
318
|
}
|
|
315
|
-
function
|
|
316
|
-
return /* @__PURE__ */
|
|
319
|
+
function qe({ tone: e = "neutral" }) {
|
|
320
|
+
return /* @__PURE__ */ H("span", {
|
|
317
321
|
"aria-hidden": "true",
|
|
318
322
|
className: i("product-tone-dot--component", d.marker, {
|
|
319
323
|
"bg-muted-foreground": e === "neutral" || e === "primary",
|
|
@@ -326,35 +330,35 @@ function We({ tone: e = "neutral" }) {
|
|
|
326
330
|
}
|
|
327
331
|
//#endregion
|
|
328
332
|
//#region src/components/features/products/partials/product-metric-tile.tsx
|
|
329
|
-
function
|
|
333
|
+
function Je({ metric: e }) {
|
|
330
334
|
let t = "icon" in e ? e.icon : void 0;
|
|
331
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ U(u, {
|
|
332
336
|
gap: "dense",
|
|
333
337
|
className: "product-metric-tile--component min-w-0",
|
|
334
338
|
children: [
|
|
335
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ U(u, {
|
|
336
340
|
direction: "horizontal",
|
|
337
341
|
gap: "sm",
|
|
338
342
|
wrap: !1,
|
|
339
343
|
children: [
|
|
340
|
-
|
|
341
|
-
!!t && /* @__PURE__ */
|
|
344
|
+
Ge(e.tone) && /* @__PURE__ */ H(qe, { tone: e.tone }),
|
|
345
|
+
!!t && /* @__PURE__ */ H("span", {
|
|
342
346
|
className: "flex shrink-0 text-muted-foreground",
|
|
343
347
|
children: t
|
|
344
348
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ H(s, {
|
|
346
350
|
className: "truncate text-inherit",
|
|
347
351
|
children: e.label
|
|
348
352
|
})
|
|
349
353
|
]
|
|
350
354
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ H(S, {
|
|
352
356
|
type: "inherit",
|
|
353
357
|
weight: "semibold",
|
|
354
358
|
className: "tabular-nums",
|
|
355
359
|
children: e.value
|
|
356
360
|
}),
|
|
357
|
-
!!e.description && /* @__PURE__ */
|
|
361
|
+
!!e.description && /* @__PURE__ */ H(o, {
|
|
358
362
|
size: "xs",
|
|
359
363
|
type: "secondary",
|
|
360
364
|
lineHeight: "snug",
|
|
@@ -365,10 +369,10 @@ function Ge({ metric: e }) {
|
|
|
365
369
|
}
|
|
366
370
|
//#endregion
|
|
367
371
|
//#region src/components/features/products/partials/product-actions.tsx
|
|
368
|
-
function
|
|
369
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
|
372
|
+
function Ye({ item: e, actions: t, menuLabel: n, className: r }) {
|
|
373
|
+
return t.length === 0 ? null : /* @__PURE__ */ H("div", {
|
|
370
374
|
className: i("product-row-actions--component flex justify-end", r),
|
|
371
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ H(z, {
|
|
372
376
|
row: e,
|
|
373
377
|
actions: t,
|
|
374
378
|
menuLabel: n,
|
|
@@ -378,22 +382,22 @@ function Ke({ item: e, actions: t, menuLabel: n, className: r }) {
|
|
|
378
382
|
}
|
|
379
383
|
//#endregion
|
|
380
384
|
//#region src/components/features/products/partials/product-rows.tsx
|
|
381
|
-
var
|
|
382
|
-
function
|
|
383
|
-
let i = /* @__PURE__ */
|
|
384
|
-
className:
|
|
385
|
+
var Xe = "min-w-0 basis-48", Ze = "line-clamp-none break-words overflow-visible", Qe = "ml-auto shrink-0 flex-wrap justify-end gap-space-md";
|
|
386
|
+
function $e({ label: e, value: t, tone: n, badge: r }) {
|
|
387
|
+
let i = /* @__PURE__ */ H(F, {
|
|
388
|
+
className: Ze,
|
|
385
389
|
children: e
|
|
386
390
|
});
|
|
387
|
-
return !t && !r ? i : /* @__PURE__ */
|
|
391
|
+
return !t && !r ? i : /* @__PURE__ */ U(u, {
|
|
388
392
|
direction: "horizontal",
|
|
389
393
|
gap: "sm",
|
|
390
394
|
className: "product-row--heading",
|
|
391
395
|
children: [
|
|
392
396
|
i,
|
|
393
|
-
!!t && (
|
|
394
|
-
tone:
|
|
397
|
+
!!t && (Ge(n) ? /* @__PURE__ */ H(ee, {
|
|
398
|
+
tone: He[n],
|
|
395
399
|
children: t
|
|
396
|
-
}) : /* @__PURE__ */
|
|
400
|
+
}) : /* @__PURE__ */ H(o, {
|
|
397
401
|
tag: "span",
|
|
398
402
|
type: "secondary",
|
|
399
403
|
lineHeight: "tight",
|
|
@@ -403,8 +407,8 @@ function Xe({ label: e, value: t, tone: n, badge: r }) {
|
|
|
403
407
|
]
|
|
404
408
|
});
|
|
405
409
|
}
|
|
406
|
-
function
|
|
407
|
-
return /* @__PURE__ */
|
|
410
|
+
function et({ label: e, onSelect: t }) {
|
|
411
|
+
return /* @__PURE__ */ H(a, {
|
|
408
412
|
type: "button",
|
|
409
413
|
tone: "secondary",
|
|
410
414
|
buttonStyle: "ghost",
|
|
@@ -412,60 +416,60 @@ function Ze({ label: e, onSelect: t }) {
|
|
|
412
416
|
children: e
|
|
413
417
|
});
|
|
414
418
|
}
|
|
415
|
-
function
|
|
416
|
-
return /* @__PURE__ */
|
|
419
|
+
function tt({ metric: e, actions: t }) {
|
|
420
|
+
return /* @__PURE__ */ U(P, {
|
|
417
421
|
className: "product-structure-metric-row--component product-structure-card--item",
|
|
418
422
|
children: [
|
|
419
|
-
!!e.icon && /* @__PURE__ */
|
|
423
|
+
!!e.icon && /* @__PURE__ */ H(se, {
|
|
420
424
|
variant: "icon",
|
|
421
425
|
className: "text-muted-foreground",
|
|
422
426
|
children: e.icon
|
|
423
427
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
className:
|
|
426
|
-
children: [/* @__PURE__ */
|
|
427
|
-
className:
|
|
428
|
+
/* @__PURE__ */ U(ce, {
|
|
429
|
+
className: Xe,
|
|
430
|
+
children: [/* @__PURE__ */ H(F, {
|
|
431
|
+
className: Ze,
|
|
428
432
|
children: e.label
|
|
429
|
-
}), !!e.description && /* @__PURE__ */
|
|
433
|
+
}), !!e.description && /* @__PURE__ */ H(j, {
|
|
430
434
|
clamp: 2,
|
|
431
435
|
children: e.description
|
|
432
436
|
})]
|
|
433
437
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ U(M, {
|
|
435
439
|
className: "ml-auto shrink-0 gap-space-md",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ H(S, {
|
|
437
441
|
type: "inherit",
|
|
438
442
|
weight: "semibold",
|
|
439
|
-
className: i("tabular-nums", e.tone &&
|
|
443
|
+
className: i("tabular-nums", e.tone && Ue[e.tone]),
|
|
440
444
|
children: e.value
|
|
441
445
|
}), t]
|
|
442
446
|
})
|
|
443
447
|
]
|
|
444
448
|
});
|
|
445
449
|
}
|
|
446
|
-
function
|
|
450
|
+
function nt({ item: e, actionFallback: t, onSelect: n, actions: r }) {
|
|
447
451
|
let i = e.tone ?? (e.completed ? "success" : "neutral"), a = e.onSelect ?? n;
|
|
448
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ U(P, {
|
|
449
453
|
className: "product-readiness-row--component product-readiness-card--item",
|
|
450
454
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ H(se, {
|
|
452
456
|
className: "product-readiness-row--state h-icon-lg",
|
|
453
|
-
children: /* @__PURE__ */
|
|
457
|
+
children: /* @__PURE__ */ H(qe, { tone: i })
|
|
454
458
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
className:
|
|
457
|
-
children: [/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ U(ce, {
|
|
460
|
+
className: Xe,
|
|
461
|
+
children: [/* @__PURE__ */ H($e, {
|
|
458
462
|
label: e.label,
|
|
459
463
|
value: e.value,
|
|
460
464
|
tone: e.tone
|
|
461
|
-
}), !!e.description && /* @__PURE__ */
|
|
465
|
+
}), !!e.description && /* @__PURE__ */ H(j, {
|
|
462
466
|
clamp: 2,
|
|
463
467
|
children: e.description
|
|
464
468
|
})]
|
|
465
469
|
}),
|
|
466
|
-
!!(a || r) && /* @__PURE__ */
|
|
467
|
-
className:
|
|
468
|
-
children: [!!a && /* @__PURE__ */
|
|
470
|
+
!!(a || r) && /* @__PURE__ */ U(M, {
|
|
471
|
+
className: Qe,
|
|
472
|
+
children: [!!a && /* @__PURE__ */ H(et, {
|
|
469
473
|
label: e.actionLabel ?? t,
|
|
470
474
|
onSelect: a
|
|
471
475
|
}), r]
|
|
@@ -473,57 +477,57 @@ function $e({ item: e, actionFallback: t, onSelect: n, actions: r }) {
|
|
|
473
477
|
]
|
|
474
478
|
});
|
|
475
479
|
}
|
|
476
|
-
function
|
|
480
|
+
function rt({ item: e, actionFallback: t, onSelect: n, actions: r }) {
|
|
477
481
|
let i = e.onSelect ?? n;
|
|
478
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ U(P, {
|
|
479
483
|
className: "product-operation-row--component product-operations-card--item",
|
|
480
|
-
children: [/* @__PURE__ */
|
|
481
|
-
className:
|
|
482
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ U(ce, {
|
|
485
|
+
className: Xe,
|
|
486
|
+
children: [/* @__PURE__ */ H($e, {
|
|
483
487
|
label: e.label,
|
|
484
488
|
value: e.value,
|
|
485
489
|
tone: e.tone
|
|
486
|
-
}), !!e.description && /* @__PURE__ */
|
|
490
|
+
}), !!e.description && /* @__PURE__ */ H(j, {
|
|
487
491
|
clamp: 2,
|
|
488
492
|
children: e.description
|
|
489
493
|
})]
|
|
490
|
-
}), !!(i || r) && /* @__PURE__ */
|
|
491
|
-
className:
|
|
492
|
-
children: [!!i && /* @__PURE__ */
|
|
494
|
+
}), !!(i || r) && /* @__PURE__ */ U(M, {
|
|
495
|
+
className: Qe,
|
|
496
|
+
children: [!!i && /* @__PURE__ */ H(et, {
|
|
493
497
|
label: e.actionLabel ?? t,
|
|
494
498
|
onSelect: i
|
|
495
499
|
}), r]
|
|
496
500
|
})]
|
|
497
501
|
});
|
|
498
502
|
}
|
|
499
|
-
function
|
|
503
|
+
function it({ item: e, actionLabel: t, onSelect: n, actions: r }) {
|
|
500
504
|
let i = "values" in e ? e.values : void 0;
|
|
501
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ U(P, {
|
|
502
506
|
className: "product-summary-row--component",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
504
|
-
className:
|
|
507
|
+
children: [/* @__PURE__ */ U(ce, {
|
|
508
|
+
className: Xe,
|
|
505
509
|
children: [
|
|
506
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ H($e, {
|
|
507
511
|
label: e.label,
|
|
508
512
|
value: e.value,
|
|
509
513
|
tone: e.tone,
|
|
510
514
|
badge: e.badge
|
|
511
515
|
}),
|
|
512
|
-
!!e.description && /* @__PURE__ */
|
|
516
|
+
!!e.description && /* @__PURE__ */ H(j, {
|
|
513
517
|
clamp: 2,
|
|
514
518
|
children: e.description
|
|
515
519
|
}),
|
|
516
|
-
!!i?.length && /* @__PURE__ */
|
|
520
|
+
!!i?.length && /* @__PURE__ */ H("div", {
|
|
517
521
|
className: "mt-space-md flex flex-wrap gap-space-xs",
|
|
518
|
-
children: i.map((e, t) => /* @__PURE__ */
|
|
522
|
+
children: i.map((e, t) => /* @__PURE__ */ H(ee, {
|
|
519
523
|
tone: "secondary",
|
|
520
524
|
children: e
|
|
521
525
|
}, t))
|
|
522
526
|
})
|
|
523
527
|
]
|
|
524
|
-
}), !!(n || r) && /* @__PURE__ */
|
|
525
|
-
className:
|
|
526
|
-
children: [!!n && /* @__PURE__ */
|
|
528
|
+
}), !!(n || r) && /* @__PURE__ */ U(M, {
|
|
529
|
+
className: Qe,
|
|
530
|
+
children: [!!n && /* @__PURE__ */ H(et, {
|
|
527
531
|
label: t,
|
|
528
532
|
onSelect: n
|
|
529
533
|
}), r]
|
|
@@ -532,26 +536,26 @@ function tt({ item: e, actionLabel: t, onSelect: n, actions: r }) {
|
|
|
532
536
|
}
|
|
533
537
|
//#endregion
|
|
534
538
|
//#region src/components/features/products/components/product-contract-overview.tsx
|
|
535
|
-
function
|
|
536
|
-
let x = r(
|
|
539
|
+
function at({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s, onEditContract: c, onCreateRule: d, onSelectRule: f, onEditRule: p, onDeleteRule: m, renderRuleActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
|
|
540
|
+
let x = r(Me, b), S = e.length > 0 || t.length > 0 || n.length > 0, C = s || c || d ? /* @__PURE__ */ U("div", {
|
|
537
541
|
className: "flex items-center gap-space-md",
|
|
538
542
|
children: [
|
|
539
|
-
!!d && /* @__PURE__ */
|
|
543
|
+
!!d && /* @__PURE__ */ H(a, {
|
|
540
544
|
type: "button",
|
|
541
545
|
tone: "secondary",
|
|
542
546
|
buttonStyle: "ghost",
|
|
543
547
|
onClick: d,
|
|
544
|
-
icon:
|
|
548
|
+
icon: q,
|
|
545
549
|
children: x.createRuleLabel
|
|
546
550
|
}),
|
|
547
|
-
!!c && /* @__PURE__ */
|
|
551
|
+
!!c && /* @__PURE__ */ H(a, {
|
|
548
552
|
type: "button",
|
|
549
553
|
tone: "secondary",
|
|
550
554
|
buttonStyle: "ghost",
|
|
551
555
|
onClick: c,
|
|
552
556
|
children: x.editLabel
|
|
553
557
|
}),
|
|
554
|
-
!!s && /* @__PURE__ */
|
|
558
|
+
!!s && /* @__PURE__ */ H(a, {
|
|
555
559
|
type: "button",
|
|
556
560
|
tone: "secondary",
|
|
557
561
|
buttonStyle: "ghost",
|
|
@@ -560,49 +564,49 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
|
|
|
560
564
|
})
|
|
561
565
|
]
|
|
562
566
|
}) : void 0;
|
|
563
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ H(A, {
|
|
564
568
|
title: x.title,
|
|
565
569
|
description: x.description,
|
|
566
570
|
actions: g,
|
|
567
571
|
headerAction: C,
|
|
568
572
|
footerSlot: _,
|
|
569
573
|
className: i("product-contract-overview--component w-full", y),
|
|
570
|
-
children: S ? /* @__PURE__ */
|
|
574
|
+
children: S ? /* @__PURE__ */ U(u, {
|
|
571
575
|
gap: "2xl",
|
|
572
576
|
children: [
|
|
573
|
-
e.length > 0 && /* @__PURE__ */
|
|
577
|
+
e.length > 0 && /* @__PURE__ */ H(l, {
|
|
574
578
|
columns: {
|
|
575
579
|
base: 1,
|
|
576
580
|
sm: 3
|
|
577
581
|
},
|
|
578
582
|
gap: "md",
|
|
579
|
-
children: e.map((e) => /* @__PURE__ */
|
|
583
|
+
children: e.map((e) => /* @__PURE__ */ H(Je, { metric: e }, e.id))
|
|
580
584
|
}),
|
|
581
|
-
t.length > 0 && /* @__PURE__ */
|
|
585
|
+
t.length > 0 && /* @__PURE__ */ U(u, {
|
|
582
586
|
gap: "md",
|
|
583
|
-
children: [/* @__PURE__ */
|
|
587
|
+
children: [/* @__PURE__ */ H(o, {
|
|
584
588
|
type: "inherit",
|
|
585
589
|
weight: "semibold",
|
|
586
590
|
children: x.termsTitle
|
|
587
|
-
}), /* @__PURE__ */
|
|
591
|
+
}), /* @__PURE__ */ H(I, {
|
|
588
592
|
adaptTo: "container",
|
|
589
593
|
items: t,
|
|
590
594
|
columns: 2,
|
|
591
595
|
density: "compact"
|
|
592
596
|
})]
|
|
593
597
|
}),
|
|
594
|
-
n.length > 0 && /* @__PURE__ */
|
|
598
|
+
n.length > 0 && /* @__PURE__ */ U(u, {
|
|
595
599
|
gap: "md",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ H(o, {
|
|
597
601
|
type: "inherit",
|
|
598
602
|
weight: "semibold",
|
|
599
603
|
children: x.rulesTitle
|
|
600
|
-
}), /* @__PURE__ */
|
|
604
|
+
}), /* @__PURE__ */ H(N, { children: n.map((e, t) => {
|
|
601
605
|
let n = f ? () => f(e) : void 0, r = p ? () => p(e) : void 0, i = m ? () => m(e) : void 0, a = [
|
|
602
606
|
...n ? [{
|
|
603
607
|
id: "open",
|
|
604
608
|
label: x.viewRuleLabel,
|
|
605
|
-
icon: /* @__PURE__ */
|
|
609
|
+
icon: /* @__PURE__ */ H(G, { className: "size-icon-md" }),
|
|
606
610
|
onClick: () => n(),
|
|
607
611
|
tone: "secondary",
|
|
608
612
|
buttonStyle: "ghost"
|
|
@@ -610,7 +614,7 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
|
|
|
610
614
|
...r ? [{
|
|
611
615
|
id: "edit",
|
|
612
616
|
label: x.editRuleLabel,
|
|
613
|
-
icon: /* @__PURE__ */
|
|
617
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
614
618
|
onClick: () => r(),
|
|
615
619
|
tone: "secondary",
|
|
616
620
|
buttonStyle: "ghost"
|
|
@@ -618,7 +622,7 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
|
|
|
618
622
|
...i ? [{
|
|
619
623
|
id: "delete",
|
|
620
624
|
label: x.deleteRuleLabel,
|
|
621
|
-
icon: /* @__PURE__ */
|
|
625
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
622
626
|
onClick: () => i(),
|
|
623
627
|
tone: "destructive"
|
|
624
628
|
}] : []
|
|
@@ -627,43 +631,43 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
|
|
|
627
631
|
onSelect: n,
|
|
628
632
|
onEdit: r,
|
|
629
633
|
onDelete: i
|
|
630
|
-
}) : /* @__PURE__ */
|
|
634
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
631
635
|
item: e,
|
|
632
636
|
actions: a,
|
|
633
637
|
menuLabel: x.ruleActionsLabel
|
|
634
638
|
});
|
|
635
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ H(it, {
|
|
636
640
|
item: e,
|
|
637
641
|
actions: o
|
|
638
642
|
}, e.id);
|
|
639
643
|
}) })]
|
|
640
644
|
})
|
|
641
645
|
]
|
|
642
|
-
}) : v ?? /* @__PURE__ */
|
|
646
|
+
}) : v ?? /* @__PURE__ */ H($, {
|
|
643
647
|
title: x.emptyTitle,
|
|
644
648
|
description: x.emptyDescription,
|
|
645
|
-
action: d ? /* @__PURE__ */
|
|
649
|
+
action: d ? /* @__PURE__ */ H(a, {
|
|
646
650
|
tone: "primary",
|
|
647
651
|
type: "button",
|
|
648
652
|
onClick: d,
|
|
649
|
-
icon:
|
|
653
|
+
icon: q,
|
|
650
654
|
children: x.createRuleLabel
|
|
651
655
|
}) : void 0
|
|
652
656
|
})
|
|
653
657
|
});
|
|
654
658
|
}
|
|
655
|
-
|
|
659
|
+
at.displayName = "ProductContractOverview";
|
|
656
660
|
//#endregion
|
|
657
661
|
//#region src/components/features/products/components/product-details-card.tsx
|
|
658
|
-
function
|
|
659
|
-
let m = r(
|
|
662
|
+
function ot({ title: e, description: t, metadata: n = [], media: o, onEditDetails: s, actions: c, headerEnd: l, footerSlot: u, empty: d, className: f, strings: p }) {
|
|
663
|
+
let m = r(je, p), h = s ? /* @__PURE__ */ H(a, {
|
|
660
664
|
type: "button",
|
|
661
665
|
tone: "secondary",
|
|
662
666
|
buttonStyle: "ghost",
|
|
663
667
|
onClick: s,
|
|
664
668
|
children: m.editLabel
|
|
665
669
|
}) : void 0;
|
|
666
|
-
return /* @__PURE__ */
|
|
670
|
+
return /* @__PURE__ */ H(A, {
|
|
667
671
|
title: e ?? m.title,
|
|
668
672
|
description: t === !1 ? void 0 : t ?? m.description,
|
|
669
673
|
actions: c,
|
|
@@ -671,17 +675,17 @@ function rt({ title: e, description: t, metadata: n = [], media: o, onEditDetail
|
|
|
671
675
|
headerEnd: l,
|
|
672
676
|
footerSlot: u,
|
|
673
677
|
className: i("product-details-card--component w-full", f),
|
|
674
|
-
children: n.length === 0 ? d ?? /* @__PURE__ */
|
|
678
|
+
children: n.length === 0 && !o ? d ?? /* @__PURE__ */ H($, {
|
|
675
679
|
title: m.emptyTitle,
|
|
676
680
|
description: m.emptyDescription
|
|
677
|
-
}) : /* @__PURE__ */
|
|
681
|
+
}) : /* @__PURE__ */ H("div", {
|
|
678
682
|
className: "@container/product-details",
|
|
679
|
-
children: /* @__PURE__ */
|
|
680
|
-
className: i("grid min-w-0 grid-cols-1 gap-space-xl", o && "@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]"),
|
|
681
|
-
children: [!!o && /* @__PURE__ */
|
|
682
|
-
className: "product-details-card--media self-start overflow-hidden rounded-
|
|
683
|
+
children: /* @__PURE__ */ U("div", {
|
|
684
|
+
className: i("grid min-w-0 grid-cols-1 gap-space-xl", o && n.length > 0 && "@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]"),
|
|
685
|
+
children: [!!o && /* @__PURE__ */ H("div", {
|
|
686
|
+
className: "product-details-card--media self-start overflow-hidden rounded-radius border border-border bg-muted/30",
|
|
683
687
|
children: o
|
|
684
|
-
}), /* @__PURE__ */
|
|
688
|
+
}), n.length > 0 && /* @__PURE__ */ H(I, {
|
|
685
689
|
adaptTo: "container",
|
|
686
690
|
items: n,
|
|
687
691
|
columns: o ? 1 : 2,
|
|
@@ -692,12 +696,12 @@ function rt({ title: e, description: t, metadata: n = [], media: o, onEditDetail
|
|
|
692
696
|
})
|
|
693
697
|
});
|
|
694
698
|
}
|
|
695
|
-
|
|
699
|
+
ot.displayName = "ProductDetailsCard";
|
|
696
700
|
//#endregion
|
|
697
701
|
//#region src/components/features/products/components/product-option-action-menu.tsx
|
|
698
|
-
function
|
|
699
|
-
let d = r(
|
|
700
|
-
return f || p || m || s ? s ? /* @__PURE__ */
|
|
702
|
+
function st({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDeleteOption: o, renderOptionActions: s, menuLabel: c, className: l, strings: u }) {
|
|
703
|
+
let d = r(Z, u), f = n ? () => n(e) : void 0, p = a ? () => a(e) : void 0, m = o ? () => o(e) : void 0;
|
|
704
|
+
return f || p || m || s ? s ? /* @__PURE__ */ H("div", {
|
|
701
705
|
className: i("product-option-action-menu--component flex justify-end", l),
|
|
702
706
|
children: s(e, {
|
|
703
707
|
index: t,
|
|
@@ -705,7 +709,7 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
|
|
|
705
709
|
onEdit: p,
|
|
706
710
|
onDelete: m
|
|
707
711
|
})
|
|
708
|
-
}) : /* @__PURE__ */
|
|
712
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
709
713
|
item: e,
|
|
710
714
|
menuLabel: c ?? d.actionsLabel,
|
|
711
715
|
className: i("product-option-action-menu--component", l),
|
|
@@ -713,7 +717,7 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
|
|
|
713
717
|
...f ? [{
|
|
714
718
|
id: "open",
|
|
715
719
|
label: d.viewLabel,
|
|
716
|
-
icon: /* @__PURE__ */
|
|
720
|
+
icon: /* @__PURE__ */ H(G, { className: "size-icon-md" }),
|
|
717
721
|
onClick: () => f(),
|
|
718
722
|
tone: "secondary",
|
|
719
723
|
buttonStyle: "ghost"
|
|
@@ -721,7 +725,7 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
|
|
|
721
725
|
...p ? [{
|
|
722
726
|
id: "edit",
|
|
723
727
|
label: d.editLabel,
|
|
724
|
-
icon: /* @__PURE__ */
|
|
728
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
725
729
|
onClick: () => p(),
|
|
726
730
|
tone: "secondary",
|
|
727
731
|
buttonStyle: "ghost"
|
|
@@ -729,54 +733,54 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
|
|
|
729
733
|
...m ? [{
|
|
730
734
|
id: "delete",
|
|
731
735
|
label: d.deleteLabel,
|
|
732
|
-
icon: /* @__PURE__ */
|
|
736
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
733
737
|
onClick: () => m(),
|
|
734
738
|
tone: "destructive"
|
|
735
739
|
}] : []
|
|
736
740
|
]
|
|
737
741
|
}) : null;
|
|
738
742
|
}
|
|
739
|
-
|
|
743
|
+
st.displayName = "ProductOptionActionMenu";
|
|
740
744
|
//#endregion
|
|
741
745
|
//#region src/components/features/products/components/product-operations-card.tsx
|
|
742
|
-
function
|
|
743
|
-
let h = r(
|
|
746
|
+
function ct({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditOperation: o, onDeleteOperation: s, renderOperationActions: c, actions: l, footerSlot: u, renderItem: d, empty: f, className: p, strings: m }) {
|
|
747
|
+
let h = r(Ae, m), g = t ? /* @__PURE__ */ H(a, {
|
|
744
748
|
type: "button",
|
|
745
749
|
tone: "secondary",
|
|
746
750
|
buttonStyle: "ghost",
|
|
747
751
|
onClick: t,
|
|
748
|
-
icon:
|
|
752
|
+
icon: q,
|
|
749
753
|
children: h.createLabel
|
|
750
754
|
}) : void 0;
|
|
751
|
-
return /* @__PURE__ */
|
|
755
|
+
return /* @__PURE__ */ H(A, {
|
|
752
756
|
title: h.title,
|
|
753
757
|
description: h.description,
|
|
754
758
|
actions: l,
|
|
755
759
|
headerAction: g,
|
|
756
760
|
footerSlot: u,
|
|
757
761
|
className: i("product-operations-card--component w-full", p),
|
|
758
|
-
children: e.length === 0 ? f ?? /* @__PURE__ */
|
|
762
|
+
children: e.length === 0 ? f ?? /* @__PURE__ */ H($, {
|
|
759
763
|
title: h.emptyTitle,
|
|
760
764
|
description: h.emptyDescription,
|
|
761
|
-
action: t ? /* @__PURE__ */
|
|
765
|
+
action: t ? /* @__PURE__ */ H(a, {
|
|
762
766
|
tone: "primary",
|
|
763
767
|
type: "button",
|
|
764
768
|
onClick: t,
|
|
765
|
-
icon:
|
|
769
|
+
icon: q,
|
|
766
770
|
children: h.createLabel
|
|
767
771
|
}) : void 0
|
|
768
|
-
}) : /* @__PURE__ */
|
|
772
|
+
}) : /* @__PURE__ */ H(N, { children: e.map((e, t) => {
|
|
769
773
|
let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [...i ? [{
|
|
770
774
|
id: "edit",
|
|
771
775
|
label: h.editLabel,
|
|
772
|
-
icon: /* @__PURE__ */
|
|
776
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
773
777
|
onClick: () => i(),
|
|
774
778
|
tone: "secondary",
|
|
775
779
|
buttonStyle: "ghost"
|
|
776
780
|
}] : [], ...a ? [{
|
|
777
781
|
id: "delete",
|
|
778
782
|
label: h.deleteLabel,
|
|
779
|
-
icon: /* @__PURE__ */
|
|
783
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
780
784
|
onClick: () => a(),
|
|
781
785
|
tone: "destructive"
|
|
782
786
|
}] : []], u = c ? c(e, {
|
|
@@ -784,12 +788,12 @@ function at({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditO
|
|
|
784
788
|
onSelect: r,
|
|
785
789
|
onEdit: i,
|
|
786
790
|
onDelete: a
|
|
787
|
-
}) : /* @__PURE__ */
|
|
791
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
788
792
|
item: e,
|
|
789
793
|
actions: l,
|
|
790
794
|
menuLabel: h.actionsLabel
|
|
791
795
|
});
|
|
792
|
-
return d ? /* @__PURE__ */
|
|
796
|
+
return d ? /* @__PURE__ */ H("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ H(rt, {
|
|
793
797
|
item: e,
|
|
794
798
|
actionFallback: h.actionLabel,
|
|
795
799
|
onSelect: r,
|
|
@@ -798,350 +802,389 @@ function at({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditO
|
|
|
798
802
|
}) })
|
|
799
803
|
});
|
|
800
804
|
}
|
|
801
|
-
|
|
805
|
+
ct.displayName = "ProductOperationsCard";
|
|
802
806
|
//#endregion
|
|
803
807
|
//#region src/components/features/products/components/product-options-matrix.tsx
|
|
804
|
-
function
|
|
805
|
-
return
|
|
808
|
+
function lt(e) {
|
|
809
|
+
return ut(e) ? String(e) : "";
|
|
806
810
|
}
|
|
807
|
-
function
|
|
811
|
+
function ut(e) {
|
|
808
812
|
return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
|
|
809
813
|
}
|
|
810
|
-
function
|
|
811
|
-
let n =
|
|
814
|
+
function dt(e, t) {
|
|
815
|
+
let n = lt(t.name);
|
|
812
816
|
return n ? `${e}: ${n}` : e;
|
|
813
817
|
}
|
|
814
|
-
function
|
|
818
|
+
function ft(e) {
|
|
815
819
|
return {
|
|
816
|
-
name:
|
|
817
|
-
values: (e.values ?? []).map((e) => ({
|
|
818
|
-
...e,
|
|
819
|
-
label: ot(e.label)
|
|
820
|
-
}))
|
|
820
|
+
name: lt(e.name),
|
|
821
|
+
values: (e.values ?? []).map((e) => ({ ...e }))
|
|
821
822
|
};
|
|
822
823
|
}
|
|
823
|
-
function
|
|
824
|
-
let R = r(
|
|
825
|
-
|
|
824
|
+
function pt({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s, defaultCollapsedOptionIds: l = [], onCollapsedOptionIdsChange: d, editingOptionId: m, defaultEditingOptionId: g, onEditingOptionIdChange: _, onCreateOption: S, onEditOption: C, onDeleteOption: w, confirmDelete: T, onAddValue: E, onDeleteValue: te, onOptionNameChange: re, onValueLabelChange: ie, onDoneEditingOption: ae, onSaveEditingOption: oe, onError: se, onCancelEditingOption: j, onToggleUsedForVariants: M, renderOptionActions: N, renderValue: ce, showHeader: P, showCollapseControls: F = !0, showInlineActions: I = !0, showVariantToggle: L = !0, actions: le, headerEnd: ue, footerSlot: de, empty: fe, className: pe, strings: me }) {
|
|
825
|
+
let R = r(Ne, me), z = s !== void 0, [he, ve] = be(l), Se = z ? s : he, Ce = V(() => new Set(Se), [Se]), G = m !== void 0 || g !== void 0 || !!_ || !!re || !!ie || !!ae || !!oe || !!j, K = m !== void 0, [we, Ee] = be(g ?? null), [De, ke] = be({}), Y = ye(!1), Ae = ye(!0), [je, Me] = be(null), [X, Z] = be(null), Pe = ye(null), Fe = ye(0), Ie = ye(null), Le = B((e) => {
|
|
826
|
+
e && (e.focus(), Ie.current = null);
|
|
827
|
+
}, []), Q = je !== null;
|
|
828
|
+
_e(() => (Ae.current = !0, () => {
|
|
829
|
+
Ae.current = !1;
|
|
830
|
+
}), []);
|
|
831
|
+
let Re = G ? K ? m : we : null, ze = e.length > 0, Be = t === "embedded" && P !== !1, Ve = ze && !!S, He = B((t) => {
|
|
832
|
+
z || ve(t), d?.(t, e.filter((e) => t.includes(e.id)));
|
|
826
833
|
}, [
|
|
827
|
-
|
|
834
|
+
z,
|
|
828
835
|
d,
|
|
829
836
|
e
|
|
830
|
-
]),
|
|
831
|
-
|
|
832
|
-
|
|
837
|
+
]), Ue = B((e) => {
|
|
838
|
+
if (Y.current) return;
|
|
839
|
+
let t = Ce.has(e.id) ? Se.filter((t) => t !== e.id) : [...Se, e.id];
|
|
840
|
+
He(t);
|
|
833
841
|
}, [
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
]),
|
|
838
|
-
|
|
842
|
+
Ce,
|
|
843
|
+
Se,
|
|
844
|
+
He
|
|
845
|
+
]), We = B((e, t) => {
|
|
846
|
+
G && (K || Ee(e), _?.(e, t));
|
|
839
847
|
}, [
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
]),
|
|
844
|
-
|
|
848
|
+
K,
|
|
849
|
+
_,
|
|
850
|
+
G
|
|
851
|
+
]), Ge = B((e) => {
|
|
852
|
+
Y.current || (G && ut(e.name) && (Z(null), ke((t) => ({
|
|
845
853
|
...t,
|
|
846
|
-
[e.id]:
|
|
847
|
-
})),
|
|
848
|
-
}, [
|
|
849
|
-
|
|
854
|
+
[e.id]: ft(e)
|
|
855
|
+
})), We(e.id, e)), C?.(e));
|
|
856
|
+
}, [
|
|
857
|
+
C,
|
|
858
|
+
G,
|
|
859
|
+
We
|
|
860
|
+
]), Ke = B((e) => De[e.id] ?? ft(e), [De]), qe = B((e, t) => {
|
|
861
|
+
Y.current || ke((n) => ({
|
|
850
862
|
...n,
|
|
851
|
-
[e.id]: t(n[e.id] ??
|
|
863
|
+
[e.id]: t(n[e.id] ?? ft(e))
|
|
852
864
|
}));
|
|
853
|
-
}, []),
|
|
854
|
-
|
|
855
|
-
|
|
865
|
+
}, []), Je = B((e) => {
|
|
866
|
+
if (Y.current) return;
|
|
867
|
+
let t = Ke(e);
|
|
868
|
+
Z(null), ke((t) => {
|
|
856
869
|
let { [e.id]: n, ...r } = t;
|
|
857
870
|
return r;
|
|
858
|
-
}),
|
|
871
|
+
}), We(null, e), j?.(e, t);
|
|
859
872
|
}, [
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
]),
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
873
|
+
Ke,
|
|
874
|
+
j,
|
|
875
|
+
We
|
|
876
|
+
]), Xe = B(async (e) => {
|
|
877
|
+
if (Y.current) return !1;
|
|
878
|
+
Y.current = !0, Me(e.id), Z(null);
|
|
879
|
+
let t = Ke(e), n = e.values ?? [], r = new Set(n.map((e) => e.id)), i = new Set(t.values.map((e) => e.id));
|
|
880
|
+
try {
|
|
881
|
+
let a = oe?.(e, t);
|
|
882
|
+
return a && await a, Ae.current ? (t.name !== lt(e.name) && re?.(e, t.name), n.forEach((n) => {
|
|
883
|
+
let r = t.values.find((e) => e.id === n.id);
|
|
884
|
+
r && lt(n.label) !== lt(r.label) && ie?.(e, n, lt(r.label));
|
|
885
|
+
}), t.values.forEach((t) => {
|
|
886
|
+
r.has(t.id) || E?.(e);
|
|
887
|
+
}), n.forEach((t) => {
|
|
888
|
+
i.has(t.id) || te?.(e, t);
|
|
889
|
+
}), ke((t) => {
|
|
890
|
+
let { [e.id]: n, ...r } = t;
|
|
891
|
+
return r;
|
|
892
|
+
}), We(null, e), ae?.(e), !0) : !1;
|
|
893
|
+
} catch (t) {
|
|
894
|
+
return Ae.current && (Z({
|
|
895
|
+
optionId: e.id,
|
|
896
|
+
message: t instanceof Error && t.message ? t.message : R.saveErrorMessage ?? Ne.saveErrorMessage
|
|
897
|
+
}), se?.(t)), !1;
|
|
898
|
+
} finally {
|
|
899
|
+
Y.current = !1, Ae.current && Me(null);
|
|
900
|
+
}
|
|
876
901
|
}, [
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
O,
|
|
880
|
-
M,
|
|
881
|
-
k,
|
|
902
|
+
Ke,
|
|
903
|
+
E,
|
|
882
904
|
te,
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
905
|
+
ae,
|
|
906
|
+
re,
|
|
907
|
+
oe,
|
|
908
|
+
se,
|
|
909
|
+
ie,
|
|
910
|
+
R.saveErrorMessage,
|
|
911
|
+
We
|
|
912
|
+
]), Ze = y(), [Qe, $e] = be(null);
|
|
913
|
+
_e(() => {
|
|
914
|
+
X && !Ze.isOpen && (Pe.current?.focus(), Pe.current?.scrollIntoView?.({ block: "nearest" }));
|
|
915
|
+
}, [X, Ze.isOpen]);
|
|
916
|
+
let et = B((e) => {
|
|
917
|
+
if (Y.current) return;
|
|
918
|
+
let t = Ke(e), n = new Set(t.values.map((e) => e.id)), r = (e.values ?? []).filter((e) => !n.has(e.id)).length;
|
|
919
|
+
if (T === !1 || r === 0) {
|
|
920
|
+
Xe(e);
|
|
889
921
|
return;
|
|
890
922
|
}
|
|
891
|
-
|
|
923
|
+
$e({
|
|
892
924
|
option: e,
|
|
893
925
|
removed: r
|
|
894
|
-
}),
|
|
926
|
+
}), Ze.show();
|
|
895
927
|
}, [
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
]),
|
|
901
|
-
|
|
928
|
+
Xe,
|
|
929
|
+
T,
|
|
930
|
+
Ke,
|
|
931
|
+
Ze
|
|
932
|
+
]), tt = B((e) => {
|
|
933
|
+
Y.current || (Re === e.id && (ke((t) => {
|
|
902
934
|
let { [e.id]: n, ...r } = t;
|
|
903
935
|
return r;
|
|
904
|
-
}),
|
|
936
|
+
}), We(null, e)), w?.(e));
|
|
905
937
|
}, [
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
]),
|
|
910
|
-
if (
|
|
911
|
-
|
|
912
|
-
|
|
938
|
+
w,
|
|
939
|
+
Re,
|
|
940
|
+
We
|
|
941
|
+
]), nt = y(), [rt, it] = be(null), at = B((e) => {
|
|
942
|
+
if (!Y.current) {
|
|
943
|
+
if (T === !1) {
|
|
944
|
+
tt(e);
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
it(e), nt.show();
|
|
913
948
|
}
|
|
914
|
-
Ve(e), ze.show();
|
|
915
949
|
}, [
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
]),
|
|
950
|
+
T,
|
|
951
|
+
tt,
|
|
952
|
+
nt
|
|
953
|
+
]), ot = S ? /* @__PURE__ */ H(a, {
|
|
920
954
|
type: "button",
|
|
921
955
|
tone: "neutral",
|
|
922
|
-
onClick:
|
|
923
|
-
|
|
956
|
+
onClick: () => {
|
|
957
|
+
Y.current || S();
|
|
958
|
+
},
|
|
959
|
+
disabled: Q,
|
|
960
|
+
icon: q,
|
|
924
961
|
children: R.createLabel
|
|
925
|
-
}) : void 0,
|
|
962
|
+
}) : void 0, st = Be ? /* @__PURE__ */ H("div", {
|
|
926
963
|
className: "product-options-matrix--panel-header p-surface",
|
|
927
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ U(u, {
|
|
928
965
|
direction: "horizontal",
|
|
929
966
|
gap: "md",
|
|
930
967
|
justify: "between",
|
|
931
|
-
children: [/* @__PURE__ */
|
|
968
|
+
children: [/* @__PURE__ */ H(o, {
|
|
932
969
|
type: "inherit",
|
|
933
970
|
weight: "semibold",
|
|
934
971
|
children: R.title
|
|
935
|
-
}),
|
|
972
|
+
}), ot]
|
|
936
973
|
})
|
|
937
|
-
}) : null,
|
|
974
|
+
}) : null, ct = /* @__PURE__ */ U("div", {
|
|
938
975
|
className: "product-options-matrix--body min-w-0",
|
|
939
976
|
children: [
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
className: "product-options-matrix--panel overflow-hidden rounded-
|
|
942
|
-
children: [
|
|
943
|
-
className: i("product-options-matrix--list",
|
|
977
|
+
/* @__PURE__ */ U("div", {
|
|
978
|
+
className: "product-options-matrix--panel overflow-hidden rounded-surface border border-border bg-background text-foreground",
|
|
979
|
+
children: [st, ze ? /* @__PURE__ */ U("div", {
|
|
980
|
+
className: i("product-options-matrix--list", Be && "border-t border-border/60"),
|
|
944
981
|
children: [e.map((e, t) => {
|
|
945
|
-
let n = e.values ?? [], r =
|
|
982
|
+
let n = e.values ?? [], r = Ce.has(e.id), s = G && ut(e.name), l = s && Re === e.id, d = !!C || s, m = !!w, g = !!E, _ = Ke(e), y = X?.optionId === e.id ? X : null, b = je === e.id, S = N?.(e, {
|
|
946
983
|
index: t,
|
|
947
|
-
onEdit:
|
|
948
|
-
onDelete:
|
|
949
|
-
onAddValue:
|
|
950
|
-
|
|
984
|
+
onEdit: d && !Q ? () => Ge(e) : void 0,
|
|
985
|
+
onDelete: w && !Q ? () => at(e) : void 0,
|
|
986
|
+
onAddValue: E && !Q ? () => {
|
|
987
|
+
Y.current || E(e);
|
|
988
|
+
} : void 0,
|
|
989
|
+
onToggleCollapsed: () => Ue(e),
|
|
951
990
|
collapsed: r
|
|
952
|
-
}),
|
|
991
|
+
}), T = [...g ? [{
|
|
953
992
|
id: "add-value",
|
|
954
993
|
label: R.addValueLabel,
|
|
955
|
-
|
|
956
|
-
|
|
994
|
+
disabled: Q,
|
|
995
|
+
icon: /* @__PURE__ */ H(q, { className: "size-icon-md" }),
|
|
996
|
+
onClick: () => {
|
|
997
|
+
Y.current || E?.(e);
|
|
998
|
+
},
|
|
957
999
|
tone: "secondary",
|
|
958
1000
|
buttonStyle: "ghost"
|
|
959
|
-
}] : [], ...
|
|
1001
|
+
}] : [], ...m ? [{
|
|
960
1002
|
id: "delete",
|
|
961
1003
|
label: R.deleteLabel,
|
|
962
|
-
|
|
963
|
-
|
|
1004
|
+
disabled: Q,
|
|
1005
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
1006
|
+
onClick: () => at(e),
|
|
964
1007
|
tone: "destructive"
|
|
965
|
-
}] : []],
|
|
1008
|
+
}] : []], re = I && (d || T.length > 0) ? /* @__PURE__ */ U(xe, { children: [!!d && /* @__PURE__ */ H(a, {
|
|
966
1009
|
type: "button",
|
|
967
1010
|
tone: "secondary",
|
|
968
1011
|
buttonStyle: "ghost",
|
|
969
|
-
onClick: () =>
|
|
1012
|
+
onClick: () => Ge(e),
|
|
1013
|
+
disabled: Q,
|
|
970
1014
|
children: R.editLabel
|
|
971
|
-
}), /* @__PURE__ */
|
|
1015
|
+
}), /* @__PURE__ */ H(Ye, {
|
|
972
1016
|
item: e,
|
|
973
|
-
actions:
|
|
1017
|
+
actions: T,
|
|
974
1018
|
menuLabel: R.actionsLabel
|
|
975
|
-
})] }) : null,
|
|
976
|
-
if (
|
|
1019
|
+
})] }) : null, ie = S === void 0 ? re : S;
|
|
1020
|
+
if (l) return /* @__PURE__ */ H("div", {
|
|
977
1021
|
className: "product-options-matrix--item product-options-matrix--item-editing border-b border-border/60 p-surface last:border-b-0",
|
|
978
|
-
children: /* @__PURE__ */
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
...e,
|
|
1034
|
-
values: e.values.map((e) => e.id === t.id ? {
|
|
1035
|
-
...e,
|
|
1036
|
-
label: r
|
|
1037
|
-
} : e)
|
|
1038
|
-
}));
|
|
1039
|
-
},
|
|
1040
|
-
"aria-label": `${R.optionValuesLabel}: ${ot(t.label)}`,
|
|
1041
|
-
className: "bg-background"
|
|
1042
|
-
}),
|
|
1043
|
-
/* @__PURE__ */ H(a, {
|
|
1044
|
-
type: "button",
|
|
1045
|
-
size: "sm",
|
|
1046
|
-
iconOnly: !0,
|
|
1047
|
-
tone: "secondary",
|
|
1048
|
-
buttonStyle: "ghost",
|
|
1049
|
-
onClick: () => Q(e, (e) => ({
|
|
1022
|
+
children: /* @__PURE__ */ U(u, {
|
|
1023
|
+
gap: "lg",
|
|
1024
|
+
className: "product-options-matrix--editor",
|
|
1025
|
+
"aria-busy": b,
|
|
1026
|
+
children: [
|
|
1027
|
+
y && /* @__PURE__ */ U(p, {
|
|
1028
|
+
ref: Pe,
|
|
1029
|
+
tabIndex: -1,
|
|
1030
|
+
tone: "destructive",
|
|
1031
|
+
children: [/* @__PURE__ */ H(h, { children: R.saveErrorTitle ?? Ne.saveErrorTitle }), /* @__PURE__ */ H(f, { children: y.message })]
|
|
1032
|
+
}),
|
|
1033
|
+
/* @__PURE__ */ H(k, {
|
|
1034
|
+
label: R.optionNameLabel,
|
|
1035
|
+
className: "product-options-matrix--editor-field",
|
|
1036
|
+
children: /* @__PURE__ */ H(O, {
|
|
1037
|
+
value: _.name,
|
|
1038
|
+
disabled: Q,
|
|
1039
|
+
onChange: (t) => {
|
|
1040
|
+
let n = t.currentTarget.value;
|
|
1041
|
+
qe(e, (e) => ({
|
|
1042
|
+
...e,
|
|
1043
|
+
name: n
|
|
1044
|
+
}));
|
|
1045
|
+
},
|
|
1046
|
+
"aria-label": R.optionNameLabel,
|
|
1047
|
+
className: "bg-background"
|
|
1048
|
+
})
|
|
1049
|
+
}),
|
|
1050
|
+
/* @__PURE__ */ U(u, {
|
|
1051
|
+
gap: "sm",
|
|
1052
|
+
className: "product-options-matrix--editor-field",
|
|
1053
|
+
children: [/* @__PURE__ */ H(o, {
|
|
1054
|
+
type: "inherit",
|
|
1055
|
+
weight: "medium",
|
|
1056
|
+
children: R.optionValuesLabel
|
|
1057
|
+
}), /* @__PURE__ */ U(u, {
|
|
1058
|
+
gap: "xs",
|
|
1059
|
+
className: "product-options-matrix--editor-values",
|
|
1060
|
+
children: [
|
|
1061
|
+
_.values.length === 0 && /* @__PURE__ */ H(o, {
|
|
1062
|
+
size: "xs",
|
|
1063
|
+
type: "secondary",
|
|
1064
|
+
children: R.noValuesLabel
|
|
1065
|
+
}),
|
|
1066
|
+
_.values.map((t) => /* @__PURE__ */ U("div", {
|
|
1067
|
+
className: "product-options-matrix--editor-value grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-space-sm",
|
|
1068
|
+
children: [ut(t.label) ? /* @__PURE__ */ H(O, {
|
|
1069
|
+
ref: t.id === Ie.current ? Le : void 0,
|
|
1070
|
+
value: lt(t.label),
|
|
1071
|
+
disabled: Q,
|
|
1072
|
+
onChange: (n) => {
|
|
1073
|
+
let r = n.currentTarget.value;
|
|
1074
|
+
qe(e, (e) => ({
|
|
1075
|
+
...e,
|
|
1076
|
+
values: e.values.map((e) => e.id === t.id ? {
|
|
1050
1077
|
...e,
|
|
1051
|
-
|
|
1052
|
-
})
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1078
|
+
label: r
|
|
1079
|
+
} : e)
|
|
1080
|
+
}));
|
|
1081
|
+
},
|
|
1082
|
+
"aria-label": `${R.optionValuesLabel}: ${lt(t.label)}`,
|
|
1083
|
+
className: "bg-background"
|
|
1084
|
+
}) : /* @__PURE__ */ H("div", {
|
|
1085
|
+
className: "min-w-0",
|
|
1086
|
+
children: t.label
|
|
1087
|
+
}), /* @__PURE__ */ U(a, {
|
|
1088
|
+
type: "button",
|
|
1089
|
+
size: "sm",
|
|
1090
|
+
iconOnly: !0,
|
|
1091
|
+
tone: "secondary",
|
|
1092
|
+
buttonStyle: "ghost",
|
|
1093
|
+
onClick: () => qe(e, (e) => ({
|
|
1094
|
+
...e,
|
|
1095
|
+
values: e.values.filter((e) => e.id !== t.id)
|
|
1096
|
+
})),
|
|
1097
|
+
"aria-label": R.deleteValueLabel,
|
|
1098
|
+
disabled: Q,
|
|
1099
|
+
className: "text-muted-foreground hover:text-destructive",
|
|
1100
|
+
children: [/* @__PURE__ */ H(J, {
|
|
1101
|
+
className: "size-icon-sm",
|
|
1102
|
+
"aria-hidden": "true"
|
|
1103
|
+
}), /* @__PURE__ */ H(o, {
|
|
1104
|
+
tag: "span",
|
|
1105
|
+
size: "pxs",
|
|
1106
|
+
className: "sr-only",
|
|
1107
|
+
children: R.deleteValueLabel
|
|
1108
|
+
})]
|
|
1109
|
+
})]
|
|
1110
|
+
}, t.id)),
|
|
1111
|
+
/* @__PURE__ */ H("div", {
|
|
1112
|
+
className: "product-options-matrix--editor-add-value min-w-0",
|
|
1113
|
+
children: /* @__PURE__ */ H(a, {
|
|
1114
|
+
type: "button",
|
|
1115
|
+
tone: "secondary",
|
|
1116
|
+
buttonStyle: "outline",
|
|
1117
|
+
disabled: Q,
|
|
1118
|
+
onClick: () => {
|
|
1119
|
+
if (Y.current) return;
|
|
1120
|
+
let t = new Set([...e.values ?? [], ..._.values].map((e) => e.id)), n;
|
|
1121
|
+
do
|
|
1122
|
+
n = `${e.id}-draft-value-${++Fe.current}`;
|
|
1123
|
+
while (t.has(n));
|
|
1124
|
+
Ie.current = n, qe(e, (e) => ({
|
|
1125
|
+
...e,
|
|
1126
|
+
values: [...e.values, {
|
|
1127
|
+
id: n,
|
|
1128
|
+
label: ""
|
|
1129
|
+
}]
|
|
1130
|
+
}));
|
|
1131
|
+
},
|
|
1132
|
+
fullWidth: !0,
|
|
1133
|
+
className: "justify-start text-muted-foreground",
|
|
1134
|
+
children: R.addAnotherValueLabel
|
|
1097
1135
|
})
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
})
|
|
1101
|
-
|
|
1136
|
+
})
|
|
1137
|
+
]
|
|
1138
|
+
})]
|
|
1139
|
+
}),
|
|
1140
|
+
/* @__PURE__ */ U(u, {
|
|
1141
|
+
direction: "horizontal",
|
|
1142
|
+
gap: "md",
|
|
1143
|
+
justify: "between",
|
|
1144
|
+
wrap: !1,
|
|
1145
|
+
className: "product-options-matrix--editor-actions",
|
|
1146
|
+
children: [/* @__PURE__ */ H("div", { children: !!w && /* @__PURE__ */ H(a, {
|
|
1147
|
+
type: "button",
|
|
1148
|
+
tone: "destructive",
|
|
1149
|
+
buttonStyle: "outline",
|
|
1150
|
+
onClick: () => at(e),
|
|
1151
|
+
disabled: Q,
|
|
1152
|
+
children: R.deleteLabel
|
|
1153
|
+
}) }), /* @__PURE__ */ U(u, {
|
|
1102
1154
|
direction: "horizontal",
|
|
1103
|
-
gap: "
|
|
1104
|
-
justify: "
|
|
1155
|
+
gap: "sm",
|
|
1156
|
+
justify: "end",
|
|
1105
1157
|
wrap: !1,
|
|
1106
|
-
|
|
1107
|
-
children: [/* @__PURE__ */ V("div", { children: !!x && /* @__PURE__ */ V(a, {
|
|
1158
|
+
children: [/* @__PURE__ */ H(a, {
|
|
1108
1159
|
type: "button",
|
|
1109
|
-
tone: "
|
|
1110
|
-
buttonStyle: "
|
|
1111
|
-
onClick: () =>
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
onClick: () => Me(e),
|
|
1123
|
-
children: R.cancelLabel
|
|
1124
|
-
}), /* @__PURE__ */ V(a, {
|
|
1125
|
-
type: "button",
|
|
1126
|
-
tone: "neutral",
|
|
1127
|
-
onClick: () => Le(e),
|
|
1128
|
-
children: R.saveLabel ?? R.doneLabel
|
|
1129
|
-
})]
|
|
1160
|
+
tone: "secondary",
|
|
1161
|
+
buttonStyle: "ghost",
|
|
1162
|
+
onClick: () => Je(e),
|
|
1163
|
+
disabled: Q,
|
|
1164
|
+
children: R.cancelLabel
|
|
1165
|
+
}), /* @__PURE__ */ H(a, {
|
|
1166
|
+
type: "button",
|
|
1167
|
+
tone: "neutral",
|
|
1168
|
+
onClick: () => et(e),
|
|
1169
|
+
disabled: Q,
|
|
1170
|
+
loading: b,
|
|
1171
|
+
strings: { loading: R.savingLabel },
|
|
1172
|
+
children: y ? R.retrySaveLabel ?? R.saveLabel : R.saveLabel ?? R.doneLabel
|
|
1130
1173
|
})]
|
|
1131
|
-
})
|
|
1132
|
-
|
|
1133
|
-
|
|
1174
|
+
})]
|
|
1175
|
+
})
|
|
1176
|
+
]
|
|
1134
1177
|
})
|
|
1135
1178
|
}, e.id);
|
|
1136
|
-
let
|
|
1137
|
-
render: /* @__PURE__ */
|
|
1179
|
+
let A = /* @__PURE__ */ U(u, {
|
|
1180
|
+
render: /* @__PURE__ */ H("span", {}),
|
|
1138
1181
|
gap: "sm",
|
|
1139
1182
|
children: [
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
render: /* @__PURE__ */
|
|
1183
|
+
/* @__PURE__ */ U(u, {
|
|
1184
|
+
render: /* @__PURE__ */ H("span", {}),
|
|
1142
1185
|
direction: "horizontal",
|
|
1143
1186
|
gap: "sm",
|
|
1144
|
-
children: [/* @__PURE__ */
|
|
1187
|
+
children: [/* @__PURE__ */ H(o, {
|
|
1145
1188
|
type: "inherit",
|
|
1146
1189
|
tag: "span",
|
|
1147
1190
|
weight: "semibold",
|
|
@@ -1149,37 +1192,39 @@ function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
|
|
|
1149
1192
|
children: e.name
|
|
1150
1193
|
}), e.badge]
|
|
1151
1194
|
}),
|
|
1152
|
-
!!e.description && /* @__PURE__ */
|
|
1195
|
+
!!e.description && /* @__PURE__ */ H(o, {
|
|
1153
1196
|
tag: "span",
|
|
1154
1197
|
size: "xs",
|
|
1155
1198
|
type: "secondary",
|
|
1156
1199
|
className: "max-w-prose",
|
|
1157
1200
|
children: e.description
|
|
1158
1201
|
}),
|
|
1159
|
-
!r && /* @__PURE__ */
|
|
1160
|
-
render: /* @__PURE__ */
|
|
1202
|
+
!r && /* @__PURE__ */ H(u, {
|
|
1203
|
+
render: /* @__PURE__ */ H("span", {}),
|
|
1161
1204
|
gap: "sm",
|
|
1162
1205
|
className: "product-options-matrix--values",
|
|
1163
|
-
children: n.length === 0 ? /* @__PURE__ */
|
|
1206
|
+
children: n.length === 0 ? /* @__PURE__ */ H(o, {
|
|
1164
1207
|
tag: "span",
|
|
1165
1208
|
size: "xs",
|
|
1166
1209
|
type: "secondary",
|
|
1167
1210
|
children: R.noValuesLabel
|
|
1168
|
-
}) : /* @__PURE__ */
|
|
1211
|
+
}) : /* @__PURE__ */ H("span", {
|
|
1169
1212
|
className: "flex flex-wrap gap-space-xs",
|
|
1170
1213
|
children: n.map((n, r) => {
|
|
1171
|
-
let a =
|
|
1214
|
+
let a = te ? () => {
|
|
1215
|
+
Y.current || te(e, n);
|
|
1216
|
+
} : void 0, s = ce?.(n, {
|
|
1172
1217
|
option: e,
|
|
1173
1218
|
optionIndex: t,
|
|
1174
1219
|
valueIndex: r,
|
|
1175
1220
|
onDelete: a
|
|
1176
1221
|
});
|
|
1177
|
-
return s ? /* @__PURE__ */
|
|
1222
|
+
return s ? /* @__PURE__ */ H(ge, { children: s }, n.id) : /* @__PURE__ */ U(ee, {
|
|
1178
1223
|
size: "sm",
|
|
1179
1224
|
tone: "neutral",
|
|
1180
1225
|
className: i("product-options-matrix--value", n.disabled && "opacity-50"),
|
|
1181
1226
|
children: [
|
|
1182
|
-
|
|
1227
|
+
ut(n.label) ? /* @__PURE__ */ H(o, {
|
|
1183
1228
|
type: "inherit",
|
|
1184
1229
|
tag: "span",
|
|
1185
1230
|
size: "inherit",
|
|
@@ -1187,15 +1232,16 @@ function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
|
|
|
1187
1232
|
children: n.label
|
|
1188
1233
|
}) : n.label,
|
|
1189
1234
|
n.badge,
|
|
1190
|
-
!!a &&
|
|
1235
|
+
!!a && I && /* @__PURE__ */ U("button", {
|
|
1191
1236
|
type: "button",
|
|
1192
1237
|
onClick: a,
|
|
1238
|
+
disabled: Q,
|
|
1193
1239
|
"aria-label": R.deleteValueLabel,
|
|
1194
|
-
className: i(
|
|
1195
|
-
children: [/* @__PURE__ */
|
|
1196
|
-
className:
|
|
1240
|
+
className: i(D.target, D.focus, c.inset, D.clear, "hover:text-destructive"),
|
|
1241
|
+
children: [/* @__PURE__ */ H(Oe, {
|
|
1242
|
+
className: D.icon,
|
|
1197
1243
|
"aria-hidden": "true"
|
|
1198
|
-
}), /* @__PURE__ */
|
|
1244
|
+
}), /* @__PURE__ */ H(o, {
|
|
1199
1245
|
tag: "span",
|
|
1200
1246
|
size: "pxs",
|
|
1201
1247
|
className: "sr-only",
|
|
@@ -1209,166 +1255,177 @@ function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
|
|
|
1209
1255
|
})
|
|
1210
1256
|
]
|
|
1211
1257
|
});
|
|
1212
|
-
return /* @__PURE__ */
|
|
1258
|
+
return /* @__PURE__ */ H("div", {
|
|
1213
1259
|
className: "product-options-matrix--item border-b border-border/60 last:border-b-0",
|
|
1214
|
-
children: /* @__PURE__ */
|
|
1215
|
-
className: "grid min-w-0
|
|
1260
|
+
children: /* @__PURE__ */ U("div", {
|
|
1261
|
+
className: i("grid min-w-0 items-center gap-x-space-md gap-y-space-md p-surface", F ? "grid-cols-[auto_minmax(0,1fr)] @2xl/product-options-matrix:grid-cols-[auto_minmax(0,1fr)_auto]" : "grid-cols-1 @2xl/product-options-matrix:grid-cols-[minmax(0,1fr)_auto]"),
|
|
1216
1262
|
children: [
|
|
1217
|
-
|
|
1263
|
+
F && /* @__PURE__ */ U(a, {
|
|
1218
1264
|
type: "button",
|
|
1219
1265
|
size: "sm",
|
|
1220
1266
|
iconOnly: !0,
|
|
1221
1267
|
tone: "secondary",
|
|
1222
1268
|
buttonStyle: "ghost",
|
|
1223
|
-
onClick: () =>
|
|
1269
|
+
onClick: () => Ue(e),
|
|
1270
|
+
disabled: Q,
|
|
1224
1271
|
"aria-expanded": !r,
|
|
1225
1272
|
"aria-label": r ? R.expandOptionLabel : R.collapseOptionLabel,
|
|
1226
1273
|
className: "product-options-matrix--collapse-trigger mt-space-2xs shrink-0 text-muted-foreground",
|
|
1227
|
-
children: [/* @__PURE__ */
|
|
1274
|
+
children: [/* @__PURE__ */ H(W, {
|
|
1228
1275
|
className: i("size-icon-sm transition-transform", r && "-rotate-90"),
|
|
1229
1276
|
"aria-hidden": "true"
|
|
1230
|
-
}), /* @__PURE__ */
|
|
1277
|
+
}), /* @__PURE__ */ H(o, {
|
|
1231
1278
|
tag: "span",
|
|
1232
1279
|
size: "pxs",
|
|
1233
1280
|
className: "sr-only",
|
|
1234
1281
|
children: r ? R.expandOptionLabel : R.collapseOptionLabel
|
|
1235
1282
|
})]
|
|
1236
|
-
}) : /* @__PURE__ */ V("span", {
|
|
1237
|
-
className: "product-options-matrix--drag-handle flex size-icon-lg items-center justify-center text-muted-foreground",
|
|
1238
|
-
"aria-hidden": "true",
|
|
1239
|
-
children: /* @__PURE__ */ V(Se, { className: "size-icon-sm" })
|
|
1240
1283
|
}),
|
|
1241
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ H("div", {
|
|
1242
1285
|
className: "product-options-matrix--item-main min-w-0",
|
|
1243
|
-
children:
|
|
1286
|
+
children: d && !I ? /* @__PURE__ */ H("button", {
|
|
1244
1287
|
type: "button",
|
|
1245
|
-
onClick: () =>
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1288
|
+
onClick: () => Ge(e),
|
|
1289
|
+
disabled: Q,
|
|
1290
|
+
"aria-label": dt(R.editLabel, e),
|
|
1291
|
+
className: `product-options-matrix--edit-summary ${x.nativeButtonReset} block w-full cursor-pointer whitespace-normal rounded-radius text-start text-inherit outline-none ${c.edge}`,
|
|
1292
|
+
children: A
|
|
1293
|
+
}) : A
|
|
1250
1294
|
}),
|
|
1251
|
-
(
|
|
1252
|
-
className: i("product-options-matrix--item-actions
|
|
1253
|
-
children: [!!
|
|
1295
|
+
(!!M && L || !!ie) && /* @__PURE__ */ U("div", {
|
|
1296
|
+
className: i("product-options-matrix--item-actions flex min-w-0 flex-wrap items-center justify-start @2xl/product-options-matrix:col-start-auto @2xl/product-options-matrix:justify-end", F ? "col-start-2" : "col-start-1", v.commands),
|
|
1297
|
+
children: [!!M && L && /* @__PURE__ */ U("div", {
|
|
1254
1298
|
className: "inline-flex items-center gap-space-sm",
|
|
1255
|
-
children: [/* @__PURE__ */
|
|
1299
|
+
children: [/* @__PURE__ */ H(o, {
|
|
1256
1300
|
tag: "span",
|
|
1257
1301
|
id: `product-option-${e.id}-variant-toggle-label`,
|
|
1258
1302
|
size: "pxs",
|
|
1259
1303
|
type: "secondary",
|
|
1260
1304
|
weight: "medium",
|
|
1261
1305
|
children: R.useForVariantsLabel
|
|
1262
|
-
}), /* @__PURE__ */
|
|
1306
|
+
}), /* @__PURE__ */ H(ne, {
|
|
1263
1307
|
checked: !!e.usedForVariants,
|
|
1264
|
-
|
|
1308
|
+
disabled: Q,
|
|
1309
|
+
onValueChange: (t) => {
|
|
1310
|
+
Y.current || M(e, t);
|
|
1311
|
+
},
|
|
1265
1312
|
"aria-labelledby": `product-option-${e.id}-variant-toggle-label`
|
|
1266
1313
|
})]
|
|
1267
|
-
}),
|
|
1314
|
+
}), ie]
|
|
1268
1315
|
})
|
|
1269
1316
|
]
|
|
1270
1317
|
})
|
|
1271
1318
|
}, e.id);
|
|
1272
|
-
}), !!
|
|
1319
|
+
}), !!Ve && /* @__PURE__ */ H("div", {
|
|
1273
1320
|
className: "product-options-matrix--create-row border-t border-border/60 p-surface-xs",
|
|
1274
|
-
children: /* @__PURE__ */
|
|
1321
|
+
children: /* @__PURE__ */ H(a, {
|
|
1275
1322
|
type: "button",
|
|
1276
1323
|
tone: "secondary",
|
|
1277
1324
|
buttonStyle: "ghost",
|
|
1278
|
-
onClick:
|
|
1279
|
-
|
|
1325
|
+
onClick: () => {
|
|
1326
|
+
Y.current || S?.();
|
|
1327
|
+
},
|
|
1328
|
+
disabled: Q,
|
|
1329
|
+
icon: Te,
|
|
1280
1330
|
size: "sm",
|
|
1281
1331
|
fullWidth: !0,
|
|
1282
1332
|
className: "justify-start text-foreground",
|
|
1283
1333
|
children: R.addAnotherOptionLabel
|
|
1284
1334
|
})
|
|
1285
1335
|
})]
|
|
1286
|
-
}) : /* @__PURE__ */
|
|
1287
|
-
className: i(
|
|
1288
|
-
children:
|
|
1336
|
+
}) : /* @__PURE__ */ H("div", {
|
|
1337
|
+
className: i(Be && "border-t border-border/60"),
|
|
1338
|
+
children: fe ?? /* @__PURE__ */ H($, {
|
|
1289
1339
|
title: R.emptyTitle,
|
|
1290
1340
|
description: R.emptyDescription,
|
|
1291
|
-
action:
|
|
1341
|
+
action: S && !Be ? /* @__PURE__ */ H(a, {
|
|
1292
1342
|
tone: "primary",
|
|
1293
1343
|
type: "button",
|
|
1294
|
-
onClick:
|
|
1295
|
-
icon:
|
|
1344
|
+
onClick: S,
|
|
1345
|
+
icon: q,
|
|
1296
1346
|
children: R.createLabel
|
|
1297
1347
|
}) : void 0
|
|
1298
1348
|
})
|
|
1299
1349
|
})]
|
|
1300
1350
|
}),
|
|
1301
|
-
!!(
|
|
1302
|
-
...
|
|
1351
|
+
!!(T !== !1 && Qe) && /* @__PURE__ */ H(b, {
|
|
1352
|
+
...Ze.overlayProps,
|
|
1303
1353
|
destructive: !0,
|
|
1304
1354
|
title: R.confirmRemoveValuesTitle,
|
|
1305
|
-
description: n(R.confirmRemoveValuesDescription, { count:
|
|
1306
|
-
strings: {
|
|
1307
|
-
|
|
1355
|
+
description: n(R.confirmRemoveValuesDescription, { count: Qe.removed }),
|
|
1356
|
+
strings: {
|
|
1357
|
+
confirm: X?.optionId === Qe.option.id ? R.retrySaveLabel : R.confirmRemoveValuesLabel,
|
|
1358
|
+
loading: R.savingLabel
|
|
1359
|
+
},
|
|
1360
|
+
alertMessage: X?.optionId === Qe.option.id ? X.message : void 0,
|
|
1361
|
+
closeOnAsyncComplete: !1,
|
|
1362
|
+
onAsyncConfirm: async () => {
|
|
1363
|
+
await Xe(Qe.option) && Ze.hide();
|
|
1364
|
+
}
|
|
1308
1365
|
}),
|
|
1309
|
-
!!(
|
|
1310
|
-
...
|
|
1366
|
+
!!(T !== !1 && w) && /* @__PURE__ */ H(b, {
|
|
1367
|
+
...nt.overlayProps,
|
|
1311
1368
|
destructive: !0,
|
|
1312
1369
|
title: R.confirmDeleteOptionTitle,
|
|
1313
1370
|
description: R.confirmDeleteOptionDescription,
|
|
1314
1371
|
strings: { confirm: R.deleteLabel },
|
|
1315
1372
|
onConfirm: () => {
|
|
1316
|
-
|
|
1373
|
+
rt && tt(rt);
|
|
1317
1374
|
}
|
|
1318
1375
|
})
|
|
1319
1376
|
]
|
|
1320
1377
|
});
|
|
1321
|
-
return t === "embedded" ? /* @__PURE__ */
|
|
1378
|
+
return t === "embedded" ? /* @__PURE__ */ H("section", {
|
|
1322
1379
|
"aria-label": R.title,
|
|
1323
|
-
className: i("product-options-matrix--component @container/product-options-matrix min-w-0",
|
|
1324
|
-
children:
|
|
1325
|
-
}) : /* @__PURE__ */
|
|
1380
|
+
className: i("product-options-matrix--component @container/product-options-matrix min-w-0", pe),
|
|
1381
|
+
children: ct
|
|
1382
|
+
}) : /* @__PURE__ */ H(A, {
|
|
1326
1383
|
title: R.title,
|
|
1327
1384
|
description: R.description,
|
|
1328
|
-
actions:
|
|
1329
|
-
headerAction:
|
|
1330
|
-
headerEnd:
|
|
1331
|
-
footerSlot:
|
|
1332
|
-
className: i("product-options-matrix--component @container/product-options-matrix w-full",
|
|
1333
|
-
children:
|
|
1385
|
+
actions: le,
|
|
1386
|
+
headerAction: ot,
|
|
1387
|
+
headerEnd: ue,
|
|
1388
|
+
footerSlot: de,
|
|
1389
|
+
className: i("product-options-matrix--component @container/product-options-matrix w-full", pe),
|
|
1390
|
+
children: ct
|
|
1334
1391
|
});
|
|
1335
1392
|
}
|
|
1336
|
-
|
|
1393
|
+
pt.displayName = "ProductOptionsMatrix";
|
|
1337
1394
|
//#endregion
|
|
1338
1395
|
//#region src/components/features/products/components/product-options-summary.tsx
|
|
1339
|
-
function
|
|
1340
|
-
let g = r(
|
|
1396
|
+
function mt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOption: o, onEditOption: s, onDeleteOption: c, renderOptionActions: l, actions: u, footerSlot: d, renderOption: f, empty: p, className: m, strings: h }) {
|
|
1397
|
+
let g = r(X, h), _ = !!(o || s || c || l), v = [...u ?? [], ...n && t ? [{
|
|
1341
1398
|
id: "manage-options",
|
|
1342
1399
|
label: g.manageLabel,
|
|
1343
|
-
icon: /* @__PURE__ */
|
|
1400
|
+
icon: /* @__PURE__ */ H(De, { className: "size-icon-md" }),
|
|
1344
1401
|
onClick: t
|
|
1345
|
-
}] : []], y = n || t ? /* @__PURE__ */
|
|
1402
|
+
}] : []], y = n || t ? /* @__PURE__ */ H(a, {
|
|
1346
1403
|
type: "button",
|
|
1347
1404
|
tone: "secondary",
|
|
1348
1405
|
buttonStyle: "ghost",
|
|
1349
1406
|
onClick: n ?? t,
|
|
1350
|
-
icon: n ?
|
|
1407
|
+
icon: n ? q : void 0,
|
|
1351
1408
|
children: n ? g.createLabel : g.manageLabel
|
|
1352
1409
|
}) : void 0;
|
|
1353
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ H(A, {
|
|
1354
1411
|
title: g.title,
|
|
1355
1412
|
description: g.description,
|
|
1356
1413
|
actions: v.length > 0 ? v : void 0,
|
|
1357
1414
|
headerAction: y,
|
|
1358
1415
|
footerSlot: d,
|
|
1359
1416
|
className: i("product-options-summary--component w-full", m),
|
|
1360
|
-
children: e.length === 0 ? p ?? /* @__PURE__ */
|
|
1417
|
+
children: e.length === 0 ? p ?? /* @__PURE__ */ H($, {
|
|
1361
1418
|
title: g.emptyTitle,
|
|
1362
1419
|
description: g.emptyDescription,
|
|
1363
|
-
action: n ? /* @__PURE__ */
|
|
1420
|
+
action: n ? /* @__PURE__ */ H(a, {
|
|
1364
1421
|
tone: "primary",
|
|
1365
1422
|
type: "button",
|
|
1366
1423
|
onClick: n,
|
|
1367
|
-
icon:
|
|
1424
|
+
icon: q,
|
|
1368
1425
|
children: g.createLabel
|
|
1369
1426
|
}) : void 0
|
|
1370
|
-
}) : /* @__PURE__ */
|
|
1371
|
-
let n = _ ? /* @__PURE__ */
|
|
1427
|
+
}) : /* @__PURE__ */ H(N, { children: e.map((e, t) => (() => {
|
|
1428
|
+
let n = _ ? /* @__PURE__ */ H(st, {
|
|
1372
1429
|
option: e,
|
|
1373
1430
|
index: t,
|
|
1374
1431
|
onSelectOption: o,
|
|
@@ -1383,54 +1440,54 @@ function dt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOp
|
|
|
1383
1440
|
actionsLabel: g.actionsLabel
|
|
1384
1441
|
}
|
|
1385
1442
|
}) : void 0;
|
|
1386
|
-
return f ? /* @__PURE__ */
|
|
1443
|
+
return f ? /* @__PURE__ */ H("div", { children: f(e, t) }, e.id) : /* @__PURE__ */ H(it, {
|
|
1387
1444
|
item: e,
|
|
1388
1445
|
actions: n
|
|
1389
1446
|
}, e.id);
|
|
1390
1447
|
})()) })
|
|
1391
1448
|
});
|
|
1392
1449
|
}
|
|
1393
|
-
|
|
1450
|
+
mt.displayName = "ProductOptionsSummary";
|
|
1394
1451
|
//#endregion
|
|
1395
1452
|
//#region src/components/features/products/components/product-policies-card.tsx
|
|
1396
|
-
function
|
|
1397
|
-
let h = r(
|
|
1453
|
+
function ht({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPolicy: o, onDeletePolicy: s, renderPolicyActions: c, actions: l, footerSlot: u, renderPolicy: d, empty: f, className: p, strings: m }) {
|
|
1454
|
+
let h = r(Fe, m), g = t ? /* @__PURE__ */ H(a, {
|
|
1398
1455
|
type: "button",
|
|
1399
1456
|
tone: "secondary",
|
|
1400
1457
|
buttonStyle: "ghost",
|
|
1401
1458
|
onClick: t,
|
|
1402
|
-
icon:
|
|
1459
|
+
icon: q,
|
|
1403
1460
|
children: h.createLabel
|
|
1404
1461
|
}) : void 0;
|
|
1405
|
-
return /* @__PURE__ */
|
|
1462
|
+
return /* @__PURE__ */ H(A, {
|
|
1406
1463
|
title: h.title,
|
|
1407
1464
|
description: h.description,
|
|
1408
1465
|
actions: l,
|
|
1409
1466
|
headerAction: g,
|
|
1410
1467
|
footerSlot: u,
|
|
1411
1468
|
className: i("product-policies-card--component w-full", p),
|
|
1412
|
-
children: e.length === 0 ? f ?? /* @__PURE__ */
|
|
1469
|
+
children: e.length === 0 ? f ?? /* @__PURE__ */ H($, {
|
|
1413
1470
|
title: h.emptyTitle,
|
|
1414
1471
|
description: h.emptyDescription,
|
|
1415
|
-
action: t ? /* @__PURE__ */
|
|
1472
|
+
action: t ? /* @__PURE__ */ H(a, {
|
|
1416
1473
|
tone: "primary",
|
|
1417
1474
|
type: "button",
|
|
1418
1475
|
onClick: t,
|
|
1419
|
-
icon:
|
|
1476
|
+
icon: q,
|
|
1420
1477
|
children: h.createLabel
|
|
1421
1478
|
}) : void 0
|
|
1422
|
-
}) : /* @__PURE__ */
|
|
1479
|
+
}) : /* @__PURE__ */ H(N, { children: e.map((e, t) => (() => {
|
|
1423
1480
|
let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [...i ? [{
|
|
1424
1481
|
id: "edit",
|
|
1425
1482
|
label: h.editLabel,
|
|
1426
|
-
icon: /* @__PURE__ */
|
|
1483
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
1427
1484
|
onClick: () => i(),
|
|
1428
1485
|
tone: "secondary",
|
|
1429
1486
|
buttonStyle: "ghost"
|
|
1430
1487
|
}] : [], ...a ? [{
|
|
1431
1488
|
id: "delete",
|
|
1432
1489
|
label: h.deleteLabel,
|
|
1433
|
-
icon: /* @__PURE__ */
|
|
1490
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
1434
1491
|
onClick: () => a(),
|
|
1435
1492
|
tone: "destructive"
|
|
1436
1493
|
}] : []], u = c ? c(e, {
|
|
@@ -1438,12 +1495,12 @@ function ft({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPoli
|
|
|
1438
1495
|
onSelect: r,
|
|
1439
1496
|
onEdit: i,
|
|
1440
1497
|
onDelete: a
|
|
1441
|
-
}) : /* @__PURE__ */
|
|
1498
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
1442
1499
|
item: e,
|
|
1443
1500
|
actions: l,
|
|
1444
1501
|
menuLabel: h.actionsLabel
|
|
1445
1502
|
});
|
|
1446
|
-
return d ? /* @__PURE__ */
|
|
1503
|
+
return d ? /* @__PURE__ */ H("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ H(it, {
|
|
1447
1504
|
item: e,
|
|
1448
1505
|
actionLabel: h.viewLabel,
|
|
1449
1506
|
onSelect: r,
|
|
@@ -1452,69 +1509,69 @@ function ft({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPoli
|
|
|
1452
1509
|
})()) })
|
|
1453
1510
|
});
|
|
1454
1511
|
}
|
|
1455
|
-
|
|
1512
|
+
ht.displayName = "ProductPoliciesCard";
|
|
1456
1513
|
//#endregion
|
|
1457
1514
|
//#region src/components/features/products/components/product-quote-preview-card.tsx
|
|
1458
|
-
function
|
|
1459
|
-
let
|
|
1515
|
+
function gt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQuote: l, onCreateLine: d, onSelectLine: f, onEditLine: p, onDeleteLine: m, renderLineActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
|
|
1516
|
+
let x = r(Pe, b), C = t !== void 0 || n !== void 0 || s !== void 0, w = d || l ? /* @__PURE__ */ U("div", {
|
|
1460
1517
|
className: "flex items-center gap-space-md",
|
|
1461
|
-
children: [!!d && /* @__PURE__ */
|
|
1518
|
+
children: [!!d && /* @__PURE__ */ H(a, {
|
|
1462
1519
|
type: "button",
|
|
1463
1520
|
tone: "secondary",
|
|
1464
1521
|
buttonStyle: "ghost",
|
|
1465
1522
|
onClick: d,
|
|
1466
|
-
icon:
|
|
1467
|
-
children:
|
|
1468
|
-
}), !!l && /* @__PURE__ */
|
|
1523
|
+
icon: q,
|
|
1524
|
+
children: x.createLineLabel
|
|
1525
|
+
}), !!l && /* @__PURE__ */ H(a, {
|
|
1469
1526
|
type: "button",
|
|
1470
1527
|
tone: "secondary",
|
|
1471
1528
|
buttonStyle: "ghost",
|
|
1472
1529
|
onClick: l,
|
|
1473
|
-
children:
|
|
1530
|
+
children: x.actionLabel
|
|
1474
1531
|
})]
|
|
1475
1532
|
}) : void 0;
|
|
1476
|
-
return /* @__PURE__ */
|
|
1477
|
-
title:
|
|
1478
|
-
description:
|
|
1533
|
+
return /* @__PURE__ */ H(A, {
|
|
1534
|
+
title: x.title,
|
|
1535
|
+
description: x.description,
|
|
1479
1536
|
actions: g,
|
|
1480
|
-
headerAction:
|
|
1537
|
+
headerAction: w,
|
|
1481
1538
|
footerSlot: _,
|
|
1482
|
-
className: i("product-quote-preview-card--component w-full",
|
|
1483
|
-
children: e.length === 0 ? v ?? /* @__PURE__ */
|
|
1484
|
-
title:
|
|
1485
|
-
description:
|
|
1486
|
-
action: d ? /* @__PURE__ */
|
|
1539
|
+
className: i("product-quote-preview-card--component w-full", y),
|
|
1540
|
+
children: e.length === 0 ? v ?? /* @__PURE__ */ H($, {
|
|
1541
|
+
title: x.emptyTitle,
|
|
1542
|
+
description: x.emptyDescription,
|
|
1543
|
+
action: d ? /* @__PURE__ */ H(a, {
|
|
1487
1544
|
tone: "primary",
|
|
1488
1545
|
type: "button",
|
|
1489
1546
|
onClick: d,
|
|
1490
|
-
icon:
|
|
1491
|
-
children:
|
|
1547
|
+
icon: q,
|
|
1548
|
+
children: x.createLineLabel
|
|
1492
1549
|
}) : void 0
|
|
1493
|
-
}) : /* @__PURE__ */
|
|
1550
|
+
}) : /* @__PURE__ */ U(u, {
|
|
1494
1551
|
gap: "2xl",
|
|
1495
1552
|
className: "product-quote-preview-card--body",
|
|
1496
|
-
children: [/* @__PURE__ */
|
|
1553
|
+
children: [/* @__PURE__ */ H(N, { children: e.map((e, t) => {
|
|
1497
1554
|
let n = f ? () => f(e) : void 0, r = p ? () => p(e) : void 0, i = m ? () => m(e) : void 0, a = [
|
|
1498
1555
|
...n ? [{
|
|
1499
1556
|
id: "open",
|
|
1500
|
-
label:
|
|
1501
|
-
icon: /* @__PURE__ */
|
|
1557
|
+
label: x.viewLineLabel,
|
|
1558
|
+
icon: /* @__PURE__ */ H(G, { className: "size-icon-md" }),
|
|
1502
1559
|
onClick: () => n(),
|
|
1503
1560
|
tone: "secondary",
|
|
1504
1561
|
buttonStyle: "ghost"
|
|
1505
1562
|
}] : [],
|
|
1506
1563
|
...r ? [{
|
|
1507
1564
|
id: "edit",
|
|
1508
|
-
label:
|
|
1509
|
-
icon: /* @__PURE__ */
|
|
1565
|
+
label: x.editLineLabel,
|
|
1566
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
1510
1567
|
onClick: () => r(),
|
|
1511
1568
|
tone: "secondary",
|
|
1512
1569
|
buttonStyle: "ghost"
|
|
1513
1570
|
}] : [],
|
|
1514
1571
|
...i ? [{
|
|
1515
1572
|
id: "delete",
|
|
1516
|
-
label:
|
|
1517
|
-
icon: /* @__PURE__ */
|
|
1573
|
+
label: x.deleteLineLabel,
|
|
1574
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
1518
1575
|
onClick: () => i(),
|
|
1519
1576
|
tone: "destructive"
|
|
1520
1577
|
}] : []
|
|
@@ -1523,55 +1580,55 @@ function pt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQ
|
|
|
1523
1580
|
onSelect: n,
|
|
1524
1581
|
onEdit: r,
|
|
1525
1582
|
onDelete: i
|
|
1526
|
-
}) : /* @__PURE__ */
|
|
1583
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
1527
1584
|
item: e,
|
|
1528
1585
|
actions: a,
|
|
1529
|
-
menuLabel:
|
|
1586
|
+
menuLabel: x.lineActionsLabel
|
|
1530
1587
|
});
|
|
1531
|
-
return /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ U(P, {
|
|
1532
1589
|
className: "product-quote-preview-card--line",
|
|
1533
|
-
children: [/* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
!!e.description && /* @__PURE__ */
|
|
1536
|
-
!!e.quantity && /* @__PURE__ */
|
|
1537
|
-
] }), /* @__PURE__ */
|
|
1590
|
+
children: [/* @__PURE__ */ U(ce, { children: [
|
|
1591
|
+
/* @__PURE__ */ H(F, { children: e.label }),
|
|
1592
|
+
!!e.description && /* @__PURE__ */ H(j, { children: e.description }),
|
|
1593
|
+
!!e.quantity && /* @__PURE__ */ H(j, { children: e.quantity })
|
|
1594
|
+
] }), /* @__PURE__ */ U(M, { children: [/* @__PURE__ */ H(S, {
|
|
1538
1595
|
type: "inherit",
|
|
1539
1596
|
className: "tabular-nums",
|
|
1540
1597
|
children: e.amount
|
|
1541
1598
|
}), o] })]
|
|
1542
1599
|
}, e.id);
|
|
1543
|
-
}) }), /* @__PURE__ */
|
|
1600
|
+
}) }), /* @__PURE__ */ U(u, {
|
|
1544
1601
|
gap: "lg",
|
|
1545
1602
|
className: "product-quote-preview-card--totals",
|
|
1546
1603
|
children: [
|
|
1547
|
-
!!C && /* @__PURE__ */
|
|
1604
|
+
!!C && /* @__PURE__ */ U(u, {
|
|
1548
1605
|
gap: "sm",
|
|
1549
1606
|
children: [
|
|
1550
|
-
t !== void 0 && /* @__PURE__ */
|
|
1551
|
-
label:
|
|
1607
|
+
t !== void 0 && /* @__PURE__ */ H(me, {
|
|
1608
|
+
label: x.subtotalLabel,
|
|
1552
1609
|
value: t,
|
|
1553
1610
|
valueClassName: "tabular-nums"
|
|
1554
1611
|
}),
|
|
1555
|
-
n !== void 0 && /* @__PURE__ */
|
|
1556
|
-
label:
|
|
1612
|
+
n !== void 0 && /* @__PURE__ */ H(me, {
|
|
1613
|
+
label: x.taxLabel,
|
|
1557
1614
|
value: n,
|
|
1558
1615
|
valueClassName: "tabular-nums"
|
|
1559
1616
|
}),
|
|
1560
|
-
s !== void 0 && /* @__PURE__ */
|
|
1561
|
-
label:
|
|
1617
|
+
s !== void 0 && /* @__PURE__ */ H(me, {
|
|
1618
|
+
label: x.discountLabel,
|
|
1562
1619
|
value: s,
|
|
1563
1620
|
valueClassName: "tabular-nums text-success"
|
|
1564
1621
|
})
|
|
1565
1622
|
]
|
|
1566
1623
|
}),
|
|
1567
|
-
!!C && /* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
label: /* @__PURE__ */
|
|
1624
|
+
!!C && /* @__PURE__ */ H(E, {}),
|
|
1625
|
+
/* @__PURE__ */ H(me, {
|
|
1626
|
+
label: /* @__PURE__ */ H(o, {
|
|
1570
1627
|
type: "inherit",
|
|
1571
1628
|
tag: "span",
|
|
1572
1629
|
weight: "semibold",
|
|
1573
1630
|
lineHeight: "tight",
|
|
1574
|
-
children:
|
|
1631
|
+
children: x.totalLabel
|
|
1575
1632
|
}),
|
|
1576
1633
|
value: c ?? "-",
|
|
1577
1634
|
valueClassName: "font-semibold tabular-nums"
|
|
@@ -1581,135 +1638,135 @@ function pt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQ
|
|
|
1581
1638
|
})
|
|
1582
1639
|
});
|
|
1583
1640
|
}
|
|
1584
|
-
|
|
1641
|
+
gt.displayName = "ProductQuotePreviewCard";
|
|
1585
1642
|
//#endregion
|
|
1586
1643
|
//#region src/components/features/products/components/product-readiness-card.tsx
|
|
1587
|
-
function
|
|
1588
|
-
let
|
|
1644
|
+
function _t({ items: e = [], score: t, scoreLabel: n, summary: s, onCreateReadinessItem: c, onSelectReadinessItem: l, onEditReadinessItem: d, onDeleteReadinessItem: f, renderReadinessItemActions: p, actions: m, footerSlot: h, renderItem: _, empty: v, className: y, strings: b }) {
|
|
1645
|
+
let x = r(ke, b), S = t === void 0 ? void 0 : Ke(t), C = c ? /* @__PURE__ */ H(a, {
|
|
1589
1646
|
type: "button",
|
|
1590
1647
|
tone: "secondary",
|
|
1591
1648
|
buttonStyle: "ghost",
|
|
1592
1649
|
onClick: c,
|
|
1593
|
-
icon:
|
|
1594
|
-
children:
|
|
1650
|
+
icon: q,
|
|
1651
|
+
children: x.createLabel
|
|
1595
1652
|
}) : void 0;
|
|
1596
|
-
return /* @__PURE__ */
|
|
1597
|
-
title:
|
|
1598
|
-
description:
|
|
1599
|
-
actions:
|
|
1600
|
-
headerAction:
|
|
1601
|
-
footerSlot:
|
|
1653
|
+
return /* @__PURE__ */ U(A, {
|
|
1654
|
+
title: x.title,
|
|
1655
|
+
description: x.description,
|
|
1656
|
+
actions: m,
|
|
1657
|
+
headerAction: C,
|
|
1658
|
+
footerSlot: h,
|
|
1602
1659
|
contentGap: "2xl",
|
|
1603
1660
|
className: i("product-readiness-card--component w-full", y),
|
|
1604
|
-
children: [(
|
|
1661
|
+
children: [(S !== void 0 || !!s) && /* @__PURE__ */ U(u, {
|
|
1605
1662
|
gap: "lg",
|
|
1606
1663
|
className: "product-readiness-card--summary",
|
|
1607
|
-
children: [
|
|
1664
|
+
children: [S !== void 0 && /* @__PURE__ */ U(u, {
|
|
1608
1665
|
gap: "sm",
|
|
1609
1666
|
className: "product-readiness-card--score",
|
|
1610
|
-
children: [/* @__PURE__ */
|
|
1667
|
+
children: [/* @__PURE__ */ U(u, {
|
|
1611
1668
|
direction: "horizontal",
|
|
1612
1669
|
justify: "between",
|
|
1613
1670
|
gap: "lg",
|
|
1614
|
-
children: [/* @__PURE__ */
|
|
1671
|
+
children: [/* @__PURE__ */ H(o, {
|
|
1615
1672
|
size: "xs",
|
|
1616
1673
|
type: "secondary",
|
|
1617
|
-
children: n ??
|
|
1618
|
-
}), /* @__PURE__ */
|
|
1674
|
+
children: n ?? x.scoreLabel
|
|
1675
|
+
}), /* @__PURE__ */ H(w, {
|
|
1619
1676
|
type: "inherit",
|
|
1620
|
-
value:
|
|
1677
|
+
value: S,
|
|
1621
1678
|
scaled: !0,
|
|
1622
1679
|
size: "xs",
|
|
1623
1680
|
weight: "semibold"
|
|
1624
1681
|
})]
|
|
1625
|
-
}), /* @__PURE__ */
|
|
1626
|
-
value:
|
|
1627
|
-
"aria-label": typeof n == "string" ? n :
|
|
1628
|
-
"aria-valuetext": `${
|
|
1682
|
+
}), /* @__PURE__ */ H(g, {
|
|
1683
|
+
value: S,
|
|
1684
|
+
"aria-label": typeof n == "string" ? n : x.progressLabel,
|
|
1685
|
+
"aria-valuetext": `${S}%`,
|
|
1629
1686
|
size: "sm"
|
|
1630
1687
|
})]
|
|
1631
|
-
}), !!s && /* @__PURE__ */
|
|
1688
|
+
}), !!s && /* @__PURE__ */ H(o, {
|
|
1632
1689
|
type: "secondary",
|
|
1633
1690
|
children: s
|
|
1634
1691
|
})]
|
|
1635
|
-
}), e.length === 0 ? v ?? /* @__PURE__ */
|
|
1636
|
-
title:
|
|
1637
|
-
description:
|
|
1638
|
-
action: c ? /* @__PURE__ */
|
|
1692
|
+
}), e.length === 0 ? v ?? /* @__PURE__ */ H($, {
|
|
1693
|
+
title: x.emptyTitle,
|
|
1694
|
+
description: x.emptyDescription,
|
|
1695
|
+
action: c ? /* @__PURE__ */ H(a, {
|
|
1639
1696
|
tone: "primary",
|
|
1640
1697
|
type: "button",
|
|
1641
1698
|
onClick: c,
|
|
1642
|
-
icon:
|
|
1643
|
-
children:
|
|
1699
|
+
icon: q,
|
|
1700
|
+
children: x.createLabel
|
|
1644
1701
|
}) : void 0
|
|
1645
|
-
}) : /* @__PURE__ */
|
|
1702
|
+
}) : /* @__PURE__ */ H(N, { children: e.map((e, t) => {
|
|
1646
1703
|
let n = l ? () => l(e) : void 0, r = d ? () => d(e) : void 0, i = f ? () => f(e) : void 0, a = [...r ? [{
|
|
1647
1704
|
id: "edit",
|
|
1648
|
-
label:
|
|
1649
|
-
icon: /* @__PURE__ */
|
|
1705
|
+
label: x.editLabel,
|
|
1706
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
1650
1707
|
onClick: () => r(),
|
|
1651
1708
|
tone: "secondary",
|
|
1652
1709
|
buttonStyle: "ghost"
|
|
1653
1710
|
}] : [], ...i ? [{
|
|
1654
1711
|
id: "delete",
|
|
1655
|
-
label:
|
|
1656
|
-
icon: /* @__PURE__ */
|
|
1712
|
+
label: x.deleteLabel,
|
|
1713
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
1657
1714
|
onClick: () => i(),
|
|
1658
1715
|
tone: "destructive"
|
|
1659
|
-
}] : []], o =
|
|
1716
|
+
}] : []], o = p ? p(e, {
|
|
1660
1717
|
index: t,
|
|
1661
1718
|
onSelect: n,
|
|
1662
1719
|
onEdit: r,
|
|
1663
1720
|
onDelete: i
|
|
1664
|
-
}) : /* @__PURE__ */
|
|
1721
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
1665
1722
|
item: e,
|
|
1666
1723
|
actions: a,
|
|
1667
|
-
menuLabel:
|
|
1724
|
+
menuLabel: x.actionsLabel
|
|
1668
1725
|
});
|
|
1669
|
-
return _ ? /* @__PURE__ */
|
|
1726
|
+
return _ ? /* @__PURE__ */ H("div", { children: _(e, t) }, e.id) : /* @__PURE__ */ H(nt, {
|
|
1670
1727
|
item: e,
|
|
1671
|
-
actionFallback:
|
|
1728
|
+
actionFallback: x.actionLabel,
|
|
1672
1729
|
onSelect: n,
|
|
1673
1730
|
actions: o
|
|
1674
1731
|
}, e.id);
|
|
1675
1732
|
}) })]
|
|
1676
1733
|
});
|
|
1677
1734
|
}
|
|
1678
|
-
|
|
1735
|
+
_t.displayName = "ProductReadinessCard";
|
|
1679
1736
|
//#endregion
|
|
1680
1737
|
//#region src/components/features/products/components/product-structure-card.tsx
|
|
1681
|
-
function
|
|
1682
|
-
let m = r(
|
|
1738
|
+
function vt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetric: o, onDeleteMetric: s, renderMetricActions: c, actions: l, footerSlot: u, empty: d, className: f, strings: p }) {
|
|
1739
|
+
let m = r(Y, p), h = t ? /* @__PURE__ */ H(a, {
|
|
1683
1740
|
type: "button",
|
|
1684
1741
|
tone: "secondary",
|
|
1685
1742
|
buttonStyle: "ghost",
|
|
1686
1743
|
onClick: t,
|
|
1687
|
-
icon:
|
|
1744
|
+
icon: q,
|
|
1688
1745
|
children: m.createLabel
|
|
1689
1746
|
}) : void 0;
|
|
1690
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ H(A, {
|
|
1691
1748
|
title: m.title,
|
|
1692
1749
|
description: m.description,
|
|
1693
1750
|
actions: l,
|
|
1694
1751
|
headerAction: h,
|
|
1695
1752
|
footerSlot: u,
|
|
1696
1753
|
className: i("product-structure-card--component w-full", f),
|
|
1697
|
-
children: e.length === 0 ? d ?? /* @__PURE__ */
|
|
1754
|
+
children: e.length === 0 ? d ?? /* @__PURE__ */ H($, {
|
|
1698
1755
|
title: m.emptyTitle,
|
|
1699
1756
|
description: m.emptyDescription,
|
|
1700
|
-
action: t ? /* @__PURE__ */
|
|
1757
|
+
action: t ? /* @__PURE__ */ H(a, {
|
|
1701
1758
|
tone: "primary",
|
|
1702
1759
|
type: "button",
|
|
1703
1760
|
onClick: t,
|
|
1704
|
-
icon:
|
|
1761
|
+
icon: q,
|
|
1705
1762
|
children: m.createLabel
|
|
1706
1763
|
}) : void 0
|
|
1707
|
-
}) : /* @__PURE__ */
|
|
1764
|
+
}) : /* @__PURE__ */ H(N, { children: e.map((e, t) => {
|
|
1708
1765
|
let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [
|
|
1709
1766
|
...r ? [{
|
|
1710
1767
|
id: "open",
|
|
1711
1768
|
label: m.viewLabel,
|
|
1712
|
-
icon: /* @__PURE__ */
|
|
1769
|
+
icon: /* @__PURE__ */ H(G, { className: "size-icon-md" }),
|
|
1713
1770
|
onClick: () => r(),
|
|
1714
1771
|
tone: "secondary",
|
|
1715
1772
|
buttonStyle: "ghost"
|
|
@@ -1717,7 +1774,7 @@ function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
|
|
|
1717
1774
|
...i ? [{
|
|
1718
1775
|
id: "edit",
|
|
1719
1776
|
label: m.editLabel,
|
|
1720
|
-
icon: /* @__PURE__ */
|
|
1777
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
1721
1778
|
onClick: () => i(),
|
|
1722
1779
|
tone: "secondary",
|
|
1723
1780
|
buttonStyle: "ghost"
|
|
@@ -1725,7 +1782,7 @@ function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
|
|
|
1725
1782
|
...a ? [{
|
|
1726
1783
|
id: "delete",
|
|
1727
1784
|
label: m.deleteLabel,
|
|
1728
|
-
icon: /* @__PURE__ */
|
|
1785
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
1729
1786
|
onClick: () => a(),
|
|
1730
1787
|
tone: "destructive"
|
|
1731
1788
|
}] : []
|
|
@@ -1734,51 +1791,51 @@ function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
|
|
|
1734
1791
|
onSelect: r,
|
|
1735
1792
|
onEdit: i,
|
|
1736
1793
|
onDelete: a
|
|
1737
|
-
}) : /* @__PURE__ */
|
|
1794
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
1738
1795
|
item: e,
|
|
1739
1796
|
actions: l,
|
|
1740
1797
|
menuLabel: m.actionsLabel
|
|
1741
1798
|
});
|
|
1742
|
-
return /* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ H(tt, {
|
|
1743
1800
|
metric: e,
|
|
1744
1801
|
actions: u
|
|
1745
1802
|
}, e.id);
|
|
1746
1803
|
}) })
|
|
1747
1804
|
});
|
|
1748
1805
|
}
|
|
1749
|
-
|
|
1806
|
+
vt.displayName = "ProductStructureCard";
|
|
1750
1807
|
//#endregion
|
|
1751
1808
|
//#region src/components/features/products/components/product-variants-table.tsx
|
|
1752
|
-
function
|
|
1753
|
-
return /* @__PURE__ */
|
|
1809
|
+
function yt({ variant: e, channelsLabel: t }) {
|
|
1810
|
+
return /* @__PURE__ */ U(u, {
|
|
1754
1811
|
gap: "xs",
|
|
1755
1812
|
className: "product-variants-table--variant-cell min-w-0",
|
|
1756
|
-
children: [/* @__PURE__ */
|
|
1813
|
+
children: [/* @__PURE__ */ U(u, {
|
|
1757
1814
|
gap: "dense",
|
|
1758
|
-
children: [/* @__PURE__ */
|
|
1815
|
+
children: [/* @__PURE__ */ U(u, {
|
|
1759
1816
|
direction: "horizontal",
|
|
1760
1817
|
gap: "sm",
|
|
1761
|
-
children: [/* @__PURE__ */
|
|
1818
|
+
children: [/* @__PURE__ */ H(o, {
|
|
1762
1819
|
type: "inherit",
|
|
1763
1820
|
weight: "semibold",
|
|
1764
1821
|
className: "truncate",
|
|
1765
1822
|
children: e.name
|
|
1766
|
-
}), !!e.status && /* @__PURE__ */
|
|
1823
|
+
}), !!e.status && /* @__PURE__ */ H(ee, {
|
|
1767
1824
|
tone: e.statusTone ?? "secondary",
|
|
1768
1825
|
children: e.status
|
|
1769
1826
|
})]
|
|
1770
|
-
}), !!e.description && /* @__PURE__ */
|
|
1827
|
+
}), !!e.description && /* @__PURE__ */ H(o, {
|
|
1771
1828
|
size: "xs",
|
|
1772
1829
|
type: "secondary",
|
|
1773
1830
|
children: e.description
|
|
1774
1831
|
})]
|
|
1775
|
-
}), !!(e.options?.length || e.channels) && /* @__PURE__ */
|
|
1832
|
+
}), !!(e.options?.length || e.channels) && /* @__PURE__ */ U(u, {
|
|
1776
1833
|
direction: "horizontal",
|
|
1777
1834
|
gap: "xs",
|
|
1778
|
-
children: [e.options?.map((e, t) => /* @__PURE__ */
|
|
1835
|
+
children: [e.options?.map((e, t) => /* @__PURE__ */ H(ee, {
|
|
1779
1836
|
tone: "secondary",
|
|
1780
1837
|
children: e
|
|
1781
|
-
}, t)), !!e.channels && /* @__PURE__ */
|
|
1838
|
+
}, t)), !!e.channels && /* @__PURE__ */ U(o, {
|
|
1782
1839
|
tag: "span",
|
|
1783
1840
|
size: "xs",
|
|
1784
1841
|
type: "secondary",
|
|
@@ -1791,22 +1848,22 @@ function gt({ variant: e, channelsLabel: t }) {
|
|
|
1791
1848
|
})]
|
|
1792
1849
|
});
|
|
1793
1850
|
}
|
|
1794
|
-
function
|
|
1795
|
-
return /* @__PURE__ */
|
|
1851
|
+
function bt({ value: e, emphasis: t = !1 }) {
|
|
1852
|
+
return /* @__PURE__ */ H(e ? S : C, {
|
|
1796
1853
|
type: e ? "inherit" : "secondary",
|
|
1797
1854
|
weight: t ? "semibold" : void 0,
|
|
1798
1855
|
className: "min-w-0 tabular-nums",
|
|
1799
1856
|
children: e ?? "-"
|
|
1800
1857
|
});
|
|
1801
1858
|
}
|
|
1802
|
-
function
|
|
1803
|
-
let h = r(
|
|
1859
|
+
function xt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVariant: o, onDuplicateVariant: s, onDeleteVariant: c, renderVariantActions: l, actions: u, footerSlot: d, empty: f, className: p, strings: m }) {
|
|
1860
|
+
let h = r(Ie, m), g = V(() => {
|
|
1804
1861
|
if (l) return;
|
|
1805
1862
|
let e = [
|
|
1806
1863
|
...n ? [{
|
|
1807
1864
|
id: "open",
|
|
1808
1865
|
label: h.viewLabel,
|
|
1809
|
-
icon: /* @__PURE__ */
|
|
1866
|
+
icon: /* @__PURE__ */ H(G, {
|
|
1810
1867
|
className: "size-icon-sm",
|
|
1811
1868
|
"aria-hidden": "true"
|
|
1812
1869
|
}),
|
|
@@ -1816,7 +1873,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1816
1873
|
...o ? [{
|
|
1817
1874
|
id: "edit",
|
|
1818
1875
|
label: h.editLabel,
|
|
1819
|
-
icon: /* @__PURE__ */
|
|
1876
|
+
icon: /* @__PURE__ */ H(we, {
|
|
1820
1877
|
className: "size-icon-sm",
|
|
1821
1878
|
"aria-hidden": "true"
|
|
1822
1879
|
}),
|
|
@@ -1826,7 +1883,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1826
1883
|
...s ? [{
|
|
1827
1884
|
id: "duplicate",
|
|
1828
1885
|
label: h.duplicateLabel,
|
|
1829
|
-
icon: /* @__PURE__ */
|
|
1886
|
+
icon: /* @__PURE__ */ H(Ce, {
|
|
1830
1887
|
className: "size-icon-sm",
|
|
1831
1888
|
"aria-hidden": "true"
|
|
1832
1889
|
}),
|
|
@@ -1836,7 +1893,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1836
1893
|
...c ? [{
|
|
1837
1894
|
id: "delete",
|
|
1838
1895
|
label: h.deleteLabel,
|
|
1839
|
-
icon: /* @__PURE__ */
|
|
1896
|
+
icon: /* @__PURE__ */ H(J, {
|
|
1840
1897
|
className: "size-icon-sm",
|
|
1841
1898
|
"aria-hidden": "true"
|
|
1842
1899
|
}),
|
|
@@ -1855,12 +1912,12 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1855
1912
|
h.duplicateLabel,
|
|
1856
1913
|
h.editLabel,
|
|
1857
1914
|
h.viewLabel
|
|
1858
|
-
]), _ =
|
|
1915
|
+
]), _ = V(() => {
|
|
1859
1916
|
let e = [
|
|
1860
1917
|
{
|
|
1861
1918
|
accessorKey: "name",
|
|
1862
1919
|
header: h.headers.variant,
|
|
1863
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
1920
|
+
cell: ({ row: e }) => /* @__PURE__ */ H(yt, {
|
|
1864
1921
|
variant: e.original,
|
|
1865
1922
|
channelsLabel: h.headers.channels
|
|
1866
1923
|
})
|
|
@@ -1868,7 +1925,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1868
1925
|
{
|
|
1869
1926
|
accessorKey: "price",
|
|
1870
1927
|
header: h.headers.price,
|
|
1871
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
1928
|
+
cell: ({ row: e }) => /* @__PURE__ */ H(bt, {
|
|
1872
1929
|
value: e.original.price,
|
|
1873
1930
|
emphasis: !0
|
|
1874
1931
|
}),
|
|
@@ -1877,17 +1934,17 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1877
1934
|
{
|
|
1878
1935
|
accessorKey: "inventory",
|
|
1879
1936
|
header: h.headers.inventory,
|
|
1880
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
1937
|
+
cell: ({ row: e }) => /* @__PURE__ */ H(bt, { value: e.original.inventory })
|
|
1881
1938
|
},
|
|
1882
1939
|
{
|
|
1883
1940
|
accessorKey: "sku",
|
|
1884
1941
|
header: h.headers.sku,
|
|
1885
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
1942
|
+
cell: ({ row: e }) => /* @__PURE__ */ H(bt, { value: e.original.sku })
|
|
1886
1943
|
},
|
|
1887
1944
|
{
|
|
1888
1945
|
accessorKey: "updatedAt",
|
|
1889
1946
|
header: h.headers.updated,
|
|
1890
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
1947
|
+
cell: ({ row: e }) => /* @__PURE__ */ H(bt, { value: e.original.updatedAt })
|
|
1891
1948
|
}
|
|
1892
1949
|
];
|
|
1893
1950
|
return l && e.push({
|
|
@@ -1915,32 +1972,32 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1915
1972
|
h.headers.sku,
|
|
1916
1973
|
h.headers.updated,
|
|
1917
1974
|
h.headers.variant
|
|
1918
|
-
]), v = t ? /* @__PURE__ */
|
|
1975
|
+
]), v = t ? /* @__PURE__ */ H(a, {
|
|
1919
1976
|
type: "button",
|
|
1920
1977
|
tone: "secondary",
|
|
1921
1978
|
buttonStyle: "ghost",
|
|
1922
1979
|
onClick: t,
|
|
1923
|
-
icon:
|
|
1980
|
+
icon: q,
|
|
1924
1981
|
children: h.createLabel
|
|
1925
1982
|
}) : void 0;
|
|
1926
|
-
return /* @__PURE__ */
|
|
1983
|
+
return /* @__PURE__ */ H(A, {
|
|
1927
1984
|
title: h.title,
|
|
1928
1985
|
description: h.description,
|
|
1929
1986
|
actions: u,
|
|
1930
1987
|
headerAction: v,
|
|
1931
1988
|
footerSlot: d,
|
|
1932
1989
|
className: i("product-variants-table--component w-full", p),
|
|
1933
|
-
children: e.length === 0 ? f ?? /* @__PURE__ */
|
|
1990
|
+
children: e.length === 0 ? f ?? /* @__PURE__ */ H($, {
|
|
1934
1991
|
title: h.emptyTitle,
|
|
1935
1992
|
description: h.emptyDescription,
|
|
1936
|
-
action: t ? /* @__PURE__ */
|
|
1993
|
+
action: t ? /* @__PURE__ */ H(a, {
|
|
1937
1994
|
tone: "primary",
|
|
1938
1995
|
type: "button",
|
|
1939
1996
|
onClick: t,
|
|
1940
|
-
icon:
|
|
1997
|
+
icon: q,
|
|
1941
1998
|
children: h.createLabel
|
|
1942
1999
|
}) : void 0
|
|
1943
|
-
}) : /* @__PURE__ */
|
|
2000
|
+
}) : /* @__PURE__ */ H(he, {
|
|
1944
2001
|
data: e,
|
|
1945
2002
|
columns: _,
|
|
1946
2003
|
getRowId: (e) => e.id,
|
|
@@ -1957,43 +2014,43 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
|
|
|
1957
2014
|
})
|
|
1958
2015
|
});
|
|
1959
2016
|
}
|
|
1960
|
-
|
|
2017
|
+
xt.displayName = "ProductVariantsTable";
|
|
1961
2018
|
//#endregion
|
|
1962
2019
|
//#region src/components/features/products/components/product-overview.tsx
|
|
1963
|
-
function
|
|
1964
|
-
let _ = r(
|
|
1965
|
-
return /* @__PURE__ */
|
|
2020
|
+
function St({ details: e, contract: t, options: n, variants: a, readiness: o, structure: s, operations: c, quote: l, policies: d, slots: f, className: p, mainClassName: m, railClassName: h, strings: g }) {
|
|
2021
|
+
let _ = r(Ve, g), v = !!(o || s || c || l || d || f?.railTop || f?.railBottom);
|
|
2022
|
+
return /* @__PURE__ */ U(u, {
|
|
1966
2023
|
gap: "3xl",
|
|
1967
2024
|
className: i("product-overview--component @container/product-overview", p),
|
|
1968
2025
|
children: [
|
|
1969
2026
|
f?.before,
|
|
1970
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ U("div", {
|
|
1971
2028
|
className: i("grid min-w-0 grid-cols-1 gap-space-3xl", v && "@5xl/product-overview:grid-cols-[minmax(0,1fr)_22rem]"),
|
|
1972
|
-
children: [/* @__PURE__ */
|
|
1973
|
-
render: /* @__PURE__ */
|
|
2029
|
+
children: [/* @__PURE__ */ U(u, {
|
|
2030
|
+
render: /* @__PURE__ */ H("section", {}),
|
|
1974
2031
|
gap: "3xl",
|
|
1975
2032
|
"aria-label": _.mainLabel,
|
|
1976
2033
|
className: i("product-overview--main", m),
|
|
1977
2034
|
children: [
|
|
1978
2035
|
f?.mainTop,
|
|
1979
|
-
!!e && /* @__PURE__ */
|
|
1980
|
-
!!t && /* @__PURE__ */
|
|
1981
|
-
!!n && /* @__PURE__ */
|
|
1982
|
-
!!a && /* @__PURE__ */
|
|
2036
|
+
!!e && /* @__PURE__ */ H(ot, { ...e }),
|
|
2037
|
+
!!t && /* @__PURE__ */ H(at, { ...t }),
|
|
2038
|
+
!!n && /* @__PURE__ */ H(mt, { ...n }),
|
|
2039
|
+
!!a && /* @__PURE__ */ H(xt, { ...a }),
|
|
1983
2040
|
f?.mainBottom
|
|
1984
2041
|
]
|
|
1985
|
-
}), !!v && /* @__PURE__ */
|
|
1986
|
-
render: /* @__PURE__ */
|
|
2042
|
+
}), !!v && /* @__PURE__ */ U(u, {
|
|
2043
|
+
render: /* @__PURE__ */ H("aside", {}),
|
|
1987
2044
|
gap: "3xl",
|
|
1988
2045
|
"aria-label": _.railLabel,
|
|
1989
2046
|
className: i("product-overview--rail", h),
|
|
1990
2047
|
children: [
|
|
1991
2048
|
f?.railTop,
|
|
1992
|
-
!!o && /* @__PURE__ */
|
|
1993
|
-
!!s && /* @__PURE__ */
|
|
1994
|
-
!!c && /* @__PURE__ */
|
|
1995
|
-
!!l && /* @__PURE__ */
|
|
1996
|
-
!!d && /* @__PURE__ */
|
|
2049
|
+
!!o && /* @__PURE__ */ H(_t, { ...o }),
|
|
2050
|
+
!!s && /* @__PURE__ */ H(vt, { ...s }),
|
|
2051
|
+
!!c && /* @__PURE__ */ H(ct, { ...c }),
|
|
2052
|
+
!!l && /* @__PURE__ */ H(gt, { ...l }),
|
|
2053
|
+
!!d && /* @__PURE__ */ H(ht, { ...d }),
|
|
1997
2054
|
f?.railBottom
|
|
1998
2055
|
]
|
|
1999
2056
|
})]
|
|
@@ -2002,15 +2059,15 @@ function yt({ details: e, contract: t, options: n, variants: a, readiness: o, st
|
|
|
2002
2059
|
]
|
|
2003
2060
|
});
|
|
2004
2061
|
}
|
|
2005
|
-
|
|
2062
|
+
St.displayName = "ProductOverview";
|
|
2006
2063
|
//#endregion
|
|
2007
2064
|
//#region src/components/features/products/components/product-variant-action-menu.tsx
|
|
2008
|
-
function
|
|
2065
|
+
function Ct(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, onDeleteVariant: i }, a) {
|
|
2009
2066
|
return [
|
|
2010
2067
|
...t ? [{
|
|
2011
2068
|
id: "open",
|
|
2012
2069
|
label: a.viewLabel,
|
|
2013
|
-
icon: /* @__PURE__ */
|
|
2070
|
+
icon: /* @__PURE__ */ H(G, { className: "size-icon-md" }),
|
|
2014
2071
|
onClick: () => t(e),
|
|
2015
2072
|
tone: "secondary",
|
|
2016
2073
|
buttonStyle: "ghost"
|
|
@@ -2018,7 +2075,7 @@ function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
|
|
|
2018
2075
|
...n ? [{
|
|
2019
2076
|
id: "edit",
|
|
2020
2077
|
label: a.editLabel,
|
|
2021
|
-
icon: /* @__PURE__ */
|
|
2078
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
2022
2079
|
onClick: () => n(e),
|
|
2023
2080
|
tone: "secondary",
|
|
2024
2081
|
buttonStyle: "ghost"
|
|
@@ -2026,7 +2083,7 @@ function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
|
|
|
2026
2083
|
...r ? [{
|
|
2027
2084
|
id: "duplicate",
|
|
2028
2085
|
label: a.duplicateLabel,
|
|
2029
|
-
icon: /* @__PURE__ */
|
|
2086
|
+
icon: /* @__PURE__ */ H(Ce, { className: "size-icon-md" }),
|
|
2030
2087
|
onClick: () => r(e),
|
|
2031
2088
|
tone: "secondary",
|
|
2032
2089
|
buttonStyle: "ghost"
|
|
@@ -2034,15 +2091,15 @@ function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
|
|
|
2034
2091
|
...i ? [{
|
|
2035
2092
|
id: "delete",
|
|
2036
2093
|
label: a.deleteLabel,
|
|
2037
|
-
icon: /* @__PURE__ */
|
|
2094
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
2038
2095
|
onClick: () => i(e),
|
|
2039
2096
|
tone: "destructive"
|
|
2040
2097
|
}] : []
|
|
2041
2098
|
];
|
|
2042
2099
|
}
|
|
2043
|
-
function
|
|
2044
|
-
let f = r(
|
|
2045
|
-
return p || m || h || g || c ? c ? /* @__PURE__ */
|
|
2100
|
+
function wt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, onDuplicateVariant: o, onDeleteVariant: s, renderVariantActions: c, menuLabel: l, className: u, strings: d }) {
|
|
2101
|
+
let f = r(Re, d), p = n ? () => n(e) : void 0, m = a ? () => a(e) : void 0, h = o ? () => o(e) : void 0, g = s ? () => s(e) : void 0;
|
|
2102
|
+
return p || m || h || g || c ? c ? /* @__PURE__ */ H("div", {
|
|
2046
2103
|
className: i("product-variant-action-menu--component flex justify-end", u),
|
|
2047
2104
|
children: c(e, {
|
|
2048
2105
|
index: t,
|
|
@@ -2051,11 +2108,11 @@ function xt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, on
|
|
|
2051
2108
|
onDuplicate: h,
|
|
2052
2109
|
onDelete: g
|
|
2053
2110
|
})
|
|
2054
|
-
}) : /* @__PURE__ */
|
|
2111
|
+
}) : /* @__PURE__ */ H(Ye, {
|
|
2055
2112
|
item: e,
|
|
2056
2113
|
menuLabel: l ?? f.actionsLabel,
|
|
2057
2114
|
className: i("product-variant-action-menu--component", u),
|
|
2058
|
-
actions:
|
|
2115
|
+
actions: Ct(e, {
|
|
2059
2116
|
onSelectVariant: n,
|
|
2060
2117
|
onEditVariant: a,
|
|
2061
2118
|
onDuplicateVariant: o,
|
|
@@ -2066,11 +2123,11 @@ function xt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, on
|
|
|
2066
2123
|
}))
|
|
2067
2124
|
}) : null;
|
|
2068
2125
|
}
|
|
2069
|
-
|
|
2126
|
+
wt.displayName = "ProductVariantActionMenu";
|
|
2070
2127
|
//#endregion
|
|
2071
2128
|
//#region src/components/features/products/components/product-variant-details.tsx
|
|
2072
|
-
var
|
|
2073
|
-
function
|
|
2129
|
+
var Tt = (e) => e != null && e !== !1 && e !== "";
|
|
2130
|
+
function Et(e, t) {
|
|
2074
2131
|
return [
|
|
2075
2132
|
{
|
|
2076
2133
|
label: t.price,
|
|
@@ -2092,24 +2149,24 @@ function Ct(e, t) {
|
|
|
2092
2149
|
label: t.updated,
|
|
2093
2150
|
value: e.updatedAt
|
|
2094
2151
|
}
|
|
2095
|
-
].filter((e) =>
|
|
2152
|
+
].filter((e) => Tt(e.value));
|
|
2096
2153
|
}
|
|
2097
|
-
function
|
|
2098
|
-
let
|
|
2154
|
+
function Dt({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c, onSelectVariant: l, onEditVariant: d, onDuplicateVariant: f, onDeleteVariant: p, onSelectOption: m, actions: h, headerEnd: g, footerSlot: _, empty: y, renderActions: b, renderMetadata: x, renderOption: S, className: C, strings: w }) {
|
|
2155
|
+
let T = r(ze, w), E = e ? t ?? Et(e, T.metadata) : [], D = [...e && !b ? Ct(e, {
|
|
2099
2156
|
onSelectVariant: l,
|
|
2100
2157
|
onEditVariant: d,
|
|
2101
2158
|
onDuplicateVariant: f,
|
|
2102
2159
|
onDeleteVariant: p
|
|
2103
|
-
},
|
|
2104
|
-
className: i("product-variant-details--header-actions flex items-center",
|
|
2105
|
-
children: [!!c && /* @__PURE__ */
|
|
2160
|
+
}, Re) : [], ...h ?? []], O = !!(e && b), k = /* @__PURE__ */ U("div", {
|
|
2161
|
+
className: i("product-variant-details--header-actions flex items-center", v.commands),
|
|
2162
|
+
children: [!!c && /* @__PURE__ */ H(a, {
|
|
2106
2163
|
type: "button",
|
|
2107
2164
|
tone: "secondary",
|
|
2108
2165
|
buttonStyle: "ghost",
|
|
2109
2166
|
onClick: c,
|
|
2110
|
-
icon:
|
|
2111
|
-
children:
|
|
2112
|
-
}), !!
|
|
2167
|
+
icon: Se,
|
|
2168
|
+
children: T.backLabel
|
|
2169
|
+
}), !!O && e && /* @__PURE__ */ H(wt, {
|
|
2113
2170
|
variant: e,
|
|
2114
2171
|
onSelectVariant: l,
|
|
2115
2172
|
onEditVariant: d,
|
|
@@ -2117,190 +2174,202 @@ function wt({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c,
|
|
|
2117
2174
|
onDeleteVariant: p,
|
|
2118
2175
|
renderVariantActions: b
|
|
2119
2176
|
})]
|
|
2120
|
-
}),
|
|
2121
|
-
return /* @__PURE__ */
|
|
2122
|
-
title: e?.name ??
|
|
2123
|
-
titleSuffix: e?.status ? /* @__PURE__ */
|
|
2177
|
+
}), te = e?.options ?? [];
|
|
2178
|
+
return /* @__PURE__ */ H(A, {
|
|
2179
|
+
title: e?.name ?? T.title,
|
|
2180
|
+
titleSuffix: e?.status ? /* @__PURE__ */ H(ee, {
|
|
2124
2181
|
tone: e.statusTone ?? "secondary",
|
|
2125
2182
|
children: e.status
|
|
2126
2183
|
}) : void 0,
|
|
2127
|
-
description: e?.description ??
|
|
2128
|
-
actions:
|
|
2129
|
-
headerAction: c ||
|
|
2130
|
-
headerEnd:
|
|
2131
|
-
footerSlot:
|
|
2132
|
-
className: i("product-variant-details--component w-full",
|
|
2133
|
-
children: e ? /* @__PURE__ */
|
|
2184
|
+
description: e?.description ?? T.description,
|
|
2185
|
+
actions: D.length ? D : void 0,
|
|
2186
|
+
headerAction: c || O ? k : void 0,
|
|
2187
|
+
headerEnd: g,
|
|
2188
|
+
footerSlot: _,
|
|
2189
|
+
className: i("product-variant-details--component w-full", C),
|
|
2190
|
+
children: e ? /* @__PURE__ */ U(u, {
|
|
2134
2191
|
gap: "2xl",
|
|
2135
2192
|
className: "product-variant-details--body",
|
|
2136
2193
|
children: [
|
|
2137
|
-
!!s && /* @__PURE__ */
|
|
2138
|
-
className: "product-variant-details--media overflow-hidden rounded-
|
|
2194
|
+
!!s && /* @__PURE__ */ H("div", {
|
|
2195
|
+
className: "product-variant-details--media overflow-hidden rounded-radius border border-border bg-muted/30",
|
|
2139
2196
|
children: s
|
|
2140
2197
|
}),
|
|
2141
|
-
x ? x(e) :
|
|
2198
|
+
x ? x(e) : E.some(Boolean) && /* @__PURE__ */ U(u, {
|
|
2142
2199
|
gap: "md",
|
|
2143
2200
|
className: "product-variant-details--facts",
|
|
2144
|
-
children: [/* @__PURE__ */
|
|
2201
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2145
2202
|
type: "inherit",
|
|
2146
2203
|
weight: "semibold",
|
|
2147
|
-
children:
|
|
2148
|
-
}), /* @__PURE__ */
|
|
2204
|
+
children: T.factsTitle
|
|
2205
|
+
}), /* @__PURE__ */ H(I, {
|
|
2149
2206
|
adaptTo: "container",
|
|
2150
|
-
items:
|
|
2207
|
+
items: E,
|
|
2151
2208
|
columns: 3,
|
|
2152
2209
|
density: "compact",
|
|
2153
2210
|
className: "product-variant-details--metadata"
|
|
2154
2211
|
})]
|
|
2155
2212
|
}),
|
|
2156
|
-
!!
|
|
2213
|
+
!!te.length && /* @__PURE__ */ U(u, {
|
|
2157
2214
|
gap: "md",
|
|
2158
2215
|
className: "product-variant-details--selected-options",
|
|
2159
|
-
children: [/* @__PURE__ */
|
|
2216
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2160
2217
|
type: "inherit",
|
|
2161
2218
|
weight: "semibold",
|
|
2162
|
-
children:
|
|
2163
|
-
}), /* @__PURE__ */
|
|
2219
|
+
children: T.selectedOptionsTitle
|
|
2220
|
+
}), /* @__PURE__ */ H("div", {
|
|
2164
2221
|
className: "flex flex-wrap gap-space-sm",
|
|
2165
|
-
children:
|
|
2222
|
+
children: te.map((e, t) => /* @__PURE__ */ H(ee, {
|
|
2166
2223
|
tone: "secondary",
|
|
2167
2224
|
children: e
|
|
2168
2225
|
}, t))
|
|
2169
2226
|
})]
|
|
2170
2227
|
}),
|
|
2171
|
-
!!n.length && /* @__PURE__ */
|
|
2228
|
+
!!n.length && /* @__PURE__ */ U(u, {
|
|
2172
2229
|
gap: "md",
|
|
2173
2230
|
className: "product-variant-details--related-options",
|
|
2174
|
-
children: [/* @__PURE__ */
|
|
2231
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2175
2232
|
type: "inherit",
|
|
2176
2233
|
weight: "semibold",
|
|
2177
|
-
children:
|
|
2178
|
-
}), /* @__PURE__ */
|
|
2234
|
+
children: T.relatedOptionsTitle
|
|
2235
|
+
}), /* @__PURE__ */ H(N, { children: n.map((e, t) => S ? /* @__PURE__ */ H("div", { children: S(e, t) }, e.id) : /* @__PURE__ */ H(it, {
|
|
2179
2236
|
item: e,
|
|
2180
|
-
actionLabel:
|
|
2237
|
+
actionLabel: T.viewOptionLabel,
|
|
2181
2238
|
onSelect: m ? () => m(e) : void 0
|
|
2182
2239
|
}, e.id)) })]
|
|
2183
2240
|
})
|
|
2184
2241
|
]
|
|
2185
|
-
}) : y ?? /* @__PURE__ */
|
|
2186
|
-
title:
|
|
2187
|
-
description:
|
|
2242
|
+
}) : y ?? /* @__PURE__ */ H($, {
|
|
2243
|
+
title: T.emptyTitle,
|
|
2244
|
+
description: T.emptyDescription
|
|
2188
2245
|
})
|
|
2189
2246
|
});
|
|
2190
2247
|
}
|
|
2191
|
-
|
|
2248
|
+
Dt.displayName = "ProductVariantDetails";
|
|
2192
2249
|
//#endregion
|
|
2193
2250
|
//#region src/components/features/products/components/product-variant-editor.tsx
|
|
2194
|
-
var
|
|
2251
|
+
var Ot = (e) => e.map((e) => ({
|
|
2195
2252
|
value: e.value,
|
|
2196
2253
|
label: e.label,
|
|
2197
2254
|
disabled: e.disabled
|
|
2198
2255
|
}));
|
|
2199
|
-
function
|
|
2200
|
-
let
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
...
|
|
2256
|
+
function kt({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s = [], onValueChange: c, onSubmit: l, onError: d, onCancel: f, onDelete: p, actions: m, headerEnd: h, footerSlot: g, visibleFields: _, errors: y, formId: b, showHeader: x = !0, children: S, disabled: C = !1, submitting: w = !1, className: ee, strings: T }) {
|
|
2257
|
+
let E = r(Be, T), D = ve(), ne = b ?? D, ie = e !== void 0, [ae, oe] = be(t ?? {}), [se, j] = be(!1), M = (ie ? e : ae) ?? {}, N = M.options, ce = n.filter((e) => e.value !== void 0 && (!N || !Object.hasOwn(N, e.id))), P = ce.length > 0 ? {
|
|
2258
|
+
...M,
|
|
2259
|
+
options: {
|
|
2260
|
+
...N,
|
|
2261
|
+
...Object.fromEntries(ce.map((e) => [e.id, e.value]))
|
|
2262
|
+
}
|
|
2263
|
+
} : M, F = w || se, I = C || F, L = (e) => _?.[e] !== !1, le = L("name") || L("sku") || L("description"), ue = L("price") || L("inventory") || L("status") || L("channels"), de = (e) => {
|
|
2264
|
+
ie || oe(e), c?.(e);
|
|
2265
|
+
}, fe = (e, t) => {
|
|
2266
|
+
de({
|
|
2267
|
+
...P,
|
|
2205
2268
|
[e]: t
|
|
2206
2269
|
});
|
|
2207
|
-
},
|
|
2208
|
-
|
|
2209
|
-
...
|
|
2270
|
+
}, pe = (e, t) => {
|
|
2271
|
+
de({
|
|
2272
|
+
...P,
|
|
2210
2273
|
options: {
|
|
2211
|
-
...
|
|
2274
|
+
...P.options,
|
|
2212
2275
|
[e.id]: t
|
|
2213
2276
|
}
|
|
2214
2277
|
});
|
|
2215
|
-
},
|
|
2216
|
-
if (e.preventDefault(), l && !
|
|
2217
|
-
|
|
2278
|
+
}, me = async (e) => {
|
|
2279
|
+
if (e.preventDefault(), l && !F) {
|
|
2280
|
+
j(!0);
|
|
2218
2281
|
try {
|
|
2219
|
-
await l(
|
|
2282
|
+
await l(P);
|
|
2220
2283
|
} catch (e) {
|
|
2221
2284
|
d?.(e);
|
|
2222
2285
|
} finally {
|
|
2223
|
-
|
|
2286
|
+
j(!1);
|
|
2224
2287
|
}
|
|
2225
2288
|
}
|
|
2226
|
-
},
|
|
2289
|
+
}, R = /* @__PURE__ */ U("div", {
|
|
2227
2290
|
className: "product-variant-editor--footer flex flex-col-reverse gap-space-md @sm/product-variant-editor:flex-row @sm/product-variant-editor:items-center @sm/product-variant-editor:justify-between",
|
|
2228
|
-
children: [/* @__PURE__ */
|
|
2291
|
+
children: [/* @__PURE__ */ H("div", { children: !!p && /* @__PURE__ */ H(a, {
|
|
2229
2292
|
type: "button",
|
|
2230
2293
|
tone: "destructive",
|
|
2231
2294
|
buttonStyle: "ghost",
|
|
2232
|
-
onClick: () => p(
|
|
2233
|
-
disabled:
|
|
2234
|
-
children:
|
|
2235
|
-
}) }), /* @__PURE__ */
|
|
2295
|
+
onClick: () => p(P),
|
|
2296
|
+
disabled: I,
|
|
2297
|
+
children: E.deleteLabel
|
|
2298
|
+
}) }), /* @__PURE__ */ U("div", {
|
|
2236
2299
|
className: "flex flex-col-reverse gap-space-md @sm/product-variant-editor:flex-row @sm/product-variant-editor:justify-end",
|
|
2237
|
-
children: [!!f && /* @__PURE__ */
|
|
2300
|
+
children: [!!f && /* @__PURE__ */ H(a, {
|
|
2238
2301
|
type: "button",
|
|
2239
2302
|
tone: "secondary",
|
|
2240
2303
|
buttonStyle: "ghost",
|
|
2241
2304
|
onClick: f,
|
|
2242
|
-
disabled:
|
|
2243
|
-
children:
|
|
2244
|
-
}), !!l && /* @__PURE__ */
|
|
2305
|
+
disabled: I,
|
|
2306
|
+
children: E.cancelLabel
|
|
2307
|
+
}), !!l && /* @__PURE__ */ H(a, {
|
|
2245
2308
|
tone: "primary",
|
|
2246
2309
|
type: "submit",
|
|
2247
|
-
form:
|
|
2248
|
-
disabled:
|
|
2249
|
-
children:
|
|
2310
|
+
form: ne,
|
|
2311
|
+
disabled: I,
|
|
2312
|
+
children: F ? E.savingLabel : E.saveLabel
|
|
2250
2313
|
})]
|
|
2251
2314
|
})]
|
|
2252
|
-
}),
|
|
2253
|
-
return /* @__PURE__ */
|
|
2254
|
-
title: x.title,
|
|
2255
|
-
description: x.description,
|
|
2315
|
+
}), z = !!(p || f || l);
|
|
2316
|
+
return /* @__PURE__ */ H(A, {
|
|
2317
|
+
title: x ? E.title : void 0,
|
|
2318
|
+
description: x ? E.description : void 0,
|
|
2256
2319
|
actions: m,
|
|
2257
2320
|
headerEnd: h,
|
|
2258
2321
|
footerSlot: g,
|
|
2259
|
-
className: i("product-variant-editor--component @container/product-variant-editor w-full",
|
|
2260
|
-
children: /* @__PURE__ */
|
|
2261
|
-
render: /* @__PURE__ */
|
|
2262
|
-
id:
|
|
2263
|
-
onSubmit:
|
|
2322
|
+
className: i("product-variant-editor--component @container/product-variant-editor w-full", ee),
|
|
2323
|
+
children: /* @__PURE__ */ U(u, {
|
|
2324
|
+
render: /* @__PURE__ */ H("form", {
|
|
2325
|
+
id: ne,
|
|
2326
|
+
onSubmit: me
|
|
2264
2327
|
}),
|
|
2265
2328
|
gap: "2xl",
|
|
2266
2329
|
className: "product-variant-editor--form",
|
|
2267
2330
|
children: [
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
className: "product-variant-editor--section grid
|
|
2270
|
-
children: [/* @__PURE__ */
|
|
2331
|
+
le && /* @__PURE__ */ U("section", {
|
|
2332
|
+
className: i("product-variant-editor--section grid", v.related),
|
|
2333
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2271
2334
|
type: "inherit",
|
|
2272
2335
|
weight: "semibold",
|
|
2273
|
-
children:
|
|
2274
|
-
}), /* @__PURE__ */
|
|
2275
|
-
className: "grid
|
|
2336
|
+
children: E.identityTitle
|
|
2337
|
+
}), /* @__PURE__ */ U("div", {
|
|
2338
|
+
className: i("grid @sm/product-variant-editor:grid-cols-2", v.related),
|
|
2276
2339
|
children: [
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
label:
|
|
2340
|
+
L("name") && /* @__PURE__ */ H(k, {
|
|
2341
|
+
label: E.fields.name,
|
|
2342
|
+
error: y?.name,
|
|
2279
2343
|
required: !0,
|
|
2280
|
-
children: /* @__PURE__ */
|
|
2281
|
-
value:
|
|
2282
|
-
onChange: (e) =>
|
|
2283
|
-
|
|
2284
|
-
|
|
2344
|
+
children: /* @__PURE__ */ H(O, {
|
|
2345
|
+
value: P.name ?? "",
|
|
2346
|
+
onChange: (e) => fe("name", e.target.value),
|
|
2347
|
+
invalid: !!y?.name,
|
|
2348
|
+
placeholder: E.placeholders.name,
|
|
2349
|
+
disabled: I
|
|
2285
2350
|
})
|
|
2286
2351
|
}),
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
-
label:
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2352
|
+
L("sku") && /* @__PURE__ */ H(k, {
|
|
2353
|
+
label: E.fields.sku,
|
|
2354
|
+
error: y?.sku,
|
|
2355
|
+
children: /* @__PURE__ */ H(O, {
|
|
2356
|
+
value: P.sku ?? "",
|
|
2357
|
+
onChange: (e) => fe("sku", e.target.value),
|
|
2358
|
+
invalid: !!y?.sku,
|
|
2359
|
+
placeholder: E.placeholders.sku,
|
|
2360
|
+
disabled: I
|
|
2294
2361
|
})
|
|
2295
2362
|
}),
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
label:
|
|
2363
|
+
L("description") && /* @__PURE__ */ H(k, {
|
|
2364
|
+
label: E.fields.description,
|
|
2365
|
+
error: y?.description,
|
|
2298
2366
|
className: "@sm/product-variant-editor:col-span-2",
|
|
2299
|
-
children: /* @__PURE__ */
|
|
2300
|
-
value:
|
|
2301
|
-
onChange: (e) =>
|
|
2302
|
-
|
|
2303
|
-
|
|
2367
|
+
children: /* @__PURE__ */ H(te, {
|
|
2368
|
+
value: P.description ?? "",
|
|
2369
|
+
onChange: (e) => fe("description", e.target.value),
|
|
2370
|
+
invalid: !!y?.description,
|
|
2371
|
+
placeholder: E.placeholders.description,
|
|
2372
|
+
disabled: I,
|
|
2304
2373
|
autoResize: !0,
|
|
2305
2374
|
minRows: 2
|
|
2306
2375
|
})
|
|
@@ -2308,144 +2377,154 @@ function Et({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s
|
|
|
2308
2377
|
]
|
|
2309
2378
|
})]
|
|
2310
2379
|
}),
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
className: "product-variant-editor--section grid
|
|
2313
|
-
children: [/* @__PURE__ */
|
|
2380
|
+
ue && /* @__PURE__ */ U("section", {
|
|
2381
|
+
className: i("product-variant-editor--section grid", v.related),
|
|
2382
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2314
2383
|
type: "inherit",
|
|
2315
2384
|
weight: "semibold",
|
|
2316
|
-
children:
|
|
2317
|
-
}), /* @__PURE__ */
|
|
2318
|
-
className: "grid
|
|
2385
|
+
children: E.commercialTitle
|
|
2386
|
+
}), /* @__PURE__ */ U("div", {
|
|
2387
|
+
className: i("grid @sm/product-variant-editor:grid-cols-2", v.related),
|
|
2319
2388
|
children: [
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
label:
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2389
|
+
L("price") && /* @__PURE__ */ H(k, {
|
|
2390
|
+
label: E.fields.price,
|
|
2391
|
+
error: y?.price,
|
|
2392
|
+
children: /* @__PURE__ */ H(O, {
|
|
2393
|
+
value: P.price ?? "",
|
|
2394
|
+
onChange: (e) => fe("price", e.target.value),
|
|
2395
|
+
invalid: !!y?.price,
|
|
2396
|
+
placeholder: E.placeholders.price,
|
|
2397
|
+
disabled: I
|
|
2327
2398
|
})
|
|
2328
2399
|
}),
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
label:
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2400
|
+
L("inventory") && /* @__PURE__ */ H(k, {
|
|
2401
|
+
label: E.fields.inventory,
|
|
2402
|
+
error: y?.inventory,
|
|
2403
|
+
children: /* @__PURE__ */ H(O, {
|
|
2404
|
+
value: P.inventory ?? "",
|
|
2405
|
+
onChange: (e) => fe("inventory", e.target.value),
|
|
2406
|
+
invalid: !!y?.inventory,
|
|
2407
|
+
placeholder: E.placeholders.inventory,
|
|
2408
|
+
disabled: I,
|
|
2336
2409
|
inputMode: "numeric"
|
|
2337
2410
|
})
|
|
2338
2411
|
}),
|
|
2339
|
-
/* @__PURE__ */
|
|
2340
|
-
label:
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2412
|
+
L("status") && /* @__PURE__ */ H(k, {
|
|
2413
|
+
label: E.fields.status,
|
|
2414
|
+
error: y?.status,
|
|
2415
|
+
children: s.length > 0 ? /* @__PURE__ */ H(re, {
|
|
2416
|
+
options: Ot(s),
|
|
2417
|
+
value: P.status ?? null,
|
|
2418
|
+
onValueChange: (e) => fe("status", e ?? ""),
|
|
2419
|
+
invalid: !!y?.status,
|
|
2420
|
+
placeholder: E.statusPlaceholder,
|
|
2421
|
+
disabled: I,
|
|
2422
|
+
"aria-label": E.fields.status
|
|
2423
|
+
}) : /* @__PURE__ */ H(O, {
|
|
2424
|
+
value: P.status ?? "",
|
|
2425
|
+
onChange: (e) => fe("status", e.target.value),
|
|
2426
|
+
invalid: !!y?.status,
|
|
2427
|
+
placeholder: E.placeholders.status,
|
|
2428
|
+
disabled: I
|
|
2353
2429
|
})
|
|
2354
2430
|
}),
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
label:
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2431
|
+
L("channels") && /* @__PURE__ */ H(k, {
|
|
2432
|
+
label: E.fields.channels,
|
|
2433
|
+
error: y?.channels,
|
|
2434
|
+
children: /* @__PURE__ */ H(O, {
|
|
2435
|
+
value: P.channels ?? "",
|
|
2436
|
+
onChange: (e) => fe("channels", e.target.value),
|
|
2437
|
+
invalid: !!y?.channels,
|
|
2438
|
+
placeholder: E.placeholders.channels,
|
|
2439
|
+
disabled: I
|
|
2362
2440
|
})
|
|
2363
2441
|
})
|
|
2364
2442
|
]
|
|
2365
2443
|
})]
|
|
2366
2444
|
}),
|
|
2367
|
-
!!n.length && /* @__PURE__ */
|
|
2368
|
-
className: "product-variant-editor--section grid
|
|
2369
|
-
children: [/* @__PURE__ */
|
|
2445
|
+
!!n.length && /* @__PURE__ */ U("section", {
|
|
2446
|
+
className: i("product-variant-editor--section grid", v.related),
|
|
2447
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2370
2448
|
type: "inherit",
|
|
2371
2449
|
weight: "semibold",
|
|
2372
|
-
children:
|
|
2373
|
-
}), /* @__PURE__ */
|
|
2374
|
-
className: "grid
|
|
2450
|
+
children: E.optionsTitle
|
|
2451
|
+
}), /* @__PURE__ */ H("div", {
|
|
2452
|
+
className: i("grid @sm/product-variant-editor:grid-cols-2", v.related),
|
|
2375
2453
|
children: n.map((e) => {
|
|
2376
|
-
let t =
|
|
2377
|
-
return /* @__PURE__ */
|
|
2454
|
+
let t = P.options?.[e.id] ?? "", n = !!e.choices?.length;
|
|
2455
|
+
return /* @__PURE__ */ H(k, {
|
|
2378
2456
|
label: e.label,
|
|
2379
2457
|
helperText: e.helperText,
|
|
2380
|
-
children: n ? /* @__PURE__ */
|
|
2381
|
-
options:
|
|
2458
|
+
children: n ? /* @__PURE__ */ H(re, {
|
|
2459
|
+
options: Ot(e.choices ?? []),
|
|
2382
2460
|
value: t || null,
|
|
2383
|
-
onValueChange: (t) =>
|
|
2384
|
-
placeholder: e.placeholder ??
|
|
2385
|
-
disabled:
|
|
2461
|
+
onValueChange: (t) => pe(e, t),
|
|
2462
|
+
placeholder: e.placeholder ?? E.optionPlaceholder,
|
|
2463
|
+
disabled: I,
|
|
2386
2464
|
"aria-label": e.label
|
|
2387
|
-
}) : /* @__PURE__ */
|
|
2465
|
+
}) : /* @__PURE__ */ H(O, {
|
|
2388
2466
|
value: t,
|
|
2389
|
-
onChange: (t) =>
|
|
2390
|
-
placeholder: e.placeholder ??
|
|
2391
|
-
disabled:
|
|
2467
|
+
onChange: (t) => pe(e, t.target.value),
|
|
2468
|
+
placeholder: e.placeholder ?? E.optionPlaceholder,
|
|
2469
|
+
disabled: I
|
|
2392
2470
|
})
|
|
2393
2471
|
}, e.id);
|
|
2394
2472
|
})
|
|
2395
2473
|
})]
|
|
2396
2474
|
}),
|
|
2397
|
-
|
|
2475
|
+
S,
|
|
2476
|
+
g == null && z && R
|
|
2398
2477
|
]
|
|
2399
2478
|
})
|
|
2400
2479
|
});
|
|
2401
2480
|
}
|
|
2402
|
-
|
|
2481
|
+
kt.displayName = "ProductVariantEditor";
|
|
2403
2482
|
//#endregion
|
|
2404
2483
|
//#region src/components/features/products/components/product-variants-bulk-table.tsx
|
|
2405
|
-
var
|
|
2484
|
+
var At = [
|
|
2406
2485
|
"variant",
|
|
2407
2486
|
"sku",
|
|
2408
2487
|
"price",
|
|
2409
2488
|
"inventory",
|
|
2410
2489
|
"status"
|
|
2411
|
-
],
|
|
2412
|
-
function
|
|
2490
|
+
], jt = "text", Mt = "text", Nt = "multiple";
|
|
2491
|
+
function Pt(e) {
|
|
2413
2492
|
return typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
2414
2493
|
}
|
|
2415
|
-
function
|
|
2494
|
+
function Ft(e, t) {
|
|
2416
2495
|
let n = e.optionValues?.[t.id];
|
|
2417
2496
|
if (n != null && n !== !1 && n !== "") return n;
|
|
2418
2497
|
let r = e.optionValueIds?.[t.id];
|
|
2419
2498
|
return t.values?.find((e) => e.id === r)?.label ?? void 0;
|
|
2420
2499
|
}
|
|
2421
|
-
function
|
|
2422
|
-
return e.name !== void 0 && e.name !== null && e.name !== "" ? e.name : t.filter((e) => e.usedForVariants !== !1).map((t) =>
|
|
2500
|
+
function It(e, t) {
|
|
2501
|
+
return e.name !== void 0 && e.name !== null && e.name !== "" ? e.name : t.filter((e) => e.usedForVariants !== !1).map((t) => Ft(e, t)).filter((e) => e != null && e !== "").map((e) => Pt(e)).filter(Boolean).join(" / ") || "-";
|
|
2423
2502
|
}
|
|
2424
|
-
function
|
|
2425
|
-
return t.filter((e) => e.usedForVariants !== !1).map((t) =>
|
|
2503
|
+
function Lt(e, t) {
|
|
2504
|
+
return t.filter((e) => e.usedForVariants !== !1).map((t) => Ft(e, t)).filter((e) => e != null && e !== "");
|
|
2426
2505
|
}
|
|
2427
|
-
function
|
|
2428
|
-
return e.map(
|
|
2506
|
+
function Rt(e) {
|
|
2507
|
+
return e.map(Pt).filter(Boolean).join(" / ");
|
|
2429
2508
|
}
|
|
2430
|
-
function
|
|
2431
|
-
return
|
|
2509
|
+
function zt(e, t) {
|
|
2510
|
+
return Pt(Ft(e, t)) || "-";
|
|
2432
2511
|
}
|
|
2433
|
-
function
|
|
2512
|
+
function Bt(e, t) {
|
|
2434
2513
|
return e.map((e) => t.get(e)).filter((e) => !!e);
|
|
2435
2514
|
}
|
|
2436
|
-
function
|
|
2515
|
+
function Vt(e) {
|
|
2437
2516
|
return e == null || e === "" ? "-" : e;
|
|
2438
2517
|
}
|
|
2439
|
-
function
|
|
2518
|
+
function Ht(e) {
|
|
2440
2519
|
return e != null && e !== "";
|
|
2441
2520
|
}
|
|
2442
|
-
function
|
|
2521
|
+
function Ut(e) {
|
|
2443
2522
|
return e === "sku" || e === "price" || e === "inventory";
|
|
2444
2523
|
}
|
|
2445
|
-
function
|
|
2446
|
-
return e === "text" || e === "field" ? e : e[t] ??
|
|
2524
|
+
function Wt(e, t) {
|
|
2525
|
+
return e === "text" || e === "field" ? e : e[t] ?? Mt;
|
|
2447
2526
|
}
|
|
2448
|
-
function
|
|
2527
|
+
function Gt(e, t, n, r) {
|
|
2449
2528
|
return {
|
|
2450
2529
|
index: e,
|
|
2451
2530
|
field: t,
|
|
@@ -2453,347 +2532,346 @@ function Ht(e, t, n, r) {
|
|
|
2453
2532
|
value: r
|
|
2454
2533
|
};
|
|
2455
2534
|
}
|
|
2456
|
-
function
|
|
2457
|
-
let
|
|
2535
|
+
function Kt(e, t, n, r, a, o = "whitespace-normal break-words") {
|
|
2536
|
+
let s = Pt(e);
|
|
2458
2537
|
if (n === "field") {
|
|
2459
2538
|
let e = !!r;
|
|
2460
|
-
return /* @__PURE__ */
|
|
2539
|
+
return /* @__PURE__ */ H(O, {
|
|
2461
2540
|
readOnly: !e,
|
|
2462
|
-
value:
|
|
2541
|
+
value: s,
|
|
2463
2542
|
onChange: e ? (e) => r(e.currentTarget.value) : void 0,
|
|
2464
2543
|
onBlur: a ? (e) => a(e.currentTarget.value) : void 0,
|
|
2465
2544
|
"aria-label": t,
|
|
2466
|
-
className: i("h-control-lg w-full min-w-24 bg-background px-control shadow-xs", !e && "text-muted-foreground")
|
|
2545
|
+
className: i("h-control-lg w-full min-w-24 field-sizing-content bg-background px-control shadow-xs", !e && "text-muted-foreground")
|
|
2467
2546
|
});
|
|
2468
2547
|
}
|
|
2469
|
-
let
|
|
2470
|
-
return /* @__PURE__ */
|
|
2471
|
-
className: "min-w-0
|
|
2472
|
-
children:
|
|
2548
|
+
let c = Ht(e) ? S : C;
|
|
2549
|
+
return /* @__PURE__ */ H(c, {
|
|
2550
|
+
className: i("min-w-0 tabular-nums", o),
|
|
2551
|
+
children: Vt(e)
|
|
2473
2552
|
});
|
|
2474
2553
|
}
|
|
2475
|
-
function
|
|
2476
|
-
let
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
]),
|
|
2482
|
-
if (!
|
|
2483
|
-
let t = new Map((
|
|
2554
|
+
function qt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibleColumns: c = At, optionCombinationDisplay: l = jt, cellDisplay: d = Mt, selectionMode: f, renderOptionCombination: p, renderCell: m, selectedVariantIds: h, defaultSelectedVariantIds: g = [], onSelectedVariantIdsChange: v, onVariantFieldChange: y, onVariantFieldBlur: b, onCreateVariant: x, onGenerateVariants: S, onSelectVariant: C, onEditVariant: w, onDuplicateVariant: E, onDeleteVariant: D, onBulkEdit: O, onBulkApply: k, onBulkDelete: te, renderVariantActions: ne, renderBulkActions: re, actions: ae, headerEnd: oe, footerSlot: se, empty: j, surface: M = "card", className: N, strings: ce }) {
|
|
2555
|
+
let P = r(Le, ce), F = h !== void 0, [I, me] = be(g), R = !!(re || O || k || te), z = (f ?? (R || F || v ? Nt : "none")) === "multiple", he = V(() => z ? F ? h : I : [], [
|
|
2556
|
+
I,
|
|
2557
|
+
z,
|
|
2558
|
+
F,
|
|
2559
|
+
h
|
|
2560
|
+
]), _e = V(() => new Map(e.map((e) => [e.id, e])), [e]), ve = V(() => Bt(he, _e), [_e, he]), Se = V(() => new Set(he), [he]), W = V(() => new Set(c), [c]), K = V(() => t.find((e) => e.id === n), [t, n]), Te = V(() => new Map(e.map((e, t) => [e.id, t])), [e]), Ee = V(() => {
|
|
2561
|
+
if (!K) return e;
|
|
2562
|
+
let t = new Map((K.values ?? []).map((e, t) => [e.id, t]));
|
|
2484
2563
|
return [...e].sort((e, n) => {
|
|
2485
|
-
let r = e.optionValueIds?.[
|
|
2564
|
+
let r = e.optionValueIds?.[K.id], i = n.optionValueIds?.[K.id], a = r === void 0 ? void 0 : t.get(r), o = i === void 0 ? void 0 : t.get(i), s = a ?? 2 ** 53 - 1, c = o ?? 2 ** 53 - 1;
|
|
2486
2565
|
return s === c ? (Te.get(e.id) ?? 0) - (Te.get(n.id) ?? 0) : s - c;
|
|
2487
2566
|
});
|
|
2488
2567
|
}, [
|
|
2489
|
-
|
|
2568
|
+
K,
|
|
2490
2569
|
Te,
|
|
2491
2570
|
e
|
|
2492
|
-
]), De =
|
|
2493
|
-
if (!
|
|
2571
|
+
]), De = V(() => {
|
|
2572
|
+
if (!K) return /* @__PURE__ */ new Map();
|
|
2494
2573
|
let t = /* @__PURE__ */ new Map();
|
|
2495
2574
|
return e.forEach((e) => {
|
|
2496
|
-
let n =
|
|
2575
|
+
let n = zt(e, K);
|
|
2497
2576
|
t.set(n, (t.get(n) ?? 0) + 1);
|
|
2498
2577
|
}), t;
|
|
2499
|
-
}, [
|
|
2500
|
-
let t =
|
|
2501
|
-
|
|
2578
|
+
}, [K, e]), Oe = z && R, ke = e.length > 0, Y = z && ke && e.every((e) => Se.has(e.id)), Ae = ve.length > 0 && !Y, je = ye(null), Me = !!(C || w || E || D || ne), X = c.filter((e) => W.has(e)).length + +!!z + +!!Me, Z = B((e) => {
|
|
2579
|
+
let t = Bt(e, _e);
|
|
2580
|
+
F || me(e), v?.(e, t);
|
|
2502
2581
|
}, [
|
|
2503
|
-
|
|
2582
|
+
F,
|
|
2504
2583
|
v,
|
|
2505
|
-
|
|
2506
|
-
]),
|
|
2507
|
-
if (!
|
|
2508
|
-
let n = t === !0 ? Array.from(/* @__PURE__ */ new Set([...
|
|
2509
|
-
|
|
2584
|
+
_e
|
|
2585
|
+
]), Ne = B(() => Z([]), [Z]), Pe = B((e, t) => {
|
|
2586
|
+
if (!z) return;
|
|
2587
|
+
let n = t === !0 ? Array.from(/* @__PURE__ */ new Set([...he, e.id])) : he.filter((t) => t !== e.id);
|
|
2588
|
+
Z(n);
|
|
2510
2589
|
}, [
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
]), Fe =
|
|
2515
|
-
|
|
2590
|
+
z,
|
|
2591
|
+
he,
|
|
2592
|
+
Z
|
|
2593
|
+
]), Fe = B((t) => {
|
|
2594
|
+
z && Z(t === !0 ? e.map((e) => e.id) : []);
|
|
2516
2595
|
}, [
|
|
2517
|
-
|
|
2518
|
-
|
|
2596
|
+
z,
|
|
2597
|
+
Z,
|
|
2519
2598
|
e
|
|
2520
2599
|
]), Ie = {
|
|
2521
|
-
selectedRows:
|
|
2522
|
-
selectedIds:
|
|
2600
|
+
selectedRows: ve,
|
|
2601
|
+
selectedIds: he,
|
|
2523
2602
|
allRows: e,
|
|
2524
|
-
selectedCount:
|
|
2603
|
+
selectedCount: ve.length,
|
|
2525
2604
|
totalCount: e.length,
|
|
2526
|
-
allRowsSelected:
|
|
2527
|
-
clearSelection:
|
|
2528
|
-
setSelectedIds:
|
|
2529
|
-
},
|
|
2605
|
+
allRowsSelected: Y,
|
|
2606
|
+
clearSelection: Ne,
|
|
2607
|
+
setSelectedIds: Z
|
|
2608
|
+
}, Q = x || S ? /* @__PURE__ */ U(u, {
|
|
2530
2609
|
direction: "horizontal",
|
|
2531
|
-
gap:
|
|
2610
|
+
gap: _.commands,
|
|
2532
2611
|
justify: "end",
|
|
2533
2612
|
className: "product-variants-bulk-table--header-actions",
|
|
2534
|
-
children: [!!
|
|
2613
|
+
children: [!!S && /* @__PURE__ */ H(a, {
|
|
2535
2614
|
type: "button",
|
|
2536
2615
|
tone: "secondary",
|
|
2537
2616
|
buttonStyle: "outline",
|
|
2538
|
-
onClick:
|
|
2539
|
-
children:
|
|
2540
|
-
}), !!x && /* @__PURE__ */
|
|
2617
|
+
onClick: S,
|
|
2618
|
+
children: P.generateLabel
|
|
2619
|
+
}), !!x && /* @__PURE__ */ H(a, {
|
|
2541
2620
|
type: "button",
|
|
2542
2621
|
tone: "secondary",
|
|
2543
2622
|
buttonStyle: "ghost",
|
|
2544
2623
|
onClick: x,
|
|
2545
|
-
icon:
|
|
2546
|
-
children:
|
|
2624
|
+
icon: q,
|
|
2625
|
+
children: P.createLabel
|
|
2547
2626
|
})]
|
|
2548
|
-
}) : void 0, Re =
|
|
2627
|
+
}) : void 0, Re = ve.length > 0 ? re?.(Ie) : void 0, ze = Oe ? /* @__PURE__ */ H(T, {
|
|
2549
2628
|
placement: "inline",
|
|
2550
2629
|
className: "product-variants-bulk-table--bulk-toolbar",
|
|
2551
|
-
selectedCount:
|
|
2630
|
+
selectedCount: ve.length,
|
|
2552
2631
|
totalCount: e.length,
|
|
2553
|
-
onClear:
|
|
2632
|
+
onClear: Ne,
|
|
2554
2633
|
returnFocusRef: je,
|
|
2555
2634
|
strings: {
|
|
2556
|
-
summary: (t, n) =>
|
|
2557
|
-
clear:
|
|
2635
|
+
summary: (t, n) => P.selectedLabel(t, n ?? e.length),
|
|
2636
|
+
clear: P.clearSelectionLabel
|
|
2558
2637
|
},
|
|
2559
|
-
children: Re ?? /* @__PURE__ */
|
|
2560
|
-
!!
|
|
2638
|
+
children: Re ?? /* @__PURE__ */ U(xe, { children: [
|
|
2639
|
+
!!O && /* @__PURE__ */ H(a, {
|
|
2561
2640
|
type: "button",
|
|
2562
|
-
onClick: () =>
|
|
2563
|
-
children:
|
|
2641
|
+
onClick: () => O(ve),
|
|
2642
|
+
children: P.bulkEditLabel
|
|
2564
2643
|
}),
|
|
2565
|
-
!!k && /* @__PURE__ */
|
|
2644
|
+
!!k && /* @__PURE__ */ H(a, {
|
|
2566
2645
|
type: "button",
|
|
2567
2646
|
tone: "neutral",
|
|
2568
2647
|
buttonStyle: "ghost",
|
|
2569
|
-
onClick: () => k(
|
|
2570
|
-
children:
|
|
2648
|
+
onClick: () => k(ve),
|
|
2649
|
+
children: P.bulkApplyLabel
|
|
2571
2650
|
}),
|
|
2572
|
-
!!
|
|
2651
|
+
!!te && /* @__PURE__ */ H(a, {
|
|
2573
2652
|
type: "button",
|
|
2574
2653
|
tone: "destructive",
|
|
2575
2654
|
buttonStyle: "ghost",
|
|
2576
|
-
onClick: () =>
|
|
2577
|
-
children:
|
|
2655
|
+
onClick: () => te(ve),
|
|
2656
|
+
children: P.bulkDeleteLabel
|
|
2578
2657
|
})
|
|
2579
2658
|
] })
|
|
2580
|
-
}) : null, Be = e.length === 0 ?
|
|
2581
|
-
title:
|
|
2582
|
-
description:
|
|
2583
|
-
action:
|
|
2659
|
+
}) : null, Be = e.length === 0 ? j ?? /* @__PURE__ */ H($, {
|
|
2660
|
+
title: P.emptyTitle,
|
|
2661
|
+
description: P.emptyDescription,
|
|
2662
|
+
action: S ? /* @__PURE__ */ H(a, {
|
|
2584
2663
|
tone: "primary",
|
|
2585
2664
|
type: "button",
|
|
2586
|
-
onClick:
|
|
2587
|
-
children:
|
|
2665
|
+
onClick: S,
|
|
2666
|
+
children: P.generateLabel
|
|
2588
2667
|
}) : void 0
|
|
2589
|
-
}) : /* @__PURE__ */
|
|
2668
|
+
}) : /* @__PURE__ */ U(u, {
|
|
2590
2669
|
gap: "md",
|
|
2591
2670
|
className: "product-variants-bulk-table--body",
|
|
2592
|
-
children: [ze, /* @__PURE__ */
|
|
2593
|
-
className: "product-variants-bulk-table--table overflow-hidden rounded-
|
|
2594
|
-
children: /* @__PURE__ */
|
|
2595
|
-
containerClassName: "[scrollbar-gutter:stable] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-2.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-track]:bg-muted/30",
|
|
2671
|
+
children: [ze, /* @__PURE__ */ H("div", {
|
|
2672
|
+
className: "product-variants-bulk-table--table overflow-hidden rounded-surface border border-border bg-background text-foreground",
|
|
2673
|
+
children: /* @__PURE__ */ U(pe, {
|
|
2596
2674
|
className: "w-full border-collapse",
|
|
2597
2675
|
children: [
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2676
|
+
/* @__PURE__ */ U("colgroup", { children: [
|
|
2677
|
+
z && /* @__PURE__ */ H("col", { className: "w-14 min-w-14 max-w-14" }),
|
|
2678
|
+
W.has("variant") && /* @__PURE__ */ H("col", {}),
|
|
2679
|
+
W.has("sku") && /* @__PURE__ */ H("col", {}),
|
|
2680
|
+
W.has("price") && /* @__PURE__ */ H("col", {}),
|
|
2681
|
+
W.has("inventory") && /* @__PURE__ */ H("col", {}),
|
|
2682
|
+
W.has("status") && /* @__PURE__ */ H("col", {}),
|
|
2683
|
+
W.has("updated") && /* @__PURE__ */ H("col", {}),
|
|
2684
|
+
Me && /* @__PURE__ */ H("col", { className: "w-18" })
|
|
2607
2685
|
] }),
|
|
2608
|
-
/* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ H(fe, { children: /* @__PURE__ */ U(L, {
|
|
2609
2687
|
className: "h-12 border-b border-border/60 bg-muted/50",
|
|
2610
2688
|
children: [
|
|
2611
|
-
|
|
2689
|
+
z && /* @__PURE__ */ H(de, {
|
|
2612
2690
|
className: "w-14 min-w-14 max-w-14 px-0 py-space-md text-center align-middle",
|
|
2613
|
-
children: /* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ H(ie, {
|
|
2614
2692
|
ref: je,
|
|
2615
|
-
checked:
|
|
2616
|
-
indeterminate:
|
|
2693
|
+
checked: Y,
|
|
2694
|
+
indeterminate: Ae,
|
|
2617
2695
|
onCheckedChange: Fe,
|
|
2618
|
-
"aria-label":
|
|
2696
|
+
"aria-label": P.selectAllLabel,
|
|
2619
2697
|
className: "mx-auto"
|
|
2620
2698
|
})
|
|
2621
2699
|
}),
|
|
2622
|
-
|
|
2700
|
+
W.has("variant") && /* @__PURE__ */ H(de, {
|
|
2623
2701
|
className: "px-space-lg py-space-md text-left align-middle",
|
|
2624
|
-
children: /* @__PURE__ */
|
|
2702
|
+
children: /* @__PURE__ */ H(s, {
|
|
2625
2703
|
className: "whitespace-normal",
|
|
2626
|
-
children:
|
|
2704
|
+
children: P.headers.variant
|
|
2627
2705
|
})
|
|
2628
2706
|
}),
|
|
2629
|
-
|
|
2707
|
+
W.has("sku") && /* @__PURE__ */ H(de, {
|
|
2630
2708
|
className: "px-space-lg py-space-md text-left align-middle",
|
|
2631
|
-
children: /* @__PURE__ */
|
|
2709
|
+
children: /* @__PURE__ */ H(s, {
|
|
2632
2710
|
className: "whitespace-normal",
|
|
2633
|
-
children:
|
|
2711
|
+
children: P.headers.sku
|
|
2634
2712
|
})
|
|
2635
2713
|
}),
|
|
2636
|
-
|
|
2714
|
+
W.has("price") && /* @__PURE__ */ H(de, {
|
|
2637
2715
|
className: "px-space-lg py-space-md text-left align-middle",
|
|
2638
|
-
children: /* @__PURE__ */
|
|
2716
|
+
children: /* @__PURE__ */ H(s, {
|
|
2639
2717
|
className: "whitespace-normal",
|
|
2640
|
-
children:
|
|
2718
|
+
children: P.headers.price
|
|
2641
2719
|
})
|
|
2642
2720
|
}),
|
|
2643
|
-
|
|
2721
|
+
W.has("inventory") && /* @__PURE__ */ H(de, {
|
|
2644
2722
|
className: "px-space-lg py-space-md text-left align-middle",
|
|
2645
|
-
children: /* @__PURE__ */
|
|
2723
|
+
children: /* @__PURE__ */ H(s, {
|
|
2646
2724
|
className: "whitespace-normal",
|
|
2647
|
-
children:
|
|
2725
|
+
children: P.headers.inventory
|
|
2648
2726
|
})
|
|
2649
2727
|
}),
|
|
2650
|
-
|
|
2728
|
+
W.has("status") && /* @__PURE__ */ H(de, {
|
|
2651
2729
|
className: "px-space-lg py-space-md text-left align-middle",
|
|
2652
|
-
children: /* @__PURE__ */
|
|
2730
|
+
children: /* @__PURE__ */ H(s, {
|
|
2653
2731
|
className: "whitespace-normal",
|
|
2654
|
-
children:
|
|
2732
|
+
children: P.headers.status
|
|
2655
2733
|
})
|
|
2656
2734
|
}),
|
|
2657
|
-
|
|
2735
|
+
W.has("updated") && /* @__PURE__ */ H(de, {
|
|
2658
2736
|
className: "px-space-lg py-space-md text-left align-middle",
|
|
2659
|
-
children: /* @__PURE__ */
|
|
2737
|
+
children: /* @__PURE__ */ H(s, {
|
|
2660
2738
|
className: "whitespace-normal",
|
|
2661
|
-
children:
|
|
2739
|
+
children: P.headers.updated
|
|
2662
2740
|
})
|
|
2663
2741
|
}),
|
|
2664
|
-
|
|
2742
|
+
Me && /* @__PURE__ */ H(de, {
|
|
2665
2743
|
className: "px-space-lg py-space-md text-right align-middle",
|
|
2666
|
-
children: /* @__PURE__ */
|
|
2744
|
+
children: /* @__PURE__ */ H(s, {
|
|
2667
2745
|
className: "whitespace-normal",
|
|
2668
|
-
children:
|
|
2746
|
+
children: P.headers.actions
|
|
2669
2747
|
})
|
|
2670
2748
|
})
|
|
2671
2749
|
]
|
|
2672
2750
|
}) }),
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
let r = Te.get(e.id) ?? n, i =
|
|
2751
|
+
/* @__PURE__ */ H(ue, { children: Ee.map((e, n) => {
|
|
2752
|
+
let r = Te.get(e.id) ?? n, i = K ? zt(e, K) : null, a = n > 0 ? Ee[n - 1] : void 0, s = K && a ? zt(a, K) : null, c = !!K && i !== s, f = Se.has(e.id), h = {
|
|
2675
2753
|
index: r,
|
|
2676
|
-
onSelect:
|
|
2677
|
-
onEdit:
|
|
2678
|
-
onDuplicate:
|
|
2679
|
-
onDelete:
|
|
2754
|
+
onSelect: C ? () => C(e) : void 0,
|
|
2755
|
+
onEdit: w ? () => w(e) : void 0,
|
|
2756
|
+
onDuplicate: E ? () => E(e) : void 0,
|
|
2757
|
+
onDelete: D ? () => D(e) : void 0,
|
|
2680
2758
|
isSelected: f,
|
|
2681
|
-
onToggleSelected:
|
|
2682
|
-
}, g =
|
|
2759
|
+
onToggleSelected: z ? (t) => Pe(e, t) : void 0
|
|
2760
|
+
}, g = K ? t.filter((e) => e.id !== K.id) : t, _ = Lt(e, g), v = K ? It({
|
|
2683
2761
|
...e,
|
|
2684
2762
|
name: void 0
|
|
2685
|
-
}, g) :
|
|
2686
|
-
let a =
|
|
2763
|
+
}, g) : It(e, t), x = v === "-" && K ? It(e, t) : v, S = Rt(_), T = S === Pt(x), O = (t, n, i = Mt) => {
|
|
2764
|
+
let a = Ut(t) && y ? (i) => y(e, t, i, Gt(r, t, n, i)) : void 0, o = Ut(t) && b ? (i) => b(e, t, i, Gt(r, t, n, i)) : void 0;
|
|
2687
2765
|
return {
|
|
2688
2766
|
index: r,
|
|
2689
2767
|
column: t,
|
|
2690
2768
|
value: n,
|
|
2691
2769
|
variantName: x,
|
|
2692
2770
|
optionValues: _,
|
|
2693
|
-
optionLabel:
|
|
2771
|
+
optionLabel: S,
|
|
2694
2772
|
cellDisplay: i,
|
|
2695
2773
|
onValueChange: a,
|
|
2696
2774
|
onBlur: o
|
|
2697
2775
|
};
|
|
2698
2776
|
}, k = (t, n, r, i) => {
|
|
2699
|
-
let a =
|
|
2777
|
+
let a = O(t, n, r), o = m?.(e, a);
|
|
2700
2778
|
return o === void 0 ? i(a) : o;
|
|
2701
|
-
},
|
|
2779
|
+
}, te = l !== "none" && _.length > 0 && !T, re = l === "none" ? null : p?.(e, {
|
|
2702
2780
|
optionGroups: t,
|
|
2703
2781
|
optionValues: _,
|
|
2704
|
-
optionLabel:
|
|
2782
|
+
optionLabel: S,
|
|
2705
2783
|
display: l
|
|
2706
|
-
}),
|
|
2707
|
-
...
|
|
2784
|
+
}), A = [
|
|
2785
|
+
...C ? [{
|
|
2708
2786
|
id: "view",
|
|
2709
|
-
label:
|
|
2710
|
-
icon: /* @__PURE__ */
|
|
2711
|
-
onClick: () =>
|
|
2787
|
+
label: P.viewLabel,
|
|
2788
|
+
icon: /* @__PURE__ */ H(G, { className: "size-icon-md" }),
|
|
2789
|
+
onClick: () => C(e),
|
|
2712
2790
|
tone: "secondary",
|
|
2713
2791
|
buttonStyle: "ghost"
|
|
2714
2792
|
}] : [],
|
|
2715
|
-
...
|
|
2793
|
+
...w ? [{
|
|
2716
2794
|
id: "edit",
|
|
2717
|
-
label:
|
|
2718
|
-
icon: /* @__PURE__ */
|
|
2719
|
-
onClick: () =>
|
|
2795
|
+
label: P.editLabel,
|
|
2796
|
+
icon: /* @__PURE__ */ H(we, { className: "size-icon-md" }),
|
|
2797
|
+
onClick: () => w(e),
|
|
2720
2798
|
tone: "secondary",
|
|
2721
2799
|
buttonStyle: "ghost"
|
|
2722
2800
|
}] : [],
|
|
2723
|
-
...
|
|
2801
|
+
...E ? [{
|
|
2724
2802
|
id: "duplicate",
|
|
2725
|
-
label:
|
|
2726
|
-
icon: /* @__PURE__ */
|
|
2727
|
-
onClick: () =>
|
|
2803
|
+
label: P.duplicateLabel,
|
|
2804
|
+
icon: /* @__PURE__ */ H(Ce, { className: "size-icon-md" }),
|
|
2805
|
+
onClick: () => E(e),
|
|
2728
2806
|
tone: "secondary",
|
|
2729
2807
|
buttonStyle: "ghost"
|
|
2730
2808
|
}] : [],
|
|
2731
|
-
...
|
|
2809
|
+
...D ? [{
|
|
2732
2810
|
id: "delete",
|
|
2733
|
-
label:
|
|
2734
|
-
icon: /* @__PURE__ */
|
|
2735
|
-
onClick: () =>
|
|
2811
|
+
label: P.deleteLabel,
|
|
2812
|
+
icon: /* @__PURE__ */ H(J, { className: "size-icon-md" }),
|
|
2813
|
+
onClick: () => D(e),
|
|
2736
2814
|
tone: "destructive"
|
|
2737
2815
|
}] : []
|
|
2738
2816
|
];
|
|
2739
|
-
return /* @__PURE__ */
|
|
2817
|
+
return /* @__PURE__ */ U(ge, { children: [c && /* @__PURE__ */ H(L, {
|
|
2740
2818
|
className: "product-variants-bulk-table--group-row border-b border-border/60 bg-muted/30",
|
|
2741
|
-
children: /* @__PURE__ */
|
|
2742
|
-
colSpan:
|
|
2819
|
+
children: /* @__PURE__ */ H(le, {
|
|
2820
|
+
colSpan: X,
|
|
2743
2821
|
className: "px-space-lg py-space-md align-middle",
|
|
2744
|
-
children: /* @__PURE__ */
|
|
2822
|
+
children: /* @__PURE__ */ U(u, {
|
|
2745
2823
|
direction: "horizontal",
|
|
2746
2824
|
gap: "sm",
|
|
2747
2825
|
wrap: !1,
|
|
2748
|
-
children: [/* @__PURE__ */
|
|
2826
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2749
2827
|
type: "inherit",
|
|
2750
2828
|
tag: "span",
|
|
2751
2829
|
weight: "semibold",
|
|
2752
2830
|
className: "min-w-0 whitespace-normal break-words",
|
|
2753
2831
|
children: i
|
|
2754
|
-
}), /* @__PURE__ */
|
|
2832
|
+
}), /* @__PURE__ */ H(o, {
|
|
2755
2833
|
tag: "span",
|
|
2756
2834
|
size: "xs",
|
|
2757
2835
|
type: "secondary",
|
|
2758
2836
|
className: "whitespace-nowrap",
|
|
2759
|
-
children:
|
|
2837
|
+
children: P.groupCountLabel(De.get(i ?? "") ?? 0)
|
|
2760
2838
|
})]
|
|
2761
2839
|
})
|
|
2762
2840
|
})
|
|
2763
|
-
}), /* @__PURE__ */
|
|
2841
|
+
}), /* @__PURE__ */ U(L, {
|
|
2764
2842
|
className: "h-20 border-b border-border/60 last:border-b-0",
|
|
2765
2843
|
children: [
|
|
2766
|
-
|
|
2844
|
+
z && /* @__PURE__ */ H(le, {
|
|
2767
2845
|
className: "w-14 min-w-14 max-w-14 px-0 py-space-lg text-center align-middle",
|
|
2768
|
-
children: /* @__PURE__ */
|
|
2846
|
+
children: /* @__PURE__ */ H(ie, {
|
|
2769
2847
|
checked: f,
|
|
2770
2848
|
onCheckedChange: (t) => Pe(e, t),
|
|
2771
|
-
"aria-label":
|
|
2849
|
+
"aria-label": P.selectRowLabel(r),
|
|
2772
2850
|
className: "mx-auto"
|
|
2773
2851
|
})
|
|
2774
2852
|
}),
|
|
2775
|
-
|
|
2853
|
+
W.has("variant") && /* @__PURE__ */ H(le, {
|
|
2776
2854
|
className: "px-space-lg py-space-lg align-middle",
|
|
2777
|
-
children: k("variant", x,
|
|
2855
|
+
children: k("variant", x, Mt, () => /* @__PURE__ */ U(u, {
|
|
2778
2856
|
gap: "xs",
|
|
2779
2857
|
children: [
|
|
2780
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ H(o, {
|
|
2781
2859
|
type: "inherit",
|
|
2782
2860
|
weight: "medium",
|
|
2783
2861
|
className: "min-w-0 whitespace-normal break-words",
|
|
2784
2862
|
children: x
|
|
2785
2863
|
}),
|
|
2786
|
-
|
|
2787
|
-
!
|
|
2864
|
+
re,
|
|
2865
|
+
!re && te && l === "text" && /* @__PURE__ */ H(o, {
|
|
2788
2866
|
size: "xs",
|
|
2789
2867
|
type: "secondary",
|
|
2790
2868
|
className: "min-w-0 whitespace-normal break-words",
|
|
2791
|
-
children: _.map((t, n) => /* @__PURE__ */
|
|
2869
|
+
children: _.map((t, n) => /* @__PURE__ */ U("span", { children: [n > 0 ? " / " : null, t] }, `${e.id}-option-text-${n}`))
|
|
2792
2870
|
}),
|
|
2793
|
-
!
|
|
2871
|
+
!re && te && l === "tags" && /* @__PURE__ */ H(u, {
|
|
2794
2872
|
direction: "horizontal",
|
|
2795
2873
|
gap: "xs",
|
|
2796
|
-
children: _.map((t, n) => /* @__PURE__ */
|
|
2874
|
+
children: _.map((t, n) => /* @__PURE__ */ H(ee, {
|
|
2797
2875
|
size: "sm",
|
|
2798
2876
|
tone: "secondary",
|
|
2799
2877
|
className: "max-w-full",
|
|
@@ -2803,38 +2881,38 @@ function Wt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
|
|
|
2803
2881
|
]
|
|
2804
2882
|
}))
|
|
2805
2883
|
}),
|
|
2806
|
-
|
|
2884
|
+
W.has("sku") && /* @__PURE__ */ H(le, {
|
|
2807
2885
|
className: "px-space-lg py-space-md align-middle",
|
|
2808
|
-
children: k("sku", e.sku,
|
|
2886
|
+
children: k("sku", e.sku, Wt(d, "sku"), (t) => Kt(e.sku, `${P.headers.sku}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur, "whitespace-nowrap"))
|
|
2809
2887
|
}),
|
|
2810
|
-
|
|
2888
|
+
W.has("price") && /* @__PURE__ */ H(le, {
|
|
2811
2889
|
className: "px-space-lg py-space-md align-middle",
|
|
2812
|
-
children: k("price", e.price,
|
|
2890
|
+
children: k("price", e.price, Wt(d, "price"), (t) => Kt(e.price, `${P.headers.price}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
|
|
2813
2891
|
}),
|
|
2814
|
-
|
|
2892
|
+
W.has("inventory") && /* @__PURE__ */ H(le, {
|
|
2815
2893
|
className: "px-space-lg py-space-md align-middle",
|
|
2816
|
-
children: k("inventory", e.inventory,
|
|
2894
|
+
children: k("inventory", e.inventory, Wt(d, "inventory"), (t) => Kt(e.inventory, `${P.headers.inventory}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
|
|
2817
2895
|
}),
|
|
2818
|
-
|
|
2896
|
+
W.has("status") && /* @__PURE__ */ H(le, {
|
|
2819
2897
|
className: "px-space-lg py-space-lg align-middle",
|
|
2820
|
-
children: k("status", e.status,
|
|
2898
|
+
children: k("status", e.status, Mt, () => e.status ? /* @__PURE__ */ H(ee, {
|
|
2821
2899
|
tone: e.statusTone ?? "secondary",
|
|
2822
2900
|
children: e.status
|
|
2823
|
-
}) : /* @__PURE__ */
|
|
2901
|
+
}) : /* @__PURE__ */ H(o, {
|
|
2824
2902
|
type: "secondary",
|
|
2825
2903
|
children: "-"
|
|
2826
2904
|
}))
|
|
2827
2905
|
}),
|
|
2828
|
-
|
|
2906
|
+
W.has("updated") && /* @__PURE__ */ H(le, {
|
|
2829
2907
|
className: "px-space-lg py-space-lg align-middle",
|
|
2830
|
-
children: k("updated", e.updatedAt,
|
|
2908
|
+
children: k("updated", e.updatedAt, Mt, () => Kt(e.updatedAt, `${P.headers.updated}: ${Pt(x)}`, "text"))
|
|
2831
2909
|
}),
|
|
2832
|
-
|
|
2910
|
+
Me && /* @__PURE__ */ H(le, {
|
|
2833
2911
|
className: "px-space-lg py-space-lg text-right align-middle",
|
|
2834
|
-
children:
|
|
2912
|
+
children: ne ? ne(e, h) : /* @__PURE__ */ H(Ye, {
|
|
2835
2913
|
item: e,
|
|
2836
|
-
actions:
|
|
2837
|
-
menuLabel:
|
|
2914
|
+
actions: A,
|
|
2915
|
+
menuLabel: P.headers.actions
|
|
2838
2916
|
})
|
|
2839
2917
|
})
|
|
2840
2918
|
]
|
|
@@ -2844,210 +2922,219 @@ function Wt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
|
|
|
2844
2922
|
})
|
|
2845
2923
|
})]
|
|
2846
2924
|
});
|
|
2847
|
-
return
|
|
2848
|
-
"aria-label":
|
|
2849
|
-
className: i("product-variants-bulk-table--component min-w-0",
|
|
2925
|
+
return M === "embedded" ? /* @__PURE__ */ H("section", {
|
|
2926
|
+
"aria-label": P.title,
|
|
2927
|
+
className: i("product-variants-bulk-table--component min-w-0", N),
|
|
2850
2928
|
children: Be
|
|
2851
|
-
}) : /* @__PURE__ */
|
|
2852
|
-
title:
|
|
2853
|
-
description:
|
|
2854
|
-
actions:
|
|
2855
|
-
headerAction:
|
|
2856
|
-
headerEnd:
|
|
2857
|
-
footerSlot:
|
|
2858
|
-
className: i("product-variants-bulk-table--component w-full",
|
|
2929
|
+
}) : /* @__PURE__ */ H(A, {
|
|
2930
|
+
title: P.title,
|
|
2931
|
+
description: P.description,
|
|
2932
|
+
actions: ae,
|
|
2933
|
+
headerAction: Q,
|
|
2934
|
+
headerEnd: oe,
|
|
2935
|
+
footerSlot: se,
|
|
2936
|
+
className: i("product-variants-bulk-table--component w-full", N),
|
|
2859
2937
|
children: Be
|
|
2860
2938
|
});
|
|
2861
2939
|
}
|
|
2862
|
-
|
|
2940
|
+
qt.displayName = "ProductVariantsBulkTable";
|
|
2863
2941
|
//#endregion
|
|
2864
2942
|
//#region src/components/features/products/components/product-variants-manager.tsx
|
|
2865
|
-
function
|
|
2866
|
-
let { defaultScale:
|
|
2943
|
+
function Jt({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionCombinationDisplay: l, cellDisplay: d, selectionMode: f, renderOptionCombination: p, renderCell: h, selectedVariantIds: g, defaultSelectedVariantIds: v, onSelectedVariantIdsChange: y, onVariantFieldChange: b, onVariantFieldBlur: x, collapsedOptionIds: S, defaultCollapsedOptionIds: C, onCollapsedOptionIdsChange: w, editingOptionId: ee, defaultEditingOptionId: T, onEditingOptionIdChange: E, onCreateOption: D, onEditOption: O, onDeleteOption: k, onAddValue: te, onDeleteValue: ne, onOptionNameChange: ie, onValueLabelChange: A, onDoneEditingOption: se, onSaveEditingOption: j, onError: M, onCancelEditingOption: N, onToggleUsedForVariants: ce, renderOptionActions: P, renderValue: F, onCreateVariant: I, onGenerateVariants: L, onSelectVariant: le, onEditVariant: ue, onDuplicateVariant: de, onDeleteVariant: fe, onBulkEdit: pe, onBulkApply: me, onBulkDelete: R, renderVariantActions: z, renderBulkActions: he, groupByOptionId: ge, defaultGroupByOptionId: _e, onGroupByOptionIdChange: ve, showGroupBy: ye = !0, onSearchVariants: xe, onFilterVariants: Se, controlsEnd: W, actions: Ce, headerEnd: G, footerSlot: we, surface: Te = "flat", padding: De = Te === "flat" ? "none" : "md", headerDivider: J, footerDivider: Oe, className: ke, strings: Y, optionsStrings: Ae, variantsStrings: je }) {
|
|
2944
|
+
let { defaultScale: Me } = t(), X = e(void 0, Me), Z = r(Q, Y), Ne = V(() => n.filter((e) => e.usedForVariants !== !1), [n]), Pe = Ne[0]?.id ?? null, Fe = ge !== void 0, [Ie, Le] = be(_e), Re = Fe ? ge : ye ? Ie === void 0 ? Pe : Ie : _e ?? null, ze = !!xe && !!Se, Be = !!xe || !!Se, Ve = V(() => ye ? Ne.map((e) => ({
|
|
2867
2945
|
value: e.id,
|
|
2868
2946
|
label: String(typeof e.name == "string" || typeof e.name == "number" ? e.name : e.id)
|
|
2869
|
-
})), [
|
|
2947
|
+
})) : [], [Ne, ye]), $ = B((e) => {
|
|
2870
2948
|
let t = n.find((t) => t.id === e);
|
|
2871
|
-
|
|
2949
|
+
Fe || Le(e ?? null), ve?.(e, t);
|
|
2872
2950
|
}, [
|
|
2873
|
-
|
|
2874
|
-
|
|
2951
|
+
Fe,
|
|
2952
|
+
ve,
|
|
2875
2953
|
n
|
|
2876
|
-
]),
|
|
2954
|
+
]), He = L || I ? /* @__PURE__ */ U(u, {
|
|
2877
2955
|
direction: "horizontal",
|
|
2878
|
-
gap:
|
|
2956
|
+
gap: _.commands,
|
|
2879
2957
|
justify: "end",
|
|
2880
2958
|
className: "product-variants-manager--header-actions",
|
|
2881
|
-
children: [!!
|
|
2959
|
+
children: [!!L && /* @__PURE__ */ H(a, {
|
|
2882
2960
|
type: "button",
|
|
2883
2961
|
tone: "secondary",
|
|
2884
2962
|
buttonStyle: "outline",
|
|
2885
|
-
onClick:
|
|
2886
|
-
children:
|
|
2887
|
-
}), !!
|
|
2963
|
+
onClick: L,
|
|
2964
|
+
children: Z.generateLabel
|
|
2965
|
+
}), !!I && /* @__PURE__ */ H(a, {
|
|
2888
2966
|
type: "button",
|
|
2889
2967
|
tone: "secondary",
|
|
2890
2968
|
buttonStyle: "outline",
|
|
2891
|
-
onClick:
|
|
2892
|
-
icon:
|
|
2893
|
-
children:
|
|
2969
|
+
onClick: I,
|
|
2970
|
+
icon: q,
|
|
2971
|
+
children: Z.createVariantLabel
|
|
2894
2972
|
})]
|
|
2895
2973
|
}) : void 0;
|
|
2896
|
-
return /* @__PURE__ */
|
|
2897
|
-
surface:
|
|
2898
|
-
padding:
|
|
2899
|
-
headerDivider:
|
|
2900
|
-
footerDivider:
|
|
2901
|
-
title:
|
|
2902
|
-
description:
|
|
2903
|
-
actions:
|
|
2904
|
-
actionsLabel:
|
|
2905
|
-
headerAction:
|
|
2906
|
-
headerEnd:
|
|
2974
|
+
return /* @__PURE__ */ H(m, {
|
|
2975
|
+
surface: Te,
|
|
2976
|
+
padding: De,
|
|
2977
|
+
headerDivider: J,
|
|
2978
|
+
footerDivider: Oe,
|
|
2979
|
+
title: Z.title,
|
|
2980
|
+
description: Z.description,
|
|
2981
|
+
actions: Ce,
|
|
2982
|
+
actionsLabel: Z.actionsLabel,
|
|
2983
|
+
headerAction: He,
|
|
2984
|
+
headerEnd: G,
|
|
2907
2985
|
footerSlot: we,
|
|
2908
|
-
className: i("product-variants-manager--component w-full",
|
|
2909
|
-
children: /* @__PURE__ */
|
|
2986
|
+
className: i("product-variants-manager--component w-full", ke),
|
|
2987
|
+
children: /* @__PURE__ */ U(u, {
|
|
2910
2988
|
gap: "2xl",
|
|
2911
2989
|
className: "product-variants-manager--body",
|
|
2912
|
-
children: [/* @__PURE__ */
|
|
2990
|
+
children: [/* @__PURE__ */ H("section", {
|
|
2913
2991
|
className: "product-variants-manager--options min-w-0",
|
|
2914
|
-
children: /* @__PURE__ */
|
|
2992
|
+
children: /* @__PURE__ */ H(pt, {
|
|
2915
2993
|
optionGroups: n,
|
|
2916
2994
|
collapsedOptionIds: S,
|
|
2917
2995
|
defaultCollapsedOptionIds: C,
|
|
2918
2996
|
onCollapsedOptionIdsChange: w,
|
|
2919
|
-
editingOptionId:
|
|
2920
|
-
defaultEditingOptionId:
|
|
2921
|
-
onEditingOptionIdChange:
|
|
2997
|
+
editingOptionId: ee,
|
|
2998
|
+
defaultEditingOptionId: T,
|
|
2999
|
+
onEditingOptionIdChange: E,
|
|
2922
3000
|
surface: "embedded",
|
|
2923
|
-
onCreateOption:
|
|
2924
|
-
onEditOption:
|
|
2925
|
-
onDeleteOption:
|
|
2926
|
-
onAddValue:
|
|
2927
|
-
onDeleteValue:
|
|
2928
|
-
onOptionNameChange:
|
|
2929
|
-
onValueLabelChange:
|
|
2930
|
-
onDoneEditingOption:
|
|
2931
|
-
onSaveEditingOption:
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
3001
|
+
onCreateOption: D,
|
|
3002
|
+
onEditOption: O,
|
|
3003
|
+
onDeleteOption: k,
|
|
3004
|
+
onAddValue: te,
|
|
3005
|
+
onDeleteValue: ne,
|
|
3006
|
+
onOptionNameChange: ie,
|
|
3007
|
+
onValueLabelChange: A,
|
|
3008
|
+
onDoneEditingOption: se,
|
|
3009
|
+
onSaveEditingOption: j,
|
|
3010
|
+
onError: M,
|
|
3011
|
+
onCancelEditingOption: N,
|
|
3012
|
+
onToggleUsedForVariants: ce,
|
|
3013
|
+
renderOptionActions: P,
|
|
3014
|
+
renderValue: F,
|
|
2936
3015
|
showHeader: !1,
|
|
2937
3016
|
showCollapseControls: !1,
|
|
2938
3017
|
showInlineActions: !1,
|
|
2939
3018
|
showVariantToggle: !1,
|
|
2940
3019
|
strings: {
|
|
2941
|
-
title:
|
|
2942
|
-
...
|
|
3020
|
+
title: Z.optionsTitle,
|
|
3021
|
+
...Ae
|
|
2943
3022
|
}
|
|
2944
3023
|
})
|
|
2945
|
-
}), /* @__PURE__ */
|
|
3024
|
+
}), /* @__PURE__ */ U(u, {
|
|
2946
3025
|
gap: "md",
|
|
2947
3026
|
className: "product-variants-manager--variants-region",
|
|
2948
|
-
children: [/* @__PURE__ */
|
|
3027
|
+
children: [(Ve.length > 0 || Be || W) && /* @__PURE__ */ H("div", {
|
|
2949
3028
|
className: "product-variants-manager--controls",
|
|
2950
|
-
children: /* @__PURE__ */
|
|
3029
|
+
children: /* @__PURE__ */ U(u, {
|
|
2951
3030
|
direction: "horizontal",
|
|
2952
3031
|
gap: "md",
|
|
2953
3032
|
justify: "between",
|
|
2954
|
-
children: [/* @__PURE__ */
|
|
3033
|
+
children: [Ve.length > 0 && /* @__PURE__ */ U(u, {
|
|
2955
3034
|
direction: "horizontal",
|
|
2956
3035
|
gap: "sm",
|
|
2957
3036
|
wrap: !1,
|
|
2958
3037
|
className: "product-variants-manager--group-by",
|
|
2959
|
-
children: [/* @__PURE__ */
|
|
3038
|
+
children: [/* @__PURE__ */ H(o, {
|
|
2960
3039
|
type: "secondary",
|
|
2961
3040
|
className: "whitespace-nowrap",
|
|
2962
|
-
children:
|
|
2963
|
-
}),
|
|
2964
|
-
options:
|
|
2965
|
-
value:
|
|
2966
|
-
onValueChange:
|
|
2967
|
-
"aria-label":
|
|
3041
|
+
children: Z.groupByLabel
|
|
3042
|
+
}), Ve.length > 0 && /* @__PURE__ */ H(re, {
|
|
3043
|
+
options: Ve,
|
|
3044
|
+
value: Re ?? void 0,
|
|
3045
|
+
onValueChange: $,
|
|
3046
|
+
"aria-label": Z.groupByLabel,
|
|
2968
3047
|
className: "min-w-32 bg-background"
|
|
2969
3048
|
})]
|
|
2970
|
-
}), /* @__PURE__ */
|
|
3049
|
+
}), (Be || W) && /* @__PURE__ */ U(u, {
|
|
2971
3050
|
direction: "horizontal",
|
|
2972
3051
|
gap: "sm",
|
|
2973
3052
|
justify: "end",
|
|
2974
3053
|
wrap: !1,
|
|
2975
|
-
className: "product-variants-manager--controls-end",
|
|
2976
|
-
children: [/* @__PURE__ */
|
|
2977
|
-
className: i("
|
|
2978
|
-
|
|
3054
|
+
className: "product-variants-manager--controls-end ms-auto",
|
|
3055
|
+
children: [Be && /* @__PURE__ */ U("div", {
|
|
3056
|
+
className: i("flex", ze && [
|
|
3057
|
+
"product-variants-manager--tool-buttons bg-background shadow-xs",
|
|
3058
|
+
ae.joinedFrame,
|
|
3059
|
+
oe[X]
|
|
3060
|
+
]),
|
|
3061
|
+
children: [xe && /* @__PURE__ */ U(a, {
|
|
2979
3062
|
type: "button",
|
|
2980
|
-
size:
|
|
3063
|
+
size: X,
|
|
2981
3064
|
iconOnly: !0,
|
|
2982
3065
|
tone: "secondary",
|
|
2983
|
-
buttonStyle: "ghost",
|
|
2984
|
-
onClick:
|
|
2985
|
-
"aria-label":
|
|
2986
|
-
className: i(
|
|
2987
|
-
|
|
3066
|
+
buttonStyle: ze ? "ghost" : "outline",
|
|
3067
|
+
onClick: xe,
|
|
3068
|
+
"aria-label": Z.searchLabel,
|
|
3069
|
+
className: i(ze && [
|
|
3070
|
+
ae.joinedItem,
|
|
3071
|
+
ae.firstItem,
|
|
3072
|
+
"border-r border-border"
|
|
3073
|
+
], "text-muted-foreground hover:text-foreground"),
|
|
3074
|
+
children: [/* @__PURE__ */ H(Ee, {
|
|
2988
3075
|
className: "size-icon-sm",
|
|
2989
3076
|
"aria-hidden": "true"
|
|
2990
|
-
}), /* @__PURE__ */
|
|
3077
|
+
}), /* @__PURE__ */ H(o, {
|
|
2991
3078
|
tag: "span",
|
|
2992
3079
|
size: "pxs",
|
|
2993
3080
|
className: "sr-only",
|
|
2994
|
-
children:
|
|
3081
|
+
children: Z.searchLabel
|
|
2995
3082
|
})]
|
|
2996
|
-
}), /* @__PURE__ */
|
|
3083
|
+
}), Se && /* @__PURE__ */ U(a, {
|
|
2997
3084
|
type: "button",
|
|
2998
|
-
size:
|
|
3085
|
+
size: X,
|
|
2999
3086
|
iconOnly: !0,
|
|
3000
3087
|
tone: "secondary",
|
|
3001
|
-
buttonStyle: "ghost",
|
|
3002
|
-
onClick:
|
|
3003
|
-
"aria-label":
|
|
3004
|
-
className: i(
|
|
3005
|
-
children: [/* @__PURE__ */
|
|
3088
|
+
buttonStyle: ze ? "ghost" : "outline",
|
|
3089
|
+
onClick: Se,
|
|
3090
|
+
"aria-label": Z.filterLabel,
|
|
3091
|
+
className: i(ze && [ae.joinedItem, ae.lastItem], "text-muted-foreground hover:text-foreground"),
|
|
3092
|
+
children: [/* @__PURE__ */ H(K, {
|
|
3006
3093
|
className: "size-icon-sm",
|
|
3007
3094
|
"aria-hidden": "true"
|
|
3008
|
-
}), /* @__PURE__ */
|
|
3095
|
+
}), /* @__PURE__ */ H(o, {
|
|
3009
3096
|
tag: "span",
|
|
3010
3097
|
size: "pxs",
|
|
3011
3098
|
className: "sr-only",
|
|
3012
|
-
children:
|
|
3099
|
+
children: Z.filterLabel
|
|
3013
3100
|
})]
|
|
3014
3101
|
})]
|
|
3015
|
-
}),
|
|
3102
|
+
}), W]
|
|
3016
3103
|
})]
|
|
3017
3104
|
})
|
|
3018
|
-
}), /* @__PURE__ */
|
|
3105
|
+
}), /* @__PURE__ */ H("section", {
|
|
3019
3106
|
className: "product-variants-manager--variants min-w-0",
|
|
3020
|
-
children: /* @__PURE__ */
|
|
3107
|
+
children: /* @__PURE__ */ H(qt, {
|
|
3021
3108
|
variants: s,
|
|
3022
3109
|
optionGroups: n,
|
|
3023
|
-
groupByOptionId:
|
|
3110
|
+
groupByOptionId: Re,
|
|
3024
3111
|
visibleColumns: c,
|
|
3025
3112
|
optionCombinationDisplay: l,
|
|
3026
3113
|
cellDisplay: d,
|
|
3027
|
-
selectionMode:
|
|
3028
|
-
renderOptionCombination:
|
|
3029
|
-
renderCell:
|
|
3114
|
+
selectionMode: f,
|
|
3115
|
+
renderOptionCombination: p,
|
|
3116
|
+
renderCell: h,
|
|
3030
3117
|
surface: "embedded",
|
|
3031
|
-
selectedVariantIds:
|
|
3118
|
+
selectedVariantIds: g,
|
|
3032
3119
|
defaultSelectedVariantIds: v,
|
|
3033
3120
|
onSelectedVariantIdsChange: y,
|
|
3034
3121
|
onVariantFieldChange: b,
|
|
3035
3122
|
onVariantFieldBlur: x,
|
|
3036
|
-
onCreateVariant:
|
|
3037
|
-
onGenerateVariants:
|
|
3038
|
-
onSelectVariant:
|
|
3039
|
-
onEditVariant:
|
|
3040
|
-
onDuplicateVariant:
|
|
3041
|
-
onDeleteVariant:
|
|
3042
|
-
onBulkEdit:
|
|
3043
|
-
onBulkApply:
|
|
3044
|
-
onBulkDelete:
|
|
3045
|
-
renderVariantActions:
|
|
3123
|
+
onCreateVariant: I,
|
|
3124
|
+
onGenerateVariants: L,
|
|
3125
|
+
onSelectVariant: le,
|
|
3126
|
+
onEditVariant: ue,
|
|
3127
|
+
onDuplicateVariant: de,
|
|
3128
|
+
onDeleteVariant: fe,
|
|
3129
|
+
onBulkEdit: pe,
|
|
3130
|
+
onBulkApply: me,
|
|
3131
|
+
onBulkDelete: R,
|
|
3132
|
+
renderVariantActions: z,
|
|
3046
3133
|
renderBulkActions: he,
|
|
3047
3134
|
strings: {
|
|
3048
|
-
title:
|
|
3049
|
-
generateLabel:
|
|
3050
|
-
...
|
|
3135
|
+
title: Z.variantsTitle,
|
|
3136
|
+
generateLabel: Z.generateLabel,
|
|
3137
|
+
...je
|
|
3051
3138
|
}
|
|
3052
3139
|
})
|
|
3053
3140
|
})]
|
|
@@ -3055,8 +3142,8 @@ function Gt({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionC
|
|
|
3055
3142
|
})
|
|
3056
3143
|
});
|
|
3057
3144
|
}
|
|
3058
|
-
|
|
3145
|
+
Jt.displayName = "ProductVariantsManager";
|
|
3059
3146
|
//#endregion
|
|
3060
|
-
export {
|
|
3147
|
+
export { at as ProductContractOverview, ot as ProductDetailsCard, ct as ProductOperationsCard, st as ProductOptionActionMenu, pt as ProductOptionsMatrix, mt as ProductOptionsSummary, St as ProductOverview, ht as ProductPoliciesCard, gt as ProductQuotePreviewCard, _t as ProductReadinessCard, vt as ProductStructureCard, wt as ProductVariantActionMenu, Dt as ProductVariantDetails, kt as ProductVariantEditor, qt as ProductVariantsBulkTable, Jt as ProductVariantsManager, xt as ProductVariantsTable, Me as defaultProductContractOverviewStrings, je as defaultProductDetailsCardStrings, Ae as defaultProductOperationsCardStrings, Z as defaultProductOptionActionMenuStrings, Ne as defaultProductOptionsMatrixStrings, X as defaultProductOptionsSummaryStrings, Ve as defaultProductOverviewStrings, Fe as defaultProductPoliciesCardStrings, Pe as defaultProductQuotePreviewCardStrings, ke as defaultProductReadinessCardStrings, Y as defaultProductStructureCardStrings, Re as defaultProductVariantActionMenuStrings, ze as defaultProductVariantDetailsStrings, Be as defaultProductVariantEditorStrings, Le as defaultProductVariantsBulkTableStrings, Q as defaultProductVariantsManagerStrings, Ie as defaultProductVariantsTableStrings };
|
|
3061
3148
|
|
|
3062
3149
|
//# sourceMappingURL=products.js.map
|