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

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 (149) hide show
  1. package/dist/chunk-3FV4COTM.js +68 -0
  2. package/dist/chunk-423RQBOX.js +21 -0
  3. package/dist/chunk-42FMGB5M.js +661 -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-5PTBRJM7.cjs +346 -0
  9. package/dist/chunk-5RQ7AZPN.cjs +455 -0
  10. package/dist/chunk-5Z4P6WHR.cjs +525 -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-AETWQQWU.cjs +92 -0
  18. package/dist/chunk-ANNUYP55.cjs +431 -0
  19. package/dist/chunk-BA2DBSAN.js +102 -0
  20. package/dist/chunk-BFMTUMTU.js +669 -0
  21. package/dist/chunk-BVJQ3UPZ.js +62 -0
  22. package/dist/chunk-DFME724B.js +147 -0
  23. package/dist/chunk-E2CWBQTV.js +119 -0
  24. package/dist/chunk-EGLLDKN6.js +9 -0
  25. package/dist/chunk-EJQCQPET.cjs +9 -0
  26. package/dist/chunk-F6CQ6CBI.cjs +112 -0
  27. package/dist/chunk-F6W3JQ7K.js +42 -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-GLGU2WFL.cjs +190 -0
  32. package/dist/chunk-GPVNCJ3Z.cjs +696 -0
  33. package/dist/chunk-GVQOD3VW.js +74 -0
  34. package/dist/chunk-IHOCANCQ.js +293 -0
  35. package/dist/chunk-JDFV4W6N.cjs +700 -0
  36. package/dist/chunk-KOC3KQIT.js +124 -0
  37. package/dist/chunk-KPWZLUES.cjs +124 -0
  38. package/dist/chunk-L7JN6OBQ.cjs +314 -0
  39. package/dist/chunk-MC7SY2QH.cjs +20 -0
  40. package/dist/chunk-MDVSCWJI.js +314 -0
  41. package/dist/chunk-N527BTY4.cjs +366 -0
  42. package/dist/chunk-NYRXUGVL.js +104 -0
  43. package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
  44. package/dist/chunk-Q3WFY5N3.js +366 -0
  45. package/dist/chunk-QGN2BBJO.cjs +104 -0
  46. package/dist/chunk-RDTKAAHX.js +346 -0
  47. package/dist/chunk-TGZZ3RZU.cjs +86 -0
  48. package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
  49. package/dist/chunk-URSKA2VR.js +190 -0
  50. package/dist/chunk-V4WDMM6Z.js +86 -0
  51. package/dist/chunk-VJEER76X.js +455 -0
  52. package/dist/chunk-VZBWYWEI.cjs +736 -0
  53. package/dist/chunk-WR7YLDVV.cjs +68 -0
  54. package/dist/chunk-X4HQ4H2V.js +701 -0
  55. package/dist/chunk-XFSW3ZNI.cjs +145 -0
  56. package/dist/chunk-XQFAUDR2.cjs +62 -0
  57. package/dist/chunk-ZH5XVNHG.js +92 -0
  58. package/dist/chunk-ZH6BHLQR.js +431 -0
  59. package/dist/chunk-ZP2E2H2G.cjs +119 -0
  60. package/dist/chunk-ZVWXM3UK.cjs +293 -0
  61. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  62. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  63. package/dist/components/alert/index.cjs +20 -0
  64. package/dist/components/alert/index.d.cts +169 -0
  65. package/dist/components/alert/index.d.ts +169 -0
  66. package/dist/components/alert/index.js +20 -0
  67. package/dist/components/button/index.cjs +21 -0
  68. package/dist/components/button/index.d.cts +613 -0
  69. package/dist/components/button/index.d.ts +613 -0
  70. package/dist/components/button/index.js +21 -0
  71. package/dist/components/card/index.cjs +22 -0
  72. package/dist/components/card/index.d.cts +620 -0
  73. package/dist/components/card/index.d.ts +620 -0
  74. package/dist/components/card/index.js +22 -0
  75. package/dist/components/checkbox/index.cjs +26 -0
  76. package/dist/components/checkbox/index.d.cts +1136 -0
  77. package/dist/components/checkbox/index.d.ts +1136 -0
  78. package/dist/components/checkbox/index.js +26 -0
  79. package/dist/components/chip/index.cjs +20 -0
  80. package/dist/components/chip/index.d.cts +608 -0
  81. package/dist/components/chip/index.d.ts +608 -0
  82. package/dist/components/chip/index.js +20 -0
  83. package/dist/components/divider/index.cjs +13 -0
  84. package/dist/components/divider/index.d.cts +117 -0
  85. package/dist/components/divider/index.d.ts +117 -0
  86. package/dist/components/divider/index.js +13 -0
  87. package/dist/components/input/index.cjs +25 -0
  88. package/dist/components/input/index.d.cts +205 -0
  89. package/dist/components/input/index.d.ts +205 -0
  90. package/dist/components/input/index.js +25 -0
  91. package/dist/components/input-group/index.cjs +27 -0
  92. package/dist/components/input-group/index.d.cts +270 -0
  93. package/dist/components/input-group/index.d.ts +270 -0
  94. package/dist/components/input-group/index.js +27 -0
  95. package/dist/components/input-otp/index.cjs +29 -0
  96. package/dist/components/input-otp/index.d.cts +325 -0
  97. package/dist/components/input-otp/index.d.ts +325 -0
  98. package/dist/components/input-otp/index.js +29 -0
  99. package/dist/components/radio/index.cjs +26 -0
  100. package/dist/components/radio/index.d.cts +1102 -0
  101. package/dist/components/radio/index.d.ts +1102 -0
  102. package/dist/components/radio/index.js +26 -0
  103. package/dist/components/spinner/index.cjs +16 -0
  104. package/dist/components/spinner/index.d.cts +104 -0
  105. package/dist/components/spinner/index.d.ts +104 -0
  106. package/dist/components/spinner/index.js +16 -0
  107. package/dist/components/switch/index.cjs +27 -0
  108. package/dist/components/switch/index.d.cts +1154 -0
  109. package/dist/components/switch/index.d.ts +1154 -0
  110. package/dist/components/switch/index.js +27 -0
  111. package/dist/components/text-area/index.cjs +14 -0
  112. package/dist/components/text-area/index.d.cts +73 -0
  113. package/dist/components/text-area/index.d.ts +73 -0
  114. package/dist/components/text-area/index.js +14 -0
  115. package/dist/components/typography/index.cjs +15 -0
  116. package/dist/components/typography/index.d.cts +116 -0
  117. package/dist/components/typography/index.d.ts +116 -0
  118. package/dist/components/typography/index.js +15 -0
  119. package/dist/components/view/index.cjs +17 -0
  120. package/dist/components/view/index.d.cts +152 -0
  121. package/dist/components/view/index.d.ts +152 -0
  122. package/dist/components/view/index.js +17 -0
  123. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  124. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  125. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  126. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  127. package/dist/index.cjs +252 -4
  128. package/dist/index.d.cts +110 -4
  129. package/dist/index.d.ts +110 -4
  130. package/dist/index.js +271 -23
  131. package/dist/input.type-BUMDlzL9.d.cts +167 -0
  132. package/dist/input.type-D2qgi03E.d.ts +167 -0
  133. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  134. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  135. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  136. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  137. package/dist/system/index.cjs +60 -3
  138. package/dist/system/index.d.cts +347 -181
  139. package/dist/system/index.d.ts +347 -181
  140. package/dist/system/index.js +71 -14
  141. package/dist/theme/index.cjs +4 -3
  142. package/dist/theme/index.d.cts +34 -23
  143. package/dist/theme/index.d.ts +34 -23
  144. package/dist/theme/index.js +3 -2
  145. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  146. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  147. package/package.json +184 -18
  148. package/dist/chunk-QAMNNTGM.js +0 -637
  149. package/dist/chunk-V63JO65F.cjs +0 -637
