@shopify/shop-minis-react 0.3.4 → 0.4.0

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 (167) hide show
  1. package/dist/components/MinisContainer.js +11 -10
  2. package/dist/components/MinisContainer.js.map +1 -1
  3. package/dist/hooks/content/useContent.js +12 -18
  4. package/dist/hooks/content/useContent.js.map +1 -1
  5. package/dist/hooks/product/useCuratedProducts.js +9 -11
  6. package/dist/hooks/product/useCuratedProducts.js.map +1 -1
  7. package/dist/hooks/product/usePopularProducts.js +9 -11
  8. package/dist/hooks/product/usePopularProducts.js.map +1 -1
  9. package/dist/hooks/product/useProduct.js +11 -17
  10. package/dist/hooks/product/useProduct.js.map +1 -1
  11. package/dist/hooks/product/useProductList.js +10 -21
  12. package/dist/hooks/product/useProductList.js.map +1 -1
  13. package/dist/hooks/product/useProductLists.js +11 -13
  14. package/dist/hooks/product/useProductLists.js.map +1 -1
  15. package/dist/hooks/product/useProductMedia.js +12 -18
  16. package/dist/hooks/product/useProductMedia.js.map +1 -1
  17. package/dist/hooks/product/useProductSearch.js +34 -27
  18. package/dist/hooks/product/useProductSearch.js.map +1 -1
  19. package/dist/hooks/product/useProductVariants.js +11 -14
  20. package/dist/hooks/product/useProductVariants.js.map +1 -1
  21. package/dist/hooks/product/useProducts.js +12 -11
  22. package/dist/hooks/product/useProducts.js.map +1 -1
  23. package/dist/hooks/product/useRecommendedProducts.js +11 -13
  24. package/dist/hooks/product/useRecommendedProducts.js.map +1 -1
  25. package/dist/hooks/shop/useRecommendedShops.js +11 -13
  26. package/dist/hooks/shop/useRecommendedShops.js.map +1 -1
  27. package/dist/hooks/shop/useShop.js +12 -11
  28. package/dist/hooks/shop/useShop.js.map +1 -1
  29. package/dist/hooks/user/useBuyerAttributes.js +8 -10
  30. package/dist/hooks/user/useBuyerAttributes.js.map +1 -1
  31. package/dist/hooks/user/useCurrentUser.js +7 -9
  32. package/dist/hooks/user/useCurrentUser.js.map +1 -1
  33. package/dist/hooks/user/useFollowedShops.js +11 -14
  34. package/dist/hooks/user/useFollowedShops.js.map +1 -1
  35. package/dist/hooks/user/useOrders.js +7 -9
  36. package/dist/hooks/user/useOrders.js.map +1 -1
  37. package/dist/hooks/user/useRecentProducts.js +11 -13
  38. package/dist/hooks/user/useRecentProducts.js.map +1 -1
  39. package/dist/hooks/user/useRecentShops.js +10 -13
  40. package/dist/hooks/user/useRecentShops.js.map +1 -1
  41. package/dist/hooks/user/useSavedProducts.js +10 -13
  42. package/dist/hooks/user/useSavedProducts.js.map +1 -1
  43. package/dist/internal/reactQuery/MinisQueryProvider.js +11 -0
  44. package/dist/internal/reactQuery/MinisQueryProvider.js.map +1 -0
  45. package/dist/internal/reactQuery/queryClient.js +33 -0
  46. package/dist/internal/reactQuery/queryClient.js.map +1 -0
  47. package/dist/internal/reactQuery/useShopActionInfiniteQuery.js +52 -0
  48. package/dist/internal/reactQuery/useShopActionInfiniteQuery.js.map +1 -0
  49. package/dist/internal/reactQuery/useShopActionQuery.js +37 -0
  50. package/dist/internal/reactQuery/useShopActionQuery.js.map +1 -0
  51. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/focusManager.js +45 -0
  52. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -0
  53. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js +89 -0
  54. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +1 -0
  55. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js +55 -0
  56. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map +1 -0
  57. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutation.js +198 -0
  58. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutation.js.map +1 -0
  59. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js +99 -0
  60. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +1 -0
  61. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js +67 -0
  62. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -0
  63. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js +39 -0
  64. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -0
  65. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/query.js +299 -0
  66. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -0
  67. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryCache.js +80 -0
  68. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +1 -0
  69. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryClient.js +215 -0
  70. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +1 -0
  71. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryObserver.js +300 -0
  72. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -0
  73. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/removable.js +25 -0
  74. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/removable.js.map +1 -0
  75. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/retryer.js +76 -0
  76. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -0
  77. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/subscribable.js +21 -0
  78. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +1 -0
  79. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/thenable.js +26 -0
  80. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/thenable.js.map +1 -0
  81. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/utils.js +176 -0
  82. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -0
  83. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js +7 -0
  84. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map +1 -0
  85. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +17 -0
  86. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +1 -0
  87. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js +19 -0
  88. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +1 -0
  89. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +21 -0
  90. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -0
  91. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/suspense.js +18 -0
  92. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -0
  93. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +64 -0
  94. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -0
  95. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js +13 -0
  96. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map +1 -0
  97. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQuery.js +9 -0
  98. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQuery.js.map +1 -0
  99. package/package.json +2 -7
  100. package/src/components/MinisContainer.tsx +6 -3
  101. package/src/hooks/content/useContent.ts +6 -17
  102. package/src/hooks/product/useCuratedProducts.ts +4 -6
  103. package/src/hooks/product/usePopularProducts.ts +4 -6
  104. package/src/hooks/product/useProduct.ts +6 -17
  105. package/src/hooks/product/useProductList.ts +4 -19
  106. package/src/hooks/product/useProductLists.ts +4 -6
  107. package/src/hooks/product/useProductMedia.ts +6 -17
  108. package/src/hooks/product/useProductSearch.ts +19 -15
  109. package/src/hooks/product/useProductVariants.ts +5 -13
  110. package/src/hooks/product/useProducts.ts +8 -12
  111. package/src/hooks/product/useRecommendedProducts.ts +4 -6
  112. package/src/hooks/shop/useRecommendedShops.ts +4 -6
  113. package/src/hooks/shop/useShop.ts +8 -12
  114. package/src/hooks/user/useBuyerAttributes.ts +4 -6
  115. package/src/hooks/user/useCurrentUser.ts +4 -6
  116. package/src/hooks/user/useFollowedShops.ts +5 -13
  117. package/src/hooks/user/useOrders.ts +4 -6
  118. package/src/hooks/user/useRecentProducts.ts +4 -6
  119. package/src/hooks/user/useRecentShops.ts +5 -13
  120. package/src/hooks/user/useSavedProducts.ts +5 -13
  121. package/src/internal/reactQuery/MinisQueryProvider.test.tsx +38 -0
  122. package/src/internal/reactQuery/MinisQueryProvider.tsx +16 -0
  123. package/src/internal/reactQuery/index.ts +8 -0
  124. package/src/internal/reactQuery/queryClient.test.tsx +91 -0
  125. package/src/internal/reactQuery/queryClient.ts +43 -0
  126. package/src/internal/reactQuery/useShopActionInfiniteQuery.test.tsx +357 -0
  127. package/src/internal/reactQuery/useShopActionInfiniteQuery.ts +129 -0
  128. package/src/internal/reactQuery/useShopActionQuery.test.tsx +184 -0
  129. package/src/internal/reactQuery/useShopActionQuery.ts +74 -0
  130. package/dist/internal/useShopActionsDataFetching.js +0 -79
  131. package/dist/internal/useShopActionsDataFetching.js.map +0 -1
  132. package/dist/internal/useShopActionsPaginatedDataFetching.js +0 -96
  133. package/dist/internal/useShopActionsPaginatedDataFetching.js.map +0 -1
  134. package/src/hooks/product/useProductSearch.test.ts +0 -470
  135. package/src/internal/useShopActionsDataFetching.test.ts +0 -465
  136. package/src/internal/useShopActionsDataFetching.ts +0 -150
  137. package/src/internal/useShopActionsPaginatedDataFetching.ts +0 -188
  138. package/src/stories/Accordion.stories.tsx +0 -124
  139. package/src/stories/AddToCart.stories.tsx +0 -251
  140. package/src/stories/Alert.stories.tsx +0 -38
  141. package/src/stories/AlertDialog.stories.tsx +0 -48
  142. package/src/stories/Avatar.stories.tsx +0 -29
  143. package/src/stories/Badge.stories.tsx +0 -46
  144. package/src/stories/Button.stories.tsx +0 -81
  145. package/src/stories/Card.stories.tsx +0 -40
  146. package/src/stories/Checkbox.stories.tsx +0 -44
  147. package/src/stories/FavoriteButton.stories.tsx +0 -58
  148. package/src/stories/IconButton.stories.tsx +0 -68
  149. package/src/stories/ImageContentWrapper.stories.tsx +0 -65
  150. package/src/stories/Input.stories.tsx +0 -44
  151. package/src/stories/Label.stories.tsx +0 -19
  152. package/src/stories/List.stories.tsx +0 -64
  153. package/src/stories/MerchantCard.stories.tsx +0 -127
  154. package/src/stories/ProductCard.stories.tsx +0 -92
  155. package/src/stories/ProductLink.stories.tsx +0 -46
  156. package/src/stories/ProductVariantPrice.stories.tsx +0 -70
  157. package/src/stories/Progress.stories.tsx +0 -30
  158. package/src/stories/PullToRefreshList.stories.tsx +0 -122
  159. package/src/stories/QuantitySelector.stories.tsx +0 -78
  160. package/src/stories/RadioGroup.stories.tsx +0 -51
  161. package/src/stories/Search.stories.tsx +0 -37
  162. package/src/stories/Select.stories.tsx +0 -85
  163. package/src/stories/Skeleton.stories.tsx +0 -19
  164. package/src/stories/TextInput.stories.tsx +0 -26
  165. package/src/stories/Toaster.stories.tsx +0 -46
  166. package/src/stories/Touchable.stories.tsx +0 -40
  167. package/src/stories/VideoPlayer.stories.tsx +0 -129
