@tapcart/mobile-components 0.5.3 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/components/hooks/use-infinite-scroll.js +2 -2
  2. package/dist/components/hooks/use-products.d.ts +15 -0
  3. package/dist/components/hooks/use-products.d.ts.map +1 -0
  4. package/dist/components/hooks/use-products.js +11 -0
  5. package/dist/components/hooks/use-scroll-direction.d.ts +1 -1
  6. package/dist/components/hooks/use-scroll-direction.d.ts.map +1 -1
  7. package/dist/components/hooks/use-scroll-direction.js +25 -19
  8. package/dist/components/ui/badge.d.ts +4 -1
  9. package/dist/components/ui/badge.d.ts.map +1 -1
  10. package/dist/components/ui/badge.js +25 -4
  11. package/dist/components/ui/button.d.ts +1 -0
  12. package/dist/components/ui/button.d.ts.map +1 -1
  13. package/dist/components/ui/button.js +5 -4
  14. package/dist/components/ui/color-swatch.d.ts +25 -0
  15. package/dist/components/ui/color-swatch.d.ts.map +1 -0
  16. package/dist/components/ui/color-swatch.js +44 -0
  17. package/dist/components/ui/drawer.d.ts.map +1 -1
  18. package/dist/components/ui/drawer.js +1 -1
  19. package/dist/components/ui/empty-message.d.ts +4 -1
  20. package/dist/components/ui/empty-message.d.ts.map +1 -1
  21. package/dist/components/ui/empty-message.js +1 -2
  22. package/dist/components/ui/grid.d.ts +1 -1
  23. package/dist/components/ui/icon.d.ts +5 -2
  24. package/dist/components/ui/icon.d.ts.map +1 -1
  25. package/dist/components/ui/icon.js +20 -4
  26. package/dist/components/ui/price.d.ts.map +1 -1
  27. package/dist/components/ui/price.js +16 -8
  28. package/dist/components/ui/product-card.d.ts.map +1 -1
  29. package/dist/components/ui/product-card.js +3 -2
  30. package/dist/components/ui/selectors.d.ts +4 -2
  31. package/dist/components/ui/selectors.d.ts.map +1 -1
  32. package/dist/components/ui/selectors.js +5 -5
  33. package/dist/components/ui/text.d.ts +2 -1
  34. package/dist/components/ui/text.d.ts.map +1 -1
  35. package/dist/components/ui/text.js +3 -2
  36. package/dist/components/ui/toast.d.ts +2 -2
  37. package/dist/index.d.ts +32 -30
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +32 -30
  40. package/dist/styles.css +51 -7
  41. package/package.json +2 -1
@@ -78,13 +78,13 @@ const useInfiniteScroll = ({ initialData, queryVariables: queryVariableProps, })
78
78
  return {
79
79
  data,
80
80
  error,
81
- isLoadingInitialData: false,
81
+ isLoadingInitialData,
82
82
  isLoadingMore,
83
83
  isEmpty,
84
84
  isReachingEnd,
85
85
  ref,
86
86
  products: data ? data === null || data === void 0 ? void 0 : data.flatMap((page) => page === null || page === void 0 ? void 0 : page.products) : [],
87
- isLoading: isLoading,
87
+ isLoading,
88
88
  isValidating,
89
89
  };
90
90
  };
@@ -0,0 +1,15 @@
1
+ import { Product } from "app-studio-types";
2
+ type URL = string;
3
+ type UseProductsProps = {
4
+ productIds: string[];
5
+ baseURL: URL;
6
+ fetcher?: (url: string) => Promise<any>;
7
+ };
8
+ type UseProductsReturn = {
9
+ products: Product[];
10
+ error: any;
11
+ isLoading: boolean;
12
+ };
13
+ declare function useProducts({ productIds, baseURL, fetcher, }: UseProductsProps): UseProductsReturn;
14
+ export { useProducts };
15
+ //# sourceMappingURL=use-products.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-products.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-products.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,KAAK,GAAG,GAAG,MAAM,CAAA;AACjB,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,OAAO,EAAE,GAAG,CAAA;IACZ,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CACxC,CAAA;AACD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,KAAK,EAAE,GAAG,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,iBAAS,WAAW,CAAC,EACnB,UAAU,EACV,OAAO,EACP,OAAuD,GACxD,EAAE,gBAAgB,GAAG,iBAAiB,CAStC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,11 @@
1
+ import useSWR from "swr";
2
+ function useProducts({ productIds, baseURL, fetcher = (url) => fetch(url).then((res) => res.json()), }) {
3
+ const url = `${baseURL}/products/by-ids?ids=${productIds.join(",")}`;
4
+ const { data, error } = useSWR(url, fetcher);
5
+ return {
6
+ products: data || [],
7
+ error,
8
+ isLoading: !data && !error,
9
+ };
10
+ }
11
+ export { useProducts };
@@ -3,6 +3,6 @@ interface ScrollData {
3
3
  direction: ScrollDirection;
4
4
  scrollY: number;
5
5
  }
6
- declare function useScrollDirection(threshold?: number, throttleDelay?: number): ScrollData;
6
+ declare function useScrollDirection(threshold?: number): ScrollData;
7
7
  export { useScrollDirection };
8
8
  //# sourceMappingURL=use-scroll-direction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-scroll-direction.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-scroll-direction.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;AAE3C,UAAU,UAAU;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,iBAAS,kBAAkB,CACzB,SAAS,GAAE,MAAU,EACrB,aAAa,GAAE,MAAW,GACzB,UAAU,CAmDZ;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"use-scroll-direction.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-scroll-direction.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;AAE3C,UAAU,UAAU;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,iBAAS,kBAAkB,CAAC,SAAS,GAAE,MAAU,GAAG,UAAU,CAqD7D;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,21 +1,13 @@
1
1
  "use client";
2
- import { useState, useEffect, useRef } from "react";
3
- function useScrollDirection(threshold = 5, throttleDelay = 50) {
2
+ import { useState, useEffect, useRef, useTransition } from "react";
3
+ function useScrollDirection(threshold = 5) {
4
4
  const [scrollData, setScrollData] = useState({
5
5
  direction: null,
6
6
  scrollY: 0,
7
7
  });
8
+ const [isPending, startTransition] = useTransition();
8
9
  const lastScrollY = useRef(0);
9
- const throttle = (func, limit) => {
10
- let inThrottle;
11
- return (...args) => {
12
- if (!inThrottle) {
13
- func(...args);
14
- inThrottle = true;
15
- setTimeout(() => (inThrottle = false), limit);
16
- }
17
- };
18
- };
10
+ const isBouncing = useRef(false);
19
11
  useEffect(() => {
20
12
  if (typeof window === "undefined") {
21
13
  return;
@@ -25,18 +17,32 @@ function useScrollDirection(threshold = 5, throttleDelay = 50) {
25
17
  return;
26
18
  }
27
19
  const scrollY = window.scrollY;
28
- const direction = scrollY > lastScrollY.current && scrollY !== 0 ? "down" : "up";
29
- if (Math.abs(scrollY - lastScrollY.current) > threshold) {
30
- setScrollData({ direction, scrollY });
20
+ const scrollHeight = document.documentElement.scrollHeight;
21
+ const clientHeight = document.documentElement.clientHeight;
22
+ // Detect if the user is at the top or bottom of the page
23
+ if (scrollY <= 0 || scrollY + clientHeight >= scrollHeight) {
24
+ isBouncing.current = true;
25
+ }
26
+ else {
27
+ isBouncing.current = false;
28
+ }
29
+ // Prevent updating scroll direction if the page is bouncing
30
+ if (!isBouncing.current &&
31
+ Math.abs(scrollY - lastScrollY.current) > threshold) {
32
+ startTransition(() => {
33
+ setScrollData({
34
+ direction: scrollY > lastScrollY.current ? "down" : "up",
35
+ scrollY,
36
+ });
37
+ });
31
38
  lastScrollY.current = scrollY > 0 ? scrollY : 0;
32
39
  }
33
40
  };
34
- const throttledUpdateScrollDirection = throttle(updateScrollDirection, throttleDelay);
35
- window.addEventListener("scroll", throttledUpdateScrollDirection);
41
+ window.addEventListener("scroll", updateScrollDirection);
36
42
  return () => {
37
- window.removeEventListener("scroll", throttledUpdateScrollDirection);
43
+ window.removeEventListener("scroll", updateScrollDirection);
38
44
  };
39
- }, [threshold, throttleDelay]);
45
+ }, [threshold]);
40
46
  return scrollData;
41
47
  }
