@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,49 +1,21 @@
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);
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; }
29
2
 
30
- // src/components/expansion-panel/index.ts
31
- var expansion_panel_exports = {};
32
- __export(expansion_panel_exports, {
33
- ExpansionPanel: () => ExpansionPanel,
34
- ExpansionPanelItem: () => ExpansionPanelItem
35
- });
36
- module.exports = __toCommonJS(expansion_panel_exports);
3
+ var _chunkBD72HIPRcjs = require('../chunk-BD72HIPR.cjs');
4
+ require('../chunk-HSPTLUFA.cjs');
5
+
6
+
7
+
8
+ var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
37
9
 
38
10
  // src/components/expansion-panel/expansion-panel.tsx
39
- var import_react14 = __toESM(require("react"), 1);
40
- var import_react_native9 = require("react-native");
11
+ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
12
+ var _reactnative = require('react-native');
41
13
 
42
14
  // src/components/expansion-panel/expansion-panel-context.ts
43
- var import_react = require("react");
44
- var ExpansionPanelContext = (0, import_react.createContext)(void 0);
15
+
16
+ var ExpansionPanelContext = _react.createContext.call(void 0, void 0);
45
17
  var useExpansionPanelContext = () => {
46
- const context = (0, import_react.useContext)(ExpansionPanelContext);
18
+ const context = _react.useContext.call(void 0, ExpansionPanelContext);
47
19
  if (!context) {
48
20
  throw new Error(
49
21
  "ExpansionPanelItem must be used within an ExpansionPanel component"
@@ -53,59 +25,14 @@ var useExpansionPanelContext = () => {
53
25
  };
54
26
 
55
27
  // src/components/expansion-panel/expansion-panel.hook.ts
56
- var import_react7 = require("react");
57
-
58
- // src/core/theme-context.tsx
59
- var import_react5 = __toESM(require("react"), 1);
60
- var import_react_native2 = require("react-native");
61
- var import_theme = require("@xaui/core/theme");
62
- var import_palette = require("@xaui/core/palette");
63
-
64
- // src/core/portal/portal.tsx
65
- var import_react3 = require("react");
66
-
67
- // src/core/portal/portal-context.ts
68
- var import_react2 = require("react");
69
- var PortalContext = (0, import_react2.createContext)(null);
70
28
 
71
- // src/core/portal/portal-host.tsx
72
- var import_react4 = __toESM(require("react"), 1);
73
- var import_react_native = require("react-native");
74
- var hostStyles = import_react_native.StyleSheet.create({
75
- container: {
76
- flex: 1
77
- }
78
- });
79
-
80
- // src/core/theme-context.tsx
81
- var XUIThemeContext = (0, import_react5.createContext)(null);
82
-
83
- // src/core/theme-hooks.ts
84
- var import_react6 = require("react");
85
- var import_react_native3 = require("react-native");
86
- function useXUITheme() {
87
- const theme = (0, import_react6.useContext)(XUIThemeContext);
88
- if (!theme) {
89
- throw new Error("useXUITheme must be used within XUIProvider");
90
- }
91
- return theme;
92
- }
93
- function useXUIPalette() {
94
- const theme = useXUITheme();
95
- return (0, import_react6.useMemo)(() => theme.palette, [theme]);
96
- }
97
-
98
- // src/core/index.ts
99
- var import_theme2 = require("@xaui/core/theme");
100
-
101
- // src/components/expansion-panel/expansion-panel.hook.ts
102
29
  var useExpansionPanelStyles = ({
103
30
  variant,
104
31
  fullWidth
105
32
  }) => {
106
- const theme = useXUITheme();
107
- const palette2 = useXUIPalette();
108
- const containerStyles = (0, import_react7.useMemo)(() => {
33
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
34
+ const palette2 = _chunkOQ2BLOOGcjs.useXUIPalette.call(void 0, );
35
+ const containerStyles = _react.useMemo.call(void 0, () => {
109
36
  const base = {};
110
37
  if (fullWidth) {
111
38
  base.width = "100%";
@@ -129,17 +56,17 @@ var useExpansionPanelSelection = ({
129
56
  defaultExpandedKeys,
130
57
  onSelectionChange
131
58
  }) => {
132
- const [internalExpandedKeys, setInternalExpandedKeys] = (0, import_react7.useState)(defaultExpandedKeys);
59
+ const [internalExpandedKeys, setInternalExpandedKeys] = _react.useState.call(void 0, defaultExpandedKeys);
133
60
  const isControlled = expandedKeys !== void 0;
134
61
  const currentExpandedKeys = isControlled ? expandedKeys : internalExpandedKeys;
135
- const toggleItem = (0, import_react7.useCallback)(
62
+ const toggleItem = _react.useCallback.call(void 0,
136
63
  (key) => {
137
64
  const isExpanded = currentExpandedKeys.includes(key);
138
65
  const newExpandedKeys = selectionMode === "toggle" ? isExpanded ? [] : [key] : isExpanded ? currentExpandedKeys.filter((k) => k !== key) : [...currentExpandedKeys, key];
139
66
  if (!isControlled) {
140
67
  setInternalExpandedKeys(newExpandedKeys);
141
68
  }
142
- onSelectionChange?.(newExpandedKeys);
69
+ _optionalChain([onSelectionChange, 'optionalCall', _ => _(newExpandedKeys)]);
143
70
  },
144
71
  [selectionMode, currentExpandedKeys, isControlled, onSelectionChange]
145
72
  );
@@ -152,7 +79,7 @@ var useExpansionPanelContextValue = (config) => {
152
79
  defaultExpandedKeys: config.defaultExpandedKeys,
153
80
  onSelectionChange: config.onSelectionChange
154
81
  });
155
- return (0, import_react7.useMemo)(
82
+ return _react.useMemo.call(void 0,
156
83
  () => ({
157
84
  variant: config.variant,
158
85
  hideIndicator: config.hideIndicator,
@@ -177,12 +104,12 @@ var useExpansionPanelContextValue = (config) => {
177
104
  };
178
105
 
179
106
  // src/components/expansion-panel/expansion-panel-item.tsx
180
- var import_react10 = __toESM(require("react"), 1);
181
- var import_react_native6 = require("react-native");
107
+
108
+
182
109
 
183
110
  // src/components/expansion-panel/expansion-panel-item.style.ts
184
- var import_react_native4 = require("react-native");
185
- var styles = import_react_native4.StyleSheet.create({
111
+
112
+ var styles = _reactnative.StyleSheet.create({
186
113
  startContent: {
187
114
  flexShrink: 0
188
115
  },
@@ -205,62 +132,65 @@ var styles = import_react_native4.StyleSheet.create({
205
132
  });
206
133
 
207
134
  // src/components/expansion-panel/expansion-panel-item.hook.ts
208
- var import_react8 = require("react");
209
- var import_react_native5 = require("react-native");
210
- var import_palette2 = require("@xaui/core/palette");
211
- var import_core3 = require("@xaui/core");
135
+
136
+
137
+
138
+
139
+
140
+ var _palette = require('@xaui/core/palette');
141
+ var _core = require('@xaui/core');
212
142
  var useExpansionPanelItemState = (itemKey) => {
213
143
  const context = useExpansionPanelContext();
214
- const resolvedItemKey = itemKey ?? "";
144
+ const resolvedItemKey = _nullishCoalesce(itemKey, () => ( ""));
215
145
  const isExpanded = resolvedItemKey ? context.expandedKeys.includes(resolvedItemKey) : false;
216
146
  const isDisabled = resolvedItemKey ? context.disabledKeys.includes(resolvedItemKey) : false;
217
- const handlePress = (0, import_react8.useCallback)(() => {
147
+ const handlePress = _react.useCallback.call(void 0, () => {
218
148
  if (isDisabled || !resolvedItemKey) return;
219
149
  context.toggleItem(resolvedItemKey);
220
150
  }, [isDisabled, resolvedItemKey, context]);
221
151
  return { ...context, resolvedItemKey, isExpanded, isDisabled, handlePress };
222
152
  };
223
153
  var useExpansionPanelItemAnimation = (isExpanded, disableAnimation) => {
224
- const [contentHeight, setContentHeight] = (0, import_react8.useState)(0);
225
- const [isMeasured, setIsMeasured] = (0, import_react8.useState)(false);
226
- const animatedHeight = (0, import_react8.useRef)(new import_react_native5.Animated.Value(isExpanded ? 1 : 0)).current;
227
- const animatedRotation = (0, import_react8.useRef)(new import_react_native5.Animated.Value(isExpanded ? 1 : 0)).current;
228
- const prevContentHeight = (0, import_react8.useRef)(contentHeight);
229
- (0, import_react8.useEffect)(() => {
154
+ const [contentHeight, setContentHeight] = _react.useState.call(void 0, 0);
155
+ const [isMeasured, setIsMeasured] = _react.useState.call(void 0, false);
156
+ const animatedHeight = _react.useRef.call(void 0, new _reactnative.Animated.Value(isExpanded ? 1 : 0)).current;
157
+ const animatedRotation = _react.useRef.call(void 0, new _reactnative.Animated.Value(isExpanded ? 1 : 0)).current;
158
+ const prevContentHeight = _react.useRef.call(void 0, contentHeight);
159
+ _react.useEffect.call(void 0, () => {
230
160
  if (disableAnimation) {
231
161
  animatedHeight.setValue(isExpanded ? 1 : 0);
232
162
  animatedRotation.setValue(isExpanded ? 1 : 0);
233
163
  return;
234
164
  }
235
- import_react_native5.Animated.parallel([
236
- import_react_native5.Animated.timing(animatedHeight, {
165
+ _reactnative.Animated.parallel([
166
+ _reactnative.Animated.timing(animatedHeight, {
237
167
  toValue: isExpanded ? 1 : 0,
238
168
  duration: 300,
239
- easing: import_react_native5.Easing.bezier(0.4, 0, 0.2, 1),
169
+ easing: _reactnative.Easing.bezier(0.4, 0, 0.2, 1),
240
170
  useNativeDriver: false
241
171
  }),
242
- import_react_native5.Animated.timing(animatedRotation, {
172
+ _reactnative.Animated.timing(animatedRotation, {
243
173
  toValue: isExpanded ? 1 : 0,
244
174
  duration: 300,
245
- easing: import_react_native5.Easing.bezier(0.4, 0, 0.2, 1),
175
+ easing: _reactnative.Easing.bezier(0.4, 0, 0.2, 1),
246
176
  useNativeDriver: true
247
177
  })
248
178
  ]).start();
249
179
  }, [isExpanded, disableAnimation, animatedHeight, animatedRotation]);
250
- (0, import_react8.useEffect)(() => {
180
+ _react.useEffect.call(void 0, () => {
251
181
  if (contentHeight <= 0 || contentHeight === prevContentHeight.current || !isExpanded)
252
182
  return;
253
183
  prevContentHeight.current = contentHeight;
254
184
  if (!disableAnimation && isMeasured) {
255
- import_react_native5.Animated.timing(animatedHeight, {
185
+ _reactnative.Animated.timing(animatedHeight, {
256
186
  toValue: 1,
257
187
  duration: 200,
258
- easing: import_react_native5.Easing.out(import_react_native5.Easing.ease),
188
+ easing: _reactnative.Easing.out(_reactnative.Easing.ease),
259
189
  useNativeDriver: false
260
190
  }).start();
261
191
  }
262
192
  }, [contentHeight, isExpanded, disableAnimation, isMeasured, animatedHeight]);
263
- const onContentLayout = (0, import_react8.useCallback)((event) => {
193
+ const onContentLayout = _react.useCallback.call(void 0, (event) => {
264
194
  const height = event.nativeEvent.layout.height;
265
195
  if (height > 0) {
266
196
  setContentHeight(height);
@@ -283,12 +213,12 @@ var useExpansionPanelItemAnimation = (isExpanded, disableAnimation) => {
283
213
  };
284
214
  };
285
215
  var useBaseStyles = (variant, isDisabled) => {
286
- const theme = useXUITheme();
287
- const baseStyles = (0, import_react8.useMemo)(() => {
216
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
217
+ const baseStyles = _react.useMemo.call(void 0, () => {
288
218
  const base = { overflow: "hidden" };
289
219
  if (variant === "splitted") {
290
220
  base.paddingHorizontal = theme.spacing.md;
291
- base.backgroundColor = (0, import_core3.withOpacity)(theme.colors.default.background, 0.5);
221
+ base.backgroundColor = _core.withOpacity.call(void 0, theme.colors.default.background, 0.5);
292
222
  base.borderRadius = theme.borderRadius.md;
293
223
  base.marginBottom = theme.spacing.xs;
294
224
  } else if (variant === "bordered") {
@@ -302,8 +232,8 @@ var useBaseStyles = (variant, isDisabled) => {
302
232
  return baseStyles;
303
233
  };
304
234
  var useTriggerStyles = (variant, isCompact) => {
305
- const theme = useXUITheme();
306
- const triggerStyles = (0, import_react8.useMemo)(() => {
235
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
236
+ const triggerStyles = _react.useMemo.call(void 0, () => {
307
237
  const trigger = {
308
238
  flexDirection: "row",
309
239
  alignItems: "center",
@@ -318,8 +248,8 @@ var useTriggerStyles = (variant, isCompact) => {
318
248
  return triggerStyles;
319
249
  };
320
250
  var useTitleTextStyle = (isCompact) => {
321
- const theme = useXUITheme();
322
- const titleTextStyle = (0, import_react8.useMemo)(
251
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
252
+ const titleTextStyle = _react.useMemo.call(void 0,
323
253
  () => ({
324
254
  fontSize: isCompact ? theme.fontSizes.md : theme.fontSizes.lg,
325
255
  fontWeight: theme.fontWeights.medium,
@@ -330,11 +260,11 @@ var useTitleTextStyle = (isCompact) => {
330
260
  return titleTextStyle;
331
261
  };
332
262
  var useSubtitleTextStyle = () => {
333
- const theme = useXUITheme();
334
- const subtitleTextStyle = (0, import_react8.useMemo)(
263
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
264
+ const subtitleTextStyle = _react.useMemo.call(void 0,
335
265
  () => ({
336
266
  fontSize: theme.fontSizes.sm,
337
- color: import_palette2.colors.gray[500],
267
+ color: _palette.colors.gray[500],
338
268
  marginTop: theme.spacing.xs
339
269
  }),
340
270
  [theme]
@@ -342,8 +272,8 @@ var useSubtitleTextStyle = () => {
342
272
  return subtitleTextStyle;
343
273
  };
344
274
  var useContentContainerStyle = (isCompact, variant) => {
345
- const theme = useXUITheme();
346
- const contentContainerStyle = (0, import_react8.useMemo)(
275
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
276
+ const contentContainerStyle = _react.useMemo.call(void 0,
347
277
  () => ({
348
278
  paddingBottom: isCompact ? theme.spacing.xs : theme.spacing.sm,
349
279
  paddingHorizontal: variant === "light" ? theme.spacing.sm : 0
@@ -353,19 +283,19 @@ var useContentContainerStyle = (isCompact, variant) => {
353
283
  return contentContainerStyle;
354
284
  };
355
285
  var useForegroundColor = () => {
356
- const theme = useXUITheme();
286
+ const theme = _chunkOQ2BLOOGcjs.useXUITheme.call(void 0, );
357
287
  return theme.colors.foreground;
358
288
  };
359
289
 
360
290
  // src/components/expansion-panel/chevron-right-icon.tsx
361
- var import_react9 = __toESM(require("react"), 1);
362
- var import_react_native_svg = __toESM(require("react-native-svg"), 1);
291
+
292
+ var _reactnativesvg = require('react-native-svg'); var _reactnativesvg2 = _interopRequireDefault(_reactnativesvg);
363
293
  var ChevronRightIcon = ({
364
294
  color = "#000",
365
295
  size = 20
366
296
  }) => {
367
- return /* @__PURE__ */ import_react9.default.createElement(import_react_native_svg.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ import_react9.default.createElement(
368
- import_react_native_svg.Path,
297
+ return /* @__PURE__ */ _react2.default.createElement(_reactnativesvg2.default, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ _react2.default.createElement(
298
+ _reactnativesvg.Path,
369
299
  {
370
300
  d: "M9 18l6-6-6-6",
371
301
  stroke: color,
@@ -398,7 +328,7 @@ var ExpansionPanelItem = ({
398
328
  } = useExpansionPanelItemState(itemKey);
399
329
  const handlePress = () => {
400
330
  togglePress();
401
- onSelected?.(!isExpanded);
331
+ _optionalChain([onSelected, 'optionalCall', _2 => _2(!isExpanded)]);
402
332
  };
403
333
  const { onContentLayout, heightInterpolation, rotationInterpolation } = useExpansionPanelItemAnimation(isExpanded, disableAnimation);
404
334
  const baseStyles = useBaseStyles(variant, isDisabled);
@@ -407,50 +337,50 @@ var ExpansionPanelItem = ({
407
337
  const subtitleTextStyle = useSubtitleTextStyle();
408
338
  const contentContainerStyle = useContentContainerStyle(isCompact, variant);
409
339
  const foregroundColor = useForegroundColor();
410
- return /* @__PURE__ */ import_react10.default.createElement(import_react_native6.View, { style: [baseStyles, customAppearance?.base] }, /* @__PURE__ */ import_react10.default.createElement(import_react_native6.View, { style: customAppearance?.heading }, /* @__PURE__ */ import_react10.default.createElement(
411
- import_react_native6.Pressable,
340
+ return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [baseStyles, _optionalChain([customAppearance, 'optionalAccess', _3 => _3.base])] }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _4 => _4.heading]) }, /* @__PURE__ */ _react2.default.createElement(
341
+ _reactnative.Pressable,
412
342
  {
413
- style: [triggerStyles, customAppearance?.trigger],
343
+ style: [triggerStyles, _optionalChain([customAppearance, 'optionalAccess', _5 => _5.trigger])],
414
344
  onPress: handlePress,
415
345
  disabled: isDisabled,
416
346
  accessibilityRole: "button",
417
347
  accessibilityState: { expanded: isExpanded, disabled: isDisabled }
418
348
  },
419
- startContent && /* @__PURE__ */ import_react10.default.createElement(import_react_native6.View, { style: [styles.startContent, customAppearance?.startContent] }, startContent),
420
- /* @__PURE__ */ import_react10.default.createElement(import_react_native6.View, { style: styles.titleWrapper }, typeof title === "string" ? /* @__PURE__ */ import_react10.default.createElement(import_react_native6.Text, { style: [titleTextStyle, customAppearance?.title] }, title) : title, subtitle && (typeof subtitle === "string" ? /* @__PURE__ */ import_react10.default.createElement(import_react_native6.Text, { style: [subtitleTextStyle, customAppearance?.subtitle] }, subtitle) : subtitle)),
421
- !hideIndicator && /* @__PURE__ */ import_react10.default.createElement(
422
- import_react_native6.Animated.View,
349
+ startContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.startContent, _optionalChain([customAppearance, 'optionalAccess', _6 => _6.startContent])] }, startContent),
350
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.titleWrapper }, typeof title === "string" ? /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [titleTextStyle, _optionalChain([customAppearance, 'optionalAccess', _7 => _7.title])] }, title) : title, subtitle && (typeof subtitle === "string" ? /* @__PURE__ */ _react2.default.createElement(_reactnative.Text, { style: [subtitleTextStyle, _optionalChain([customAppearance, 'optionalAccess', _8 => _8.subtitle])] }, subtitle) : subtitle)),
351
+ !hideIndicator && /* @__PURE__ */ _react2.default.createElement(
352
+ _reactnative.Animated.View,
423
353
  {
424
354
  style: [
425
355
  styles.indicator,
426
- customAppearance?.indicator,
356
+ _optionalChain([customAppearance, 'optionalAccess', _9 => _9.indicator]),
427
357
  { transform: [{ rotate: rotationInterpolation }] }
428
358
  ]
429
359
  },
430
- indicator || /* @__PURE__ */ import_react10.default.createElement(ChevronRightIcon, { color: foregroundColor })
360
+ indicator || /* @__PURE__ */ _react2.default.createElement(ChevronRightIcon, { color: foregroundColor })
431
361
  )
432
- )), /* @__PURE__ */ import_react10.default.createElement(import_react_native6.View, { style: styles.hiddenMeasure, pointerEvents: "none" }, /* @__PURE__ */ import_react10.default.createElement(
433
- import_react_native6.View,
362
+ )), /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.hiddenMeasure, pointerEvents: "none" }, /* @__PURE__ */ _react2.default.createElement(
363
+ _reactnative.View,
434
364
  {
435
365
  onLayout: onContentLayout,
436
- style: [contentContainerStyle, customAppearance?.content]
366
+ style: [contentContainerStyle, _optionalChain([customAppearance, 'optionalAccess', _10 => _10.content])]
437
367
  },
438
368
  children
439
- )), /* @__PURE__ */ import_react10.default.createElement(
440
- import_react_native6.Animated.View,
369
+ )), /* @__PURE__ */ _react2.default.createElement(
370
+ _reactnative.Animated.View,
441
371
  {
442
372
  style: [
443
373
  styles.contentOverflow,
444
374
  disableAnimation ? { height: isExpanded ? void 0 : 0 } : { height: heightInterpolation }
445
375
  ]
446
376
  },
447
- /* @__PURE__ */ import_react10.default.createElement(import_react_native6.View, { style: [contentContainerStyle, customAppearance?.content] }, children)
377
+ /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [contentContainerStyle, _optionalChain([customAppearance, 'optionalAccess', _11 => _11.content])] }, children)
448
378
  ));
449
379
  };
450
380
  ExpansionPanelItem.displayName = "ExpansionPanelItem";
451
381
 
452
382
  // src/components/expansion-panel/expansion-panel.utils.ts
453
- var import_react11 = __toESM(require("react"), 1);
383
+
454
384
  var getItemKey = (value, fallback) => {
455
385
  if (value === null || value === void 0) return String(fallback);
456
386
  if (typeof value === "string" || typeof value === "number") return String(value);
@@ -460,7 +390,7 @@ var normalizeElementKey = (value) => {
460
390
  if (typeof value !== "string") return value;
461
391
  return value.startsWith(".$") ? value.slice(2) : value.startsWith(".") ? value.slice(1) : value;
462
392
  };
463
- var isExpansionPanelItem = (value) => import_react11.default.isValidElement(value) && (value.type === ExpansionPanelItem || typeof value.type === "function" && value.type.displayName === "ExpansionPanelItem");
393
+ var isExpansionPanelItem = (value) => _react2.default.isValidElement(value) && (value.type === ExpansionPanelItem || typeof value.type === "function" && value.type.displayName === "ExpansionPanelItem");
464
394
  var buildExpansionPanelContextParams = (props) => {
465
395
  return {
466
396
  variant: props.variant || "light",
@@ -476,74 +406,6 @@ var buildExpansionPanelContextParams = (props) => {
476
406
  };
477
407
  };
478
408
 
479
- // src/components/divider/divider.tsx
480
- var import_react13 = __toESM(require("react"), 1);
481
- var import_react_native8 = require("react-native");
482
-
483
- // src/components/divider/divider.style.ts
484
- var import_react_native7 = require("react-native");
485
- var styles2 = import_react_native7.StyleSheet.create({
486
- horizontal: {
487
- height: 1,
488
- flexShrink: 1,
489
- flexBasis: "auto",
490
- width: "100%"
491
- },
492
- vertical: {
493
- width: 1,
494
- alignSelf: "stretch"
495
- }
496
- });
497
-
498
- // src/components/divider/divider.hook.ts
499
- var import_react12 = require("react");
500
- var import_core5 = require("@xaui/core");
501
- var useDividerColor = (themeColor, customColor) => {
502
- const theme = useXUITheme();
503
- const dividerColor = (0, import_react12.useMemo)(() => {
504
- if (customColor) {
505
- return customColor;
506
- }
507
- const safeThemeColor = (0, import_core5.getSafeThemeColor)(themeColor);
508
- return theme.colors[safeThemeColor].main;
509
- }, [customColor, themeColor, theme]);
510
- return dividerColor;
511
- };
512
- var useDividerSize = (size, orientation) => {
513
- const sizeStyles = (0, import_react12.useMemo)(() => {
514
- if (orientation === "horizontal") {
515
- return {
516
- height: size
517
- };
518
- }
519
- return {
520
- width: size
521
- };
522
- }, [size, orientation]);
523
- return sizeStyles;
524
- };
525
-
526
- // src/components/divider/divider.tsx
527
- var Divider = ({
528
- size = 1,
529
- themeColor = "default",
530
- color,
531
- orientation = "horizontal"
532
- }) => {
533
- const dividerColor = useDividerColor(themeColor, color);
534
- const sizeStyles = useDividerSize(size, orientation);
535
- return /* @__PURE__ */ import_react13.default.createElement(
536
- import_react_native8.View,
537
- {
538
- style: [
539
- orientation === "horizontal" ? styles2.horizontal : styles2.vertical,
540
- sizeStyles,
541
- { backgroundColor: dividerColor }
542
- ]
543
- }
544
- );
545
- };
546
-
547
409
  // src/components/expansion-panel/expansion-panel.tsx
548
410
  var ExpansionPanel = (props) => {
549
411
  const {
@@ -559,22 +421,21 @@ var ExpansionPanel = (props) => {
559
421
  });
560
422
  const contextParams = buildExpansionPanelContextParams(props);
561
423
  const contextValue = useExpansionPanelContextValue(contextParams);
562
- const childrenArray = import_react14.default.Children.toArray(children);
563
- return /* @__PURE__ */ import_react14.default.createElement(ExpansionPanelContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react14.default.createElement(import_react_native9.View, { style: [containerStyles, customAppearance?.container] }, childrenArray.map((child, index) => {
424
+ const childrenArray = _react2.default.Children.toArray(children);
425
+ return /* @__PURE__ */ _react2.default.createElement(ExpansionPanelContext.Provider, { value: contextValue }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [containerStyles, _optionalChain([customAppearance, 'optionalAccess', _12 => _12.container])] }, childrenArray.map((child, index) => {
564
426
  const isLast = index === childrenArray.length - 1;
565
427
  const showBottomDivider = (showDivider || variant === "bordered") && !isLast && variant !== "splitted";
566
428
  const resolvedChildKey = isExpansionPanelItem(child) ? getItemKey(
567
- child.props.itemKey ?? normalizeElementKey(child.key),
429
+ _nullishCoalesce(child.props.itemKey, () => ( normalizeElementKey(child.key))),
568
430
  index
569
431
  ) : getItemKey(
570
- import_react14.default.isValidElement(child) ? normalizeElementKey(child.key) : void 0,
432
+ _react2.default.isValidElement(child) ? normalizeElementKey(child.key) : void 0,
571
433
  index
572
434
  );
573
- return /* @__PURE__ */ import_react14.default.createElement(import_react_native9.View, { key: resolvedChildKey, style: customAppearance?.item }, isExpansionPanelItem(child) ? import_react14.default.cloneElement(child, { itemKey: resolvedChildKey }) : child, showBottomDivider && /* @__PURE__ */ import_react14.default.createElement(Divider, { color: dividerColor, size: 1 }));
435
+ return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { key: resolvedChildKey, style: _optionalChain([customAppearance, 'optionalAccess', _13 => _13.item]) }, isExpansionPanelItem(child) ? _react2.default.cloneElement(child, { itemKey: resolvedChildKey }) : child, showBottomDivider && /* @__PURE__ */ _react2.default.createElement(_chunkBD72HIPRcjs.Divider, { color: dividerColor, size: 1 }));
574
436
  })));
575
437
  };
576
- // Annotate the CommonJS export names for ESM import in node:
577
- 0 && (module.exports = {
578
- ExpansionPanel,
579
- ExpansionPanelItem
580
- });
438
+
439
+
440
+
441
+ exports.ExpansionPanel = ExpansionPanel; exports.ExpansionPanelItem = ExpansionPanelItem;
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  Divider
3
- } from "../chunk-ULJSCNPE.js";
3
+ } from "../chunk-LUBWRVI2.js";
4
+ import "../chunk-DXXNBF5P.js";
4
5
  import {
5
6
  useXUIPalette,
6
7
  useXUITheme
7
- } from "../chunk-GHCVNQET.js";
8
+ } from "../chunk-LTKYHG5V.js";
8
9
 
9
10
  // src/components/expansion-panel/expansion-panel.tsx
10
11
  import React4 from "react";