@shopify/shop-minis-react 0.0.3 → 0.0.4

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.
@@ -0,0 +1,297 @@
1
+ import { jsxs as p, jsx as r, Fragment as M } from "react/jsx-runtime";
2
+ import * as b from "react";
3
+ import { cva as U } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { useShopNavigation as E } from "../../hooks/navigation/useShopNavigation.js";
5
+ import { useSavedProductsActions as G } from "../../hooks/user/useSavedProductsActions.js";
6
+ import { formatMoney as f } from "../../lib/formatMoney.js";
7
+ import { cn as o } from "../../lib/utils.js";
8
+ import { Badge as J } from "../ui/badge.js";
9
+ import { Button as K } from "../ui/button.js";
10
+ import { Icon as Q } from "../ui/icon.js";
11
+ import { Touchable as B } from "../ui/touchable.js";
12
+ import { Root as V } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js";
13
+ const W = U(
14
+ "relative overflow-hidden rounded-xl border border-gray-200",
15
+ {
16
+ variants: {
17
+ variant: {
18
+ default: "",
19
+ priceOverlay: "",
20
+ compact: ""
21
+ },
22
+ touchable: {
23
+ true: "cursor-pointer",
24
+ false: ""
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ variant: "default",
29
+ touchable: !0
30
+ }
31
+ }
32
+ );
33
+ function X({
34
+ className: e,
35
+ variant: t,
36
+ touchable: a = !0,
37
+ asChild: c = !1,
38
+ onPress: i,
39
+ ...h
40
+ }) {
41
+ const n = /* @__PURE__ */ r(
42
+ c ? V : "div",
43
+ {
44
+ className: o(
45
+ W({ variant: t, touchable: a }),
46
+ "border-0",
47
+ e
48
+ ),
49
+ ...h
50
+ }
51
+ );
52
+ return a && i ? /* @__PURE__ */ r(B, { onPress: i, asChild: !0, children: n }) : n;
53
+ }
54
+ function Y({
55
+ className: e,
56
+ variant: t = "default",
57
+ ...a
58
+ }) {
59
+ return /* @__PURE__ */ r(
60
+ "div",
61
+ {
62
+ "data-slot": "product-card-image-container",
63
+ className: o(
64
+ "relative overflow-hidden rounded-xl border border-gray-200",
65
+ "w-full aspect-square",
66
+ t === "compact" ? "min-h-[104px]" : "min-h-[134px]",
67
+ e
68
+ ),
69
+ ...a
70
+ }
71
+ );
72
+ }
73
+ function Z({
74
+ className: e,
75
+ src: t,
76
+ alt: a,
77
+ ...c
78
+ }) {
79
+ return /* @__PURE__ */ r("div", { className: "w-full h-full bg-gray-100 flex items-center justify-center", children: t ? /* @__PURE__ */ r(
80
+ "img",
81
+ {
82
+ "data-slot": "product-card-image",
83
+ src: t,
84
+ alt: a,
85
+ className: o("w-full h-full object-cover", e),
86
+ ...c
87
+ }
88
+ ) : /* @__PURE__ */ r("div", { className: "text-gray-400 text-sm", children: "No Image" }) });
89
+ }
90
+ function j({
91
+ className: e,
92
+ position: t = "bottom-left",
93
+ children: a,
94
+ ...c
95
+ }) {
96
+ return /* @__PURE__ */ r(
97
+ "div",
98
+ {
99
+ className: o(
100
+ "absolute z-10",
101
+ t === "top-left" ? "top-3 left-3" : "bottom-2 left-2"
102
+ ),
103
+ children: /* @__PURE__ */ r(
104
+ J,
105
+ {
106
+ className: o("bg-black/50 text-white rounded", e),
107
+ ...c,
108
+ children: a
109
+ }
110
+ )
111
+ }
112
+ );
113
+ }
114
+ function _({
115
+ className: e,
116
+ onPress: t,
117
+ filled: a = !1,
118
+ icon: c = "Heart",
119
+ ...i
120
+ }) {
121
+ return /* @__PURE__ */ r("div", { className: o("absolute bottom-3 right-3 z-10", e), ...i, children: /* @__PURE__ */ r(B, { onPress: t, asChild: !0, children: /* @__PURE__ */ r(
122
+ K,
123
+ {
124
+ variant: "secondary",
125
+ size: "icon",
126
+ className: o(
127
+ "h-8 w-8 rounded-full border-0 shadow-sm",
128
+ a ? "bg-primary" : "bg-grayscale-l6/60 backdrop-blur-sm"
129
+ ),
130
+ children: /* @__PURE__ */ r(Q, { name: c, filled: a, className: "h-4 w-4 text-white" })
131
+ }
132
+ ) }) });
133
+ }
134
+ function $({
135
+ className: e,
136
+ variant: t = "default",
137
+ ...a
138
+ }) {
139
+ return t !== "default" ? null : /* @__PURE__ */ r(
140
+ "div",
141
+ {
142
+ "data-slot": "product-card-info",
143
+ className: o("px-1 pt-2 pb-0 space-y-1", e),
144
+ ...a
145
+ }
146
+ );
147
+ }
148
+ function tt({
149
+ className: e,
150
+ children: t,
151
+ ...a
152
+ }) {
153
+ return /* @__PURE__ */ r(
154
+ "h3",
155
+ {
156
+ "data-slot": "product-card-title",
157
+ className: o(
158
+ "text-sm font-medium leading-tight text-gray-900",
159
+ "truncate overflow-hidden whitespace-nowrap text-ellipsis",
160
+ e
161
+ ),
162
+ ...a,
163
+ children: t
164
+ }
165
+ );
166
+ }
167
+ function rt({ className: e, ...t }) {
168
+ return /* @__PURE__ */ r(
169
+ "div",
170
+ {
171
+ "data-slot": "product-card-price",
172
+ className: o("flex items-center gap-2", e),
173
+ ...t
174
+ }
175
+ );
176
+ }
177
+ function k({
178
+ className: e,
179
+ ...t
180
+ }) {
181
+ return /* @__PURE__ */ r(
182
+ "span",
183
+ {
184
+ "data-slot": "product-card-current-price",
185
+ className: o("text-sm font-semibold text-gray-900", e),
186
+ ...t
187
+ }
188
+ );
189
+ }
190
+ function et({
191
+ className: e,
192
+ ...t
193
+ }) {
194
+ return /* @__PURE__ */ r(
195
+ "span",
196
+ {
197
+ "data-slot": "product-card-original-price",
198
+ className: o("text-sm text-gray-500 line-through", e),
199
+ ...t
200
+ }
201
+ );
202
+ }
203
+ function ht({
204
+ product: e,
205
+ selectedProductVariant: t,
206
+ variant: a = "default",
207
+ touchable: c = !0,
208
+ badgeText: i,
209
+ badgeVariant: h = "secondary",
210
+ onFavoriteToggled: m
211
+ }) {
212
+ const { navigateToProduct: n } = E(), { saveProduct: x, unsaveProduct: P } = G(), {
213
+ id: d,
214
+ title: N,
215
+ featuredImage: F,
216
+ price: z,
217
+ compareAtPrice: O,
218
+ isFavorited: R,
219
+ defaultVariantId: g,
220
+ shop: v
221
+ } = e, I = t?.image || F, w = t?.price || z, A = t?.compareAtPrice || O, [y, S] = b.useState(R), s = w?.currencyCode, l = w?.amount, L = I?.url, T = I?.altText || N, C = A?.amount, q = C && C !== l, D = b.useCallback(() => {
222
+ c && n({
223
+ productId: d
224
+ });
225
+ }, [n, d, c]), H = b.useCallback(async () => {
226
+ const u = y;
227
+ S(!u), m?.(!u);
228
+ try {
229
+ u ? await P({
230
+ productId: d,
231
+ shopId: v.id,
232
+ productVariantId: t?.id || g
233
+ }) : await x({
234
+ productId: d,
235
+ shopId: v.id,
236
+ productVariantId: t?.id || g
237
+ });
238
+ } catch {
239
+ S(u), m?.(u);
240
+ }
241
+ }, [
242
+ y,
243
+ d,
244
+ v.id,
245
+ t?.id,
246
+ g,
247
+ x,
248
+ P,
249
+ m
250
+ ]);
251
+ return /* @__PURE__ */ p(
252
+ X,
253
+ {
254
+ variant: a,
255
+ touchable: c,
256
+ onPress: D,
257
+ children: [
258
+ /* @__PURE__ */ p(Y, { variant: a, children: [
259
+ /* @__PURE__ */ r(Z, { src: L, alt: T }),
260
+ a === "priceOverlay" && s && l && /* @__PURE__ */ r(j, { position: "top-left", children: f(l, s) }),
261
+ i && /* @__PURE__ */ r(j, { position: "bottom-left", variant: h, children: i }),
262
+ /* @__PURE__ */ r(
263
+ _,
264
+ {
265
+ filled: y,
266
+ onPress: H
267
+ }
268
+ )
269
+ ] }),
270
+ /* @__PURE__ */ p($, { variant: a, children: [
271
+ /* @__PURE__ */ r(tt, { children: N }),
272
+ /* @__PURE__ */ r(rt, { children: q ? /* @__PURE__ */ p(M, { children: [
273
+ /* @__PURE__ */ r(k, { children: f(l, s) }),
274
+ /* @__PURE__ */ r(et, { children: f(
275
+ C,
276
+ A?.currencyCode || s
277
+ ) })
278
+ ] }) : /* @__PURE__ */ r(k, { children: f(l, s) }) })
279
+ ] })
280
+ ]
281
+ }
282
+ );
283
+ }
284
+ export {
285
+ ht as ProductCard,
286
+ j as ProductCardBadge,
287
+ k as ProductCardCurrentPrice,
288
+ _ as ProductCardFavoriteButton,
289
+ Z as ProductCardImage,
290
+ Y as ProductCardImageContainer,
291
+ $ as ProductCardInfo,
292
+ et as ProductCardOriginalPrice,
293
+ rt as ProductCardPrice,
294
+ X as ProductCardRoot,
295
+ tt as ProductCardTitle
296
+ };
297
+ //# sourceMappingURL=product-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-card.js","sources":["../../../src/components/commerce/product-card.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {useSavedProductsActions} from '../../hooks/user/useSavedProductsActions'\nimport {formatMoney} from '../../lib/formatMoney'\nimport {cn} from '../../lib/utils'\nimport {\n type Product,\n type ProductVariant,\n} from '../../types/minisSDK.generated.d'\nimport {Badge} from '../ui/badge'\nimport {Button} from '../ui/button'\nimport {Icon, type LucideIconName} from '../ui/icon'\nimport {Touchable} from '../ui/touchable'\n\nconst productCardVariants = cva(\n 'relative overflow-hidden rounded-xl border border-gray-200',\n {\n variants: {\n variant: {\n default: '',\n priceOverlay: '',\n compact: '',\n },\n touchable: {\n true: 'cursor-pointer',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n touchable: true,\n },\n }\n)\n\n// Primitive components (building blocks)\nexport interface ProductCardRootProps\n extends React.ComponentProps<'div'>,\n VariantProps<typeof productCardVariants> {\n variant?: 'default' | 'priceOverlay' | 'compact'\n touchable?: boolean\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction ProductCardRoot({\n className,\n variant,\n touchable = true,\n asChild = false,\n onPress,\n ...props\n}: ProductCardRootProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div'\n\n const content = (\n <Comp\n className={cn(\n productCardVariants({variant, touchable}),\n 'border-0',\n className\n )}\n {...props}\n />\n )\n\n if (touchable && onPress) {\n return (\n <Touchable onPress={onPress} asChild>\n {content}\n </Touchable>\n )\n }\n\n return content\n}\n\nfunction ProductCardImageContainer({\n className,\n variant = 'default',\n ...props\n}: React.ComponentProps<'div'> & {\n variant?: 'default' | 'priceOverlay' | 'compact'\n}) {\n return (\n <div\n data-slot=\"product-card-image-container\"\n className={cn(\n 'relative overflow-hidden rounded-xl border border-gray-200',\n 'w-full aspect-square',\n variant === 'compact' ? 'min-h-[104px]' : 'min-h-[134px]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductCardImage({\n className,\n src,\n alt,\n ...props\n}: React.ComponentProps<'img'> & {\n src?: string\n alt?: string\n}) {\n return (\n <div className=\"w-full h-full bg-gray-100 flex items-center justify-center\">\n {src ? (\n <img\n data-slot=\"product-card-image\"\n src={src}\n alt={alt}\n className={cn('w-full h-full object-cover', className)}\n {...props}\n />\n ) : (\n <div className=\"text-gray-400 text-sm\">No Image</div>\n )}\n </div>\n )\n}\n\nfunction ProductCardBadge({\n className,\n position = 'bottom-left',\n children,\n ...props\n}: React.ComponentProps<typeof Badge> & {\n position?: 'top-left' | 'bottom-left'\n}) {\n return (\n <div\n className={cn(\n 'absolute z-10',\n position === 'top-left' ? 'top-3 left-3' : 'bottom-2 left-2'\n )}\n >\n <Badge\n className={cn('bg-black/50 text-white rounded', className)}\n {...props}\n >\n {children}\n </Badge>\n </div>\n )\n}\n\nfunction ProductCardFavoriteButton({\n className,\n onPress,\n filled = false,\n icon = 'Heart',\n ...props\n}: React.ComponentProps<'div'> & {\n onPress?: () => void\n filled?: boolean\n icon?: LucideIconName\n}) {\n return (\n <div className={cn('absolute bottom-3 right-3 z-10', className)} {...props}>\n <Touchable onPress={onPress} asChild>\n <Button\n variant=\"secondary\"\n size=\"icon\"\n className={cn(\n 'h-8 w-8 rounded-full border-0 shadow-sm',\n filled ? 'bg-primary' : 'bg-grayscale-l6/60 backdrop-blur-sm'\n )}\n >\n <Icon name={icon} filled={filled} className=\"h-4 w-4 text-white\" />\n </Button>\n </Touchable>\n </div>\n )\n}\n\nfunction ProductCardInfo({\n className,\n variant = 'default',\n ...props\n}: React.ComponentProps<'div'> & {\n variant?: 'default' | 'priceOverlay' | 'compact'\n}) {\n if (variant !== 'default') {\n return null\n }\n\n return (\n <div\n data-slot=\"product-card-info\"\n className={cn('px-1 pt-2 pb-0 space-y-1', className)}\n {...props}\n />\n )\n}\n\nfunction ProductCardTitle({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"product-card-title\"\n className={cn(\n 'text-sm font-medium leading-tight text-gray-900',\n 'truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction ProductCardPrice({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-card-price\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n}\n\nfunction ProductCardCurrentPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-card-current-price\"\n className={cn('text-sm font-semibold text-gray-900', className)}\n {...props}\n />\n )\n}\n\nfunction ProductCardOriginalPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-card-original-price\"\n className={cn('text-sm text-gray-500 line-through', className)}\n {...props}\n />\n )\n}\n\nexport interface ProductCardProps {\n product: Product\n selectedProductVariant?: ProductVariant\n variant?: 'default' | 'priceOverlay' | 'compact'\n touchable?: boolean\n badgeText?: string\n badgeVariant?: 'default' | 'secondary' | 'destructive' | 'outline'\n onFavoriteToggled?: (isFavorited: boolean) => void\n sectionId?: string\n}\n\n// Composed ProductCard component\nfunction ProductCard({\n product,\n selectedProductVariant,\n variant = 'default',\n touchable = true,\n badgeText,\n badgeVariant = 'secondary',\n onFavoriteToggled,\n}: ProductCardProps) {\n const {navigateToProduct} = useShopNavigation()\n const {saveProduct, unsaveProduct} = useSavedProductsActions()\n\n const {\n id,\n title,\n featuredImage,\n price,\n compareAtPrice,\n isFavorited,\n defaultVariantId,\n shop,\n } = product\n\n // Use selected variant data if available\n const displayImage = selectedProductVariant?.image || featuredImage\n const displayPrice = selectedProductVariant?.price || price\n const displayCompareAtPrice =\n selectedProductVariant?.compareAtPrice || compareAtPrice\n\n // Local state for optimistic UI updates\n const [isFavoritedLocal, setIsFavoritedLocal] = React.useState(isFavorited)\n\n const currencyCode = displayPrice?.currencyCode\n const amount = displayPrice?.amount\n const imageUrl = displayImage?.url\n const imageAltText = displayImage?.altText || title\n const compareAtPriceAmount = displayCompareAtPrice?.amount\n const hasDiscount = compareAtPriceAmount && compareAtPriceAmount !== amount\n\n const handlePress = React.useCallback(() => {\n if (!touchable) return\n\n navigateToProduct({\n productId: id,\n })\n }, [navigateToProduct, id, touchable])\n\n const handleFavoritePress = React.useCallback(async () => {\n const previousState = isFavoritedLocal\n\n // Optimistic update\n setIsFavoritedLocal(!previousState)\n onFavoriteToggled?.(!previousState)\n\n try {\n if (previousState) {\n await unsaveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedProductVariant?.id || defaultVariantId,\n })\n } else {\n await saveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedProductVariant?.id || defaultVariantId,\n })\n }\n } catch (error) {\n // Revert optimistic update on error\n setIsFavoritedLocal(previousState)\n onFavoriteToggled?.(previousState)\n }\n }, [\n isFavoritedLocal,\n id,\n shop.id,\n selectedProductVariant?.id,\n defaultVariantId,\n saveProduct,\n unsaveProduct,\n onFavoriteToggled,\n ])\n\n return (\n <ProductCardRoot\n variant={variant}\n touchable={touchable}\n onPress={handlePress}\n >\n <ProductCardImageContainer variant={variant}>\n <ProductCardImage src={imageUrl} alt={imageAltText} />\n\n {/* Price overlay badge for priceOverlay variant */}\n {variant === 'priceOverlay' && currencyCode && amount && (\n <ProductCardBadge position=\"top-left\">\n {formatMoney(amount, currencyCode)}\n </ProductCardBadge>\n )}\n\n {/* Custom badge */}\n {badgeText && (\n <ProductCardBadge position=\"bottom-left\" variant={badgeVariant}>\n {badgeText}\n </ProductCardBadge>\n )}\n\n {/* Favorite button */}\n <ProductCardFavoriteButton\n filled={isFavoritedLocal}\n onPress={handleFavoritePress}\n />\n </ProductCardImageContainer>\n\n {/* Product info for default variant */}\n <ProductCardInfo variant={variant}>\n <ProductCardTitle>{title}</ProductCardTitle>\n\n <ProductCardPrice>\n {hasDiscount ? (\n <>\n <ProductCardCurrentPrice>\n {formatMoney(amount, currencyCode)}\n </ProductCardCurrentPrice>\n <ProductCardOriginalPrice>\n {formatMoney(\n compareAtPriceAmount,\n displayCompareAtPrice?.currencyCode || currencyCode\n )}\n </ProductCardOriginalPrice>\n </>\n ) : (\n <ProductCardCurrentPrice>\n {formatMoney(amount, currencyCode)}\n </ProductCardCurrentPrice>\n )}\n </ProductCardPrice>\n </ProductCardInfo>\n </ProductCardRoot>\n )\n}\n\nexport {\n // Composed component\n ProductCard,\n // Primitive components for custom composition\n ProductCardRoot,\n ProductCardImageContainer,\n ProductCardImage,\n ProductCardBadge,\n ProductCardFavoriteButton,\n ProductCardInfo,\n ProductCardTitle,\n ProductCardPrice,\n ProductCardCurrentPrice,\n ProductCardOriginalPrice,\n}\n"],"names":["productCardVariants","cva","ProductCardRoot","className","variant","touchable","asChild","onPress","props","content","jsx","SlotPrimitive.Slot","cn","Touchable","ProductCardImageContainer","ProductCardImage","src","alt","ProductCardBadge","position","children","Badge","ProductCardFavoriteButton","filled","icon","Button","Icon","ProductCardInfo","ProductCardTitle","ProductCardPrice","ProductCardCurrentPrice","ProductCardOriginalPrice","ProductCard","product","selectedProductVariant","badgeText","badgeVariant","onFavoriteToggled","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","price","compareAtPrice","isFavorited","defaultVariantId","shop","displayImage","displayPrice","displayCompareAtPrice","isFavoritedLocal","setIsFavoritedLocal","React","currencyCode","amount","imageUrl","imageAltText","compareAtPriceAmount","hasDiscount","handlePress","handleFavoritePress","previousState","jsxs","formatMoney","Fragment"],"mappings":";;;;;;;;;;;;AAkBA,MAAMA,IAAsBC;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,cAAc;AAAA,QACd,SAAS;AAAA,MACX;AAAA,MACA,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ;AAYA,SAASC,EAAgB;AAAA,EACvB,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU;AAAA,EACV,SAAAC;AAAA,EACA,GAAGC;AACL,GAAyB;AAGvB,QAAMC,IACJ,gBAAAC;AAAA,IAHWJ,IAAUK,IAAqB;AAAA,IAGzC;AAAA,MACC,WAAWC;AAAA,QACTZ,EAAoB,EAAC,SAAAI,GAAS,WAAAC,GAAU;AAAA,QACxC;AAAA,QACAF;AAAA,MACF;AAAA,MACC,GAAGK;AAAA,IAAA;AAAA,EACN;AAGF,SAAIH,KAAaE,IAEZ,gBAAAG,EAAAG,GAAA,EAAU,SAAAN,GAAkB,SAAO,IACjC,UACHE,GAAA,IAIGA;AACT;AAEA,SAASK,EAA0B;AAAA,EACjC,WAAAX;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGI;AACL,GAEG;AAEC,SAAA,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACAR,MAAY,YAAY,kBAAkB;AAAA,QAC1CD;AAAA,MACF;AAAA,MACC,GAAGK;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASO,EAAiB;AAAA,EACxB,WAAAZ;AAAA,EACA,KAAAa;AAAA,EACA,KAAAC;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,EAE3C,CAAA;AAAA,UAAA,GACF,IAEC,gBAAA/C,EAAAoB,GAAA,EACE,YAAY4B,GAAQD,CAAY,GACnC,EAEJ,CAAA;AAAA,QAAA,EACF,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -175,7 +175,7 @@ function tt({
175
175
  children: /* @__PURE__ */ e(z, { onPress: t, asChild: !0, children: /* @__PURE__ */ e(
176
176
  M,
177
177
  {
178
- variant: "ghost",
178
+ variant: "borderless",
179
179
  size: "icon",
180
180
  className: "h-auto w-auto p-0 hover:bg-transparent",
181
181
  children: /* @__PURE__ */ e(
@@ -258,7 +258,7 @@ function ut({ product: r }) {
258
258
  filled: d < Math.floor(g),
259
259
  className: n(
260
260
  "h-3 w-3",
261
- d < Math.floor(g) ? "text-gray-900" : "text-gray-300"
261
+ d < Math.floor(g) ? "text-primary" : "text-gray-300"
262
262
  )
263
263
  },
264
264
  d
@@ -1 +1 @@
1
- {"version":3,"file":"product-link.js","sources":["../../../src/components/commerce/product-link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {useSavedProductsActions} from '../../hooks/user/useSavedProductsActions'\nimport {cn} from '../../lib/utils'\nimport {type Product} from '../../types/minisSDK.generated.d'\nimport {Button} from '../ui/button'\nimport {Card, CardContent, CardAction} from '../ui/card'\nimport {Icon, type LucideIconName} from '../ui/icon'\nimport {Touchable} from '../ui/touchable'\n\nconst productLinkVariants = cva('', {\n variants: {\n layout: {\n horizontal: '!flex-row items-center gap-3 px-4 py-3',\n vertical: 'flex-col',\n },\n discount: {\n none: '',\n small: '',\n large: '',\n },\n },\n defaultVariants: {\n layout: 'horizontal',\n discount: 'none',\n },\n})\n\n// Primitive components (building blocks)\nexport interface ProductLinkRootProps\n extends React.ComponentProps<typeof Card>,\n VariantProps<typeof productLinkVariants> {\n layout?: 'horizontal' | 'vertical'\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction ProductLinkRoot({\n className,\n layout,\n discount,\n asChild = false,\n onPress,\n ...props\n}: ProductLinkRootProps) {\n const Comp = asChild ? SlotPrimitive.Root : Card\n\n return (\n <Touchable onPress={onPress} asChild>\n <Comp\n className={cn(\n productLinkVariants({layout, discount}),\n 'border-0 bg-white rounded-xl shadow-lg shadow-black/10',\n className\n )}\n {...props}\n />\n </Touchable>\n )\n}\n\nfunction ProductLinkImage({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<'div'> & {layout?: 'horizontal' | 'vertical'}) {\n return (\n <div\n data-slot=\"product-link-image\"\n className={cn(\n 'overflow-hidden rounded-md bg-muted',\n layout === 'horizontal'\n ? 'h-16 w-16 flex-shrink-0'\n : 'aspect-square w-full',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkInfo({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<typeof CardContent> & {\n layout?: 'horizontal' | 'vertical'\n}) {\n return (\n <CardContent\n className={cn(\n layout === 'horizontal'\n ? 'flex-1 min-w-0 space-y-1 px-0 py-0'\n : 'space-y-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkTitle({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"product-link-title\"\n className={cn(\n 'text-sm font-medium leading-tight text-gray-900 truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction ProductLinkPrice({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-price\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkCurrentPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-current-price\"\n className={cn('text-sm font-semibold text-gray-900', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkOriginalPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-original-price\"\n className={cn('text-sm text-gray-500 line-through', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkDiscountPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-discount-price\"\n className={cn('text-sm font-semibold text-red-600', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkRating({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-rating\"\n className={cn(\n 'flex items-center gap-1 text-xs text-muted-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkActions({\n className,\n onActionPress,\n icon = 'Heart',\n filled = false,\n ...props\n}: React.ComponentProps<typeof CardAction> & {\n onActionPress?: () => void\n icon?: LucideIconName\n filled?: boolean\n}) {\n return (\n <CardAction\n className={cn('flex-shrink-0 self-center px-0 py-0', className)}\n {...props}\n >\n <Touchable onPress={onActionPress} asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-auto w-auto p-0 hover:bg-transparent\"\n >\n <Icon\n name={icon}\n filled={filled}\n withBackground\n className=\"h-4 w-4\"\n />\n </Button>\n </Touchable>\n </CardAction>\n )\n}\n\nexport interface ProductLinkProps {\n product: Product\n}\n\n// Composed ProductLink component\nfunction ProductLink({product}: ProductLinkProps) {\n const {navigateToProduct} = useShopNavigation()\n const {saveProduct, unsaveProduct} = useSavedProductsActions()\n\n const {\n id,\n title,\n featuredImage,\n reviewAnalytics,\n price,\n compareAtPrice,\n isFavorited,\n selectedVariant,\n defaultVariantId,\n shop,\n } = product\n\n // Local state for optimistic UI updates\n const [isFavoritedLocal, setIsFavoritedLocal] = React.useState(isFavorited)\n\n const averageRating = reviewAnalytics?.averageRating\n const reviewCount = reviewAnalytics?.reviewCount\n const currencyCode = price?.currencyCode\n const amount = price?.amount\n const imageUrl = featuredImage?.url\n const imageAltText = featuredImage?.altText || title\n const compareAtPriceAmount = compareAtPrice?.amount\n const compareAtPriceCurrencyCode = compareAtPrice?.currencyCode\n const hasDiscount = compareAtPriceAmount && compareAtPriceAmount !== amount\n\n const handlePress = React.useCallback(() => {\n navigateToProduct({\n productId: id,\n })\n }, [navigateToProduct, id])\n\n const handleActionPress = React.useCallback(async () => {\n const previousState = isFavoritedLocal\n\n // Optimistic update\n setIsFavoritedLocal(!previousState)\n\n try {\n if (previousState) {\n await unsaveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n } else {\n await saveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n }\n } catch (error) {\n // Revert optimistic update on error\n setIsFavoritedLocal(previousState)\n }\n }, [\n isFavoritedLocal,\n id,\n shop.id,\n selectedVariant?.id,\n defaultVariantId,\n saveProduct,\n unsaveProduct,\n ])\n\n return (\n <ProductLinkRoot\n layout=\"horizontal\"\n discount={hasDiscount ? 'small' : 'none'}\n onPress={handlePress}\n >\n <ProductLinkImage layout=\"horizontal\">\n {imageUrl ? (\n <img\n src={imageUrl}\n alt={imageAltText}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"h-full w-full bg-muted flex items-center justify-center text-muted-foreground text-xs\">\n No Image\n </div>\n )}\n </ProductLinkImage>\n\n <ProductLinkInfo layout=\"horizontal\">\n <ProductLinkTitle>{title}</ProductLinkTitle>\n\n {reviewCount && averageRating && (\n <ProductLinkRating>\n <div className=\"flex items-center gap-1\">\n {Array.from({length: 5}, (_, i) => (\n <Icon\n key={i}\n name=\"Star\"\n filled={i < Math.floor(averageRating!)}\n className={cn(\n 'h-3 w-3',\n i < Math.floor(averageRating!)\n ? 'text-gray-900'\n : 'text-gray-300'\n )}\n />\n ))}\n <span className=\"text-xs text-gray-600 ml-1\">\n ({reviewCount})\n </span>\n </div>\n </ProductLinkRating>\n )}\n\n <ProductLinkPrice>\n {hasDiscount ? (\n <>\n <ProductLinkDiscountPrice>\n {currencyCode} {amount}\n </ProductLinkDiscountPrice>\n <ProductLinkOriginalPrice>\n {compareAtPriceCurrencyCode} {compareAtPriceAmount}\n </ProductLinkOriginalPrice>\n </>\n ) : (\n <ProductLinkCurrentPrice>\n {currencyCode} {amount}\n </ProductLinkCurrentPrice>\n )}\n </ProductLinkPrice>\n </ProductLinkInfo>\n\n <ProductLinkActions\n icon=\"Heart\"\n filled={isFavoritedLocal}\n onActionPress={handleActionPress}\n />\n </ProductLinkRoot>\n )\n}\n\nexport {\n // Composed component\n ProductLink,\n // Primitive components for custom composition\n ProductLinkRoot,\n ProductLinkImage,\n ProductLinkInfo,\n ProductLinkTitle,\n ProductLinkPrice,\n ProductLinkCurrentPrice,\n ProductLinkOriginalPrice,\n ProductLinkDiscountPrice,\n ProductLinkRating,\n ProductLinkActions,\n}\n"],"names":["productLinkVariants","cva","ProductLinkRoot","className","layout","discount","asChild","onPress","props","jsx","Touchable","SlotPrimitive.Root","Card","cn","ProductLinkImage","ProductLinkInfo","CardContent","ProductLinkTitle","children","ProductLinkPrice","ProductLinkCurrentPrice","ProductLinkOriginalPrice","ProductLinkDiscountPrice","ProductLinkRating","ProductLinkActions","onActionPress","icon","filled","CardAction","Button","Icon","ProductLink","product","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","reviewAnalytics","price","compareAtPrice","isFavorited","selectedVariant","defaultVariantId","shop","isFavoritedLocal","setIsFavoritedLocal","React","averageRating","reviewCount","currencyCode","amount","imageUrl","imageAltText","compareAtPriceAmount","compareAtPriceCurrencyCode","hasDiscount","handlePress","handleActionPress","previousState","jsxs","_","i","Fragment"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAsBC,EAAI,IAAI;AAAA,EAClC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAA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U,2BACZ,UAAA;AAAA,YAAA,MAAM,KAAK,EAAC,QAAQ,KAAI,CAACC,GAAGC,MAC3B,gBAAAxD;AAAA,cAACqB;AAAA,cAAA;AAAA,gBAEC,MAAK;AAAA,gBACL,QAAQmC,IAAI,KAAK,MAAMd,CAAc;AAAA,gBACrC,WAAWtC;AAAA,kBACT;AAAA,kBACAoD,IAAI,KAAK,MAAMd,CAAc,IACzB,kBACA;AAAA,gBAAA;AAAA,cACN;AAAA,cARKc;AAAA,YAAA,CAUR;AAAA,YACD,gBAAAF,EAAC,QAAK,EAAA,WAAU,8BAA6B,UAAA;AAAA,cAAA;AAAA,cACzCX;AAAA,cAAY;AAAA,YAAA,EAChB,CAAA;AAAA,UAAA,EAAA,CACF,EACF,CAAA;AAAA,UAGF,gBAAA3C,EAACU,GACE,EAAA,UAAAwC,IAEG,gBAAAI,EAAAG,GAAA,EAAA,UAAA;AAAA,YAAA,gBAAAH,EAACzC,GACE,EAAA,UAAA;AAAA,cAAA+B;AAAA,cAAa;AAAA,cAAEC;AAAA,YAAA,GAClB;AAAA,8BACCjC,GACE,EAAA,UAAA;AAAA,cAAAqC;AAAA,cAA2B;AAAA,cAAED;AAAA,YAAA,EAChC,CAAA;AAAA,UACF,EAAA,CAAA,sBAECrC,GACE,EAAA,UAAA;AAAA,YAAAiC;AAAA,YAAa;AAAA,YAAEC;AAAA,UAAA,EAAA,CAClB,EAEJ,CAAA;AAAA,QAAA,GACF;AAAA,QAEA,gBAAA7C;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAQwB;AAAA,YACR,eAAea;AAAA,UAAA;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"product-link.js","sources":["../../../src/components/commerce/product-link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {useShopNavigation} from '../../hooks/navigation/useShopNavigation'\nimport {useSavedProductsActions} from '../../hooks/user/useSavedProductsActions'\nimport {cn} from '../../lib/utils'\nimport {type Product} from '../../types/minisSDK.generated.d'\nimport {Button} from '../ui/button'\nimport {Card, CardContent, CardAction} from '../ui/card'\nimport {Icon, type LucideIconName} from '../ui/icon'\nimport {Touchable} from '../ui/touchable'\n\nconst productLinkVariants = cva('', {\n variants: {\n layout: {\n horizontal: '!flex-row items-center gap-3 px-4 py-3',\n vertical: 'flex-col',\n },\n discount: {\n none: '',\n small: '',\n large: '',\n },\n },\n defaultVariants: {\n layout: 'horizontal',\n discount: 'none',\n },\n})\n\n// Primitive components (building blocks)\nexport interface ProductLinkRootProps\n extends React.ComponentProps<typeof Card>,\n VariantProps<typeof productLinkVariants> {\n layout?: 'horizontal' | 'vertical'\n asChild?: boolean\n onPress?: () => void\n}\n\nfunction ProductLinkRoot({\n className,\n layout,\n discount,\n asChild = false,\n onPress,\n ...props\n}: ProductLinkRootProps) {\n const Comp = asChild ? SlotPrimitive.Root : Card\n\n return (\n <Touchable onPress={onPress} asChild>\n <Comp\n className={cn(\n productLinkVariants({layout, discount}),\n 'border-0 bg-white rounded-xl shadow-lg shadow-black/10',\n className\n )}\n {...props}\n />\n </Touchable>\n )\n}\n\nfunction ProductLinkImage({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<'div'> & {layout?: 'horizontal' | 'vertical'}) {\n return (\n <div\n data-slot=\"product-link-image\"\n className={cn(\n 'overflow-hidden rounded-md bg-muted',\n layout === 'horizontal'\n ? 'h-16 w-16 flex-shrink-0'\n : 'aspect-square w-full',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkInfo({\n className,\n layout = 'horizontal',\n ...props\n}: React.ComponentProps<typeof CardContent> & {\n layout?: 'horizontal' | 'vertical'\n}) {\n return (\n <CardContent\n className={cn(\n layout === 'horizontal'\n ? 'flex-1 min-w-0 space-y-1 px-0 py-0'\n : 'space-y-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkTitle({\n className,\n children,\n ...props\n}: React.ComponentProps<'h3'>) {\n return (\n <h3\n data-slot=\"product-link-title\"\n className={cn(\n 'text-sm font-medium leading-tight text-gray-900 truncate overflow-hidden whitespace-nowrap text-ellipsis',\n className\n )}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\nfunction ProductLinkPrice({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-price\"\n className={cn('flex items-center gap-2', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkCurrentPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-current-price\"\n className={cn('text-sm font-semibold text-gray-900', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkOriginalPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-original-price\"\n className={cn('text-sm text-gray-500 line-through', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkDiscountPrice({\n className,\n ...props\n}: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"product-link-discount-price\"\n className={cn('text-sm font-semibold text-red-600', className)}\n {...props}\n />\n )\n}\n\nfunction ProductLinkRating({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"product-link-rating\"\n className={cn(\n 'flex items-center gap-1 text-xs text-muted-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ProductLinkActions({\n className,\n onActionPress,\n icon = 'Heart',\n filled = false,\n ...props\n}: React.ComponentProps<typeof CardAction> & {\n onActionPress?: () => void\n icon?: LucideIconName\n filled?: boolean\n}) {\n return (\n <CardAction\n className={cn('flex-shrink-0 self-center px-0 py-0', className)}\n {...props}\n >\n <Touchable onPress={onActionPress} asChild>\n <Button\n variant=\"borderless\"\n size=\"icon\"\n className=\"h-auto w-auto p-0 hover:bg-transparent\"\n >\n <Icon\n name={icon}\n filled={filled}\n withBackground\n className=\"h-4 w-4\"\n />\n </Button>\n </Touchable>\n </CardAction>\n )\n}\n\nexport interface ProductLinkProps {\n product: Product\n}\n\n// Composed ProductLink component\nfunction ProductLink({product}: ProductLinkProps) {\n const {navigateToProduct} = useShopNavigation()\n const {saveProduct, unsaveProduct} = useSavedProductsActions()\n\n const {\n id,\n title,\n featuredImage,\n reviewAnalytics,\n price,\n compareAtPrice,\n isFavorited,\n selectedVariant,\n defaultVariantId,\n shop,\n } = product\n\n // Local state for optimistic UI updates\n const [isFavoritedLocal, setIsFavoritedLocal] = React.useState(isFavorited)\n\n const averageRating = reviewAnalytics?.averageRating\n const reviewCount = reviewAnalytics?.reviewCount\n const currencyCode = price?.currencyCode\n const amount = price?.amount\n const imageUrl = featuredImage?.url\n const imageAltText = featuredImage?.altText || title\n const compareAtPriceAmount = compareAtPrice?.amount\n const compareAtPriceCurrencyCode = compareAtPrice?.currencyCode\n const hasDiscount = compareAtPriceAmount && compareAtPriceAmount !== amount\n\n const handlePress = React.useCallback(() => {\n navigateToProduct({\n productId: id,\n })\n }, [navigateToProduct, id])\n\n const handleActionPress = React.useCallback(async () => {\n const previousState = isFavoritedLocal\n\n // Optimistic update\n setIsFavoritedLocal(!previousState)\n\n try {\n if (previousState) {\n await unsaveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n } else {\n await saveProduct({\n productId: id,\n shopId: shop.id,\n productVariantId: selectedVariant?.id || defaultVariantId,\n })\n }\n } catch (error) {\n // Revert optimistic update on error\n setIsFavoritedLocal(previousState)\n }\n }, [\n isFavoritedLocal,\n id,\n shop.id,\n selectedVariant?.id,\n defaultVariantId,\n saveProduct,\n unsaveProduct,\n ])\n\n return (\n <ProductLinkRoot\n layout=\"horizontal\"\n discount={hasDiscount ? 'small' : 'none'}\n onPress={handlePress}\n >\n <ProductLinkImage layout=\"horizontal\">\n {imageUrl ? (\n <img\n src={imageUrl}\n alt={imageAltText}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"h-full w-full bg-muted flex items-center justify-center text-muted-foreground text-xs\">\n No Image\n </div>\n )}\n </ProductLinkImage>\n\n <ProductLinkInfo layout=\"horizontal\">\n <ProductLinkTitle>{title}</ProductLinkTitle>\n\n {reviewCount && averageRating && (\n <ProductLinkRating>\n <div className=\"flex items-center gap-1\">\n {Array.from({length: 5}, (_, i) => (\n <Icon\n key={i}\n name=\"Star\"\n filled={i < Math.floor(averageRating!)}\n className={cn(\n 'h-3 w-3',\n i < Math.floor(averageRating!)\n ? 'text-primary'\n : 'text-gray-300'\n )}\n />\n ))}\n <span className=\"text-xs text-gray-600 ml-1\">\n ({reviewCount})\n </span>\n </div>\n </ProductLinkRating>\n )}\n\n <ProductLinkPrice>\n {hasDiscount ? (\n <>\n <ProductLinkDiscountPrice>\n {currencyCode} {amount}\n </ProductLinkDiscountPrice>\n <ProductLinkOriginalPrice>\n {compareAtPriceCurrencyCode} {compareAtPriceAmount}\n </ProductLinkOriginalPrice>\n </>\n ) : (\n <ProductLinkCurrentPrice>\n {currencyCode} {amount}\n </ProductLinkCurrentPrice>\n )}\n </ProductLinkPrice>\n </ProductLinkInfo>\n\n <ProductLinkActions\n icon=\"Heart\"\n filled={isFavoritedLocal}\n onActionPress={handleActionPress}\n />\n </ProductLinkRoot>\n )\n}\n\nexport {\n // Composed component\n ProductLink,\n // Primitive components for custom composition\n ProductLinkRoot,\n ProductLinkImage,\n ProductLinkInfo,\n ProductLinkTitle,\n ProductLinkPrice,\n ProductLinkCurrentPrice,\n ProductLinkOriginalPrice,\n ProductLinkDiscountPrice,\n ProductLinkRating,\n ProductLinkActions,\n}\n"],"names":["productLinkVariants","cva","ProductLinkRoot","className","layout","discount","asChild","onPress","props","jsx","Touchable","SlotPrimitive.Root","Card","cn","ProductLinkImage","ProductLinkInfo","CardContent","ProductLinkTitle","children","ProductLinkPrice","ProductLinkCurrentPrice","ProductLinkOriginalPrice","ProductLinkDiscountPrice","ProductLinkRating","ProductLinkActions","onActionPress","icon","filled","CardAction","Button","Icon","ProductLink","product","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","reviewAnalytics","price","compareAtPrice","isFavorited","selectedVariant","defaultVariantId","shop","isFavoritedLocal","setIsFavoritedLocal","React","averageRating","reviewCount","currencyCode","amount","imageUrl","imageAltText","compareAtPriceAmount","compareAtPriceCurrencyCode","hasDiscount","handlePress","handleActionPress","previousState","jsxs","_","i","Fragment"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAsBC,EAAI,IAAI;AAAA,EAClC,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,QAAQ;AAAA,IACR,UAAU;AAAA,EAAA;AAEd,CAAC;AAWD,SAASC,EAAgB;AAAA,EACvB,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,SAAAC;AAAA,EACA,GAAGC;AACL,GAAyB;AAGvB,SACG,gBAAAC,EAAAC,GAAA,EAAU,SAAAH,GAAkB,SAAO,IAClC,UAAA,gBAAAE;AAAA,IAJSH,IAAUK,IAAqBC;AAAA,IAIvC;AAAA,MACC,WAAWC;AAAA,QACTb,EAAoB,EAAC,QAAAI,GAAQ,UAAAC,GAAS;AAAA,QACtC;AAAA,QACAF;AAAA,MACF;AAAA,MACC,GAAGK;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ;AAEA,SAASM,EAAiB;AAAA,EACxB,WAAAX;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,GAAGI;AACL,GAAuE;AAEnE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWI;AAAA,QACT;AAAA,QACAT,MAAW,eACP,4BACA;AAAA,QACJD;A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,UACF,EAAA,CAAA,sBAECrC,GACE,EAAA,UAAA;AAAA,YAAAiC;AAAA,YAAa;AAAA,YAAEC;AAAA,UAAA,EAAA,CAClB,EAEJ,CAAA;AAAA,QAAA,GACF;AAAA,QAEA,gBAAA7C;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,QAAQwB;AAAA,YACR,eAAea;AAAA,UAAA;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -120,7 +120,7 @@ function O({
120
120
  return /* @__PURE__ */ e(
121
121
  m,
122
122
  {
123
- className: o(l({ variant: "outline" }), t),
123
+ className: o(l({ variant: "outlined" }), t),
124
124
  ...a
125
125
  }
126
126
  );
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","sources":["../../../src/components/ui/alert-dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {AlertDialog as AlertDialogPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nimport {buttonVariants} from './button'\n\nfunction AlertDialog({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return (\n <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n return (\n <AlertDialogPrimitive.Action\n className={cn(buttonVariants(), className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n return (\n <AlertDialogPrimitive.Cancel\n className={cn(buttonVariants({variant: 'outline'}), className)}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n}\n"],"names":["AlertDialog","props","AlertDialogPrimitive.Root","AlertDialogTrigger","AlertDialogPrimitive.Trigger","AlertDialogPortal","AlertDialogPrimitive.Portal","AlertDialogOverlay","className","jsx","AlertDialogPrimitive.Overlay","cn","AlertDialogContent","AlertDialogPrimitive.Content","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogPrimitive.Title","AlertDialogDescription","AlertDialogPrimitive.Description","AlertDialogAction","AlertDialogPrimitive.Action","buttonVariants","AlertDialogCancel","AlertDialogPrimitive.Cancel"],"mappings":";;;;AAQA,SAASA,EAAY;AAAA,EACnB,GAAGC;AACL,GAA2D;AACzD,2BAAQC,GAAA,EAA0B,aAAU,gBAAgB,GAAGD,GAAO;AACxE;AAEA,SAASE,EAAmB;AAAA,EAC1B,GAAGF;AACL,GAA8D;AAC5D,2BACGG,GAAA,EAA6B,aAAU,wBAAwB,GAAGH,GAAO;AAE9E;AAEA,SAASI,EAAkB;AAAA,EACzB,GAAGJ;AACL,GAA6D;AAC3D,2BACGK,GAAA,EAA4B,aAAU,uBAAuB,GAAGL,GAAO;AAE5E;AAEA,SAASM,EAAmB;AAAA,EAC1B,WAAAC;AAAA,EACA,GAAGP;AACL,GAA8D;AAE1D,SAAA,gBAAAQ;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MACF;AAAA,MACC,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,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,EACA,GAAGP;AACL,GAA6D;AAEzD,SAAA,gBAAAQ;AAAA,IAACY;AAAAA,IAAA;AAAA,MACC,WAAWV,EAAGW,EAAe,GAAGd,CAAS;AAAA,MACxC,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASsB,EAAkB;AAAA,EACzB,WAAAf;AAAA,EACA,GAAGP;AACL,GAA6D;AAEzD,SAAA,gBAAAQ;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,WAAWb,EAAGW,EAAe,EAAC,SAAS,UAAS,CAAC,GAAGd,CAAS;AAAA,MAC5D,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;"}
1
+ {"version":3,"file":"alert-dialog.js","sources":["../../../src/components/ui/alert-dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {AlertDialog as AlertDialogPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nimport {buttonVariants} from './button'\n\nfunction AlertDialog({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return (\n <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n )\n}\n\nfunction AlertDialogPortal({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return (\n <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n )\n}\n\nfunction AlertDialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogContent({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n )\n}\n\nfunction AlertDialogHeader({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogFooter({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogAction({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {\n return (\n <AlertDialogPrimitive.Action\n className={cn(buttonVariants(), className)}\n {...props}\n />\n )\n}\n\nfunction AlertDialogCancel({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n return (\n <AlertDialogPrimitive.Cancel\n className={cn(buttonVariants({variant: 'outlined'}), className)}\n {...props}\n />\n )\n}\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n}\n"],"names":["AlertDialog","props","AlertDialogPrimitive.Root","AlertDialogTrigger","AlertDialogPrimitive.Trigger","AlertDialogPortal","AlertDialogPrimitive.Portal","AlertDialogOverlay","className","jsx","AlertDialogPrimitive.Overlay","cn","AlertDialogContent","AlertDialogPrimitive.Content","AlertDialogHeader","AlertDialogFooter","AlertDialogTitle","AlertDialogPrimitive.Title","AlertDialogDescription","AlertDialogPrimitive.Description","AlertDialogAction","AlertDialogPrimitive.Action","buttonVariants","AlertDialogCancel","AlertDialogPrimitive.Cancel"],"mappings":";;;;AAQA,SAASA,EAAY;AAAA,EACnB,GAAGC;AACL,GAA2D;AACzD,2BAAQC,GAAA,EAA0B,aAAU,gBAAgB,GAAGD,GAAO;AACxE;AAEA,SAASE,EAAmB;AAAA,EAC1B,GAAGF;AACL,GAA8D;AAC5D,2BACGG,GAAA,EAA6B,aAAU,wBAAwB,GAAGH,GAAO;AAE9E;AAEA,SAASI,EAAkB;AAAA,EACzB,GAAGJ;AACL,GAA6D;AAC3D,2BACGK,GAAA,EAA4B,aAAU,uBAAuB,GAAGL,GAAO;AAE5E;AAEA,SAASM,EAAmB;AAAA,EAC1B,WAAAC;AAAA,EACA,GAAGP;AACL,GAA8D;AAE1D,SAAA,gBAAAQ;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MACF;AAAA,MACC,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASW,EAAmB;AAAA,EAC1B,WAAAJ;AAAA,EACA,GAAGP;AACL,G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;AAAAA,IAAA;AAAA,MACC,WAAWV,EAAGW,EAAe,GAAGd,CAAS;AAAA,MACxC,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASsB,EAAkB;AAAA,EACzB,WAAAf;AAAA,EACA,GAAGP;AACL,GAA6D;AAEzD,SAAA,gBAAAQ;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,WAAWb,EAAGW,EAAe,EAAC,SAAS,WAAU,CAAC,GAAGd,CAAS;AAAA,MAC7D,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;"}
@@ -1,18 +1,22 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { cva as s } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
3
- import { cn as a } from "../../lib/utils.js";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { cva as n } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
3
+ import { cn as i } from "../../lib/utils.js";
4
4
  import { Root as d } from "../../node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js";
5
- const u = s(
5
+ const b = n(
6
6
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
7
7
  {
8
8
  variants: {
9
9
  variant: {
10
- default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
11
- destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
12
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
13
- secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
14
- ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
15
- link: "text-primary underline-offset-4 hover:underline"
10
+ primary: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
11
+ secondary: "bg-slate-900 text-white shadow-xs hover:bg-slate-800",
12
+ tertiary: "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",
13
+ blurred: "bg-black/20 text-white shadow-xs hover:bg-black/30 backdrop-blur-md border border-white/20",
14
+ text: "bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",
15
+ borderless: "bg-transparent text-primary hover:text-primary/80",
16
+ borderlessUnbranded: "bg-transparent text-foreground hover:text-foreground/80",
17
+ outlined: "border border-border bg-background text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground",
18
+ dangerous: "bg-destructive text-white shadow-xs hover:bg-destructive/90",
19
+ "outlined-dangerous": "border border-destructive bg-transparent text-destructive shadow-xs hover:bg-destructive/10"
16
20
  },
17
21
  size: {
18
22
  default: "h-9 px-4 py-2 has-[>svg]:px-3",
@@ -22,29 +26,29 @@ const u = s(
22
26
  }
23
27
  },
24
28
  defaultVariants: {
25
- variant: "default",
29
+ variant: "primary",
26
30
  size: "default"
27
31
  }
28
32
  }
29
33
  );
30
- function b({
34
+ function p({
31
35
  className: e,
32
36
  variant: r,
33
37
  size: t,
34
- asChild: i = !1,
35
- ...o
38
+ asChild: o = !1,
39
+ ...a
36
40
  }) {
37
- return /* @__PURE__ */ n(
38
- i ? d : "button",
41
+ return /* @__PURE__ */ s(
42
+ o ? d : "button",
39
43
  {
40
44
  "data-slot": "button",
41
- className: a(u({ variant: r, size: t, className: e })),
42
- ...o
45
+ className: i(b({ variant: r, size: t, className: e })),
46
+ ...a
43
47
  }
44
48
  );
45
49
  }
46
50
  export {
47
- b as Button,
48
- u as buttonVariants
51
+ p as Button,
52
+ b as buttonVariants
49
53
  };
50
54
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({variant, size, className}))}\n {...props}\n />\n )\n}\n\nexport {Button, buttonVariants}\n"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","props","jsx","SlotPrimitive.Slot","cn"],"mappings":";;;;AAOA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAEA,SAASC,EAAO;AAAA,EACd,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GAGK;AAID,SAAA,gBAAAC;AAAA,IAHWF,IAAUG,IAAqB;AAAA,IAGzC;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAGV,EAAe,EAAC,SAAAI,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAU,CAAC;AAAA,MACvD,GAAGI;AAAA,IAAA;AAAA,EACN;AAEJ;"}
1
+ {"version":3,"file":"button.js","sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Slot as SlotPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n primary:\n 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',\n secondary: 'bg-slate-900 text-white shadow-xs hover:bg-slate-800',\n tertiary:\n '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',\n blurred:\n 'bg-black/20 text-white shadow-xs hover:bg-black/30 backdrop-blur-md border border-white/20',\n text: 'bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground',\n borderless: 'bg-transparent text-primary hover:text-primary/80',\n borderlessUnbranded:\n 'bg-transparent text-foreground hover:text-foreground/80',\n outlined:\n 'border border-border bg-background text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground',\n dangerous:\n 'bg-destructive text-white shadow-xs hover:bg-destructive/90',\n 'outlined-dangerous':\n 'border border-destructive bg-transparent text-destructive shadow-xs hover:bg-destructive/10',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({variant, size, className}))}\n {...props}\n />\n )\n}\n\nexport {Button, buttonVariants}\n"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","props","jsx","SlotPrimitive.Slot","cn"],"mappings":";;;;AAOA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WAAW;AAAA,QACX,UACE;AAAA,QACF,SACE;AAAA,QACF,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,qBACE;AAAA,QACF,UACE;AAAA,QACF,WACE;AAAA,QACF,sBACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAEA,SAASC,EAAO;AAAA,EACd,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GAGK;AAID,SAAA,gBAAAC;AAAA,IAHWF,IAAUG,IAAqB;AAAA,IAGzC;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAGV,EAAe,EAAC,SAAAI,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAU,CAAC;AAAA,MACvD,GAAGI;AAAA,IAAA;AAAA,EACN;AAEJ;"}
@@ -115,7 +115,7 @@ function B({ className: o, ...r }) {
115
115
  }
116
116
  function q({
117
117
  className: o,
118
- variant: r = "outline",
118
+ variant: r = "outlined",
119
119
  size: t = "icon",
120
120
  ...s
121
121
  }) {
@@ -143,7 +143,7 @@ function q({
143
143
  }
144
144
  function F({
145
145
  className: o,
146
- variant: r = "outline",
146
+ variant: r = "outlined",
147
147
  size: t = "icon",
148
148
  ...s
149
149
  }) {