@xaui/native 0.0.21 → 0.0.24

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 (113) hide show
  1. package/README.md +195 -2
  2. package/dist/alert/index.js +1 -2
  3. package/dist/app-bar/index.cjs +217 -0
  4. package/dist/app-bar/index.d.cts +52 -0
  5. package/dist/app-bar/index.d.ts +52 -0
  6. package/dist/app-bar/index.js +142 -0
  7. package/dist/autocomplete/index.js +48 -36
  8. package/dist/avatar/index.js +1 -2
  9. package/dist/badge/index.js +1 -2
  10. package/dist/bottom-sheet/index.js +1 -2
  11. package/dist/bottom-tab-bar/index.cjs +571 -0
  12. package/dist/bottom-tab-bar/index.d.cts +211 -0
  13. package/dist/bottom-tab-bar/index.d.ts +211 -0
  14. package/dist/bottom-tab-bar/index.js +497 -0
  15. package/dist/button/index.d.cts +102 -5
  16. package/dist/button/index.d.ts +102 -5
  17. package/dist/button/index.js +2 -3
  18. package/dist/button.type-j1ZdkkSl.d.cts +4 -0
  19. package/dist/button.type-j1ZdkkSl.d.ts +4 -0
  20. package/dist/card/index.cjs +2 -0
  21. package/dist/card/index.d.cts +6 -1
  22. package/dist/card/index.d.ts +6 -1
  23. package/dist/card/index.js +4 -2
  24. package/dist/carousel/index.js +1 -1
  25. package/dist/chart/index.cjs +1067 -0
  26. package/dist/chart/index.d.cts +218 -0
  27. package/dist/chart/index.d.ts +218 -0
  28. package/dist/chart/index.js +1026 -0
  29. package/dist/checkbox/index.js +1 -2
  30. package/dist/chip/index.js +1 -2
  31. package/dist/chunk-3XSXTM3G.js +661 -0
  32. package/dist/chunk-4KSZLONZ.js +79 -0
  33. package/dist/{chunk-DXXNBF5P.js → chunk-CZFDZPAS.js} +0 -5
  34. package/dist/{chunk-LTKYHG5V.js → chunk-GHCVNQET.js} +12 -5
  35. package/dist/chunk-I4V5Y5GD.js +76 -0
  36. package/dist/{chunk-F7WH4DMG.js → chunk-UI5L26KD.js} +1 -1
  37. package/dist/{chunk-LUBWRVI2.js → chunk-ULJSCNPE.js} +1 -1
  38. package/dist/chunk-URBEEDFX.js +79 -0
  39. package/dist/core/index.js +3 -5
  40. package/dist/datepicker/index.js +1 -2
  41. package/dist/divider/index.js +2 -3
  42. package/dist/drawer/index.cjs +310 -0
  43. package/dist/drawer/index.d.cts +58 -0
  44. package/dist/drawer/index.d.ts +58 -0
  45. package/dist/drawer/index.js +236 -0
  46. package/dist/{accordion → expansion-panel}/index.cjs +45 -45
  47. package/dist/{accordion → expansion-panel}/index.d.cts +30 -30
  48. package/dist/{accordion → expansion-panel}/index.d.ts +30 -30
  49. package/dist/{accordion → expansion-panel}/index.js +40 -41
  50. package/dist/fab/index.d.cts +3 -3
  51. package/dist/fab/index.d.ts +3 -3
  52. package/dist/fab/index.js +3 -4
  53. package/dist/fab-menu/index.d.cts +2 -2
  54. package/dist/fab-menu/index.d.ts +2 -2
  55. package/dist/fab-menu/index.js +3 -4
  56. package/dist/{fab.type-Ba0QMprb.d.ts → fab.type-CgIYqQlT.d.ts} +1 -1
  57. package/dist/{fab.type-U09H8B7D.d.cts → fab.type-l2vjG8-p.d.cts} +1 -1
  58. package/dist/feature-discovery/index.cjs +531 -0
  59. package/dist/feature-discovery/index.d.cts +82 -0
  60. package/dist/feature-discovery/index.d.ts +82 -0
  61. package/dist/feature-discovery/index.js +464 -0
  62. package/dist/indicator/index.js +2 -3
  63. package/dist/input/index.cjs +258 -164
  64. package/dist/input/index.d.cts +15 -1
  65. package/dist/input/index.d.ts +15 -1
  66. package/dist/input/index.js +219 -126
  67. package/dist/list/index.js +1 -2
  68. package/dist/menu/index.js +2 -2
  69. package/dist/menubox/index.cjs +369 -0
  70. package/dist/menubox/index.d.cts +98 -0
  71. package/dist/menubox/index.d.ts +98 -0
  72. package/dist/menubox/index.js +296 -0
  73. package/dist/pager/index.cjs +243 -0
  74. package/dist/pager/index.d.cts +93 -0
  75. package/dist/pager/index.d.ts +93 -0
  76. package/dist/pager/index.js +205 -0
  77. package/dist/progress/index.js +1 -2
  78. package/dist/radio/index.cjs +537 -0
  79. package/dist/radio/index.d.cts +145 -0
  80. package/dist/radio/index.d.ts +145 -0
  81. package/dist/radio/index.js +464 -0
  82. package/dist/segment-button/index.js +2 -2
  83. package/dist/select/index.js +22 -10
  84. package/dist/skeleton/index.js +2 -2
  85. package/dist/slider/index.cjs +655 -0
  86. package/dist/slider/index.d.cts +171 -0
  87. package/dist/slider/index.d.ts +171 -0
  88. package/dist/slider/index.js +575 -0
  89. package/dist/stepper/index.cjs +624 -0
  90. package/dist/stepper/index.d.cts +137 -0
  91. package/dist/stepper/index.d.ts +137 -0
  92. package/dist/stepper/index.js +549 -0
  93. package/dist/switch/index.js +1 -2
  94. package/dist/tabs/index.cjs +523 -0
  95. package/dist/tabs/index.d.cts +176 -0
  96. package/dist/tabs/index.d.ts +176 -0
  97. package/dist/tabs/index.js +438 -0
  98. package/dist/timepicker/index.cjs +1280 -0
  99. package/dist/timepicker/index.d.cts +215 -0
  100. package/dist/timepicker/index.d.ts +215 -0
  101. package/dist/timepicker/index.js +1181 -0
  102. package/dist/toolbar/index.cjs +395 -0
  103. package/dist/toolbar/index.d.cts +100 -0
  104. package/dist/toolbar/index.d.ts +100 -0
  105. package/dist/toolbar/index.js +325 -0
  106. package/dist/typography/index.js +1 -2
  107. package/dist/view/index.cjs +16 -2
  108. package/dist/view/index.js +16 -2
  109. package/package.json +73 -8
  110. package/dist/button.type-D8tzEBo7.d.ts +0 -104
  111. package/dist/button.type-ikaWzhIg.d.cts +0 -104
  112. package/dist/chunk-GBHQCAKW.js +0 -19
  113. package/dist/chunk-JEGEPGVU.js +0 -287
