@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,455 @@
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
+ var _chunk3E7CDKFOcjs = require('./chunk-3E7CDKFO.cjs');
4
+
5
+
6
+ var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
7
+
8
+
9
+ var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
10
+
11
+
12
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
13
+
14
+
15
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
16
+
17
+
18
+
19
+
20
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
21
+
22
+
23
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
24
+
25
+ // src/components/card/card-background.tsx
26
+ var _react = require('react');
27
+ var _reactnative = require('react-native');
28
+
29
+ // src/components/card/card.utils.ts
30
+
31
+ var CARD_BACKGROUND = /* @__PURE__ */ Symbol.for("xaui.Card.background");
32
+ function markBackground(component) {
33
+ return Object.assign(component, { [CARD_BACKGROUND]: true });
34
+ }
35
+ function isBackground(node) {
36
+ if (!_react.isValidElement.call(void 0, node)) return false;
37
+ const type = node.type;
38
+ if (typeof type !== "function" && typeof type !== "object") return false;
39
+ if (type === null) return false;
40
+ return type[CARD_BACKGROUND] === true;
41
+ }
42
+ function partitionBackground(children) {
43
+ const all = _react.Children.toArray(children);
44
+ const index = all.findIndex(isBackground);
45
+ if (index === -1) return { background: null, content: children };
46
+ return {
47
+ background: all[index],
48
+ content: all.filter((_, at) => at !== index)
49
+ };
50
+ }
51
+
52
+ // src/components/card/card.context.ts
53
+ var [CardProvider, useCard] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Card");
54
+
55
+ // src/components/card/card.style.ts
56
+
57
+ var cardSheet = _reactnative.StyleSheet.create({
58
+ backgroundImage: { width: "100%", height: "100%" }
59
+ });
60
+
61
+ // src/components/card/card-background.tsx
62
+ var _jsxruntime = require('react/jsx-runtime');
63
+ var CardBackground = markBackground(
64
+ _react.forwardRef.call(void 0, function CardBackground2({ children, source, style, ...props }, ref) {
65
+ const { backgroundStyle } = useCard();
66
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
67
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
68
+ _reactnative.View,
69
+ {
70
+ ref,
71
+ accessibilityElementsHidden: true,
72
+ importantForAccessibility: "no-hide-descendants",
73
+ ...rest,
74
+ style: [backgroundStyle, styleProps, style],
75
+ children: source ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Image, { source, style: cardSheet.backgroundImage }) : children
76
+ }
77
+ );
78
+ })
79
+ );
80
+ CardBackground.displayName = "XAUI.Card.Background";
81
+
82
+ // src/components/card/card-body.tsx
83
+
84
+
85
+
86
+ var CardBody = _react.forwardRef.call(void 0, function CardBody2({ children, style, ...props }, ref) {
87
+ const { bodyStyle } = useCard();
88
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
89
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, style: [bodyStyle, styleProps, style], ...rest, children });
90
+ });
91
+ CardBody.displayName = "XAUI.Card.Body";
92
+
93
+ // src/components/card/card-description.tsx
94
+
95
+
96
+
97
+ var CardDescription = _react.forwardRef.call(void 0,
98
+ function CardDescription2({ children, style, ...props }, ref) {
99
+ const { descriptionStyle } = useCard();
100
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
101
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, style: [descriptionStyle, styleProps, style], ...rest, children });
102
+ }
103
+ );
104
+ CardDescription.displayName = "XAUI.Card.Description";
105
+
106
+ // src/components/card/card-footer.tsx
107
+
108
+
109
+
110
+ var CardFooter = _react.forwardRef.call(void 0, function CardFooter2({ children, style, ...props }, ref) {
111
+ const { footerStyle } = useCard();
112
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
113
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, style: [footerStyle, styleProps, style], ...rest, children });
114
+ });
115
+ CardFooter.displayName = "XAUI.Card.Footer";
116
+
117
+ // src/components/card/card-header.tsx
118
+
119
+
120
+
121
+ var CardHeader = _react.forwardRef.call(void 0, function CardHeader2({ children, style, ...props }, ref) {
122
+ const { headerStyle } = useCard();
123
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
124
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, style: [headerStyle, styleProps, style], ...rest, children });
125
+ });
126
+ CardHeader.displayName = "XAUI.Card.Header";
127
+
128
+ // src/components/card/card-title.tsx
129
+
130
+
131
+
132
+ var CardTitle = _react.forwardRef.call(void 0, function CardTitle2({ children, style, ...props }, ref) {
133
+ const { titleStyle } = useCard();
134
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
135
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, style: [titleStyle, styleProps, style], ...rest, children });
136
+ });
137
+ CardTitle.displayName = "XAUI.Card.Title";
138
+
139
+ // src/components/card/card.tsx
140
+
141
+
142
+
143
+ // src/components/card/card.recipe.ts
144
+ var SLOTS = [
145
+ "root",
146
+ "background",
147
+ "header",
148
+ "body",
149
+ "footer",
150
+ "title",
151
+ "description"
152
+ ];
153
+ var VARIANT_TOKENS = {
154
+ default: { bg: "surface", fg: "surfaceForeground" },
155
+ secondary: { bg: "surfaceSecondary", fg: "surfaceSecondaryForeground" },
156
+ tertiary: { border: "border", fg: "foreground" },
157
+ ghost: { fg: "foreground" }
158
+ };
159
+ var DESCRIPTION_OPACITY = 0.6;
160
+ function sizeAxis(step) {
161
+ const { padding, gap, contentGap, radius, title, description } = step;
162
+ return (theme) => ({
163
+ root: {
164
+ padding: theme.spacing(padding),
165
+ gap: theme.spacing(gap),
166
+ borderRadius: theme.radius[radius]
167
+ },
168
+ // The same corner as the root, because this layer is what clips the image — the root
169
+ // deliberately does not (see `base`), so the radius has to be repeated where the
170
+ // `overflow` is.
171
+ background: { borderRadius: theme.radius[radius] },
172
+ header: { gap: theme.spacing(contentGap) },
173
+ body: { gap: theme.spacing(contentGap) },
174
+ footer: { gap: theme.spacing(contentGap) },
175
+ title: {
176
+ fontSize: theme.fontSizes[title],
177
+ lineHeight: theme.lineHeights[title]
178
+ },
179
+ description: {
180
+ fontSize: theme.fontSizes[description],
181
+ lineHeight: theme.lineHeights[description]
182
+ }
183
+ });
184
+ }
185
+ var SIZES = {
186
+ xs: {
187
+ padding: 3,
188
+ gap: 2,
189
+ contentGap: 1,
190
+ radius: "lg",
191
+ title: "sm",
192
+ description: "xs"
193
+ },
194
+ sm: {
195
+ padding: 3.5,
196
+ gap: 3,
197
+ contentGap: 1,
198
+ radius: "xl",
199
+ title: "md",
200
+ description: "sm"
201
+ },
202
+ md: {
203
+ padding: 4,
204
+ gap: 4,
205
+ contentGap: 1,
206
+ radius: "2xl",
207
+ title: "lg",
208
+ description: "md"
209
+ },
210
+ lg: {
211
+ padding: 5,
212
+ gap: 5,
213
+ contentGap: 1.5,
214
+ radius: "3xl",
215
+ title: "xl",
216
+ description: "lg"
217
+ }
218
+ };
219
+ function corner(key) {
220
+ return (theme) => ({
221
+ root: { borderRadius: theme.radius[key] },
222
+ background: { borderRadius: theme.radius[key] }
223
+ });
224
+ }
225
+ var cardRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
226
+ slots: SLOTS,
227
+ base: (theme) => ({
228
+ root: {
229
+ flexDirection: "column",
230
+ borderWidth: 0,
231
+ // iOS's squircle. Free on Android, and it is what makes a card's radius read as a
232
+ // shape rather than as four arcs meeting straight edges.
233
+ borderCurve: "continuous"
234
+ // Deliberately no `overflow: 'hidden'`: on iOS it clips the node's own shadow, so
235
+ // a `default` card would lose the elevation the variant just gave it. The press
236
+ // wash rounds itself off the root's corners and needs no clip; a caller bleeding an
237
+ // image to the edges writes `overflow="hidden"` and takes the trade knowingly.
238
+ },
239
+ // R13 — `start` and `end`, never `left` and `right`, even at zero. `overflow` lives
240
+ // here rather than on the root: on iOS it clips the node's own shadow, and a `default`
241
+ // card would lose the elevation its variant just gave it.
242
+ background: {
243
+ position: "absolute",
244
+ top: 0,
245
+ bottom: 0,
246
+ start: 0,
247
+ end: 0,
248
+ overflow: "hidden"
249
+ },
250
+ // Top-aligned content — a badge, an icon, a title block. A column pinned to the
251
+ // leading edge, which RTL mirrors on its own; `flexDirection="row"` is one prop away
252
+ // for a header that puts an action at the far end.
253
+ header: { alignItems: "flex-start" },
254
+ // `flexGrow` and not `flex: 1`. `flex: 1` also sets `flexBasis: 0`, and in a card
255
+ // whose height comes from its content that measures the body as empty before there
256
+ // is any free space to give back to it — the collapse is silent and total.
257
+ body: { flexGrow: 1 },
258
+ // A footer is an action row: the one section whose common case is horizontal, so it
259
+ // is the one section that is a row by default.
260
+ footer: { flexDirection: "row", alignItems: "center" },
261
+ // `medium`, not `semibold`. A card's title sits in prose rather than on a control:
262
+ // one weight above the description is enough to rank them, and the heavier step reads
263
+ // as a section heading the card did not ask for.
264
+ title: {
265
+ fontFamily: theme.fontFamilies.heading,
266
+ fontWeight: theme.fontWeights.medium
267
+ },
268
+ description: {
269
+ fontFamily: theme.fontFamilies.body,
270
+ fontWeight: theme.fontWeights.regular,
271
+ opacity: DESCRIPTION_OPACITY
272
+ }
273
+ }),
274
+ variantTokens: VARIANT_TOKENS,
275
+ /**
276
+ * Where the variant's colours land, for every variant at once. The border width follows
277
+ * the *presence* of the border role, so `ghost` needs no rule of its own to say it has
278
+ * no edge.
279
+ */
280
+ paint: (theme, colors) => ({
281
+ root: {
282
+ backgroundColor: colors.bg,
283
+ borderColor: colors.border,
284
+ borderWidth: colors.border ? theme.borderWidth.default : 0
285
+ },
286
+ title: { color: colors.fg },
287
+ description: { color: colors.fg }
288
+ }),
289
+ /** Declaration order is application order: `radius` overrides the radius `size` set. */
290
+ variants: {
291
+ size: {
292
+ xs: sizeAxis(SIZES.xs),
293
+ sm: sizeAxis(SIZES.sm),
294
+ md: sizeAxis(SIZES.md),
295
+ lg: sizeAxis(SIZES.lg)
296
+ },
297
+ /**
298
+ * Both slots move together, always: the background layer is what clips the image, so
299
+ * a `radius` that moved only the root would round the card and leave its photo square
300
+ * in the corners.
301
+ */
302
+ radius: {
303
+ xs: corner("xs"),
304
+ sm: corner("sm"),
305
+ md: corner("md"),
306
+ lg: corner("lg"),
307
+ xl: corner("xl"),
308
+ "2xl": corner("2xl"),
309
+ "3xl": corner("3xl"),
310
+ "4xl": corner("4xl"),
311
+ field: corner("field"),
312
+ full: corner("full")
313
+ }
314
+ },
315
+ /**
316
+ * The elevation belongs to the one variant that is a surface standing on the
317
+ * background. `secondary` is the level for a card *inside* a card and `tertiary` and
318
+ * `ghost` have no fill to lift, so a shadow under any of them would read as dirt rather
319
+ * than as height. In dark mode the theme's `surface` shadow is already nothing (§4),
320
+ * which is why this names the role instead of a set of numbers.
321
+ */
322
+ compoundVariants: [
323
+ {
324
+ when: { variant: "default" },
325
+ style: (theme) => ({ root: theme.shadows.surface })
326
+ }
327
+ ],
328
+ states: {
329
+ disabled: (theme) => ({ root: { opacity: theme.opacity.disabled } })
330
+ },
331
+ defaultVariants: { variant: "default", size: "md" }
332
+ });
333
+
334
+ // src/components/card/card.tsx
335
+
336
+ var CardRoot = _react.forwardRef.call(void 0, function Card({
337
+ children,
338
+ variant,
339
+ size,
340
+ radius,
341
+ color,
342
+ isDisabled = false,
343
+ isPressable = false,
344
+ asChild = false,
345
+ accessibilityRole,
346
+ accessibilityState,
347
+ animation,
348
+ style,
349
+ onPressIn,
350
+ onPressOut,
351
+ ...props
352
+ }, ref) {
353
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
354
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
355
+ const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
356
+ const selection = { variant, size, radius };
357
+ const states = { disabled: isDisabled };
358
+ const styles = cardRecipe.resolve({ theme, selection, states });
359
+ const tint = color ? cardRecipe.tint({ theme, color, selection, states }) : void 0;
360
+ const context = _react.useMemo.call(void 0,
361
+ () => ({
362
+ backgroundStyle: styles.background,
363
+ headerStyle: styles.header,
364
+ bodyStyle: styles.body,
365
+ footerStyle: styles.footer,
366
+ titleStyle: tint ? [styles.title, tint.title] : styles.title,
367
+ descriptionStyle: tint ? [styles.description, tint.description] : styles.description,
368
+ isDisabled
369
+ }),
370
+ [styles, tint, isDisabled]
371
+ );
372
+ const rootStyle = [
373
+ styles.root,
374
+ _optionalChain([tint, 'optionalAccess', _2 => _2.root]),
375
+ styleProps,
376
+ typeof style === "function" ? style({ pressed: isPressed }) : style
377
+ ];
378
+ const text = _chunk7GHM4GKLcjs.childrenToString.call(void 0, children);
379
+ const content = text !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardDescription, { children: text }) : children;
380
+ if (!isPressable && !asChild && (onPressIn || onPressOut || rest.onPress || rest.onLongPress)) {
381
+ _chunkEJQCQPETcjs.warnDev.call(void 0,
382
+ "Card: a press handler needs `isPressable`. Without it the card renders a View, which never receives the touch \u2014 add `isPressable` to make it a control."
383
+ );
384
+ }
385
+ const { background, content: body } = partitionBackground(content);
386
+ const layered = background === null ? body : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
387
+ background,
388
+ body
389
+ ] });
390
+ const surface = isPressable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
391
+ _chunk3E7CDKFOcjs.PressableFeedback,
392
+ {
393
+ ref,
394
+ isPressed,
395
+ isDisabled,
396
+ asChild,
397
+ animation,
398
+ accessibilityRole: _nullishCoalesce(accessibilityRole, () => ( "button")),
399
+ accessibilityState: { disabled: isDisabled, ...accessibilityState },
400
+ ...rest,
401
+ style: rootStyle,
402
+ onPressIn: press.onPressIn,
403
+ onPressOut: press.onPressOut,
404
+ children: asChild ? children : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
405
+ background,
406
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3E7CDKFOcjs.PressableFeedback.Highlight, {}),
407
+ body
408
+ ] })
409
+ }
410
+ ) : asChild ? (
411
+ // R12 — the caller's element is the card, so it takes the children it was written
412
+ // with and the auto-wrap does not apply.
413
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
414
+ _chunk7GHM4GKLcjs.Slot,
415
+ {
416
+ ref,
417
+ accessibilityRole,
418
+ accessibilityState,
419
+ ...rest,
420
+ style: rootStyle,
421
+ children
422
+ }
423
+ )
424
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
425
+ _reactnative.View,
426
+ {
427
+ ref,
428
+ accessibilityRole,
429
+ accessibilityState,
430
+ ...rest,
431
+ style: rootStyle,
432
+ children: layered
433
+ }
434
+ );
435
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardProvider, { value: context, children: surface });
436
+ });
437
+ CardRoot.displayName = "XAUI.Card.Root";
438
+
439
+ // src/components/card/index.ts
440
+ var Card2 = Object.assign(CardRoot, {
441
+ Background: CardBackground,
442
+ Header: CardHeader,
443
+ Body: CardBody,
444
+ Footer: CardFooter,
445
+ Title: CardTitle,
446
+ Description: CardDescription
447
+ });
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+ exports.CARD_BACKGROUND = CARD_BACKGROUND; exports.markBackground = markBackground; exports.useCard = useCard; exports.cardRecipe = cardRecipe; exports.Card = Card2;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,27 @@
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; }// src/hooks/use-anchor-ref.ts
2
+ var _react = require('react');
3
+ function useAnchorRef({ isOpen, onAnchor, onLayout }) {
4
+ const node = _react.useRef.call(void 0, null);
5
+ const latest = _react.useRef.call(void 0, onAnchor);
6
+ latest.current = onAnchor;
7
+ const measure = _react.useCallback.call(void 0, () => {
8
+ _optionalChain([node, 'access', _ => _.current, 'optionalAccess', _2 => _2.measureInWindow, 'call', _3 => _3((x, y, width, height) => {
9
+ latest.current({ x, y, width, height });
10
+ })]);
11
+ }, []);
12
+ const handleLayout = _react.useCallback.call(void 0,
13
+ (event) => {
14
+ _optionalChain([onLayout, 'optionalCall', _4 => _4(event)]);
15
+ measure();
16
+ },
17
+ [measure, onLayout]
18
+ );
19
+ _react.useEffect.call(void 0, () => {
20
+ if (isOpen) measure();
21
+ }, [isOpen, measure]);
22
+ return { node, measure, onLayout: handleLayout };
23
+ }
24
+
25
+
26
+
27
+ exports.useAnchorRef = useAnchorRef;
@@ -0,0 +1,13 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/system/slot/merge-refs.ts
2
+ function mergeRefs(...refs) {
3
+ return (value) => {
4
+ for (const ref of refs) {
5
+ if (typeof ref === "function") ref(value);
6
+ else if (ref) ref.current = value;
7
+ }
8
+ };
9
+ }
10
+
11
+
12
+
13
+ exports.mergeRefs = mergeRefs;
@@ -0,0 +1,198 @@
1
+ import {
2
+ createRecipe,
3
+ radiusAxis
4
+ } from "./chunk-4GTAZM2C.js";
5
+ import {
6
+ useXAUITheme
7
+ } from "./chunk-A3EGFI6T.js";
8
+ import {
9
+ Slot,
10
+ childrenToString
11
+ } from "./chunk-K72UDPVN.js";
12
+ import {
13
+ useStyleProps
14
+ } from "./chunk-M63GFNKV.js";
15
+
16
+ // src/components/badge/badge.tsx
17
+ import { forwardRef, useMemo } from "react";
18
+ import { Text, View } from "react-native";
19
+
20
+ // src/components/badge/badge.recipe.ts
21
+ var SLOTS = ["root", "label"];
22
+ var VARIANT_TOKENS = {
23
+ primary: { bg: "accent", fg: "accentForeground" },
24
+ secondary: { bg: "accentSoft", fg: "accentSoftForeground" },
25
+ default: { bg: "default", fg: "defaultForeground" },
26
+ tertiary: { border: "border", fg: "foreground" },
27
+ ghost: { fg: "foreground" },
28
+ success: { bg: "success", fg: "successForeground" },
29
+ "success-soft": { bg: "successSoft", fg: "successSoftForeground" },
30
+ warning: { bg: "warning", fg: "warningForeground" },
31
+ "warning-soft": { bg: "warningSoft", fg: "warningSoftForeground" },
32
+ danger: { bg: "danger", fg: "dangerForeground" },
33
+ "danger-soft": { bg: "dangerSoft", fg: "dangerSoftForeground" }
34
+ };
35
+ function sizeAxis(step) {
36
+ return (theme) => {
37
+ const height = theme.spacing(step.height);
38
+ return {
39
+ root: {
40
+ height,
41
+ minWidth: height,
42
+ paddingHorizontal: theme.spacing(step.padding)
43
+ },
44
+ label: { fontSize: theme.fontSizes[step.label] }
45
+ };
46
+ };
47
+ }
48
+ function dotAxis(diameter) {
49
+ return (theme) => {
50
+ const size = theme.spacing(diameter);
51
+ return {
52
+ root: { height: size, width: size, minWidth: size, paddingHorizontal: 0 }
53
+ };
54
+ };
55
+ }
56
+ var BADGE_DEFAULT_SIZE = "md";
57
+ var SIZES = {
58
+ xs: { height: 4, padding: 1.25, label: "xs", dot: 1.5 },
59
+ sm: { height: 4.5, padding: 1.5, label: "xs", dot: 2 },
60
+ md: { height: 5, padding: 1.5, label: "xs", dot: 2.5 },
61
+ lg: { height: 6, padding: 2, label: "sm", dot: 3 }
62
+ };
63
+ function badgeOffset(theme, size, isDot) {
64
+ const step = SIZES[size];
65
+ return theme.spacing(isDot ? step.dot : step.height) / 2;
66
+ }
67
+ var badgeRecipe = createRecipe({
68
+ slots: SLOTS,
69
+ base: (theme) => ({
70
+ root: {
71
+ flexDirection: "row",
72
+ alignItems: "center",
73
+ justifyContent: "center",
74
+ borderWidth: 0,
75
+ // The capsule at every size, which is what makes a two-digit count read as one
76
+ // object. `radius` is still there for the square marker.
77
+ borderRadius: theme.radius.full,
78
+ // Squircle corners for when `radius` overrides the pill. Free on Android.
79
+ borderCurve: "continuous"
80
+ },
81
+ label: {
82
+ fontFamily: theme.fontFamilies.body,
83
+ fontWeight: theme.fontWeights.semibold,
84
+ // Android reserves leading above and below the glyphs, which in a 16pt box is the
85
+ // difference between a centred digit and one sitting low.
86
+ includeFontPadding: false,
87
+ // No `lineHeight`: the scale's leading is taller than the box at every size here,
88
+ // and the root centres the label anyway.
89
+ textAlign: "center"
90
+ }
91
+ }),
92
+ variantTokens: VARIANT_TOKENS,
93
+ /**
94
+ * Where the variant's colours land, for every variant at once. The border width follows
95
+ * the *presence* of the border role, so `ghost` needs no rule of its own.
96
+ */
97
+ paint: (theme, colors) => ({
98
+ root: {
99
+ backgroundColor: colors.bg,
100
+ borderColor: colors.border,
101
+ borderWidth: colors.border ? theme.borderWidth.default : 0
102
+ },
103
+ label: { color: colors.fg }
104
+ }),
105
+ /** Declaration order is application order: `dot` overrides the box `size` set, and
106
+ * `radius` overrides the capsule from `base`. */
107
+ variants: {
108
+ size: {
109
+ xs: sizeAxis(SIZES.xs),
110
+ sm: sizeAxis(SIZES.sm),
111
+ md: sizeAxis(SIZES.md),
112
+ lg: sizeAxis(SIZES.lg)
113
+ },
114
+ /**
115
+ * The same four keys as `size`, and the root selects it with the resolved size when
116
+ * `isDot` is set and with nothing when it is not — an axis left unselected contributes
117
+ * nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
118
+ * have needed a `false` branch with nothing to say, and a `size × isDot` compound
119
+ * would have been sixteen entries for four measurements.
120
+ */
121
+ dot: {
122
+ xs: dotAxis(SIZES.xs.dot),
123
+ sm: dotAxis(SIZES.sm.dot),
124
+ md: dotAxis(SIZES.md.dot),
125
+ lg: dotAxis(SIZES.lg.dot)
126
+ },
127
+ radius: radiusAxis("root")
128
+ },
129
+ /**
130
+ * `danger`, where every other component in the library defaults to the first name in its
131
+ * ladder. A badge is overwhelmingly the count of something that wants attention — unread,
132
+ * failed, overdue — and a red one is what `<Badge>3</Badge>` means. The accent count is a
133
+ * `variant` away.
134
+ */
135
+ defaultVariants: { variant: "danger", size: BADGE_DEFAULT_SIZE }
136
+ });
137
+
138
+ // src/components/badge/badge.utils.ts
139
+ function placementInsets(placement, offset) {
140
+ if (!placement) return void 0;
141
+ const vertical = placement.startsWith("top") ? { top: -offset } : { bottom: -offset };
142
+ const horizontal = placement.endsWith("start") ? { start: -offset } : { end: -offset };
143
+ return { position: "absolute", ...vertical, ...horizontal };
144
+ }
145
+
146
+ // src/components/badge/badge.tsx
147
+ import { jsx } from "react/jsx-runtime";
148
+ var Badge = forwardRef(function Badge2({
149
+ children,
150
+ variant,
151
+ size,
152
+ radius,
153
+ color,
154
+ isDot = false,
155
+ placement,
156
+ asChild = false,
157
+ style,
158
+ ...props
159
+ }, ref) {
160
+ const theme = useXAUITheme();
161
+ const [styleProps, rest] = useStyleProps(props);
162
+ const resolvedSize = size ?? BADGE_DEFAULT_SIZE;
163
+ const selection = {
164
+ variant,
165
+ size,
166
+ radius,
167
+ // An axis left unselected contributes nothing, which is exactly "this badge has a
168
+ // label" — no `false` branch with nothing to say.
169
+ dot: isDot ? resolvedSize : void 0
170
+ };
171
+ const styles = badgeRecipe.resolve({ theme, selection });
172
+ const tint = color ? badgeRecipe.tint({ theme, color, selection }) : void 0;
173
+ const insets = useMemo(
174
+ () => placementInsets(placement, badgeOffset(theme, resolvedSize, isDot)),
175
+ [placement, theme, resolvedSize, isDot]
176
+ );
177
+ const rootStyle = [styles.root, tint?.root, insets, styleProps, style];
178
+ const text = childrenToString(children);
179
+ const label = text !== null ? /* @__PURE__ */ jsx(Text, { style: [styles.label, tint?.label], numberOfLines: 1, children: text }) : children;
180
+ const content = isDot ? null : label;
181
+ const Root = asChild ? Slot : View;
182
+ return /* @__PURE__ */ jsx(
183
+ Root,
184
+ {
185
+ ref,
186
+ ...rest,
187
+ style: rootStyle,
188
+ children: asChild ? children : content
189
+ }
190
+ );
191
+ });
192
+ Badge.displayName = "XAUI.Badge";
193
+
194
+ export {
195
+ badgeRecipe,
196
+ placementInsets,
197
+ Badge
198
+ };