@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.
- package/README.md +14 -10
- package/dist/_virtual/index2.js +3 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.js +2 -3
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/components/atoms/button.js +28 -73
- package/dist/components/atoms/button.js.map +1 -1
- package/dist/components/atoms/favorite-button.js +21 -0
- package/dist/components/atoms/favorite-button.js.map +1 -0
- package/dist/components/atoms/icon-button.js +38 -0
- package/dist/components/atoms/icon-button.js.map +1 -0
- package/dist/components/atoms/touchable.js +14 -14
- package/dist/components/atoms/touchable.js.map +1 -1
- package/dist/components/commerce/merchant-card.js +1 -8
- package/dist/components/commerce/merchant-card.js.map +1 -1
- package/dist/components/commerce/product-card.js +79 -109
- package/dist/components/commerce/product-card.js.map +1 -1
- package/dist/components/commerce/product-link.js +36 -55
- package/dist/components/commerce/product-link.js.map +1 -1
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/{atoms → ui}/alert-dialog.js +1 -1
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.js +68 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/{atoms → ui}/carousel.js +23 -23
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/{atoms → ui}/drawer.js +25 -22
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/index.js +193 -218
- package/dist/index.js.map +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.0_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/package.json +6 -9
- package/src/components/atoms/button.tsx +10 -66
- package/src/components/atoms/favorite-button.tsx +22 -0
- package/src/components/atoms/icon-button.tsx +42 -0
- package/src/components/atoms/touchable.tsx +5 -1
- package/src/components/commerce/merchant-card.tsx +1 -12
- package/src/components/commerce/product-card.tsx +4 -32
- package/src/components/commerce/product-link.tsx +9 -29
- package/src/components/index.ts +23 -20
- package/src/components/{atoms → ui}/alert-dialog.tsx +1 -1
- package/src/components/ui/button.tsx +77 -0
- package/src/components/{atoms → ui}/carousel.tsx +11 -11
- package/src/components/{atoms → ui}/drawer.tsx +2 -1
- package/src/index.css +8 -2
- package/src/styles/globals.css +41 -0
- package/src/styles/theme.css +102 -0
- package/dist/components/atoms/accordion.js.map +0 -1
- package/dist/components/atoms/alert-dialog.js.map +0 -1
- package/dist/components/atoms/alert.js.map +0 -1
- package/dist/components/atoms/avatar.js.map +0 -1
- package/dist/components/atoms/badge.js.map +0 -1
- package/dist/components/atoms/card.js.map +0 -1
- package/dist/components/atoms/carousel.js.map +0 -1
- package/dist/components/atoms/checkbox.js.map +0 -1
- package/dist/components/atoms/dialog.js.map +0 -1
- package/dist/components/atoms/drawer.js.map +0 -1
- package/dist/components/atoms/input.js.map +0 -1
- package/dist/components/atoms/label.js.map +0 -1
- package/dist/components/atoms/progress.js.map +0 -1
- package/dist/components/atoms/radio-group.js.map +0 -1
- package/dist/components/atoms/resizable.js.map +0 -1
- package/dist/components/atoms/scroll-area.js.map +0 -1
- package/dist/components/atoms/select.js.map +0 -1
- package/dist/components/atoms/separator.js.map +0 -1
- package/dist/components/atoms/sheet.js.map +0 -1
- package/dist/components/atoms/sonner.js.map +0 -1
- package/src/base.css +0 -273
- package/tailwind.config.js +0 -3
- /package/dist/components/{atoms → ui}/accordion.js +0 -0
- /package/dist/components/{atoms → ui}/alert.js +0 -0
- /package/dist/components/{atoms → ui}/avatar.js +0 -0
- /package/dist/components/{atoms → ui}/badge.js +0 -0
- /package/dist/components/{atoms → ui}/card.js +0 -0
- /package/dist/components/{atoms → ui}/checkbox.js +0 -0
- /package/dist/components/{atoms → ui}/dialog.js +0 -0
- /package/dist/components/{atoms → ui}/input.js +0 -0
- /package/dist/components/{atoms → ui}/label.js +0 -0
- /package/dist/components/{atoms → ui}/progress.js +0 -0
- /package/dist/components/{atoms → ui}/radio-group.js +0 -0
- /package/dist/components/{atoms → ui}/resizable.js +0 -0
- /package/dist/components/{atoms → ui}/scroll-area.js +0 -0
- /package/dist/components/{atoms → ui}/select.js +0 -0
- /package/dist/components/{atoms → ui}/separator.js +0 -0
- /package/dist/components/{atoms → ui}/sheet.js +0 -0
- /package/dist/components/{atoms → ui}/sonner.js +0 -0
- /package/src/components/{atoms → ui}/accordion.tsx +0 -0
- /package/src/components/{atoms → ui}/alert.tsx +0 -0
- /package/src/components/{atoms → ui}/avatar.tsx +0 -0
- /package/src/components/{atoms → ui}/badge.tsx +0 -0
- /package/src/components/{atoms → ui}/card.tsx +0 -0
- /package/src/components/{atoms → ui}/checkbox.tsx +0 -0
- /package/src/components/{atoms → ui}/dialog.tsx +0 -0
- /package/src/components/{atoms → ui}/input.tsx +0 -0
- /package/src/components/{atoms → ui}/label.tsx +0 -0
- /package/src/components/{atoms → ui}/progress.tsx +0 -0
- /package/src/components/{atoms → ui}/radio-group.tsx +0 -0
- /package/src/components/{atoms → ui}/resizable.tsx +0 -0
- /package/src/components/{atoms → ui}/scroll-area.tsx +0 -0
- /package/src/components/{atoms → ui}/select.tsx +0 -0
- /package/src/components/{atoms → ui}/separator.tsx +0 -0
- /package/src/components/{atoms → ui}/sheet.tsx +0 -0
- /package/src/components/{atoms → ui}/sonner.tsx +0 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { jsxs as c, jsx as t, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useShopNavigation as
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { cva as F } from "../../shop-minis-react/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { useShopNavigation as j } from "../../hooks/navigation/useShopNavigation.js";
|
|
5
5
|
import { useSavedProductsActions as O } from "../../hooks/user/useSavedProductsActions.js";
|
|
6
6
|
import { formatMoney as b } from "../../lib/formatMoney.js";
|
|
7
7
|
import { cn as n } from "../../lib/utils.js";
|
|
8
|
-
import {
|
|
9
|
-
import { Card as D, CardContent as q, CardAction as B } from "../atoms/card.js";
|
|
8
|
+
import { FavoriteButton as M } from "../atoms/favorite-button.js";
|
|
10
9
|
import { Touchable as A } from "../atoms/touchable.js";
|
|
11
|
-
import
|
|
12
|
-
import U from "../../shop-minis-react/node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/
|
|
10
|
+
import { Card as D, CardContent as q, CardAction as B } from "../ui/card.js";
|
|
11
|
+
import U from "../../shop-minis-react/node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/star.js";
|
|
13
12
|
import { Root as _ } from "../../shop-minis-react/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";
|
|
14
|
-
const E =
|
|
13
|
+
const E = F("", {
|
|
15
14
|
variants: {
|
|
16
15
|
layout: {
|
|
17
16
|
horizontal: "w-full !flex-row items-center gap-3 px-4 py-3",
|
|
@@ -58,7 +57,7 @@ function G({
|
|
|
58
57
|
}
|
|
59
58
|
);
|
|
60
59
|
}
|
|
61
|
-
function
|
|
60
|
+
function H({
|
|
62
61
|
className: o,
|
|
63
62
|
layout: e = "horizontal",
|
|
64
63
|
...r
|
|
@@ -76,7 +75,7 @@ function J({
|
|
|
76
75
|
}
|
|
77
76
|
);
|
|
78
77
|
}
|
|
79
|
-
function
|
|
78
|
+
function J({
|
|
80
79
|
className: o,
|
|
81
80
|
layout: e = "horizontal",
|
|
82
81
|
...r
|
|
@@ -92,7 +91,7 @@ function K({
|
|
|
92
91
|
}
|
|
93
92
|
);
|
|
94
93
|
}
|
|
95
|
-
function
|
|
94
|
+
function K({
|
|
96
95
|
className: o,
|
|
97
96
|
children: e,
|
|
98
97
|
...r
|
|
@@ -110,7 +109,7 @@ function Q({
|
|
|
110
109
|
}
|
|
111
110
|
);
|
|
112
111
|
}
|
|
113
|
-
function
|
|
112
|
+
function Q({ className: o, ...e }) {
|
|
114
113
|
return /* @__PURE__ */ t(
|
|
115
114
|
"div",
|
|
116
115
|
{
|
|
@@ -120,7 +119,7 @@ function W({ className: o, ...e }) {
|
|
|
120
119
|
}
|
|
121
120
|
);
|
|
122
121
|
}
|
|
123
|
-
function
|
|
122
|
+
function W({
|
|
124
123
|
className: o,
|
|
125
124
|
...e
|
|
126
125
|
}) {
|
|
@@ -133,7 +132,7 @@ function X({
|
|
|
133
132
|
}
|
|
134
133
|
);
|
|
135
134
|
}
|
|
136
|
-
function
|
|
135
|
+
function X({
|
|
137
136
|
className: o,
|
|
138
137
|
...e
|
|
139
138
|
}) {
|
|
@@ -146,7 +145,7 @@ function Y({
|
|
|
146
145
|
}
|
|
147
146
|
);
|
|
148
147
|
}
|
|
149
|
-
function
|
|
148
|
+
function Y({
|
|
150
149
|
className: o,
|
|
151
150
|
...e
|
|
152
151
|
}) {
|
|
@@ -159,7 +158,7 @@ function Z({
|
|
|
159
158
|
}
|
|
160
159
|
);
|
|
161
160
|
}
|
|
162
|
-
function
|
|
161
|
+
function Z({ className: o, ...e }) {
|
|
163
162
|
return /* @__PURE__ */ t(
|
|
164
163
|
"div",
|
|
165
164
|
{
|
|
@@ -172,9 +171,9 @@ function $({ className: o, ...e }) {
|
|
|
172
171
|
}
|
|
173
172
|
);
|
|
174
173
|
}
|
|
175
|
-
function
|
|
174
|
+
function $({
|
|
176
175
|
className: o,
|
|
177
|
-
|
|
176
|
+
onPress: e,
|
|
178
177
|
filled: r = !1,
|
|
179
178
|
...i
|
|
180
179
|
}) {
|
|
@@ -193,22 +192,14 @@ function tt({
|
|
|
193
192
|
opacity: { type: "tween", duration: 0.08, ease: "easeInOut" },
|
|
194
193
|
scale: { type: "tween", duration: 0.08, ease: "easeInOut" }
|
|
195
194
|
},
|
|
196
|
-
children: /* @__PURE__ */ t(
|
|
197
|
-
M,
|
|
198
|
-
{
|
|
199
|
-
variant: "borderless",
|
|
200
|
-
size: "icon",
|
|
201
|
-
className: "h-auto w-auto p-0 hover:bg-transparent",
|
|
202
|
-
children: /* @__PURE__ */ t(U, { fill: r ? "currentColor" : "none", className: "h-4 w-4" })
|
|
203
|
-
}
|
|
204
|
-
)
|
|
195
|
+
children: /* @__PURE__ */ t(M, { filled: r, onClick: e })
|
|
205
196
|
}
|
|
206
197
|
)
|
|
207
198
|
}
|
|
208
199
|
);
|
|
209
200
|
}
|
|
210
|
-
function
|
|
211
|
-
const { navigateToProduct: e } =
|
|
201
|
+
function ut({ product: o }) {
|
|
202
|
+
const { navigateToProduct: e } = j(), { saveProduct: r, unsaveProduct: i } = O(), {
|
|
212
203
|
id: a,
|
|
213
204
|
title: s,
|
|
214
205
|
featuredImage: p,
|
|
@@ -219,15 +210,15 @@ function pt({ product: o }) {
|
|
|
219
210
|
selectedVariant: f,
|
|
220
211
|
defaultVariantId: h,
|
|
221
212
|
shop: g
|
|
222
|
-
} = o, [x, C] =
|
|
213
|
+
} = o, [x, C] = w.useState(z), y = P?.averageRating, N = P?.reviewCount;
|
|
223
214
|
l?.currencyCode;
|
|
224
|
-
const v = l?.amount ? b(l?.amount, l?.currencyCode) : void 0, I = p?.url, T = p?.altText || s,
|
|
215
|
+
const v = l?.amount ? b(l?.amount, l?.currencyCode) : void 0, I = p?.url, T = p?.altText || s, k = d?.amount ? b(d?.amount, d?.currencyCode) : void 0;
|
|
225
216
|
d?.currencyCode;
|
|
226
|
-
const L =
|
|
217
|
+
const L = k && k !== v, R = w.useCallback(() => {
|
|
227
218
|
e({
|
|
228
219
|
productId: a
|
|
229
220
|
});
|
|
230
|
-
}, [e, a]), S =
|
|
221
|
+
}, [e, a]), S = w.useCallback(async () => {
|
|
231
222
|
const u = x;
|
|
232
223
|
C(!u);
|
|
233
224
|
try {
|
|
@@ -259,7 +250,7 @@ function pt({ product: o }) {
|
|
|
259
250
|
discount: L ? "small" : "none",
|
|
260
251
|
onPress: R,
|
|
261
252
|
children: [
|
|
262
|
-
/* @__PURE__ */ t(
|
|
253
|
+
/* @__PURE__ */ t(H, { layout: "horizontal", children: I ? /* @__PURE__ */ t(
|
|
263
254
|
"img",
|
|
264
255
|
{
|
|
265
256
|
src: I,
|
|
@@ -267,11 +258,11 @@ function pt({ product: o }) {
|
|
|
267
258
|
className: "h-full w-full object-cover"
|
|
268
259
|
}
|
|
269
260
|
) : /* @__PURE__ */ t("div", { className: "h-full w-full bg-muted flex items-center justify-center text-muted-foreground text-xs", children: "No Image" }) }),
|
|
270
|
-
/* @__PURE__ */ c(
|
|
271
|
-
/* @__PURE__ */ t(
|
|
272
|
-
N && y && /* @__PURE__ */ t(
|
|
261
|
+
/* @__PURE__ */ c(J, { layout: "horizontal", children: [
|
|
262
|
+
/* @__PURE__ */ t(K, { children: s }),
|
|
263
|
+
N && y && /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
273
264
|
Array.from({ length: 5 }, (u, m) => /* @__PURE__ */ t(
|
|
274
|
-
|
|
265
|
+
U,
|
|
275
266
|
{
|
|
276
267
|
fill: m < Math.floor(y) ? "currentColor" : "none",
|
|
277
268
|
className: n(
|
|
@@ -287,16 +278,16 @@ function pt({ product: o }) {
|
|
|
287
278
|
")"
|
|
288
279
|
] })
|
|
289
280
|
] }) }),
|
|
290
|
-
/* @__PURE__ */ t(
|
|
291
|
-
/* @__PURE__ */ t(
|
|
292
|
-
/* @__PURE__ */ t(
|
|
293
|
-
] }) : /* @__PURE__ */ t(
|
|
281
|
+
/* @__PURE__ */ t(Q, { children: L ? /* @__PURE__ */ c(V, { children: [
|
|
282
|
+
/* @__PURE__ */ t(Y, { children: v }),
|
|
283
|
+
/* @__PURE__ */ t(X, { children: k })
|
|
284
|
+
] }) : /* @__PURE__ */ t(W, { children: v }) })
|
|
294
285
|
] }),
|
|
295
286
|
/* @__PURE__ */ t(
|
|
296
|
-
|
|
287
|
+
$,
|
|
297
288
|
{
|
|
298
289
|
filled: x,
|
|
299
|
-
|
|
290
|
+
onPress: S
|
|
300
291
|
}
|
|
301
292
|
)
|
|
302
293
|
]
|
|
@@ -304,16 +295,6 @@ function pt({ product: o }) {
|
|
|
304
295
|
);
|
|
305
296
|
}
|
|
306
297
|
export {
|
|
307
|
-
|
|
308
|
-
tt as ProductLinkActions,
|
|
309
|
-
X as ProductLinkCurrentPrice,
|
|
310
|
-
Z as ProductLinkDiscountPrice,
|
|
311
|
-
J as ProductLinkImage,
|
|
312
|
-
K as ProductLinkInfo,
|
|
313
|
-
Y as ProductLinkOriginalPrice,
|
|
314
|
-
W as ProductLinkPrice,
|
|
315
|
-
$ as ProductLinkRating,
|
|
316
|
-
G as ProductLinkRoot,
|
|
317
|
-
Q as ProductLinkTitle
|
|
298
|
+
ut as ProductLink
|
|
318
299
|
};
|
|
319
300
|
//# sourceMappingURL=product-link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-link.js","sources":["../../../src/components/commerce/product-link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {type Product} from '@shopify/shop-minis-platform'\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Heart, Star} from 'lucide-react'\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 {Button} from '../atoms/button'\nimport {Card, CardContent, CardAction} from '../atoms/card'\nimport {Touchable} from '../atoms/touchable'\n\nconst productLinkVariants = cva('', {\n variants: {\n layout: {\n horizontal: 'w-full !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\n onClick={onPress}\n whileTap={{opacity: 0.7}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\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 filled = false,\n ...props\n}: React.ComponentProps<typeof CardAction> & {\n onActionPress?: () => void\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\n stopPropagation\n onClick={onActionPress}\n whileTap={{opacity: 0.7, scale: 0.95}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n scale: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n <Button\n variant=\"borderless\"\n size=\"icon\"\n className=\"h-auto w-auto p-0 hover:bg-transparent\"\n >\n <Heart fill={filled ? 'currentColor' : 'none'} className=\"h-4 w-4\" />\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 ? formatMoney(price?.amount, price?.currencyCode)\n : undefined\n const imageUrl = featuredImage?.url\n const imageAltText = featuredImage?.altText || title\n const compareAtPriceAmount = compareAtPrice?.amount\n ? formatMoney(compareAtPrice?.amount, compareAtPrice?.currencyCode)\n : undefined\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 <Star\n key={i}\n fill={\n i < Math.floor(averageRating!) ? 'currentColor' : 'none'\n }\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>{amount}</ProductLinkDiscountPrice>\n <ProductLinkOriginalPrice>\n {compareAtPriceAmount}\n </ProductLinkOriginalPrice>\n </>\n ) : (\n <ProductLinkCurrentPrice>{amount}</ProductLinkCurrentPrice>\n )}\n </ProductLinkPrice>\n </ProductLinkInfo>\n\n <ProductLinkActions\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","filled","CardAction","Button","Heart","ProductLink","product","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","reviewAnalytics","price","compareAtPrice","isFavorited","selectedVariant","defaultVariantId","shop","isFavoritedLocal","setIsFavoritedLocal","React","averageRating","reviewCount","amount","formatMoney","imageUrl","imageAltText","compareAtPriceAmount","hasDiscount","handlePress","handleActionPress","previousState","jsxs","_","i","Star","Fragment"],"mappings":";;;;;;;;;;;;;AAeA,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;AAIrB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASH;AAAA,MACT,UAAU,EAAC,SAAS,IAAG;AAAA,MACvB,YAAY;AAAA,QACV,SAAS,EAAC,MAAM,SAAS,UAAU,MAAM,MAAM,YAAW;AAAA,MAC5D;AAAA,MAEA,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I,CAACC,GAAGC,MAC3B,gBAAAtD;AAAA,cAACuD;AAAA,cAAA;AAAA,gBAEC,MACED,IAAI,KAAK,MAAMb,CAAc,IAAI,iBAAiB;AAAA,gBAEpD,WAAWrC;AAAA,kBACT;AAAA,kBACAkD,IAAI,KAAK,MAAMb,CAAc,IACzB,iBACA;AAAA,gBAAA;AAAA,cACN;AAAA,cATKa;AAAA,YAAA,CAWR;AAAA,YACD,gBAAAF,EAAC,QAAK,EAAA,WAAU,8BAA6B,UAAA;AAAA,cAAA;AAAA,cACzCV;AAAA,cAAY;AAAA,YAAA,EAChB,CAAA;AAAA,UAAA,EAAA,CACF,EACF,CAAA;AAAA,UAGF,gBAAA1C,EAACU,GACE,EAAA,UAAAsC,IAEG,gBAAAI,EAAAI,GAAA,EAAA,UAAA;AAAA,YAAA,gBAAAxD,EAACa,KAA0B,UAAO8B,EAAA,CAAA;AAAA,YAClC,gBAAA3C,EAACY,KACE,UACHmC,EAAA,CAAA;AAAA,UAAA,EACF,CAAA,IAEA,gBAAA/C,EAACW,GAAyB,EAAA,UAAAgC,EAAA,CAAO,EAErC,CAAA;AAAA,QAAA,GACF;AAAA,QAEA,gBAAA3C;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,QAAQuB;AAAA,YACR,eAAeY;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 {type Product} from '@shopify/shop-minis-platform'\nimport {cva, type VariantProps} from 'class-variance-authority'\nimport {Star} from 'lucide-react'\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 {FavoriteButton} from '../atoms/favorite-button'\nimport {Touchable} from '../atoms/touchable'\nimport {Card, CardContent, CardAction} from '../ui/card'\n\nconst productLinkVariants = cva('', {\n variants: {\n layout: {\n horizontal: 'w-full !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\n onClick={onPress}\n whileTap={{opacity: 0.7}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\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 onPress,\n filled = false,\n ...props\n}: React.ComponentProps<typeof CardAction> & {\n onPress?: () => void\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\n stopPropagation\n onClick={onPress}\n whileTap={{opacity: 0.7, scale: 0.95}}\n transition={{\n opacity: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n scale: {type: 'tween', duration: 0.08, ease: 'easeInOut'},\n }}\n >\n <FavoriteButton filled={filled} onClick={onPress} />\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 ? formatMoney(price?.amount, price?.currencyCode)\n : undefined\n const imageUrl = featuredImage?.url\n const imageAltText = featuredImage?.altText || title\n const compareAtPriceAmount = compareAtPrice?.amount\n ? formatMoney(compareAtPrice?.amount, compareAtPrice?.currencyCode)\n : undefined\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 <Star\n key={i}\n fill={\n i < Math.floor(averageRating!) ? 'currentColor' : 'none'\n }\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>{amount}</ProductLinkDiscountPrice>\n <ProductLinkOriginalPrice>\n {compareAtPriceAmount}\n </ProductLinkOriginalPrice>\n </>\n ) : (\n <ProductLinkCurrentPrice>{amount}</ProductLinkCurrentPrice>\n )}\n </ProductLinkPrice>\n </ProductLinkInfo>\n\n <ProductLinkActions\n filled={isFavoritedLocal}\n onPress={handleActionPress}\n />\n </ProductLinkRoot>\n )\n}\n\nexport {ProductLink}\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","filled","CardAction","FavoriteButton","ProductLink","product","navigateToProduct","useShopNavigation","saveProduct","unsaveProduct","useSavedProductsActions","id","title","featuredImage","reviewAnalytics","price","compareAtPrice","isFavorited","selectedVariant","defaultVariantId","shop","isFavoritedLocal","setIsFavoritedLocal","React","averageRating","reviewCount","amount","formatMoney","imageUrl","imageAltText","compareAtPriceAmount","hasDiscount","handlePress","handleActionPress","previousState","jsxs","_","i","Star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A,QAAA,GACF;AAAA,QAEA,gBAAAzC;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,QAAQqB;AAAA,YACR,SAASY;AAAA,UAAA;AAAA,QAAA;AAAA,MACX;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../../src/components/ui/accordion.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {ChevronDownIcon} from 'lucide-react'\nimport {Accordion as AccordionPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nfunction Accordion({\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Root>) {\n return <AccordionPrimitive.Root data-slot=\"accordion\" {...props} />\n}\n\nfunction AccordionItem({\n className,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Item>) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('border-b last:border-b-0', className)}\n {...props}\n />\n )\n}\n\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',\n className\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n}\n\nfunction AccordionContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Content>) {\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn('pt-0 pb-4', className)}>{children}</div>\n </AccordionPrimitive.Content>\n )\n}\n\nexport {Accordion, AccordionItem, AccordionTrigger, AccordionContent}\n"],"names":["Accordion","props","AccordionPrimitive.Root","AccordionItem","className","jsx","AccordionPrimitive.Item","cn","AccordionTrigger","children","AccordionPrimitive.Header","jsxs","AccordionPrimitive.Trigger","ChevronDownIcon","AccordionContent","AccordionPrimitive.Content"],"mappings":";;;;AAOA,SAASA,EAAU;AAAA,EACjB,GAAGC;AACL,GAAyD;AACvD,2BAAQC,GAAA,EAAwB,aAAU,aAAa,GAAGD,GAAO;AACnE;AAEA,SAASE,EAAc;AAAA,EACrB,WAAAC;AAAA,EACA,GAAGH;AACL,GAAyD;AAErD,SAAA,gBAAAI;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAG,4BAA4BH,CAAS;AAAA,MAClD,GAAGH;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASO,EAAiB;AAAA,EACxB,WAAAJ;AAAA,EACA,UAAAK;AAAA,EACA,GAAGR;AACL,GAA4D;AAC1D,SACG,gBAAAI,EAAAK,GAAA,EAA0B,WAAU,QACnC,UAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWL;AAAA,QACT;AAAA,QACAH;AAAA,MACF;AAAA,MACC,GAAGH;AAAA,MAEH,UAAA;AAAA,QAAAQ;AAAA,QACD,gBAAAJ,EAACQ,GAAgB,EAAA,WAAU,8GAA8G,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE7I;AAEJ;AAEA,SAASC,EAAiB;AAAA,EACxB,WAAAV;AAAA,EACA,UAAAK;AAAA,EACA,GAAGR;AACL,GAA4D;AAExD,SAAA,gBAAAI;AAAA,IAACU;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAU;AAAA,MACT,GAAGd;AAAA,MAEJ,4BAAC,OAAI,EAAA,WAAWM,EAAG,aAAaH,CAAS,GAAI,UAAAK,EAAS,CAAA;AAAA,IAAA;AAAA,EACxD;AAEJ;"}
|
|
@@ -0,0 +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,SAASW,EAAmB;AAAA,EAC1B,WAAAJ;AAAA,EACA,GAAGP;AACL,GAA8D;AAC5D,2BACGI,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAI,EAACF,GAAmB,EAAA;AAAA,IACpB,gBAAAE;AAAA,MAACI;AAAAA,MAAA;AAAA,QACC,aAAU;AAAA,QACV,WAAWF;AAAA,UACT;AAAA,UACAH;AAAA,QACF;AAAA,QACC,GAAGP;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAEJ;AAEA,SA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AAS,UAAS,CAAC,GAAGd,CAAS;AAAA,MAC5D,GAAGP;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.js","sources":["../../../src/components/ui/alert.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cva, type VariantProps} from 'class-variance-authority'\n\nimport {cn} from '../../lib/utils'\n\nconst alertVariants = cva(\n 'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive:\n 'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n)\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({variant}), className)}\n {...props}\n />\n )\n}\n\nfunction AlertTitle({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n 'col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {Alert, AlertTitle, AlertDescription}\n"],"names":["alertVariants","cva","Alert","className","variant","props","jsx","cn","AlertTitle","AlertDescription"],"mappings":";;;AAMA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MAAA;AAAA,IAEN;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAEA,SAASC,EAAM;AAAA,EACb,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAqE;AAEjE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAWC,EAAGP,EAAc,EAAC,SAAAI,EAAQ,CAAA,GAAGD,CAAS;AAAA,MAChD,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASG,EAAW,EAAC,WAAAL,GAAW,GAAGE,KAAqC;AAEpE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASI,EAAiB,EAAC,WAAAN,GAAW,GAAGE,KAAqC;AAE1E,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../../src/components/ui/avatar.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {Avatar as AvatarPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n 'relative flex size-8 shrink-0 overflow-hidden rounded-full',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full', className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted flex size-full items-center justify-center rounded-full',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {Avatar, AvatarImage, AvatarFallback}\n"],"names":["Avatar","className","props","jsx","AvatarPrimitive.Root","cn","AvatarImage","AvatarPrimitive.Image","AvatarFallback","AvatarPrimitive.Fallback"],"mappings":";;;AAMA,SAASA,EAAO;AAAA,EACd,WAAAC;AAAA,EACA,GAAGC;AACL,GAAsD;AAElD,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASI,EAAY;AAAA,EACnB,WAAAL;AAAA,EACA,GAAGC;AACL,GAAuD;AAEnD,SAAA,gBAAAC;AAAA,IAACI;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWF,EAAG,2BAA2BJ,CAAS;AAAA,MACjD,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASM,EAAe;AAAA,EACtB,WAAAP;AAAA,EACA,GAAGC;AACL,GAA0D;AAEtD,SAAA,gBAAAC;AAAA,IAACM;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWJ;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/ui/badge.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 badgeVariants = cva(\n 'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden',\n {\n variants: {\n variant: {\n default:\n 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',\n secondary:\n 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',\n destructive:\n 'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n)\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<'span'> &\n VariantProps<typeof badgeVariants> & {asChild?: boolean}) {\n const Comp = asChild ? SlotPrimitive.Slot : 'span'\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({variant}), className)}\n {...props}\n />\n )\n}\n\nexport {Badge, badgeVariants}\n"],"names":["badgeVariants","cva","Badge","className","variant","asChild","props","jsx","SlotPrimitive.Slot","cn"],"mappings":";;;;AAOA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,MAAA;AAAA,IAEN;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAEA,SAASC,EAAM;AAAA,EACb,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GAC4D;AAIxD,SAAA,gBAAAC;AAAA,IAHWF,IAAUG,IAAqB;AAAA,IAGzC;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAGT,EAAc,EAAC,SAAAI,EAAQ,CAAA,GAAGD,CAAS;AAAA,MAChD,GAAGG;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cva as i } from "../../shop-minis-react/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
3
|
+
import { cn as o } from "../../lib/utils.js";
|
|
4
|
+
import { Root as d } from "../../shop-minis-react/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 p = i(
|
|
6
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:bg-disabled disabled:text-disabled-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:border-destructive",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
12
|
+
tertiary: "bg-tertiary text-tertiary-foreground",
|
|
13
|
+
destructive: "bg-destructive text-white dark:bg-destructive/60",
|
|
14
|
+
outline: "border bg-background dark:bg-input/30 dark:border-input",
|
|
15
|
+
ghost: "",
|
|
16
|
+
link: "text-primary underline-offset-4",
|
|
17
|
+
icon: "flex rounded-full items-center justify-center p-0 aspect-square"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "min-h-[32px] rounded-lg px-3 py-2 text-sm leading-[18px] has-[>svg]:px-3",
|
|
21
|
+
sm: "min-h-[20px] rounded-lg gap-1.5 px-3 py-1 text-xs leading-4 has-[>svg]:px-2.5",
|
|
22
|
+
lg: "min-h-[44px] rounded-xl px-3 py-3 text-base leading-6 has-[>svg]:px-4"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
compoundVariants: [
|
|
26
|
+
{
|
|
27
|
+
variant: "icon",
|
|
28
|
+
size: "default",
|
|
29
|
+
className: "size-8 min-h-0 p-0 rounded-full gap-0 px-0 py-0 has-[>svg]:px-0"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
variant: "icon",
|
|
33
|
+
size: "sm",
|
|
34
|
+
className: "size-6 min-h-0 p-0 rounded-full gap-0 px-0 py-0 has-[>svg]:px-0"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
variant: "icon",
|
|
38
|
+
size: "lg",
|
|
39
|
+
className: "size-10 min-h-0 p-0 rounded-full gap-0 px-0 py-0 has-[>svg]:px-0"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
variant: "default",
|
|
44
|
+
size: "default"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
function c({
|
|
49
|
+
className: e,
|
|
50
|
+
variant: t,
|
|
51
|
+
size: a,
|
|
52
|
+
asChild: n = !1,
|
|
53
|
+
...r
|
|
54
|
+
}) {
|
|
55
|
+
return /* @__PURE__ */ s(
|
|
56
|
+
n ? d : "button",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "button",
|
|
59
|
+
className: o(p({ variant: t, size: a, className: e })),
|
|
60
|
+
...r
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
c as BaseButton,
|
|
66
|
+
p as buttonVariants
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +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:bg-disabled disabled:text-disabled-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n tertiary: 'bg-tertiary text-tertiary-foreground',\n destructive: 'bg-destructive text-white dark:bg-destructive/60',\n outline: 'border bg-background dark:bg-input/30 dark:border-input',\n ghost: '',\n link: 'text-primary underline-offset-4',\n icon: 'flex rounded-full items-center justify-center p-0 aspect-square',\n },\n size: {\n default:\n 'min-h-[32px] rounded-lg px-3 py-2 text-sm leading-[18px] has-[>svg]:px-3',\n sm: 'min-h-[20px] rounded-lg gap-1.5 px-3 py-1 text-xs leading-4 has-[>svg]:px-2.5',\n lg: 'min-h-[44px] rounded-xl px-3 py-3 text-base leading-6 has-[>svg]:px-4',\n },\n },\n compoundVariants: [\n {\n variant: 'icon',\n size: 'default',\n className:\n 'size-8 min-h-0 p-0 rounded-full gap-0 px-0 py-0 has-[>svg]:px-0',\n },\n {\n variant: 'icon',\n size: 'sm',\n className:\n 'size-6 min-h-0 p-0 rounded-full gap-0 px-0 py-0 has-[>svg]:px-0',\n },\n {\n variant: 'icon',\n size: 'lg',\n className:\n 'size-10 min-h-0 p-0 rounded-full gap-0 px-0 py-0 has-[>svg]:px-0',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n)\n\nfunction BaseButton({\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 {BaseButton, buttonVariants}\n"],"names":["buttonVariants","cva","BaseButton","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,SAAS;AAAA,QACT,WAAW;AAAA,QACX,UAAU;AAAA,QACV,aAAa;AAAA,QACb,SAAS;AAAA,QACT,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SACE;AAAA,QACF,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,IAER;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,WACE;AAAA,MACJ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,WACE;AAAA,MACJ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,WACE;AAAA,MAAA;AAAA,IAEN;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ;AAEA,SAASC,EAAW;AAAA,EAClB,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;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {cn} from '../../lib/utils'\n\nfunction Card({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction CardAction({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 self-start justify-self-end',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardContent({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({className, ...props}: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6 [.border-t]:pt-6', className)}\n {...props}\n />\n )\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n}\n"],"names":["Card","className","props","jsx","cn","CardHeader","CardTitle","CardDescription","CardAction","CardContent","CardFooter"],"mappings":";;AAIA,SAASA,EAAK,EAAC,WAAAC,GAAW,GAAGC,KA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AAAT,GAAW,GAAGC,KAAqC;AAEpE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAG,2CAA2CH,CAAS;AAAA,MACjE,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as h } from "react/jsx-runtime";
|
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import k from "../../shop-minis-react/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.1.0/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
|
|
4
4
|
import { cn as d } from "../../lib/utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { BaseButton as v } from "./button.js";
|
|
6
6
|
import z from "../../shop-minis-react/node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
7
7
|
import g from "../../shop-minis-react/node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/arrow-right.js";
|
|
8
8
|
const p = l.createContext(null);
|
|
@@ -12,11 +12,11 @@ function m() {
|
|
|
12
12
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
13
13
|
return o;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function I({
|
|
16
16
|
orientation: o = "horizontal",
|
|
17
17
|
opts: r,
|
|
18
18
|
setApi: t,
|
|
19
|
-
plugins:
|
|
19
|
+
plugins: n,
|
|
20
20
|
className: c,
|
|
21
21
|
children: i,
|
|
22
22
|
...u
|
|
@@ -26,16 +26,16 @@ function K({
|
|
|
26
26
|
...r,
|
|
27
27
|
axis: o === "horizontal" ? "x" : "y"
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
), [b, w] = l.useState(!1), [S, y] = l.useState(!1), f = l.useCallback((
|
|
31
|
-
|
|
29
|
+
n
|
|
30
|
+
), [b, w] = l.useState(!1), [S, y] = l.useState(!1), f = l.useCallback((s) => {
|
|
31
|
+
s && (w(s.canScrollPrev()), y(s.canScrollNext()));
|
|
32
32
|
}, []), x = l.useCallback(() => {
|
|
33
33
|
e?.scrollPrev();
|
|
34
34
|
}, [e]), C = l.useCallback(() => {
|
|
35
35
|
e?.scrollNext();
|
|
36
36
|
}, [e]), P = l.useCallback(
|
|
37
|
-
(
|
|
38
|
-
|
|
37
|
+
(s) => {
|
|
38
|
+
s.key === "ArrowLeft" ? (s.preventDefault(), x()) : s.key === "ArrowRight" && (s.preventDefault(), C());
|
|
39
39
|
},
|
|
40
40
|
[x, C]
|
|
41
41
|
);
|
|
@@ -74,8 +74,8 @@ function K({
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const { carouselRef: t, orientation:
|
|
77
|
+
function K({ className: o, ...r }) {
|
|
78
|
+
const { carouselRef: t, orientation: n } = m();
|
|
79
79
|
return /* @__PURE__ */ a(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
@@ -87,7 +87,7 @@ function L({ className: o, ...r }) {
|
|
|
87
87
|
{
|
|
88
88
|
className: d(
|
|
89
89
|
"flex",
|
|
90
|
-
|
|
90
|
+
n === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
91
91
|
o
|
|
92
92
|
),
|
|
93
93
|
...r
|
|
@@ -96,7 +96,7 @@ function L({ className: o, ...r }) {
|
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function L({ className: o, ...r }) {
|
|
100
100
|
const { orientation: t } = m();
|
|
101
101
|
return /* @__PURE__ */ a(
|
|
102
102
|
"div",
|
|
@@ -115,9 +115,9 @@ function B({ className: o, ...r }) {
|
|
|
115
115
|
}
|
|
116
116
|
function q({
|
|
117
117
|
className: o,
|
|
118
|
-
variant: r = "
|
|
119
|
-
size: t = "
|
|
120
|
-
...
|
|
118
|
+
variant: r = "icon",
|
|
119
|
+
size: t = "default",
|
|
120
|
+
...n
|
|
121
121
|
}) {
|
|
122
122
|
const { orientation: c, scrollPrev: i, canScrollPrev: u } = m();
|
|
123
123
|
return /* @__PURE__ */ h(
|
|
@@ -133,7 +133,7 @@ function q({
|
|
|
133
133
|
),
|
|
134
134
|
disabled: !u,
|
|
135
135
|
onClick: i,
|
|
136
|
-
...
|
|
136
|
+
...n,
|
|
137
137
|
children: [
|
|
138
138
|
/* @__PURE__ */ a(z, {}),
|
|
139
139
|
/* @__PURE__ */ a("span", { className: "sr-only", children: "Previous slide" })
|
|
@@ -143,9 +143,9 @@ function q({
|
|
|
143
143
|
}
|
|
144
144
|
function F({
|
|
145
145
|
className: o,
|
|
146
|
-
variant: r = "
|
|
147
|
-
size: t = "
|
|
148
|
-
...
|
|
146
|
+
variant: r = "icon",
|
|
147
|
+
size: t = "default",
|
|
148
|
+
...n
|
|
149
149
|
}) {
|
|
150
150
|
const { orientation: c, scrollNext: i, canScrollNext: u } = m();
|
|
151
151
|
return /* @__PURE__ */ h(
|
|
@@ -161,7 +161,7 @@ function F({
|
|
|
161
161
|
),
|
|
162
162
|
disabled: !u,
|
|
163
163
|
onClick: i,
|
|
164
|
-
...
|
|
164
|
+
...n,
|
|
165
165
|
children: [
|
|
166
166
|
/* @__PURE__ */ a(g, {}),
|
|
167
167
|
/* @__PURE__ */ a("span", { className: "sr-only", children: "Next slide" })
|
|
@@ -170,9 +170,9 @@ function F({
|
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
172
|
export {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
I as Carousel,
|
|
174
|
+
K as CarouselContent,
|
|
175
|
+
L as CarouselItem,
|
|
176
176
|
F as CarouselNext,
|
|
177
177
|
q as CarouselPrevious
|
|
178
178
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../../src/components/ui/carousel.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nimport useEmblaCarousel, {type UseEmblaCarouselType} from 'embla-carousel-react'\nimport {ArrowLeft, ArrowRight} from 'lucide-react'\n\nimport {cn} from '../../lib/utils'\n\nimport {BaseButton} from './button'\n\ntype CarouselApi = UseEmblaCarouselType[1]\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\ninterface CarouselProps {\n opts?: CarouselOptions\n plugins?: CarouselPlugin\n orientation?: 'horizontal' | 'vertical'\n setApi?: (api: CarouselApi) => void\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n canScrollPrev: boolean\n canScrollNext: boolean\n} & CarouselProps\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null)\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext)\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />')\n }\n\n return context\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins\n )\n const [canScrollPrev, setCanScrollPrev] = React.useState(false)\n const [canScrollNext, setCanScrollNext] = React.useState(false)\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n }, [])\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev()\n }, [api])\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext()\n }, [api])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n scrollNext()\n }\n },\n [scrollPrev, scrollNext]\n )\n\n React.useEffect(() => {\n if (!api || !setApi) return\n setApi(api)\n }, [api, setApi])\n\n React.useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on('reInit', onSelect)\n api.on('select', onSelect)\n\n return () => {\n api?.off('select', onSelect)\n }\n }, [api, onSelect])\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n opts,\n orientation:\n orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({className, ...props}: React.ComponentProps<'div'>) {\n const {carouselRef, orientation} = useCarousel()\n\n return (\n <div\n ref={carouselRef}\n className=\"overflow-hidden\"\n data-slot=\"carousel-content\"\n >\n <div\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CarouselItem({className, ...props}: React.ComponentProps<'div'>) {\n const {orientation} = useCarousel()\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'icon',\n size = 'default',\n ...props\n}: React.ComponentProps<typeof BaseButton>) {\n const {orientation, scrollPrev, canScrollPrev} = useCarousel()\n\n return (\n <BaseButton\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </BaseButton>\n )\n}\n\nfunction CarouselNext({\n className,\n variant = 'icon',\n size = 'default',\n ...props\n}: React.ComponentProps<typeof BaseButton>) {\n const {orientation, scrollNext, canScrollNext} = useCarousel()\n\n return (\n <BaseButton\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute size-8 rounded-full',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </BaseButton>\n )\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n}\n"],"names":["CarouselContext","React","useCarousel","context","Carousel","orientation","opts","setApi","plugins","className","children","props","carouselRef","api","useEmblaCarousel","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","onSelect","scrollPrev","scrollNext","handleKeyDown","event","jsx","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","jsxs","BaseButton","ArrowLeft","CarouselNext","ArrowRight"],"mappings":";;;;;;;AAgCA,MAAMA,IAAkBC,EAAM,cAA2C,IAAI;AAE7E,SAASC,IAAc;AACf,QAAAC,IAAUF,EAAM,WAAWD,CAAe;AAEhD,MAAI,CAACG;AACG,UAAA,IAAI,MAAM,gDAAgD;AAG3D,SAAAA;AACT;AAEA,SAASC,EAAS;AAAA,EAChB,aAAAC,IAAc;AAAA,EACd,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GAAgD;AACxC,QAAA,CAACC,GAAaC,CAAG,IAAIC;AAAA,IACzB;AAAA,MACE,GAAGR;AAAA,M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aAAAN,GAAa,YAAAe,GAAY,eAAAL,EAAA,IAAiBb,EAAY;AAG3D,SAAA,gBAAA6B;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,SAAAH;AAAA,MACA,MAAAC;AAAA,MACA,WAAWL;AAAA,QACT;AAAA,QACApB,MAAgB,eACZ,sCACA;AAAA,QACJI;AAAA,MACF;AAAA,MACA,UAAU,CAACM;AAAA,MACX,SAASK;AAAA,MACR,GAAGT;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAa,EAACS,GAAU,EAAA;AAAA,QACV,gBAAAT,EAAA,QAAA,EAAK,WAAU,WAAU,UAAc,iBAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAC1C;AAEJ;AAEA,SAASU,EAAa;AAAA,EACpB,WAAAzB;AAAA,EACA,SAAAoB,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,GAAGnB;AACL,GAA4C;AAC1C,QAAM,EAAC,aAAAN,GAAa,YAAAgB,GAAY,eAAAJ,EAAA,IAAiBf,EAAY;AAG3D,SAAA,gBAAA6B;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,SAAAH;AAAA,MACA,MAAAC;AAAA,MACA,WAAWL;AAAA,QACT;AAAA,QACApB,MAAgB,eACZ,uCACA;AAAA,QACJI;AAAA,MACF;AAAA,MACA,UAAU,CAACQ;AAAA,MACX,SAASI;AAAA,MACR,GAAGV;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAa,EAACW,GAAW,EAAA;AAAA,QACX,gBAAAX,EAAA,QAAA,EAAK,WAAU,WAAU,UAAU,aAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACtC;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {CheckIcon} from 'lucide-react'\nimport {Checkbox as CheckboxPrimitive} from 'radix-ui'\n\nimport {cn} from '../../lib/utils'\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport {Checkbox}\n"],"names":["Checkbox","className","props","jsx","CheckboxPrimitive.Root","cn","CheckboxPrimitive.Indicator","CheckIcon"],"mappings":";;;;AAOA,SAASA,EAAS;AAAA,EAChB,WAAAC;AAAA,EACA,GAAGC;AACL,GAAwD;AAEpD,SAAA,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGC;AAAA,MAEJ,UAAA,gBAAAC;AAAA,QAACG;AAAAA,QAAA;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,UAAA,gBAAAH,EAACI,GAAU,EAAA,WAAU,WAAW,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC;AAAA,EACF;AAEJ;"}
|