@tapcart/mobile-components 0.3.0 → 0.4.0

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.
@@ -4,9 +4,10 @@ interface Product {
4
4
  interface PageData {
5
5
  products: Product[];
6
6
  cursorBlob?: string;
7
+ filtersData: any;
7
8
  }
8
9
  interface UseInfiniteScrollProps {
9
- initialData: PageData[];
10
+ initialData: PageData;
10
11
  loadMoreProducts: (params: any) => Promise<PageData>;
11
12
  queryVariables: Record<string, any>;
12
13
  }
@@ -22,6 +23,6 @@ interface UseInfiniteScrollReturn {
22
23
  isLoading: boolean;
23
24
  isValidating: boolean;
24
25
  }
25
- declare const useInfiniteScroll: ({ initialData, loadMoreProducts, queryVariables, }: UseInfiniteScrollProps) => UseInfiniteScrollReturn;
26
+ declare const useInfiniteScroll: ({ initialData, loadMoreProducts, queryVariables: queryVariableProps, }: UseInfiniteScrollProps) => UseInfiniteScrollReturn;
26
27
  export { useInfiniteScroll };
27
28
  //# sourceMappingURL=use-infinite-scroll.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAOA,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAOD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,QAAQ,EAAE,CAAA;IACvB,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACpC;AAED,UAAU,uBAAuB;IAC/B,IAAI,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAA;IACV,oBAA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,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;CACtB;AA0CD,QAAA,MAAM,iBAAiB,2EAIpB,sBAAsB,KAAG,uBA+F3B,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -1,10 +1,60 @@
1
1
  "use client";
2
- import { useCallback, useEffect } from "react";
2
+ import { useCallback, useEffect, useMemo } from "react";
3
3
  import useSWRInfinite from "swr/infinite";
4
4
  import { useInView } from "react-intersection-observer";
5
+ import { useSearchParams } from "next/navigation";
5
6
  const PAGE_SIZE = 8;
6
- const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables, }) => {
7
+ const parseSort = (json) => {
8
+ return json ? JSON.parse(json) : undefined;
9
+ };
10
+ // @ts-expect-error
11
+ const reconcileFilters = ({ selectedFilters, filtersData }) => {
12
+ if (!selectedFilters)
13
+ throw new Error("No filters provided");
14
+ const filtersArray = selectedFilters ? JSON.parse(selectedFilters) : undefined;
15
+ if (!filtersData)
16
+ throw new Error("No filters data found");
17
+ const selectedTags = new Map();
18
+ filtersArray === null || filtersArray === void 0 ? void 0 : filtersArray.forEach((filter) => {
19
+ selectedTags.set(filter, true);
20
+ });
21
+ const matchingFilters = (filtersList, selectedTags) => {
22
+ return filtersList.filter((filter) => {
23
+ const parsedFilter = filter.tag;
24
+ return selectedTags.has(parsedFilter);
25
+ });
26
+ };
27
+ const searchFilters = (filtersData === null || filtersData === void 0 ? void 0 : filtersData.map((category) => {
28
+ const filterList = category.filters;
29
+ const matchingFiltersList = matchingFilters(filterList, selectedTags);
30
+ return Object.assign(Object.assign({}, category), { filters: matchingFiltersList });
31
+ })) || [];
32
+ return {
33
+ searchFilters,
34
+ filtersData,
35
+ };
36
+ };
37
+ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables: queryVariableProps, }) => {
7
38
  var _a, _b, _c, _d;
39
+ const searchParams = useSearchParams();
40
+ const sortStateFromParam = useCallback(() => {
41
+ return searchParams.get("sort")
42
+ ? parseSort(searchParams.get("sort"))
43
+ : // we need to default to the sort option from the query variables so that the initial sort is correct
44
+ queryVariableProps.sortOption;
45
+ }, [queryVariableProps.sortOption, searchParams]);
46
+ const selectedFilters = searchParams.get("filters") || "[]";
47
+ const queryVariables = useMemo(() => {
48
+ return Object.assign(Object.assign({}, queryVariableProps), { sortOption: sortStateFromParam(), filterCategories: reconcileFilters({
49
+ selectedFilters,
50
+ filtersData: initialData.filtersData,
51
+ }).searchFilters });
52
+ }, [
53
+ initialData.filtersData,
54
+ queryVariableProps,
55
+ selectedFilters,
56
+ sortStateFromParam,
57
+ ]);
8
58
  const { ref, inView } = useInView({ rootMargin: "600px" }); // controls how early the next page loads
9
59
  const getKey = (pageIndex, previousPageData) => {
10
60
  var _a;
@@ -15,8 +65,6 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables, }) =
15
65
  return Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob });
16
66
  };
17
67
  const { data, error, size, setSize, isLoading, isValidating, } = useSWRInfinite(getKey, loadMoreProducts, {
18
- // @ts-expect-error
19
- fallbackData: [initialData],
20
68
  revalidateFirstPage: false,
21
69
  initialSize: 1,
22
70
  });
@@ -38,16 +86,20 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables, }) =
38
86
  loadMore();
39
87
  }
40
88
  }, [inView, loadMore]);
89
+ // Trigger a new page load when the query variables change
90
+ useEffect(() => {
91
+ setSize(1);
92
+ }, [queryVariables, setSize]);
41
93
  return {
42
94
  data,
43
95
  error,
44
- isLoadingInitialData,
96
+ isLoadingInitialData: false,
45
97
  isLoadingMore,
46
98
  isEmpty,
47
99
  isReachingEnd,
48
100
  ref,
49
- products: data ? data.flatMap((page) => page === null || page === void 0 ? void 0 : page.products) : [],
50
- isLoading,
101
+ products: data ? data === null || data === void 0 ? void 0 : data.flatMap((page) => page === null || page === void 0 ? void 0 : page.products) : [],
102
+ isLoading: false,
51
103
  isValidating,
52
104
  };
53
105
  };
@@ -26,10 +26,10 @@ const buttonVariants = cva("w-full flex rounded items-center justify-center tran
26
26
  content: "py-3 px-4 w-auto",
27
27
  },
28
28
  variant: {
29
- default: "bg-buttonColors-primaryFill border border-buttonColors-primaryOutlineColor shadow-buttonColors-primaryShadow",
29
+ default: "bg-buttonColors-primaryFill border border-buttonColors-primaryOutlineColor shadow-primary",
30
30
  destructive: "bg-stateColors-error disabled:bg-stateColors-disabled shadow-buttonColors-primaryShadow",
31
31
  outline: "border border-input hover:bg-accent",
32
- secondary: "bg-buttonColors-secondaryFill border border-buttonColors-secondaryOutlineColor disabled:bg-buttonColors-secondaryFill disabled:text-stateColors-disabled disabled:border-stateColors-disabled shadow-buttonColors-secondaryShadow",
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
35
  quickadd: "bg-buttonColors-primaryFill border border-buttonColors-primaryOutlineColor w-full rounded-none rounded-b-lg h-8 text-xs",
@@ -9,11 +9,16 @@ type CarouselProps = {
9
9
  plugins?: CarouselPlugin;
10
10
  orientation?: "horizontal" | "vertical";
11
11
  setApi?: (api: CarouselApi) => void;
12
+ slidesInView?: (slides: Array<number>) => void;
12
13
  };
13
14
  declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
14
15
  declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
16
  declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
17
  declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
17
18
  declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
18
- export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
19
+ type CarouselDotsProps = {
20
+ maxDots?: number;
21
+ };
22
+ declare const CarouselDots: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselDotsProps & React.RefAttributes<HTMLDivElement>>;
23
+ export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots, };
19
24
  //# sourceMappingURL=carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../components/ui/carousel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,gBAAgB,EAAE,EACvB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAA;AAM7B,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAA;AAC1C,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAChE,KAAK,eAAe,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;AAC/C,KAAK,cAAc,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAA;AAE9C,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAA;CACpC,CAAA;AAuBD,QAAA,MAAM,QAAQ,6HAyGb,CAAA;AAGD,QAAA,MAAM,eAAe,6GAmBnB,CAAA;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CACjB,CAAA;AAED,QAAA,MAAM,YAAY,iIA8ChB,CAAC;AAGH,OAAO,EACL,KAAK,WAAW,EAChB,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,CAAA"}
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import * as React from "react";
15
15
  import useEmblaCarousel from "embla-carousel-react";
16
16
  import { ArrowLeft, ArrowRight } from "lucide-react";
@@ -25,7 +25,7 @@ function useCarousel() {
25
25
  return context;
26
26
  }
