@shopify/shop-minis-react 0.0.0-snapshot.20250610143037 → 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.
- package/README.md +1 -65
- package/dist/index.js +75 -77
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -3
- package/tailwind.config.js +2 -38
- package/dist/lib/tailwind-preset.js +0 -13
- package/dist/lib/tailwind-preset.js.map +0 -1
- package/src/lib/tailwind-preset.ts +0 -31
package/README.md
CHANGED
|
@@ -46,55 +46,7 @@ Add the library's CSS to your main CSS file or app entry point:
|
|
|
46
46
|
}
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
### 2.
|
|
50
|
-
|
|
51
|
-
Choose one of the following approaches:
|
|
52
|
-
|
|
53
|
-
#### Option A: Using Tailwind Preset (Recommended)
|
|
54
|
-
|
|
55
|
-
```js
|
|
56
|
-
// tailwind.config.js
|
|
57
|
-
const shopMinisConfig = require('@shopify/shop-minis-react/tailwind')
|
|
58
|
-
|
|
59
|
-
module.exports = {
|
|
60
|
-
...shopMinisConfig,
|
|
61
|
-
content: [
|
|
62
|
-
...shopMinisConfig.content,
|
|
63
|
-
'./src/**/*.{js,ts,jsx,tsx}', // your project content
|
|
64
|
-
]
|
|
65
|
-
// No theme config needed - all styling via CSS variables
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
#### Option B: Using TypeScript Preset
|
|
70
|
-
|
|
71
|
-
```ts
|
|
72
|
-
// tailwind.config.ts
|
|
73
|
-
import { shopMinisPreset } from '@shopify/shop-minis-react'
|
|
74
|
-
|
|
75
|
-
export default {
|
|
76
|
-
presets: [shopMinisPreset],
|
|
77
|
-
content: [
|
|
78
|
-
'./src/**/*.{js,ts,jsx,tsx}', // your project content
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
#### Option C: Manual Configuration
|
|
84
|
-
|
|
85
|
-
```js
|
|
86
|
-
// tailwind.config.js
|
|
87
|
-
module.exports = {
|
|
88
|
-
content: [
|
|
89
|
-
'./src/**/*.{js,ts,jsx,tsx}',
|
|
90
|
-
// CRITICAL: Must include library source for class scanning
|
|
91
|
-
'./node_modules/@shopify/shop-minis-react/src/**/*.{js,ts,jsx,tsx}',
|
|
92
|
-
],
|
|
93
|
-
// No theme configuration needed - all styling via CSS variables
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 3. Use Components
|
|
49
|
+
### 2. Use Components
|
|
98
50
|
|
|
99
51
|
```tsx
|
|
100
52
|
import { Button, Card, CardContent, CardHeader, CardTitle } from '@shopify/shop-minis-react'
|
|
@@ -136,22 +88,6 @@ You can customize the design system by overriding CSS variables:
|
|
|
136
88
|
--primary: oklch(0.5 0.3 280);
|
|
137
89
|
/* ... dark mode overrides */
|
|
138
90
|
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### TypeScript Configuration
|
|
142
|
-
|
|
143
|
-
If you're using path mapping in your `tsconfig.json`:
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"compilerOptions": {
|
|
148
|
-
"paths": {
|
|
149
|
-
"@/components/*": ["./src/components/*"],
|
|
150
|
-
"@shopify/shop-minis-react": ["./node_modules/@shopify/shop-minis-react/src"]
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
91
|
|
|
156
92
|
### Vite Configuration
|
|
157
93
|
|
package/dist/index.js
CHANGED
|
@@ -1,80 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { Consent as Sr, ConsentStatus as Pr, CurrencyCode as Er, Gender as hr } from "./types/minisSDK.generated.d.js";
|
|
1
|
+
import { Button as e, buttonVariants as t } from "./components/ui/button.js";
|
|
2
|
+
import { Card as i, CardAction as a, CardContent as p, CardDescription as u, CardFooter as n, CardHeader as l, CardTitle as m } from "./components/ui/card.js";
|
|
3
|
+
import { AlertDialog as d, AlertDialogAction as x, AlertDialogCancel as c, AlertDialogContent as A, AlertDialogDescription as g, AlertDialogFooter as C, AlertDialogHeader as D, AlertDialogOverlay as S, AlertDialogPortal as P, AlertDialogTitle as E, AlertDialogTrigger as y } from "./components/ui/alert-dialog.js";
|
|
4
|
+
import { Toaster as h } from "./components/ui/sonner.js";
|
|
5
|
+
import { useSavedProductsActions as M } from "./hooks/user/useSavedProductsActions.js";
|
|
6
|
+
import { useFollowedShopsActions as L } from "./hooks/user/useFollowedShopsActions.js";
|
|
7
|
+
import { useCurrentUser as U } from "./hooks/user/useCurrentUser.js";
|
|
8
|
+
import { useOrders as w } from "./hooks/user/useOrders.js";
|
|
9
|
+
import { useBuyerAttributes as H } from "./hooks/user/useBuyerAttributes.js";
|
|
10
|
+
import { useProductListActions as R } from "./hooks/product/useProductListActions.js";
|
|
11
|
+
import { useProductLists as G } from "./hooks/product/useProductLists.js";
|
|
12
|
+
import { useProductList as V } from "./hooks/product/useProductList.js";
|
|
13
|
+
import { useRecommendedProducts as q } from "./hooks/product/useRecommendedProducts.js";
|
|
14
|
+
import { usePopularProducts as J } from "./hooks/product/usePopularProducts.js";
|
|
15
|
+
import { useAsyncStorage as Q } from "./hooks/storage/useAsyncStorage.js";
|
|
16
|
+
import { useSecureStorage as X } from "./hooks/storage/useSecureStorage.js";
|
|
17
|
+
import { useImageUpload as Z } from "./hooks/storage/useImageUpload.js";
|
|
18
|
+
import { useShopNavigation as $ } from "./hooks/navigation/useShopNavigation.js";
|
|
19
|
+
import { useCloseMini as or } from "./hooks/navigation/useCloseMini.js";
|
|
20
|
+
import { useShopCartActions as tr } from "./hooks/shop/useShopCartActions.js";
|
|
21
|
+
import { useRecommendedShops as ir } from "./hooks/shop/useRecommendedShops.js";
|
|
22
|
+
import { useErrorToast as pr } from "./hooks/util/useErrorToast.js";
|
|
23
|
+
import { useErrorScreen as nr } from "./hooks/util/useErrorScreen.js";
|
|
24
|
+
import { MiniEntityNotFoundError as mr, MiniError as fr, MiniNetworkError as dr, formatError as xr } from "./utils/errors.js";
|
|
25
|
+
import { parseUrl as Ar } from "./utils/parseUrl.js";
|
|
26
|
+
import { Consent as Cr, ConsentStatus as Dr, CurrencyCode as Sr, Gender as Pr } from "./types/minisSDK.generated.d.js";
|
|
28
27
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
G as
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
or as useShopNavigation
|
|
28
|
+
d as AlertDialog,
|
|
29
|
+
x as AlertDialogAction,
|
|
30
|
+
c as AlertDialogCancel,
|
|
31
|
+
A as AlertDialogContent,
|
|
32
|
+
g as AlertDialogDescription,
|
|
33
|
+
C as AlertDialogFooter,
|
|
34
|
+
D as AlertDialogHeader,
|
|
35
|
+
S as AlertDialogOverlay,
|
|
36
|
+
P as AlertDialogPortal,
|
|
37
|
+
E as AlertDialogTitle,
|
|
38
|
+
y as AlertDialogTrigger,
|
|
39
|
+
e as Button,
|
|
40
|
+
i as Card,
|
|
41
|
+
a as CardAction,
|
|
42
|
+
p as CardContent,
|
|
43
|
+
u as CardDescription,
|
|
44
|
+
n as CardFooter,
|
|
45
|
+
l as CardHeader,
|
|
46
|
+
m as CardTitle,
|
|
47
|
+
Cr as Consent,
|
|
48
|
+
Dr as ConsentStatus,
|
|
49
|
+
Sr as CurrencyCode,
|
|
50
|
+
Pr as Gender,
|
|
51
|
+
mr as MiniEntityNotFoundError,
|
|
52
|
+
fr as MiniError,
|
|
53
|
+
dr as MiniNetworkError,
|
|
54
|
+
h as Toaster,
|
|
55
|
+
t as buttonVariants,
|
|
56
|
+
xr as formatError,
|
|
57
|
+
Ar as parseUrl,
|
|
58
|
+
Q as useAsyncStorage,
|
|
59
|
+
H as useBuyerAttributes,
|
|
60
|
+
or as useCloseMini,
|
|
61
|
+
U as useCurrentUser,
|
|
62
|
+
nr as useErrorScreen,
|
|
63
|
+
pr as useErrorToast,
|
|
64
|
+
L as useFollowedShopsActions,
|
|
65
|
+
Z as useImageUpload,
|
|
66
|
+
w as useOrders,
|
|
67
|
+
J as usePopularProducts,
|
|
68
|
+
V as useProductList,
|
|
69
|
+
R as useProductListActions,
|
|
70
|
+
G as useProductLists,
|
|
71
|
+
q as useRecommendedProducts,
|
|
72
|
+
ir as useRecommendedShops,
|
|
73
|
+
M as useSavedProductsActions,
|
|
74
|
+
X as useSecureStorage,
|
|
75
|
+
tr as useShopCartActions,
|
|
76
|
+
$ as useShopNavigation
|
|
79
77
|
};
|
|
80
78
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/tailwind.config.js
CHANGED
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This configuration only handles content scanning for the library.
|
|
5
|
-
* All theming is handled via CSS variables in the imported stylesheet.
|
|
6
|
-
*
|
|
7
|
-
* Usage in consumer projects:
|
|
8
|
-
*
|
|
9
|
-
* // tailwind.config.js
|
|
10
|
-
* const shopMinisConfig = require('@shopify/shop-minis-react/tailwind')
|
|
11
|
-
*
|
|
12
|
-
* module.exports = {
|
|
13
|
-
* ...shopMinisConfig,
|
|
14
|
-
* content: [
|
|
15
|
-
* ...shopMinisConfig.content,
|
|
16
|
-
* './src/**\/*.{js,ts,jsx,tsx}', // your project content
|
|
17
|
-
* ]
|
|
18
|
-
* }
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const libraryConfig = {
|
|
22
|
-
content: [
|
|
23
|
-
// Library content - consumers should append their own content
|
|
24
|
-
'./node_modules/@shopify/shop-minis-react/src/**/*.{js,ts,jsx,tsx}',
|
|
25
|
-
'./node_modules/@shopify/shop-minis-react/dist/**/*.{js,ts,jsx,tsx}',
|
|
26
|
-
],
|
|
27
|
-
// No theme configuration - all styling via CSS variables
|
|
1
|
+
module.exports = {
|
|
2
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
28
3
|
}
|
|
29
|
-
|
|
30
|
-
// For development within this package
|
|
31
|
-
const devConfig = {
|
|
32
|
-
...libraryConfig,
|
|
33
|
-
content: [libraryConfig.content, './src/**/*.{js,ts,jsx,tsx}'],
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Export the appropriate config based on context
|
|
37
|
-
const isDevelopment =
|
|
38
|
-
typeof process !== 'undefined' && process.env.NODE_ENV === 'development'
|
|
39
|
-
module.exports = isDevelopment ? devConfig : libraryConfig
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const s = {
|
|
2
|
-
content: [
|
|
3
|
-
// CRITICAL: Ensure consumer's Tailwind scans our source files
|
|
4
|
-
"./node_modules/@shopify/shop-minis-react/src/**/*.{js,ts,jsx,tsx}",
|
|
5
|
-
"./node_modules/@shopify/shop-minis-react/dist/**/*.{js,ts,jsx,tsx}"
|
|
6
|
-
]
|
|
7
|
-
// No theme configuration - all styling via CSS variables
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
s as default,
|
|
11
|
-
s as shopMinisPreset
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=tailwind-preset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-preset.js","sources":["../../src/lib/tailwind-preset.ts"],"sourcesContent":["/**\n * Minimal Tailwind CSS preset for @shopify/shop-minis-react\n *\n * This preset ensures your library's source files are scanned for Tailwind classes.\n * Essential for source-only distribution to work properly.\n *\n * Usage in consumer projects:\n *\n * // tailwind.config.ts\n * import { shopMinisPreset } from '@shopify/shop-minis-react/src/lib/tailwind-preset'\n *\n * export default {\n * presets: [shopMinisPreset],\n * content: [\n * './src/**\\/*.{js,ts,jsx,tsx}', // your project content\n * ]\n * }\n */\n\nimport type {Config} from 'tailwindcss'\n\nexport const shopMinisPreset: Config = {\n content: [\n // CRITICAL: Ensure consumer's Tailwind scans our source files\n './node_modules/@shopify/shop-minis-react/src/**/*.{js,ts,jsx,tsx}',\n './node_modules/@shopify/shop-minis-react/dist/**/*.{js,ts,jsx,tsx}',\n ],\n // No theme configuration - all styling via CSS variables\n}\n\nexport default shopMinisPreset\n"],"names":["shopMinisPreset"],"mappings":"AAqBO,MAAMA,IAA0B;AAAA,EACrC,SAAS;AAAA;AAAA,IAEP;AAAA,IACA;AAAA,EAAA;AAAA;AAGJ;"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal Tailwind CSS preset for @shopify/shop-minis-react
|
|
3
|
-
*
|
|
4
|
-
* This preset ensures your library's source files are scanned for Tailwind classes.
|
|
5
|
-
* Essential for source-only distribution to work properly.
|
|
6
|
-
*
|
|
7
|
-
* Usage in consumer projects:
|
|
8
|
-
*
|
|
9
|
-
* // tailwind.config.ts
|
|
10
|
-
* import { shopMinisPreset } from '@shopify/shop-minis-react/src/lib/tailwind-preset'
|
|
11
|
-
*
|
|
12
|
-
* export default {
|
|
13
|
-
* presets: [shopMinisPreset],
|
|
14
|
-
* content: [
|
|
15
|
-
* './src/**\/*.{js,ts,jsx,tsx}', // your project content
|
|
16
|
-
* ]
|
|
17
|
-
* }
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import type {Config} from 'tailwindcss'
|
|
21
|
-
|
|
22
|
-
export const shopMinisPreset: Config = {
|
|
23
|
-
content: [
|
|
24
|
-
// CRITICAL: Ensure consumer's Tailwind scans our source files
|
|
25
|
-
'./node_modules/@shopify/shop-minis-react/src/**/*.{js,ts,jsx,tsx}',
|
|
26
|
-
'./node_modules/@shopify/shop-minis-react/dist/**/*.{js,ts,jsx,tsx}',
|
|
27
|
-
],
|
|
28
|
-
// No theme configuration - all styling via CSS variables
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default shopMinisPreset
|