@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,7 @@
1
+ function i(n, t) {
2
+ return typeof n == "function" ? n(t) : n && (n.current = t), n;
3
+ }
4
+ export {
5
+ i as assignRef
6
+ };
7
+ //# sourceMappingURL=assignRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assignRef.js","sources":["../../../../../../../../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"],"sourcesContent":["/**\n * Assigns a value for a given ref, no matter of the ref format\n * @param {RefObject} ref - a callback function or ref object\n * @param value - a new value\n *\n * @see https://github.com/theKashey/use-callback-ref#assignref\n * @example\n * const refObject = useRef();\n * const refFn = (ref) => {....}\n *\n * assignRef(refObject, \"refValue\");\n * assignRef(refFn, \"refValue\");\n */\nexport function assignRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n }\n else if (ref) {\n ref.current = value;\n }\n return ref;\n}\n"],"names":["assignRef","ref","value"],"mappings":"AAaO,SAASA,EAAUC,GAAKC,GAAO;AAClC,SAAI,OAAOD,KAAQ,aACfA,EAAIC,CAAK,IAEJD,MACLA,EAAI,UAAUC,IAEXD;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,27 @@
1
+ import * as f from "react";
2
+ import { assignRef as o } from "./assignRef.js";
3
+ import { useCallbackRef as l } from "./useRef.js";
4
+ var s = typeof window < "u" ? f.useLayoutEffect : f.useEffect, c = /* @__PURE__ */ new WeakMap();
5
+ function v(e, m) {
6
+ var t = l(null, function(n) {
7
+ return e.forEach(function(u) {
8
+ return o(u, n);
9
+ });
10
+ });
11
+ return s(function() {
12
+ var n = c.get(t);
13
+ if (n) {
14
+ var u = new Set(n), r = new Set(e), i = t.current;
15
+ u.forEach(function(a) {
16
+ r.has(a) || o(a, null);
17
+ }), r.forEach(function(a) {
18
+ u.has(a) || o(a, i);
19
+ });
20
+ }
21
+ c.set(t, e);
22
+ }, [e]), t;
23
+ }
24
+ export {
25
+ v as useMergeRefs
26
+ };
27
+ //# sourceMappingURL=useMergeRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMergeRef.js","sources":["../../../../../../../../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"],"sourcesContent":["import * as React from 'react';\nimport { assignRef } from './assignRef';\nimport { useCallbackRef } from './useRef';\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar currentValues = new WeakMap();\n/**\n * Merges two or more refs together providing a single interface to set their value\n * @param {RefObject|Ref} refs\n * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}\n *\n * @see {@link mergeRefs} a version without buit-in memoization\n * @see https://github.com/theKashey/use-callback-ref#usemergerefs\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const ownRef = useRef();\n * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together\n * return <div ref={domRef}>...</div>\n * }\n */\nexport function useMergeRefs(refs, defaultValue) {\n var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {\n return refs.forEach(function (ref) { return assignRef(ref, newValue); });\n });\n // handle refs changes - added or removed\n useIsomorphicLayoutEffect(function () {\n var oldValue = currentValues.get(callbackRef);\n if (oldValue) {\n var prevRefs_1 = new Set(oldValue);\n var nextRefs_1 = new Set(refs);\n var current_1 = callbackRef.current;\n prevRefs_1.forEach(function (ref) {\n if (!nextRefs_1.has(ref)) {\n assignRef(ref, null);\n }\n });\n nextRefs_1.forEach(function (ref) {\n if (!prevRefs_1.has(ref)) {\n assignRef(ref, current_1);\n }\n });\n }\n currentValues.set(callbackRef, refs);\n }, [refs]);\n return callbackRef;\n}\n"],"names":["useIsomorphicLayoutEffect","React","currentValues","useMergeRefs","refs","defaultValue","callbackRef","useCallbackRef","newValue","ref","assignRef","oldValue","prevRefs_1","nextRefs_1","current_1"],"mappings":";;;AAGA,IAAIA,IAA4B,OAAO,SAAW,MAAcC,EAAM,kBAAkBA,EAAM,WAC1FC,IAAgB,oBAAI,QAAS;AAe1B,SAASC,EAAaC,GAAMC,GAAc;AAC7C,MAAIC,IAAcC,EAA+B,MAAM,SAAUC,GAAU;AACvE,WAAOJ,EAAK,QAAQ,SAAUK,GAAK;AAAE,aAAOC,EAAUD,GAAKD,CAAQ;AAAA,KAAI;AAAA,EAC/E,CAAK;AAED,SAAAR,EAA0B,WAAY;AAClC,QAAIW,IAAWT,EAAc,IAAII,CAAW;AAC5C,QAAIK,GAAU;AACV,UAAIC,IAAa,IAAI,IAAID,CAAQ,GAC7BE,IAAa,IAAI,IAAIT,CAAI,GACzBU,IAAYR,EAAY;AAC5B,MAAAM,EAAW,QAAQ,SAAUH,GAAK;AAC9B,QAAKI,EAAW,IAAIJ,CAAG,KACnBC,EAAUD,GAAK,IAAI;AAAA,MAEvC,CAAa,GACDI,EAAW,QAAQ,SAAUJ,GAAK;AAC9B,QAAKG,EAAW,IAAIH,CAAG,KACnBC,EAAUD,GAAKK,CAAS;AAAA,MAE5C,CAAa;AAAA,IACb;AACQ,IAAAZ,EAAc,IAAII,GAAaF,CAAI;AAAA,EAC3C,GAAO,CAACA,CAAI,CAAC,GACFE;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,26 @@
1
+ import { useState as u } from "react";
2
+ function n(c, r) {
3
+ var e = u(function() {
4
+ return {
5
+ // value
6
+ value: c,
7
+ // last callback
8
+ callback: r,
9
+ // "memoized" public interface
10
+ facade: {
11
+ get current() {
12
+ return e.value;
13
+ },
14
+ set current(a) {
15
+ var t = e.value;
16
+ t !== a && (e.value = a, e.callback(a, t));
17
+ }
18
+ }
19
+ };
20
+ })[0];
21
+ return e.callback = r, e.facade;
22
+ }
23
+ export {
24
+ n as useCallbackRef
25
+ };
26
+ //# sourceMappingURL=useRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRef.js","sources":["../../../../../../../../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"],"sourcesContent":["import { useState } from 'react';\n/**\n * creates a MutableRef with ref change callback\n * @param initialValue - initial ref value\n * @param {Function} callback - a callback to run when value changes\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n *\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n * @returns {MutableRefObject}\n */\nexport function useCallbackRef(initialValue, callback) {\n var ref = useState(function () { return ({\n // value\n value: initialValue,\n // last callback\n callback: callback,\n // \"memoized\" public interface\n facade: {\n get current() {\n return ref.value;\n },\n set current(value) {\n var last = ref.value;\n if (last !== value) {\n ref.value = value;\n ref.callback(value, last);\n }\n },\n },\n }); })[0];\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n"],"names":["useCallbackRef","initialValue","callback","ref","useState","value","last"],"mappings":";AAeO,SAASA,EAAeC,GAAcC,GAAU;AACnD,MAAIC,IAAMC,EAAS,WAAY;AAAE,WAAQ;AAAA;AAAA,MAErC,OAAOH;AAAA;AAAA,MAEP,UAAUC;AAAA;AAAA,MAEV,QAAQ;AAAA,QACJ,IAAI,UAAU;AACV,iBAAOC,EAAI;AAAA,QACd;AAAA,QACD,IAAI,QAAQE,GAAO;AACf,cAAIC,IAAOH,EAAI;AACf,UAAIG,MAASD,MACTF,EAAI,QAAQE,GACZF,EAAI,SAASE,GAAOC,CAAI;AAAA,QAE/B;AAAA,MACJ;AAAA,IACT;AAAA,EAAO,CAAE,EAAE,CAAC;AAER,SAAAH,EAAI,WAAWD,GACRC,EAAI;AACf;","x_google_ignoreList":[0]}
@@ -0,0 +1,19 @@
1
+ import { __rest as o, __assign as d } from "../../../../../tslib@2.8.1/node_modules/tslib/tslib.es6.js";
2
+ import * as n from "react";
3
+ var i = function(r) {
4
+ var e = r.sideCar, a = o(r, ["sideCar"]);
5
+ if (!e)
6
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
7
+ var t = e.read();
8
+ if (!t)
9
+ throw new Error("Sidecar medium not found");
10
+ return n.createElement(t, d({}, a));
11
+ };
12
+ i.isSideCarExport = !0;
13
+ function p(r, e) {
14
+ return r.useMedium(e), i;
15
+ }
16
+ export {
17
+ p as exportSidecar
18
+ };
19
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.js","sources":["../../../../../../../../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"],"sourcesContent":["import { __assign, __rest } from \"tslib\";\nimport * as React from 'react';\nvar SideCar = function (_a) {\n var sideCar = _a.sideCar, rest = __rest(_a, [\"sideCar\"]);\n if (!sideCar) {\n throw new Error('Sidecar: please provide `sideCar` property to import the right car');\n }\n var Target = sideCar.read();\n if (!Target) {\n throw new Error('Sidecar medium not found');\n }\n return React.createElement(Target, __assign({}, rest));\n};\nSideCar.isSideCarExport = true;\nexport function exportSidecar(medium, exported) {\n medium.useMedium(exported);\n return SideCar;\n}\n"],"names":["SideCar","_a","sideCar","rest","__rest","Target","React","__assign","exportSidecar","medium","exported"],"mappings":";;AAEA,IAAIA,IAAU,SAAUC,GAAI;AACxB,MAAIC,IAAUD,EAAG,SAASE,IAAOC,EAAOH,GAAI,CAAC,SAAS,CAAC;AACvD,MAAI,CAACC;AACD,UAAM,IAAI,MAAM,oEAAoE;AAExF,MAAIG,IAASH,EAAQ,KAAM;AAC3B,MAAI,CAACG;AACD,UAAM,IAAI,MAAM,0BAA0B;AAE9C,SAAOC,EAAM,cAAcD,GAAQE,EAAS,CAAA,GAAIJ,CAAI,CAAC;AACzD;AACAH,EAAQ,kBAAkB;AACnB,SAASQ,EAAcC,GAAQC,GAAU;AAC5C,SAAAD,EAAO,UAAUC,CAAQ,GAClBV;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,68 @@
1
+ import { __assign as d } from "../../../../../tslib@2.8.1/node_modules/tslib/tslib.es6.js";
2
+ function l(r) {
3
+ return r;
4
+ }
5
+ function h(r, t) {
6
+ t === void 0 && (t = l);
7
+ var e = [], o = !1, c = {
8
+ read: function() {
9
+ if (o)
10
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
11
+ return e.length ? e[e.length - 1] : r;
12
+ },
13
+ useMedium: function(u) {
14
+ var n = t(u, o);
15
+ return e.push(n), function() {
16
+ e = e.filter(function(i) {
17
+ return i !== n;
18
+ });
19
+ };
20
+ },
21
+ assignSyncMedium: function(u) {
22
+ for (o = !0; e.length; ) {
23
+ var n = e;
24
+ e = [], n.forEach(u);
25
+ }
26
+ e = {
27
+ push: function(i) {
28
+ return u(i);
29
+ },
30
+ filter: function() {
31
+ return e;
32
+ }
33
+ };
34
+ },
35
+ assignMedium: function(u) {
36
+ o = !0;
37
+ var n = [];
38
+ if (e.length) {
39
+ var i = e;
40
+ e = [], i.forEach(u), n = e;
41
+ }
42
+ var s = function() {
43
+ var f = n;
44
+ n = [], f.forEach(u);
45
+ }, a = function() {
46
+ return Promise.resolve().then(s);
47
+ };
48
+ a(), e = {
49
+ push: function(f) {
50
+ n.push(f), a();
51
+ },
52
+ filter: function(f) {
53
+ return n = n.filter(f), e;
54
+ }
55
+ };
56
+ }
57
+ };
58
+ return c;
59
+ }
60
+ function v(r) {
61
+ r === void 0 && (r = {});
62
+ var t = h(null);
63
+ return t.options = d({ async: !0, ssr: !1 }, r), t;
64
+ }
65
+ export {
66
+ v as createSidecarMedium
67
+ };
68
+ //# sourceMappingURL=medium.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"medium.js","sources":["../../../../../../../../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"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","buffer","assigned","medium","data","item","x","cb","cbs","pendingQueue","executeQueue","cycle","filter","createSidecarMedium","options","__assign"],"mappings":";AACA,SAASA,EAAKC,GAAG;AACb,SAAOA;AACX;AACA,SAASC,EAAkBC,GAAUC,GAAY;AAC7C,EAAIA,MAAe,WAAUA,IAAaJ;AAC1C,MAAIK,IAAS,CAAE,GACXC,IAAW,IACXC,IAAS;AAAA,IACT,MAAM,WAAY;AACd,UAAID;AACA,cAAM,IAAI,MAAM,kGAAkG;AAEtH,aAAID,EAAO,SACAA,EAAOA,EAAO,SAAS,CAAC,IAE5BF;AAAA,IACV;AAAA,IACD,WAAW,SAAUK,GAAM;AACvB,UAAIC,IAAOL,EAAWI,GAAMF,CAAQ;AACpC,aAAAD,EAAO,KAAKI,CAAI,GACT,WAAY;AACf,QAAAJ,IAASA,EAAO,OAAO,SAAUK,GAAG;AAAE,iBAAOA,MAAMD;AAAA,SAAO;AAAA,MAC7D;AAAA,IACJ;AAAA,IACD,kBAAkB,SAAUE,GAAI;AAE5B,WADAL,IAAW,IACJD,EAAO,UAAQ;AAClB,YAAIO,IAAMP;AACV,QAAAA,IAAS,CAAE,GACXO,EAAI,QAAQD,CAAE;AAAA,MAC9B;AACY,MAAAN,IAAS;AAAA,QACL,MAAM,SAAUK,GAAG;AAAE,iBAAOC,EAAGD,CAAC;AAAA,QAAI;AAAA,QACpC,QAAQ,WAAY;AAAE,iBAAOL;AAAA,QAAS;AAAA,MACzC;AAAA,IACJ;AAAA,IACD,cAAc,SAAUM,GAAI;AACxB,MAAAL,IAAW;AACX,UAAIO,IAAe,CAAE;AACrB,UAAIR,EAAO,QAAQ;AACf,YAAIO,IAAMP;AACV,QAAAA,IAAS,CAAE,GACXO,EAAI,QAAQD,CAAE,GACdE,IAAeR;AAAA,MAC/B;AACY,UAAIS,IAAe,WAAY;AAC3B,YAAIF,IAAMC;AACV,QAAAA,IAAe,CAAE,GACjBD,EAAI,QAAQD,CAAE;AAAA,MACjB,GACGI,IAAQ,WAAY;AAAE,eAAO,QAAQ,QAAO,EAAG,KAAKD,CAAY;AAAA,MAAI;AACxE,MAAAC,EAAO,GACPV,IAAS;AAAA,QACL,MAAM,SAAUK,GAAG;AACf,UAAAG,EAAa,KAAKH,CAAC,GACnBK,EAAO;AAAA,QACV;AAAA,QACD,QAAQ,SAAUC,GAAQ;AACtB,iBAAAH,IAAeA,EAAa,OAAOG,CAAM,GAClCX;AAAA,QACV;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACD,SAAOE;AACX;AAMO,SAASU,EAAoBC,GAAS;AACzC,EAAIA,MAAY,WAAUA,IAAU,CAAA;AACpC,MAAIX,IAASL,EAAkB,IAAI;AACnC,SAAAK,EAAO,UAAUY,EAAS,EAAE,OAAO,IAAM,KAAK,GAAO,GAAED,CAAO,GACvDX;AACX;","x_google_ignoreList":[0]}
@@ -0,0 +1,18 @@
1
+ var R = /* @__PURE__ */ ((D) => (D.AED = "AED", D.AFN = "AFN", D.ALL = "ALL", D.AMD = "AMD", D.ANG = "ANG", D.AOA = "AOA", D.ARS = "ARS", D.AUD = "AUD", D.AWG = "AWG", D.AZN = "AZN", D.BAM = "BAM", D.BBD = "BBD", D.BDT = "BDT", D.BGN = "BGN", D.BHD = "BHD", D.BIF = "BIF", D.BMD = "BMD", D.BND = "BND", D.BOB = "BOB", D.BRL = "BRL", D.BSD = "BSD", D.BTN = "BTN", D.BWP = "BWP", D.BYN = "BYN", D.BYR = "BYR", D.BZD = "BZD", D.CAD = "CAD", D.CDF = "CDF", D.CHF = "CHF", D.CLP = "CLP", D.CNY = "CNY", D.COP = "COP", D.CRC = "CRC", D.CVE = "CVE", D.CZK = "CZK", D.DJF = "DJF", D.DKK = "DKK", D.DOP = "DOP", D.DZD = "DZD", D.EGP = "EGP", D.ERN = "ERN", D.ETB = "ETB", D.EUR = "EUR", D.FJD = "FJD", D.FKP = "FKP", D.GBP = "GBP", D.GEL = "GEL", D.GHS = "GHS", D.GIP = "GIP", D.GMD = "GMD", D.GNF = "GNF", D.GTQ = "GTQ", D.GYD = "GYD", D.HKD = "HKD", D.HNL = "HNL", D.HRK = "HRK", D.HTG = "HTG", D.HUF = "HUF", D.IDR = "IDR", D.ILS = "ILS", D.INR = "INR", D.IQD = "IQD", D.IRR = "IRR", D.ISK = "ISK", D.JEP = "JEP", D.JMD = "JMD", D.JOD = "JOD", D.JPY = "JPY", D.KES = "KES", D.KGS = "KGS", D.KHR = "KHR", D.KID = "KID", D.KMF = "KMF", D.KRW = "KRW", D.KWD = "KWD", D.KYD = "KYD", D.KZT = "KZT", D.LAK = "LAK", D.LBP = "LBP", D.LKR = "LKR", D.LRD = "LRD", D.LSL = "LSL", D.LTL = "LTL", D.LVL = "LVL", D.LYD = "LYD", D.MAD = "MAD", D.MDL = "MDL", D.MGA = "MGA", D.MKD = "MKD", D.MMK = "MMK", D.MNT = "MNT", D.MOP = "MOP", D.MRU = "MRU", D.MUR = "MUR", D.MVR = "MVR", D.MWK = "MWK", D.MXN = "MXN", D.MYR = "MYR", D.MZN = "MZN", D.NAD = "NAD", D.NGN = "NGN", D.NIO = "NIO", D.NOK = "NOK", D.NPR = "NPR", D.NZD = "NZD", D.OMR = "OMR", D.PAB = "PAB", D.PEN = "PEN", D.PGK = "PGK", D.PHP = "PHP", D.PKR = "PKR", D.PLN = "PLN", D.PYG = "PYG", D.QAR = "QAR", D.RON = "RON", D.RSD = "RSD", D.RUB = "RUB", D.RWF = "RWF", D.SAR = "SAR", D.SBD = "SBD", D.SCR = "SCR", D.SDG = "SDG", D.SEK = "SEK", D.SGD = "SGD", D.SHP = "SHP", D.SLL = "SLL", D.SOS = "SOS", D.SRD = "SRD", D.SSP = "SSP", D.STD = "STD", D.STN = "STN", D.SYP = "SYP", D.SZL = "SZL", D.THB = "THB", D.TJS = "TJS", D.TMT = "TMT", D.TND = "TND", D.TOP = "TOP", D.TRY = "TRY", D.TTD = "TTD", D.TWD = "TWD", D.TZS = "TZS", D.UAH = "UAH", D.UGX = "UGX", D.USD = "USD", D.UYU = "UYU", D.UZS = "UZS", D.VED = "VED", D.VEF = "VEF", D.VES = "VES", D.VND = "VND", D.VUV = "VUV", D.WST = "WST", D.XAF = "XAF", D.XCD = "XCD", D.XOF = "XOF", D.XPF = "XPF", D.XXX = "XXX", D.YER = "YER", D.ZAR = "ZAR", D.ZMW = "ZMW", D))(R || {}), S = /* @__PURE__ */ ((D) => (D.Male = "MALE", D.Female = "FEMALE", D.Neutral = "NEUTRAL", D))(S || {});
2
+ const N = {
3
+ MiniConsent: "mini_consent",
4
+ CameraConsent: "camera_consent",
5
+ PhotoLibraryConsent: "photo_library_consent",
6
+ MicrophoneConsent: "microphone_consent"
7
+ }, M = {
8
+ Granted: "granted",
9
+ Dismissed: "dismissed",
10
+ Idle: "idle"
11
+ };
12
+ export {
13
+ N as Consent,
14
+ M as ConsentStatus,
15
+ R as CurrencyCode,
16
+ S as Gender
17
+ };
18
+ //# sourceMappingURL=minisSDK.generated.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minisSDK.generated.d.js","sources":["../../src/types/minisSDK.generated.d.ts"],"sourcesContent":["/* eslint-disable @shopify/typescript/prefer-pascal-case-enums */\n// Auto-generated type definitions for MinisSDK\n// Generated on: 2025-06-06T15:17:55.440Z\n// Do not edit this file manually - run the generation script instead\n// Source: useShopActionsImplementationV3.ts + shopActionsV3Definitions.ts + shopActionsV3Types.ts\n// Generated using TypeScript compiler API for reliable AST parsing\n//\n// This file is self-contained and can be shipped independently\n\n// ============================================================================\n// Base Types (extracted using TypeScript AST parsing)\n// ============================================================================\n\nexport interface ApiKeys {\n refreshToken: string\n accessToken: string\n}\n\nexport interface ShopActionOk<T> {\n ok: true\n data: T\n}\n\nexport interface ShopActionError {\n ok: false\n error: Error & {code?: string}\n}\n\nexport type ShopActionResult<T = void> = ShopActionOk<T> | ShopActionError\n\nexport interface ShopActions {\n getShopAppInformation: () => Promise<\n ShopActionResult<GetShopAppInformationResponse>\n >\n productRecommendationImpression(\n params: ProductRecommendationImpressionParams\n ): Promise<ShopActionResult>\n productRecommendationClick(\n params: ProductRecommendationClickParams\n ): Promise<ShopActionResult>\n hideEntryPoint(): Promise<ShopActionResult>\n closeMini(): Promise<ShopActionResult>\n\n // account actions\n followShop(params: FollowShopParams): Promise<ShopActionResult<boolean>>\n unfollowShop(params: UnfollowShopParams): Promise<ShopActionResult<boolean>>\n favorite(params: FavoriteParams): Promise<ShopActionResult>\n unfavorite(params: UnfavoriteParams): Promise<ShopActionResult>\n getAccountInformation: (\n params: GetAccountInformationParams\n ) => Promise<ShopActionResult<GetAccountInformationResponse>>\n\n // user actions\n getCurrentUser(\n params?: GetCurrentUserParams\n ): Promise<ShopActionResult<GetCurrentUserResponse>>\n\n // product actions\n createOrderAttribution(\n params: CreateOrderAttributionParams\n ): Promise<ShopActionResult>\n addToCart(params: AddToCartParams): Promise<ShopActionResult>\n buyProduct(params: BuyProductParams): Promise<ShopActionResult>\n buyProducts(params: BuyProductsParams): Promise<ShopActionResult>\n\n // error actions\n showErrorScreen: (params: ShowErrorScreenParams) => Promise<ShopActionResult>\n showErrorToast: (message: ShowErrorToastParams) => Promise<ShopActionResult>\n\n // deeplink actions\n getDeeplinkPaths(): Promise<ShopActionResult<GetDeeplinkPathsResponse>>\n navigateToDeeplink(\n params: NavigateToDeeplinkParams\n ): Promise<ShopActionResult>\n\n // navigation actions\n navigateToShop(params: NavigateToShopParams): Promise<ShopActionResult>\n navigateToProduct(params: NavigateToProductParams): Promise<ShopActionResult>\n navigateToOrder(params: NavigateToOrderParams): Promise<ShopActionResult>\n navigateToCheckout(\n params: NavigateToCheckoutParams\n ): Promise<ShopActionResult>\n\n // image upload actions\n createImageUploadLink(\n params: CreateImageUploadLinkParams\n ): Promise<ShopActionResult<CreateImageUploadLinkResponse>>\n completeImageUpload(\n params: CompleteImageUploadParams\n ): Promise<ShopActionResult<CompleteImageUploadResponse>>\n\n // async storage actions\n getPersistedItem(\n params: GetAsyncStorageItemParams\n ): Promise<ShopActionResult<string | null>>\n setPersistedItem(params: SetAsyncStorageItemParams): Promise<ShopActionResult>\n removePersistedItem(\n params: RemoveAsyncStorageItemParams\n ): Promise<ShopActionResult>\n getAllPersistedKeys(): Promise<ShopActionResult<string[]>>\n clearPersistedItems(): Promise<ShopActionResult>\n\n getInternalPersistedItem(\n params: GetAsyncStorageItemParams\n ): Promise<ShopActionResult<string | null>>\n setInternalPersistedItem(\n params: SetAsyncStorageItemParams\n ): Promise<ShopActionResult>\n removeInternalPersistedItem(\n params: RemoveAsyncStorageItemParams\n ): Promise<ShopActionResult>\n getAllInternalPersistedKeys(): Promise<ShopActionResult<string[]>>\n clearInternalPersistedItems(): Promise<ShopActionResult>\n\n // secure storage actions\n getSecret(): Promise<ShopActionResult<string | null>>\n setSecret(params: SetSecretParams): Promise<ShopActionResult>\n removeSecret(): Promise<ShopActionResult>\n\n // event reporting actions\n reportInteraction(params: ReportInteractionParams): Promise<ShopActionResult>\n reportImpression(params: ReportImpressionParams): Promise<ShopActionResult>\n reportContentImpression(\n params: ReportContentImpressionParams\n ): Promise<ShopActionResult>\n\n getProductLists(\n params?: GetProductListsParams\n ): Promise<ShopActionResult<GetProductListsResponse>>\n\n getProductList(\n params?: GetProductListParams\n ): Promise<ShopActionResult<GetProductListResponse>>\n\n // product list actions\n addProductList(\n params: AddProductListParams\n ): Promise<ShopActionResult<ProductList>>\n removeProductList(params: RemoveProductListParams): Promise<ShopActionResult>\n renameProductList: (\n params: RenameProductListParams\n ) => Promise<ShopActionResult<ProductList>>\n addProductListItem(\n params: AddProductListItemParams\n ): Promise<ShopActionResult>\n removeProductListItem(\n params: RemoveProductListItemParams\n ): Promise<ShopActionResult>\n\n // recommendations actions\n getRecommendedProducts(\n params?: GetRecommendedProductsParams\n ): Promise<ShopActionResult<GetRecommendedProductsResponse>>\n getRecommendedShops(\n params?: GetRecommendedShopsParams\n ): Promise<ShopActionResult<GetRecommendedShopsResponse>>\n searchProductsByShop(\n params?: SearchProductsByShopParams\n ): Promise<ShopActionResult<SearchProductsByShopResponse>>\n\n // orders list actions\n getOrders(\n params?: GetOrdersParams\n ): Promise<ShopActionResult<GetOrdersResponse>>\n\n getBuyerAttributes(): Promise<ShopActionResult<GetBuyerAttributesResponse>>\n\n // content actions\n showFeedbackSheet(params: ShowFeedbackSheetParams): Promise<ShopActionResult>\n\n getPopularProducts(\n params?: GetPopularProductsParams\n ): Promise<ShopActionResult<GetPopularProductsResponse>>\n}\n\nexport interface AuthShopActions {\n refreshAccessToken(\n params: RefreshAccessTokenParams\n ): Promise<ShopActionResult<ApiKeys>>\n signOut(): Promise<ShopActionResult>\n}\n\nexport type AllShopActions = ShopActions & AuthShopActions\n\nexport type ShopActionParams<T extends keyof AllShopActions> = Parameters<\n AllShopActions[T]\n>[0]\n\nexport interface FavoriteParams {\n shopId: string\n productId: string\n productVariantId: string\n}\n\nexport interface UnfavoriteParams {\n shopId: string\n productId: string\n productVariantId: string\n}\n\nexport interface LineItemAttribution {\n sourceName: string\n sourceIdentifier: string\n}\n\nexport interface CreateOrderAttributionParams {\n orderId: string\n productVariantId: string\n attribution?: LineItemAttribution\n}\n\nexport interface AddToCartParams extends BuyProductLineItem {\n /**\n * The discount codes to apply to the cart.\n */\n discountCodes?: string[]\n /**\n * Attribution data for the line item.\n * @deprecated\n */\n attribution?: LineItemAttribution\n}\n\nexport interface BuyProductLineItem {\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/456`.\n */\n productVariantId: string\n /**\n * The quantity of the product to add to the cart.\n */\n quantity?: number\n}\n\nexport interface BuyProductsParams {\n items: [BuyProductLineItem, ...BuyProductLineItem[]] // at least one item\n attribution?: LineItemAttribution\n discountCode?: string\n}\n\nexport interface BuyProductParams extends BuyProductLineItem {\n /**\n * Attribution data for the line item.\n * @deprecated\n */\n attribution?: LineItemAttribution\n /**\n * The discount code to apply to the product.\n */\n discountCode?: string\n}\n\nexport interface UpdateLineItemAttributesParams {\n lineItemAttributes: {key: string; value: string}[]\n attribution?: LineItemAttribution\n}\n\nexport interface NavigateToShopParams {\n shopId: string\n /**\n * @deprecated\n */\n shopName?: string\n}\n\nexport interface NavigateToOrderParams {\n /**\n * The GID of the order. E.g. `gid://shopify/Order/123`.\n */\n orderId: string\n}\n\nexport interface NavigateToCheckoutParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/123`.\n */\n shopId: string\n}\n\nexport interface NavigateToProductParams {\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * If present, the GID of the variant that should be initially selected\n */\n productVariantId?: string\n /*\n * Variants displayed in the product details screen will be limited to those\n * whose ID is included in this list.\n */\n includedProductVariantGIDs?: string[]\n /**\n * @deprecated use includedProductVariantGIDs instead\n */\n includedProductVariantIds?: string[]\n /**\n * @deprecated do not use\n */\n attribution?: LineItemAttribution\n /**\n * The discount code to apply to the product.\n */\n discountCode?: string\n}\n\nexport interface RefreshAccessTokenParams {\n refreshToken: string\n}\n\nexport interface ProductRecommendationImpressionParams {\n // The product GID string\n productId: string\n // Optional section id, could be useful for tracking which UI sections get impressions\n sectionId?: string\n}\n\nexport interface ProductRecommendationClickParams {\n productId: string\n sectionId?: string\n}\n\nexport interface ShowErrorScreenParams {\n /**\n * The message to display in the error screen.\n */\n message?: string\n /**\n * The title of the error screen.\n */\n title?: string\n}\n\nexport interface ShowErrorToastParams {\n message?: string\n}\n\nexport interface GetAccountInformationParams {\n /**\n * To use user account information, a shopId must be given to track on\n * which shop's behalf user information is being accessed\n */\n shopId: string\n type: 'email' | 'name' | 'phone'\n}\n\nexport interface AccountInformationPhoneInfo {\n phoneNumber: string\n countryCode: string\n prefix: string\n}\n\nexport interface GetAccountInformationResponse {\n status: 'available' | 'not-available'\n value?: string | AccountInformationPhoneInfo\n}\n\nexport interface GetShopAppInformationResponse {\n appVersion: string\n buildNumber: string\n buildId: string\n}\n\nexport interface FollowShopParams {\n shopId: string\n}\n\nexport interface UnfollowShopParams {\n shopId: string\n}\n\nexport interface NavigateToDeeplinkParams {\n deeplink: string\n}\n\nexport interface GetDeeplinkPathsResponse {\n matchers: string[]\n}\n\nexport interface ProductRecommendationClickParams {\n productId: string\n productVariantId?: string\n variantGIDs?: string[]\n discountCode?: string\n attribution?: LineItemAttribution\n sectionId?: string\n}\n\nexport interface CreateImageUploadLinkParams {\n input: {\n mimeType: string\n fileSize: number\n }[]\n}\n\nexport interface UploadTarget {\n url: string\n resourceUrl: string\n parameters: {name: string; value: string}[]\n}\n\nexport interface CreateImageUploadLinkResponse {\n targets?: UploadTarget[]\n error?: string\n}\n\nexport interface CompleteImageUploadParams {\n resourceUrls: string[]\n}\n\nexport interface CompleteImageUploadResponse {\n files?: {\n id: string\n fileStatus: 'FAILED' | 'PENDING' | 'PROCESSING' | 'READY'\n image?: {\n url: string\n } | null\n }[]\n error?: string\n}\n\nexport interface PaginationInfo {\n hasNextPage: boolean\n endCursor: string | null\n}\n\nexport interface GetProductListsResponse {\n data: ProductList[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetProductListResponse {\n data: ProductList | null\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecommendedProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetRecommendedShopsResponse {\n data: Shop[]\n pageInfo: PaginationInfo\n}\n\nexport interface SearchProductsByShopResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport interface GetBuyerAttributesResponse {\n data: {\n genderAffinity?: Gender\n categoryAffinities: TaxonomyCategory[]\n }\n}\n\nexport interface GetCurrentUserResponse {\n data: UserProfile\n}\n\nexport interface GetOrdersResponse {\n data: Order[]\n pageInfo: PaginationInfo\n}\n\nexport interface SetSecretParams {\n value: string\n}\n\nexport interface SetAsyncStorageItemParams {\n key: string\n value: string\n}\n\nexport interface GetAsyncStorageItemParams {\n key: string\n}\n\nexport interface RemoveAsyncStorageItemParams {\n key: string\n}\n\nexport interface ReportInteractionParams {\n interactionType: string\n interactionValue?: string\n pageValue?: string\n}\n\nexport interface ReportImpressionParams {\n subjectType?: string\n subjectId?: string\n pageValue?: string\n}\n\nexport interface ReportContentImpressionParams {\n publicId: string\n pageValue?: string\n}\n\nexport interface GetProductListsParams {\n /**\n * The number of lists to fetch.\n */\n first?: number\n /**\n * The cursor to fetch the next page of lists.\n */\n after?: string\n /**\n * The number of items per list to fetch.\n */\n itemsFirst?: number\n /**\n * The fetch policy to use.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id?: string\n /**\n * The public ID of the product list.\n */\n publicId?: string\n /**\n * The number of items to fetch.\n */\n first?: number\n /**\n * The cursor to fetch the next page of items.\n */\n after?: string\n /**\n * The fetch policy to use.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface AddProductListParams {\n /**\n * The name of the product list.\n */\n name: string\n /**\n * A description of the product list.\n */\n description?: string\n}\n\nexport interface RemoveProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id: string\n}\n\nexport interface RenameProductListParams {\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n */\n id: string\n /**\n * The new name of the product list.\n */\n name: string\n}\n\nexport interface AddProductListItemParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/42`.\n */\n shopId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.\n */\n productVariantId: string\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n * This will soon be deprecated in favor of just `publicListId`.\n */\n listId: string\n /**\n * The public ID of the product list.\n */\n publicListId: string\n}\n\nexport interface RemoveProductListItemParams {\n /**\n * The GID of the shop. E.g. `gid://shopify/Shop/42`.\n */\n shopId: string\n /**\n * The GID of the product variant. E.g. `gid://shopify/ProductVariant/101`.\n */\n productVariantId: string\n /**\n * The GID of the product. E.g. `gid://shopify/Product/123`.\n */\n productId: string\n /**\n * The GID of the product list. E.g. `gid://shopapp/ProductList/123`.\n * This will soon be deprecated in favor of just `publicListId`.\n */\n listId: string\n /**\n * The public ID of the product list.\n */\n publicListId: string\n}\n\nexport interface GetRecommendedProductsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetRecommendedShopsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface SearchProductsByShopParams {\n shopId: string\n query?: string\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetBuyerAttributesParams {\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetCurrentUserParams {\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetOrdersParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetPopularProductsParams {\n first?: number\n after?: string\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface GetPopularProductsResponse {\n data: Product[]\n pageInfo: PaginationInfo\n}\n\nexport type FetchPolicy =\n | 'cache-first'\n | 'network-only'\n | 'cache-only'\n | 'no-cache'\n | 'standby'\n\nexport type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network'\n\nexport enum CurrencyCode {\n AED = 'AED',\n AFN = 'AFN',\n ALL = 'ALL',\n AMD = 'AMD',\n ANG = 'ANG',\n AOA = 'AOA',\n ARS = 'ARS',\n AUD = 'AUD',\n AWG = 'AWG',\n AZN = 'AZN',\n BAM = 'BAM',\n BBD = 'BBD',\n BDT = 'BDT',\n BGN = 'BGN',\n BHD = 'BHD',\n BIF = 'BIF',\n BMD = 'BMD',\n BND = 'BND',\n BOB = 'BOB',\n BRL = 'BRL',\n BSD = 'BSD',\n BTN = 'BTN',\n BWP = 'BWP',\n BYN = 'BYN',\n BYR = 'BYR',\n BZD = 'BZD',\n CAD = 'CAD',\n CDF = 'CDF',\n CHF = 'CHF',\n CLP = 'CLP',\n CNY = 'CNY',\n COP = 'COP',\n CRC = 'CRC',\n CVE = 'CVE',\n CZK = 'CZK',\n DJF = 'DJF',\n DKK = 'DKK',\n DOP = 'DOP',\n DZD = 'DZD',\n EGP = 'EGP',\n ERN = 'ERN',\n ETB = 'ETB',\n EUR = 'EUR',\n FJD = 'FJD',\n FKP = 'FKP',\n GBP = 'GBP',\n GEL = 'GEL',\n GHS = 'GHS',\n GIP = 'GIP',\n GMD = 'GMD',\n GNF = 'GNF',\n GTQ = 'GTQ',\n GYD = 'GYD',\n HKD = 'HKD',\n HNL = 'HNL',\n HRK = 'HRK',\n HTG = 'HTG',\n HUF = 'HUF',\n IDR = 'IDR',\n ILS = 'ILS',\n INR = 'INR',\n IQD = 'IQD',\n IRR = 'IRR',\n ISK = 'ISK',\n JEP = 'JEP',\n JMD = 'JMD',\n JOD = 'JOD',\n JPY = 'JPY',\n KES = 'KES',\n KGS = 'KGS',\n KHR = 'KHR',\n KID = 'KID',\n KMF = 'KMF',\n KRW = 'KRW',\n KWD = 'KWD',\n KYD = 'KYD',\n KZT = 'KZT',\n LAK = 'LAK',\n LBP = 'LBP',\n LKR = 'LKR',\n LRD = 'LRD',\n LSL = 'LSL',\n LTL = 'LTL',\n LVL = 'LVL',\n LYD = 'LYD',\n MAD = 'MAD',\n MDL = 'MDL',\n MGA = 'MGA',\n MKD = 'MKD',\n MMK = 'MMK',\n MNT = 'MNT',\n MOP = 'MOP',\n MRU = 'MRU',\n MUR = 'MUR',\n MVR = 'MVR',\n MWK = 'MWK',\n MXN = 'MXN',\n MYR = 'MYR',\n MZN = 'MZN',\n NAD = 'NAD',\n NGN = 'NGN',\n NIO = 'NIO',\n NOK = 'NOK',\n NPR = 'NPR',\n NZD = 'NZD',\n OMR = 'OMR',\n PAB = 'PAB',\n PEN = 'PEN',\n PGK = 'PGK',\n PHP = 'PHP',\n PKR = 'PKR',\n PLN = 'PLN',\n PYG = 'PYG',\n QAR = 'QAR',\n RON = 'RON',\n RSD = 'RSD',\n RUB = 'RUB',\n RWF = 'RWF',\n SAR = 'SAR',\n SBD = 'SBD',\n SCR = 'SCR',\n SDG = 'SDG',\n SEK = 'SEK',\n SGD = 'SGD',\n SHP = 'SHP',\n SLL = 'SLL',\n SOS = 'SOS',\n SRD = 'SRD',\n SSP = 'SSP',\n STD = 'STD',\n STN = 'STN',\n SYP = 'SYP',\n SZL = 'SZL',\n THB = 'THB',\n TJS = 'TJS',\n TMT = 'TMT',\n TND = 'TND',\n TOP = 'TOP',\n TRY = 'TRY',\n TTD = 'TTD',\n TWD = 'TWD',\n TZS = 'TZS',\n UAH = 'UAH',\n UGX = 'UGX',\n USD = 'USD',\n UYU = 'UYU',\n UZS = 'UZS',\n VED = 'VED',\n VEF = 'VEF',\n VES = 'VES',\n VND = 'VND',\n VUV = 'VUV',\n WST = 'WST',\n XAF = 'XAF',\n XCD = 'XCD',\n XOF = 'XOF',\n XPF = 'XPF',\n XXX = 'XXX',\n YER = 'YER',\n ZAR = 'ZAR',\n ZMW = 'ZMW',\n}\n\nexport type Decimal = string\n\nexport type MiniAppParams = any\n\nexport interface MiniAppConfig<\n _DeprecatedParams extends MiniAppParams = undefined,\n> {\n /**\n * Root component of used inside the Minis Viewer\n */\n ViewerRoot: () => JSX.Element | null\n}\n\nexport interface MiniManifest {\n trusted_domains?: string[]\n permissions?: string[]\n [key: string]: any\n}\n\nexport type Permission = 'CAMERA' | 'GALLERY' | 'MICROPHONE'\n\nexport interface Money {\n amount: Decimal\n currencyCode: CurrencyCode\n}\n\nexport interface ProductImage {\n id?: string | null\n altText?: string | null\n url: string\n sensitive?: boolean | null\n}\n\nexport interface ProductVariant {\n id: string\n isFavorited: boolean\n image?: ProductImage | null\n price: Money\n compareAtPrice?: Money | null\n}\n\nexport interface ProductShop {\n id: string\n name: string\n}\n\nexport type ProductMedia =\n | {\n id: string\n image?: ProductImage | null\n mediaContentType: 'IMAGE'\n }\n | {\n mediaContentType: 'MODEL_3D'\n previewImage?: ProductImage | null\n sources: {\n filesize: number\n format: string\n mimeType: string\n url: string\n }[]\n }\n\nexport interface Product {\n id: string\n title: string\n reviewAnalytics: {\n averageRating?: number | null\n reviewCount?: number | null\n }\n shop: ProductShop\n selectedVariant?: ProductVariant\n defaultVariantId: string\n isFavorited: boolean\n variants?: ProductVariant[]\n featuredImage?: ProductImage | null\n price: Money\n compareAtPrice?: Money | null\n}\n\nexport interface Shop {\n id: string\n name: string\n isFollowing?: boolean | null\n shareUrl?: string | null\n primaryDomain: {\n url: string\n }\n logoImage?: ProductImage | null\n reviewAnalytics: {\n averageRating?: number | null\n reviewCount: number\n }\n}\n\nexport interface QueryOptions {\n fetchPolicy?: WatchQueryFetchPolicy\n skip?: boolean\n}\n\nexport interface ProductList {\n id: string\n publicId: string | null\n name: string | null\n products: Product[]\n}\n\nexport interface Order {\n id: string\n name: string\n lineItems: {\n productTitle: string\n variantTitle: string | null\n quantity: number\n product: Product | null\n }[]\n shop: Shop | null\n}\n\nexport interface BuyerAttributes {\n genderAffinity?: Gender\n categoryAffinities: TaxonomyCategory[]\n}\n\nexport enum Gender {\n Male = 'MALE',\n Female = 'FEMALE',\n Neutral = 'NEUTRAL',\n}\n\nexport interface TaxonomyCategory {\n id: string\n name: string\n ancestors?: TaxonomyCategory[]\n}\n\n/**\n * A user profile.\n */\nexport interface UserProfile {\n /**\n * The display name of the user.\n */\n displayName?: string | null\n /**\n * The avatar image of the user.\n */\n avatarImage?: {\n url: string\n } | null\n}\n\n/**\n * A user metafield.\n */\nexport interface UserMetafield {\n /**\n * The key of the user metafield.\n */\n key: string\n /**\n * The value of the user metafield.\n */\n value: string\n}\n\nexport interface ContentImage {\n id: string | null\n url: string\n width: number | null\n height: number | null\n}\n\nexport interface ContentProduct {\n id: string\n title: string\n featuredImage: ContentImage | null\n}\n\nexport type ContentVisibility = 'DISCOVERABLE' | 'LINKABLE'\n\nexport interface Content {\n publicId: string\n externalId: string | null\n image: ContentImage\n title: string\n description: string | null\n visibility: ContentVisibility[]\n shareableUrl: string | null\n products: ContentProduct[] | null\n}\n\n/**\n * The fetch policy to use. `cache-first` will only fetch from the network if there is no\n * cached data. `network-only` will fetch from the network regardless of whether there\n * is cached data.\n */\nexport type DataHookFetchPolicy = 'cache-first' | 'network-only'\n\nexport interface DataHookOptionsBase {\n /**\n * When true, the data will not be fetched immediately.\n */\n skip?: boolean\n /**\n * The fetch policy to use for the initial data load. Subsequent loads may use different policies.\n */\n fetchPolicy?: DataHookFetchPolicy\n}\n\nexport interface PaginatedDataHookOptionsBase extends DataHookOptionsBase {\n /**\n * The number of products to fetch.\n * @default 20\n */\n first?: number\n}\n\nexport interface DataHookReturnsBase {\n /**\n * Whether data is loading. Represents the initial data load but not `refetch`/`fetchMore` calls.\n */\n loading: boolean\n /**\n * The error that occurred while loading. Represents the initial data load and `refetch` calls but not `fetchMore`\n */\n error: Error | null\n /**\n * Refetch the data. Data is updated in place. The `loading` state will not update but the `error` state will.\n */\n refetch: () => Promise<void>\n}\n\nexport interface PaginatedDataHookReturnsBase extends DataHookReturnsBase {\n /**\n * Whether there is a next page to fetch.\n */\n hasNextPage: boolean\n /**\n * Fetch more data. Data is updated in place. The `loading` and `error` states will not update\n */\n fetchMore: () => Promise<void>\n}\n\nexport const Consent = {\n MiniConsent: 'mini_consent',\n CameraConsent: 'camera_consent',\n PhotoLibraryConsent: 'photo_library_consent',\n MicrophoneConsent: 'microphone_consent',\n} as const\n\nexport const ConsentStatus = {\n Granted: 'granted',\n Dismissed: 'dismissed',\n Idle: 'idle',\n} as const\n\nexport type ConsentType = (typeof Consent)[keyof typeof Consent]\n\nexport type ConsentStatusType =\n (typeof ConsentStatus)[keyof typeof ConsentStatus]\n\nexport interface PaginatedDataHookPageInfo {\n /**\n * Whether there is a next page to fetch.\n */\n hasNextPage: boolean\n /**\n * The cursor to use for the next page of data.\n */\n endCursor: string | null\n}\n\ndeclare global {\n interface Window {\n minisSDK: ShopActions\n }\n}\n\nexport {}\n"],"names":["CurrencyCode","Gender","Consent","ConsentStatus"],"mappings":"AAuqBY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,MAAM,OAjKIA,IAAAA,KAAA,CAAA,CAAA,GAgSAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,UAAU,WAHAA,IAAAA,KAAA,CAAA,CAAA;AAwHL,MAAMC,IAAU;AAAA,EACrB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,mBAAmB;AACrB,GAEaC,IAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,WAAW;AAAA,EACX,MAAM;AACR;"}
@@ -0,0 +1,39 @@
1
+ class t extends Error {
2
+ constructor({
3
+ component: e,
4
+ hook: n,
5
+ func: i,
6
+ callback: o,
7
+ message: a = "Unknown Error"
8
+ }) {
9
+ let r = a;
10
+ (e || n || i) && (e ? r = `<${e} />` : n ? r = n : i && (r = `${i}()`), o && (r = `${r} ${o}()`), r = `${r}: ${a}`), super(r), this.name = "MiniError";
11
+ }
12
+ }
13
+ class E extends t {
14
+ constructor(e) {
15
+ super({ message: "Network Error", ...e }), this.name = "MiniNetworkError";
16
+ }
17
+ }
18
+ class m extends t {
19
+ constructor(e) {
20
+ super({ message: "Entity Not Found", ...e }), this.name = "MiniEntityNotFoundError";
21
+ }
22
+ }
23
+ const u = (s, e) => e ? e.networkError ? new E({
24
+ ...s,
25
+ message: e.networkError?.message
26
+ }) : e.code ? new t({
27
+ ...s,
28
+ message: `${e.code}${e.message ? `: ${e.message}` : ""}`
29
+ }) : new t({
30
+ ...s,
31
+ message: e?.message
32
+ }) : null;
33
+ export {
34
+ m as MiniEntityNotFoundError,
35
+ t as MiniError,
36
+ E as MiniNetworkError,
37
+ u as formatError
38
+ };
39
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sources":["../../src/utils/errors.ts"],"sourcesContent":["interface MiniErrorSource {\n component?: string\n hook?: string\n func?: string\n callback?: string\n}\n\ninterface MiniErrorParams extends MiniErrorSource {\n message: string\n}\n\n// Base class for all Mini errors\n// We can give richer error messages by using this throughout the SDK\n// In future we could add instrumentation to track these errors too\nexport class MiniError extends Error {\n constructor({\n component,\n hook,\n func,\n callback,\n message = 'Unknown Error',\n }: MiniErrorParams) {\n let formattedMessage = message\n\n if (component || hook || func) {\n if (component) {\n formattedMessage = `<${component} />`\n } else if (hook) {\n formattedMessage = hook\n } else if (func) {\n formattedMessage = `${func}()`\n }\n\n if (callback) {\n formattedMessage = `${formattedMessage} ${callback}()`\n }\n\n formattedMessage = `${formattedMessage}: ${message}`\n }\n\n super(formattedMessage)\n this.name = 'MiniError'\n }\n}\n\nexport class MiniNetworkError extends MiniError {\n constructor(params: Partial<MiniErrorParams>) {\n super({message: 'Network Error', ...params})\n this.name = 'MiniNetworkError'\n }\n}\n\nexport class MiniEntityNotFoundError extends MiniError {\n constructor(params: Partial<MiniErrorParams>) {\n super({message: 'Entity Not Found', ...params})\n this.name = 'MiniEntityNotFoundError'\n }\n}\n\nexport const formatError = (\n source: MiniErrorSource,\n error: any\n): MiniError | MiniNetworkError | null => {\n if (!error) {\n return null\n }\n\n if (error.networkError) {\n return new MiniNetworkError({\n ...source,\n message: error.networkError?.message,\n })\n }\n\n if (error.code) {\n return new MiniError({\n ...source,\n message: `${error.code}${error.message ? `: ${error.message}` : ''}`,\n })\n }\n\n return new MiniError({\n ...source,\n message: error?.message,\n })\n}\n"],"names":["MiniError","component","hook","func","callback","message","formattedMessage","MiniNetworkError","params","MiniEntityNotFoundError","formatError","source","error"],"mappings":"AAcO,MAAMA,UAAkB,MAAM;AAAA,EACnC,YAAY;AAAA,IACV,WAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,EAAA,GACQ;AAClB,QAAIC,IAAmBD;AAEnB,KAAAJ,KAAaC,KAAQC,OACnBF,IACFK,IAAmB,IAAIL,CAAS,QACvBC,IACUI,IAAAJ,IACVC,MACTG,IAAmB,GAAGH,CAAI,OAGxBC,MACiBE,IAAA,GAAGA,CAAgB,IAAIF,CAAQ,OAGjCE,IAAA,GAAGA,CAAgB,KAAKD,CAAO,KAGpD,MAAMC,CAAgB,GACtB,KAAK,OAAO;AAAA,EAAA;AAEhB;AAEO,MAAMC,UAAyBP,EAAU;AAAA,EAC9C,YAAYQ,GAAkC;AAC5C,UAAM,EAAC,SAAS,iBAAiB,GAAGA,GAAO,GAC3C,KAAK,OAAO;AAAA,EAAA;AAEhB;AAEO,MAAMC,UAAgCT,EAAU;AAAA,EACrD,YAAYQ,GAAkC;AAC5C,UAAM,EAAC,SAAS,oBAAoB,GAAGA,GAAO,GAC9C,KAAK,OAAO;AAAA,EAAA;AAEhB;AAEa,MAAAE,IAAc,CACzBC,GACAC,MAEKA,IAIDA,EAAM,eACD,IAAIL,EAAiB;AAAA,EAC1B,GAAGI;AAAA,EACH,SAASC,EAAM,cAAc;AAAA,CAC9B,IAGCA,EAAM,OACD,IAAIZ,EAAU;AAAA,EACnB,GAAGW;AAAA,EACH,SAAS,GAAGC,EAAM,IAAI,GAAGA,EAAM,UAAU,KAAKA,EAAM,OAAO,KAAK,EAAE;AAAA,CACnE,IAGI,IAAIZ,EAAU;AAAA,EACnB,GAAGW;AAAA,EACH,SAASC,GAAO;AAAA,CACjB,IApBQ;"}
@@ -0,0 +1,8 @@
1
+ import e from "../_virtual/index.js";
2
+ function o(r) {
3
+ return e(r, !0);
4
+ }
5
+ export {
6
+ o as parseUrl
7
+ };
8
+ //# sourceMappingURL=parseUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseUrl.js","sources":["../../src/utils/parseUrl.ts"],"sourcesContent":["import urlParse from 'url-parse'\n\nexport function parseUrl(url: string) {\n return urlParse(url, true)\n}\n"],"names":["parseUrl","url","urlParse"],"mappings":";AAEO,SAASA,EAASC,GAAa;AAC7B,SAAAC,EAASD,GAAK,EAAI;AAC3B;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shopify/shop-minis-react",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "engines": {
@@ -17,20 +17,21 @@
17
17
  "types": "src/index.ts",
