@tapcart/mobile-components 0.16.3 → 0.17.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/core.d.ts +2 -0
- package/core.js +13 -0
- package/dist/components/core/icon.d.ts +37 -0
- package/dist/components/core/icon.d.ts.map +1 -0
- package/dist/components/core/icon.js +61 -0
- package/dist/components/hooks/use-search-analytics-open-product.d.ts +12 -0
- package/dist/components/hooks/use-search-analytics-open-product.d.ts.map +1 -1
- package/dist/components/hooks/use-search-analytics-open-product.js +12 -0
- package/dist/components/libs/sort-filter/custom-search.d.ts +1 -1
- package/dist/components/libs/sort-filter/custom-search.d.ts.map +1 -1
- package/dist/components/ui/Input/input.d.ts +1 -1
- package/dist/components/ui/Input/input.d.ts.map +1 -1
- package/dist/components/ui/Input/types.d.ts +1 -1
- package/dist/components/ui/Input/types.d.ts.map +1 -1
- package/dist/components/ui/Input/useInput.d.ts +1 -1
- package/dist/components/ui/Input/useInput.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/styles.css +21 -0
- package/package.json +4 -2
package/core.d.ts
ADDED
package/core.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Runtime shim so bundlers can resolve `@tapcart/mobile-components/core`
|
|
2
|
+
// without a package.json exports map.
|
|
3
|
+
//
|
|
4
|
+
// Points at the full compiled core barrel so V2 blocks need only ONE import
|
|
5
|
+
// line from `/core` (Text, Html, Icon, getData + all hooks/ui: ScrollArea,
|
|
6
|
+
// useRecommendations, useProducts, Price, etc.). The barrel swaps in the V2
|
|
7
|
+
// core/ versions of button, text, html, icon over their legacy ui/ counterparts.
|
|
8
|
+
//
|
|
9
|
+
// The old targeted subset existed because the full barrel used to transitively
|
|
10
|
+
// pull components/ui/image.js with a monorepo-only `@/` path alias external
|
|
11
|
+
// bundlers couldn't resolve. tsc-alias now emits clean relative paths in dist,
|
|
12
|
+
// so that hazard is gone and the full barrel is safe to publish.
|
|
13
|
+
export * from "./dist/core/index.js"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare const ICON_SIZES: {
|
|
3
|
+
readonly sm: 16;
|
|
4
|
+
readonly md: 20;
|
|
5
|
+
readonly lg: 24;
|
|
6
|
+
readonly xl: 32;
|
|
7
|
+
};
|
|
8
|
+
export type IconSize = keyof typeof ICON_SIZES;
|
|
9
|
+
export interface IconProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
10
|
+
url?: string | null;
|
|
11
|
+
size?: IconSize | number;
|
|
12
|
+
/**
|
|
13
|
+
* The baked style bag from `generateManifestStyles`. `fill` and `stroke` are
|
|
14
|
+
* INTERCEPTED here (not applied to the wrapper — inherited values can't
|
|
15
|
+
* override a path's own presentation attribute). They're re-applied to the
|
|
16
|
+
* SVG's already-painted paths via CSS custom properties + the static
|
|
17
|
+
* `.tc-icon` rule in globals.css, which beats the baked fill/stroke and
|
|
18
|
+
* leaves hollow icons hollow (`:not([fill="none"])`). Everything else on the
|
|
19
|
+
* style bag decorates the wrapper normally.
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties & {
|
|
22
|
+
fill?: string;
|
|
23
|
+
stroke?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* V2 core Icon. Renders an inline SVG from `url`, standardized sizing, and
|
|
28
|
+
* theming driven entirely off the baked `style` bag (fill/stroke). No color
|
|
29
|
+
* prop, no per-path JS injection, no per-icon stylesheet — one static rule +
|
|
30
|
+
* an inline CSS variable per instance.
|
|
31
|
+
*/
|
|
32
|
+
declare function Icon({ url, size, style, className, ...props }: IconProps): import("react/jsx-runtime").JSX.Element | null;
|
|
33
|
+
declare namespace Icon {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
export { Icon };
|
|
37
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../components/core/icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,eAAO,MAAM,UAAU;;;;;CAKb,CAAA;AAEV,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAA;AAE9C,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC5D,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IACxB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACjE;AAED;;;;;GAKG;AACH,iBAAS,IAAI,CAAC,EAAE,GAAG,EAAE,IAAW,EAAE,KAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,kDAmC7E;kBAnCQ,IAAI;;;AAuCb,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { useCallback } from "react";
|
|
15
|
+
import { ReactSVG } from "react-svg";
|
|
16
|
+
import { cn } from "../../lib/utils";
|
|
17
|
+
// Standardized V2 icon sizes (px). Blocks pass a keyword; a raw number is also
|
|
18
|
+
// accepted as an escape hatch.
|
|
19
|
+
export const ICON_SIZES = {
|
|
20
|
+
sm: 16,
|
|
21
|
+
md: 20,
|
|
22
|
+
lg: 24,
|
|
23
|
+
xl: 32,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* V2 core Icon. Renders an inline SVG from `url`, standardized sizing, and
|
|
27
|
+
* theming driven entirely off the baked `style` bag (fill/stroke). No color
|
|
28
|
+
* prop, no per-path JS injection, no per-icon stylesheet — one static rule +
|
|
29
|
+
* an inline CSS variable per instance.
|
|
30
|
+
*/
|
|
31
|
+
function Icon(_a) {
|
|
32
|
+
var _b;
|
|
33
|
+
var { url, size = "md", style = {}, className } = _a, props = __rest(_a, ["url", "size", "style", "className"]);
|
|
34
|
+
const { fill, stroke } = style, wrapperStyle = __rest(style
|
|
35
|
+
// Accept only positive finite numbers as a raw px escape hatch; anything
|
|
36
|
+
// else (0, negative, NaN, Infinity) falls back to the named size / md so the
|
|
37
|
+
// icon never renders invalid or invisible.
|
|
38
|
+
, ["fill", "stroke"]);
|
|
39
|
+
// Accept only positive finite numbers as a raw px escape hatch; anything
|
|
40
|
+
// else (0, negative, NaN, Infinity) falls back to the named size / md so the
|
|
41
|
+
// icon never renders invalid or invisible.
|
|
42
|
+
const px = typeof size === "number" && Number.isFinite(size) && size > 0
|
|
43
|
+
? size
|
|
44
|
+
: (_b = ICON_SIZES[size]) !== null && _b !== void 0 ? _b : ICON_SIZES.md;
|
|
45
|
+
const cssVars = {};
|
|
46
|
+
if (fill)
|
|
47
|
+
cssVars["--tc-icon-fill"] = fill;
|
|
48
|
+
if (stroke)
|
|
49
|
+
cssVars["--tc-icon-stroke"] = stroke;
|
|
50
|
+
// Stable identity so ReactSVG doesn't re-run injection every render on
|
|
51
|
+
// icon-heavy pages.
|
|
52
|
+
const beforeInjection = useCallback((svg) => {
|
|
53
|
+
svg.setAttribute("width", "100%");
|
|
54
|
+
svg.setAttribute("height", "100%");
|
|
55
|
+
}, []);
|
|
56
|
+
if (!url)
|
|
57
|
+
return null;
|
|
58
|
+
return (_jsx("span", Object.assign({ className: cn("tc-icon", className), "data-fill": fill ? "" : undefined, "data-stroke": stroke ? "" : undefined, style: Object.assign(Object.assign(Object.assign({}, wrapperStyle), cssVars), { width: px, height: px }) }, props, { children: _jsx(ReactSVG, { src: url, beforeInjection: beforeInjection }) })));
|
|
59
|
+
}
|
|
60
|
+
Icon.displayName = "Icon";
|
|
61
|
+
export { Icon };
|
|
@@ -42,6 +42,9 @@ interface UseSearchAnalyticsOpenProductParams {
|
|
|
42
42
|
* carousels, ...) so there's one implementation to maintain. The results are
|
|
43
43
|
* held in a ref so the returned callback keeps a stable identity (preserving
|
|
44
44
|
* a memoized ProductCard) while still reading the latest list on click.
|
|
45
|
+
*
|
|
46
|
+
* @deprecated Emission moved app-side; see the module note above. Still used by
|
|
47
|
+
* pinned forks for the product/open it performs, so it must keep working.
|
|
45
48
|
*/
|
|
46
49
|
export declare function useSearchAnalyticsOpenProduct({ products, searchClient, emitProductClick, action, surface, }: UseSearchAnalyticsOpenProductParams): (props: OpenProductProps) => void;
|
|
47
50
|
interface AddToCartProps {
|
|
@@ -80,6 +83,9 @@ interface UseSearchAnalyticsAddToCartParams {
|
|
|
80
83
|
* (`searchClient` falsy), the emitter isn't injected, or the added variant
|
|
81
84
|
* isn't in the current results — without a matched hit there's no `objectID` to
|
|
82
85
|
* attribute, so we skip the emit rather than send a provider-less event.
|
|
86
|
+
*
|
|
87
|
+
* @deprecated Emission moved app-side; see the module note above. Still used by
|
|
88
|
+
* pinned forks for the cart/add it performs, so it must keep working.
|
|
83
89
|
*/
|
|
84
90
|
export declare function useSearchAnalyticsAddToCart({ products, searchClient, emitProductConversion, action, surface, }: UseSearchAnalyticsAddToCartParams): (props: AddToCartProps) => Promise<void>;
|
|
85
91
|
/**
|
|
@@ -93,6 +99,9 @@ export declare function useSearchAnalyticsAddToCart({ products, searchClient, em
|
|
|
93
99
|
* Algolia `objectID` + 1-based position, no cart mutation. No-ops when the grid
|
|
94
100
|
* isn't search-backed (`searchClient` falsy), the emitter isn't injected, the
|
|
95
101
|
* variant is missing, or the variant isn't found in the current results.
|
|
102
|
+
*
|
|
103
|
+
* @deprecated Emission moved app-side; the quick-add provider now resolves the
|
|
104
|
+
* attribution itself. Emit-only, so this is inert once wrapper emission is on.
|
|
96
105
|
*/
|
|
97
106
|
export declare function useSearchAnalyticsConversionEmit({ products, searchClient, emitProductConversion, surface, }: UseSearchAnalyticsAddToCartParams): (variantId?: string) => void;
|
|
98
107
|
interface UseSearchAnalyticsImpressionParams {
|
|
@@ -118,6 +127,9 @@ interface UseSearchAnalyticsImpressionParams {
|
|
|
118
127
|
* Returns `undefined` when the grid isn't search-backed or no emitter is
|
|
119
128
|
* injected, so ProductCard skips setting up an IntersectionObserver entirely on
|
|
120
129
|
* non-search surfaces.
|
|
130
|
+
*
|
|
131
|
+
* @deprecated Emission moved app-side; impressions are observed from the block's
|
|
132
|
+
* rendered cards. Emit-only, so this is inert once wrapper emission is on.
|
|
121
133
|
*/
|
|
122
134
|
export declare function useSearchAnalyticsImpression({ searchClient, emitProductImpression, surface, enabled, }: UseSearchAnalyticsImpressionParams): ((product: SearchAnalyticsProduct | undefined | null) => void) | undefined;
|
|
123
135
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-analytics-open-product.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-search-analytics-open-product.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-search-analytics-open-product.d.ts","sourceRoot":"","sources":["../../../components/hooks/use-search-analytics-open-product.ts"],"names":[],"mappings":"AA6BA,UAAU,sBAAsB;IAC9B,EA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Gid } from "../../lib/utils";
|
|
|
25
25
|
* carousels, ...) so there's one implementation to maintain. The results are
|
|
26
26
|
* held in a ref so the returned callback keeps a stable identity (preserving
|
|
27
27
|
* a memoized ProductCard) while still reading the latest list on click.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Emission moved app-side; see the module note above. Still used by
|
|
30
|
+
* pinned forks for the product/open it performs, so it must keep working.
|
|
28
31
|
*/
|
|
29
32
|
export function useSearchAnalyticsOpenProduct({ products, searchClient, emitProductClick, action, surface = "collection", }) {
|
|
30
33
|
const productsRef = React.useRef(products);
|
|
@@ -79,6 +82,9 @@ export function useSearchAnalyticsOpenProduct({ products, searchClient, emitProd
|
|
|
79
82
|
* (`searchClient` falsy), the emitter isn't injected, or the added variant
|
|
80
83
|
* isn't in the current results — without a matched hit there's no `objectID` to
|
|
81
84
|
* attribute, so we skip the emit rather than send a provider-less event.
|
|
85
|
+
*
|
|
86
|
+
* @deprecated Emission moved app-side; see the module note above. Still used by
|
|
87
|
+
* pinned forks for the cart/add it performs, so it must keep working.
|
|
82
88
|
*/
|
|
83
89
|
export function useSearchAnalyticsAddToCart({ products, searchClient, emitProductConversion, action, surface = "collection", }) {
|
|
84
90
|
const productsRef = React.useRef(products);
|
|
@@ -135,6 +141,9 @@ export function useSearchAnalyticsAddToCart({ products, searchClient, emitProduc
|
|
|
135
141
|
* Algolia `objectID` + 1-based position, no cart mutation. No-ops when the grid
|
|
136
142
|
* isn't search-backed (`searchClient` falsy), the emitter isn't injected, the
|
|
137
143
|
* variant is missing, or the variant isn't found in the current results.
|
|
144
|
+
*
|
|
145
|
+
* @deprecated Emission moved app-side; the quick-add provider now resolves the
|
|
146
|
+
* attribution itself. Emit-only, so this is inert once wrapper emission is on.
|
|
138
147
|
*/
|
|
139
148
|
export function useSearchAnalyticsConversionEmit({ products, searchClient, emitProductConversion, surface = "collection", }) {
|
|
140
149
|
const productsRef = React.useRef(products);
|
|
@@ -168,6 +177,9 @@ export function useSearchAnalyticsConversionEmit({ products, searchClient, emitP
|
|
|
168
177
|
* Returns `undefined` when the grid isn't search-backed or no emitter is
|
|
169
178
|
* injected, so ProductCard skips setting up an IntersectionObserver entirely on
|
|
170
179
|
* non-search surfaces.
|
|
180
|
+
*
|
|
181
|
+
* @deprecated Emission moved app-side; impressions are observed from the block's
|
|
182
|
+
* rendered cards. Emit-only, so this is inert once wrapper emission is on.
|
|
171
183
|
*/
|
|
172
184
|
export function useSearchAnalyticsImpression({ searchClient, emitProductImpression, surface = "collection", enabled = true, }) {
|
|
173
185
|
const seenRef = React.useRef(new Set());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KMP } from "./kmp";
|
|
2
|
-
import { FilterCategory } from "
|
|
2
|
+
import { FilterCategory } from "./search-integration";
|
|
3
3
|
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
4
4
|
import { Integration } from "app-studio-types";
|
|
5
5
|
export declare class CustomSearch extends KMP {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-search.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/custom-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAEL,cAAc,EACf,MAAM,
|
|
1
|
+
{"version":3,"file":"custom-search.d.ts","sourceRoot":"","sources":["../../../../components/libs/sort-filter/custom-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAEL,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,qBAAa,YAAa,SAAQ,GAAG;IACnC,OAAO,CAAC,WAAW,CAAa;gBAEpB,EAAE,WAAW,EAAE,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE;IAKzD,qCAAqC,YAC1B,cAAc,EAAE,gBACX,uBAAuB,KACpC,MAAM,CA2BR;IAED,wBAAwB,YAEvB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,QAAA,MAAM,KAAK,qFAyLV,CAAA;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { VariantProps } from "class-variance-authority";
|
|
3
|
-
import { inputVariants } from "
|
|
3
|
+
import { inputVariants } from "./useInput";
|
|
4
4
|
import { Color, TextStyle } from "../../../lib/utils";
|
|
5
5
|
export type BorderSides = ("all" | "bottom" | "left" | "right" | "top")[];
|
|
6
6
|
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange">, VariantProps<typeof inputVariants> {
|
|
@@ -1 +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,
|
|
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,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WAAW,CAAA;IACzB,YAAY,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InputProps } from "
|
|
2
|
+
import { InputProps } from "./types";
|
|
3
3
|
export declare const DEFAULT_ICON_SIZE = 20;
|
|
4
4
|
export declare const DEFAULT_X_PADDING = 12;
|
|
5
5
|
export declare const DEFAULT_Y_PADDING = 8;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInput.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/useInput.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useInput.d.ts","sourceRoot":"","sources":["../../../../components/ui/Input/useInput.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGpC,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,UACZ,KACL,UAAU,EACR,SAAS,GACT,MAAM,GACN,SAAS,GACT,cAAc,GACd,WAAW,GACX,WAAW,GACX,iBAAiB,GACjB,cAAc,GACd,kBAAkB,GAClB,wBAAwB,GACxB,aAAa,GACb,cAAc,GACd,cAAc,GACd,sBAAsB,GACtB,YAAY,CACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FF,CAAA"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export * from "../components/ui/favorite";
|
|
|
45
45
|
export * from "../components/ui/fallback-on-condition";
|
|
46
46
|
export * from "../components/ui/grid";
|
|
47
47
|
export * from "../components/ui/virtual-grid";
|
|
48
|
-
export * from "../components/
|
|
48
|
+
export * from "../components/core/icon";
|
|
49
49
|
export * from "../components/ui/image";
|
|
50
50
|
export * from "../components/ui/Input/input";
|
|
51
51
|
export * from "../components/ui/label";
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,EAAE,EACF,wBAAwB,EACxB,GAAG,EACH,kBAAkB,EAClB,4BAA4B,EAC5B,4BAA4B,EAC5B,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,QAAQ,GACT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,cAAc,EACd,YAAY,EACZ,4BAA4B,EAC5B,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,EAC5B,OAAO,EACP,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,cAAc,kBAAkB,CAAA;AAChC,cAAc,gCAAgC,CAAA;AAC9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AuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,2BAA2B,CAAA;AACzC,cAAc,kCAAkC,CAAA;AAChD,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,mDAAmD,CAAA;AACjE,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sCAAsC,CAAA;AACpD,cAAc,qCAAqC,CAAA;AACnD,cAAc,oCAAoC,CAAA;AAClD,cAAc,cAAc,CAAA;AAC5B,cAAc,8CAA8C,CAAA;AAC5D,cAAc,mDAAmD,CAAA;AACjE,cAAc,sBAAsB,CAAA;AACpC,cAAc,oCAAoC,CAAA;AAClD,cAAc,sCAAsC,CAAA;AACpD,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,+CAA+C,CAAA"}
|
package/dist/core/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export * from "../components/ui/favorite";
|
|
|
44
44
|
export * from "../components/ui/fallback-on-condition";
|
|
45
45
|
export * from "../components/ui/grid";
|
|
46
46
|
export * from "../components/ui/virtual-grid";
|
|
47
|
-
export * from "../components/
|
|
47
|
+
export * from "../components/core/icon";
|
|
48
48
|
export * from "../components/ui/image";
|
|
49
49
|
export * from "../components/ui/Input/input";
|
|
50
50
|
export * from "../components/ui/label";
|
package/dist/styles.css
CHANGED
|
@@ -499,6 +499,27 @@ video {
|
|
|
499
499
|
[hidden]:where(:not([hidden="until-found"])) {
|
|
500
500
|
display: none;
|
|
501
501
|
}
|
|
502
|
+
/* V2 core Icon (components/core/icon.tsx).
|
|
503
|
+
One static rule for the whole app — per-icon cost is just an inline CSS
|
|
504
|
+
variable, so icon-heavy pages don't pay per-instance stylesheet churn.
|
|
505
|
+
A CSS rule targeting the paths beats the SVG's baked fill/stroke
|
|
506
|
+
presentation attribute; `:not([...="none"])` recolors ONLY paths that were
|
|
507
|
+
already painted, so stroke-only / hollow icons stay hollow with no toggle. */
|
|
508
|
+
.tc-icon {
|
|
509
|
+
display: inline-flex;
|
|
510
|
+
line-height: 0;
|
|
511
|
+
}
|
|
512
|
+
.tc-icon svg {
|
|
513
|
+
width: 100%;
|
|
514
|
+
height: 100%;
|
|
515
|
+
}
|
|
516
|
+
.tc-icon[data-fill] svg [fill]:not([fill="none"]) {
|
|
517
|
+
fill: var(--tc-icon-fill) !important;
|
|
518
|
+
}
|
|
519
|
+
.tc-icon[data-stroke] svg [stroke]:not([stroke="none"]) {
|
|
520
|
+
stroke: var(--tc-icon-stroke) !important;
|
|
521
|
+
}
|
|
522
|
+
|
|
502
523
|
.no-scrollbar *:not(.textarea-component)::-webkit-scrollbar {
|
|
503
524
|
display: none;
|
|
504
525
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
7
7
|
"sourceMap": true,
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
9
|
+
"dist",
|
|
10
|
+
"core.js",
|
|
11
|
+
"core.d.ts"
|
|
10
12
|
],
|
|
11
13
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
12
14
|
"author": "Tapcart Inc.",
|