@xaui/native 0.0.26 → 0.0.28

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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -228
  3. package/dist/alert/index.cjs +92 -166
  4. package/dist/alert/index.js +2 -1
  5. package/dist/app-bar/index.cjs +24 -98
  6. package/dist/app-bar/index.js +2 -1
  7. package/dist/autocomplete/index.cjs +192 -281
  8. package/dist/autocomplete/index.js +36 -48
  9. package/dist/avatar/index.cjs +59 -133
  10. package/dist/avatar/index.js +2 -1
  11. package/dist/badge/index.cjs +26 -99
  12. package/dist/badge/index.js +2 -1
  13. package/dist/bottom-sheet/index.cjs +5 -456
  14. package/dist/bottom-sheet/index.js +4 -363
  15. package/dist/bottom-tab-bar/index.cjs +93 -167
  16. package/dist/bottom-tab-bar/index.js +2 -2
  17. package/dist/button/index.cjs +73 -525
  18. package/dist/button/index.js +3 -2
  19. package/dist/card/index.cjs +76 -169
  20. package/dist/card/index.js +2 -2
  21. package/dist/carousel/index.cjs +68 -145
  22. package/dist/carousel/index.js +1 -1
  23. package/dist/chart/index.cjs +132 -173
  24. package/dist/checkbox/index.cjs +70 -143
  25. package/dist/checkbox/index.js +2 -1
  26. package/dist/chip/index.cjs +89 -164
  27. package/dist/chip/index.js +2 -1
  28. package/dist/chunk-BD72HIPR.cjs +75 -0
  29. package/dist/chunk-DHSTKO3K.cjs +19 -0
  30. package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
  31. package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
  32. package/dist/chunk-GBHQCAKW.js +19 -0
  33. package/dist/chunk-HC2SSHNU.js +368 -0
  34. package/dist/chunk-HSPTLUFA.cjs +7 -0
  35. package/dist/chunk-JEGEPGVU.js +287 -0
  36. package/dist/chunk-KTLGDLCB.cjs +287 -0
  37. package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
  38. package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
  39. package/dist/chunk-OQ2BLOOG.cjs +138 -0
  40. package/dist/chunk-QMYWIWSX.cjs +384 -0
  41. package/dist/chunk-XFPPR2VB.cjs +368 -0
  42. package/dist/core/index.cjs +22 -168
  43. package/dist/core/index.d.cts +1 -1
  44. package/dist/core/index.d.ts +1 -1
  45. package/dist/core/index.js +5 -3
  46. package/dist/datepicker/index.cjs +239 -320
  47. package/dist/datepicker/index.js +2 -1
  48. package/dist/divider/index.cjs +5 -145
  49. package/dist/divider/index.js +3 -2
  50. package/dist/drawer/index.cjs +39 -112
  51. package/dist/drawer/index.js +2 -1
  52. package/dist/expansion-panel/index.cjs +91 -230
  53. package/dist/expansion-panel/index.js +3 -2
  54. package/dist/fab/index.cjs +6 -722
  55. package/dist/fab/index.js +4 -3
  56. package/dist/fab-menu/index.cjs +81 -814
  57. package/dist/fab-menu/index.js +4 -3
  58. package/dist/feature-discovery/index.cjs +72 -139
  59. package/dist/feature-discovery/index.js +2 -2
  60. package/dist/index.cjs +1 -18
  61. package/dist/indicator/index.cjs +5 -445
  62. package/dist/indicator/index.js +3 -2
  63. package/dist/input/index.cjs +214 -282
  64. package/dist/input/index.js +2 -2
  65. package/dist/list/index.cjs +71 -146
  66. package/dist/list/index.js +2 -1
  67. package/dist/menu/index.cjs +59 -127
  68. package/dist/menu/index.js +2 -2
  69. package/dist/menubox/index.cjs +60 -132
  70. package/dist/menubox/index.js +2 -1
  71. package/dist/pager/index.cjs +42 -80
  72. package/dist/progress/index.cjs +43 -114
  73. package/dist/progress/index.js +2 -1
  74. package/dist/radio/index.cjs +82 -154
  75. package/dist/radio/index.js +2 -1
  76. package/dist/segment-button/index.cjs +60 -147
  77. package/dist/segment-button/index.js +2 -2
  78. package/dist/select/index.cjs +149 -224
  79. package/dist/select/index.js +10 -22
  80. package/dist/skeleton/index.cjs +23 -94
  81. package/dist/skeleton/index.js +2 -2
  82. package/dist/slider/index.cjs +77 -156
  83. package/dist/slider/index.js +2 -1
  84. package/dist/snackbar/index.cjs +420 -0
  85. package/dist/snackbar/index.d.cts +175 -0
  86. package/dist/snackbar/index.d.ts +175 -0
  87. package/dist/snackbar/index.js +420 -0
  88. package/dist/stepper/index.cjs +121 -195
  89. package/dist/stepper/index.js +2 -1
  90. package/dist/switch/index.cjs +48 -121
  91. package/dist/switch/index.js +2 -1
  92. package/dist/tabs/index.cjs +67 -151
  93. package/dist/tabs/index.js +2 -1
  94. package/dist/timepicker/index.cjs +135 -593
  95. package/dist/timepicker/index.js +24 -383
  96. package/dist/toolbar/index.cjs +59 -128
  97. package/dist/toolbar/index.js +2 -1
  98. package/dist/typography/index.cjs +37 -92
  99. package/dist/typography/index.d.cts +1 -1
  100. package/dist/typography/index.d.ts +1 -1
  101. package/dist/typography/index.js +20 -1
  102. package/dist/view/index.cjs +178 -223
  103. package/package.json +7 -1
  104. package/dist/chunk-3XSXTM3G.js +0 -661
  105. package/dist/chunk-4KSZLONZ.js +0 -79
  106. package/dist/chunk-I4V5Y5GD.js +0 -76
  107. package/dist/chunk-URBEEDFX.js +0 -79
