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