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

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 (95) hide show
  1. package/dist/{chunk-GJSFKH4L.js → chunk-2XPG2243.js} +16 -16
  2. package/dist/{chunk-TGMVEHV7.cjs → chunk-3E7CDKFO.cjs} +61 -61
  3. package/dist/{chunk-37L7YGZV.cjs → chunk-5R26NM4M.cjs} +11 -34
  4. package/dist/chunk-5VKYNBNA.js +607 -0
  5. package/dist/{chunk-S4QUM4EE.cjs → chunk-6DOLGZVV.cjs} +4 -4
  6. package/dist/{chunk-LIUO6D3D.js → chunk-6UEZJRVI.js} +75 -75
  7. package/dist/chunk-734MFAX4.js +27 -0
  8. package/dist/{chunk-VZK3NLBH.cjs → chunk-7YF5NAHQ.cjs} +7 -7
  9. package/dist/{chunk-SIP5J7HU.cjs → chunk-ABAGZTXZ.cjs} +15 -15
  10. package/dist/{chunk-USF6EWYR.js → chunk-BRRXFOBY.js} +7 -7
  11. package/dist/{chunk-4KSKQD37.cjs → chunk-C5YLPCFC.cjs} +5 -5
  12. package/dist/{chunk-54CWXA34.cjs → chunk-DA3OKXHV.cjs} +59 -59
  13. package/dist/{chunk-HA6BFY3A.js → chunk-DD4276RF.js} +6 -6
  14. package/dist/{chunk-SACDOFGF.js → chunk-DG2I4PJG.js} +15 -15
  15. package/dist/{chunk-FBCWNXZC.js → chunk-DHGLGSH6.js} +58 -58
  16. package/dist/{chunk-MXGER5PI.js → chunk-DIBUQ46Y.js} +5 -5
  17. package/dist/{chunk-XAFP5JLK.js → chunk-EZEYMLO3.js} +13 -36
  18. package/dist/{chunk-7KLBTMXV.cjs → chunk-G7P3ERYF.cjs} +5 -5
  19. package/dist/{chunk-QZ24MZRX.js → chunk-GA6PBWNT.js} +1 -1
  20. package/dist/{chunk-HOI5425P.cjs → chunk-GFUZ3MUT.cjs} +6 -6
  21. package/dist/chunk-GTR5X65M.cjs +27 -0
  22. package/dist/{chunk-EYD4H4X6.js → chunk-KCMYU7WF.js} +1 -1
  23. package/dist/{chunk-JKP4TPIL.js → chunk-LRN3RNDO.js} +16 -16
  24. package/dist/{chunk-XNMZQSY5.js → chunk-N3KTZMPG.js} +5 -5
  25. package/dist/{chunk-7TOG4TVU.cjs → chunk-NWGLP6JX.cjs} +15 -15
  26. package/dist/{chunk-NCCRQK3P.cjs → chunk-R73XQK7X.cjs} +5 -5
  27. package/dist/{chunk-76XDVA24.cjs → chunk-RU7JCMWC.cjs} +6 -6
  28. package/dist/chunk-T5FV5F7A.cjs +607 -0
  29. package/dist/{chunk-3JXI2IHV.cjs → chunk-TJ74XVZN.cjs} +8 -8
  30. package/dist/{chunk-URA25DU4.cjs → chunk-UAWBAD4E.cjs} +5 -5
  31. package/dist/{chunk-6CO6FM67.js → chunk-UFTCTTKK.js} +15 -15
  32. package/dist/{chunk-DY3SUG5P.js → chunk-XFPQFCEK.js} +6 -6
  33. package/dist/{chunk-66FOASTP.cjs → chunk-XV735BSA.cjs} +6 -6
  34. package/dist/{chunk-TRETQZEW.js → chunk-YGYYJ3LQ.js} +5 -5
  35. package/dist/{chunk-R7BU4CPS.js → chunk-YVHT2UVW.js} +1 -1
  36. package/dist/{chunk-AAVCMCJ3.cjs → chunk-ZFOOJK37.cjs} +2 -2
  37. package/dist/components/accordion/index.cjs +5 -5
  38. package/dist/components/accordion/index.js +4 -4
  39. package/dist/components/alert/index.cjs +6 -6
  40. package/dist/components/alert/index.js +5 -5
  41. package/dist/components/avatar/index.cjs +4 -4
  42. package/dist/components/avatar/index.js +3 -3
  43. package/dist/components/badge/index.cjs +4 -4
  44. package/dist/components/badge/index.js +3 -3
  45. package/dist/components/button/index.cjs +5 -5
  46. package/dist/components/button/index.js +4 -4
  47. package/dist/components/card/index.cjs +5 -5
  48. package/dist/components/card/index.js +4 -4
  49. package/dist/components/checkbox/index.cjs +5 -5
  50. package/dist/components/checkbox/index.js +4 -4
  51. package/dist/components/chip/index.cjs +6 -6
  52. package/dist/components/chip/index.js +5 -5
  53. package/dist/components/divider/index.cjs +4 -4
  54. package/dist/components/divider/index.js +3 -3
  55. package/dist/components/field-group/index.cjs +5 -5
  56. package/dist/components/field-group/index.js +4 -4
  57. package/dist/components/input-otp/index.cjs +4 -4
  58. package/dist/components/input-otp/index.js +3 -3
  59. package/dist/components/menu/index.cjs +49 -0
  60. package/dist/components/menu/index.d.cts +351 -0
  61. package/dist/components/menu/index.d.ts +351 -0
  62. package/dist/components/menu/index.js +49 -0
  63. package/dist/components/popover/index.cjs +6 -5
  64. package/dist/components/popover/index.js +5 -4
  65. package/dist/components/radio/index.cjs +5 -5
  66. package/dist/components/radio/index.js +4 -4
  67. package/dist/components/select/index.cjs +5 -5
  68. package/dist/components/select/index.d.cts +1 -1
  69. package/dist/components/select/index.d.ts +1 -1
  70. package/dist/components/select/index.js +4 -4
  71. package/dist/components/spinner/index.cjs +1 -1
  72. package/dist/components/spinner/index.js +1 -1
  73. package/dist/components/switch/index.cjs +5 -5
  74. package/dist/components/switch/index.js +4 -4
  75. package/dist/components/text-area/index.cjs +5 -5
  76. package/dist/components/text-area/index.js +4 -4
  77. package/dist/components/text-field/index.cjs +4 -4
  78. package/dist/components/text-field/index.js +3 -3
  79. package/dist/components/typography/index.cjs +4 -4
  80. package/dist/components/typography/index.js +3 -3
  81. package/dist/index.cjs +61 -28
  82. package/dist/index.d.cts +1 -0
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.js +78 -45
  85. package/dist/system/index.cjs +7 -7
  86. package/dist/system/index.js +7 -7
  87. package/package.json +11 -1
  88. package/dist/{chunk-S2WNWMNT.js → chunk-2NRZKJG7.js} +4 -4
  89. package/dist/{chunk-26OGEFQI.js → chunk-4CUZZWFW.js} +3 -3
  90. package/dist/{chunk-KSUV74BE.cjs → chunk-6L2TS2R3.cjs} +3 -3
  91. package/dist/{chunk-SZLXPF3G.js → chunk-73RKQC5X.js} +3 -3
  92. package/dist/{chunk-BNFIFRQA.cjs → chunk-AMCSSOJT.cjs} +3 -3
  93. package/dist/{chunk-346QBNUD.js → chunk-H7DS4IO7.js} +4 -4
  94. package/dist/{chunk-RKCWYUGA.cjs → chunk-HDVVZG4S.cjs} +3 -3
  95. package/dist/{chunk-A7YB7YWX.cjs → chunk-J3MB4PI5.cjs} +3 -3
