@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/chunk-2EGR4LWD.js +145 -0
  2. package/dist/chunk-2NRZKJG7.js +531 -0
  3. package/dist/chunk-2PMXMKS5.js +67 -0
  4. package/dist/chunk-2XPG2243.js +586 -0
  5. package/dist/chunk-36PRYGAM.js +13 -0
  6. package/dist/chunk-3E7CDKFO.cjs +696 -0
  7. package/dist/chunk-3GFRSZYR.js +54 -0
  8. package/dist/chunk-423RQBOX.js +21 -0
  9. package/dist/chunk-4CUZZWFW.js +92 -0
  10. package/dist/chunk-4GTAZM2C.js +174 -0
  11. package/dist/chunk-4KFKWBN5.cjs +89 -0
  12. package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
  13. package/dist/chunk-5R26NM4M.cjs +402 -0
  14. package/dist/chunk-5VKYNBNA.js +607 -0
  15. package/dist/chunk-64MXEVT3.js +66 -0
  16. package/dist/chunk-6DOLGZVV.cjs +147 -0
  17. package/dist/chunk-6L2TS2R3.cjs +92 -0
  18. package/dist/chunk-6UEZJRVI.js +669 -0
  19. package/dist/chunk-734MFAX4.js +27 -0
  20. package/dist/chunk-73RKQC5X.js +104 -0
  21. package/dist/chunk-7DPL3ZDS.cjs +21 -0
  22. package/dist/chunk-7EIHHOHP.cjs +42 -0
  23. package/dist/chunk-7GHM4GKL.cjs +119 -0
  24. package/dist/chunk-7YF5NAHQ.cjs +74 -0
  25. package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
  26. package/dist/chunk-ABAGZTXZ.cjs +736 -0
  27. package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
  28. package/dist/chunk-AMCSSOJT.cjs +104 -0
  29. package/dist/chunk-BA2DBSAN.js +102 -0
  30. package/dist/chunk-BRRXFOBY.js +431 -0
  31. package/dist/chunk-C5YLPCFC.cjs +293 -0
  32. package/dist/chunk-DA3OKXHV.cjs +700 -0
  33. package/dist/chunk-DD4276RF.js +366 -0
  34. package/dist/chunk-DG2I4PJG.js +701 -0
  35. package/dist/chunk-DHGLGSH6.js +661 -0
  36. package/dist/chunk-DIBUQ46Y.js +346 -0
  37. package/dist/chunk-EGLLDKN6.js +9 -0
  38. package/dist/chunk-EJQCQPET.cjs +9 -0
  39. package/dist/chunk-EKS3W46M.cjs +66 -0
  40. package/dist/chunk-EZEYMLO3.js +402 -0
  41. package/dist/chunk-F6CQ6CBI.cjs +112 -0
  42. package/dist/chunk-F6W3JQ7K.js +42 -0
  43. package/dist/chunk-FHUYHV6J.js +89 -0
  44. package/dist/chunk-FNEUOBCV.cjs +174 -0
  45. package/dist/chunk-G3CCT4EY.js +518 -0
  46. package/dist/chunk-G7P3ERYF.cjs +478 -0
  47. package/dist/chunk-GA6PBWNT.js +147 -0
  48. package/dist/chunk-GFUZ3MUT.cjs +455 -0
  49. package/dist/chunk-GGW43Q37.cjs +1 -0
  50. package/dist/chunk-GTR5X65M.cjs +27 -0
  51. package/dist/chunk-H4E4HDEP.cjs +13 -0
  52. package/dist/chunk-H7DS4IO7.js +198 -0
  53. package/dist/chunk-HDVVZG4S.cjs +198 -0
  54. package/dist/chunk-IKJVLJKT.js +151 -0
  55. package/dist/chunk-J3MB4PI5.cjs +531 -0
  56. package/dist/chunk-K72UDPVN.js +119 -0
  57. package/dist/chunk-KCMYU7WF.js +86 -0
  58. package/dist/chunk-LRN3RNDO.js +940 -0
  59. package/dist/chunk-LTX6TB5I.js +124 -0
  60. package/dist/chunk-LUPCPLND.cjs +145 -0
  61. package/dist/chunk-M63GFNKV.js +194 -0
  62. package/dist/chunk-N3KTZMPG.js +293 -0
  63. package/dist/chunk-NCTOTTVW.js +13 -0
  64. package/dist/chunk-NWGLP6JX.cjs +410 -0
  65. package/dist/chunk-R73XQK7X.cjs +314 -0
  66. package/dist/chunk-RU7JCMWC.cjs +881 -0
  67. package/dist/chunk-SNIHUKDA.cjs +184 -0
  68. package/dist/chunk-T5FV5F7A.cjs +607 -0
  69. package/dist/chunk-TDTUAIFF.cjs +153 -0
  70. package/dist/chunk-TJ74XVZN.cjs +431 -0
  71. package/dist/chunk-TK44VBIE.cjs +194 -0
  72. package/dist/chunk-UAWBAD4E.cjs +346 -0
  73. package/dist/chunk-UFTCTTKK.js +381 -0
  74. package/dist/chunk-VLKBESEV.cjs +407 -0
  75. package/dist/chunk-WDDXU3OH.cjs +67 -0
  76. package/dist/chunk-WFEMJCXO.cjs +13 -0
  77. package/dist/chunk-WHJTBTYM.js +0 -0
  78. package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
  79. package/dist/chunk-XFPQFCEK.js +455 -0
  80. package/dist/chunk-XSQPVDFH.cjs +60 -0
  81. package/dist/chunk-XTC2SLFT.js +153 -0
  82. package/dist/chunk-XV735BSA.cjs +366 -0
  83. package/dist/chunk-XWNG2U4K.cjs +124 -0
  84. package/dist/chunk-YGYYJ3LQ.js +314 -0
  85. package/dist/chunk-YVHT2UVW.js +74 -0
  86. package/dist/chunk-ZFOOJK37.cjs +86 -0
  87. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  88. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  89. package/dist/components/accordion/index.cjs +35 -0
  90. package/dist/components/accordion/index.d.cts +299 -0
  91. package/dist/components/accordion/index.d.ts +299 -0
  92. package/dist/components/accordion/index.js +35 -0
  93. package/dist/components/alert/index.cjs +20 -0
  94. package/dist/components/alert/index.d.cts +169 -0
  95. package/dist/components/alert/index.d.ts +169 -0
  96. package/dist/components/alert/index.js +20 -0
  97. package/dist/components/avatar/index.cjs +16 -0
  98. package/dist/components/avatar/index.d.cts +131 -0
  99. package/dist/components/avatar/index.d.ts +131 -0
  100. package/dist/components/avatar/index.js +16 -0
  101. package/dist/components/badge/index.cjs +15 -0
  102. package/dist/components/badge/index.d.cts +157 -0
  103. package/dist/components/badge/index.d.ts +157 -0
  104. package/dist/components/badge/index.js +15 -0
  105. package/dist/components/button/index.cjs +22 -0
  106. package/dist/components/button/index.d.cts +613 -0
  107. package/dist/components/button/index.d.ts +613 -0
  108. package/dist/components/button/index.js +22 -0
  109. package/dist/components/card/index.cjs +22 -0
  110. package/dist/components/card/index.d.cts +620 -0
  111. package/dist/components/card/index.d.ts +620 -0
  112. package/dist/components/card/index.js +22 -0
  113. package/dist/components/checkbox/index.cjs +26 -0
  114. package/dist/components/checkbox/index.d.cts +1136 -0
  115. package/dist/components/checkbox/index.d.ts +1136 -0
  116. package/dist/components/checkbox/index.js +26 -0
  117. package/dist/components/chip/index.cjs +20 -0
  118. package/dist/components/chip/index.d.cts +608 -0
  119. package/dist/components/chip/index.d.ts +608 -0
  120. package/dist/components/chip/index.js +20 -0
  121. package/dist/components/divider/index.cjs +13 -0
  122. package/dist/components/divider/index.d.cts +117 -0
  123. package/dist/components/divider/index.d.ts +117 -0
  124. package/dist/components/divider/index.js +13 -0
  125. package/dist/components/field-group/index.cjs +27 -0
  126. package/dist/components/field-group/index.d.cts +270 -0
  127. package/dist/components/field-group/index.d.ts +270 -0
  128. package/dist/components/field-group/index.js +27 -0
  129. package/dist/components/input-otp/index.cjs +29 -0
  130. package/dist/components/input-otp/index.d.cts +325 -0
  131. package/dist/components/input-otp/index.d.ts +325 -0
  132. package/dist/components/input-otp/index.js +29 -0
  133. package/dist/components/menu/index.cjs +49 -0
  134. package/dist/components/menu/index.d.cts +351 -0
  135. package/dist/components/menu/index.d.ts +351 -0
  136. package/dist/components/menu/index.js +49 -0
  137. package/dist/components/popover/index.cjs +38 -0
  138. package/dist/components/popover/index.d.cts +254 -0
  139. package/dist/components/popover/index.d.ts +254 -0
  140. package/dist/components/popover/index.js +38 -0
  141. package/dist/components/radio/index.cjs +26 -0
  142. package/dist/components/radio/index.d.cts +1102 -0
  143. package/dist/components/radio/index.d.ts +1102 -0
  144. package/dist/components/radio/index.js +26 -0
  145. package/dist/components/select/index.cjs +50 -0
  146. package/dist/components/select/index.d.cts +498 -0
  147. package/dist/components/select/index.d.ts +498 -0
  148. package/dist/components/select/index.js +50 -0
  149. package/dist/components/skeleton/index.cjs +11 -0
  150. package/dist/components/skeleton/index.d.cts +111 -0
  151. package/dist/components/skeleton/index.d.ts +111 -0
  152. package/dist/components/skeleton/index.js +11 -0
  153. package/dist/components/spinner/index.cjs +17 -0
  154. package/dist/components/spinner/index.d.cts +104 -0
  155. package/dist/components/spinner/index.d.ts +104 -0
  156. package/dist/components/spinner/index.js +17 -0
  157. package/dist/components/switch/index.cjs +27 -0
  158. package/dist/components/switch/index.d.cts +1154 -0
  159. package/dist/components/switch/index.d.ts +1154 -0
  160. package/dist/components/switch/index.js +27 -0
  161. package/dist/components/tabs/index.cjs +33 -0
  162. package/dist/components/tabs/index.d.cts +261 -0
  163. package/dist/components/tabs/index.d.ts +261 -0
  164. package/dist/components/tabs/index.js +33 -0
  165. package/dist/components/text-area/index.cjs +14 -0
  166. package/dist/components/text-area/index.d.cts +73 -0
  167. package/dist/components/text-area/index.d.ts +73 -0
  168. package/dist/components/text-area/index.js +14 -0
  169. package/dist/components/text-field/index.cjs +25 -0
  170. package/dist/components/text-field/index.d.cts +205 -0
  171. package/dist/components/text-field/index.d.ts +205 -0
  172. package/dist/components/text-field/index.js +25 -0
  173. package/dist/components/typography/index.cjs +15 -0
  174. package/dist/components/typography/index.d.cts +116 -0
  175. package/dist/components/typography/index.d.ts +116 -0
  176. package/dist/components/typography/index.js +15 -0
  177. package/dist/components/view/index.cjs +17 -0
  178. package/dist/components/view/index.d.cts +152 -0
  179. package/dist/components/view/index.d.ts +152 -0
  180. package/dist/components/view/index.js +17 -0
  181. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  182. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  183. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  184. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  185. package/dist/index.cjs +423 -5
  186. package/dist/index.d.cts +119 -4
  187. package/dist/index.d.ts +119 -4
  188. package/dist/index.js +445 -27
  189. package/dist/placement-DHa0Rrh1.d.cts +38 -0
  190. package/dist/placement-DHa0Rrh1.d.ts +38 -0
  191. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  192. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  193. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  194. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  195. package/dist/system/index.cjs +73 -4
  196. package/dist/system/index.d.cts +379 -193
  197. package/dist/system/index.d.ts +379 -193
  198. package/dist/system/index.js +87 -18
  199. package/dist/text-field.type-0l73acce.d.ts +167 -0
  200. package/dist/text-field.type-DBh06DU5.d.cts +167 -0
  201. package/dist/theme/index.cjs +5 -3
  202. package/dist/theme/index.d.cts +55 -24
  203. package/dist/theme/index.d.ts +55 -24
  204. package/dist/theme/index.js +4 -2
  205. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  206. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  207. package/package.json +264 -18
  208. package/dist/chunk-ECDWSSHJ.js +0 -688
  209. package/dist/chunk-IYFGO523.cjs +0 -688
