@shopify/shop-minis-react 0.0.16 → 0.0.18

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 (120) hide show
  1. package/README.md +14 -10
  2. package/dist/_virtual/index2.js +3 -2
  3. package/dist/_virtual/index2.js.map +1 -1
  4. package/dist/_virtual/index3.js +2 -3
  5. package/dist/_virtual/index3.js.map +1 -1
  6. package/dist/components/atoms/button.js +28 -73
  7. package/dist/components/atoms/button.js.map +1 -1
  8. package/dist/components/atoms/favorite-button.js +21 -0
  9. package/dist/components/atoms/favorite-button.js.map +1 -0
  10. package/dist/components/atoms/icon-button.js +38 -0
  11. package/dist/components/atoms/icon-button.js.map +1 -0
  12. package/dist/components/atoms/touchable.js +14 -14
  13. package/dist/components/atoms/touchable.js.map +1 -1
  14. package/dist/components/commerce/merchant-card.js +1 -8
  15. package/dist/components/commerce/merchant-card.js.map +1 -1
  16. package/dist/components/commerce/product-card.js +79 -109
  17. package/dist/components/commerce/product-card.js.map +1 -1
  18. package/dist/components/commerce/product-link.js +36 -55
  19. package/dist/components/commerce/product-link.js.map +1 -1
  20. package/dist/components/ui/accordion.js.map +1 -0
  21. package/dist/components/{atoms → ui}/alert-dialog.js +1 -1
  22. package/dist/components/ui/alert-dialog.js.map +1 -0
  23. package/dist/components/ui/alert.js.map +1 -0
  24. package/dist/components/ui/avatar.js.map +1 -0
  25. package/dist/components/ui/badge.js.map +1 -0
  26. package/dist/components/ui/button.js +68 -0
  27. package/dist/components/ui/button.js.map +1 -0
  28. package/dist/components/ui/card.js.map +1 -0
  29. package/dist/components/{atoms → ui}/carousel.js +23 -23
  30. package/dist/components/ui/carousel.js.map +1 -0
  31. package/dist/components/ui/checkbox.js.map +1 -0
  32. package/dist/components/ui/dialog.js.map +1 -0
  33. package/dist/components/{atoms → ui}/drawer.js +25 -22
  34. package/dist/components/ui/drawer.js.map +1 -0
  35. package/dist/components/ui/input.js.map +1 -0
  36. package/dist/components/ui/label.js.map +1 -0
  37. package/dist/components/ui/progress.js.map +1 -0
  38. package/dist/components/ui/radio-group.js.map +1 -0
  39. package/dist/components/ui/resizable.js.map +1 -0
  40. package/dist/components/ui/scroll-area.js.map +1 -0
  41. package/dist/components/ui/select.js.map +1 -0
  42. package/dist/components/ui/separator.js.map +1 -0
  43. package/dist/components/ui/sheet.js.map +1 -0
  44. package/dist/components/ui/sonner.js.map +1 -0
  45. package/dist/index.js +193 -218
  46. package/dist/index.js.map +1 -1
  47. 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
  48. package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
  49. package/package.json +6 -9
  50. package/src/components/atoms/button.tsx +10 -66
  51. package/src/components/atoms/favorite-button.tsx +22 -0
  52. package/src/components/atoms/icon-button.tsx +42 -0
  53. package/src/components/atoms/touchable.tsx +5 -1
  54. package/src/components/commerce/merchant-card.tsx +1 -12
  55. package/src/components/commerce/product-card.tsx +4 -32
  56. package/src/components/commerce/product-link.tsx +9 -29
  57. package/src/components/index.ts +23 -20
  58. package/src/components/{atoms → ui}/alert-dialog.tsx +1 -1
  59. package/src/components/ui/button.tsx +77 -0
  60. package/src/components/{atoms → ui}/carousel.tsx +11 -11
  61. package/src/components/{atoms → ui}/drawer.tsx +2 -1
  62. package/src/index.css +8 -2
  63. package/src/styles/globals.css +41 -0
  64. package/src/styles/theme.css +102 -0
  65. package/dist/components/atoms/accordion.js.map +0 -1
  66. package/dist/components/atoms/alert-dialog.js.map +0 -1
  67. package/dist/components/atoms/alert.js.map +0 -1
  68. package/dist/components/atoms/avatar.js.map +0 -1
  69. package/dist/components/atoms/badge.js.map +0 -1
  70. package/dist/components/atoms/card.js.map +0 -1
  71. package/dist/components/atoms/carousel.js.map +0 -1
  72. package/dist/components/atoms/checkbox.js.map +0 -1
  73. package/dist/components/atoms/dialog.js.map +0 -1
  74. package/dist/components/atoms/drawer.js.map +0 -1
  75. package/dist/components/atoms/input.js.map +0 -1
  76. package/dist/components/atoms/label.js.map +0 -1
  77. package/dist/components/atoms/progress.js.map +0 -1
  78. package/dist/components/atoms/radio-group.js.map +0 -1
  79. package/dist/components/atoms/resizable.js.map +0 -1
  80. package/dist/components/atoms/scroll-area.js.map +0 -1
  81. package/dist/components/atoms/select.js.map +0 -1
  82. package/dist/components/atoms/separator.js.map +0 -1
  83. package/dist/components/atoms/sheet.js.map +0 -1
  84. package/dist/components/atoms/sonner.js.map +0 -1
  85. package/src/base.css +0 -273
  86. package/tailwind.config.js +0 -3
  87. /package/dist/components/{atoms → ui}/accordion.js +0 -0
  88. /package/dist/components/{atoms → ui}/alert.js +0 -0
  89. /package/dist/components/{atoms → ui}/avatar.js +0 -0
  90. /package/dist/components/{atoms → ui}/badge.js +0 -0
  91. /package/dist/components/{atoms → ui}/card.js +0 -0
  92. /package/dist/components/{atoms → ui}/checkbox.js +0 -0
  93. /package/dist/components/{atoms → ui}/dialog.js +0 -0
  94. /package/dist/components/{atoms → ui}/input.js +0 -0
  95. /package/dist/components/{atoms → ui}/label.js +0 -0
  96. /package/dist/components/{atoms → ui}/progress.js +0 -0
  97. /package/dist/components/{atoms → ui}/radio-group.js +0 -0
  98. /package/dist/components/{atoms → ui}/resizable.js +0 -0
  99. /package/dist/components/{atoms → ui}/scroll-area.js +0 -0
  100. /package/dist/components/{atoms → ui}/select.js +0 -0
  101. /package/dist/components/{atoms → ui}/separator.js +0 -0
  102. /package/dist/components/{atoms → ui}/sheet.js +0 -0
  103. /package/dist/components/{atoms → ui}/sonner.js +0 -0
  104. /package/src/components/{atoms → ui}/accordion.tsx +0 -0
  105. /package/src/components/{atoms → ui}/alert.tsx +0 -0
  106. /package/src/components/{atoms → ui}/avatar.tsx +0 -0
  107. /package/src/components/{atoms → ui}/badge.tsx +0 -0
  108. /package/src/components/{atoms → ui}/card.tsx +0 -0
  109. /package/src/components/{atoms → ui}/checkbox.tsx +0 -0
  110. /package/src/components/{atoms → ui}/dialog.tsx +0 -0
  111. /package/src/components/{atoms → ui}/input.tsx +0 -0
  112. /package/src/components/{atoms → ui}/label.tsx +0 -0
  113. /package/src/components/{atoms → ui}/progress.tsx +0 -0
  114. /package/src/components/{atoms → ui}/radio-group.tsx +0 -0
  115. /package/src/components/{atoms → ui}/resizable.tsx +0 -0
  116. /package/src/components/{atoms → ui}/scroll-area.tsx +0 -0
  117. /package/src/components/{atoms → ui}/select.tsx +0 -0
  118. /package/src/components/{atoms → ui}/separator.tsx +0 -0
  119. /package/src/components/{atoms → ui}/sheet.tsx +0 -0
  120. /package/src/components/{atoms → ui}/sonner.tsx +0 -0