42
48
  export { useScrollDirection };
@@ -7,8 +7,11 @@ declare const badgeVariants: (props?: ({
7
7
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
8
8
  size: "plp-layout" | "carousels";
9
9
  icon?: string | null;
10
+ iconUrl?: string | null;
10
11
  type?: "icon-and-text" | "icon-only" | "text-only";
12
+ backgroundColor?: string | null;
13
+ fontColor?: string | null;
11
14
  }
12
- declare function Badge({ className, icon, alignment, cornerRadius, type, size, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
15
+ declare function Badge({ className, icon, iconUrl, alignment, cornerRadius, type, size, backgroundColor, fontColor, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
13
16
  export { Badge, badgeVariants };
14
17
  //# sourceMappingURL=badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,QAAA,MAAM,aAAa;;;mFAkClB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,IAAI,EAAE,YAAY,GAAG,WAAW,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,WAAW,CAAA;CACnD;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,IAAI,EACJ,SAAS,EACT,YAAwB,EACxB,IAAsB,EACtB,IAAmB,EACnB,GAAG,KAAK,EACT,EAAE,UAAU,2CA0BZ;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,QAAA,MAAM,aAAa;;;mFAqDlB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,IAAI,EAAE,YAAY,GAAG,WAAW,CAAA;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,CAAC,EAAE,eAAe,GAAG,WAAW,GAAG,WAAW,CAAA;IAClD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,IAAI,EACJ,OAAO,EACP,SAAS,EACT,YAAwB,EACxB,IAAsB,EACtB,IAAmB,EACnB,eAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,2CA6BZ;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
@@ -19,7 +19,7 @@ const badgeVariants = cva("inline-flex items-center justify-center gap-1 py-1 px
19
19
  alignment: {
20
20
  start: "",
21
21
  end: "",
22
- center: "rounded-none w-full",
22
+ center: "w-full",
23
23
  },
24
24
  cornerRadius: {
25
25
  rounded: "",
@@ -42,11 +42,32 @@ const badgeVariants = cva("inline-flex items-center justify-center gap-1 py-1 px
42
42
  cornerRadius: "rounded",
43
43
  class: "rounded-tl rounded-bl",
44
44
  },
45
+ {
46
+ alignment: "center",
47
+ cornerRadius: "rounded",
48
+ class: "rounded",
49
+ },
50
+ {
51
+ alignment: "start",
52
+ cornerRadius: "circle",
53
+ class: "rounded-tr-2xl rounded-br-2xl",
54
+ },
55
+ {
56
+ alignment: "end",
57
+ cornerRadius: "circle",
58
+ class: "rounded-tl-2xl rounded-bl-2xl",
59
+ },
60
+ {
61
+ alignment: "center",
62
+ cornerRadius: "circle",
63
+ class: "rounded-2xl",
64
+ },
45
65
  ]
46
66
  });
47
67
  function Badge(_a) {
48
- var { className, icon, alignment, cornerRadius = "rounded", type = "icon-and-text", size = "plp-layout" } = _a, props = __rest(_a, ["className", "icon", "alignment", "cornerRadius", "type", "size"]);
49
- const BadgeText = () => (_jsx(Text, Object.assign({ type: size === "plp-layout" ? "body-primary" : "body-secondary", className: "text-productBadging-text" }, { children: props.children })));
50
- return (_jsx("div", Object.assign({ className: cn(badgeVariants({ alignment, cornerRadius }), className) }, props, { children: type === "icon-and-text" ? (_jsxs(_Fragment, { children: [icon && (_jsx(Icon, { name: icon, size: size === "carousels" ? "xs" : "sm" })), _jsx(BadgeText, {})] })) : type === "icon-only" && icon ? (_jsx(Icon, { name: icon, size: size === "carousels" ? "xs" : "sm" })) : (_jsx(BadgeText, {})) })));
68
+ var { className, icon, iconUrl, alignment, cornerRadius = "rounded", type = "icon-and-text", size = "plp-layout", backgroundColor, fontColor } = _a, props = __rest(_a, ["className", "icon", "iconUrl", "alignment", "cornerRadius", "type", "size", "backgroundColor", "fontColor"]);
69
+ const backgroundColorOverride = backgroundColor ? { backgroundColor } : {};
70
+ const BadgeText = () => (_jsx(Text, Object.assign({ type: size === "plp-layout" ? "body-primary" : "body-secondary", className: "text-productBadging-text", fontColor: fontColor }, { children: props.children })));
71
+ return (_jsx("div", Object.assign({ className: cn(badgeVariants({ alignment, cornerRadius }), className), style: backgroundColorOverride }, props, { children: type === "icon-and-text" ? (_jsxs(_Fragment, { children: [(icon || iconUrl) && (_jsx(Icon, { name: icon, url: iconUrl, strokeColor: fontColor, fillColor: fontColor, size: size === "carousels" ? "xs" : "sm" })), _jsx(BadgeText, {})] })) : type === "icon-only" && icon ? (_jsx(Icon, { name: icon, url: iconUrl, strokeColor: fontColor, fillColor: fontColor, size: size === "carousels" ? "xs" : "sm" })) : (_jsx(BadgeText, {})) })));
51
72
  }
52
73
  export { Badge, badgeVariants };
@@ -11,6 +11,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
11
11
  labelClassName?: string;
12
12
  labelStyle?: React.CSSProperties | undefined;
13
13
  iconColor?: string;
14
+ iconPosition?: "left" | "right";
14
15
  }
15
16
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
16
17
  export { Button, buttonVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;mFAgCnB,CAAA;AAwCD,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,MAAM,uFAuEX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;mFAgCnB,CAAA;AAwCD,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED,QAAA,MAAM,MAAM,uFAyEX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
@@ -32,7 +32,7 @@ const buttonVariants = cva("w-full flex rounded items-center justify-center tran
32
32
  secondary: "bg-buttonColors-secondaryFill border border-buttonColors-secondaryOutlineColor disabled:bg-buttonColors-secondaryFill disabled:text-stateColors-disabled shadow-secondary",
33
33
  ghost: "hover:bg-accent",
34
34
  link: "underline-offset-4 hover:underline disabled:text-stateColors-disabled disabled:bg-transparent",
35
- quickadd: "bg-buttonColors-primaryFill border border-buttonColors-primaryOutlineColor w-full rounded-none rounded-b-lg h-8 text-xs",
35
+ quickadd: "bg-buttonColors-primaryFill w-full rounded-none rounded-b-lg h-8 text-xs border border-buttonColors-primaryOutlineColor py-2",
36
36
  applePay: "bg-white border border-black",
37
37
  shopPay: "bg-[#612EFF]",
38
38
  },
@@ -69,7 +69,7 @@ const labelVariants = cva("truncate", {
69
69
  secondary: "text-buttonColors-secondaryText",
70
70
  ghost: "hover:text-accent-foreground",
71
71
  link: "text-textColors-primaryColor",
72
- quickadd: "text-buttonColors-primaryText",
72
+ quickadd: "text-buttonColors-primaryText text-xs",
73
73
  applePay: "text-black border",
74
74
  shopPay: "",
75
75
  },
@@ -79,12 +79,13 @@ const labelVariants = cva("truncate", {
79
79
  },
80
80
  });
81
81
  const Button = React.forwardRef((_a, ref) => {
82
- var { className, labelClassName, labelStyle, variant, size, asChild = false, loading, icon, iconColor } = _a, props = __rest(_a, ["className", "labelClassName", "labelStyle", "variant", "size", "asChild", "loading", "icon", "iconColor"]);
82
+ var { className, labelClassName, labelStyle, variant, size, asChild = false, loading, icon, iconColor, iconPosition } = _a, props = __rest(_a, ["className", "labelClassName", "labelStyle", "variant", "size", "asChild", "loading", "icon", "iconColor", "iconPosition"]);
83
83
  const Comp = asChild ? Slot : "button";
84
84
  const IconButton = () => (icon ? _jsx(Icon, { name: icon, size: "sm" }) : null);
85
- const BasicButton = () => (_jsxs(_Fragment, { children: [icon ? (_jsx(Icon, { name: icon, size: variant === "quickadd" ? "xs" : "sm", className: cn(iconVariants({ variant }), "mr-2"), style: { color: iconColor } })) : null, !loading ? (_jsx(Text, Object.assign({ type: "body-primary", className: cn(labelVariants({ variant }), labelClassName), style: labelStyle }, { children: props.children }))) : (_jsx(_Fragment, {}))] }));
85
+ const BasicButton = () => (_jsxs(_Fragment, { children: [icon ? (_jsx(Icon, { name: icon, size: variant === "quickadd" ? "xs" : "sm", className: cn(iconVariants({ variant }), { "mr-2": iconPosition !== "right" }), style: { color: iconColor } })) : null, !loading ? (_jsx(Text, Object.assign({ type: "body-primary", className: cn(labelVariants({ variant }), labelClassName), style: labelStyle }, { children: props.children }))) : (_jsx(_Fragment, {}))] }));
86
86
  return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size }), className, {
87
87
  "pointer-events-none": loading,
88
+ "flex-row-reverse": icon && iconPosition === "right"
88
89
  }), ref: ref }, props, { children: loading ? (_jsx("div", Object.assign({ className: cn("flex items-center justify-center", size === "icon" ? "h-5" : "h-6") }, { children: _jsx(Icon, { className: cn(iconVariants({ variant }), "h-5 w-5 animate-spin"), name: "loader", style: { color: iconColor } }) }))) : size === "icon" ? (_jsx(IconButton, {})) : (_jsx(BasicButton, {})) })));
