@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.
Files changed (203) 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-G7P3ERYF.cjs +478 -0
  46. package/dist/chunk-GA6PBWNT.js +147 -0
  47. package/dist/chunk-GFUZ3MUT.cjs +455 -0
  48. package/dist/chunk-GGW43Q37.cjs +1 -0
  49. package/dist/chunk-GTR5X65M.cjs +27 -0
  50. package/dist/chunk-H4E4HDEP.cjs +13 -0
  51. package/dist/chunk-H7DS4IO7.js +198 -0
  52. package/dist/chunk-HDVVZG4S.cjs +198 -0
  53. package/dist/chunk-IKJVLJKT.js +151 -0
  54. package/dist/chunk-J3MB4PI5.cjs +531 -0
  55. package/dist/chunk-K72UDPVN.js +119 -0
  56. package/dist/chunk-KCMYU7WF.js +86 -0
  57. package/dist/chunk-LRN3RNDO.js +940 -0
  58. package/dist/chunk-LTX6TB5I.js +124 -0
  59. package/dist/chunk-LUPCPLND.cjs +145 -0
  60. package/dist/chunk-M63GFNKV.js +194 -0
  61. package/dist/chunk-N3KTZMPG.js +293 -0
  62. package/dist/chunk-NCTOTTVW.js +13 -0
  63. package/dist/chunk-NWGLP6JX.cjs +410 -0
  64. package/dist/chunk-R73XQK7X.cjs +314 -0
  65. package/dist/chunk-RU7JCMWC.cjs +881 -0
  66. package/dist/chunk-SNIHUKDA.cjs +184 -0
  67. package/dist/chunk-T5FV5F7A.cjs +607 -0
  68. package/dist/chunk-TDTUAIFF.cjs +153 -0
  69. package/dist/chunk-TJ74XVZN.cjs +431 -0
  70. package/dist/chunk-TK44VBIE.cjs +194 -0
  71. package/dist/chunk-UAWBAD4E.cjs +346 -0
  72. package/dist/chunk-UFTCTTKK.js +381 -0
  73. package/dist/chunk-WDDXU3OH.cjs +67 -0
  74. package/dist/chunk-WFEMJCXO.cjs +13 -0
  75. package/dist/chunk-WHJTBTYM.js +0 -0
  76. package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
  77. package/dist/chunk-XFPQFCEK.js +455 -0
  78. package/dist/chunk-XSQPVDFH.cjs +60 -0
  79. package/dist/chunk-XTC2SLFT.js +153 -0
  80. package/dist/chunk-XV735BSA.cjs +366 -0
  81. package/dist/chunk-XWNG2U4K.cjs +124 -0
  82. package/dist/chunk-YGYYJ3LQ.js +314 -0
  83. package/dist/chunk-YVHT2UVW.js +74 -0
  84. package/dist/chunk-ZFOOJK37.cjs +86 -0
  85. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  86. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  87. package/dist/components/accordion/index.cjs +35 -0
  88. package/dist/components/accordion/index.d.cts +299 -0
  89. package/dist/components/accordion/index.d.ts +299 -0
  90. package/dist/components/accordion/index.js +35 -0
  91. package/dist/components/alert/index.cjs +20 -0
  92. package/dist/components/alert/index.d.cts +169 -0
  93. package/dist/components/alert/index.d.ts +169 -0
  94. package/dist/components/alert/index.js +20 -0
  95. package/dist/components/avatar/index.cjs +16 -0
  96. package/dist/components/avatar/index.d.cts +131 -0
  97. package/dist/components/avatar/index.d.ts +131 -0
  98. package/dist/components/avatar/index.js +16 -0
  99. package/dist/components/badge/index.cjs +15 -0
  100. package/dist/components/badge/index.d.cts +157 -0
  101. package/dist/components/badge/index.d.ts +157 -0
  102. package/dist/components/badge/index.js +15 -0
  103. package/dist/components/button/index.cjs +22 -0
  104. package/dist/components/button/index.d.cts +613 -0
  105. package/dist/components/button/index.d.ts +613 -0
  106. package/dist/components/button/index.js +22 -0
  107. package/dist/components/card/index.cjs +22 -0
  108. package/dist/components/card/index.d.cts +620 -0
  109. package/dist/components/card/index.d.ts +620 -0
  110. package/dist/components/card/index.js +22 -0
  111. package/dist/components/checkbox/index.cjs +26 -0
  112. package/dist/components/checkbox/index.d.cts +1136 -0
  113. package/dist/components/checkbox/index.d.ts +1136 -0
  114. package/dist/components/checkbox/index.js +26 -0
  115. package/dist/components/chip/index.cjs +20 -0
  116. package/dist/components/chip/index.d.cts +608 -0
  117. package/dist/components/chip/index.d.ts +608 -0
  118. package/dist/components/chip/index.js +20 -0
  119. package/dist/components/divider/index.cjs +13 -0
  120. package/dist/components/divider/index.d.cts +117 -0
  121. package/dist/components/divider/index.d.ts +117 -0
  122. package/dist/components/divider/index.js +13 -0
  123. package/dist/components/field-group/index.cjs +27 -0
  124. package/dist/components/field-group/index.d.cts +270 -0
  125. package/dist/components/field-group/index.d.ts +270 -0
  126. package/dist/components/field-group/index.js +27 -0
  127. package/dist/components/input-otp/index.cjs +29 -0
  128. package/dist/components/input-otp/index.d.cts +325 -0
  129. package/dist/components/input-otp/index.d.ts +325 -0
  130. package/dist/components/input-otp/index.js +29 -0
  131. package/dist/components/menu/index.cjs +49 -0
  132. package/dist/components/menu/index.d.cts +351 -0
  133. package/dist/components/menu/index.d.ts +351 -0
  134. package/dist/components/menu/index.js +49 -0
  135. package/dist/components/popover/index.cjs +38 -0
  136. package/dist/components/popover/index.d.cts +254 -0
  137. package/dist/components/popover/index.d.ts +254 -0
  138. package/dist/components/popover/index.js +38 -0
  139. package/dist/components/radio/index.cjs +26 -0
  140. package/dist/components/radio/index.d.cts +1102 -0
  141. package/dist/components/radio/index.d.ts +1102 -0
  142. package/dist/components/radio/index.js +26 -0
  143. package/dist/components/select/index.cjs +50 -0
  144. package/dist/components/select/index.d.cts +498 -0
  145. package/dist/components/select/index.d.ts +498 -0
  146. package/dist/components/select/index.js +50 -0
  147. package/dist/components/skeleton/index.cjs +11 -0
  148. package/dist/components/skeleton/index.d.cts +111 -0
  149. package/dist/components/skeleton/index.d.ts +111 -0
  150. package/dist/components/skeleton/index.js +11 -0
  151. package/dist/components/spinner/index.cjs +17 -0
  152. package/dist/components/spinner/index.d.cts +104 -0
  153. package/dist/components/spinner/index.d.ts +104 -0
  154. package/dist/components/spinner/index.js +17 -0
  155. package/dist/components/switch/index.cjs +27 -0
  156. package/dist/components/switch/index.d.cts +1154 -0
  157. package/dist/components/switch/index.d.ts +1154 -0
  158. package/dist/components/switch/index.js +27 -0
  159. package/dist/components/text-area/index.cjs +14 -0
  160. package/dist/components/text-area/index.d.cts +73 -0
  161. package/dist/components/text-area/index.d.ts +73 -0
  162. package/dist/components/text-area/index.js +14 -0
  163. package/dist/components/text-field/index.cjs +25 -0
  164. package/dist/components/text-field/index.d.cts +205 -0
  165. package/dist/components/text-field/index.d.ts +205 -0
  166. package/dist/components/text-field/index.js +25 -0
  167. package/dist/components/typography/index.cjs +15 -0
  168. package/dist/components/typography/index.d.cts +116 -0
  169. package/dist/components/typography/index.d.ts +116 -0
  170. package/dist/components/typography/index.js +15 -0
  171. package/dist/components/view/index.cjs +17 -0
  172. package/dist/components/view/index.d.cts +152 -0
  173. package/dist/components/view/index.d.ts +152 -0
  174. package/dist/components/view/index.js +17 -0
  175. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  176. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  177. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  178. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  179. package/dist/index.cjs +400 -4
  180. package/dist/index.d.cts +118 -4
  181. package/dist/index.d.ts +118 -4
  182. package/dist/index.js +423 -27
  183. package/dist/placement-DHa0Rrh1.d.cts +38 -0
  184. package/dist/placement-DHa0Rrh1.d.ts +38 -0
  185. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  186. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  187. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  188. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  189. package/dist/system/index.cjs +73 -4
  190. package/dist/system/index.d.cts +379 -193
  191. package/dist/system/index.d.ts +379 -193
  192. package/dist/system/index.js +87 -18
  193. package/dist/text-field.type-0l73acce.d.ts +167 -0
  194. package/dist/text-field.type-DBh06DU5.d.cts +167 -0
  195. package/dist/theme/index.cjs +5 -3
  196. package/dist/theme/index.d.cts +55 -24
  197. package/dist/theme/index.d.ts +55 -24
  198. package/dist/theme/index.js +4 -2
  199. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  200. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  201. package/package.json +254 -18
  202. package/dist/chunk-ECDWSSHJ.js +0 -688
  203. package/dist/chunk-IYFGO523.cjs +0 -688
