@shopify/shop-minis-react 0.0.25 → 0.0.26
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/_virtual/index10.js +2 -2
- package/dist/_virtual/index4.js +2 -3
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/_virtual/index7.js +3 -2
- package/dist/_virtual/index7.js.map +1 -1
- package/dist/_virtual/index9.js +2 -2
- package/dist/components/atoms/product-variant-price.js +61 -0
- package/dist/components/atoms/product-variant-price.js.map +1 -0
- package/dist/components/commerce/product-card.js +120 -153
- package/dist/components/commerce/product-card.js.map +1 -1
- package/dist/components/commerce/product-link.js +12 -16
- package/dist/components/commerce/product-link.js.map +1 -1
- package/dist/components/content/content-monitor.js +17 -0
- package/dist/components/content/content-monitor.js.map +1 -0
- package/dist/components/content/content-wrapper.js +17 -0
- package/dist/components/content/content-wrapper.js.map +1 -0
- package/dist/hooks/content/useContent.js +24 -0
- package/dist/hooks/content/useContent.js.map +1 -0
- package/dist/hooks/content/useCreateImageContent.js +21 -18
- package/dist/hooks/content/useCreateImageContent.js.map +1 -1
- package/dist/index.js +227 -223
- package/dist/index.js.map +1 -1
- package/dist/mocks.js +21 -6
- package/dist/mocks.js.map +1 -1
- package/dist/shop-minis-platform/src/types/content.js +5 -0
- package/dist/shop-minis-platform/src/types/content.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@xmldom_xmldom@0.8.10/node_modules/@xmldom/xmldom/lib/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.1.0/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/package.json +5 -4
- package/src/components/atoms/product-variant-price.tsx +74 -0
- package/src/components/commerce/product-card.tsx +7 -56
- package/src/components/commerce/product-link.tsx +0 -2
- package/src/components/content/content-monitor.tsx +23 -0
- package/src/components/content/content-wrapper.tsx +56 -0
- package/src/components/index.ts +2 -0
- package/src/hooks/content/useContent.ts +50 -0
- package/src/hooks/content/useCreateImageContent.ts +20 -5
- package/src/mocks.ts +15 -0
- package/src/stories/ProductVariantPrice.stories.tsx +73 -0
- package/src/stories/Toaster.stories.tsx +2 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {ProductVariantPrice} from '../components/atoms/product-variant-price'
|
|
2
|
+
|
|
3
|
+
import type {Meta, StoryObj} from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
type ProductVariantPriceProps = React.ComponentProps<typeof ProductVariantPrice>
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Atoms/ProductVariantPrice',
|
|
9
|
+
component: ProductVariantPrice,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'padded',
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
amount: {
|
|
15
|
+
control: 'text',
|
|
16
|
+
},
|
|
17
|
+
currencyCode: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['USD', 'CAD', 'EUR', 'GBP', 'JPY'],
|
|
20
|
+
},
|
|
21
|
+
compareAtPriceAmount: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
},
|
|
24
|
+
compareAtPriceCurrencyCode: {
|
|
25
|
+
control: 'select',
|
|
26
|
+
options: ['USD', 'CAD', 'EUR', 'GBP', 'JPY'],
|
|
27
|
+
},
|
|
28
|
+
className: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
},
|
|
31
|
+
currentPriceClassName: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
},
|
|
34
|
+
originalPriceClassName: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
},
|
|
37
|
+
containerClassName: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
tags: ['autodocs'],
|
|
42
|
+
} satisfies Meta<ProductVariantPriceProps>
|
|
43
|
+
|
|
44
|
+
export default meta
|
|
45
|
+
type Story = StoryObj<typeof meta>
|
|
46
|
+
|
|
47
|
+
export const Default: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
amount: '29.99',
|
|
50
|
+
currencyCode: 'USD',
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const WithDiscount: Story = {
|
|
55
|
+
name: 'With Discount',
|
|
56
|
+
args: {
|
|
57
|
+
amount: '24.99',
|
|
58
|
+
currencyCode: 'USD',
|
|
59
|
+
compareAtPriceAmount: '39.99',
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const CustomStyling: Story = {
|
|
64
|
+
name: 'Custom Styling',
|
|
65
|
+
args: {
|
|
66
|
+
amount: '89.99',
|
|
67
|
+
currencyCode: 'USD',
|
|
68
|
+
compareAtPriceAmount: '119.99',
|
|
69
|
+
currentPriceClassName: 'text-2xl font-bold text-green-600',
|
|
70
|
+
originalPriceClassName: 'text-lg text-red-500 line-through',
|
|
71
|
+
containerClassName: 'gap-3 p-4 bg-gray-50 rounded-lg',
|
|
72
|
+
},
|
|
73
|
+
}
|
|
@@ -26,7 +26,7 @@ type Story = StoryObj<typeof meta>
|
|
|
26
26
|
|
|
27
27
|
export const SuccessToast: Story = {
|
|
28
28
|
decorators: [
|
|
29
|
-
|
|
29
|
+
() => (
|
|
30
30
|
<Button onClick={() => toast.success('Success toast!')}>
|
|
31
31
|
Show success Toast
|
|
32
32
|
</Button>
|
|
@@ -37,7 +37,7 @@ export const SuccessToast: Story = {
|
|
|
37
37
|
|
|
38
38
|
export const ErrorToast: Story = {
|
|
39
39
|
decorators: [
|
|
40
|
-
|
|
40
|
+
() => (
|
|
41
41
|
<Button onClick={() => toast.error('Error toast!')}>
|
|
42
42
|
Show error Toast
|
|
43
43
|
</Button>
|