hasting-swatchcart-module 0.0.2 → 0.0.4

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.
Files changed (341) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +6 -0
  2. package/dist/_virtual/index.js +7 -0
  3. package/dist/_virtual/index2.js +7 -0
  4. package/dist/_virtual/index3.js +4 -0
  5. package/dist/_virtual/use-sync-external-store-with-selector.development.js +4 -0
  6. package/dist/_virtual/use-sync-external-store-with-selector.production.js +4 -0
  7. package/dist/_virtual/utilities.js +4 -0
  8. package/dist/_virtual/with-selector.js +5 -0
  9. package/dist/_virtual/with-selector2.js +4 -0
  10. package/dist/assets/src/shared/ui/CustomSidebar/CustomSidebar.module.css +1 -0
  11. package/dist/assets/src/shared/ui/Markdown/MDWithAccordion.module.css +1 -0
  12. package/dist/assets/src/shared/ui/PopoverTooltip/PopoverTooltip.module.css +0 -0
  13. package/dist/components/SwatchesModule.js +23 -38896
  14. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +527 -0
  15. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +402 -0
  16. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +208 -0
  17. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  18. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +130 -0
  19. package/dist/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  20. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  21. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +251 -0
  22. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  23. package/dist/node_modules/@radix-ui/react-context/dist/index.js +68 -0
  24. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +256 -0
  25. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  26. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  27. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  28. package/dist/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  29. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +231 -0
  30. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +219 -0
  31. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  32. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  33. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  34. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +49 -0
  35. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  36. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  37. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  38. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  39. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
  40. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  41. package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +877 -0
  42. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +35 -0
  43. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +497 -0
  44. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  45. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +62 -0
  46. package/dist/node_modules/@ungap/structured-clone/esm/index.js +11 -0
  47. package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +106 -0
  48. package/dist/node_modules/@ungap/structured-clone/esm/types.js +13 -0
  49. package/dist/node_modules/aria-hidden/dist/es2015/index.js +52 -0
  50. package/dist/node_modules/bail/index.js +7 -0
  51. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  52. package/dist/node_modules/comma-separated-tokens/index.js +20 -0
  53. package/dist/node_modules/decode-named-character-reference/index.dom.js +14 -0
  54. package/dist/node_modules/devlop/lib/default.js +8 -0
  55. package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +7 -0
  56. package/dist/node_modules/extend/index.js +43 -0
  57. package/dist/node_modules/get-nonce/dist/es2015/index.js +7 -0
  58. package/dist/node_modules/hast-util-from-parse5/lib/index.js +145 -0
  59. package/dist/node_modules/hast-util-parse-selector/lib/index.js +20 -0
  60. package/dist/node_modules/hast-util-raw/lib/index.js +217 -0
  61. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +302 -0
  62. package/dist/node_modules/hast-util-to-parse5/lib/index.js +118 -0
  63. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.js +12 -0
  64. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.js +61 -0
  65. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.js +33 -0
  66. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.js +368 -0
  67. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.js +6 -0
  68. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.js +566 -0
  69. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
  70. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
  71. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.js +22 -0
  72. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.js +27 -0
  73. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.js +23 -0
  74. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.js +11 -0
  75. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.js +17 -0
  76. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.js +14 -0
  77. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.js +19 -0
  78. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.js +11 -0
  79. package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.js +11 -0
  80. package/dist/node_modules/hast-util-whitespace/lib/index.js +10 -0
  81. package/dist/node_modules/hastscript/lib/create-h.js +112 -0
  82. package/dist/node_modules/hastscript/lib/index.js +8 -0
  83. package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +44 -0
  84. package/dist/node_modules/html-url-attributes/lib/index.js +26 -0
  85. package/dist/node_modules/html-void-elements/index.js +25 -0
  86. package/dist/node_modules/immer/dist/immer.js +467 -0
  87. package/dist/node_modules/inline-style-parser/index.js +93 -0
  88. package/dist/node_modules/is-plain-obj/index.js +9 -0
  89. package/dist/node_modules/lucide-react/dist/esm/Icon.js +40 -0
  90. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +27 -0
  91. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
  92. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +12 -0
  93. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +12 -0
  94. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +15 -0
  95. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +19 -0
  96. package/dist/node_modules/mdast-util-from-markdown/lib/index.js +581 -0
  97. package/dist/node_modules/mdast-util-to-hast/lib/footer.js +90 -0
  98. package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +12 -0
  99. package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +8 -0
  100. package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +15 -0
  101. package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +12 -0
  102. package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +12 -0
  103. package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +28 -0
  104. package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +12 -0
  105. package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +9 -0
  106. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +14 -0
  107. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +10 -0
  108. package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +58 -0
  109. package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +14 -0
  110. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +19 -0
  111. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +15 -0
  112. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +42 -0
  113. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +21 -0
  114. package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +12 -0
  115. package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +7 -0
  116. package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +12 -0
  117. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +13 -0
  118. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +21 -0
  119. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +32 -0
  120. package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +8 -0
  121. package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +12 -0
  122. package/dist/node_modules/mdast-util-to-hast/lib/index.js +10 -0
  123. package/dist/node_modules/mdast-util-to-hast/lib/revert.js +13 -0
  124. package/dist/node_modules/mdast-util-to-hast/lib/state.js +104 -0
  125. package/dist/node_modules/mdast-util-to-string/lib/index.js +29 -0
  126. package/dist/node_modules/micromark/lib/constructs.js +85 -0
  127. package/dist/node_modules/micromark/lib/create-tokenizer.js +223 -0
  128. package/dist/node_modules/micromark/lib/initialize/content.js +37 -0
  129. package/dist/node_modules/micromark/lib/initialize/document.js +126 -0
  130. package/dist/node_modules/micromark/lib/initialize/flow.js +33 -0
  131. package/dist/node_modules/micromark/lib/initialize/text.js +95 -0
  132. package/dist/node_modules/micromark/lib/parse.js +32 -0
  133. package/dist/node_modules/micromark/lib/postprocess.js +9 -0
  134. package/dist/node_modules/micromark/lib/preprocess.js +39 -0
  135. package/dist/node_modules/micromark-core-commonmark/lib/attention.js +83 -0
  136. package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +43 -0
  137. package/dist/node_modules/micromark-core-commonmark/lib/blank-line.js +18 -0
  138. package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +42 -0
  139. package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +17 -0
  140. package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +30 -0
  141. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +94 -0
  142. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +43 -0
  143. package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +45 -0
  144. package/dist/node_modules/micromark-core-commonmark/lib/content.js +50 -0
  145. package/dist/node_modules/micromark-core-commonmark/lib/definition.js +80 -0
  146. package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +17 -0
  147. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +46 -0
  148. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +144 -0
  149. package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +102 -0
  150. package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +152 -0
  151. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +22 -0
  152. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +19 -0
  153. package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +14 -0
  154. package/dist/node_modules/micromark-core-commonmark/lib/list.js +90 -0
  155. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +57 -0
  156. package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +25 -0
  157. package/dist/node_modules/micromark-factory-destination/index.js +31 -0
  158. package/dist/node_modules/micromark-factory-label/index.js +28 -0
  159. package/dist/node_modules/micromark-factory-space/index.js +15 -0
  160. package/dist/node_modules/micromark-factory-title/index.js +26 -0
  161. package/dist/node_modules/micromark-factory-whitespace/index.js +12 -0
  162. package/dist/node_modules/micromark-util-character/index.js +39 -0
  163. package/dist/node_modules/micromark-util-chunked/index.js +16 -0
  164. package/dist/node_modules/micromark-util-classify-character/index.js +10 -0
  165. package/dist/node_modules/micromark-util-combine-extensions/index.js +36 -0
  166. package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +16 -0
  167. package/dist/node_modules/micromark-util-decode-string/index.js +18 -0
  168. package/dist/node_modules/micromark-util-html-tag-name/index.js +68 -0
  169. package/dist/node_modules/micromark-util-normalize-identifier/index.js +6 -0
  170. package/dist/node_modules/micromark-util-resolve-all/index.js +12 -0
  171. package/dist/node_modules/micromark-util-sanitize-uri/index.js +23 -0
  172. package/dist/node_modules/micromark-util-subtokenize/index.js +55 -0
  173. package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +175 -0
  174. package/dist/node_modules/parse5/dist/common/doctype.js +98 -0
  175. package/dist/node_modules/parse5/dist/common/error-codes.js +7 -0
  176. package/dist/node_modules/parse5/dist/common/foreign-content.js +210 -0
  177. package/dist/node_modules/parse5/dist/common/html.js +250 -0
  178. package/dist/node_modules/parse5/dist/common/token.js +14 -0
  179. package/dist/node_modules/parse5/dist/common/unicode.js +73 -0
  180. package/dist/node_modules/parse5/dist/parser/formatting-element-list.js +84 -0
  181. package/dist/node_modules/parse5/dist/parser/index.js +2271 -0
  182. package/dist/node_modules/parse5/dist/parser/open-element-stack.js +240 -0
  183. package/dist/node_modules/parse5/dist/serializer/index.js +2 -0
  184. package/dist/node_modules/parse5/dist/tokenizer/index.js +1940 -0
  185. package/dist/node_modules/parse5/dist/tokenizer/preprocessor.js +88 -0
  186. package/dist/node_modules/parse5/dist/tree-adapters/default.js +162 -0
  187. package/dist/node_modules/parse5/node_modules/entities/dist/esm/decode-codepoint.js +38 -0
  188. package/dist/node_modules/parse5/node_modules/entities/dist/esm/decode.js +245 -0
  189. package/dist/node_modules/parse5/node_modules/entities/dist/esm/generated/decode-data-html.js +7 -0
  190. package/dist/node_modules/property-information/index.js +12 -0
  191. package/dist/node_modules/property-information/lib/aria.js +61 -0
  192. package/dist/node_modules/property-information/lib/find.js +33 -0
  193. package/dist/node_modules/property-information/lib/hast-to-react.js +22 -0
  194. package/dist/node_modules/property-information/lib/html.js +368 -0
  195. package/dist/node_modules/property-information/lib/normalize.js +6 -0
  196. package/dist/node_modules/property-information/lib/svg.js +566 -0
  197. package/dist/node_modules/property-information/lib/util/case-insensitive-transform.js +7 -0
  198. package/dist/node_modules/property-information/lib/util/case-sensitive-transform.js +6 -0
  199. package/dist/node_modules/property-information/lib/util/create.js +19 -0
  200. package/dist/node_modules/property-information/lib/util/defined-info.js +36 -0
  201. package/dist/node_modules/property-information/lib/util/info.js +28 -0
  202. package/dist/node_modules/property-information/lib/util/merge.js +10 -0
  203. package/dist/node_modules/property-information/lib/util/schema.js +21 -0
  204. package/dist/node_modules/property-information/lib/util/types.js +14 -0
  205. package/dist/node_modules/property-information/lib/xlink.js +19 -0
  206. package/dist/node_modules/property-information/lib/xml.js +11 -0
  207. package/dist/node_modules/property-information/lib/xmlns.js +11 -0
  208. package/dist/node_modules/react-markdown/lib/index.js +102 -0
  209. package/dist/node_modules/react-redux/dist/react-redux.js +246 -0
  210. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +11 -0
  211. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +112 -0
  212. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +31 -0
  213. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
  214. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +68 -0
  215. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
  216. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
  217. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +71 -0
  218. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +7 -0
  219. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -0
  220. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +11 -0
  221. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +15 -0
  222. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +30 -0
  223. package/dist/node_modules/redux/dist/redux.js +258 -0
  224. package/dist/node_modules/redux-thunk/dist/redux-thunk.js +8 -0
  225. package/dist/node_modules/rehype-raw/lib/index.js +12 -0
  226. package/dist/node_modules/remark-parse/lib/index.js +19 -0
  227. package/dist/node_modules/remark-rehype/lib/index.js +18 -0
  228. package/dist/node_modules/reselect/dist/reselect.js +244 -0
  229. package/dist/node_modules/space-separated-tokens/index.js +11 -0
  230. package/dist/node_modules/style-to-js/cjs/index.js +20 -0
  231. package/dist/node_modules/style-to-js/cjs/utilities.js +19 -0
  232. package/dist/node_modules/style-to-object/cjs/index.js +28 -0
  233. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2731 -0
  234. package/dist/node_modules/trim-lines/index.js +28 -0
  235. package/dist/node_modules/trough/lib/index.js +60 -0
  236. package/dist/node_modules/tslib/tslib.es6.js +27 -0
  237. package/dist/node_modules/unified/lib/callable-instance.js +25 -0
  238. package/dist/node_modules/unified/lib/index.js +529 -0
  239. package/dist/node_modules/unist-util-is/lib/index.js +84 -0
  240. package/dist/node_modules/unist-util-position/lib/index.js +23 -0
  241. package/dist/node_modules/unist-util-stringify-position/lib/index.js +15 -0
  242. package/dist/node_modules/unist-util-visit/lib/index.js +16 -0
  243. package/dist/node_modules/unist-util-visit-parents/lib/color.js +6 -0
  244. package/dist/node_modules/unist-util-visit-parents/lib/index.js +56 -0
  245. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +6 -0
  246. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +26 -0
  247. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +25 -0
  248. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +18 -0
  249. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +67 -0
  250. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +66 -0
  251. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +65 -0
  252. package/dist/node_modules/use-sync-external-store/with-selector.js +10 -0
  253. package/dist/node_modules/vfile/lib/index.js +406 -0
  254. package/dist/node_modules/vfile/lib/minpath.browser.js +112 -0
  255. package/dist/node_modules/vfile/lib/minproc.browser.js +7 -0
  256. package/dist/node_modules/vfile/lib/minurl.browser.js +41 -0
  257. package/dist/node_modules/vfile/lib/minurl.shared.js +7 -0
  258. package/dist/node_modules/vfile-location/lib/index.js +42 -0
  259. package/dist/node_modules/vfile-message/lib/index.js +91 -0
  260. package/dist/node_modules/web-namespaces/index.js +11 -0
  261. package/dist/node_modules/zwitch/index.js +18 -0
  262. package/dist/src/app/assets/images/product_thumb.png.js +4 -0
  263. package/dist/src/app/assets/svg/ArrowIconSVG.js +25 -0
  264. package/dist/src/app/assets/svg/CheckMarkIconSVG.js +25 -0
  265. package/dist/src/app/assets/svg/CloseIconSVG.js +25 -0
  266. package/dist/src/app/assets/svg/MinusIconSVG.js +24 -0
  267. package/dist/src/app/assets/svg/PlusIconSVG.js +24 -0
  268. package/dist/src/app/assets/svg/SearchIconSVG.js +37 -0
  269. package/dist/src/app/assets/svg/TrashIconSVG.js +24 -0
  270. package/dist/src/app/providers/StoreProvider.js +7 -0
  271. package/dist/src/app/store/rootReducer.js +12 -0
  272. package/dist/src/app/store/store.js +14 -0
  273. package/dist/src/features/Cart/lib/CartCervices.js +8 -0
  274. package/dist/src/features/Cart/model/cartSlice.js +58 -0
  275. package/dist/src/features/Cart/model/selectors.js +18 -0
  276. package/dist/src/features/Cart/ui/CartHeader/CartHeader.js +53 -0
  277. package/dist/src/features/Cart/ui/CartList/CartList.js +29 -0
  278. package/dist/src/features/Cart/ui/CartListItem/CartListItem.js +41 -0
  279. package/dist/src/features/Cart/ui/CartPrice/CartPrice.js +23 -0
  280. package/dist/src/features/Cart/ui/CartWrapper/CartWrapper.js +38 -0
  281. package/dist/src/features/Cart/ui/Counter/Counter.js +46 -0
  282. package/dist/src/features/DataAdapter/lib/DataAdapterServices.js +102 -0
  283. package/dist/src/features/DataAdapter/utils/types.js +8 -0
  284. package/dist/src/features/MultiProduct/lib/MultiProductCartServices.js +34 -0
  285. package/dist/src/features/MultiProduct/model/API/api.js +18 -0
  286. package/dist/src/features/MultiProduct/model/multiProductCartSlice.js +83 -0
  287. package/dist/src/features/MultiProduct/model/selectors.js +7 -0
  288. package/dist/src/features/MultiProduct/ui/CartSelectedProductList/CartSelectedProductList.js +21 -0
  289. package/dist/src/features/MultiProduct/ui/CustomModal/CustomModal.js +28 -0
  290. package/dist/src/features/MultiProduct/ui/FiltersSelectedProductItem/FiltersSelectedProductItem.js +27 -0
  291. package/dist/src/features/MultiProduct/ui/MultiProductCartHeader/MultiProductCartHeader.js +60 -0
  292. package/dist/src/features/MultiProduct/ui/MultiProductItemCart/MultiProductItemCart.js +71 -0
  293. package/dist/src/features/MultiProduct/ui/MultiProductWrapper/MultiProductWrapper.js +19 -0
  294. package/dist/src/features/MultiProduct/ui/ProductList/ProductList.js +138 -0
  295. package/dist/src/features/MultiProduct/ui/ProductListItem/ProductListItem.js +51 -0
  296. package/dist/src/features/MultiProduct/ui/SelectedProductItem/SelectedProductItem.js +55 -0
  297. package/dist/src/features/MultiProduct/ui/SwatchContentContainer/SwatchContentContainer.js +46 -0
  298. package/dist/src/features/MultiProduct/utils/constants.js +16 -0
  299. package/dist/src/features/MultiProduct/utils/randomList.js +41 -0
  300. package/dist/src/features/swatches/lib/AttributeHelper.js +21 -0
  301. package/dist/src/features/swatches/lib/SwatchesServices.js +54 -0
  302. package/dist/src/features/swatches/model/selectors.js +12 -0
  303. package/dist/src/features/swatches/model/swatchesSlice.js +108 -0
  304. package/dist/src/features/swatches/model/thunks.js +22 -0
  305. package/dist/src/features/swatches/model/types.js +6 -0
  306. package/dist/src/features/swatches/ui/Filters/ColorsFilter.js +45 -0
  307. package/dist/src/features/swatches/ui/Filters/LooksFilter.js +45 -0
  308. package/dist/src/features/swatches/ui/Filters/MaterialsFilter.js +47 -0
  309. package/dist/src/features/swatches/ui/Filters/index.js +12 -0
  310. package/dist/src/features/swatches/ui/HexGridZoom/HexGridZoom.js +50 -0
  311. package/dist/src/features/swatches/ui/ImageGridZoom/ImageGridZoom.js +45 -0
  312. package/dist/src/features/swatches/ui/MaterialList/index.js +39 -0
  313. package/dist/src/features/swatches/ui/MaterialListItem/MaterialListItem.js +51 -0
  314. package/dist/src/features/swatches/ui/ProductElement/index.js +65 -0
  315. package/dist/src/features/swatches/ui/SwatchWrapper/SwatchWrapper.js +62 -0
  316. package/dist/src/features/swatches/ui/Swatches.js +51 -0
  317. package/dist/src/features/swatches/ui/SwatchesList/SwatchesList.js +67 -0
  318. package/dist/src/features/swatches/utils/constants.js +8 -0
  319. package/dist/src/shared/constants/props.js +13337 -0
  320. package/dist/src/shared/constants/selectedMaterials.js +4 -0
  321. package/dist/src/shared/types/activeTab.js +7 -0
  322. package/dist/src/shared/ui/Checkbox/Checkbox.js +31 -0
  323. package/dist/src/shared/ui/CustomButton/CustomButton.js +16 -0
  324. package/dist/src/shared/ui/CustomSidebar/CustomSidebar.js +59 -0
  325. package/dist/src/shared/ui/CustomSidebar/CustomSidebar.module.scss.js +13 -0
  326. package/dist/src/shared/ui/Dialog/Dialog.js +81 -0
  327. package/dist/src/shared/ui/Label/Label.js +27 -0
  328. package/dist/src/shared/ui/Markdown/MDWithAccordion.js +36 -0
  329. package/dist/src/shared/ui/Markdown/MDWithAccordion.module.scss.js +9 -0
  330. package/dist/src/shared/ui/MaterialItem/MaterialItem.js +36 -0
  331. package/dist/src/shared/ui/MultiSelect/MultiSelect.js +150 -0
  332. package/dist/src/shared/ui/PopoverTooltip/InfoIcon.js +35 -0
  333. package/dist/src/shared/ui/PopoverTooltip/PopoverTooltip.js +37 -0
  334. package/dist/src/shared/ui/PopoverTooltip/PopoverTooltip.module.scss.js +4 -0
  335. package/dist/src/shared/ui/Slider/Slider.js +117 -0
  336. package/dist/src/shared/utils/cn.js +8 -0
  337. package/dist/src/shared/utils/uniqueList.js +4 -0
  338. package/package.json +12 -2
  339. package/dist/assets/SwatchesModule.css +0 -1
  340. /package/dist/{lib/components → components}/SwatchesModule.d.ts +0 -0
  341. /package/dist/{lib/main.d.ts → main.d.ts} +0 -0
