@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.
Files changed (209) hide show
  1. package/dist/chunk-2EGR4LWD.js +145 -0
  2. package/dist/chunk-2NRZKJG7.js +531 -0
  3. package/dist/chunk-2PMXMKS5.js +67 -0
  4. package/dist/chunk-2XPG2243.js +586 -0
  5. package/dist/chunk-36PRYGAM.js +13 -0
  6. package/dist/chunk-3E7CDKFO.cjs +696 -0
  7. package/dist/chunk-3GFRSZYR.js +54 -0
  8. package/dist/chunk-423RQBOX.js +21 -0
  9. package/dist/chunk-4CUZZWFW.js +92 -0
  10. package/dist/chunk-4GTAZM2C.js +174 -0
  11. package/dist/chunk-4KFKWBN5.cjs +89 -0
  12. package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
  13. package/dist/chunk-5R26NM4M.cjs +402 -0
  14. package/dist/chunk-5VKYNBNA.js +607 -0
  15. package/dist/chunk-64MXEVT3.js +66 -0
  16. package/dist/chunk-6DOLGZVV.cjs +147 -0
  17. package/dist/chunk-6L2TS2R3.cjs +92 -0
  18. package/dist/chunk-6UEZJRVI.js +669 -0
  19. package/dist/chunk-734MFAX4.js +27 -0
  20. package/dist/chunk-73RKQC5X.js +104 -0
  21. package/dist/chunk-7DPL3ZDS.cjs +21 -0
  22. package/dist/chunk-7EIHHOHP.cjs +42 -0
  23. package/dist/chunk-7GHM4GKL.cjs +119 -0
  24. package/dist/chunk-7YF5NAHQ.cjs +74 -0
  25. package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
  26. package/dist/chunk-ABAGZTXZ.cjs +736 -0
  27. package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
  28. package/dist/chunk-AMCSSOJT.cjs +104 -0
  29. package/dist/chunk-BA2DBSAN.js +102 -0
  30. package/dist/chunk-BRRXFOBY.js +431 -0
  31. package/dist/chunk-C5YLPCFC.cjs +293 -0
  32. package/dist/chunk-DA3OKXHV.cjs +700 -0
  33. package/dist/chunk-DD4276RF.js +366 -0
  34. package/dist/chunk-DG2I4PJG.js +701 -0
  35. package/dist/chunk-DHGLGSH6.js +661 -0
  36. package/dist/chunk-DIBUQ46Y.js +346 -0
  37. package/dist/chunk-EGLLDKN6.js +9 -0
  38. package/dist/chunk-EJQCQPET.cjs +9 -0
  39. package/dist/chunk-EKS3W46M.cjs +66 -0
  40. package/dist/chunk-EZEYMLO3.js +402 -0
  41. package/dist/chunk-F6CQ6CBI.cjs +112 -0
  42. package/dist/chunk-F6W3JQ7K.js +42 -0
  43. package/dist/chunk-FHUYHV6J.js +89 -0
  44. package/dist/chunk-FNEUOBCV.cjs +174 -0
  45. package/dist/chunk-G3CCT4EY.js +518 -0
  46. package/dist/chunk-G7P3ERYF.cjs +478 -0
  47. package/dist/chunk-GA6PBWNT.js +147 -0
  48. package/dist/chunk-GFUZ3MUT.cjs +455 -0
  49. package/dist/chunk-GGW43Q37.cjs +1 -0
  50. package/dist/chunk-GTR5X65M.cjs +27 -0
  51. package/dist/chunk-H4E4HDEP.cjs +13 -0
  52. package/dist/chunk-H7DS4IO7.js +198 -0
  53. package/dist/chunk-HDVVZG4S.cjs +198 -0
  54. package/dist/chunk-IKJVLJKT.js +151 -0
  55. package/dist/chunk-J3MB4PI5.cjs +531 -0
  56. package/dist/chunk-K72UDPVN.js +119 -0
  57. package/dist/chunk-KCMYU7WF.js +86 -0
  58. package/dist/chunk-LRN3RNDO.js +940 -0
  59. package/dist/chunk-LTX6TB5I.js +124 -0
  60. package/dist/chunk-LUPCPLND.cjs +145 -0
  61. package/dist/chunk-M63GFNKV.js +194 -0
  62. package/dist/chunk-N3KTZMPG.js +293 -0
  63. package/dist/chunk-NCTOTTVW.js +13 -0
  64. package/dist/chunk-NWGLP6JX.cjs +410 -0
  65. package/dist/chunk-R73XQK7X.cjs +314 -0
  66. package/dist/chunk-RU7JCMWC.cjs +881 -0
  67. package/dist/chunk-SNIHUKDA.cjs +184 -0
  68. package/dist/chunk-T5FV5F7A.cjs +607 -0
  69. package/dist/chunk-TDTUAIFF.cjs +153 -0
  70. package/dist/chunk-TJ74XVZN.cjs +431 -0
  71. package/dist/chunk-TK44VBIE.cjs +194 -0
  72. package/dist/chunk-UAWBAD4E.cjs +346 -0
  73. package/dist/chunk-UFTCTTKK.js +381 -0
  74. package/dist/chunk-VLKBESEV.cjs +407 -0
  75. package/dist/chunk-WDDXU3OH.cjs +67 -0
  76. package/dist/chunk-WFEMJCXO.cjs +13 -0
  77. package/dist/chunk-WHJTBTYM.js +0 -0
  78. package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
  79. package/dist/chunk-XFPQFCEK.js +455 -0
  80. package/dist/chunk-XSQPVDFH.cjs +60 -0
  81. package/dist/chunk-XTC2SLFT.js +153 -0
  82. package/dist/chunk-XV735BSA.cjs +366 -0
  83. package/dist/chunk-XWNG2U4K.cjs +124 -0
  84. package/dist/chunk-YGYYJ3LQ.js +314 -0
  85. package/dist/chunk-YVHT2UVW.js +74 -0
  86. package/dist/chunk-ZFOOJK37.cjs +86 -0
  87. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  88. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  89. package/dist/components/accordion/index.cjs +35 -0
  90. package/dist/components/accordion/index.d.cts +299 -0
  91. package/dist/components/accordion/index.d.ts +299 -0
  92. package/dist/components/accordion/index.js +35 -0
  93. package/dist/components/alert/index.cjs +20 -0
  94. package/dist/components/alert/index.d.cts +169 -0
  95. package/dist/components/alert/index.d.ts +169 -0
  96. package/dist/components/alert/index.js +20 -0
  97. package/dist/components/avatar/index.cjs +16 -0
  98. package/dist/components/avatar/index.d.cts +131 -0
  99. package/dist/components/avatar/index.d.ts +131 -0
  100. package/dist/components/avatar/index.js +16 -0
  101. package/dist/components/badge/index.cjs +15 -0
  102. package/dist/components/badge/index.d.cts +157 -0
  103. package/dist/components/badge/index.d.ts +157 -0
  104. package/dist/components/badge/index.js +15 -0
  105. package/dist/components/button/index.cjs +22 -0
  106. package/dist/components/button/index.d.cts +613 -0
  107. package/dist/components/button/index.d.ts +613 -0
  108. package/dist/components/button/index.js +22 -0
  109. package/dist/components/card/index.cjs +22 -0
  110. package/dist/components/card/index.d.cts +620 -0
  111. package/dist/components/card/index.d.ts +620 -0
  112. package/dist/components/card/index.js +22 -0
  113. package/dist/components/checkbox/index.cjs +26 -0
  114. package/dist/components/checkbox/index.d.cts +1136 -0
  115. package/dist/components/checkbox/index.d.ts +1136 -0
  116. package/dist/components/checkbox/index.js +26 -0
  117. package/dist/components/chip/index.cjs +20 -0
  118. package/dist/components/chip/index.d.cts +608 -0
  119. package/dist/components/chip/index.d.ts +608 -0
  120. package/dist/components/chip/index.js +20 -0
  121. package/dist/components/divider/index.cjs +13 -0
  122. package/dist/components/divider/index.d.cts +117 -0
  123. package/dist/components/divider/index.d.ts +117 -0
  124. package/dist/components/divider/index.js +13 -0
  125. package/dist/components/field-group/index.cjs +27 -0
  126. package/dist/components/field-group/index.d.cts +270 -0
  127. package/dist/components/field-group/index.d.ts +270 -0
  128. package/dist/components/field-group/index.js +27 -0
  129. package/dist/components/input-otp/index.cjs +29 -0
  130. package/dist/components/input-otp/index.d.cts +325 -0
  131. package/dist/components/input-otp/index.d.ts +325 -0
  132. package/dist/components/input-otp/index.js +29 -0
  133. package/dist/components/menu/index.cjs +49 -0
  134. package/dist/components/menu/index.d.cts +351 -0
  135. package/dist/components/menu/index.d.ts +351 -0
  136. package/dist/components/menu/index.js +49 -0
  137. package/dist/components/popover/index.cjs +38 -0
  138. package/dist/components/popover/index.d.cts +254 -0
  139. package/dist/components/popover/index.d.ts +254 -0
  140. package/dist/components/popover/index.js +38 -0
  141. package/dist/components/radio/index.cjs +26 -0
  142. package/dist/components/radio/index.d.cts +1102 -0
  143. package/dist/components/radio/index.d.ts +1102 -0
  144. package/dist/components/radio/index.js +26 -0
  145. package/dist/components/select/index.cjs +50 -0
  146. package/dist/components/select/index.d.cts +498 -0
  147. package/dist/components/select/index.d.ts +498 -0
  148. package/dist/components/select/index.js +50 -0
  149. package/dist/components/skeleton/index.cjs +11 -0
  150. package/dist/components/skeleton/index.d.cts +111 -0
  151. package/dist/components/skeleton/index.d.ts +111 -0
  152. package/dist/components/skeleton/index.js +11 -0
  153. package/dist/components/spinner/index.cjs +17 -0
  154. package/dist/components/spinner/index.d.cts +104 -0
  155. package/dist/components/spinner/index.d.ts +104 -0
  156. package/dist/components/spinner/index.js +17 -0
  157. package/dist/components/switch/index.cjs +27 -0
  158. package/dist/components/switch/index.d.cts +1154 -0
  159. package/dist/components/switch/index.d.ts +1154 -0
  160. package/dist/components/switch/index.js +27 -0
  161. package/dist/components/tabs/index.cjs +33 -0
  162. package/dist/components/tabs/index.d.cts +261 -0
  163. package/dist/components/tabs/index.d.ts +261 -0
  164. package/dist/components/tabs/index.js +33 -0
  165. package/dist/components/text-area/index.cjs +14 -0
  166. package/dist/components/text-area/index.d.cts +73 -0
  167. package/dist/components/text-area/index.d.ts +73 -0
  168. package/dist/components/text-area/index.js +14 -0
  169. package/dist/components/text-field/index.cjs +25 -0
  170. package/dist/components/text-field/index.d.cts +205 -0
  171. package/dist/components/text-field/index.d.ts +205 -0
  172. package/dist/components/text-field/index.js +25 -0
  173. package/dist/components/typography/index.cjs +15 -0
  174. package/dist/components/typography/index.d.cts +116 -0
  175. package/dist/components/typography/index.d.ts +116 -0
  176. package/dist/components/typography/index.js +15 -0
  177. package/dist/components/view/index.cjs +17 -0
  178. package/dist/components/view/index.d.cts +152 -0
  179. package/dist/components/view/index.d.ts +152 -0
  180. package/dist/components/view/index.js +17 -0
  181. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  182. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  183. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  184. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  185. package/dist/index.cjs +423 -5
  186. package/dist/index.d.cts +119 -4
  187. package/dist/index.d.ts +119 -4
  188. package/dist/index.js +445 -27
  189. package/dist/placement-DHa0Rrh1.d.cts +38 -0
  190. package/dist/placement-DHa0Rrh1.d.ts +38 -0
  191. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  192. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  193. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  194. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  195. package/dist/system/index.cjs +73 -4
  196. package/dist/system/index.d.cts +379 -193
  197. package/dist/system/index.d.ts +379 -193
  198. package/dist/system/index.js +87 -18
  199. package/dist/text-field.type-0l73acce.d.ts +167 -0
  200. package/dist/text-field.type-DBh06DU5.d.cts +167 -0
  201. package/dist/theme/index.cjs +5 -3
  202. package/dist/theme/index.d.cts +55 -24
  203. package/dist/theme/index.d.ts +55 -24
  204. package/dist/theme/index.js +4 -2
  205. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  206. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  207. package/package.json +264 -18
  208. package/dist/chunk-ECDWSSHJ.js +0 -688
  209. 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 };