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