89
90
  });
90
91
  Button.displayName = "Button";
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { VariantProps } from "class-variance-authority";
3
+ declare const colorSwatchVariants: (props?: ({
4
+ overflow?: "wrap" | "horizontal-scroll" | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ interface Color {
7
+ color: string;
8
+ disabled?: boolean;
9
+ selected?: boolean;
10
+ }
11
+ interface Img {
12
+ url: string;
13
+ disabled?: boolean;
14
+ selected?: boolean;
15
+ }
16
+ interface ColorSwatchProps extends VariantProps<typeof colorSwatchVariants> {
17
+ className?: string;
18
+ items: Color[] | Img[];
19
+ onSelect: (color: Color | Img) => void;
20
+ shape: "rectangle" | "circle";
21
+ type: "color" | "image";
22
+ }
23
+ declare const ColorSwatch: React.FC<ColorSwatchProps>;
24
+ export { ColorSwatch, type ColorSwatchProps, type Color, type Img };
25
+ //# sourceMappingURL=color-swatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-swatch.d.ts","sourceRoot":"","sources":["../../../components/ui/color-swatch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAI5D,QAAA,MAAM,mBAAmB;;mFAWvB,CAAA;AAEF,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,UAAU,GAAG;IACX,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,UAAU,gBAAiB,SAAQ,YAAY,CAAC,OAAO,mBAAmB,CAAC;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,KAAK,EAAE,GAAG,GAAG,EAAE,CAAA;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAA;IAC7B,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;CACxB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsD3C,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,KAAK,EAAE,KAAK,GAAG,EAAE,CAAA"}
@@ -0,0 +1,44 @@
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 { cva } from "class-variance-authority";
15
+ import { cn } from "../../lib/utils";
16
+ const colorSwatchVariants = cva("grid grid-flow-col w-full gap-x-2 gap-y-2", {
17
+ variants: {
18
+ overflow: {
19
+ "horizontal-scroll": "overflow-x-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
20
+ wrap: "flex flex-wrap",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ overflow: "horizontal-scroll",
25
+ },
26
+ });
27
+ const ColorSwatch = (_a) => {
28
+ var { className, onSelect, shape = "rectangle", overflow = "horizontal-scroll", items, type } = _a, props = __rest(_a, ["className", "onSelect", "shape", "overflow", "items", "type"]);
29
+ return (_jsx("div", Object.assign({ className: cn(colorSwatchVariants({ overflow }), className) }, props, { children: items.map((item, index) => {
30
+ return (_jsx("button", Object.assign({ className: cn("border border-transparent rounded-sm", {
31
+ "border-coreColors-brandColorPrimary": item.selected,
32
+ "rounded-sm": shape === "rectangle",
33
+ "rounded-full": shape === "circle",
34
+ }), onClick: () => onSelect(item) }, { children: _jsx("div", Object.assign({ className: cn("relative h-[22px] w-[22px] border border-coreColors-dividingLines bg-contain", {
35
+ "rounded-sm": shape === "rectangle",
36
+ "rounded-full": shape === "circle",
37
+ }), style: {
38
+ backgroundColor: type === "color" ? item.color : "",
39
+ borderColor: item.selected ? "#FFF" : "",
40
+ backgroundImage: type === "image" ? `url(${item.url})` : "",
41
+ } }, { children: item.disabled ? (_jsx("div", Object.assign({ className: "absolute flex items-center justify-center", style: { inset: shape === "rectangle" ? 0 : 2 } }, { children: _jsx("div", { className: "w-full h-[1px] bg-white transform rotate-45 rounded" }) }))) : null }), index) })));
42
+ }) })));
43
+ };
44
+ export { ColorSwatch };
@@ -1 +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,KAAK,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAA;AAEpE,QAAA,MAAM,MAAM;0CAAyC,W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AAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,iBAAiB,+LASrB,CAAA;AAGF,KAAK,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,0DAKf,iBAAiB,4CA8BnB,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"}
@@ -20,7 +20,7 @@ const DrawerPortal = DrawerPrimitive.Portal;
20
20
  const DrawerClose = DrawerPrimitive.Close;
21
21
  const Drawer = (_a) => {
22
22
  var { shouldScaleBackground } = _a, props = __rest(_a, ["shouldScaleBackground"]);
23
- return _jsx(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: true }, props));
23
+ return (_jsx(DrawerPrimitive.Root, Object.assign({ shouldScaleBackground: true }, props, { noBodyStyles: true, disablePreventScroll: true })));
24
24
  };
25
25
  Drawer.displayName = "Drawer";
26
26
  const DrawerOverlay = React.forwardRef((_a, ref) => {
@@ -6,6 +6,9 @@ interface EmptyMessageProps {
6
6
  buttonLabel?: string;
7
7
  heightOffset?: number;
8
8
  openScreen: (params: OpenScreenParams) => void;
9
+ usePathname: () => string;
10
+ useRouter: () => string[];
11
+ useSearchParams: () => string;
9
12
  }
10
13
  interface Destination {
11
14
  type: "internal" | "external";
@@ -14,6 +17,6 @@ interface Destination {
14
17
  interface OpenScreenParams {
15
18
  destination: Destination;
16
19
  }
17
- declare function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, }: EmptyMessageProps): import("react/jsx-runtime").JSX.Element;
20
+ declare function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, usePathname, useRouter, useSearchParams, }: EmptyMessageProps): import("react/jsx-runtime").JSX.Element;
18
21
  export { EmptyMessage };
19
22
  //# sourceMappingURL=empty-message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty-message.d.ts","sourceRoot":"","sources":["../../../components/ui/empty-message.tsx"],"names":[],"mappings":"AAOA,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC/C;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAA;IAC7B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,UAAU,gBAAgB;IACxB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,GACX,EAAE,iBAAiB,2CA+CnB;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"empty-message.d.ts","sourceRoot":"","sources":["../../../components/ui/empty-message.tsx"],"names":[],"mappings":"AAMA,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAC9C,WAAW,EAAE,MAAM,MAAM,CAAA;IACzB,SAAS,EAAE,MAAM,MAAM,EAAE,CAAA;IACzB,eAAe,EAAE,MAAM,MAAM,CAAA;CAC9B;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,UAAU,GAAG,UAAU,CAAA;IAC7B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,UAAU,gBAAgB;IACxB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAsB,EACtB,SAAoB,EACpB,eAA0B,GAC3B,EAAE,iBAAiB,2CA+CnB;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -4,8 +4,7 @@ import { Button } from "./button";
4
4
  import { Icon } from "./icon";
5
5
  import { Text } from "./text";
6
6
  import { cn } from "../../lib/utils";
7
- import { usePathname, useRouter, useSearchParams } from "next/navigation";
8
- function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, }) {
7
+ function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, usePathname = () => "", useRouter = () => [], useSearchParams = () => "", }) {
9
8
  const router = useRouter();
10
9
  const pathname = usePathname();
11
10
  const searchParams = useSearchParams();
@@ -5,7 +5,7 @@ interface GridType {
5
5
  children: React.ReactNode;
6
6
  }
7
7
  declare const gridVariants: (props?: ({
8
- columns?: 2 | 1 | 3 | 4 | null | undefined;
8
+ columns?: 3 | 1 | 2 | 4 | null | undefined;
9
9
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
10
10
  export interface GridProps extends GridType, VariantProps<typeof gridVariants> {
11
11
  }
@@ -6,8 +6,11 @@ declare const iconVariants: (props?: ({
6
6
  color?: string | null | undefined;
7
7
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
8
8
  export interface IconProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">, VariantProps<typeof iconVariants> {
9
- name?: string;
9
+ name?: string | null;
10
+ url?: string | null;
11
+ fillColor?: string | null;
12
+ strokeColor?: string | null;
10
13
  }
11
- declare function Icon({ className, name, size, color, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
14
+ declare function Icon({ className, name, size, color, fillColor, strokeColor, url, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
12
15
  export { Icon, iconVariants, IconPencilMinus };
13
16
  //# sourceMappingURL=icon.d.ts.map
@@ -1 +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,EAEL,eAAe,EAkChB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAsDD,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,2CAczE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/ui/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAEL,eAAe,EAkChB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAsDD,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,GAAG,IAAI,CAAA;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC5B;AA8CD,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,IAAI,EACJ,IAAW,EACX,KAAK,EACL,SAAS,EACT,WAAW,EACX,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,2CAgBX;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,CAAA"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  var __rest = (this && this.__rest) || function (s, e) {
2
3
  var t = {};
3
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -10,8 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
10
11
  return t;
11
12
  };
12
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { ReactSVG } from "react-svg";
13
15
  import { cva } from "class-variance-authority";
14
- import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconChevronRight, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, IconTrash, IconLoader2, IconColumns1, IconColumns2, IconColumns3, IconSearch, IconShoppingCartOff } from "@tabler/icons-react";
16
+ import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconChevronRight, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, IconTrash, IconLoader2, IconColumns1, IconColumns2, IconColumns3, IconSearch, IconShoppingCartOff, } from "@tabler/icons-react";
15
17
  import { cn, iconColorVariantClasses } from "../../lib/utils";
16
18
  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", {
17
19
  variants: {
@@ -76,9 +78,23 @@ const icons = {
76
78
  search: IconSearch,
77
79
  "shopping-cart-off": IconShoppingCartOff,
78
80
  };
79
- function Icon(_a) {
80
- var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
81
+ const TablerIcon = ({ name, size }) => {
81
82
  const IconComponent = icons[name];
82
- return (_jsxs("div", Object.assign({ className: cn(iconVariants({ color, size, className })) }, props, { children: [IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] })) : null, props.children] })));
83
+ return IconComponent ? (_jsx(IconComponent, { size: sizeMapping[size], strokeWidth: strokeWidthMapping[size] })) : null;
84
+ };
85
+ const CustomIcon = ({ url, size, strokeColor, fillColor }) => {
86
+ return (_jsx(ReactSVG, { src: url, beforeInjection: (svg) => {
87
+ svg.setAttribute("style", `width: ${sizeMapping[size]}px; height: ${sizeMapping[size]}px`);
88
+ const paths = svg.querySelectorAll("path");
89
+ paths.forEach((path) => {
90
+ path.setAttribute("stroke-width", strokeWidthMapping[size].toString());
91
+ fillColor && path.setAttribute("fill", fillColor);
92
+ strokeColor && path.setAttribute("stroke", strokeColor);
93
+ });
94
+ } }));
95
+ };
96
+ function Icon(_a) {
97
+ var { className, name, size = "md", color, fillColor, strokeColor, url } = _a, props = __rest(_a, ["className", "name", "size", "color", "fillColor", "strokeColor", "url"]);
98
+ return (_jsxs("div", Object.assign({ className: cn(iconVariants({ size, color, className })) }, props, { children: [url ? (_jsx(CustomIcon, { url: url, size: size, strokeColor: strokeColor, fillColor: fillColor })) : (_jsx(TablerIcon, { name: name, size: size })), props.children] })));
83
99
  }
84
100
  export { Icon, iconVariants, IconPencilMinus };
@@ -1 +1 @@
1
- {"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":"AAKA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC;CAClD;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAa,EACb,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,EACb,aAAkB,GACnB,EAAE,UAAU,2CAsGZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
1
+ {"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":"AAIA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC;CAClD;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,EACb,aAAkB,GACnB,EAAE,UAAU,2CAiEZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -1,13 +1,21 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Money } from "./money";
3
3
  import { Text } from "./text";
4
4
  import { cn } from "../../lib/utils";
5
- function Price({ price, priceHigh = 0, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", fontSize = 15, textAlignment = '', }) {
6
- return (_jsx(_Fragment, { children: priceRanges ? (_jsx(_Fragment, { children: isSale &&
7
- compareAtPrice !== undefined &&
8
- compareAtPriceHigh !== undefined ? (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsxs(Text, Object.assign({ className: "text-textColors-salePriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: [_jsx("div", { className: cn("flex flex-wrap gap-2", {
9
- "ml-auto": textAlignment === 'right',
10
- "mr-auto": textAlignment === 'center',
11
- }) }), _jsxs("span", Object.assign({ className: "flex-grow min-w-[fit-content]" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }), " -", " ", priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale }))] }))] })), _jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }), " ", "-", " ", _jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale })] }))] }))) : (_jsxs(Text, Object.assign({ className: "text-textColors-priceText", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }), " -", " ", priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale }))] }))) })) : (_jsx(_Fragment, { children: isSale && compareAtPrice !== undefined ? (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsx(Text, Object.assign({ className: "text-textColors-salePriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: _jsx("span", Object.assign({ className: "mr-2" }, { children: _jsx(Money, { price: price, currency: currency, locale: locale }) })) })), _jsx(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0", style: { fontSize } }, { children: _jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }) }))] }))) : (_jsx(Text, Object.assign({ className: "text-textColors-priceText", style: { fontSize: `${fontSize}px` } }, { children: _jsx(Money, { price: price, currency: currency, locale: locale }) }))) })) }));
5
+ function Price({ price, priceHigh, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", fontSize = 15, textAlignment = '', }) {
6
+ const Spacer = () => (_jsx("span", { children: " - " }));
7
+ const ProductPrice = () => {
8
+ const colorClass = isSale ? 'text-textColors-salePriceText' : 'text-textColors-priceText';
9
+ return (_jsxs(Text, Object.assign({ className: `${colorClass} flex-shrink-0`, style: { fontSize: `${fontSize}px` } }, { children: [_jsx("div", { className: cn("flex flex-wrap gap-2", {
10
+ "ml-auto": textAlignment === 'right',
11
+ "mr-auto": textAlignment === 'center',
12
+ }) }), _jsxs("span", Object.assign({ className: "flex-grow min-w-[fit-content]" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale }), priceRanges && priceHigh !== undefined && _jsx(Spacer, {}), priceRanges && priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale }))] }))] })));
13
+ };
14
+ const StrikeThroughPrice = () => {
15
+ if (!isSale || !compareAtPrice)
16
+ return null;
17
+ return (_jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale }), priceRanges && compareAtPriceHigh && _jsx(Spacer, {}), priceRanges && compareAtPriceHigh && (_jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale }))] })));
18
+ };
19
+ return (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsx(ProductPrice, {}), _jsx(StrikeThroughPrice, {})] })));
12
20
  }