@@ -0,0 +1,402 @@
1
+ import {
2
+ useAnchorRef
3
+ } from "./chunk-734MFAX4.js";
4
+ import {
5
+ useAnchoredPosition
6
+ } from "./chunk-2EGR4LWD.js";
7
+ import {
8
+ Portal
9
+ } from "./chunk-2PMXMKS5.js";
10
+ import {
11
+ anchoredEntering,
12
+ anchoredExiting,
13
+ overlayEntering,
14
+ overlayExiting
15
+ } from "./chunk-64MXEVT3.js";
16
+ import {
17
+ useMergedRef
18
+ } from "./chunk-NCTOTTVW.js";
19
+ import {
20
+ useControllableState
21
+ } from "./chunk-F6W3JQ7K.js";
22
+ import {
23
+ PressableFeedback
24
+ } from "./chunk-6UEZJRVI.js";
25
+ import {
26
+ usePressState
27
+ } from "./chunk-423RQBOX.js";
28
+ import {
29
+ createRecipe,
30
+ radiusAxis
31
+ } from "./chunk-4GTAZM2C.js";
32
+ import {
33
+ useXAUITheme
34
+ } from "./chunk-A3EGFI6T.js";
35
+ import {
36
+ createSlotContext
37
+ } from "./chunk-K72UDPVN.js";
38
+ import {
39
+ useStyleProps
40
+ } from "./chunk-M63GFNKV.js";
41
+
42
+ // src/components/popover/popover-close.tsx
43
+ import { forwardRef, useCallback } from "react";
44
+
45
+ // src/components/popover/popover.context.ts
46
+ var [PopoverProvider, usePopover] = createSlotContext("Popover");
47
+
48
+ // src/components/popover/popover-close.tsx
49
+ import { jsx } from "react/jsx-runtime";
50
+ var PopoverClose = forwardRef(
51
+ function PopoverClose2({
52
+ children,
53
+ asChild = false,
54
+ accessibilityRole = "button",
55
+ style,
56
+ onPress,
57
+ onPressIn,
58
+ onPressOut,
59
+ ...props
60
+ }, ref) {
61
+ const { close } = usePopover();
62
+ const [styleProps, rest] = useStyleProps(props);
63
+ const [isPressed, press] = usePressState({ onPressIn, onPressOut });
64
+ const handlePress = useCallback(
65
+ (event) => {
66
+ onPress?.(event);
67
+ close();
68
+ },
69
+ [close, onPress]
70
+ );
71
+ return /* @__PURE__ */ jsx(
72
+ PressableFeedback,
73
+ {
74
+ ref,
75
+ isPressed,
76
+ asChild,
77
+ accessibilityRole,
78
+ ...rest,
79
+ style: [
80
+ styleProps,
81
+ typeof style === "function" ? style({ pressed: isPressed }) : style
82
+ ],
83
+ onPress: handlePress,
84
+ onPressIn: press.onPressIn,
85
+ onPressOut: press.onPressOut,
86
+ children
87
+ }
88
+ );
89
+ }
90
+ );
91
+ PopoverClose.displayName = "XAUI.Popover.Close";
92
+
93
+ // src/components/popover/popover-content.tsx
94
+ import { forwardRef as forwardRef2 } from "react";
95
+ import Animated from "react-native-reanimated";
96
+
97
+ // src/components/popover/popover.recipe.ts
98
+ var SLOTS = ["trigger", "overlay", "content", "title", "description"];
99
+ function popoverMeasure(fontSize) {
100
+ return fontSize * 13;
101
+ }
102
+ var popoverRecipe = createRecipe({
103
+ slots: SLOTS,
104
+ base: (theme) => ({
105
+ overlay: { position: "absolute", top: 0, bottom: 0, start: 0, end: 0 },
106
+ content: {
107
+ position: "absolute",
108
+ backgroundColor: theme.colors.overlay,
109
+ // HeroUI's twelve by sixteen: a panel is read, not scanned, so it is wider-padded
110
+ // than it is tall-padded.
111
+ paddingVertical: theme.spacing(3),
112
+ paddingHorizontal: theme.spacing(4),
113
+ // Their `--radius-3xl` on a base of 8 is 24 points; our base is 12, so the same 24
114
+ // is `2xl`. Reading their key rather than their number puts a pill on it.
115
+ borderRadius: theme.radius["2xl"],
116
+ borderCurve: "continuous",
117
+ gap: theme.spacing(1.5),
118
+ ...theme.shadows.overlay
119
+ },
120
+ title: {
121
+ fontFamily: theme.fontFamilies.body,
122
+ fontWeight: theme.fontWeights.medium,
123
+ fontSize: theme.fontSizes.lg,
124
+ lineHeight: theme.lineHeights.lg,
125
+ color: theme.colors.overlayForeground
126
+ },
127
+ description: {
128
+ fontFamily: theme.fontFamilies.body,
129
+ fontSize: theme.fontSizes.md,
130
+ lineHeight: theme.lineHeights.md,
131
+ color: theme.colors.muted
132
+ }
133
+ }),
134
+ variantTokens: { default: {} },
135
+ variants: { radius: radiusAxis("content") },
136
+ states: {
137
+ disabled: (theme) => ({ trigger: { opacity: theme.opacity.disabled } })
138
+ },
139
+ defaultVariants: { variant: "default" }
140
+ });
141
+
142
+ // src/components/popover/popover-content.tsx
143
+ import { jsx as jsx2 } from "react/jsx-runtime";
144
+ var DEFAULT_OFFSET = 9;
145
+ var DEFAULT_INSETS = {
146
+ top: 12,
147
+ bottom: 12,
148
+ start: 12,
149
+ end: 12
150
+ };
151
+ var PopoverContent = forwardRef2(
152
+ function PopoverContent2({
153
+ children,
154
+ placement = "bottom",
155
+ align = "center",
156
+ width = "content-fit",
157
+ offset = DEFAULT_OFFSET,
158
+ alignOffset = 0,
159
+ avoidCollisions = true,
160
+ insets,
161
+ style,
162
+ onLayout,
163
+ ...props
164
+ }, ref) {
165
+ const context = usePopover();
166
+ const { contentStyle, isOpen, anchor } = context;
167
+ const [styleProps, rest] = useStyleProps(props);
168
+ const theme = useXAUITheme();
169
+ const { position, onContentLayout, measuringStyle } = useAnchoredPosition({
170
+ anchor,
171
+ isOpen,
172
+ placement,
173
+ align,
174
+ width,
175
+ offset,
176
+ alignOffset,
177
+ avoidCollisions,
178
+ insets: { ...DEFAULT_INSETS, ...insets },
179
+ maxWidth: popoverMeasure(theme.fontSizes.md),
180
+ onLayout
181
+ });
182
+ if (!isOpen || anchor === null) return null;
183
+ return /* @__PURE__ */ jsx2(Portal, { children: /* @__PURE__ */ jsx2(PopoverProvider, { value: context, children: /* @__PURE__ */ jsx2(
184
+ Animated.View,
185
+ {
186
+ ref,
187
+ entering: position ? anchoredEntering(position.placement) : void 0,
188
+ exiting: position ? anchoredExiting(position.placement) : void 0,
189
+ onLayout: onContentLayout,
190
+ ...rest,
191
+ style: [
192
+ contentStyle,
193
+ position === null ? measuringStyle : {
194
+ top: position.top,
195
+ start: position.start,
196
+ width: position.width,
197
+ maxHeight: position.maxHeight
198
+ },
199
+ styleProps,
200
+ style
201
+ ],
202
+ children
203
+ },
204
+ position?.placement ?? "measuring"
205
+ ) }) });
206
+ }
207
+ );
208
+ PopoverContent.displayName = "XAUI.Popover.Content";
209
+
210
+ // src/components/popover/popover-description.tsx
211
+ import { forwardRef as forwardRef3 } from "react";
212
+ import { Text } from "react-native";
213
+ import { jsx as jsx3 } from "react/jsx-runtime";
214
+ var PopoverDescription = forwardRef3(
215
+ function PopoverDescription2({ children, style, ...props }, ref) {
216
+ const { descriptionStyle } = usePopover();
217
+ const [styleProps, rest] = useStyleProps(props);
218
+ return /* @__PURE__ */ jsx3(Text, { ref, ...rest, style: [descriptionStyle, styleProps, style], children });
219
+ }
220
+ );
221
+ PopoverDescription.displayName = "XAUI.Popover.Description";
222
+
223
+ // src/components/popover/popover-overlay.tsx
224
+ import { forwardRef as forwardRef4 } from "react";
225
+ import { Pressable } from "react-native";
226
+ import Animated2 from "react-native-reanimated";
227
+ import { jsx as jsx4 } from "react/jsx-runtime";
228
+ var AnimatedPressable = Animated2.createAnimatedComponent(Pressable);
229
+ var PopoverOverlay = forwardRef4(
230
+ function PopoverOverlay2({ children, isDismissable = true, style, ...props }, ref) {
231
+ const context = usePopover();
232
+ const { overlayStyle, isOpen, close } = context;
233
+ const [styleProps, rest] = useStyleProps(props);
234
+ if (!isOpen) return null;
235
+ return /* @__PURE__ */ jsx4(Portal, { children: /* @__PURE__ */ jsx4(PopoverProvider, { value: context, children: /* @__PURE__ */ jsx4(
236
+ AnimatedPressable,
237
+ {
238
+ ref,
239
+ entering: overlayEntering,
240
+ exiting: overlayExiting,
241
+ accessibilityRole: "none",
242
+ importantForAccessibility: "no",
243
+ onPress: isDismissable ? close : void 0,
244
+ ...rest,
245
+ style: [overlayStyle, styleProps, style],
246
+ children
247
+ }
248
+ ) }) });
249
+ }
250
+ );
251
+ PopoverOverlay.displayName = "XAUI.Popover.Overlay";
252
+
253
+ // src/components/popover/popover-title.tsx
254
+ import { forwardRef as forwardRef5 } from "react";
255
+ import { Text as Text2 } from "react-native";
256
+ import { jsx as jsx5 } from "react/jsx-runtime";
257
+ var PopoverTitle = forwardRef5(
258
+ function PopoverTitle2({ children, accessibilityRole = "header", style, ...props }, ref) {
259
+ const { titleStyle } = usePopover();
260
+ const [styleProps, rest] = useStyleProps(props);
261
+ return /* @__PURE__ */ jsx5(
262
+ Text2,
263
+ {
264
+ ref,
265
+ accessibilityRole,
266
+ ...rest,
267
+ style: [titleStyle, styleProps, style],
268
+ children
269
+ }
270
+ );
271
+ }
272
+ );
273
+ PopoverTitle.displayName = "XAUI.Popover.Title";
274
+
275
+ // src/components/popover/popover-trigger.tsx
276
+ import { forwardRef as forwardRef6, useCallback as useCallback2 } from "react";
277
+ import { jsx as jsx6 } from "react/jsx-runtime";
278
+ var PopoverTrigger = forwardRef6(
279
+ function PopoverTrigger2({
280
+ children,
281
+ asChild = false,
282
+ accessibilityRole = "button",
283
+ accessibilityState,
284
+ style,
285
+ onLayout,
286
+ onPress,
287
+ onPressIn,
288
+ onPressOut,
289
+ ...props
290
+ }, ref) {
291
+ const { triggerStyle, isOpen, isDisabled, toggle, setAnchor } = usePopover();
292
+ const [styleProps, rest] = useStyleProps(props);
293
+ const [isPressed, press] = usePressState({ onPressIn, onPressOut });
294
+ const anchor = useAnchorRef({ isOpen, onAnchor: setAnchor, onLayout });
295
+ const refs = useMergedRef(anchor.node, ref);
296
+ const handlePress = useCallback2(
297
+ (event) => {
298
+ onPress?.(event);
299
+ anchor.measure();
300
+ toggle();
301
+ },
302
+ [anchor, onPress, toggle]
303
+ );
304
+ return /* @__PURE__ */ jsx6(
305
+ PressableFeedback,
306
+ {
307
+ ref: refs,
308
+ isPressed,
309
+ isDisabled,
310
+ asChild,
311
+ accessibilityRole,
312
+ accessibilityState: {
313
+ disabled: isDisabled,
314
+ expanded: isOpen,
315
+ ...accessibilityState
316
+ },
317
+ ...rest,
318
+ onLayout: anchor.onLayout,
319
+ style: [
320
+ triggerStyle,
321
+ styleProps,
322
+ typeof style === "function" ? style({ pressed: isPressed }) : style
323
+ ],
324
+ onPress: handlePress,
325
+ onPressIn: press.onPressIn,
326
+ onPressOut: press.onPressOut,
327
+ children
328
+ }
329
+ );
330
+ }
331
+ );
332
+ PopoverTrigger.displayName = "XAUI.Popover.Trigger";
333
+
334
+ // src/components/popover/popover.tsx
335
+ import { useCallback as useCallback3, useMemo, useState } from "react";
336
+ import { jsx as jsx7 } from "react/jsx-runtime";
337
+ function Popover({
338
+ children,
339
+ radius,
340
+ isOpen: controlledOpen,
341
+ defaultOpen = false,
342
+ onOpenChange,
343
+ isDisabled = false
344
+ }) {
345
+ const theme = useXAUITheme();
346
+ const [anchor, setAnchor] = useState(null);
347
+ const [isOpen, setOpen] = useControllableState({
348
+ value: controlledOpen,
349
+ defaultValue: defaultOpen,
350
+ onChange: onOpenChange
351
+ });
352
+ const styles = popoverRecipe.resolve({
353
+ theme,
354
+ selection: { radius },
355
+ states: { disabled: isDisabled }
356
+ });
357
+ const open = useCallback3(() => setOpen(true), [setOpen]);
358
+ const close = useCallback3(() => setOpen(false), [setOpen]);
359
+ const toggle = useCallback3(() => setOpen((current) => !current), [setOpen]);
360
+ const context = useMemo(
361
+ () => ({
362
+ triggerStyle: styles.trigger,
363
+ overlayStyle: styles.overlay,
364
+ contentStyle: styles.content,
365
+ titleStyle: styles.title,
366
+ descriptionStyle: styles.description,
367
+ isOpen,
368
+ isDisabled,
369
+ open,
370
+ close,
371
+ toggle,
372
+ anchor,
373
+ setAnchor
374
+ }),
375
+ [styles, isOpen, isDisabled, open, close, toggle, anchor]
376
+ );
377
+ return /* @__PURE__ */ jsx7(PopoverProvider, { value: context, children });
378
+ }
379
+ Popover.displayName = "XAUI.Popover.Root";
380
+
381
+ // src/components/popover/index.ts
382
+ var Popover2 = Object.assign(Popover, {
383
+ Trigger: PopoverTrigger,
384
+ Overlay: PopoverOverlay,
385
+ Content: PopoverContent,
386
+ Title: PopoverTitle,
387
+ Description: PopoverDescription,
388
+ Close: PopoverClose
389
+ });
390
+
391
+ export {
392
+ usePopover,
393
+ PopoverClose,
394
+ popoverRecipe,
395
+ PopoverContent,
396
+ PopoverDescription,
397
+ PopoverOverlay,
398
+ PopoverTitle,
399
+ PopoverTrigger,
400
+ Popover,
401
+ Popover2
402
+ };
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ function _interopRequireDefault(obj) {
7
+ return obj && obj.__esModule ? obj : {
8
+ default: obj
9
+ };
10
+ } // src/system/selection-fill/selection-fill.tsx
11
+ var _reactnative = require('react-native');
12
+ var _reactnativereanimated = require('react-native-reanimated');
13
+ var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
14
+ var _jsxruntime = require('react/jsx-runtime');
15
+ var DURATION = 120;
16
+ var FROM_SCALE = 0.8;
17
+ function SelectionFill({
18
+ isVisible,
19
+ style,
20
+ animation = true,
21
+ children
22
+ }) {
23
+ if (!animation) {
24
+ return isVisible ? /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
25
+ style,
26
+ children
27
+ }) : null;
28
+ }
29
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, AnimatedFill, {
30
+ isVisible,
31
+ style,
32
+ children
33
+ });
34
+ }
35
+ SelectionFill.displayName = "XAUI.SelectionFill";
36
+ const _worklet_11674708088880_init_data = {
37
+ code: "function chunkF6CQ6CBICjs1(){const{_reactnativereanimated,isVisible,DURATION}=this.__closure;return _reactnativereanimated.withTiming.call(void 0,isVisible?1:0,{duration:DURATION});}",
38
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-F6CQ6CBI.cjs",
39
+ sourceMap: "{\"version\":3,\"names\":[\"chunkF6CQ6CBICjs1\",\"_reactnativereanimated\",\"isVisible\",\"DURATION\",\"__closure\",\"withTiming\",\"call\",\"duration\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-F6CQ6CBI.cjs\"],\"mappings\":\"AA2BuE,SAAAA,iBAAMA,CAAA,QAAAC,sBAAA,CAAAC,SAAA,CAAAC,QAAA,OAAAC,SAAA,CAEzE,MAAO,CAAAH,sBAAsB,CAACI,UAAU,CAACC,IAAI,CAAC,IAAK,EAAC,CAAEJ,SAAS,CAAG,CAAC,CAAG,CAAC,CAAE,CAAEK,QAAQ,CAAEJ,QAAS,CAAC,CAAC,CAClG\",\"ignoreList\":[]}"
40
+ };
41
+ const _worklet_9756080511809_init_data = {
42
+ code: "function chunkF6CQ6CBICjs2(){const{progress,FROM_SCALE}=this.__closure;return{opacity:progress.value,transform:[{scale:FROM_SCALE+(1-FROM_SCALE)*progress.value}]};}",
43
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-F6CQ6CBI.cjs",
44
+ sourceMap: "{\"version\":3,\"names\":[\"chunkF6CQ6CBICjs2\",\"progress\",\"FROM_SCALE\",\"__closure\",\"opacity\",\"value\",\"transform\",\"scale\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-F6CQ6CBI.cjs\"],\"mappings\":\"AA+B6E,SAAAA,iBAAMA,CAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,CAE/E,MAAO,CACLC,OAAO,CAAEH,QAAQ,CAACI,KAAK,CACvBC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEL,UAAU,CAAG,CAAC,CAAC,CAAGA,UAAU,EAAID,QAAQ,CAACI,KAAM,CAAC,CACvE,CAAC,CACH\",\"ignoreList\":[]}"
45
+ };
46
+ function AnimatedFill({
47
+ isVisible,
48
+ style,
49
+ children
50
+ }) {
51
+ const progress = _reactnativereanimated.useDerivedValue.call(void 0, function chunkF6CQ6CBICjs1Factory({
52
+ _worklet_11674708088880_init_data,
53
+ _reactnativereanimated,
54
+ isVisible,
55
+ DURATION
56
+ }) {
57
+ const _e = [new global.Error(), -4, -27];
58
+ const chunkF6CQ6CBICjs1 = function () {
59
+ return _reactnativereanimated.withTiming.call(void 0, isVisible ? 1 : 0, {
60
+ duration: DURATION
61
+ });
62
+ };
63
+ chunkF6CQ6CBICjs1.__closure = {
64
+ _reactnativereanimated,
65
+ isVisible,
66
+ DURATION
67
+ };
68
+ chunkF6CQ6CBICjs1.__workletHash = 11674708088880;
69
+ chunkF6CQ6CBICjs1.__pluginVersion = "0.7.4";
70
+ chunkF6CQ6CBICjs1.__initData = _worklet_11674708088880_init_data;
71
+ chunkF6CQ6CBICjs1.__stackDetails = _e;
72
+ return chunkF6CQ6CBICjs1;
73
+ }({
74
+ _worklet_11674708088880_init_data,
75
+ _reactnativereanimated,
76
+ isVisible,
77
+ DURATION
78
+ }), [isVisible]);
79
+ const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkF6CQ6CBICjs2Factory({
80
+ _worklet_9756080511809_init_data,
81
+ progress,
82
+ FROM_SCALE
83
+ }) {
84
+ const _e = [new global.Error(), -3, -27];
85
+ const chunkF6CQ6CBICjs2 = function () {
86
+ return {
87
+ opacity: progress.value,
88
+ transform: [{
89
+ scale: FROM_SCALE + (1 - FROM_SCALE) * progress.value
90
+ }]
91
+ };
92
+ };
93
+ chunkF6CQ6CBICjs2.__closure = {
94
+ progress,
95
+ FROM_SCALE
96
+ };
97
+ chunkF6CQ6CBICjs2.__workletHash = 9756080511809;
98
+ chunkF6CQ6CBICjs2.__pluginVersion = "0.7.4";
99
+ chunkF6CQ6CBICjs2.__initData = _worklet_9756080511809_init_data;
100
+ chunkF6CQ6CBICjs2.__stackDetails = _e;
101
+ return chunkF6CQ6CBICjs2;
102
+ }({
103
+ _worklet_9756080511809_init_data,
104
+ progress,
105
+ FROM_SCALE
106
+ }), [progress]);
107
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
108
+ style: [style, animatedStyle],
109
+ children
110
+ });
111
+ }
112
+ exports.SelectionFill = SelectionFill;
@@ -0,0 +1,42 @@
1
+ import {
2
+ warnDev
3
+ } from "./chunk-EGLLDKN6.js";
4
+
5
+ // src/hooks/use-controllable-state.ts
6
+ import { useCallback, useRef, useState } from "react";
7
+ function useControllableState({
8
+ value,
9
+ defaultValue,
10
+ onChange
11
+ }) {
12
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
13
+ const isControlled = value !== void 0;
14
+ const current = isControlled ? value : uncontrolled;
15
+ useControlWarning(isControlled);
16
+ const latest = useRef(current);
17
+ latest.current = current;
18
+ const onChangeRef = useRef(onChange);
19
+ onChangeRef.current = onChange;
20
+ const controlled = useRef(isControlled);
21
+ controlled.current = isControlled;
22
+ const set = useCallback((next) => {
23
+ const resolved = typeof next === "function" ? next(latest.current) : next;
24
+ if (resolved === latest.current) return;
25
+ if (!controlled.current) setUncontrolled(resolved);
26
+ onChangeRef.current?.(resolved);
27
+ }, []);
28
+ return [current, set];
29
+ }
30
+ function useControlWarning(isControlled) {
31
+ const wasControlled = useRef(isControlled);
32
+ if (wasControlled.current !== isControlled) {
33
+ warnDev(
34
+ `a component switched from ${wasControlled.current ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Decide for the life of the component: pass \`value\` always, or never. Passing \`undefined\` for a value you do control reads as "uncontrolled" here.`
35
+ );
36
+ wasControlled.current = isControlled;
37
+ }
38
+ }
39
+
40
+ export {
41
+ useControllableState
42
+ };
@@ -0,0 +1,89 @@
1
+ import {
2
+ useXAUITheme
3
+ } from "./chunk-A3EGFI6T.js";
4
+ import {
5
+ useStyleProps
6
+ } from "./chunk-M63GFNKV.js";
7
+
8
+ // src/system/icon/chevron-down-icon.tsx
9
+ import { Path, Svg } from "react-native-svg";
10
+ import { jsx } from "react/jsx-runtime";
11
+ function ChevronDownIcon({
12
+ size = 20,
13
+ color = "currentColor"
14
+ }) {
15
+ return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
16
+ Path,
17
+ {
18
+ d: "m6 9 6 6 6-6",
19
+ stroke: color,
20
+ strokeWidth: 2,
21
+ strokeLinecap: "round",
22
+ strokeLinejoin: "round"
23
+ }
24
+ ) });
25
+ }
26
+ ChevronDownIcon.displayName = "XAUI.ChevronDownIcon";
27
+
28
+ // src/system/icon/icon-context.ts
29
+ import { createContext, useContext } from "react";
30
+ var IconContext = createContext({});
31
+ IconContext.displayName = "XAUI.Icon.Context";
32
+ function useIconContext() {
33
+ return useContext(IconContext);
34
+ }
35
+
36
+ // src/system/icon/icon.tsx
37
+ import { cloneElement, isValidElement } from "react";
38
+ import { Image } from "react-native";
39
+ import { jsx as jsx2 } from "react/jsx-runtime";
40
+ function Icon(props) {
41
+ const inherited = useIconContext();
42
+ const theme = useXAUITheme();
43
+ const size = props.size ?? inherited.size ?? theme.fontSizes.md;
44
+ const color = props.color ?? inherited.color ?? theme.colors.foreground;
45
+ if (props.as) {
46
+ const Component = props.as;
47
+ return /* @__PURE__ */ jsx2(Component, { size, color });
48
+ }
49
+ if (isValidElement(props.children)) {
50
+ return cloneElement(props.children, {
51
+ width: size,
52
+ height: size,
53
+ color
54
+ });
55
+ }
56
+ if (props.source) return /* @__PURE__ */ jsx2(IconImage, { ...props, resolved: { size, color } });
57
+ throw new Error(
58
+ "XAUI: Icon needs one of `as` (an icon component), a raw SVG element as its child, or `source` (an image). It renders nothing on its own."
59
+ );
60
+ }
61
+ Icon.displayName = "XAUI.Icon";
62
+ function IconImage({
63
+ source,
64
+ style,
65
+ resolved,
66
+ size: _size,
67
+ color: _color,
68
+ ...props
69
+ }) {
70
+ const [styleProps] = useStyleProps(props);
71
+ return /* @__PURE__ */ jsx2(
72
+ Image,
73
+ {
74
+ source,
75
+ style: [
76
+ { width: resolved.size, height: resolved.size, tintColor: resolved.color },
77
+ styleProps,
78
+ style
79
+ ]
80
+ }
81
+ );
82
+ }
83
+
84
+ export {
85
+ ChevronDownIcon,
86
+ IconContext,
87
+ useIconContext,
88
+ Icon
89
+ };