@xaui/native 0.2.8 → 0.9.1-alpha.1

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 (234) hide show
  1. package/dist/chunk-KFCORXWW.cjs +150 -0
  2. package/dist/chunk-M7P46XKI.cjs +100 -0
  3. package/dist/chunk-N357EQCZ.js +150 -0
  4. package/dist/chunk-NHPQQQ7P.cjs +734 -0
  5. package/dist/chunk-PBVPOX7D.js +734 -0
  6. package/dist/chunk-RBNCR5KB.js +100 -0
  7. package/dist/index.cjs +40 -1
  8. package/dist/index.d.cts +5 -2
  9. package/dist/index.d.ts +5 -2
  10. package/dist/index.js +40 -0
  11. package/dist/system/index.cjs +7 -0
  12. package/dist/system/index.d.cts +83 -0
  13. package/dist/system/index.d.ts +83 -0
  14. package/dist/system/index.js +7 -0
  15. package/dist/theme/index.cjs +36 -0
  16. package/dist/theme/index.d.cts +539 -0
  17. package/dist/theme/index.d.ts +539 -0
  18. package/dist/theme/index.js +36 -0
  19. package/dist/theme.type-B3ODSLbB.d.cts +153 -0
  20. package/dist/theme.type-B3ODSLbB.d.ts +153 -0
  21. package/package.json +30 -248
  22. package/README.md +0 -178
  23. package/dist/alert/index.cjs +0 -340
  24. package/dist/alert/index.d.cts +0 -46
  25. package/dist/alert/index.d.ts +0 -46
  26. package/dist/alert/index.js +0 -340
  27. package/dist/app-bar/index.cjs +0 -148
  28. package/dist/app-bar/index.d.cts +0 -59
  29. package/dist/app-bar/index.d.ts +0 -59
  30. package/dist/app-bar/index.js +0 -148
  31. package/dist/autocomplete/index.cjs +0 -1122
  32. package/dist/autocomplete/index.d.cts +0 -88
  33. package/dist/autocomplete/index.d.ts +0 -88
  34. package/dist/autocomplete/index.js +0 -1122
  35. package/dist/avatar/index.cjs +0 -281
  36. package/dist/avatar/index.d.cts +0 -123
  37. package/dist/avatar/index.d.ts +0 -123
  38. package/dist/avatar/index.js +0 -281
  39. package/dist/badge/index.cjs +0 -197
  40. package/dist/badge/index.d.cts +0 -94
  41. package/dist/badge/index.d.ts +0 -94
  42. package/dist/badge/index.js +0 -197
  43. package/dist/bottom-sheet/index.cjs +0 -9
  44. package/dist/bottom-sheet/index.d.cts +0 -84
  45. package/dist/bottom-sheet/index.d.ts +0 -84
  46. package/dist/bottom-sheet/index.js +0 -9
  47. package/dist/bottom-tab-bar/index.cjs +0 -497
  48. package/dist/bottom-tab-bar/index.d.cts +0 -211
  49. package/dist/bottom-tab-bar/index.d.ts +0 -211
  50. package/dist/bottom-tab-bar/index.js +0 -497
  51. package/dist/button/index.cjs +0 -392
  52. package/dist/button/index.d.cts +0 -174
  53. package/dist/button/index.d.ts +0 -174
  54. package/dist/button/index.js +0 -392
  55. package/dist/button.type-j1ZdkkSl.d.cts +0 -4
  56. package/dist/button.type-j1ZdkkSl.d.ts +0 -4
  57. package/dist/card/index.cjs +0 -338
  58. package/dist/card/index.d.cts +0 -191
  59. package/dist/card/index.d.ts +0 -191
  60. package/dist/card/index.js +0 -338
  61. package/dist/carousel/index.cjs +0 -381
  62. package/dist/carousel/index.d.cts +0 -147
  63. package/dist/carousel/index.d.ts +0 -147
  64. package/dist/carousel/index.js +0 -381
  65. package/dist/chart/index.cjs +0 -1026
  66. package/dist/chart/index.d.cts +0 -218
  67. package/dist/chart/index.d.ts +0 -218
  68. package/dist/chart/index.js +0 -1026
  69. package/dist/checkbox/index.cjs +0 -443
  70. package/dist/checkbox/index.d.cts +0 -73
  71. package/dist/checkbox/index.d.ts +0 -73
  72. package/dist/checkbox/index.js +0 -443
  73. package/dist/chip/index.cjs +0 -503
  74. package/dist/chip/index.d.cts +0 -195
  75. package/dist/chip/index.d.ts +0 -195
  76. package/dist/chip/index.js +0 -503
  77. package/dist/chunk-4JFWQ5XT.js +0 -368
  78. package/dist/chunk-56RPWZD2.cjs +0 -9
  79. package/dist/chunk-7UFBLUMV.cjs +0 -136
  80. package/dist/chunk-A45TVXU5.js +0 -337
  81. package/dist/chunk-BYWUAPC4.cjs +0 -368
  82. package/dist/chunk-DECMUMCI.js +0 -0
  83. package/dist/chunk-DHSTKO3K.cjs +0 -19
  84. package/dist/chunk-DJ4Q37UT.cjs +0 -75
  85. package/dist/chunk-EUQDGTST.cjs +0 -1
  86. package/dist/chunk-GBHQCAKW.js +0 -19
  87. package/dist/chunk-RBSA4NH4.js +0 -136
  88. package/dist/chunk-SHBDANQN.js +0 -9
  89. package/dist/chunk-UGEINZM7.cjs +0 -290
  90. package/dist/chunk-UU4HHBDN.js +0 -290
  91. package/dist/chunk-VSZEXOUN.js +0 -384
  92. package/dist/chunk-YIEUN3G5.cjs +0 -384
  93. package/dist/chunk-ZH6ZSV2Q.cjs +0 -337
  94. package/dist/chunk-ZY7IUTAT.js +0 -75
  95. package/dist/color-picker/index.cjs +0 -457
  96. package/dist/color-picker/index.d.cts +0 -124
  97. package/dist/color-picker/index.d.ts +0 -124
  98. package/dist/color-picker/index.js +0 -457
  99. package/dist/core/index.cjs +0 -24
  100. package/dist/core/index.d.cts +0 -28
  101. package/dist/core/index.d.ts +0 -28
  102. package/dist/core/index.js +0 -24
  103. package/dist/datepicker/index.cjs +0 -1625
  104. package/dist/datepicker/index.d.cts +0 -45
  105. package/dist/datepicker/index.d.ts +0 -45
  106. package/dist/datepicker/index.js +0 -1625
  107. package/dist/dialog/index.cjs +0 -372
  108. package/dist/dialog/index.d.cts +0 -151
  109. package/dist/dialog/index.d.ts +0 -151
  110. package/dist/dialog/index.js +0 -372
  111. package/dist/divider/index.cjs +0 -8
  112. package/dist/divider/index.d.cts +0 -30
  113. package/dist/divider/index.d.ts +0 -30
  114. package/dist/divider/index.js +0 -8
  115. package/dist/drawer/index.cjs +0 -237
  116. package/dist/drawer/index.d.cts +0 -58
  117. package/dist/drawer/index.d.ts +0 -58
  118. package/dist/drawer/index.js +0 -237
  119. package/dist/expansion-panel/index.cjs +0 -441
  120. package/dist/expansion-panel/index.d.cts +0 -153
  121. package/dist/expansion-panel/index.d.ts +0 -153
  122. package/dist/expansion-panel/index.js +0 -441
  123. package/dist/fab/index.cjs +0 -9
  124. package/dist/fab/index.d.cts +0 -10
  125. package/dist/fab/index.d.ts +0 -10
  126. package/dist/fab/index.js +0 -9
  127. package/dist/fab-menu/index.cjs +0 -330
  128. package/dist/fab-menu/index.d.cts +0 -125
  129. package/dist/fab-menu/index.d.ts +0 -125
  130. package/dist/fab-menu/index.js +0 -330
  131. package/dist/fab.type-CkUHmXU_.d.ts +0 -86
  132. package/dist/fab.type-DN0vtAh6.d.cts +0 -86
  133. package/dist/feature-discovery/index.cjs +0 -464
  134. package/dist/feature-discovery/index.d.cts +0 -82
  135. package/dist/feature-discovery/index.d.ts +0 -82
  136. package/dist/feature-discovery/index.js +0 -464
  137. package/dist/indicator/index.cjs +0 -8
  138. package/dist/indicator/index.d.cts +0 -47
  139. package/dist/indicator/index.d.ts +0 -47
  140. package/dist/indicator/index.js +0 -8
  141. package/dist/input/index.cjs +0 -1462
  142. package/dist/input/index.d.cts +0 -522
  143. package/dist/input/index.d.ts +0 -522
  144. package/dist/input/index.js +0 -1462
  145. package/dist/input-trigger/index.cjs +0 -197
  146. package/dist/input-trigger/index.d.cts +0 -11
  147. package/dist/input-trigger/index.d.ts +0 -11
  148. package/dist/input-trigger/index.js +0 -197
  149. package/dist/input-trigger.type-Ba4bM3Qp.d.cts +0 -180
  150. package/dist/input-trigger.type-Ba4bM3Qp.d.ts +0 -180
  151. package/dist/list/index.cjs +0 -395
  152. package/dist/list/index.d.cts +0 -188
  153. package/dist/list/index.d.ts +0 -188
  154. package/dist/list/index.js +0 -395
  155. package/dist/menu/index.cjs +0 -316
  156. package/dist/menu/index.d.cts +0 -115
  157. package/dist/menu/index.d.ts +0 -115
  158. package/dist/menu/index.js +0 -316
  159. package/dist/menubox/index.cjs +0 -297
  160. package/dist/menubox/index.d.cts +0 -98
  161. package/dist/menubox/index.d.ts +0 -98
  162. package/dist/menubox/index.js +0 -297
  163. package/dist/pager/index.cjs +0 -205
  164. package/dist/pager/index.d.cts +0 -93
  165. package/dist/pager/index.d.ts +0 -93
  166. package/dist/pager/index.js +0 -205
  167. package/dist/picker/index.cjs +0 -244
  168. package/dist/picker/index.d.cts +0 -121
  169. package/dist/picker/index.d.ts +0 -121
  170. package/dist/picker/index.js +0 -244
  171. package/dist/progress/index.cjs +0 -219
  172. package/dist/progress/index.d.cts +0 -47
  173. package/dist/progress/index.d.ts +0 -47
  174. package/dist/progress/index.js +0 -219
  175. package/dist/radio/index.cjs +0 -465
  176. package/dist/radio/index.d.cts +0 -145
  177. package/dist/radio/index.d.ts +0 -145
  178. package/dist/radio/index.js +0 -465
  179. package/dist/refresh-control/index.cjs +0 -45
  180. package/dist/refresh-control/index.d.cts +0 -55
  181. package/dist/refresh-control/index.d.ts +0 -55
  182. package/dist/refresh-control/index.js +0 -45
  183. package/dist/segment-button/index.cjs +0 -405
  184. package/dist/segment-button/index.d.cts +0 -141
  185. package/dist/segment-button/index.d.ts +0 -141
  186. package/dist/segment-button/index.js +0 -405
  187. package/dist/select/index.cjs +0 -878
  188. package/dist/select/index.d.cts +0 -192
  189. package/dist/select/index.d.ts +0 -192
  190. package/dist/select/index.js +0 -878
  191. package/dist/skeleton/index.cjs +0 -89
  192. package/dist/skeleton/index.d.cts +0 -45
  193. package/dist/skeleton/index.d.ts +0 -45
  194. package/dist/skeleton/index.js +0 -89
  195. package/dist/slider/index.cjs +0 -576
  196. package/dist/slider/index.d.cts +0 -171
  197. package/dist/slider/index.d.ts +0 -171
  198. package/dist/slider/index.js +0 -576
  199. package/dist/snackbar/index.cjs +0 -436
  200. package/dist/snackbar/index.d.cts +0 -174
  201. package/dist/snackbar/index.d.ts +0 -174
  202. package/dist/snackbar/index.js +0 -436
  203. package/dist/snippet/index.cjs +0 -314
  204. package/dist/snippet/index.d.cts +0 -95
  205. package/dist/snippet/index.d.ts +0 -95
  206. package/dist/snippet/index.js +0 -314
  207. package/dist/stepper/index.cjs +0 -550
  208. package/dist/stepper/index.d.cts +0 -137
  209. package/dist/stepper/index.d.ts +0 -137
  210. package/dist/stepper/index.js +0 -550
  211. package/dist/switch/index.cjs +0 -358
  212. package/dist/switch/index.d.cts +0 -28
  213. package/dist/switch/index.d.ts +0 -28
  214. package/dist/switch/index.js +0 -358
  215. package/dist/tabs/index.cjs +0 -440
  216. package/dist/tabs/index.d.cts +0 -180
  217. package/dist/tabs/index.d.ts +0 -180
  218. package/dist/tabs/index.js +0 -440
  219. package/dist/timepicker/index.cjs +0 -823
  220. package/dist/timepicker/index.d.cts +0 -215
  221. package/dist/timepicker/index.d.ts +0 -215
  222. package/dist/timepicker/index.js +0 -823
  223. package/dist/toolbar/index.cjs +0 -333
  224. package/dist/toolbar/index.d.cts +0 -100
  225. package/dist/toolbar/index.d.ts +0 -100
  226. package/dist/toolbar/index.js +0 -333
  227. package/dist/typography/index.cjs +0 -238
  228. package/dist/typography/index.d.cts +0 -113
  229. package/dist/typography/index.d.ts +0 -113
  230. package/dist/typography/index.js +0 -238
  231. package/dist/view/index.cjs +0 -1361
  232. package/dist/view/index.d.cts +0 -833
  233. package/dist/view/index.d.ts +0 -833
  234. package/dist/view/index.js +0 -1361