18
18
  "files": [
19
19
  "src/**/*.{ts,tsx,css}",
20
+ "dist/**/*",
21
+ "tailwind.config.js",
20
22
  "README.md",
21
23
  "LICENSE.txt"
22
24
  ],
23
25
  "exports": {
24
26
  ".": {
27
+ "source": "./src/index.ts",
25
28
  "import": "./src/index.ts",
26
29
  "types": "./src/index.ts"
27
30
  },
28
- "./tailwind": {
29
- "default": "./src/tailwind-theme.css"
30
- },
31
- "./styles": {
32
- "default": "./src/index.css"
33
- }
31
+ "./styles": "./src/index.css",
32
+ "./tailwind": "./tailwind.config.js",
33
+ "./tailwind.config": "./tailwind.config.js",
34
+ "./src/*": "./src/*"
34
35
  },
35
36
  "peerDependencies": {
36
37
  "react": ">=18.2.0",
@@ -39,20 +40,31 @@
39
40
  "typescript": ">=5.0.0"
40
41
  },
41
42
  "dependencies": {
42
- "clsx": "^2.1.0",
43
- "tailwind-merge": "^2.2.0"
43
+ "@radix-ui/react-alert-dialog": "^1.1.14",
44
+ "@radix-ui/react-slot": "^1.2.3",
45
+ "@tailwindcss/vite": "^4.1.8",
46
+ "@types/url-parse": "1.4.9",
47
+ "@vitejs/plugin-react": "^4.2.1",
48
+ "class-variance-authority": "^0.7.1",
49
+ "clsx": "^2.1.1",
50
+ "lucide-react": "^0.513.0",
51
+ "next-themes": "^0.4.6",
52
+ "sonner": "^2.0.5",
53
+ "tailwindcss": "^4.1.8",
54
+ "tailwind-merge": "^2.5.2",
55
+ "tw-animate-css": "^1.3.4",
56
+ "url-parse": "1.5.10"
44
57
  },
