@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.41
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/chunk-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G3CCT4EY.js +518 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-VLKBESEV.cjs +407 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +22 -0
- package/dist/components/card/index.cjs +22 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- package/dist/components/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +17 -0
- package/dist/components/switch/index.cjs +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/tabs/index.cjs +33 -0
- package/dist/components/tabs/index.d.cts +261 -0
- package/dist/components/tabs/index.d.ts +261 -0
- package/dist/components/tabs/index.js +33 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +423 -5
- package/dist/index.d.cts +119 -4
- package/dist/index.d.ts +119 -4
- package/dist/index.js +445 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +264 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -1,68 +1,58 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunkWDDXU3OHcjs = require('./chunk-WDDXU3OH.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
6
12
|
|
|
7
13
|
// src/provider/xaui-provider.tsx
|
|
8
14
|
var _reactnative = require('react-native');
|
|
9
15
|
|
|
10
|
-
// src/utils/stable-hash.ts
|
|
11
|
-
function canonical(value) {
|
|
12
|
-
if (value === null || typeof value !== "object") return _nullishCoalesce(JSON.stringify(value), () => ( "null"));
|
|
13
|
-
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
14
|
-
const entries = Object.entries(value).filter(([, v]) => typeof v !== "function").sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`);
|
|
15
|
-
return `{${entries.join(",")}}`;
|
|
16
|
-
}
|
|
17
|
-
function stableHash(value) {
|
|
18
|
-
const input = canonical(value);
|
|
19
|
-
let hash = 2166136261;
|
|
20
|
-
for (let i = 0; i < input.length; i++) {
|
|
21
|
-
hash ^= input.charCodeAt(i);
|
|
22
|
-
hash = Math.imul(hash, 16777619) >>> 0;
|
|
23
|
-
}
|
|
24
|
-
return hash.toString(36);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
16
|
// src/theme/derive-colors.ts
|
|
28
17
|
function deriveColors(s) {
|
|
29
18
|
return {
|
|
30
|
-
accentPressed:
|
|
31
|
-
successPressed:
|
|
32
|
-
warningPressed:
|
|
33
|
-
dangerPressed:
|
|
34
|
-
defaultPressed:
|
|
35
|
-
surfacePressed:
|
|
36
|
-
defaultSoft:
|
|
19
|
+
accentPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.accent, s.foreground, 0.1),
|
|
20
|
+
successPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.success, s.foreground, 0.1),
|
|
21
|
+
warningPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.warning, s.foreground, 0.1),
|
|
22
|
+
dangerPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.danger, s.foreground, 0.1),
|
|
23
|
+
defaultPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.default, s.defaultForeground, 0.04),
|
|
24
|
+
surfacePressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.surface, s.surfaceForeground, 0.08),
|
|
25
|
+
defaultSoft: _chunk57SJ4LJFcjs.alpha.call(void 0, s.default, 0.5),
|
|
37
26
|
defaultSoftForeground: s.defaultForeground,
|
|
38
|
-
defaultSoftPressed:
|
|
39
|
-
accentSoft:
|
|
40
|
-
accentSoftForeground:
|
|
41
|
-
accentSoftPressed:
|
|
42
|
-
successSoft:
|
|
43
|
-
successSoftForeground:
|
|
44
|
-
successSoftPressed:
|
|
45
|
-
warningSoft:
|
|
46
|
-
warningSoftForeground:
|
|
47
|
-
warningSoftPressed:
|
|
48
|
-
dangerSoft:
|
|
49
|
-
dangerSoftForeground:
|
|
50
|
-
dangerSoftPressed:
|
|
51
|
-
backgroundSecondary:
|
|
52
|
-
backgroundTertiary:
|
|
27
|
+
defaultSoftPressed: _chunk57SJ4LJFcjs.alpha.call(void 0, s.default, 0.6),
|
|
28
|
+
accentSoft: _chunk57SJ4LJFcjs.alpha.call(void 0, s.accent, 0.15),
|
|
29
|
+
accentSoftForeground: _chunk57SJ4LJFcjs.mix.call(void 0, s.accent, s.foreground, 0.2),
|
|
30
|
+
accentSoftPressed: _chunk57SJ4LJFcjs.alpha.call(void 0, s.accent, 0.2),
|
|
31
|
+
successSoft: _chunk57SJ4LJFcjs.alpha.call(void 0, s.success, 0.15),
|
|
32
|
+
successSoftForeground: _chunk57SJ4LJFcjs.mix.call(void 0, s.success, s.foreground, 0.3),
|
|
33
|
+
successSoftPressed: _chunk57SJ4LJFcjs.alpha.call(void 0, s.success, 0.2),
|
|
34
|
+
warningSoft: _chunk57SJ4LJFcjs.alpha.call(void 0, s.warning, 0.15),
|
|
35
|
+
warningSoftForeground: _chunk57SJ4LJFcjs.mix.call(void 0, s.warning, s.foreground, 0.35),
|
|
36
|
+
warningSoftPressed: _chunk57SJ4LJFcjs.alpha.call(void 0, s.warning, 0.2),
|
|
37
|
+
dangerSoft: _chunk57SJ4LJFcjs.alpha.call(void 0, s.danger, 0.15),
|
|
38
|
+
dangerSoftForeground: _chunk57SJ4LJFcjs.mix.call(void 0, s.danger, s.foreground, 0.2),
|
|
39
|
+
dangerSoftPressed: _chunk57SJ4LJFcjs.alpha.call(void 0, s.danger, 0.2),
|
|
40
|
+
backgroundSecondary: _chunk57SJ4LJFcjs.mix.call(void 0, s.background, s.foreground, 0.04),
|
|
41
|
+
backgroundTertiary: _chunk57SJ4LJFcjs.mix.call(void 0, s.background, s.foreground, 0.08),
|
|
53
42
|
backgroundInverse: s.foreground,
|
|
54
|
-
borderSecondary:
|
|
55
|
-
borderTertiary:
|
|
56
|
-
separatorSecondary:
|
|
57
|
-
separatorTertiary:
|
|
58
|
-
fieldPressed:
|
|
43
|
+
borderSecondary: _chunk57SJ4LJFcjs.mix.call(void 0, s.surface, s.surfaceForeground, 0.22),
|
|
44
|
+
borderTertiary: _chunk57SJ4LJFcjs.mix.call(void 0, s.surface, s.surfaceForeground, 0.34),
|
|
45
|
+
separatorSecondary: _chunk57SJ4LJFcjs.mix.call(void 0, s.surface, s.surfaceForeground, 0.15),
|
|
46
|
+
separatorTertiary: _chunk57SJ4LJFcjs.mix.call(void 0, s.surface, s.surfaceForeground, 0.19),
|
|
47
|
+
fieldPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.fieldBackground, s.fieldForeground, 0.1),
|
|
59
48
|
fieldFocus: s.fieldBackground,
|
|
60
|
-
fieldBorderPressed:
|
|
61
|
-
fieldBorderFocus:
|
|
49
|
+
fieldBorderPressed: _chunk57SJ4LJFcjs.mix.call(void 0, s.fieldBorder, s.fieldForeground, 0.12),
|
|
50
|
+
fieldBorderFocus: _chunk57SJ4LJFcjs.mix.call(void 0, s.fieldBorder, s.fieldForeground, 0.26)
|
|
62
51
|
};
|
|
63
52
|
}
|
|
64
53
|
|
|
65
54
|
// src/theme/scales.ts
|
|
55
|
+
|
|
66
56
|
var SPACING_UNIT = 4;
|
|
67
57
|
var RADIUS_BASE = 12;
|
|
68
58
|
function buildRadius(base) {
|
|
@@ -75,7 +65,16 @@ function buildRadius(base) {
|
|
|
75
65
|
"2xl": base * 2,
|
|
76
66
|
"3xl": base * 3,
|
|
77
67
|
"4xl": base * 4,
|
|
78
|
-
|
|
68
|
+
/**
|
|
69
|
+
* HeroUI's value, reached from the other side of the scale: their `--radius-field` is
|
|
70
|
+
* an alias of their `--radius-xl`, and their base is 8 where ours is 12 — so their
|
|
71
|
+
* field corner is 12 points and, at our default base, so is this.
|
|
72
|
+
*
|
|
73
|
+
* It coincides with `lg` today and is still its own key, because that is what lets a
|
|
74
|
+
* theme round its fields without rounding its cards. It was `base * 1.75`, which put a
|
|
75
|
+
* 48-tall field at 87% of its geometric maximum — a gélule rather than a rounded box.
|
|
76
|
+
*/
|
|
77
|
+
field: base,
|
|
79
78
|
full: 9999
|
|
80
79
|
};
|
|
81
80
|
}
|
|
@@ -114,7 +113,10 @@ var fontWeights = {
|
|
|
114
113
|
var fontFamilies = {
|
|
115
114
|
body: "System",
|
|
116
115
|
heading: "System",
|
|
117
|
-
|
|
116
|
+
// `'monospace'` is an Android family name, not a generic one: iOS does not resolve it and
|
|
117
|
+
// silently falls back to the system face, so code set with it is not monospaced there.
|
|
118
|
+
// Menlo is the face iOS ships, and it is what HeroUI Native selects for the same reason.
|
|
119
|
+
mono: _reactnative.Platform.OS === "ios" ? "Menlo" : "monospace"
|
|
118
120
|
};
|
|
119
121
|
var borderWidth = { default: 1, field: 1 };
|
|
120
122
|
var opacity = { disabled: 0.5 };
|
|
@@ -131,10 +133,10 @@ function buildShadows(mode) {
|
|
|
131
133
|
surface: noShadow,
|
|
132
134
|
overlay: {
|
|
133
135
|
shadowColor: "#000000",
|
|
134
|
-
shadowOffset: { width: 0, height:
|
|
135
|
-
shadowOpacity: 0.
|
|
136
|
-
shadowRadius:
|
|
137
|
-
elevation:
|
|
136
|
+
shadowOffset: { width: 0, height: 4 },
|
|
137
|
+
shadowOpacity: 0.45,
|
|
138
|
+
shadowRadius: 16,
|
|
139
|
+
elevation: 8
|
|
138
140
|
},
|
|
139
141
|
field: noShadow
|
|
140
142
|
};
|
|
@@ -149,10 +151,10 @@ function buildShadows(mode) {
|
|
|
149
151
|
},
|
|
150
152
|
overlay: {
|
|
151
153
|
shadowColor: "#000000",
|
|
152
|
-
shadowOffset: { width: 0, height:
|
|
153
|
-
shadowOpacity: 0.
|
|
154
|
-
shadowRadius:
|
|
155
|
-
elevation:
|
|
154
|
+
shadowOffset: { width: 0, height: 4 },
|
|
155
|
+
shadowOpacity: 0.1,
|
|
156
|
+
shadowRadius: 16,
|
|
157
|
+
elevation: 8
|
|
156
158
|
},
|
|
157
159
|
field: {
|
|
158
160
|
shadowColor: "#000000",
|
|
@@ -171,7 +173,7 @@ var tokens = {
|
|
|
171
173
|
foreground: "#18181b",
|
|
172
174
|
surface: "#ffffff",
|
|
173
175
|
surfaceForeground: "#18181b",
|
|
174
|
-
surfaceSecondary: "#
|
|
176
|
+
surfaceSecondary: "#ececee",
|
|
175
177
|
surfaceSecondaryForeground: "#18181b",
|
|
176
178
|
surfaceTertiary: "#e4e4e7",
|
|
177
179
|
surfaceTertiaryForeground: "#18181b",
|
|
@@ -179,7 +181,7 @@ var tokens = {
|
|
|
179
181
|
overlayForeground: "#18181b",
|
|
180
182
|
backdrop: "rgba(0, 0, 0, 0.2)",
|
|
181
183
|
muted: "#71717a",
|
|
182
|
-
default: "#
|
|
184
|
+
default: "#e4e4e7",
|
|
183
185
|
defaultForeground: "#18181b",
|
|
184
186
|
accent: "#9333ea",
|
|
185
187
|
accentForeground: "#faf5ff",
|
|
@@ -189,7 +191,7 @@ var tokens = {
|
|
|
189
191
|
fieldBorder: "#e4e4e7",
|
|
190
192
|
success: "#15803d",
|
|
191
193
|
successForeground: "#fafafa",
|
|
192
|
-
warning: "#
|
|
194
|
+
warning: "#c2410c",
|
|
193
195
|
warningForeground: "#fafafa",
|
|
194
196
|
danger: "#dc2626",
|
|
195
197
|
dangerForeground: "#fafafa",
|
|
@@ -199,24 +201,24 @@ var tokens = {
|
|
|
199
201
|
separator: "#d4d4d8",
|
|
200
202
|
focus: "#9333ea",
|
|
201
203
|
link: "#18181b",
|
|
202
|
-
accentPressed: "#
|
|
203
|
-
successPressed: "#
|
|
204
|
-
warningPressed: "#
|
|
205
|
-
dangerPressed: "#
|
|
206
|
-
defaultPressed: "#
|
|
204
|
+
accentPressed: "#8533d3",
|
|
205
|
+
successPressed: "#1b753a",
|
|
206
|
+
warningPressed: "#af3e15",
|
|
207
|
+
dangerPressed: "#c72927",
|
|
208
|
+
defaultPressed: "#dbdbde",
|
|
207
209
|
surfacePressed: "#eaeaea",
|
|
208
|
-
defaultSoft: "rgba(
|
|
210
|
+
defaultSoft: "rgba(228, 228, 231, 0.5)",
|
|
209
211
|
defaultSoftForeground: "#18181b",
|
|
210
|
-
defaultSoftPressed: "rgba(
|
|
212
|
+
defaultSoftPressed: "rgba(228, 228, 231, 0.6)",
|
|
211
213
|
accentSoft: "rgba(147, 51, 234, 0.15)",
|
|
212
214
|
accentSoftForeground: "#7833bc",
|
|
213
215
|
accentSoftPressed: "rgba(147, 51, 234, 0.2)",
|
|
214
216
|
successSoft: "rgba(21, 128, 61, 0.15)",
|
|
215
217
|
successSoftForeground: "#205f34",
|
|
216
218
|
successSoftPressed: "rgba(21, 128, 61, 0.2)",
|
|
217
|
-
warningSoft: "rgba(
|
|
218
|
-
warningSoftForeground: "#
|
|
219
|
-
warningSoftPressed: "rgba(
|
|
219
|
+
warningSoft: "rgba(194, 65, 12, 0.15)",
|
|
220
|
+
warningSoftForeground: "#82361e",
|
|
221
|
+
warningSoftPressed: "rgba(194, 65, 12, 0.2)",
|
|
220
222
|
dangerSoft: "rgba(220, 38, 38, 0.15)",
|
|
221
223
|
dangerSoftForeground: "#b22b28",
|
|
222
224
|
dangerSoftPressed: "rgba(220, 38, 38, 0.2)",
|
|
@@ -259,7 +261,7 @@ var tokens = {
|
|
|
259
261
|
fieldBorder: "#3f3f46",
|
|
260
262
|
success: "#4ade80",
|
|
261
263
|
successForeground: "#18181b",
|
|
262
|
-
warning: "#
|
|
264
|
+
warning: "#fb923c",
|
|
263
265
|
warningForeground: "#18181b",
|
|
264
266
|
danger: "#f87171",
|
|
265
267
|
dangerForeground: "#18181b",
|
|
@@ -269,10 +271,10 @@ var tokens = {
|
|
|
269
271
|
separator: "#52525b",
|
|
270
272
|
focus: "#c084fc",
|
|
271
273
|
link: "#fafafa",
|
|
272
|
-
accentPressed: "#
|
|
273
|
-
successPressed: "#
|
|
274
|
-
warningPressed: "#
|
|
275
|
-
dangerPressed: "#
|
|
274
|
+
accentPressed: "#c691fd",
|
|
275
|
+
successPressed: "#64e18d",
|
|
276
|
+
warningPressed: "#fc9d55",
|
|
277
|
+
dangerPressed: "#fa807e",
|
|
276
278
|
defaultPressed: "#2e2e31",
|
|
277
279
|
surfacePressed: "#27272a",
|
|
278
280
|
defaultSoft: "rgba(39, 39, 42, 0.5)",
|
|
@@ -284,9 +286,9 @@ var tokens = {
|
|
|
284
286
|
successSoft: "rgba(74, 222, 128, 0.15)",
|
|
285
287
|
successSoftForeground: "#8de8a6",
|
|
286
288
|
successSoftPressed: "rgba(74, 222, 128, 0.2)",
|
|
287
|
-
warningSoft: "rgba(251,
|
|
288
|
-
warningSoftForeground: "#
|
|
289
|
-
warningSoftPressed: "rgba(251,
|
|
289
|
+
warningSoft: "rgba(251, 146, 60, 0.15)",
|
|
290
|
+
warningSoftForeground: "#feb887",
|
|
291
|
+
warningSoftPressed: "rgba(251, 146, 60, 0.2)",
|
|
290
292
|
dangerSoft: "rgba(248, 113, 113, 0.15)",
|
|
291
293
|
dangerSoftForeground: "#fc8f8c",
|
|
292
294
|
dangerSoftPressed: "rgba(248, 113, 113, 0.2)",
|
|
@@ -377,7 +379,7 @@ function resolveMode(mode, config, id) {
|
|
|
377
379
|
};
|
|
378
380
|
}
|
|
379
381
|
function createTheme(config = {}) {
|
|
380
|
-
const id = stableHash(config);
|
|
382
|
+
const id = _chunkTK44VBIEcjs.stableHash.call(void 0, config);
|
|
381
383
|
return {
|
|
382
384
|
id,
|
|
383
385
|
light: resolveMode("light", config, id),
|
|
@@ -387,14 +389,16 @@ function createTheme(config = {}) {
|
|
|
387
389
|
var defaultTheme = createTheme();
|
|
388
390
|
|
|
389
391
|
// src/provider/xaui-provider.tsx
|
|
392
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
390
393
|
function XAUIProvider({
|
|
391
394
|
children,
|
|
392
395
|
theme = defaultTheme,
|
|
393
|
-
colorMode = "system"
|
|
396
|
+
colorMode = "system",
|
|
397
|
+
hasPortalHost = true
|
|
394
398
|
}) {
|
|
395
399
|
const scheme = _reactnative.useColorScheme.call(void 0, );
|
|
396
400
|
const resolved = colorMode === "system" ? scheme === "dark" ? "dark" : "light" : colorMode;
|
|
397
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk57SJ4LJFcjs.ThemeContext.Provider, { value: theme[resolved], children: hasPortalHost ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.PortalHost, { children }) : children });
|
|
398
402
|
}
|
|
399
403
|
|
|
400
404
|
// src/theme/palette.ts
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
13
|
+
|
|
14
|
+
// src/components/typography/typography.tsx
|
|
15
|
+
var _react = require('react');
|
|
16
|
+
var _reactnative = require('react-native');
|
|
17
|
+
|
|
18
|
+
// src/components/typography/typography.recipe.ts
|
|
19
|
+
var SLOTS = ["root"];
|
|
20
|
+
var VARIANT_TOKENS = {
|
|
21
|
+
h1: { fg: "foreground" },
|
|
22
|
+
h2: { fg: "foreground" },
|
|
23
|
+
h3: { fg: "foreground" },
|
|
24
|
+
h4: { fg: "foreground" },
|
|
25
|
+
h5: { fg: "foreground" },
|
|
26
|
+
h6: { fg: "foreground" },
|
|
27
|
+
body: { fg: "foreground" },
|
|
28
|
+
"body-sm": { fg: "foreground" },
|
|
29
|
+
"body-xs": { fg: "foreground" },
|
|
30
|
+
code: { fg: "foreground" }
|
|
31
|
+
};
|
|
32
|
+
var ROLES = {
|
|
33
|
+
h1: { step: "4xl", weight: "bold", family: "heading", letterSpacing: -0.5 },
|
|
34
|
+
h2: { step: "3xl", weight: "bold", family: "heading", letterSpacing: -0.4 },
|
|
35
|
+
h3: { step: "2xl", weight: "bold", family: "heading", letterSpacing: -0.3 },
|
|
36
|
+
h4: { step: "xl", weight: "semibold", family: "heading" },
|
|
37
|
+
h5: { step: "lg", weight: "semibold", family: "heading" },
|
|
38
|
+
h6: { step: "md", weight: "semibold", family: "heading" },
|
|
39
|
+
body: { step: "md", weight: "regular", family: "body" },
|
|
40
|
+
"body-sm": { step: "sm", weight: "regular", family: "body" },
|
|
41
|
+
"body-xs": { step: "xs", weight: "regular", family: "body" },
|
|
42
|
+
code: { step: "sm", weight: "regular", family: "mono", chip: true }
|
|
43
|
+
};
|
|
44
|
+
function metricsOf({ step, weight, family, letterSpacing, chip }) {
|
|
45
|
+
return (theme) => ({
|
|
46
|
+
root: {
|
|
47
|
+
fontSize: theme.fontSizes[step],
|
|
48
|
+
lineHeight: theme.lineHeights[step],
|
|
49
|
+
fontWeight: theme.fontWeights[weight],
|
|
50
|
+
fontFamily: theme.fontFamilies[family],
|
|
51
|
+
...letterSpacing === void 0 ? {} : { letterSpacing },
|
|
52
|
+
...chip === void 0 ? {} : {
|
|
53
|
+
alignSelf: "flex-start",
|
|
54
|
+
backgroundColor: theme.colors.default,
|
|
55
|
+
paddingHorizontal: theme.spacing(1.5),
|
|
56
|
+
paddingVertical: theme.spacing(0.5),
|
|
57
|
+
borderRadius: theme.radius.md
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
var ROLE_AXIS = Object.fromEntries(
|
|
63
|
+
Object.entries(ROLES).map(([name, spec]) => [name, metricsOf(spec)])
|
|
64
|
+
);
|
|
65
|
+
var typographyRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
66
|
+
slots: SLOTS,
|
|
67
|
+
variantTokens: VARIANT_TOKENS,
|
|
68
|
+
// Ink only. The chip's fill is a token, not a role, so it belongs to the metrics above —
|
|
69
|
+
// where it also stays inside the cache key instead of being recomputed with the tint.
|
|
70
|
+
paint: (_theme, colors) => ({ root: { color: colors.fg } }),
|
|
71
|
+
variants: { variant: ROLE_AXIS },
|
|
72
|
+
defaultVariants: { variant: "body" }
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// src/components/typography/typography.tsx
|
|
76
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
77
|
+
var Typography = _react.forwardRef.call(void 0, function Typography2({ children, variant, color, asChild = false, style, ...props }, ref) {
|
|
78
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
79
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
80
|
+
const selection = { variant };
|
|
81
|
+
const styles = typographyRecipe.resolve({ theme, selection });
|
|
82
|
+
const tint = color ? typographyRecipe.tint({ theme, color, selection }) : void 0;
|
|
83
|
+
const rootStyle = [styles.root, _optionalChain([tint, 'optionalAccess', _ => _.root]), styleProps, style];
|
|
84
|
+
const Root = asChild ? _chunk7GHM4GKLcjs.Slot : _reactnative.Text;
|
|
85
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Root, { ref, style: rootStyle, ...rest, children });
|
|
86
|
+
});
|
|
87
|
+
Typography.displayName = "XAUI.Typography";
|
|
88
|
+
|
|
89
|
+
// src/components/typography/text-span.tsx
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
var TextSpan = _react.forwardRef.call(void 0, function TextSpan2({ children, asChild = false, style, ...props }, ref) {
|
|
94
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
95
|
+
const Root = asChild ? _chunk7GHM4GKLcjs.Slot : _reactnative.Text;
|
|
96
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Root, { ref, style: [styleProps, style], ...rest, children });
|
|
97
|
+
});
|
|
98
|
+
TextSpan.displayName = "XAUI.TextSpan";
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
exports.typographyRecipe = typographyRecipe; exports.Typography = Typography; exports.TextSpan = TextSpan;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// src/system/selection-fill/selection-fill.tsx
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle, useDerivedValue, withTiming } from "react-native-reanimated";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var DURATION = 120;
|
|
6
|
+
var FROM_SCALE = 0.8;
|
|
7
|
+
function SelectionFill({
|
|
8
|
+
isVisible,
|
|
9
|
+
style,
|
|
10
|
+
animation = true,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
if (!animation) {
|
|
14
|
+
return isVisible ? /* @__PURE__ */jsx(View, {
|
|
15
|
+
style,
|
|
16
|
+
children
|
|
17
|
+
}) : null;
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */jsx(AnimatedFill, {
|
|
20
|
+
isVisible,
|
|
21
|
+
style,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
SelectionFill.displayName = "XAUI.SelectionFill";
|
|
26
|
+
const _worklet_13281565252924_init_data = {
|
|
27
|
+
code: "function chunkBA2DBSANJs1(){const{withTiming,isVisible,DURATION}=this.__closure;return withTiming(isVisible?1:0,{duration:DURATION});}",
|
|
28
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BA2DBSAN.js",
|
|
29
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkBA2DBSANJs1\",\"withTiming\",\"isVisible\",\"DURATION\",\"__closure\",\"duration\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BA2DBSAN.js\"],\"mappings\":\"AA2BmC,SAAAA,gBAAMA,CAAA,QAAAC,UAAA,CAAAC,SAAA,CAAAC,QAAA,OAAAC,SAAA,CAErC,MAAO,CAAAH,UAAU,CAACC,SAAS,CAAG,CAAC,CAAG,CAAC,CAAE,CAAEG,QAAQ,CAAEF,QAAS,CAAC,CAAC,CAC9D\",\"ignoreList\":[]}"
|
|
30
|
+
};
|
|
31
|
+
const _worklet_2224484425301_init_data = {
|
|
32
|
+
code: "function chunkBA2DBSANJs2(){const{progress,FROM_SCALE}=this.__closure;return{opacity:progress.value,transform:[{scale:FROM_SCALE+(1-FROM_SCALE)*progress.value}]};}",
|
|
33
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BA2DBSAN.js",
|
|
34
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkBA2DBSANJs2\",\"progress\",\"FROM_SCALE\",\"__closure\",\"opacity\",\"value\",\"transform\",\"scale\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BA2DBSAN.js\"],\"mappings\":\"AA+ByC,SAAAA,gBAAMA,CAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,CAE3C,MAAO,CACLC,OAAO,CAAEH,QAAQ,CAACI,KAAK,CACvBC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEL,UAAU,CAAG,CAAC,CAAC,CAAGA,UAAU,EAAID,QAAQ,CAACI,KAAM,CAAC,CACvE,CAAC,CACH\",\"ignoreList\":[]}"
|
|
35
|
+
};
|
|
36
|
+
function AnimatedFill({
|
|
37
|
+
isVisible,
|
|
38
|
+
style,
|
|
39
|
+
children
|
|
40
|
+
}) {
|
|
41
|
+
const progress = useDerivedValue(function chunkBA2DBSANJs1Factory({
|
|
42
|
+
_worklet_13281565252924_init_data,
|
|
43
|
+
withTiming,
|
|
44
|
+
isVisible,
|
|
45
|
+
DURATION
|
|
46
|
+
}) {
|
|
47
|
+
const _e = [new global.Error(), -4, -27];
|
|
48
|
+
const chunkBA2DBSANJs1 = function () {
|
|
49
|
+
return withTiming(isVisible ? 1 : 0, {
|
|
50
|
+
duration: DURATION
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
chunkBA2DBSANJs1.__closure = {
|
|
54
|
+
withTiming,
|
|
55
|
+
isVisible,
|
|
56
|
+
DURATION
|
|
57
|
+
};
|
|
58
|
+
chunkBA2DBSANJs1.__workletHash = 13281565252924;
|
|
59
|
+
chunkBA2DBSANJs1.__pluginVersion = "0.7.4";
|
|
60
|
+
chunkBA2DBSANJs1.__initData = _worklet_13281565252924_init_data;
|
|
61
|
+
chunkBA2DBSANJs1.__stackDetails = _e;
|
|
62
|
+
return chunkBA2DBSANJs1;
|
|
63
|
+
}({
|
|
64
|
+
_worklet_13281565252924_init_data,
|
|
65
|
+
withTiming,
|
|
66
|
+
isVisible,
|
|
67
|
+
DURATION
|
|
68
|
+
}), [isVisible]);
|
|
69
|
+
const animatedStyle = useAnimatedStyle(function chunkBA2DBSANJs2Factory({
|
|
70
|
+
_worklet_2224484425301_init_data,
|
|
71
|
+
progress,
|
|
72
|
+
FROM_SCALE
|
|
73
|
+
}) {
|
|
74
|
+
const _e = [new global.Error(), -3, -27];
|
|
75
|
+
const chunkBA2DBSANJs2 = function () {
|
|
76
|
+
return {
|
|
77
|
+
opacity: progress.value,
|
|
78
|
+
transform: [{
|
|
79
|
+
scale: FROM_SCALE + (1 - FROM_SCALE) * progress.value
|
|
80
|
+
}]
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
chunkBA2DBSANJs2.__closure = {
|
|
84
|
+
progress,
|
|
85
|
+
FROM_SCALE
|
|
86
|
+
};
|
|
87
|
+
chunkBA2DBSANJs2.__workletHash = 2224484425301;
|
|
88
|
+
chunkBA2DBSANJs2.__pluginVersion = "0.7.4";
|
|
89
|
+
chunkBA2DBSANJs2.__initData = _worklet_2224484425301_init_data;
|
|
90
|
+
chunkBA2DBSANJs2.__stackDetails = _e;
|
|
91
|
+
return chunkBA2DBSANJs2;
|
|
92
|
+
}({
|
|
93
|
+
_worklet_2224484425301_init_data,
|
|
94
|
+
progress,
|
|
95
|
+
FROM_SCALE
|
|
96
|
+
}), [progress]);
|
|
97
|
+
return /* @__PURE__ */jsx(Animated.View, {
|
|
98
|
+
style: [style, animatedStyle],
|
|
99
|
+
children
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
export { SelectionFill };
|