@@ -0,0 +1,607 @@
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
+ var _chunkGTR5X65Mcjs = require('./chunk-GTR5X65M.cjs');
4
+
5
+
6
+ var _chunkLUPCPLNDcjs = require('./chunk-LUPCPLND.cjs');
7
+
8
+
9
+ var _chunkWDDXU3OHcjs = require('./chunk-WDDXU3OH.cjs');
10
+
11
+
12
+
13
+
14
+
15
+ var _chunkEKS3W46Mcjs = require('./chunk-EKS3W46M.cjs');
16
+
17
+
18
+ var _chunkWFEMJCXOcjs = require('./chunk-WFEMJCXO.cjs');
19
+
20
+
21
+ var _chunk4KFKWBN5cjs = require('./chunk-4KFKWBN5.cjs');
22
+
23
+
24
+ var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
25
+
26
+
27
+ var _chunk3E7CDKFOcjs = require('./chunk-3E7CDKFO.cjs');
28
+
29
+
30
+ var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
31
+
32
+
33
+
34
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
35
+
36
+
37
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
38
+
39
+
40
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
41
+
42
+
43
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
44
+
45
+ // src/components/menu/menu-content.tsx
46
+ var _react = require('react');
47
+ var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
48
+
49
+ // src/components/menu/menu.recipe.ts
50
+ var _reactnative = require('react-native');
51
+ var SLOTS = [
52
+ "trigger",
53
+ "overlay",
54
+ "content",
55
+ "label",
56
+ "separator",
57
+ "group",
58
+ "item",
59
+ "itemTitle",
60
+ "itemDescription",
61
+ "itemIndicator"
62
+ ];
63
+ var VARIANT_TOKENS = {
64
+ default: { fg: "overlayForeground" },
65
+ danger: { fg: "danger" }
66
+ };
67
+ function menuMeasure(fontSize) {
68
+ return fontSize * 15;
69
+ }
70
+ var PANEL_PADDING_HORIZONTAL = 1.5;
71
+ var PANEL_PADDING_VERTICAL = 3;
72
+ var ITEM_PADDING_HORIZONTAL = 2.5;
73
+ var ITEM_PADDING_VERTICAL = 2;
74
+ var ITEM_GAP = 2.5;
75
+ var LABEL_INSET = 3;
76
+ var INDICATOR = 5;
77
+ var HAIRLINE = _reactnative.StyleSheet.hairlineWidth;
78
+ var menuRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
79
+ slots: SLOTS,
80
+ base: (theme) => ({
81
+ overlay: { position: "absolute", top: 0, bottom: 0, start: 0, end: 0 },
82
+ content: {
83
+ position: "absolute",
84
+ backgroundColor: theme.colors.overlay,
85
+ paddingHorizontal: theme.spacing(PANEL_PADDING_HORIZONTAL),
86
+ paddingVertical: theme.spacing(PANEL_PADDING_VERTICAL),
87
+ // Their `--radius-3xl` on a base of 8 is 24; our base is 12, so the same 24 is `2xl`.
88
+ borderRadius: theme.radius["2xl"],
89
+ borderCurve: "continuous",
90
+ ...theme.shadows.overlay
91
+ },
92
+ label: {
93
+ fontFamily: theme.fontFamilies.body,
94
+ fontWeight: theme.fontWeights.medium,
95
+ fontSize: theme.fontSizes.sm,
96
+ lineHeight: theme.lineHeights.sm,
97
+ color: theme.colors.muted,
98
+ // Inset to the row's own text rather than to the panel: a heading that starts
99
+ // before the rows it heads reads as a heading for the panel.
100
+ marginStart: theme.spacing(LABEL_INSET),
101
+ paddingVertical: theme.spacing(1)
102
+ },
103
+ /**
104
+ * A rule between two runs of rows, placed by the caller rather than drawn between
105
+ * every pair. A menu of four related actions wants none; a menu whose last row is
106
+ * "Supprimer" wants exactly one, above it.
107
+ *
108
+ * It runs the panel's full inner width rather than lining up with the rows' text: a
109
+ * separator inset to the titles reads as belonging to the row under it, and this one
110
+ * belongs to neither.
111
+ */
112
+ separator: {
113
+ height: HAIRLINE,
114
+ backgroundColor: theme.colors.separator,
115
+ marginVertical: theme.spacing(1),
116
+ marginHorizontal: -theme.spacing(PANEL_PADDING_HORIZONTAL)
117
+ },
118
+ group: { flexDirection: "column" },
119
+ item: {
120
+ flexDirection: "row",
121
+ alignItems: "center",
122
+ gap: theme.spacing(ITEM_GAP),
123
+ paddingHorizontal: theme.spacing(ITEM_PADDING_HORIZONTAL),
124
+ paddingVertical: theme.spacing(ITEM_PADDING_VERTICAL),
125
+ borderRadius: theme.radius.lg,
126
+ borderCurve: "continuous"
127
+ },
128
+ itemTitle: {
129
+ fontFamily: theme.fontFamilies.body,
130
+ fontWeight: theme.fontWeights.medium,
131
+ fontSize: theme.fontSizes.md,
132
+ lineHeight: theme.lineHeights.md,
133
+ // Grows into the row so an indicator stays pinned to the end, whatever the label's
134
+ // length — but from its **content** size rather than from zero.
135
+ //
136
+ // `flex: 1` is `flexBasis: 0`, and the panel is measured before it has a width: with
137
+ // a basis of zero and no definite width to grow into, the row's content size is
138
+ // nothing and the title collapses. The whole menu measured as a 70-point capsule
139
+ // with no text in it. HeroUI writes `flex: 1` here and gets away with it because
140
+ // their measuring pass hands the panel a definite width; ours asks the panel how
141
+ // wide it wants to be, which is a question a zero basis cannot answer.
142
+ flexGrow: 1,
143
+ flexShrink: 1,
144
+ flexBasis: "auto"
145
+ },
146
+ itemDescription: {
147
+ fontFamily: theme.fontFamilies.body,
148
+ fontSize: theme.fontSizes.sm,
149
+ lineHeight: theme.lineHeights.sm,
150
+ color: theme.colors.muted
151
+ },
152
+ itemIndicator: {
153
+ width: theme.spacing(INDICATOR),
154
+ height: theme.spacing(INDICATOR),
155
+ alignItems: "center",
156
+ justifyContent: "center"
157
+ }
158
+ }),
159
+ variantTokens: VARIANT_TOKENS,
160
+ /** The variant paints the row's text and nothing else. The panel is the theme's. */
161
+ paint: (_theme, colors) => ({
162
+ itemTitle: { color: colors.fg },
163
+ itemIndicator: { color: colors.fg }
164
+ }),
165
+ variants: { radius: _chunkFNEUOBCVcjs.radiusAxis.call(void 0, "content") },
166
+ states: {
167
+ pressed: (theme) => ({
168
+ item: { backgroundColor: theme.colors.defaultSoftPressed }
169
+ }),
170
+ disabled: (theme) => ({ trigger: { opacity: theme.opacity.disabled } })
171
+ },
172
+ defaultVariants: { variant: "default" }
173
+ });
174
+
175
+ // src/components/menu/menu.context.ts
176
+ var [MenuProvider, useMenu] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Menu");
177
+ var [MenuItemProvider, useMenuItem] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "Menu.Item");
178
+
179
+ // src/components/menu/menu-content.tsx
180
+ var _jsxruntime = require('react/jsx-runtime');
181
+ var DEFAULT_OFFSET = 6;
182
+ var DEFAULT_INSETS = {
183
+ top: 12,
184
+ bottom: 12,
185
+ start: 12,
186
+ end: 12
187
+ };
188
+ var MenuContent = _react.forwardRef.call(void 0, function MenuContent2({
189
+ children,
190
+ placement = "bottom",
191
+ align = "center",
192
+ width = "content-fit",
193
+ offset = DEFAULT_OFFSET,
194
+ alignOffset = 0,
195
+ avoidCollisions = true,
196
+ insets,
197
+ style,
198
+ onLayout,
199
+ ...props
200
+ }, ref) {
201
+ const context = useMenu();
202
+ const { contentStyle, isOpen, anchor } = context;
203
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
204
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
205
+ const { position, onContentLayout, measuringStyle } = _chunkLUPCPLNDcjs.useAnchoredPosition.call(void 0, {
206
+ anchor,
207
+ isOpen,
208
+ placement,
209
+ align,
210
+ width,
211
+ offset,
212
+ alignOffset,
213
+ avoidCollisions,
214
+ insets: { ...DEFAULT_INSETS, ...insets },
215
+ maxWidth: menuMeasure(theme.fontSizes.md),
216
+ onLayout
217
+ });
218
+ if (!isOpen || anchor === null) return null;
219
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
220
+ _reactnativereanimated2.default.View,
221
+ {
222
+ ref,
223
+ entering: position ? _chunkEKS3W46Mcjs.anchoredEntering.call(void 0, position.placement) : void 0,
224
+ exiting: position ? _chunkEKS3W46Mcjs.anchoredExiting.call(void 0, position.placement) : void 0,
225
+ onLayout: onContentLayout,
226
+ ...rest,
227
+ style: [
228
+ contentStyle,
229
+ position === null ? measuringStyle : {
230
+ top: position.top,
231
+ start: position.start,
232
+ width: position.width,
233
+ maxHeight: position.maxHeight
234
+ },
235
+ styleProps,
236
+ style
237
+ ],
238
+ children
239
+ },
240
+ _nullishCoalesce(_optionalChain([position, 'optionalAccess', _ => _.placement]), () => ( "measuring"))
241
+ ) }) });
242
+ });
243
+ MenuContent.displayName = "XAUI.Menu.Content";
244
+
245
+ // src/components/menu/menu-group.tsx
246
+
247
+
248
+
249
+ var MenuGroup = _react.forwardRef.call(void 0, function MenuGroup2({ children, accessibilityRole = "menu", style, ...props }, ref) {
250
+ const { groupStyle } = useMenu();
251
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
252
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
253
+ _reactnative.View,
254
+ {
255
+ ref,
256
+ accessibilityRole,
257
+ ...rest,
258
+ style: [groupStyle, styleProps, style],
259
+ children
260
+ }
261
+ );
262
+ });
263
+ MenuGroup.displayName = "XAUI.Menu.Group";
264
+
265
+ // src/components/menu/menu-item.tsx
266
+
267
+
268
+ var MenuItem = _react.forwardRef.call(void 0, function MenuItem2({
269
+ variant = "default",
270
+ children,
271
+ isDisabled = false,
272
+ closesOnPress = true,
273
+ asChild = false,
274
+ accessibilityRole = "menuitem",
275
+ accessibilityState,
276
+ style,
277
+ onPress,
278
+ onPressIn,
279
+ onPressOut,
280
+ ...props
281
+ }, ref) {
282
+ const { itemStyle, itemPressedStyle, glyph, close } = useMenu();
283
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
284
+ const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
285
+ const handlePress = _react.useCallback.call(void 0,
286
+ (event) => {
287
+ _optionalChain([onPress, 'optionalCall', _2 => _2(event)]);
288
+ if (closesOnPress) close();
289
+ },
290
+ [close, closesOnPress, onPress]
291
+ );
292
+ const context = _react.useMemo.call(void 0,
293
+ () => ({ variant, isPressed, isDisabled }),
294
+ [variant, isPressed, isDisabled]
295
+ );
296
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuItemProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4KFKWBN5cjs.IconContext.Provider, { value: glyph[variant], children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
297
+ _chunk3E7CDKFOcjs.PressableFeedback,
298
+ {
299
+ ref,
300
+ isPressed,
301
+ isDisabled,
302
+ asChild,
303
+ accessibilityRole,
304
+ accessibilityState: { disabled: isDisabled, ...accessibilityState },
305
+ ...rest,
306
+ style: [
307
+ itemStyle,
308
+ isPressed && itemPressedStyle,
309
+ styleProps,
310
+ typeof style === "function" ? style({ pressed: isPressed }) : style
311
+ ],
312
+ onPress: handlePress,
313
+ onPressIn: press.onPressIn,
314
+ onPressOut: press.onPressOut,
315
+ children: typeof children === "function" ? children(context) : children
316
+ }
317
+ ) }) });
318
+ });
319
+ MenuItem.displayName = "XAUI.Menu.Item";
320
+
321
+ // src/components/menu/menu-item-description.tsx
322
+
323
+
324
+
325
+ var MenuItemDescription = _react.forwardRef.call(void 0,
326
+ function MenuItemDescription2({ children, style, ...props }, ref) {
327
+ const { itemDescriptionStyle } = useMenu();
328
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
329
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.Text, { ref, ...rest, style: [itemDescriptionStyle, styleProps, style], children });
330
+ }
331
+ );
332
+ MenuItemDescription.displayName = "XAUI.Menu.ItemDescription";
333
+
334
+ // src/components/menu/menu-item-indicator.tsx
335
+
336
+
337
+
338
+ var MenuItemIndicator = _react.forwardRef.call(void 0,
339
+ function MenuItemIndicator2({ children, style, ...props }, ref) {
340
+ const { itemIndicatorStyle } = useMenu();
341
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
342
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { ref, ...rest, style: [itemIndicatorStyle, styleProps, style], children });
343
+ }
344
+ );
345
+ MenuItemIndicator.displayName = "XAUI.Menu.ItemIndicator";
346
+
347
+ // src/components/menu/menu-item-title.tsx
348
+
349
+
350
+
351
+ var MenuItemTitle = _react.forwardRef.call(void 0,
352
+ function MenuItemTitle2({ children, numberOfLines = 1, style, ...props }, ref) {
353
+ const { itemTitleStyle } = useMenu();
354
+ const { variant } = useMenuItem();
355
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
356
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
357
+ _reactnative.Text,
358
+ {
359
+ ref,
360
+ numberOfLines,
361
+ ...rest,
362
+ style: [itemTitleStyle[variant], styleProps, style],
363
+ children
364
+ }
365
+ );
366
+ }
367
+ );
368
+ MenuItemTitle.displayName = "XAUI.Menu.ItemTitle";
369
+
370
+ // src/components/menu/menu-label.tsx
371
+
372
+
373
+
374
+ var MenuLabel = _react.forwardRef.call(void 0, function MenuLabel2({ children, accessibilityRole = "header", style, ...props }, ref) {
375
+ const { labelStyle } = useMenu();
376
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
377
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
378
+ _reactnative.Text,
379
+ {
380
+ ref,
381
+ accessibilityRole,
382
+ ...rest,
383
+ style: [labelStyle, styleProps, style],
384
+ children
385
+ }
386
+ );
387
+ });
388
+ MenuLabel.displayName = "XAUI.Menu.Label";
389
+
390
+ // src/components/menu/menu-separator.tsx
391
+
392
+
393
+
394
+ var MenuSeparator = _react.forwardRef.call(void 0,
395
+ function MenuSeparator2({ style, ...props }, ref) {
396
+ const { separatorStyle } = useMenu();
397
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
398
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
399
+ _reactnative.View,
400
+ {
401
+ ref,
402
+ accessibilityElementsHidden: true,
403
+ importantForAccessibility: "no-hide-descendants",
404
+ ...rest,
405
+ style: [separatorStyle, styleProps, style]
406
+ }
407
+ );
408
+ }
409
+ );
410
+ MenuSeparator.displayName = "XAUI.Menu.Separator";
411
+
412
+ // src/components/menu/menu-overlay.tsx
413
+
414
+
415
+
416
+
417
+ var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
418
+ var MenuOverlay = _react.forwardRef.call(void 0, function MenuOverlay2({ children, isDismissable = true, style, ...props }, ref) {
419
+ const context = useMenu();
420
+ const { overlayStyle, isOpen, close } = context;
421
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
422
+ if (!isOpen) return null;
423
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWDDXU3OHcjs.Portal, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
424
+ AnimatedPressable,
425
+ {
426
+ ref,
427
+ entering: _chunkEKS3W46Mcjs.overlayEntering,
428
+ exiting: _chunkEKS3W46Mcjs.overlayExiting,
429
+ accessibilityRole: "none",
430
+ importantForAccessibility: "no",
431
+ onPress: isDismissable ? close : void 0,
432
+ ...rest,
433
+ style: [overlayStyle, styleProps, style],
434
+ children
435
+ }
436
+ ) }) });
437
+ });
438
+ MenuOverlay.displayName = "XAUI.Menu.Overlay";
439
+
440
+ // src/components/menu/menu-trigger.tsx
441
+
442
+
443
+ var MenuTrigger = _react.forwardRef.call(void 0, function MenuTrigger2({
444
+ children,
445
+ asChild = false,
446
+ accessibilityRole = "button",
447
+ accessibilityState,
448
+ style,
449
+ onLayout,
450
+ onPress,
451
+ onPressIn,
452
+ onPressOut,
453
+ ...props
454
+ }, ref) {
455
+ const { triggerStyle, isOpen, isDisabled, toggle, setAnchor } = useMenu();
456
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
457
+ const [isPressed, press] = _chunk7DPL3ZDScjs.usePressState.call(void 0, { onPressIn, onPressOut });
458
+ const anchor = _chunkGTR5X65Mcjs.useAnchorRef.call(void 0, { isOpen, onAnchor: setAnchor, onLayout });
459
+ const refs = _chunkWFEMJCXOcjs.useMergedRef.call(void 0, anchor.node, ref);
460
+ const handlePress = _react.useCallback.call(void 0,
461
+ (event) => {
462
+ _optionalChain([onPress, 'optionalCall', _3 => _3(event)]);
463
+ anchor.measure();
464
+ toggle();
465
+ },
466
+ [anchor, onPress, toggle]
467
+ );
468
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
469
+ _chunk3E7CDKFOcjs.PressableFeedback,
470
+ {
471
+ ref: refs,
472
+ isPressed,
473
+ isDisabled,
474
+ asChild,
475
+ accessibilityRole,
476
+ accessibilityState: {
477
+ disabled: isDisabled,
478
+ expanded: isOpen,
479
+ ...accessibilityState
480
+ },
481
+ ...rest,
482
+ onLayout: anchor.onLayout,
483
+ style: [
484
+ triggerStyle,
485
+ styleProps,
486
+ typeof style === "function" ? style({ pressed: isPressed }) : style
487
+ ],
488
+ onPress: handlePress,
489
+ onPressIn: press.onPressIn,
490
+ onPressOut: press.onPressOut,
491
+ children
492
+ }
493
+ );
494
+ });
495
+ MenuTrigger.displayName = "XAUI.Menu.Trigger";
496
+
497
+ // src/components/menu/menu.tsx
498
+
499
+
500
+
501
+ var VARIANTS = ["default", "danger"];
502
+ function Menu({
503
+ children,
504
+ radius,
505
+ isOpen: controlledOpen,
506
+ defaultOpen = false,
507
+ onOpenChange,
508
+ isDisabled = false
509
+ }) {
510
+ const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
511
+ const [anchor, setAnchor] = _react.useState.call(void 0, null);
512
+ const [isOpen, setOpen] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
513
+ value: controlledOpen,
514
+ defaultValue: defaultOpen,
515
+ onChange: onOpenChange
516
+ });
517
+ const selection = { radius };
518
+ const styles = menuRecipe.resolve({
519
+ theme,
520
+ selection,
521
+ states: { disabled: isDisabled }
522
+ });
523
+ const pressed = menuRecipe.resolve({ theme, selection, states: { pressed: true } });
524
+ const open = _react.useCallback.call(void 0, () => setOpen(true), [setOpen]);
525
+ const close = _react.useCallback.call(void 0, () => setOpen(false), [setOpen]);
526
+ const toggle = _react.useCallback.call(void 0, () => setOpen((current) => !current), [setOpen]);
527
+ const context = _react.useMemo.call(void 0, () => {
528
+ const byVariant = (read) => Object.fromEntries(VARIANTS.map((v) => [v, read(v)]));
529
+ const title = byVariant(
530
+ (variant) => menuRecipe.resolve({ theme, selection: { ...selection, variant } }).itemTitle
531
+ );
532
+ return {
533
+ triggerStyle: styles.trigger,
534
+ overlayStyle: styles.overlay,
535
+ contentStyle: styles.content,
536
+ labelStyle: styles.label,
537
+ separatorStyle: styles.separator,
538
+ groupStyle: styles.group,
539
+ itemStyle: styles.item,
540
+ itemPressedStyle: pressed.item,
541
+ itemTitleStyle: title,
542
+ itemDescriptionStyle: styles.itemDescription,
543
+ itemIndicatorStyle: styles.itemIndicator,
544
+ glyph: byVariant((variant) => {
545
+ const flat = _reactnative.StyleSheet.flatten([title[variant]]);
546
+ return {
547
+ size: flat.fontSize,
548
+ // `ColorValue` also covers the platform's opaque colours, which `Icon` cannot
549
+ // hand to a third-party component expecting a string.
550
+ color: typeof flat.color === "string" ? flat.color : void 0
551
+ };
552
+ }),
553
+ isOpen,
554
+ isDisabled,
555
+ open,
556
+ close,
557
+ toggle,
558
+ anchor,
559
+ setAnchor
560
+ };
561
+ }, [
562
+ styles,
563
+ pressed,
564
+ theme,
565
+ radius,
566
+ isOpen,
567
+ isDisabled,
568
+ open,
569
+ close,
570
+ toggle,
571
+ anchor
572
+ ]);
573
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MenuProvider, { value: context, children });
574
+ }
575
+ Menu.displayName = "XAUI.Menu.Root";
576
+
577
+ // src/components/menu/index.ts
578
+ var Menu2 = Object.assign(Menu, {
579
+ Trigger: MenuTrigger,
580
+ Overlay: MenuOverlay,
581
+ Content: MenuContent,
582
+ Label: MenuLabel,
583
+ Separator: MenuSeparator,
584
+ Group: MenuGroup,
585
+ Item: MenuItem,
586
+ ItemTitle: MenuItemTitle,
587
+ ItemDescription: MenuItemDescription,
588
+ ItemIndicator: MenuItemIndicator
589
+ });
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+ exports.menuRecipe = menuRecipe; exports.useMenu = useMenu; exports.useMenuItem = useMenuItem; exports.MenuContent = MenuContent; exports.MenuGroup = MenuGroup; exports.MenuItem = MenuItem; exports.MenuItemDescription = MenuItemDescription; exports.MenuItemIndicator = MenuItemIndicator; exports.MenuItemTitle = MenuItemTitle; exports.MenuLabel = MenuLabel; exports.MenuSeparator = MenuSeparator; exports.MenuOverlay = MenuOverlay; exports.MenuTrigger = MenuTrigger; exports.Menu = Menu; exports.Menu2 = Menu2;
@@ -1,13 +1,13 @@
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
3
 
