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