@tapcart/mobile-components 0.2.12 → 0.3.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.
- 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/checkbox.js +2 -2
- package/dist/components/ui/chip.d.ts.map +1 -1
- package/dist/components/ui/chip.js +3 -3
- package/dist/components/ui/drawer.js +1 -1
- 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 +318 -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 +5 -19
- package/dist/components/ui/product-card.d.ts.map +1 -1
- package/dist/components/ui/product-card.js +77 -24
- 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/toggle.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/styles.css +108 -88
- package/package.json +9 -3
- 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
|
@@ -37,7 +37,7 @@ const radiogroupItemVariants = cva("grid grid-cols-[auto,auto,1fr] gap-2 items-s
|
|
|
37
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" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "group-disabled:text-stateColors-disabled mr-2" }, { children: label })), numberAmount ? (_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-secondaryColor group-disabled:text-stateColors-disabled" }, { children: `(${numberAmount})` }))) : null] })), subtext ? (_jsx(Text, Object.assign({ type: "body-secondary", className: "group-disabled:text-stateColors-disabled mt-2" }, { children: subtext }))) : null] })));
|
|
38
38
|
const RadioGroupItem = React.forwardRef((_a, ref) => {
|
|
39
39
|
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"]);
|
|
40
|
-
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" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] })) : (_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" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) : (_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" }) })), _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" }) }))] })), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) }))) })));
|
|
40
|
+
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" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] })) : (_jsx(RadioGroupPrimitive.Item, Object.assign({ ref: ref, value: value, onSelect: onSelect, checked: selected, onClick: onClick, className: cn("flex items-center justify-center active:opacity-70", 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" }), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) : (_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" }) })), _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" }) }))] })), _jsx(RadioGroupItemLabels, { label: label, numberAmount: numberAmount, subtext: subtext }, key)] }))) }))) })));
|
|
41
41
|
});
|
|
42
42
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
43
43
|
export { RadioGroup, RadioGroupItem, radiogroupItemVariants };
|
|
@@ -23,7 +23,7 @@ declare const Selectors: React.ForwardRefExoticComponent<Omit<React.DetailedHTML
|
|
|
23
23
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
24
|
type SelectorContainerProps = {
|
|
25
25
|
children: React.ReactElement<SelectorsProps>[];
|
|
26
|
-
containerRef: React.RefObject<
|
|
26
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
27
27
|
};
|
|
28
28
|
declare const SelectorContainer: React.FC<SelectorContainerProps>;
|
|
29
29
|
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../components/ui/selectors.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,iBAAiB;;;mFAiBtB,CAAA;AACD,KAAK,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,GAC5D,YAAY,CAAC,OAAO,iBAAiB,CAAC,GAAG;IACvC,QAAQ,CAAC,EAAE,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,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAA;IAC9C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC9C,CAAA;AACD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAyCvD,CAAA;AAID,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAE,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 } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
@@ -23,7 +23,7 @@ const selectorsVariants = cva("flex py-2 px-4 whitespace-nowrap bg-coreColors-pa
|
|
|
23
23
|
},
|
|
24
24
|
disabled: {
|
|
25
25
|
true: "[&>p]:!line-through [&>p]:text-stateColors-disabled",
|
|
26
|
-
false: "cursor-pointer active:outline-coreColors-brandColorPrimary",
|
|
26
|
+
false: "cursor-pointer active:outline-coreColors-brandColorPrimary active:opacity-70",
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: {
|
|
@@ -38,8 +38,24 @@ const Selectors = React.forwardRef((_a, ref) => {
|
|
|
38
38
|
disabled,
|
|
39
39
|
}), "group"), ref: ref }, props, { children: _jsx(Text, Object.assign({ type: "body-primary", color: "text-textColors-primaryColor" }, { children: label })) })));
|
|
40
40
|
});
|
|
41
|
-
const SelectorContainer = ({ children }) => {
|
|
42
|
-
|
|
41
|
+
const SelectorContainer = ({ children, containerRef, }) => {
|
|
42
|
+
const [showFadeLeft, setShowFadeLeft] = React.useState(false);
|
|
43
|
+
const [showFadeRight, setShowFadeRight] = React.useState(false);
|
|
44
|
+
const checkOverflow = () => {
|
|
45
|
+
const { scrollLeft, scrollWidth, clientWidth } = containerRef.current;
|
|
46
|
+
setShowFadeLeft(scrollLeft > 0);
|
|
47
|
+
setShowFadeRight(scrollLeft + clientWidth < scrollWidth);
|
|
48
|
+
};
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
const handleResize = () => checkOverflow();
|
|
51
|
+
window.addEventListener("resize", handleResize);
|
|
52
|
+
checkOverflow();
|
|
53
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
54
|
+
}, []);
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
checkOverflow();
|
|
57
|
+
}, [children]);
|
|
58
|
+
return (_jsx("div", Object.assign({ className: "relative" }, { children: _jsxs("div", Object.assign({ className: "flex gap-2 px-1 h-[42px] items-center overflow-x-auto overflow-y-hidden no-scrollbar", onScroll: checkOverflow, ref: containerRef }, { children: [children, showFadeLeft && (_jsx("div", { className: "absolute top-0 left-0 w-8 h-full pointer-events-none bg-fade-left" })), showFadeRight && (_jsx("div", { className: "absolute top-0 right-0 w-8 h-full pointer-events-none bg-fade-right" }))] })) })));
|
|
43
59
|
};
|
|
44
60
|
Selectors.displayName = "Selectors";
|
|
45
61
|
export { SelectorContainer, Selectors, selectorsVariants };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { cva } from "class-variance-authority";
|
|
14
14
|
import { cn } from "../../lib/utils";
|
|
15
|
-
const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton
|
|
15
|
+
const skeletonVariants = cva("animate-pulse flex bg-stateColors-skeleton rounded-[4px]", {
|
|
16
16
|
variants: {
|
|
17
17
|
variant: {
|
|
18
18
|
line: "",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
|
+
export interface SliderProps extends Omit<React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>, "onChange"> {
|
|
4
|
+
className?: string;
|
|
5
|
+
defaultValue: number[];
|
|
6
|
+
value: number[];
|
|
7
|
+
step: number;
|
|
8
|
+
max: number;
|
|
9
|
+
min?: number;
|
|
10
|
+
onChange: (value: number[]) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
export { Slider };
|
|
14
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../components/ui/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,MAAM,WAAW,WACf,SAAQ,IAAI,CACV,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAC3D,UAAU,CACX;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,KAAK,EAAE,MAAM,EAAE,CAAA;IAEf,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACpC;AAED,QAAA,MAAM,MAAM,qFAmHX,CAAA;AAID,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 SliderPrimitive from "@radix-ui/react-slider";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
import { Input } from "./input";
|
|
18
|
+
const Slider = React.forwardRef((_a, ref) => {
|
|
19
|
+
var { className, max, min = 0, step = 1, defaultValue, value, onChange } = _a,
|
|
20
|
+
// doubleValue = false,
|
|
21
|
+
props = __rest(_a, ["className", "max", "min", "step", "defaultValue", "value", "onChange"]);
|
|
22
|
+
const doubleValue = false;
|
|
23
|
+
const handleCommit = (value) => {
|
|
24
|
+
onChange(value);
|
|
25
|
+
if (props.onValueChange) {
|
|
26
|
+
props.onValueChange(value);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const useDebounce = (value, delay) => {
|
|
30
|
+
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
const handler = setTimeout(() => {
|
|
33
|
+
setDebouncedValue(value);
|
|
34
|
+
}, delay);
|
|
35
|
+
return () => {
|
|
36
|
+
clearTimeout(handler);
|
|
37
|
+
};
|
|
38
|
+
}, [value, delay]);
|
|
39
|
+
return debouncedValue;
|
|
40
|
+
};
|
|
41
|
+
const debouncedSliderVal = useDebounce(value, 200);
|
|
42
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "mt-3 mb-6" }, { children: _jsxs(SliderPrimitive.Root, Object.assign({ ref: ref, className: cn("flex relative h-0.5 w-auto items-center select-none", className), onValueChange: (value) => onChange(value), onValueCommit: (value) => {
|
|
43
|
+
handleCommit(value);
|
|
44
|
+
}, defaultValue: defaultValue, value: value, max: max, min: min, step: step }, props, { children: [_jsx(SliderPrimitive.Track, Object.assign({ className: "relative h-1 rounded w-full grow overflow-hidden bg-coreColors-dividingLines" }, { children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-coreColors-brandColorPrimary" }) })), _jsx(SliderPrimitive.Thumb, { className: "block hover:slider-thumb h-4 w-4 rounded-full border-2 border-coreColors-brandColorPrimary bg-coreColors-modalBackground focus-visible:outline-none hover:h-[18px] hover:w-[18px] disabled:pointer-events-none" })] })) })), _jsxs("div", Object.assign({ className: "flex w-auto gap-4 " }, { children: [doubleValue && doubleValue == true ? (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({ className: "w-full px-4 py-2 border bg-coreColors-inputBackground" }, { children: _jsxs("div", Object.assign({ className: "flex flex-col" }, { children: [_jsx("div", Object.assign({ className: "h-4 text-textColors-secondaryColor text-[10px] leading-[13px]" }, { children: "Minimum" })), _jsxs("div", Object.assign({ className: "flex text-textColors-primaryColor text-[15px]" }, { children: ["$", min] }))] })) })), _jsx("div", { className: "w-4 h-0 self-center border-2 bg-coreColors-dividingLines" })] })) : (""), _jsx("div", Object.assign({ className: "w-full px-4 py-2 outline outline-1 outline-coreColors-dividingLines rounded bg-coreColors-inputBackground" }, { children: _jsxs("div", Object.assign({ className: "flex flex-col" }, { children: [_jsx("div", Object.assign({ className: "flex items-center h-4 text-textColors-secondaryColor text-[10px] leading-[13px]" }, { children: "Maximum" })), _jsxs("div", Object.assign({ className: "flex h-6 text-textColors-primaryColor text-[15px] w-full [&>div]:w-full" }, { children: ["$", _jsx(Input, { className: "border-0 p-0 h-full w-full text-[15px]", id: "slider-maximum", value: debouncedSliderVal[0].toString(), placeholder: defaultValue[0].toString(), onChange: (value) => {
|
|
45
|
+
const inputValue = Number(value);
|
|
46
|
+
inputValue > max ? onChange([max]) : onChange([inputValue]);
|
|
47
|
+
} })] }))] })) }))] }))] }));
|
|
48
|
+
});
|
|
49
|
+
Slider.displayName = SliderPrimitive.Root.displayName;
|
|
50
|
+
export { Slider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SubscriptionProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
|
|
3
|
+
imgUrl?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
oldPrice: number;
|
|
6
|
+
type: "subscription" | "one-time";
|
|
7
|
+
newPrice: number;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
savePercentage?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const Subscription: React.ForwardRefExoticComponent<SubscriptionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export { Subscription };
|
|
15
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../../components/ui/subscription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,cAAc,GAAG,UAAU,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,QAAA,MAAM,YAAY,6FAsEjB,CAAA;AAID,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
import { Text } from "./text";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
import { Icon } from "./icon";
|
|
17
|
+
const Subscription = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { imgUrl, name, oldPrice, newPrice, savePercentage = true, selected = false, type = "subscription", onClick, className } = _a, props = __rest(_a, ["imgUrl", "name", "oldPrice", "newPrice", "savePercentage", "selected", "type", "onClick", "className"]);
|
|
19
|
+
return (_jsxs("button", Object.assign({ className: cn("flex flex-row p-4 gap-2 w-full border-b border-coreColors-dividingLines", selected ? "bg-stateColors-skeleton" : "", className), ref: ref, onClick: onClick }, props, { children: [type == "subscription" && (_jsx(Icon, { name: "repeat", size: "sm", color: "stateColors-subscriptions", className: "my-auto" })), _jsxs("div", Object.assign({ className: "flex flex-col w-full items-start overflow-hidden" }, { children: [_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-primaryColor truncate w-full text-left" }, { children: name })), type == "subscription" && savePercentage && newPrice ? (_jsxs(Text, Object.assign({ type: "body-secondary", className: "text-stateColors-subscriptions" }, { children: ["Save ", 100 - (newPrice * 100) / oldPrice, "%"] }))) : null] })), _jsxs("div", Object.assign({ className: "flex flex-row items-start gap-2" }, { children: [type == "subscription" && newPrice ? (_jsx(Text, Object.assign({ type: "body-primary", className: "text-textColors-salePriceText" }, { children: `$${newPrice.toFixed(2)}` }))) : null, _jsx(Text, Object.assign({ type: "body-primary", className: `${type == "subscription"
|
|
20
|
+
? "line-through hover:!line-through text-textColors-strikethroughPriceText"
|
|
21
|
+
: "text-textColors-priceText"}` }, { children: `$${oldPrice.toFixed(2)}` }))] }))] })));
|
|
22
|
+
});
|
|
23
|
+
Subscription.displayName = "Subscription";
|
|
24
|
+
export { Subscription };
|
|
@@ -1 +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,
|
|
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,8JAmBV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -15,8 +15,8 @@ import * as React from "react";
|
|
|
15
15
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
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-
|
|
18
|
+
var { className, onClick } = _a, props = __rest(_a, ["className", "onClick"]);
|
|
19
|
+
return (_jsx(SwitchPrimitives.Root, Object.assign({ onClick: onClick, className: cn("peer inline-flex h-8 w-14 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-stateColors-success data-[state=unchecked]:bg-stateColors-disabled", className) }, props, { ref: ref }, { children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-7 w-7 rounded-full bg-coreColors-pageColor drop-shadow-[0_3px_1px_0_rgba(0,0,0,1)] ring-0 transition-transform data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0") }) })));
|
|
20
20
|
});
|
|
21
21
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
22
22
|
export { Switch };
|
|
@@ -15,7 +15,7 @@ import * as React from "react";
|
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
17
|
import { Text } from "./text";
|
|
18
|
-
const tabVariants = cva("flex items-center justify-center px-4 py-2 w-full", {
|
|
18
|
+
const tabVariants = cva("flex items-center justify-center px-4 py-2 w-full active:opacity-70", {
|
|
19
19
|
variants: {
|
|
20
20
|
isActive: {
|
|
21
21
|
true: "[&>p]:text-textColors-primaryColor",
|
|
@@ -15,7 +15,7 @@ import * as React from "react";
|
|
|
15
15
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
16
16
|
import { cva } from "class-variance-authority";
|
|
17
17
|
import { cn } from "../../lib/utils";
|
|
18
|
-
const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
|
|
18
|
+
const toggleVariants = cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground active:opacity-70", {
|
|
19
19
|
variants: {
|
|
20
20
|
variant: {
|
|
21
21
|
default: "bg-transparent",
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./components/ui/toggle";
|
|
|
18
18
|
export * from "./components/ui/toggle-group";
|
|
19
19
|
export * from "./components/ui/switch";
|
|
20
20
|
export * from "./components/ui/scroll-area";
|
|
21
|
+
export * from "./components/ui/slider";
|
|
21
22
|
export * from "./components/ui/selectors";
|
|
22
23
|
export * from "./components/ui/toast";
|
|
23
24
|
export * from "./components/ui/toaster";
|
|
@@ -32,7 +33,11 @@ export * from "./components/ui/wishlist";
|
|
|
32
33
|
export * from "./components/ui/product-card";
|
|
33
34
|
export * from "./components/ui/dropdown";
|
|
34
35
|
export * from "./components/ui/product-grid";
|
|
36
|
+
export * from "./components/ui/quantity-picker";
|
|
35
37
|
export * from "./components/hooks/use-infinite-scroll";
|
|
38
|
+
export * from "./components/ui/subscription";
|
|
39
|
+
export * from "./components/ui/line-item-text-icons";
|
|
36
40
|
export * from "./components/hooks/use-scroll-direction";
|
|
41
|
+
export * from "./components/ui/image";
|
|
37
42
|
export { cn, cva } from "./lib/utils";
|
|
38
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,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,wCAAwC,CAAA;AACtD,cAAc,yCAAyC,CAAA;AACvD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;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,yCAAyC,CAAA;AACvD,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from "./components/ui/toggle";
|
|
|
19
19
|
export * from "./components/ui/toggle-group";
|
|
20
20
|
export * from "./components/ui/switch";
|
|
21
21
|
export * from "./components/ui/scroll-area";
|
|
22
|
+
export * from "./components/ui/slider";
|
|
22
23
|
export * from "./components/ui/selectors";
|
|
23
24
|
export * from "./components/ui/toast";
|
|
24
25
|
export * from "./components/ui/toaster";
|
|
@@ -33,6 +34,10 @@ export * from "./components/ui/wishlist";
|
|
|
33
34
|
export * from "./components/ui/product-card";
|
|
34
35
|
export * from "./components/ui/dropdown";
|
|
35
36
|
export * from "./components/ui/product-grid";
|
|
37
|
+
export * from "./components/ui/quantity-picker";
|
|
36
38
|
export * from "./components/hooks/use-infinite-scroll";
|
|
39
|
+
export * from "./components/ui/subscription";
|
|
40
|
+
export * from "./components/ui/line-item-text-icons";
|
|
37
41
|
export * from "./components/hooks/use-scroll-direction";
|
|
42
|
+
export * from "./components/ui/image";
|
|
38
43
|
export { cn, cva } from "./lib/utils";
|