@@ -0,0 +1,575 @@
1
+ import {
2
+ useBorderRadiusStyles,
3
+ useXUITheme
4
+ } from "../chunk-4KSZLONZ.js";
5
+
6
+ // src/components/slider/slider.tsx
7
+ import React, { useCallback, useEffect, useMemo as useMemo2, useRef, useState } from "react";
8
+ import {
9
+ Animated as Animated2,
10
+ PanResponder,
11
+ Text,
12
+ View
13
+ } from "react-native";
14
+
15
+ // src/components/slider/slider.animation.ts
16
+ import { Animated } from "react-native";
17
+ var runSliderThumbPressInAnimation = (scale) => {
18
+ Animated.spring(scale, {
19
+ toValue: 1.08,
20
+ friction: 6,
21
+ tension: 120,
22
+ useNativeDriver: false
23
+ }).start();
24
+ };
25
+ var runSliderThumbPressOutAnimation = (scale) => {
26
+ Animated.spring(scale, {
27
+ toValue: 1,
28
+ friction: 6,
29
+ tension: 120,
30
+ useNativeDriver: false
31
+ }).start();
32
+ };
33
+
34
+ // src/components/slider/slider.hook.ts
35
+ import { useMemo } from "react";
36
+ import { getSafeThemeColor, withPaletteNumber } from "@xaui/core";
37
+ function useSliderSizeStyles(size) {
38
+ const theme = useXUITheme();
39
+ return useMemo(() => {
40
+ const sizes = {
41
+ xs: {
42
+ trackThickness: 4,
43
+ thumbSize: 14,
44
+ stepDotSize: 4,
45
+ markOffset: 12,
46
+ fontSize: theme.fontSizes.xs
47
+ },
48
+ sm: {
49
+ trackThickness: 6,
50
+ thumbSize: 16,
51
+ stepDotSize: 5,
52
+ markOffset: 14,
53
+ fontSize: theme.fontSizes.sm
54
+ },
55
+ md: {
56
+ trackThickness: 8,
57
+ thumbSize: 20,
58
+ stepDotSize: 6,
59
+ markOffset: 16,
60
+ fontSize: theme.fontSizes.md
61
+ },
62
+ lg: {
63
+ trackThickness: 10,
64
+ thumbSize: 24,
65
+ stepDotSize: 7,
66
+ markOffset: 18,
67
+ fontSize: theme.fontSizes.lg
68
+ }
69
+ };
70
+ return sizes[size];
71
+ }, [size, theme]);
72
+ }
73
+ function useSliderColorStyles(color, isDisabled) {
74
+ const theme = useXUITheme();
75
+ const safeColor = getSafeThemeColor(color);
76
+ const palette = theme.colors[safeColor];
77
+ const fillColor = withPaletteNumber(palette.main, 400);
78
+ return useMemo(() => {
79
+ if (isDisabled) {
80
+ return {
81
+ trackColor: `${theme.colors.default.main}30`,
82
+ fillColor: `${theme.colors.default.main}55`,
83
+ thumbColor: `${theme.colors.default.main}85`,
84
+ valueColor: `${theme.colors.foreground}85`,
85
+ labelColor: `${theme.colors.foreground}85`,
86
+ stepColor: `${theme.colors.default.main}50`,
87
+ activeStepColor: `${theme.colors.default.main}75`,
88
+ markColor: `${theme.colors.foreground}80`
89
+ };
90
+ }
91
+ return {
92
+ trackColor: `${palette.main}28`,
93
+ fillColor,
94
+ thumbColor: fillColor,
95
+ valueColor: theme.colors.foreground,
96
+ labelColor: theme.colors.foreground,
97
+ stepColor: `${palette.main}40`,
98
+ activeStepColor: fillColor,
99
+ markColor: `${theme.colors.foreground}90`
100
+ };
101
+ }, [fillColor, isDisabled, palette.main, theme.colors]);
102
+ }
103
+
104
+ // src/components/slider/slider.style.ts
105
+ import { StyleSheet } from "react-native";
106
+ var styles = StyleSheet.create({
107
+ container: {
108
+ width: "100%"
109
+ },
110
+ header: {
111
+ flexDirection: "row",
112
+ alignItems: "center",
113
+ justifyContent: "space-between",
114
+ marginBottom: 10
115
+ },
116
+ row: {
117
+ flexDirection: "row",
118
+ alignItems: "center",
119
+ gap: 10,
120
+ width: "100%"
121
+ },
122
+ verticalRow: {
123
+ flexDirection: "column",
124
+ alignItems: "center",
125
+ justifyContent: "center",
126
+ gap: 10
127
+ },
128
+ trackContainer: {
129
+ flex: 1,
130
+ justifyContent: "center",
131
+ position: "relative"
132
+ },
133
+ verticalTrackContainer: {
134
+ height: 220,
135
+ justifyContent: "center",
136
+ alignItems: "center"
137
+ },
138
+ track: {
139
+ width: "100%",
140
+ overflow: "hidden"
141
+ },
142
+ verticalTrack: {
143
+ width: 8,
144
+ height: "100%"
145
+ },
146
+ fill: {
147
+ position: "absolute",
148
+ left: 0,
149
+ top: 0
150
+ },
151
+ verticalFill: {
152
+ left: 0,
153
+ bottom: 0,
154
+ top: void 0
155
+ },
156
+ thumb: {
157
+ position: "absolute",
158
+ justifyContent: "center",
159
+ alignItems: "center"
160
+ },
161
+ mark: {
162
+ position: "absolute",
163
+ alignItems: "center"
164
+ },
165
+ stepDot: {
166
+ position: "absolute",
167
+ borderRadius: 999
168
+ },
169
+ disabled: {
170
+ opacity: 0.55
171
+ },
172
+ label: {
173
+ fontWeight: "600"
174
+ },
175
+ value: {
176
+ fontWeight: "500"
177
+ },
178
+ markLabel: {
179
+ marginTop: 6,
180
+ fontSize: 12
181
+ }
182
+ });
183
+
184
+ // src/components/slider/slider.tsx
185
+ var clamp = (value, min, max) => Math.min(Math.max(value, min), max);
186
+ var roundToStep = (value, min, step) => {
187
+ const safeStep = step <= 0 ? 1 : step;
188
+ return Math.round((value - min) / safeStep) * safeStep + min;
189
+ };
190
+ var valueToPercent = (value, min, max) => {
191
+ const range = max - min;
192
+ if (range <= 0) return 0;
193
+ return (value - min) / range * 100;
194
+ };
195
+ var percentToValue = (percent, min, max, step) => {
196
+ const raw = min + (max - min) * percent / 100;
197
+ return clamp(roundToStep(raw, min, step), min, max);
198
+ };
199
+ var getInitialValue = ({
200
+ value,
201
+ defaultValue,
202
+ minValue,
203
+ maxValue
204
+ }) => {
205
+ if (value !== void 0) return clamp(value, minValue, maxValue);
206
+ if (defaultValue !== void 0) return clamp(defaultValue, minValue, maxValue);
207
+ return minValue;
208
+ };
209
+ var getRelativePosition = (location, trackLength, orientation) => {
210
+ if (trackLength <= 0) return 0;
211
+ const ratio = clamp(location / trackLength, 0, 1);
212
+ return orientation === "vertical" ? (1 - ratio) * 100 : ratio * 100;
213
+ };
214
+ var renderMarkLabel = (mark) => {
215
+ if (mark.label === void 0) return null;
216
+ return mark.label;
217
+ };
218
+ var getPixelPosition = (percent, length) => {
219
+ if (length <= 0) return 0;
220
+ return clamp(percent, 0, 100) / 100 * length;
221
+ };
222
+ var Slider = ({
223
+ value: controlledValue,
224
+ defaultValue,
225
+ minValue = 0,
226
+ maxValue = 100,
227
+ step = 1,
228
+ label,
229
+ showValueLabel = false,
230
+ formatOptions,
231
+ marks,
232
+ showSteps = false,
233
+ orientation = "horizontal",
234
+ size = "md",
235
+ color = "primary",
236
+ radius = "full",
237
+ startContent,
238
+ endContent,
239
+ isDisabled = false,
240
+ isReadOnly = false,
241
+ trackLength,
242
+ onChange,
243
+ onChangeEnd,
244
+ customAppearance
245
+ }) => {
246
+ const isControlled = controlledValue !== void 0;
247
+ const [internalValue, setInternalValue] = useState(
248
+ getInitialValue({
249
+ value: controlledValue,
250
+ defaultValue,
251
+ minValue,
252
+ maxValue
253
+ })
254
+ );
255
+ const [measuredTrackLength, setMeasuredTrackLength] = useState(
256
+ trackLength && trackLength > 0 ? trackLength : 0
257
+ );
258
+ const currentValue = isControlled ? clamp(controlledValue, minValue, maxValue) : internalValue;
259
+ const sizeStyles = useSliderSizeStyles(size);
260
+ const colorStyles = useSliderColorStyles(color, isDisabled);
261
+ const radiusStyles = useBorderRadiusStyles(radius);
262
+ const theme = useXUITheme();
263
+ const thumbScale = useRef(new Animated2.Value(1)).current;
264
+ const initialTouchTrackPosition = useRef(0);
265
+ const animatedTrackPosition = useRef(new Animated2.Value(0)).current;
266
+ const isDragging = useRef(false);
267
+ const currentValueRef = useRef(currentValue);
268
+ currentValueRef.current = currentValue;
269
+ const onChangeEndRef = useRef(onChangeEnd);
270
+ onChangeEndRef.current = onChangeEnd;
271
+ const thumbOverlapInset = Math.max(
272
+ 0,
273
+ (sizeStyles.thumbSize - sizeStyles.trackThickness) / 2
274
+ );
275
+ const formattedValue = useMemo2(() => {
276
+ try {
277
+ return new Intl.NumberFormat(void 0, formatOptions).format(currentValue);
278
+ } catch {
279
+ return String(currentValue);
280
+ }
281
+ }, [currentValue, formatOptions]);
282
+ const activePercent = valueToPercent(currentValue, minValue, maxValue);
283
+ const effectiveTrackLength = trackLength && trackLength > 0 ? trackLength : measuredTrackLength;
284
+ const thumbCenterPosition = getPixelPosition(activePercent, effectiveTrackLength);
285
+ const trackContainerLengthStyle = orientation === "vertical" ? {
286
+ height: (trackLength && trackLength > 0 ? trackLength : 220) + thumbOverlapInset * 2
287
+ } : trackLength && trackLength > 0 ? { width: trackLength + thumbOverlapInset * 2 } : null;
288
+ useEffect(() => {
289
+ if (!isDragging.current && effectiveTrackLength > 0) {
290
+ animatedTrackPosition.setValue(
291
+ clamp(thumbCenterPosition, 0, effectiveTrackLength)
292
+ );
293
+ }
294
+ }, [thumbCenterPosition, effectiveTrackLength, animatedTrackPosition]);
295
+ const animatedFillSize = useMemo2(() => {
296
+ const safeLength = Math.max(effectiveTrackLength, 1);
297
+ return animatedTrackPosition.interpolate({
298
+ inputRange: [0, safeLength],
299
+ outputRange: [0, safeLength],
300
+ extrapolate: "clamp"
301
+ });
302
+ }, [animatedTrackPosition, effectiveTrackLength]);
303
+ const animatedThumbOffset = useMemo2(() => {
304
+ const base = thumbOverlapInset - sizeStyles.thumbSize / 2;
305
+ const safeLength = Math.max(effectiveTrackLength, 1);
306
+ return animatedTrackPosition.interpolate({
307
+ inputRange: [0, safeLength],
308
+ outputRange: [base, safeLength + base],
309
+ extrapolate: "clamp"
310
+ });
311
+ }, [
312
+ animatedTrackPosition,
313
+ effectiveTrackLength,
314
+ thumbOverlapInset,
315
+ sizeStyles.thumbSize
316
+ ]);
317
+ const setValue = useCallback(
318
+ (nextValue) => {
319
+ if (!isControlled) {
320
+ setInternalValue(nextValue);
321
+ }
322
+ onChange?.(nextValue);
323
+ },
324
+ [isControlled, onChange]
325
+ );
326
+ const setValueFromPosition = useCallback(
327
+ (position) => {
328
+ const nextPercent = getRelativePosition(
329
+ position,
330
+ effectiveTrackLength,
331
+ orientation
332
+ );
333
+ const nextValue = percentToValue(nextPercent, minValue, maxValue, step);
334
+ setValue(nextValue);
335
+ return nextValue;
336
+ },
337
+ [effectiveTrackLength, maxValue, minValue, orientation, setValue, step]
338
+ );
339
+ const isInteractive = !isDisabled && !isReadOnly;
340
+ const panResponder = useMemo2(
341
+ () => PanResponder.create({
342
+ onStartShouldSetPanResponder: () => isInteractive,
343
+ onMoveShouldSetPanResponder: (_evt, gs) => {
344
+ if (!isInteractive) return false;
345
+ return orientation === "horizontal" ? Math.abs(gs.dx) >= Math.abs(gs.dy) : Math.abs(gs.dy) >= Math.abs(gs.dx);
346
+ },
347
+ onPanResponderTerminationRequest: () => !isDragging.current,
348
+ onPanResponderGrant: (event) => {
349
+ if (!isInteractive) return;
350
+ isDragging.current = true;
351
+ runSliderThumbPressInAnimation(thumbScale);
352
+ const point = orientation === "vertical" ? event.nativeEvent.locationY : event.nativeEvent.locationX;
353
+ const rawPosition = point - thumbOverlapInset;
354
+ initialTouchTrackPosition.current = rawPosition;
355
+ const clamped = clamp(rawPosition, 0, effectiveTrackLength);
356
+ animatedTrackPosition.setValue(
357
+ orientation === "vertical" ? effectiveTrackLength - clamped : clamped
358
+ );
359
+ setValueFromPosition(rawPosition);
360
+ },
361
+ onPanResponderMove: (_event, gestureState) => {
362
+ if (!isInteractive) return;
363
+ const delta = orientation === "vertical" ? gestureState.dy : gestureState.dx;
364
+ const rawPosition = initialTouchTrackPosition.current + delta;
365
+ const clamped = clamp(rawPosition, 0, effectiveTrackLength);
366
+ animatedTrackPosition.setValue(
367
+ orientation === "vertical" ? effectiveTrackLength - clamped : clamped
368
+ );
369
+ setValueFromPosition(rawPosition);
370
+ },
371
+ onPanResponderRelease: (_event, gestureState) => {
372
+ isDragging.current = false;
373
+ runSliderThumbPressOutAnimation(thumbScale);
374
+ if (!isInteractive) return;
375
+ const delta = orientation === "vertical" ? gestureState.dy : gestureState.dx;
376
+ const nextValue = setValueFromPosition(
377
+ initialTouchTrackPosition.current + delta
378
+ );
379
+ const snappedPercent = valueToPercent(nextValue, minValue, maxValue);
380
+ animatedTrackPosition.setValue(
381
+ getPixelPosition(snappedPercent, effectiveTrackLength)
382
+ );
383
+ onChangeEndRef.current?.(nextValue);
384
+ },
385
+ onPanResponderTerminate: () => {
386
+ isDragging.current = false;
387
+ runSliderThumbPressOutAnimation(thumbScale);
388
+ const val = currentValueRef.current;
389
+ const pct = valueToPercent(val, minValue, maxValue);
390
+ animatedTrackPosition.setValue(getPixelPosition(pct, effectiveTrackLength));
391
+ onChangeEndRef.current?.(val);
392
+ }
393
+ }),
394
+ [
395
+ animatedTrackPosition,
396
+ effectiveTrackLength,
397
+ isInteractive,
398
+ minValue,
399
+ maxValue,
400
+ orientation,
401
+ setValueFromPosition,
402
+ thumbScale,
403
+ thumbOverlapInset
404
+ ]
405
+ );
406
+ const handleTrackLayout = useCallback(
407
+ (event) => {
408
+ if (trackLength && trackLength > 0) return;
409
+ const nextLength = orientation === "vertical" ? event.nativeEvent.layout.height : event.nativeEvent.layout.width;
410
+ setMeasuredTrackLength(nextLength);
411
+ },
412
+ [orientation, trackLength]
413
+ );
414
+ const steps = useMemo2(() => {
415
+ if (!showSteps || step <= 0 || maxValue <= minValue) return [];
416
+ const count = Math.floor((maxValue - minValue) / step);
417
+ if (count > 200) return [];
418
+ return Array.from({ length: count + 1 }, (_, index) => minValue + index * step);
419
+ }, [maxValue, minValue, showSteps, step]);
420
+ return /* @__PURE__ */ React.createElement(View, { style: [styles.container, customAppearance?.container] }, (label !== void 0 || showValueLabel) && /* @__PURE__ */ React.createElement(View, { style: [styles.header, customAppearance?.header] }, label !== void 0 ? /* @__PURE__ */ React.createElement(
421
+ Text,
422
+ {
423
+ style: [
424
+ styles.label,
425
+ { color: colorStyles.labelColor, fontSize: sizeStyles.fontSize },
426
+ customAppearance?.label
427
+ ]
428
+ },
429
+ label
430
+ ) : /* @__PURE__ */ React.createElement(View, null), showValueLabel && /* @__PURE__ */ React.createElement(
431
+ Text,
432
+ {
433
+ style: [
434
+ styles.value,
435
+ { color: colorStyles.valueColor, fontSize: sizeStyles.fontSize },
436
+ customAppearance?.value
437
+ ]
438
+ },
439
+ formattedValue
440
+ )), /* @__PURE__ */ React.createElement(
441
+ View,
442
+ {
443
+ style: [
444
+ orientation === "vertical" ? styles.verticalRow : styles.row,
445
+ (isDisabled || isReadOnly) && styles.disabled
446
+ ]
447
+ },
448
+ startContent,
449
+ /* @__PURE__ */ React.createElement(
450
+ View,
451
+ {
452
+ ...panResponder.panHandlers,
453
+ style: [
454
+ styles.trackContainer,
455
+ orientation === "vertical" && styles.verticalTrackContainer,
456
+ {
457
+ padding: thumbOverlapInset
458
+ },
459
+ trackContainerLengthStyle,
460
+ customAppearance?.trackContainer
461
+ ]
462
+ },
463
+ /* @__PURE__ */ React.createElement(
464
+ View,
465
+ {
466
+ onLayout: handleTrackLayout,
467
+ style: [
468
+ styles.track,
469
+ orientation === "vertical" && styles.verticalTrack,
470
+ {
471
+ borderRadius: radiusStyles.borderRadius,
472
+ backgroundColor: colorStyles.trackColor,
473
+ height: orientation === "vertical" ? "100%" : sizeStyles.trackThickness,
474
+ width: orientation === "vertical" ? sizeStyles.trackThickness : "100%"
475
+ },
476
+ customAppearance?.track
477
+ ]
478
+ },
479
+ /* @__PURE__ */ React.createElement(
480
+ Animated2.View,
481
+ {
482
+ style: [
483
+ styles.fill,
484
+ orientation === "vertical" && styles.verticalFill,
485
+ {
486
+ backgroundColor: colorStyles.fillColor,
487
+ height: orientation === "vertical" ? effectiveTrackLength > 0 ? animatedFillSize : `${activePercent}%` : sizeStyles.trackThickness,
488
+ width: orientation === "vertical" ? sizeStyles.trackThickness : effectiveTrackLength > 0 ? animatedFillSize : `${activePercent}%`
489
+ },
490
+ customAppearance?.fill
491
+ ]
492
+ }
493
+ ),
494
+ showSteps && steps.map((stepValue) => {
495
+ const percent = valueToPercent(stepValue, minValue, maxValue);
496
+ const isActive = stepValue <= currentValue;
497
+ return /* @__PURE__ */ React.createElement(
498
+ View,
499
+ {
500
+ key: `step-${stepValue}`,
501
+ style: [
502
+ styles.stepDot,
503
+ {
504
+ width: sizeStyles.stepDotSize,
505
+ height: sizeStyles.stepDotSize,
506
+ backgroundColor: isActive ? colorStyles.activeStepColor : colorStyles.stepColor,
507
+ left: orientation === "vertical" ? (sizeStyles.trackThickness - sizeStyles.stepDotSize) / 2 : getPixelPosition(percent, effectiveTrackLength) - sizeStyles.stepDotSize / 2,
508
+ bottom: orientation === "vertical" ? getPixelPosition(percent, effectiveTrackLength) - sizeStyles.stepDotSize / 2 : (sizeStyles.trackThickness - sizeStyles.stepDotSize) / 2
509
+ },
510
+ customAppearance?.step,
511
+ isActive && customAppearance?.activeStep
512
+ ]
513
+ }
514
+ );
515
+ })
516
+ ),
517
+ /* @__PURE__ */ React.createElement(
518
+ Animated2.View,
519
+ {
520
+ pointerEvents: "none",
521
+ style: [
522
+ styles.thumb,
523
+ {
524
+ width: sizeStyles.thumbSize,
525
+ height: sizeStyles.thumbSize,
526
+ borderRadius: sizeStyles.thumbSize / 2,
527
+ left: orientation === "vertical" ? 0 : animatedThumbOffset,
528
+ top: orientation === "vertical" ? void 0 : 0,
529
+ bottom: orientation === "vertical" ? animatedThumbOffset : void 0,
530
+ backgroundColor: theme.colors.background,
531
+ borderWidth: 2,
532
+ borderColor: colorStyles.fillColor,
533
+ ...theme.shadows.md,
534
+ transform: [{ scale: thumbScale }]
535
+ },
536
+ customAppearance?.thumb
537
+ ]
538
+ }
539
+ ),
540
+ marks?.map((mark) => {
541
+ const percent = valueToPercent(mark.value, minValue, maxValue);
542
+ return /* @__PURE__ */ React.createElement(
543
+ View,
544
+ {
545
+ key: `mark-${mark.value}`,
546
+ style: [
547
+ styles.mark,
548
+ {
549
+ left: orientation === "vertical" ? thumbOverlapInset + sizeStyles.trackThickness + 8 : thumbOverlapInset + getPixelPosition(percent, effectiveTrackLength) - 10,
550
+ top: orientation === "vertical" ? void 0 : thumbOverlapInset + sizeStyles.trackThickness,
551
+ bottom: orientation === "vertical" ? thumbOverlapInset + getPixelPosition(percent, effectiveTrackLength) - 8 : void 0
552
+ },
553
+ customAppearance?.mark
554
+ ]
555
+ },
556
+ /* @__PURE__ */ React.createElement(
557
+ Text,
558
+ {
559
+ style: [
560
+ styles.markLabel,
561
+ { color: colorStyles.markColor },
562
+ customAppearance?.markLabel
563
+ ]
564
+ },
565
+ renderMarkLabel(mark)
566
+ )
567
+ );
568
+ })
569
+ ),
570
+ endContent
571
+ ));
572
+ };
573
+ export {
574
+ Slider
575
+ };