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