27
27
  const Carousel = React.forwardRef((_a, ref) => {
28
- var { orientation = "horizontal", opts, setApi, plugins, className, children } = _a, props = __rest(_a, ["orientation", "opts", "setApi", "plugins", "className", "children"]);
28
+ var { orientation = "horizontal", opts, setApi, plugins, className, children, slidesInView } = _a, props = __rest(_a, ["orientation", "opts", "setApi", "plugins", "className", "children", "slidesInView"]);
29
29
  const [carouselRef, api] = useEmblaCarousel(Object.assign(Object.assign({}, opts), { axis: orientation === "horizontal" ? "x" : "y" }), plugins);
30
30
  const [canScrollPrev, setCanScrollPrev] = React.useState(false);
31
31
  const [canScrollNext, setCanScrollNext] = React.useState(false);
@@ -36,6 +36,12 @@ const Carousel = React.forwardRef((_a, ref) => {
36
36
  setCanScrollPrev(api.canScrollPrev());
37
37
  setCanScrollNext(api.canScrollNext());
38
38
  }, []);
39
+ const onSlidesInView = React.useCallback((api) => {
40
+ if (!api) {
41
+ return;
42
+ }
43
+ slidesInView === null || slidesInView === void 0 ? void 0 : slidesInView(api.slidesInView());
44
+ }, [slidesInView]);
39
45
  const scrollPrev = React.useCallback(() => {
40
46
  api === null || api === void 0 ? void 0 : api.scrollPrev();
41
47
  }, [api]);
@@ -65,6 +71,7 @@ const Carousel = React.forwardRef((_a, ref) => {
65
71
  onSelect(api);
66
72
  api.on("reInit", onSelect);
67
73
  api.on("select", onSelect);
74
+ api.on("slidesInView", onSlidesInView);
68
75
  return () => {
69
76
  api === null || api === void 0 ? void 0 : api.off("select", onSelect);
70
77
  };
@@ -109,4 +116,31 @@ const CarouselNext = React.forwardRef((_a, ref) => {
109
116
  : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollNext, onClick: scrollNext }, props, { children: [_jsx(ArrowRight, { className: "h-4 w-4" }), _jsx("span", Object.assign({ className: "sr-only" }, { children: "Next slide" }))] })));
110
117
  });
111
118
  CarouselNext.displayName = "CarouselNext";
112
- export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
119
+ const CarouselDots = React.forwardRef((_a, ref) => {
120
+ var { maxDots = 5 } = _a, props = __rest(_a, ["maxDots"]);
121
+ const { api } = useCarousel();
122
+ const [_, setUpdateState] = React.useState(false);
123
+ const toggleUpdateState = React.useCallback(() => setUpdateState((prevState) => !prevState), []);
124
+ React.useEffect(() => {
125
+ if (api) {
126
+ api.on('select', toggleUpdateState);
127
+ api.on('reInit', toggleUpdateState);
128
+ return () => {
129
+ api.off('select', toggleUpdateState);
130
+ api.off('reInit', toggleUpdateState);
131
+ };
132
+ }
133
+ }, [api, toggleUpdateState]);
134
+ const numberOfSlides = Math.min((api === null || api === void 0 ? void 0 : api.scrollSnapList().length) || 0, maxDots);
135
+ const currentSlide = Math.min((api === null || api === void 0 ? void 0 : api.selectedScrollSnap()) || 0, maxDots - 1);
136
+ if (numberOfSlides > 1) {
137
+ return (_jsx("div", Object.assign({ ref: ref, className: `flex justify-center ${props.className}` }, { children: Array.from({ length: numberOfSlides }, (_, i) => (_jsx(Button, { className: `mx-1 h-1.5 w-1.5 rounded-full p-0 ${i === currentSlide
138
+ ? 'bg-coreColors-brandColorPrimary'
139
+ : 'bg-coreColors-brandColorPrimary opacity-50'}`, "aria-label": `Go to slide ${i + 1}`, onClick: () => api === null || api === void 0 ? void 0 : api.scrollTo(i) }, i))) })));
140
+ }
141
+ else {
142
+ return _jsx(_Fragment, {});
143
+ }
144
+ });
145
+ CarouselDots.displayName = 'CarouselDots';
146
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots, };
@@ -32,7 +32,7 @@ const checkboxVariants = cva("flex flex-col group group-disabled", {
32
32
  });
33
33
  const Checkbox = React.forwardRef((_a, ref) => {
34
34
  var { id, className, label, numberAmount, subtext, selected = false, onCheck, onSelect, deactivated = false } = _a, props = __rest(_a, ["id", "className", "label", "numberAmount", "subtext", "selected", "onCheck", "onSelect", "deactivated"]);
35
- return (_jsx("div", Object.assign({ className: cn(checkboxVariants({ deactivated })) }, { children: _jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn("peer h-6 shrink-0 self-start rounded ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 group ", className), id: id, checked: selected, onSelect: onSelect, onCheckedChange: onCheck, disabled: deactivated !== null && deactivated !== void 0 ? deactivated : false }, props, { children: _jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group" }, { children: [_jsxs("div", Object.assign({ className: "grid" }, { children: [_jsx(CheckboxPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center text-current col-start-1 row-start-1" }, { children: !deactivated && (_jsx(Check, { className: "col-start-1 row-start-1 items-center z-50 text-coreColors-brandColorPrimary" })) })), _jsxs("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: [!deactivated && !selected && (_jsx(Unchecked, { className: "text-coreColors-secondaryIcon" })), deactivated && (_jsx(DisabledCheckbox, { className: "text-stateColors-disabled" }))] }))] })), _jsxs("div", Object.assign({ className: "flex flex-col gap-2 items-start" }, { children: [label && (_jsx("label", Object.assign({ htmlFor: id }, { children: _jsxs("span", Object.assign({ className: "flex gap-2" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled" }, { children: label })), numberAmount && (_jsxs(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled inline" }, { children: ["(", numberAmount, ")"] })))] })) }))), subtext && (_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled" }, { children: subtext })))] }))] })) })) })));
35
+ return (_jsx("div", Object.assign({ className: cn(checkboxVariants({ deactivated })) }, { children: _jsx(CheckboxPrimitive.Root, Object.assign({ ref: ref, className: cn("w-full peer h-6 shrink-0 self-start rounded ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 group ", className), id: id, checked: selected, onSelect: onSelect, onCheckedChange: onCheck, disabled: deactivated !== null && deactivated !== void 0 ? deactivated : false }, props, { children: _jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group " }, { children: [_jsxs("div", Object.assign({ className: "grid" }, { children: [_jsx(CheckboxPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center text-current col-start-1 row-start-1" }, { children: !deactivated && (_jsx(Check, { className: "col-start-1 row-start-1 items-center z-50 text-coreColors-brandColorPrimary" })) })), _jsxs("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: [!deactivated && !selected && (_jsx(Unchecked, { className: "text-coreColors-secondaryIcon" })), deactivated && (_jsx(DisabledCheckbox, { className: "text-stateColors-disabled" }))] }))] })), _jsxs("div", Object.assign({ className: "flex flex-col gap-2 items-start overflow-x-auto" }, { children: [label && (_jsx("label", Object.assign({ htmlFor: id, className: "max-w-full" }, { children: _jsxs("span", Object.assign({ className: "flex gap-2" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled text-ellipsis overflow-hidden " }, { children: label })), numberAmount && (_jsxs(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled inline" }, { children: ["(", numberAmount, ")"] })))] })) }))), subtext && (_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled" }, { children: subtext })))] }))] })) })) })));
36
36
  });
37
37
  Checkbox.displayName = CheckboxPrimitive.Root.displayName;
38
38
  export { Checkbox };