@@ -1,40 +0,0 @@
1
- import {fn} from 'storybook/test'
2
-
3
- import {Touchable} from '../components/atoms/touchable'
4
-
5
- import type {Meta, StoryObj} from '@storybook/react-vite'
6
-
7
- const meta = {
8
- title: 'Atoms/Touchable',
9
- component: Touchable,
10
- parameters: {},
11
- tags: ['autodocs'],
12
- argTypes: {
13
- stopPropagation: {
14
- control: 'boolean',
15
- },
16
- },
17
- args: {
18
- onClick: fn(),
19
- stopPropagation: false,
20
- },
21
- } satisfies Meta<typeof Touchable>
22
-
23
- export default meta
24
- type Story = StoryObj<typeof meta>
25
-
26
- export const Default: Story = {
27
- args: {
28
- children: <div>Click me</div>,
29
- },
30
- }
31
-
32
- export const WithStyledChild: Story = {
33
- args: {
34
- children: (
35
- <div className="bg-secondary text-white p-4 rounded-md cursor-pointer hover:bg-secondary/90 transition-colors">
36
- Custom styled touchable
37
- </div>
38
- ),
39
- },
40
- }
@@ -1,129 +0,0 @@
1
- import {useRef} from 'react'
2
-
3
- import {fn} from 'storybook/test'
4
-
5
- import {VideoPlayer, VideoPlayerRef} from '../components/atoms/video-player'
6
-
7
- import type {Meta, StoryObj} from '@storybook/react-vite'
8
-
9
- const meta: Meta<typeof VideoPlayer> = {
10
- title: 'Atoms/VideoPlayer',
11
- component: VideoPlayer,
12
- parameters: {
13
- layout: 'padded',
14
- },
15
- args: {
16
- onPlay: fn(),
17
- onPause: fn(),
18
- onEnded: fn(),
19
- onReady: fn(),
20
- },
21
- argTypes: {
22
- src: {
23
- control: 'text',
24
- },
25
- format: {
26
- control: 'select',
27
- options: ['video/mp4', 'video/webm', 'video/ogg'],
28
- },
29
- poster: {
30
- control: 'text',
31
- },
32
- width: {
33
- control: 'number',
34
- },
35
- height: {
36
- control: 'number',
37
- },
38
- muted: {
39
- control: 'boolean',
40
- },
41
- autoplay: {
42
- control: 'boolean',
43
- },
44
- playButtonComponent: {
45
- control: 'text',
46
- },
47
- },
48
- tags: ['autodocs'],
49
- }
50
-
51
- export default meta
52
- type Story = StoryObj<typeof meta>
53
-
54
- const SAMPLE_VIDEO_MP4 =
55
- 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
56
- const SAMPLE_POSTER =
57
- 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg'
58
-
59
- export const FixedWidth: Story = {
60
- args: {
61
- src: SAMPLE_VIDEO_MP4,
62
- width: 300,
63
- },
64
- }
65
-
66
- export const FixedHeight: Story = {
67
- args: {
68
- src: SAMPLE_VIDEO_MP4,
69
- height: 200,
70
- },
71
- }
72
-
73
- export const WithPoster: Story = {
74
- args: {
75
- src: SAMPLE_VIDEO_MP4,
76
- poster: SAMPLE_POSTER,
77
- width: 300,
78
- },
79
- }
80
-
81
- export const WithCustomPlayButton: Story = {
82
- args: {
83
- src: SAMPLE_VIDEO_MP4,
84
- poster: SAMPLE_POSTER,
85
- width: 300,
86
- playButtonComponent: (
87
- <div className="bg-blue-500 text-white rounded-full p-4 shadow-lg">
88
- <svg viewBox="0 0 24 24" className="w-8 h-8" fill="currentColor">
89
- <path d="M8 5v14l11-7z" />
90
- </svg>
91
- </div>
92
- ),
93
- },
94
- }
95
-
96
- const WithImperativeControlsComponent = (args: any) => {
97
- const videoRef = useRef<VideoPlayerRef>(null)
98
-
99
- return (
100
- <div className="space-y-4 flex flex-col items-center">
101
- <VideoPlayer ref={videoRef} {...args} />
102
- <div className="flex gap-2">
103
- <button
104
- type="button"
105
- className="px-4 py-2 bg-primary text-white rounded"
106
- onClick={() => videoRef.current?.play()}
107
- >
108
- Play
109
- </button>
110
- <button
111
- type="button"
112
- className="px-4 py-2 bg-red-400 text-white rounded"
113
- onClick={() => videoRef.current?.pause()}
114
- >
115
- Pause
116
- </button>
117
- </div>
118
- </div>
119
- )
120
- }
121
-
122
- export const WithImperativeControls: Story = {
123
- render: WithImperativeControlsComponent,
124
- args: {
125
- src: SAMPLE_VIDEO_MP4,
126
- poster: SAMPLE_POSTER,
127
- width: 300,
128
- },
129
- }