@shopify/shop-minis-react 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/README.md +110 -90
  2. package/dist/_virtual/_commonjsHelpers.js +9 -0
  3. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  4. package/dist/_virtual/index.js +8 -0
  5. package/dist/_virtual/index.js.map +1 -0
  6. package/dist/_virtual/index2.js +5 -0
  7. package/dist/_virtual/index2.js.map +1 -0
  8. package/dist/components/ui/alert-dialog.js +141 -0
  9. package/dist/components/ui/alert-dialog.js.map +1 -0
  10. package/dist/components/ui/button.js +50 -0
  11. package/dist/components/ui/button.js.map +1 -0
  12. package/dist/components/ui/card.js +91 -0
  13. package/dist/components/ui/card.js.map +1 -0
  14. package/dist/components/ui/sonner.js +23 -0
  15. package/dist/components/ui/sonner.js.map +1 -0
  16. package/dist/hooks/navigation/useCloseMini.js +12 -0
  17. package/dist/hooks/navigation/useCloseMini.js.map +1 -0
  18. package/dist/hooks/navigation/useShopNavigation.js +20 -0
  19. package/dist/hooks/navigation/useShopNavigation.js.map +1 -0
  20. package/dist/hooks/product/usePopularProducts.js +20 -0
  21. package/dist/hooks/product/usePopularProducts.js.map +1 -0
  22. package/dist/hooks/product/useProductList.js +29 -0
  23. package/dist/hooks/product/useProductList.js.map +1 -0
  24. package/dist/hooks/product/useProductListActions.js +22 -0
  25. package/dist/hooks/product/useProductListActions.js.map +1 -0
  26. package/dist/hooks/product/useProductLists.js +20 -0
  27. package/dist/hooks/product/useProductLists.js.map +1 -0
  28. package/dist/hooks/product/useRecommendedProducts.js +20 -0
  29. package/dist/hooks/product/useRecommendedProducts.js.map +1 -0
  30. package/dist/hooks/shop/useRecommendedShops.js +21 -0
  31. package/dist/hooks/shop/useRecommendedShops.js.map +1 -0
  32. package/dist/hooks/shop/useShopCartActions.js +13 -0
  33. package/dist/hooks/shop/useShopCartActions.js.map +1 -0
  34. package/dist/hooks/storage/useAsyncStorage.js +22 -0
  35. package/dist/hooks/storage/useAsyncStorage.js.map +1 -0
  36. package/dist/hooks/storage/useImageUpload.js +62 -0
  37. package/dist/hooks/storage/useImageUpload.js.map +1 -0
  38. package/dist/hooks/storage/useSecureStorage.js +14 -0
  39. package/dist/hooks/storage/useSecureStorage.js.map +1 -0
  40. package/dist/hooks/user/useBuyerAttributes.js +20 -0
  41. package/dist/hooks/user/useBuyerAttributes.js.map +1 -0
  42. package/dist/hooks/user/useCurrentUser.js +20 -0
  43. package/dist/hooks/user/useCurrentUser.js.map +1 -0
  44. package/dist/hooks/user/useFollowedShopsActions.js +13 -0
  45. package/dist/hooks/user/useFollowedShopsActions.js.map +1 -0
  46. package/dist/hooks/user/useOrders.js +20 -0
  47. package/dist/hooks/user/useOrders.js.map +1 -0
  48. package/dist/hooks/user/useSavedProductsActions.js +13 -0
  49. package/dist/hooks/user/useSavedProductsActions.js.map +1 -0
  50. package/dist/hooks/util/useErrorScreen.js +9 -0
  51. package/dist/hooks/util/useErrorScreen.js.map +1 -0
  52. package/dist/hooks/util/useErrorToast.js +9 -0
  53. package/dist/hooks/util/useErrorToast.js.map +1 -0
  54. package/dist/index.js +78 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/internal/useHandleAction.js +13 -0
  57. package/dist/internal/useHandleAction.js.map +1 -0
  58. package/dist/internal/useShopActions.js +7 -0
  59. package/dist/internal/useShopActions.js.map +1 -0
  60. package/dist/internal/useShopActionsDataFetching.js +79 -0
  61. package/dist/internal/useShopActionsDataFetching.js.map +1 -0
  62. package/dist/internal/useShopActionsPaginatedDataFetching.js +96 -0
  63. package/dist/internal/useShopActionsPaginatedDataFetching.js.map +1 -0
  64. package/dist/lib/utils.js +9 -0
  65. package/dist/lib/utils.js.map +1 -0
  66. package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js +10 -0
  67. package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js.map +1 -0
  68. package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react_5smkpul3xqqoqjowwwfk226yey/node_modules/@radix-ui/react-alert-dialog/dist/index.js +127 -0
  69. package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react_5smkpul3xqqoqjowwwfk226yey/node_modules/@radix-ui/react-alert-dialog/dist/index.js.map +1 -0
  70. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
  71. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -0
  72. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js +69 -0
  73. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
  74. package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1._sjczexpvrqz6fttoobpwnns2oa/node_modules/@radix-ui/react-dialog/dist/index.js +259 -0
  75. package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1._sjczexpvrqz6fttoobpwnns2oa/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -0
  76. package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.10_@types_react-dom@19.1.6_@types_react@19.1.6__@types__ipor64qsap4jnr6m7nflv4q5v4/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
  77. package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.10_@types_react-dom@19.1.6_@types_react@19.1.6__@types__ipor64qsap4jnr6m7nflv4q5v4/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -0
  78. package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.js +18 -0
  79. package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -0
  80. package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@1_zpdtvgogfsfavk62phevpdv4fu/node_modules/@radix-ui/react-focus-scope/dist/index.js +137 -0
  81. package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@1_zpdtvgogfsfavk62phevpdv4fu/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -0
  82. package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js +14 -0
  83. package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js.map +1 -0
  84. package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1.6_sr45arufxpp6hzdn2l7kcrtvqe/node_modules/@radix-ui/react-portal/dist/index.js +16 -0
  85. package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1.6_sr45arufxpp6hzdn2l7kcrtvqe/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -0
  86. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.4_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1_5ga5lr7i6zouk7rhd63vbsmjyu/node_modules/@radix-ui/react-presence/dist/index.js +71 -0
  87. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.4_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1_5ga5lr7i6zouk7rhd63vbsmjyu/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -0
  88. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
  89. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
  90. package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js +59 -0
  91. package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
  92. package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +11 -0
  93. package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -0
  94. package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +53 -0
  95. package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -0
  96. package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +15 -0
  97. package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -0
  98. package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
  99. package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -0
  100. package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +53 -0
  101. package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js.map +1 -0
  102. package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js +36 -0
  103. package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js.map +1 -0
  104. package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +18 -0
  105. package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +1 -0
  106. package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +8 -0
  107. package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js.map +1 -0
  108. package/dist/node_modules/.pnpm/next-themes@0.4.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next-themes/dist/index.js +34 -0
  109. package/dist/node_modules/.pnpm/next-themes@0.4.6_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/next-themes/dist/index.js.map +1 -0
  110. package/dist/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +44 -0
  111. package/dist/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js.map +1 -0
  112. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js +72 -0
  113. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -0
  114. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +8 -0
  115. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -0
  116. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +26 -0
  117. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -0
  118. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js +12 -0
  119. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -0
  120. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +113 -0
  121. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -0
  122. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js +32 -0
  123. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -0
  124. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +17 -0
  125. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -0
  126. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +69 -0
  127. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -0
  128. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js +6 -0
  129. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -0
  130. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js +8 -0
  131. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -0
  132. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js +12 -0
  133. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -0
  134. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js +16 -0
  135. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -0
  136. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js +31 -0
  137. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.1.6_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -0
  138. package/dist/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js +25 -0
  139. package/dist/node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js.map +1 -0
  140. package/dist/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js +743 -0
  141. package/dist/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js.map +1 -0
  142. package/dist/node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.js +2265 -0
  143. package/dist/node_modules/.pnpm/tailwind-merge@2.6.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  144. package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +28 -0
  145. package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js.map +1 -0
  146. package/dist/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js +133 -0
  147. package/dist/node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js.map +1 -0
  148. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js +7 -0
  149. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -0
  150. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +27 -0
  151. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -0
  152. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js +26 -0
  153. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.1.6_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -0
  154. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js +19 -0
  155. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -0
  156. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js +68 -0
  157. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.1.6_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -0
  158. package/dist/types/minisSDK.generated.d.js +18 -0
  159. package/dist/types/minisSDK.generated.d.js.map +1 -0
  160. package/dist/utils/errors.js +39 -0
  161. package/dist/utils/errors.js.map +1 -0
  162. package/dist/utils/parseUrl.js +8 -0
  163. package/dist/utils/parseUrl.js.map +1 -0
  164. package/package.json +29 -14
  165. package/src/components/index.ts +4 -7
  166. package/src/components/ui/alert-dialog.tsx +151 -0
  167. package/src/components/ui/button.tsx +60 -0
  168. package/src/components/ui/card.tsx +92 -0
  169. package/src/components/ui/sonner.tsx +23 -0
  170. package/src/dev.tsx +116 -38
  171. package/src/hooks/index.ts +31 -5
  172. package/src/hooks/navigation/useCloseMini.doc.ts +32 -0
  173. package/src/hooks/navigation/useCloseMini.example.tsx +7 -0
  174. package/src/hooks/navigation/useCloseMini.ts +17 -0
  175. package/src/hooks/navigation/useShopNavigation.doc.ts +32 -0
  176. package/src/hooks/navigation/useShopNavigation.example.tsx +29 -0
  177. package/src/hooks/navigation/useShopNavigation.ts +41 -0
  178. package/src/hooks/product/usePopularProducts.ts +37 -0
  179. package/src/hooks/product/useProductList.doc.ts +32 -0
  180. package/src/hooks/product/useProductList.example.tsx +9 -0
  181. package/src/hooks/product/useProductList.ts +56 -0
  182. package/src/hooks/product/useProductListActions.doc.ts +32 -0
  183. package/src/hooks/product/useProductListActions.example.tsx +57 -0
  184. package/src/hooks/product/useProductListActions.ts +51 -0
  185. package/src/hooks/product/useProductLists.doc.ts +32 -0
  186. package/src/hooks/product/useProductLists.example.tsx +9 -0
  187. package/src/hooks/product/useProductLists.ts +39 -0
  188. package/src/hooks/product/useRecommendedProducts.doc.ts +32 -0
  189. package/src/hooks/product/useRecommendedProducts.example.tsx +7 -0
  190. package/src/hooks/product/useRecommendedProducts.ts +37 -0
  191. package/src/hooks/shop/useRecommendedShops.doc.ts +32 -0
  192. package/src/hooks/shop/useRecommendedShops.example.tsx +7 -0
  193. package/src/hooks/shop/useRecommendedShops.ts +43 -0
  194. package/src/hooks/shop/useShopCartActions.doc.ts +32 -0
  195. package/src/hooks/shop/useShopCartActions.example.tsx +28 -0
  196. package/src/hooks/shop/useShopCartActions.ts +23 -0
  197. package/src/hooks/storage/useAsyncStorage.doc.ts +32 -0
  198. package/src/hooks/storage/useAsyncStorage.example.tsx +30 -0
  199. package/src/hooks/storage/useAsyncStorage.ts +48 -0
  200. package/src/hooks/storage/useImageUpload.doc.ts +32 -0
  201. package/src/hooks/storage/useImageUpload.example.tsx +20 -0
  202. package/src/hooks/storage/useImageUpload.ts +135 -0
  203. package/src/hooks/storage/useSecureStorage.doc.ts +32 -0
  204. package/src/hooks/storage/useSecureStorage.example.tsx +23 -0
  205. package/src/hooks/storage/useSecureStorage.ts +28 -0
  206. package/src/hooks/user/useBuyerAttributes.doc.ts +32 -0
  207. package/src/hooks/user/useBuyerAttributes.example.tsx +14 -0
  208. package/src/hooks/user/useBuyerAttributes.ts +34 -0
  209. package/src/hooks/user/useCurrentUser.doc.ts +31 -0
  210. package/src/hooks/user/useCurrentUser.example.tsx +7 -0
  211. package/src/hooks/user/useCurrentUser.ts +37 -0
  212. package/src/hooks/user/useFollowedShopsActions.doc.ts +32 -0
  213. package/src/hooks/user/useFollowedShopsActions.example.tsx +18 -0
  214. package/src/hooks/user/useFollowedShopsActions.ts +23 -0
  215. package/src/hooks/user/useOrders.doc.ts +32 -0
  216. package/src/hooks/user/useOrders.example.tsx +7 -0
  217. package/src/hooks/user/useOrders.ts +32 -0
  218. package/src/hooks/user/useSavedProductsActions.doc.ts +32 -0
  219. package/src/hooks/user/useSavedProductsActions.example.tsx +30 -0
  220. package/src/hooks/user/useSavedProductsActions.ts +23 -0
  221. package/src/hooks/util/useErrorScreen.doc.ts +32 -0
  222. package/src/hooks/util/useErrorScreen.example.tsx +16 -0
  223. package/src/hooks/util/useErrorScreen.ts +15 -0
  224. package/src/hooks/util/useErrorToast.doc.ts +32 -0
  225. package/src/hooks/util/useErrorToast.example.tsx +15 -0
  226. package/src/hooks/util/useErrorToast.ts +15 -0
  227. package/src/index.css +120 -2
  228. package/src/internal/useHandleAction.ts +24 -0
  229. package/src/internal/useShopActions.ts +5 -0
  230. package/src/internal/useShopActionsDataFetching.ts +153 -0
  231. package/src/internal/useShopActionsPaginatedDataFetching.ts +193 -0
  232. package/src/lib/utils.ts +9 -0
  233. package/src/types/index.ts +2 -0
  234. package/src/types/minisSDK.generated.d.ts +2 -74
  235. package/src/utils/errors.ts +86 -0
  236. package/src/utils/index.ts +2 -11
  237. package/src/utils/parseUrl.ts +5 -0
  238. package/tailwind.config.js +3 -0
  239. package/src/components/HelloWorld/HelloWorld.tsx +0 -43
  240. package/src/components/HelloWorld/index.ts +0 -2
  241. package/src/tailwind-theme.css +0 -39