@@ -0,0 +1,256 @@
1
+ import * as s from "react";
2
+ import { composeEventHandlers as p } from "../../primitive/dist/index.js";
3
+ import { useComposedRefs as _ } from "../../react-compose-refs/dist/index.js";
4
+ import { createContextScope as H, createContext as V } from "../../react-context/dist/index.js";
5
+ import { useId as R } from "../../react-id/dist/index.js";
6
+ import { useControllableState as q } from "../../react-use-controllable-state/dist/index.js";
7
+ import { DismissableLayer as K } from "../../react-dismissable-layer/dist/index.js";
8
+ import { FocusScope as U } from "../../react-focus-scope/dist/index.js";
9
+ import { Portal as Y } from "../../react-portal/dist/index.js";
10
+ import { Presence as h } from "../../react-presence/dist/index.js";
11
+ import { Primitive as g } from "../../react-primitive/dist/index.js";
12
+ import { useFocusGuards as Z } from "../../react-focus-guards/dist/index.js";
13
+ import z from "../../../react-remove-scroll/dist/es2015/Combination.js";
14
+ import { hideOthers as J } from "../../../aria-hidden/dist/es2015/index.js";
15
+ import { createSlot as Q } from "../../react-slot/dist/index.js";
16
+ import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
17
+ var D = "Dialog", [I] = H(D), [X, u] = I(D), x = (e) => {
18
+ const {
19
+ __scopeDialog: t,
20
+ children: n,
21
+ open: a,
22
+ defaultOpen: r,
23
+ onOpenChange: o,
24
+ modal: l = !0
25
+ } = e, c = s.useRef(null), f = s.useRef(null), [v, C] = q({
26
+ prop: a,
27
+ defaultProp: r ?? !1,
28
+ onChange: o,
29
+ caller: D
30
+ });
31
+ return /* @__PURE__ */ i(
32
+ X,
33
+ {
34
+ scope: t,
35
+ triggerRef: c,
36
+ contentRef: f,
37
+ contentId: R(),
38
+ titleId: R(),
39
+ descriptionId: R(),
40
+ open: v,
41
+ onOpenChange: C,
42
+ onOpenToggle: s.useCallback(() => C((j) => !j), [C]),
43
+ modal: l,
44
+ children: n
45
+ }
46
+ );
47
+ };
48
+ x.displayName = D;
49
+ var A = "DialogTrigger", ee = s.forwardRef(
50
+ (e, t) => {
51
+ const { __scopeDialog: n, ...a } = e, r = u(A, n), o = _(t, r.triggerRef);
52
+ return /* @__PURE__ */ i(
53
+ g.button,
54
+ {
55
+ type: "button",
56
+ "aria-haspopup": "dialog",
57
+ "aria-expanded": r.open,
58
+ "aria-controls": r.contentId,
59
+ "data-state": N(r.open),
60
+ ...a,
61
+ ref: o,
62
+ onClick: p(e.onClick, r.onOpenToggle)
63
+ }
64
+ );
65
+ }
66
+ );
67
+ ee.displayName = A;
68
+ var E = "DialogPortal", [oe, T] = I(E, {
69
+ forceMount: void 0
70
+ }), b = (e) => {
71
+ const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
72
+ return /* @__PURE__ */ i(oe, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(h, { present: n || o.open, children: /* @__PURE__ */ i(Y, { asChild: !0, container: r, children: l }) })) });
73
+ };
74
+ b.displayName = E;
75
+ var m = "DialogOverlay", M = s.forwardRef(
76
+ (e, t) => {
77
+ const n = T(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
78
+ return o.modal ? /* @__PURE__ */ i(h, { present: a || o.open, children: /* @__PURE__ */ i(re, { ...r, ref: t }) }) : null;
79
+ }
80
+ );
81
+ M.displayName = m;
82
+ var te = Q("DialogOverlay.RemoveScroll"), re = s.forwardRef(
83
+ (e, t) => {
84
+ const { __scopeDialog: n, ...a } = e, r = u(m, n);
85
+ return (
86
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
87
+ // ie. when `Overlay` and `Content` are siblings
88
+ /* @__PURE__ */ i(z, { as: te, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
89
+ g.div,
90
+ {
91
+ "data-state": N(r.open),
92
+ ...a,
93
+ ref: t,
94
+ style: { pointerEvents: "auto", ...a.style }
95
+ }
96
+ ) })
97
+ );
98
+ }
99
+ ), d = "DialogContent", w = s.forwardRef(
100
+ (e, t) => {
101
+ const n = T(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
102
+ return /* @__PURE__ */ i(h, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(ne, { ...r, ref: t }) : /* @__PURE__ */ i(ae, { ...r, ref: t }) });
103
+ }
104
+ );
105
+ w.displayName = d;
106
+ var ne = s.forwardRef(
107
+ (e, t) => {
108
+ const n = u(d, e.__scopeDialog), a = s.useRef(null), r = _(t, n.contentRef, a);
109
+ return s.useEffect(() => {
110
+ const o = a.current;
111
+ if (o) return J(o);
112
+ }, []), /* @__PURE__ */ i(
113
+ F,
114
+ {
115
+ ...e,
116
+ ref: r,
117
+ trapFocus: n.open,
118
+ disableOutsidePointerEvents: !0,
119
+ onCloseAutoFocus: p(e.onCloseAutoFocus, (o) => {
120
+ o.preventDefault(), n.triggerRef.current?.focus();
121
+ }),
122
+ onPointerDownOutside: p(e.onPointerDownOutside, (o) => {
123
+ const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
124
+ (l.button === 2 || c) && o.preventDefault();
125
+ }),
126
+ onFocusOutside: p(
127
+ e.onFocusOutside,
128
+ (o) => o.preventDefault()
129
+ )
130
+ }
131
+ );
132
+ }
133
+ ), ae = s.forwardRef(
134
+ (e, t) => {
135
+ const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
136
+ return /* @__PURE__ */ i(
137
+ F,
138
+ {
139
+ ...e,
140
+ ref: t,
141
+ trapFocus: !1,
142
+ disableOutsidePointerEvents: !1,
143
+ onCloseAutoFocus: (o) => {
144
+ e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
145
+ },
146
+ onInteractOutside: (o) => {
147
+ e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
148
+ const l = o.target;
149
+ n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
150
+ }
151
+ }
152
+ );
153
+ }
154
+ ), F = s.forwardRef(
155
+ (e, t) => {
156
+ const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), v = _(t, f);
157
+ return Z(), /* @__PURE__ */ P(O, { children: [
158
+ /* @__PURE__ */ i(
159
+ U,
160
+ {
161
+ asChild: !0,
162
+ loop: !0,
163
+ trapped: a,
164
+ onMountAutoFocus: r,
165
+ onUnmountAutoFocus: o,
166
+ children: /* @__PURE__ */ i(
167
+ K,
168
+ {
169
+ role: "dialog",
170
+ id: c.contentId,
171
+ "aria-describedby": c.descriptionId,
172
+ "aria-labelledby": c.titleId,
173
+ "data-state": N(c.open),
174
+ ...l,
175
+ ref: v,
176
+ onDismiss: () => c.onOpenChange(!1)
177
+ }
178
+ )
179
+ }
180
+ ),
181
+ /* @__PURE__ */ P(O, { children: [
182
+ /* @__PURE__ */ i(ie, { titleId: c.titleId }),
183
+ /* @__PURE__ */ i(ce, { contentRef: f, descriptionId: c.descriptionId })
184
+ ] })
185
+ ] });
186
+ }
187
+ ), y = "DialogTitle", S = s.forwardRef(
188
+ (e, t) => {
189
+ const { __scopeDialog: n, ...a } = e, r = u(y, n);
190
+ return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
191
+ }
192
+ );
193
+ S.displayName = y;
194
+ var W = "DialogDescription", k = s.forwardRef(
195
+ (e, t) => {
196
+ const { __scopeDialog: n, ...a } = e, r = u(W, n);
197
+ return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
198
+ }
199
+ );
200
+ k.displayName = W;
201
+ var G = "DialogClose", L = s.forwardRef(
202
+ (e, t) => {
203
+ const { __scopeDialog: n, ...a } = e, r = u(G, n);
204
+ return /* @__PURE__ */ i(
205
+ g.button,
206
+ {
207
+ type: "button",
208
+ ...a,
209
+ ref: t,
210
+ onClick: p(e.onClick, () => r.onOpenChange(!1))
211
+ }
212
+ );
213
+ }
214
+ );
215
+ L.displayName = G;
216
+ function N(e) {
217
+ return e ? "open" : "closed";
218
+ }
219
+ var $ = "DialogTitleWarning", [Ne, B] = V($, {
220
+ contentName: d,
221
+ titleName: y,
222
+ docsSlug: "dialog"
223
+ }), ie = ({ titleId: e }) => {
224
+ const t = B($), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
225
+
226
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
227
+
228
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
229
+ return s.useEffect(() => {
230
+ e && (document.getElementById(e) || console.error(n));
231
+ }, [n, e]), null;
232
+ }, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: t }) => {
233
+ const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(se).contentName}}.`;
234
+ return s.useEffect(() => {
235
+ const r = e.current?.getAttribute("aria-describedby");
236
+ t && r && (document.getElementById(t) || console.warn(a));
237
+ }, [a, e, t]), null;
238
+ }, Pe = x, Oe = b, Ie = M, xe = w, Ae = S, Te = k, be = L;
239
+ export {
240
+ be as Close,
241
+ xe as Content,
242
+ Te as Description,
243
+ x as Dialog,
244
+ L as DialogClose,
245
+ w as DialogContent,
246
+ k as DialogDescription,
247
+ M as DialogOverlay,
248
+ b as DialogPortal,
249
+ S as DialogTitle,
250
+ ee as DialogTrigger,
251
+ Ie as Overlay,
252
+ Oe as Portal,
253
+ Pe as Root,
254
+ Ae as Title,
255
+ Ne as WarningProvider
256
+ };
@@ -0,0 +1,127 @@
1
+ import * as n from "react";
2
+ import { composeEventHandlers as h } from "../../primitive/dist/index.js";
3
+ import { Primitive as w, dispatchDiscreteCustomEvent as k } from "../../react-primitive/dist/index.js";
4
+ import { useComposedRefs as g } from "../../react-compose-refs/dist/index.js";
5
+ import { useCallbackRef as R } from "../../react-use-callback-ref/dist/index.js";
6
+ import { useEscapeKeydown as U } from "../../react-use-escape-keydown/dist/index.js";
7
+ import { jsx as T } from "react/jsx-runtime";
8
+ var z = "DismissableLayer", y = "dismissableLayer.update", H = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", C, B = n.createContext({
9
+ layers: /* @__PURE__ */ new Set(),
10
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
11
+ branches: /* @__PURE__ */ new Set()
12
+ }), K = n.forwardRef(
13
+ (s, e) => {
14
+ const {
15
+ disableOutsidePointerEvents: r = !1,
16
+ onEscapeKeyDown: a,
17
+ onPointerDownOutside: i,
18
+ onFocusOutside: c,
19
+ onInteractOutside: f,
20
+ onDismiss: d,
21
+ ...E
22
+ } = s, o = n.useContext(B), [u, F] = n.useState(null), l = u?.ownerDocument ?? globalThis?.document, [, I] = n.useState({}), S = g(e, (t) => F(t)), p = Array.from(o.layers), [W] = [...o.layersWithOutsidePointerEventsDisabled].slice(-1), A = p.indexOf(W), b = u ? p.indexOf(u) : -1, N = o.layersWithOutsidePointerEventsDisabled.size > 0, D = b >= A, _ = Y((t) => {
23
+ const v = t.target, P = [...o.branches].some((m) => m.contains(v));
24
+ !D || P || (i?.(t), f?.(t), t.defaultPrevented || d?.());
25
+ }, l), O = q((t) => {
26
+ const v = t.target;
27
+ [...o.branches].some((m) => m.contains(v)) || (c?.(t), f?.(t), t.defaultPrevented || d?.());
28
+ }, l);
29
+ return U((t) => {
30
+ b === o.layers.size - 1 && (a?.(t), !t.defaultPrevented && d && (t.preventDefault(), d()));
31
+ }, l), n.useEffect(() => {
32
+ if (u)
33
+ return r && (o.layersWithOutsidePointerEventsDisabled.size === 0 && (C = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), o.layersWithOutsidePointerEventsDisabled.add(u)), o.layers.add(u), L(), () => {
34
+ r && o.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = C);
35
+ };
36
+ }, [u, l, r, o]), n.useEffect(() => () => {
37
+ u && (o.layers.delete(u), o.layersWithOutsidePointerEventsDisabled.delete(u), L());
38
+ }, [u, o]), n.useEffect(() => {
39
+ const t = () => I({});
40
+ return document.addEventListener(y, t), () => document.removeEventListener(y, t);
41
+ }, []), /* @__PURE__ */ T(
42
+ w.div,
43
+ {
44
+ ...E,
45
+ ref: S,
46
+ style: {
47
+ pointerEvents: N ? D ? "auto" : "none" : void 0,
48
+ ...s.style
49
+ },
50
+ onFocusCapture: h(s.onFocusCapture, O.onFocusCapture),
51
+ onBlurCapture: h(s.onBlurCapture, O.onBlurCapture),
52
+ onPointerDownCapture: h(
53
+ s.onPointerDownCapture,
54
+ _.onPointerDownCapture
55
+ )
56
+ }
57
+ );
58
+ }
59
+ );
60
+ K.displayName = z;
61
+ var j = "DismissableLayerBranch", X = n.forwardRef((s, e) => {
62
+ const r = n.useContext(B), a = n.useRef(null), i = g(e, a);
63
+ return n.useEffect(() => {
64
+ const c = a.current;
65
+ if (c)
66
+ return r.branches.add(c), () => {
67
+ r.branches.delete(c);
68
+ };
69
+ }, [r.branches]), /* @__PURE__ */ T(w.div, { ...s, ref: i });
70
+ });
71
+ X.displayName = j;
72
+ function Y(s, e = globalThis?.document) {
73
+ const r = R(s), a = n.useRef(!1), i = n.useRef(() => {
74
+ });
75
+ return n.useEffect(() => {
76
+ const c = (d) => {
77
+ if (d.target && !a.current) {
78
+ let E = function() {
79
+ x(
80
+ H,
81
+ r,
82
+ o,
83
+ { discrete: !0 }
84
+ );
85
+ };
86
+ const o = { originalEvent: d };
87
+ d.pointerType === "touch" ? (e.removeEventListener("click", i.current), i.current = E, e.addEventListener("click", i.current, { once: !0 })) : E();
88
+ } else
89
+ e.removeEventListener("click", i.current);
90
+ a.current = !1;
91
+ }, f = window.setTimeout(() => {
92
+ e.addEventListener("pointerdown", c);
93
+ }, 0);
94
+ return () => {
95
+ window.clearTimeout(f), e.removeEventListener("pointerdown", c), e.removeEventListener("click", i.current);
96
+ };
97
+ }, [e, r]), {
98
+ // ensures we check React component tree (not just DOM tree)
99
+ onPointerDownCapture: () => a.current = !0
100
+ };
101
+ }
102
+ function q(s, e = globalThis?.document) {
103
+ const r = R(s), a = n.useRef(!1);
104
+ return n.useEffect(() => {
105
+ const i = (c) => {
106
+ c.target && !a.current && x(M, r, { originalEvent: c }, {
107
+ discrete: !1
108
+ });
109
+ };
110
+ return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
111
+ }, [e, r]), {
112
+ onFocusCapture: () => a.current = !0,
113
+ onBlurCapture: () => a.current = !1
114
+ };
115
+ }
116
+ function L() {
117
+ const s = new CustomEvent(y);
118
+ document.dispatchEvent(s);
119
+ }
120
+ function x(s, e, r, { discrete: a }) {
121
+ const i = r.originalEvent.target, c = new CustomEvent(s, { bubbles: !1, cancelable: !0, detail: r });
122
+ e && i.addEventListener(s, e, { once: !0 }), a ? k(i, c) : i.dispatchEvent(c);
123
+ }
124
+ export {
125
+ K as DismissableLayer,
126
+ X as DismissableLayerBranch
127
+ };
@@ -0,0 +1,17 @@
1
+ import * as r from "react";
2
+ var t = 0;
3
+ function a() {
4
+ r.useEffect(() => {
5
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
6
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
7
+ t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
8
+ };
9
+ }, []);
10
+ }
11
+ function n() {
12
+ const e = document.createElement("span");
13
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
14
+ }
15
+ export {
16
+ a as useFocusGuards
17
+ };
@@ -0,0 +1,136 @@
1
+ import * as d from "react";
2
+ import { useComposedRefs as R } from "../../react-compose-refs/dist/index.js";
3
+ import { Primitive as M } from "../../react-primitive/dist/index.js";
4
+ import { useCallbackRef as y } from "../../react-use-callback-ref/dist/index.js";
5
+ import { jsx as _ } from "react/jsx-runtime";
6
+ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, t) => {
7
+ const {
8
+ loop: n = !1,
9
+ trapped: u = !1,
10
+ onMountAutoFocus: p,
11
+ onUnmountAutoFocus: L,
12
+ ...g
13
+ } = e, [o, U] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), A = R(t, (s) => U(s)), a = d.useRef({
14
+ paused: !1,
15
+ pause() {
16
+ this.paused = !0;
17
+ },
18
+ resume() {
19
+ this.paused = !1;
20
+ }
21
+ }).current;
22
+ d.useEffect(() => {
23
+ if (u) {
24
+ let s = function(i) {
25
+ if (a.paused || !o) return;
26
+ const c = i.target;
27
+ o.contains(c) ? b.current = c : f(b.current, { select: !0 });
28
+ }, l = function(i) {
29
+ if (a.paused || !o) return;
30
+ const c = i.relatedTarget;
31
+ c !== null && (o.contains(c) || f(b.current, { select: !0 }));
32
+ }, r = function(i) {
33
+ if (document.activeElement === document.body)
34
+ for (const h of i)
35
+ h.removedNodes.length > 0 && f(o);
36
+ };
37
+ document.addEventListener("focusin", s), document.addEventListener("focusout", l);
38
+ const m = new MutationObserver(r);
39
+ return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
40
+ document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
41
+ };
42
+ }
43
+ }, [u, o, a.paused]), d.useEffect(() => {
44
+ if (o) {
45
+ O.add(a);
46
+ const s = document.activeElement;
47
+ if (!o.contains(s)) {
48
+ const r = new CustomEvent(F, N);
49
+ o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(W(I(o)), { select: !0 }), document.activeElement === s && f(o));
50
+ }
51
+ return () => {
52
+ o.removeEventListener(F, E), setTimeout(() => {
53
+ const r = new CustomEvent(T, N);
54
+ o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), O.remove(a);
55
+ }, 0);
56
+ };
57
+ }
58
+ }, [o, E, v, a]);
59
+ const P = d.useCallback(
60
+ (s) => {
61
+ if (!n && !u || a.paused) return;
62
+ const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
63
+ if (l && r) {
64
+ const m = s.currentTarget, [i, c] = x(m);
65
+ i && c ? !s.shiftKey && r === c ? (s.preventDefault(), n && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), n && f(c, { select: !0 })) : r === m && s.preventDefault();
66
+ }
67
+ },
68
+ [n, u, a.paused]
69
+ );
70
+ return /* @__PURE__ */ _(M.div, { tabIndex: -1, ...g, ref: A, onKeyDown: P });
71
+ });
72
+ k.displayName = K;
73
+ function w(e, { select: t = !1 } = {}) {
74
+ const n = document.activeElement;
75
+ for (const u of e)
76
+ if (f(u, { select: t }), document.activeElement !== n) return;
77
+ }
78
+ function x(e) {
79
+ const t = I(e), n = S(t, e), u = S(t.reverse(), e);
80
+ return [n, u];
81
+ }
82
+ function I(e) {
83
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
84
+ acceptNode: (u) => {
85
+ const p = u.tagName === "INPUT" && u.type === "hidden";
86
+ return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
87
+ }
88
+ });
89
+ for (; n.nextNode(); ) t.push(n.currentNode);
90
+ return t;
91
+ }
92
+ function S(e, t) {
93
+ for (const n of e)
94
+ if (!D(n, { upTo: t })) return n;
95
+ }
96
+ function D(e, { upTo: t }) {
97
+ if (getComputedStyle(e).visibility === "hidden") return !0;
98
+ for (; e; ) {
99
+ if (t !== void 0 && e === t) return !1;
100
+ if (getComputedStyle(e).display === "none") return !0;
101
+ e = e.parentElement;
102
+ }
103
+ return !1;
104
+ }
105
+ function H(e) {
106
+ return e instanceof HTMLInputElement && "select" in e;
107
+ }
108
+ function f(e, { select: t = !1 } = {}) {
109
+ if (e && e.focus) {
110
+ const n = document.activeElement;
111
+ e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
112
+ }
113
+ }
114
+ var O = V();
115
+ function V() {
116
+ let e = [];
117
+ return {
118
+ add(t) {
119
+ const n = e[0];
120
+ t !== n && n?.pause(), e = C(e, t), e.unshift(t);
121
+ },
122
+ remove(t) {
123
+ e = C(e, t), e[0]?.resume();
124
+ }
125
+ };
126
+ }
127
+ function C(e, t) {
128
+ const n = [...e], u = n.indexOf(t);
129
+ return u !== -1 && n.splice(u, 1), n;
130
+ }
131
+ function W(e) {
132
+ return e.filter((t) => t.tagName !== "A");
133
+ }
134
+ export {
135
+ k as FocusScope
136
+ };
@@ -0,0 +1,13 @@
1
+ import * as o from "react";
2
+ import { useLayoutEffect as a } from "../../react-use-layout-effect/dist/index.js";
3
+ var s = o[" useId ".trim().toString()] || (() => {
4
+ }), f = 0;
5
+ function i(t) {
6
+ const [e, r] = o.useState(s());
7
+ return a(() => {
8
+ r((u) => u ?? String(f++));
9
+ }, [t]), t || (e ? `radix-${e}` : "");
10
+ }
11
+ export {
12
+ i as useId
13
+ };