@tapcart/mobile-components 0.7.13 → 0.7.15
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/contexts/translation-context.d.ts +13 -0
- package/dist/components/contexts/translation-context.d.ts.map +1 -0
- package/dist/components/contexts/translation-context.js +12 -0
- package/dist/components/hooks/use-click-outside.d.ts +3 -0
- package/dist/components/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/components/hooks/use-click-outside.js +16 -0
- package/dist/components/hooks/use-outside-click.d.ts +4 -0
- package/dist/components/hooks/use-outside-click.d.ts.map +1 -0
- package/dist/components/hooks/use-outside-click.js +16 -0
- package/dist/components/hooks/use-products.d.ts.map +1 -1
- package/dist/components/hooks/use-products.js +6 -0
- package/dist/components/ui/money.d.ts +2 -1
- package/dist/components/ui/money.d.ts.map +1 -1
- package/dist/components/ui/money.js +8 -4
- package/dist/components/ui/price.d.ts +2 -1
- package/dist/components/ui/price.d.ts.map +1 -1
- package/dist/components/ui/price.js +3 -3
- package/dist/components/ui/text.d.ts +2 -1
- package/dist/components/ui/text.d.ts.map +1 -1
- package/dist/components/ui/text.js +10 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +3 -0
- package/package.json +18 -18
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type TranslationMap = Record<string, string>;
|
|
3
|
+
export declare const TranslationProvider: ({ translations, children, }: {
|
|
4
|
+
translations: TranslationMap;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const useTranslation: () => TranslationMap;
|
|
8
|
+
export declare const getTextTranslation: ({ text, translations, }: {
|
|
9
|
+
text: string;
|
|
10
|
+
translations: Record<string, string>;
|
|
11
|
+
}) => string | undefined;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=translation-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-context.d.ts","sourceRoot":"","sources":["../../../components/contexts/translation-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAExD,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAI5C,eAAO,MAAM,mBAAmB;kBAIhB,cAAc;cAClB,MAAM,SAAS;6CAK1B,CAAA;AAED,eAAO,MAAM,cAAc,sBAAuC,CAAA;AAElE,eAAO,MAAM,kBAAkB;UAIvB,MAAM;kBACE,OAAO,MAAM,EAAE,MAAM,CAAC;wBAMrC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
const TranslationContext = createContext({});
|
|
5
|
+
export const TranslationProvider = ({ translations, children, }) => (_jsx(TranslationContext.Provider, Object.assign({ value: translations }, { children: children })));
|
|
6
|
+
export const useTranslation = () => useContext(TranslationContext);
|
|
7
|
+
export const getTextTranslation = ({ text, translations, }) => {
|
|
8
|
+
const key = text.trim().toLowerCase();
|
|
9
|
+
if (!(key in translations))
|
|
10
|
+
return undefined;
|
|
11
|
+
return translations[key];
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-click-outside.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-click-outside.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAE,IAAI,CAa5F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export function useClickOutside(ref, callback) {
|
|
4
|
+
React.useEffect(() => {
|
|
5
|
+
const handleClickOutside = (event) => {
|
|
6
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
7
|
+
callback();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
11
|
+
return () => {
|
|
12
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
13
|
+
};
|
|
14
|
+
}, [ref, callback]);
|
|
15
|
+
}
|
|
16
|
+
;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-outside-click.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-outside-click.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,eAAe,QAAS,MAAM,SAAS,CAAC,WAAW,CAAC,YAAY,MAAM,IAAI,SAa/E,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const useClickOutside = (ref, callback) => {
|
|
4
|
+
React.useEffect(() => {
|
|
5
|
+
const handleClickOutside = (event) => {
|
|
6
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
7
|
+
callback();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
11
|
+
return () => {
|
|
12
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
13
|
+
};
|
|
14
|
+
}, [ref, callback]);
|
|
15
|
+
};
|
|
16
|
+
export default useClickOutside;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-products.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-products.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAG1C,KAAK,GAAG,GAAG,MAAM,CAAA;AACjB,KAA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AAA;IACpC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1E,UAAU,CAAC,EAAE,cAAc,EAAE,CAAA;CAC9B,CAAA;AACD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,KAAK,EAAE,GAAG,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,iBAAiB,CAiE7E"}
|
|
@@ -22,6 +22,12 @@ export function useProducts(props) {
|
|
|
22
22
|
body = queryVariables || {};
|
|
23
23
|
}
|
|
24
24
|
if ((productIds === null || productIds === void 0 ? void 0 : productIds.length) || (productHandles === null || productHandles === void 0 ? void 0 : productHandles.length)) {
|
|
25
|
+
if (queryVariables === null || queryVariables === void 0 ? void 0 : queryVariables.country) {
|
|
26
|
+
queryParams.set("country", queryVariables.country);
|
|
27
|
+
}
|
|
28
|
+
if (queryVariables === null || queryVariables === void 0 ? void 0 : queryVariables.language) {
|
|
29
|
+
queryParams.set("language", queryVariables.language);
|
|
30
|
+
}
|
|
25
31
|
url = `${baseURL}/products/by-ids?${queryParams.toString()}`;
|
|
26
32
|
}
|
|
27
33
|
}
|
|
@@ -7,8 +7,9 @@ interface MoneyType {
|
|
|
7
7
|
}
|
|
8
8
|
declare const moneyVariants: (props?: ({} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
9
9
|
export interface MoneyProps extends MoneyType, VariantProps<typeof moneyVariants> {
|
|
10
|
+
hideZeroCents?: boolean;
|
|
10
11
|
styles?: React.CSSProperties;
|
|
11
12
|
}
|
|
12
|
-
declare function Money({ price, locale, currency, styles, ...props }: MoneyProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function Money({ price, locale, currency, hideZeroCents, styles, ...props }: MoneyProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export { Money, moneyVariants };
|
|
14
15
|
//# sourceMappingURL=money.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../components/ui/money.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,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;IAChC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC7B;AAEL,iBAAS,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../components/ui/money.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,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;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC7B;AAEL,iBAAS,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAqB,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAc9F;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -10,6 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
13
14
|
import { cva } from "class-variance-authority";
|
|
14
15
|
const moneyVariants = cva("", {
|
|
15
16
|
variants: {},
|
|
@@ -19,13 +20,16 @@ const moneyVariants = cva("", {
|
|
|
19
20
|
},
|
|
20
21
|
});
|
|
21
22
|
function Money(_a) {
|
|
22
|
-
var { price, locale, currency, styles } = _a, props = __rest(_a, ["price", "locale", "currency", "styles"]);
|
|
23
|
-
const formatter = new Intl.NumberFormat(locale, {
|
|
23
|
+
var { price, locale, currency, hideZeroCents = false, styles } = _a, props = __rest(_a, ["price", "locale", "currency", "hideZeroCents", "styles"]);
|
|
24
|
+
const formatter = React.useMemo(() => new Intl.NumberFormat(locale, {
|
|
24
25
|
style: "currency",
|
|
25
26
|
currency: currency,
|
|
26
27
|
currencyDisplay: "narrowSymbol",
|
|
27
|
-
});
|
|
28
|
-
|
|
28
|
+
}), [locale, currency]);
|
|
29
|
+
const formattedPrice = React.useMemo(() => {
|
|
30
|
+
const formatted = formatter.format(Number(price));
|
|
31
|
+
return hideZeroCents ? formatted.replace(/(\.|,)00$/, '') : formatted;
|
|
32
|
+
}, [formatter, price, hideZeroCents]);
|
|
29
33
|
return _jsx("span", Object.assign({}, props, { style: styles }, { children: formattedPrice }));
|
|
30
34
|
}
|
|
31
35
|
export { Money, moneyVariants };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface PriceProps {
|
|
3
|
+
hideZeroCents?: boolean;
|
|
3
4
|
price: number;
|
|
4
5
|
priceHigh?: number;
|
|
5
6
|
priceRanges?: boolean;
|
|
@@ -14,6 +15,6 @@ interface PriceProps {
|
|
|
14
15
|
saleStyles?: React.CSSProperties;
|
|
15
16
|
strikeThroughStyles?: React.CSSProperties;
|
|
16
17
|
}
|
|
17
|
-
declare function Price({ price, priceHigh, priceRanges, isSale, compareAtPrice, compareAtPriceHigh, currency, locale, fontSize, textAlignment, standardStyles, saleStyles, strikeThroughStyles, }: PriceProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function Price({ price, priceHigh, priceRanges, isSale, compareAtPrice, compareAtPriceHigh, currency, locale, fontSize, textAlignment, standardStyles, saleStyles, strikeThroughStyles, hideZeroCents }: PriceProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export { Price };
|
|
19
20
|
//# sourceMappingURL=price.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":";AAIA,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3C;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,EACb,aAAkB,EAClB,cAAc,EACd,UAAU,EACV,mBAAmB,
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../../components/ui/price.tsx"],"names":[],"mappings":";AAIA,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC;IACjD,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3C;AAED,iBAAS,KAAK,CAAC,EACb,KAAK,EACL,SAAS,EACT,WAAmB,EACnB,MAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAgB,EAChB,MAAgB,EAChB,QAAa,EACb,aAAkB,EAClB,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,aAAa,EACd,EAAE,UAAU,2CAoEZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -2,17 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Money } from "./money";
|
|
3
3
|
import { Text } from "./text";
|
|
4
4
|
import { cn } from "../../lib/utils";
|
|
5
|
-
function Price({ price, priceHigh, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", fontSize = 15, textAlignment = '', standardStyles, saleStyles, strikeThroughStyles, }) {
|
|
5
|
+
function Price({ price, priceHigh, priceRanges = false, isSale = false, compareAtPrice, compareAtPriceHigh, currency = "USD", locale = "en-US", fontSize = 15, textAlignment = '', standardStyles, saleStyles, strikeThroughStyles, hideZeroCents }) {
|
|
6
6
|
const Spacer = () => (_jsx("span", { children: " - " }));
|
|
7
7
|
const ProductPrice = () => {
|
|
8
8
|
const priceStyles = (!isSale || !compareAtPrice) ? standardStyles : saleStyles;
|
|
9
9
|
const colorClass = isSale ? 'text-textColors-salePriceText' : 'text-textColors-priceText';
|
|
10
|
-
return (_jsx(Text, Object.assign({ className: `${colorClass} flex-shrink-0`, style: { fontSize: `${fontSize}px` } }, { children: _jsxs("span", Object.assign({ className: "flex-grow min-w-[fit-content]" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale, styles: priceStyles }), priceRanges && priceHigh !== undefined && _jsx(Spacer, {}), priceRanges && priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale, styles: priceStyles }))] })) })));
|
|
10
|
+
return (_jsx(Text, Object.assign({ className: `${colorClass} flex-shrink-0`, style: { fontSize: `${fontSize}px` } }, { children: _jsxs("span", Object.assign({ className: "flex-grow min-w-[fit-content]" }, { children: [_jsx(Money, { price: price, currency: currency, locale: locale, styles: priceStyles, hideZeroCents: hideZeroCents }), priceRanges && priceHigh !== undefined && _jsx(Spacer, {}), priceRanges && priceHigh !== undefined && (_jsx(Money, { price: priceHigh, currency: currency, locale: locale, styles: priceStyles, hideZeroCents: hideZeroCents }))] })) })));
|
|
11
11
|
};
|
|
12
12
|
const StrikeThroughPrice = () => {
|
|
13
13
|
if (!isSale || !compareAtPrice)
|
|
14
14
|
return null;
|
|
15
|
-
return (_jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0 flex items-center", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale, styles: strikeThroughStyles }), priceRanges && compareAtPriceHigh && _jsx(Spacer, {}), priceRanges && compareAtPriceHigh && (_jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale, styles: strikeThroughStyles }))] })));
|
|
15
|
+
return (_jsxs(Text, Object.assign({ className: "line-through text-textColors-strikethroughPriceText flex-shrink-0 flex items-center", style: { fontSize: `${fontSize}px` } }, { children: [_jsx(Money, { price: compareAtPrice, currency: currency, locale: locale, styles: strikeThroughStyles, hideZeroCents: hideZeroCents }), priceRanges && compareAtPriceHigh && _jsx(Spacer, {}), priceRanges && compareAtPriceHigh && (_jsx(Money, { price: compareAtPriceHigh, currency: currency, locale: locale, styles: strikeThroughStyles, hideZeroCents: hideZeroCents }))] })));
|
|
16
16
|
};
|
|
17
17
|
return (_jsxs("div", Object.assign({ className: cn("flex flex-wrap gap-x-2", { "justify-start": textAlignment === "left" }, { "justify-end": textAlignment === "right" }, { "justify-center": textAlignment === "center" }) }, { children: [_jsx(ProductPrice, {}), _jsx(StrikeThroughPrice, {})] })));
|
|
18
18
|
}
|
|
@@ -5,7 +5,8 @@ declare const textVariants: (props?: ({
|
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface TextProps extends React.HTMLAttributes<HTMLParagraphElement>, VariantProps<typeof textVariants> {
|
|
7
7
|
fontColor?: string | null;
|
|
8
|
+
children?: React.ReactNode;
|
|
8
9
|
}
|
|
9
|
-
declare function Text({ className, type, fontColor, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Text({ className, type, fontColor, children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export { Text, textVariants };
|
|
11
12
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAOjE,QAAA,MAAM,YAAY;;mFAgBhB,CAAA;AAEF,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAChD,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAiB1E;AAED,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -10,8 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from "react";
|
|
13
14
|
import { cva } from "class-variance-authority";
|
|
14
15
|
import { cn } from "../../lib/utils";
|
|
16
|
+
import { useTranslation, getTextTranslation, } from "../contexts/translation-context";
|
|
15
17
|
const textVariants = cva("", {
|
|
16
18
|
variants: {
|
|
17
19
|
type: {
|
|
@@ -27,8 +29,14 @@ const textVariants = cva("", {
|
|
|
27
29
|
},
|
|
28
30
|
});
|
|
29
31
|
function Text(_a) {
|
|
30
|
-
var { className, type, fontColor } = _a, props = __rest(_a, ["className", "type", "fontColor"]);
|
|
32
|
+
var { className, type, fontColor, children } = _a, props = __rest(_a, ["className", "type", "fontColor", "children"]);
|
|
31
33
|
const fontColorOverride = fontColor ? { color: fontColor } : {};
|
|
32
|
-
|
|
34
|
+
const translations = useTranslation();
|
|
35
|
+
const stringContents = React.Children.toArray(children).join("");
|
|
36
|
+
const textContents = getTextTranslation({
|
|
37
|
+
text: stringContents,
|
|
38
|
+
translations,
|
|
39
|
+
});
|
|
40
|
+
return (_jsx("p", Object.assign({ className: cn(textVariants({ type }), className), style: fontColorOverride }, props, { children: textContents ? textContents : children })));
|
|
33
41
|
}
|
|
34
42
|
export { Text, textVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, isFavoriteIntegrationEnabled } from "./lib/utils";
|
|
1
|
+
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, isFavoriteIntegrationEnabled, getSpaceBetween, } from "./lib/utils";
|
|
2
|
+
export * from "./components/contexts/translation-context";
|
|
2
3
|
export * from "./components/hooks/use-collection";
|
|
3
4
|
export * from "./components/hooks/use-infinite-scroll";
|
|
4
5
|
export * from "./components/hooks/use-recommendations";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,eAAe,GAChB,MAAM,aAAa,CAAA;AACpB,cAAc,2CAA2C,CAAA;AACzD,cAAc,mCAAmC,CAAA;AACjD,cAAc,wCAAwC,CAAA;AACtD,cAAc,wCAAwC,CAAA;AACtD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,yCAAyC,CAAA;AACvD,cAAc,oCAAoC,CAAA;AAClD,cAAc,wCAAwC,CAAA;AACtD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,sBAAsB,CAAA;AACpC,cAAc,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/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// component exports
|
|
2
|
-
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, isFavoriteIntegrationEnabled } from "./lib/utils";
|
|
2
|
+
export { cn, cva, getColor, getBackgroundAndPaddingStyle, getBorderSidesStyle, getTextStyle, getVerticalAlignmentStyle, getBackgroundAndSpacingStyle, getIdFromGid, productGidFromId, variantGidFromId, getPaddingStyle, getMarginStyle, getVerticalAlignment, mapFlexToAlignment, formatRelativeTime, stringRatioToInt, getOverlayStyle, throttleFunction, getDestinationHandler, getProductGidsFromIds, createCollectionImageMap, isFavoriteIntegrationEnabled, getSpaceBetween, } from "./lib/utils";
|
|
3
|
+
export * from "./components/contexts/translation-context";
|
|
3
4
|
export * from "./components/hooks/use-collection";
|
|
4
5
|
export * from "./components/hooks/use-infinite-scroll";
|
|
5
6
|
export * from "./components/hooks/use-recommendations";
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -48,6 +48,9 @@ export declare const getVerticalAlignmentStyle: (alignmentAndSpacing: AlignmentA
|
|
|
48
48
|
top?: undefined;
|
|
49
49
|
transform?: undefined;
|
|
50
50
|
};
|
|
51
|
+
export declare const getSpaceBetween: (gap: number) => {
|
|
52
|
+
gap: string;
|
|
53
|
+
};
|
|
51
54
|
export declare const getPaddingStyle: (padding: Partial<Spacing> | undefined) => {
|
|
52
55
|
paddingTop?: undefined;
|
|
53
56
|
paddingBottom?: undefined;
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],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AAG,YAAY,GAAG,MAAM,iBAjBrC,MAAM,WAAW,kBAAkB,yBAE5C,MAAM,WAAW,kBAAkB,yBAO/B,MAAM,WAAW,kBAAkB,yBAEhC,MAAM,WAAW,kBAAkB,yBAS3D,CAAA;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,YAOlD;AAED,eAAO,MAAM,wBAAwB,gBACtB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,2BAQpE,CAAA;AAED,eAAO,MAAM,4BAA4B,yCAIxC,CAAA"}
|
package/dist/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.15",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -11,18 +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
|
-
"test": "jest",
|
|
24
|
-
"test:watch": "jest --watch"
|
|
25
|
-
},
|
|
26
14
|
"peerDependencies": {
|
|
27
15
|
"react": "^17.0.2 || ^18.0.0",
|
|
28
16
|
"react-dom": "^17.0.2 || ^18.0.0"
|
|
@@ -32,19 +20,19 @@
|
|
|
32
20
|
"@types/lodash": "4.17.5",
|
|
33
21
|
"@types/react": "^18.2.0",
|
|
34
22
|
"@types/react-dom": "^18.2.0",
|
|
35
|
-
"app-studio-types": "workspace:*",
|
|
36
23
|
"autoprefixer": "^10.4.14",
|
|
37
24
|
"chokidar-cli": "^3.0.0",
|
|
38
25
|
"concurrently": "^8.2.2",
|
|
39
26
|
"eslint": "^7.32.0",
|
|
40
|
-
"eslint-config-custom": "workspace:*",
|
|
41
27
|
"jest": "^29.7.0",
|
|
42
28
|
"postcss": "^8.4.24",
|
|
43
29
|
"tailwindcss": "^3.3.2",
|
|
44
30
|
"ts-jest": "^29.2.5",
|
|
45
31
|
"tsc-alias": "^1.8.10",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
32
|
+
"typescript": "^4.5.2",
|
|
33
|
+
"app-studio-types": "0.0.5",
|
|
34
|
+
"tsconfig": "0.0.0",
|
|
35
|
+
"eslint-config-custom": "0.0.0"
|
|
48
36
|
},
|
|
49
37
|
"dependencies": {
|
|
50
38
|
"@radix-ui/react-accordion": "^1.1.2",
|
|
@@ -80,5 +68,17 @@
|
|
|
80
68
|
"tailwind-merge": "^1.13.2",
|
|
81
69
|
"tailwindcss-animate": "^1.0.6",
|
|
82
70
|
"vaul": "0.9.1"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
74
|
+
"ui:add": "pnpm dlx shadcn-ui@latest add",
|
|
75
|
+
"build:styles": "postcss styles/globals.css -o dist/styles.css",
|
|
76
|
+
"build:ts": "tsc -p tsconfig.json && tsc-alias",
|
|
77
|
+
"build": "pnpm run build:ts && pnpm run build:styles",
|
|
78
|
+
"dev:ts": "tsc -w -p tsconfig.json",
|
|
79
|
+
"dev:styles": "npx tailwindcss -i styles/globals.css -o dist/styles.css --watch",
|
|
80
|
+
"dev": "concurrently \"pnpm run dev:ts\" \"pnpm run dev:styles\"",
|
|
81
|
+
"test": "jest",
|
|
82
|
+
"test:watch": "jest --watch"
|
|
83
83
|
}
|
|
84
|
-
}
|
|
84
|
+
}
|