@@ -1,102 +1,40 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/components/select/index.ts
31
- var select_exports = {};
32
- __export(select_exports, {
33
- Select: () => Select,
34
- SelectItem: () => SelectItem
35
- });
36
- module.exports = __toCommonJS(select_exports);
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 _chunkDHSTKO3Kcjs = require('../chunk-DHSTKO3K.cjs');
4
+ require('../chunk-HSPTLUFA.cjs');
5
+
6
+
7
+ var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
37
8
 
38
9
  // src/components/select/select.tsx
39
- var import_react12 = __toESM(require("react"), 1);
40
- var import_react_native8 = require("react-native");
10
+ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
11
+
12
+
41
13
 
42
- // src/components/select/select-context.ts
43
- var import_react = require("react");
44
- var SelectContext = (0, import_react.createContext)(null);
45
14
 
46
- // src/components/select/select.hook.ts
47
- var import_react7 = require("react");
48
- var import_core = require("@xaui/core");
49
- var import_palette2 = require("@xaui/core/palette");
50
-
51
- // src/core/theme-context.tsx
52
- var import_react5 = __toESM(require("react"), 1);
53
- var import_react_native2 = require("react-native");
54
- var import_theme = require("@xaui/core/theme");
55
- var import_palette = require("@xaui/core/palette");
56
-
57
- // src/core/portal/portal.tsx
58
- var import_react3 = require("react");
59
-
60
- // src/core/portal/portal-context.ts
61
- var import_react2 = require("react");
62
- var PortalContext = (0, import_react2.createContext)(null);
63
-
64
- // src/core/portal/portal-host.tsx
65
- var import_react4 = __toESM(require("react"), 1);
66
- var import_react_native = require("react-native");
67
- var hostStyles = import_react_native.StyleSheet.create({
68
- container: {
69
- flex: 1
70
- }
71
- });
72
15
 
73
- // src/core/theme-context.tsx
74
- var XUIThemeContext = (0, import_react5.createContext)(null);
75
16
 
76
- // src/core/theme-hooks.ts
77
- var import_react6 = require("react");
78
- var import_react_native3 = require("react-native");
79
- function useXUITheme() {
80
- const theme = (0, import_react6.useContext)(XUIThemeContext);
81
- if (!theme) {
82
- throw new Error("useXUITheme must be used within XUIProvider");
83
- }
84
- return theme;
85
- }
86
17
 
87
- // src/core/index.ts
88
- var import_theme2 = require("@xaui/core/theme");
18
+
19
+ var _reactnative = require('react-native');
20
+
21
+ // src/components/select/select-context.ts
22
+
23
+ var SelectContext = _react.createContext.call(void 0, null);
89
24
 
90
25
  // src/components/select/select.hook.ts
26
+
27
+ var _core = require('@xaui/core');
28
+ var _palette = require('@xaui/core/palette');
91
29
  var useSelectColorScheme = (themeColor) => {
92
- const theme = useXUITheme();
93
- const safeThemeColor = (0, import_core.getSafeThemeColor)(themeColor);
30
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
31
+ const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
94
32
  const colorScheme = theme.colors[safeThemeColor];
95
33
  return { theme, colorScheme };
96
34
  };
