@xaui/native 0.9.1-alpha.3 → 0.9.1-alpha.30

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 (143) hide show
  1. package/dist/chunk-27ZRTZEE.js +293 -0
  2. package/dist/chunk-3FV4COTM.js +68 -0
  3. package/dist/chunk-423RQBOX.js +21 -0
  4. package/dist/chunk-4GTAZM2C.js +174 -0
  5. package/dist/chunk-4XPLPQLM.cjs +147 -0
  6. package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
  7. package/dist/chunk-5GO7MAVY.cjs +74 -0
  8. package/dist/chunk-5RQ7AZPN.cjs +455 -0
  9. package/dist/chunk-5Z4P6WHR.cjs +525 -0
  10. package/dist/chunk-6RVCGLKZ.js +661 -0
  11. package/dist/chunk-7DPL3ZDS.cjs +21 -0
  12. package/dist/chunk-7EIHHOHP.cjs +42 -0
  13. package/dist/chunk-7SEZGVTY.js +62 -0
  14. package/dist/chunk-7XKQJQF2.cjs +70 -0
  15. package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
  16. package/dist/chunk-A5OCK3C2.js +525 -0
  17. package/dist/chunk-BA2DBSAN.js +102 -0
  18. package/dist/chunk-BFMTUMTU.js +669 -0
  19. package/dist/chunk-BVJQ3UPZ.js +62 -0
  20. package/dist/chunk-DFME724B.js +147 -0
  21. package/dist/chunk-E2CWBQTV.js +119 -0
  22. package/dist/chunk-E4TS6632.cjs +314 -0
  23. package/dist/chunk-EGLLDKN6.js +9 -0
  24. package/dist/chunk-EJQCQPET.cjs +9 -0
  25. package/dist/chunk-F6CQ6CBI.cjs +112 -0
  26. package/dist/chunk-F6W3JQ7K.js +42 -0
  27. package/dist/chunk-FMZQW35T.js +431 -0
  28. package/dist/chunk-FNEUOBCV.cjs +174 -0
  29. package/dist/chunk-G7K652GC.js +145 -0
  30. package/dist/chunk-GGW42MY4.js +20 -0
  31. package/dist/chunk-GI24YJPE.js +314 -0
  32. package/dist/chunk-GLGU2WFL.cjs +190 -0
  33. package/dist/chunk-GPVNCJ3Z.cjs +696 -0
  34. package/dist/chunk-GVQOD3VW.js +74 -0
  35. package/dist/chunk-KOC3KQIT.js +124 -0
  36. package/dist/chunk-KPWZLUES.cjs +124 -0
  37. package/dist/chunk-KWCHSIMI.cjs +293 -0
  38. package/dist/chunk-MC7SY2QH.cjs +20 -0
  39. package/dist/chunk-N527BTY4.cjs +366 -0
  40. package/dist/chunk-NBFWWQFW.cjs +346 -0
  41. package/dist/chunk-NYRXUGVL.js +104 -0
  42. package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
  43. package/dist/chunk-Q3WFY5N3.js +366 -0
  44. package/dist/chunk-QGN2BBJO.cjs +104 -0
  45. package/dist/chunk-TGZZ3RZU.cjs +86 -0
  46. package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
  47. package/dist/chunk-UBQLKIZC.cjs +431 -0
  48. package/dist/chunk-URSKA2VR.js +190 -0
  49. package/dist/chunk-V4WDMM6Z.js +86 -0
  50. package/dist/chunk-VJEER76X.js +455 -0
  51. package/dist/chunk-VZBWYWEI.cjs +736 -0
  52. package/dist/chunk-WR7YLDVV.cjs +68 -0
  53. package/dist/chunk-X4HQ4H2V.js +701 -0
  54. package/dist/chunk-XFSW3ZNI.cjs +145 -0
  55. package/dist/chunk-XQFAUDR2.cjs +62 -0
  56. package/dist/chunk-YKL6XHM6.js +346 -0
  57. package/dist/chunk-ZP2E2H2G.cjs +119 -0
  58. package/dist/chunk-ZSLNGBDS.cjs +700 -0
  59. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  60. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  61. package/dist/components/alert/index.cjs +20 -0
  62. package/dist/components/alert/index.d.cts +169 -0
  63. package/dist/components/alert/index.d.ts +169 -0
  64. package/dist/components/alert/index.js +20 -0
  65. package/dist/components/button/index.cjs +21 -0
  66. package/dist/components/button/index.d.cts +613 -0
  67. package/dist/components/button/index.d.ts +613 -0
  68. package/dist/components/button/index.js +21 -0
  69. package/dist/components/card/index.cjs +22 -0
  70. package/dist/components/card/index.d.cts +620 -0
  71. package/dist/components/card/index.d.ts +620 -0
  72. package/dist/components/card/index.js +22 -0
  73. package/dist/components/checkbox/index.cjs +26 -0
  74. package/dist/components/checkbox/index.d.cts +1136 -0
  75. package/dist/components/checkbox/index.d.ts +1136 -0
  76. package/dist/components/checkbox/index.js +26 -0
  77. package/dist/components/chip/index.cjs +20 -0
  78. package/dist/components/chip/index.d.cts +608 -0
  79. package/dist/components/chip/index.d.ts +608 -0
  80. package/dist/components/chip/index.js +20 -0
  81. package/dist/components/input/index.cjs +25 -0
  82. package/dist/components/input/index.d.cts +205 -0
  83. package/dist/components/input/index.d.ts +205 -0
  84. package/dist/components/input/index.js +25 -0
  85. package/dist/components/input-group/index.cjs +27 -0
  86. package/dist/components/input-group/index.d.cts +270 -0
  87. package/dist/components/input-group/index.d.ts +270 -0
  88. package/dist/components/input-group/index.js +27 -0
  89. package/dist/components/input-otp/index.cjs +29 -0
  90. package/dist/components/input-otp/index.d.cts +325 -0
  91. package/dist/components/input-otp/index.d.ts +325 -0
  92. package/dist/components/input-otp/index.js +29 -0
  93. package/dist/components/radio/index.cjs +26 -0
  94. package/dist/components/radio/index.d.cts +1102 -0
  95. package/dist/components/radio/index.d.ts +1102 -0
  96. package/dist/components/radio/index.js +26 -0
  97. package/dist/components/spinner/index.cjs +16 -0
  98. package/dist/components/spinner/index.d.cts +104 -0
  99. package/dist/components/spinner/index.d.ts +104 -0
  100. package/dist/components/spinner/index.js +16 -0
  101. package/dist/components/switch/index.cjs +27 -0
  102. package/dist/components/switch/index.d.cts +1154 -0
  103. package/dist/components/switch/index.d.ts +1154 -0
  104. package/dist/components/switch/index.js +27 -0
  105. package/dist/components/text-area/index.cjs +14 -0
  106. package/dist/components/text-area/index.d.cts +73 -0
  107. package/dist/components/text-area/index.d.ts +73 -0
  108. package/dist/components/text-area/index.js +14 -0
  109. package/dist/components/typography/index.cjs +15 -0
  110. package/dist/components/typography/index.d.cts +116 -0
  111. package/dist/components/typography/index.d.ts +116 -0
  112. package/dist/components/typography/index.js +15 -0
  113. package/dist/components/view/index.cjs +17 -0
  114. package/dist/components/view/index.d.cts +152 -0
  115. package/dist/components/view/index.d.ts +152 -0
  116. package/dist/components/view/index.js +17 -0
  117. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  118. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  119. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  120. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  121. package/dist/index.cjs +246 -4
  122. package/dist/index.d.cts +109 -4
  123. package/dist/index.d.ts +109 -4
  124. package/dist/index.js +266 -24
  125. package/dist/input.type-BUMDlzL9.d.cts +167 -0
  126. package/dist/input.type-D2qgi03E.d.ts +167 -0
  127. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  128. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  129. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  130. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  131. package/dist/system/index.cjs +60 -3
  132. package/dist/system/index.d.cts +347 -181
  133. package/dist/system/index.d.ts +347 -181
  134. package/dist/system/index.js +71 -14
  135. package/dist/theme/index.cjs +4 -3
  136. package/dist/theme/index.d.cts +34 -23
  137. package/dist/theme/index.d.ts +34 -23
  138. package/dist/theme/index.js +3 -2
  139. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  140. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  141. package/package.json +174 -18
  142. package/dist/chunk-QAMNNTGM.js +0 -637
  143. package/dist/chunk-V63JO65F.cjs +0 -637
