@xaui/native 0.2.8 → 0.9.1-alpha.0

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 (224) hide show
  1. package/dist/chunk-JDS6KGCM.cjs +791 -0
  2. package/dist/chunk-T3ZI2PZ6.js +791 -0
  3. package/dist/index.cjs +32 -1
  4. package/dist/index.d.cts +2 -2
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.js +32 -0
  7. package/dist/theme/index.cjs +32 -0
  8. package/dist/theme/index.d.cts +669 -0
  9. package/dist/theme/index.d.ts +669 -0
  10. package/dist/theme/index.js +32 -0
  11. package/package.json +26 -249
  12. package/README.md +0 -178
  13. package/dist/alert/index.cjs +0 -340
  14. package/dist/alert/index.d.cts +0 -46
  15. package/dist/alert/index.d.ts +0 -46
  16. package/dist/alert/index.js +0 -340
  17. package/dist/app-bar/index.cjs +0 -148
  18. package/dist/app-bar/index.d.cts +0 -59
  19. package/dist/app-bar/index.d.ts +0 -59
  20. package/dist/app-bar/index.js +0 -148
  21. package/dist/autocomplete/index.cjs +0 -1122
  22. package/dist/autocomplete/index.d.cts +0 -88
  23. package/dist/autocomplete/index.d.ts +0 -88
  24. package/dist/autocomplete/index.js +0 -1122
  25. package/dist/avatar/index.cjs +0 -281
  26. package/dist/avatar/index.d.cts +0 -123
  27. package/dist/avatar/index.d.ts +0 -123
  28. package/dist/avatar/index.js +0 -281
  29. package/dist/badge/index.cjs +0 -197
  30. package/dist/badge/index.d.cts +0 -94
  31. package/dist/badge/index.d.ts +0 -94
  32. package/dist/badge/index.js +0 -197
  33. package/dist/bottom-sheet/index.cjs +0 -9
  34. package/dist/bottom-sheet/index.d.cts +0 -84
  35. package/dist/bottom-sheet/index.d.ts +0 -84
  36. package/dist/bottom-sheet/index.js +0 -9
  37. package/dist/bottom-tab-bar/index.cjs +0 -497
  38. package/dist/bottom-tab-bar/index.d.cts +0 -211
  39. package/dist/bottom-tab-bar/index.d.ts +0 -211
  40. package/dist/bottom-tab-bar/index.js +0 -497
  41. package/dist/button/index.cjs +0 -392
  42. package/dist/button/index.d.cts +0 -174
  43. package/dist/button/index.d.ts +0 -174
  44. package/dist/button/index.js +0 -392
  45. package/dist/button.type-j1ZdkkSl.d.cts +0 -4
  46. package/dist/button.type-j1ZdkkSl.d.ts +0 -4
  47. package/dist/card/index.cjs +0 -338
  48. package/dist/card/index.d.cts +0 -191
  49. package/dist/card/index.d.ts +0 -191
  50. package/dist/card/index.js +0 -338
  51. package/dist/carousel/index.cjs +0 -381
  52. package/dist/carousel/index.d.cts +0 -147
  53. package/dist/carousel/index.d.ts +0 -147
  54. package/dist/carousel/index.js +0 -381
  55. package/dist/chart/index.cjs +0 -1026
  56. package/dist/chart/index.d.cts +0 -218
  57. package/dist/chart/index.d.ts +0 -218
  58. package/dist/chart/index.js +0 -1026
  59. package/dist/checkbox/index.cjs +0 -443
  60. package/dist/checkbox/index.d.cts +0 -73
  61. package/dist/checkbox/index.d.ts +0 -73
  62. package/dist/checkbox/index.js +0 -443
  63. package/dist/chip/index.cjs +0 -503
  64. package/dist/chip/index.d.cts +0 -195
  65. package/dist/chip/index.d.ts +0 -195
  66. package/dist/chip/index.js +0 -503
  67. package/dist/chunk-4JFWQ5XT.js +0 -368
  68. package/dist/chunk-56RPWZD2.cjs +0 -9
  69. package/dist/chunk-7UFBLUMV.cjs +0 -136
  70. package/dist/chunk-A45TVXU5.js +0 -337
  71. package/dist/chunk-BYWUAPC4.cjs +0 -368
  72. package/dist/chunk-DECMUMCI.js +0 -0
  73. package/dist/chunk-DHSTKO3K.cjs +0 -19
  74. package/dist/chunk-DJ4Q37UT.cjs +0 -75
  75. package/dist/chunk-EUQDGTST.cjs +0 -1
  76. package/dist/chunk-GBHQCAKW.js +0 -19
  77. package/dist/chunk-RBSA4NH4.js +0 -136
  78. package/dist/chunk-SHBDANQN.js +0 -9
  79. package/dist/chunk-UGEINZM7.cjs +0 -290
  80. package/dist/chunk-UU4HHBDN.js +0 -290
  81. package/dist/chunk-VSZEXOUN.js +0 -384
  82. package/dist/chunk-YIEUN3G5.cjs +0 -384
  83. package/dist/chunk-ZH6ZSV2Q.cjs +0 -337
  84. package/dist/chunk-ZY7IUTAT.js +0 -75
  85. package/dist/color-picker/index.cjs +0 -457
  86. package/dist/color-picker/index.d.cts +0 -124
  87. package/dist/color-picker/index.d.ts +0 -124
  88. package/dist/color-picker/index.js +0 -457
  89. package/dist/core/index.cjs +0 -24
  90. package/dist/core/index.d.cts +0 -28
  91. package/dist/core/index.d.ts +0 -28
  92. package/dist/core/index.js +0 -24
  93. package/dist/datepicker/index.cjs +0 -1625
  94. package/dist/datepicker/index.d.cts +0 -45
  95. package/dist/datepicker/index.d.ts +0 -45
  96. package/dist/datepicker/index.js +0 -1625
  97. package/dist/dialog/index.cjs +0 -372
  98. package/dist/dialog/index.d.cts +0 -151
  99. package/dist/dialog/index.d.ts +0 -151
  100. package/dist/dialog/index.js +0 -372
  101. package/dist/divider/index.cjs +0 -8
  102. package/dist/divider/index.d.cts +0 -30
  103. package/dist/divider/index.d.ts +0 -30
  104. package/dist/divider/index.js +0 -8
  105. package/dist/drawer/index.cjs +0 -237
  106. package/dist/drawer/index.d.cts +0 -58
  107. package/dist/drawer/index.d.ts +0 -58
  108. package/dist/drawer/index.js +0 -237
  109. package/dist/expansion-panel/index.cjs +0 -441
  110. package/dist/expansion-panel/index.d.cts +0 -153
  111. package/dist/expansion-panel/index.d.ts +0 -153
  112. package/dist/expansion-panel/index.js +0 -441
  113. package/dist/fab/index.cjs +0 -9
  114. package/dist/fab/index.d.cts +0 -10
  115. package/dist/fab/index.d.ts +0 -10
  116. package/dist/fab/index.js +0 -9
  117. package/dist/fab-menu/index.cjs +0 -330
  118. package/dist/fab-menu/index.d.cts +0 -125
  119. package/dist/fab-menu/index.d.ts +0 -125
  120. package/dist/fab-menu/index.js +0 -330
  121. package/dist/fab.type-CkUHmXU_.d.ts +0 -86
  122. package/dist/fab.type-DN0vtAh6.d.cts +0 -86
  123. package/dist/feature-discovery/index.cjs +0 -464
  124. package/dist/feature-discovery/index.d.cts +0 -82
  125. package/dist/feature-discovery/index.d.ts +0 -82
  126. package/dist/feature-discovery/index.js +0 -464
  127. package/dist/indicator/index.cjs +0 -8
  128. package/dist/indicator/index.d.cts +0 -47
  129. package/dist/indicator/index.d.ts +0 -47
  130. package/dist/indicator/index.js +0 -8
  131. package/dist/input/index.cjs +0 -1462
  132. package/dist/input/index.d.cts +0 -522
  133. package/dist/input/index.d.ts +0 -522
  134. package/dist/input/index.js +0 -1462
  135. package/dist/input-trigger/index.cjs +0 -197
  136. package/dist/input-trigger/index.d.cts +0 -11
  137. package/dist/input-trigger/index.d.ts +0 -11
  138. package/dist/input-trigger/index.js +0 -197
  139. package/dist/input-trigger.type-Ba4bM3Qp.d.cts +0 -180
  140. package/dist/input-trigger.type-Ba4bM3Qp.d.ts +0 -180
  141. package/dist/list/index.cjs +0 -395
  142. package/dist/list/index.d.cts +0 -188
  143. package/dist/list/index.d.ts +0 -188
  144. package/dist/list/index.js +0 -395
  145. package/dist/menu/index.cjs +0 -316
  146. package/dist/menu/index.d.cts +0 -115
  147. package/dist/menu/index.d.ts +0 -115
  148. package/dist/menu/index.js +0 -316
  149. package/dist/menubox/index.cjs +0 -297
  150. package/dist/menubox/index.d.cts +0 -98
  151. package/dist/menubox/index.d.ts +0 -98
  152. package/dist/menubox/index.js +0 -297
  153. package/dist/pager/index.cjs +0 -205
  154. package/dist/pager/index.d.cts +0 -93
  155. package/dist/pager/index.d.ts +0 -93
  156. package/dist/pager/index.js +0 -205
  157. package/dist/picker/index.cjs +0 -244
  158. package/dist/picker/index.d.cts +0 -121
  159. package/dist/picker/index.d.ts +0 -121
  160. package/dist/picker/index.js +0 -244
  161. package/dist/progress/index.cjs +0 -219
  162. package/dist/progress/index.d.cts +0 -47
  163. package/dist/progress/index.d.ts +0 -47
  164. package/dist/progress/index.js +0 -219
  165. package/dist/radio/index.cjs +0 -465
  166. package/dist/radio/index.d.cts +0 -145
  167. package/dist/radio/index.d.ts +0 -145
  168. package/dist/radio/index.js +0 -465
  169. package/dist/refresh-control/index.cjs +0 -45
  170. package/dist/refresh-control/index.d.cts +0 -55
  171. package/dist/refresh-control/index.d.ts +0 -55
  172. package/dist/refresh-control/index.js +0 -45
  173. package/dist/segment-button/index.cjs +0 -405
  174. package/dist/segment-button/index.d.cts +0 -141
  175. package/dist/segment-button/index.d.ts +0 -141
  176. package/dist/segment-button/index.js +0 -405
  177. package/dist/select/index.cjs +0 -878
  178. package/dist/select/index.d.cts +0 -192
  179. package/dist/select/index.d.ts +0 -192
  180. package/dist/select/index.js +0 -878
  181. package/dist/skeleton/index.cjs +0 -89
  182. package/dist/skeleton/index.d.cts +0 -45
  183. package/dist/skeleton/index.d.ts +0 -45
  184. package/dist/skeleton/index.js +0 -89
  185. package/dist/slider/index.cjs +0 -576
  186. package/dist/slider/index.d.cts +0 -171
  187. package/dist/slider/index.d.ts +0 -171
  188. package/dist/slider/index.js +0 -576
  189. package/dist/snackbar/index.cjs +0 -436
  190. package/dist/snackbar/index.d.cts +0 -174
  191. package/dist/snackbar/index.d.ts +0 -174
  192. package/dist/snackbar/index.js +0 -436
  193. package/dist/snippet/index.cjs +0 -314
  194. package/dist/snippet/index.d.cts +0 -95
  195. package/dist/snippet/index.d.ts +0 -95
  196. package/dist/snippet/index.js +0 -314
  197. package/dist/stepper/index.cjs +0 -550
  198. package/dist/stepper/index.d.cts +0 -137
  199. package/dist/stepper/index.d.ts +0 -137
  200. package/dist/stepper/index.js +0 -550
  201. package/dist/switch/index.cjs +0 -358
  202. package/dist/switch/index.d.cts +0 -28
  203. package/dist/switch/index.d.ts +0 -28
  204. package/dist/switch/index.js +0 -358
  205. package/dist/tabs/index.cjs +0 -440
  206. package/dist/tabs/index.d.cts +0 -180
  207. package/dist/tabs/index.d.ts +0 -180
  208. package/dist/tabs/index.js +0 -440
  209. package/dist/timepicker/index.cjs +0 -823
  210. package/dist/timepicker/index.d.cts +0 -215
  211. package/dist/timepicker/index.d.ts +0 -215
  212. package/dist/timepicker/index.js +0 -823
  213. package/dist/toolbar/index.cjs +0 -333
  214. package/dist/toolbar/index.d.cts +0 -100
  215. package/dist/toolbar/index.d.ts +0 -100
  216. package/dist/toolbar/index.js +0 -333
  217. package/dist/typography/index.cjs +0 -238
  218. package/dist/typography/index.d.cts +0 -113
  219. package/dist/typography/index.d.ts +0 -113
  220. package/dist/typography/index.js +0 -238
  221. package/dist/view/index.cjs +0 -1361
  222. package/dist/view/index.d.cts +0 -833
  223. package/dist/view/index.d.ts +0 -833
  224. package/dist/view/index.js +0 -1361