45
58
  "devDependencies": {
46
- "@tailwindcss/vite": "^4.1.8",
59
+ "@shopify/generate-docs": "^0.16.6",
47
60
  "@types/node": "^20.12.1",
48
61
  "@types/react": "^19.1.2",
49
62
  "@types/react-dom": "^19.1.2",
50
- "@vitejs/plugin-react": "^4.2.1",
51
63
  "react": "^19.1.0",
52
64
  "react-dom": "^19.1.0",
53
- "tailwindcss": "^4.1.8",
54
65
  "typescript": "^5.8.3",
55
- "vite": "^6.3.3"
66
+ "vite": "^6.3.3",
67
+ "vite-plugin-dts": "^4.3.0"
56
68
  },
57
69
  "keywords": [
58
70
  "react",
@@ -74,6 +86,9 @@
74
86
  },
75
87
  "scripts": {
76
88
  "dev": "vite",
77
- "type-check": "tsc --noEmit"
89
+ "build": "vite build --mode lib",
90
+ "build:watch": "vite build --mode lib --watch",
91
+ "type-check": "tsc --noEmit",
92
+ "clean": "rm -rf dist"
78
93
  }
79
94
  }
@@ -1,7 +1,4 @@
1
- // Export all components here
2
- // Example: export { Button } from './Button';
3
- // Example: export { Card } from './Card';
4
-
5
- // This file will be populated as components are added
6
-
7
- export * from './HelloWorld'
1
+ export * from './ui/button'
2
+ export * from './ui/card'
3
+ export * from './ui/alert-dialog'
4
+ export * from './ui/sonner'
@@ -0,0 +1,151 @@
1
+ import * as React from 'react'
2
+
3
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
4
+
5
+ import {cn} from '../../lib/utils'
6
+
7
+ import {buttonVariants} from './button'
8
+
9
+ function AlertDialog({
10
+ ...props
11
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
12
+ return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
13
+ }
14
+
15
+ function AlertDialogTrigger({
16
+ ...props
17
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
18
+ return (
19
+ <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
20
+ )
21
+ }
22
+
23
+ function AlertDialogPortal({
24
+ ...props
25
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
26
+ return (
27
+ <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
28
+ )
29
+ }
30
+
31
+ function AlertDialogOverlay({
32
+ className,
33
+ ...props
34
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
35
+ return (
36
+ <AlertDialogPrimitive.Overlay
37
+ data-slot="alert-dialog-overlay"
38
+ className={cn(
39
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ function AlertDialogContent({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
51
+ return (
52
+ <AlertDialogPortal>
53
+ <AlertDialogOverlay />
54
+ <AlertDialogPrimitive.Content
55
+ data-slot="alert-dialog-content"
56
+ className={cn(
57
+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
58
+ className
59
+ )}
60
+ {...props}
61
+ />
62
+ </AlertDialogPortal>
63
+ )
64
+ }
65
+
66
+ function AlertDialogHeader({className, ...props}: React.ComponentProps<'div'>) {
67
+ return (
68
+ <div
69
+ data-slot="alert-dialog-header"
70
+ className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
71
+ {...props}
72
+ />
73
+ )
74
+ }
75
+
76
+ function AlertDialogFooter({className, ...props}: React.ComponentProps<'div'>) {
77
+ return (
78
+ <div
79
+ data-slot="alert-dialog-footer"
80
+ className={cn(
81
+ 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
82
+ className
83
+ )}
84
+ {...props}
85
+ />
86
+ )
87
+ }
88
+
89
+ function AlertDialogTitle({
90
+ className,
91
+ ...props
92
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
93
+ return (
94
+ <AlertDialogPrimitive.Title
95
+ data-slot="alert-dialog-title"
96
+ className={cn('text-lg font-semibold', className)}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ function AlertDialogDescription({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
106
+ return (
107
+ <AlertDialogPrimitive.Description
108
+ data-slot="alert-dialog-description"
109
+ className={cn('text-muted-foreground text-sm', className)}
110
+ {...props}
111
+ />
112
+ )
113
+ }
114
+
115
+ function AlertDialogAction({
116
+ className,
117
+ ...props
118
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
119
+ return (
120
+ <AlertDialogPrimitive.Action
121
+ className={cn(buttonVariants(), className)}
122
+ {...props}
123
+ />
124
+ )
125
+ }
126
+
127
+ function AlertDialogCancel({
128
+ className,
129
+ ...props
130
+ }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
131
+ return (
132
+ <AlertDialogPrimitive.Cancel
133
+ className={cn(buttonVariants({variant: 'outline'}), className)}
134
+ {...props}
135
+ />
136
+ )
137
+ }
138
+
139
+ export {
140
+ AlertDialog,
141
+ AlertDialogPortal,
142
+ AlertDialogOverlay,
143
+ AlertDialogTrigger,
144
+ AlertDialogContent,
145
+ AlertDialogHeader,
146
+ AlertDialogFooter,
147
+ AlertDialogTitle,
148
+ AlertDialogDescription,
149
+ AlertDialogAction,
150
+ AlertDialogCancel,
151
+ }