@xaui/native 0.9.1-alpha.37 → 0.9.1-alpha.38

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 (135) hide show
  1. package/dist/{chunk-OULTSBKU.js → chunk-26OGEFQI.js} +1 -1
  2. package/dist/{chunk-TJHYSSBZ.js → chunk-346QBNUD.js} +1 -1
  3. package/dist/{chunk-PPWXLZGL.js → chunk-3GFRSZYR.js} +15 -23
  4. package/dist/{chunk-DKH6BNPF.cjs → chunk-3JXI2IHV.cjs} +13 -13
  5. package/dist/{chunk-7B3UBUC6.cjs → chunk-4KFKWBN5.cjs} +23 -2
  6. package/dist/{chunk-IGLKACSR.cjs → chunk-4KSKQD37.cjs} +5 -5
  7. package/dist/{chunk-UBOXW5WO.cjs → chunk-54CWXA34.cjs} +61 -61
  8. package/dist/{chunk-ZJWEVFAO.cjs → chunk-66FOASTP.cjs} +9 -9
  9. package/dist/{chunk-5PPNDKRX.js → chunk-6CO6FM67.js} +16 -16
  10. package/dist/{chunk-54FJOKAN.cjs → chunk-7GHM4GKL.cjs} +25 -25
  11. package/dist/{chunk-AP6RVIIK.cjs → chunk-7TOG4TVU.cjs} +21 -21
  12. package/dist/{chunk-LEWW24RQ.cjs → chunk-A7YB7YWX.cjs} +3 -3
  13. package/dist/{chunk-3P6M2R4S.cjs → chunk-AAVCMCJ3.cjs} +4 -4
  14. package/dist/{chunk-VFTT3Q4B.cjs → chunk-BNFIFRQA.cjs} +3 -3
  15. package/dist/{chunk-JXNFOOKC.js → chunk-DY3SUG5P.js} +5 -5
  16. package/dist/{chunk-EOJ5MYAQ.js → chunk-EYD4H4X6.js} +4 -4
  17. package/dist/{chunk-RGKWNK4T.js → chunk-FBCWNXZC.js} +58 -58
  18. package/dist/{chunk-HXW4ANVB.js → chunk-FHUYHV6J.js} +25 -4
  19. package/dist/{chunk-6G3XWPNP.js → chunk-HA6BFY3A.js} +3 -3
  20. package/dist/{chunk-FTQHDJYL.cjs → chunk-HOI5425P.cjs} +9 -9
  21. package/dist/{chunk-YXPYOOHU.js → chunk-K72UDPVN.js} +27 -27
  22. package/dist/{chunk-NTD3NPRX.cjs → chunk-KSUV74BE.cjs} +2 -2
  23. package/dist/{chunk-UGF35NSE.js → chunk-LIUO6D3D.js} +75 -75
  24. package/dist/{chunk-E3X5ODKQ.js → chunk-LTX6TB5I.js} +1 -1
  25. package/dist/{chunk-BORJJYDW.js → chunk-MXGER5PI.js} +2 -2
  26. package/dist/{chunk-GTT4NHS2.cjs → chunk-NCCRQK3P.cjs} +11 -11
  27. package/dist/chunk-NCTOTTVW.js +13 -0
  28. package/dist/chunk-Q3MQ7S2D.cjs +476 -0
  29. package/dist/{chunk-NKPTXTTS.js → chunk-QZ24MZRX.js} +3 -3
  30. package/dist/{chunk-7LSY4WFL.js → chunk-R7BU4CPS.js} +2 -2
  31. package/dist/{chunk-DVDQSW7U.cjs → chunk-RAWGK2XK.cjs} +25 -60
  32. package/dist/{chunk-JB5LGQ54.cjs → chunk-RKCWYUGA.cjs} +3 -3
  33. package/dist/{chunk-SMW6ZWMH.js → chunk-S2WNWMNT.js} +1 -1
  34. package/dist/{chunk-WVLSQO6K.cjs → chunk-S4QUM4EE.cjs} +9 -9
  35. package/dist/{chunk-SO5UAGIU.js → chunk-SACDOFGF.js} +15 -15
  36. package/dist/{chunk-CUQTAPBU.cjs → chunk-SIP5J7HU.cjs} +17 -17
  37. package/dist/{chunk-O3A3DBSZ.js → chunk-SZLXPF3G.js} +1 -1
  38. package/dist/{chunk-437QULXO.cjs → chunk-TDTUAIFF.cjs} +5 -5
  39. package/dist/{chunk-DRMT346W.cjs → chunk-TGMVEHV7.cjs} +64 -64
  40. package/dist/{chunk-TDYPY2J7.js → chunk-TRETQZEW.js} +7 -7
  41. package/dist/{chunk-ITURCQMQ.cjs → chunk-URA25DU4.cjs} +5 -5
  42. package/dist/{chunk-4PTWZCOK.js → chunk-USF6EWYR.js} +7 -7
  43. package/dist/{chunk-P747CRAY.cjs → chunk-VZK3NLBH.cjs} +9 -9
  44. package/dist/chunk-WFEMJCXO.cjs +13 -0
  45. package/dist/{chunk-RVRVGG73.js → chunk-XNMZQSY5.js} +2 -2
  46. package/dist/{chunk-K4TWKF5U.cjs → chunk-XSQPVDFH.cjs} +15 -25
  47. package/dist/{chunk-JDSE4TQL.js → chunk-XTC2SLFT.js} +1 -1
  48. package/dist/{chunk-C5VDFRAD.cjs → chunk-XWNG2U4K.cjs} +2 -2
  49. package/dist/chunk-ZF6KIHXH.js +591 -0
  50. package/dist/{chunk-XWY4DF37.js → chunk-ZNZ7HVRW.js} +51 -88
  51. package/dist/components/accordion/index.cjs +34 -0
  52. package/dist/components/accordion/index.d.cts +299 -0
  53. package/dist/components/accordion/index.d.ts +299 -0
  54. package/dist/components/accordion/index.js +34 -0
  55. package/dist/components/alert/index.cjs +7 -7
  56. package/dist/components/alert/index.d.cts +2 -2
  57. package/dist/components/alert/index.d.ts +2 -2
  58. package/dist/components/alert/index.js +6 -6
  59. package/dist/components/avatar/index.cjs +4 -4
  60. package/dist/components/avatar/index.d.cts +3 -3
  61. package/dist/components/avatar/index.d.ts +3 -3
  62. package/dist/components/avatar/index.js +3 -3
  63. package/dist/components/badge/index.cjs +3 -3
  64. package/dist/components/badge/index.d.cts +1 -1
  65. package/dist/components/badge/index.d.ts +1 -1
  66. package/dist/components/badge/index.js +2 -2
  67. package/dist/components/button/index.cjs +8 -7
  68. package/dist/components/button/index.d.cts +204 -204
  69. package/dist/components/button/index.d.ts +204 -204
  70. package/dist/components/button/index.js +7 -6
  71. package/dist/components/card/index.cjs +5 -5
  72. package/dist/components/card/index.d.cts +206 -206
  73. package/dist/components/card/index.d.ts +206 -206
  74. package/dist/components/card/index.js +4 -4
  75. package/dist/components/checkbox/index.cjs +5 -5
  76. package/dist/components/checkbox/index.d.cts +408 -408
  77. package/dist/components/checkbox/index.d.ts +408 -408
  78. package/dist/components/checkbox/index.js +4 -4
  79. package/dist/components/chip/index.cjs +7 -7
  80. package/dist/components/chip/index.d.cts +205 -205
  81. package/dist/components/chip/index.d.ts +205 -205
  82. package/dist/components/chip/index.js +6 -6
  83. package/dist/components/divider/index.cjs +3 -3
  84. package/dist/components/divider/index.d.cts +3 -3
  85. package/dist/components/divider/index.d.ts +3 -3
  86. package/dist/components/divider/index.js +2 -2
  87. package/dist/components/field-group/index.cjs +5 -5
  88. package/dist/components/field-group/index.d.cts +8 -8
  89. package/dist/components/field-group/index.d.ts +8 -8
  90. package/dist/components/field-group/index.js +4 -4
  91. package/dist/components/input-otp/index.cjs +3 -3
  92. package/dist/components/input-otp/index.d.cts +2 -2
  93. package/dist/components/input-otp/index.d.ts +2 -2
  94. package/dist/components/input-otp/index.js +2 -2
  95. package/dist/components/radio/index.cjs +5 -5
  96. package/dist/components/radio/index.d.cts +419 -419
  97. package/dist/components/radio/index.d.ts +419 -419
  98. package/dist/components/radio/index.js +4 -4
  99. package/dist/components/select/index.cjs +8 -7
  100. package/dist/components/select/index.d.cts +12 -22
  101. package/dist/components/select/index.d.ts +12 -22
  102. package/dist/components/select/index.js +7 -6
  103. package/dist/components/skeleton/index.d.cts +1 -1
  104. package/dist/components/skeleton/index.d.ts +1 -1
  105. package/dist/components/spinner/index.cjs +5 -4
  106. package/dist/components/spinner/index.d.cts +1 -1
  107. package/dist/components/spinner/index.d.ts +1 -1
  108. package/dist/components/spinner/index.js +4 -3
  109. package/dist/components/switch/index.cjs +5 -5
  110. package/dist/components/switch/index.d.cts +409 -409
  111. package/dist/components/switch/index.d.ts +409 -409
  112. package/dist/components/switch/index.js +4 -4
  113. package/dist/components/text-area/index.cjs +4 -4
  114. package/dist/components/text-area/index.js +3 -3
  115. package/dist/components/text-field/index.cjs +3 -3
  116. package/dist/components/text-field/index.d.cts +3 -3
  117. package/dist/components/text-field/index.d.ts +3 -3
  118. package/dist/components/text-field/index.js +2 -2
  119. package/dist/components/typography/index.cjs +3 -3
  120. package/dist/components/typography/index.d.cts +5 -5
  121. package/dist/components/typography/index.d.ts +5 -5
  122. package/dist/components/typography/index.js +2 -2
  123. package/dist/components/view/index.cjs +3 -3
  124. package/dist/components/view/index.d.cts +8 -8
  125. package/dist/components/view/index.d.ts +8 -8
  126. package/dist/components/view/index.js +2 -2
  127. package/dist/index.cjs +51 -27
  128. package/dist/index.d.cts +3 -2
  129. package/dist/index.d.ts +3 -2
  130. package/dist/index.js +69 -45
  131. package/dist/system/index.cjs +9 -7
  132. package/dist/system/index.d.cts +46 -33
  133. package/dist/system/index.d.ts +46 -33
  134. package/dist/system/index.js +10 -8
  135. package/package.json +11 -1