package/dist/index.js CHANGED
@@ -1,224 +1,199 @@
1
1
  import { MinisContainer as o } from "./components/MinisContainer.js";
2
- import { ProductCard as a, ProductCardBadge as i, ProductCardCurrentPrice as n, ProductCardFavoriteButton as c, ProductCardImage as l, ProductCardImageContainer as u, ProductCardInfo as d, ProductCardOriginalPrice as s, ProductCardPrice as p, ProductCardRoot as m, ProductCardTitle as f } from "./components/commerce/product-card.js";
3
- import { ProductLink as C, ProductLinkActions as g, ProductLinkCurrentPrice as P, ProductLinkDiscountPrice as D, ProductLinkImage as S, ProductLinkInfo as A, ProductLinkOriginalPrice as h, ProductLinkPrice as L, ProductLinkRating as k, ProductLinkRoot as I, ProductLinkTitle as T } from "./components/commerce/product-link.js";
4
- import { MerchantCard as w, MerchantCardImage as R, MerchantCardImageContainer as v, MerchantCardInfo as b, MerchantCardLogo as F, MerchantCardName as B, MerchantCardPrimitive as E, MerchantCardRating as y, MerchantCardRoot as H } from "./components/commerce/merchant-card.js";
5
- import { Accordion as N, AccordionContent as G, AccordionItem as U, AccordionTrigger as V } from "./components/atoms/accordion.js";
6
- import { Alert as j, AlertDescription as q, AlertTitle as J } from "./components/atoms/alert.js";
7
- import { AlertDialog as Q, AlertDialogAction as W, AlertDialogCancel as X, AlertDialogContent as Y, AlertDialogDescription as Z, AlertDialogFooter as _, AlertDialogHeader as $, AlertDialogOverlay as rr, AlertDialogPortal as er, AlertDialogTitle as or, AlertDialogTrigger as tr } from "./components/atoms/alert-dialog.js";
8
- import { Avatar as ir, AvatarFallback as nr, AvatarImage as cr } from "./components/atoms/avatar.js";
9
- import { Badge as ur, badgeVariants as dr } from "./components/atoms/badge.js";
10
- import { Button as pr, buttonVariants as mr } from "./components/atoms/button.js";
11
- import { Card as xr, CardAction as Cr, CardContent as gr, CardDescription as Pr, CardFooter as Dr, CardHeader as Sr, CardTitle as Ar } from "./components/atoms/card.js";
12
- import { Carousel as Lr, CarouselContent as kr, CarouselItem as Ir, CarouselNext as Tr, CarouselPrevious as Mr } from "./components/atoms/carousel.js";
13
- import { Checkbox as Rr } from "./components/atoms/checkbox.js";
14
- import { Dialog as br, DialogClose as Fr, DialogContent as Br, DialogDescription as Er, DialogFooter as yr, DialogHeader as Hr, DialogOverlay as Or, DialogPortal as Nr, DialogTitle as Gr, DialogTrigger as Ur } from "./components/atoms/dialog.js";
15
- import { Drawer as zr, DrawerClose as jr, DrawerContent as qr, DrawerDescription as Jr, DrawerFooter as Kr, DrawerHeader as Qr, DrawerOverlay as Wr, DrawerPortal as Xr, DrawerTitle as Yr, DrawerTrigger as Zr } from "./components/atoms/drawer.js";
16
- import { Input as $r } from "./components/atoms/input.js";
17
- import { Label as ee } from "./components/atoms/label.js";
18
- import { Progress as te } from "./components/atoms/progress.js";
19
- import { RadioGroup as ie, RadioGroupItem as ne } from "./components/atoms/radio-group.js";
20
- import { ResizableHandle as le, ResizablePanel as ue, ResizablePanelGroup as de } from "./components/atoms/resizable.js";
21
- import { ScrollArea as pe, ScrollBar as me } from "./components/atoms/scroll-area.js";
22
- import { Select as xe, SelectContent as Ce, SelectGroup as ge, SelectItem as Pe, SelectLabel as De, SelectScrollDownButton as Se, SelectScrollUpButton as Ae, SelectSeparator as he, SelectTrigger as Le, SelectValue as ke } from "./components/atoms/select.js";
23
- import { Separator as Te } from "./components/atoms/separator.js";
24
- import { Sheet as we, SheetClose as Re, SheetContent as ve, SheetDescription as be, SheetFooter as Fe, SheetHeader as Be, SheetTitle as Ee, SheetTrigger as ye } from "./components/atoms/sheet.js";
25
- import { Toaster as Oe } from "./components/atoms/sonner.js";
26
- import { useRecentProducts as Ge } from "./hooks/user/useRecentProducts.js";
27
- import { useRecentShops as Ve } from "./hooks/user/useRecentShops.js";
28
- import { useSavedProducts as je } from "./hooks/user/useSavedProducts.js";
29
- import { useSavedProductsActions as Je } from "./hooks/user/useSavedProductsActions.js";
30
- import { useFollowedShops as Qe } from "./hooks/user/useFollowedShops.js";
31
- import { useFollowedShopsActions as Xe } from "./hooks/user/useFollowedShopsActions.js";
32
- import { useCurrentUser as Ze } from "./hooks/user/useCurrentUser.js";
33
- import { useOrders as $e } from "./hooks/user/useOrders.js";
34
- import { useBuyerAttributes as eo } from "./hooks/user/useBuyerAttributes.js";
35
- import { useProductListActions as to } from "./hooks/product/useProductListActions.js";
36
- import { useProductLists as io } from "./hooks/product/useProductLists.js";
37
- import { useProductList as co } from "./hooks/product/useProductList.js";
38
- import { useProduct as uo } from "./hooks/product/useProduct.js";
39
- import { useProducts as po } from "./hooks/product/useProducts.js";
40
- import { useProductVariants as fo } from "./hooks/product/useProductVariants.js";
41
- import { useProductMedia as Co } from "./hooks/product/useProductMedia.js";
42
- import { useProductSearch as Po } from "./hooks/product/useProductSearch.js";
43
- import { useRecommendedProducts as So } from "./hooks/product/useRecommendedProducts.js";
44
- import { usePopularProducts as ho } from "./hooks/product/usePopularProducts.js";
45
- import { useCuratedProducts as ko } from "./hooks/product/useCuratedProducts.js";
46
- import { useAsyncStorage as To } from "./hooks/storage/useAsyncStorage.js";
47
- import { useSecureStorage as wo } from "./hooks/storage/useSecureStorage.js";
48
- import { useImageUpload as vo } from "./hooks/storage/useImageUpload.js";
49
- import { useShopNavigation as Fo } from "./hooks/navigation/useShopNavigation.js";
50
- import { useCloseMini as Eo } from "./hooks/navigation/useCloseMini.js";
51
- import { useDeeplink as Ho } from "./hooks/navigation/useDeeplink.js";
52
- import { useShop as No } from "./hooks/shop/useShop.js";
53
- import { useShopCartActions as Uo } from "./hooks/shop/useShopCartActions.js";
54
- import { useRecommendedShops as zo } from "./hooks/shop/useRecommendedShops.js";
55
- import { useErrorToast as qo } from "./hooks/util/useErrorToast.js";
56
- import { useErrorScreen as Ko } from "./hooks/util/useErrorScreen.js";
57
- import { useShare as Wo } from "./hooks/util/useShare.js";
58
- import { useImagePicker as Yo } from "./hooks/util/useImagePicker.js";
59
- import { MiniEntityNotFoundError as _o, MiniError as $o, MiniNetworkError as rt, formatError as et } from "./utils/errors.js";
60
- import { parseUrl as tt } from "./utils/parseUrl.js";
61
- import { Consent as it, ConsentStatus as nt } from "./shop-minis-platform/src/types/permissions.js";
2
+ import { ProductCard as a } from "./components/commerce/product-card.js";
3
+ import { ProductLink as i } from "./components/commerce/product-link.js";
4
+ import { MerchantCard as s, MerchantCardPrimitive as m } from "./components/commerce/merchant-card.js";
5
+ import { Button as n } from "./components/atoms/button.js";
6
+ import { FavoriteButton as x } from "./components/atoms/favorite-button.js";
7
+ import { IconButton as d } from "./components/atoms/icon-button.js";
8
+ import { Touchable as S } from "./components/atoms/touchable.js";
9
+ import { Accordion as C, AccordionContent as A, AccordionItem as P, AccordionTrigger as h } from "./components/ui/accordion.js";
10
+ import { Alert as w, AlertDescription as v, AlertTitle as F } from "./components/ui/alert.js";
11
+ import { AlertDialog as I, AlertDialogAction as R, AlertDialogCancel as M, AlertDialogContent as B, AlertDialogDescription as E, AlertDialogFooter as k, AlertDialogHeader as y, AlertDialogOverlay as H, AlertDialogPortal as L, AlertDialogTitle as G, AlertDialogTrigger as N } from "./components/ui/alert-dialog.js";
12
+ import { Avatar as U, AvatarFallback as z, AvatarImage as V } from "./components/ui/avatar.js";
13
+ import { Card as q, CardAction as J, CardContent as K, CardDescription as Q, CardFooter as W, CardHeader as X, CardTitle as Y } from "./components/ui/card.js";
14
+ import { Carousel as _, CarouselContent as $, CarouselItem as rr, CarouselNext as er, CarouselPrevious as or } from "./components/ui/carousel.js";
15
+ import { Checkbox as ar } from "./components/ui/checkbox.js";
16
+ import { Dialog as ir, DialogClose as pr, DialogContent as sr, DialogDescription as mr, DialogFooter as ur, DialogHeader as nr, DialogOverlay as cr, DialogPortal as xr, DialogTitle as fr, DialogTrigger as dr } from "./components/ui/dialog.js";
17
+ import { Drawer as Sr, DrawerClose as Dr, DrawerContent as Cr, DrawerDescription as Ar, DrawerFooter as Pr, DrawerHeader as hr, DrawerOverlay as Tr, DrawerPortal as wr, DrawerTitle as vr, DrawerTrigger as Fr } from "./components/ui/drawer.js";
18
+ import { Input as Ir } from "./components/ui/input.js";
19
+ import { Label as Mr } from "./components/ui/label.js";
20
+ import { Progress as Er } from "./components/ui/progress.js";
21
+ import { RadioGroup as yr, RadioGroupItem as Hr } from "./components/ui/radio-group.js";
22
+ import { ResizableHandle as Gr, ResizablePanel as Nr, ResizablePanelGroup as Or } from "./components/ui/resizable.js";
23
+ import { ScrollArea as zr, ScrollBar as Vr } from "./components/ui/scroll-area.js";
24
+ import { Select as qr, SelectContent as Jr, SelectGroup as Kr, SelectItem as Qr, SelectLabel as Wr, SelectScrollDownButton as Xr, SelectScrollUpButton as Yr, SelectSeparator as Zr, SelectTrigger as _r, SelectValue as $r } from "./components/ui/select.js";
25
+ import { Separator as ee } from "./components/ui/separator.js";
26
+ import { Sheet as te, SheetClose as ae, SheetContent as le, SheetDescription as ie, SheetFooter as pe, SheetHeader as se, SheetTitle as me, SheetTrigger as ue } from "./components/ui/sheet.js";
27
+ import { Toaster as ce } from "./components/ui/sonner.js";
28
+ import { useRecentProducts as fe } from "./hooks/user/useRecentProducts.js";
29
+ import { useRecentShops as ge } from "./hooks/user/useRecentShops.js";
30
+ import { useSavedProducts as De } from "./hooks/user/useSavedProducts.js";
31
+ import { useSavedProductsActions as Ae } from "./hooks/user/useSavedProductsActions.js";
32
+ import { useFollowedShops as he } from "./hooks/user/useFollowedShops.js";
33
+ import { useFollowedShopsActions as we } from "./hooks/user/useFollowedShopsActions.js";
34
+ import { useCurrentUser as Fe } from "./hooks/user/useCurrentUser.js";
35
+ import { useOrders as Ie } from "./hooks/user/useOrders.js";
36
+ import { useBuyerAttributes as Me } from "./hooks/user/useBuyerAttributes.js";
37
+ import { useProductListActions as Ee } from "./hooks/product/useProductListActions.js";
38
+ import { useProductLists as ye } from "./hooks/product/useProductLists.js";
39
+ import { useProductList as Le } from "./hooks/product/useProductList.js";
40
+ import { useProduct as Ne } from "./hooks/product/useProduct.js";
41
+ import { useProducts as Ue } from "./hooks/product/useProducts.js";
42
+ import { useProductVariants as Ve } from "./hooks/product/useProductVariants.js";
43
+ import { useProductMedia as qe } from "./hooks/product/useProductMedia.js";
44
+ import { useProductSearch as Ke } from "./hooks/product/useProductSearch.js";
45
+ import { useRecommendedProducts as We } from "./hooks/product/useRecommendedProducts.js";
46
+ import { usePopularProducts as Ye } from "./hooks/product/usePopularProducts.js";
47
+ import { useCuratedProducts as _e } from "./hooks/product/useCuratedProducts.js";
48
+ import { useAsyncStorage as ro } from "./hooks/storage/useAsyncStorage.js";
49
+ import { useSecureStorage as oo } from "./hooks/storage/useSecureStorage.js";
50
+ import { useImageUpload as ao } from "./hooks/storage/useImageUpload.js";
51
+ import { useShopNavigation as io } from "./hooks/navigation/useShopNavigation.js";
52
+ import { useCloseMini as so } from "./hooks/navigation/useCloseMini.js";
53
+ import { useDeeplink as uo } from "./hooks/navigation/useDeeplink.js";
54
+ import { useShop as co } from "./hooks/shop/useShop.js";
55
+ import { useShopCartActions as fo } from "./hooks/shop/useShopCartActions.js";
56
+ import { useRecommendedShops as So } from "./hooks/shop/useRecommendedShops.js";
57
+ import { useErrorToast as Co } from "./hooks/util/useErrorToast.js";
58
+ import { useErrorScreen as Po } from "./hooks/util/useErrorScreen.js";
59
+ import { useShare as To } from "./hooks/util/useShare.js";
60
+ import { useImagePicker as vo } from "./hooks/util/useImagePicker.js";
61
+ import { MiniEntityNotFoundError as bo, MiniError as Io, MiniNetworkError as Ro, formatError as Mo } from "./utils/errors.js";
62
+ import { parseUrl as Eo } from "./utils/parseUrl.js";
63
+ import { Consent as yo, ConsentStatus as Ho } from "./shop-minis-platform/src/types/permissions.js";
62
64
  export {
63
- N as Accordion,
64
- G as AccordionContent,
65
- U as AccordionItem,
66
- V as AccordionTrigger,
67
- j as Alert,
68
- q as AlertDescription,
69
- Q as AlertDialog,
70
- W as AlertDialogAction,
71
- X as AlertDialogCancel,
72
- Y as AlertDialogContent,
73
- Z as AlertDialogDescription,
74
- _ as AlertDialogFooter,
75
- $ as AlertDialogHeader,
76
- rr as AlertDialogOverlay,
77
- er as AlertDialogPortal,
78
- or as AlertDialogTitle,
79
- tr as AlertDialogTrigger,
80
- J as AlertTitle,
81
- ir as Avatar,
82
- nr as AvatarFallback,
83
- cr as AvatarImage,
84
- ur as Badge,
85
- pr as Button,
86
- xr as Card,
87
- Cr as CardAction,
88
- gr as CardContent,
89
- Pr as CardDescription,
90
- Dr as CardFooter,
91
- Sr as CardHeader,
92
- Ar as CardTitle,
93
- Lr as Carousel,
94
- kr as CarouselContent,
95
- Ir as CarouselItem,
96
- Tr as CarouselNext,
97
- Mr as CarouselPrevious,
98
- Rr as Checkbox,
99
- it as Consent,
100
- nt as ConsentStatus,
101
- br as Dialog,
102
- Fr as DialogClose,
103
- Br as DialogContent,
104
- Er as DialogDescription,
105
- yr as DialogFooter,
106
- Hr as DialogHeader,
107
- Or as DialogOverlay,
108
- Nr as DialogPortal,
109
- Gr as DialogTitle,
110
- Ur as DialogTrigger,
111
- zr as Drawer,
112
- jr as DrawerClose,
113
- qr as DrawerContent,
114
- Jr as DrawerDescription,
115
- Kr as DrawerFooter,
116
- Qr as DrawerHeader,
117
- Wr as DrawerOverlay,
118
- Xr as DrawerPortal,
119
- Yr as DrawerTitle,
120
- Zr as DrawerTrigger,
121
- $r as Input,
122
- ee as Label,
123
- w as MerchantCard,
124
- R as MerchantCardImage,
125
- v as MerchantCardImageContainer,
126
- b as MerchantCardInfo,
127
- F as MerchantCardLogo,
128
- B as MerchantCardName,
129
- E as MerchantCardPrimitive,
130
- y as MerchantCardRating,
131
- H as MerchantCardRoot,
132
- _o as MiniEntityNotFoundError,
133
- $o as MiniError,
134
- rt as MiniNetworkError,
65
+ C as Accordion,
66
+ A as AccordionContent,
67
+ P as AccordionItem,
68
+ h as AccordionTrigger,
69
+ w as Alert,
70
+ v as AlertDescription,
71
+ I as AlertDialog,
72
+ R as AlertDialogAction,
73
+ M as AlertDialogCancel,
74
+ B as AlertDialogContent,
75
+ E as AlertDialogDescription,
76
+ k as AlertDialogFooter,
77
+ y as AlertDialogHeader,
78
+ H as AlertDialogOverlay,
79
+ L as AlertDialogPortal,
80
+ G as AlertDialogTitle,
81
+ N as AlertDialogTrigger,
82
+ F as AlertTitle,
83
+ U as Avatar,
84
+ z as AvatarFallback,
85
+ V as AvatarImage,
86
+ n as Button,
87
+ q as Card,
88
+ J as CardAction,
89
+ K as CardContent,
90
+ Q as CardDescription,
91
+ W as CardFooter,
92
+ X as CardHeader,
93
+ Y as CardTitle,
94
+ _ as Carousel,
95
+ $ as CarouselContent,
96
+ rr as CarouselItem,
97
+ er as CarouselNext,
98
+ or as CarouselPrevious,
99
+ ar as Checkbox,
100
+ yo as Consent,
101
+ Ho as ConsentStatus,
102
+ ir as Dialog,
103
+ pr as DialogClose,
104
+ sr as DialogContent,
105
+ mr as DialogDescription,
106
+ ur as DialogFooter,
107
+ nr as DialogHeader,
108
+ cr as DialogOverlay,
109
+ xr as DialogPortal,
110
+ fr as DialogTitle,
111
+ dr as DialogTrigger,
112
+ Sr as Drawer,
113
+ Dr as DrawerClose,
114
+ Cr as DrawerContent,
115
+ Ar as DrawerDescription,
116
+ Pr as DrawerFooter,
117
+ hr as DrawerHeader,
118
+ Tr as DrawerOverlay,
119
+ wr as DrawerPortal,
120
+ vr as DrawerTitle,
121
+ Fr as DrawerTrigger,
122
+ x as FavoriteButton,
123
+ d as IconButton,
124
+ Ir as Input,
125
+ Mr as Label,
126
+ s as MerchantCard,
127
+ m as MerchantCardPrimitive,
128
+ bo as MiniEntityNotFoundError,
129
+ Io as MiniError,
130
+ Ro as MiniNetworkError,
135
131
  o as MinisContainer,
136
132
  a as ProductCard,
137
- i as ProductCardBadge,
138
- n as ProductCardCurrentPrice,
139
- c as ProductCardFavoriteButton,
140
- l as ProductCardImage,
141
- u as ProductCardImageContainer,
142
- d as ProductCardInfo,
143
- s as ProductCardOriginalPrice,
144
- p as ProductCardPrice,
145
- m as ProductCardRoot,
146
- f as ProductCardTitle,
147
- C as ProductLink,
148
- g as ProductLinkActions,
149
- P as ProductLinkCurrentPrice,
150
- D as ProductLinkDiscountPrice,
151
- S as ProductLinkImage,
152
- A as ProductLinkInfo,
153
- h as ProductLinkOriginalPrice,
154
- L as ProductLinkPrice,
155
- k as ProductLinkRating,
156
- I as ProductLinkRoot,
157
- T as ProductLinkTitle,
158
- te as Progress,
159
- ie as RadioGroup,
160
- ne as RadioGroupItem,
161
- le as ResizableHandle,
162
- ue as ResizablePanel,
163
- de as ResizablePanelGroup,
164
- pe as ScrollArea,
165
- me as ScrollBar,
166
- xe as Select,
167
- Ce as SelectContent,
168
- ge as SelectGroup,
169
- Pe as SelectItem,
170
- De as SelectLabel,
171
- Se as SelectScrollDownButton,
172
- Ae as SelectScrollUpButton,
173
- he as SelectSeparator,
174
- Le as SelectTrigger,
175
- ke as SelectValue,
176
- Te as Separator,
177
- we as Sheet,
178
- Re as SheetClose,
179
- ve as SheetContent,
180
- be as SheetDescription,
181
- Fe as SheetFooter,
182
- Be as SheetHeader,
183
- Ee as SheetTitle,
184
- ye as SheetTrigger,
185
- Oe as Toaster,
186
- dr as badgeVariants,
187
- mr as buttonVariants,
188
- et as formatError,
189
- tt as parseUrl,
190
- To as useAsyncStorage,
191
- eo as useBuyerAttributes,
192
- Eo as useCloseMini,
193
- ko as useCuratedProducts,
194
- Ze as useCurrentUser,
195
- Ho as useDeeplink,
196
- Ko as useErrorScreen,
197
- qo as useErrorToast,
198
- Qe as useFollowedShops,
199
- Xe as useFollowedShopsActions,
200
- Yo as useImagePicker,
201
- vo as useImageUpload,
202
- $e as useOrders,
203
- ho as usePopularProducts,
204
- uo as useProduct,
205
- co as useProductList,
206
- to as useProductListActions,
207
- io as useProductLists,
208
- Co as useProductMedia,
209
- Po as useProductSearch,
210
- fo as useProductVariants,
211
- po as useProducts,
212
- Ge as useRecentProducts,
213
- Ve as useRecentShops,
214
- So as useRecommendedProducts,
215
- zo as useRecommendedShops,
216
- je as useSavedProducts,
217
- Je as useSavedProductsActions,
218
- wo as useSecureStorage,
219
- Wo as useShare,
220
- No as useShop,
221
- Uo as useShopCartActions,
222
- Fo as useShopNavigation
133
+ i as ProductLink,
134
+ Er as Progress,
135
+ yr as RadioGroup,
136
+ Hr as RadioGroupItem,
137
+ Gr as ResizableHandle,
138
+ Nr as ResizablePanel,
139
+ Or as ResizablePanelGroup,
140
+ zr as ScrollArea,
141
+ Vr as ScrollBar,
142
+ qr as Select,
143
+ Jr as SelectContent,
144
+ Kr as SelectGroup,
145
+ Qr as SelectItem,
146
+ Wr as SelectLabel,
147
+ Xr as SelectScrollDownButton,
148
+ Yr as SelectScrollUpButton,
149
+ Zr as SelectSeparator,
150
+ _r as SelectTrigger,
151
+ $r as SelectValue,
152
+ ee as Separator,
153
+ te as Sheet,
154
+ ae as SheetClose,
155
+ le as SheetContent,
156
+ ie as SheetDescription,
157
+ pe as SheetFooter,
158
+ se as SheetHeader,
159
+ me as SheetTitle,
160
+ ue as SheetTrigger,
161
+ ce as Toaster,
162
+ S as Touchable,
163
+ Mo as formatError,
164
+ Eo as parseUrl,
165
+ ro as useAsyncStorage,
166
+ Me as useBuyerAttributes,
167
+ so as useCloseMini,
168
+ _e as useCuratedProducts,
169
+ Fe as useCurrentUser,
170
+ uo as useDeeplink,
171
+ Po as useErrorScreen,
172
+ Co as useErrorToast,
173
+ he as useFollowedShops,
174
+ we as useFollowedShopsActions,
175
+ vo as useImagePicker,
176
+ ao as useImageUpload,
177
+ Ie as useOrders,
178
+ Ye as usePopularProducts,
179
+ Ne as useProduct,
180
+ Le as useProductList,
181
+ Ee as useProductListActions,
182
+ ye as useProductLists,
183
+ qe as useProductMedia,
184
+ Ke as useProductSearch,
185
+ Ve as useProductVariants,
186
+ Ue as useProducts,
187
+ fe as useRecentProducts,
188
+ ge as useRecentShops,
189
+ We as useRecommendedProducts,
190
+ So as useRecommendedShops,
191
+ De as useSavedProducts,
192
+ Ae as useSavedProductsActions,
193
+ oo as useSecureStorage,
194
+ To as useShare,
195
+ co as useShop,
196
+ fo as useShopCartActions,
197
+ io as useShopNavigation
223
198
  };
