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

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-OULTSBKU.js → chunk-26OGEFQI.js} +1 -1
  2. package/dist/chunk-2EGR4LWD.js +145 -0
  3. package/dist/{chunk-TJHYSSBZ.js → chunk-346QBNUD.js} +1 -1
  4. package/dist/chunk-37L7YGZV.cjs +425 -0
  5. package/dist/{chunk-PPWXLZGL.js → chunk-3GFRSZYR.js} +15 -23
  6. package/dist/{chunk-DKH6BNPF.cjs → chunk-3JXI2IHV.cjs} +13 -13
  7. package/dist/{chunk-7B3UBUC6.cjs → chunk-4KFKWBN5.cjs} +23 -2
  8. package/dist/{chunk-IGLKACSR.cjs → chunk-4KSKQD37.cjs} +5 -5
  9. package/dist/{chunk-UBOXW5WO.cjs → chunk-54CWXA34.cjs} +61 -61
  10. package/dist/chunk-64MXEVT3.js +66 -0
  11. package/dist/{chunk-ZJWEVFAO.cjs → chunk-66FOASTP.cjs} +9 -9
  12. package/dist/{chunk-5PPNDKRX.js → chunk-6CO6FM67.js} +16 -16
  13. package/dist/{chunk-DVDQSW7U.cjs → chunk-76XDVA24.cjs} +65 -190
  14. package/dist/{chunk-54FJOKAN.cjs → chunk-7GHM4GKL.cjs} +25 -25
  15. package/dist/chunk-7KLBTMXV.cjs +478 -0
  16. package/dist/{chunk-AP6RVIIK.cjs → chunk-7TOG4TVU.cjs} +21 -21
  17. package/dist/{chunk-LEWW24RQ.cjs → chunk-A7YB7YWX.cjs} +3 -3
  18. package/dist/{chunk-3P6M2R4S.cjs → chunk-AAVCMCJ3.cjs} +4 -4
  19. package/dist/{chunk-VFTT3Q4B.cjs → chunk-BNFIFRQA.cjs} +3 -3
  20. package/dist/{chunk-JXNFOOKC.js → chunk-DY3SUG5P.js} +5 -5
  21. package/dist/chunk-EKS3W46M.cjs +66 -0
  22. package/dist/{chunk-EOJ5MYAQ.js → chunk-EYD4H4X6.js} +4 -4
  23. package/dist/{chunk-RGKWNK4T.js → chunk-FBCWNXZC.js} +58 -58
  24. package/dist/{chunk-HXW4ANVB.js → chunk-FHUYHV6J.js} +25 -4
  25. package/dist/chunk-GJSFKH4L.js +586 -0
  26. package/dist/{chunk-6G3XWPNP.js → chunk-HA6BFY3A.js} +3 -3
  27. package/dist/{chunk-FTQHDJYL.cjs → chunk-HOI5425P.cjs} +9 -9
  28. package/dist/{chunk-XWY4DF37.js → chunk-JKP4TPIL.js} +86 -289
  29. package/dist/{chunk-YXPYOOHU.js → chunk-K72UDPVN.js} +27 -27
  30. package/dist/{chunk-NTD3NPRX.cjs → chunk-KSUV74BE.cjs} +2 -2
  31. package/dist/{chunk-UGF35NSE.js → chunk-LIUO6D3D.js} +75 -75
  32. package/dist/{chunk-E3X5ODKQ.js → chunk-LTX6TB5I.js} +1 -1
  33. package/dist/chunk-LUPCPLND.cjs +145 -0
  34. package/dist/{chunk-BORJJYDW.js → chunk-MXGER5PI.js} +2 -2
  35. package/dist/{chunk-GTT4NHS2.cjs → chunk-NCCRQK3P.cjs} +11 -11
  36. package/dist/chunk-NCTOTTVW.js +13 -0
  37. package/dist/{chunk-NKPTXTTS.js → chunk-QZ24MZRX.js} +3 -3
  38. package/dist/{chunk-7LSY4WFL.js → chunk-R7BU4CPS.js} +2 -2
  39. package/dist/{chunk-JB5LGQ54.cjs → chunk-RKCWYUGA.cjs} +3 -3
  40. package/dist/{chunk-SMW6ZWMH.js → chunk-S2WNWMNT.js} +1 -1
  41. package/dist/{chunk-WVLSQO6K.cjs → chunk-S4QUM4EE.cjs} +9 -9
  42. package/dist/{chunk-SO5UAGIU.js → chunk-SACDOFGF.js} +15 -15
  43. package/dist/{chunk-CUQTAPBU.cjs → chunk-SIP5J7HU.cjs} +17 -17
  44. package/dist/{chunk-O3A3DBSZ.js → chunk-SZLXPF3G.js} +1 -1
  45. package/dist/{chunk-437QULXO.cjs → chunk-TDTUAIFF.cjs} +5 -5
  46. package/dist/{chunk-DRMT346W.cjs → chunk-TGMVEHV7.cjs} +64 -64
  47. package/dist/{chunk-TDYPY2J7.js → chunk-TRETQZEW.js} +7 -7
  48. package/dist/{chunk-ITURCQMQ.cjs → chunk-URA25DU4.cjs} +5 -5
  49. package/dist/{chunk-4PTWZCOK.js → chunk-USF6EWYR.js} +7 -7
  50. package/dist/{chunk-P747CRAY.cjs → chunk-VZK3NLBH.cjs} +9 -9
  51. package/dist/chunk-WFEMJCXO.cjs +13 -0
  52. package/dist/chunk-XAFP5JLK.js +425 -0
  53. package/dist/{chunk-RVRVGG73.js → chunk-XNMZQSY5.js} +2 -2
  54. package/dist/{chunk-K4TWKF5U.cjs → chunk-XSQPVDFH.cjs} +15 -25
  55. package/dist/{chunk-JDSE4TQL.js → chunk-XTC2SLFT.js} +1 -1
  56. package/dist/{chunk-C5VDFRAD.cjs → chunk-XWNG2U4K.cjs} +2 -2
  57. package/dist/components/accordion/index.cjs +35 -0
  58. package/dist/components/accordion/index.d.cts +299 -0
  59. package/dist/components/accordion/index.d.ts +299 -0
  60. package/dist/components/accordion/index.js +35 -0
  61. package/dist/components/alert/index.cjs +7 -7
  62. package/dist/components/alert/index.d.cts +2 -2
  63. package/dist/components/alert/index.d.ts +2 -2
  64. package/dist/components/alert/index.js +6 -6
  65. package/dist/components/avatar/index.cjs +4 -4
  66. package/dist/components/avatar/index.d.cts +3 -3
  67. package/dist/components/avatar/index.d.ts +3 -3
  68. package/dist/components/avatar/index.js +3 -3
  69. package/dist/components/badge/index.cjs +3 -3
  70. package/dist/components/badge/index.d.cts +1 -1
  71. package/dist/components/badge/index.d.ts +1 -1
  72. package/dist/components/badge/index.js +2 -2
  73. package/dist/components/button/index.cjs +8 -7
  74. package/dist/components/button/index.d.cts +204 -204
  75. package/dist/components/button/index.d.ts +204 -204
  76. package/dist/components/button/index.js +7 -6
  77. package/dist/components/card/index.cjs +5 -5
  78. package/dist/components/card/index.d.cts +206 -206
  79. package/dist/components/card/index.d.ts +206 -206
  80. package/dist/components/card/index.js +4 -4
  81. package/dist/components/checkbox/index.cjs +5 -5
  82. package/dist/components/checkbox/index.d.cts +408 -408
  83. package/dist/components/checkbox/index.d.ts +408 -408
  84. package/dist/components/checkbox/index.js +4 -4
  85. package/dist/components/chip/index.cjs +7 -7
  86. package/dist/components/chip/index.d.cts +205 -205
  87. package/dist/components/chip/index.d.ts +205 -205
  88. package/dist/components/chip/index.js +6 -6
  89. package/dist/components/divider/index.cjs +3 -3
  90. package/dist/components/divider/index.d.cts +3 -3
  91. package/dist/components/divider/index.d.ts +3 -3
  92. package/dist/components/divider/index.js +2 -2
  93. package/dist/components/field-group/index.cjs +5 -5
  94. package/dist/components/field-group/index.d.cts +8 -8
  95. package/dist/components/field-group/index.d.ts +8 -8
  96. package/dist/components/field-group/index.js +4 -4
  97. package/dist/components/input-otp/index.cjs +3 -3
  98. package/dist/components/input-otp/index.d.cts +2 -2
  99. package/dist/components/input-otp/index.d.ts +2 -2
  100. package/dist/components/input-otp/index.js +2 -2
  101. package/dist/components/popover/index.cjs +37 -0
  102. package/dist/components/popover/index.d.cts +254 -0
  103. package/dist/components/popover/index.d.ts +254 -0
  104. package/dist/components/popover/index.js +37 -0
  105. package/dist/components/radio/index.cjs +5 -5
  106. package/dist/components/radio/index.d.cts +419 -419
  107. package/dist/components/radio/index.d.ts +419 -419
  108. package/dist/components/radio/index.js +4 -4
  109. package/dist/components/select/index.cjs +10 -7
  110. package/dist/components/select/index.d.cts +24 -45
  111. package/dist/components/select/index.d.ts +24 -45
  112. package/dist/components/select/index.js +9 -6
  113. package/dist/components/skeleton/index.d.cts +1 -1
  114. package/dist/components/skeleton/index.d.ts +1 -1
  115. package/dist/components/spinner/index.cjs +5 -4
  116. package/dist/components/spinner/index.d.cts +1 -1
  117. package/dist/components/spinner/index.d.ts +1 -1
  118. package/dist/components/spinner/index.js +4 -3
  119. package/dist/components/switch/index.cjs +5 -5
  120. package/dist/components/switch/index.d.cts +409 -409
  121. package/dist/components/switch/index.d.ts +409 -409
  122. package/dist/components/switch/index.js +4 -4
  123. package/dist/components/text-area/index.cjs +4 -4
  124. package/dist/components/text-area/index.js +3 -3
  125. package/dist/components/text-field/index.cjs +3 -3
  126. package/dist/components/text-field/index.d.cts +3 -3
  127. package/dist/components/text-field/index.d.ts +3 -3
  128. package/dist/components/text-field/index.js +2 -2
  129. package/dist/components/typography/index.cjs +3 -3
  130. package/dist/components/typography/index.d.cts +5 -5
  131. package/dist/components/typography/index.d.ts +5 -5
  132. package/dist/components/typography/index.js +2 -2
  133. package/dist/components/view/index.cjs +3 -3
  134. package/dist/components/view/index.d.cts +8 -8
  135. package/dist/components/view/index.d.ts +8 -8
  136. package/dist/components/view/index.js +2 -2
  137. package/dist/index.cjs +89 -28
  138. package/dist/index.d.cts +5 -2
  139. package/dist/index.d.ts +5 -2
  140. package/dist/index.js +109 -48
  141. package/dist/placement-DHa0Rrh1.d.cts +38 -0
  142. package/dist/placement-DHa0Rrh1.d.ts +38 -0
  143. package/dist/system/index.cjs +24 -8
  144. package/dist/system/index.d.cts +83 -34
  145. package/dist/system/index.d.ts +83 -34
  146. package/dist/system/index.js +24 -8
  147. package/package.json +21 -1
  148. /package/dist/{chunk-OJCCV65P.cjs → chunk-GGW43Q37.cjs} +0 -0
  149. /package/dist/{chunk-MESKS6AI.js → chunk-WHJTBTYM.js} +0 -0