@@ -0,0 +1,366 @@
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
+
3
+
4
+ var _chunkZFOOJK37cjs = require('./chunk-ZFOOJK37.cjs');
5
+
6
+
7
+ var _chunk4KFKWBN5cjs = require('./chunk-4KFKWBN5.cjs');
8
+
9
+
10
+
11
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
12
+
13
+
14
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
15
+
16
+
17
+
18
+
19
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
20
+
21
+
22
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
23
+
24
+ // src/components/alert/alert-close.tsx
25
+ var _react = require('react');
26
+
27
+ // src/components/alert/alert.context.ts
28
+ var [AlertProvider, useAlert] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Alert");
29
+
30
+ // src/components/alert/alert-close.tsx
31
+ var _jsxruntime = require('react/jsx-runtime');
32
+ var AlertClose = _react.forwardRef.call(void 0, function AlertClose2({ isDisabled, ...props }, ref) {
33
+ const { closeStyle, closeGlyphStyle, isDisabled: isAlertDisabled } = useAlert();
34
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
+ _chunkZFOOJK37cjs.CloseButton,
36
+ {
37
+ ref,
38
+ name: "Alert.Close",
39
+ baseStyle: closeStyle,
40
+ glyphStyle: closeGlyphStyle,
41
+ isDisabled: _nullishCoalesce(isDisabled, () => ( isAlertDisabled)),
42
+ ...props
43
+ }
44
+ );
45
+ });
46
+ AlertClose.displayName = "XAUI.Alert.Close";
47
+
48
+ // src/components/alert/alert-content.tsx
49
+
50
+ var _reactnative = require('react-native');
51
+
52
+ var AlertContent = _react.forwardRef.call(void 0,
53
+ function AlertContent2({ children, style, ...props }, ref) {
54
+ const { contentStyle } = useAlert();
55
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
56
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, style: [contentStyle, styleProps, style], ...rest, children });
57
+ }
58
+ );
59
+ AlertContent.displayName = "XAUI.Alert.Content";
60
+
61
+ // src/components/alert/alert-description.tsx
62
+
63
+
64
+
65
+ var AlertDescription = _react.forwardRef.call(void 0,
66
+ function AlertDescription2({ children, style, ...props }, ref) {
67
+ const { descriptionStyle } = useAlert();
68
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
69
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, style: [descriptionStyle, styleProps, style], ...rest, children });
70
+ }
71
+ );
72
+ AlertDescription.displayName = "XAUI.Alert.Description";
73
+
74
+ // src/components/alert/alert-icon.tsx
75
+
76
+
77
+
78
+ var AlertIcon = _react.forwardRef.call(void 0, function AlertIcon2({ as, children, source, size, color, style, ...props }, ref) {
79
+ const { iconStyle, icon } = useAlert();
80
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
81
+ const glyphSize = _nullishCoalesce(size, () => ( icon.size));
82
+ const glyphColor = _nullishCoalesce(color, () => ( icon.color));
83
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, style: [iconStyle, styleProps, style], ...rest, children: as ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.Icon, { as, size: glyphSize, color: glyphColor }) : source ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.Icon, { source, size: glyphSize, color: glyphColor }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.Icon, { size: glyphSize, color: glyphColor, children }) });
84
+ });
85
+ AlertIcon.displayName = "XAUI.Alert.Icon";
86
+
87
+ // src/components/alert/alert-title.tsx
88
+
89
+
90
+
91
+ var AlertTitle = _react.forwardRef.call(void 0, function AlertTitle2({ children, style, ...props }, ref) {
92
+ const { titleStyle } = useAlert();
93
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
94
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, style: [titleStyle, styleProps, style], ...rest, children });
95
+ });
96
+ AlertTitle.displayName = "XAUI.Alert.Title";
97
+
98
+ // src/components/alert/alert.tsx
99
+
100
+
101
+
102
+ // src/components/alert/alert.recipe.ts
103
+ var SLOTS = [
104
+ "root",
105
+ "icon",
106
+ "iconGlyph",
107
+ "content",
108
+ "title",
109
+ "description",
110
+ "close",
111
+ "closeGlyph"
112
+ ];
113
+ var VARIANT_TOKENS = {
114
+ default: { bg: "surface", fg: "surfaceForeground" },
115
+ primary: { bg: "accent", fg: "accentForeground" },
116
+ secondary: { bg: "accentSoft", fg: "accentSoftForeground" },
117
+ success: { bg: "success", fg: "successForeground" },
118
+ "success-soft": { bg: "successSoft", fg: "successSoftForeground" },
119
+ warning: { bg: "warning", fg: "warningForeground" },
120
+ "warning-soft": { bg: "warningSoft", fg: "warningSoftForeground" },
121
+ danger: { bg: "danger", fg: "dangerForeground" },
122
+ "danger-soft": { bg: "dangerSoft", fg: "dangerSoftForeground" }
123
+ };
124
+ var DESCRIPTION_OPACITY = 0.6;
125
+ function sizeAxis(step) {
126
+ const { padding, gap, contentGap, title, description, glyph, cross, radius } = step;
127
+ return (theme) => ({
128
+ root: {
129
+ padding: theme.spacing(padding),
130
+ gap: theme.spacing(gap),
131
+ borderRadius: theme.radius[radius]
132
+ },
133
+ icon: { paddingTop: (theme.lineHeights[title] - theme.fontSizes[glyph]) / 2 },
134
+ iconGlyph: { fontSize: theme.fontSizes[glyph] },
135
+ content: { gap: theme.spacing(contentGap) },
136
+ title: {
137
+ fontSize: theme.fontSizes[title],
138
+ lineHeight: theme.lineHeights[title]
139
+ },
140
+ description: {
141
+ fontSize: theme.fontSizes[description],
142
+ lineHeight: theme.lineHeights[description]
143
+ },
144
+ // The touch target is the glyph's box; the shared `CloseButton` grows it outwards
145
+ // with `hitSlop`, because a cross big enough to hit is a cross too big to look right.
146
+ close: { width: theme.fontSizes[glyph], height: theme.fontSizes[glyph] },
147
+ closeGlyph: { width: theme.spacing(cross) }
148
+ });
149
+ }
150
+ var SIZES = {
151
+ xs: {
152
+ padding: 2,
153
+ gap: 2,
154
+ contentGap: 0.5,
155
+ title: "xs",
156
+ description: "xs",
157
+ glyph: "sm",
158
+ cross: 2,
159
+ radius: "lg"
160
+ },
161
+ sm: {
162
+ padding: 2.5,
163
+ gap: 2.5,
164
+ contentGap: 0.5,
165
+ title: "sm",
166
+ description: "xs",
167
+ glyph: "md",
168
+ cross: 2,
169
+ radius: "xl"
170
+ },
171
+ md: {
172
+ padding: 3,
173
+ gap: 3,
174
+ contentGap: 1,
175
+ title: "md",
176
+ description: "sm",
177
+ glyph: "lg",
178
+ cross: 2.5,
179
+ radius: "2xl"
180
+ },
181
+ lg: {
182
+ padding: 4,
183
+ gap: 3.5,
184
+ contentGap: 1,
185
+ title: "lg",
186
+ description: "md",
187
+ glyph: "xl",
188
+ cross: 3,
189
+ radius: "3xl"
190
+ }
191
+ };
192
+ var alertRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
193
+ slots: SLOTS,
194
+ // The cross's own geometry — thickness and centring — belongs to the shared
195
+ // `CloseButton`; what stays below is the box and bar size this component's scale sets.
196
+ base: (theme) => ({
197
+ ..._chunkZFOOJK37cjs.closeButtonBase.call(void 0, theme),
198
+ root: {
199
+ flexDirection: "row",
200
+ // Top-aligned, not centred: an alert's message can run to three lines, and an icon
201
+ // floating beside the middle of a paragraph reads as decoration rather than as the
202
+ // mark of what the paragraph is. A single-line alert centres itself with
203
+ // `alignItems="center"` on the root — one prop, and it is the caller's call.
204
+ alignItems: "flex-start",
205
+ borderWidth: 0,
206
+ // iOS's squircle. Free on Android, and it is what makes a radius this large read as
207
+ // a shape rather than as four arcs meeting straight edges.
208
+ borderCurve: "continuous"
209
+ // Deliberately no `overflow: 'hidden'`: on iOS it clips the node's own shadow, so a
210
+ // `default` alert would lose the elevation the variant just gave it.
211
+ },
212
+ // `flex: 1` and not `flexGrow`: the root is a row, so the content has to be measured
213
+ // from a zero basis to take exactly what the icon and the close leave — the opposite
214
+ // of the `Card`'s body, which grows in a column where a zero basis collapses it.
215
+ content: { flex: 1 },
216
+ // `medium`, not `semibold`. An alert's title sits in prose rather than on a control:
217
+ // one weight above the description is enough to rank them.
218
+ title: {
219
+ fontFamily: theme.fontFamilies.heading,
220
+ fontWeight: theme.fontWeights.medium
221
+ },
222
+ description: {
223
+ fontFamily: theme.fontFamilies.body,
224
+ fontWeight: theme.fontWeights.regular,
225
+ opacity: DESCRIPTION_OPACITY
226
+ }
227
+ }),
228
+ variantTokens: VARIANT_TOKENS,
229
+ /**
230
+ * Where the variant's colours land, for every variant at once.
231
+ *
232
+ * The icon takes the **title's** colour rather than a status colour of its own — on a
233
+ * `danger` alert the readable colour is the one the title already uses, and on a
234
+ * `danger-soft` one that token *is* the red. HeroUI arrives at the same place from the
235
+ * other direction, colouring the icon by status on a neutral surface; here the variant
236
+ * decides both, and an icon that has to disagree with its alert says so itself with
237
+ * `<Alert.Icon color={…} />`.
238
+ */
239
+ paint: (theme, colors) => ({
240
+ root: {
241
+ backgroundColor: colors.bg,
242
+ borderColor: colors.border,
243
+ borderWidth: colors.border ? theme.borderWidth.default : 0
244
+ },
245
+ iconGlyph: { color: colors.fg },
246
+ title: { color: colors.fg },
247
+ description: { color: colors.fg },
248
+ closeGlyph: { backgroundColor: colors.fg }
249
+ }),
250
+ /** Declaration order is application order: `radius` overrides the radius `size` set. */
251
+ variants: {
252
+ size: {
253
+ xs: sizeAxis(SIZES.xs),
254
+ sm: sizeAxis(SIZES.sm),
255
+ md: sizeAxis(SIZES.md),
256
+ lg: sizeAxis(SIZES.lg)
257
+ },
258
+ radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "root")
259
+ },
260
+ /**
261
+ * The elevation belongs to the one variant that is a surface standing on the background,
262
+ * exactly as on the `Card`. A tinted alert already separates itself by its fill, and a
263
+ * shadow under it would read as dirt. In dark mode the theme's `surface` shadow is
264
+ * already nothing (§4), which is why this names the role instead of a set of numbers.
265
+ */
266
+ compoundVariants: [
267
+ {
268
+ when: { variant: "default" },
269
+ style: (theme) => ({ root: theme.shadows.surface })
270
+ }
271
+ ],
272
+ states: {
273
+ disabled: (theme) => ({ root: { opacity: theme.opacity.disabled } })
274
+ },
275
+ defaultVariants: { variant: "default", size: "md" }
276
+ });
277
+
278
+ // src/components/alert/alert.tsx
279
+
280
+ var AlertRoot = _react.forwardRef.call(void 0, function Alert({
281
+ children,
282
+ variant,
283
+ size,
284
+ radius,
285
+ color,
286
+ isDisabled = false,
287
+ asChild = false,
288
+ accessibilityRole = "alert",
289
+ // Android reads a live region aloud when its content changes, which is what makes an
290
+ // alert that *appears* announce itself instead of waiting to be found. `'polite'`
291
+ // rather than `'assertive'`: it queues behind whatever is being read instead of
292
+ // cutting it off. A static alert that is part of the page sets `'none'`.
293
+ accessibilityLiveRegion = "polite",
294
+ style,
295
+ ...props
296
+ }, ref) {
297
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
298
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
299
+ const selection = { variant, size, radius };
300
+ const states = { disabled: isDisabled };
301
+ const styles = alertRecipe.resolve({ theme, selection, states });
302
+ const tint = color ? alertRecipe.tint({ theme, color, selection, states }) : void 0;
303
+ const context = _react.useMemo.call(void 0, () => {
304
+ const glyph = _reactnative.StyleSheet.flatten([styles.iconGlyph, _optionalChain([tint, 'optionalAccess', _ => _.iconGlyph])]);
305
+ return {
306
+ iconStyle: styles.icon,
307
+ contentStyle: styles.content,
308
+ titleStyle: tint ? [styles.title, tint.title] : styles.title,
309
+ descriptionStyle: tint ? [styles.description, tint.description] : styles.description,
310
+ closeStyle: styles.close,
311
+ closeGlyphStyle: tint ? [styles.closeGlyph, tint.closeGlyph] : styles.closeGlyph,
312
+ icon: {
313
+ size: glyph.fontSize,
314
+ // `ColorValue` also covers the platform's opaque colours, which `Icon` cannot
315
+ // hand to a third-party component expecting a string.
316
+ color: typeof glyph.color === "string" ? glyph.color : void 0
317
+ },
318
+ isDisabled
319
+ };
320
+ }, [styles, tint, isDisabled]);
321
+ const rootStyle = [styles.root, _optionalChain([tint, 'optionalAccess', _2 => _2.root]), styleProps, style];
322
+ const text = _chunk7GHM4GKLcjs.childrenToString.call(void 0, children);
323
+ const content = text !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertDescription, { children: text }) : children;
324
+ const surface = asChild ? (
325
+ // R12 — the caller's element *is* the alert, so it takes the children it was written
326
+ // with and the auto-wrap does not apply.
327
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
328
+ _chunk7GHM4GKLcjs.Slot,
329
+ {
330
+ ref,
331
+ accessibilityRole,
332
+ accessibilityLiveRegion,
333
+ ...rest,
334
+ style: rootStyle,
335
+ children
336
+ }
337
+ )
338
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
339
+ _reactnative.View,
340
+ {
341
+ ref,
342
+ accessibilityRole,
343
+ accessibilityLiveRegion,
344
+ ...rest,
345
+ style: rootStyle,
346
+ children: content
347
+ }
348
+ );
349
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AlertProvider, { value: context, children: surface });
350
+ });
351
+ AlertRoot.displayName = "XAUI.Alert.Root";
352
+
353
+ // src/components/alert/index.ts
354
+ var Alert2 = Object.assign(AlertRoot, {
355
+ Icon: AlertIcon,
356
+ Content: AlertContent,
357
+ Title: AlertTitle,
358
+ Description: AlertDescription,
359
+ Close: AlertClose
360
+ });
361
+
362
+
363
+
364
+
365
+
366
+ exports.useAlert = useAlert; exports.alertRecipe = alertRecipe; exports.Alert = Alert2;
@@ -0,0 +1,124 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkXSQPVDFHcjs = require('./chunk-XSQPVDFH.cjs');
4
+
5
+
6
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
7
+
8
+
9
+
10
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
11
+
12
+
13
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
14
+
15
+ // src/components/spinner/spinner.tsx
16
+ var _react = require('react');
17
+ var _reactnative = require('react-native');
18
+ var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
19
+
20
+ // src/components/spinner/spinner.recipe.ts
21
+ var SLOTS = ["root", "arc"];
22
+ var VARIANT_TOKENS = {
23
+ primary: { fg: "accent" },
24
+ secondary: { fg: "accentSoftForeground" },
25
+ default: { fg: "foreground" },
26
+ tertiary: { fg: "muted" },
27
+ success: { fg: "success" },
28
+ warning: { fg: "warning" },
29
+ danger: { fg: "danger" }
30
+ };
31
+ var TRACK_OPACITY = 0.18;
32
+ function sizeAxis(step) {
33
+ return (theme) => {
34
+ const diameter = theme.spacing(step.diameter);
35
+ const stroke = theme.borderWidth.default * step.stroke;
36
+ return {
37
+ root: {
38
+ width: diameter,
39
+ height: diameter,
40
+ borderRadius: diameter / 2,
41
+ borderWidth: stroke
42
+ },
43
+ // The arc is the same ring, drawn one stroke outside the track's box so the two
44
+ // circles land on each other rather than nesting. R13 — `start` and `end`, so the
45
+ // inset mirrors with the layout instead of staying put.
46
+ arc: {
47
+ position: "absolute",
48
+ top: -stroke,
49
+ bottom: -stroke,
50
+ start: -stroke,
51
+ end: -stroke,
52
+ borderRadius: diameter / 2 + stroke,
53
+ borderWidth: stroke
54
+ }
55
+ };
56
+ };
57
+ }
58
+ var SIZES = {
59
+ xs: { diameter: 4, stroke: 2 },
60
+ sm: { diameter: 5, stroke: 2 },
61
+ md: { diameter: 6, stroke: 2 },
62
+ lg: { diameter: 8, stroke: 3 }
63
+ };
64
+ var spinnerRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
65
+ slots: SLOTS,
66
+ base: () => ({
67
+ // Squircle corners are meaningless on a full circle, and `overflow` would clip the
68
+ // arc that deliberately sits outside this box.
69
+ root: { alignItems: "center", justifyContent: "center" }
70
+ }),
71
+ variantTokens: VARIANT_TOKENS,
72
+ /**
73
+ * One ink, two opacities, and the gap that makes the rotation visible.
74
+ *
75
+ * `borderTopColor: 'transparent'` is structural rather than a colour the theme has an
76
+ * opinion about — it is the quarter of the circle that is missing, and without it a
77
+ * rotating ring is a ring.
78
+ */
79
+ paint: (_theme, colors) => ({
80
+ root: { borderColor: colors.fg ? _chunk57SJ4LJFcjs.alpha.call(void 0, colors.fg, TRACK_OPACITY) : void 0 },
81
+ arc: { borderColor: colors.fg, borderTopColor: "transparent" }
82
+ }),
83
+ variants: {
84
+ size: {
85
+ xs: sizeAxis(SIZES.xs),
86
+ sm: sizeAxis(SIZES.sm),
87
+ md: sizeAxis(SIZES.md),
88
+ lg: sizeAxis(SIZES.lg)
89
+ }
90
+ },
91
+ defaultVariants: { variant: "primary", size: "md" }
92
+ });
93
+
94
+ // src/components/spinner/spinner.tsx
95
+ var _jsxruntime = require('react/jsx-runtime');
96
+ var Spinner = _react.forwardRef.call(void 0, function Spinner2({ variant, size, color, animation = true, style, ...props }, ref) {
97
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
98
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
99
+ const selection = { variant, size };
100
+ const styles = spinnerRecipe.resolve({ theme, selection });
101
+ const tint = color ? spinnerRecipe.tint({ theme, color, selection }) : void 0;
102
+ const arcStyle = [styles.arc, _optionalChain([tint, 'optionalAccess', _ => _.arc])];
103
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
104
+ _reactnative.View,
105
+ {
106
+ ref,
107
+ accessibilityRole: "progressbar",
108
+ accessibilityState: { busy: animation },
109
+ ...rest,
110
+ style: [styles.root, _optionalChain([tint, 'optionalAccess', _2 => _2.root]), styleProps, style],
111
+ children: animation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SpinningArc, { style: arcStyle }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: arcStyle })
112
+ }
113
+ );
114
+ });
115
+ Spinner.displayName = "XAUI.Spinner";
116
+ function SpinningArc({ style }) {
117
+ const rotation = _chunkXSQPVDFHcjs.useRotation.call(void 0, );
118
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { style: [style, rotation] });
119
+ }
120
+
121
+
122
+
123
+
124
+ exports.spinnerRecipe = spinnerRecipe; exports.Spinner = Spinner;