@@ -1,297 +0,0 @@
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; }require('../chunk-56RPWZD2.cjs');
2
-
3
-
4
- var _chunk7UFBLUMVcjs = require('../chunk-7UFBLUMV.cjs');
5
-
6
- // src/components/menubox/menubox.tsx
7
- var _react = require('react'); var _react2 = _interopRequireDefault(_react);
8
- var _reactnative = require('react-native');
9
-
10
- // src/components/menubox/menubox-context.ts
11
-
12
- var MenuBoxContext = _react.createContext.call(void 0, null);
13
-
14
- // src/components/menubox/menubox.style.ts
15
-
16
- var styles = _reactnative.StyleSheet.create({
17
- container: {
18
- overflow: "hidden"
19
- },
20
- item: {
21
- flexDirection: "row",
22
- alignItems: "center",
23
- gap: 12
24
- },
25
- content: {
26
- flex: 1,
27
- gap: 2
28
- },
29
- title: {
30
- fontWeight: "500"
31
- },
32
- description: {
33
- opacity: 0.6
34
- },
35
- disabled: {
36
- opacity: 0.5
37
- },
38
- divider: {
39
- height: 1,
40
- marginLeft: 56
41
- }
42
- });
43
-
44
- // src/components/menubox/menubox.tsx
45
- var MenuBox = ({
46
- children,
47
- size = "md",
48
- radius = "lg",
49
- themeColor = "default",
50
- spacing = 0,
51
- style,
52
- backgroundColor
53
- }) => {
54
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
55
- const itemCount = _react.Children.count(children);
56
- const itemKeys = _react.useMemo.call(void 0, () => {
57
- const keys = [];
58
- _react.Children.forEach(children, (child) => {
59
- if (_react.isValidElement.call(void 0, child)) {
60
- const props = child.props;
61
- if (props.itemKey) {
62
- keys.push(props.itemKey);
63
- }
64
- }
65
- });
66
- return keys;
67
- }, [children]);
68
- const getItemIndex = (itemKey) => {
69
- return itemKeys.indexOf(itemKey);
70
- };
71
- const bgColor = _nullishCoalesce(backgroundColor, () => ( theme.colors.default.container));
72
- const contextValue = _react.useMemo.call(void 0,
73
- () => ({
74
- size,
75
- radius,
76
- themeColor,
77
- backgroundColor: bgColor,
78
- itemCount,
79
- spacing,
80
- getItemIndex
81
- }),
82
- [size, radius, themeColor, bgColor, itemCount, spacing, getItemIndex]
83
- );
84
- return /* @__PURE__ */ _react2.default.createElement(MenuBoxContext.Provider, { value: contextValue }, /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.container, style] }, children));
85
- };
86
-
87
- // src/components/menubox/menubox-item.tsx
88
-
89
-
90
-
91
- // src/components/menubox/menubox.hook.ts
92
-
93
- var useMenuBoxItemSizeStyles = (size) => {
94
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
95
- return _react.useMemo.call(void 0, () => {
96
- const sizes = {
97
- xs: {
98
- paddingVertical: theme.spacing.sm,
99
- paddingHorizontal: theme.spacing.sm,
100
- titleSize: theme.fontSizes.xs,
101
- descriptionSize: theme.fontSizes.xs
102
- },
103
- sm: {
104
- paddingVertical: theme.spacing.sm,
105
- paddingHorizontal: theme.spacing.md,
106
- titleSize: theme.fontSizes.sm,
107
- descriptionSize: theme.fontSizes.xs
108
- },
109
- md: {
110
- paddingVertical: theme.spacing.md,
111
- paddingHorizontal: theme.spacing.md,
112
- titleSize: theme.fontSizes.md,
113
- descriptionSize: theme.fontSizes.sm
114
- },
115
- lg: {
116
- paddingVertical: theme.spacing.lg,
117
- paddingHorizontal: theme.spacing.lg,
118
- titleSize: theme.fontSizes.lg,
119
- descriptionSize: theme.fontSizes.md
120
- }
121
- };
122
- return sizes[size];
123
- }, [size, theme]);
124
- };
125
- var useMenuBoxRadiusStyles = (radius, isFirst, isLast) => {
126
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
127
- return _react.useMemo.call(void 0, () => {
128
- const radiusMap = {
129
- none: theme.borderRadius.none,
130
- sm: theme.borderRadius.md,
131
- md: theme.borderRadius.lg,
132
- lg: theme.borderRadius.xl,
133
- full: theme.borderRadius.full
134
- };
135
- const r = radiusMap[radius];
136
- return {
137
- borderTopLeftRadius: isFirst ? r : 0,
138
- borderTopRightRadius: isFirst ? r : 0,
139
- borderBottomLeftRadius: isLast ? r : 0,
140
- borderBottomRightRadius: isLast ? r : 0
141
- };
142
- }, [radius, isFirst, isLast, theme]);
143
- };
144
-
145
- // src/components/menubox/menubox.animation.ts
146
-
147
- var runMenuBoxPressInAnimation = (animatedScale, animatedOpacity) => {
148
- _reactnative.Animated.parallel([
149
- _reactnative.Animated.spring(animatedScale, {
150
- toValue: 0.99,
151
- useNativeDriver: true,
152
- speed: 50,
153
- bounciness: 0
154
- }),
155
- _reactnative.Animated.timing(animatedOpacity, {
156
- toValue: 0.8,
157
- duration: 100,
158
- useNativeDriver: true
159
- })
160
- ]).start();
161
- };
162
- var runMenuBoxPressOutAnimation = (animatedScale, animatedOpacity) => {
163
- _reactnative.Animated.parallel([
164
- _reactnative.Animated.spring(animatedScale, {
165
- toValue: 1,
166
- useNativeDriver: true,
167
- speed: 50,
168
- bounciness: 0
169
- }),
170
- _reactnative.Animated.timing(animatedOpacity, {
171
- toValue: 1,
172
- duration: 100,
173
- useNativeDriver: true
174
- })
175
- ]).start();
176
- };
177
-
178
- // src/components/menubox/menubox-item.tsx
179
- var MenuBoxItem = (props) => {
180
- const context = _react.useContext.call(void 0, MenuBoxContext);
181
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
182
- const animatedScale = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
183
- const animatedOpacity = _react2.default.useRef(new _reactnative.Animated.Value(1)).current;
184
- const {
185
- itemKey,
186
- title,
187
- description,
188
- startContent,
189
- endContent,
190
- isDisabled = false,
191
- customAppearance,
192
- onPress
193
- } = props;
194
- const size = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _ => _.size]), () => ( "md"));
195
- const radius = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _2 => _2.radius]), () => ( "lg"));
196
- const itemBackgroundColor = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _3 => _3.backgroundColor]), () => ( (theme.mode === "dark" ? theme.colors.default.container : theme.colors.background)));
197
- const spacing = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _4 => _4.spacing]), () => ( 0));
198
- const itemCount = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _5 => _5.itemCount]), () => ( 1));
199
- const index = _nullishCoalesce(_optionalChain([context, 'optionalAccess', _6 => _6.getItemIndex, 'call', _7 => _7(itemKey)]), () => ( 0));
200
- const isFirst = index === 0;
201
- const isLast = index === itemCount - 1;
202
- const sizeStyles = useMenuBoxItemSizeStyles(size);
203
- const radiusStyles = useMenuBoxRadiusStyles(radius, isFirst, isLast);
204
- const titleColor = isDisabled ? theme.colors.foreground + "50" : theme.colors.foreground;
205
- const descriptionColor = isDisabled ? theme.colors.foreground + "50" : theme.colors.foreground + "99";
206
- const handlePress = () => {
207
- if (isDisabled) {
208
- return;
209
- }
210
- _optionalChain([onPress, 'optionalCall', _8 => _8({})]);
211
- };
212
- const handlePressIn = () => {
213
- if (!isDisabled) {
214
- runMenuBoxPressInAnimation(animatedScale, animatedOpacity);
215
- }
216
- };
217
- const handlePressOut = () => {
218
- if (!isDisabled) {
219
- runMenuBoxPressOutAnimation(animatedScale, animatedOpacity);
220
- }
221
- };
222
- const renderTitle = () => {
223
- if (typeof title === "string" || typeof title === "number") {
224
- return /* @__PURE__ */ _react2.default.createElement(
225
- _reactnative.Text,
226
- {
227
- style: [
228
- styles.title,
229
- { fontSize: sizeStyles.titleSize, color: titleColor },
230
- _optionalChain([customAppearance, 'optionalAccess', _9 => _9.title])
231
- ],
232
- numberOfLines: 1
233
- },
234
- title
235
- );
236
- }
237
- return title;
238
- };
239
- const renderDescription = () => {
240
- if (!description) return null;
241
- if (typeof description === "string" || typeof description === "number") {
242
- return /* @__PURE__ */ _react2.default.createElement(
243
- _reactnative.Text,
244
- {
245
- style: [
246
- styles.description,
247
- { fontSize: sizeStyles.descriptionSize, color: descriptionColor },
248
- _optionalChain([customAppearance, 'optionalAccess', _10 => _10.description])
249
- ],
250
- numberOfLines: 1
251
- },
252
- description
253
- );
254
- }
255
- return description;
256
- };
257
- const content = /* @__PURE__ */ _react2.default.createElement(
258
- _reactnative.Animated.View,
259
- {
260
- style: [
261
- styles.item,
262
- {
263
- paddingVertical: sizeStyles.paddingVertical,
264
- paddingHorizontal: sizeStyles.paddingHorizontal,
265
- backgroundColor: itemBackgroundColor,
266
- transform: [{ scale: animatedScale }],
267
- opacity: animatedOpacity
268
- },
269
- radiusStyles,
270
- isDisabled && styles.disabled,
271
- _optionalChain([customAppearance, 'optionalAccess', _11 => _11.container])
272
- ]
273
- },
274
- startContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _12 => _12.content]) }, startContent),
275
- /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.content, _optionalChain([customAppearance, 'optionalAccess', _13 => _13.content])] }, renderTitle(), renderDescription()),
276
- endContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _14 => _14.content]) }, endContent)
277
- );
278
- return /* @__PURE__ */ _react2.default.createElement(
279
- _reactnative.Pressable,
280
- {
281
- onPress: handlePress,
282
- onPressIn: handlePressIn,
283
- onPressOut: handlePressOut,
284
- disabled: isDisabled,
285
- style: [
286
- radiusStyles,
287
- { overflow: "hidden" },
288
- !isLast && { marginBottom: spacing }
289
- ]
290
- },
291
- content
292
- );
293
- };
294
-
295
-
296
-
297
- exports.MenuBox = MenuBox; exports.MenuBoxItem = MenuBoxItem;
@@ -1,98 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
3
- import { Size, Radius, ThemeColor } from '@xaui/core/types';
4
-
5
- type MenuBoxItemCustomAppearance = {
6
- /**
7
- * Custom styles for the item container
8
- */
9
- container?: ViewStyle;
10
- /**
11
- * Custom styles for the content container
12
- */
13
- content?: ViewStyle;
14
- /**
15
- * Custom styles for the title text
16
- */
17
- title?: TextStyle;
18
- /**
19
- * Custom styles for the description text
20
- */
21
- description?: TextStyle;
22
- };
23
- type MenuBoxItemProps = {
24
- /**
25
- * Unique key for the item
26
- */
27
- itemKey: string;
28
- /**
29
- * Title text for the MenuBoxItem
30
- */
31
- title: ReactNode;
32
- /**
33
- * Optional description text
34
- */
35
- description?: ReactNode;
36
- /**
37
- * Content to display at the start of the item (icon, avatar, etc.)
38
- */
39
- startContent?: ReactNode;
40
- /**
41
- * Content to display at the end of the item (chevron, badge, etc.)
42
- */
43
- endContent?: ReactNode;
44
- /**
45
- * Whether the item is disabled
46
- * @default false
47
- */
48
- isDisabled?: boolean;
49
- /**
50
- * Custom appearance styles for item parts
51
- */
52
- customAppearance?: MenuBoxItemCustomAppearance;
53
- /**
54
- * Callback fired when the item is pressed
55
- */
56
- onPress?: (event: GestureResponderEvent) => void;
57
- };
58
- type MenuBoxProps = {
59
- /**
60
- * MenuBox items (MenuBoxItem components)
61
- */
62
- children: ReactNode;
63
- /**
64
- * Size of the menu items
65
- * @default 'md'
66
- */
67
- size?: Size;
68
- /**
69
- * Border radius for the container and items
70
- * @default 'lg'
71
- */
72
- radius?: Radius;
73
- /**
74
- * Theme color for pressed states
75
- * @default 'default'
76
- */
77
- themeColor?: ThemeColor;
78
- /**
79
- * Spacing between menu items in pixels
80
- * @default 0
81
- */
82
- spacing?: number;
83
- /**
84
- * Custom styles for the container
85
- */
86
- style?: ViewStyle;
87
- /**
88
- * Background color for MenuBox items
89
- * Uses `theme.colors.default.container` by default
90
- */
91
- backgroundColor?: string;
92
- };
93
-
94
- declare const MenuBox: React.FC<MenuBoxProps>;
95
-
96
- declare const MenuBoxItem: React.FC<MenuBoxItemProps>;
97
-
98
- export { MenuBox, MenuBoxItem, type MenuBoxItemCustomAppearance, type MenuBoxItemProps, type MenuBoxProps };
@@ -1,98 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { ViewStyle, TextStyle, GestureResponderEvent } from 'react-native';
3
- import { Size, Radius, ThemeColor } from '@xaui/core/types';
4
-
5
- type MenuBoxItemCustomAppearance = {
6
- /**
7
- * Custom styles for the item container
8
- */
9
- container?: ViewStyle;
10
- /**
11
- * Custom styles for the content container
12
- */
13
- content?: ViewStyle;
14
- /**
15
- * Custom styles for the title text
16
- */
17
- title?: TextStyle;
18
- /**
19
- * Custom styles for the description text
20
- */
21
- description?: TextStyle;
22
- };
23
- type MenuBoxItemProps = {
24
- /**
25
- * Unique key for the item
26
- */
27
- itemKey: string;
28
- /**
29
- * Title text for the MenuBoxItem
30
- */
31
- title: ReactNode;
32
- /**
33
- * Optional description text
34
- */
35
- description?: ReactNode;
36
- /**
37
- * Content to display at the start of the item (icon, avatar, etc.)
38
- */
39
- startContent?: ReactNode;
40
- /**
41
- * Content to display at the end of the item (chevron, badge, etc.)
42
- */
43
- endContent?: ReactNode;
44
- /**
45
- * Whether the item is disabled
46
- * @default false
47
- */
48
- isDisabled?: boolean;
49
- /**
50
- * Custom appearance styles for item parts
51
- */
52
- customAppearance?: MenuBoxItemCustomAppearance;
53
- /**
54
- * Callback fired when the item is pressed
55
- */
56
- onPress?: (event: GestureResponderEvent) => void;
57
- };
58
- type MenuBoxProps = {
59
- /**
60
- * MenuBox items (MenuBoxItem components)
61
- */
62
- children: ReactNode;
63
- /**
64
- * Size of the menu items
65
- * @default 'md'
66
- */
67
- size?: Size;
68
- /**
69
- * Border radius for the container and items
70
- * @default 'lg'
71
- */
72
- radius?: Radius;
73
- /**
74
- * Theme color for pressed states
75
- * @default 'default'
76
- */
77
- themeColor?: ThemeColor;
78
- /**
79
- * Spacing between menu items in pixels
80
- * @default 0
81
- */
82
- spacing?: number;
83
- /**
84
- * Custom styles for the container
85
- */
86
- style?: ViewStyle;
87
- /**
88
- * Background color for MenuBox items
89
- * Uses `theme.colors.default.container` by default
90
- */
91
- backgroundColor?: string;
92
- };
93
-
94
- declare const MenuBox: React.FC<MenuBoxProps>;
95
-
96
- declare const MenuBoxItem: React.FC<MenuBoxItemProps>;
97
-
98
- export { MenuBox, MenuBoxItem, type MenuBoxItemCustomAppearance, type MenuBoxItemProps, type MenuBoxProps };