@@ -0,0 +1,586 @@
1
+ import { INDICATOR_ROTATION, INDICATOR_SPRING } from "./chunk-64MXEVT3.js";
2
+ import { ChevronDownIcon, Icon, IconContext } from "./chunk-FHUYHV6J.js";
3
+ import { useControllableState } from "./chunk-F6W3JQ7K.js";
4
+ import { PressableFeedback } from "./chunk-LIUO6D3D.js";
5
+ import { usePressState } from "./chunk-423RQBOX.js";
6
+ import { Slot, createSlotContext } from "./chunk-K72UDPVN.js";
7
+ import { createRecipe, radiusAxis } from "./chunk-4GTAZM2C.js";
8
+ import { useXAUITheme } from "./chunk-A3EGFI6T.js";
9
+ import { useStyleProps } from "./chunk-M63GFNKV.js";
10
+
11
+ // src/components/accordion/accordion-content.tsx
12
+ import { forwardRef } from "react";
13
+ import Animated from "react-native-reanimated";
14
+
15
+ // src/components/accordion/accordion.animation.ts
16
+ import { Easing, FadeIn, FadeOut, LinearTransition } from "react-native-reanimated";
17
+ var LAYOUT = LinearTransition.springify().damping(140).stiffness(1600).mass(4);
18
+ var CONTENT_MS = 200;
19
+ var contentEntering = FadeIn.duration(CONTENT_MS).easing(Easing.out(Easing.ease));
20
+ var contentExiting = FadeOut.duration(CONTENT_MS).easing(Easing.in(Easing.ease));
21
+
22
+ // src/components/accordion/accordion.context.ts
23
+ var [AccordionProvider, useAccordion] = createSlotContext("Accordion");
24
+ var [AccordionItemProvider, useAccordionItem] = createSlotContext("Accordion.Item");
25
+
26
+ // src/components/accordion/accordion-content.tsx
27
+ import { jsx } from "react/jsx-runtime";
28
+ var AccordionContent = forwardRef(function AccordionContent2({
29
+ children,
30
+ style,
31
+ ...props
32
+ }, ref) {
33
+ const {
34
+ contentStyle
35
+ } = useAccordion();
36
+ const {
37
+ isExpanded
38
+ } = useAccordionItem();
39
+ const [styleProps, rest] = useStyleProps(props);
40
+ if (!isExpanded) return null;
41
+ return /* @__PURE__ */jsx(Animated.View, {
42
+ ref,
43
+ entering: contentEntering,
44
+ exiting: contentExiting,
45
+ ...rest,
46
+ style: [contentStyle, styleProps, style],
47
+ children
48
+ });
49
+ });
50
+ AccordionContent.displayName = "XAUI.Accordion.Content";
51
+
52
+ // src/components/accordion/accordion-indicator.tsx
53
+ import { useEffect } from "react";
54
+ import Animated2, { interpolate, useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated";
55
+ import { jsx as jsx2 } from "react/jsx-runtime";
56
+ const _worklet_5989753634611_init_data = {
57
+ code: "function chunkGJSFKH4LJs1(){const{interpolate,progress,INDICATOR_ROTATION}=this.__closure;return{transform:[{rotate:interpolate(progress.get(),[0,1],[INDICATOR_ROTATION[0],INDICATOR_ROTATION[1]])+\"deg\"}]};}",
58
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-GJSFKH4L.js",
59
+ sourceMap: "{\"version\":3,\"names\":[\"chunkGJSFKH4LJs1\",\"interpolate\",\"progress\",\"INDICATOR_ROTATION\",\"__closure\",\"transform\",\"rotate\",\"get\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-GJSFKH4L.js\"],\"mappings\":\"AA8FoC,SAAAA,iBAAA,QAAAC,WAAA,CAAAC,QAAA,CAAAC,kBAAA,OAAAC,SAAA,OAAO,CACvCC,SAAS,CAAE,CACT,CACEC,MAAM,CAAKL,WAAW,CAACC,QAAQ,CAACK,GAAG,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAACJ,kBAAkB,CAAC,CAAC,CAAC,CAAEA,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,MAChG,CAAC,CAEL,CAAC\",\"ignoreList\":[]}"
60
+ };
61
+ function AccordionIndicator({
62
+ as = ChevronDownIcon,
63
+ ...props
64
+ }) {
65
+ const {
66
+ indicatorStyle
67
+ } = useAccordion();
68
+ const {
69
+ isExpanded
70
+ } = useAccordionItem();
71
+ const progress = useSharedValue(isExpanded ? 1 : 0);
72
+ useEffect(() => {
73
+ progress.set(withSpring(isExpanded ? 1 : 0, INDICATOR_SPRING));
74
+ }, [isExpanded, progress]);
75
+ const rotation = useAnimatedStyle(function chunkGJSFKH4LJs1Factory({
76
+ _worklet_5989753634611_init_data,
77
+ interpolate,
78
+ progress,
79
+ INDICATOR_ROTATION
80
+ }) {
81
+ const _e = [new global.Error(), -4, -27];
82
+ const chunkGJSFKH4LJs1 = () => ({
83
+ transform: [{
84
+ rotate: `${interpolate(progress.get(), [0, 1], [INDICATOR_ROTATION[0], INDICATOR_ROTATION[1]])}deg`
85
+ }]
86
+ });
87
+ chunkGJSFKH4LJs1.__closure = {
88
+ interpolate,
89
+ progress,
90
+ INDICATOR_ROTATION
91
+ };
92
+ chunkGJSFKH4LJs1.__workletHash = 5989753634611;
93
+ chunkGJSFKH4LJs1.__pluginVersion = "0.7.4";
94
+ chunkGJSFKH4LJs1.__initData = _worklet_5989753634611_init_data;
95
+ chunkGJSFKH4LJs1.__stackDetails = _e;
96
+ return chunkGJSFKH4LJs1;
97
+ }({
98
+ _worklet_5989753634611_init_data,
99
+ interpolate,
100
+ progress,
101
+ INDICATOR_ROTATION
102
+ }));
103
+ return /* @__PURE__ */jsx2(Animated2.View, {
104
+ style: [indicatorStyle, rotation],
105
+ children: /* @__PURE__ */jsx2(Icon, {
106
+ as,
107
+ ...props
108
+ })
109
+ });
110
+ }
111
+ AccordionIndicator.displayName = "XAUI.Accordion.Indicator";
112
+
113
+ // src/components/accordion/accordion-item.tsx
114
+ import { forwardRef as forwardRef2, useMemo } from "react";
115
+ import Animated3 from "react-native-reanimated";
116
+ import { jsx as jsx3 } from "react/jsx-runtime";
117
+ var AccordionItem = forwardRef2(function AccordionItem2({
118
+ value,
119
+ children,
120
+ isDisabled = false,
121
+ style,
122
+ ...props
123
+ }, ref) {
124
+ const {
125
+ itemStyle,
126
+ isDisabled: isRootDisabled,
127
+ isExpanded
128
+ } = useAccordion();
129
+ const [styleProps, rest] = useStyleProps(props);
130
+ const expanded = isExpanded(value);
131
+ const disabled = isRootDisabled || isDisabled;
132
+ const context = useMemo(() => ({
133
+ value,
134
+ isExpanded: expanded,
135
+ isDisabled: disabled
136
+ }), [value, expanded, disabled]);
137
+ return /* @__PURE__ */jsx3(AccordionItemProvider, {
138
+ value: context,
139
+ children: /* @__PURE__ */jsx3(Animated3.View, {
140
+ ref,
141
+ layout: LAYOUT,
142
+ ...rest,
143
+ style: [itemStyle, styleProps, style],
144
+ children: typeof children === "function" ? children(context) : children
145
+ })
146
+ });
147
+ });
148
+ AccordionItem.displayName = "XAUI.Accordion.Item";
149
+
150
+ // src/components/accordion/accordion-trigger.tsx
151
+ import { Children, forwardRef as forwardRef3, useCallback } from "react";
152
+ import { Text } from "react-native";
153
+ import { jsx as jsx4 } from "react/jsx-runtime";
154
+ var AccordionTrigger = forwardRef3(function AccordionTrigger2({
155
+ children,
156
+ asChild = false,
157
+ accessibilityRole = "button",
158
+ accessibilityState,
159
+ style,
160
+ onPress,
161
+ onPressIn,
162
+ onPressOut,
163
+ ...props
164
+ }, ref) {
165
+ const {
166
+ triggerStyle,
167
+ triggerPressedStyle,
168
+ labelStyle,
169
+ glyph,
170
+ toggle
171
+ } = useAccordion();
172
+ const {
173
+ value,
174
+ isExpanded,
175
+ isDisabled
176
+ } = useAccordionItem();
177
+ const [styleProps, rest] = useStyleProps(props);
178
+ const [isPressed, press] = usePressState({
179
+ onPressIn,
180
+ onPressOut
181
+ });
182
+ const handlePress = useCallback(event => {
183
+ onPress?.(event);
184
+ toggle(value);
185
+ }, [onPress, toggle, value]);
186
+ return /* @__PURE__ */jsx4(IconContext.Provider, {
187
+ value: glyph,
188
+ children: /* @__PURE__ */jsx4(PressableFeedback, {
189
+ ref,
190
+ isPressed,
191
+ isDisabled,
192
+ asChild,
193
+ accessibilityRole,
194
+ accessibilityState: {
195
+ disabled: isDisabled,
196
+ expanded: isExpanded,
197
+ ...accessibilityState
198
+ },
199
+ ...rest,
200
+ style: [triggerStyle, isPressed && triggerPressedStyle, styleProps, typeof style === "function" ? style({
201
+ pressed: isPressed
202
+ }) : style],
203
+ onPress: handlePress,
204
+ onPressIn: press.onPressIn,
205
+ onPressOut: press.onPressOut,
206
+ children: asChild ? children : wrapText(children, labelStyle)
207
+ })
208
+ });
209
+ });
210
+ AccordionTrigger.displayName = "XAUI.Accordion.Trigger";
211
+ function wrapText(children, style) {
212
+ return Children.map(children, child => typeof child === "string" || typeof child === "number" ? /* @__PURE__ */jsx4(Text, {
213
+ style,
214
+ children: child
215
+ }) : child);
216
+ }
217
+
218
+ // src/components/accordion/accordion.tsx
219
+ import { Children as Children2, forwardRef as forwardRef4, Fragment, useMemo as useMemo3 } from "react";
220
+ import { StyleSheet as StyleSheet2 } from "react-native";
221
+ import Animated4 from "react-native-reanimated";
222
+
223
+ // src/components/accordion/accordion.hook.ts
224
+ import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
225
+ function useExpansion({
226
+ value,
227
+ defaultValue,
228
+ onValueChange,
229
+ selectionMode,
230
+ isCollapsible
231
+ }) {
232
+ const [current, setCurrent] = useControllableState({
233
+ value,
234
+ defaultValue: defaultValue ?? (selectionMode === "multiple" ? [] : ""),
235
+ onChange: onValueChange
236
+ });
237
+ const isExpanded = useCallback2(item => Array.isArray(current) ? current.includes(item) : current === item, [current]);
238
+ const toggle = useCallback2(item => {
239
+ setCurrent(value_ => nextValue(value_, item, selectionMode, isCollapsible));
240
+ }, [isCollapsible, selectionMode, setCurrent]);
241
+ return useMemo2(() => ({
242
+ isExpanded,
243
+ toggle
244
+ }), [isExpanded, toggle]);
245
+ }
246
+ function nextValue(current, item, selectionMode, isCollapsible) {
247
+ if (selectionMode === "multiple") {
248
+ const list = Array.isArray(current) ? current : current ? [current] : [];
249
+ if (!list.includes(item)) return [...list, item];
250
+ if (!isCollapsible && list.length === 1) return current;
251
+ return list.filter(value => value !== item);
252
+ }
253
+ if (current !== item) return item;
254
+ return isCollapsible ? "" : current;
255
+ }
256
+
257
+ // src/components/accordion/accordion.recipe.ts
258
+ import { StyleSheet } from "react-native";
259
+ var SLOTS = ["root", "container", "separator", "item", "trigger", "indicator", "content"];
260
+ var VARIANT_TOKENS = {
261
+ primary: {
262
+ bg: "surface",
263
+ fg: "surfaceForeground"
264
+ },
265
+ secondary: {
266
+ bg: "surfaceSecondary",
267
+ fg: "surfaceSecondaryForeground"
268
+ },
269
+ tertiary: {
270
+ border: "border",
271
+ fg: "foreground"
272
+ },
273
+ ghost: {
274
+ fg: "foreground"
275
+ }
276
+ };
277
+ var HAIRLINE = StyleSheet.hairlineWidth;
278
+ var SIZES = {
279
+ xs: {
280
+ padding: 2.5,
281
+ gap: 2.5,
282
+ label: "sm",
283
+ glyph: "md",
284
+ radius: "md"
285
+ },
286
+ sm: {
287
+ padding: 3,
288
+ gap: 3,
289
+ label: "md",
290
+ glyph: "lg",
291
+ radius: "lg"
292
+ },
293
+ md: {
294
+ padding: 3,
295
+ gap: 4,
296
+ label: "md",
297
+ glyph: "lg",
298
+ radius: "xl"
299
+ },
300
+ lg: {
301
+ padding: 4,
302
+ gap: 4,
303
+ label: "lg",
304
+ glyph: "xl",
305
+ radius: "2xl"
306
+ }
307
+ };
308
+ var TRIGGER_PADDING_VERTICAL = 4;
309
+ function sizeAxis(step) {
310
+ const {
311
+ padding,
312
+ gap,
313
+ label,
314
+ glyph,
315
+ radius
316
+ } = step;
317
+ return theme => ({
318
+ // Both layers, at the same value: the outer one draws the corner, the inner one is
319
+ // what a pressed row is cut against.
320
+ root: {
321
+ borderRadius: theme.radius[radius]
322
+ },
323
+ container: {
324
+ borderRadius: theme.radius[radius]
325
+ },
326
+ trigger: {
327
+ paddingVertical: theme.spacing(TRIGGER_PADDING_VERTICAL),
328
+ paddingHorizontal: theme.spacing(padding),
329
+ gap: theme.spacing(gap),
330
+ fontSize: theme.fontSizes[label],
331
+ lineHeight: theme.lineHeights[label]
332
+ },
333
+ indicator: {
334
+ fontSize: theme.fontSizes[glyph]
335
+ },
336
+ content: {
337
+ paddingHorizontal: theme.spacing(padding),
338
+ paddingBottom: theme.spacing(TRIGGER_PADDING_VERTICAL)
339
+ }
340
+ });
341
+ }
342
+ var accordionRecipe = createRecipe({
343
+ slots: SLOTS,
344
+ base: theme => ({
345
+ // The root carries the shadow and the border; it must **not** clip. On iOS
346
+ // `overflow: 'hidden'` sets `masksToBounds`, which clips the layer's own shadow along
347
+ // with everything else, and a lifted `primary` would have none at all.
348
+ root: {
349
+ flexDirection: "column",
350
+ borderCurve: "continuous"
351
+ },
352
+ // So the clipping is one layer in. This is the one extra node in the component, and
353
+ // it is here for a platform constraint rather than for layout: a single layer cannot
354
+ // both cast a shadow and clip its children on iOS. Without it a pressed row paints
355
+ // over the card's rounded corner, square, for as long as a finger is on it.
356
+ container: {
357
+ flexDirection: "column",
358
+ overflow: "hidden"
359
+ },
360
+ separator: {
361
+ height: HAIRLINE,
362
+ backgroundColor: theme.colors.separator
363
+ },
364
+ // This one is load-bearing: it is what makes the height animation read as a panel
365
+ // unrolling rather than as content sliding out from behind the row above it.
366
+ item: {
367
+ flexDirection: "column",
368
+ overflow: "hidden"
369
+ },
370
+ trigger: {
371
+ flexDirection: "row",
372
+ alignItems: "center",
373
+ justifyContent: "space-between",
374
+ fontFamily: theme.fontFamilies.body,
375
+ fontWeight: theme.fontWeights.medium
376
+ },
377
+ indicator: {
378
+ alignItems: "center",
379
+ justifyContent: "center"
380
+ }
381
+ }),
382
+ variantTokens: VARIANT_TOKENS,
383
+ /**
384
+ * The fill is the **root's**, never the row's. A row that painted its own would stack
385
+ * two fills where the separator sits, and the hairline would disappear into the seam.
386
+ */
387
+ paint: (theme, colors) => ({
388
+ root: {
389
+ backgroundColor: colors.bg,
390
+ borderColor: colors.border,
391
+ borderWidth: colors.border ? theme.borderWidth.default : 0
392
+ },
393
+ trigger: {
394
+ color: colors.fg
395
+ },
396
+ indicator: {
397
+ color: theme.colors.muted
398
+ }
399
+ }),
400
+ variants: {
401
+ size: {
402
+ xs: sizeAxis(SIZES.xs),
403
+ sm: sizeAxis(SIZES.sm),
404
+ md: sizeAxis(SIZES.md),
405
+ lg: sizeAxis(SIZES.lg)
406
+ },
407
+ radius: radiusAxis("root", "container")
408
+ },
409
+ /**
410
+ * A container inset from its own edge, and its separators inset with it. `ghost` has no
411
+ * edge to be inset from, so its rows run the full width and the hairline runs with them
412
+ * — which is the difference between a list on a page and a list in a box.
413
+ *
414
+ * `primary` is the only one lifted. It is the one that reads as a card, and HeroUI puts
415
+ * their `--shadow-surface` on exactly that variant. `secondary` and `tertiary` have too
416
+ * little fill to lift — a shadow under either would read as dirt rather than as height
417
+ * — and in dark mode the theme's surface shadow is already nothing (§4), which is why
418
+ * this names the role rather than a set of numbers.
419
+ */
420
+ compoundVariants: [...["primary", "secondary", "tertiary"].map(variant => ({
421
+ when: {
422
+ variant
423
+ },
424
+ style: theme => ({
425
+ separator: {
426
+ marginHorizontal: theme.spacing(3)
427
+ }
428
+ })
429
+ })), {
430
+ when: {
431
+ variant: "primary"
432
+ },
433
+ style: theme => ({
434
+ root: theme.shadows.surface
435
+ })
436
+ }],
437
+ states: {
438
+ // On the row, not on the root: pressing one row must not tint the whole container.
439
+ pressed: theme => ({
440
+ trigger: {
441
+ backgroundColor: theme.colors.defaultSoftPressed
442
+ }
443
+ }),
444
+ disabled: theme => ({
445
+ root: {
446
+ opacity: theme.opacity.disabled
447
+ }
448
+ })
449
+ },
450
+ defaultVariants: {
451
+ variant: "ghost",
452
+ size: "md"
453
+ }
454
+ });
455
+
456
+ // src/components/accordion/accordion.tsx
457
+ import { jsx as jsx5, jsxs } from "react/jsx-runtime";
458
+ var AccordionRoot = forwardRef4(function Accordion({
459
+ children,
460
+ variant,
461
+ size,
462
+ radius,
463
+ color,
464
+ selectionMode = "single",
465
+ value,
466
+ defaultValue,
467
+ onValueChange,
468
+ isDisabled = false,
469
+ isCollapsible = true,
470
+ hasSeparator = true,
471
+ asChild = false,
472
+ style,
473
+ ...props
474
+ }, ref) {
475
+ const theme = useXAUITheme();
476
+ const [styleProps, rest] = useStyleProps(props);
477
+ const {
478
+ isExpanded,
479
+ toggle
480
+ } = useExpansion({
481
+ value,
482
+ defaultValue,
483
+ onValueChange,
484
+ selectionMode,
485
+ isCollapsible
486
+ });
487
+ const selection = {
488
+ variant,
489
+ size,
490
+ radius
491
+ };
492
+ const styles = accordionRecipe.resolve({
493
+ theme,
494
+ selection,
495
+ states: {
496
+ disabled: isDisabled
497
+ }
498
+ });
499
+ const pressed = accordionRecipe.resolve({
500
+ theme,
501
+ selection,
502
+ states: {
503
+ pressed: true
504
+ }
505
+ });
506
+ const tint = color ? accordionRecipe.tint({
507
+ theme,
508
+ color,
509
+ selection
510
+ }) : void 0;
511
+ const context = useMemo3(() => {
512
+ const trigger = StyleSheet2.flatten([styles.trigger, tint?.trigger]);
513
+ const indicator = StyleSheet2.flatten([styles.indicator, tint?.indicator]);
514
+ return {
515
+ separatorStyle: styles.separator,
516
+ itemStyle: styles.item,
517
+ triggerStyle: tint ? [styles.trigger, tint.trigger] : styles.trigger,
518
+ triggerPressedStyle: pressed.trigger,
519
+ indicatorStyle: styles.indicator,
520
+ contentStyle: styles.content,
521
+ // The trigger is a row of views, so a stringifiable child is wrapped in a `Text` of
522
+ // its own — and that text takes the type the recipe put on the row.
523
+ labelStyle: {
524
+ color: trigger.color,
525
+ fontFamily: trigger.fontFamily,
526
+ fontWeight: trigger.fontWeight,
527
+ fontSize: trigger.fontSize,
528
+ lineHeight: trigger.lineHeight
529
+ },
530
+ glyph: {
531
+ size: indicator.fontSize,
532
+ color: typeof indicator.color === "string" ? indicator.color : void 0
533
+ },
534
+ isDisabled,
535
+ isExpanded,
536
+ toggle
537
+ };
538
+ }, [styles, pressed, tint, isDisabled, isExpanded, toggle]);
539
+ const rootStyle = [styles.root, tint?.root, styleProps, style];
540
+ const items = Children2.toArray(children);
541
+ const rows = items.map((child, index) => /* @__PURE__ */jsxs(Fragment, {
542
+ children: [child, hasSeparator && index < items.length - 1 ? /* @__PURE__ */jsx5(Animated4.View, {
543
+ layout: LAYOUT,
544
+ style: styles.separator
545
+ }) : null]
546
+ }, index));
547
+ return /* @__PURE__ */jsx5(AccordionProvider, {
548
+ value: context,
549
+ children: asChild ? /* @__PURE__ */jsx5(Slot, {
550
+ ref,
551
+ ...rest,
552
+ style: rootStyle,
553
+ children
554
+ }) :
555
+ // Two layers, and the only place in the library where a root has one inside it.
556
+ // A single layer cannot both cast a shadow and clip its children on iOS, and this
557
+ // component needs both: `primary` is lifted, and a pressed row has to be cut
558
+ // against the card's rounded corner rather than painting over it.
559
+ //
560
+ // The layout transition is on each of them as well as on every row. Without it on
561
+ // the outer one the accordion's own height jumps to its new total in one frame
562
+ // while the rows inside it are still animating.
563
+ /* @__PURE__ */
564
+ jsx5(Animated4.View, {
565
+ ref,
566
+ layout: LAYOUT,
567
+ ...rest,
568
+ style: rootStyle,
569
+ children: /* @__PURE__ */jsx5(Animated4.View, {
570
+ layout: LAYOUT,
571
+ style: styles.container,
572
+ children: rows
573
+ })
574
+ })
575
+ });
576
+ });
577
+ AccordionRoot.displayName = "XAUI.Accordion.Root";
578
+
579
+ // src/components/accordion/index.ts
580
+ var Accordion2 = Object.assign(AccordionRoot, {
581
+ Item: AccordionItem,
582
+ Trigger: AccordionTrigger,
583
+ Indicator: AccordionIndicator,
584
+ Content: AccordionContent
585
+ });
586
+ export { LAYOUT, useAccordion, useAccordionItem, AccordionContent, AccordionIndicator, AccordionItem, AccordionTrigger, accordionRecipe, AccordionRoot, Accordion2 as Accordion };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  CloseButton,
3
3
  closeButtonBase
4
- } from "./chunk-EOJ5MYAQ.js";
4
+ } from "./chunk-EYD4H4X6.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
  childrenToString,
