@valpro-labs/ui 1.1.4 → 1.1.6
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/blocks/night-market-icon.d.ts.map +1 -1
- package/dist/components/blocks/night-market-icon.js +15 -8
- package/dist/components/blocks/night-market-icon.js.map +1 -1
- package/dist/components/blocks/skin-tile.js +2 -2
- package/dist/components/blocks/wallet.d.ts +9 -0
- package/dist/components/blocks/wallet.d.ts.map +1 -1
- package/dist/components/blocks/wallet.js +6 -1
- package/dist/components/blocks/wallet.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"night-market-icon.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/night-market-icon.tsx"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"night-market-icon.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/night-market-icon.tsx"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqBD,iBAAS,eAAe,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,oBAAoB,2CAQlE;AAED,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCSSVariable } from 'uniwind';
|
|
3
3
|
import { Path, Svg } from '../../lib/svg-shim';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
// Square viewBox so the Svg canvas stays square at every `size`. The icon's
|
|
5
|
+
// natural silhouette is a 20x36 rectangle (with a diamond cutout), which we
|
|
6
|
+
// pad to a 36x36 square. Flex containers can then center the Svg on whole
|
|
7
|
+
// pixels, avoiding the sub-pixel drift that a 20x36 Svg canvas produced when
|
|
8
|
+
// consumers wrapped it in a square button (e.g. `size={20}` -> width 11.111).
|
|
9
|
+
const VB = 36;
|
|
10
|
+
const RECT_W = 20;
|
|
11
|
+
const RECT_H = 36;
|
|
12
|
+
const RECT_X = (VB - RECT_W) / 2;
|
|
13
|
+
const RECT_Y = (VB - RECT_H) / 2;
|
|
14
|
+
const CX = VB / 2;
|
|
15
|
+
const CY = VB / 2;
|
|
8
16
|
const HALF_DIAG = 6 * Math.SQRT2;
|
|
9
17
|
const PATH_D = [
|
|
10
|
-
`
|
|
18
|
+
`M${RECT_X} ${RECT_Y} H${RECT_X + RECT_W} V${RECT_Y + RECT_H} H${RECT_X} Z`,
|
|
11
19
|
`M${CX} ${(CY - HALF_DIAG).toFixed(3)} L${(CX + HALF_DIAG).toFixed(3)} ${CY} L${CX} ${(CY + HALF_DIAG).toFixed(3)} L${(CX - HALF_DIAG).toFixed(3)} ${CY} Z`,
|
|
12
20
|
].join(' ');
|
|
13
|
-
function NightMarketIcon({ size =
|
|
21
|
+
function NightMarketIcon({ size = VB, color }) {
|
|
14
22
|
const foreground = useCSSVariable('--color-foreground');
|
|
15
23
|
const fill = color ?? (typeof foreground === 'string' ? foreground : 'currentColor');
|
|
16
|
-
|
|
17
|
-
return (_jsx(Svg, { width: width, height: size, viewBox: `0 0 ${VB_W} ${VB_H}`, children: _jsx(Path, { d: PATH_D, fill: fill, fillRule: "evenodd" }) }));
|
|
24
|
+
return (_jsx(Svg, { width: size, height: size, viewBox: `0 0 ${VB} ${VB}`, children: _jsx(Path, { d: PATH_D, fill: fill, fillRule: "evenodd" }) }));
|
|
18
25
|
}
|
|
19
26
|
export { NightMarketIcon };
|
|
20
27
|
//# sourceMappingURL=night-market-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"night-market-icon.js","sourceRoot":"","sources":["../../../src/components/blocks/night-market-icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAO3C,MAAM,
|
|
1
|
+
{"version":3,"file":"night-market-icon.js","sourceRoot":"","sources":["../../../src/components/blocks/night-market-icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAO3C,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,6EAA6E;AAC7E,8EAA8E;AAC9E,MAAM,EAAE,GAAG,EAAE,CAAC;AACd,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACjC,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACjC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAClB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAClB,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;AAEjC,MAAM,MAAM,GAAG;IACb,IAAI,MAAM,IAAI,MAAM,KAAK,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,MAAM,KAAK,MAAM,IAAI;IAC3E,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI;CAC5J,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAEZ,SAAS,eAAe,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAwB;IACjE,MAAM,UAAU,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,KAAK,IAAI,CAAC,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACrF,OAAO,CACL,KAAC,GAAG,IAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,YACxD,KAAC,IAAI,IAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,SAAS,GAAG,GAC9C,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -14,8 +14,8 @@ import { cn } from '../../lib/utils';
|
|
|
14
14
|
*/
|
|
15
15
|
function SkinTile({ swatchUrl, isSelected = false, stateIcon, favoriteBadge, className, }) {
|
|
16
16
|
return (_jsxs(View, { className: cn('bg-card relative items-center justify-center overflow-hidden rounded-lg', isSelected && 'ring-val-red ring-2', className), style: { width: 48, height: 48 }, children: [swatchUrl ? (_jsx(Image, { source: swatchUrl, style: { width: '100%', height: '100%' }, contentFit: "cover" })) : null, isSelected ? (_jsx(View, { className: "bg-val-red/20 absolute inset-0", pointerEvents: "none" })) : null, _jsx(View, { className: "absolute inset-0 items-center justify-center", children: _jsx(View, { className: "items-center justify-center", style: {
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
17
|
+
width: 20,
|
|
18
|
+
height: 20,
|
|
19
19
|
transform: [{ rotate: '45deg' }],
|
|
20
20
|
backgroundColor: 'rgba(0,0,0,0.6)',
|
|
21
21
|
borderWidth: 1,
|
|
@@ -5,6 +5,10 @@ interface WalletBalance {
|
|
|
5
5
|
iconUrl?: string;
|
|
6
6
|
/** Current balance. Omit to render a dash placeholder. */
|
|
7
7
|
amount?: number;
|
|
8
|
+
/** Optional override for icon tint + amount text color.
|
|
9
|
+
* Accepts any value expo-image's `tintColor` understands
|
|
10
|
+
* (hex, rgb/rgba, named color). Falls back to `--color-foreground`. */
|
|
11
|
+
color?: string;
|
|
8
12
|
}
|
|
9
13
|
interface WalletProps {
|
|
10
14
|
/** Currencies to render, in the display order chosen by the caller. */
|
|
@@ -20,6 +24,11 @@ interface WalletProps {
|
|
|
20
24
|
*
|
|
21
25
|
* Data-free: the consumer resolves the currency list + icons (from
|
|
22
26
|
* whichever asset store they use) and passes `balances` in display order.
|
|
27
|
+
*
|
|
28
|
+
* Each balance accepts an optional `color` which the consumer can use for
|
|
29
|
+
* threshold-based highlights — e.g. tint Kingdom Credits purple once the
|
|
30
|
+
* amount crosses some "you can afford X" threshold. When omitted, both the
|
|
31
|
+
* icon tint and amount text fall back to `--color-foreground`.
|
|
23
32
|
*/
|
|
24
33
|
declare function Wallet({ balances, isLoading, className }: WalletProps): import("react/jsx-runtime").JSX.Element;
|
|
25
34
|
export { Wallet };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/wallet.tsx"],"names":[],"mappings":"AASA,UAAU,aAAa;IACrB,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/components/blocks/wallet.tsx"],"names":[],"mappings":"AASA,UAAU,aAAa;IACrB,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;4EAEwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,WAAW;IACnB,uEAAuE;IACvE,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,SAAiB,EAAE,SAAS,EAAE,EAAE,WAAW,2CA+BtE;AAED,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -11,11 +11,16 @@ import { cn } from '../../lib/utils';
|
|
|
11
11
|
*
|
|
12
12
|
* Data-free: the consumer resolves the currency list + icons (from
|
|
13
13
|
* whichever asset store they use) and passes `balances` in display order.
|
|
14
|
+
*
|
|
15
|
+
* Each balance accepts an optional `color` which the consumer can use for
|
|
16
|
+
* threshold-based highlights — e.g. tint Kingdom Credits purple once the
|
|
17
|
+
* amount crosses some "you can afford X" threshold. When omitted, both the
|
|
18
|
+
* icon tint and amount text fall back to `--color-foreground`.
|
|
14
19
|
*/
|
|
15
20
|
function Wallet({ balances, isLoading = false, className }) {
|
|
16
21
|
const foregroundRaw = useCSSVariable('--color-foreground');
|
|
17
22
|
const foreground = typeof foregroundRaw === 'string' ? foregroundRaw : undefined;
|
|
18
|
-
return (_jsx(View, { className: cn('bg-card overflow-hidden rounded-2xl px-4 py-3', className), children: _jsx(View, { className: "flex-row items-center gap-x-4", children: balances.map((b) => (_jsxs(View, { className: "flex-1 flex-row items-center gap-x-1.5", children: [b.iconUrl ? (_jsx(Image, { source: b.iconUrl, style: { width: 18, height: 18, tintColor: foreground }, contentFit: "contain" })) : null, isLoading ? (_jsx(Skeleton, { className: "h-5 w-12 rounded-sm" })) : (_jsx(Text, { className: "text-foreground text-sm leading-5 font-bold", children: b.amount?.toLocaleString() ?? '—' }))] }, b.key))) }) }));
|
|
23
|
+
return (_jsx(View, { className: cn('bg-card overflow-hidden rounded-2xl px-4 py-3', className), children: _jsx(View, { className: "flex-row items-center gap-x-4", children: balances.map((b) => (_jsxs(View, { className: "flex-1 flex-row items-center gap-x-1.5", children: [b.iconUrl ? (_jsx(Image, { source: b.iconUrl, style: { width: 18, height: 18, tintColor: b.color ?? foreground }, contentFit: "contain" })) : null, isLoading ? (_jsx(Skeleton, { className: "h-5 w-12 rounded-sm" })) : (_jsx(Text, { className: "text-foreground text-sm leading-5 font-bold", style: b.color ? { color: b.color } : undefined, children: b.amount?.toLocaleString() ?? '—' }))] }, b.key))) }) }));
|
|
19
24
|
}
|
|
20
25
|
export { Wallet };
|
|
21
26
|
//# sourceMappingURL=wallet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../src/components/blocks/wallet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../src/components/blocks/wallet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OA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