4
- var _chunkAAVCMCJ3cjs = require('./chunk-AAVCMCJ3.cjs');
4
+ var _chunkZFOOJK37cjs = require('./chunk-ZFOOJK37.cjs');
5
5
 
6
6
 
7
7
  var _chunk4KFKWBN5cjs = require('./chunk-4KFKWBN5.cjs');
8
8
 
9
9
 
10
- var _chunkTGMVEHV7cjs = require('./chunk-TGMVEHV7.cjs');
10
+ var _chunk3E7CDKFOcjs = require('./chunk-3E7CDKFO.cjs');
11
11
 
12
12
 
13
13
  var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
@@ -17,15 +17,15 @@ var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
17
17
 
18
18
 
19
19
 
20
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
20
21
 
21
- var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
22
22
 
23
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
23
24
 
24
25
 
25
- var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
26
26
 
27
27
 
28
- var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
28
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
29
29
 
30
30
 
31
31
  var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
@@ -58,7 +58,7 @@ ChipAvatar.displayName = "XAUI.Chip.Avatar";
58
58
  var ChipClose = _react.forwardRef.call(void 0, function ChipClose2({ isDisabled, ...props }, ref) {
59
59
  const { closeStyle, closeGlyphStyle, isDisabled: isChipDisabled } = useChip();
60
60
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
61
- _chunkAAVCMCJ3cjs.CloseButton,
61
+ _chunkZFOOJK37cjs.CloseButton,
62
62
  {
63
63
  ref,
64
64
  name: "Chip.Close",
@@ -242,7 +242,7 @@ var chipRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
242
242
  // The cross's own geometry — thickness and centring — belongs to the shared
243
243
  // `CloseButton`; what stays below is the box and bar size this component's scale sets.
244
244
  base: (theme) => ({
245
- ..._chunkAAVCMCJ3cjs.closeButtonBase.call(void 0, theme),
245
+ ..._chunkZFOOJK37cjs.closeButtonBase.call(void 0, theme),
246
246
  root: {
247
247
  // A chip hugs its content where a `Button` fills its column. The difference is what
248
248
  // the two are: a button is a control the layout sizes, a chip is a token *about*
@@ -371,7 +371,7 @@ var ChipRoot = _react.forwardRef.call(void 0, function Chip({
371
371
  );
372
372
  }
373
373
  const surface = isPressable ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
374
- _chunkTGMVEHV7cjs.PressableFeedback,
374
+ _chunk3E7CDKFOcjs.PressableFeedback,
375
375
  {
376
376
  ref,
377
377
  isPressed,
@@ -6,21 +6,21 @@ var _chunkF6CQ6CBIcjs = require('./chunk-F6CQ6CBI.cjs');
6
6
  var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
7
7
 
8
8
 
9
- var _chunkTGMVEHV7cjs = require('./chunk-TGMVEHV7.cjs');
9
+ var _chunk3E7CDKFOcjs = require('./chunk-3E7CDKFO.cjs');
10
10
 
11
11
 
12
12
  var _chunk7DPL3ZDScjs = require('./chunk-7DPL3ZDS.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
16
+ var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
17
17
 
18
18
 
19
+ var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
19
20
 
20
- var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
21
21
 
22
22
 
23
- var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
23
+ var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
24
24
 
25
25
 
26
26
  var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
@@ -303,7 +303,7 @@ var CheckboxRoot = _react.forwardRef.call(void 0, function Checkbox({
303
303
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckboxLabel, { children: text })
304
304
  ] }) : _nullishCoalesce(children, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckboxIndicator, {})));
305
305
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckboxProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
306
- _chunkTGMVEHV7cjs.PressableFeedback,
306
+ _chunk3E7CDKFOcjs.PressableFeedback,
307
307
  {
308
308
  ref,
309
309
  isPressed,