11
11
  createSlotContext
12
- } from "./chunk-YXPYOOHU.js";
12
+ } from "./chunk-K72UDPVN.js";
13
13
  import {
14
14
  createRecipe,
15
15
  radiusAxis
@@ -1,17 +1,17 @@
1
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
2
 
3
- var _chunkDRMT346Wcjs = require('./chunk-DRMT346W.cjs');
3
+ var _chunkTGMVEHV7cjs = require('./chunk-TGMVEHV7.cjs');
4
4
 
5
5
 
6
- var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
6
+ var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
7
7
 
8
8
 
9
- var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
9
+ var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _chunk54FJOKANcjs = require('./chunk-54FJOKAN.cjs');
14
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
15
15
 
16
16
 
17
17
  var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
@@ -50,7 +50,7 @@ function partitionBackground(children) {
50
50
  }
51
51
 
52
52
  // src/components/card/card.context.ts
53
- var [CardProvider, useCard] = _chunk54FJOKANcjs.createSlotContext.call(void 0, "Card");
53
+ var [CardProvider, useCard] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Card");
54
54
 
55
55
  // src/components/card/card.style.ts
56
56
 
@@ -375,7 +375,7 @@ var CardRoot = _react.forwardRef.call(void 0, function Card({
375
375
  styleProps,
376
376
  typeof style === "function" ? style({ pressed: isPressed }) : style
377
377
  ];
378
- const text = _chunk54FJOKANcjs.childrenToString.call(void 0, children);
378
+ const text = _chunk7GHM4GKLcjs.childrenToString.call(void 0, children);
379
379
  const content = text !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardDescription, { children: text }) : children;
380
380
  if (!isPressable && !asChild && (onPressIn || onPressOut || rest.onPress || rest.onLongPress)) {
381
381
  _chunkEJQCQPETcjs.warnDev.call(void 0,
@@ -388,7 +388,7 @@ var CardRoot = _react.forwardRef.call(void 0, function Card({
388
388
  body
389
389
  ] });
390
390
  const surface = isPressable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
391
- _chunkDRMT346Wcjs.PressableFeedback,
391
+ _chunkTGMVEHV7cjs.PressableFeedback,
392
392
  {
393
393
  ref,
394
394
  isPressed,
@@ -403,7 +403,7 @@ var CardRoot = _react.forwardRef.call(void 0, function Card({
403
403
  onPressOut: press.onPressOut,
404
404
  children: asChild ? children : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
405
405
  background,
406
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDRMT346Wcjs.PressableFeedback.Highlight, {}),
406
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTGMVEHV7cjs.PressableFeedback.Highlight, {}),
407
407
  body
408
408
  ] })
409
409
  }
@@ -411,7 +411,7 @@ var CardRoot = _react.forwardRef.call(void 0, function Card({
411
411
  // R12 — the caller's element is the card, so it takes the children it was written
412
412
  // with and the auto-wrap does not apply.
413
413
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
414
- _chunk54FJOKANcjs.Slot,
414
+ _chunk7GHM4GKLcjs.Slot,
415
415
  {
416
416
  ref,
417
417
  accessibilityRole,