hasting-swatchcart-module 0.0.2 → 0.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/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/index.js +7 -0
- package/dist/_virtual/index2.js +7 -0
- package/dist/_virtual/index3.js +4 -0
- package/dist/_virtual/use-sync-external-store-with-selector.development.js +4 -0
- package/dist/_virtual/use-sync-external-store-with-selector.production.js +4 -0
- package/dist/_virtual/utilities.js +4 -0
- package/dist/_virtual/with-selector.js +5 -0
- package/dist/_virtual/with-selector2.js +4 -0
- package/dist/assets/src/shared/ui/CustomSidebar/CustomSidebar.module.css +1 -0
- package/dist/assets/src/shared/ui/Markdown/MDWithAccordion.module.css +1 -0
- package/dist/assets/src/shared/ui/PopoverTooltip/PopoverTooltip.module.css +0 -0
- package/dist/components/SwatchesModule.js +22 -38896
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +527 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +251 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +68 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +256 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +231 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
- package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +877 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +35 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +497 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +62 -0
- package/dist/node_modules/@ungap/structured-clone/esm/index.js +11 -0
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +106 -0
- package/dist/node_modules/@ungap/structured-clone/esm/types.js +13 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
- package/dist/node_modules/bail/index.js +7 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/comma-separated-tokens/index.js +20 -0
- package/dist/node_modules/decode-named-character-reference/index.dom.js +14 -0
- package/dist/node_modules/devlop/lib/default.js +8 -0
- package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +7 -0
- package/dist/node_modules/extend/index.js +43 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
- package/dist/node_modules/hast-util-from-parse5/lib/index.js +145 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.js +20 -0
- package/dist/node_modules/hast-util-raw/lib/index.js +217 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +302 -0
- package/dist/node_modules/hast-util-to-parse5/lib/index.js +118 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.js +12 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.js +61 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.js +33 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.js +368 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.js +6 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.js +566 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.js +22 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.js +27 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.js +23 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.js +11 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.js +17 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.js +14 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.js +11 -0
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.js +11 -0
- package/dist/node_modules/hast-util-whitespace/lib/index.js +10 -0
- package/dist/node_modules/hastscript/lib/create-h.js +112 -0
- package/dist/node_modules/hastscript/lib/index.js +8 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +44 -0
- package/dist/node_modules/html-url-attributes/lib/index.js +26 -0
- package/dist/node_modules/html-void-elements/index.js +25 -0
- package/dist/node_modules/immer/dist/immer.js +467 -0
- package/dist/node_modules/inline-style-parser/index.js +93 -0
- package/dist/node_modules/is-plain-obj/index.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +40 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +19 -0
- package/dist/node_modules/mdast-util-from-markdown/lib/index.js +581 -0
- package/dist/node_modules/mdast-util-to-hast/lib/footer.js +90 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +8 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +15 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +28 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +9 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +14 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +58 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +14 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +19 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +15 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +42 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +21 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +7 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +21 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +32 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +8 -0
- package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +12 -0
- package/dist/node_modules/mdast-util-to-hast/lib/index.js +10 -0
- package/dist/node_modules/mdast-util-to-hast/lib/revert.js +13 -0
- package/dist/node_modules/mdast-util-to-hast/lib/state.js +104 -0
- package/dist/node_modules/mdast-util-to-string/lib/index.js +29 -0
- package/dist/node_modules/micromark/lib/constructs.js +85 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.js +223 -0
- package/dist/node_modules/micromark/lib/initialize/content.js +37 -0
- package/dist/node_modules/micromark/lib/initialize/document.js +126 -0
- package/dist/node_modules/micromark/lib/initialize/flow.js +33 -0
- package/dist/node_modules/micromark/lib/initialize/text.js +95 -0
- package/dist/node_modules/micromark/lib/parse.js +32 -0
- package/dist/node_modules/micromark/lib/postprocess.js +9 -0
- package/dist/node_modules/micromark/lib/preprocess.js +39 -0
- package/dist/node_modules/micromark-core-commonmark/lib/attention.js +83 -0
- package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +43 -0
- package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +18 -0
- package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +42 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +17 -0
- package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +30 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +94 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +43 -0
- package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +45 -0
- package/dist/node_modules/micromark-core-commonmark/lib/content.js +50 -0
- package/dist/node_modules/micromark-core-commonmark/lib/definition.js +80 -0
- package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +17 -0
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +46 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +144 -0
- package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +102 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +152 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +22 -0
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +19 -0
- package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +14 -0
- package/dist/node_modules/micromark-core-commonmark/lib/list.js +90 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +57 -0
- package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +25 -0
- package/dist/node_modules/micromark-factory-destination/index.js +31 -0
- package/dist/node_modules/micromark-factory-label/index.js +28 -0
- package/dist/node_modules/micromark-factory-space/index.js +15 -0
- package/dist/node_modules/micromark-factory-title/index.js +26 -0
- package/dist/node_modules/micromark-factory-whitespace/index.js +12 -0
- package/dist/node_modules/micromark-util-character/index.js +39 -0
- package/dist/node_modules/micromark-util-chunked/index.js +16 -0
- package/dist/node_modules/micromark-util-classify-character/index.js +10 -0
- package/dist/node_modules/micromark-util-combine-extensions/index.js +36 -0
- package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +16 -0
- package/dist/node_modules/micromark-util-decode-string/index.js +18 -0
- package/dist/node_modules/micromark-util-html-tag-name/index.js +68 -0
- package/dist/node_modules/micromark-util-normalize-identifier/index.js +6 -0
- package/dist/node_modules/micromark-util-resolve-all/index.js +12 -0
- package/dist/node_modules/micromark-util-sanitize-uri/index.js +23 -0
- package/dist/node_modules/micromark-util-subtokenize/index.js +55 -0
- package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +175 -0
- package/dist/node_modules/parse5/dist/common/doctype.js +98 -0
- package/dist/node_modules/parse5/dist/common/error-codes.js +7 -0
- package/dist/node_modules/parse5/dist/common/foreign-content.js +210 -0
- package/dist/node_modules/parse5/dist/common/html.js +250 -0
- package/dist/node_modules/parse5/dist/common/token.js +14 -0
- package/dist/node_modules/parse5/dist/common/unicode.js +73 -0
- package/dist/node_modules/parse5/dist/parser/formatting-element-list.js +84 -0
- package/dist/node_modules/parse5/dist/parser/index.js +2271 -0
- package/dist/node_modules/parse5/dist/parser/open-element-stack.js +240 -0
- package/dist/node_modules/parse5/dist/serializer/index.js +2 -0
- package/dist/node_modules/parse5/dist/tokenizer/index.js +1940 -0
- package/dist/node_modules/parse5/dist/tokenizer/preprocessor.js +88 -0
- package/dist/node_modules/parse5/dist/tree-adapters/default.js +162 -0
- package/dist/node_modules/parse5/node_modules/entities/dist/esm/decode-codepoint.js +38 -0
- package/dist/node_modules/parse5/node_modules/entities/dist/esm/decode.js +245 -0
- package/dist/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
- package/dist/node_modules/property-information/index.js +12 -0
- package/dist/node_modules/property-information/lib/aria.js +61 -0
- package/dist/node_modules/property-information/lib/find.js +33 -0
- package/dist/node_modules/property-information/lib/hast-to-react.js +22 -0
- package/dist/node_modules/property-information/lib/html.js +368 -0
- package/dist/node_modules/property-information/lib/normalize.js +6 -0
- package/dist/node_modules/property-information/lib/svg.js +566 -0
- package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
- package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
- package/dist/node_modules/property-information/lib/util/create.js +19 -0
- package/dist/node_modules/property-information/lib/util/defined-info.js +36 -0
- package/dist/node_modules/property-information/lib/util/info.js +28 -0
- package/dist/node_modules/property-information/lib/util/merge.js +10 -0
- package/dist/node_modules/property-information/lib/util/schema.js +21 -0
- package/dist/node_modules/property-information/lib/util/types.js +14 -0
- package/dist/node_modules/property-information/lib/xlink.js +19 -0
- package/dist/node_modules/property-information/lib/xml.js +11 -0
- package/dist/node_modules/property-information/lib/xmlns.js +11 -0
- package/dist/node_modules/react-markdown/lib/index.js +102 -0
- package/dist/node_modules/react-redux/dist/react-redux.js +135 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
- package/dist/node_modules/redux/dist/redux.js +258 -0
- package/dist/node_modules/redux-thunk/dist/redux-thunk.js +8 -0
- package/dist/node_modules/rehype-raw/lib/index.js +12 -0
- package/dist/node_modules/remark-parse/lib/index.js +19 -0
- package/dist/node_modules/remark-rehype/lib/index.js +18 -0
- package/dist/node_modules/reselect/dist/reselect.js +244 -0
- package/dist/node_modules/space-separated-tokens/index.js +11 -0
- package/dist/node_modules/style-to-js/cjs/index.js +20 -0
- package/dist/node_modules/style-to-js/cjs/utilities.js +19 -0
- package/dist/node_modules/style-to-object/cjs/index.js +28 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2731 -0
- package/dist/node_modules/trim-lines/index.js +28 -0
- package/dist/node_modules/trough/lib/index.js +60 -0
- package/dist/node_modules/tslib/tslib.es6.js +27 -0
- package/dist/node_modules/unified/lib/callable-instance.js +25 -0
- package/dist/node_modules/unified/lib/index.js +529 -0
- package/dist/node_modules/unist-util-is/lib/index.js +84 -0
- package/dist/node_modules/unist-util-position/lib/index.js +23 -0
- package/dist/node_modules/unist-util-stringify-position/lib/index.js +15 -0
- package/dist/node_modules/unist-util-visit/lib/index.js +16 -0
- package/dist/node_modules/unist-util-visit-parents/lib/color.js +6 -0
- package/dist/node_modules/unist-util-visit-parents/lib/index.js +56 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +66 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +65 -0
- package/dist/node_modules/use-sync-external-store/with-selector.js +10 -0
- package/dist/node_modules/vfile/lib/index.js +406 -0
- package/dist/node_modules/vfile/lib/minpath.browser.js +112 -0
- package/dist/node_modules/vfile/lib/minproc.browser.js +7 -0
- package/dist/node_modules/vfile/lib/minurl.browser.js +41 -0
- package/dist/node_modules/vfile/lib/minurl.shared.js +7 -0
- package/dist/node_modules/vfile-location/lib/index.js +42 -0
- package/dist/node_modules/vfile-message/lib/index.js +91 -0
- package/dist/node_modules/web-namespaces/index.js +11 -0
- package/dist/node_modules/zwitch/index.js +18 -0
- package/dist/src/app/assets/images/product_thumb.png.js +4 -0
- package/dist/src/app/assets/svg/ArrowIconSVG.js +25 -0
- package/dist/src/app/assets/svg/CheckMarkIconSVG.js +25 -0
- package/dist/src/app/assets/svg/CloseIconSVG.js +25 -0
- package/dist/src/app/assets/svg/MinusIconSVG.js +24 -0
- package/dist/src/app/assets/svg/PlusIconSVG.js +24 -0
- package/dist/src/app/assets/svg/SearchIconSVG.js +37 -0
- package/dist/src/app/assets/svg/TrashIconSVG.js +24 -0
- package/dist/src/app/store/rootReducer.js +12 -0
- package/dist/src/app/store/store.js +14 -0
- package/dist/src/features/Cart/lib/CartCervices.js +8 -0
- package/dist/src/features/Cart/model/cartSlice.js +58 -0
- package/dist/src/features/Cart/model/selectors.js +18 -0
- package/dist/src/features/Cart/ui/CartHeader/CartHeader.js +53 -0
- package/dist/src/features/Cart/ui/CartList/CartList.js +29 -0
- package/dist/src/features/Cart/ui/CartListItem/CartListItem.js +41 -0
- package/dist/src/features/Cart/ui/CartPrice/CartPrice.js +23 -0
- package/dist/src/features/Cart/ui/CartWrapper/CartWrapper.js +38 -0
- package/dist/src/features/Cart/ui/Counter/Counter.js +46 -0
- package/dist/src/features/DataAdapter/lib/DataAdapterServices.js +102 -0
- package/dist/src/features/DataAdapter/utils/types.js +8 -0
- package/dist/src/features/MultiProduct/lib/MultiProductCartServices.js +34 -0
- package/dist/src/features/MultiProduct/model/API/api.js +18 -0
- package/dist/src/features/MultiProduct/model/multiProductCartSlice.js +83 -0
- package/dist/src/features/MultiProduct/model/selectors.js +7 -0
- package/dist/src/features/MultiProduct/ui/CartSelectedProductList/CartSelectedProductList.js +21 -0
- package/dist/src/features/MultiProduct/ui/CustomModal/CustomModal.js +28 -0
- package/dist/src/features/MultiProduct/ui/FiltersSelectedProductItem/FiltersSelectedProductItem.js +27 -0
- package/dist/src/features/MultiProduct/ui/MultiProductCartHeader/MultiProductCartHeader.js +60 -0
- package/dist/src/features/MultiProduct/ui/MultiProductItemCart/MultiProductItemCart.js +71 -0
- package/dist/src/features/MultiProduct/ui/MultiProductWrapper/MultiProductWrapper.js +19 -0
- package/dist/src/features/MultiProduct/ui/ProductList/ProductList.js +138 -0
- package/dist/src/features/MultiProduct/ui/ProductListItem/ProductListItem.js +51 -0
- package/dist/src/features/MultiProduct/ui/SelectedProductItem/SelectedProductItem.js +55 -0
- package/dist/src/features/MultiProduct/ui/SwatchContentContainer/SwatchContentContainer.js +46 -0
- package/dist/src/features/MultiProduct/utils/constants.js +16 -0
- package/dist/src/features/MultiProduct/utils/randomList.js +41 -0
- package/dist/src/features/swatches/lib/AttributeHelper.js +21 -0
- package/dist/src/features/swatches/lib/SwatchesServices.js +54 -0
- package/dist/src/features/swatches/model/selectors.js +12 -0
- package/dist/src/features/swatches/model/swatchesSlice.js +108 -0
- package/dist/src/features/swatches/model/thunks.js +22 -0
- package/dist/src/features/swatches/model/types.js +6 -0
- package/dist/src/features/swatches/ui/Filters/ColorsFilter.js +45 -0
- package/dist/src/features/swatches/ui/Filters/LooksFilter.js +45 -0
- package/dist/src/features/swatches/ui/Filters/MaterialsFilter.js +47 -0
- package/dist/src/features/swatches/ui/Filters/index.js +12 -0
- package/dist/src/features/swatches/ui/HexGridZoom/HexGridZoom.js +50 -0
- package/dist/src/features/swatches/ui/ImageGridZoom/ImageGridZoom.js +45 -0
- package/dist/src/features/swatches/ui/MaterialList/index.js +39 -0
- package/dist/src/features/swatches/ui/MaterialListItem/MaterialListItem.js +51 -0
- package/dist/src/features/swatches/ui/ProductElement/index.js +65 -0
- package/dist/src/features/swatches/ui/SwatchWrapper/SwatchWrapper.js +62 -0
- package/dist/src/features/swatches/ui/Swatches.js +51 -0
- package/dist/src/features/swatches/ui/SwatchesList/SwatchesList.js +67 -0
- package/dist/src/features/swatches/utils/constants.js +8 -0
- package/dist/src/shared/constants/props.js +13337 -0
- package/dist/src/shared/constants/selectedMaterials.js +4 -0
- package/dist/src/shared/types/activeTab.js +7 -0
- package/dist/src/shared/ui/Checkbox/Checkbox.js +31 -0
- package/dist/src/shared/ui/CustomButton/CustomButton.js +16 -0
- package/dist/src/shared/ui/CustomSidebar/CustomSidebar.js +59 -0
- package/dist/src/shared/ui/CustomSidebar/CustomSidebar.module.scss.js +13 -0
- package/dist/src/shared/ui/Dialog/Dialog.js +81 -0
- package/dist/src/shared/ui/Label/Label.js +27 -0
- package/dist/src/shared/ui/Markdown/MDWithAccordion.js +36 -0
- package/dist/src/shared/ui/Markdown/MDWithAccordion.module.scss.js +9 -0
- package/dist/src/shared/ui/MaterialItem/MaterialItem.js +36 -0
- package/dist/src/shared/ui/MultiSelect/MultiSelect.js +150 -0
- package/dist/src/shared/ui/PopoverTooltip/InfoIcon.js +35 -0
- package/dist/src/shared/ui/PopoverTooltip/PopoverTooltip.js +37 -0
- package/dist/src/shared/ui/PopoverTooltip/PopoverTooltip.module.scss.js +4 -0
- package/dist/src/shared/ui/Slider/Slider.js +117 -0
- package/dist/src/shared/utils/cn.js +8 -0
- package/dist/src/shared/utils/uniqueList.js +4 -0
- package/package.json +12 -2
- package/dist/assets/SwatchesModule.css +0 -1
- /package/dist/{lib/components → components}/SwatchesModule.d.ts +0 -0
- /package/dist/{lib/main.d.ts → main.d.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useEffect as f } from "react";
|
|
3
|
+
import { useAppDispatch as h, useAppSelector as r } from "../../../../app/store/store.js";
|
|
4
|
+
import { MultiSelect as d } from "../../../../shared/ui/MultiSelect/MultiSelect.js";
|
|
5
|
+
import { getMaterialSelectStateFilters as M, getAllMaterialValues as g } from "../../model/selectors.js";
|
|
6
|
+
import { setMaterialSelect as F } from "../../model/swatchesSlice.js";
|
|
7
|
+
const v = () => {
|
|
8
|
+
const i = h(), o = r(M), a = r(g), [s, n] = u([]);
|
|
9
|
+
f(() => {
|
|
10
|
+
if (a?.length) {
|
|
11
|
+
const e = [
|
|
12
|
+
...new Set(
|
|
13
|
+
a.map(
|
|
14
|
+
(t) => t.metadata?.Finish || t.metadata?.Material
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
].filter(Boolean).map((t) => {
|
|
18
|
+
const p = a.filter(
|
|
19
|
+
(l) => l.metadata?.Finish === t || l.metadata?.Material === t
|
|
20
|
+
).length;
|
|
21
|
+
return {
|
|
22
|
+
value: t,
|
|
23
|
+
label: t,
|
|
24
|
+
count: p
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
e?.length && n(e);
|
|
28
|
+
}
|
|
29
|
+
}, [a]);
|
|
30
|
+
const m = (e, t) => {
|
|
31
|
+
i(F({ filterName: e, values: t }));
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ c(
|
|
34
|
+
d,
|
|
35
|
+
{
|
|
36
|
+
options: s,
|
|
37
|
+
values: o.Finish,
|
|
38
|
+
onValueChange: (e) => m("Finish", e),
|
|
39
|
+
placeholder: "Material",
|
|
40
|
+
className: "max-w-[100px] sm:max-w-[auto] sm:min-w-[160px]",
|
|
41
|
+
dropdownWidth: "w-80"
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
v as MaterialsFilter
|
|
47
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MaterialsFilter as i } from "./MaterialsFilter.js";
|
|
3
|
+
import { ColorsFilter as s } from "./ColorsFilter.js";
|
|
4
|
+
import { LooksFilter as e } from "./LooksFilter.js";
|
|
5
|
+
const f = ({ containerStyles: o }) => /* @__PURE__ */ t("div", { className: o, children: [
|
|
6
|
+
/* @__PURE__ */ r(i, {}),
|
|
7
|
+
/* @__PURE__ */ r(s, {}),
|
|
8
|
+
/* @__PURE__ */ r(e, {})
|
|
9
|
+
] });
|
|
10
|
+
export {
|
|
11
|
+
f as Filters
|
|
12
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { AttributeHelper as s } from "../../lib/AttributeHelper.js";
|
|
4
|
+
import { Dialog as p, DialogContent as u, DialogHeader as f, DialogTitle as g } from "../../../../shared/ui/Dialog/Dialog.js";
|
|
5
|
+
const w = ({ item: e }) => {
|
|
6
|
+
const [r, h] = l(null), [n, i] = l(!1), d = "#f2f1f1", t = s.getHexColor(e);
|
|
7
|
+
return /* @__PURE__ */ a(m, { children: [
|
|
8
|
+
/* @__PURE__ */ o(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
className: "group relative w-full h-full aspect-video overflow-hidden shadow-sm group cursor-pointer rounded-sm",
|
|
12
|
+
style: { backgroundColor: t || d }
|
|
13
|
+
}
|
|
14
|
+
),
|
|
15
|
+
/* @__PURE__ */ o(
|
|
16
|
+
p,
|
|
17
|
+
{
|
|
18
|
+
open: !!n,
|
|
19
|
+
onOpenChange: () => {
|
|
20
|
+
i(!1);
|
|
21
|
+
},
|
|
22
|
+
children: /* @__PURE__ */ a(
|
|
23
|
+
u,
|
|
24
|
+
{
|
|
25
|
+
className: "sm:max-w-5xl",
|
|
26
|
+
onClick: (c) => c.stopPropagation(),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(g, { className: "sr-only", children: "Hex Color" }) }),
|
|
29
|
+
/* @__PURE__ */ o(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: "w-full aspect-video rounded",
|
|
33
|
+
style: { backgroundColor: r || "transparent" }
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
t && /* @__PURE__ */ a("span", { className: "text-white mt-2 block", children: [
|
|
37
|
+
" ",
|
|
38
|
+
(e?.metadata?.Material || e?.metadata?.Material) && `${e.metadata?.Material} | `,
|
|
39
|
+
s.getAttributeLabel(e)
|
|
40
|
+
] })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] });
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
w as HexGridZoom
|
|
50
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as o, Fragment as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r } from "react";
|
|
3
|
+
import { AttributeHelper as s } from "../../lib/AttributeHelper.js";
|
|
4
|
+
import { Dialog as g, DialogContent as p, DialogHeader as h, DialogTitle as u } from "../../../../shared/ui/Dialog/Dialog.js";
|
|
5
|
+
const b = ({ item: a }) => {
|
|
6
|
+
const [n, f] = r(""), [i, m] = r(!1), l = s.getImage(a), t = s.getValueLabel(a);
|
|
7
|
+
return /* @__PURE__ */ o(d, { children: [
|
|
8
|
+
/* @__PURE__ */ e("div", { className: "group relative w-full h-full aspect-video overflow-hidden shadow-sm group cursor-pointer rounded-sm", children: l && /* @__PURE__ */ e(
|
|
9
|
+
"img",
|
|
10
|
+
{
|
|
11
|
+
src: l,
|
|
12
|
+
alt: t,
|
|
13
|
+
className: "w-full h-full object-cover",
|
|
14
|
+
loading: "lazy"
|
|
15
|
+
}
|
|
16
|
+
) }),
|
|
17
|
+
/* @__PURE__ */ e(
|
|
18
|
+
g,
|
|
19
|
+
{
|
|
20
|
+
open: !!i,
|
|
21
|
+
onOpenChange: () => {
|
|
22
|
+
m(!1);
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ o(
|
|
25
|
+
p,
|
|
26
|
+
{
|
|
27
|
+
className: "sm:max-w-5xl",
|
|
28
|
+
onClick: (c) => c.stopPropagation(),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(u, { className: "sr-only", children: "Image Zoom" }) }),
|
|
31
|
+
/* @__PURE__ */ e("img", { src: n, alt: "Zoomed", className: "w-full h-auto" }),
|
|
32
|
+
/* @__PURE__ */ o("span", { className: "text-white mt-2 block", children: [
|
|
33
|
+
(a?.metadata?.Finish || a?.metadata?.Material) && `${a.metadata?.Finish || a.metadata?.Material} | `,
|
|
34
|
+
t
|
|
35
|
+
] })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] });
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
b as ImageGridZoom
|
|
45
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as V, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as F, useMemo as N } from "react";
|
|
3
|
+
import { useVirtualizer as b } from "../../../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
4
|
+
import { useAppSelector as f } from "../../../../app/store/store.js";
|
|
5
|
+
import { getAllMaterialValues as j, getMaterialSelectStateFilters as A } from "../../model/selectors.js";
|
|
6
|
+
import { MaterialListItem as w } from "../MaterialListItem/MaterialListItem.js";
|
|
7
|
+
const G = ({
|
|
8
|
+
containerStyles: x = "flex-1 min-h-0 overflow-y-auto p-[var(--padding)] sm:p-[var(--sm-padding)]",
|
|
9
|
+
gridStyles: k = "grid grid-cols-1 gap-[8px] sm:grid-cols-3",
|
|
10
|
+
desktopColumnsCount: M = 3
|
|
11
|
+
}) => {
|
|
12
|
+
const m = F(null), h = f(j), e = f(A), a = N(() => h.filter((t) => {
|
|
13
|
+
const d = e.Finish.length === 0 || e.Finish.some(
|
|
14
|
+
(s) => t.metadata?.Finish === s || t.metadata?.Material === s
|
|
15
|
+
), i = e.Color.length === 0 || t.metadata?.Color && e.Color.some(
|
|
16
|
+
(s) => t.metadata?.Color?.split(",").map((O) => O.trim()).includes(s)
|
|
17
|
+
), r = t.metadata?.Look, g = !e.Look || e.Look.length === 0 || e.Look.some(
|
|
18
|
+
(s) => r && r.includes(s)
|
|
19
|
+
);
|
|
20
|
+
return d && i && g;
|
|
21
|
+
}), [e, h]), u = typeof window < "u" ? window.matchMedia("(min-width: 640px)").matches : !1, l = u ? M : 1, v = Math.ceil(a.length / l), R = u ? 300 : 200, c = b({
|
|
22
|
+
count: v,
|
|
23
|
+
getScrollElement: () => m.current,
|
|
24
|
+
estimateSize: () => R,
|
|
25
|
+
overscan: 24,
|
|
26
|
+
measureElement: (t) => t?.getBoundingClientRect().height
|
|
27
|
+
}), o = c.getVirtualItems(), S = c.getTotalSize(), I = o[0]?.index ?? 0, z = o[o.length - 1]?.index ?? -1, p = I * l, C = Math.min((z + 1) * l, a.length), L = a.slice(p, C), y = o[0]?.start ?? 0, E = S - (o[o.length - 1]?.end ?? 0);
|
|
28
|
+
return /* @__PURE__ */ V("div", { ref: m, className: x, children: [
|
|
29
|
+
/* @__PURE__ */ n("div", { style: { height: y }, "aria-hidden": !0 }),
|
|
30
|
+
/* @__PURE__ */ n("div", { className: k, children: L.map((t, d) => {
|
|
31
|
+
const i = p + d, r = `${t.metadata.label || i}/${t.parentName}`;
|
|
32
|
+
return (i + 1) % l === 0 || i === a.length - 1 ? /* @__PURE__ */ n("div", { ref: c.measureElement, children: /* @__PURE__ */ n(w, { val: t }) }, r) : /* @__PURE__ */ n(w, { val: t }, r);
|
|
33
|
+
}) }),
|
|
34
|
+
/* @__PURE__ */ n("div", { style: { height: E }, "aria-hidden": !0 })
|
|
35
|
+
] });
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
G as MaterialList
|
|
39
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsxs as t, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { AttributeHelper as c } from "../../lib/AttributeHelper.js";
|
|
3
|
+
import { ImageGridZoom as d } from "../ImageGridZoom/ImageGridZoom.js";
|
|
4
|
+
import { HexGridZoom as l } from "../HexGridZoom/HexGridZoom.js";
|
|
5
|
+
import { useAppDispatch as p, useAppSelector as f } from "../../../../app/store/store.js";
|
|
6
|
+
import { setSelectedMaterials as h } from "../../model/swatchesSlice.js";
|
|
7
|
+
import { getSelectedMaterials as b } from "../../model/selectors.js";
|
|
8
|
+
import { CheckMarkIconSVG as u } from "../../../../app/assets/svg/CheckMarkIconSVG.js";
|
|
9
|
+
const j = ({ val: e }) => {
|
|
10
|
+
const a = p(), m = f(b), n = (r) => {
|
|
11
|
+
a(h({ selectedMaterial: r }));
|
|
12
|
+
}, i = e && e.assetId ? e.assetId : "false", o = m.find(
|
|
13
|
+
(r) => r.assetId === i && r.parentName === e.parentName
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ t("div", { className: "w-31 rounded mb-[20px] sm:w-40", children: [
|
|
16
|
+
/* @__PURE__ */ t(
|
|
17
|
+
"button",
|
|
18
|
+
{
|
|
19
|
+
onClick: () => n(e),
|
|
20
|
+
className: `w-31 h-31 rounded sm:w-40 sm:h-40 relative aspect-square overflow-hidden transition ${o ? "border-amber-700" : "border-transparent"}`,
|
|
21
|
+
children: [
|
|
22
|
+
c.getImage(e) ? /* @__PURE__ */ s(d, { item: e }) : /* @__PURE__ */ s(l, { item: e }),
|
|
23
|
+
/* @__PURE__ */ s(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: `absolute top-0 right-0 m-2 w-[30px] h-[30px] flex justify-center items-center
|
|
27
|
+
bg-[var(--background-grey)] rounded-2xl
|
|
28
|
+
border-none pointer-events-none
|
|
29
|
+
${o ? "bg-[var(--main-accent-color)]" : ""}`,
|
|
30
|
+
children: /* @__PURE__ */ s(u, {})
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
e.assetId
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col mt-3", children: [
|
|
38
|
+
/* @__PURE__ */ t("span", { className: "font-normal mb-1", children: [
|
|
39
|
+
e.metadata.label,
|
|
40
|
+
" "
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ t("span", { className: "font-medium", children: [
|
|
43
|
+
e.parentName,
|
|
44
|
+
" "
|
|
45
|
+
] })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
j as MaterialListItem
|
|
51
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as L, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useEffect as V } from "react";
|
|
3
|
+
import { useAppDispatch as M, useAppSelector as m } from "../../../../app/store/store.js";
|
|
4
|
+
import { MultiSelect as N } from "../../../../shared/ui/MultiSelect/MultiSelect.js";
|
|
5
|
+
import { getProductElementOptions as O, getMaterialSelectStateFilters as w } from "../../model/selectors.js";
|
|
6
|
+
import { uniqueList as x } from "../../../../shared/utils/uniqueList.js";
|
|
7
|
+
import { setMaterialSelect as A, setPanelFilter as p } from "../../model/swatchesSlice.js";
|
|
8
|
+
import { SwatchesServices as d } from "../../lib/SwatchesServices.js";
|
|
9
|
+
const k = ({
|
|
10
|
+
containerStyles: f,
|
|
11
|
+
selectStyles: h
|
|
12
|
+
}) => {
|
|
13
|
+
const l = M(), e = m(O), P = m(w), [g, S] = u(
|
|
14
|
+
[]
|
|
15
|
+
), [E, a] = u([]);
|
|
16
|
+
V(() => {
|
|
17
|
+
if (!e?.length) return;
|
|
18
|
+
const o = e.map((r) => {
|
|
19
|
+
const { Name: t, Label: s } = r.metadata || {};
|
|
20
|
+
return { value: t, label: s, id: t };
|
|
21
|
+
});
|
|
22
|
+
S(o);
|
|
23
|
+
}, [e]);
|
|
24
|
+
const F = (o, r) => {
|
|
25
|
+
if (r.length) {
|
|
26
|
+
const t = x(r);
|
|
27
|
+
if (t.length) {
|
|
28
|
+
const s = e.filter(
|
|
29
|
+
(i) => t.includes(i.metadata?.Label)
|
|
30
|
+
);
|
|
31
|
+
a(t);
|
|
32
|
+
const b = d.mapFiltersFromValues(
|
|
33
|
+
s,
|
|
34
|
+
P
|
|
35
|
+
), n = d.getPositiveSelectedFilers(b);
|
|
36
|
+
n.length && n.forEach((i) => {
|
|
37
|
+
const { filterName: v, filterKeys: C } = i;
|
|
38
|
+
l(A({ filterName: v, values: C }));
|
|
39
|
+
}), l(p({ attributes: s }));
|
|
40
|
+
} else
|
|
41
|
+
l(p({ attributes: e }));
|
|
42
|
+
} else
|
|
43
|
+
a([]);
|
|
44
|
+
};
|
|
45
|
+
return (
|
|
46
|
+
// <div className='flex justify-between items-center shrink-0 p-[var(--padding)] border-b border-solid border-[var(--border)] sm:p-[var(--sm-padding)]'>
|
|
47
|
+
/* @__PURE__ */ L("div", { className: f, children: [
|
|
48
|
+
/* @__PURE__ */ c("span", { children: "Product element" }),
|
|
49
|
+
/* @__PURE__ */ c(
|
|
50
|
+
N,
|
|
51
|
+
{
|
|
52
|
+
options: g,
|
|
53
|
+
values: E,
|
|
54
|
+
onValueChange: (o) => F("PanelElement", o),
|
|
55
|
+
placeholder: "All product elements",
|
|
56
|
+
className: h,
|
|
57
|
+
dropdownWidth: "w-80"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] })
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
k as ProductElement
|
|
65
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { ProductElement as m } from "../ProductElement/index.js";
|
|
3
|
+
import { Filters as c } from "../Filters/index.js";
|
|
4
|
+
import { MaterialList as p } from "../MaterialList/index.js";
|
|
5
|
+
import { SwatchesList as f } from "../SwatchesList/SwatchesList.js";
|
|
6
|
+
import { EActiveTab as b } from "../../../../shared/types/activeTab.js";
|
|
7
|
+
import { CloseIconSVG as h } from "../../../../app/assets/svg/CloseIconSVG.js";
|
|
8
|
+
import u from "../../../../shared/ui/CustomSidebar/CustomSidebar.js";
|
|
9
|
+
import { useAppDispatch as g, useAppSelector as a } from "../../../../app/store/store.js";
|
|
10
|
+
import { getSelectedMaterials as v } from "../../model/selectors.js";
|
|
11
|
+
import { CartCervices as x } from "../../../Cart/lib/CartCervices.js";
|
|
12
|
+
import { setCartItems as w } from "../../../Cart/model/cartSlice.js";
|
|
13
|
+
import { getCartItems as C } from "../../../Cart/model/selectors.js";
|
|
14
|
+
const R = ({
|
|
15
|
+
isOpen: i,
|
|
16
|
+
onToggleSidebar: o,
|
|
17
|
+
onSetActiveTab: n
|
|
18
|
+
}) => {
|
|
19
|
+
const d = g(), l = a(v) ?? [], s = a(C);
|
|
20
|
+
return /* @__PURE__ */ t(u, { isOpen: i, setIsOpen: o, children: [
|
|
21
|
+
/* @__PURE__ */ t("header", { className: "flex p-[var(--padding)] justify-between items-center border-b border-solid border-[var(--border)] sm:p-[var(--sm-padding)]", children: [
|
|
22
|
+
/* @__PURE__ */ r("h2", { className: "m-0 text-[16px] leading-[1.6] font-medium", children: "Order free swatches" }),
|
|
23
|
+
/* @__PURE__ */ r(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
className: `flex justify-center items-center w-[30px] h-[30px] bg-[var(--background-grey)]\r
|
|
27
|
+
border-none cursor-pointer rounded-full\r
|
|
28
|
+
[&_svg_path]:stroke-[var(--svg-dark)]`,
|
|
29
|
+
onClick: o,
|
|
30
|
+
children: /* @__PURE__ */ r(h, { width: 10, height: 10 })
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col h-full min-h-0", children: [
|
|
35
|
+
/* @__PURE__ */ r(
|
|
36
|
+
m,
|
|
37
|
+
{
|
|
38
|
+
containerStyles: "flex justify-between items-center shrink-0 p-[var(--padding)] border-b border-solid border-[var(--border)] sm:p-[var(--sm-padding)]",
|
|
39
|
+
selectStyles: "min-w-[auto] max-w-[154px] sm:max-w-[auto] sm:min-w-[250px]"
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ r(c, { containerStyles: "shrink-0 flex justify-between items-center gap-2 p-[var(--padding)] border-b border-solid border-[var(--border)] sm:p-[var(--sm-padding)]" }),
|
|
43
|
+
/* @__PURE__ */ r(p, {}),
|
|
44
|
+
/* @__PURE__ */ r(f, {}),
|
|
45
|
+
/* @__PURE__ */ r("div", { className: "p-[var(--padding)] border-t border-solid border-[var(--border)] shrink-0", children: /* @__PURE__ */ r(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
className: "w-full bg-[var(--main-accent-color)] text-white py-3 rounded-full font-bold cursor-pointer",
|
|
49
|
+
onClick: () => {
|
|
50
|
+
console.log("cartItems", s), console.log("selectedMaterials", s);
|
|
51
|
+
const e = x.getCartPreparedOption(l);
|
|
52
|
+
console.log("cartData", e), e && d(w(e)), n(b.CART);
|
|
53
|
+
},
|
|
54
|
+
children: "ADD SWATCHES TO CART"
|
|
55
|
+
}
|
|
56
|
+
) })
|
|
57
|
+
] })
|
|
58
|
+
] });
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
R as SwatchWrapper
|
|
62
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useEffect as S } from "react";
|
|
3
|
+
import { useAppDispatch as h } from "../../../app/store/store.js";
|
|
4
|
+
import { setAllMaterialsOptions as u } from "../model/swatchesSlice.js";
|
|
5
|
+
import { SwatchWrapper as v } from "./SwatchWrapper/SwatchWrapper.js";
|
|
6
|
+
import { CartWrapper as b } from "../../Cart/ui/CartWrapper/CartWrapper.js";
|
|
7
|
+
import { EActiveTab as p } from "../../../shared/types/activeTab.js";
|
|
8
|
+
import { EDataInputType as m } from "../../DataAdapter/utils/types.js";
|
|
9
|
+
import { DataAdapterServices as l } from "../../DataAdapter/lib/DataAdapterServices.js";
|
|
10
|
+
const H = ({
|
|
11
|
+
isOpen: a,
|
|
12
|
+
uiDataType: c,
|
|
13
|
+
data: r,
|
|
14
|
+
onToggleSidebar: o
|
|
15
|
+
// onSendData,
|
|
16
|
+
}) => {
|
|
17
|
+
const s = h(), [f, n] = T(p.SWATCH);
|
|
18
|
+
S(() => {
|
|
19
|
+
if (r) {
|
|
20
|
+
if (c === m.UI) {
|
|
21
|
+
const t = l.getTransformedData({
|
|
22
|
+
dataType: m.UI,
|
|
23
|
+
data: r
|
|
24
|
+
});
|
|
25
|
+
t && s(u(t));
|
|
26
|
+
}
|
|
27
|
+
} else
|
|
28
|
+
throw new Error("SwatchCart-module: Attributes are important");
|
|
29
|
+
}, [r]);
|
|
30
|
+
const i = (t) => {
|
|
31
|
+
n(t);
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ e(A, { children: f === p.SWATCH ? /* @__PURE__ */ e(
|
|
34
|
+
v,
|
|
35
|
+
{
|
|
36
|
+
isOpen: a,
|
|
37
|
+
onToggleSidebar: o,
|
|
38
|
+
onSetActiveTab: i
|
|
39
|
+
}
|
|
40
|
+
) : /* @__PURE__ */ e(
|
|
41
|
+
b,
|
|
42
|
+
{
|
|
43
|
+
isOpen: a,
|
|
44
|
+
onToggleSidebar: o,
|
|
45
|
+
onSetActiveTab: i
|
|
46
|
+
}
|
|
47
|
+
) });
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
H as Swatches
|
|
51
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useAppDispatch as l, useAppSelector as c } from "../../../../app/store/store.js";
|
|
3
|
+
import { getSelectedMaterials as p } from "../../model/selectors.js";
|
|
4
|
+
import { setSelectedMaterials as h } from "../../model/swatchesSlice.js";
|
|
5
|
+
import { AttributeHelper as b } from "../../lib/AttributeHelper.js";
|
|
6
|
+
import { ImageGridZoom as f } from "../ImageGridZoom/ImageGridZoom.js";
|
|
7
|
+
import { HexGridZoom as g } from "../HexGridZoom/HexGridZoom.js";
|
|
8
|
+
import { CloseIconSVG as v } from "../../../../app/assets/svg/CloseIconSVG.js";
|
|
9
|
+
import { MAX_SLOTS as s } from "../../../../shared/constants/selectedMaterials.js";
|
|
10
|
+
const u = () => /* @__PURE__ */ r(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: [
|
|
14
|
+
"relative w-10 h-10 rounded-sm aspect-square overflow-hidden",
|
|
15
|
+
"border border-solid border-[var(--border)] bg-[var(--sidebar-b)] sm:w-16 sm:h-16"
|
|
16
|
+
].join(" "),
|
|
17
|
+
"aria-hidden": !0
|
|
18
|
+
}
|
|
19
|
+
), C = ({
|
|
20
|
+
containerStyles: i = "p-[var(--padding)] border-t border-solid border-[var(--border)] shrink-0 sm:p-[var(--sm-padding)]"
|
|
21
|
+
}) => {
|
|
22
|
+
const d = l(), a = c(p) ?? [], m = (e) => {
|
|
23
|
+
d(h({ selectedMaterial: e }));
|
|
24
|
+
}, n = Math.max(0, s - a.length);
|
|
25
|
+
return /* @__PURE__ */ t("div", { className: i, children: [
|
|
26
|
+
/* @__PURE__ */ t("div", { className: "flex justify-between items-center mb-3", children: [
|
|
27
|
+
/* @__PURE__ */ t("div", { className: "relative w-30", children: [
|
|
28
|
+
/* @__PURE__ */ r("div", { className: "", children: "Swatches list" }),
|
|
29
|
+
/* @__PURE__ */ r("span", { className: "absolute top-0 right-[-6px] font-medium text-[var(--main-accent-color)] text-[8px] leading-none", children: "Free" })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ t("div", { children: [
|
|
32
|
+
a.length,
|
|
33
|
+
"/",
|
|
34
|
+
s,
|
|
35
|
+
" Selected"
|
|
36
|
+
] })
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: [
|
|
39
|
+
a.map((e, o) => /* @__PURE__ */ t(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
onClick: () => m(e),
|
|
43
|
+
className: `relative w-10 h-10 bg-[var(--sidebar-b)] border border-solid border-[var(--border)] rounded-sm aspect-square overflow-hidden transition\r
|
|
44
|
+
sm:w-16 sm:h-16`,
|
|
45
|
+
"aria-label": `Selected swatch ${e.name ?? e.assetId}`,
|
|
46
|
+
title: "Click to remove",
|
|
47
|
+
children: [
|
|
48
|
+
b.getImage(e) ? /* @__PURE__ */ r(f, { item: e }) : /* @__PURE__ */ r(g, { item: e }),
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: `absolute top-0 right-0 m-2 w-[16px] h-[16px] flex justify-center items-center\r
|
|
53
|
+
bg-[var(--background-grey)] rounded-2xl border-none pointer-events-none`,
|
|
54
|
+
children: /* @__PURE__ */ r(v, { className: "w-2 h-2 stroke-[var(--svg-dark)]" })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
`${e.metadata.label || o}/${e.parentName}`
|
|
60
|
+
)),
|
|
61
|
+
Array.from({ length: n }).map((e, o) => /* @__PURE__ */ r(u, {}, `mock-${o}`))
|
|
62
|
+
] })
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
C as SwatchesList
|
|
67
|
+
};
|