@tapcart/mobile-components 0.2.12 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/hooks/use-infinite-scroll.d.ts +1 -0
- package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
- package/dist/components/hooks/use-infinite-scroll.js +3 -2
- package/dist/components/hooks/use-scroll-direction.d.ts +1 -1
- package/dist/components/hooks/use-scroll-direction.d.ts.map +1 -1
- package/dist/components/hooks/use-scroll-direction.js +17 -5
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +49 -14
- package/dist/components/ui/carousel.d.ts +5 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +29 -2
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/chip.d.ts +6 -4
- package/dist/components/ui/chip.d.ts.map +1 -1
- package/dist/components/ui/chip.js +10 -4
- package/dist/components/ui/drawer.js +3 -3
- package/dist/components/ui/icon.d.ts.map +1 -1
- package/dist/components/ui/icon.js +5 -1
- package/dist/components/ui/image.d.ts +157 -0
- package/dist/components/ui/image.d.ts.map +1 -0
- package/dist/components/ui/image.js +311 -0
- package/dist/components/ui/line-item-text-icons.d.ts +14 -0
- package/dist/components/ui/line-item-text-icons.d.ts.map +1 -0
- package/dist/components/ui/line-item-text-icons.js +22 -0
- package/dist/components/ui/product-card.d.ts +6 -19
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +135 -36
- package/dist/components/ui/quantity-picker.d.ts +14 -0
- package/dist/components/ui/quantity-picker.d.ts.map +1 -0
- package/dist/components/ui/quantity-picker.js +23 -0
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/selectors.d.ts +1 -1
- package/dist/components/ui/selectors.d.ts.map +1 -1
- package/dist/components/ui/selectors.js +20 -4
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/slider.d.ts +14 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +50 -0
- package/dist/components/ui/subscription.d.ts +15 -0
- package/dist/components/ui/subscription.d.ts.map +1 -0
- package/dist/components/ui/subscription.js +24 -0
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/textarea.d.ts +18 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +54 -0
- package/dist/components/ui/toggle.js +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/styles.css +248 -122
- package/package.json +20 -14
- package/dist/components/ThemeProvider.d.ts +0 -3
- package/dist/components/ThemeProvider.d.ts.map +0 -1
- package/dist/components/ThemeProvider.js +0 -18
- package/dist/components/ThemeToggle.d.ts +0 -2
- package/dist/components/ThemeToggle.d.ts.map +0 -1
- package/dist/components/ThemeToggle.js +0 -8
|
@@ -20,6 +20,7 @@ interface UseInfiniteScrollReturn {
|
|
|
20
20
|
ref: (node?: Element | null | undefined) => void;
|
|
21
21
|
products: Product[];
|
|
22
22
|
isLoading: boolean;
|
|
23
|
+
isValidating: boolean;
|
|
23
24
|
}
|
|
24
25
|
declare const useInfiniteScroll: ({ initialData, loadMoreProducts, queryVariables, }: UseInfiniteScrollProps) => UseInfiniteScrollReturn;
|
|
25
26
|
export { useInfiniteScroll };
|
|
@@ -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,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;
|
|
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,oBAAoB,EAAE,OAAO,CAAA;IAC7B,aAAa,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAChD,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,QAAA,MAAM,iBAAiB,uDAIpB,sBAAsB,KAAG,uBAkE3B,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { useInView } from "react-intersection-observer";
|
|
|
5
5
|
const PAGE_SIZE = 8;
|
|
6
6
|
const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables, }) => {
|
|
7
7
|
var _a, _b, _c, _d;
|
|
8
|
-
const { ref, inView } = useInView({ rootMargin: "
|
|
8
|
+
const { ref, inView } = useInView({ rootMargin: "600px" }); // controls how early the next page loads
|
|
9
9
|
const getKey = (pageIndex, previousPageData) => {
|
|
10
10
|
var _a;
|
|
11
11
|
if (pageIndex === 0)
|
|
@@ -14,7 +14,7 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables, }) =
|
|
|
14
14
|
return null;
|
|
15
15
|
return Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob });
|
|
16
16
|
};
|
|
17
|
-
const { data, error, size, setSize, isLoading } = useSWRInfinite(getKey, loadMoreProducts, {
|
|
17
|
+
const { data, error, size, setSize, isLoading, isValidating, } = useSWRInfinite(getKey, loadMoreProducts, {
|
|
18
18
|
// @ts-expect-error
|
|
19
19
|
fallbackData: [initialData],
|
|
20
20
|
revalidateFirstPage: false,
|
|
@@ -48,6 +48,7 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables, }) =
|
|
|
48
48
|
ref,
|
|
49
49
|
products: data ? data.flatMap((page) => page === null || page === void 0 ? void 0 : page.products) : [],
|
|
50
50
|
isLoading,
|
|
51
|
+
isValidating,
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
54
|
export { useInfiniteScroll };
|
|
@@ -3,6 +3,6 @@ interface ScrollData {
|
|
|
3
3
|
direction: ScrollDirection;
|
|
4
4
|
scrollY: number;
|
|
5
5
|
}
|
|
6
|
-
declare function useScrollDirection(threshold?: number): ScrollData;
|
|
6
|
+
declare function useScrollDirection(threshold?: number, throttleDelay?: 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":"
|
|
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,10 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { useState, useEffect, useRef } from "react";
|
|
2
|
-
function useScrollDirection(threshold = 5) {
|
|
3
|
+
function useScrollDirection(threshold = 5, throttleDelay = 50) {
|
|
3
4
|
const [scrollData, setScrollData] = useState({
|
|
4
5
|
direction: null,
|
|
5
6
|
scrollY: 0,
|
|
6
7
|
});
|
|
7
8
|
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
|
+
};
|
|
8
19
|
useEffect(() => {
|
|
9
20
|
if (typeof window === "undefined") {
|
|
10
21
|
return;
|
|
@@ -14,17 +25,18 @@ function useScrollDirection(threshold = 5) {
|
|
|
14
25
|
return;
|
|
15
26
|
}
|
|
16
27
|
const scrollY = window.scrollY;
|
|
17
|
-
const direction = scrollY > lastScrollY.current ? "down" : "up";
|
|
28
|
+
const direction = scrollY > lastScrollY.current && scrollY !== 0 ? "down" : "up";
|
|
18
29
|
if (Math.abs(scrollY - lastScrollY.current) > threshold) {
|
|
19
30
|
setScrollData({ direction, scrollY });
|
|
20
31
|
lastScrollY.current = scrollY > 0 ? scrollY : 0;
|
|
21
32
|
}
|
|
22
33
|
};
|
|
23
|
-
|
|
34
|
+
const throttledUpdateScrollDirection = throttle(updateScrollDirection, throttleDelay);
|
|
35
|
+
window.addEventListener("scroll", throttledUpdateScrollDirection);
|
|
24
36
|
return () => {
|
|
25
|
-
window.removeEventListener("scroll",
|
|
37
|
+
window.removeEventListener("scroll", throttledUpdateScrollDirection);
|
|
26
38
|
};
|
|
27
|
-
}, [threshold]);
|
|
39
|
+
}, [threshold, throttleDelay]);
|
|
28
40
|
return scrollData;
|
|
29
41
|
}
|
|
30
42
|
export { useScrollDirection };
|
|
@@ -23,7 +23,7 @@ const AccordionItem = React.forwardRef((_a, ref) => {
|
|
|
23
23
|
AccordionItem.displayName = "AccordionItem";
|
|
24
24
|
const AccordionTrigger = React.forwardRef((_a, ref) => {
|
|
25
25
|
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
26
|
-
return (_jsx(AccordionPrimitive.Header, Object.assign({ className: "flex" }, { children: _jsxs(AccordionPrimitive.Trigger, Object.assign({ ref: ref, className: cn("px-4 flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline
|
|
26
|
+
return (_jsx(AccordionPrimitive.Header, Object.assign({ className: "flex" }, { children: _jsxs(AccordionPrimitive.Trigger, Object.assign({ ref: ref, className: cn("px-4 flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]_svg]:rotate-180 active:opacity-70", className) }, props, { children: [children, _jsx(Icon, { name: "chevron-down", size: "sm", className: "text-coreColors-secondaryIcon shrink-0 transition-transform duration-200 " })] })) })));
|
|
27
27
|
});
|
|
28
28
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
29
29
|
const AccordionContent = React.forwardRef((_a, ref) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
alignment?: "
|
|
4
|
+
alignment?: "end" | "center" | "start" | null | undefined;
|
|
5
5
|
cornerRadius?: "circle" | "square" | "rounded" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
@@ -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;
|
|
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;CAC7C;AAED,QAAA,MAAM,MAAM,uFAoEX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -13,11 +13,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Slot } from "@radix-ui/react-slot";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
|
-
import { IconLoader2 } from "@tabler/icons-react";
|
|
17
16
|
import { cn } from "../../lib/utils";
|
|
18
17
|
import { Icon } from "./icon";
|
|
19
18
|
import { Text } from "./text";
|
|
20
|
-
const buttonVariants = cva("w-full flex rounded items-center justify-center transition-colors disabled:bg-stateColors-disabled disabled:
|
|
19
|
+
const buttonVariants = cva("w-full flex rounded items-center justify-center transition-colors disabled:bg-stateColors-disabled disabled:border-stateColors-disabled disabled:pointer-events-none ring-offset-background overflow-elipse whitespace-nowrap truncate active:opacity-70 disabled:opacity-70", {
|
|
21
20
|
variants: {
|
|
22
21
|
size: {
|
|
23
22
|
default: "py-3 px-4",
|
|
@@ -27,14 +26,14 @@ const buttonVariants = cva("w-full flex rounded items-center justify-center tran
|
|
|
27
26
|
content: "py-3 px-4 w-auto",
|
|
28
27
|
},
|
|
29
28
|
variant: {
|
|
30
|
-
default: "bg-buttonColors-primaryFill
|
|
31
|
-
destructive: "bg-stateColors-error
|
|
32
|
-
outline: "
|
|
33
|
-
secondary: "bg-buttonColors-secondaryFill
|
|
34
|
-
ghost: "hover:bg-accent
|
|
35
|
-
link: "underline-offset-4 hover:underline
|
|
36
|
-
quickadd: "bg-buttonColors-primaryFill
|
|
37
|
-
applePay: "bg-white
|
|
29
|
+
default: "bg-buttonColors-primaryFill border border-buttonColors-primaryOutlineColor shadow-primary",
|
|
30
|
+
destructive: "bg-stateColors-error disabled:bg-stateColors-disabled shadow-buttonColors-primaryShadow",
|
|
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 shadow-secondary",
|
|
33
|
+
ghost: "hover:bg-accent",
|
|
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",
|
|
36
|
+
applePay: "bg-white border border-black",
|
|
38
37
|
shopPay: "bg-[#612EFF]",
|
|
39
38
|
},
|
|
40
39
|
},
|
|
@@ -43,14 +42,50 @@ const buttonVariants = cva("w-full flex rounded items-center justify-center tran
|
|
|
43
42
|
size: "default",
|
|
44
43
|
},
|
|
45
44
|
});
|
|
45
|
+
const iconVariants = cva("", {
|
|
46
|
+
variants: {
|
|
47
|
+
variant: {
|
|
48
|
+
default: "text-buttonColors-primaryText",
|
|
49
|
+
destructive: "text-coreColors-pageColor",
|
|
50
|
+
outline: "hover:text-accent-foreground",
|
|
51
|
+
secondary: "text-buttonColors-secondaryText",
|
|
52
|
+
ghost: "hover:text-accent-foreground",
|
|
53
|
+
link: "text-textColors-primaryColor",
|
|
54
|
+
quickadd: "text-buttonColors-primaryText",
|
|
55
|
+
applePay: "text-black",
|
|
56
|
+
shopPay: "",
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
variant: "default",
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
const labelVariants = cva("truncate", {
|
|
64
|
+
variants: {
|
|
65
|
+
variant: {
|
|
66
|
+
default: "text-buttonColors-primaryText",
|
|
67
|
+
destructive: "text-coreColors-pageColor",
|
|
68
|
+
outline: "hover:text-accent-foreground",
|
|
69
|
+
secondary: "text-buttonColors-secondaryText",
|
|
70
|
+
ghost: "hover:text-accent-foreground",
|
|
71
|
+
link: "text-textColors-primaryColor",
|
|
72
|
+
quickadd: "text-buttonColors-primaryText",
|
|
73
|
+
applePay: "text-black border",
|
|
74
|
+
shopPay: "",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
variant: "default",
|
|
79
|
+
},
|
|
80
|
+
});
|
|
46
81
|
const Button = React.forwardRef((_a, ref) => {
|
|
47
82
|
var { className, labelClassName, labelStyle, variant, size, asChild = false, loading, icon } = _a, props = __rest(_a, ["className", "labelClassName", "labelStyle", "variant", "size", "asChild", "loading", "icon"]);
|
|
48
83
|
const Comp = asChild ? Slot : "button";
|
|
49
|
-
const IconButton = () =>
|
|
50
|
-
const BasicButton = () => (_jsxs(_Fragment, { children: [icon ? (_jsx(Icon, { name: icon, size: variant === "quickadd" ? "xs" : "sm", className: "mr-2" })) : null, !loading ? _jsx(Text, Object.assign({ type: "body-primary", className: cn(
|
|
51
|
-
return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size
|
|
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") })) : null, !loading ? (_jsx(Text, Object.assign({ type: "body-primary", className: cn(labelVariants({ variant }), labelClassName), style: labelStyle }, { children: props.children }))) : (_jsx(_Fragment, {}))] }));
|
|
86
|
+
return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size }), className, {
|
|
52
87
|
"pointer-events-none": loading,
|
|
53
|
-
}), ref: ref }, props, { children: loading ? (_jsx(
|
|
88
|
+
}), 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" }) }))) : size === "icon" ? (_jsx(IconButton, {})) : (_jsx(BasicButton, {})) })));
|
|
54
89
|
});
|
|
55
90
|
Button.displayName = "Button";
|
|
56
91
|
export { Button, buttonVariants };
|
|
@@ -15,5 +15,9 @@ declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttribu
|
|
|
15
15
|
declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
17
|
declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../../components/ui/button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
-
|
|
18
|
+
type CarouselDotsProps = {
|
|
19
|
+
maxDots?: number;
|
|
20
|
+
};
|
|
21
|
+
declare const CarouselDots: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselDotsProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots, };
|
|
19
23
|
//# 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;AAGF,QAAA,MAAM,YAAY,6GAmBhB,CAAA;AAGF,QAAA,MAAM,gBAAgB,kLA0BpB,CAAA;AAGF,QAAA,MAAM,YAAY,kLA0BhB,CAAA;
|
|
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;AAGF,QAAA,MAAM,YAAY,6GAmBhB,CAAA;AAGF,QAAA,MAAM,gBAAgB,kLA0BpB,CAAA;AAGF,QAAA,MAAM,YAAY,kLA0BhB,CAAA;AAIF,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;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";
|
|
@@ -109,4 +109,31 @@ const CarouselNext = React.forwardRef((_a, ref) => {
|
|
|
109
109
|
: "-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
110
|
});
|
|
111
111
|
CarouselNext.displayName = "CarouselNext";
|
|
112
|
-
|
|
112
|
+
const CarouselDots = React.forwardRef((_a, ref) => {
|
|
113
|
+
var { maxDots = 5 } = _a, props = __rest(_a, ["maxDots"]);
|
|
114
|
+
const { api } = useCarousel();
|
|
115
|
+
const [_, setUpdateState] = React.useState(false);
|
|
116
|
+
const toggleUpdateState = React.useCallback(() => setUpdateState((prevState) => !prevState), []);
|
|
117
|
+
React.useEffect(() => {
|
|
118
|
+
if (api) {
|
|
119
|
+
api.on('select', toggleUpdateState);
|
|
120
|
+
api.on('reInit', toggleUpdateState);
|
|
121
|
+
return () => {
|
|
122
|
+
api.off('select', toggleUpdateState);
|
|
123
|
+
api.off('reInit', toggleUpdateState);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}, [api, toggleUpdateState]);
|
|
127
|
+
const numberOfSlides = Math.min((api === null || api === void 0 ? void 0 : api.scrollSnapList().length) || 0, maxDots);
|
|
128
|
+
const currentSlide = Math.min((api === null || api === void 0 ? void 0 : api.selectedScrollSnap()) || 0, maxDots - 1);
|
|
129
|
+
if (numberOfSlides > 1) {
|
|
130
|
+
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
|
|
131
|
+
? 'bg-coreColors-brandColorPrimary'
|
|
132
|
+
: 'bg-coreColors-brandColorPrimary opacity-50'}`, "aria-label": `Go to slide ${i + 1}`, onClick: () => api === null || api === void 0 ? void 0 : api.scrollTo(i) }, i))) })));
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return _jsx(_Fragment, {});
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
CarouselDots.displayName = 'CarouselDots';
|
|
139
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselDots, };
|
|
@@ -23,7 +23,7 @@ const checkboxVariants = cva("flex flex-col group group-disabled", {
|
|
|
23
23
|
variants: {
|
|
24
24
|
deactivated: {
|
|
25
25
|
true: "[&_p]:text-stateColors-disabled",
|
|
26
|
-
false: "",
|
|
26
|
+
false: "active:opacity-70",
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: {
|
|
@@ -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 && (_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<"
|
|
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.
|
|
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<
|
|
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
|
|
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
|
|
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
|
|
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("
|
|
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-
|
|
68
|
+
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", {
|
|
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 -
|
|
35
|
-
: { maxHeight: "calc(100vh -
|
|
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";
|
|
@@ -57,7 +57,7 @@ const DrawerDescription = React.forwardRef((_a, ref) => {
|
|
|
57
57
|
});
|
|
58
58
|
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
|
|
59
59
|
const DrawerHeader = ({ title, iconLeftName, iconRightName, onCloseClick, }) => {
|
|
60
|
-
return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" })), _jsx(DrawerTitle, { children: title }), iconRightName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconRightName, className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" }))] })));
|
|
60
|
+
return (_jsxs(DrawerHeaderBase, Object.assign({ className: "p-4 text-center flex justify-between" }, { children: [iconLeftName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconLeftName, color: "coreColors-secondaryIcon", className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" })), _jsx(DrawerTitle, { children: title }), iconRightName ? (_jsx(DrawerClose, Object.assign({ className: "h-6 w-6 p-0", onClick: onCloseClick }, { children: _jsx(Icon, { name: iconRightName, color: "coreColors-secondaryIcon", className: "h-6 w-6 p-0", size: "md" }) }))) : (_jsx("div", { className: "w-6" }))] })));
|
|
61
61
|
};
|
|
62
62
|
const DrawerContent = ({ children }) => {
|
|
63
63
|
return _jsx("div", Object.assign({ className: "h-full overflow-scroll" }, { children: children }));
|
|
@@ -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,
|
|
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,EA6BhB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAiDD,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"}
|
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { cva } from "class-variance-authority";
|
|
14
|
-
import { IconUpload, IconPencilMinus, IconPlus, IconMinus, IconAdjustmentsAlt, IconArrowsSort, IconAlertCircle, IconCircleX, IconInfoCircle, IconCheck, IconSquareOff, IconMapPin, IconRepeat, IconSquare, IconSquareCheck, IconChevronUp, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, } from "@tabler/icons-react";
|
|
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, } from "@tabler/icons-react";
|
|
15
15
|
import { cn, iconColorVariantClasses } from "../../lib/utils";
|
|
16
16
|
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
17
|
variants: {
|
|
@@ -54,11 +54,13 @@ const icons = {
|
|
|
54
54
|
square: IconSquare,
|
|
55
55
|
"square-check": IconSquareCheck,
|
|
56
56
|
"chevron-up": IconChevronUp,
|
|
57
|
+
"chevron-right": IconChevronRight,
|
|
57
58
|
"eye-off": IconEyeOff,
|
|
58
59
|
"square-x": IconSquareX,
|
|
59
60
|
circle: IconCircle,
|
|
60
61
|
"chevron-down": IconChevronDown,
|
|
61
62
|
"heart-filled": IconHeartFilled,
|
|
63
|
+
"menu-icon-heart": IconHeartFilled,
|
|
62
64
|
upload: IconUpload,
|
|
63
65
|
"currency-dollar": IconCurrencyDollar,
|
|
64
66
|
x: IconX,
|
|
@@ -66,6 +68,8 @@ const icons = {
|
|
|
66
68
|
"circle-dot-filled": IconCircleDotFilled,
|
|
67
69
|
"mood-sad": IconMoodSad,
|
|
68
70
|
"square-x-filled": IconSquareXFilled,
|
|
71
|
+
trash: IconTrash,
|
|
72
|
+
loader: IconLoader2,
|
|
69
73
|
};
|
|
70
74
|
function Icon(_a) {
|
|
71
75
|
var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
|