@@ -3,26 +3,28 @@ import React from "react";
3
3
  declare const chipVariants: (props?: ({
4
4
  variant?: "secondary" | "primary" | null | undefined;
5
5
  direction?: "horizontal" | "vertical" | null | undefined;
6
+ iconPosition?: "default" | "left" | "right" | null | undefined;
6
7
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
- type ChipProps = React.ComponentPropsWithoutRef<"button"> & VariantProps<typeof chipVariants> & {
8
+ type ChipProps = React.ComponentPropsWithoutRef<"div"> & VariantProps<typeof chipVariants> & {
8
9
  icon?: React.ElementType;
9
10
  iconPosition?: "left" | "right";
10
11
  onChipClick?: () => void;
11
12
  onIconClick?: () => void;
12
13
  };
13
- declare const Chip: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
14
+ declare const Chip: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & VariantProps<(props?: ({
14
15
  variant?: "secondary" | "primary" | null | undefined;
15
16
  direction?: "horizontal" | "vertical" | null | undefined;
17
+ iconPosition?: "default" | "left" | "right" | null | undefined;
16
18
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & {
17
19
  icon?: React.ElementType<any> | undefined;
18
20
  iconPosition?: "left" | "right" | undefined;
19
21
  onChipClick?: (() => void) | undefined;
20
22
  onIconClick?: (() => void) | undefined;
21
- } & React.RefAttributes<HTMLButtonElement>>;
23
+ } & React.RefAttributes<HTMLDivElement>>;
22
24
  type MultipleChipsProps = {
23
25
  children: React.ReactElement<ChipProps>[];
24
26
  containerRef: React.RefObject<HTMLDivElement>;
25
27
  };
26
28
  declare const MultipleChips: React.FC<MultipleChipsProps>;
27
- export { Chip, MultipleChips, type ChipProps };
29
+ export { Chip, MultipleChips, type ChipProps, type MultipleChipsProps };
28
30
  //# sourceMappingURL=chip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAsC,MAAM,OAAO,CAAA;AAG1D,QAAA,MAAM,YAAY;;;mFAkBjB,CAAA;AAED,KAAK,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GACvD,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAEH,QAAA,MAAM,IAAI;;;;;;yBAJc,IAAI;yBACJ,IAAI;2CAoD3B,CAAA;AAGD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAA;IACzC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC9C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkD/C,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAsC,MAAM,OAAO,CAAA;AAG1D,QAAA,MAAM,YAAY;;;;mFAwBjB,CAAA;AAED,KAAK,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GACpD,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAEH,QAAA,MAAM,IAAI;;;;;;;yBAJc,IAAI;yBACJ,IAAI;wCAgE3B,CAAA;AAGD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAA;IACzC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC9C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkD/C,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,CAAA"}
@@ -15,7 +15,7 @@ import { cva } from "class-variance-authority";
15
15
  import { cn } from "../../lib/utils";
16
16
  import React, { useState, useEffect } from "react";
17
17
  import { Icon } from "./icon";
18
- const chipVariants = cva("inline-flex items-center justify-center rounded border border-coreColors-dividingLines text-[12px] transition-colors p-2 h-8 active:opacity-70", {
18
+ const chipVariants = cva("inline-flex items-center justify-center rounded border border-coreColors-dividingLines text-[12px] transition-colors h-8 active:opacity-70", {
19
19
  variants: {
20
20
  variant: {
21
21
  primary: "bg-coreColors-pageColor text-textColors-primaryColor",
@@ -25,21 +25,27 @@ const chipVariants = cva("inline-flex items-center justify-center rounded border
25
25
  horizontal: "flex-row",
26
26
  vertical: "flex-col",
27
27
  },
28
+ iconPosition: {
29
+ default: "p-2",
30
+ left: "pr-2",
31
+ right: "pl-2",
32
+ },
28
33
  },
29
34
  defaultVariants: {
30
35
  variant: "primary",
31
36
  direction: "horizontal",
37
+ iconPosition: "default",
32
38
  },
33
39
  });
34
40
  const Chip = React.forwardRef((_a, ref) => {
35
- var { className, variant, direction, children, iconPosition = "left", onChipClick, onIconClick } = _a, props = __rest(_a, ["className", "variant", "direction", "children", "iconPosition", "onChipClick", "onIconClick"]);
41
+ var { className, variant, direction, children, iconPosition, onChipClick, onIconClick } = _a, props = __rest(_a, ["className", "variant", "direction", "children", "iconPosition", "onChipClick", "onIconClick"]);
36
42
  const handleOnClick = () => {
37
43
  onChipClick === null || onChipClick === void 0 ? void 0 : onChipClick();
38
44
  };
39
45
  const handleIconClick = () => {
40
46
  onIconClick === null || onIconClick === void 0 ? void 0 : onIconClick();
41
47
  };
42
- return (_jsxs("button", Object.assign({ onClick: handleOnClick, ref: ref, className: cn(chipVariants({ variant, direction }), className) }, props, { children: [iconPosition === "left" && (_jsx(Icon, { name: "square-x-filled", className: "mr-2 h-4 w-4 cursor-pointer", color: "coreColors-secondaryIcon", onClick: handleIconClick })), children, Icon && iconPosition === "right" && (_jsx(Icon, { name: "square-x-filled", className: "ml-2 h-4 w-4 cursor-pointer", onClick: handleIconClick, color: "coreColors-secondaryIcon" }))] })));
48
+ return (_jsxs("div", Object.assign({ onClick: handleOnClick, ref: ref, className: cn(chipVariants({ variant, direction, iconPosition }), className) }, props, { children: [iconPosition === "left" && (_jsx("button", Object.assign({ onClick: handleIconClick, className: "h-full flex items-center justify-center pl-2" }, { children: _jsx(Icon, { name: "square-x-filled", className: "mr-2 h-4 w-4 cursor-pointer", color: "coreColors-secondaryIcon" }) }))), children, iconPosition === "right" && (_jsx("button", Object.assign({ onClick: handleIconClick, className: "h-full flex items-center justify-center pr-2" }, { children: _jsx(Icon, { name: "square-x-filled", className: "ml-2 h-4 w-4 cursor-pointer", onClick: handleIconClick, color: "coreColors-secondaryIcon" }) })))] })));
43
49
  });
44
50
  Chip.displayName = "Chip";
45
51
  const MultipleChips = ({ children, containerRef, }) => {
@@ -59,7 +65,7 @@ const MultipleChips = ({ children, containerRef, }) => {
59
65
  useEffect(() => {
60
66
  checkOverflow();
61
67
  }, [children]);
62
- return (_jsxs("div", Object.assign({ className: "relative" }, { children: [_jsx("div", Object.assign({ ref: containerRef, className: "flex overflow-x-auto overflow-y-hidden no-scrollbar", onScroll: checkOverflow }, { children: children.map((chip, index) => (_jsx("div", Object.assign({ className: cn("shrink-0", {
68
+ return (_jsxs("div", Object.assign({ className: "relative no-scrollbar" }, { children: [_jsx("div", Object.assign({ ref: containerRef, className: "flex overflow-x-auto overflow-y-hidden", onScroll: checkOverflow }, { children: children.map((chip, index) => (_jsx("div", Object.assign({ className: cn("shrink-0", {
63
69
  "mr-2": index < children.length - 1,
64
70
  }) }, { children: chip }), index))) })), 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" }))] })));
65
71
  };
@@ -31,8 +31,8 @@ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
31
31
  const DrawerContentBase = React.forwardRef((_a, ref) => {
32
32
  var { className, children, hideBackdrop = false, backdropHexColor, isSheet = false } = _a, props = __rest(_a, ["className", "children", "hideBackdrop", "backdropHexColor", "isSheet"]);
33
33
  const styles = isSheet
34
- ? { height: "calc(100vh - 56px)" }
35
- : { maxHeight: "calc(100vh - 56px)" };
34
+ ? { height: "calc(100vh - 112px)" }
35
+ : { maxHeight: "calc(100vh - 112px)" };
36
36
  return (_jsxs(DrawerPortal, { children: [hideBackdrop ? null : (_jsx(DrawerOverlay, { backdropHexColor: backdropHexColor })), _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" }), children] }))] }));
37
37
  });
38
38
  DrawerContentBase.displayName = "DrawerContentBase";
@@ -0,0 +1,19 @@
1
+ interface EmptyMessageProps {
2
+ iconName: string;
3
+ title: string;
4
+ description: string;
5
+ className?: string;
6
+ buttonLabel?: string;
7
+ heightOffset?: number;
8
+ openScreen: (params: OpenScreenParams) => void;
9
+ }
10
+ interface Destination {
11
+ type: "internal" | "external";
12
+ url: string;
13
+ }
14
+ interface OpenScreenParams {
15
+ destination: Destination;
16
+ }
17
+ declare function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, }: EmptyMessageProps): import("react/jsx-runtime").JSX.Element;
18
+ export { EmptyMessage };
19
+ //# sourceMappingURL=empty-message.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button } from "./button";
4
+ import { Icon } from "./icon";
5
+ import { Text } from "./text";
6
+ import { cn } from "../../lib/utils";
7
+ import { usePathname, useRouter, useSearchParams } from "next/navigation";
8
+ function EmptyMessage({ iconName, title, description, className, buttonLabel, openScreen, }) {
9
+ const router = useRouter();
10
+ const pathname = usePathname();
11
+ const searchParams = useSearchParams();
12
+ const onClick = () => {
13
+ const newParams = new URLSearchParams(searchParams.toString());
14
+ const filters = newParams.get("filters");
15
+ if (filters) {
16
+ newParams.delete("filters");
17
+ router.push(`${pathname}?${newParams}`);
18
+ }
19
+ else {
20
+ openScreen({
21
+ destination: {
22
+ type: "internal",
23
+ url: "/home",
24
+ },
25
+ });
26
+ }
27
+ };
28
+ return (_jsxs("div", Object.assign({ className: cn("flex-grow flex flex-col justify-center items-center gap-4 h-full", className) }, { children: [_jsxs("div", Object.assign({ className: "flex flex-col justify-center items-center gap-2" }, { children: [_jsx(Icon, { name: iconName, size: "md", color: "coreColors-secondaryIcon" }), _jsx(Text, Object.assign({ type: "h2", className: "text-textColors-primaryColor text-center" }, { children: title })), _jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor text-center" }, { children: description }))] })), buttonLabel ? (_jsx(Button, Object.assign({ variant: "default", onClick: onClick, className: "w-auto" }, { children: buttonLabel }))) : null] })));
29
+ }
30
+ export { EmptyMessage };
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM1D,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;CACzB,C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K,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,EACpE,MAAM,GAAE,MAAsB,EAC9B,WAAW,UAAQ,GAClB,MAAM,CAiBR;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,6BAA0B,EAC/B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAUV;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,GAAE,IAAe,GAEnB;IACE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,IAAI,CAAA;CACX,EAAE,GACH,SAAS,CAUZ"}
@@ -135,21 +135,14 @@ export const Image = React.forwardRef((_a, ref) => {
135
135
  setHasError(true);
136
136
  };
137
137
  const imgClassName = `opacity-0 transition-opacity duration-500 ease-in-out ${isLoaded ? "opacity-100" : ""}`;
138
- const aspectRatioPadding = aspectRatio
139
- ? {
140
- paddingBottom: `${(parseFloat(aspectRatio.split(":")[1]) /
141
- parseFloat(aspectRatio.split(":")[0])) *
142
- 100}%`,
143
- }
144
- : { paddingBottom: "100%" };
145
138
  const wrapperStyle = {
146
- paddingBottom: !isLoaded ? aspectRatioPadding.paddingBottom : undefined,
147
139
  aspectRatio: (_b = normalizedProps.aspectRatio) === null || _b === void 0 ? void 0 : _b.replace(":", "/"),
148
140
  };
149
- return (_jsx("div", Object.assign({ className: "relative w-full bg-stateColors-skeleton ", style: wrapperStyle }, { children: !hasError && normalizedProps.src ? (_jsx("img", Object.assign({ ref: ref, alt: normalizedProps.alt, decoding: decoding, height: normalizedProps.height, loading: loading, src: normalizedProps.src, srcSet: generateSrcSet(normalizedProps.src, generateSizes(imageWidths, normalizedProps.aspectRatio, crop), loader, objectFit === "contain"), width: normalizedProps.width, className: imgClassName, onLoad: handleImageLoad, onError: handleImageError, sizes: sizes, style: {
141
+ return (_jsx("div", Object.assign({ className: "relative bg-stateColors-skeleton border-transparent", style: wrapperStyle }, { children: !hasError && normalizedProps.src ? (_jsx("img", Object.assign({ ref: ref, alt: normalizedProps.alt, decoding: decoding, height: normalizedProps.height, loading: loading, src: normalizedProps.src, srcSet: generateSrcSet(normalizedProps.src, generateSizes(imageWidths, normalizedProps.aspectRatio, crop), loader, normalizedProps.objectFit === "contain"), width: normalizedProps.width, className: imgClassName, onLoad: handleImageLoad, onError: handleImageError, sizes: sizes, style: {
150
142
  objectFit: normalizedProps.objectFit,
151
143
  maxHeight: "100%",
152
144
  height: "100%",
145
+ width: "100%",
153
146
  } }, passthroughProps))) : (_jsx("div", { className: "absolute top-0 left-0 w-full h-full bg-stateColors-skeleton " })) })));
154
147
  });
155
148
  /**
@@ -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;CAClB;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,GACd,EAAE,UAAU,2CAuFZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
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;CAClB;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,GACd,EAAE,UAAU,2CAwFZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -5,6 +5,7 @@ type Config = {
5
5
  productImage?: {
6
6
  enabled: boolean;
7
7
  cornerRadius: number;
8
+ allowSwipeability: boolean;
8
9
  };
9
10
  price?: {
10
11
  enabled: boolean;
@@ -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;AAE1C,KAAK,MAAM,GAAG;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,KAAK,CAAC,EA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A"}
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,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,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,CAAA;QAChB,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAA;KAClD,CAAA;IACD,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,OAAO,CAAA;QAClB,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,EAAE,OAAO,CAAA;KAClB,CAAA;IACD,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,OAAO,CAAA;QAClB,aAAa,EAAE,MAAM,CAAA;QACrB,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,aAAa,CAAC,EAAE;QACd,OAAO,EAAE,OAAO,CAAA;QAChB,UAAU,EACN,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,sBAAsB,CAAA;QAC1B,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAA;QACpB,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU,CAAA;YAChB,GAAG,EAAE,QAAQ,CAAA;YACb,OAAO,CAAC,EAAE,MAAM,CAAA;SACjB,CAAA;KACF,CAAA;CACF,C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AI,CAAA;IACT,UAAU,CAAC,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;CAC1E,CAAA;AA8HD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiU3C,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -10,23 +10,7 @@ import { Skeleton } from "./skeleton";
10
10
  import { cn } from "../../lib/utils";
11
11
  import { cva } from "class-variance-authority";
12
12
  import { Image } from "./image";
13
- const aspectScalingVariants = cva("w-full", {
14
- variants: {
15
- aspectRatio: {
16
- "1:1": "aspect-square",
17
- "2:3": "aspect-[2/3]",
18
- "4:5": "aspect-[4/5]",
19
- },
20
- scaling: {
21
- fill: "object-cover",
22
- fit: "object-contain",
23
- },
24
- },
25
- defaultVariants: {
26
- aspectRatio: "2:3",
27
- scaling: "fill",
28
- },
29
- });
13
+ import { Carousel, CarouselContent, CarouselDots, CarouselItem } from "./carousel";
30
14
  const productCardBadgeVariants = cva("absolute truncate", {
31
15
  variants: {
32
16
  horizontalPosition: {
@@ -39,7 +23,18 @@ const productCardBadgeVariants = cva("absolute truncate", {
39
23
  bottom: "bottom-0 mb-2",
40
24
  below: "",
41
25
  },
26
+ imageSwipeEnabled: {
27
+ true: "",
28
+ false: "",
29
+ },
42
30
  },
31
+ compoundVariants: [
32
+ {
33
+ verticalPosition: "bottom",
34
+ imageSwipeEnabled: true,
35
+ class: "bottom-[18px]",
36
+ },
37
+ ],
43
38
  });
44
39
  const productCardFavoriteVariants = cva("absolute ", {
45
40
  variants: {
@@ -60,22 +55,32 @@ const productCardFavoriteVariants = cva("absolute ", {
60
55
  bottom: "",
61
56
  below: "",
62
57
  },
58
+ isSoldOut: {
59
+ true: "",
60
+ false: "",
61
+ },
63
62
  showSoldOutBadge: {
64
63
  true: "",
65
64
  false: "",
66
65
  },
66
+ imageSwipeEnabled: {
67
+ true: "",
68
+ false: "",
69
+ },
67
70
  },
68
71
  compoundVariants: [
69
72
  {
70
73
  iconPosition: "top-left",
71
74
  badgeHorizontalPosition: ["start", "center"],
72
75
  badgeVerticalPosition: "top",
76
+ showSoldOutBadge: false,
73
77
  class: "top-10",
74
78
  },
75
79
  {
76
80
  iconPosition: "top-right",
77
81
  badgeHorizontalPosition: ["end", "center"],
78
82
  badgeVerticalPosition: "top",
83
+ showSoldOutBadge: false,
79
84
  class: "top-10",
80
85
  },
81
86
  {
@@ -95,13 +100,41 @@ const productCardFavoriteVariants = cva("absolute ", {
95
100
  showSoldOutBadge: true,
96
101
  class: "bottom-10",
97
102
  },
103
+ {
104
+ iconPosition: ["bottom-left", "bottom-right"],
105
+ imageSwipeEnabled: true,
106
+ class: "bottom-[18px]",
107
+ },
108
+ {
109
+ iconPosition: "bottom-left",
110
+ badgeHorizontalPosition: ["start", "center"],
111
+ badgeVerticalPosition: "bottom",
112
+ isSoldOut: false,
113
+ showSoldOutBadge: false,
114
+ imageSwipeEnabled: true,
115
+ class: "bottom-[58px]",
116
+ },
117
+ {
118
+ iconPosition: "bottom-right",
119
+ badgeHorizontalPosition: ["end", "center"],
120
+ badgeVerticalPosition: "bottom",
121
+ showSoldOutBadge: false,
122
+ imageSwipeEnabled: true,
123
+ class: "bottom-[58px]",
124
+ },
125
+ {
126
+ iconPosition: "bottom-left",
127
+ showSoldOutBadge: true,
128
+ imageSwipeEnabled: true,
129
+ class: "bottom-[58px]",
130
+ },
98
131
  ],
99
132
  defaultVariants: {
100
133
  iconPosition: "below-image-on-right",
101
134
  },
102
135
  });
103
136
  const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFavoriteClick, onQuickAdd, openProduct, }) => {
104
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15;
137
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18;
105
138
  const { variants, images, title, tags } = product;
106
139
  // Select the variant that has the lowest price that is available or just the lowest price if none are available
107
140
  let searchVariants = variants.filter((variant) => variant.available);
@@ -151,50 +184,63 @@ const ProductCard = ({ config, tapcartData, product, isLoading, favorited, onFav
151
184
  }
152
185
  };
153
186
  const sizes = getImageSizes(config);
187
+ const imageSwipeEnabled = (((_e = config.productImage) === null || _e === void 0 ? void 0 : _e.allowSwipeability) && product.images.length > 1);
154
188
  return (_jsx("div", Object.assign({ className: `w-1/2` }, { children: _jsxs("div", Object.assign({ className: "w-full active:opacity-70", onClick: () => {
155
189
  _openProduct();
156
- } }, { children: [((_e = config.productImage) === null || _e === void 0 ? void 0 : _e.enabled) && (_jsxs("div", Object.assign({ className: "relative w-full overflow-hidden", style: {
190
+ } }, { children: [((_f = config.productImage) === null || _f === void 0 ? void 0 : _f.enabled) && (_jsxs("div", Object.assign({ className: "relative w-full overflow-hidden", style: {
157
191
  borderTopLeftRadius: `${config.productImage.cornerRadius}px`,
158
192
  borderTopRightRadius: `${config.productImage.cornerRadius}px`,
159
- } }, { children: [_jsx(Image, { alt: product.title, aspectRatio: (_g = (_f = tapcartData.theme) === null || _f === void 0 ? void 0 : _f.productImages) === null || _g === void 0 ? void 0 : _g.aspectRatio, data: product.featuredImage || product.images[0], sizes: sizes, objectFit: (_j = (_h = tapcartData.theme) === null || _h === void 0 ? void 0 : _h.productImages) === null || _j === void 0 ? void 0 : _j.scaling }), aboveBadge && product.availableForSale && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(productCardBadgeVariants({
193
+ borderBottomLeftRadius: `${((_g = config.quickAdd) === null || _g === void 0 ? void 0 : _g.enabled) ? "0" : config.productImage.cornerRadius}px`,
194
+ borderBottomRightRadius: `${((_h = config.quickAdd) === null || _h === void 0 ? void 0 : _h.enabled) ? "0" : config.productImage.cornerRadius}px`,
195
+ } }, { children: [imageSwipeEnabled ? (_jsx(Carousel, Object.assign({ className: "w-full max-w-xs overflow-hidden relative" }, { children: _jsxs("div", Object.assign({ className: "relative" }, { children: [_jsx(CarouselContent, Object.assign({ className: "" }, { children: product.images.map((image, index) => {
196
+ var _a, _b, _c, _d;
197
+ return (_jsx(CarouselItem, Object.assign({ className: "pl-0" }, { children: _jsx(Image, { alt: product.title, aspectRatio: (_b = (_a = tapcartData.theme) === null || _a === void 0 ? void 0 : _a.productImages) === null || _b === void 0 ? void 0 : _b.aspectRatio, data: image, sizes: sizes, objectFit: (_d = (_c = tapcartData.theme) === null || _c === void 0 ? void 0 : _c.productImages) === null || _d === void 0 ? void 0 : _d.scaling }) })));
198
+ }) })), _jsx(CarouselDots, { className: "absolute left-0 w-full bottom-2" })] })) }))) : (_jsx(Image, { alt: product.title, aspectRatio: (_k = (_j = tapcartData.theme) === null || _j === void 0 ? void 0 : _j.productImages) === null || _k === void 0 ? void 0 : _k.aspectRatio, data: product.featuredImage || product.images[0], sizes: sizes, objectFit: (_m = (_l = tapcartData.theme) === null || _l === void 0 ? void 0 : _l.productImages) === null || _m === void 0 ? void 0 : _m.scaling })), aboveBadge && product.availableForSale && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(productCardBadgeVariants({
160
199
  verticalPosition: aboveBadge.verticalPosition,
161
200
  horizontalPosition: aboveBadge.horizontalPosition,
201
+ imageSwipeEnabled,
162
202
  })), style: {
163
203
  color: aboveBadge.fontColor,
164
204
  backgroundColor: aboveBadge.backgroundColor,
165
- }, alignment: aboveBadge.horizontalPosition, cornerRadius: aboveBadge.cornerRadius, icon: aboveBadge.image }, { children: aboveBadge.text }))), showSoldOutBadge && (_jsx(Badge, Object.assign({ size: "plp-layout", className: "absolute left-0 bottom-0 mb-2 bg-stateColors-disabled", alignment: "start", cornerRadius: "rounded", type: "text-only" }, { children: "Sold Out" }))), ((_k = config.favoritesIcon) === null || _k === void 0 ? void 0 : _k.enabled) &&
205
+ }, alignment: aboveBadge.horizontalPosition, cornerRadius: aboveBadge.cornerRadius, icon: aboveBadge.image }, { children: aboveBadge.text }))), showSoldOutBadge && (_jsx(Badge, Object.assign({ size: "plp-layout", className: cn(productCardBadgeVariants({
206
+ verticalPosition: "bottom",
207
+ horizontalPosition: "start",
208
+ imageSwipeEnabled,
209
+ }), "bg-stateColors-disabled"), alignment: "start", cornerRadius: "rounded", type: "text-only" }, { children: "Sold Out" }))), ((_o = config.favoritesIcon) === null || _o === void 0 ? void 0 : _o.enabled) &&
166
210
  iconPosition !== "below-image-on-right" && (_jsx(Favorite, { className: cn(productCardFavoriteVariants({
167
211
  iconPosition,
168
212
  badgeHorizontalPosition: aboveBadge === null || aboveBadge === void 0 ? void 0 : aboveBadge.horizontalPosition,
169
213
  badgeVerticalPosition: aboveBadge === null || aboveBadge === void 0 ? void 0 : aboveBadge.verticalPosition,
214
+ isSoldOut: !product.availableForSale,
170
215
  showSoldOutBadge,
216
+ imageSwipeEnabled
171
217
  })), selected: favorited, onClick: (e) => {
172
218
  onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
173
- }, icon: ((_m = (_l = config.favoritesIcon) === null || _l === void 0 ? void 0 : _l.icon) === null || _m === void 0 ? void 0 : _m.type) === "internal"
174
- ? (_p = (_o = config.favoritesIcon) === null || _o === void 0 ? void 0 : _o.icon) === null || _p === void 0 ? void 0 : _p.url
175
- : undefined }))] }))), ((_q = config.quickAdd) === null || _q === void 0 ? void 0 : _q.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
219
+ }, icon: ((_q = (_p = config.favoritesIcon) === null || _p === void 0 ? void 0 : _p.icon) === null || _q === void 0 ? void 0 : _q.type) === "internal"
220
+ ? (_s = (_r = config.favoritesIcon) === null || _r === void 0 ? void 0 : _r.icon) === null || _s === void 0 ? void 0 : _s.url
221
+ : undefined }))] }))), ((_t = config.quickAdd) === null || _t === void 0 ? void 0 : _t.enabled) && (_jsx(Button, Object.assign({ className: "outline-0", style: {
176
222
  borderBottomLeftRadius: `${config.quickAdd.cornerRadius}px`,
177
223
  borderBottomRightRadius: `${config.quickAdd.cornerRadius}px`,
178
- }, labelClassName: cn("outline-0 w-full", { uppercase: (_r = config.quickAdd) === null || _r === void 0 ? void 0 : _r.uppercase }, { "text-left": ((_s = config.quickAdd) === null || _s === void 0 ? void 0 : _s.textAlignment) === "left" }, { "text-right": ((_t = config.quickAdd) === null || _t === void 0 ? void 0 : _t.textAlignment) === "right" }, { "text-center": ((_u = config.quickAdd) === null || _u === void 0 ? void 0 : _u.textAlignment) === "center" }), labelStyle: { fontSize: (_v = config.quickAdd) === null || _v === void 0 ? void 0 : _v.fontSize }, variant: "quickadd", size: "default", onClick: (e) => {
224
+ }, labelClassName: cn("outline-0 w-full", { uppercase: (_u = config.quickAdd) === null || _u === void 0 ? void 0 : _u.uppercase }, { "text-left": ((_v = config.quickAdd) === null || _v === void 0 ? void 0 : _v.textAlignment) === "left" }, { "text-right": ((_w = config.quickAdd) === null || _w === void 0 ? void 0 : _w.textAlignment) === "right" }, { "text-center": ((_x = config.quickAdd) === null || _x === void 0 ? void 0 : _x.textAlignment) === "center" }), labelStyle: { fontSize: (_y = config.quickAdd) === null || _y === void 0 ? void 0 : _y.fontSize }, variant: "quickadd", size: "default", onClick: (e) => {
179
225
  e.stopPropagation();
180
226
  onQuickAdd === null || onQuickAdd === void 0 ? void 0 : onQuickAdd(e, product);
181
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", {
182
228
  "justify-end": belowBadge.horizontalPosition === "end",
183
- }) }, { 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 })) }))), ((_w = config.productTitle) === null || _w === void 0 ? void 0 : _w.enabled) && (_jsx("div", Object.assign({ className: "mt-2 w-full" }, { children: _jsx(Text, Object.assign({ type: "body-secondary", className: cn({ uppercase: (_x = config.productTitle) === null || _x === void 0 ? void 0 : _x.uppercase }, {
184
- "text-left": ((_y = config.productTitle) === null || _y === void 0 ? void 0 : _y.textAlignment) === "left",
229
+ }) }, { 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 })) }))), ((_z = config.productTitle) === null || _z === void 0 ? void 0 : _z.enabled) && (_jsx("div", Object.assign({ className: "mt-2 w-full" }, { children: _jsx(Text, Object.assign({ type: "body-secondary", className: cn({ uppercase: (_0 = config.productTitle) === null || _0 === void 0 ? void 0 : _0.uppercase }, {
230
+ "text-left": ((_1 = config.productTitle) === null || _1 === void 0 ? void 0 : _1.textAlignment) === "left",
185
231
  }, {
186
- "text-right": ((_z = config.productTitle) === null || _z === void 0 ? void 0 : _z.textAlignment) === "right",
232
+ "text-right": ((_2 = config.productTitle) === null || _2 === void 0 ? void 0 : _2.textAlignment) === "right",
187
233
  }, {
188
- "text-center": ((_0 = config.productTitle) === null || _0 === void 0 ? void 0 : _0.textAlignment) === "center",
189
- }, { truncate: !((_1 = config.productTitle) === null || _1 === void 0 ? void 0 : _1.wrapText) }, { "text-wrap": (_2 = config.productTitle) === null || _2 === void 0 ? void 0 : _2.wrapText }, "text-textColors-productTitle"), style: { fontSize: (_3 = config.productTitle) === null || _3 === void 0 ? void 0 : _3.fontSize } }, { children: title })) }))), _jsxs("div", Object.assign({ className: cn("flex flex-row w-full gap-2 mt-1 justify-end", { "justify-start": ((_4 = config.price) === null || _4 === void 0 ? void 0 : _4.textAlignment) === "left" }, { "justify-end": ((_5 = config.price) === null || _5 === void 0 ? void 0 : _5.textAlignment) === "right" }, { "justify-center": ((_6 = config.price) === null || _6 === void 0 ? void 0 : _6.textAlignment) === "center" }) }, { children: [((_7 = config.price) === null || _7 === void 0 ? void 0 : _7.enabled) && (_jsx(Price, { price: parseFloat(variant.price.amount), isSale: !!variant.compareAtPrice &&
234
+ "text-center": ((_3 = config.productTitle) === null || _3 === void 0 ? void 0 : _3.textAlignment) === "center",
235
+ }, { truncate: !((_4 = config.productTitle) === null || _4 === void 0 ? void 0 : _4.wrapText) }, { "text-wrap": (_5 = config.productTitle) === null || _5 === void 0 ? void 0 : _5.wrapText }, "text-textColors-productTitle"), style: { fontSize: (_6 = config.productTitle) === null || _6 === void 0 ? void 0 : _6.fontSize } }, { children: title })) }))), _jsxs("div", Object.assign({ className: cn("flex flex-row w-full gap-2 mt-1 justify-end", { "justify-start": ((_7 = config.price) === null || _7 === void 0 ? void 0 : _7.textAlignment) === "left" }, { "justify-end": ((_8 = config.price) === null || _8 === void 0 ? void 0 : _8.textAlignment) === "right" }, { "justify-center": ((_9 = config.price) === null || _9 === void 0 ? void 0 : _9.textAlignment) === "center" }) }, { children: [((_10 = config.price) === null || _10 === void 0 ? void 0 : _10.enabled) && (_jsx(Price, { price: parseFloat(variant.price.amount), isSale: !!variant.compareAtPrice &&
190
236
  variant.compareAtPrice &&
191
- parseFloat((_8 = variant.compareAtPrice) === null || _8 === void 0 ? void 0 : _8.amount) >
237
+ parseFloat((_11 = variant.compareAtPrice) === null || _11 === void 0 ? void 0 : _11.amount) >
192
238
  parseFloat(variant.price.amount), compareAtPrice: variant.compareAtPrice &&
193
- parseFloat((_9 = variant.compareAtPrice) === null || _9 === void 0 ? void 0 : _9.amount), currency: tapcartData.currency.code, locale: tapcartData.currency.locale, fontSize: (_10 = config.price) === null || _10 === void 0 ? void 0 : _10.fontSize })), ((_11 = config.favoritesIcon) === null || _11 === void 0 ? void 0 : _11.enabled) &&
239
+ parseFloat((_12 = variant.compareAtPrice) === null || _12 === void 0 ? void 0 : _12.amount), currency: tapcartData.currency.code, locale: tapcartData.currency.locale, fontSize: (_13 = config.price) === null || _13 === void 0 ? void 0 : _13.fontSize })), ((_14 = config.favoritesIcon) === null || _14 === void 0 ? void 0 : _14.enabled) &&
194
240
  config.favoritesIcon.layoutType === "below-image-on-right" && (_jsx("div", Object.assign({ className: "w-8 h-8 flex items-center justify-center" }, { children: _jsx(Favorite, { selected: favorited, onClick: (e) => {
195
241
  onFavoriteClick === null || onFavoriteClick === void 0 ? void 0 : onFavoriteClick(e, product);
196
- }, size: "small", icon: ((_13 = (_12 = config.favoritesIcon) === null || _12 === void 0 ? void 0 : _12.icon) === null || _13 === void 0 ? void 0 : _13.type) === "internal"
197
- ? (_15 = (_14 = config.favoritesIcon) === null || _14 === void 0 ? void 0 : _14.icon) === null || _15 === void 0 ? void 0 : _15.url
242
+ }, size: "small", icon: ((_16 = (_15 = config.favoritesIcon) === null || _15 === void 0 ? void 0 : _15.icon) === null || _16 === void 0 ? void 0 : _16.type) === "internal"
243
+ ? (_18 = (_17 = config.favoritesIcon) === null || _17 === void 0 ? void 0 : _17.icon) === null || _18 === void 0 ? void 0 : _18.url
198
244
  : undefined }) })))] }))] }))] })) })));
199
245
  };
200
246
  export { ProductCard };
@@ -2,9 +2,10 @@ type Product = any;
2
2
  interface PageData {
3
3
  products: Product[];
4
4
  cursorBlob?: string;
5
+ filtersData: any;
5
6
  }
6
7
  interface ProductGridItemsProps {
7
- initialData: PageData[];
8
+ initialData: PageData;
8
9
  loadMoreProducts: (params: any) => Promise<PageData>;
9
10
  queryVariables: Record<string, any>;
10
11
  config: Record<string, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"product-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/product-grid.tsx"],"names":[],"mappings":"AAkBA,KAAK,OAAO,GAAG,GAAG,CAAA;AAClB,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,QAAQ,EAAE,CAAA;IACvB,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5B;AAED,iBAAS,WAAW,CAAC,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,MAAM,GACP,EAAE,qBAAqB,2CAmCvB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"product-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/product-grid.tsx"],"names":[],"mappings":"AAkBA,KAAK,OAAO,GAAG,GAAG,CAAA;AAClB,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;CACjB;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,QAAQ,CAAA;IACrB,gBAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACpD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC5B;AAED,iBAAS,WAAW,CAAC,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,MAAM,GACP,EAAE,qBAAqB,2CAmCvB;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const textareaVariants: (props?: ({
4
+ error?: boolean | null | undefined;
5
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
+ export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange">, VariantProps<typeof textareaVariants> {
7
+ id: string;
8
+ label?: string;
9
+ icon?: string;
10
+ asChild?: boolean;
11
+ value: string;
12
+ placeholder: string;
13
+ maxHeight?: number;
14
+ onChange: (_: string) => void;
15
+ }
16
+ declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
17
+ export { Textarea };
18
+ //# sourceMappingURL=textarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../components/ui/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,gBAAgB;;mFAarB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC,EACzE,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,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,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9B;AAED,QAAA,MAAM,QAAQ,2FA6Eb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -0,0 +1,54 @@
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 { Slot } from "@radix-ui/react-slot";
16
+ import { cva } from "class-variance-authority";
17
+ import { cn } from "../../lib/utils";
18
+ const textareaVariants = cva("relative pl-4 pr-4 rounded border border-coreColors-dividingLines bg-coreColors-inputBackground focus-within:border-coreColors-brandColorPrimary [&_label]:focus-within:text-coreColors-brandColorPrimary", {
19
+ variants: {
20
+ error: {
21
+ true: "!border-stateColors-error [&_*]:text-stateColors-error [&_*]:placeholder:text-stateColors-error focus-within:!border-stateColors-error [&+label]:text-stateColors-error [&_label]:focus-within:!text-stateColors-error",
22
+ false: "",
23
+ },
24
+ },
25
+ defaultVariants: {
26
+ error: false,
27
+ },
28
+ });
29
+ const Textarea = React.forwardRef((_a, ref) => {
30
+ var { className, error = false, id, label, icon, asChild, value, placeholder, maxHeight, onChange } = _a, props = __rest(_a, ["className", "error", "id", "label", "icon", "asChild", "value", "placeholder", "maxHeight", "onChange"]);
31
+ const Comp = asChild ? Slot : "div";
32
+ const [content, setContent] = React.useState(value);
33
+ const textareaRef = React.useRef(null);
34
+ React.useEffect(() => {
35
+ if (textareaRef.current) {
36
+ textareaRef.current.style.height = "auto";
37
+ textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
38
+ }
39
+ }, [content]);
40
+ const handleChange = (e) => {
41
+ setContent(e);
42
+ };
43
+ const focusTextarea = () => {
44
+ if (textareaRef.current) {
45
+ textareaRef.current.focus();
46
+ }
47
+ };
48
+ return (_jsxs(Comp, Object.assign({ className: cn(textareaVariants({ error }), content ? "pt-6 pb-2" : "pt-4 pb-4", className), onClick: focusTextarea }, { children: [_jsx("textarea", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => {
49
+ onChange(e.target.value);
50
+ handleChange(e.target.value);
51
+ }, id: id, className: cn("textarea-component overflow-y-auto w-full resize-none text-[15px] font-fontRegular leading-[160%] font-normal min-h-[24px] align-top placeholder-shown:!truncate text-textColors-primaryColor ring-offset-background file:border-0 file:bg-transparent placeholder-shown:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer", { "pr-1": (textareaRef.current && maxHeight && textareaRef.current.scrollHeight >= maxHeight) }), style: { maxHeight: `${maxHeight}px` }, "data-text": "Enter text here", rows: 1, ref: textareaRef }, props)), label ? (_jsx("label", Object.assign({ htmlFor: id, style: { maxWidth: `-webkit-fill-available` }, className: "absolute truncate text-[10px] pr-4 text-textColors-secondaryColor top-2 z-10 h-4 origin-[0] start-4 opacity-100 peer-placeholder-shown:opacity-0" }, { children: label }))) : null] })));
52
+ });
53
+ Textarea.displayName = "Textarea";
54
+ export { Textarea };
package/dist/index.d.ts CHANGED
@@ -37,7 +37,9 @@ export * from "./components/ui/quantity-picker";
37
37
  export * from "./components/hooks/use-infinite-scroll";
38
38
  export * from "./components/ui/subscription";
39
39
  export * from "./components/ui/line-item-text-icons";
40
+ export * from "./components/ui/textarea";
40
41
  export * from "./components/hooks/use-scroll-direction";
41
42
  export * from "./components/ui/image";
43
+ export * from "./components/ui/empty-message";
42
44
  export { cn, cva } from "./lib/utils";
43
45
  //# 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,uBAAuB,CAAA;AACrC,cAAc,8BAA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5C,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;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sCAAsC,CAAA;AACpD,cAAc,0BAA0B,CAAA;AACxC,cAAc,yCAAyC,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA"}
package/dist/index.js CHANGED
@@ -38,6 +38,8 @@ export * from "./components/ui/quantity-picker";
38
38
  export * from "./components/hooks/use-infinite-scroll";
39
39
  export * from "./components/ui/subscription";
40
40
  export * from "./components/ui/line-item-text-icons";
41
+ export * from "./components/ui/textarea";
41
42
  export * from "./components/hooks/use-scroll-direction";
42
43
  export * from "./components/ui/image";
44
+ export * from "./components/ui/empty-message";
43
45
  export { cn, cva } from "./lib/utils";
package/dist/styles.css CHANGED
@@ -385,10 +385,10 @@ video {
385
385
  [hidden] {
386
386
  display: none;
387
387
  }
388
- *::-webkit-scrollbar {
388
+ .no-scrollbar *:not(.textarea-component)::-webkit-scrollbar {
389
389
  display: none;
390
390
  }
391
- * {
391
+ .no-scrollbar *:not(.textarea-component) {
392
392
  -ms-overflow-style: none; /* IE and Edge */
393
393
  scrollbar-width: none; /* Firefox */
394
394
  }
@@ -425,9 +425,12 @@ video {
425
425
 
426
426
  --radius: 0.5rem;
427
427
 
428
- --fontRegular: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
429
- --fontMedium: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
430
- --fontBold: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
428
+ --fontRegular: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
429
+ Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
430
+ --fontMedium: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
431
+ Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
432
+ --fontBold: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
433
+ Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
431
434
 
432
435
  --coreColors-pageColor: #ffffff;
433
436
  --coreColors-shadow: #000000;
@@ -454,12 +457,12 @@ video {
454
457
  --buttonColors-primaryText: #ffffff;
455
458
  --buttonColors-primaryFill: #000000;
456
459
  --buttonColors-primaryOutline: #000000;
457
- --buttonColors-primaryShadow: #ffffff;
460
+ --buttonColors-primaryShadow: #000000;
458
461
  --buttonColors-disabled: #707070;
459
462
  --buttonColors-secondaryText: #000000;
460
463
  --buttonColors-secondaryFill: #ffffff;
461
464
  --buttonColors-secondaryOutline: #000000;
462
- --buttonColors-secondaryShadow: #ffffff;
465
+ --buttonColors-secondaryShadow: #000000;
463
466
 
464
467
  --stateColors-disabled: #707070;
465
468
  --stateColors-error: #d91e18ff;
@@ -477,6 +480,29 @@ video {
477
480
  --productImage-aspectRatio: "2:3";
478
481
  --productImage-scaling: cover;
479
482
  --productImage-isCustom: "false";
483
+
484
+ --standard-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.10);
485
+ }
486
+ .textarea-component::-webkit-scrollbar {
487
+ width: 4px;
488
+ }
489
+ .textarea-component::-webkit-scrollbar-thumb {
490
+ border-radius: 1.5rem;
491
+ background: var(--coreColors-secondaryIcon);
492
+ }
493
+ .textarea-component::-webkit-scrollbar-track {
494
+ border-radius: 1.5rem;
495
+ background: var(--coreColors-dividingLines);
496
+ }
497
+ .textarea-component::-moz-placeholder {
498
+ white-space: nowrap;
499
+ overflow: hidden;
500
+ text-overflow: ellipsis;
501
+ }
502
+ .textarea-component::placeholder {
503
+ white-space: nowrap;
504
+ overflow: hidden;
505
+ text-overflow: ellipsis;
480
506
  }
481
507
 
482
508
  /*.dark {*/
@@ -672,6 +698,15 @@ video {
672
698
  .bottom-10 {
673
699
  bottom: 2.5rem;
674
700
  }
701
+ .bottom-2 {
702
+ bottom: 0.5rem;
703
+ }
704
+ .bottom-\[18px\] {
705
+ bottom: 18px;
706
+ }
707
+ .bottom-\[58px\] {
708
+ bottom: 58px;
709
+ }
675
710
  .end-4 {
676
711
  inset-inline-end: 1rem;
677
712
  }
@@ -732,6 +767,10 @@ video {
732
767
  .row-start-1 {
733
768
  grid-row-start: 1;
734
769
  }
770
+ .mx-1 {
771
+ margin-left: 0.25rem;
772
+ margin-right: 0.25rem;
773
+ }
735
774
  .mx-4 {
736
775
  margin-left: 1rem;
737
776
  margin-right: 1rem;
@@ -806,9 +845,6 @@ video {
806
845
  .aspect-\[2\/3\] {
807
846
  aspect-ratio: 2/3;
808
847
  }
809
- .aspect-\[4\/5\] {
810
- aspect-ratio: 4/5;
811
- }
812
848
  .aspect-productImages {
813
849
  aspect-ratio: var(--productImage-aspectRatio);
814
850
  }
@@ -824,6 +860,9 @@ video {
824
860
  .h-1 {
825
861
  height: 0.25rem;
826
862
  }
863
+ .h-1\.5 {
864
+ height: 0.375rem;
865
+ }
827
866
  .h-10 {
828
867
  height: 2.5rem;
829
868
  }
@@ -884,6 +923,15 @@ video {
884
923
  .max-h-screen {
885
924
  max-height: 100vh;
886
925
  }
926
+ .min-h-\[24px\] {
927
+ min-height: 24px;
928
+ }
929
+ .w-1 {
930
+ width: 0.25rem;
931
+ }
932
+ .w-1\.5 {
933
+ width: 0.375rem;
934
+ }
887
935
  .w-1\/2 {
888
936
  width: 50%;
889
937
  }
@@ -948,6 +996,9 @@ video {
948
996
  .max-w-lg {
949
997
  max-width: 32rem;
950
998
  }
999
+ .max-w-xs {
1000
+ max-width: 20rem;
1001
+ }
951
1002
  .flex-1 {
952
1003
  flex: 1 1 0%;
953
1004
  }
@@ -957,6 +1008,9 @@ video {
957
1008
  .shrink-0 {
958
1009
  flex-shrink: 0;
959
1010
  }
1011
+ .flex-grow {
1012
+ flex-grow: 1;
1013
+ }
960
1014
  .grow {
961
1015
  flex-grow: 1;
962
1016
  }
@@ -1021,6 +1075,9 @@ video {
1021
1075
  -moz-user-select: none;
1022
1076
  user-select: none;
1023
1077
  }
1078
+ .resize-none {
1079
+ resize: none;
1080
+ }
1024
1081
  .resize {
1025
1082
  resize: both;
1026
1083
  }
@@ -1189,6 +1246,9 @@ video {
1189
1246
  .border-t {
1190
1247
  border-top-width: 1px;
1191
1248
  }
1249
+ .\!border-stateColors-error {
1250
+ border-color: var(--stateColors-error) !important;
1251
+ }
1192
1252
  .border-black {
1193
1253
  --tw-border-opacity: 1;
1194
1254
  border-color: rgb(0 0 0 / var(--tw-border-opacity));
@@ -1290,22 +1350,14 @@ video {
1290
1350
  background-image: linear-gradient(90deg,#ffffff00 0%,#FFF 100%);
1291
1351
  }
1292
1352
  .bg-fade-left {
1293
- background-image: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
1353
+ background-image: linear-gradient(to right, var(--coreColors-pageColor) 0%, #ffffff00 100%);;
1294
1354
  }
1295
1355
  .bg-fade-right {
1296
- background-image: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
1356
+ background-image: linear-gradient(to left, var(--coreColors-pageColor) 0%, #ffffff00 100%);;
1297
1357
  }
1298
1358
  .fill-current {
1299
1359
  fill: currentColor;
1300
1360
  }
1301
- .object-contain {
1302
- -o-object-fit: contain;
1303
- object-fit: contain;
1304
- }
1305
- .object-cover {
1306
- -o-object-fit: cover;
1307
- object-fit: cover;
1308
- }
1309
1361
  .p-0 {
1310
1362
  padding: 0px;
1311
1363
  }
@@ -1384,12 +1436,24 @@ video {
1384
1436
  .pb-8 {
1385
1437
  padding-bottom: 2rem;
1386
1438
  }
1439
+ .pl-0 {
1440
+ padding-left: 0px;
1441
+ }
1442
+ .pl-2 {
1443
+ padding-left: 0.5rem;
1444
+ }
1387
1445
  .pl-4 {
1388
1446
  padding-left: 1rem;
1389
1447
  }
1390
1448
  .pl-8 {
1391
1449
  padding-left: 2rem;
1392
1450
  }
1451
+ .pr-1 {
1452
+ padding-right: 0.25rem;
1453
+ }
1454
+ .pr-2 {
1455
+ padding-right: 0.5rem;
1456
+ }
1393
1457
  .pr-4 {
1394
1458
  padding-right: 1rem;
1395
1459
  }
@@ -1405,6 +1469,9 @@ video {
1405
1469
  .pt-5 {
1406
1470
  padding-top: 1.25rem;
1407
1471
  }
1472
+ .pt-6 {
1473
+ padding-top: 1.5rem;
1474
+ }
1408
1475
  .text-left {
1409
1476
  text-align: left;
1410
1477
  }
@@ -1417,6 +1484,9 @@ video {
1417
1484
  .text-start {
1418
1485
  text-align: start;
1419
1486
  }
1487
+ .align-top {
1488
+ vertical-align: top;
1489
+ }
1420
1490
  .font-fontMedium {
1421
1491
  font-family: var(--fontMedium);
1422
1492
  }
@@ -1502,9 +1572,6 @@ video {
1502
1572
  .text-buttonColors-primaryShadow {
1503
1573
  color: var(--buttonColors-primaryShadow);
1504
1574
  }
1505
- .text-buttonColors-primaryShadowEnabled {
1506
- color: var(--buttonColors-primaryShadowEnabled);
1507
- }
1508
1575
  .text-buttonColors-primaryText {
1509
1576
  color: var(--buttonColors-primaryText);
1510
1577
  }
@@ -1523,9 +1590,6 @@ video {
1523
1590
  .text-buttonColors-secondaryShadow {
1524
1591
  color: var(--buttonColors-secondaryShadow);
1525
1592
  }
1526
- .text-buttonColors-secondaryShadowEnabled {
1527
- color: var(--buttonColors-secondaryShadowEnabled);
1528
- }
1529
1593
  .text-buttonColors-secondaryText {
1530
1594
  color: var(--buttonColors-secondaryText);
1531
1595
  }
@@ -1637,6 +1701,9 @@ video {
1637
1701
  .opacity-100 {
1638
1702
  opacity: 1;
1639
1703
  }
1704
+ .opacity-50 {
1705
+ opacity: 0.5;
1706
+ }
1640
1707
  .shadow-\[0_0_6px_0_rgba\(17\2c 17\2c 17\2c 0\.16\)\] {
1641
1708
  --tw-shadow: 0 0 6px 0 rgba(17,17,17,0.16);
1642
1709
  --tw-shadow-colored: 0 0 6px 0 var(--tw-shadow-color);
@@ -1647,12 +1714,26 @@ video {
1647
1714
  --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
1648
1715
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1649
1716
  }
1717
+ .shadow-primary {
1718
+ --tw-shadow: calc(var(--buttonColors-primaryShadowEnabled) * 0px) calc(var(--buttonColors-primaryShadowEnabled) * 5px) calc(var(--buttonColors-primaryShadowEnabled) * 25px) calc(var(--buttonColors-primaryShadowEnabled)* 0px) rgb(0, 0, 0, 0.10);;
1719
+ --tw-shadow-colored: calc(var(--buttonColors-primaryShadowEnabled) * 0px) calc(var(--buttonColors-primaryShadowEnabled) * 5px) calc(var(--buttonColors-primaryShadowEnabled) * 25px) calc(var(--buttonColors-primaryShadowEnabled)* 0px) rgb(0, 0, 0, 0.10);;
1720
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1721
+ }
1722
+ .shadow-secondary {
1723
+ --tw-shadow: calc(var(--buttonColors-secondaryShadowEnabled) * 0px) calc(var(--buttonColors-secondaryShadowEnabled) * 5px) calc(var(--buttonColors-secondaryShadowEnabled) * 25px) calc(var(--buttonColors-secondaryShadowEnabled)* 0px) rgb(0, 0, 0, 0.10);;
1724
+ --tw-shadow-colored: calc(var(--buttonColors-secondaryShadowEnabled) * 0px) calc(var(--buttonColors-secondaryShadowEnabled) * 5px) calc(var(--buttonColors-secondaryShadowEnabled) * 25px) calc(var(--buttonColors-secondaryShadowEnabled)* 0px) rgb(0, 0, 0, 0.10);;
1725
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1726
+ }
1650
1727
  .shadow-buttonColors-primaryShadow {
1651
1728
  --tw-shadow-color: var(--buttonColors-primaryShadow);
1652
1729
  --tw-shadow: var(--tw-shadow-colored);
1653
1730
  }
1654
- .shadow-buttonColors-secondaryShadow {
1655
- --tw-shadow-color: var(--buttonColors-secondaryShadow);
1731
+ .shadow-primary {
1732
+ --tw-shadow-color: hsl(var(--primary));
1733
+ --tw-shadow: var(--tw-shadow-colored);
1734
+ }
1735
+ .shadow-secondary {
1736
+ --tw-shadow-color: hsl(var(--secondary));
1656
1737
  --tw-shadow: var(--tw-shadow-colored);
1657
1738
  }
1658
1739
  .outline-none {
@@ -1753,15 +1834,6 @@ video {
1753
1834
  .ease-in-out {
1754
1835
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1755
1836
  }
1756
- /* Hide scrollbar for Chrome, Safari and Opera */
1757
- .no-scrollbar *::-webkit-scrollbar {
1758
- display: none;
1759
- }
1760
- /* Hide scrollbar for IE, Edge and Firefox */
1761
- .no-scrollbar * {
1762
- -ms-overflow-style: none; /* IE and Edge */
1763
- scrollbar-width: none; /* Firefox */
1764
- }
1765
1837
  .container {
1766
1838
  padding-right: 16px;
1767
1839
  padding-left: 16px;
@@ -1794,12 +1866,34 @@ video {
1794
1866
  .placeholder\:text-textColors-secondaryColor::placeholder {
1795
1867
  color: var(--textColors-secondaryColor, #727272ff);
1796
1868
  }
1869
+ .placeholder-shown\:\!truncate:-moz-placeholder-shown {
1870
+ overflow: hidden !important;
1871
+ text-overflow: ellipsis !important;
1872
+ white-space: nowrap !important;
1873
+ }
1874
+ .placeholder-shown\:\!truncate:placeholder-shown {
1875
+ overflow: hidden !important;
1876
+ text-overflow: ellipsis !important;
1877
+ white-space: nowrap !important;
1878
+ }
1797
1879
  .placeholder-shown\:p-4:-moz-placeholder-shown {
1798
1880
  padding: 1rem;
1799
1881
  }
1800
1882
  .placeholder-shown\:p-4:placeholder-shown {
1801
1883
  padding: 1rem;
1802
1884
  }
1885
+ .placeholder-shown\:text-textColors-secondaryColor:-moz-placeholder-shown {
1886
+ color: var(--textColors-secondaryColor, #727272ff);
1887
+ }
1888
+ .placeholder-shown\:text-textColors-secondaryColor:placeholder-shown {
1889
+ color: var(--textColors-secondaryColor, #727272ff);
1890
+ }
1891
+ .focus-within\:\!border-stateColors-error:focus-within {
1892
+ border-color: var(--stateColors-error) !important;
1893
+ }
1894
+ .focus-within\:border-coreColors-brandColorPrimary:focus-within {
1895
+ border-color: var(--coreColors-brandColorPrimary);
1896
+ }
1803
1897
  .hover\:h-\[18px\]:hover {
1804
1898
  height: 18px;
1805
1899
  }
@@ -2194,9 +2288,24 @@ video {
2194
2288
  .\[\&_\*\]\:text-coreColors-pageColor * {
2195
2289
  color: var(--coreColors-pageColor);
2196
2290
  }
2291
+ .\[\&_\*\]\:text-stateColors-error * {
2292
+ color: var(--stateColors-error);
2293
+ }
2197
2294
  .\[\&_\*\]\:text-textColors-primaryColor * {
2198
2295
  color: var(--textColors-primaryColor, #121212ff);
2199
2296
  }
2297
+ .\[\&_\*\]\:placeholder\:text-stateColors-error *::-moz-placeholder {
2298
+ color: var(--stateColors-error);
2299
+ }
2300
+ .\[\&_\*\]\:placeholder\:text-stateColors-error *::placeholder {
2301
+ color: var(--stateColors-error);
2302
+ }
2303
+ .\[\&_label\]\:focus-within\:\!text-stateColors-error:focus-within label {
2304
+ color: var(--stateColors-error) !important;
2305
+ }
2306
+ .\[\&_label\]\:focus-within\:text-coreColors-brandColorPrimary:focus-within label {
2307
+ color: var(--coreColors-brandColorPrimary);
2308
+ }
2200
2309
  .\[\&_p\]\:text-stateColors-disabled p {
2201
2310
  color: var(--stateColors-disabled);
2202
2311
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapcart/mobile-components",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "style": "dist/styles.css",
@@ -29,9 +29,9 @@
29
29
  "@types/lodash": "4.17.5",
30
30
  "@types/react": "^18.2.0",
31
31
  "@types/react-dom": "^18.2.0",
32
+ "app-studio-types": "workspace:*",
32
33
  "autoprefixer": "^10.4.14",
33
34
  "chokidar-cli": "^3.0.0",
34
- "app-studio-types": "workspace:*",
35
35
  "concurrently": "^8.2.2",
36
36
  "eslint": "^7.32.0",
37
37
  "eslint-config-custom": "workspace:*",
@@ -63,6 +63,7 @@
63
63
  "clsx": "^1.2.1",
64
64
  "embla-carousel-react": "^8.0.2",
65
65
  "lucide-react": "^0.248.0",
66
+ "next": "^14.2.5",
66
67
  "next-themes": "^0.2.1",
67
68
  "postcss-cli": "^11.0.0",
68
69
  "react-intersection-observer": "^9.10.2",