@@ -107,7 +107,10 @@ function deriveTint(tint, theme) {
107
107
  foreground,
108
108
  soft: alpha(tint, 0.15),
109
109
  softForeground: mix(tint, theme.colors.foreground, 0.2),
110
- pressed: mix(tint, foreground, 0.1),
110
+ // Towards the mode's ink, not the tint's own foreground — the same single direction
111
+ // the token layer takes (P2-API-REVIEW §E). A raw tint has to behave like `accent`
112
+ // under the finger as much as it does at rest.
113
+ pressed: mix(tint, theme.colors.foreground, 0.1),
111
114
  softPressed: alpha(tint, 0.2)
112
115
  };
113
116
  cache.set(key, derived);
@@ -122,4 +125,6 @@ function deriveTint(tint, theme) {
122
125
 
123
126
 
124
127
 
125
- exports.ThemeContext = ThemeContext; exports.useXAUITheme = useXAUITheme; exports.useColorMode = useColorMode; exports.useThemeColor = useThemeColor; exports.mix = mix; exports.alpha = alpha; exports.deriveTint = deriveTint;
128
+
129
+
130
+ exports.ThemeContext = ThemeContext; exports.useXAUITheme = useXAUITheme; exports.useColorMode = useColorMode; exports.useThemeColor = useThemeColor; exports.isHex = isHex; exports.mix = mix; exports.alpha = alpha; exports.contrastOn = contrastOn; exports.deriveTint = deriveTint;
@@ -0,0 +1,74 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunk5Z4P6WHRcjs = require('./chunk-5Z4P6WHR.cjs');
9
+
10
+
11
+ var _chunkZP2E2H2Gcjs = require('./chunk-ZP2E2H2G.cjs');
12
+
13
+
14
+ var _chunkGLGU2WFLcjs = require('./chunk-GLGU2WFL.cjs');
15
+
16
+ // src/components/text-area/text-area-field.tsx
17
+ var _react = require('react');
18
+
19
+ // src/components/text-area/text-area.context.ts
20
+ var [TextAreaProvider, useTextArea] = _chunkZP2E2H2Gcjs.createSlotContext.call(void 0, "TextArea");
21
+
22
+ // src/components/text-area/text-area-field.tsx
23
+ var _jsxruntime = require('react/jsx-runtime');
24
+ var TextAreaField = _react.forwardRef.call(void 0,
25
+ function TextAreaField2({ style, scrollEnabled, ...props }, ref) {
26
+ const { textAreaStyle, textArea } = _chunk5Z4P6WHRcjs.useInput.call(void 0, );
27
+ const { rows, maxRows } = useTextArea();
28
+ const [styleProps, rest] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
29
+ const height = _react.useMemo.call(void 0, () => {
30
+ const chrome = textArea.paddingVertical * 2;
31
+ return {
32
+ minHeight: rows * textArea.lineHeight + chrome,
33
+ // Unset, the field grows for as long as the text does. With a ceiling it stops
34
+ // there and scrolls, which is the only case that needs `scrollEnabled` — a
35
+ // multiline field that can grow has nothing to scroll.
36
+ maxHeight: maxRows ? maxRows * textArea.lineHeight + chrome : void 0
37
+ };
38
+ }, [rows, maxRows, textArea]);
39
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
40
+ _chunk5Z4P6WHRcjs.InputField,
41
+ {
42
+ ref,
43
+ multiline: true,
44
+ scrollEnabled: _nullishCoalesce(scrollEnabled, () => ( maxRows !== void 0)),
45
+ ...rest,
46
+ style: [textAreaStyle, height, styleProps, style]
47
+ }
48
+ );
49
+ }
50
+ );
51
+ TextAreaField.displayName = "XAUI.TextArea.Field";
52
+
53
+ // src/components/text-area/text-area.tsx
54
+
55
+
56
+ var DEFAULT_ROWS = 3;
57
+ var TextAreaRoot = _react.forwardRef.call(void 0, function TextArea({ rows = DEFAULT_ROWS, maxRows, children, ...props }, ref) {
58
+ const context = _react.useMemo.call(void 0, () => ({ rows, maxRows }), [rows, maxRows]);
59
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TextAreaProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk5Z4P6WHRcjs.InputRoot, { ref, ...props, children }) });
60
+ });
61
+ TextAreaRoot.displayName = "XAUI.TextArea.Root";
62
+
63
+ // src/components/text-area/index.ts
64
+ var TextArea2 = Object.assign(TextAreaRoot, {
65
+ Label: _chunk5Z4P6WHRcjs.InputLabel,
66
+ Field: TextAreaField,
67
+ Description: _chunk5Z4P6WHRcjs.InputDescription,
68
+ Error: _chunk5Z4P6WHRcjs.InputError
69
+ });
70
+
71
+
72
+
73
+
74
+ exports.useTextArea = useTextArea; exports.TextArea = TextArea2;
@@ -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 _chunkGPVNCJ3Zcjs = require('./chunk-GPVNCJ3Z.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 _chunkZP2E2H2Gcjs = require('./chunk-ZP2E2H2G.cjs');
21
+
22
+
23
+ var _chunkGLGU2WFLcjs = require('./chunk-GLGU2WFL.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] = _chunkZP2E2H2Gcjs.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] = _chunkGLGU2WFLcjs.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] = _chunkGLGU2WFLcjs.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] = _chunkGLGU2WFLcjs.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] = _chunkGLGU2WFLcjs.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] = _chunkGLGU2WFLcjs.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] = _chunkGLGU2WFLcjs.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] = _chunkGLGU2WFLcjs.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 = _chunkZP2E2H2Gcjs.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
+ _chunkGPVNCJ3Zcjs.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, _chunkGPVNCJ3Zcjs.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
+ _chunkZP2E2H2Gcjs.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;