@@ -0,0 +1,476 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+ var _chunk4KFKWBN5cjs = require('./chunk-4KFKWBN5.cjs');
6
+
7
+
8
+ var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
9
+
10
+
11
+ var _chunkTGMVEHV7cjs = require('./chunk-TGMVEHV7.cjs');
12
+
13
+
14
+ var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
15
+
16
+
17
+
18
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
19
+
20
+
21
+
22
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
23
+
24
+
25
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
26
+
27
+
28
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
29
+
30
+ // src/components/accordion/accordion-content.tsx
31
+ var _react = require('react');
32
+ var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
33
+
34
+ // src/components/accordion/accordion.animation.ts
35
+
36
+ var LAYOUT = _reactnativereanimated.LinearTransition.springify().damping(140).stiffness(1600).mass(4);
37
+ var CONTENT_MS = 200;
38
+ var contentEntering = _reactnativereanimated.FadeIn.duration(CONTENT_MS).easing(
39
+ _reactnativereanimated.Easing.out(_reactnativereanimated.Easing.ease)
40
+ );
41
+ var contentExiting = _reactnativereanimated.FadeOut.duration(CONTENT_MS).easing(
42
+ _reactnativereanimated.Easing.in(_reactnativereanimated.Easing.ease)
43
+ );
44
+ var INDICATOR_SPRING = { damping: 140, stiffness: 1e3, mass: 4 };
45
+ var INDICATOR_ROTATION = [0, -180];
46
+
47
+ // src/components/accordion/accordion.context.ts
48
+ var [AccordionProvider, useAccordion] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Accordion");
49
+ var [AccordionItemProvider, useAccordionItem] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Accordion.Item");
50
+
51
+ // src/components/accordion/accordion-content.tsx
52
+ var _jsxruntime = require('react/jsx-runtime');
53
+ var AccordionContent = _react.forwardRef.call(void 0,
54
+ function AccordionContent2({ children, style, ...props }, ref) {
55
+ const { contentStyle } = useAccordion();
56
+ const { isExpanded } = useAccordionItem();
57
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
58
+ if (!isExpanded) return null;
59
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
60
+ _reactnativereanimated2.default.View,
61
+ {
62
+ ref,
63
+ entering: contentEntering,
64
+ exiting: contentExiting,
65
+ ...rest,
66
+ style: [contentStyle, styleProps, style],
67
+ children
68
+ }
69
+ );
70
+ }
71
+ );
72
+ AccordionContent.displayName = "XAUI.Accordion.Content";
73
+
74
+ // src/components/accordion/accordion-indicator.tsx
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+ function AccordionIndicator({
84
+ as = _chunk4KFKWBN5cjs.ChevronDownIcon,
85
+ ...props
86
+ }) {
87
+ const { indicatorStyle } = useAccordion();
88
+ const { isExpanded } = useAccordionItem();
89
+ const progress = _reactnativereanimated.useSharedValue.call(void 0, isExpanded ? 1 : 0);
90
+ _react.useEffect.call(void 0, () => {
91
+ progress.set(_reactnativereanimated.withSpring.call(void 0, isExpanded ? 1 : 0, INDICATOR_SPRING));
92
+ }, [isExpanded, progress]);
93
+ const rotation = _reactnativereanimated.useAnimatedStyle.call(void 0, () => ({
94
+ transform: [
95
+ {
96
+ rotate: `${_reactnativereanimated.interpolate.call(void 0, progress.get(), [0, 1], [INDICATOR_ROTATION[0], INDICATOR_ROTATION[1]])}deg`
97
+ }
98
+ ]
99
+ }));
100
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { style: [indicatorStyle, rotation], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.Icon, { as, ...props }) });
101
+ }
102
+ AccordionIndicator.displayName = "XAUI.Accordion.Indicator";
103
+
104
+ // src/components/accordion/accordion-item.tsx
105
+
106
+
107
+
108
+ var AccordionItem = _react.forwardRef.call(void 0,
109
+ function AccordionItem2({ value, children, isDisabled = false, style, ...props }, ref) {
110
+ const { itemStyle, isDisabled: isRootDisabled, isExpanded } = useAccordion();
111
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
112
+ const expanded = isExpanded(value);
113
+ const disabled = isRootDisabled || isDisabled;
114
+ const context = _react.useMemo.call(void 0,
115
+ () => ({ value, isExpanded: expanded, isDisabled: disabled }),
116
+ [value, expanded, disabled]
117
+ );
118
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AccordionItemProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
119
+ _reactnativereanimated2.default.View,
120
+ {
121
+ ref,
122
+ layout: LAYOUT,
123
+ ...rest,
124
+ style: [itemStyle, styleProps, style],
125
+ children: typeof children === "function" ? children(context) : children
126
+ }
127
+ ) });
128
+ }
129
+ );
130
+ AccordionItem.displayName = "XAUI.Accordion.Item";
131
+
132
+ // src/components/accordion/accordion-trigger.tsx
133
+
134
+ var _reactnative = require('react-native');
135
+
136
+ var AccordionTrigger = _react.forwardRef.call(void 0,
137
+ function AccordionTrigger2({
138
+ children,
139
+ asChild = false,
140
+ accessibilityRole = "button",
141
+ accessibilityState,
142
+ style,
143
+ onPress,
144
+ onPressIn,
145
+ onPressOut,
146
+ ...props
147
+ }, ref) {
148
+ const { triggerStyle, triggerPressedStyle, labelStyle, glyph, toggle } = useAccordion();
149
+ const { value, isExpanded, isDisabled } = useAccordionItem();
150
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
151
+ const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
152
+ const handlePress = _react.useCallback.call(void 0,
153
+ (event) => {
154
+ _optionalChain([onPress, 'optionalCall', _ => _(event)]);
155
+ toggle(value);
156
+ },
157
+ [onPress, toggle, value]
158
+ );
159
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.IconContext.Provider, { value: glyph, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
160
+ _chunkTGMVEHV7cjs.PressableFeedback,
161
+ {
162
+ ref,
163
+ isPressed,
164
+ isDisabled,
165
+ asChild,
166
+ accessibilityRole,
167
+ accessibilityState: {
168
+ disabled: isDisabled,
169
+ expanded: isExpanded,
170
+ ...accessibilityState
171
+ },
172
+ ...rest,
173
+ style: [
174
+ triggerStyle,
175
+ isPressed && triggerPressedStyle,
176
+ styleProps,
177
+ typeof style === "function" ? style({ pressed: isPressed }) : style
178
+ ],
179
+ onPress: handlePress,
180
+ onPressIn: press.onPressIn,
181
+ onPressOut: press.onPressOut,
182
+ children: asChild ? children : wrapText(children, labelStyle)
183
+ }
184
+ ) });
185
+ }
186
+ );
187
+ AccordionTrigger.displayName = "XAUI.Accordion.Trigger";
188
+ function wrapText(children, style) {
189
+ return _react.Children.map(
190
+ children,
191
+ (child) => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { style, children: child }) : child
192
+ );
193
+ }
194
+
195
+ // src/components/accordion/accordion.tsx
196
+
197
+
198
+
199
+
200
+ // src/components/accordion/accordion.hook.ts
201
+
202
+ function useExpansion({
203
+ value,
204
+ defaultValue,
205
+ onValueChange,
206
+ selectionMode,
207
+ isCollapsible
208
+ }) {
209
+ const [current, setCurrent] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
210
+ value,
211
+ defaultValue: _nullishCoalesce(defaultValue, () => ( (selectionMode === "multiple" ? [] : ""))),
212
+ onChange: onValueChange
213
+ });
214
+ const isExpanded = _react.useCallback.call(void 0,
215
+ (item) => Array.isArray(current) ? current.includes(item) : current === item,
216
+ [current]
217
+ );
218
+ const toggle = _react.useCallback.call(void 0,
219
+ (item) => {
220
+ setCurrent((value_) => nextValue(value_, item, selectionMode, isCollapsible));
221
+ },
222
+ [isCollapsible, selectionMode, setCurrent]
223
+ );
224
+ return _react.useMemo.call(void 0, () => ({ isExpanded, toggle }), [isExpanded, toggle]);
225
+ }
226
+ function nextValue(current, item, selectionMode, isCollapsible) {
227
+ if (selectionMode === "multiple") {
228
+ const list = Array.isArray(current) ? current : current ? [current] : [];
229
+ if (!list.includes(item)) return [...list, item];
230
+ if (!isCollapsible && list.length === 1) return current;
231
+ return list.filter((value) => value !== item);
232
+ }
233
+ if (current !== item) return item;
234
+ return isCollapsible ? "" : current;
235
+ }
236
+
237
+ // src/components/accordion/accordion.recipe.ts
238
+
239
+ var SLOTS = [
240
+ "root",
241
+ "container",
242
+ "separator",
243
+ "item",
244
+ "trigger",
245
+ "indicator",
246
+ "content"
247
+ ];
248
+ var VARIANT_TOKENS = {
249
+ primary: { bg: "surface", fg: "surfaceForeground" },
250
+ secondary: { bg: "surfaceSecondary", fg: "surfaceSecondaryForeground" },
251
+ tertiary: { border: "border", fg: "foreground" },
252
+ ghost: { fg: "foreground" }
253
+ };
254
+ var HAIRLINE = _reactnative.StyleSheet.hairlineWidth;
255
+ var SIZES = {
256
+ xs: { padding: 2.5, gap: 2.5, label: "sm", glyph: "md", radius: "md" },
257
+ sm: { padding: 3, gap: 3, label: "md", glyph: "lg", radius: "lg" },
258
+ md: { padding: 3, gap: 4, label: "md", glyph: "lg", radius: "xl" },
259
+ lg: { padding: 4, gap: 4, label: "lg", glyph: "xl", radius: "2xl" }
260
+ };
261
+ var TRIGGER_PADDING_VERTICAL = 4;
262
+ function sizeAxis(step) {
263
+ const { padding, gap, label, glyph, radius } = step;
264
+ return (theme) => ({
265
+ // Both layers, at the same value: the outer one draws the corner, the inner one is
266
+ // what a pressed row is cut against.
267
+ root: { borderRadius: theme.radius[radius] },
268
+ container: { borderRadius: theme.radius[radius] },
269
+ trigger: {
270
+ paddingVertical: theme.spacing(TRIGGER_PADDING_VERTICAL),
271
+ paddingHorizontal: theme.spacing(padding),
272
+ gap: theme.spacing(gap),
273
+ fontSize: theme.fontSizes[label],
274
+ lineHeight: theme.lineHeights[label]
275
+ },
276
+ indicator: { fontSize: theme.fontSizes[glyph] },
277
+ content: {
278
+ paddingHorizontal: theme.spacing(padding),
279
+ paddingBottom: theme.spacing(TRIGGER_PADDING_VERTICAL)
280
+ }
281
+ });
282
+ }
283
+ var accordionRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
284
+ slots: SLOTS,
285
+ base: (theme) => ({
286
+ // The root carries the shadow and the border; it must **not** clip. On iOS
287
+ // `overflow: 'hidden'` sets `masksToBounds`, which clips the layer's own shadow along
288
+ // with everything else, and a lifted `primary` would have none at all.
289
+ root: { flexDirection: "column", borderCurve: "continuous" },
290
+ // So the clipping is one layer in. This is the one extra node in the component, and
291
+ // it is here for a platform constraint rather than for layout: a single layer cannot
292
+ // both cast a shadow and clip its children on iOS. Without it a pressed row paints
293
+ // over the card's rounded corner, square, for as long as a finger is on it.
294
+ container: { flexDirection: "column", overflow: "hidden" },
295
+ separator: { height: HAIRLINE, backgroundColor: theme.colors.separator },
296
+ // This one is load-bearing: it is what makes the height animation read as a panel
297
+ // unrolling rather than as content sliding out from behind the row above it.
298
+ item: { flexDirection: "column", overflow: "hidden" },
299
+ trigger: {
300
+ flexDirection: "row",
301
+ alignItems: "center",
302
+ justifyContent: "space-between",
303
+ fontFamily: theme.fontFamilies.body,
304
+ fontWeight: theme.fontWeights.medium
305
+ },
306
+ indicator: { alignItems: "center", justifyContent: "center" }
307
+ }),
308
+ variantTokens: VARIANT_TOKENS,
309
+ /**
310
+ * The fill is the **root's**, never the row's. A row that painted its own would stack
311
+ * two fills where the separator sits, and the hairline would disappear into the seam.
312
+ */
313
+ paint: (theme, colors) => ({
314
+ root: {
315
+ backgroundColor: colors.bg,
316
+ borderColor: colors.border,
317
+ borderWidth: colors.border ? theme.borderWidth.default : 0
318
+ },
319
+ trigger: { color: colors.fg },
320
+ indicator: { color: theme.colors.muted }
321
+ }),
322
+ variants: {
323
+ size: {
324
+ xs: sizeAxis(SIZES.xs),
325
+ sm: sizeAxis(SIZES.sm),
326
+ md: sizeAxis(SIZES.md),
327
+ lg: sizeAxis(SIZES.lg)
328
+ },
329
+ radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "root", "container")
330
+ },
331
+ /**
332
+ * A container inset from its own edge, and its separators inset with it. `ghost` has no
333
+ * edge to be inset from, so its rows run the full width and the hairline runs with them
334
+ * — which is the difference between a list on a page and a list in a box.
335
+ *
336
+ * `primary` is the only one lifted. It is the one that reads as a card, and HeroUI puts
337
+ * their `--shadow-surface` on exactly that variant. `secondary` and `tertiary` have too
338
+ * little fill to lift — a shadow under either would read as dirt rather than as height
339
+ * — and in dark mode the theme's surface shadow is already nothing (§4), which is why
340
+ * this names the role rather than a set of numbers.
341
+ */
342
+ compoundVariants: [
343
+ ...["primary", "secondary", "tertiary"].map((variant) => ({
344
+ when: { variant },
345
+ style: (theme) => ({
346
+ separator: { marginHorizontal: theme.spacing(3) }
347
+ })
348
+ })),
349
+ {
350
+ when: { variant: "primary" },
351
+ style: (theme) => ({
352
+ root: theme.shadows.surface
353
+ })
354
+ }
355
+ ],
356
+ states: {
357
+ // On the row, not on the root: pressing one row must not tint the whole container.
358
+ pressed: (theme) => ({
359
+ trigger: { backgroundColor: theme.colors.defaultSoftPressed }
360
+ }),
361
+ disabled: (theme) => ({ root: { opacity: theme.opacity.disabled } })
362
+ },
363
+ defaultVariants: { variant: "ghost", size: "md" }
364
+ });
365
+
366
+ // src/components/accordion/accordion.tsx
367
+
368
+ var AccordionRoot = _react.forwardRef.call(void 0, function Accordion({
369
+ children,
370
+ variant,
371
+ size,
372
+ radius,
373
+ color,
374
+ selectionMode = "single",
375
+ value,
376
+ defaultValue,
377
+ onValueChange,
378
+ isDisabled = false,
379
+ isCollapsible = true,
380
+ hasSeparator = true,
381
+ asChild = false,
382
+ style,
383
+ ...props
384
+ }, ref) {
385
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
386
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
387
+ const { isExpanded, toggle } = useExpansion({
388
+ value,
389
+ defaultValue,
390
+ onValueChange,
391
+ selectionMode,
392
+ isCollapsible
393
+ });
394
+ const selection = { variant, size, radius };
395
+ const styles = accordionRecipe.resolve({
396
+ theme,
397
+ selection,
398
+ states: { disabled: isDisabled }
399
+ });
400
+ const pressed = accordionRecipe.resolve({
401
+ theme,
402
+ selection,
403
+ states: { pressed: true }
404
+ });
405
+ const tint = color ? accordionRecipe.tint({ theme, color, selection }) : void 0;
406
+ const context = _react.useMemo.call(void 0, () => {
407
+ const trigger = _reactnative.StyleSheet.flatten([styles.trigger, _optionalChain([tint, 'optionalAccess', _2 => _2.trigger])]);
408
+ const indicator = _reactnative.StyleSheet.flatten([
409
+ styles.indicator,
410
+ _optionalChain([tint, 'optionalAccess', _3 => _3.indicator])
411
+ ]);
412
+ return {
413
+ separatorStyle: styles.separator,
414
+ itemStyle: styles.item,
415
+ triggerStyle: tint ? [styles.trigger, tint.trigger] : styles.trigger,
416
+ triggerPressedStyle: pressed.trigger,
417
+ indicatorStyle: styles.indicator,
418
+ contentStyle: styles.content,
419
+ // The trigger is a row of views, so a stringifiable child is wrapped in a `Text` of
420
+ // its own — and that text takes the type the recipe put on the row.
421
+ labelStyle: {
422
+ color: trigger.color,
423
+ fontFamily: trigger.fontFamily,
424
+ fontWeight: trigger.fontWeight,
425
+ fontSize: trigger.fontSize,
426
+ lineHeight: trigger.lineHeight
427
+ },
428
+ glyph: {
429
+ size: indicator.fontSize,
430
+ color: typeof indicator.color === "string" ? indicator.color : void 0
431
+ },
432
+ isDisabled,
433
+ isExpanded,
434
+ toggle
435
+ };
436
+ }, [styles, pressed, tint, isDisabled, isExpanded, toggle]);
437
+ const rootStyle = [styles.root, _optionalChain([tint, 'optionalAccess', _4 => _4.root]), styleProps, style];
438
+ const items = _react.Children.toArray(children);
439
+ const rows = items.map((child, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Fragment, { children: [
440
+ child,
441
+ hasSeparator && index < items.length - 1 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { layout: LAYOUT, style: styles.separator }) : null
442
+ ] }, index));
443
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AccordionProvider, { value: context, children: asChild ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7GHM4GKLcjs.Slot, { ref, ...rest, style: rootStyle, children }) : (
444
+ // Two layers, and the only place in the library where a root has one inside it.
445
+ // A single layer cannot both cast a shadow and clip its children on iOS, and this
446
+ // component needs both: `primary` is lifted, and a pressed row has to be cut
447
+ // against the card's rounded corner rather than painting over it.
448
+ //
449
+ // The layout transition is on each of them as well as on every row. Without it on
450
+ // the outer one the accordion's own height jumps to its new total in one frame
451
+ // while the rows inside it are still animating.
452
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { ref, layout: LAYOUT, ...rest, style: rootStyle, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { layout: LAYOUT, style: styles.container, children: rows }) })
453
+ ) });
454
+ });
455
+ AccordionRoot.displayName = "XAUI.Accordion.Root";
456
+
457
+ // src/components/accordion/index.ts
458
+ var Accordion2 = Object.assign(AccordionRoot, {
459
+ Item: AccordionItem,
460
+ Trigger: AccordionTrigger,
461
+ Indicator: AccordionIndicator,
462
+ Content: AccordionContent
463
+ });
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+ exports.LAYOUT = LAYOUT; exports.useAccordion = useAccordion; exports.useAccordionItem = useAccordionItem; exports.AccordionContent = AccordionContent; exports.AccordionIndicator = AccordionIndicator; exports.AccordionItem = AccordionItem; exports.AccordionTrigger = AccordionTrigger; exports.accordionRecipe = accordionRecipe; exports.AccordionRoot = AccordionRoot; exports.Accordion = Accordion2;
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  TextFieldField,
3
3
  useTextField
4
- } from "./chunk-SMW6ZWMH.js";
4
+ } from "./chunk-S2WNWMNT.js";
5
5
  import {
6
6
  Icon
7
- } from "./chunk-HXW4ANVB.js";
7
+ } from "./chunk-FHUYHV6J.js";
8
8
  import {
9
9
  Slot,
10
10
  createSlotContext
11
- } from "./chunk-YXPYOOHU.js";
11
+ } from "./chunk-K72UDPVN.js";
12
12
  import {
13
13
  useStyleProps
14
14
  } from "./chunk-M63GFNKV.js";
@@ -5,10 +5,10 @@ import {
5
5
  TextFieldLabel,
6
6
  TextFieldRoot,
7
7
  useTextField
8
- } from "./chunk-SMW6ZWMH.js";
8
+ } from "./chunk-S2WNWMNT.js";
9
9
  import {
10
10
  createSlotContext
11
- } from "./chunk-YXPYOOHU.js";
11
+ } from "./chunk-K72UDPVN.js";
12
12
  import {
13
13
  useStyleProps
14
14
  } from "./chunk-M63GFNKV.js";