@tapcart/mobile-components 0.4.2 → 0.4.4
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 +4 -3
- package/dist/components/hooks/use-infinite-scroll.d.ts.map +1 -1
- package/dist/components/hooks/use-infinite-scroll.js +33 -19
- package/dist/components/ui/Input/index.d.ts +2 -0
- package/dist/components/ui/Input/index.d.ts.map +1 -0
- package/dist/components/ui/Input/index.js +1 -0
- package/dist/components/ui/Input/input.d.ts +5 -0
- package/dist/components/ui/Input/input.d.ts.map +1 -0
- package/dist/components/ui/Input/input.js +46 -0
- package/dist/components/ui/Input/types.d.ts +34 -0
- package/dist/components/ui/Input/types.d.ts.map +1 -0
- package/dist/components/ui/Input/types.js +1 -0
- package/dist/components/ui/Input/useInput.d.ts +41 -0
- package/dist/components/ui/Input/useInput.d.ts.map +1 -0
- package/dist/components/ui/Input/useInput.js +69 -0
- package/dist/components/ui/button.d.ts +1 -0
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +3 -3
- package/dist/components/ui/icon.d.ts.map +1 -1
- package/dist/components/ui/icon.js +2 -1
- package/dist/components/ui/image.d.ts +3 -0
- package/dist/components/ui/image.d.ts.map +1 -1
- package/dist/components/ui/image.js +3 -5
- package/dist/components/ui/money.d.ts.map +1 -1
- package/dist/components/ui/money.js +1 -0
- package/dist/components/ui/slider.js +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +3 -0
- package/dist/styles.css +9 -17
- package/package.json +16 -16
|
@@ -5,10 +5,10 @@ interface PageData {
|
|
|
5
5
|
products: Product[];
|
|
6
6
|
cursorBlob?: string;
|
|
7
7
|
filtersData: any;
|
|
8
|
+
apiURL: string;
|
|
8
9
|
}
|
|
9
10
|
interface UseInfiniteScrollProps {
|
|
10
11
|
initialData: PageData;
|
|
11
|
-
loadMoreProducts: (params: any) => Promise<PageData>;
|
|
12
12
|
queryVariables: Record<string, any>;
|
|
13
13
|
}
|
|
14
14
|
interface UseInfiniteScrollReturn {
|
|
@@ -23,6 +23,7 @@ interface UseInfiniteScrollReturn {
|
|
|
23
23
|
isLoading: boolean;
|
|
24
24
|
isValidating: boolean;
|
|
25
25
|
}
|
|
26
|
-
declare const
|
|
27
|
-
|
|
26
|
+
declare const constructURL: (params: Record<string, any>, apiURL: string) => string;
|
|
27
|
+
declare const useInfiniteScroll: ({ initialData, queryVariables: queryVariableProps, }: UseInfiniteScrollProps) => UseInfiniteScrollReturn;
|
|
28
|
+
export { useInfiniteScroll, constructURL };
|
|
28
29
|
//# sourceMappingURL=use-infinite-scroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAQA,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"use-infinite-scroll.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-infinite-scroll.ts"],"names":[],"mappings":"AAQA,UAAU,OAAO;IACf,MAAM,EAAE,MAAM,CAAA;CAEf;AAED,UAAU,QAAQ;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,GAAG,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAOD,UAAU,sBAAsB;IAC9B,WAAW,EAAE,QAAQ,CAAA;IACrB,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;AA2CD,QAAA,MAAM,YAAY,WAAY,OAAO,MAAM,EAAE,GAAG,CAAC,UAAU,MAAM,WAahE,CAAA;AAqBD,QAAA,MAAM,iBAAiB,yDAGpB,sBAAsB,KAAG,uBAoF3B,CAAA;AAED,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -7,8 +7,7 @@ const PAGE_SIZE = 8;
|
|
|
7
7
|
const parseSort = (json) => {
|
|
8
8
|
return json ? JSON.parse(json) : undefined;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
const reconcileFilters = ({ selectedFilters, filtersData }) => {
|
|
10
|
+
const reconcileFilters = ({ selectedFilters = "[]", filtersData = [] }) => {
|
|
12
11
|
if (!selectedFilters)
|
|
13
12
|
throw new Error("No filters provided");
|
|
14
13
|
const filtersArray = selectedFilters ? JSON.parse(selectedFilters) : undefined;
|
|
@@ -20,6 +19,8 @@ const reconcileFilters = ({ selectedFilters, filtersData }) => {
|
|
|
20
19
|
});
|
|
21
20
|
const matchingFilters = (filtersList, selectedTags) => {
|
|
22
21
|
return filtersList.filter((filter) => {
|
|
22
|
+
if (!(filter === null || filter === void 0 ? void 0 : filter.tag))
|
|
23
|
+
return false;
|
|
23
24
|
const parsedFilter = filter.tag;
|
|
24
25
|
return selectedTags.has(parsedFilter);
|
|
25
26
|
});
|
|
@@ -34,7 +35,30 @@ const reconcileFilters = ({ selectedFilters, filtersData }) => {
|
|
|
34
35
|
filtersData,
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
|
-
const
|
|
38
|
+
const constructURL = (params, apiURL) => {
|
|
39
|
+
const url = new URL(apiURL);
|
|
40
|
+
Object.keys(params).forEach((key) => {
|
|
41
|
+
const value = params[key];
|
|
42
|
+
if (value !== undefined && value !== null) {
|
|
43
|
+
if (typeof value === "string") {
|
|
44
|
+
url.searchParams.append(key, value);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
url.searchParams.append(key, JSON.stringify(value));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return url.toString();
|
|
52
|
+
};
|
|
53
|
+
const getKey = (pageIndex, previousPageData, queryVariables, apiURL) => {
|
|
54
|
+
var _a;
|
|
55
|
+
if (pageIndex === 0)
|
|
56
|
+
return constructURL(queryVariables, apiURL);
|
|
57
|
+
if (!previousPageData || !((_a = previousPageData.pageData) === null || _a === void 0 ? void 0 : _a.cursorBlob))
|
|
58
|
+
return null;
|
|
59
|
+
return constructURL(Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob }), apiURL);
|
|
60
|
+
};
|
|
61
|
+
const useInfiniteScroll = ({ initialData, queryVariables: queryVariableProps, }) => {
|
|
38
62
|
var _a, _b, _c, _d;
|
|
39
63
|
const searchParams = useSearchParams();
|
|
40
64
|
const sortStateFromParam = useCallback(() => {
|
|
@@ -56,15 +80,8 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables: quer
|
|
|
56
80
|
sortStateFromParam,
|
|
57
81
|
]);
|
|
58
82
|
const { ref, inView } = useInView({ rootMargin: "600px" }); // controls how early the next page loads
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
if (pageIndex === 0)
|
|
62
|
-
return queryVariables;
|
|
63
|
-
if (!previousPageData || !((_a = previousPageData.pageData) === null || _a === void 0 ? void 0 : _a.cursorBlob))
|
|
64
|
-
return null;
|
|
65
|
-
return Object.assign(Object.assign({}, queryVariables), { cursorBlob: previousPageData.pageData.cursorBlob });
|
|
66
|
-
};
|
|
67
|
-
const { data, error, size, setSize, isLoading, isValidating, } = useSWRInfinite(getKey, loadMoreProducts, {
|
|
83
|
+
const fetcher = (url) => fetch(url).then((res) => res.json());
|
|
84
|
+
const { data, error, size, setSize, isLoading, isValidating, } = useSWRInfinite((pageIndex, previousPageData) => getKey(pageIndex, previousPageData, queryVariables, initialData.apiURL), fetcher, {
|
|
68
85
|
revalidateFirstPage: false,
|
|
69
86
|
initialSize: 1,
|
|
70
87
|
});
|
|
@@ -76,20 +93,17 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables: quer
|
|
|
76
93
|
? !((_d = (_c = data[data.length - 1]) === null || _c === void 0 ? void 0 : _c.pageData) === null || _d === void 0 ? void 0 : _d.cursorBlob)
|
|
77
94
|
: true;
|
|
78
95
|
const isReachingEnd = isEmpty || isEndPointer;
|
|
96
|
+
const isRefreshing = isValidating && data && data.length === size;
|
|
79
97
|
const loadMore = useCallback(() => {
|
|
80
|
-
if (!isLoadingMore && !isReachingEnd) {
|
|
98
|
+
if (!isLoadingMore && !isReachingEnd && !isRefreshing) {
|
|
81
99
|
setSize(size + 1);
|
|
82
100
|
}
|
|
83
|
-
}, [isLoadingMore, isReachingEnd,
|
|
101
|
+
}, [isLoadingMore, isReachingEnd, isRefreshing, setSize, size]);
|
|
84
102
|
useEffect(() => {
|
|
85
103
|
if (inView) {
|
|
86
104
|
loadMore();
|
|
87
105
|
}
|
|
88
106
|
}, [inView, loadMore]);
|
|
89
|
-
// Trigger a new page load when the query variables change
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
setSize(1);
|
|
92
|
-
}, [queryVariables, setSize]);
|
|
93
107
|
return {
|
|
94
108
|
data,
|
|
95
109
|
error,
|
|
@@ -103,4 +117,4 @@ const useInfiniteScroll = ({ initialData, loadMoreProducts, queryVariables: quer
|
|
|
103
117
|
isValidating,
|
|
104
118
|
};
|
|
105
119
|
};
|
|
106
|
-
export { useInfiniteScroll };
|
|
120
|
+
export { useInfiniteScroll, constructURL };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './input';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAGxD,QAAA,MAAM,KAAK,qFAiIV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 { inputVariants, useInput } from "./useInput";
|
|
15
|
+
import { cn } from "../../../lib/utils";
|
|
16
|
+
import { Icon } from "../icon";
|
|
17
|
+
const Input = React.forwardRef((_a, ref) => {
|
|
18
|
+
var { className, error = false, id, type, label, asChild, value, onChange, icon, iconPosition = "right", // Default to "right" for backward compatibility
|
|
19
|
+
iconColor, placeholder, placeholderFont, placeholderFontWeight, placeholderFontSize, placeholderTextAlign, placeholderTextColor, placeholderUpperCase, inputPadding, backgroundColor, borderRadius, inputBorderColor, borderSides, inputSpacing } = _a, props = __rest(_a, ["className", "error", "id", "type", "label", "asChild", "value", "onChange", "icon", "iconPosition", "iconColor", "placeholder", "placeholderFont", "placeholderFontWeight", "placeholderFontSize", "placeholderTextAlign", "placeholderTextColor", "placeholderUpperCase", "inputPadding", "backgroundColor", "borderRadius", "inputBorderColor", "borderSides", "inputSpacing"]);
|
|
20
|
+
const { Comp, inputPaddingRight, inputPaddingLeft, borderStyle, borderRadiusStyle, iconLeftPadding, iconRightPadding, iconTopPadding, iconBottomPadding, placeholderTextColorStyle, iconColorStyle, inputBgColor, inputBorderColorStyle, } = useInput({
|
|
21
|
+
asChild,
|
|
22
|
+
icon,
|
|
23
|
+
iconPosition,
|
|
24
|
+
iconColor,
|
|
25
|
+
className,
|
|
26
|
+
backgroundColor,
|
|
27
|
+
borderRadius,
|
|
28
|
+
inputBorderColor,
|
|
29
|
+
borderSides,
|
|
30
|
+
inputSpacing,
|
|
31
|
+
inputPadding,
|
|
32
|
+
placeholderTextColor,
|
|
33
|
+
});
|
|
34
|
+
return (_jsxs(Comp, Object.assign({ className: "relative flex items-center group" }, { children: [icon && iconPosition === "left" && (_jsx(Icon, { name: icon, "data-error": error, size: "sm", color: iconColorStyle !== "inherit" ? undefined : "coreColors-secondaryIcon", className: cn("flex items-center absolute aspect-square fill-current z-10 icon ", {
|
|
35
|
+
"w-5": true,
|
|
36
|
+
"text-stateColors-error": error,
|
|
37
|
+
}), style: {
|
|
38
|
+
left: iconLeftPadding,
|
|
39
|
+
right: iconRightPadding,
|
|
40
|
+
top: iconTopPadding,
|
|
41
|
+
bottom: iconBottomPadding,
|
|
42
|
+
color: iconColorStyle,
|
|
43
|
+
} })), _jsx("input", Object.assign({ placeholder: placeholder, value: value, onChange: (e) => onChange(e.target.value), id: id, type: type, className: cn(inputVariants({ error, hasLabel: !!label }), className), "data-icon": !!icon, ref: ref }, props, { style: Object.assign(Object.assign({ paddingLeft: inputPaddingLeft, paddingRight: inputPaddingRight, fontFamily: placeholderFont, fontWeight: placeholderFontWeight, fontSize: `${placeholderFontSize}px`, textAlign: placeholderTextAlign, color: placeholderTextColorStyle, textTransform: placeholderUpperCase ? "uppercase" : undefined, borderColor: inputBorderColorStyle, paddingTop: inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.top, paddingBottom: inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.bottom, backgroundColor: inputBgColor }, borderStyle), (label ? { borderRadius: "8px" } : borderRadiusStyle)) })), label ? (_jsx("label", Object.assign({ htmlFor: id, className: cn("absolute text-[10px] text-textColors-secondaryColor group-active:text-coreColors-brandColorPrimary top-2 z-10 h-4 origin-[0] opacity-100 peer-placeholder-shown:opacity-0", iconPosition === "left" ? "start-10" : "start-4") }, { children: label }))) : null, icon && iconPosition === "right" && (_jsx(Icon, { name: icon, "data-error": error, size: "sm", className: "absolute w-5 aspect-square fill-current text-textColors-secondaryColor top-[18px] z-10 origin-[0] end-4 peer-pr-8 icon data-[error=true]:text-stateColors-error" }))] })));
|
|
44
|
+
});
|
|
45
|
+
Input.displayName = "Input";
|
|
46
|
+
export { Input };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { inputVariants } from "../../../components/ui/Input/useInput";
|
|
4
|
+
import { Color } from "../../../lib/utils";
|
|
5
|
+
export type BorderSides = ("all" | "bottom" | "left" | "right" | "top")[];
|
|
6
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">, VariantProps<typeof inputVariants> {
|
|
7
|
+
id: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
icon?: string;
|
|
13
|
+
iconPosition?: "left" | "right";
|
|
14
|
+
iconColor?: Color;
|
|
15
|
+
placeholder: string;
|
|
16
|
+
placeholderFont?: string;
|
|
17
|
+
placeholderFontWeight?: string;
|
|
18
|
+
placeholderFontSize?: number;
|
|
19
|
+
placeholderTextAlign?: "left" | "center" | "right";
|
|
20
|
+
placeholderTextColor?: Color;
|
|
21
|
+
placeholderUpperCase?: boolean;
|
|
22
|
+
backgroundColor?: Color;
|
|
23
|
+
borderRadius?: number;
|
|
24
|
+
inputBorderColor?: Color;
|
|
25
|
+
borderSides?: BorderSides;
|
|
26
|
+
inputPadding?: {
|
|
27
|
+
top: number;
|
|
28
|
+
bottom: number;
|
|
29
|
+
left: number;
|
|
30
|
+
right: number;
|
|
31
|
+
};
|
|
32
|
+
inputSpacing?: number;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;AAE1E,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC,EACnE,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnD,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;KAAE,CAAC;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { InputProps } from "../../../components/ui/Input/types";
|
|
3
|
+
export declare const DEFAULT_ICON_SIZE = 20;
|
|
4
|
+
export declare const DEFAULT_X_PADDING = 12;
|
|
5
|
+
export declare const DEFAULT_Y_PADDING = 8;
|
|
6
|
+
export declare const inputVariants: (props?: ({
|
|
7
|
+
hasLabel?: boolean | null | undefined;
|
|
8
|
+
error?: boolean | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const useInput: (props: Pick<InputProps, "asChild" | "icon" | "iconPosition" | "iconColor" | "className" | "backgroundColor" | "borderRadius" | "inputBorderColor" | "borderSides" | "inputSpacing" | "inputPadding" | "placeholderTextColor">) => {
|
|
11
|
+
Comp: string | import("react").ForwardRefExoticComponent<import("@radix-ui/react-slot").SlotProps & import("react").RefAttributes<HTMLElement>>;
|
|
12
|
+
inputPaddingRight: string | undefined;
|
|
13
|
+
inputPaddingLeft: string | undefined;
|
|
14
|
+
borderStyle: {
|
|
15
|
+
borderWidth: string;
|
|
16
|
+
borderTopWidth?: undefined;
|
|
17
|
+
borderBottomWidth?: undefined;
|
|
18
|
+
borderLeftWidth?: undefined;
|
|
19
|
+
borderRightWidth?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
borderTopWidth: string | number;
|
|
22
|
+
borderBottomWidth: string | number;
|
|
23
|
+
borderLeftWidth: string | number;
|
|
24
|
+
borderRightWidth: string | number;
|
|
25
|
+
borderWidth?: undefined;
|
|
26
|
+
};
|
|
27
|
+
borderRadiusStyle: {
|
|
28
|
+
borderRadius: string;
|
|
29
|
+
} | {
|
|
30
|
+
borderRadius?: undefined;
|
|
31
|
+
};
|
|
32
|
+
iconLeftPadding: string;
|
|
33
|
+
iconRightPadding: string;
|
|
34
|
+
iconTopPadding: string;
|
|
35
|
+
iconBottomPadding: string;
|
|
36
|
+
placeholderTextColorStyle: string | undefined;
|
|
37
|
+
iconColorStyle: string | undefined;
|
|
38
|
+
inputBgColor: string | undefined;
|
|
39
|
+
inputBorderColorStyle: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=useInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInput.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/useInput.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAGxD,eAAO,MAAM,iBAAiB,KAAK,CAAA;AACnC,eAAO,MAAM,iBAAiB,KAAK,CAAA;AACnC,eAAO,MAAM,iBAAiB,IAAI,CAAA;AAElC,eAAO,MAAM,aAAa;;;mFAkBzB,CAAA;AAED,eAAO,MAAM,QAAQ,UAAW,KAAK,UAAU,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,WAAW,GAAG,iBAAiB,GAAG,cAAc,GAAG,kBAAkB,GAAG,aAAa,GAAG,cAAc,GAAG,cAAc,GAAG,sBAAsB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkErP,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { getColor } from "../../../lib/utils";
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
export const DEFAULT_ICON_SIZE = 20;
|
|
5
|
+
export const DEFAULT_X_PADDING = 12;
|
|
6
|
+
export const DEFAULT_Y_PADDING = 8;
|
|
7
|
+
export const inputVariants = cva("flex w-full border border-coreColors-dividingLines bg-coreColors-inputBackground text-textColors-primaryColor text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-textColors-secondaryColor focus-visible:outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 focus:border-coreColors-brandColorPrimary peer data-[icon=true]:pr-10", {
|
|
8
|
+
variants: {
|
|
9
|
+
hasLabel: {
|
|
10
|
+
true: "h-14 px-4 rounded pt-5 pb-2 placeholder-shown:p-4",
|
|
11
|
+
false: "pl-10 pr-4 py-2",
|
|
12
|
+
},
|
|
13
|
+
error: {
|
|
14
|
+
true: "border-stateColors-error text-stateColors-error placeholder:text-stateColors-error focus:border-stateColors-error [&+label]:text-stateColors-error",
|
|
15
|
+
false: "",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
error: false,
|
|
20
|
+
hasLabel: true,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
export const useInput = (props) => {
|
|
24
|
+
const { asChild, icon, iconPosition = "right", // Default to "right" for backward compatibility
|
|
25
|
+
iconColor, placeholderTextColor, backgroundColor, borderRadius, inputBorderColor, borderSides = ["all"], inputPadding, inputSpacing = DEFAULT_X_PADDING, } = props;
|
|
26
|
+
const Comp = asChild ? Slot : "div";
|
|
27
|
+
const inputPaddingRight = icon && iconPosition === "right" ? (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.right) ? `${inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.right}px` : "2.5rem" : undefined;
|
|
28
|
+
const inputPaddingLeft = icon && iconPosition === "left"
|
|
29
|
+
? (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.left) !== undefined && inputSpacing
|
|
30
|
+
? `calc(${(inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.left) + inputSpacing + DEFAULT_ICON_SIZE}px)`
|
|
31
|
+
: (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.left)
|
|
32
|
+
? `calc(${(inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.left) + DEFAULT_ICON_SIZE + DEFAULT_Y_PADDING}px)`
|
|
33
|
+
: inputSpacing
|
|
34
|
+
? `calc(${inputSpacing + DEFAULT_X_PADDING + DEFAULT_ICON_SIZE}px)`
|
|
35
|
+
: `calc(${DEFAULT_Y_PADDING + DEFAULT_X_PADDING + DEFAULT_ICON_SIZE}px)`
|
|
36
|
+
: undefined;
|
|
37
|
+
const borderStyle = borderSides.includes("all")
|
|
38
|
+
? { borderWidth: "1px" }
|
|
39
|
+
: {
|
|
40
|
+
borderTopWidth: borderSides.includes("top") ? "1px" : 0,
|
|
41
|
+
borderBottomWidth: borderSides.includes("bottom") ? "1px" : 0,
|
|
42
|
+
borderLeftWidth: borderSides.includes("left") ? "1px" : 0,
|
|
43
|
+
borderRightWidth: borderSides.includes("right") ? "1px" : 0,
|
|
44
|
+
};
|
|
45
|
+
const borderRadiusStyle = borderRadius ? { borderRadius: `${borderRadius}px` } : {};
|
|
46
|
+
const iconLeftPadding = (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.left) !== undefined ? `${inputPadding.left}px` : `${DEFAULT_X_PADDING}px`;
|
|
47
|
+
const iconRightPadding = (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.right) !== undefined ? `${inputPadding.right}px` : `${DEFAULT_X_PADDING}px`;
|
|
48
|
+
const iconTopPadding = (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.top) !== undefined ? `${inputPadding.top}px` : `${DEFAULT_Y_PADDING}px`;
|
|
49
|
+
const iconBottomPadding = (inputPadding === null || inputPadding === void 0 ? void 0 : inputPadding.bottom) !== undefined ? `${inputPadding.bottom}px` : `${DEFAULT_Y_PADDING}px`;
|
|
50
|
+
const iconColorStyle = getColor(iconColor);
|
|
51
|
+
const inputBgColor = getColor(backgroundColor);
|
|
52
|
+
const inputBorderColorStyle = getColor(inputBorderColor);
|
|
53
|
+
const placeholderTextColorStyle = getColor(placeholderTextColor);
|
|
54
|
+
return {
|
|
55
|
+
Comp,
|
|
56
|
+
inputPaddingRight,
|
|
57
|
+
inputPaddingLeft,
|
|
58
|
+
borderStyle,
|
|
59
|
+
borderRadiusStyle,
|
|
60
|
+
iconLeftPadding,
|
|
61
|
+
iconRightPadding,
|
|
62
|
+
iconTopPadding,
|
|
63
|
+
iconBottomPadding,
|
|
64
|
+
placeholderTextColorStyle,
|
|
65
|
+
iconColorStyle,
|
|
66
|
+
inputBgColor,
|
|
67
|
+
inputBorderColorStyle,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -10,6 +10,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
10
10
|
icon?: string;
|
|
11
11
|
labelClassName?: string;
|
|
12
12
|
labelStyle?: React.CSSProperties | undefined;
|
|
13
|
+
iconColor?: string;
|
|
13
14
|
}
|
|
14
15
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
16
|
export { Button, buttonVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;mFAgCnB,CAAA;AAwCD,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,QAAA,MAAM,cAAc;;;mFAgCnB,CAAA;AAwCD,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,MAAM,uFAuEX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -79,13 +79,13 @@ const labelVariants = cva("truncate", {
|
|
|
79
79
|
},
|
|
80
80
|
});
|
|
81
81
|
const Button = React.forwardRef((_a, ref) => {
|
|
82
|
-
var { className, labelClassName, labelStyle, variant, size, asChild = false, loading, icon } = _a, props = __rest(_a, ["className", "labelClassName", "labelStyle", "variant", "size", "asChild", "loading", "icon"]);
|
|
82
|
+
var { className, labelClassName, labelStyle, variant, size, asChild = false, loading, icon, iconColor } = _a, props = __rest(_a, ["className", "labelClassName", "labelStyle", "variant", "size", "asChild", "loading", "icon", "iconColor"]);
|
|
83
83
|
const Comp = asChild ? Slot : "button";
|
|
84
84
|
const IconButton = () => (icon ? _jsx(Icon, { name: icon, size: "sm" }) : null);
|
|
85
|
-
const BasicButton = () => (_jsxs(_Fragment, { children: [icon ? (_jsx(Icon, { name: icon, size: variant === "quickadd" ? "xs" : "sm", className: cn(iconVariants({ variant }), "mr-2") })) : null, !loading ? (_jsx(Text, Object.assign({ type: "body-primary", className: cn(labelVariants({ variant }), labelClassName), style: labelStyle }, { children: props.children }))) : (_jsx(_Fragment, {}))] }));
|
|
85
|
+
const BasicButton = () => (_jsxs(_Fragment, { children: [icon ? (_jsx(Icon, { name: icon, size: variant === "quickadd" ? "xs" : "sm", className: cn(iconVariants({ variant }), "mr-2"), style: { color: iconColor } })) : null, !loading ? (_jsx(Text, Object.assign({ type: "body-primary", className: cn(labelVariants({ variant }), labelClassName), style: labelStyle }, { children: props.children }))) : (_jsx(_Fragment, {}))] }));
|
|
86
86
|
return (_jsx(Comp, Object.assign({ className: cn(buttonVariants({ variant, size }), className, {
|
|
87
87
|
"pointer-events-none": loading,
|
|
88
|
-
}), 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, {})) })));
|
|
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", style: { color: iconColor } }) }))) : size === "icon" ? (_jsx(IconButton, {})) : (_jsx(BasicButton, {})) })));
|
|
89
89
|
});
|
|
90
90
|
Button.displayName = "Button";
|
|
91
91
|
export { Button, buttonVariants };
|
|
@@ -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,EA8BhB,MAAM,qBAAqB,CAAA;AAI5B,QAAA,MAAM,YAAY;;;mFAgBjB,CAAA;AAkDD,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, IconChevronRight, IconEyeOff, IconSquareX, IconCircle, IconChevronDown, IconHeartFilled, IconCurrencyDollar, IconX, IconCircleOff, IconCircleDotFilled, IconMoodSad, IconSquareXFilled, IconTrash, IconLoader2, } 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, IconSearch, } 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: {
|
|
@@ -70,6 +70,7 @@ const icons = {
|
|
|
70
70
|
"square-x-filled": IconSquareXFilled,
|
|
71
71
|
trash: IconTrash,
|
|
72
72
|
loader: IconLoader2,
|
|
73
|
+
"search": IconSearch
|
|
73
74
|
};
|
|
74
75
|
function Icon(_a) {
|
|
75
76
|
var { className, name, size = "md", color } = _a, props = __rest(_a, ["className", "name", "size", "color"]);
|
|
@@ -54,6 +54,9 @@ type TapcartImageBaseProps = {
|
|
|
54
54
|
* "fill" maps to `object-fit: cover`
|
|
55
55
|
*/
|
|
56
56
|
objectFit?: "fit" | "fill" | "cover" | "contain" | "none" | "scale-down";
|
|
57
|
+
/** An optional prop to set styles for the image wrapper
|
|
58
|
+
*/
|
|
59
|
+
imageWrapperStyles?: any;
|
|
57
60
|
};
|
|
58
61
|
/**
|
|
59
62
|
* Tapcart’s Image component is a wrapper around the HTML image element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM1D,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAUD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,MAAM,CAAA;AAKrD,KAAK,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,GAChE,qBAAqB,CAAA;AAEvB,KAAK,qBAAqB,GAAG;IAC3B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE;QAAE,iBAAiB,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;IAC1D;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qFAAqF;IACrF,aAAa,CAAC,EAAE,aAAa,CAAA;IAE7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../components/ui/image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM1D,KAAK,aAAa,GAAG;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAUD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,MAAM,CAAA;AAKrD,KAAK,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,qBAAqB,CAAC,KAAK,CAAC,GAChE,qBAAqB,CAAA;AAEvB,KAAK,qBAAqB,GAAG;IAC3B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,IAAI,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE;QAAE,iBAAiB,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;IAC1D;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qFAAqF;IACrF,aAAa,CAAC,EAAE,aAAa,CAAA;IAE7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAA;IAExE;OACG;IACH,kBAAkB,CAAC,EAAE,GAAG,CAAA;CACzB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,KAAK,yGAuKjB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,GACZ,EAAE,YAAY,UAiBd;AAiED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,GAAG,CAAC,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,KAAK,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,EACpE,MAAM,GAAE,MAAsB,EAC9B,WAAW,UAAQ,GAClB,MAAM,CAiBR;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,6BAA0B,EAC/B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAUV;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,IAAI,GAAE,IAAe,GAEnB;IACE,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,IAAI,CAAA;CACX,EAAE,GACH,SAAS,CAUZ"}
|
|
@@ -49,12 +49,12 @@ import * as React from "react";
|
|
|
49
49
|
*/
|
|
50
50
|
export const Image = React.forwardRef((_a, ref) => {
|
|
51
51
|
var _b;
|
|
52
|
-
var { alt, aspectRatio, crop = "center", data, decoding = "async", height = "auto", loader = shopifyLoader, loading = "lazy", sizes, src, srcSetOptions = {
|
|
52
|
+
var { alt, aspectRatio, crop = "center", data, decoding = "async", height = "auto", loader = shopifyLoader, loading = "lazy", sizes, src, imageWrapperStyles, srcSetOptions = {
|
|
53
53
|
intervals: 15,
|
|
54
54
|
startingWidth: 100,
|
|
55
55
|
incrementSize: 100,
|
|
56
56
|
placeholderWidth: 100,
|
|
57
|
-
}, width = "100%", objectFit = "cover" } = _a, passthroughProps = __rest(_a, ["alt", "aspectRatio", "crop", "data", "decoding", "height", "loader", "loading", "sizes", "src", "srcSetOptions", "width", "objectFit"]);
|
|
57
|
+
}, width = "100%", objectFit = "cover" } = _a, passthroughProps = __rest(_a, ["alt", "aspectRatio", "crop", "data", "decoding", "height", "loader", "loading", "sizes", "src", "imageWrapperStyles", "srcSetOptions", "width", "objectFit"]);
|
|
58
58
|
/*
|
|
59
59
|
* Gets normalized values for width, height from data prop
|
|
60
60
|
*/
|
|
@@ -135,9 +135,7 @@ export const Image = React.forwardRef((_a, ref) => {
|
|
|
135
135
|
setHasError(true);
|
|
136
136
|
};
|
|
137
137
|
const imgClassName = `opacity-0 transition-opacity duration-500 ease-in-out ${isLoaded ? "opacity-100" : ""}`;
|
|
138
|
-
const wrapperStyle = {
|
|
139
|
-
aspectRatio: (_b = normalizedProps.aspectRatio) === null || _b === void 0 ? void 0 : _b.replace(":", "/"),
|
|
140
|
-
};
|
|
138
|
+
const wrapperStyle = Object.assign({ aspectRatio: (_b = normalizedProps.aspectRatio) === null || _b === void 0 ? void 0 : _b.replace(":", "/") }, imageWrapperStyles);
|
|
141
139
|
return (_jsx("div", Object.assign({ className: "relative bg-stateColors-skeleton border-transparent", style: wrapperStyle }, { children: !hasError && normalizedProps.src ? (_jsx("img", Object.assign({ ref: ref, alt: normalizedProps.alt, decoding: decoding, height: normalizedProps.height, loading: loading, src: normalizedProps.src, srcSet: generateSrcSet(normalizedProps.src, generateSizes(imageWidths, normalizedProps.aspectRatio, crop), loader, normalizedProps.objectFit === "contain"), width: normalizedProps.width, className: imgClassName, onLoad: handleImageLoad, onError: handleImageError, sizes: sizes, style: {
|
|
142
140
|
objectFit: normalizedProps.objectFit,
|
|
143
141
|
maxHeight: "100%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../components/ui/money.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,aAAa,gGAMjB,CAAA;AAEF,MAAM,WAAW,UACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../components/ui/money.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,aAAa,gGAMjB,CAAA;AAEF,MAAM,WAAW,UACf,SAAQ,SAAS,EACf,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAS/D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -23,6 +23,7 @@ function Money(_a) {
|
|
|
23
23
|
const formatter = new Intl.NumberFormat(locale, {
|
|
24
24
|
style: "currency",
|
|
25
25
|
currency: currency,
|
|
26
|
+
currencyDisplay: "narrowSymbol",
|
|
26
27
|
});
|
|
27
28
|
let formattedPrice = formatter.format(Number(price));
|
|
28
29
|
return _jsx("span", Object.assign({}, props, { children: formattedPrice }));
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
16
16
|
import { cn } from "../../lib/utils";
|
|
17
|
-
import { Input } from "./
|
|
17
|
+
import { Input } from "./Input";
|
|
18
18
|
const Slider = React.forwardRef((_a, ref) => {
|
|
19
19
|
var { className, max, min = 0, step = 1, defaultValue, value, onChange } = _a,
|
|
20
20
|
// doubleValue = false,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./components/ui/button";
|
|
2
|
-
export * from "./components/ui/input";
|
|
2
|
+
export * from "./components/ui/Input/input";
|
|
3
3
|
export * from "./components/ui/aspect-ratio";
|
|
4
4
|
export * from "./components/ui/accordion";
|
|
5
5
|
export * from "./components/ui/icon";
|
|
@@ -32,14 +32,13 @@ export * from "./components/ui/favorite";
|
|
|
32
32
|
export * from "./components/ui/wishlist";
|
|
33
33
|
export * from "./components/ui/product-card";
|
|
34
34
|
export * from "./components/ui/dropdown";
|
|
35
|
-
export * from "./components/ui/product-grid";
|
|
36
35
|
export * from "./components/ui/quantity-picker";
|
|
37
36
|
export * from "./components/hooks/use-infinite-scroll";
|
|
38
37
|
export * from "./components/ui/subscription";
|
|
39
38
|
export * from "./components/ui/line-item-text-icons";
|
|
40
39
|
export * from "./components/ui/textarea";
|
|
41
40
|
export * from "./components/hooks/use-scroll-direction";
|
|
41
|
+
export { cn, cva, getColor } from "./lib/utils";
|
|
42
42
|
export * from "./components/ui/image";
|
|
43
43
|
export * from "./components/ui/empty-message";
|
|
44
|
-
export { cn, cva } from "./lib/utils";
|
|
45
44
|
//# 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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;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,iCAAiC,CAAA;AAC/C,cAAc,wCAAwC,CAAA;AACtD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sCAAsC,CAAA;AACpD,cAAc,0BAA0B,CAAA;AACxC,cAAc,yCAAyC,CAAA;AACvD,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// component exports
|
|
2
2
|
export * from "./components/ui/button";
|
|
3
|
-
export * from "./components/ui/input";
|
|
3
|
+
export * from "./components/ui/Input/input";
|
|
4
4
|
export * from "./components/ui/aspect-ratio";
|
|
5
5
|
export * from "./components/ui/accordion";
|
|
6
6
|
export * from "./components/ui/icon";
|
|
@@ -33,13 +33,12 @@ export * from "./components/ui/favorite";
|
|
|
33
33
|
export * from "./components/ui/wishlist";
|
|
34
34
|
export * from "./components/ui/product-card";
|
|
35
35
|
export * from "./components/ui/dropdown";
|
|
36
|
-
export * from "./components/ui/product-grid";
|
|
37
36
|
export * from "./components/ui/quantity-picker";
|
|
38
37
|
export * from "./components/hooks/use-infinite-scroll";
|
|
39
38
|
export * from "./components/ui/subscription";
|
|
40
39
|
export * from "./components/ui/line-item-text-icons";
|
|
41
40
|
export * from "./components/ui/textarea";
|
|
42
41
|
export * from "./components/hooks/use-scroll-direction";
|
|
42
|
+
export { cn, cva, getColor } from "./lib/utils";
|
|
43
43
|
export * from "./components/ui/image";
|
|
44
44
|
export * from "./components/ui/empty-message";
|
|
45
|
-
export { cn, cva } from "./lib/utils";
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ClassValue } from "clsx";
|
|
2
|
+
export type Color = {
|
|
3
|
+
type: "custom" | "brand-kit";
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
2
6
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
7
|
export declare const iconColorLevels: string[];
|
|
4
8
|
export declare const iconColorVariantClasses: Record<string, string>;
|
|
5
9
|
export { cva } from "class-variance-authority";
|
|
10
|
+
export declare const getColor: (colorOption: Color | undefined) => string | undefined;
|
|
6
11
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAA;AAGvC,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,eAAO,MAAM,eAAe,UAc3B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAA;AAMjE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAA;AAGvC,MAAM,MAAM,KAAK,GAAG;IAAE,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,eAAO,MAAM,eAAe,UAc3B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAA;AAMjE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAA;AAG9C,eAAO,MAAM,QAAQ,gBAAiB,KAAK,GAAG,SAAS,uBAEtD,CAAC"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -23,3 +23,6 @@ for (let iconColorLevel of iconColorLevels) {
|
|
|
23
23
|
iconColorVariantClasses[iconColorLevel] = `text-${iconColorLevel}`;
|
|
24
24
|
}
|
|
25
25
|
export { cva } from "class-variance-authority";
|
|
26
|
+
export const getColor = (colorOption) => {
|
|
27
|
+
return colorOption ? (colorOption === null || colorOption === void 0 ? void 0 : colorOption.type) === 'brand-kit' ? `var(--${colorOption.value})` : colorOption.value : undefined;
|
|
28
|
+
};
|
package/dist/styles.css
CHANGED
|
@@ -728,6 +728,9 @@ video {
|
|
|
728
728
|
.right-2 {
|
|
729
729
|
right: 0.5rem;
|
|
730
730
|
}
|
|
731
|
+
.start-10 {
|
|
732
|
+
inset-inline-start: 2.5rem;
|
|
733
|
+
}
|
|
731
734
|
.start-4 {
|
|
732
735
|
inset-inline-start: 1rem;
|
|
733
736
|
}
|
|
@@ -842,9 +845,6 @@ video {
|
|
|
842
845
|
.grid {
|
|
843
846
|
display: grid;
|
|
844
847
|
}
|
|
845
|
-
.aspect-\[2\/3\] {
|
|
846
|
-
aspect-ratio: 2/3;
|
|
847
|
-
}
|
|
848
848
|
.aspect-productImages {
|
|
849
849
|
aspect-ratio: var(--productImage-aspectRatio);
|
|
850
850
|
}
|
|
@@ -1317,10 +1317,6 @@ video {
|
|
|
1317
1317
|
.bg-coreColors-pageColor {
|
|
1318
1318
|
background-color: var(--coreColors-pageColor);
|
|
1319
1319
|
}
|
|
1320
|
-
.bg-neutral-100 {
|
|
1321
|
-
--tw-bg-opacity: 1;
|
|
1322
|
-
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
1323
|
-
}
|
|
1324
1320
|
.bg-productBadging-fill {
|
|
1325
1321
|
background-color: var(--productBadging-fill);
|
|
1326
1322
|
}
|
|
@@ -1442,6 +1438,9 @@ video {
|
|
|
1442
1438
|
.pl-0 {
|
|
1443
1439
|
padding-left: 0px;
|
|
1444
1440
|
}
|
|
1441
|
+
.pl-10 {
|
|
1442
|
+
padding-left: 2.5rem;
|
|
1443
|
+
}
|
|
1445
1444
|
.pl-2 {
|
|
1446
1445
|
padding-left: 0.5rem;
|
|
1447
1446
|
}
|
|
@@ -1776,6 +1775,9 @@ video {
|
|
|
1776
1775
|
--tw-drop-shadow: drop-shadow(0 3px 1px 0 rgba(0,0,0,1));
|
|
1777
1776
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
1778
1777
|
}
|
|
1778
|
+
.\!filter {
|
|
1779
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;
|
|
1780
|
+
}
|
|
1779
1781
|
.filter {
|
|
1780
1782
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
1781
1783
|
}
|
|
@@ -2212,10 +2214,6 @@ video {
|
|
|
2212
2214
|
.data-\[state\=open\]\:duration-500[data-state=open] {
|
|
2213
2215
|
animation-duration: 500ms;
|
|
2214
2216
|
}
|
|
2215
|
-
:is(.dark .dark\:bg-neutral-900) {
|
|
2216
|
-
--tw-bg-opacity: 1;
|
|
2217
|
-
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
|
|
2218
|
-
}
|
|
2219
2217
|
@media (min-width: 640px) {
|
|
2220
2218
|
|
|
2221
2219
|
.sm\:mt-0 {
|
|
@@ -2244,12 +2242,6 @@ video {
|
|
|
2244
2242
|
text-align: left;
|
|
2245
2243
|
}
|
|
2246
2244
|
}
|
|
2247
|
-
@media (min-width: 1024px) {
|
|
2248
|
-
|
|
2249
|
-
.lg\:grid-cols-3 {
|
|
2250
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
2245
|
.\[\&\+label\]\:text-stateColors-error+label {
|
|
2254
2246
|
color: var(--stateColors-error);
|
|
2255
2247
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -11,16 +11,6 @@
|
|
|
11
11
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
12
|
"author": "Tapcart Inc.",
|
|
13
13
|
"homepage": "https://tapcart.com",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"lint": "eslint \"**/*.ts*\"",
|
|
16
|
-
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
17
|
-
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
18
|
-
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
19
|
-
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
20
|
-
"dev:ts": "tsc -w -p tsconfig.json",
|
|
21
|
-
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
22
|
-
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
|
|
23
|
-
},
|
|
24
14
|
"peerDependencies": {
|
|
25
15
|
"react": "^17.0.2 || ^18.0.0",
|
|
26
16
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
@@ -29,17 +19,17 @@
|
|
|
29
19
|
"@types/lodash": "4.17.5",
|
|
30
20
|
"@types/react": "^18.2.0",
|
|
31
21
|
"@types/react-dom": "^18.2.0",
|
|
32
|
-
"app-studio-types": "workspace:*",
|
|
33
22
|
"autoprefixer": "^10.4.14",
|
|
34
23
|
"chokidar-cli": "^3.0.0",
|
|
35
24
|
"concurrently": "^8.2.2",
|
|
36
25
|
"eslint": "^7.32.0",
|
|
37
|
-
"eslint-config-custom": "workspace:*",
|
|
38
26
|
"postcss": "^8.4.24",
|
|
39
27
|
"tailwindcss": "^3.3.2",
|
|
40
28
|
"tsc-alias": "^1.8.10",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
29
|
+
"typescript": "^4.5.2",
|
|
30
|
+
"eslint-config-custom": "0.0.0",
|
|
31
|
+
"tsconfig": "0.0.0",
|
|
32
|
+
"app-studio-types": "0.0.0"
|
|
43
33
|
},
|
|
44
34
|
"dependencies": {
|
|
45
35
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -71,5 +61,15 @@
|
|
|
71
61
|
"tailwind-merge": "^1.13.2",
|
|
72
62
|
"tailwindcss-animate": "^1.0.6",
|
|
73
63
|
"vaul": "^0.9.1"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
67
|
+
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
68
|
+
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
69
|
+
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
70
|
+
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
71
|
+
"dev:ts": "tsc -w -p tsconfig.json",
|
|
72
|
+
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
73
|
+
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\""
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|