@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.
- package/dist/components/MinisContainer.js +11 -10
- package/dist/components/MinisContainer.js.map +1 -1
- package/dist/hooks/content/useContent.js +12 -18
- package/dist/hooks/content/useContent.js.map +1 -1
- package/dist/hooks/product/useCuratedProducts.js +9 -11
- package/dist/hooks/product/useCuratedProducts.js.map +1 -1
- package/dist/hooks/product/usePopularProducts.js +9 -11
- package/dist/hooks/product/usePopularProducts.js.map +1 -1
- package/dist/hooks/product/useProduct.js +11 -17
- package/dist/hooks/product/useProduct.js.map +1 -1
- package/dist/hooks/product/useProductList.js +10 -21
- package/dist/hooks/product/useProductList.js.map +1 -1
- package/dist/hooks/product/useProductLists.js +11 -13
- package/dist/hooks/product/useProductLists.js.map +1 -1
- package/dist/hooks/product/useProductMedia.js +12 -18
- package/dist/hooks/product/useProductMedia.js.map +1 -1
- package/dist/hooks/product/useProductSearch.js +34 -27
- package/dist/hooks/product/useProductSearch.js.map +1 -1
- package/dist/hooks/product/useProductVariants.js +11 -14
- package/dist/hooks/product/useProductVariants.js.map +1 -1
- package/dist/hooks/product/useProducts.js +12 -11
- package/dist/hooks/product/useProducts.js.map +1 -1
- package/dist/hooks/product/useRecommendedProducts.js +11 -13
- package/dist/hooks/product/useRecommendedProducts.js.map +1 -1
- package/dist/hooks/shop/useRecommendedShops.js +11 -13
- package/dist/hooks/shop/useRecommendedShops.js.map +1 -1
- package/dist/hooks/shop/useShop.js +12 -11
- package/dist/hooks/shop/useShop.js.map +1 -1
- package/dist/hooks/user/useBuyerAttributes.js +8 -10
- package/dist/hooks/user/useBuyerAttributes.js.map +1 -1
- package/dist/hooks/user/useCurrentUser.js +7 -9
- package/dist/hooks/user/useCurrentUser.js.map +1 -1
- package/dist/hooks/user/useFollowedShops.js +11 -14
- package/dist/hooks/user/useFollowedShops.js.map +1 -1
- package/dist/hooks/user/useOrders.js +7 -9
- package/dist/hooks/user/useOrders.js.map +1 -1
- package/dist/hooks/user/useRecentProducts.js +11 -13
- package/dist/hooks/user/useRecentProducts.js.map +1 -1
- package/dist/hooks/user/useRecentShops.js +10 -13
- package/dist/hooks/user/useRecentShops.js.map +1 -1
- package/dist/hooks/user/useSavedProducts.js +10 -13
- package/dist/hooks/user/useSavedProducts.js.map +1 -1
- package/dist/internal/reactQuery/MinisQueryProvider.js +11 -0
- package/dist/internal/reactQuery/MinisQueryProvider.js.map +1 -0
- package/dist/internal/reactQuery/queryClient.js +33 -0
- package/dist/internal/reactQuery/queryClient.js.map +1 -0
- package/dist/internal/reactQuery/useShopActionInfiniteQuery.js +52 -0
- package/dist/internal/reactQuery/useShopActionInfiniteQuery.js.map +1 -0
- package/dist/internal/reactQuery/useShopActionQuery.js +37 -0
- package/dist/internal/reactQuery/useShopActionQuery.js.map +1 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/package.json +2 -7
- package/src/components/MinisContainer.tsx +6 -3
- package/src/hooks/content/useContent.ts +6 -17
- package/src/hooks/product/useCuratedProducts.ts +4 -6
- package/src/hooks/product/usePopularProducts.ts +4 -6
- package/src/hooks/product/useProduct.ts +6 -17
- package/src/hooks/product/useProductList.ts +4 -19
- package/src/hooks/product/useProductLists.ts +4 -6
- package/src/hooks/product/useProductMedia.ts +6 -17
- package/src/hooks/product/useProductSearch.ts +19 -15
- package/src/hooks/product/useProductVariants.ts +5 -13
- package/src/hooks/product/useProducts.ts +8 -12
- package/src/hooks/product/useRecommendedProducts.ts +4 -6
- package/src/hooks/shop/useRecommendedShops.ts +4 -6
- package/src/hooks/shop/useShop.ts +8 -12
- package/src/hooks/user/useBuyerAttributes.ts +4 -6
- package/src/hooks/user/useCurrentUser.ts +4 -6
- package/src/hooks/user/useFollowedShops.ts +5 -13
- package/src/hooks/user/useOrders.ts +4 -6
- package/src/hooks/user/useRecentProducts.ts +4 -6
- package/src/hooks/user/useRecentShops.ts +5 -13
- package/src/hooks/user/useSavedProducts.ts +5 -13
- package/src/internal/reactQuery/MinisQueryProvider.test.tsx +38 -0
- package/src/internal/reactQuery/MinisQueryProvider.tsx +16 -0
- package/src/internal/reactQuery/index.ts +8 -0
- package/src/internal/reactQuery/queryClient.test.tsx +91 -0
- package/src/internal/reactQuery/queryClient.ts +43 -0
- package/src/internal/reactQuery/useShopActionInfiniteQuery.test.tsx +357 -0
- package/src/internal/reactQuery/useShopActionInfiniteQuery.ts +129 -0
- package/src/internal/reactQuery/useShopActionQuery.test.tsx +184 -0
- package/src/internal/reactQuery/useShopActionQuery.ts +74 -0
- package/dist/internal/useShopActionsDataFetching.js +0 -79
- package/dist/internal/useShopActionsDataFetching.js.map +0 -1
- package/dist/internal/useShopActionsPaginatedDataFetching.js +0 -96
- package/dist/internal/useShopActionsPaginatedDataFetching.js.map +0 -1
- package/src/hooks/product/useProductSearch.test.ts +0 -470
- package/src/internal/useShopActionsDataFetching.test.ts +0 -465
- package/src/internal/useShopActionsDataFetching.ts +0 -150
- package/src/internal/useShopActionsPaginatedDataFetching.ts +0 -188
- package/src/stories/Accordion.stories.tsx +0 -124
- package/src/stories/AddToCart.stories.tsx +0 -251
- package/src/stories/Alert.stories.tsx +0 -38
- package/src/stories/AlertDialog.stories.tsx +0 -48
- package/src/stories/Avatar.stories.tsx +0 -29
- package/src/stories/Badge.stories.tsx +0 -46
- package/src/stories/Button.stories.tsx +0 -81
- package/src/stories/Card.stories.tsx +0 -40
- package/src/stories/Checkbox.stories.tsx +0 -44
- package/src/stories/FavoriteButton.stories.tsx +0 -58
- package/src/stories/IconButton.stories.tsx +0 -68
- package/src/stories/ImageContentWrapper.stories.tsx +0 -65
- package/src/stories/Input.stories.tsx +0 -44
- package/src/stories/Label.stories.tsx +0 -19
- package/src/stories/List.stories.tsx +0 -64
- package/src/stories/MerchantCard.stories.tsx +0 -127
- package/src/stories/ProductCard.stories.tsx +0 -92
- package/src/stories/ProductLink.stories.tsx +0 -46
- package/src/stories/ProductVariantPrice.stories.tsx +0 -70
- package/src/stories/Progress.stories.tsx +0 -30
- package/src/stories/PullToRefreshList.stories.tsx +0 -122
- package/src/stories/QuantitySelector.stories.tsx +0 -78
- package/src/stories/RadioGroup.stories.tsx +0 -51
- package/src/stories/Search.stories.tsx +0 -37
- package/src/stories/Select.stories.tsx +0 -85
- package/src/stories/Skeleton.stories.tsx +0 -19
- package/src/stories/TextInput.stories.tsx +0 -26
- package/src/stories/Toaster.stories.tsx +0 -46
- package/src/stories/Touchable.stories.tsx +0 -40
- package/src/stories/VideoPlayer.stories.tsx +0 -129
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {Badge} from '../components/ui/badge'
|
|
2
|
-
|
|
3
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'UI/Badge',
|
|
7
|
-
component: Badge,
|
|
8
|
-
parameters: {},
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
control: 'radio',
|
|
13
|
-
options: ['default', 'secondary', 'destructive', 'outline'],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
} satisfies Meta<typeof Badge>
|
|
17
|
-
|
|
18
|
-
export default meta
|
|
19
|
-
type Story = StoryObj<typeof meta>
|
|
20
|
-
|
|
21
|
-
export const Default: Story = {
|
|
22
|
-
args: {
|
|
23
|
-
children: 'Badge',
|
|
24
|
-
},
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const Secondary: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
variant: 'secondary',
|
|
30
|
-
children: 'Badge',
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const Destructive: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
variant: 'destructive',
|
|
37
|
-
children: 'Badge',
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const Outline: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
variant: 'outline',
|
|
44
|
-
children: 'Badge',
|
|
45
|
-
},
|
|
46
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {fn} from 'storybook/test'
|
|
2
|
-
|
|
3
|
-
import {Button} from '../components/atoms/button'
|
|
4
|
-
|
|
5
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
6
|
-
|
|
7
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Atoms/Button',
|
|
10
|
-
component: Button,
|
|
11
|
-
parameters: {},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
-
tags: ['autodocs'],
|
|
14
|
-
argTypes: {
|
|
15
|
-
variant: {
|
|
16
|
-
control: 'radio',
|
|
17
|
-
options: [
|
|
18
|
-
'default',
|
|
19
|
-
'secondary',
|
|
20
|
-
'tertiary',
|
|
21
|
-
'outline',
|
|
22
|
-
'ghost',
|
|
23
|
-
'link',
|
|
24
|
-
'destructive',
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
args: {onClick: fn()},
|
|
29
|
-
} satisfies Meta<typeof Button>
|
|
30
|
-
|
|
31
|
-
export default meta
|
|
32
|
-
type Story = StoryObj<typeof meta>
|
|
33
|
-
|
|
34
|
-
export const Default: Story = {
|
|
35
|
-
args: {
|
|
36
|
-
variant: 'default',
|
|
37
|
-
children: 'Button',
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const Secondary: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
variant: 'secondary',
|
|
44
|
-
children: 'Button',
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const Tertiary: Story = {
|
|
49
|
-
args: {
|
|
50
|
-
variant: 'tertiary',
|
|
51
|
-
children: 'Button',
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const Outline: Story = {
|
|
56
|
-
args: {
|
|
57
|
-
variant: 'outline',
|
|
58
|
-
children: 'Button',
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const Ghost: Story = {
|
|
63
|
-
args: {
|
|
64
|
-
variant: 'ghost',
|
|
65
|
-
children: 'Button',
|
|
66
|
-
},
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export const Link: Story = {
|
|
70
|
-
args: {
|
|
71
|
-
variant: 'link',
|
|
72
|
-
children: 'Button',
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const Destructive: Story = {
|
|
77
|
-
args: {
|
|
78
|
-
variant: 'destructive',
|
|
79
|
-
children: 'Button',
|
|
80
|
-
},
|
|
81
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {Button} from '../components/atoms/button'
|
|
2
|
-
import {
|
|
3
|
-
Card,
|
|
4
|
-
CardHeader,
|
|
5
|
-
CardFooter,
|
|
6
|
-
CardTitle,
|
|
7
|
-
CardAction,
|
|
8
|
-
CardDescription,
|
|
9
|
-
CardContent,
|
|
10
|
-
} from '../components/ui/card'
|
|
11
|
-
|
|
12
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
13
|
-
|
|
14
|
-
const meta = {
|
|
15
|
-
title: 'UI/Card',
|
|
16
|
-
render: () => (
|
|
17
|
-
<Card>
|
|
18
|
-
<CardHeader>
|
|
19
|
-
<CardTitle>Card Title</CardTitle>
|
|
20
|
-
<CardDescription>Card description goes here</CardDescription>
|
|
21
|
-
<CardAction>
|
|
22
|
-
<Button>Action</Button>
|
|
23
|
-
</CardAction>
|
|
24
|
-
</CardHeader>
|
|
25
|
-
<CardContent>
|
|
26
|
-
<p>This is the main content of the card.</p>
|
|
27
|
-
</CardContent>
|
|
28
|
-
<CardFooter>
|
|
29
|
-
<p>Card footer content</p>
|
|
30
|
-
</CardFooter>
|
|
31
|
-
</Card>
|
|
32
|
-
),
|
|
33
|
-
parameters: {},
|
|
34
|
-
tags: ['autodocs'],
|
|
35
|
-
} satisfies Meta<typeof Card>
|
|
36
|
-
|
|
37
|
-
export default meta
|
|
38
|
-
type Story = StoryObj<typeof meta>
|
|
39
|
-
|
|
40
|
-
export const Default: Story = {}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {Checkbox} from '../components/ui/checkbox'
|
|
2
|
-
|
|
3
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'UI/Checkbox',
|
|
7
|
-
component: Checkbox,
|
|
8
|
-
parameters: {},
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
argTypes: {
|
|
11
|
-
checked: {
|
|
12
|
-
control: 'boolean',
|
|
13
|
-
},
|
|
14
|
-
disabled: {
|
|
15
|
-
control: 'boolean',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
} satisfies Meta<typeof Checkbox>
|
|
19
|
-
|
|
20
|
-
export default meta
|
|
21
|
-
type Story = StoryObj<typeof meta>
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {
|
|
24
|
-
args: {},
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const Checked: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
checked: true,
|
|
30
|
-
},
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const Disabled: Story = {
|
|
34
|
-
args: {
|
|
35
|
-
disabled: true,
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const DisabledChecked: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
disabled: true,
|
|
42
|
-
checked: true,
|
|
43
|
-
},
|
|
44
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {fn} from 'storybook/test'
|
|
2
|
-
|
|
3
|
-
import {FavoriteButton} from '../components/commerce/favorite-button'
|
|
4
|
-
|
|
5
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Commerce/FavoriteButton',
|
|
9
|
-
component: FavoriteButton,
|
|
10
|
-
parameters: {},
|
|
11
|
-
tags: ['autodocs'],
|
|
12
|
-
argTypes: {
|
|
13
|
-
filled: {
|
|
14
|
-
control: 'boolean',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
onClick: fn(),
|
|
19
|
-
filled: false,
|
|
20
|
-
},
|
|
21
|
-
} satisfies Meta<typeof FavoriteButton>
|
|
22
|
-
|
|
23
|
-
export default meta
|
|
24
|
-
type Story = StoryObj<typeof meta>
|
|
25
|
-
|
|
26
|
-
export const Favorited: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
filled: true,
|
|
29
|
-
onClick: fn(),
|
|
30
|
-
},
|
|
31
|
-
render: ({onClick, filled}) => {
|
|
32
|
-
return (
|
|
33
|
-
<FavoriteButton
|
|
34
|
-
filled={filled}
|
|
35
|
-
onClick={() => {
|
|
36
|
-
onClick?.()
|
|
37
|
-
}}
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const Unfavorited: Story = {
|
|
44
|
-
args: {
|
|
45
|
-
filled: false,
|
|
46
|
-
onClick: fn(),
|
|
47
|
-
},
|
|
48
|
-
render: ({onClick, filled}) => {
|
|
49
|
-
return (
|
|
50
|
-
<FavoriteButton
|
|
51
|
-
filled={filled}
|
|
52
|
-
onClick={() => {
|
|
53
|
-
onClick?.()
|
|
54
|
-
}}
|
|
55
|
-
/>
|
|
56
|
-
)
|
|
57
|
-
},
|
|
58
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {Heart, Star, Settings, Home} from 'lucide-react'
|
|
2
|
-
import {fn} from 'storybook/test'
|
|
3
|
-
|
|
4
|
-
import {IconButton} from '../components/atoms/icon-button'
|
|
5
|
-
|
|
6
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Atoms/IconButton',
|
|
10
|
-
component: IconButton,
|
|
11
|
-
parameters: {},
|
|
12
|
-
tags: ['autodocs'],
|
|
13
|
-
argTypes: {
|
|
14
|
-
size: {
|
|
15
|
-
control: 'radio',
|
|
16
|
-
options: ['sm', 'default', 'lg'],
|
|
17
|
-
},
|
|
18
|
-
filled: {
|
|
19
|
-
control: 'boolean',
|
|
20
|
-
},
|
|
21
|
-
Icon: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: ['Heart', 'Star', 'Settings', 'Home'],
|
|
24
|
-
mapping: {
|
|
25
|
-
Heart,
|
|
26
|
-
Star,
|
|
27
|
-
Settings,
|
|
28
|
-
Home,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
args: {
|
|
33
|
-
onClick: fn(),
|
|
34
|
-
filled: false,
|
|
35
|
-
size: 'default',
|
|
36
|
-
Icon: Heart,
|
|
37
|
-
},
|
|
38
|
-
} satisfies Meta<typeof IconButton>
|
|
39
|
-
|
|
40
|
-
export default meta
|
|
41
|
-
type Story = StoryObj<typeof meta>
|
|
42
|
-
|
|
43
|
-
export const Default: Story = {
|
|
44
|
-
args: {
|
|
45
|
-
Icon: Heart,
|
|
46
|
-
},
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const Filled: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
Icon: Heart,
|
|
52
|
-
filled: true,
|
|
53
|
-
},
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const Small: Story = {
|
|
57
|
-
args: {
|
|
58
|
-
Icon: Star,
|
|
59
|
-
size: 'sm',
|
|
60
|
-
},
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const Large: Story = {
|
|
64
|
-
args: {
|
|
65
|
-
Icon: Settings,
|
|
66
|
-
size: 'lg',
|
|
67
|
-
},
|
|
68
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import {fn} from 'storybook/test'
|
|
2
|
-
|
|
3
|
-
import {ImageContentWrapper} from '../components/content/image-content-wrapper'
|
|
4
|
-
import {injectMocks} from '../mocks'
|
|
5
|
-
|
|
6
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Atoms/ImageContentWrapper',
|
|
10
|
-
component: ImageContentWrapper,
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'padded',
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
onLoad: fn(),
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
publicId: {
|
|
19
|
-
control: 'text',
|
|
20
|
-
},
|
|
21
|
-
externalId: {
|
|
22
|
-
control: 'text',
|
|
23
|
-
},
|
|
24
|
-
width: {
|
|
25
|
-
control: 'number',
|
|
26
|
-
},
|
|
27
|
-
height: {
|
|
28
|
-
control: 'number',
|
|
29
|
-
},
|
|
30
|
-
className: {
|
|
31
|
-
control: 'text',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
tags: ['autodocs'],
|
|
35
|
-
} satisfies Meta<typeof ImageContentWrapper>
|
|
36
|
-
|
|
37
|
-
export default meta
|
|
38
|
-
type Story = StoryObj<typeof meta>
|
|
39
|
-
|
|
40
|
-
injectMocks()
|
|
41
|
-
|
|
42
|
-
export const WithPublicId: Story = {
|
|
43
|
-
args: {
|
|
44
|
-
publicId: 'content-123',
|
|
45
|
-
width: 400,
|
|
46
|
-
height: 300,
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const WithExternalId: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
externalId: 'external-123',
|
|
53
|
-
width: 400,
|
|
54
|
-
height: 300,
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const WithCustomLoader: Story = {
|
|
59
|
-
args: {
|
|
60
|
-
publicId: 'content-123',
|
|
61
|
-
width: 400,
|
|
62
|
-
height: 300,
|
|
63
|
-
Loader: 'Loading image...',
|
|
64
|
-
},
|
|
65
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {Input} from '../components/ui/input'
|
|
2
|
-
|
|
3
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'UI/Input',
|
|
7
|
-
component: Input,
|
|
8
|
-
parameters: {},
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
argTypes: {
|
|
11
|
-
type: {
|
|
12
|
-
control: 'select',
|
|
13
|
-
options: ['text', 'email', 'password', 'number', 'search', 'tel', 'url'],
|
|
14
|
-
},
|
|
15
|
-
placeholder: {
|
|
16
|
-
control: 'text',
|
|
17
|
-
},
|
|
18
|
-
disabled: {
|
|
19
|
-
control: 'boolean',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
} satisfies Meta<typeof Input>
|
|
23
|
-
|
|
24
|
-
export default meta
|
|
25
|
-
type Story = StoryObj<typeof meta>
|
|
26
|
-
|
|
27
|
-
export const Default: Story = {
|
|
28
|
-
args: {
|
|
29
|
-
placeholder: 'Enter text...',
|
|
30
|
-
},
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const WithValue: Story = {
|
|
34
|
-
args: {
|
|
35
|
-
value: 'This is an input',
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const Disabled: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
disabled: true,
|
|
42
|
-
value: 'Disabled input',
|
|
43
|
-
},
|
|
44
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {Label} from '../components/ui/label'
|
|
2
|
-
|
|
3
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'UI/Label',
|
|
7
|
-
component: Label,
|
|
8
|
-
parameters: {},
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
} satisfies Meta<typeof Label>
|
|
11
|
-
|
|
12
|
-
export default meta
|
|
13
|
-
type Story = StoryObj<typeof meta>
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
args: {
|
|
17
|
-
children: 'This is a text label',
|
|
18
|
-
},
|
|
19
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {fn} from 'storybook/test'
|
|
2
|
-
|
|
3
|
-
import {List} from '../components/atoms/list'
|
|
4
|
-
import {ProductCard} from '../components/commerce/product-card'
|
|
5
|
-
import {ProductLink} from '../components/commerce/product-link'
|
|
6
|
-
import {createProduct, injectMocks} from '../mocks'
|
|
7
|
-
|
|
8
|
-
import type {Product} from '@shopify/shop-minis-platform'
|
|
9
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
10
|
-
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Atoms/List',
|
|
13
|
-
component: List as any,
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: 'padded',
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
height: {
|
|
19
|
-
control: 'number',
|
|
20
|
-
description: 'Height of the virtualized list container',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
tags: ['autodocs'],
|
|
24
|
-
} satisfies Meta<typeof List>
|
|
25
|
-
|
|
26
|
-
export default meta
|
|
27
|
-
type Story = StoryObj<typeof meta>
|
|
28
|
-
|
|
29
|
-
injectMocks()
|
|
30
|
-
|
|
31
|
-
const createProductList = (count: number) => {
|
|
32
|
-
return Array.from({length: count}, (_, index) =>
|
|
33
|
-
createProduct(`product-${index + 1}`, `Product ${index + 1}`, '9.99')
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const ProductLinkList: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
items: createProductList(50),
|
|
40
|
-
height: 600,
|
|
41
|
-
itemSizeForRow: () => 100,
|
|
42
|
-
showScrollbar: true,
|
|
43
|
-
renderItem: (product: Product) => (
|
|
44
|
-
<div className="p-4">
|
|
45
|
-
<ProductLink product={product} />
|
|
46
|
-
</div>
|
|
47
|
-
),
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const ProductGridList: Story = {
|
|
52
|
-
args: {
|
|
53
|
-
items: createProductList(20),
|
|
54
|
-
height: 600,
|
|
55
|
-
itemSizeForRow: () => 220,
|
|
56
|
-
showScrollbar: true,
|
|
57
|
-
renderItem: (product: Product) => (
|
|
58
|
-
<div className="grid grid-cols-2 gap-4">
|
|
59
|
-
<ProductCard product={product} onFavoriteToggled={fn()} />
|
|
60
|
-
<ProductCard product={product} onFavoriteToggled={fn()} />
|
|
61
|
-
</div>
|
|
62
|
-
),
|
|
63
|
-
},
|
|
64
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import {MerchantCard} from '../components/commerce/merchant-card'
|
|
2
|
-
import {createShop, injectMocks} from '../mocks'
|
|
3
|
-
|
|
4
|
-
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
5
|
-
|
|
6
|
-
type MerchantCardProps = React.ComponentProps<typeof MerchantCard>
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Commerce/MerchantCard',
|
|
10
|
-
component: MerchantCard,
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'padded',
|
|
13
|
-
},
|
|
14
|
-
argTypes: {
|
|
15
|
-
touchable: {
|
|
16
|
-
control: 'boolean',
|
|
17
|
-
},
|
|
18
|
-
featuredImagesLimit: {
|
|
19
|
-
control: 'number',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
tags: ['autodocs'],
|
|
23
|
-
} satisfies Meta<MerchantCardProps>
|
|
24
|
-
|
|
25
|
-
export default meta
|
|
26
|
-
type Story = StoryObj<typeof meta>
|
|
27
|
-
|
|
28
|
-
injectMocks()
|
|
29
|
-
|
|
30
|
-
export const Default: Story = {
|
|
31
|
-
decorators: [
|
|
32
|
-
Story => (
|
|
33
|
-
<div style={{maxWidth: 200}}>
|
|
34
|
-
<Story />
|
|
35
|
-
</div>
|
|
36
|
-
),
|
|
37
|
-
],
|
|
38
|
-
args: {
|
|
39
|
-
shop: {
|
|
40
|
-
...createShop('shop1', 'Amazing Store'),
|
|
41
|
-
reviewAnalytics: {averageRating: 4.8, reviewCount: 1250},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const CoverImageDark: Story = {
|
|
47
|
-
decorators: [
|
|
48
|
-
Story => (
|
|
49
|
-
<div style={{maxWidth: 200}}>
|
|
50
|
-
<Story />
|
|
51
|
-
</div>
|
|
52
|
-
),
|
|
53
|
-
],
|
|
54
|
-
name: 'Cover Image',
|
|
55
|
-
args: {
|
|
56
|
-
shop: createShop('cover3', 'Midnight Store', {
|
|
57
|
-
themeType: 'coverImage',
|
|
58
|
-
coverDominantColor: '#2C3E50',
|
|
59
|
-
}),
|
|
60
|
-
},
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const BrandColorWordmark: Story = {
|
|
64
|
-
decorators: [
|
|
65
|
-
Story => (
|
|
66
|
-
<div style={{maxWidth: 200}}>
|
|
67
|
-
<Story />
|
|
68
|
-
</div>
|
|
69
|
-
),
|
|
70
|
-
],
|
|
71
|
-
name: 'Brand Color + Wordmark',
|
|
72
|
-
args: {
|
|
73
|
-
shop: createShop('brand2', 'Amazing Store', {
|
|
74
|
-
themeType: 'brandColor',
|
|
75
|
-
wordmarkUrl:
|
|
76
|
-
'https://merrypeople.com/cdn/shop/files/Transparent_Background_1.png?v=1696465429&width=1024',
|
|
77
|
-
primaryColor: '#E3F2FD',
|
|
78
|
-
}),
|
|
79
|
-
},
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export const Grid: Story = {
|
|
83
|
-
decorators: [
|
|
84
|
-
() => (
|
|
85
|
-
<div className="grid grid-cols-2 gap-4">
|
|
86
|
-
{/* Default */}
|
|
87
|
-
<MerchantCard
|
|
88
|
-
shop={{
|
|
89
|
-
...createShop('shop1', 'Amazing Store'),
|
|
90
|
-
reviewAnalytics: {averageRating: 4.8, reviewCount: 1250},
|
|
91
|
-
}}
|
|
92
|
-
/>
|
|
93
|
-
|
|
94
|
-
{/* Cover Image (Dark) */}
|
|
95
|
-
<MerchantCard
|
|
96
|
-
shop={createShop('cover3', 'Amazing Store', {
|
|
97
|
-
themeType: 'coverImage',
|
|
98
|
-
coverDominantColor: '#2C3E50',
|
|
99
|
-
})}
|
|
100
|
-
/>
|
|
101
|
-
|
|
102
|
-
{/* Brand Color + Wordmark (Light) */}
|
|
103
|
-
<MerchantCard
|
|
104
|
-
shop={createShop('brand2', 'Amazing Store', {
|
|
105
|
-
themeType: 'brandColor',
|
|
106
|
-
wordmarkUrl:
|
|
107
|
-
'https://merrypeople.com/cdn/shop/files/Transparent_Background_1.png?v=1696465429&width=1024',
|
|
108
|
-
primaryColor: '#E3F2FD',
|
|
109
|
-
})}
|
|
110
|
-
/>
|
|
111
|
-
|
|
112
|
-
{/* Brand Color + Wordmark (Dark) */}
|
|
113
|
-
<MerchantCard
|
|
114
|
-
shop={createShop('brand4', 'Amazing Store', {
|
|
115
|
-
themeType: 'brandColor',
|
|
116
|
-
wordmarkUrl:
|
|
117
|
-
'https://merrypeople.com/cdn/shop/files/Transparent_Background_1.png?v=1696465429&width=1024',
|
|
118
|
-
primaryColor: '#808080',
|
|
119
|
-
})}
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
),
|
|
123
|
-
],
|
|
124
|
-
args: {
|
|
125
|
-
shop: createShop('shop1', 'Amazing Store'),
|
|
126
|
-
},
|
|
127
|
-
}
|