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