13
21
  export { Price };
@@ -1 +1 @@
1
- {"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../components/ui/product-card.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG1C,KAAK,MAAM,GAAG;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;QACpB,iBAAiB,EAAE,OAAO,CAAA;KAC3B,CAAA;IACD,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,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AC,EAAE,CACX,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAC1C,OAAO,EAAE,OAAO,KACb,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACzE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AA8HD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2U3C,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -6,6 +6,7 @@ import { Button } from "./button";
6
6
  import { Text } from "./text";
7
7
  import * as React from "react";
8
8
  import { Price } from "./price";
9
+ import { Icon } from "./icon";
9
10
  import { Skeleton } from "./skeleton";
10
11
  import { cn } from "../../lib/utils";
11
12
  import { cva } from "class-variance-authority";
@@ -221,10 +222,10 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
221
222
  : undefined, layoutType: (_t = config.favoritesIcon) === null || _t === void 0 ? void 0 : _t.layoutType }))] }))), ((_u = config.quickAdd) === null || _u === void 0 ? void 0 : _u.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
222
223
  borderBottomLeftRadius: `${config.quickAdd.cornerRadius}px`,
223
224
  borderBottomRightRadius: `${config.quickAdd.cornerRadius}px`,
224
- }, labelClassName: cn("outline-0 w-full", { uppercase: (_v = config.quickAdd) === null || _v === void 0 ? void 0 : _v.uppercase }, { "text-left": ((_w = config.quickAdd) === null || _w === void 0 ? void 0 : _w.textAlignment) === "left" }, { "text-right": ((_x = config.quickAdd) === null || _x === void 0 ? void 0 : _x.textAlignment) === "right" }, { "text-center": ((_y = config.quickAdd) === null || _y === void 0 ? void 0 : _y.textAlignment) === "center" }), labelStyle: { fontSize: (_z = config.quickAdd) === null || _z === void 0 ? void 0 : _z.fontSize }, variant: "quickadd", size: "default", onClick: (e) => {
225
+ }, labelClassName: cn("outline-0 w-full", { uppercase: (_v = config.quickAdd) === null || _v === void 0 ? void 0 : _v.uppercase }, { "text-left": ((_w = config.quickAdd) === null || _w === void 0 ? void 0 : _w.textAlignment) === "left" }, { "text-right": ((_x = config.quickAdd) === null || _x === void 0 ? void 0 : _x.textAlignment) === "right" }, { "text-center": ((_y = config.quickAdd) === null || _y === void 0 ? void 0 : _y.textAlignment) === "center" }), labelStyle: { fontSize: (_z = config.quickAdd) === null || _z === void 0 ? void 0 : _z.fontSize }, variant: "quickadd", size: "default", disabled: product.availableForSale === false, onClick: (e) => {
225
226
  e.stopPropagation();
226
227
  onQuickAdd === null || onQuickAdd === void 0 ? void 0 : onQuickAdd(e, product);
227
- } }, { children: "+ Quick add" }))), _jsxs("div", Object.assign({ className: "w-full flex-col justify-start items-start gap-0 inline-flex" }, { children: [belowBadge && (_jsx("div", Object.assign({ className: cn("mt-2 w-full flex justify-start", {
228
+ } }, { children: _jsxs("div", Object.assign({ className: "flex items-center justify-center gap-2" }, { children: [_jsx(Icon, { name: product.availableForSale ? "plus" : "shopping-cart-off", size: "xs" }), product.availableForSale ? "Quick Add" : "Sold Out"] })) }))), _jsxs("div", Object.assign({ className: "w-full flex-col justify-start items-start gap-0 inline-flex" }, { children: [belowBadge && (_jsx("div", Object.assign({ className: cn("mt-2 w-full flex justify-start", {
228
229
  "justify-end": belowBadge.horizontalPosition === "end",
229
230
  }) }, { children: _jsx(Badge, Object.assign({ size: "plp-layout", alignment: belowBadge.horizontalPosition, icon: belowBadge.image, className: cn("truncate", { rounded: belowBadge.cornerRadius === "rounded" }, { "rounded-none": belowBadge.cornerRadius === "square" }) }, { children: belowBadge.text })) }))), ((_0 = config.productTitle) === null || _0 === void 0 ? void 0 : _0.enabled) && (_jsx("div", Object.assign({ className: "mt-2 w-full" }, { children: _jsx(Text, Object.assign({ type: "body-secondary", className: cn({ uppercase: (_1 = config.productTitle) === null || _1 === void 0 ? void 0 : _1.uppercase }, {
230
231
  "text-left": ((_2 = config.productTitle) === null || _2 === void 0 ? void 0 : _2.textAlignment) === "left",
@@ -6,6 +6,7 @@ declare const selectorsVariants: (props?: ({
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
7
  type SelectorsProps = React.ComponentPropsWithoutRef<"button"> & VariantProps<typeof selectorsVariants> & {
8
8
  disabled?: boolean;
9
+ disabledClick?: boolean;
9
10
  selected?: boolean;
10
11
  label?: string;
11
12
  key?: string;
@@ -16,15 +17,16 @@ declare const Selectors: React.ForwardRefExoticComponent<Omit<React.DetailedHTML
16
17
  disabled?: boolean | null | undefined;
17
18
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & {
18
19
  disabled?: boolean | undefined;
20
+ disabledClick?: boolean | undefined;
19
21
  selected?: boolean | undefined;
20
22
  label?: string | undefined;
21
23
  key?: string | undefined;
22
24
  onSelect?: React.MouseEventHandler<HTMLButtonElement> | undefined;
23
25
  } & React.RefAttributes<HTMLButtonElement>>;
24
26
  type SelectorContainerProps = {
25
- children: React.ReactElement<SelectorsProps>[];
27
+ children: React.ReactElement<SelectorsProps>[] | React.ReactElement<SelectorsProps>;
26
28
  containerRef: React.RefObject<HTMLDivElement>;
27
- className: string;
29
+ className?: string;
28
30
  };
29
31
  declare const SelectorContainer: React.FC<SelectorContainerProps>;
30
32
  export { SelectorContainer, Selectors, selectorsVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AACD,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAA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AC,GAAG,SAAS,CAAA;CAClE,CAAA;AAEH,QAAA,MAAM,SAAS;;;;;;;;;eAHA,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS;2CA2CpE,CAAA;AACD,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IACnF,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6CvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
@@ -23,7 +23,7 @@ const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pa
23
23
  },
24
24
  disabled: {
25
25
  true: "[&>p]:!line-through [&>p]:text-stateColors-disabled",
26
- false: "cursor-pointer active:outline-coreColors-brandColorPrimary active:opacity-70",
26
+ false: "cursor-pointer",
27
27
  },
28
28
  },
29
29
  defaultVariants: {
@@ -31,12 +31,12 @@ const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pa
31
31
  },
32
32
  });
33
33
  const Selectors = React.forwardRef((_a, ref) => {
34
- var { label, selected, disabled = false, className, onSelect, children } = _a, props = __rest(_a, ["label", "selected", "disabled", "className", "onSelect", "children"]);
35
- return (_jsx("button", Object.assign({ disabled: disabled, onClick: onSelect, className: cn(selectorsVariants({
34
+ var { label, selected, disabled = false, disabledClick = true, className, onSelect, children } = _a, props = __rest(_a, ["label", "selected", "disabled", "disabledClick", "className", "onSelect", "children"]);
35
+ return (_jsx("button", Object.assign({ disabled: disabled && disabledClick, onClick: onSelect, className: cn(selectorsVariants({
36
36
  selected: selected,
37
37
  className,
38
38
  disabled,
39
- }), "group"), ref: ref }, props, { children: children ? (children) : (_jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label }))) })));
39
+ }), "group", className), ref: ref }, props, { children: children ? (children) : (_jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label }))) })));
40
40
  });
41
41
  const SelectorContainer = ({ children, containerRef, className, }) => {
42
42
  const [showFadeLeft, setShowFadeLeft] = React.useState(false);
@@ -55,7 +55,7 @@ const SelectorContainer = ({ children, containerRef, className, }) => {
55
55
  React.useEffect(() => {
56
56
  checkOverflow();
57
57
  }, [children]);
58
- return (_jsx("div", Object.assign({ className: "relative" }, { children: _jsxs("div", Object.assign({ className: cn("flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", className), onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none bg-fade-left" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none bg-fade-right" }))] })) })));
58
+ return (_jsx("div", Object.assign({ className: "relative no-scrollbar" }, { children: _jsxs("div", Object.assign({ className: cn("flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", className), onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none bg-fade-left" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none bg-fade-right" }))] })) })));
59
59
  };
60
60
  Selectors.displayName = "Selectors";
61
61
  export { SelectorContainer, Selectors, selectorsVariants };
@@ -4,7 +4,8 @@ declare const textVariants: (props?: ({
4
4
  type?: "h1" | "h2" | "label" | "body-primary" | "body-secondary" | null | undefined;
5
5
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
6
  export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof textVariants> {
7
+ fontColor?: string | null;
7
8
  }
8
- declare function Text({ className, type, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
9
+ declare function Text({ className, type, fontColor, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
9
10
  export { Text, textVariants };
10
11
  //# sourceMappingURL=text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../components/ui/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,YAAY;;mFAgBhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAChD,YAAY,CAAC,OAAO,YAAY,CAAC;CAAG;AAExC,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAErD;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../components/ui/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,YAAY;;mFAgBhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAChD,YAAY,CAAC,OAAO,YAAY,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAEL,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAIhE;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
@@ -27,7 +27,8 @@ const textVariants = cva("", {
27
27
  },
28
28
  });
29
29
  function Text(_a) {
30
- var { className, type } = _a, props = __rest(_a, ["className", "type"]);
31
- return _jsx("p", Object.assign({ className: cn(textVariants({ type }), className) }, props));
30
+ var { className, type, fontColor } = _a, props = __rest(_a, ["className", "type", "fontColor"]);
31
+ const fontColorOverride = fontColor ? { color: fontColor } : {};
32
+ return _jsx("p", Object.assign({ className: cn(textVariants({ type }), className), style: fontColorOverride }, props));
32
33
  }
33
34
  export { Text, textVariants };
@@ -4,14 +4,14 @@ import { type VariantProps } from "class-variance-authority";
4
4
  declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
5
5
  declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
6
6
  declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
7
- variant?: "default" | "error" | "warning" | "success" | null | undefined;
7
+ variant?: "error" | "default" | "warning" | "success" | null | undefined;
8
8
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
9
9
  declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
10
10
  declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
11
  declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
12
  type ToastType = "default" | "warning" | "error" | "success";
13
13
  declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
14
- type?: "default" | "error" | "warning" | "success" | undefined;
14
+ type?: "error" | "default" | "warning" | "success" | undefined;
15
15
  icon?: boolean | undefined;
16
16
  } & React.RefAttributes<HTMLDivElement>>;
17
17
  type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
package/dist/index.d.ts CHANGED
@@ -1,44 +1,46 @@
1
- export * from "./components/ui/button";
2
- export * from "./components/ui/Input/input";
3
- export * from "./components/ui/aspect-ratio";
1
+ export { cn, cva, getColor } from "./lib/utils";
2
+ export * from "./components/hooks/use-infinite-scroll";
3
+ export * from "./components/hooks/use-products";
4
+ export * from "./components/hooks/use-scroll-direction";
4
5
  export * from "./components/ui/accordion";
5
- export * from "./components/ui/icon";
6
+ export * from "./components/ui/aspect-ratio";
7
+ export * from "./components/ui/badge";
8
+ export * from "./components/ui/button";
6
9
  export * from "./components/ui/carousel";
7
10
  export * from "./components/ui/checkbox";
11
+ export * from "./components/ui/chip";
12
+ export * from "./components/ui/color-swatch";
8
13
  export * from "./components/ui/container";
14
+ export * from "./components/ui/drawer";
15
+ export * from "./components/ui/dropdown";
16
+ export * from "./components/ui/empty-message";
17
+ export * from "./components/ui/favorite";
9
18
  export * from "./components/ui/grid";
19
+ export * from "./components/ui/icon";
20
+ export * from "./components/ui/image";
21
+ export * from "./components/ui/Input/input";
10
22
  export * from "./components/ui/label";
11
- export * from "./components/ui/separator";
12
- export * from "./components/ui/badge";
13
- export * from "./components/ui/video";
23
+ export * from "./components/ui/line-item-text-icons";
14
24
  export * from "./components/ui/money";
15
- export * from "./components/ui/skeleton";
16
- export * from "./components/ui/text";
17
- export * from "./components/ui/toggle";
18
- export * from "./components/ui/toggle-group";
19
- export * from "./components/ui/switch";
25
+ export * from "./components/ui/price";
26
+ export * from "./components/ui/product-card";
27
+ export * from "./components/ui/quantity-picker";
28
+ export * from "./components/ui/radio-group";
20
29
  export * from "./components/ui/scroll-area";
21
- export * from "./components/ui/slider";
22
30
  export * from "./components/ui/selectors";
31
+ export * from "./components/ui/separator";
32
+ export * from "./components/ui/skeleton";
33
+ export * from "./components/ui/slider";
34
+ export * from "./components/ui/subscription";
35
+ export * from "./components/ui/switch";
36
+ export * from "./components/ui/tabs";
37
+ export * from "./components/ui/text";
38
+ export * from "./components/ui/textarea";
23
39
  export * from "./components/ui/toast";
24
40
  export * from "./components/ui/toaster";
25
- export * from "./components/ui/chip";
41
+ export * from "./components/ui/toggle-group";
42
+ export * from "./components/ui/toggle";
26
43
  export * from "./components/ui/use-toast";
27
- export * from "./components/ui/drawer";
28
- export * from "./components/ui/radio-group";
29
- export * from "./components/ui/tabs";
30
- export * from "./components/ui/price";
31
- export * from "./components/ui/favorite";
44
+ export * from "./components/ui/video";
32
45
  export * from "./components/ui/wishlist";
33
- export * from "./components/ui/product-card";
34
- export * from "./components/ui/dropdown";
35
- export * from "./components/ui/quantity-picker";
36
- export * from "./components/hooks/use-infinite-scroll";
37
- export * from "./components/ui/subscription";
38
- export * from "./components/ui/line-item-text-icons";
39
- export * from "./components/ui/textarea";
40
- export * from "./components/hooks/use-scroll-direction";
41
- export { cn, cva, getColor } from "./lib/utils";
42
- export * from "./components/ui/image";
43
- export * from "./components/ui/empty-message";
44
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACx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cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA;AACrC,cAAc,sCAAsC,CAAA;AACpD,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA"}
package/dist/index.js CHANGED
@@ -1,44 +1,46 @@
1
1
  // component exports
2
- export * from "./components/ui/button";
3
- export * from "./components/ui/Input/input";
4
- export * from "./components/ui/aspect-ratio";
2
+ export { cn, cva, getColor } from "./lib/utils";
3
+ export * from "./components/hooks/use-infinite-scroll";
4
+ export * from "./components/hooks/use-products";
5
+ export * from "./components/hooks/use-scroll-direction";
5
6
  export * from "./components/ui/accordion";
6
- export * from "./components/ui/icon";
7
+ export * from "./components/ui/aspect-ratio";
8
+ export * from "./components/ui/badge";
9
+ export * from "./components/ui/button";
7
10
  export * from "./components/ui/carousel";
8
11
  export * from "./components/ui/checkbox";
12
+ export * from "./components/ui/chip";
13
+ export * from "./components/ui/color-swatch";
9
14
  export * from "./components/ui/container";
15
+ export * from "./components/ui/drawer";
16
+ export * from "./components/ui/dropdown";
17
+ export * from "./components/ui/empty-message";
18
+ export * from "./components/ui/favorite";
10
19
  export * from "./components/ui/grid";
20
+ export * from "./components/ui/icon";
21
+ export * from "./components/ui/image";
22
+ export * from "./components/ui/Input/input";
11
23
  export * from "./components/ui/label";
12
- export * from "./components/ui/separator";
13
- export * from "./components/ui/badge";
14
- export * from "./components/ui/video";
24
+ export * from "./components/ui/line-item-text-icons";
15
25
  export * from "./components/ui/money";
16
- export * from "./components/ui/skeleton";
17
- export * from "./components/ui/text";
18
- export * from "./components/ui/toggle";
19
- export * from "./components/ui/toggle-group";
20
- export * from "./components/ui/switch";
26
+ export * from "./components/ui/price";
27
+ export * from "./components/ui/product-card";
28
+ export * from "./components/ui/quantity-picker";
29
+ export * from "./components/ui/radio-group";
21
30
  export * from "./components/ui/scroll-area";
22
- export * from "./components/ui/slider";
23
31
  export * from "./components/ui/selectors";
32
+ export * from "./components/ui/separator";
33
+ export * from "./components/ui/skeleton";
34
+ export * from "./components/ui/slider";
35
+ export * from "./components/ui/subscription";
36
+ export * from "./components/ui/switch";
37
+ export * from "./components/ui/tabs";
38
+ export * from "./components/ui/text";
39
+ export * from "./components/ui/textarea";
24
40
  export * from "./components/ui/toast";
25
41
  export * from "./components/ui/toaster";
26
- export * from "./components/ui/chip";
42
+ export * from "./components/ui/toggle-group";
43
+ export * from "./components/ui/toggle";
27
44
  export * from "./components/ui/use-toast";
28
- export * from "./components/ui/drawer";
29
- export * from "./components/ui/radio-group";
30
- export * from "./components/ui/tabs";
31
- export * from "./components/ui/price";
32
- export * from "./components/ui/favorite";
45
+ export * from "./components/ui/video";
33
46
  export * from "./components/ui/wishlist";
34
- export * from "./components/ui/product-card";
35
- export * from "./components/ui/dropdown";
36
- export * from "./components/ui/quantity-picker";
37
- export * from "./components/hooks/use-infinite-scroll";
38
- export * from "./components/ui/subscription";
39
- export * from "./components/ui/line-item-text-icons";
40
- export * from "./components/ui/textarea";
41
- export * from "./components/hooks/use-scroll-direction";
42
- export { cn, cva, getColor } from "./lib/utils";
43
- export * from "./components/ui/image";
44
- export * from "./components/ui/empty-message";
package/dist/styles.css CHANGED
@@ -800,9 +800,6 @@ video {
800
800
  .mb-2 {
801
801
  margin-bottom: 0.5rem;
802
802
  }
803
- .mb-4 {
804
- margin-bottom: 1rem;
805
- }
806
803
  .mb-6 {
807
804
  margin-bottom: 1.5rem;
808
805
  }
@@ -914,6 +911,9 @@ video {
914
911
  .h-\[1px\] {
915
912
  height: 1px;
916
913
  }
914
+ .h-\[22px\] {
915
+ height: 22px;
916
+ }
917
917
  .h-\[2px\] {
918
918
  height: 2px;
919
919
  }
@@ -983,6 +983,9 @@ video {
983
983
  .w-\[1px\] {
984
984
  width: 1px;
985
985
  }
986
+ .w-\[22px\] {
987
+ width: 22px;
988
+ }
986
989
  .w-\[40px\] {
987
990
  width: 40px;
988
991
  }
@@ -1055,6 +1058,10 @@ video {
1055
1058
  --tw-translate-y: -50%;
1056
1059
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1057
1060
  }
1061
+ .rotate-45 {
1062
+ --tw-rotate: 45deg;
1063
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1064
+ }
1058
1065
  .rotate-90 {
1059
1066
  --tw-rotate: 90deg;
1060
1067
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
@@ -1112,6 +1119,9 @@ video {
1112
1119
  -moz-columns: 3;
1113
1120
  columns: 3;
1114
1121
  }
1122
+ .grid-flow-col {
1123
+ grid-auto-flow: column;
1124
+ }
1115
1125
  .grid-cols-1 {
1116
1126
  grid-template-columns: repeat(1, minmax(0, 1fr));
1117
1127
  }
@@ -1130,6 +1140,9 @@ video {
1130
1140
  .flex-row {
1131
1141
  flex-direction: row;
1132
1142
  }
1143
+ .flex-row-reverse {
1144
+ flex-direction: row-reverse;
1145
+ }
1133
1146
  .flex-col {
1134
1147
  flex-direction: column;
1135
1148
  }
@@ -1169,10 +1182,17 @@ video {
1169
1182
  .gap-4 {
1170
1183
  gap: 1rem;
1171
1184
  }
1185
+ .gap-x-2 {
1186
+ -moz-column-gap: 0.5rem;
1187
+ column-gap: 0.5rem;
1188
+ }
1172
1189
  .gap-x-\[7px\] {
1173
1190
  -moz-column-gap: 7px;
1174
1191
  column-gap: 7px;
1175
1192
  }
1193
+ .gap-y-2 {
1194
+ row-gap: 0.5rem;
1195
+ }
1176
1196
  .gap-y-4 {
1177
1197
  row-gap: 1rem;
1178
1198
  }
@@ -1221,6 +1241,9 @@ video {
1221
1241
  .rounded {
1222
1242
  border-radius: 0.25rem;
1223
1243
  }
1244
+ .rounded-2xl {
1245
+ border-radius: 1rem;
1246
+ }
1224
1247
  .rounded-\[4px\] {
1225
1248
  border-radius: 4px;
1226
1249
  }
@@ -1250,15 +1273,27 @@ video {
1250
1273
  .rounded-bl {
1251
1274
  border-bottom-left-radius: 0.25rem;
1252
1275
  }
1276
+ .rounded-bl-2xl {
1277
+ border-bottom-left-radius: 1rem;
1278
+ }
1253
1279
  .rounded-br {
1254
1280
  border-bottom-right-radius: 0.25rem;
1255
1281
  }
1282
+ .rounded-br-2xl {
1283
+ border-bottom-right-radius: 1rem;
1284
+ }
1256
1285
  .rounded-tl {
1257
1286
  border-top-left-radius: 0.25rem;
1258
1287
  }
1288
+ .rounded-tl-2xl {
1289
+ border-top-left-radius: 1rem;
1290
+ }
1259
1291
  .rounded-tr {
1260
1292
  border-top-right-radius: 0.25rem;
1261
1293
  }
1294
+ .rounded-tr-2xl {
1295
+ border-top-right-radius: 1rem;
1296
+ }
1262
1297
  .border {
1263
1298
  border-width: 1px;
1264
1299
  }
@@ -1385,6 +1420,9 @@ video {
1385
1420
  .bg-fade-right {
1386
1421
  background-image: linear-gradient(to left, var(--coreColors-pageColor) 0%, #ffffff00 100%);;
1387
1422
  }
1423
+ .bg-contain {
1424
+ background-size: contain;
1425
+ }
1388
1426
  .fill-current {
1389
1427
  fill: currentColor;
1390
1428
  }
@@ -1409,10 +1447,6 @@ video {
1409
1447
  .p-\[1px\] {
1410
1448
  padding: 1px;
1411
1449
  }
1412
- .px-0 {
1413
- padding-left: 0px;
1414
- padding-right: 0px;
1415
- }
1416
1450
  .px-1 {
1417
1451
  padding-left: 0.25rem;
1418
1452
  padding-right: 0.25rem;
@@ -1878,6 +1912,12 @@ video {
1878
1912
  *:hover {
1879
1913
  text-decoration-line: unset !important;
1880
1914
  }
1915
+ .\[-ms-overflow-style\:none\] {
1916
+ -ms-overflow-style: none;
1917
+ }
1918
+ .\[scrollbar-width\:none\] {
1919
+ scrollbar-width: none;
1920
+ }
1881
1921
 
1882
1922
  body::-webkit-scrollbar {
1883
1923
  display: none;
@@ -2391,6 +2431,10 @@ body::-webkit-scrollbar {
2391
2431
  color: var(--stateColors-error);
2392
2432
  }
2393
2433
 
2434
+ .\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar {
2435
+ display: none;
2436
+ }
2437
+
2394
2438
  .\[\&\>div\>button\]\:border-coreColors-brandColorPrimary>div>button {
2395
2439
  border-color: var(--coreColors-brandColorPrimary);
2396
2440
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",
@@ -67,6 +67,7 @@
67
67
  "next-themes": "^0.2.1",
68
68
  "postcss-cli": "^11.0.0",
69
69
  "react-intersection-observer": "^9.10.2",
70
+ "react-svg": "^16.1.34",
70
71
  "swr": "^2.2.5",
71
72
  "tailwind-merge": "^1.13.2",
72
73
  "tailwindcss-animate": "^1.0.6",