@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,281 +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/avatar/avatar.tsx
7
- var _react = require('react'); var _react2 = _interopRequireDefault(_react);
8
- var _reactnative = require('react-native');
9
-
10
- // src/components/avatar/avatar.style.ts
11
-
12
- var styles = _reactnative.StyleSheet.create({
13
- container: {
14
- overflow: "hidden",
15
- alignItems: "center",
16
- justifyContent: "center"
17
- },
18
- image: {
19
- width: "100%",
20
- height: "100%"
21
- },
22
- fallback: {
23
- alignItems: "center",
24
- justifyContent: "center"
25
- },
26
- group: {
27
- flexDirection: "row",
28
- alignItems: "center"
29
- },
30
- grid: {
31
- flexDirection: "row",
32
- flexWrap: "wrap",
33
- alignItems: "flex-start"
34
- }
35
- });
36
-
37
- // src/components/avatar/avatar.hook.ts
38
-
39
- var _core = require('@xaui/core');
40
- var sizeMap = {
41
- xs: 24,
42
- sm: 32,
43
- md: 40,
44
- lg: 48
45
- };
46
- function resolveAvatarSize(size) {
47
- if (typeof size === "number") {
48
- return size;
49
- }
50
- return sizeMap[size];
51
- }
52
- function useAvatarSizeStyles(size) {
53
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
54
- const resolvedSize = _react.useMemo.call(void 0, () => resolveAvatarSize(size), [size]);
55
- const fontSize = _react.useMemo.call(void 0, () => {
56
- if (typeof size === "number") {
57
- return Math.max(10, Math.round(size * 0.4));
58
- }
59
- return theme.fontSizes[size];
60
- }, [size, theme]);
61
- return {
62
- size: resolvedSize,
63
- fontSize
64
- };
65
- }
66
- function useAvatarRadiusStyles(radius, size) {
67
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
68
- return _react.useMemo.call(void 0, () => {
69
- if (radius === "full") {
70
- return { borderRadius: size / 2 };
71
- }
72
- const radii = {
73
- none: theme.borderRadius.none,
74
- sm: theme.borderRadius.sm,
75
- md: theme.borderRadius.md,
76
- lg: theme.borderRadius.lg,
77
- full: theme.borderRadius.full
78
- };
79
- return { borderRadius: radii[radius] };
80
- }, [radius, size, theme]);
81
- }
82
- function useAvatarColors(themeColor, isDisabled) {
83
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
84
- const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
85
- const colorScheme = theme.colors[safeThemeColor];
86
- const backgroundColor = _react.useMemo.call(void 0, () => {
87
- if (isDisabled) {
88
- return theme.colors.background;
89
- }
90
- return colorScheme.container;
91
- }, [colorScheme.container, isDisabled, theme.colors.background]);
92
- const textColor = _react.useMemo.call(void 0, () => {
93
- if (safeThemeColor === "default") {
94
- return theme.colors.foreground;
95
- }
96
- return colorScheme.onContainer;
97
- }, [safeThemeColor, colorScheme.onContainer, theme.colors.foreground]);
98
- return {
99
- backgroundColor,
100
- textColor,
101
- borderColor: colorScheme.main
102
- };
103
- }
104
- function getDefaultInitials(name) {
105
- const trimmed = name.trim();
106
- if (!trimmed) {
107
- return "";
108
- }
109
- const parts = trimmed.split(/\s+/);
110
- if (parts.length === 1) {
111
- return parts[0].slice(0, 2).toUpperCase();
112
- }
113
- return `${parts[0][0]}${parts[parts.length - 1][0]}`.toUpperCase();
114
- }
115
-
116
- // src/components/avatar/avatar.tsx
117
- var Avatar = ({
118
- src,
119
- name,
120
- icon,
121
- fallback,
122
- size = "md",
123
- radius = "full",
124
- themeColor = "default",
125
- isBordered = false,
126
- isDisabled = false,
127
- showFallback = false,
128
- getInitials,
129
- customAppearance
130
- }) => {
131
- const [isError, setIsError] = _react2.default.useState(false);
132
- const { size: resolvedSize, fontSize } = useAvatarSizeStyles(size);
133
- const radiusStyles = useAvatarRadiusStyles(radius, resolvedSize);
134
- const { backgroundColor, textColor, borderColor } = useAvatarColors(
135
- themeColor,
136
- isDisabled
137
- );
138
- const accessibilityLabel = _nullishCoalesce(name, () => ( "Avatar"));
139
- const shouldShowFallback = showFallback || !src || isError;
140
- const initials = name ? (_nullishCoalesce(getInitials, () => ( getDefaultInitials)))(name) : "";
141
- return /* @__PURE__ */ _react2.default.createElement(
142
- _reactnative.View,
143
- {
144
- style: [
145
- styles.container,
146
- {
147
- width: resolvedSize,
148
- height: resolvedSize,
149
- backgroundColor,
150
- opacity: isDisabled ? 0.6 : 1,
151
- borderWidth: isBordered ? 1 : 0,
152
- borderColor: isBordered ? borderColor : "transparent"
153
- },
154
- radiusStyles,
155
- _optionalChain([customAppearance, 'optionalAccess', _ => _.container])
156
- ],
157
- accessible: true,
158
- accessibilityRole: "image",
159
- accessibilityLabel
160
- },
161
- !shouldShowFallback && src ? /* @__PURE__ */ _react2.default.createElement(
162
- _reactnative.Image,
163
- {
164
- source: { uri: src },
165
- style: [styles.image, radiusStyles, _optionalChain([customAppearance, 'optionalAccess', _2 => _2.image])],
166
- accessibilityLabel,
167
- onError: () => setIsError(true)
168
- }
169
- ) : /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.fallback, { width: "100%", height: "100%" }] }, _nullishCoalesce(_nullishCoalesce(fallback, () => ( icon)), () => ( /* @__PURE__ */ _react2.default.createElement(
170
- _reactnative.Text,
171
- {
172
- style: [
173
- {
174
- color: textColor,
175
- fontSize,
176
- fontWeight: "600"
177
- },
178
- _optionalChain([customAppearance, 'optionalAccess', _3 => _3.text])
179
- ]
180
- },
181
- initials
182
- ))))
183
- );
184
- };
185
-
186
- // src/components/avatar/avatar-group.tsx
187
-
188
-
189
- var AvatarGroup = ({
190
- children,
191
- max,
192
- total,
193
- size = "md",
194
- radius = "full",
195
- themeColor = "default",
196
- isBordered = false,
197
- isDisabled = false,
198
- isGrid = false,
199
- renderCount,
200
- customAppearance
201
- }) => {
202
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
203
- const resolvedSize = resolveAvatarSize(size);
204
- const spacing = theme.spacing.xs;
205
- const overlap = Math.round(resolvedSize * 0.28);
206
- const allChildren = _react2.default.Children.toArray(children).filter(
207
- (child) => _react2.default.isValidElement(child)
208
- );
209
- const totalCount = _nullishCoalesce(total, () => ( allChildren.length));
210
- const maxCount = _nullishCoalesce(max, () => ( totalCount));
211
- const visibleChildren = allChildren.slice(0, maxCount);
212
- const remaining = Math.max(0, totalCount - maxCount);
213
- const enhanced = visibleChildren.map((child, index) => {
214
- const childProps = child.props;
215
- return /* @__PURE__ */ _react2.default.createElement(
216
- _reactnative.View,
217
- {
218
- key: _nullishCoalesce(child.key, () => ( index)),
219
- style: isGrid ? { marginRight: spacing, marginBottom: spacing } : { marginLeft: index === 0 ? 0 : -overlap, zIndex: index }
220
- },
221
- _react2.default.cloneElement(child, {
222
- size: _nullishCoalesce(childProps.size, () => ( size)),
223
- radius: _nullishCoalesce(childProps.radius, () => ( radius)),
224
- themeColor: _nullishCoalesce(childProps.themeColor, () => ( themeColor)),
225
- isBordered: _nullishCoalesce(childProps.isBordered, () => ( isBordered)),
226
- isDisabled: _nullishCoalesce(childProps.isDisabled, () => ( isDisabled))
227
- })
228
- );
229
- });
230
- const countNode = remaining > 0 ? _nullishCoalesce(_optionalChain([renderCount, 'optionalCall', _4 => _4(remaining)]), () => ( /* @__PURE__ */ _react2.default.createElement(
231
- Avatar,
232
- {
233
- name: `+${remaining}`,
234
- showFallback: true,
235
- size,
236
- radius,
237
- themeColor,
238
- isBordered,
239
- isDisabled,
240
- fallback: /* @__PURE__ */ _react2.default.createElement(
241
- _reactnative.Text,
242
- {
243
- style: {
244
- color: theme.colors.foreground,
245
- fontSize: Math.max(10, Math.round(resolvedSize * 0.35)),
246
- fontWeight: "600"
247
- }
248
- },
249
- "+",
250
- remaining
251
- )
252
- }
253
- ))) : null;
254
- if (countNode) {
255
- enhanced.push(
256
- /* @__PURE__ */ _react2.default.createElement(
257
- _reactnative.View,
258
- {
259
- key: "avatar-count",
260
- style: isGrid ? { marginRight: spacing, marginBottom: spacing } : {
261
- marginLeft: enhanced.length === 0 ? 0 : -overlap,
262
- zIndex: enhanced.length
263
- }
264
- },
265
- countNode
266
- )
267
- );
268
- }
269
- return /* @__PURE__ */ _react2.default.createElement(
270
- _reactnative.View,
271
- {
272
- style: [isGrid ? styles.grid : styles.group, _optionalChain([customAppearance, 'optionalAccess', _5 => _5.container])],
273
- accessible: true
274
- },
275
- enhanced
276
- );
277
- };
278
-
279
-
280
-
281
- exports.Avatar = Avatar; exports.AvatarGroup = AvatarGroup;
@@ -1,123 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { ViewStyle, ImageStyle, TextStyle } from 'react-native';
3
- import { Size, Radius, ThemeColor } from '@xaui/core/types';
4
-
5
- type AvatarSize = Size | number;
6
- type AvatarCustomAppearance = {
7
- /**
8
- * Custom styles for the container
9
- */
10
- container?: ViewStyle;
11
- /**
12
- * Custom styles for the image
13
- */
14
- image?: ImageStyle;
15
- /**
16
- * Custom styles for the fallback text
17
- */
18
- text?: TextStyle;
19
- };
20
- type AvatarProps = {
21
- /**
22
- * Avatar image source URL.
23
- */
24
- src?: string;
25
- /**
26
- * Avatar name used for initials fallback.
27
- */
28
- name?: string;
29
- /**
30
- * Custom icon rendered when no image is available.
31
- */
32
- icon?: ReactNode;
33
- /**
34
- * Custom fallback rendered when no image is available.
35
- */
36
- fallback?: ReactNode;
37
- /**
38
- * Avatar size preset or custom number.
39
- * @default 'md'
40
- */
41
- size?: AvatarSize;
42
- /**
43
- * Avatar radius.
44
- * @default 'full'
45
- */
46
- radius?: Radius;
47
- /**
48
- * Theme color for avatar background and text.
49
- */
50
- themeColor?: ThemeColor;
51
- /**
52
- * Show border around avatar.
53
- */
54
- isBordered?: boolean;
55
- /**
56
- * Disabled state.
57
- */
58
- isDisabled?: boolean;
59
- /**
60
- * Show fallback content when image is missing or fails.
61
- * @default false
62
- */
63
- showFallback?: boolean;
64
- /**
65
- * Custom initials generator.
66
- */
67
- getInitials?: (name: string) => string;
68
- /**
69
- * Custom appearance styles for avatar parts
70
- */
71
- customAppearance?: AvatarCustomAppearance;
72
- };
73
- type AvatarGroupProps = {
74
- children?: ReactNode;
75
- /**
76
- * Max avatars to display before showing count.
77
- */
78
- max?: number;
79
- /**
80
- * Total avatars count if different from children length.
81
- */
82
- total?: number;
83
- /**
84
- * Shared avatar size.
85
- */
86
- size?: AvatarSize;
87
- /**
88
- * Shared avatar radius.
89
- */
90
- radius?: Radius;
91
- /**
92
- * Shared theme color.
93
- */
94
- themeColor?: ThemeColor;
95
- /**
96
- * Show border around avatars.
97
- */
98
- isBordered?: boolean;
99
- /**
100
- * Disabled state for all avatars.
101
- */
102
- isDisabled?: boolean;
103
- /**
104
- * Render avatars in a grid layout.
105
- */
106
- isGrid?: boolean;
107
- /**
108
- * Custom renderer for the count avatar.
109
- */
110
- renderCount?: (count: number) => ReactNode;
111
- /**
112
- * Custom appearance styles for group container
113
- */
114
- customAppearance?: {
115
- container?: ViewStyle;
116
- };
117
- };
118
-
119
- declare const Avatar: React.FC<AvatarProps>;
120
-
121
- declare const AvatarGroup: React.FC<AvatarGroupProps>;
122
-
123
- export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps };
@@ -1,123 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { ViewStyle, ImageStyle, TextStyle } from 'react-native';
3
- import { Size, Radius, ThemeColor } from '@xaui/core/types';
4
-
5
- type AvatarSize = Size | number;
6
- type AvatarCustomAppearance = {
7
- /**
8
- * Custom styles for the container
9
- */
10
- container?: ViewStyle;
11
- /**
12
- * Custom styles for the image
13
- */
14
- image?: ImageStyle;
15
- /**
16
- * Custom styles for the fallback text
17
- */
18
- text?: TextStyle;
19
- };
20
- type AvatarProps = {
21
- /**
22
- * Avatar image source URL.
23
- */
24
- src?: string;
25
- /**
26
- * Avatar name used for initials fallback.
27
- */
28
- name?: string;
29
- /**
30
- * Custom icon rendered when no image is available.
31
- */
32
- icon?: ReactNode;
33
- /**
34
- * Custom fallback rendered when no image is available.
35
- */
36
- fallback?: ReactNode;
37
- /**
38
- * Avatar size preset or custom number.
39
- * @default 'md'
40
- */
41
- size?: AvatarSize;
42
- /**
43
- * Avatar radius.
44
- * @default 'full'
45
- */
46
- radius?: Radius;
47
- /**
48
- * Theme color for avatar background and text.
49
- */
50
- themeColor?: ThemeColor;
51
- /**
52
- * Show border around avatar.
53
- */
54
- isBordered?: boolean;
55
- /**
56
- * Disabled state.
57
- */
58
- isDisabled?: boolean;
59
- /**
60
- * Show fallback content when image is missing or fails.
61
- * @default false
62
- */
63
- showFallback?: boolean;
64
- /**
65
- * Custom initials generator.
66
- */
67
- getInitials?: (name: string) => string;
68
- /**
69
- * Custom appearance styles for avatar parts
70
- */
71
- customAppearance?: AvatarCustomAppearance;
72
- };
73
- type AvatarGroupProps = {
74
- children?: ReactNode;
75
- /**
76
- * Max avatars to display before showing count.
77
- */
78
- max?: number;
79
- /**
80
- * Total avatars count if different from children length.
81
- */
82
- total?: number;
83
- /**
84
- * Shared avatar size.
85
- */
86
- size?: AvatarSize;
87
- /**
88
- * Shared avatar radius.
89
- */
90
- radius?: Radius;
91
- /**
92
- * Shared theme color.
93
- */
94
- themeColor?: ThemeColor;
95
- /**
96
- * Show border around avatars.
97
- */
98
- isBordered?: boolean;
99
- /**
100
- * Disabled state for all avatars.
101
- */
102
- isDisabled?: boolean;
103
- /**
104
- * Render avatars in a grid layout.
105
- */
106
- isGrid?: boolean;
107
- /**
108
- * Custom renderer for the count avatar.
109
- */
110
- renderCount?: (count: number) => ReactNode;
111
- /**
112
- * Custom appearance styles for group container
113
- */
114
- customAppearance?: {
115
- container?: ViewStyle;
116
- };
117
- };
118
-
119
- declare const Avatar: React.FC<AvatarProps>;
120
-
121
- declare const AvatarGroup: React.FC<AvatarGroupProps>;
122
-
123
- export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps };