@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40
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-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-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/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 +400 -4
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +423 -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 +254 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { IconContext } from "./chunk-FHUYHV6J.js";
|
|
2
|
+
import { createRecipe, radiusAxis } from "./chunk-4GTAZM2C.js";
|
|
3
|
+
import { useXAUITheme } from "./chunk-A3EGFI6T.js";
|
|
4
|
+
import { Slot, childrenToString, createSlotContext } from "./chunk-K72UDPVN.js";
|
|
5
|
+
import { useStyleProps } from "./chunk-M63GFNKV.js";
|
|
6
|
+
|
|
7
|
+
// src/components/avatar/avatar-fallback.tsx
|
|
8
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
9
|
+
import { View } from "react-native";
|
|
10
|
+
|
|
11
|
+
// src/components/avatar/avatar-initials.tsx
|
|
12
|
+
import { forwardRef } from "react";
|
|
13
|
+
import { Text } from "react-native";
|
|
14
|
+
|
|
15
|
+
// src/components/avatar/avatar.context.ts
|
|
16
|
+
var [AvatarProvider, useAvatar] = createSlotContext("Avatar");
|
|
17
|
+
|
|
18
|
+
// src/components/avatar/avatar-initials.tsx
|
|
19
|
+
import { jsx } from "react/jsx-runtime";
|
|
20
|
+
var AvatarInitials = forwardRef(function AvatarInitials2({
|
|
21
|
+
children,
|
|
22
|
+
style,
|
|
23
|
+
...props
|
|
24
|
+
}, ref) {
|
|
25
|
+
const {
|
|
26
|
+
initialsStyle
|
|
27
|
+
} = useAvatar();
|
|
28
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
29
|
+
return /* @__PURE__ */jsx(Text, {
|
|
30
|
+
ref,
|
|
31
|
+
accessibilityElementsHidden: true,
|
|
32
|
+
importantForAccessibility: "no",
|
|
33
|
+
numberOfLines: 1,
|
|
34
|
+
...rest,
|
|
35
|
+
style: [initialsStyle, styleProps, style],
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
AvatarInitials.displayName = "XAUI.Avatar.Initials";
|
|
40
|
+
|
|
41
|
+
// src/components/avatar/avatar-fallback.tsx
|
|
42
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
43
|
+
var AvatarFallback = forwardRef2(function AvatarFallback2({
|
|
44
|
+
children,
|
|
45
|
+
style,
|
|
46
|
+
...props
|
|
47
|
+
}, ref) {
|
|
48
|
+
const {
|
|
49
|
+
fallbackStyle,
|
|
50
|
+
icon
|
|
51
|
+
} = useAvatar();
|
|
52
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
53
|
+
const text = childrenToString(children);
|
|
54
|
+
const content = text !== null ? /* @__PURE__ */jsx2(AvatarInitials, {
|
|
55
|
+
children: text
|
|
56
|
+
}) : children;
|
|
57
|
+
return /* @__PURE__ */jsx2(View, {
|
|
58
|
+
ref,
|
|
59
|
+
style: [fallbackStyle, styleProps, style],
|
|
60
|
+
...rest,
|
|
61
|
+
children: /* @__PURE__ */jsx2(IconContext.Provider, {
|
|
62
|
+
value: icon,
|
|
63
|
+
children: content
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
AvatarFallback.displayName = "XAUI.Avatar.Fallback";
|
|
68
|
+
|
|
69
|
+
// src/components/avatar/avatar-image.tsx
|
|
70
|
+
import { forwardRef as forwardRef3, useCallback } from "react";
|
|
71
|
+
import { Image } from "react-native";
|
|
72
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
73
|
+
|
|
74
|
+
// src/components/avatar/avatar.style.ts
|
|
75
|
+
import { StyleSheet } from "react-native";
|
|
76
|
+
var avatarSheet = StyleSheet.create({
|
|
77
|
+
image: {
|
|
78
|
+
position: "absolute",
|
|
79
|
+
top: 0,
|
|
80
|
+
bottom: 0,
|
|
81
|
+
start: 0,
|
|
82
|
+
end: 0
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// src/components/avatar/avatar-image.tsx
|
|
87
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
88
|
+
var FADE_DURATION = 200;
|
|
89
|
+
var AvatarImage = forwardRef3(function AvatarImage2({
|
|
90
|
+
animation = true,
|
|
91
|
+
style,
|
|
92
|
+
...props
|
|
93
|
+
}, ref) {
|
|
94
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
95
|
+
const frameStyle = [avatarSheet.image, styleProps, style];
|
|
96
|
+
if (!animation) return /* @__PURE__ */jsx3(Image, {
|
|
97
|
+
ref,
|
|
98
|
+
...rest,
|
|
99
|
+
style: frameStyle
|
|
100
|
+
});
|
|
101
|
+
return /* @__PURE__ */jsx3(FadingImage, {
|
|
102
|
+
ref,
|
|
103
|
+
...rest,
|
|
104
|
+
style: frameStyle
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
AvatarImage.displayName = "XAUI.Avatar.Image";
|
|
108
|
+
const _worklet_11788124035832_init_data = {
|
|
109
|
+
code: "function chunkUFTCTTKKJs1(){const{opacity}=this.__closure;return{opacity:opacity.value};}",
|
|
110
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-UFTCTTKK.js",
|
|
111
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkUFTCTTKKJs1\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-UFTCTTKK.js\"],\"mappings\":\"AAoG2C,SAAAA,gBAAMA,CAAA,QAAAC,OAAA,OAAAC,SAAA,CAE3C,MAAO,CAAED,OAAO,CAAEA,OAAO,CAACE,KAAM,CAAC,CACnC\",\"ignoreList\":[]}"
|
|
112
|
+
};
|
|
113
|
+
var FadingImage = forwardRef3(function FadingImage2({
|
|
114
|
+
onLoad,
|
|
115
|
+
style,
|
|
116
|
+
...props
|
|
117
|
+
}, ref) {
|
|
118
|
+
const opacity = useSharedValue(0);
|
|
119
|
+
const handleLoad = useCallback(event => {
|
|
120
|
+
opacity.value = withTiming(1, {
|
|
121
|
+
duration: FADE_DURATION
|
|
122
|
+
});
|
|
123
|
+
onLoad?.(event);
|
|
124
|
+
}, [opacity, onLoad]);
|
|
125
|
+
const animatedStyle = useAnimatedStyle(function chunkUFTCTTKKJs1Factory({
|
|
126
|
+
_worklet_11788124035832_init_data,
|
|
127
|
+
opacity
|
|
128
|
+
}) {
|
|
129
|
+
const _e = [new global.Error(), -2, -27];
|
|
130
|
+
const chunkUFTCTTKKJs1 = function () {
|
|
131
|
+
return {
|
|
132
|
+
opacity: opacity.value
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
chunkUFTCTTKKJs1.__closure = {
|
|
136
|
+
opacity
|
|
137
|
+
};
|
|
138
|
+
chunkUFTCTTKKJs1.__workletHash = 11788124035832;
|
|
139
|
+
chunkUFTCTTKKJs1.__pluginVersion = "0.7.4";
|
|
140
|
+
chunkUFTCTTKKJs1.__initData = _worklet_11788124035832_init_data;
|
|
141
|
+
chunkUFTCTTKKJs1.__stackDetails = _e;
|
|
142
|
+
return chunkUFTCTTKKJs1;
|
|
143
|
+
}({
|
|
144
|
+
_worklet_11788124035832_init_data,
|
|
145
|
+
opacity
|
|
146
|
+
}), [opacity]);
|
|
147
|
+
return /* @__PURE__ */jsx3(Animated.Image, {
|
|
148
|
+
ref,
|
|
149
|
+
...props,
|
|
150
|
+
onLoad: handleLoad,
|
|
151
|
+
style: [style, animatedStyle]
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// src/components/avatar/avatar.tsx
|
|
156
|
+
import { forwardRef as forwardRef4, useMemo } from "react";
|
|
157
|
+
import { StyleSheet as StyleSheet2, View as View2 } from "react-native";
|
|
158
|
+
|
|
159
|
+
// src/components/avatar/avatar.recipe.ts
|
|
160
|
+
var SLOTS = ["root", "fallback", "initials", "icon"];
|
|
161
|
+
var VARIANT_TOKENS = {
|
|
162
|
+
primary: {
|
|
163
|
+
bg: "accent",
|
|
164
|
+
fg: "accentForeground"
|
|
165
|
+
},
|
|
166
|
+
secondary: {
|
|
167
|
+
bg: "accentSoft",
|
|
168
|
+
fg: "accentSoftForeground"
|
|
169
|
+
},
|
|
170
|
+
default: {
|
|
171
|
+
bg: "default",
|
|
172
|
+
fg: "defaultForeground"
|
|
173
|
+
},
|
|
174
|
+
tertiary: {
|
|
175
|
+
border: "border",
|
|
176
|
+
fg: "foreground"
|
|
177
|
+
},
|
|
178
|
+
ghost: {
|
|
179
|
+
fg: "foreground"
|
|
180
|
+
},
|
|
181
|
+
success: {
|
|
182
|
+
bg: "success",
|
|
183
|
+
fg: "successForeground"
|
|
184
|
+
},
|
|
185
|
+
"success-soft": {
|
|
186
|
+
bg: "successSoft",
|
|
187
|
+
fg: "successSoftForeground"
|
|
188
|
+
},
|
|
189
|
+
warning: {
|
|
190
|
+
bg: "warning",
|
|
191
|
+
fg: "warningForeground"
|
|
192
|
+
},
|
|
193
|
+
"warning-soft": {
|
|
194
|
+
bg: "warningSoft",
|
|
195
|
+
fg: "warningSoftForeground"
|
|
196
|
+
},
|
|
197
|
+
danger: {
|
|
198
|
+
bg: "danger",
|
|
199
|
+
fg: "dangerForeground"
|
|
200
|
+
},
|
|
201
|
+
"danger-soft": {
|
|
202
|
+
bg: "dangerSoft",
|
|
203
|
+
fg: "dangerSoftForeground"
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
function sizeAxis(step) {
|
|
207
|
+
return theme => {
|
|
208
|
+
const diameter = theme.spacing(step.diameter);
|
|
209
|
+
return {
|
|
210
|
+
root: {
|
|
211
|
+
width: diameter,
|
|
212
|
+
height: diameter
|
|
213
|
+
},
|
|
214
|
+
initials: {
|
|
215
|
+
fontSize: theme.fontSizes[step.initials],
|
|
216
|
+
lineHeight: theme.lineHeights[step.initials]
|
|
217
|
+
},
|
|
218
|
+
icon: {
|
|
219
|
+
fontSize: theme.fontSizes[step.glyph]
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
var SIZES = {
|
|
225
|
+
xs: {
|
|
226
|
+
diameter: 8,
|
|
227
|
+
initials: "xs",
|
|
228
|
+
glyph: "xs"
|
|
229
|
+
},
|
|
230
|
+
sm: {
|
|
231
|
+
diameter: 10,
|
|
232
|
+
initials: "xs",
|
|
233
|
+
glyph: "sm"
|
|
234
|
+
},
|
|
235
|
+
md: {
|
|
236
|
+
diameter: 12,
|
|
237
|
+
initials: "sm",
|
|
238
|
+
glyph: "md"
|
|
239
|
+
},
|
|
240
|
+
lg: {
|
|
241
|
+
diameter: 16,
|
|
242
|
+
initials: "md",
|
|
243
|
+
glyph: "xl"
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var avatarRecipe = createRecipe({
|
|
247
|
+
slots: SLOTS,
|
|
248
|
+
base: theme => ({
|
|
249
|
+
root: {
|
|
250
|
+
alignItems: "center",
|
|
251
|
+
justifyContent: "center",
|
|
252
|
+
// The clip is what makes a square photo round, so unlike on the `Chip` it is not
|
|
253
|
+
// optional here: without it the image is a rectangle sitting over a circle.
|
|
254
|
+
overflow: "hidden",
|
|
255
|
+
// Squircle corners for when `radius` overrides the circle. Free on Android.
|
|
256
|
+
borderCurve: "continuous",
|
|
257
|
+
borderWidth: 0
|
|
258
|
+
},
|
|
259
|
+
fallback: {
|
|
260
|
+
width: "100%",
|
|
261
|
+
height: "100%",
|
|
262
|
+
alignItems: "center",
|
|
263
|
+
justifyContent: "center"
|
|
264
|
+
},
|
|
265
|
+
initials: {
|
|
266
|
+
fontFamily: theme.fontFamilies.body,
|
|
267
|
+
fontWeight: theme.fontWeights.medium,
|
|
268
|
+
// Two letters in a circle sit off-centre by the descender otherwise.
|
|
269
|
+
textAlign: "center"
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
variantTokens: VARIANT_TOKENS,
|
|
273
|
+
/**
|
|
274
|
+
* Where the variant's colours land, for every variant at once. The border width follows
|
|
275
|
+
* the *presence* of the border role, so `ghost` needs no rule of its own to say it has
|
|
276
|
+
* no edge.
|
|
277
|
+
*
|
|
278
|
+
* The image takes no colour: it is a photograph, and tinting one is what `Icon`'s
|
|
279
|
+
* `source` form is for.
|
|
280
|
+
*/
|
|
281
|
+
paint: (theme, colors) => ({
|
|
282
|
+
root: {
|
|
283
|
+
backgroundColor: colors.bg,
|
|
284
|
+
borderColor: colors.border,
|
|
285
|
+
borderWidth: colors.border ? theme.borderWidth.default : 0
|
|
286
|
+
},
|
|
287
|
+
initials: {
|
|
288
|
+
color: colors.fg
|
|
289
|
+
},
|
|
290
|
+
icon: {
|
|
291
|
+
color: colors.fg
|
|
292
|
+
}
|
|
293
|
+
}),
|
|
294
|
+
/** Declaration order is application order: `radius` overrides the circle `base` set. */
|
|
295
|
+
variants: {
|
|
296
|
+
size: {
|
|
297
|
+
xs: sizeAxis(SIZES.xs),
|
|
298
|
+
sm: sizeAxis(SIZES.sm),
|
|
299
|
+
md: sizeAxis(SIZES.md),
|
|
300
|
+
lg: sizeAxis(SIZES.lg)
|
|
301
|
+
},
|
|
302
|
+
radius: radiusAxis("root")
|
|
303
|
+
},
|
|
304
|
+
/**
|
|
305
|
+
* A circle at every size, where HeroUI fixes one large radius for all three — which
|
|
306
|
+
* makes their small avatars round and their large ones squircles. `full` says the shape
|
|
307
|
+
* the name means once, and `radius` is still there for the logo that wants a square.
|
|
308
|
+
*/
|
|
309
|
+
defaultVariants: {
|
|
310
|
+
variant: "default",
|
|
311
|
+
size: "md",
|
|
312
|
+
radius: "full"
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// src/components/avatar/avatar.tsx
|
|
317
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
318
|
+
var AvatarRoot = forwardRef4(function Avatar({
|
|
319
|
+
children,
|
|
320
|
+
variant,
|
|
321
|
+
size,
|
|
322
|
+
radius,
|
|
323
|
+
color,
|
|
324
|
+
asChild = false,
|
|
325
|
+
style,
|
|
326
|
+
...props
|
|
327
|
+
}, ref) {
|
|
328
|
+
const theme = useXAUITheme();
|
|
329
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
330
|
+
const selection = {
|
|
331
|
+
variant,
|
|
332
|
+
size,
|
|
333
|
+
radius
|
|
334
|
+
};
|
|
335
|
+
const styles = avatarRecipe.resolve({
|
|
336
|
+
theme,
|
|
337
|
+
selection
|
|
338
|
+
});
|
|
339
|
+
const tint = color ? avatarRecipe.tint({
|
|
340
|
+
theme,
|
|
341
|
+
color,
|
|
342
|
+
selection
|
|
343
|
+
}) : void 0;
|
|
344
|
+
const context = useMemo(() => {
|
|
345
|
+
const icon = StyleSheet2.flatten([styles.icon, tint?.icon]);
|
|
346
|
+
return {
|
|
347
|
+
fallbackStyle: styles.fallback,
|
|
348
|
+
initialsStyle: tint ? [styles.initials, tint.initials] : styles.initials,
|
|
349
|
+
icon: {
|
|
350
|
+
size: icon.fontSize,
|
|
351
|
+
// `ColorValue` also covers the platform's opaque colours, which `Icon` cannot
|
|
352
|
+
// hand to a third-party component expecting a string.
|
|
353
|
+
color: typeof icon.color === "string" ? icon.color : void 0
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
}, [styles, tint]);
|
|
357
|
+
const rootStyle = [styles.root, tint?.root, styleProps, style];
|
|
358
|
+
const text = childrenToString(children);
|
|
359
|
+
const content = text !== null ? /* @__PURE__ */jsx4(AvatarFallback, {
|
|
360
|
+
children: text
|
|
361
|
+
}) : children;
|
|
362
|
+
const Root = asChild ? Slot : View2;
|
|
363
|
+
return /* @__PURE__ */jsx4(AvatarProvider, {
|
|
364
|
+
value: context,
|
|
365
|
+
children: /* @__PURE__ */jsx4(Root, {
|
|
366
|
+
ref,
|
|
367
|
+
...rest,
|
|
368
|
+
style: rootStyle,
|
|
369
|
+
children: asChild ? children : content
|
|
370
|
+
})
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
AvatarRoot.displayName = "XAUI.Avatar.Root";
|
|
374
|
+
|
|
375
|
+
// src/components/avatar/index.ts
|
|
376
|
+
var Avatar2 = Object.assign(AvatarRoot, {
|
|
377
|
+
Image: AvatarImage,
|
|
378
|
+
Fallback: AvatarFallback,
|
|
379
|
+
Initials: AvatarInitials
|
|
380
|
+
});
|
|
381
|
+
export { useAvatar, avatarRecipe, Avatar2 as Avatar };
|
|
@@ -0,0 +1,67 @@
|
|
|
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 _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
4
|
+
|
|
5
|
+
// src/system/portal/portal-context.ts
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
var PortalContext = _react.createContext.call(void 0, null);
|
|
8
|
+
|
|
9
|
+
// src/system/portal/portal.tsx
|
|
10
|
+
|
|
11
|
+
function Portal({ children }) {
|
|
12
|
+
const context = _react.useContext.call(void 0, PortalContext);
|
|
13
|
+
const key = _react.useId.call(void 0, );
|
|
14
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
15
|
+
_optionalChain([context, 'optionalAccess', _ => _.addPortal, 'call', _2 => _2(key, children)]);
|
|
16
|
+
}, [children, context, key]);
|
|
17
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
18
|
+
return () => _optionalChain([context, 'optionalAccess', _3 => _3.removePortal, 'call', _4 => _4(key)]);
|
|
19
|
+
}, [context, key]);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
Portal.displayName = "XAUI.Portal";
|
|
23
|
+
|
|
24
|
+
// src/system/portal/portal-host.tsx
|
|
25
|
+
|
|
26
|
+
var _reactnative = require('react-native');
|
|
27
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
28
|
+
var styles = _reactnative.StyleSheet.create({
|
|
29
|
+
container: { flex: 1 }
|
|
30
|
+
});
|
|
31
|
+
function PortalHost({ children, ...props }) {
|
|
32
|
+
const [styleProps] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
33
|
+
const [portals, setPortals] = _react.useState.call(void 0, /* @__PURE__ */ new Map());
|
|
34
|
+
const [origin, setOrigin] = _react.useState.call(void 0, { x: 0, y: 0 });
|
|
35
|
+
const node = _react.useRef.call(void 0, null);
|
|
36
|
+
const measure = _react.useCallback.call(void 0, (_event) => {
|
|
37
|
+
_optionalChain([node, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.measureInWindow, 'call', _7 => _7((x, y) => {
|
|
38
|
+
setOrigin((current) => current.x === x && current.y === y ? current : { x, y });
|
|
39
|
+
})]);
|
|
40
|
+
}, []);
|
|
41
|
+
const addPortal = _react.useCallback.call(void 0, (key, element) => {
|
|
42
|
+
setPortals((current) => new Map(current).set(key, element));
|
|
43
|
+
}, []);
|
|
44
|
+
const removePortal = _react.useCallback.call(void 0, (key) => {
|
|
45
|
+
setPortals((current) => {
|
|
46
|
+
if (!current.has(key)) return current;
|
|
47
|
+
const next = new Map(current);
|
|
48
|
+
next.delete(key);
|
|
49
|
+
return next;
|
|
50
|
+
});
|
|
51
|
+
}, []);
|
|
52
|
+
const methods = _react.useMemo.call(void 0,
|
|
53
|
+
() => ({ addPortal, removePortal, origin }),
|
|
54
|
+
[addPortal, removePortal, origin]
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PortalContext.Provider, { value: methods, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { ref: node, onLayout: measure, style: [styles.container, styleProps], children: [
|
|
57
|
+
children,
|
|
58
|
+
Array.from(portals, ([key, element]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: element }, key))
|
|
59
|
+
] }) });
|
|
60
|
+
}
|
|
61
|
+
PortalHost.displayName = "XAUI.PortalHost";
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
exports.PortalContext = PortalContext; exports.Portal = Portal; exports.PortalHost = PortalHost;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkH4E4HDEPcjs = require('./chunk-H4E4HDEP.cjs');
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-merged-ref.ts
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
function useMergedRef(...refs) {
|
|
8
|
+
return _react.useMemo.call(void 0, () => _chunkH4E4HDEPcjs.mergeRefs.call(void 0, ...refs), refs);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.useMergedRef = useMergedRef;
|
|
File without changes
|
|
@@ -1,36 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PortalHost
|
|
3
|
+
} from "./chunk-2PMXMKS5.js";
|
|
1
4
|
import {
|
|
2
5
|
ThemeContext,
|
|
3
6
|
alpha,
|
|
4
7
|
mix
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-A3EGFI6T.js";
|
|
9
|
+
import {
|
|
10
|
+
stableHash
|
|
11
|
+
} from "./chunk-M63GFNKV.js";
|
|
6
12
|
|
|
7
13
|
// src/provider/xaui-provider.tsx
|
|
8
14
|
import { useColorScheme } from "react-native";
|
|
9
15
|
|
|
10
|
-
// src/utils/stable-hash.ts
|
|
11
|
-
function canonical(value) {
|
|
12
|
-
if (value === null || typeof value !== "object") return 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: mix(s.accent, s.
|
|
31
|
-
successPressed: mix(s.success, s.
|
|
32
|
-
warningPressed: mix(s.warning, s.
|
|
33
|
-
dangerPressed: mix(s.danger, s.
|
|
19
|
+
accentPressed: mix(s.accent, s.foreground, 0.1),
|
|
20
|
+
successPressed: mix(s.success, s.foreground, 0.1),
|
|
21
|
+
warningPressed: mix(s.warning, s.foreground, 0.1),
|
|
22
|
+
dangerPressed: mix(s.danger, s.foreground, 0.1),
|
|
34
23
|
defaultPressed: mix(s.default, s.defaultForeground, 0.04),
|
|
35
24
|
surfacePressed: mix(s.surface, s.surfaceForeground, 0.08),
|
|
36
25
|
defaultSoft: alpha(s.default, 0.5),
|
|
@@ -63,6 +52,7 @@ function deriveColors(s) {
|
|
|
63
52
|
}
|
|
64
53
|
|
|
65
54
|
// src/theme/scales.ts
|
|
55
|
+
import { Platform } from "react-native";
|
|
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: 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)",
|
|
@@ -387,14 +389,16 @@ function createTheme(config = {}) {
|
|
|
387
389
|
var defaultTheme = createTheme();
|
|
388
390
|
|
|
389
391
|
// src/provider/xaui-provider.tsx
|
|
392
|
+
import { jsx } from "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 = useColorScheme();
|
|
396
400
|
const resolved = colorMode === "system" ? scheme === "dark" ? "dark" : "light" : colorMode;
|
|
397
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: theme[resolved], children: hasPortalHost ? /* @__PURE__ */ jsx(PortalHost, { children }) : children });
|
|
398
402
|
}
|
|
399
403
|
|
|
400
404
|
// src/theme/palette.ts
|