@xaui/native 0.9.1-beta.95 → 0.9.1-beta.97

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 (205) hide show
  1. package/dist/{chunk-AXKDHX5V.cjs → chunk-2IOL3VDP.cjs} +3 -3
  2. package/dist/{chunk-LUPU7FJK.js → chunk-356DND54.js} +1 -1
  3. package/dist/{chunk-B5DBFS6M.js → chunk-3BRVAMXQ.js} +1 -1
  4. package/dist/{chunk-YJIVPYMG.cjs → chunk-3CI4JGY4.cjs} +14 -14
  5. package/dist/{chunk-4LRVB6WR.cjs → chunk-3DQCHPB6.cjs} +12 -12
  6. package/dist/{chunk-X6GT4H4I.cjs → chunk-3TBT6ORW.cjs} +15 -15
  7. package/dist/{chunk-DN3X5WIB.js → chunk-3VMKOQXH.js} +1 -1
  8. package/dist/{chunk-WPYJW3WM.cjs → chunk-435MOVG2.cjs} +3 -3
  9. package/dist/{chunk-NGXLJ5ZF.cjs → chunk-4R4SIP22.cjs} +22 -22
  10. package/dist/{chunk-V4IFH65I.cjs → chunk-5CXOSDFI.cjs} +2 -2
  11. package/dist/{chunk-5XTF2JDK.js → chunk-5G36GMFS.js} +1 -1
  12. package/dist/{chunk-VBS6VWW4.cjs → chunk-5UT5I53X.cjs} +3 -3
  13. package/dist/{chunk-5O7E73QP.cjs → chunk-7CGF3Z5S.cjs} +6 -6
  14. package/dist/{chunk-7OVYYZ7H.js → chunk-7EPH24S2.js} +15 -15
  15. package/dist/{chunk-G2YHGLN3.cjs → chunk-7JWOAGB3.cjs} +9 -9
  16. package/dist/{chunk-6SRFQSPR.cjs → chunk-ADGHFLBJ.cjs} +1 -1
  17. package/dist/{chunk-E4FWGZH2.js → chunk-AMFGATFY.js} +2 -2
  18. package/dist/{chunk-X22PLAP6.cjs → chunk-BGBJTBFC.cjs} +1 -1
  19. package/dist/{chunk-33BA4LVN.js → chunk-BH4IN6H6.js} +1 -1
  20. package/dist/{chunk-WLWZG2PA.cjs → chunk-BKY5YQ7W.cjs} +1 -1
  21. package/dist/{chunk-AHJLQJOE.cjs → chunk-C2S6J27O.cjs} +1 -1
  22. package/dist/chunk-C6JO2RTV.cjs +752 -0
  23. package/dist/{chunk-53E2E7GS.cjs → chunk-CP6AB6N5.cjs} +15 -15
  24. package/dist/{chunk-WYRM77XM.cjs → chunk-ENZBKNFJ.cjs} +15 -15
  25. package/dist/{chunk-BYDGJU5A.js → chunk-ES7RME6G.js} +3 -3
  26. package/dist/{chunk-KFB24VYT.js → chunk-EXONAJUX.js} +15 -15
  27. package/dist/{chunk-ERIGD4SE.cjs → chunk-FWAP4WAJ.cjs} +18 -18
  28. package/dist/{chunk-KMK6FUTK.cjs → chunk-FZXWZNYY.cjs} +9 -9
  29. package/dist/{chunk-K7VDLVLE.js → chunk-GKXOHUEW.js} +3 -3
  30. package/dist/{chunk-6W45YHTF.js → chunk-HDERVGWZ.js} +1 -1
  31. package/dist/{chunk-KHPODIQV.cjs → chunk-IHRPAKCZ.cjs} +15 -15
  32. package/dist/{chunk-2XEQDQAN.js → chunk-IVELCJEN.js} +99 -99
  33. package/dist/{chunk-5YZUYSV7.js → chunk-JYV53WUN.js} +1 -1
  34. package/dist/{chunk-DE4RSR7Q.cjs → chunk-KAYZH7ZN.cjs} +1 -1
  35. package/dist/{chunk-IMIY34F4.cjs → chunk-KIXHSX3L.cjs} +1 -1
  36. package/dist/{chunk-7M6YKCHX.js → chunk-KZZWNDDO.js} +2 -2
  37. package/dist/{chunk-OZLOYXLW.js → chunk-L6EWRWTE.js} +2 -2
  38. package/dist/{chunk-EQUD3NHO.js → chunk-LYWXGEED.js} +43 -43
  39. package/dist/{chunk-XOZMGNVS.js → chunk-MXSIY6QQ.js} +3 -3
  40. package/dist/{chunk-3CPLJJWX.js → chunk-MZUYTCCB.js} +1 -1
  41. package/dist/{chunk-NADCILBL.cjs → chunk-NRU5APUE.cjs} +4 -4
  42. package/dist/{chunk-43S673KF.js → chunk-NTVPLDJC.js} +1 -1
  43. package/dist/{chunk-7AVZ2FST.cjs → chunk-NXVSNESK.cjs} +12 -12
  44. package/dist/{chunk-4AIIAF6U.js → chunk-SRY3HKSC.js} +16 -16
  45. package/dist/chunk-SVS726BW.js +822 -0
  46. package/dist/{chunk-YOPWQHNO.js → chunk-TNFLBURM.js} +1 -1
  47. package/dist/{chunk-YCQEX25B.cjs → chunk-U6YD3UBO.cjs} +7 -7
  48. package/dist/{chunk-GN7BWYXP.cjs → chunk-USQK6SFZ.cjs} +15 -15
  49. package/dist/{chunk-YGETADPV.js → chunk-V7YT4SDX.js} +2 -2
  50. package/dist/{chunk-DBP5CA5R.js → chunk-VL2ZT4BB.js} +3 -3
  51. package/dist/{chunk-E5E2QA4K.js → chunk-VQG7K5QE.js} +15 -15
  52. package/dist/{chunk-Q6OVVUAT.js → chunk-VTGWFZCA.js} +2 -2
  53. package/dist/{chunk-MNBEUNC5.cjs → chunk-WH7MFY3H.cjs} +18 -18
  54. package/dist/{chunk-OX23MW5E.js → chunk-WMTGDNXU.js} +44 -44
  55. package/dist/{chunk-2TLPFGGR.cjs → chunk-XCEDD7PE.cjs} +24 -24
  56. package/dist/{chunk-J5COSALO.cjs → chunk-XILRXEUL.cjs} +2 -2
  57. package/dist/{chunk-AIHKBSQ5.cjs → chunk-YUCK5VJO.cjs} +8 -8
  58. package/dist/{chunk-YI5D4QZP.js → chunk-Z2KK5W7P.js} +15 -15
  59. package/dist/{chunk-SX5U5UJQ.js → chunk-ZBY7Q7WJ.js} +2 -2
  60. package/dist/{chunk-U5CUBDJA.js → chunk-ZR5YOCOQ.js} +15 -15
  61. package/dist/components/accordion/accordion.animation.d.cts +1 -1
  62. package/dist/components/accordion/accordion.animation.d.ts +1 -1
  63. package/dist/components/accordion/accordion.type.d.cts +1 -1
  64. package/dist/components/accordion/accordion.type.d.ts +1 -1
  65. package/dist/components/accordion/index.cjs +2 -2
  66. package/dist/components/accordion/index.js +1 -1
  67. package/dist/components/alert/alert-icon.d.cts +2 -2
  68. package/dist/components/alert/alert-icon.d.ts +2 -2
  69. package/dist/components/alert/alert.type.d.cts +1 -1
  70. package/dist/components/alert/alert.type.d.ts +1 -1
  71. package/dist/components/alert/index.cjs +2 -2
  72. package/dist/components/alert/index.js +1 -1
  73. package/dist/components/autocomplete/index.cjs +3 -3
  74. package/dist/components/autocomplete/index.js +2 -2
  75. package/dist/components/avatar/avatar-fallback.d.cts +1 -1
  76. package/dist/components/avatar/avatar-fallback.d.ts +1 -1
  77. package/dist/components/avatar/avatar.d.cts +1 -1
  78. package/dist/components/avatar/avatar.d.ts +1 -1
  79. package/dist/components/avatar/avatar.type.d.cts +1 -1
  80. package/dist/components/avatar/avatar.type.d.ts +1 -1
  81. package/dist/components/avatar/index.cjs +2 -2
  82. package/dist/components/avatar/index.js +1 -1
  83. package/dist/components/bottom-sheet/bottom-sheet.d.cts +1 -1
  84. package/dist/components/bottom-sheet/bottom-sheet.d.ts +1 -1
  85. package/dist/components/bottom-sheet/index.cjs +2 -2
  86. package/dist/components/bottom-sheet/index.js +1 -1
  87. package/dist/components/card/card-background.d.cts +1 -1
  88. package/dist/components/card/card-background.d.ts +1 -1
  89. package/dist/components/card/card.utils.d.cts +1 -1
  90. package/dist/components/card/card.utils.d.ts +1 -1
  91. package/dist/components/checkbox/checkbox.recipe.d.cts +1 -1
  92. package/dist/components/checkbox/checkbox.recipe.d.ts +1 -1
  93. package/dist/components/checkbox/checkbox.type.d.cts +1 -1
  94. package/dist/components/checkbox/checkbox.type.d.ts +1 -1
  95. package/dist/components/checkbox/index.cjs +2 -2
  96. package/dist/components/checkbox/index.js +1 -1
  97. package/dist/components/chip/chip.type.d.cts +1 -1
  98. package/dist/components/chip/chip.type.d.ts +1 -1
  99. package/dist/components/chip/index.cjs +2 -2
  100. package/dist/components/chip/index.js +1 -1
  101. package/dist/components/color-picker/index.cjs +7 -7
  102. package/dist/components/color-picker/index.js +6 -6
  103. package/dist/components/combobox/index.cjs +4 -4
  104. package/dist/components/combobox/index.js +3 -3
  105. package/dist/components/date-picker/index.cjs +4 -4
  106. package/dist/components/date-picker/index.js +3 -3
  107. package/dist/components/date-range-picker/index.cjs +4 -4
  108. package/dist/components/date-range-picker/index.js +3 -3
  109. package/dist/components/date-time-picker/index.cjs +5 -5
  110. package/dist/components/date-time-picker/index.js +4 -4
  111. package/dist/components/dialog/index.cjs +2 -2
  112. package/dist/components/dialog/index.js +1 -1
  113. package/dist/components/dummy-field/index.cjs +5 -5
  114. package/dist/components/dummy-field/index.js +4 -4
  115. package/dist/components/field-group/field-group-icon.d.cts +1 -1
  116. package/dist/components/field-group/field-group-icon.d.ts +1 -1
  117. package/dist/components/field-group/index.cjs +4 -4
  118. package/dist/components/field-group/index.js +3 -3
  119. package/dist/components/index.d.cts +1 -0
  120. package/dist/components/index.d.ts +1 -0
  121. package/dist/components/input-otp/input-otp.type.d.cts +1 -1
  122. package/dist/components/input-otp/input-otp.type.d.ts +1 -1
  123. package/dist/components/list-box/list-box-item-suffix.d.cts +1 -1
  124. package/dist/components/list-box/list-box-item-suffix.d.ts +1 -1
  125. package/dist/components/mask-field/index.cjs +5 -5
  126. package/dist/components/mask-field/index.js +4 -4
  127. package/dist/components/menu/index.cjs +2 -2
  128. package/dist/components/menu/index.js +1 -1
  129. package/dist/components/number-field/index.cjs +5 -5
  130. package/dist/components/number-field/index.js +4 -4
  131. package/dist/components/phone-number-field/index.cjs +37 -30
  132. package/dist/components/phone-number-field/index.js +13 -6
  133. package/dist/components/popover/index.cjs +2 -2
  134. package/dist/components/popover/index.js +1 -1
  135. package/dist/components/popover/popover.recipe.d.cts +1 -1
  136. package/dist/components/popover/popover.recipe.d.ts +1 -1
  137. package/dist/components/search-field/index.cjs +5 -5
  138. package/dist/components/search-field/index.js +4 -4
  139. package/dist/components/select/index.cjs +3 -3
  140. package/dist/components/select/index.js +2 -2
  141. package/dist/components/select/select-indicator.d.cts +1 -1
  142. package/dist/components/select/select-indicator.d.ts +1 -1
  143. package/dist/components/skeleton/skeleton.type.d.cts +1 -1
  144. package/dist/components/skeleton/skeleton.type.d.ts +1 -1
  145. package/dist/components/slide-button/index.cjs +30 -0
  146. package/dist/components/slide-button/index.d.cts +44 -0
  147. package/dist/components/slide-button/index.d.ts +44 -0
  148. package/dist/components/slide-button/index.js +30 -0
  149. package/dist/components/slide-button/slide-button-fill.d.cts +29 -0
  150. package/dist/components/slide-button/slide-button-fill.d.ts +29 -0
  151. package/dist/components/slide-button/slide-button-icon.d.cts +10 -0
  152. package/dist/components/slide-button/slide-button-icon.d.ts +10 -0
  153. package/dist/components/slide-button/slide-button-label.d.cts +20 -0
  154. package/dist/components/slide-button/slide-button-label.d.ts +20 -0
  155. package/dist/components/slide-button/slide-button-thumb.d.cts +20 -0
  156. package/dist/components/slide-button/slide-button-thumb.d.ts +20 -0
  157. package/dist/components/slide-button/slide-button.animation.d.cts +33 -0
  158. package/dist/components/slide-button/slide-button.animation.d.ts +33 -0
  159. package/dist/components/slide-button/slide-button.context.d.cts +7 -0
  160. package/dist/components/slide-button/slide-button.context.d.ts +7 -0
  161. package/dist/components/slide-button/slide-button.d.cts +56 -0
  162. package/dist/components/slide-button/slide-button.d.ts +56 -0
  163. package/dist/components/slide-button/slide-button.recipe.d.cts +31 -0
  164. package/dist/components/slide-button/slide-button.recipe.d.ts +31 -0
  165. package/dist/components/slide-button/slide-button.type.d.cts +79 -0
  166. package/dist/components/slide-button/slide-button.type.d.ts +79 -0
  167. package/dist/components/slider/slider-thumb.d.cts +1 -1
  168. package/dist/components/slider/slider-thumb.d.ts +1 -1
  169. package/dist/components/slider/slider.recipe.d.cts +1 -1
  170. package/dist/components/slider/slider.recipe.d.ts +1 -1
  171. package/dist/components/spinner/spinner.d.cts +1 -1
  172. package/dist/components/spinner/spinner.d.ts +1 -1
  173. package/dist/components/switch/switch.style.d.cts +1 -1
  174. package/dist/components/switch/switch.style.d.ts +1 -1
  175. package/dist/components/table/index.cjs +3 -3
  176. package/dist/components/table/index.js +2 -2
  177. package/dist/components/text-area/index.cjs +4 -4
  178. package/dist/components/text-area/index.js +3 -3
  179. package/dist/components/text-area/text-area.d.cts +1 -1
  180. package/dist/components/text-area/text-area.d.ts +1 -1
  181. package/dist/components/text-field/index.cjs +3 -3
  182. package/dist/components/text-field/index.js +2 -2
  183. package/dist/components/text-field/text-field.type.d.cts +4 -4
  184. package/dist/components/text-field/text-field.type.d.ts +4 -4
  185. package/dist/components/time-picker/index.cjs +4 -4
  186. package/dist/components/time-picker/index.js +3 -3
  187. package/dist/components/toast/index.cjs +2 -2
  188. package/dist/components/toast/index.js +1 -1
  189. package/dist/components/toast/toast.animation.d.cts +2 -2
  190. package/dist/components/toast/toast.animation.d.ts +2 -2
  191. package/dist/components/toast/toast.utils.d.cts +1 -1
  192. package/dist/components/toast/toast.utils.d.ts +1 -1
  193. package/dist/components/typography/typography.type.d.cts +1 -1
  194. package/dist/components/typography/typography.type.d.ts +1 -1
  195. package/dist/hooks/use-rotation.d.cts +1 -1
  196. package/dist/hooks/use-rotation.d.ts +1 -1
  197. package/dist/index.cjs +56 -38
  198. package/dist/index.js +64 -46
  199. package/dist/system/anchored/indicator-spring.d.cts +2 -2
  200. package/dist/system/anchored/indicator-spring.d.ts +2 -2
  201. package/dist/theme/derive-colors.d.cts +1 -1
  202. package/dist/theme/derive-colors.d.ts +1 -1
  203. package/dist/theme/index.cjs +2 -2
  204. package/dist/theme/index.js +1 -1
  205. package/package.json +11 -1