97
35
  var useSelectSizeStyles = (size) => {
98
- const theme = useXUITheme();
99
- return (0, import_react7.useMemo)(() => {
36
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
37
+ return _react.useMemo.call(void 0, () => {
100
38
  const sizes = {
101
39
  xs: {
102
40
  minHeight: 34,
@@ -131,8 +69,8 @@ var useSelectSizeStyles = (size) => {
131
69
  }, [size, theme]);
132
70
  };
133
71
  var useSelectRadiusStyles = (radius) => {
134
- const theme = useXUITheme();
135
- const radiusStyles = (0, import_react7.useMemo)(() => {
72
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
73
+ const radiusStyles = _react.useMemo.call(void 0, () => {
136
74
  const radii = {
137
75
  none: theme.borderRadius.none,
138
76
  sm: theme.borderRadius.sm,
@@ -142,7 +80,7 @@ var useSelectRadiusStyles = (radius) => {
142
80
  };
143
81
  return { borderRadius: radii[radius] };
144
82
  }, [radius, theme]);
145
- const listboxRadius = (0, import_react7.useMemo)(() => {
83
+ const listboxRadius = _react.useMemo.call(void 0, () => {
146
84
  const radii = {
147
85
  none: theme.borderRadius.none,
148
86
  sm: theme.borderRadius.sm,
@@ -156,10 +94,10 @@ var useSelectRadiusStyles = (radius) => {
156
94
  };
157
95
  var useSelectVariantStyles = (themeColor, variant, isInvalid) => {
158
96
  const { theme, colorScheme } = useSelectColorScheme(themeColor);
159
- return (0, import_react7.useMemo)(() => {
97
+ return _react.useMemo.call(void 0, () => {
160
98
  let borderColor = isInvalid ? theme.colors.danger.main : colorScheme.main;
161
99
  if ((variant === "outlined" || variant === "faded") && themeColor === "default") {
162
- borderColor = import_palette2.colors.gray[300];
100
+ borderColor = _palette.colors.gray[300];
163
101
  }
164
102
  const styles3 = {
165
103
  outlined: {
@@ -191,7 +129,7 @@ var useSelectVariantStyles = (themeColor, variant, isInvalid) => {
191
129
  };
192
130
  var useSelectLabelStyle = (themeColor, isInvalid, labelSize) => {
193
131
  const { theme, colorScheme } = useSelectColorScheme(themeColor);
194
- return (0, import_react7.useMemo)(() => {
132
+ return _react.useMemo.call(void 0, () => {
195
133
  let baseColor = theme.colors.foreground;
196
134
  if (isInvalid) {
197
135
  baseColor = theme.colors.danger.main;
@@ -205,42 +143,42 @@ var useSelectLabelStyle = (themeColor, isInvalid, labelSize) => {
205
143
  }, [isInvalid, labelSize, theme, themeColor, colorScheme]);
206
144
  };
207
145
  var useSelectValueColor = (isInvalid, shouldShowPlaceholder) => {
208
- const theme = useXUITheme();
209
- return (0, import_react7.useMemo)(() => {
146
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
147
+ return _react.useMemo.call(void 0, () => {
210
148
  if (isInvalid) {
211
149
  return theme.colors.danger.main;
212
150
  }
213
151
  if (shouldShowPlaceholder) {
214
- return import_palette2.colors.gray[500];
152
+ return _palette.colors.gray[500];
215
153
  }
216
154
  return theme.colors.foreground;
217
155
  }, [isInvalid, shouldShowPlaceholder, theme]);
218
156
  };
219
157
  var useSelectHelperColor = (isInvalid) => {
220
- const theme = useXUITheme();
221
- return (0, import_react7.useMemo)(() => {
158
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
159
+ return _react.useMemo.call(void 0, () => {
222
160
  if (isInvalid) {
223
161
  return theme.colors.danger.main;
224
162
  }
225
- return import_palette2.colors.gray[600];
163
+ return _palette.colors.gray[600];
226
164
  }, [isInvalid, theme]);
227
165
  };
228
166
  var useSelectSelectorColor = (isInvalid, shouldShowPlaceholder) => {
229
- const theme = useXUITheme();
230
- return (0, import_react7.useMemo)(() => {
167
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
168
+ return _react.useMemo.call(void 0, () => {
231
169
  if (isInvalid) {
232
170
  return theme.colors.danger.main;
233
171
  }
234
172
  if (shouldShowPlaceholder) {
235
- return import_palette2.colors.gray[600];
173
+ return _palette.colors.gray[600];
236
174
  }
237
175
  return theme.colors.foreground;
238
176
  }, [isInvalid, shouldShowPlaceholder, theme]);
239
177
  };
240
178
 
241
179
  // src/components/select/select.style.ts
242
- var import_react_native4 = require("react-native");
243
- var styles = import_react_native4.StyleSheet.create({
180
+
181
+ var styles = _reactnative.StyleSheet.create({
244
182
  container: {
245
183
  gap: 6
246
184
  },
@@ -319,21 +257,25 @@ var styles = import_react_native4.StyleSheet.create({
319
257
  });
320
258
 
321
259
  // src/components/select/select-trigger.tsx
322
- var import_react9 = __toESM(require("react"), 1);
323
- var import_react_native6 = require("react-native");
260
+
261
+
262
+
263
+
264
+
265
+
324
266
 
325
267
  // src/components/select/chevron-down-icon.tsx
326
- var import_react8 = __toESM(require("react"), 1);
327
- var import_react_native5 = require("react-native");
328
- var import_react_native_svg = __toESM(require("react-native-svg"), 1);
268
+
269
+
270
+ var _reactnativesvg = require('react-native-svg'); var _reactnativesvg2 = _interopRequireDefault(_reactnativesvg);
329
271
  function ChevronDownIcon({
330
272
  color,
331
273
  size,
332
274
  isOpen = false
333
275
  }) {
334
- const rotation = (0, import_react8.useRef)(new import_react_native5.Animated.Value(isOpen ? 1 : 0)).current;
335
- (0, import_react8.useEffect)(() => {
336
- import_react_native5.Animated.timing(rotation, {
276
+ const rotation = _react.useRef.call(void 0, new _reactnative.Animated.Value(isOpen ? 1 : 0)).current;
277
+ _react.useEffect.call(void 0, () => {
278
+ _reactnative.Animated.timing(rotation, {
337
279
  toValue: isOpen ? 1 : 0,
338
280
  duration: 180,
339
281
  useNativeDriver: true
@@ -343,8 +285,8 @@ function ChevronDownIcon({
343
285
  inputRange: [0, 1],
344
286
  outputRange: ["0deg", "180deg"]
345
287
  });
346
- return /* @__PURE__ */ import_react8.default.createElement(import_react_native5.Animated.View, { style: { transform: [{ rotate }] } }, /* @__PURE__ */ import_react8.default.createElement(import_react_native_svg.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ import_react8.default.createElement(
347
- import_react_native_svg.Path,
288
+ return /* @__PURE__ */ _react2.default.createElement(_reactnative.Animated.View, { style: { transform: [{ rotate }] } }, /* @__PURE__ */ _react2.default.createElement(_reactnativesvg2.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ _react2.default.createElement(
289
+ _reactnativesvg.Path,
348
290
  {
349
291
  d: "M6 9L12 15L18 9",
350
292
  stroke: color,
@@ -380,9 +322,9 @@ var SelectTrigger = ({
380
322
  textStyle,
381
323
  style
382
324
  }) => {
383
- const renderSelectorIcon = selectorIcon ?? /* @__PURE__ */ import_react9.default.createElement(ChevronDownIcon, { color: selectorColor, size: 16, isOpen });
384
- return /* @__PURE__ */ import_react9.default.createElement(import_react_native6.View, { ref: triggerRef, collapsable: false }, /* @__PURE__ */ import_react9.default.createElement(
385
- import_react_native6.Pressable,
325
+ const renderSelectorIcon = _nullishCoalesce(selectorIcon, () => ( /* @__PURE__ */ _react2.default.createElement(ChevronDownIcon, { color: selectorColor, size: 16, isOpen })));
326
+ return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { ref: triggerRef, collapsable: false }, /* @__PURE__ */ _react2.default.createElement(
327
+ _reactnative.Pressable,
386
328
  {
387
329
  onPress,
388
330
  disabled: isDisabled,
@@ -403,14 +345,14 @@ var SelectTrigger = ({
403
345
  style
404
346
  ]
405
347
  },
406
- /* @__PURE__ */ import_react9.default.createElement(
407
- import_react_native6.View,
348
+ /* @__PURE__ */ _react2.default.createElement(
349
+ _reactnative.View,
408
350
  {
409
351
  style: [styles.triggerContent, labelInside && styles.triggerContentColumn]
410
352
  },
411
353
  startContent,
412
- /* @__PURE__ */ import_react9.default.createElement(import_react_native6.View, { style: styles.valueWrapper }, labelInside && labelNode, /* @__PURE__ */ import_react9.default.createElement(
413
- import_react_native6.Text,
354
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.valueWrapper }, labelInside && labelNode, /* @__PURE__ */ _react2.default.createElement(
355
+ _reactnative.Text,
414
356
  {
415
357
  style: [
416
358
  styles.valueText,
@@ -422,29 +364,29 @@ var SelectTrigger = ({
422
364
  )),
423
365
  endContent
424
366
  ),
425
- /* @__PURE__ */ import_react9.default.createElement(import_react_native6.View, { style: styles.endSlot }, showClear && onClear && /* @__PURE__ */ import_react9.default.createElement(import_react_native6.Pressable, { onPress: onClear, style: styles.clearButton }, /* @__PURE__ */ import_react9.default.createElement(import_react_native6.Text, { style: [styles.clearText, { color: selectorColor }] }, "x")), renderSelectorIcon)
367
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.endSlot }, showClear && onClear && /* @__PURE__ */ _react2.default.createElement(_reactnative.Pressable, { onPress: onClear, style: styles.clearButton }, /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.clearText, { color: selectorColor }] }, "x")), renderSelectorIcon)
426
368
  ));
427
369
  };
428
370
 
429
371
  // src/components/select/select.animation.ts
430
- var import_react10 = require("react");
431
- var import_react_native7 = require("react-native");
372
+
373
+
432
374
  var useSelectListboxAnimation = (isOpen) => {
433
- const animationOpacity = (0, import_react10.useRef)(new import_react_native7.Animated.Value(0)).current;
434
- const animationScale = (0, import_react10.useRef)(new import_react_native7.Animated.Value(0.98)).current;
435
- (0, import_react10.useEffect)(() => {
375
+ const animationOpacity = _react.useRef.call(void 0, new _reactnative.Animated.Value(0)).current;
376
+ const animationScale = _react.useRef.call(void 0, new _reactnative.Animated.Value(0.98)).current;
377
+ _react.useEffect.call(void 0, () => {
436
378
  if (!isOpen) {
437
379
  return;
438
380
  }
439
381
  animationOpacity.setValue(0);
440
382
  animationScale.setValue(0.98);
441
- import_react_native7.Animated.parallel([
442
- import_react_native7.Animated.timing(animationOpacity, {
383
+ _reactnative.Animated.parallel([
384
+ _reactnative.Animated.timing(animationOpacity, {
443
385
  toValue: 1,
444
386
  duration: 180,
445
387
  useNativeDriver: true
446
388
  }),
447
- import_react_native7.Animated.timing(animationScale, {
389
+ _reactnative.Animated.timing(animationScale, {
448
390
  toValue: 1,
449
391
  duration: 180,
450
392
  useNativeDriver: true
@@ -455,16 +397,16 @@ var useSelectListboxAnimation = (isOpen) => {
455
397
  };
456
398
 
457
399
  // src/components/select/select.state.hook.ts
458
- var import_react11 = require("react");
400
+
459
401
  var useSelectOpenState = ({
460
402
  isOpened,
461
403
  isDisabled,
462
404
  onOpenChange,
463
405
  onClose
464
406
  }) => {
465
- const [internalOpen, setInternalOpen] = (0, import_react11.useState)(false);
466
- const isOpen = isOpened ?? internalOpen;
467
- const setOpen = (0, import_react11.useCallback)(
407
+ const [internalOpen, setInternalOpen] = _react.useState.call(void 0, false);
408
+ const isOpen = _nullishCoalesce(isOpened, () => ( internalOpen));
409
+ const setOpen = _react.useCallback.call(void 0,
468
410
  (nextOpen) => {
469
411
  if (nextOpen && isDisabled) {
470
412
  return;
@@ -472,9 +414,9 @@ var useSelectOpenState = ({
472
414
  if (isOpened === void 0) {
473
415
  setInternalOpen(nextOpen);
474
416
  }
475
- onOpenChange?.(nextOpen);
417
+ _optionalChain([onOpenChange, 'optionalCall', _ => _(nextOpen)]);
476
418
  if (!nextOpen) {
477
- onClose?.();
419
+ _optionalChain([onClose, 'optionalCall', _2 => _2()]);
478
420
  }
479
421
  },
480
422
  [isDisabled, isOpened, onOpenChange, onClose]
@@ -488,24 +430,24 @@ var useSelectSelection = ({
488
430
  onSelectionChange,
489
431
  onClear
490
432
  }) => {
491
- const [internalSelectedKeys, setInternalSelectedKeys] = (0, import_react11.useState)(
492
- defaultSelectedKeys ?? []
433
+ const [internalSelectedKeys, setInternalSelectedKeys] = _react.useState.call(void 0,
434
+ _nullishCoalesce(defaultSelectedKeys, () => ( []))
493
435
  );
494
436
  const isControlledSelection = selectedKeys !== void 0;
495
- const currentSelectedKeys = isControlledSelection ? selectedKeys ?? [] : internalSelectedKeys;
496
- const updateSelection = (0, import_react11.useCallback)(
437
+ const currentSelectedKeys = isControlledSelection ? _nullishCoalesce(selectedKeys, () => ( [])) : internalSelectedKeys;
438
+ const updateSelection = _react.useCallback.call(void 0,
497
439
  (nextKeys) => {
498
440
  if (!isControlledSelection) {
499
441
  setInternalSelectedKeys(nextKeys);
500
442
  }
501
- onSelectionChange?.(nextKeys);
443
+ _optionalChain([onSelectionChange, 'optionalCall', _3 => _3(nextKeys)]);
502
444
  if (nextKeys.length === 0) {
503
- onClear?.();
445
+ _optionalChain([onClear, 'optionalCall', _4 => _4()]);
504
446
  }
505
447
  },
506
448
  [isControlledSelection, onSelectionChange, onClear]
507
449
  );
508
- const getNextSelection = (0, import_react11.useCallback)(
450
+ const getNextSelection = _react.useCallback.call(void 0,
509
451
  (key) => {
510
452
  const isAlreadySelected = currentSelectedKeys.includes(key);
511
453
  if (selectionMode === "multiple") {
@@ -521,22 +463,22 @@ var useSelectSelection = ({
521
463
  return { currentSelectedKeys, updateSelection, getNextSelection };
522
464
  };
523
465
  var useSelectTriggerMeasurements = (isOpen) => {
524
- const triggerRef = (0, import_react11.useRef)(null);
525
- const [triggerWidth, setTriggerWidth] = (0, import_react11.useState)(null);
526
- const [triggerPosition, setTriggerPosition] = (0, import_react11.useState)(
466
+ const triggerRef = _react.useRef.call(void 0, null);
467
+ const [triggerWidth, setTriggerWidth] = _react.useState.call(void 0, null);
468
+ const [triggerPosition, setTriggerPosition] = _react.useState.call(void 0,
527
469
  null
528
470
  );
529
- const handleTriggerLayout = (0, import_react11.useCallback)((event) => {
471
+ const handleTriggerLayout = _react.useCallback.call(void 0, (event) => {
530
472
  setTriggerWidth(event.nativeEvent.layout.width);
531
473
  }, []);
532
- (0, import_react11.useEffect)(() => {
474
+ _react.useEffect.call(void 0, () => {
533
475
  if (!isOpen) {
534
476
  return;
535
477
  }
536
478
  const measureTrigger = () => {
537
- triggerRef.current?.measureInWindow((x, y, width, height) => {
479
+ _optionalChain([triggerRef, 'access', _5 => _5.current, 'optionalAccess', _6 => _6.measureInWindow, 'call', _7 => _7((x, y, width, height) => {
538
480
  setTriggerPosition({ x, y, width, height });
539
- });
481
+ })]);
540
482
  };
541
483
  const frameId = globalThis.setTimeout(measureTrigger, 0);
542
484
  return () => globalThis.clearTimeout(frameId);
@@ -598,17 +540,17 @@ var Select = ({
598
540
  });
599
541
  const { triggerRef, triggerWidth, triggerPosition, handleTriggerLayout } = useSelectTriggerMeasurements(isOpen);
600
542
  const { animationOpacity, animationScale } = useSelectListboxAnimation(isOpen);
601
- const disabledKeySet = (0, import_react12.useMemo)(() => {
602
- return new Set(disabledKeys ?? []);
543
+ const disabledKeySet = _react.useMemo.call(void 0, () => {
544
+ return new Set(_nullishCoalesce(disabledKeys, () => ( [])));
603
545
  }, [disabledKeys]);
604
- const items = (0, import_react12.useMemo)(() => {
605
- const elements = import_react12.default.Children.toArray(children).filter(Boolean);
546
+ const items = _react.useMemo.call(void 0, () => {
547
+ const elements = _react2.default.Children.toArray(children).filter(Boolean);
606
548
  return elements.map((child, index) => {
607
- if (!import_react12.default.isValidElement(child)) {
549
+ if (!_react2.default.isValidElement(child)) {
608
550
  return null;
609
551
  }
610
- const key = child.props.value ?? String(index);
611
- const labelText = getTextValue(child.props.label) ?? key;
552
+ const key = _nullishCoalesce(child.props.value, () => ( String(index)));
553
+ const labelText = _nullishCoalesce(getTextValue(child.props.label), () => ( key));
612
554
  return {
613
555
  key,
614
556
  element: child,
@@ -616,13 +558,13 @@ var Select = ({
616
558
  };
617
559
  }).filter((item) => item !== null);
618
560
  }, [children]);
619
- const selectedLabels = (0, import_react12.useMemo)(() => {
561
+ const selectedLabels = _react.useMemo.call(void 0, () => {
620
562
  const labelMap = new Map(items.map((item) => [item.key, item.labelText]));
621
563
  return currentSelectedKeys.map((key) => labelMap.get(key)).filter((value) => Boolean(value));
622
564
  }, [currentSelectedKeys, items]);
623
565
  const displayValue = selectedLabels.length ? selectedLabels.join(", ") : placeholder;
624
566
  const shouldShowPlaceholder = selectedLabels.length === 0;
625
- const theme = useXUITheme();
567
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
626
568
  const sizeStyles = useSelectSizeStyles(size);
627
569
  const { radiusStyles, listboxRadius } = useSelectRadiusStyles(radius);
628
570
  const variantStyles = useSelectVariantStyles(themeColor, variant, isInvalid);
@@ -630,7 +572,7 @@ var Select = ({
630
572
  const valueColor = useSelectValueColor(isInvalid, shouldShowPlaceholder);
631
573
  const helperColor = useSelectHelperColor(isInvalid);
632
574
  const selectorColor = useSelectSelectorColor(isInvalid, shouldShowPlaceholder);
633
- const handleItemSelection = (0, import_react12.useCallback)(
575
+ const handleItemSelection = _react.useCallback.call(void 0,
634
576
  (key) => {
635
577
  if (isDisabled) {
636
578
  return;
@@ -661,13 +603,13 @@ var Select = ({
661
603
  const handleOverlayPress = () => {
662
604
  setOpen(false);
663
605
  };
664
- const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ import_react12.default.createElement(import_react_native8.Text, { style: [styles.label, labelStyle] }, label) : /* @__PURE__ */ import_react12.default.createElement(import_react_native8.View, null, label) : null;
606
+ const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.label, labelStyle] }, label) : /* @__PURE__ */ _react2.default.createElement(_reactnative.View, null, label) : null;
665
607
  const dialogTitle = typeof label === "string" || typeof label === "number" ? String(label) : void 0;
666
608
  const shouldShowHelper = Boolean(hint || errorMessage);
667
609
  const helperContent = isInvalid && errorMessage ? errorMessage : hint;
668
- const listboxWidth = fullWidth ? triggerWidth ?? triggerPosition?.width ?? 200 : 280;
669
- const screenWidth = import_react_native8.Dimensions.get("window").width;
670
- const listboxPosition = (0, import_react12.useMemo)(() => {
610
+ const listboxWidth = fullWidth ? _nullishCoalesce(_nullishCoalesce(triggerWidth, () => ( _optionalChain([triggerPosition, 'optionalAccess', _8 => _8.width]))), () => ( 200)) : 280;
611
+ const screenWidth = _reactnative.Dimensions.get("window").width;
612
+ const listboxPosition = _react.useMemo.call(void 0, () => {
671
613
  if (!triggerPosition) {
672
614
  return { top: 0, left: 0 };
673
615
  }
@@ -680,15 +622,15 @@ var Select = ({
680
622
  const listItems = items.map((item) => {
681
623
  const itemProps = item.element.props;
682
624
  const itemDisabled = isDisabled || itemProps.isDisabled || disabledKeySet.has(item.key);
683
- const itemSelected = itemProps.isSelected ?? currentSelectedKeys.includes(item.key);
625
+ const itemSelected = _nullishCoalesce(itemProps.isSelected, () => ( currentSelectedKeys.includes(item.key)));
684
626
  const handleItemSelected = () => {
685
627
  if (itemDisabled || itemProps.isReadOnly) {
686
628
  return;
687
629
  }
688
630
  handleItemSelection(item.key);
689
- itemProps.onSelected?.();
631
+ _optionalChain([itemProps, 'access', _9 => _9.onSelected, 'optionalCall', _10 => _10()]);
690
632
  };
691
- return import_react12.default.cloneElement(item.element, {
633
+ return _react2.default.cloneElement(item.element, {
692
634
  key: item.key,
693
635
  isDisabled: itemDisabled,
694
636
  isSelected: itemSelected,
@@ -698,7 +640,7 @@ var Select = ({
698
640
  const isLabelInside = labelPlacement === "inside";
699
641
  const isLabelOutsideLeft = labelPlacement === "outside-left";
700
642
  const isLabelOutside = labelPlacement === "outside" || labelPlacement === "outside-top";
701
- const triggerContent = /* @__PURE__ */ import_react12.default.createElement(
643
+ const triggerContent = /* @__PURE__ */ _react2.default.createElement(
702
644
  SelectTrigger,
703
645
  {
704
646
  triggerRef,
@@ -726,16 +668,16 @@ var Select = ({
726
668
  }
727
669
  );
728
670
  const labelBlock = isLabelOutside || isLabelInside ? renderLabel : null;
729
- return /* @__PURE__ */ import_react12.default.createElement(import_react_native8.View, { style: [styles.container, fullWidth ? styles.fullWidth : styles.minWidth] }, isLabelOutside && labelBlock, isLabelOutsideLeft ? /* @__PURE__ */ import_react12.default.createElement(import_react_native8.View, { style: styles.outsideLeftRow }, renderLabel, triggerContent) : triggerContent, shouldShowHelper && helperContent ? typeof helperContent === "string" || typeof helperContent === "number" ? /* @__PURE__ */ import_react12.default.createElement(import_react_native8.Text, { style: [styles.helperText, { color: helperColor }] }, helperContent) : /* @__PURE__ */ import_react12.default.createElement(import_react_native8.View, null, helperContent) : null, /* @__PURE__ */ import_react12.default.createElement(
730
- import_react_native8.Modal,
671
+ return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.container, fullWidth ? styles.fullWidth : styles.minWidth] }, isLabelOutside && labelBlock, isLabelOutsideLeft ? /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.outsideLeftRow }, renderLabel, triggerContent) : triggerContent, shouldShowHelper && helperContent ? typeof helperContent === "string" || typeof helperContent === "number" ? /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [styles.helperText, { color: helperColor }] }, helperContent) : /* @__PURE__ */ _react2.default.createElement(_reactnative.View, null, helperContent) : null, /* @__PURE__ */ _react2.default.createElement(
672
+ _reactnative.Modal,
731
673
  {
732
674
  visible: isOpen,
733
675
  transparent: true,
734
676
  animationType: "fade",
735
677
  onRequestClose: handleOverlayPress
736
678
  },
737
- /* @__PURE__ */ import_react12.default.createElement(import_react_native8.Pressable, { style: styles.overlay, onPress: handleOverlayPress }, /* @__PURE__ */ import_react12.default.createElement(
738
- import_react_native8.Animated.View,
679
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.Pressable, { style: styles.overlay, onPress: handleOverlayPress }, /* @__PURE__ */ _react2.default.createElement(
680
+ _reactnative.Animated.View,
739
681
  {
740
682
  style: [
741
683
  styles.listbox,
@@ -753,14 +695,14 @@ var Select = ({
753
695
  }
754
696
  ]
755
697
  },
756
- /* @__PURE__ */ import_react12.default.createElement(
757
- import_react_native8.Pressable,
698
+ /* @__PURE__ */ _react2.default.createElement(
699
+ _reactnative.Pressable,
758
700
  {
759
701
  onPress: (event) => event.stopPropagation(),
760
702
  style: { flex: 1 }
761
703
  },
762
- /* @__PURE__ */ import_react12.default.createElement(SelectContext.Provider, { value: { size, themeColor, isDisabled } }, /* @__PURE__ */ import_react12.default.createElement(import_react_native8.View, { style: styles.listboxContent }, dialogTitle ? /* @__PURE__ */ import_react12.default.createElement(
763
- import_react_native8.Text,
704
+ /* @__PURE__ */ _react2.default.createElement(SelectContext.Provider, { value: { size, themeColor, isDisabled } }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.listboxContent }, dialogTitle ? /* @__PURE__ */ _react2.default.createElement(
705
+ _reactnative.Text,
764
706
  {
765
707
  style: [
766
708
  styles.dialogTitle,
@@ -768,38 +710,22 @@ var Select = ({
768
710
  ]
769
711
  },
770
712
  dialogTitle
771
- ) : null, /* @__PURE__ */ import_react12.default.createElement(import_react_native8.ScrollView, { style: { maxHeight: maxListboxHeight } }, listItems)))
713
+ ) : null, /* @__PURE__ */ _react2.default.createElement(_reactnative.ScrollView, { style: { maxHeight: maxListboxHeight } }, listItems)))
772
714
  )
773
715
  ))
774
716
  ));
775
717
  };
776
718
 
777
719
  // src/components/select/select-item.tsx
778
- var import_react15 = __toESM(require("react"), 1);
779
- var import_react_native10 = require("react-native");
780
-
781
- // src/components/select/checkmark-icon.tsx
782
- var import_react13 = __toESM(require("react"), 1);
783
- var import_react_native_svg2 = __toESM(require("react-native-svg"), 1);
784
- function CheckmarkIcon({ color, size }) {
785
- return /* @__PURE__ */ import_react13.default.createElement(import_react_native_svg2.default, { width: size, height: size, viewBox: "0 0 17 18", fill: "none" }, /* @__PURE__ */ import_react13.default.createElement(
786
- import_react_native_svg2.Polyline,
787
- {
788
- points: "1 9 7 14 15 4",
789
- stroke: color,
790
- strokeWidth: 2,
791
- strokeLinecap: "round",
792
- strokeLinejoin: "round"
793
- }
794
- ));
795
- }
720
+
721
+
796
722
 
797
723
  // src/components/select/select-item.hook.ts
798
- var import_react14 = require("react");
799
- var import_core4 = require("@xaui/core");
724
+
725
+
800
726
  var useSelectItemSizeStyles = (size) => {
801
- const theme = useXUITheme();
802
- return (0, import_react14.useMemo)(() => {
727
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
728
+ return _react.useMemo.call(void 0, () => {
803
729
  const sizes = {
804
730
  xs: {
805
731
  paddingVertical: theme.spacing.sm,
@@ -830,10 +756,10 @@ var useSelectItemSizeStyles = (size) => {
830
756
  }, [size, theme]);
831
757
  };
832
758
  var useSelectItemBackgroundColor = (themeColor, isSelected) => {
833
- const theme = useXUITheme();
834
- const safeThemeColor = (0, import_core4.getSafeThemeColor)(themeColor);
759
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
760
+ const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
835
761
  const colorScheme = theme.colors[safeThemeColor];
836
- return (0, import_react14.useMemo)(() => {
762
+ return _react.useMemo.call(void 0, () => {
837
763
  if (isSelected) {
838
764
  return colorScheme.background;
839
765
  }
@@ -841,8 +767,8 @@ var useSelectItemBackgroundColor = (themeColor, isSelected) => {
841
767
  }, [isSelected, colorScheme]);
842
768
  };
843
769
  var useSelectItemTextColors = () => {
844
- const theme = useXUITheme();
845
- return (0, import_react14.useMemo)(() => {
770
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
771
+ return _react.useMemo.call(void 0, () => {
846
772
  return {
847
773
  textColor: theme.colors.foreground,
848
774
  descriptionColor: theme.colors.foreground
@@ -850,10 +776,10 @@ var useSelectItemTextColors = () => {
850
776
  }, [theme]);
851
777
  };
852
778
  var useSelectItemCheckmarkColor = (themeColor) => {
853
- const theme = useXUITheme();
854
- const safeThemeColor = (0, import_core4.getSafeThemeColor)(themeColor);
779
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
780
+ const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
855
781
  const colorScheme = theme.colors[safeThemeColor];
856
- return (0, import_react14.useMemo)(() => {
782
+ return _react.useMemo.call(void 0, () => {
857
783
  if (themeColor === "default") {
858
784
  return theme.colors.primary.main;
859
785
  }
@@ -862,8 +788,8 @@ var useSelectItemCheckmarkColor = (themeColor) => {
862
788
  };
863
789
 
864
790
  // src/components/select/select-item.style.ts
865
- var import_react_native9 = require("react-native");
866
- var styles2 = import_react_native9.StyleSheet.create({
791
+
792
+ var styles2 = _reactnative.StyleSheet.create({
867
793
  item: {
868
794
  flexDirection: "row",
869
795
  alignItems: "center",
@@ -899,10 +825,10 @@ var SelectItem = ({
899
825
  textStyle,
900
826
  onSelected
901
827
  }) => {
902
- const context = (0, import_react15.useContext)(SelectContext);
903
- const size = context?.size ?? defaultSize;
904
- const themeColor = context?.themeColor ?? "default";
905
- const isItemDisabled = context?.isDisabled ? true : isDisabled;
828
+ const context = _react.useContext.call(void 0, SelectContext);
829
+ const size = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _11 => _11.size]), () => ( defaultSize));
830
+ const themeColor = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _12 => _12.themeColor]), () => ( "default"));
831
+ const isItemDisabled = _optionalChain([context, 'optionalAccess', _13 => _13.isDisabled]) ? true : isDisabled;
906
832
  const sizeStyles = useSelectItemSizeStyles(size);
907
833
  const backgroundColor = useSelectItemBackgroundColor(themeColor, isSelected);
908
834
  const { textColor, descriptionColor } = useSelectItemTextColors();
@@ -911,10 +837,10 @@ var SelectItem = ({
911
837
  if (isItemDisabled || isReadOnly) {
912
838
  return;
913
839
  }
914
- onSelected?.();
840
+ _optionalChain([onSelected, 'optionalCall', _14 => _14()]);
915
841
  };
916
- return /* @__PURE__ */ import_react15.default.createElement(
917
- import_react_native10.Pressable,
842
+ return /* @__PURE__ */ _react2.default.createElement(
843
+ _reactnative.Pressable,
918
844
  {
919
845
  onPress: handlePress,
920
846
  disabled: isItemDisabled,
@@ -930,8 +856,8 @@ var SelectItem = ({
930
856
  ]
931
857
  },
932
858
  startContent,
933
- /* @__PURE__ */ import_react15.default.createElement(import_react_native10.View, { style: styles2.content }, /* @__PURE__ */ import_react15.default.createElement(
934
- import_react_native10.Text,
859
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles2.content }, /* @__PURE__ */ _react2.default.createElement(
860
+ _reactnative.Text,
935
861
  {
936
862
  style: [
937
863
  styles2.title,
@@ -940,8 +866,8 @@ var SelectItem = ({
940
866
  ]
941
867
  },
942
868
  label
943
- ), description && /* @__PURE__ */ import_react15.default.createElement(
944
- import_react_native10.Text,
869
+ ), description && /* @__PURE__ */ _react2.default.createElement(
870
+ _reactnative.Text,
945
871
  {
946
872
  style: [
947
873
  styles2.description,
@@ -950,12 +876,11 @@ var SelectItem = ({
950
876
  },
951
877
  description
952
878
  )),
953
- isSelected && (selectedIcon || /* @__PURE__ */ import_react15.default.createElement(CheckmarkIcon, { color: checkmarkColor, size: 16 })),
879
+ isSelected && (selectedIcon || /* @__PURE__ */ _react2.default.createElement(_chunkDHSTKO3Kcjs.CheckmarkIcon, { color: checkmarkColor, size: 16 })),
954
880
  endContent
955
881
  );
956
882
  };
957
- // Annotate the CommonJS export names for ESM import in node:
958
- 0 && (module.exports = {
959
- Select,
960
- SelectItem
961
- });
883
+
884
+
885
+
886
+ exports.Select = Select; exports.SelectItem = SelectItem;