@tapcart/mobile-components 0.2.4 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +34 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +62 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +34 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +56 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +112 -0
- package/dist/components/ui/checkbox.d.ts +18 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +38 -0
- package/dist/components/ui/chip.d.ts +28 -0
- package/dist/components/ui/chip.d.ts.map +1 -0
- package/dist/components/ui/chip.js +66 -0
- package/dist/components/ui/container.d.ts +10 -0
- package/dist/components/ui/container.d.ts.map +1 -0
- package/dist/components/ui/container.js +26 -0
- package/dist/components/ui/drawer.d.ts +37 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +63 -0
- package/dist/components/ui/favorite.d.ts +13 -0
- package/dist/components/ui/favorite.d.ts.map +1 -0
- package/dist/components/ui/favorite.js +35 -0
- package/dist/components/ui/grid.d.ts +14 -0
- package/dist/components/ui/grid.d.ts.map +1 -0
- package/dist/components/ui/grid.js +33 -0
- package/dist/components/ui/icon.d.ts +13 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/components/ui/icon.js +50 -0
- package/dist/components/ui/input.d.ts +17 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +35 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +24 -0
- package/dist/components/ui/money.d.ts +12 -0
- package/dist/components/ui/money.d.ts.map +1 -0
- package/dist/components/ui/money.js +30 -0
- package/dist/components/ui/price.d.ts +13 -0
- package/dist/components/ui/price.d.ts.map +1 -0
- package/dist/components/ui/price.js +9 -0
- package/dist/components/ui/product-card.d.ts +33 -0
- package/dist/components/ui/product-card.d.ts.map +1 -0
- package/dist/components/ui/product-card.js +40 -0
- package/dist/components/ui/radio-group.d.ts +21 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +47 -0
- package/dist/components/ui/scroll-area.d.ts +9 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +29 -0
- package/dist/components/ui/selectors.d.ts +30 -0
- package/dist/components/ui/selectors.d.ts.map +1 -0
- package/dist/components/ui/selectors.js +45 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +22 -0
- package/dist/components/ui/skeleton.d.ts +13 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +33 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +22 -0
- package/dist/components/ui/tabs.d.ts +13 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +96 -0
- package/dist/components/ui/text.d.ts +10 -0
- package/dist/components/ui/text.d.ts.map +1 -0
- package/dist/components/ui/text.js +33 -0
- package/dist/components/ui/toast.d.ts +20 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +98 -0
- package/dist/components/ui/toaster.d.ts +6 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +22 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +36 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +40 -0
- package/dist/components/ui/use-toast.d.ts +45 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +112 -0
- package/dist/components/ui/video.d.ts +8 -0
- package/dist/components/ui/video.d.ts.map +1 -0
- package/dist/components/ui/video.js +22 -0
- package/dist/components/ui/wishlist.d.ts +12 -0
- package/dist/components/ui/wishlist.d.ts.map +1 -0
- package/dist/components/ui/wishlist.js +23 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +25 -0
- package/dist/styles.css +401 -145
- package/package.json +15 -8
- package/dist/index.d.mts +0 -221
- package/dist/index.mjs +0 -999
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
16
|
+
import { cva } from "class-variance-authority";
|
|
17
|
+
import { cn } from "../../lib/utils";
|
|
18
|
+
import { Icon } from "./icon";
|
|
19
|
+
import { Text } from "./text";
|
|
20
|
+
const RadioGroup = React.forwardRef((_a, ref) => {
|
|
21
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
22
|
+
return (_jsx(RadioGroupPrimitive.Root, Object.assign({ className: cn("grid gap-2", className) }, props, { ref: ref }), void 0));
|
|
23
|
+
});
|
|
24
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
25
|
+
const radiogroupItemVariants = cva("grid grid-cols-[auto,auto,1fr] gap-2 items-start group", {
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
default: "",
|
|
29
|
+
selected: "[&>div>button]:border-coreColors-brandColorPrimary",
|
|
30
|
+
deactivated: "[&_p]:text-stateColors-disabled",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const RadioGroupItemLabels = ({ key, label, numberAmount, subtext }) => (_jsxs("div", Object.assign({ className: "col-span-2" }, { children: [_jsxs("div", Object.assign({ className: "flex flex-row items-start mb-2" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled mr-2" }, { children: label }), void 0), numberAmount ?
|
|
38
|
+
_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled" }, { children: `(${numberAmount})` }), void 0)
|
|
39
|
+
: null] }), void 0), subtext ?
|
|
40
|
+
_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled" }, { children: subtext }), void 0)
|
|
41
|
+
: null] }), void 0));
|
|
42
|
+
const RadioGroupItem = React.forwardRef((_a, ref) => {
|
|
43
|
+
var { value, label = "", subtext, numberAmount = 0, onSelect, onClick, selected = false, className, variant = "default", key } = _a, props = __rest(_a, ["value", "label", "subtext", "numberAmount", "onSelect", "onClick", "selected", "className", "variant", "key"]);
|
|
44
|
+
return (_jsx("div", Object.assign({ className: cn(radiogroupItemVariants({ variant }), className) }, { children: variant === "deactivated" ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "circle-off", size: "md", className: "text-stateColors-disabled" }, void 0), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }, void 0)) : (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, value: value, onSelect: onSelect, checked: selected, onClick: onClick, className: cn("flex items-center justify-center", className) }, props, { children: selected || variant === "selected" ? (_jsxs("div", Object.assign({ className: "grid grid-cols-[auto,auto,1fr] gap-2 items-start group" }, { children: [_jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }, void 0), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }), void 0)) : (_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(RadioGroupPrimitive.Indicator, Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle-dot-filled", size: "md", className: "text-coreColors-brandColorPrimary z-10" }, void 0) }), void 0), _jsx("div", Object.assign({ className: "flex items-center justify-center col-start-1 row-start-1" }, { children: _jsx(Icon, { name: "circle", size: "md", className: "col-start-1 row-start-1 text-coreColors-secondaryIcon items-center z-1" }, void 0) }), void 0)] }), void 0), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }), void 0)) }), void 0)) }), void 0));
|
|
45
|
+
});
|
|
46
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
47
|
+
export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
declare type Orientation = "horizontal" | "vertical";
|
|
4
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
6
|
+
orientation?: Orientation | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { ScrollArea, ScrollBar };
|
|
9
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../../components/ui/scroll-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAA;AAIlE,aAAK,WAAW,GAAG,YAAY,GAAG,UAAU,CAAA;AAE5C,QAAA,MAAM,UAAU,+JAed,CAAA;AAGF,QAAA,MAAM,SAAS;;wCAuBb,CAAA;AAGF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
const ScrollArea = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className, children } = _a, props = __rest(_a, ["className", "children"]);
|
|
19
|
+
return (_jsxs(ScrollAreaPrimitive.Root, Object.assign({ ref: ref, className: cn("relative overflow-hidden", className) }, props, { children: [_jsx(ScrollAreaPrimitive.Viewport, Object.assign({ className: "h-full w-full rounded-[inherit]" }, { children: _jsx("div", Object.assign({ className: "flex w-max px-[16px]" }, { children: children }), void 0) }), void 0), _jsx(ScrollBar, {}, void 0), _jsx(ScrollAreaPrimitive.Corner, {}, void 0)] }), void 0));
|
|
20
|
+
});
|
|
21
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
22
|
+
const ScrollBar = React.forwardRef((_a, ref) => {
|
|
23
|
+
var { className, orientation = "horizontal" } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
24
|
+
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, Object.assign({ ref: ref, orientation: orientation, className: cn("flex touch-none select-none transition-colors", orientation === "vertical" &&
|
|
25
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" &&
|
|
26
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px] ", className) }, props, { children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" }, void 0) }), void 0));
|
|
27
|
+
});
|
|
28
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
29
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const selectorsVariants: (props?: ({
|
|
4
|
+
selected?: boolean | null | undefined;
|
|
5
|
+
disabled?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare type SelectorsProps = React.ComponentPropsWithoutRef<"button"> & VariantProps<typeof selectorsVariants> & {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
key?: string;
|
|
12
|
+
onSelect?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare const Selectors: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
15
|
+
selected?: boolean | null | undefined;
|
|
16
|
+
disabled?: boolean | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & {
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
selected?: boolean | undefined;
|
|
20
|
+
label?: string | undefined;
|
|
21
|
+
key?: string | undefined;
|
|
22
|
+
onSelect?: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
23
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
declare type SelectorContainerProps = {
|
|
25
|
+
children: React.ReactElement<SelectorsProps>[];
|
|
26
|
+
containerRef: React.RefObject<HTMLButtonElement>;
|
|
27
|
+
};
|
|
28
|
+
declare const SelectorContainer: React.FC<SelectorContainerProps>;
|
|
29
|
+
export { SelectorContainer, Selectors, selectorsVariants };
|
|
30
|
+
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AAED,aAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;CAClE,CAAA;AAEH,QAAA,MAAM,SAAS;;;;;;;;eAHA,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,SAAS;2CA6BpE,CAAA;AACD,aAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;CACjD,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAQvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Text } from "./text";
|
|
18
|
+
const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pageColor flex-row justify-center outline outline-1 rounded text-textColors-primaryColor outline-coreColors-dividingLines items-center", {
|
|
19
|
+
variants: {
|
|
20
|
+
selected: {
|
|
21
|
+
true: "outline-coreColors-brandColorPrimary",
|
|
22
|
+
false: "",
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
true: "[&>p]:!line-through [&>p]:text-stateColors-disabled",
|
|
26
|
+
false: "cursor-pointer active:outline-coreColors-brandColorPrimary",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
selected: false,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const Selectors = React.forwardRef((_a, ref) => {
|
|
34
|
+
var { label, selected, disabled = false, className, onSelect } = _a, props = __rest(_a, ["label", "selected", "disabled", "className", "onSelect"]);
|
|
35
|
+
return (_jsx("button", Object.assign({ disabled: disabled, onClick: onSelect, className: cn(selectorsVariants({
|
|
36
|
+
selected: selected,
|
|
37
|
+
className,
|
|
38
|
+
disabled,
|
|
39
|
+
}), "group"), ref: ref }, props, { children: _jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label }), void 0) }), void 0));
|
|
40
|
+
});
|
|
41
|
+
const SelectorContainer = ({ children }) => {
|
|
42
|
+
return (_jsx("div", Object.assign({ className: "flex gap-2 px-1 h-[42px] items-center overflow-x-auto" }, { children: children.map((chip, index) => (_jsx("div", { children: chip }, index))) }), void 0));
|
|
43
|
+
};
|
|
44
|
+
Selectors.displayName = "Selectors";
|
|
45
|
+
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
|
5
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../components/ui/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAA;AAI/D,QAAA,MAAM,SAAS,6JAoBd,CAAA;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
const Separator = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className, orientation = "horizontal", decorative = true } = _a, props = __rest(_a, ["className", "orientation", "decorative"]);
|
|
19
|
+
return (_jsx(SeparatorPrimitive.Root, Object.assign({ ref: ref, decorative: decorative, orientation: orientation, className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className) }, props), void 0));
|
|
20
|
+
});
|
|
21
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
22
|
+
export { Separator };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const skeletonVariants: (props?: ({
|
|
4
|
+
variant?: "circle" | "line" | "rectangular" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
}
|
|
11
|
+
declare function Skeleton({ className, variant, height, width, borderRadius, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Skeleton };
|
|
13
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../components/ui/skeleton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,gBAAgB;;mFAYrB,CAAA;AAED,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,YAAgB,EAChB,GAAG,KAAK,EACT,EAAE,aAAa,2CAYf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton h-10 w-10 rounded-[4px]", {
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
line: "",
|
|
19
|
+
rectangular: "",
|
|
20
|
+
circle: "rounded-full",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: { variant: "line" },
|
|
24
|
+
});
|
|
25
|
+
function Skeleton(_a) {
|
|
26
|
+
var { className, variant, height, width, borderRadius = 4 } = _a, props = __rest(_a, ["className", "variant", "height", "width", "borderRadius"]);
|
|
27
|
+
return (_jsx("div", Object.assign({ className: cn(skeletonVariants({ variant }), className), style: {
|
|
28
|
+
width: width,
|
|
29
|
+
height: height,
|
|
30
|
+
borderRadius: variant === "rectangular" ? borderRadius : "",
|
|
31
|
+
} }, props), void 0));
|
|
32
|
+
}
|
|
33
|
+
export { Skeleton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
5
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAA;AAI1D,QAAA,MAAM,MAAM,8JAkBV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
const Switch = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
19
|
+
return (_jsx(SwitchPrimitives.Root, Object.assign({ className: cn("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className) }, props, { ref: ref }, { children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0") }, void 0) }), void 0));
|
|
20
|
+
});
|
|
21
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
22
|
+
export { Switch };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
tabs: {
|
|
4
|
+
label: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}[];
|
|
7
|
+
activeTab: number;
|
|
8
|
+
onTabChange: (_: number) => void;
|
|
9
|
+
active?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { Tabs };
|
|
13
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../components/ui/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAA;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAiCD,QAAA,MAAM,IAAI,kFAyGT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { cva } from "class-variance-authority";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Text } from "./text";
|
|
18
|
+
const tabVariants = cva("flex items-center justify-center px-4 py-2 w-full", {
|
|
19
|
+
variants: {
|
|
20
|
+
isActive: {
|
|
21
|
+
true: "[&>p]:text-textColors-primaryColor",
|
|
22
|
+
false: "[&>p]:text-textColors-secondaryColor",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
isActive: false,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const Tab = ({ label, isActive = false, onClick }) => {
|
|
30
|
+
return (_jsx("button", Object.assign({ className: cn(tabVariants({
|
|
31
|
+
isActive,
|
|
32
|
+
})), onClick: onClick }, { children: _jsx(Text, Object.assign({ type: "body-primary" }, { children: label }), void 0) }), void 0));
|
|
33
|
+
};
|
|
34
|
+
const Tabs = React.forwardRef((_a, ref) => {
|
|
35
|
+
var { className, tabs, activeTab, onTabChange } = _a, props = __rest(_a, ["className", "tabs", "activeTab", "onTabChange"]);
|
|
36
|
+
const [underlinePosition, setUnderlinePosition] = React.useState({
|
|
37
|
+
left: 0,
|
|
38
|
+
width: 0,
|
|
39
|
+
});
|
|
40
|
+
const containerRef = React.useRef(null);
|
|
41
|
+
const [showLeftGradient, setShowLeftGradient] = React.useState(false);
|
|
42
|
+
const [showRightGradient, setShowRightGradient] = React.useState(false);
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
onTabChange(activeTab);
|
|
45
|
+
}, [activeTab, tabs, onTabChange]);
|
|
46
|
+
const checkShowGradients = () => {
|
|
47
|
+
const { scrollLeft, scrollWidth, clientWidth } = containerRef.current;
|
|
48
|
+
setShowLeftGradient(scrollLeft > 0);
|
|
49
|
+
setShowRightGradient(scrollLeft + clientWidth < scrollWidth);
|
|
50
|
+
};
|
|
51
|
+
const handleTabChanged = React.useCallback(() => {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const currentTab = containerRef.current.children[activeTab];
|
|
54
|
+
setUnderlinePosition({
|
|
55
|
+
left: (_a = currentTab === null || currentTab === void 0 ? void 0 : currentTab.offsetLeft) !== null && _a !== void 0 ? _a : 0,
|
|
56
|
+
width: (_b = currentTab === null || currentTab === void 0 ? void 0 : currentTab.clientWidth) !== null && _b !== void 0 ? _b : 0,
|
|
57
|
+
});
|
|
58
|
+
currentTab.scrollIntoView({
|
|
59
|
+
behavior: "smooth",
|
|
60
|
+
block: "nearest",
|
|
61
|
+
inline: "center",
|
|
62
|
+
});
|
|
63
|
+
}, [activeTab]);
|
|
64
|
+
React.useEffect(() => {
|
|
65
|
+
handleTabChanged();
|
|
66
|
+
window.addEventListener("resize", handleTabChanged);
|
|
67
|
+
return () => {
|
|
68
|
+
window.removeEventListener("resize", handleTabChanged);
|
|
69
|
+
};
|
|
70
|
+
}, [handleTabChanged]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
const handleResize = () => checkShowGradients();
|
|
73
|
+
window.addEventListener("resize", handleResize);
|
|
74
|
+
checkShowGradients();
|
|
75
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
76
|
+
}, []);
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
checkShowGradients();
|
|
79
|
+
}, [tabs]);
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
if (ref) {
|
|
82
|
+
if (typeof ref === "function") {
|
|
83
|
+
ref(containerRef.current);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
ref.current = containerRef.current;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, [ref]);
|
|
90
|
+
return (_jsxs("div", Object.assign({ className: "relative" }, props, { children: [_jsxs("div", Object.assign({ ref: containerRef, className: "relative flex overflow-x-auto", onScroll: checkShowGradients }, { children: [tabs.map((tab, index) => (_jsx(Tab, { label: tab.label, isActive: activeTab === index, onClick: () => onTabChange(index) }, index))), _jsx("div", { className: `absolute bottom-0 bg-coreColors-brandColorPrimary h-[2px] transition-all duration-300`, style: {
|
|
91
|
+
left: underlinePosition.left,
|
|
92
|
+
width: underlinePosition.width,
|
|
93
|
+
} }, void 0)] }), void 0), showRightGradient ? (_jsx("div", { className: "absolute right-0 bottom-0 w-16 h-10 bg-[linear-gradient(90deg,#ffffff00_0%,#FFF_100%)] pointer-events-none" }, void 0)) : (_jsx(_Fragment, {}, void 0)), showLeftGradient ? (_jsx("div", { className: "absolute left-0 bottom-0 w-16 h-10 bg-[linear-gradient(270deg,#ffffff00_0%,#FFF_100%)] pointer-events-none" }, void 0)) : (_jsx(_Fragment, {}, void 0))] }), void 0));
|
|
94
|
+
});
|
|
95
|
+
Tabs.displayName = "Tabs";
|
|
96
|
+
export { Tabs };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const textVariants: (props?: ({
|
|
4
|
+
type?: "h1" | "h2" | "label" | "body-primary" | "body-secondary" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof textVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Text({ className, type, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Text, textVariants };
|
|
10
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../components/ui/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,YAAY;;mFAgBhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAChD,YAAY,CAAC,OAAO,YAAY,CAAC;CAAG;AAExC,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAErD;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { cn } from "../../lib/utils";
|
|
15
|
+
const textVariants = cva("", {
|
|
16
|
+
variants: {
|
|
17
|
+
type: {
|
|
18
|
+
h1: "text-[23px] font-sfpro-roboto leading-[130%] font-normal text-textColors-primaryColor",
|
|
19
|
+
h2: "text-lg font-sfpro-roboto leading-[130%] font-medium text-textColors-primaryColor",
|
|
20
|
+
"body-primary": "text-[15px] font-sfpro-roboto leading-[160%] font-normal text-textColors-primaryColor",
|
|
21
|
+
"body-secondary": "text-[12px] font-sfpro-roboto leading-[130%] font-normal text-textColors-secondaryColor",
|
|
22
|
+
label: "text-[10px] font-sfpro-roboto leading-[130%] font-normal text-textColors-secondaryColor",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
type: "body-primary",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
function Text(_a) {
|
|
30
|
+
var { className, type } = _a, props = __rest(_a, ["className", "type"]);
|
|
31
|
+
return _jsx("p", Object.assign({ className: cn(textVariants({ type }), className) }, props), void 0);
|
|
32
|
+
}
|
|
33
|
+
export { Text, textVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
|
|
5
|
+
declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
6
|
+
declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
|
|
7
|
+
variant?: "default" | "error" | "warning" | "success" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
9
|
+
declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare type ToastType = "default" | "warning" | "error" | "success";
|
|
13
|
+
declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
|
+
type?: "default" | "error" | "warning" | "success" | undefined;
|
|
15
|
+
icon?: boolean | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
18
|
+
declare type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
19
|
+
export { type ToastProps, type ToastActionElement, ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, type ToastType, };
|
|
20
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../components/ui/toast.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAOjE,QAAA,MAAM,aAAa,8CAA2B,CAAA;AAE9C,QAAA,MAAM,aAAa,kKAYjB,CAAA;AAgCF,QAAA,MAAM,KAAK;;0HAYT,CAAA;AAGF,QAAA,MAAM,WAAW,kKAYf,CAAA;AAGF,QAAA,MAAM,UAAU,iKAed,CAAA;AAGF,QAAA,MAAM,UAAU,2JASd,CAAA;AAEF,aAAK,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAiC5D,QAAA,MAAM,gBAAgB;;;wCAiBpB,CAAA;AAGF,aAAK,UAAU,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,KAAK,CAAC,CAAA;AAE9D,aAAK,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,WAAW,CAAC,CAAA;AAEhE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,KAAK,SAAS,GACf,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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 * as ToastPrimitives from "@radix-ui/react-toast";
|
|
16
|
+
import { cva } from "class-variance-authority";
|
|
17
|
+
import { X } from "lucide-react";
|
|
18
|
+
import { cn } from "../../lib/utils";
|
|
19
|
+
import { Icon } from "./icon";
|
|
20
|
+
import { Text } from "./text";
|
|
21
|
+
const ToastProvider = ToastPrimitives.Provider;
|
|
22
|
+
const ToastViewport = React.forwardRef((_a, ref) => {
|
|
23
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
24
|
+
return (_jsx(ToastPrimitives.Viewport, Object.assign({ ref: ref, className: cn("fixed z-[100] top-0 flex max-h-screen w-full flex-col items-center right-0", className) }, props), void 0));
|
|
25
|
+
});
|
|
26
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
27
|
+
const toastVariants = cva(`fixed w-full pb-4 pt-12 px-4 h-auto group pointer-events-auto flex items-center justify-between shadow-[0_0_6px_0_rgba(17,17,17,0.16)] transition-all
|
|
28
|
+
data-[swipe=cancel]:translate-x-0
|
|
29
|
+
data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)]
|
|
30
|
+
data-[swipe=end]:animate-out
|
|
31
|
+
data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)]
|
|
32
|
+
data-[swipe=move]:transition-none
|
|
33
|
+
data-[state=closed]:animate-out
|
|
34
|
+
data-[state=closed]:fade-out-0
|
|
35
|
+
data-[state=closed]:slide-out-to-top-full
|
|
36
|
+
data-[state=open]:slide-in-from-top-full
|
|
37
|
+
data-[state=open]:animate-in
|
|
38
|
+
data-[state=open]:duration-500`, {
|
|
39
|
+
variants: {
|
|
40
|
+
variant: {
|
|
41
|
+
default: "bg-coreColors-modalBackground [&_*]:text-textColors-primaryColor",
|
|
42
|
+
error: "bg-stateColors-error [&_*]:text-coreColors-pageColor",
|
|
43
|
+
warning: "bg-stateColors-warning [&_*]:text-coreColors-pageColor",
|
|
44
|
+
success: "bg-stateColors-success [&_*]:text-coreColors-pageColor",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
variant: "default",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const Toast = React.forwardRef((_a, ref) => {
|
|
52
|
+
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
53
|
+
return (_jsx(ToastPrimitives.Root, Object.assign({ ref: ref, className: cn(toastVariants({ variant }), className) }, props), void 0));
|
|
54
|
+
});
|
|
55
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
56
|
+
const ToastAction = React.forwardRef((_a, ref) => {
|
|
57
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
58
|
+
return (_jsx(ToastPrimitives.Action, Object.assign({ ref: ref, className: cn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive", className) }, props), void 0));
|
|
59
|
+
});
|
|
60
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
61
|
+
const ToastClose = React.forwardRef((_a, ref) => {
|
|
62
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
63
|
+
return (_jsx(ToastPrimitives.Close, Object.assign({ ref: ref, className: cn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600", className), "toast-close": "" }, props, { children: _jsx(X, { className: "h-4 w-4" }, void 0) }), void 0));
|
|
64
|
+
});
|
|
65
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
66
|
+
const ToastTitle = React.forwardRef((_a, ref) => {
|
|
67
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
68
|
+
return (_jsx(ToastPrimitives.Title, Object.assign({ ref: ref, className: cn("text-sm font-semibold", className) }, props), void 0));
|
|
69
|
+
});
|
|
70
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
71
|
+
const ToastIcon = ({ type }) => {
|
|
72
|
+
const logoTypes = {
|
|
73
|
+
warning: {
|
|
74
|
+
name: "alert-circle",
|
|
75
|
+
color: "coreColors-pageColor",
|
|
76
|
+
},
|
|
77
|
+
error: {
|
|
78
|
+
name: "circle-x",
|
|
79
|
+
color: "coreColors-pageColor",
|
|
80
|
+
},
|
|
81
|
+
success: {
|
|
82
|
+
name: "check",
|
|
83
|
+
color: "coreColors-pageColor",
|
|
84
|
+
},
|
|
85
|
+
default: {
|
|
86
|
+
name: "info-circle",
|
|
87
|
+
color: "textColos-primaryColor",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const logoType = logoTypes[type];
|
|
91
|
+
return _jsx(Icon, { name: logoType.name || "", size: "sm", color: logoType.color }, void 0);
|
|
92
|
+
};
|
|
93
|
+
const ToastDescription = React.forwardRef((_a, ref) => {
|
|
94
|
+
var { className, type = "default", icon } = _a, props = __rest(_a, ["className", "type", "icon"]);
|
|
95
|
+
return (_jsxs(ToastPrimitives.Description, Object.assign({ ref: ref, className: cn("flex gap-4 items-center", className) }, props, { children: [icon ? _jsx(ToastIcon, { type: type }, void 0) : null, _jsx(Text, Object.assign({ type: "body-primary", className: "line-clamp-2" }, { children: props.children }), void 0)] }), void 0));
|
|
96
|
+
});
|
|
97
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
98
|
+
export { ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription, ToastClose, ToastAction, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../../components/ui/toaster.tsx"],"names":[],"mappings":"AAWA,wBAAgB,OAAO,CAAC,EACtB,IAAgB,GACjB,EAAE;IACD,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,2CAqBA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { Toast, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "../../components/ui/toast";
|
|
15
|
+
import { useToast } from "../../components/ui/use-toast";
|
|
16
|
+
export function Toaster({ type = "default", }) {
|
|
17
|
+
const { toasts } = useToast();
|
|
18
|
+
return (_jsxs(ToastProvider, { children: [toasts.map(function (_a) {
|
|
19
|
+
var { id, title, description, icon } = _a, props = __rest(_a, ["id", "title", "description", "icon"]);
|
|
20
|
+
return (_jsx(Toast, Object.assign({ variant: type }, props, { children: _jsxs("div", Object.assign({ className: "flex w-full justify-center" }, { children: [title && _jsx(ToastTitle, { children: title }, void 0), description && (_jsx(ToastDescription, Object.assign({ type: type, icon: icon }, { children: description }), void 0))] }), void 0) }), id));
|
|
21
|
+
}), _jsx(ToastViewport, {}, void 0)] }, void 0));
|
|
22
|
+
}
|