@@ -0,0 +1,259 @@
1
+ import * as s from "react";
2
+ import { composeEventHandlers as p } from "../../../../../@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js";
3
+ import { useComposedRefs as _ } from "../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js";
4
+ import { createContextScope as V, createContext as q } from "../../../../../@radix-ui_react-context@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js";
5
+ import { useId as R } from "../../../../../@radix-ui_react-id@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js";
6
+ import { useControllableState as K } from "../../../../../@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
7
+ import { DismissableLayer as U } from "../../../../../@radix-ui_react-dismissable-layer@1.1.10_@types_react-dom@19.1.6_@types_react@19.1.6__@types__ipor64qsap4jnr6m7nflv4q5v4/node_modules/@radix-ui/react-dismissable-layer/dist/index.js";
8
+ import { FocusScope as Y } from "../../../../../@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@1_zpdtvgogfsfavk62phevpdv4fu/node_modules/@radix-ui/react-focus-scope/dist/index.js";
9
+ import { Portal as Z } from "../../../../../@radix-ui_react-portal@1.1.9_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1.6_sr45arufxpp6hzdn2l7kcrtvqe/node_modules/@radix-ui/react-portal/dist/index.js";
10
+ import { Presence as h } from "../../../../../@radix-ui_react-presence@1.1.4_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19.1_5ga5lr7i6zouk7rhd63vbsmjyu/node_modules/@radix-ui/react-presence/dist/index.js";
11
+ import { Primitive as g } from "../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js";
12
+ import { useFocusGuards as z } from "../../../../../@radix-ui_react-focus-guards@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.js";
13
+ import J from "../../../../../react-remove-scroll@2.7.1_@types_react@19.1.6_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
+ import { hideOthers as Q } from "../../../../../aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js";
15
+ import { createSlot as X } from "../../../../../@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/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, Ne] = V(D), [ee, 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] = K({
26
+ prop: a,
27
+ defaultProp: r ?? !1,
28
+ onChange: o,
29
+ caller: D
30
+ });
31
+ return /* @__PURE__ */ i(
32
+ ee,
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((H) => !H), [C]),
43
+ modal: l,
44
+ children: n
45
+ }
46
+ );
47
+ };
48
+ x.displayName = D;
49
+ var A = "DialogTrigger", T = 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
+ T.displayName = A;
68
+ var E = "DialogPortal", [oe, b] = I(E, {
69
+ forceMount: void 0
70
+ }), M = (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(Z, { asChild: !0, container: r, children: l }) })) });
73
+ };
74
+ M.displayName = E;
75
+ var m = "DialogOverlay", w = s.forwardRef(
76
+ (e, t) => {
77
+ const n = b(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
+ w.displayName = m;
82
+ var te = X("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(J, { 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", S = s.forwardRef(
100
+ (e, t) => {
101
+ const n = b(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
+ S.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 Q(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
+ Y,
160
+ {
161
+ asChild: !0,
162
+ loop: !0,
163
+ trapped: a,
164
+ onMountAutoFocus: r,
165
+ onUnmountAutoFocus: o,
166
+ children: /* @__PURE__ */ i(
167
+ U,
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", W = 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
+ W.displayName = y;
194
+ var k = "DialogDescription", G = s.forwardRef(
195
+ (e, t) => {
196
+ const { __scopeDialog: n, ...a } = e, r = u(k, n);
197
+ return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
198
+ }
199
+ );
200
+ G.displayName = k;
201
+ var L = "DialogClose", $ = s.forwardRef(
202
+ (e, t) => {
203
+ const { __scopeDialog: n, ...a } = e, r = u(L, 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
+ $.displayName = L;
216
+ function N(e) {
217
+ return e ? "open" : "closed";
218
+ }
219
+ var B = "DialogTitleWarning", [Pe, j] = q(B, {
220
+ contentName: d,
221
+ titleName: y,
222
+ docsSlug: "dialog"
223
+ }), ie = ({ titleId: e }) => {
224
+ const t = j(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 {${j(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
+ }, Oe = x, Ie = T, xe = M, Ae = w, Te = S, be = W, Me = G, we = $;
239
+ export {
240
+ we as Close,
241
+ Te as Content,
242
+ Me as Description,
243
+ x as Dialog,
244
+ $ as DialogClose,
245
+ S as DialogContent,
246
+ G as DialogDescription,
247
+ w as DialogOverlay,
248
+ M as DialogPortal,
249
+ W as DialogTitle,
250
+ T as DialogTrigger,
251
+ Ae as Overlay,
252
+ xe as Portal,
253
+ Oe as Root,
254
+ be as Title,
255
+ Ie as Trigger,
256
+ Pe as WarningProvider,
257
+ Ne as createDialogScope
258
+ };
259
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.6_@types+react@19.1.6__@types+react@19.1._sjczexpvrqz6fttoobpwnns2oa/node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","contentRef","open","setOpen","useControllableState","jsx","useId","prevOpen","TRIGGER_NAME","DialogTrigger","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","getState","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","DialogPortal","forceMount","container","child","Presence","PortalPrimitive","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","content","hideOthers","DialogContentImpl","event","originalEvent","ctrlLeftClick","hasInteractedOutsideRef","hasPointerDownOutsideRef","target","trapFocus","onOpenAutoFocus","onCloseAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","DismissableLayer","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","DESCRIPTION_NAME","DialogDescription","descriptionProps","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","titleId","titleWarningContext","MESSAGE","DESCRIPTION_WARNING_NAME","descriptionId","describedById","Root","Trigger","Portal","Overlay","Content","Title","Description","Close"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAIA,IAAc,UACd,CAACC,GAAqBC,EAAiB,IAAIC,EAAmBH,CAAW,GACzE,CAACI,IAAgBC,CAAgB,IAAIJ,EAAoBD,CAAW,GACpEM,IAAS,CAACC,MAAU;AACtB,QAAM;AAAA,IACJ,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAMC;AAAA,IACN,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,EACZ,IAAMN,GACEO,IAAaC,EAAM,OAAO,IAAI,GAC9BC,IAAaD,EAAM,OAAO,IAAI,GAC9B,CAACE,GAAMC,CAAO,IAAIC,EAAqB;AAAA,IAC3C,MAAMT;AAAA,IACN,aAAaC,KAAe;AAAA,IAC5B,UAAUC;AAAA,IACV,QAAQZ;AAAA,EACZ,CAAG;AACD,SAAuB,gBAAAoB;AAAA,IACrBhB;AAAA,IACA;AAAA,MACE,OAAOI;AAAA,MACP,YAAAM;AAAA,MACA,YAAAE;AAAA,MACA,WAAWK,EAAO;AAAA,MAClB,SAASA,EAAO;AAAA,MAChB,eAAeA,EAAO;AAAA,MACtB,MAAAJ;AAAA,MACA,cAAcC;AAAA,MACd,cAAcH,EAAM,YAAY,MAAMG,EAAQ,CAACI,MAAa,CAACA,CAAQ,GAAG,CAACJ,CAAO,CAAC;AAAA,MACjF,OAAAL;AAAA,MACA,UAAAJ;AAAA,IACN;A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KF,CAAO;AAAA,EAE5C,GAAE,CAACA,GAAS1E,GAAY4E,CAAa,CAAC,GAChC;AACT,GACIE,KAAOxF,GACPyF,KAAUvE,GACVwE,KAAS5D,GACT6D,KAAUtD,GACVuD,KAAU/C,GACVgD,KAAQvB,GACRwB,KAAcrB,GACdsB,KAAQnB;","x_google_ignoreList":[0]}
@@ -0,0 +1,128 @@
1
+ import * as n from "react";
2
+ import { composeEventHandlers as h } from "../../../../../@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js";
3
+ import { Primitive as w, dispatchDiscreteCustomEvent as k } from "../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js";
4
+ import { useComposedRefs as g } from "../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js";
5
+ import { useCallbackRef as R } from "../../../../../@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js";
6
+ import { useEscapeKeydown as U } from "../../../../../@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/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
+ };
128
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.6_@types+react@19.1.6__@types+_ipor64qsap4jnr6m7nflv4q5v4/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":";;;;;;;AAUA,IAAIA,IAAyB,oBACzBC,IAAiB,2BACjBC,IAAuB,uCACvBC,IAAgB,iCAChBC,GACAC,IAA0BC,EAAM,cAAc;AAAA,EAChD,QAAwB,oBAAI,IAAK;AAAA,EACjC,wCAAwD,oBAAI,IAAK;AAAA,EACjE,UAA0B,oBAAI,IAAG;AACnC,CAAC,GACGC,IAAmBD,EAAM;AAAA,EAC3B,CAACE,GAAOC,MAAiB;AACvB,UAAM;AAAA,MACJ,6BAAAC,IAA8B;AAAA,MAC9B,iBAA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AAS,IAAO,YAAY,IAAM,QAAAE,GAAQ;AAChF,EAAID,KAAS3B,EAAO,iBAAiB0B,GAAMC,GAAS,EAAE,MAAM,IAAM,GAC9DE,IACFC,EAA4B9B,GAAQD,CAAK,IAEzCC,EAAO,cAAcD,CAAK;AAE9B;","x_google_ignoreList":[0]}
@@ -0,0 +1,18 @@
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
+ };
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-guards/src/focus-guards.tsx\nimport * as React from \"react\";\nvar count = 0;\nfunction FocusGuards(props) {\n useFocusGuards();\n return props.children;\n}\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll(\"[data-radix-focus-guard]\");\n document.body.insertAdjacentElement(\"afterbegin\", edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement(\"beforeend\", edgeGuards[1] ?? createFocusGuard());\n count++;\n return () => {\n if (count === 1) {\n document.querySelectorAll(\"[data-radix-focus-guard]\").forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\nfunction createFocusGuard() {\n const element = document.createElement(\"span\");\n element.setAttribute(\"data-radix-focus-guard\", \"\");\n element.tabIndex = 0;\n element.style.outline = \"none\";\n element.style.opacity = \"0\";\n element.style.position = \"fixed\";\n element.style.pointerEvents = \"none\";\n return element;\n}\nvar Root = FocusGuards;\nexport {\n FocusGuards,\n Root,\n useFocusGuards\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["count","useFocusGuards","React","edgeGuards","createFocusGuard","node","element"],"mappings":";AAIA,IAAIA,IAAQ;AAKZ,SAASC,IAAiB;AACxB,EAAAC,EAAM,UAAU,MAAM;AACpB,UAAMC,IAAa,SAAS,iBAAiB,0BAA0B;AACvE,oBAAS,KAAK,sBAAsB,cAAcA,EAAW,CAAC,KAAKC,GAAkB,GACrF,SAAS,KAAK,sBAAsB,aAAaD,EAAW,CAAC,KAAKC,GAAkB,GACpFJ,KACO,MAAM;AACX,MAAIA,MAAU,KACZ,SAAS,iBAAiB,0BAA0B,EAAE,QAAQ,CAACK,MAASA,EAAK,QAAQ,GAEvFL;AAAA,IACD;AAAA,EACF,GAAE,EAAE;AACP;AACA,SAASI,IAAmB;AAC1B,QAAME,IAAU,SAAS,cAAc,MAAM;AAC7C,SAAAA,EAAQ,aAAa,0BAA0B,EAAE,GACjDA,EAAQ,WAAW,GACnBA,EAAQ,MAAM,UAAU,QACxBA,EAAQ,MAAM,UAAU,KACxBA,EAAQ,MAAM,WAAW,SACzBA,EAAQ,MAAM,gBAAgB,QACvBA;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,137 @@
1
+ import * as d from "react";
2
+ import { useComposedRefs as R } from "../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js";
3
+ import { Primitive as M } from "../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react@19._5iu4xtybujtep4zwi6jviky6tu/node_modules/@radix-ui/react-primitive/dist/index.js";
4
+ import { useCallbackRef as y } from "../../../../../@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/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
+ };
137
+ //# sourceMappingURL=index.js.map