@@ -1,337 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunk7UFBLUMVcjs = require('./chunk-7UFBLUMV.cjs');
4
-
5
- // src/components/input-trigger/input-trigger.tsx
6
- var _react = require('react'); var _react2 = _interopRequireDefault(_react);
7
- var _reactnative = require('react-native');
8
-
9
- // src/components/input-trigger/input-trigger.hook.ts
10
-
11
- var _core = require('@xaui/core');
12
- var useInputTriggerSizeStyles = (size) => {
13
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
14
- return _react.useMemo.call(void 0, () => {
15
- const sizeMap = {
16
- sm: {
17
- minHeight: theme.componentSizes.sm,
18
- fontSize: 14,
19
- paddingHorizontal: 12,
20
- paddingVertical: 8,
21
- slotGap: 8,
22
- labelSize: 13,
23
- helperSize: 12
24
- },
25
- md: {
26
- minHeight: theme.componentSizes.md,
27
- fontSize: 16,
28
- paddingHorizontal: 14,
29
- paddingVertical: 10,
30
- slotGap: 10,
31
- labelSize: 14,
32
- helperSize: 13
33
- },
34
- lg: {
35
- minHeight: theme.componentSizes.lg,
36
- fontSize: 17,
37
- paddingHorizontal: 16,
38
- paddingVertical: 12,
39
- slotGap: 12,
40
- labelSize: 15,
41
- helperSize: 15
42
- }
43
- };
44
- return sizeMap[size];
45
- }, [size, theme]);
46
- };
47
- var useInputTriggerRadiusStyles = (radius) => {
48
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
49
- return _react.useMemo.call(void 0, () => {
50
- if (radius === "full") {
51
- return { borderRadius: theme.borderRadius.full };
52
- }
53
- return { borderRadius: theme.borderRadius[radius] };
54
- }, [radius, theme.borderRadius]);
55
- };
56
- var useInputTriggerVariantStyles = ({
57
- themeColor,
58
- variant,
59
- isInvalid,
60
- isDisabled
61
- }) => {
62
- const theme = _chunk7UFBLUMVcjs.useXUITheme.call(void 0, );
63
- const safeThemeColor = _core.getSafeThemeColor.call(void 0, themeColor);
64
- const colorScheme = theme.colors[safeThemeColor];
65
- return _react.useMemo.call(void 0, () => {
66
- const isDark = theme.mode === "dark";
67
- const neutralBorder = _core.withOpacity.call(void 0, theme.colors.foreground, 0.1);
68
- const textColor = isDisabled ? _core.withOpacity.call(void 0, theme.colors.foreground, 0.55) : theme.colors.foreground;
69
- const placeholderColor = _core.withOpacity.call(void 0, theme.colors.foreground, 0.45);
70
- const labelColor = isInvalid ? theme.colors.danger.main : _core.withOpacity.call(void 0, theme.colors.foreground, 0.8);
71
- const helperColor = isInvalid ? theme.colors.danger.main : _core.withOpacity.call(void 0, theme.colors.foreground, 0.72);
72
- if (variant === "underlined") {
73
- return {
74
- container: {
75
- backgroundColor: "transparent",
76
- borderBottomWidth: isInvalid ? 2 : 1,
77
- borderColor: isInvalid ? theme.colors.danger.main : _core.withPaletteNumber.call(void 0, colorScheme.main, 500)
78
- },
79
- unfocusedBorderColor: neutralBorder,
80
- textColor,
81
- placeholderColor,
82
- labelColor,
83
- helperColor
84
- };
85
- }
86
- if (variant === "bordered") {
87
- return {
88
- container: {
89
- backgroundColor: theme.colors.background,
90
- borderColor: isInvalid ? theme.colors.danger.main : neutralBorder,
91
- borderWidth: theme.borderWidth.md
92
- },
93
- unfocusedBorderColor: neutralBorder,
94
- textColor,
95
- placeholderColor,
96
- labelColor,
97
- helperColor
98
- };
99
- }
100
- if (variant === "light") {
101
- return {
102
- container: {
103
- borderColor: isInvalid ? theme.colors.danger.main : "transparent",
104
- borderWidth: isInvalid ? theme.borderWidth.md : 0
105
- },
106
- unfocusedBorderColor: "transparent",
107
- textColor,
108
- placeholderColor,
109
- labelColor,
110
- helperColor
111
- };
112
- }
113
- return {
114
- container: {
115
- backgroundColor: _core.withOpacity.call(void 0, colorScheme.container, isDark ? 0.25 : 0.4),
116
- borderColor: isInvalid ? _core.withPaletteNumber.call(void 0, theme.colors.danger.main, 500) : "transparent",
117
- borderWidth: isInvalid ? theme.borderWidth.md : 0
118
- },
119
- unfocusedBorderColor: "transparent",
120
- textColor,
121
- placeholderColor,
122
- labelColor,
123
- helperColor
124
- };
125
- }, [colorScheme, isDisabled, isInvalid, theme, variant]);
126
- };
127
-
128
- // src/components/input-trigger/input-trigger.style.ts
129
-
130
- var styles = _reactnative.StyleSheet.create({
131
- container: {
132
- width: "100%",
133
- gap: 6
134
- },
135
- noFullWidth: {
136
- alignSelf: "flex-start"
137
- },
138
- inputContainer: {
139
- gap: 6
140
- },
141
- label: {
142
- fontWeight: "500"
143
- },
144
- inputWrapper: {
145
- flexDirection: "row",
146
- alignItems: "center"
147
- },
148
- fileTrigger: {
149
- alignItems: "center",
150
- justifyContent: "center"
151
- },
152
- filePlusButton: {
153
- alignItems: "center",
154
- justifyContent: "center"
155
- },
156
- fileContent: {
157
- textAlign: "center"
158
- },
159
- fileCustomContent: {
160
- alignItems: "center"
161
- },
162
- fileSelectedContent: {
163
- width: "100%",
164
- alignItems: "center",
165
- justifyContent: "center",
166
- overflow: "hidden"
167
- },
168
- underlinedWrapper: {
169
- borderBottomLeftRadius: 0,
170
- borderBottomRightRadius: 0,
171
- paddingHorizontal: 0
172
- },
173
- slot: {
174
- justifyContent: "center",
175
- alignItems: "center"
176
- },
177
- content: {
178
- flex: 1,
179
- padding: 0
180
- },
181
- helperText: {
182
- fontWeight: "400"
183
- },
184
- disabled: {
185
- opacity: 0.6
186
- }
187
- });
188
-
189
- // src/components/input-trigger/input-trigger.tsx
190
- var InputTrigger = ({
191
- value,
192
- placeholder = "Select...",
193
- label,
194
- labelPlacement = "outside",
195
- description,
196
- errorMessage,
197
- startContent,
198
- endContent,
199
- themeColor = "primary",
200
- variant = "colored",
201
- size = "md",
202
- radius = "md",
203
- isDisabled = false,
204
- isInvalid = false,
205
- fullWidth = true,
206
- customAppearance,
207
- onPress
208
- }) => {
209
- const sizeStyles = useInputTriggerSizeStyles(size);
210
- const radiusStyles = useInputTriggerRadiusStyles(radius);
211
- const variantStyles = useInputTriggerVariantStyles({
212
- themeColor,
213
- variant,
214
- isInvalid,
215
- isDisabled
216
- });
217
- const hasValue = value !== void 0 && value !== null && value !== "";
218
- const helperText = isInvalid && errorMessage ? errorMessage : description;
219
- const renderLabel = label ? typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ _react2.default.createElement(
220
- _reactnative.Text,
221
- {
222
- style: [
223
- styles.label,
224
- {
225
- color: variantStyles.labelColor,
226
- fontSize: sizeStyles.labelSize
227
- },
228
- _optionalChain([customAppearance, 'optionalAccess', _ => _.label])
229
- ]
230
- },
231
- label
232
- ) : /* @__PURE__ */ _react2.default.createElement(_reactnative.View, null, label) : null;
233
- return /* @__PURE__ */ _react2.default.createElement(
234
- _reactnative.View,
235
- {
236
- style: [
237
- styles.container,
238
- !fullWidth && styles.noFullWidth,
239
- isDisabled && styles.disabled,
240
- _optionalChain([customAppearance, 'optionalAccess', _2 => _2.container])
241
- ]
242
- },
243
- /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.inputContainer, _optionalChain([customAppearance, 'optionalAccess', _3 => _3.inputContainer])] }, label && labelPlacement === "outside" && renderLabel, /* @__PURE__ */ _react2.default.createElement(
244
- _reactnative.Pressable,
245
- {
246
- onPress: isDisabled ? void 0 : onPress,
247
- disabled: isDisabled,
248
- accessibilityRole: "button"
249
- },
250
- /* @__PURE__ */ _react2.default.createElement(
251
- _reactnative.View,
252
- {
253
- style: [
254
- styles.inputWrapper,
255
- {
256
- minHeight: sizeStyles.minHeight,
257
- paddingVertical: sizeStyles.paddingVertical,
258
- paddingHorizontal: variant === "underlined" ? 0 : sizeStyles.paddingHorizontal,
259
- gap: sizeStyles.slotGap,
260
- backgroundColor: variantStyles.container.backgroundColor,
261
- borderWidth: variant === "underlined" ? 0 : variantStyles.container.borderWidth,
262
- ...variant === "underlined" && {
263
- borderBottomWidth: variantStyles.container.borderBottomWidth
264
- },
265
- borderRadius: variant === "underlined" ? 0 : radiusStyles.borderRadius,
266
- borderColor: variant === "underlined" ? variantStyles.container.borderColor : variantStyles.container.borderColor
267
- },
268
- variant === "underlined" && styles.underlinedWrapper,
269
- _optionalChain([customAppearance, 'optionalAccess', _4 => _4.inputWrapper])
270
- ]
271
- },
272
- startContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.slot }, startContent),
273
- /* @__PURE__ */ _react2.default.createElement(
274
- _reactnative.View,
275
- {
276
- style: {
277
- flex: 1,
278
- gap: labelPlacement === "inside" && label ? 2 : 0
279
- }
280
- },
281
- label && labelPlacement === "inside" && renderLabel,
282
- typeof value === "string" || typeof value === "number" ? /* @__PURE__ */ _react2.default.createElement(
283
- _reactnative.Text,
284
- {
285
- numberOfLines: 1,
286
- style: [
287
- styles.content,
288
- {
289
- color: hasValue ? variantStyles.textColor : variantStyles.placeholderColor,
290
- fontSize: sizeStyles.fontSize
291
- },
292
- _optionalChain([customAppearance, 'optionalAccess', _5 => _5.content])
293
- ]
294
- },
295
- hasValue ? value : placeholder
296
- ) : hasValue ? /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: { flex: 1 } }, value) : /* @__PURE__ */ _react2.default.createElement(
297
- _reactnative.Text,
298
- {
299
- style: [
300
- styles.content,
301
- {
302
- color: variantStyles.placeholderColor,
303
- fontSize: sizeStyles.fontSize
304
- },
305
- _optionalChain([customAppearance, 'optionalAccess', _6 => _6.content])
306
- ]
307
- },
308
- placeholder
309
- )
310
- ),
311
- endContent && /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: styles.slot }, endContent)
312
- )
313
- )),
314
- helperText ? typeof helperText === "string" || typeof helperText === "number" ? /* @__PURE__ */ _react2.default.createElement(
315
- _reactnative.Text,
316
- {
317
- style: [
318
- styles.helperText,
319
- {
320
- color: variantStyles.helperColor,
321
- fontSize: sizeStyles.helperSize
322
- },
323
- _optionalChain([customAppearance, 'optionalAccess', _7 => _7.helperText])
324
- ]
325
- },
326
- helperText
327
- ) : /* @__PURE__ */ _react2.default.createElement(_reactnative.View, null, helperText) : null
328
- );
329
- };
330
-
331
-
332
-
333
-
334
-
335
-
336
-
337
- exports.useInputTriggerSizeStyles = useInputTriggerSizeStyles; exports.useInputTriggerRadiusStyles = useInputTriggerRadiusStyles; exports.useInputTriggerVariantStyles = useInputTriggerVariantStyles; exports.styles = styles; exports.InputTrigger = InputTrigger;
@@ -1,75 +0,0 @@
1
- import {
2
- useXUITheme
3
- } from "./chunk-RBSA4NH4.js";
4
-
5
- // src/components/divider/divider.tsx
6
- import React from "react";
7
- import { View } from "react-native";
8
-
9
- // src/components/divider/divider.style.ts
10
- import { StyleSheet } from "react-native";
11
- var styles = StyleSheet.create({
12
- horizontal: {
13
- height: 1,
14
- flexShrink: 1,
15
- flexBasis: "auto",
16
- width: "100%"
17
- },
18
- vertical: {
19
- width: 1,
20
- alignSelf: "stretch"
21
- }
22
- });
23
-
24
- // src/components/divider/divider.hook.ts
25
- import { useMemo } from "react";
26
- import { getSafeThemeColor } from "@xaui/core";
27
- var useDividerColor = (themeColor, customColor) => {
28
- const theme = useXUITheme();
29
- const dividerColor = useMemo(() => {
30
- if (customColor) {
31
- return customColor;
32
- }
33
- const safeThemeColor = getSafeThemeColor(themeColor);
34
- return theme.colors[safeThemeColor].main;
35
- }, [customColor, themeColor, theme]);
36
- return dividerColor;
37
- };
38
- var useDividerSize = (size, orientation) => {
39
- const sizeStyles = useMemo(() => {
40
- if (orientation === "horizontal") {
41
- return {
42
- height: size
43
- };
44
- }
45
- return {
46
- width: size
47
- };
48
- }, [size, orientation]);
49
- return sizeStyles;
50
- };
51
-
52
- // src/components/divider/divider.tsx
53
- var Divider = ({
54
- size = 1,
55
- themeColor = "default",
56
- color,
57
- orientation = "horizontal"
58
- }) => {
59
- const dividerColor = useDividerColor(themeColor, color);
60
- const sizeStyles = useDividerSize(size, orientation);
61
- return /* @__PURE__ */ React.createElement(
62
- View,
63
- {
64
- style: [
65
- orientation === "horizontal" ? styles.horizontal : styles.vertical,
66
- sizeStyles,
67
- { backgroundColor: dividerColor }
68
- ]
69
- }
70
- );
71
- };
72
-
73
- export {
74
- Divider
75
- };