@tapcart/mobile-components 0.2.4 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +34 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +62 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +34 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +56 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +112 -0
- package/dist/components/ui/checkbox.d.ts +18 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +38 -0
- package/dist/components/ui/chip.d.ts +28 -0
- package/dist/components/ui/chip.d.ts.map +1 -0
- package/dist/components/ui/chip.js +66 -0
- package/dist/components/ui/container.d.ts +10 -0
- package/dist/components/ui/container.d.ts.map +1 -0
- package/dist/components/ui/container.js +26 -0
- package/dist/components/ui/drawer.d.ts +37 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +63 -0
- package/dist/components/ui/favorite.d.ts +13 -0
- package/dist/components/ui/favorite.d.ts.map +1 -0
- package/dist/components/ui/favorite.js +35 -0
- package/dist/components/ui/grid.d.ts +14 -0
- package/dist/components/ui/grid.d.ts.map +1 -0
- package/dist/components/ui/grid.js +33 -0
- package/dist/components/ui/icon.d.ts +13 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/components/ui/icon.js +50 -0
- package/dist/components/ui/input.d.ts +17 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +35 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +24 -0
- package/dist/components/ui/money.d.ts +12 -0
- package/dist/components/ui/money.d.ts.map +1 -0
- package/dist/components/ui/money.js +30 -0
- package/dist/components/ui/price.d.ts +13 -0
- package/dist/components/ui/price.d.ts.map +1 -0
- package/dist/components/ui/price.js +9 -0
- package/dist/components/ui/product-card.d.ts +33 -0
- package/dist/components/ui/product-card.d.ts.map +1 -0
- package/dist/components/ui/product-card.js +40 -0
- package/dist/components/ui/radio-group.d.ts +21 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +47 -0
- package/dist/components/ui/scroll-area.d.ts +9 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +29 -0
- package/dist/components/ui/selectors.d.ts +30 -0
- package/dist/components/ui/selectors.d.ts.map +1 -0
- package/dist/components/ui/selectors.js +45 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +22 -0
- package/dist/components/ui/skeleton.d.ts +13 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +33 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +22 -0
- package/dist/components/ui/tabs.d.ts +13 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +96 -0
- package/dist/components/ui/text.d.ts +10 -0
- package/dist/components/ui/text.d.ts.map +1 -0
- package/dist/components/ui/text.js +33 -0
- package/dist/components/ui/toast.d.ts +20 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +98 -0
- package/dist/components/ui/toaster.d.ts +6 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +22 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +36 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +40 -0
- package/dist/components/ui/use-toast.d.ts +45 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +112 -0
- package/dist/components/ui/video.d.ts +8 -0
- package/dist/components/ui/video.d.ts.map +1 -0
- package/dist/components/ui/video.js +22 -0
- package/dist/components/ui/wishlist.d.ts +12 -0
- package/dist/components/ui/wishlist.d.ts.map +1 -0
- package/dist/components/ui/wishlist.js +23 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +25 -0
- package/dist/styles.css +401 -145
- package/package.json +15 -8
- package/dist/index.d.mts +0 -221
- package/dist/index.mjs +0 -999
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../components/ui/container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;mFAMrB,CAAA;AAEF,MAAM,WAAW,cACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,iBAAiB,CAAC;CAAG;AAE7C,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAIlE;AAED,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
const containerVariants = cva("container", {
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
spaced: "my-3",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
function Container(_a) {
|
|
23
|
+
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
24
|
+
return (_jsx("div", Object.assign({ className: cn(containerVariants({ variant }), className) }, props), void 0));
|
|
25
|
+
}
|
|
26
|
+
export { Container, containerVariants };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
3
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const DrawerPortal: React.FC<import("@radix-ui/react-dialog").DialogPortalProps>;
|
|
5
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
|
|
7
|
+
declare const Drawer: {
|
|
8
|
+
({ shouldScaleBackground, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
backdropHexColor?: string | undefined;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DrawerContentBase: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
17
|
+
hideBackdrop?: boolean | undefined;
|
|
18
|
+
backdropHexColor?: string | undefined;
|
|
19
|
+
isSheet?: boolean | undefined;
|
|
20
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const DrawerFooter: {
|
|
22
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
26
|
+
declare type DrawerHeaderProps = {
|
|
27
|
+
iconLeftName?: string;
|
|
28
|
+
iconRightName?: string;
|
|
29
|
+
title: string;
|
|
30
|
+
onCloseClick?: (event: React.MouseEvent) => void;
|
|
31
|
+
};
|
|
32
|
+
declare const DrawerHeader: ({ title, iconLeftName, iconRightName, onCloseClick }: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare const DrawerContent: ({ children }: {
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContentBase, DrawerContent, DrawerFooter, DrawerDescription, DrawerHeader, };
|
|
37
|
+
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../components/ui/drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAA;AAIhD,QAAA,MAAM,aAAa,+HAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,8DAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,6HAAwB,CAAA;AAEzC,aAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAEpE,QAAA,MAAM,MAAM;0CAGT,WAAW;;CAOb,CAAA;AAGD,QAAA,MAAM,aAAa;;wCAajB,CAAA;AAGF,QAAA,MAAM,iBAAiB;;;;;;wCAsBrB,CAAA;AA6BF,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAKtC,CAAA;AAGD,QAAA,MAAM,iBAAiB,+LASrB,CAAA;AAGF,aAAK,iBAAiB,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAA;CACjD,CAAA;AAED,QAAA,MAAM,YAAY,yDAA0D,iBAAiB,4CAU5F,CAAA;AAED,QAAA,MAAM,aAAa;cAA8B,MAAM,SAAS;6CAE/D,CAAA;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Icon } from "../../components/ui/icon";
|
|
18
|
+
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
19
|
+
const DrawerPortal = DrawerPrimitive.Portal;
|
|
20
|
+
const DrawerClose = DrawerPrimitive.Close;
|
|
21
|
+
const Drawer = (_a) => {
|
|
22
|
+
var { shouldScaleBackground } = _a, props = __rest(_a, ["shouldScaleBackground"]);
|
|
23
|
+
return (_jsx(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: true }, props), void 0));
|
|
24
|
+
};
|
|
25
|
+
Drawer.displayName = "Drawer";
|
|
26
|
+
const DrawerOverlay = React.forwardRef((_a, ref) => {
|
|
27
|
+
var { className, backdropHexColor = "#000000" } = _a, props = __rest(_a, ["className", "backdropHexColor"]);
|
|
28
|
+
return (_jsx(DrawerPrimitive.Overlay, Object.assign({ style: { backgroundColor: `${backdropHexColor}CC` }, ref: ref, className: cn(`fixed inset-0 z-50`, className) }, props), void 0));
|
|
29
|
+
});
|
|
30
|
+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
|
|
31
|
+
const DrawerContentBase = React.forwardRef((_a, ref) => {
|
|
32
|
+
var { className, children, hideBackdrop = false, backdropHexColor, isSheet = false } = _a, props = __rest(_a, ["className", "children", "hideBackdrop", "backdropHexColor", "isSheet"]);
|
|
33
|
+
const styles = isSheet ? { height: "calc(100vh - 56px)" } : { maxHeight: "calc(100vh - 56px)" };
|
|
34
|
+
return (_jsxs(DrawerPortal, { children: [hideBackdrop ? null : _jsx(DrawerOverlay, { backdropHexColor: backdropHexColor }, void 0), _jsxs(DrawerPrimitive.Content, Object.assign({ ref: ref, style: styles, className: cn("fixed inset-x-0 bottom-0 z-50 flex h-auto flex-col rounded-t-2xl bg-coreColors-modalBackground", className) }, props, { children: [_jsx("div", { className: "mx-auto mb-2 mt-2 h-[4px] w-[40px] rounded-full bg-coreColors-dividingLines" }, void 0), children] }), void 0)] }, void 0));
|
|
35
|
+
});
|
|
36
|
+
DrawerContentBase.displayName = "DrawerContentBase";
|
|
37
|
+
const DrawerHeaderBase = (_a) => {
|
|
38
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
39
|
+
return (_jsx("div", Object.assign({ className: cn(className) }, props), void 0));
|
|
40
|
+
};
|
|
41
|
+
DrawerHeaderBase.displayName = "DrawerHeaderBase";
|
|
42
|
+
const DrawerTitle = React.forwardRef((_a, ref) => {
|
|
43
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
+
return (_jsx(DrawerPrimitive.Title, Object.assign({ ref: ref, className: cn("text-textColors-primaryColor text-center text-[18px] font-medium leading-[24px] truncate my-0 mx-4", className) }, props), void 0));
|
|
45
|
+
});
|
|
46
|
+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
47
|
+
const DrawerFooter = (_a) => {
|
|
48
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
49
|
+
return (_jsx("div", Object.assign({ className: cn("mt-auto flex flex-row gap-2 pb-8 pt-4 pl-4 pr-4 border-t border-coreColors-dividingLines", className) }, props), void 0));
|
|
50
|
+
};
|
|
51
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
52
|
+
const DrawerDescription = React.forwardRef((_a, ref) => {
|
|
53
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
+
return (_jsx(DrawerPrimitive.Description, Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props), void 0));
|
|
55
|
+
});
|
|
56
|
+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
57
|
+
const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick }) => {
|
|
58
|
+
return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, className: "h-6 w-6 p-0", size: "md" }, void 0) }), void 0)) : _jsx("span", {}, void 0), _jsx(DrawerTitle, { children: title }, void 0), iconRightName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconRightName, className: "h-6 w-6 p-0", size: "md" }, void 0) }), void 0)) : _jsx("span", {}, void 0)] }), void 0));
|
|
59
|
+
};
|
|
60
|
+
const DrawerContent = ({ children }) => {
|
|
61
|
+
return (_jsx("div", Object.assign({ className: "h-full overflow-scroll" }, { children: children }), void 0));
|
|
62
|
+
};
|
|
63
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContentBase, DrawerContent, DrawerFooter, DrawerDescription, DrawerHeader, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const favoriteVariants: (props?: ({
|
|
4
|
+
size?: "small" | "large" | null | undefined;
|
|
5
|
+
defaultVariants?: "size" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface FavoriteProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof favoriteVariants> {
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const Favorite: React.ForwardRefExoticComponent<FavoriteProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Favorite, favoriteVariants };
|
|
13
|
+
//# sourceMappingURL=favorite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"favorite.d.ts","sourceRoot":"","sources":["../../../components/ui/favorite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,gBAAgB;;;mFAarB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,QAAA,MAAM,QAAQ,yFAsBb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
import { Icon } from "./icon";
|
|
17
|
+
const favoriteVariants = cva("flex p-2 bg-coreColors-inputBackground rounded-[4px] shadow-buttonColors-primaryShadow active:[&_svg]:text-stateColors-favorites", {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
small: "p-2",
|
|
21
|
+
large: "p-3",
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: "small",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const Favorite = React.forwardRef((_a, ref) => {
|
|
29
|
+
var { className, size = "small", selected = false, onClick } = _a, props = __rest(_a, ["className", "size", "selected", "onClick"]);
|
|
30
|
+
return (_jsx("button", Object.assign({ onClick: onClick, ref: ref, className: cn(favoriteVariants({
|
|
31
|
+
size,
|
|
32
|
+
}), className) }, props, { children: _jsx(Icon, { name: "heart-filled", color: selected ? "stateColors-favorites" : "stateColors-disabled", size: size === "small" ? "xs" : "sm" }, void 0) }), void 0));
|
|
33
|
+
});
|
|
34
|
+
Favorite.displayName = "Favorite";
|
|
35
|
+
export { Favorite, favoriteVariants };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
interface GridType {
|
|
4
|
+
className: any;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const gridVariants: (props?: ({
|
|
8
|
+
columns?: 2 | 1 | 3 | 4 | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface GridProps extends GridType, VariantProps<typeof gridVariants> {
|
|
11
|
+
}
|
|
12
|
+
declare function Grid({ className, columns, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Grid, gridVariants };
|
|
14
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../components/ui/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,UAAU,QAAQ;IAChB,SAAS,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,QAAA,MAAM,YAAY;;mFAYhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,QAAQ,EACd,YAAY,CAAC,OAAO,YAAY,CAAC;CAAG;AAExC,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAMxD;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { Container } from "./container";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
const gridVariants = cva("grid", {
|
|
17
|
+
variants: {
|
|
18
|
+
columns: {
|
|
19
|
+
1: "grid-cols-1 gap-y-[7px]",
|
|
20
|
+
2: "grid-cols-2 gap-x-[7px] gap-y-[7px]",
|
|
21
|
+
3: "grid-cols-3 gap-x-[7px] gap-y-[7px]",
|
|
22
|
+
4: "grid-cols-4 gap-x-[7px] gap-y-[7px]",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
columns: 2,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
function Grid(_a) {
|
|
30
|
+
var { className, columns } = _a, props = __rest(_a, ["className", "columns"]);
|
|
31
|
+
return (_jsx(Container, { children: _jsx("div", Object.assign({ className: cn(gridVariants({ columns }), className) }, props), void 0) }, void 0));
|
|
32
|
+
}
|
|
33
|
+
export { Grid, gridVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { IconUpload, IconPencilMinus } from "@tabler/icons-react";
|
|
4
|
+
declare const iconVariants: (props?: ({
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
color?: string | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface IconProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof iconVariants> {
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function Icon({ className, name, size, color, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Icon, iconVariants, IconUpload, IconPencilMinus };
|
|
13
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAIjE,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAeD,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAW,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAuBzE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { IconUpload, IconPencilMinus } from "@tabler/icons-react";
|
|
15
|
+
import { cn, iconColorVariantClasses } from "../../lib/utils";
|
|
16
|
+
import * as allIcons from "@tabler/icons-react";
|
|
17
|
+
const iconVariants = cva("inline-flex items-center justify-center text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background", {
|
|
18
|
+
variants: {
|
|
19
|
+
size: {
|
|
20
|
+
xs: "h-4 w-4",
|
|
21
|
+
sm: "h-5 w-5",
|
|
22
|
+
md: "h-6 w-6",
|
|
23
|
+
lg: "h-14 w-14",
|
|
24
|
+
},
|
|
25
|
+
color: iconColorVariantClasses,
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
size: "md",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const strokeWidthMapping = {
|
|
32
|
+
xs: 1.5,
|
|
33
|
+
sm: 2,
|
|
34
|
+
md: 2,
|
|
35
|
+
lg: "",
|
|
36
|
+
};
|
|
37
|
+
const sizeMapping = {
|
|
38
|
+
xs: 16,
|
|
39
|
+
sm: 20,
|
|
40
|
+
md: 24,
|
|
41
|
+
lg: 56,
|
|
42
|
+
};
|
|
43
|
+
function Icon(_a) {
|
|
44
|
+
var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
|
|
45
|
+
const iconName = "Icon" +
|
|
46
|
+
(name === null || name === void 0 ? void 0 : name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(""));
|
|
47
|
+
const IconComponent = allIcons[iconName];
|
|
48
|
+
return (_jsxs("div", Object.assign({ className: cn(iconVariants({ color, size, className })) }, props, { children: [IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] }, void 0)) : null, props.children] }), void 0));
|
|
49
|
+
}
|
|
50
|
+
export { Icon, iconVariants, IconUpload, IconPencilMinus };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const inputVariants: (props?: ({
|
|
4
|
+
error?: boolean | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">, VariantProps<typeof inputVariants> {
|
|
7
|
+
id: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
value: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
onChange: (_: string) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export { Input };
|
|
17
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../components/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa;;mFAalB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,EACnE,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,QAAA,MAAM,KAAK,qFAkDV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Icon } from "./icon";
|
|
18
|
+
const inputVariants = cva("flex h-14 w-full rounded border border-coreColors-dividingLines bg-coreColors-inputBackground px-4 pt-5 pb-2 placeholder-shown:p-4 text-textColors-primaryColor text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer data-[icon=true]:pr-10", {
|
|
19
|
+
variants: {
|
|
20
|
+
error: {
|
|
21
|
+
true: "border-stateColors-error text-stateColors-error placeholder:text-stateColors-error focus:border-stateColors-error [&+label]:text-stateColors-error",
|
|
22
|
+
false: "",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
error: false,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const Input = React.forwardRef((_a, ref) => {
|
|
30
|
+
var { className, error = false, id, type, label, icon, asChild, value, placeholder, onChange } = _a, props = __rest(_a, ["className", "error", "id", "type", "label", "icon", "asChild", "value", "placeholder", "onChange"]);
|
|
31
|
+
const Comp = asChild ? Slot : "div";
|
|
32
|
+
return (_jsxs(Comp, Object.assign({ className: "relative" }, { children: [_jsx("input", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), id: id, type: type, className: cn(inputVariants({ error }), className), "data-icon": !!icon, ref: ref }, props), void 0), label ? (_jsx("label", Object.assign({ htmlFor: id, className: "absolute text-[10px] text-textColors-secondaryColor top-2 z-10 h-4 origin-[0] start-4 opacity-100 peer-placeholder-shown:opacity-0" }, { children: label }), void 0)) : null, icon ? (_jsx(Icon, { name: icon, "data-error": error, size: "sm", className: "absolute w-5 aspect-square fill-current text-textColors-secondaryColor top-[18px] z-10 origin-[0] end-4 peer-pr-8 icon data-[error=true]:text-stateColors-error" }, void 0)) : null] }), void 0));
|
|
33
|
+
});
|
|
34
|
+
Input.displayName = "Input";
|
|
35
|
+
export { Input };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
6
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../components/ui/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQjE,QAAA,MAAM,KAAK,iQAUT,CAAA;AAGF,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
16
|
+
import { cva } from "class-variance-authority";
|
|
17
|
+
import { cn } from "../../lib/utils";
|
|
18
|
+
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
19
|
+
const Label = React.forwardRef((_a, ref) => {
|
|
20
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
+
return (_jsx(LabelPrimitive.Root, Object.assign({ ref: ref, className: cn(labelVariants(), className) }, props), void 0));
|
|
22
|
+
});
|
|
23
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
24
|
+
export { Label };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
interface MoneyType {
|
|
3
|
+
currency: string;
|
|
4
|
+
locale: string;
|
|
5
|
+
price: number;
|
|
6
|
+
}
|
|
7
|
+
declare const moneyVariants: (props?: ({} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface MoneyProps extends MoneyType, VariantProps<typeof moneyVariants> {
|
|
9
|
+
}
|
|
10
|
+
declare function Money({ price, locale, currency, ...props }: MoneyProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Money, moneyVariants };
|
|
12
|
+
//# sourceMappingURL=money.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../components/ui/money.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,aAAa,gGAMjB,CAAA;AAEF,MAAM,WAAW,UACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAQ/D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
const moneyVariants = cva("", {
|
|
15
|
+
variants: {},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
currency: "USD",
|
|
18
|
+
locale: "en-US",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
function Money(_a) {
|
|
22
|
+
var { price, locale, currency } = _a, props = __rest(_a, ["price", "locale", "currency"]);
|
|
23
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
24
|
+
style: "currency",
|
|
25
|
+
currency: currency,
|
|
26
|
+
});
|
|
27
|
+
let formattedPrice = formatter.format(Number(price));
|
|
28
|
+
return _jsx("span", Object.assign({}, props, { children: formattedPrice }), void 0);
|
|
29
|
+
}
|
|
30
|
+
export { Money, moneyVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface PriceProps {
|
|
2
|
+
price: number;
|
|
3
|
+
priceHigh?: number;
|
|
4
|
+
priceRanges?: boolean;
|
|
5
|
+
isSale?: boolean;
|
|
6
|
+
compareAtPrice?: number | undefined;
|
|
7
|
+
compareAtPriceHigh?: number;
|
|
8
|
+
currency?: string;
|
|
9
|
+
locale?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function Price({ price, priceHigh, priceRanges, isSale, compareAtPrice, compareAtPriceHigh, currency, locale, }: PriceProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Price };
|
|
13
|
+
//# sourceMappingURL=price.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":"AAIA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,iBAAS,KAAK,CAAC,EACE,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,GACjB,EAAE,UAAU,2CAgD3B;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Money } from "../../components/ui/money";
|
|
3
|
+
import { Text } from "../../components/ui/text";
|
|
4
|
+
function Price({ price, priceHigh, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", }) {
|
|
5
|
+
return (_jsx(_Fragment, { children: priceRanges ? (_jsx(_Fragment, { children: isSale && compareAtPrice !== undefined && compareAtPriceHigh !== undefined ? (_jsxs("div", Object.assign({ className: "flex flex-wrap" }, { children: [_jsx(Text, Object.assign({ className: "text-textColors-salePriceText flex-shrink-0" }, { children: _jsxs("span", Object.assign({ className: "mr-2" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }, void 0), " - ", priceHigh !== undefined &&
|
|
6
|
+
_jsx(Money, { price: priceHigh, currency: currency, locale: locale }, void 0)] }), void 0) }), void 0), _jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0" }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }, void 0), " - ", _jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale }, void 0)] }), void 0)] }), void 0)) : (_jsxs(Text, Object.assign({ className: "text-textColors-priceText" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }, void 0), " - ", priceHigh !== undefined &&
|
|
7
|
+
_jsx(Money, { price: priceHigh, currency: currency, locale: locale }, void 0)] }), void 0)) }, void 0)) : (_jsx(_Fragment, { children: isSale && compareAtPrice !== undefined ? (_jsxs("div", Object.assign({ className: "flex flex-wrap" }, { children: [_jsx(Text, Object.assign({ className: "text-textColors-salePriceText flex-shrink-0" }, { children: _jsx("span", Object.assign({ className: "mr-2" }, { children: _jsx(Money, { price: price, currency: currency, locale: locale }, void 0) }), void 0) }), void 0), _jsx(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0" }, { children: _jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }, void 0) }), void 0)] }), void 0)) : (_jsx(Text, Object.assign({ className: "text-textColors-priceText" }, { children: _jsx(Money, { price: price, currency: currency, locale: locale }, void 0) }), void 0)) }, void 0)) }, void 0));
|
|
8
|
+
}
|
|
9
|
+
export { Price };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare type ProductCardProps = {
|
|
3
|
+
product: {
|
|
4
|
+
variants: {
|
|
5
|
+
compare_at_price: number | undefined;
|
|
6
|
+
price: number;
|
|
7
|
+
}[];
|
|
8
|
+
images: {
|
|
9
|
+
src: string;
|
|
10
|
+
}[];
|
|
11
|
+
title: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
};
|
|
14
|
+
className: string;
|
|
15
|
+
scaling: "fit" | "fill";
|
|
16
|
+
isQuickAddProductEnabled: boolean;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
badge?: {
|
|
19
|
+
text: string;
|
|
20
|
+
variant: "secondary" | "default" | "destructive" | "outline" | null | undefined;
|
|
21
|
+
className?: string;
|
|
22
|
+
position: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
|
|
23
|
+
};
|
|
24
|
+
icon?: {
|
|
25
|
+
name: string;
|
|
26
|
+
position: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
|
|
27
|
+
};
|
|
28
|
+
quickAdd: (event: React.MouseEvent<HTMLButtonElement>, product: ProductCardProps["product"]) => void;
|
|
29
|
+
openProduct: (event: React.MouseEvent<HTMLDivElement>, product: ProductCardProps["product"]) => void;
|
|
30
|
+
};
|
|
31
|
+
declare const ProductCard: React.FC<ProductCardProps>;
|
|
32
|
+
export { ProductCard };
|
|
33
|
+
//# sourceMappingURL=product-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../components/ui/product-card.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,aAAK,gBAAgB,GAAG;IACtB,OAAO,EAAE;QACP,QAAQ,EAAE;YAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACpE,MAAM,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;QAChF,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;KACjE,CAAC;IACF,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;KACjE,CAAA;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACrG,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;CACtG,CAAC;AAuBF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAkE3C,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Badge } from "../../components/ui/badge";
|
|
4
|
+
import { Button } from "../../components/ui/button";
|
|
5
|
+
import { Text } from "../../components/ui/text";
|
|
6
|
+
import { Price } from "../../components/ui/price";
|
|
7
|
+
import { Icon } from "../../components/ui/icon";
|
|
8
|
+
import { Skeleton } from "../../components/ui/skeleton";
|
|
9
|
+
const positionClasses = {
|
|
10
|
+
topLeft: "absolute top-0 left-0 mt-2",
|
|
11
|
+
topRight: "absolute top-0 right-0 mt-2",
|
|
12
|
+
bottomLeft: "absolute bottom-0 left-0 mb-2",
|
|
13
|
+
bottomRight: "absolute bottom-0 right-0 mb-2",
|
|
14
|
+
};
|
|
15
|
+
var BadgeAlignment;
|
|
16
|
+
(function (BadgeAlignment) {
|
|
17
|
+
BadgeAlignment["Left"] = "left";
|
|
18
|
+
BadgeAlignment["Right"] = "right";
|
|
19
|
+
BadgeAlignment["FullWidth"] = "full-width";
|
|
20
|
+
})(BadgeAlignment || (BadgeAlignment = {}));
|
|
21
|
+
const badgeAlignmentClasses = {
|
|
22
|
+
topLeft: BadgeAlignment.Left,
|
|
23
|
+
topRight: BadgeAlignment.Right,
|
|
24
|
+
bottomLeft: BadgeAlignment.Left,
|
|
25
|
+
bottomRight: BadgeAlignment.Right,
|
|
26
|
+
};
|
|
27
|
+
const ProductCard = ({ product, scaling, className, badge, icon, quickAdd, openProduct, isQuickAddProductEnabled, isLoading, }) => {
|
|
28
|
+
const { variants: [variant], images: [{ src }], title } = product;
|
|
29
|
+
const badgePosition = (badge === null || badge === void 0 ? void 0 : badge.position) || "topRight";
|
|
30
|
+
const iconPosition = (icon === null || icon === void 0 ? void 0 : icon.position) || "bottomRight";
|
|
31
|
+
const scalingClass = scaling === "fit" ? "object-contain" : "object-cover";
|
|
32
|
+
if (isLoading) {
|
|
33
|
+
return (_jsxs("div", Object.assign({ className: "w-1/2" }, { children: [_jsx(Skeleton, { className: "w-full h-64" }, void 0), _jsx(Skeleton, { className: "h-6 w-1/2 mt-2" }, void 0), _jsx(Skeleton, { className: "h-6 w-3/4 mt-2" }, void 0)] }), void 0));
|
|
34
|
+
}
|
|
35
|
+
return (_jsxs("div", Object.assign({ className: "w-1/2" }, { children: [_jsxs("div", Object.assign({ className: "relative" }, { children: [_jsx("img", { className: `w-full h-full ${scalingClass} ${isQuickAddProductEnabled ? "rounded-t-lg rounded-b-none" : "rounded-lg"}`, src: src }, void 0), badge && (_jsx(Badge, Object.assign({ size: "plp-layout", icon: "currency-dollar", className: positionClasses[badgePosition], alignment: badgeAlignmentClasses[badgePosition] }, { children: badge.text }), void 0)), icon && (_jsx(Icon, { name: "HeartFilled", className: positionClasses[iconPosition], color: "stateColors-favorites" }, void 0))] }), void 0), isQuickAddProductEnabled && (_jsx(Button, Object.assign({ variant: "quickadd", size: "sm", onClick: (e) => {
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
quickAdd(e, product);
|
|
38
|
+
} }, { children: "+ Quick add" }), void 0)), _jsx(Price, { price: variant.price, isSale: !!variant.compare_at_price, compareAtPrice: variant.compare_at_price, currency: "USD", locale: "en-US" }, void 0), _jsx(Text, Object.assign({ className: "text-textColors-productTitle" }, { children: title }), void 0)] }), void 0));
|
|
39
|
+
};
|
|
40
|
+
export { ProductCard };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export interface RadioGroupItemProps {
|
|
6
|
+
label?: string;
|
|
7
|
+
subtext?: string;
|
|
8
|
+
numberAmount?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
onSelect?: React.ReactEventHandler;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
declare const radiogroupItemVariants: (props?: ({
|
|
15
|
+
variant?: "selected" | "default" | "deactivated" | null | undefined;
|
|
16
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
17
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & RadioGroupItemProps & VariantProps<(props?: ({
|
|
18
|
+
variant?: "selected" | "default" | "deactivated" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
|
|
21
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../../components/ui/radio-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAElE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,UAAU,+JAWd,CAAA;AAGF,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAA;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,sBAAsB;;mFAc3B,CAAA;AA6BD,QAAA,MAAM,cAAc;;8HA8EnB,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAA"}
|