224
199
  //# 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { s as r } from "../../../../../../../../_virtual/index3.js";
1
+ import { s as r } from "../../../../../../../../_virtual/index2.js";
2
2
  function s() {
3
3
  return r.useSyncExternalStore(
4
4
  e,
@@ -1,4 +1,4 @@
1
- import { __exports as i } from "../../../../../../_virtual/index2.js";
1
+ import { __exports as i } from "../../../../../../_virtual/index3.js";
2
2
  var c;
3
3
  function d() {
4
4
  if (c) return i;
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.16",
4
+ "version": "0.0.18",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "engines": {
@@ -18,7 +18,6 @@
18
18
  "files": [
19
19
  "src/**/*.{ts,tsx,css}",
20
20
  "dist/**/*",
21
- "tailwind.config.js",
22
21
  "README.md",
23
22
  "LICENSE.txt"
24
23
  ],
@@ -28,10 +27,8 @@
28
27
  "import": "./src/index.ts",
29
28
  "types": "./src/index.ts"
30
29
  },
31
- "./mocks": "./src/mocks.ts",
32
30
  "./styles": "./src/index.css",
33
- "./tailwind": "./tailwind.config.js",
34
- "./tailwind.config": "./tailwind.config.js",
31
+ "./mocks": "./src/mocks.ts",
35
32
  "./src/*": "./src/*"
36
33
  },
37
34
  "peerDependencies": {
@@ -41,13 +38,14 @@
41
38
  "typescript": ">=5.0.0"
42
39
  },
43
40
  "dependencies": {
41
+ "@shopify/shop-minis-platform": "0.0.3",
44
42
  "@tailwindcss/vite": "4.1.8",
45
43
  "@types/url-parse": "1.4.9",
46
44
  "@vitejs/plugin-react": "4.5.1",
47
- "@shopify/shop-minis-platform": "0.0.3",
48
45
  "class-variance-authority": "0.7.1",
49
46
  "clsx": "2.1.1",
50
47
  "embla-carousel-react": "8.6.0",
48
+ "lodash": "4.17.21",
51
49
  "lucide-react": "0.513.0",
52
50
  "motion": "12.17.3",
53
51
  "next-themes": "0.4.6",
@@ -58,13 +56,12 @@
58
56
  "tailwindcss": "4.1.8",
59
57
  "tw-animate-css": "1.3.4",
60
58
  "url-parse": "1.5.10",
61
- "vaul": "1.1.2",
62
- "lodash": "4.17.21"
59
+ "vaul": "1.1.2"
63
60
  },
64
61
  "devDependencies": {
65
62
  "@shopify/generate-docs": "^0.16.6",
66
63
  "@types/node": "^20.12.1",
67
- "@types/react": "^19.1.2",
64
+ "@types/react": "^19.1.6",
68
65
  "@types/react-dom": "^19.1.2",
69
66
  "react": "^19.1.0",
70
67
  "react-dom": "^19.1.0",
@@ -1,71 +1,13 @@
1
- import * as React from 'react'
1
+ import React from 'react'
2
2
 
3
- import {cva, type VariantProps} from 'class-variance-authority'
4
- import {Slot as SlotPrimitive} from 'radix-ui'
3
+ import {VariantProps} from 'class-variance-authority'
5
4
 
6
5
  import {cn} from '../../lib/utils'
6
+ import {BaseButton, buttonVariants} from '../ui/button'
7
7
 
8
8
  import {Touchable} from './touchable'
9
9
 
10
- const buttonVariants = cva(
11
- "flex w-full items-center justify-center gap-3 whitespace-nowrap rounded-xl text-base font-semibold disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-5 shrink-0 [&_svg]:shrink-0",
12
- {
13
- variants: {
14
- variant: {
15
- primary:
16
- 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
17
- secondary: 'bg-slate-900 text-white shadow-xs hover:bg-slate-800',
18
- tertiary:
19
- 'bg-slate-100 text-slate-900 shadow-xs hover:bg-slate-200 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700',
20
- blurred:
21
- 'bg-black/20 text-white shadow-xs hover:bg-black/30 backdrop-blur-md border border-white/20',
22
- text: 'bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground',
23
- borderless: 'bg-transparent text-primary hover:text-primary/80',
24
- borderlessUnbranded:
25
- 'bg-transparent text-foreground hover:text-foreground/80',
26
- outlined:
27
- 'border border-border bg-background text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground',
28
- dangerous:
29
- 'bg-destructive text-white shadow-xs hover:bg-destructive/90',
30
- 'outlined-dangerous':
31
- 'border border-destructive bg-transparent text-destructive shadow-xs hover:bg-destructive/10',
32
- },
33
- size: {
34
- default: 'h-9 px-4 py-2 has-[>svg]:px-3',
35
- sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
36
- lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
37
- icon: 'size-9',
38
- },
39
- },
40
- defaultVariants: {
41
- variant: 'primary',
42
- size: 'default',
43
- },
44
- }
45
- )
46
-
47
- function BaseButton({
48
- className,
49
- variant,
50
- size,
51
- asChild = false,
52
- ...props
53
- }: React.ComponentProps<'button'> &
54
- VariantProps<typeof buttonVariants> & {
55
- asChild?: boolean
56
- }) {
57
- const Comp = asChild ? SlotPrimitive.Slot : 'button'
58
-
59
- return (
60
- <Comp
61
- data-slot="button"
62
- className={cn(buttonVariants({variant, size, className}))}
63
- {...props}
64
- />
65
- )
66
- }
67
-
68
- function Button({
10
+ export function Button({
69
11
  className,
70
12
  variant,
71
13
  size,
@@ -81,14 +23,18 @@ function Button({
81
23
  [onClick]
82
24
  )
83
25
 
26
+ const wrapperClassName = cn(
27
+ variant === 'icon' ? 'flex w-auto' : 'flex w-full'
28
+ )
29
+
84
30
  return (
85
31
  <Touchable
86
32
  onClick={handleClick}
87
33
  stopPropagation={stopPropagation}
88
- className={size === 'icon' ? 'flex w-auto' : 'flex w-full'}
34
+ className={wrapperClassName}
89
35
  >
90
36
  <BaseButton
91
- className={className}
37
+ className={cn(className, wrapperClassName)}
92
38
  variant={variant}
93
39
  size={size}
94
40
  {...props}
@@ -96,5 +42,3 @@ function Button({
96
42
  </Touchable>
97
43
  )
98
44
  }
99
-
100
- export {Button, buttonVariants}
@@ -0,0 +1,22 @@
1
+ import {Heart} from 'lucide-react'
2
+
3
+ import {IconButton} from './icon-button'
4
+
5
+ export function FavoriteButton({
6
+ onClick,
7
+ filled = false,
8
+ }: {
9
+ onClick?: () => void
10
+ filled?: boolean
11
+ }) {
12
+ return (
13
+ <IconButton
14
+ Icon={Heart}
15
+ filled={filled}
16
+ onClick={onClick}
17
+ buttonStyles={
18
+ filled ? 'bg-primary' : 'bg-button-overlay/30 backdrop-blur-sm'
19
+ }
20
+ />
21
+ )
22
+ }