@@ -0,0 +1,752 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ function _interopRequireDefault(obj) {
7
+ return obj && obj.__esModule ? obj : {
8
+ default: obj
9
+ };
10
+ }
11
+ function _nullishCoalesce(lhs, rhsFn) {
12
+ if (lhs != null) {
13
+ return lhs;
14
+ } else {
15
+ return rhsFn();
16
+ }
17
+ }
18
+ function _optionalChain(ops) {
19
+ let lastAccessLHS = undefined;
20
+ let value = ops[0];
21
+ let i = 1;
22
+ while (i < ops.length) {
23
+ const op = ops[i];
24
+ const fn = ops[i + 1];
25
+ i += 2;
26
+ if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
27
+ return undefined;
28
+ }
29
+ if (op === 'access' || op === 'optionalAccess') {
30
+ lastAccessLHS = value;
31
+ value = fn(value);
32
+ } else if (op === 'call' || op === 'optionalCall') {
33
+ value = fn((...args) => value.call(lastAccessLHS, ...args));
34
+ lastAccessLHS = undefined;
35
+ }
36
+ }
37
+ return value;
38
+ }
39
+ var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
40
+ var _chunkGSZDN6EZcjs = require('./chunk-GSZDN6EZ.cjs');
41
+ var _chunkFHNIGHN5cjs = require('./chunk-FHNIGHN5.cjs');
42
+ var _chunkSL3V7R2Ycjs = require('./chunk-SL3V7R2Y.cjs');
43
+ var _chunkCDRGTUYFcjs = require('./chunk-CDRGTUYF.cjs');
44
+ var _chunkIIAQISBGcjs = require('./chunk-IIAQISBG.cjs');
45
+ var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
46
+
47
+ // src/components/slide-button/slide-button-fill.tsx
48
+ var _react = require('react');
49
+ var _reactnative = require('react-native');
50
+ var _reactnativereanimated = require('react-native-reanimated');
51
+ var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
52
+
53
+ // src/components/slide-button/slide-button.animation.ts
54
+ var THUMB_PRESSED_SCALE = 1.06;
55
+ var THUMB_SPRING = {
56
+ damping: 20,
57
+ stiffness: 260,
58
+ mass: 0.7
59
+ };
60
+ var DEFAULT_THRESHOLD = 0.9;
61
+ const _worklet_16393505849963_init_data = {
62
+ code: "function sweptWidth_chunkC6JO2RTVCjs1(offset,travel,trackLength){return travel>0?offset/travel*trackLength:0;}",
63
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs",
64
+ sourceMap: "{\"version\":3,\"names\":[\"sweptWidth_chunkC6JO2RTVCjs1\",\"offset\",\"travel\",\"trackLength\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs\"],\"mappings\":\"AAiCA,SAAAA,4BAAoCA,CAAAC,MAAA,CAAAC,MAAa,CAAAC,WAAA,EAE/C,MAAO,CAAAD,MAAM,CAAG,CAAC,CAAGD,MAAM,CAAGC,MAAM,CAAGC,WAAW,CAAG,CAAC,CACvD\",\"ignoreList\":[]}"
65
+ };
66
+ const sweptWidth = function sweptWidth_chunkC6JO2RTVCjs1Factory({
67
+ _worklet_16393505849963_init_data
68
+ }) {
69
+ const _e = [new global.Error(), 1, -27];
70
+ const sweptWidth = function (offset, travel, trackLength) {
71
+ return travel > 0 ? offset / travel * trackLength : 0;
72
+ };
73
+ sweptWidth.__closure = {};
74
+ sweptWidth.__workletHash = 16393505849963;
75
+ sweptWidth.__pluginVersion = "0.7.4";
76
+ sweptWidth.__initData = _worklet_16393505849963_init_data;
77
+ sweptWidth.__stackDetails = _e;
78
+ return sweptWidth;
79
+ }({
80
+ _worklet_16393505849963_init_data
81
+ }); // src/components/slide-button/slide-button.context.ts
82
+ var [SlideButtonProvider, useSlideButton] = _chunkCDRGTUYFcjs.createSlotContext.call(void 0, "SlideButton");
83
+
84
+ // src/components/slide-button/slide-button-fill.tsx
85
+ var _jsxruntime = require('react/jsx-runtime');
86
+ const _worklet_4491413439968_init_data = {
87
+ code: "function chunkC6JO2RTVCjs2(){const{sweptWidth,offset,travel,trackLength}=this.__closure;return{width:sweptWidth(offset.get(),travel,trackLength)};}",
88
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs",
89
+ sourceMap: "{\"version\":3,\"names\":[\"chunkC6JO2RTVCjs2\",\"sweptWidth\",\"offset\",\"travel\",\"trackLength\",\"__closure\",\"width\",\"get\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs\"],\"mappings\":\"AA+CuE,SAAAA,iBAAMA,CAAA,QAAAC,UAAA,CAAAC,MAAA,CAAAC,MAAA,CAAAC,WAAA,OAAAC,SAAA,CAEvE,MAAO,CAAEC,KAAK,CAAEL,UAAU,CAACC,MAAM,CAACK,GAAG,CAAC,CAAC,CAAEJ,MAAM,CAAEC,WAAW,CAAE,CAAC,CACjE\",\"ignoreList\":[]}"
90
+ };
91
+ var SlideButtonFill = _react.forwardRef.call(void 0, function SlideButtonFill2({
92
+ style,
93
+ ...props
94
+ }, ref) {
95
+ const {
96
+ fillClipStyle,
97
+ fillStyle,
98
+ offset,
99
+ travel,
100
+ trackLength
101
+ } = useSlideButton();
102
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
103
+ const width = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkC6JO2RTVCjs2Factory({
104
+ _worklet_4491413439968_init_data,
105
+ sweptWidth,
106
+ offset,
107
+ travel,
108
+ trackLength
109
+ }) {
110
+ const _e = [new global.Error(), -5, -27];
111
+ const chunkC6JO2RTVCjs2 = function () {
112
+ return {
113
+ width: sweptWidth(offset.get(), travel, trackLength)
114
+ };
115
+ };
116
+ chunkC6JO2RTVCjs2.__closure = {
117
+ sweptWidth,
118
+ offset,
119
+ travel,
120
+ trackLength
121
+ };
122
+ chunkC6JO2RTVCjs2.__workletHash = 4491413439968;
123
+ chunkC6JO2RTVCjs2.__pluginVersion = "0.7.4";
124
+ chunkC6JO2RTVCjs2.__initData = _worklet_4491413439968_init_data;
125
+ chunkC6JO2RTVCjs2.__stackDetails = _e;
126
+ return chunkC6JO2RTVCjs2;
127
+ }({
128
+ _worklet_4491413439968_init_data,
129
+ sweptWidth,
130
+ offset,
131
+ travel,
132
+ trackLength
133
+ }), [travel, trackLength]);
134
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
135
+ pointerEvents: "box-none",
136
+ style: fillClipStyle,
137
+ children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
138
+ ref,
139
+ ...rest,
140
+ style: [fillStyle, width, styleProps, style]
141
+ })
142
+ });
143
+ });
144
+ SlideButtonFill.displayName = "XAUI.SlideButton.Fill";
145
+
146
+ // src/components/slide-button/slide-button-icon.tsx
147
+
148
+ function SlideButtonIcon({
149
+ size,
150
+ color,
151
+ ...rest
152
+ }) {
153
+ const {
154
+ icon
155
+ } = useSlideButton();
156
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _chunkGSZDN6EZcjs.Icon, {
157
+ size: _nullishCoalesce(size, () => icon.size),
158
+ color: _nullishCoalesce(color, () => icon.color),
159
+ ...rest
160
+ });
161
+ }
162
+ SlideButtonIcon.displayName = "XAUI.SlideButton.Icon";
163
+
164
+ // src/components/slide-button/slide-button-label.tsx
165
+
166
+ var CLIP = _reactnative.StyleSheet.create({
167
+ window: {
168
+ position: "absolute",
169
+ top: 0,
170
+ bottom: 0,
171
+ start: 0,
172
+ overflow: "hidden",
173
+ justifyContent: "center"
174
+ }
175
+ });
176
+ const _worklet_10972554653121_init_data = {
177
+ code: "function chunkC6JO2RTVCjs3(){const{sweptWidth,offset,travel,trackLength}=this.__closure;return{width:sweptWidth(offset.get(),travel,trackLength)};}",
178
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs",
179
+ sourceMap: "{\"version\":3,\"names\":[\"chunkC6JO2RTVCjs3\",\"sweptWidth\",\"offset\",\"travel\",\"trackLength\",\"__closure\",\"width\",\"get\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs\"],\"mappings\":\"AA0FsE,SAAAA,iBAAMA,CAAA,QAAAC,UAAA,CAAAC,MAAA,CAAAC,MAAA,CAAAC,WAAA,OAAAC,SAAA,CAEtE,MAAO,CAAEC,KAAK,CAAEL,UAAU,CAACC,MAAM,CAACK,GAAG,CAAC,CAAC,CAAEJ,MAAM,CAAEC,WAAW,CAAE,CAAC,CACjE\",\"ignoreList\":[]}"
180
+ };
181
+ var SlideButtonLabel = _react.forwardRef.call(void 0, function SlideButtonLabel2({
182
+ children,
183
+ style,
184
+ ...props
185
+ }, ref) {
186
+ const {
187
+ labelStyle,
188
+ labelSweptStyle,
189
+ offset,
190
+ travel,
191
+ trackLength
192
+ } = useSlideButton();
193
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
194
+ const clip = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkC6JO2RTVCjs3Factory({
195
+ _worklet_10972554653121_init_data,
196
+ sweptWidth,
197
+ offset,
198
+ travel,
199
+ trackLength
200
+ }) {
201
+ const _e = [new global.Error(), -5, -27];
202
+ const chunkC6JO2RTVCjs3 = function () {
203
+ return {
204
+ width: sweptWidth(offset.get(), travel, trackLength)
205
+ };
206
+ };
207
+ chunkC6JO2RTVCjs3.__closure = {
208
+ sweptWidth,
209
+ offset,
210
+ travel,
211
+ trackLength
212
+ };
213
+ chunkC6JO2RTVCjs3.__workletHash = 10972554653121;
214
+ chunkC6JO2RTVCjs3.__pluginVersion = "0.7.4";
215
+ chunkC6JO2RTVCjs3.__initData = _worklet_10972554653121_init_data;
216
+ chunkC6JO2RTVCjs3.__stackDetails = _e;
217
+ return chunkC6JO2RTVCjs3;
218
+ }({
219
+ _worklet_10972554653121_init_data,
220
+ sweptWidth,
221
+ offset,
222
+ travel,
223
+ trackLength
224
+ }), [travel, trackLength]);
225
+ return /* @__PURE__ */_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
226
+ children: [/* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
227
+ ref,
228
+ numberOfLines: 1,
229
+ ...rest,
230
+ style: [labelStyle, styleProps, style],
231
+ children
232
+ }), /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
233
+ pointerEvents: "none",
234
+ style: [CLIP.window, clip],
235
+ children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.Text, {
236
+ numberOfLines: 1,
237
+ ...rest,
238
+ accessibilityElementsHidden: true,
239
+ importantForAccessibility: "no-hide-descendants",
240
+ style: [labelSweptStyle, styleProps, style],
241
+ children
242
+ })
243
+ })]
244
+ });
245
+ });
246
+ SlideButtonLabel.displayName = "XAUI.SlideButton.Label";
247
+
248
+ // src/components/slide-button/slide-button-thumb.tsx
249
+
250
+ var _reactnativegesturehandler = require('react-native-gesture-handler');
251
+ const _worklet_13716117858015_init_data = {
252
+ code: "function chunkC6JO2RTVCjs4(){const{direction,offset,pressed,THUMB_PRESSED_SCALE}=this.__closure;return{transform:[{translateX:direction*offset.get()},{scale:1+pressed.get()*(THUMB_PRESSED_SCALE-1)}]};}",
253
+ location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs",
254
+ sourceMap: "{\"version\":3,\"names\":[\"chunkC6JO2RTVCjs4\",\"direction\",\"offset\",\"pressed\",\"THUMB_PRESSED_SCALE\",\"__closure\",\"transform\",\"translateX\",\"get\",\"scale\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-C6JO2RTV.cjs\"],\"mappings\":\"AAkKwE,SAAAA,iBAAMA,CAAA,QAAAC,SAAA,CAAAC,MAAA,CAAAC,OAAA,CAAAC,mBAAA,OAAAC,SAAA,CAE1E,MAAO,CACLC,SAAS,CAAE,CACT,CAAEC,UAAU,CAAEN,SAAS,CAAGC,MAAM,CAACM,GAAG,CAAC,CAAE,CAAC,CACxC,CAAEC,KAAK,CAAE,CAAC,CAAGN,OAAO,CAACK,GAAG,CAAC,CAAC,EAAIJ,mBAAmB,CAAG,CAAC,CAAE,CAAC,CAE5D,CAAC,CACH\",\"ignoreList\":[]}"
255
+ };
256
+ function SlideButtonThumb({
257
+ children,
258
+ style,
259
+ ...props
260
+ }) {
261
+ const {
262
+ thumbStyle,
263
+ glyphStyle,
264
+ offset,
265
+ travel,
266
+ threshold,
267
+ isDisabled,
268
+ isConfirmed,
269
+ confirm
270
+ } = useSlideButton();
271
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
272
+ const pressed = _reactnativereanimated.useSharedValue.call(void 0, 0);
273
+ const start = _reactnativereanimated.useSharedValue.call(void 0, 0);
274
+ const direction = _reactnative.I18nManager.isRTL ? -1 : 1;
275
+ const pan = _reactnativegesturehandler.Gesture.Pan().enabled(!isDisabled && !isConfirmed).onBegin(() => {
276
+ start.set(offset.get());
277
+ pressed.set(_reactnativereanimated.withSpring.call(void 0, 1, THUMB_SPRING));
278
+ }).onUpdate(event => {
279
+ const next = start.get() + direction * event.translationX;
280
+ offset.set(Math.min(Math.max(next, 0), travel));
281
+ }).onFinalize(() => {
282
+ pressed.set(_reactnativereanimated.withSpring.call(void 0, 0, THUMB_SPRING));
283
+ const reached = travel > 0 && offset.get() / travel >= threshold;
284
+ offset.set(_reactnativereanimated.withSpring.call(void 0, reached ? travel : 0, THUMB_SPRING));
285
+ if (reached) _reactnativereanimated.runOnJS.call(void 0, confirm)();
286
+ });
287
+ const animated = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkC6JO2RTVCjs4Factory({
288
+ _worklet_13716117858015_init_data,
289
+ direction,
290
+ offset,
291
+ pressed,
292
+ THUMB_PRESSED_SCALE
293
+ }) {
294
+ const _e = [new global.Error(), -5, -27];
295
+ const chunkC6JO2RTVCjs4 = function () {
296
+ return {
297
+ transform: [{
298
+ translateX: direction * offset.get()
299
+ }, {
300
+ scale: 1 + pressed.get() * (THUMB_PRESSED_SCALE - 1)
301
+ }]
302
+ };
303
+ };
304
+ chunkC6JO2RTVCjs4.__closure = {
305
+ direction,
306
+ offset,
307
+ pressed,
308
+ THUMB_PRESSED_SCALE
309
+ };
310
+ chunkC6JO2RTVCjs4.__workletHash = 13716117858015;
311
+ chunkC6JO2RTVCjs4.__pluginVersion = "0.7.4";
312
+ chunkC6JO2RTVCjs4.__initData = _worklet_13716117858015_init_data;
313
+ chunkC6JO2RTVCjs4.__stackDetails = _e;
314
+ return chunkC6JO2RTVCjs4;
315
+ }({
316
+ _worklet_13716117858015_init_data,
317
+ direction,
318
+ offset,
319
+ pressed,
320
+ THUMB_PRESSED_SCALE
321
+ }), [direction]);
322
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativegesturehandler.GestureDetector, {
323
+ gesture: pan,
324
+ children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
325
+ ...rest,
326
+ style: [thumbStyle, animated, styleProps, style],
327
+ children: _nullishCoalesce(children, () => (/* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
328
+ style: glyphStyle
329
+ })))
330
+ })
331
+ });
332
+ }
333
+ SlideButtonThumb.displayName = "XAUI.SlideButton.Thumb";
334
+
335
+ // src/components/slide-button/slide-button.tsx
336
+
337
+ // src/components/slide-button/slide-button.recipe.ts
338
+ var SLOTS = ["root", "fillClip", "fill", "label", "labelSwept", "thumb", "glyph"];
339
+ var VARIANT_TOKENS = {
340
+ primary: {
341
+ bg: "accentSoft",
342
+ fg: "accentSoftForeground",
343
+ bgSelected: "accent",
344
+ fgSelected: "accentForeground"
345
+ },
346
+ secondary: {
347
+ bg: "default",
348
+ fg: "defaultForeground"
349
+ },
350
+ tertiary: {
351
+ border: "border",
352
+ fg: "foreground"
353
+ },
354
+ ghost: {
355
+ fg: "foreground"
356
+ },
357
+ success: {
358
+ bg: "successSoft",
359
+ fg: "successSoftForeground",
360
+ bgSelected: "success",
361
+ fgSelected: "successForeground"
362
+ },
363
+ "success-soft": {
364
+ bg: "successSoft",
365
+ fg: "success"
366
+ },
367
+ warning: {
368
+ bg: "warningSoft",
369
+ fg: "warningSoftForeground",
370
+ bgSelected: "warning",
371
+ fgSelected: "warningForeground"
372
+ },
373
+ "warning-soft": {
374
+ bg: "warningSoft",
375
+ fg: "warning"
376
+ },
377
+ danger: {
378
+ bg: "dangerSoft",
379
+ fg: "dangerSoftForeground",
380
+ bgSelected: "danger",
381
+ fgSelected: "dangerForeground"
382
+ },
383
+ "danger-soft": {
384
+ bg: "dangerSoft",
385
+ fg: "danger"
386
+ }
387
+ };
388
+ var FILL_ALPHA = 0.2;
389
+ var THUMB_RATIO = 1.5;
390
+ var NO_SHADOW = {
391
+ shadowColor: "#000000",
392
+ shadowOffset: {
393
+ width: 0,
394
+ height: 0
395
+ },
396
+ shadowOpacity: 0,
397
+ shadowRadius: 0,
398
+ elevation: 0
399
+ };
400
+ var SIZES = {
401
+ sm: {
402
+ height: "sm",
403
+ inset: 3,
404
+ glyph: 14,
405
+ label: "sm"
406
+ },
407
+ md: {
408
+ height: "md",
409
+ inset: 4,
410
+ glyph: 16,
411
+ label: "md"
412
+ },
413
+ lg: {
414
+ height: "lg",
415
+ inset: 4,
416
+ glyph: 20,
417
+ label: "lg"
418
+ }
419
+ };
420
+ function sizeAxis(step) {
421
+ return theme => {
422
+ const height = theme.controlHeights[step.height];
423
+ const handleHeight = height - step.inset * 2;
424
+ return {
425
+ root: {
426
+ height
427
+ },
428
+ // Centred across the whole pill, not laid out beside the handle — the handle slides
429
+ // over it, so there is no gap to keep. Symmetric `start`/`end` insets (R13, never
430
+ // `left`/`right`) just keep a long label off the pill's rounded ends.
431
+ label: {
432
+ start: theme.spacing(4),
433
+ end: theme.spacing(4),
434
+ fontSize: theme.fontSizes[step.label],
435
+ lineHeight: theme.lineHeights[step.label]
436
+ },
437
+ // The same type at the same inset. No `end`: this copy is laid out inside a clip
438
+ // whose width is the trail's, and an `end` would measure against *that*, re-centring
439
+ // the text in a box that keeps narrowing. The slot gives it a width off the measured
440
+ // pill instead, so both copies sit on exactly the same glyphs.
441
+ labelSwept: {
442
+ start: theme.spacing(4),
443
+ fontSize: theme.fontSizes[step.label],
444
+ lineHeight: theme.lineHeights[step.label]
445
+ },
446
+ // A horizontal stadium: wider than tall, its corners a half-height so the ends stay
447
+ // round at any width. `start` is its resting inset; the pan translates it from there.
448
+ thumb: {
449
+ width: Math.round(handleHeight * THUMB_RATIO),
450
+ height: handleHeight,
451
+ borderRadius: handleHeight / 2,
452
+ start: step.inset
453
+ },
454
+ glyph: {
455
+ width: step.glyph,
456
+ height: step.glyph
457
+ }
458
+ };
459
+ };
460
+ }
461
+ var slideButtonRecipe = _chunkSL3V7R2Ycjs.createRecipe.call(void 0, {
462
+ slots: SLOTS,
463
+ base: theme => ({
464
+ // A fixed-height bar holding absolutely-positioned children — the fill, the label and
465
+ // its clipped copy, the thumb — so none of them pushes the others around as it moves.
466
+ //
467
+ // **It does not clip.** The trail needs clipping and gets it from `fillClip`, one layer
468
+ // in; putting `overflow: 'hidden'` up here instead costs the handle its shadow. That
469
+ // shadow is offset a point down over a three-point blur, and the handle sits four
470
+ // points off the floor — so the lower half reaches the pill's edge exactly, and the
471
+ // clip cut it flat there and curved it away at the leading cap while leaving the top
472
+ // untouched. A shadow soft above and sheared below does not read as a clipped shadow;
473
+ // it reads as a handle sunk into a groove, which is what it looked like.
474
+ root: {
475
+ width: "100%",
476
+ justifyContent: "center",
477
+ borderCurve: "continuous",
478
+ borderRadius: theme.radius.full,
479
+ borderWidth: 0
480
+ },
481
+ /**
482
+ * The window the trail is read through, and the whole reason it has one.
483
+ *
484
+ * The pill is `radius.full`, which on a 48-tall bar resolves to a 24-point cap. The
485
+ * trail's own `full` is clamped to half of whichever side is shorter — half its
486
+ * *width* for the first 48 points of the drag — so it draws a squarer corner inside a
487
+ * rounder one and bulges past the leading edge. No radius fixes that, because the
488
+ * clamp applies whatever is asked for: the trail has to be cut to the pill's shape.
489
+ *
490
+ * Cutting it here rather than on the root is what keeps the cut off the handle.
491
+ */
492
+ fillClip: {
493
+ position: "absolute",
494
+ top: 0,
495
+ bottom: 0,
496
+ start: 0,
497
+ end: 0,
498
+ overflow: "hidden",
499
+ borderCurve: "continuous",
500
+ borderRadius: theme.radius.full
501
+ },
502
+ // Zero width at rest — the width is the swept fraction of the pill, set by the slot,
503
+ // so there is nothing to draw until the drag has actually started. The radius is the
504
+ // pill's, so the trail matches the leading cap once it is wide enough to render it;
505
+ // `fillClip` covers the widths where it cannot. The colour is the variant's,
506
+ // set in `paint`.
507
+ fill: {
508
+ position: "absolute",
509
+ top: 0,
510
+ bottom: 0,
511
+ start: 0,
512
+ borderRadius: theme.radius.full
513
+ },
514
+ label: {
515
+ position: "absolute",
516
+ textAlign: "center",
517
+ fontFamily: theme.fontFamilies.body,
518
+ fontWeight: theme.fontWeights.medium
519
+ },
520
+ /**
521
+ * The label again, for the ground the trail has already covered.
522
+ *
523
+ * One label cannot serve both: on the four inverted variants the pill goes from a soft
524
+ * slice to the vivid one, and the polarity of a readable text colour flips with it —
525
+ * measured, a label painted for the soft pill reads 1.2–1.5:1 once the trail is under
526
+ * it, in light and in dark alike. Fading the label out would answer legibility by
527
+ * removing the instruction, which is the wrong trade on the control whose whole job is
528
+ * to say what the slide will do. So it is drawn twice and the top copy is clipped to
529
+ * the trail: each half of a straddling word sits on the ground it was painted for, and
530
+ * the switch happens exactly at the trail's edge rather than at some threshold.
531
+ */
532
+ labelSwept: {
533
+ position: "absolute",
534
+ textAlign: "center",
535
+ fontFamily: theme.fontFamilies.body,
536
+ fontWeight: theme.fontWeights.medium
537
+ },
538
+ /**
539
+ * The handle: the surface colour, lifted off the pill by a shadow — the same treatment
540
+ * the `Slider`'s knob takes, and for the same reason, so the chevron on it never has
541
+ * to fight the pill for contrast.
542
+ */
543
+ thumb: {
544
+ position: "absolute",
545
+ alignItems: "center",
546
+ justifyContent: "center",
547
+ backgroundColor: theme.colors.background,
548
+ ...theme.shadows.surface
549
+ },
550
+ /**
551
+ * The built-in chevron, drawn from two borders a quarter turn round — a control whose
552
+ * whole affordance is "drag me this way" cannot be written without one, and a peer
553
+ * dependency for a single arrow is the bargain the `CloseButton`'s cross also refuses.
554
+ * The lit edges are `top` and `end`, so under RTL it flips to point the other way on
555
+ * its own — the direction the handle travels either way. `children` replace it.
556
+ */
557
+ glyph: {
558
+ borderColor: theme.colors.foreground,
559
+ borderTopWidth: 2,
560
+ borderEndWidth: 2,
561
+ transform: [{
562
+ rotate: "45deg"
563
+ }]
564
+ }
565
+ }),
566
+ variantTokens: VARIANT_TOKENS,
567
+ paint: (theme, colors) => ({
568
+ root: {
569
+ backgroundColor: colors.bg,
570
+ borderColor: colors.border,
571
+ borderWidth: colors.border ? theme.borderWidth.default : 0
572
+ },
573
+ label: {
574
+ color: colors.fg
575
+ },
576
+ // A variant with no vivid slice sweeps a wash, which the resting label already reads
577
+ // against — so it falls back to the same colour and the two copies are one label.
578
+ labelSwept: {
579
+ color: _nullishCoalesce(colors.fgSelected, () => colors.fg)
580
+ },
581
+ // The vivid slice where the variant named one, so the slide *arrives* at the intent
582
+ // rather than opening on it. Everything else keeps a wash of the same foreground the
583
+ // label uses, which reads against every pill without a token of its own. Either way a
584
+ // raw `color` moves the trail, because both roles go through the tint pass.
585
+ fill: {
586
+ backgroundColor: _nullishCoalesce(colors.bgSelected, () => colors.fg ? _chunkIIAQISBGcjs.alpha.call(void 0, colors.fg, FILL_ALPHA) : void 0)
587
+ }
588
+ }),
589
+ variants: {
590
+ size: {
591
+ sm: sizeAxis(SIZES.sm),
592
+ md: sizeAxis(SIZES.md),
593
+ lg: sizeAxis(SIZES.lg)
594
+ },
595
+ /** After `size`, so a caller's `radius` wins over the pill's `full`. */
596
+ radius: _chunkSL3V7R2Ycjs.radiusAxis.call(void 0, "root", "fillClip", "fill")
597
+ },
598
+ states: {
599
+ disabled: theme => ({
600
+ root: {
601
+ opacity: theme.opacity.disabled
602
+ },
603
+ // The handle also puts its shadow down. Opacity fades the pill until its edges are
604
+ // most of the way to the page, but it fades the shadow too — and a shadow at half
605
+ // strength is still the strongest edge left in the picture, sitting a point below a
606
+ // handle whose own outline has gone. What reads then is not a faded control, it is a
607
+ // handle pressed into a dent. Nothing about a disabled control should look lifted
608
+ // anyway, so the lift goes rather than being dimmed with everything else.
609
+ thumb: NO_SHADOW
610
+ })
611
+ },
612
+ defaultVariants: {
613
+ variant: "secondary",
614
+ size: "md"
615
+ }
616
+ });
617
+
618
+ // src/components/slide-button/slide-button.tsx
619
+
620
+ var SlideButtonRoot = _react.forwardRef.call(void 0, function SlideButton({
621
+ children,
622
+ variant,
623
+ size,
624
+ radius,
625
+ color,
626
+ threshold = DEFAULT_THRESHOLD,
627
+ isConfirmed: controlledConfirmed,
628
+ defaultConfirmed = false,
629
+ onConfirm,
630
+ isDisabled = false,
631
+ accessibilityRole = "button",
632
+ accessibilityState,
633
+ style,
634
+ onLayout,
635
+ ...props
636
+ }, ref) {
637
+ const theme = _chunkIIAQISBGcjs.useXAUITheme.call(void 0);
638
+ const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
639
+ const [trackLength, setTrackLength] = _react.useState.call(void 0, 0);
640
+ const offset = _reactnativereanimated.useSharedValue.call(void 0, 0);
641
+ const reach = Math.min(Math.max(threshold, 0), 1);
642
+ const [confirmed, setConfirmed] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
643
+ value: controlledConfirmed,
644
+ defaultValue: defaultConfirmed
645
+ });
646
+ const selection = {
647
+ variant,
648
+ size,
649
+ radius
650
+ };
651
+ const states = {
652
+ disabled: isDisabled
653
+ };
654
+ const styles = slideButtonRecipe.resolve({
655
+ theme,
656
+ selection,
657
+ states
658
+ });
659
+ const tint = color ? slideButtonRecipe.tint({
660
+ theme,
661
+ color,
662
+ selection,
663
+ states
664
+ }) : void 0;
665
+ const thumb = _reactnative.StyleSheet.flatten([styles.thumb]);
666
+ const thumbSize = typeof thumb.width === "number" ? thumb.width : 0;
667
+ const inset = typeof thumb.start === "number" ? thumb.start : 0;
668
+ const travel = Math.max(trackLength - thumbSize - inset * 2, 0);
669
+ const confirm = _react.useCallback.call(void 0, () => {
670
+ setConfirmed(true);
671
+ _optionalChain([onConfirm, 'optionalCall', _ => _()]);
672
+ }, [onConfirm, setConfirmed]);
673
+ _react.useEffect.call(void 0, () => {
674
+ offset.set(_reactnativereanimated.withSpring.call(void 0, confirmed ? travel : 0, THUMB_SPRING));
675
+ }, [confirmed, travel, offset]);
676
+ const measure = _react.useCallback.call(void 0, event => {
677
+ _optionalChain([onLayout, 'optionalCall', _2 => _2(event)]);
678
+ setTrackLength(event.nativeEvent.layout.width);
679
+ }, [onLayout]);
680
+ const context = _react.useMemo.call(void 0, () => {
681
+ const glyph = _reactnative.StyleSheet.flatten([styles.glyph, _optionalChain([tint, 'optionalAccess', _3 => _3.glyph])]);
682
+ const labelInset = _reactnative.StyleSheet.flatten([styles.label]).start;
683
+ const sweptWidth2 = Math.max(trackLength - (typeof labelInset === "number" ? labelInset : 0) * 2, 0);
684
+ return {
685
+ fillClipStyle: styles.fillClip,
686
+ fillStyle: tint ? [styles.fill, tint.fill] : styles.fill,
687
+ labelStyle: tint ? [styles.label, tint.label] : styles.label,
688
+ labelSweptStyle: [styles.labelSwept, _optionalChain([tint, 'optionalAccess', _4 => _4.labelSwept]), {
689
+ width: sweptWidth2
690
+ }],
691
+ thumbStyle: styles.thumb,
692
+ glyphStyle: tint ? [styles.glyph, tint.glyph] : styles.glyph,
693
+ icon: {
694
+ size: typeof glyph.width === "number" ? glyph.width : void 0,
695
+ // The chevron is on the surface-coloured handle, so its colour is the theme's
696
+ // foreground and not the variant's — `color` (R7) stays on the pill.
697
+ color: theme.colors.foreground
698
+ },
699
+ offset,
700
+ travel,
701
+ thumbSize,
702
+ threshold: reach,
703
+ isDisabled,
704
+ isConfirmed: confirmed,
705
+ confirm,
706
+ trackLength
707
+ };
708
+ }, [styles, tint, theme.colors.foreground, offset, travel, thumbSize, reach, isDisabled, confirmed, confirm, trackLength]);
709
+ const text = _chunkFHNIGHN5cjs.childrenToString.call(void 0, children);
710
+ return /* @__PURE__ */_jsxruntime.jsx.call(void 0, SlideButtonProvider, {
711
+ value: context,
712
+ children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
713
+ ref,
714
+ accessibilityRole,
715
+ accessibilityState: {
716
+ disabled: isDisabled,
717
+ ...accessibilityState
718
+ },
719
+ accessibilityActions: [{
720
+ name: "activate"
721
+ }],
722
+ onAccessibilityAction: event => {
723
+ if (event.nativeEvent.actionName === "activate" && !isDisabled) confirm();
724
+ },
725
+ ...rest,
726
+ onLayout: measure,
727
+ style: [styles.root, _optionalChain([tint, 'optionalAccess', _5 => _5.root]), styleProps, style],
728
+ children: text !== null ? /* @__PURE__ */_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
729
+ children: [/* @__PURE__ */_jsxruntime.jsx.call(void 0, SlideButtonFill, {}), /* @__PURE__ */_jsxruntime.jsx.call(void 0, SlideButtonLabel, {
730
+ children: text
731
+ }), /* @__PURE__ */_jsxruntime.jsx.call(void 0, SlideButtonThumb, {})]
732
+ }) : children
733
+ })
734
+ });
735
+ });
736
+ SlideButtonRoot.displayName = "XAUI.SlideButton.Root";
737
+
738
+ // src/components/slide-button/index.ts
739
+ var SlideButton2 = Object.assign(SlideButtonRoot, {
740
+ Fill: SlideButtonFill,
741
+ Label: SlideButtonLabel,
742
+ Thumb: SlideButtonThumb,
743
+ Icon: SlideButtonIcon
744
+ });
745
+ exports.useSlideButton = useSlideButton;
746
+ exports.SlideButtonFill = SlideButtonFill;
747
+ exports.SlideButtonIcon = SlideButtonIcon;
748
+ exports.SlideButtonLabel = SlideButtonLabel;
749
+ exports.SlideButtonThumb = SlideButtonThumb;
750
+ exports.slideButtonRecipe = slideButtonRecipe;
751
+ exports.SlideButtonRoot = SlideButtonRoot;
752
+ exports.SlideButton = SlideButton2;