@@ -0,0 +1,293 @@
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 _chunkF6CQ6CBIcjs = require('./chunk-F6CQ6CBI.cjs');
4
+
5
+
6
+ var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
7
+
8
+
9
+ var _chunkGPVNCJ3Zcjs = require('./chunk-GPVNCJ3Z.cjs');
10
+
11
+
12
+ var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
13
+
14
+
15
+
16
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
17
+
18
+
19
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
20
+
21
+
22
+
23
+ var _chunkZP2E2H2Gcjs = require('./chunk-ZP2E2H2G.cjs');
24
+
25
+
26
+ var _chunkGLGU2WFLcjs = require('./chunk-GLGU2WFL.cjs');
27
+
28
+ // src/components/radio/radio-indicator.tsx
29
+ var _react = require('react');
30
+ var _reactnative = require('react-native');
31
+
32
+ // src/components/radio/radio.context.ts
33
+ var [RadioProvider, useRadio] = _chunkZP2E2H2Gcjs.createSlotContext.call(void 0, "Radio");
34
+
35
+ // src/components/radio/radio-indicator.tsx
36
+ var _jsxruntime = require('react/jsx-runtime');
37
+ var RadioIndicator = _react.forwardRef.call(void 0,
38
+ function RadioIndicator2({ children, animation = true, style, ...props }, ref) {
39
+ const { indicatorStyle, fillStyle, isSelected } = useRadio();
40
+ const [styleProps, rest] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
41
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [indicatorStyle, styleProps, style], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
42
+ _chunkF6CQ6CBIcjs.SelectionFill,
43
+ {
44
+ isVisible: isSelected,
45
+ style: fillStyle,
46
+ animation,
47
+ children: _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Thumb, {})))
48
+ }
49
+ ) });
50
+ }
51
+ );
52
+ RadioIndicator.displayName = "XAUI.Radio.Indicator";
53
+ function Thumb() {
54
+ const { thumbStyle } = useRadio();
55
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: thumbStyle });
56
+ }
57
+
58
+ // src/components/radio/radio-label.tsx
59
+
60
+
61
+
62
+ var RadioLabel = _react.forwardRef.call(void 0, function RadioLabel2({ children, style, ...props }, ref) {
63
+ const { labelStyle } = useRadio();
64
+ const [styleProps, rest] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
65
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, style: [labelStyle, styleProps, style], ...rest, children });
66
+ });
67
+ RadioLabel.displayName = "XAUI.Radio.Label";
68
+
69
+ // src/components/radio/radio.tsx
70
+
71
+
72
+ // src/components/radio/radio.recipe.ts
73
+ var SLOTS = ["root", "indicator", "fill", "thumb", "label"];
74
+ var VARIANT_TOKENS = {
75
+ primary: {
76
+ bg: "fieldBackground",
77
+ border: "fieldBorder",
78
+ bgSelected: "accent",
79
+ fgSelected: "accentForeground"
80
+ },
81
+ secondary: {
82
+ bg: "default",
83
+ border: "fieldBorder",
84
+ bgSelected: "accent",
85
+ fgSelected: "accentForeground"
86
+ },
87
+ tertiary: {
88
+ border: "fieldBorder",
89
+ bgSelected: "accent",
90
+ fgSelected: "accentForeground"
91
+ }
92
+ };
93
+ function sizeAxis(step) {
94
+ const { box, label, gap } = step;
95
+ return (theme) => {
96
+ const side = theme.spacing(box);
97
+ const dot = Math.round(side * THUMB_RATIO);
98
+ return {
99
+ root: { gap: theme.spacing(gap) },
100
+ indicator: { width: side, height: side },
101
+ thumb: { width: dot, height: dot, borderRadius: dot / 2 },
102
+ label: {
103
+ fontSize: theme.fontSizes[label],
104
+ lineHeight: theme.lineHeights[label]
105
+ }
106
+ };
107
+ };
108
+ }
109
+ var THUMB_RATIO = 10 / 24;
110
+ var SIZES = {
111
+ sm: { box: 5, gap: 2, label: "sm" },
112
+ md: { box: 6, gap: 2, label: "md" },
113
+ lg: { box: 7, gap: 2.5, label: "lg" }
114
+ };
115
+ var radioRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
116
+ slots: SLOTS,
117
+ base: (theme) => ({
118
+ root: { flexDirection: "row", alignItems: "center", alignSelf: "flex-start" },
119
+ indicator: {
120
+ alignItems: "center",
121
+ justifyContent: "center",
122
+ borderWidth: theme.borderWidth.field,
123
+ // The one shape decision this component makes, and the whole difference between it
124
+ // and the `Checkbox`: a radio is round, at every size. `radius` still overrides it.
125
+ borderRadius: theme.radius.full,
126
+ overflow: "hidden"
127
+ },
128
+ fill: {
129
+ position: "absolute",
130
+ top: 0,
131
+ bottom: 0,
132
+ start: 0,
133
+ end: 0,
134
+ alignItems: "center",
135
+ justifyContent: "center"
136
+ },
137
+ label: {
138
+ fontFamily: theme.fontFamilies.body,
139
+ color: theme.colors.foreground
140
+ }
141
+ }),
142
+ variantTokens: VARIANT_TOKENS,
143
+ /** The `Checkbox`'s paint, with a dot where the check was. */
144
+ paint: (theme, colors) => ({
145
+ indicator: {
146
+ backgroundColor: colors.bg,
147
+ borderColor: colors.border,
148
+ borderWidth: colors.border ? theme.borderWidth.field : 0
149
+ },
150
+ fill: { backgroundColor: colors.bgSelected },
151
+ thumb: { backgroundColor: colors.fgSelected }
152
+ }),
153
+ variants: {
154
+ size: {
155
+ sm: sizeAxis(SIZES.sm),
156
+ md: sizeAxis(SIZES.md),
157
+ lg: sizeAxis(SIZES.lg)
158
+ },
159
+ radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "indicator"),
160
+ /** Declared after `size` so its border wins. The `Checkbox`'s rule, to the letter. */
161
+ isInvalid: {
162
+ true: (theme) => ({
163
+ indicator: { borderColor: theme.colors.danger, backgroundColor: void 0 },
164
+ fill: { backgroundColor: theme.colors.danger },
165
+ thumb: { backgroundColor: theme.colors.dangerForeground },
166
+ label: { color: theme.colors.danger }
167
+ })
168
+ }
169
+ },
170
+ compoundVariants: [
171
+ {
172
+ when: { variant: "primary" },
173
+ style: (theme) => ({ indicator: theme.shadows.field })
174
+ }
175
+ ],
176
+ states: {
177
+ disabled: (theme) => ({ root: { opacity: theme.opacity.disabled } })
178
+ },
179
+ defaultVariants: { variant: "secondary", size: "md" }
180
+ });
181
+
182
+ // src/components/radio/radio.tsx
183
+
184
+ var RadioRoot = _react.forwardRef.call(void 0, function Radio({
185
+ children,
186
+ variant,
187
+ size,
188
+ radius,
189
+ color,
190
+ isSelected,
191
+ defaultSelected = false,
192
+ onSelectedChange,
193
+ isInvalid = false,
194
+ isDisabled = false,
195
+ asChild = false,
196
+ accessibilityRole,
197
+ accessibilityState,
198
+ animation,
199
+ style,
200
+ onPress,
201
+ onPressIn,
202
+ onPressOut,
203
+ ...props
204
+ }, ref) {
205
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
206
+ const [styleProps, rest] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
207
+ const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
208
+ const [selected, setSelected] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
209
+ value: isSelected,
210
+ defaultValue: defaultSelected,
211
+ onChange: onSelectedChange
212
+ });
213
+ const handlePress = _react.useCallback.call(void 0,
214
+ (event) => {
215
+ setSelected(true);
216
+ _optionalChain([onPress, 'optionalCall', _ => _(event)]);
217
+ },
218
+ [setSelected, onPress]
219
+ );
220
+ const selection = {
221
+ variant,
222
+ size,
223
+ radius,
224
+ isInvalid: isInvalid ? "true" : void 0
225
+ };
226
+ const states = { pressed: isPressed, disabled: isDisabled };
227
+ const styles = radioRecipe.resolve({ theme, selection, states });
228
+ const tint = color && !isInvalid ? radioRecipe.tint({ theme, color, selection, states }) : void 0;
229
+ const context = _react.useMemo.call(void 0,
230
+ () => ({
231
+ // The tint never reaches the circle at rest — only the fill and the dot that say it
232
+ // is the chosen one. The `Checkbox` says why, at the same line.
233
+ indicatorStyle: styles.indicator,
234
+ fillStyle: tint ? [styles.fill, tint.fill] : styles.fill,
235
+ thumbStyle: tint ? [styles.thumb, tint.thumb] : styles.thumb,
236
+ labelStyle: styles.label,
237
+ isSelected: selected,
238
+ isDisabled,
239
+ isInvalid
240
+ }),
241
+ [styles, tint, selected, isDisabled, isInvalid]
242
+ );
243
+ const rootStyle = [
244
+ styles.root,
245
+ _optionalChain([tint, 'optionalAccess', _2 => _2.root]),
246
+ styleProps,
247
+ typeof style === "function" ? style({ pressed: isPressed }) : style
248
+ ];
249
+ const text = _chunkZP2E2H2Gcjs.childrenToString.call(void 0, children);
250
+ const content = text !== null ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
251
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RadioIndicator, {}),
252
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RadioLabel, { children: text })
253
+ ] }) : _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RadioIndicator, {})));
254
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RadioProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
255
+ _chunkGPVNCJ3Zcjs.PressableFeedback,
256
+ {
257
+ ref,
258
+ isPressed,
259
+ isDisabled,
260
+ asChild,
261
+ animation,
262
+ accessibilityRole: _nullishCoalesce(accessibilityRole, () => ( "radio")),
263
+ accessibilityState: {
264
+ checked: selected,
265
+ disabled: isDisabled,
266
+ ...accessibilityState
267
+ },
268
+ "aria-invalid": isInvalid,
269
+ ...rest,
270
+ style: rootStyle,
271
+ onPress: handlePress,
272
+ onPressIn: press.onPressIn,
273
+ onPressOut: press.onPressOut,
274
+ children: asChild ? children : content
275
+ }
276
+ ) });
277
+ });
278
+ RadioRoot.displayName = "XAUI.Radio.Root";
279
+
280
+ // src/components/radio/index.ts
281
+ var Radio2 = Object.assign(RadioRoot, {
282
+ Indicator: RadioIndicator,
283
+ Label: RadioLabel
284
+ });
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+ exports.useRadio = useRadio; exports.RadioIndicator = RadioIndicator; exports.RadioLabel = RadioLabel; exports.radioRecipe = radioRecipe; exports.RadioRoot = RadioRoot; exports.Radio = Radio2;
@@ -0,0 +1,36 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle, PressableStateCallbackType } from 'react-native';
3
+ import { P as PressableFeedbackProps } from './pressable-feedback.type-Bs4dQlGj.js';
4
+
5
+ type CloseButtonOwnProps = {
6
+ /**
7
+ * Names the slot in the development warning about a missing label — `'Chip.Close'`,
8
+ * `'Alert.Close'`. Without it the warning would say "a close button" and leave the
9
+ * reader to find which one.
10
+ */
11
+ name: string;
12
+ /**
13
+ * Replaces the built-in cross — an `Icon`, or any glyph. Unset, the button draws its
14
+ * own from two rotated bars, which is what makes a dismissible component work in a
15
+ * project that has installed no icon set.
16
+ */
17
+ children?: ReactNode;
18
+ /**
19
+ * The style the surrounding component's recipe resolved for this node, applied under
20
+ * the caller's own. It is separate from `style` because `style` may be `Pressable`'s
21
+ * function form, and a function cannot be merged into an array without being resolved
22
+ * first — which only this component can do, since it owns the press state.
23
+ */
24
+ baseStyle?: StyleProp<ViewStyle>;
25
+ /** One bar of the cross: its length, its thickness and its colour, from the recipe. */
26
+ glyphStyle?: StyleProp<ViewStyle>;
27
+ /** R9 — `Pressable`'s function form as much as an object or an array. */
28
+ style?: StyleProp<ViewStyle> | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>);
29
+ };
30
+ /**
31
+ * R14 — it renders a `PressableFeedback`, so it carries that node's style keys as props
32
+ * through it.
33
+ */
34
+ type CloseButtonProps = CloseButtonOwnProps & Omit<PressableFeedbackProps, 'isPressed' | 'style' | 'children'>;
35
+
36
+ export type { CloseButtonProps as C };
@@ -0,0 +1,36 @@
1
+ import { ReactNode } from 'react';
2
+ import { StyleProp, ViewStyle, PressableStateCallbackType } from 'react-native';
3
+ import { P as PressableFeedbackProps } from './pressable-feedback.type-BA2C9sSz.cjs';
4
+
5
+ type CloseButtonOwnProps = {
6
+ /**
7
+ * Names the slot in the development warning about a missing label — `'Chip.Close'`,
8
+ * `'Alert.Close'`. Without it the warning would say "a close button" and leave the
9
+ * reader to find which one.
10
+ */
11
+ name: string;
12
+ /**
13
+ * Replaces the built-in cross — an `Icon`, or any glyph. Unset, the button draws its
14
+ * own from two rotated bars, which is what makes a dismissible component work in a
15
+ * project that has installed no icon set.
16
+ */
17
+ children?: ReactNode;
18
+ /**
19
+ * The style the surrounding component's recipe resolved for this node, applied under
20
+ * the caller's own. It is separate from `style` because `style` may be `Pressable`'s
21
+ * function form, and a function cannot be merged into an array without being resolved
22
+ * first — which only this component can do, since it owns the press state.
23
+ */
24
+ baseStyle?: StyleProp<ViewStyle>;
25
+ /** One bar of the cross: its length, its thickness and its colour, from the recipe. */
26
+ glyphStyle?: StyleProp<ViewStyle>;
27
+ /** R9 — `Pressable`'s function form as much as an object or an array. */
28
+ style?: StyleProp<ViewStyle> | ((state: PressableStateCallbackType) => StyleProp<ViewStyle>);
29
+ };
30
+ /**
31
+ * R14 — it renders a `PressableFeedback`, so it carries that node's style keys as props
32
+ * through it.
33
+ */
34
+ type CloseButtonProps = CloseButtonOwnProps & Omit<PressableFeedbackProps, 'isPressed' | 'style' | 'children'>;
35
+
36
+ export type { CloseButtonProps as C };
@@ -0,0 +1,20 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkN527BTY4cjs = require('../../chunk-N527BTY4.cjs');
6
+ require('../../chunk-TGZZ3RZU.cjs');
7
+ require('../../chunk-GPVNCJ3Z.cjs');
8
+ require('../../chunk-7DPL3ZDS.cjs');
9
+ require('../../chunk-EJQCQPET.cjs');
10
+ require('../../chunk-WR7YLDVV.cjs');
11
+ require('../../chunk-FNEUOBCV.cjs');
12
+ require('../../chunk-57SJ4LJF.cjs');
13
+ require('../../chunk-ZP2E2H2G.cjs');
14
+ require('../../chunk-GLGU2WFL.cjs');
15
+ require('../../chunk-MC7SY2QH.cjs');
16
+
17
+
18
+
19
+
20
+ exports.Alert = _chunkN527BTY4cjs.Alert; exports.alertRecipe = _chunkN527BTY4cjs.alertRecipe; exports.useAlert = _chunkN527BTY4cjs.useAlert;
@@ -0,0 +1,169 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_native from 'react-native';
4
+ import { StyleProp, ViewStyle, TextStyle, ViewProps, TextProps } from 'react-native';
5
+ import { V as ViewStyleProps, T as TextStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
6
+ import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
7
+ import { I as IconContextValue, a as IconProps } from '../../icon.type-d_i9ma-i.cjs';
8
+ import { C as CloseButtonProps } from '../../close-button.type-CHsgZ3wO.cjs';
9
+ import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-dC7wMfnj.cjs';
10
+ import '../../pressable-feedback.type-BA2C9sSz.cjs';
11
+ import 'react-native-reanimated';
12
+
13
+ type AlertSlot = 'root' | 'icon' | 'iconGlyph' | 'content' | 'title' | 'description' | 'close' | 'closeGlyph';
14
+ /**
15
+ * Nine names: the surface, the accent in two weights, and the three status families in
16
+ * theirs. An alert is the one component in the library that is **both** a surface and a
17
+ * report, so it takes the emphasis vocabulary of the `Card` for its neutral level and the
18
+ * status vocabulary of the `Chip` for the rest.
19
+ *
20
+ * - **`default`** — the `surface` fill and the surface shadow, exactly the `Card`'s
21
+ * `default`. This is HeroUI's alert: a neutral card, with the status carried by the icon
22
+ * rather than by the background.
23
+ * - **`primary` / `secondary`** — the full accent and its soft slice, for the
24
+ * informational alert that is not an outcome.
25
+ * - **`success` / `warning` / `danger`**, each with a `-soft` slice — the tinted surface
26
+ * most alerts want, and the solid fill for the banner that has to stop the reader.
27
+ *
28
+ * `tertiary` and `ghost` are absent: an alert without a surface is a paragraph, and the
29
+ * outline case is `default` with `borderWidth` and `borderColor` as style props (R14).
30
+ */
31
+ type AlertVariant = 'default' | 'primary' | 'secondary' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
32
+ type AlertSize = Size;
33
+ /**
34
+ * What the `Alert` itself understands. R14 — a name in here is the component's, so the
35
+ * style prop that shares it is not exposed: `size` is the alert's scale and never
36
+ * `ViewStyle`'s, and `color` is R7's tint.
37
+ */
38
+ type AlertOwnProps = {
39
+ variant?: AlertVariant;
40
+ /**
41
+ * Padding, gaps, radius and the type of `Title` and `Description`. **Never a height**:
42
+ * an alert is a surface, and it is as tall as the message it carries.
43
+ */
44
+ size?: AlertSize;
45
+ /** Overrides the radius `size` chose. */
46
+ radius?: RadiusKey;
47
+ /**
48
+ * A raw tint (`'#7c3aed'`), never a token (R7). It paints the fill and, through its
49
+ * OKLab-contrasted slice, the title and the icon — so a brand-coloured alert stays
50
+ * readable without being told a second colour.
51
+ */
52
+ color?: string;
53
+ /** Dims the alert, and reaches the close inside it. */
54
+ isDisabled?: boolean;
55
+ style?: StyleProp<ViewStyle>;
56
+ children?: ReactNode;
57
+ };
58
+ /**
59
+ * R14 — the alert's own props, `View`'s, and every `ViewStyle` key neither already
60
+ * claims. There is no press behaviour here, deliberately: an alert reports, it is not a
61
+ * control. A dismissible one carries an `Alert.Close`, which is the control.
62
+ */
63
+ type AlertProps = AlertOwnProps & Omit<ViewProps, keyof AlertOwnProps> & Omit<ViewStyleProps, keyof AlertOwnProps | keyof ViewProps> & {
64
+ /** R12 — merge into the single child instead of rendering a `View`. */
65
+ asChild?: boolean;
66
+ };
67
+ /** `View`'s own props win over the `ViewStyle` keys of the same name (R14). */
68
+ type AlertContentProps = ViewProps & Omit<ViewStyleProps, keyof ViewProps> & {
69
+ children?: ReactNode;
70
+ };
71
+ /** `Text`'s own props win over the `TextStyle` keys of the same name (R14). */
72
+ type AlertTextProps = TextProps & Omit<TextStyleProps, keyof TextProps> & {
73
+ children?: ReactNode;
74
+ };
75
+ type AlertTitleProps = AlertTextProps;
76
+ type AlertDescriptionProps = AlertTextProps;
77
+ /**
78
+ * `Icon`'s three forms, plus the `ViewStyle` keys of the box around them (R14).
79
+ *
80
+ * Unlike `Button.Icon` and `Chip.Icon`, this slot **renders a view of its own**. It has
81
+ * to: an alert's icon sits beside a block of text rather than on one line with it, and
82
+ * lining the glyph up with the first line's cap-height means offsetting it by half the
83
+ * leading — which needs a node. That node is also what lets the slot carry style props at
84
+ * all, which the other two cannot.
85
+ */
86
+ type AlertIconGlyphKey = 'as' | 'children' | 'source' | 'size' | 'color';
87
+ /**
88
+ * `Pick`, distributed over `Icon`'s three forms rather than applied to the union as a
89
+ * whole. Applied as a whole it merges them into one shape where `as` and `source` are both
90
+ * optional — which is the boundary `IconProps` was turned into a union to keep, so
91
+ * `<Alert.Icon as={Check} source={png} />` would compile again and one of the two would be
92
+ * silently dropped.
93
+ */
94
+ type AlertIconGlyphProps<T = IconProps> = T extends IconProps ? Pick<T, AlertIconGlyphKey> : never;
95
+ type AlertIconBoxProps = {
96
+ /** The box, not the glyph — `size` and `color` are what shape the icon itself. */
97
+ style?: StyleProp<ViewStyle>;
98
+ } & Omit<ViewStyleProps, AlertIconGlyphKey | 'style'>;
99
+ type AlertIconProps = AlertIconGlyphProps & AlertIconBoxProps;
100
+ /**
101
+ * Everything the shared `CloseButton` accepts, minus the three the alert supplies itself:
102
+ * the warning's name and the two resolved styles its recipe already decided (R5).
103
+ */
104
+ type AlertCloseProps = Omit<CloseButtonProps, 'name' | 'baseStyle' | 'glyphStyle'>;
105
+ /**
106
+ * R5 — resolved styles, not props for a slot to resolve a second time. Each entry is the
107
+ * cached `StyleSheet` reference with the uncached tint pass layered over it, so a slot
108
+ * merges its own `style` on top and does no work of its own.
109
+ */
110
+ type AlertContextValue = {
111
+ iconStyle: StyleProp<ViewStyle>;
112
+ contentStyle: StyleProp<ViewStyle>;
113
+ titleStyle: StyleProp<TextStyle>;
114
+ descriptionStyle: StyleProp<TextStyle>;
115
+ closeStyle: StyleProp<ViewStyle>;
116
+ closeGlyphStyle: StyleProp<ViewStyle>;
117
+ /**
118
+ * Values, not a style: `Icon` hands `size` and `color` to a third-party component, so
119
+ * the root flattens its icon slot once here rather than in every icon it contains.
120
+ */
121
+ icon: IconContextValue;
122
+ isDisabled: boolean;
123
+ };
124
+
125
+ declare const useAlert: () => AlertContextValue;
126
+
127
+ declare const alertRecipe: Recipe<"title" | "content" | "description" | "root" | "icon" | "iconGlyph" | "close" | "closeGlyph", AlertVariant, {
128
+ readonly size: {
129
+ readonly xs: (theme: XAUITheme) => SlotStyles<AlertSlot>;
130
+ readonly sm: (theme: XAUITheme) => SlotStyles<AlertSlot>;
131
+ readonly md: (theme: XAUITheme) => SlotStyles<AlertSlot>;
132
+ readonly lg: (theme: XAUITheme) => SlotStyles<AlertSlot>;
133
+ };
134
+ readonly radius: Record<RadiusKey, StyleFn<"root">>;
135
+ }>;
136
+
137
+ declare const Alert: react.ForwardRefExoticComponent<{
138
+ variant?: AlertVariant;
139
+ size?: AlertSize;
140
+ radius?: RadiusKey;
141
+ color?: string;
142
+ isDisabled?: boolean;
143
+ style?: react_native.StyleProp<react_native.ViewStyle>;
144
+ children?: react.ReactNode;
145
+ } & Omit<react_native.ViewProps, keyof {
146
+ variant?: AlertVariant;
147
+ size?: AlertSize;
148
+ radius?: RadiusKey;
149
+ color?: string;
150
+ isDisabled?: boolean;
151
+ style?: react_native.StyleProp<react_native.ViewStyle>;
152
+ children?: react.ReactNode;
153
+ }> & Omit<ViewStyleProps, "variant" | "size" | "radius" | "color" | "isDisabled" | "style" | "children" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction"> & {
154
+ asChild?: boolean;
155
+ } & react.RefAttributes<react_native.View>> & {
156
+ Icon: react.ForwardRefExoticComponent<AlertIconProps & react.RefAttributes<react_native.View>>;
157
+ Content: react.ForwardRefExoticComponent<react_native.ViewProps & Omit<ViewStyleProps, keyof react_native.ViewProps> & {
158
+ children?: react.ReactNode;
159
+ } & react.RefAttributes<react_native.View>>;
160
+ Title: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
161
+ children?: react.ReactNode;
162
+ } & react.RefAttributes<react_native.Text>>;
163
+ Description: react.ForwardRefExoticComponent<react_native.TextProps & Omit<TextStyleProps, keyof react_native.TextProps> & {
164
+ children?: react.ReactNode;
165
+ } & react.RefAttributes<react_native.Text>>;
166
+ Close: react.ForwardRefExoticComponent<AlertCloseProps & react.RefAttributes<react_native.View>>;
167
+ };
168
+
169
+ export { Alert, type AlertCloseProps, type AlertContentProps, type AlertContextValue, type AlertDescriptionProps, type AlertIconProps, type AlertProps, type AlertSize, type AlertSlot, type AlertTitleProps, type AlertVariant, alertRecipe, useAlert };