@xaui/native 0.9.1-alpha.29 → 0.9.1-alpha.30
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.
- package/dist/{chunk-XYFMSRNJ.js → chunk-27ZRTZEE.js} +14 -10
- package/dist/{chunk-ICR42HHG.js → chunk-3FV4COTM.js} +3 -3
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/{chunk-TFNB2PNI.cjs → chunk-4XPLPQLM.cjs} +13 -11
- package/dist/{chunk-APONC4DB.cjs → chunk-5GO7MAVY.cjs} +12 -10
- package/dist/{chunk-AQNWXJYV.cjs → chunk-5RQ7AZPN.cjs} +20 -16
- package/dist/{chunk-FFEUGWVA.cjs → chunk-5Z4P6WHR.cjs} +11 -9
- package/dist/{chunk-L3Q5TVYE.js → chunk-6RVCGLKZ.js} +60 -58
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/{chunk-Y4BPKSD3.js → chunk-7SEZGVTY.js} +1 -1
- package/dist/chunk-7XKQJQF2.cjs +70 -0
- package/dist/{chunk-7BOFQN2G.js → chunk-A5OCK3C2.js} +7 -5
- package/dist/{chunk-4HELPMAK.js → chunk-BFMTUMTU.js} +81 -101
- package/dist/chunk-BVJQ3UPZ.js +62 -0
- package/dist/{chunk-NG4GFBDR.js → chunk-DFME724B.js} +8 -6
- package/dist/chunk-E2CWBQTV.js +119 -0
- package/dist/chunk-E4TS6632.cjs +314 -0
- package/dist/{chunk-VUEDYW3M.js → chunk-FMZQW35T.js} +15 -11
- package/dist/{chunk-OYZYWWJ6.js → chunk-G7K652GC.js} +4 -2
- package/dist/{chunk-YGOXQSNU.js → chunk-GI24YJPE.js} +100 -206
- package/dist/chunk-GLGU2WFL.cjs +190 -0
- package/dist/{chunk-IG4Q3WQO.cjs → chunk-GPVNCJ3Z.cjs} +74 -95
- package/dist/{chunk-D4SOU26X.js → chunk-GVQOD3VW.js} +5 -3
- package/dist/chunk-KOC3KQIT.js +124 -0
- package/dist/chunk-KPWZLUES.cjs +124 -0
- package/dist/{chunk-SVRZJEDU.cjs → chunk-KWCHSIMI.cjs} +16 -12
- package/dist/{chunk-GCU5A5MM.cjs → chunk-N527BTY4.cjs} +17 -15
- package/dist/{chunk-F3H4TXAY.cjs → chunk-NBFWWQFW.cjs} +16 -12
- package/dist/{chunk-HOIQRGSK.js → chunk-NYRXUGVL.js} +6 -4
- package/dist/{chunk-V56334S3.js → chunk-Q3WFY5N3.js} +9 -7
- package/dist/{chunk-FXHRNUCS.cjs → chunk-QGN2BBJO.cjs} +8 -6
- package/dist/{chunk-J2JJLKLG.cjs → chunk-TGZZ3RZU.cjs} +7 -5
- package/dist/{chunk-YWBTIWT5.cjs → chunk-UBQLKIZC.cjs} +22 -18
- package/dist/{chunk-PMO62QK4.js → chunk-URSKA2VR.js} +1 -114
- package/dist/{chunk-A4RGJBP2.js → chunk-V4WDMM6Z.js} +5 -3
- package/dist/{chunk-FDSQOPJH.js → chunk-VJEER76X.js} +11 -7
- package/dist/{chunk-O5KDIEDH.cjs → chunk-VZBWYWEI.cjs} +25 -24
- package/dist/{chunk-B4W2XNBP.cjs → chunk-WR7YLDVV.cjs} +3 -3
- package/dist/{chunk-5RFRASSB.js → chunk-X4HQ4H2V.js} +16 -15
- package/dist/{chunk-IBEX4XGV.cjs → chunk-XFSW3ZNI.cjs} +13 -11
- package/dist/{chunk-VZGBEGDV.cjs → chunk-XQFAUDR2.cjs} +2 -2
- package/dist/{chunk-V3KS5PPK.js → chunk-YKL6XHM6.js} +14 -10
- package/dist/{chunk-HUZ4AUM2.cjs → chunk-ZP2E2H2G.cjs} +4 -188
- package/dist/{chunk-RZC4VFB5.cjs → chunk-ZSLNGBDS.cjs} +68 -66
- package/dist/components/alert/index.cjs +8 -6
- package/dist/components/alert/index.d.cts +2 -2
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +7 -5
- package/dist/components/button/index.cjs +9 -5
- package/dist/components/button/index.d.cts +9 -4
- package/dist/components/button/index.d.ts +9 -4
- package/dist/components/button/index.js +8 -4
- package/dist/components/card/index.cjs +6 -4
- package/dist/components/card/index.d.cts +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +5 -3
- package/dist/components/checkbox/index.cjs +7 -5
- package/dist/components/checkbox/index.d.cts +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +6 -4
- package/dist/components/chip/index.cjs +8 -6
- package/dist/components/chip/index.d.cts +2 -2
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js +7 -5
- package/dist/components/input/index.cjs +4 -3
- package/dist/components/input/index.d.cts +1 -1
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/index.js +3 -2
- package/dist/components/input-group/index.cjs +6 -5
- package/dist/components/input-group/index.d.cts +1 -1
- package/dist/components/input-group/index.d.ts +1 -1
- package/dist/components/input-group/index.js +5 -4
- package/dist/components/input-otp/index.cjs +4 -3
- package/dist/components/input-otp/index.d.cts +2 -2
- package/dist/components/input-otp/index.d.ts +2 -2
- package/dist/components/input-otp/index.js +3 -2
- package/dist/components/radio/index.cjs +7 -5
- package/dist/components/radio/index.d.cts +1 -1
- package/dist/components/radio/index.d.ts +1 -1
- package/dist/components/radio/index.js +6 -4
- package/dist/components/spinner/index.cjs +16 -0
- package/dist/components/spinner/index.d.cts +104 -0
- package/dist/components/spinner/index.d.ts +104 -0
- package/dist/components/spinner/index.js +16 -0
- package/dist/components/switch/index.cjs +6 -4
- package/dist/components/switch/index.d.cts +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +5 -3
- package/dist/components/text-area/index.cjs +5 -4
- package/dist/components/text-area/index.js +4 -3
- package/dist/components/typography/index.cjs +4 -3
- package/dist/components/typography/index.d.cts +1 -1
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/index.js +3 -2
- package/dist/components/view/index.cjs +4 -3
- package/dist/components/view/index.js +3 -2
- package/dist/{create-recipe-DUo8doTt.d.ts → create-recipe-BdVd2ffi.d.ts} +1 -1
- package/dist/{create-recipe-CWvI5ot3.d.cts → create-recipe-dC7wMfnj.d.cts} +1 -1
- package/dist/{icon.type-Dq4_qePa.d.ts → icon.type-Kml72iSz.d.ts} +1 -1
- package/dist/{icon.type-CF4KiMKl.d.cts → icon.type-d_i9ma-i.d.cts} +1 -1
- package/dist/index.cjs +39 -37
- package/dist/index.d.cts +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.js +73 -71
- package/dist/system/index.cjs +11 -8
- package/dist/system/index.d.cts +4 -4
- package/dist/system/index.d.ts +4 -4
- package/dist/system/index.js +11 -8
- package/package.json +11 -1
- package/dist/chunk-E25JH7W2.cjs +0 -456
|
@@ -36,46 +36,26 @@ function _optionalChain(ops) {
|
|
|
36
36
|
}
|
|
37
37
|
return value;
|
|
38
38
|
}
|
|
39
|
-
var _chunkHUZ4AUM2cjs = require('./chunk-HUZ4AUM2.cjs');
|
|
40
39
|
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var _react = require('react');
|
|
44
|
-
function usePressState(handlers = {}) {
|
|
45
|
-
const [isPressed, setIsPressed] = _react.useState.call(void 0, false);
|
|
46
|
-
const latest = _react.useRef.call(void 0, handlers);
|
|
47
|
-
latest.current = handlers;
|
|
48
|
-
const onPressIn = _react.useCallback.call(void 0, event => {
|
|
49
|
-
setIsPressed(true);
|
|
50
|
-
_optionalChain([latest, 'access', _ => _.current, 'access', _2 => _2.onPressIn, 'optionalCall', _3 => _3(event)]);
|
|
51
|
-
}, []);
|
|
52
|
-
const onPressOut = _react.useCallback.call(void 0, event => {
|
|
53
|
-
setIsPressed(false);
|
|
54
|
-
_optionalChain([latest, 'access', _4 => _4.current, 'access', _5 => _5.onPressOut, 'optionalCall', _6 => _6(event)]);
|
|
55
|
-
}, []);
|
|
56
|
-
const press = _react.useRef.call(void 0, {
|
|
57
|
-
onPressIn,
|
|
58
|
-
onPressOut
|
|
59
|
-
}).current;
|
|
60
|
-
return [isPressed, press];
|
|
61
|
-
}
|
|
40
|
+
var _chunkZP2E2H2Gcjs = require('./chunk-ZP2E2H2G.cjs');
|
|
41
|
+
var _chunkGLGU2WFLcjs = require('./chunk-GLGU2WFL.cjs');
|
|
62
42
|
|
|
63
43
|
// src/system/pressable-feedback/pressable-feedback-context.ts
|
|
64
|
-
|
|
65
|
-
var [FeedbackProvider, useFeedback] =
|
|
44
|
+
var _react = require('react');
|
|
45
|
+
var [FeedbackProvider, useFeedback] = _chunkZP2E2H2Gcjs.createSlotContext.call(void 0, "PressableFeedback");
|
|
66
46
|
var DisableAllContext = _react.createContext.call(void 0, false);
|
|
67
47
|
|
|
68
48
|
// src/system/pressable-feedback/pressable-feedback.animation.ts
|
|
69
49
|
var PRESS_SCALE = 0.985;
|
|
70
50
|
var PRESS_DURATION = 300;
|
|
71
51
|
var SCALE_REFERENCE_WIDTH = 300;
|
|
72
|
-
const
|
|
73
|
-
code: "function
|
|
74
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
75
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
52
|
+
const _worklet_17022770891260_init_data = {
|
|
53
|
+
code: "function pressScaleFor_chunkGPVNCJ3ZCjs1(width){const{SCALE_REFERENCE_WIDTH,PRESS_SCALE}=this.__closure;const coefficient=width>0?SCALE_REFERENCE_WIDTH/width:1;return 1-(1-PRESS_SCALE)*coefficient;}",
|
|
54
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs",
|
|
55
|
+
sourceMap: "{\"version\":3,\"names\":[\"pressScaleFor_chunkGPVNCJ3ZCjs1\",\"width\",\"SCALE_REFERENCE_WIDTH\",\"PRESS_SCALE\",\"__closure\",\"coefficient\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs\"],\"mappings\":\"AAsBA,SAAAA,+BAA8BA,CAAAC,KAAA,QAAAC,qBAAA,CAAAC,WAAA,OAAAC,SAAA,CAE5B,KAAM,CAAAC,WAAW,CAAGJ,KAAK,CAAG,CAAC,CAAGC,qBAAqB,CAAGD,KAAK,CAAG,CAAC,CACjE,MAAO,EAAC,CAAG,CAAC,CAAC,CAAGE,WAAW,EAAIE,WAAW,CAC5C\",\"ignoreList\":[]}"
|
|
76
56
|
};
|
|
77
|
-
const pressScaleFor = function
|
|
78
|
-
|
|
57
|
+
const pressScaleFor = function pressScaleFor_chunkGPVNCJ3ZCjs1Factory({
|
|
58
|
+
_worklet_17022770891260_init_data,
|
|
79
59
|
SCALE_REFERENCE_WIDTH,
|
|
80
60
|
PRESS_SCALE
|
|
81
61
|
}) {
|
|
@@ -88,13 +68,13 @@ const pressScaleFor = function pressScaleFor_chunkIG4Q3WQOCjs1Factory({
|
|
|
88
68
|
SCALE_REFERENCE_WIDTH,
|
|
89
69
|
PRESS_SCALE
|
|
90
70
|
};
|
|
91
|
-
pressScaleFor.__workletHash =
|
|
71
|
+
pressScaleFor.__workletHash = 17022770891260;
|
|
92
72
|
pressScaleFor.__pluginVersion = "0.7.4";
|
|
93
|
-
pressScaleFor.__initData =
|
|
73
|
+
pressScaleFor.__initData = _worklet_17022770891260_init_data;
|
|
94
74
|
pressScaleFor.__stackDetails = _e;
|
|
95
75
|
return pressScaleFor;
|
|
96
76
|
}({
|
|
97
|
-
|
|
77
|
+
_worklet_17022770891260_init_data,
|
|
98
78
|
SCALE_REFERENCE_WIDTH,
|
|
99
79
|
PRESS_SCALE
|
|
100
80
|
});
|
|
@@ -107,26 +87,26 @@ var RIPPLE_CONFIRM_DURATION = 225;
|
|
|
107
87
|
var RIPPLE_FADE_IN = 75;
|
|
108
88
|
var RIPPLE_FADE_OUT_DELAY = 225;
|
|
109
89
|
var RIPPLE_FADE_OUT = 150;
|
|
110
|
-
const
|
|
111
|
-
code: "function
|
|
112
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
113
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
90
|
+
const _worklet_3725045598663_init_data = {
|
|
91
|
+
code: "function rippleRadiusFor_chunkGPVNCJ3ZCjs2(width,height){return Math.sqrt(width*width+height*height)/2+5;}",
|
|
92
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs",
|
|
93
|
+
sourceMap: "{\"version\":3,\"names\":[\"rippleRadiusFor_chunkGPVNCJ3ZCjs2\",\"width\",\"height\",\"Math\",\"sqrt\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs\"],\"mappings\":\"AAoCA,SAAAA,iCAAwCA,CAAAC,KAAA,CAAAC,MAAA,EAEtC,MAAO,CAAAC,IAAI,CAACC,IAAI,CAACH,KAAK,CAAGA,KAAK,CAAGC,MAAM,CAAGA,MAAM,CAAC,CAAG,CAAC,CAAG,CAAC,CAC3D\",\"ignoreList\":[]}"
|
|
114
94
|
};
|
|
115
|
-
const rippleRadiusFor = function
|
|
116
|
-
|
|
95
|
+
const rippleRadiusFor = function rippleRadiusFor_chunkGPVNCJ3ZCjs2Factory({
|
|
96
|
+
_worklet_3725045598663_init_data
|
|
117
97
|
}) {
|
|
118
98
|
const _e = [new global.Error(), 1, -27];
|
|
119
99
|
const rippleRadiusFor = function (width, height) {
|
|
120
100
|
return Math.sqrt(width * width + height * height) / 2 + 5;
|
|
121
101
|
};
|
|
122
102
|
rippleRadiusFor.__closure = {};
|
|
123
|
-
rippleRadiusFor.__workletHash =
|
|
103
|
+
rippleRadiusFor.__workletHash = 3725045598663;
|
|
124
104
|
rippleRadiusFor.__pluginVersion = "0.7.4";
|
|
125
|
-
rippleRadiusFor.__initData =
|
|
105
|
+
rippleRadiusFor.__initData = _worklet_3725045598663_init_data;
|
|
126
106
|
rippleRadiusFor.__stackDetails = _e;
|
|
127
107
|
return rippleRadiusFor;
|
|
128
108
|
}({
|
|
129
|
-
|
|
109
|
+
_worklet_3725045598663_init_data
|
|
130
110
|
});
|
|
131
111
|
var ALL_OFF = {
|
|
132
112
|
scale: false,
|
|
@@ -253,7 +233,7 @@ function radiusFrom(style) {
|
|
|
253
233
|
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
254
234
|
var _jsxruntime = require('react/jsx-runtime');
|
|
255
235
|
var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
|
|
256
|
-
var AnimatedSlot = _reactnativereanimated2.default.createAnimatedComponent(
|
|
236
|
+
var AnimatedSlot = _reactnativereanimated2.default.createAnimatedComponent(_chunkZP2E2H2Gcjs.Slot);
|
|
257
237
|
var PressableFeedback = _react.forwardRef.call(void 0, function PressableFeedback2({
|
|
258
238
|
animation,
|
|
259
239
|
style,
|
|
@@ -261,7 +241,7 @@ var PressableFeedback = _react.forwardRef.call(void 0, function PressableFeedbac
|
|
|
261
241
|
}, ref) {
|
|
262
242
|
const inheritedDisableAll = _react.useContext.call(void 0, DisableAllContext);
|
|
263
243
|
const resolved = resolveAnimation(animation, inheritedDisableAll);
|
|
264
|
-
const [styleProps, rest] =
|
|
244
|
+
const [styleProps, rest] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
|
|
265
245
|
const Feedback = resolved.none ? StaticFeedback : AnimatedFeedback;
|
|
266
246
|
const body = /* @__PURE__ */_jsxruntime.jsx.call(void 0, Feedback, {
|
|
267
247
|
ref,
|
|
@@ -289,7 +269,7 @@ var StaticFeedback = _react.forwardRef.call(void 0, function StaticFeedback2({
|
|
|
289
269
|
animation,
|
|
290
270
|
...surface
|
|
291
271
|
}), [isPressed, animation, surface]);
|
|
292
|
-
const Root = asChild ?
|
|
272
|
+
const Root = asChild ? _chunkZP2E2H2Gcjs.Slot : _reactnative.Pressable;
|
|
293
273
|
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, FeedbackProvider, {
|
|
294
274
|
value: context,
|
|
295
275
|
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, Root, {
|
|
@@ -301,10 +281,10 @@ var StaticFeedback = _react.forwardRef.call(void 0, function StaticFeedback2({
|
|
|
301
281
|
})
|
|
302
282
|
});
|
|
303
283
|
});
|
|
304
|
-
const
|
|
305
|
-
code: "function
|
|
306
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
307
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
284
|
+
const _worklet_9801020630117_init_data = {
|
|
285
|
+
code: "function chunkGPVNCJ3ZCjs3(){const{animation,pressedScale,progress}=this.__closure;if(!animation.scale)return{};return{transform:[{scale:1-(1-pressedScale.value)*progress.value}]};}",
|
|
286
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs",
|
|
287
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkGPVNCJ3ZCjs3\",\"animation\",\"pressedScale\",\"progress\",\"__closure\",\"scale\",\"transform\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs\"],\"mappings\":\"AAmN6E,SAAAA,iBAAMA,CAAA,QAAAC,SAAA,CAAAC,YAAA,CAAAC,QAAA,OAAAC,SAAA,CAE/E,GAAI,CAACH,SAAS,CAACI,KAAK,CAAE,MAAO,CAAC,CAAC,CAC/B,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAED,KAAK,CAAE,CAAC,CAAG,CAAC,CAAC,CAAGH,YAAY,CAACK,KAAK,EAAIJ,QAAQ,CAACI,KAAM,CAAC,CAAE,CAAC,CAClF\",\"ignoreList\":[]}"
|
|
308
288
|
};
|
|
309
289
|
var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2({
|
|
310
290
|
isPressed = false,
|
|
@@ -333,14 +313,14 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
333
313
|
});
|
|
334
314
|
}, [isPressed, progress]);
|
|
335
315
|
const pressedScale = _reactnativereanimated.useDerivedValue.call(void 0, () => pressScaleFor(size.value.width));
|
|
336
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
337
|
-
|
|
316
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkGPVNCJ3ZCjs3Factory({
|
|
317
|
+
_worklet_9801020630117_init_data,
|
|
338
318
|
animation,
|
|
339
319
|
pressedScale,
|
|
340
320
|
progress
|
|
341
321
|
}) {
|
|
342
322
|
const _e = [new global.Error(), -4, -27];
|
|
343
|
-
const
|
|
323
|
+
const chunkGPVNCJ3ZCjs3 = function () {
|
|
344
324
|
if (!animation.scale) return {};
|
|
345
325
|
return {
|
|
346
326
|
transform: [{
|
|
@@ -348,18 +328,18 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
348
328
|
}]
|
|
349
329
|
};
|
|
350
330
|
};
|
|
351
|
-
|
|
331
|
+
chunkGPVNCJ3ZCjs3.__closure = {
|
|
352
332
|
animation,
|
|
353
333
|
pressedScale,
|
|
354
334
|
progress
|
|
355
335
|
};
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return
|
|
336
|
+
chunkGPVNCJ3ZCjs3.__workletHash = 9801020630117;
|
|
337
|
+
chunkGPVNCJ3ZCjs3.__pluginVersion = "0.7.4";
|
|
338
|
+
chunkGPVNCJ3ZCjs3.__initData = _worklet_9801020630117_init_data;
|
|
339
|
+
chunkGPVNCJ3ZCjs3.__stackDetails = _e;
|
|
340
|
+
return chunkGPVNCJ3ZCjs3;
|
|
361
341
|
}({
|
|
362
|
-
|
|
342
|
+
_worklet_9801020630117_init_data,
|
|
363
343
|
animation,
|
|
364
344
|
pressedScale,
|
|
365
345
|
progress
|
|
@@ -392,7 +372,7 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
392
372
|
wave.alpha.value = _reactnativereanimated.withTiming.call(void 0, 1, {
|
|
393
373
|
duration: RIPPLE_FADE_IN
|
|
394
374
|
});
|
|
395
|
-
_optionalChain([onTouchStart, 'optionalCall',
|
|
375
|
+
_optionalChain([onTouchStart, 'optionalCall', _ => _(event)]);
|
|
396
376
|
};
|
|
397
377
|
const releaseWave = () => {
|
|
398
378
|
const wave = waves[nextWave.current === 0 ? 1 : 0];
|
|
@@ -406,11 +386,11 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
406
386
|
};
|
|
407
387
|
const handleTouchEnd = event => {
|
|
408
388
|
releaseWave();
|
|
409
|
-
_optionalChain([onTouchEnd, 'optionalCall',
|
|
389
|
+
_optionalChain([onTouchEnd, 'optionalCall', _2 => _2(event)]);
|
|
410
390
|
};
|
|
411
391
|
const handleTouchCancel = event => {
|
|
412
392
|
releaseWave();
|
|
413
|
-
_optionalChain([onTouchCancel, 'optionalCall',
|
|
393
|
+
_optionalChain([onTouchCancel, 'optionalCall', _3 => _3(event)]);
|
|
414
394
|
};
|
|
415
395
|
const handleLayout = event => {
|
|
416
396
|
const {
|
|
@@ -421,7 +401,7 @@ var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2
|
|
|
421
401
|
width,
|
|
422
402
|
height
|
|
423
403
|
};
|
|
424
|
-
_optionalChain([onLayout, 'optionalCall',
|
|
404
|
+
_optionalChain([onLayout, 'optionalCall', _4 => _4(event)]);
|
|
425
405
|
};
|
|
426
406
|
const Root = asChild ? AnimatedSlot : AnimatedPressable;
|
|
427
407
|
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, FeedbackProvider, {
|
|
@@ -455,7 +435,7 @@ function useSurface(style) {
|
|
|
455
435
|
return _react.useMemo.call(void 0, () => {
|
|
456
436
|
const flat = _reactnative.StyleSheet.flatten(style);
|
|
457
437
|
return {
|
|
458
|
-
ink: inkFor(_optionalChain([flat, 'optionalAccess',
|
|
438
|
+
ink: inkFor(_optionalChain([flat, 'optionalAccess', _5 => _5.backgroundColor]), theme.colors),
|
|
459
439
|
corners: radiusFrom(flat)
|
|
460
440
|
};
|
|
461
441
|
}, [style, theme]);
|
|
@@ -476,7 +456,7 @@ function PressableFeedbackHighlight({
|
|
|
476
456
|
ink,
|
|
477
457
|
corners
|
|
478
458
|
} = useFeedback();
|
|
479
|
-
const [styleProps] =
|
|
459
|
+
const [styleProps] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
|
|
480
460
|
const settings = resolveSlotAnimation(override, animation.highlight, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION);
|
|
481
461
|
const base = [_reactnative.StyleSheet.absoluteFillObject, {
|
|
482
462
|
backgroundColor: ink,
|
|
@@ -501,10 +481,10 @@ function PressableFeedbackHighlight({
|
|
|
501
481
|
}
|
|
502
482
|
PressableFeedbackHighlight.displayName = "XAUI.PressableFeedback.Highlight";
|
|
503
483
|
markOverlay(PressableFeedbackHighlight);
|
|
504
|
-
const
|
|
505
|
-
code: "function
|
|
506
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
507
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
484
|
+
const _worklet_49611572435_init_data = {
|
|
485
|
+
code: "function chunkGPVNCJ3ZCjs4(){const{shown,opacity}=this.__closure;return{opacity:shown.value*opacity};}",
|
|
486
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs",
|
|
487
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkGPVNCJ3ZCjs4\",\"shown\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs\"],\"mappings\":\"AAiW6E,SAAAA,iBAAMA,CAAA,QAAAC,KAAA,CAAAC,OAAA,OAAAC,SAAA,CAE/E,MAAO,CAAED,OAAO,CAAED,KAAK,CAACG,KAAK,CAAGF,OAAQ,CAAC,CAC3C\",\"ignoreList\":[]}"
|
|
508
488
|
};
|
|
509
489
|
function AnimatedHighlight({
|
|
510
490
|
base,
|
|
@@ -520,28 +500,28 @@ function AnimatedHighlight({
|
|
|
520
500
|
duration
|
|
521
501
|
});
|
|
522
502
|
}, [isPressed, shown, duration]);
|
|
523
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
524
|
-
|
|
503
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkGPVNCJ3ZCjs4Factory({
|
|
504
|
+
_worklet_49611572435_init_data,
|
|
525
505
|
shown,
|
|
526
506
|
opacity
|
|
527
507
|
}) {
|
|
528
508
|
const _e = [new global.Error(), -3, -27];
|
|
529
|
-
const
|
|
509
|
+
const chunkGPVNCJ3ZCjs4 = function () {
|
|
530
510
|
return {
|
|
531
511
|
opacity: shown.value * opacity
|
|
532
512
|
};
|
|
533
513
|
};
|
|
534
|
-
|
|
514
|
+
chunkGPVNCJ3ZCjs4.__closure = {
|
|
535
515
|
shown,
|
|
536
516
|
opacity
|
|
537
517
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
return
|
|
518
|
+
chunkGPVNCJ3ZCjs4.__workletHash = 49611572435;
|
|
519
|
+
chunkGPVNCJ3ZCjs4.__pluginVersion = "0.7.4";
|
|
520
|
+
chunkGPVNCJ3ZCjs4.__initData = _worklet_49611572435_init_data;
|
|
521
|
+
chunkGPVNCJ3ZCjs4.__stackDetails = _e;
|
|
522
|
+
return chunkGPVNCJ3ZCjs4;
|
|
543
523
|
}({
|
|
544
|
-
|
|
524
|
+
_worklet_49611572435_init_data,
|
|
545
525
|
shown,
|
|
546
526
|
opacity
|
|
547
527
|
}), [shown, opacity]);
|
|
@@ -564,7 +544,7 @@ function PressableFeedbackRipple({
|
|
|
564
544
|
ink,
|
|
565
545
|
corners
|
|
566
546
|
} = useFeedback();
|
|
567
|
-
const [styleProps] =
|
|
547
|
+
const [styleProps] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
|
|
568
548
|
const waveStyle = [styleProps, style];
|
|
569
549
|
const settings = resolveSlotAnimation(override, animation.ripple, RIPPLE_OPACITY);
|
|
570
550
|
const [size, setSize] = _react.useState.call(void 0, {
|
|
@@ -605,10 +585,10 @@ function PressableFeedbackRipple({
|
|
|
605
585
|
}
|
|
606
586
|
PressableFeedbackRipple.displayName = "XAUI.PressableFeedback.Ripple";
|
|
607
587
|
markOverlay(PressableFeedbackRipple);
|
|
608
|
-
const
|
|
609
|
-
code: "function
|
|
610
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
611
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
588
|
+
const _worklet_4180976500734_init_data = {
|
|
589
|
+
code: "function chunkGPVNCJ3ZCjs5(){const{wave,RIPPLE_START_SCALE,center,opacity,radius}=this.__closure;const t=wave.expand.value;const from=wave.origin.value;const scale=RIPPLE_START_SCALE+(1-RIPPLE_START_SCALE)*t;const x=from.x+(center.x-from.x)*t;const y=from.y+(center.y-from.y)*t;return{opacity:wave.alpha.value*opacity,transform:[{translateX:x-radius},{translateY:y-radius},{scale:scale}]};}",
|
|
590
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs",
|
|
591
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkGPVNCJ3ZCjs5\",\"wave\",\"RIPPLE_START_SCALE\",\"center\",\"opacity\",\"radius\",\"__closure\",\"t\",\"expand\",\"value\",\"from\",\"origin\",\"scale\",\"x\",\"y\",\"alpha\",\"transform\",\"translateX\",\"translateY\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-GPVNCJ3Z.cjs\"],\"mappings\":\"AAia6E,SAAAA,iBAAMA,CAAA,QAAAC,IAAA,CAAAC,kBAAA,CAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA,OAAAC,SAAA,CAE/E,KAAM,CAAAC,CAAC,CAAGN,IAAI,CAACO,MAAM,CAACC,KAAK,CAC3B,KAAM,CAAAC,IAAI,CAAGT,IAAI,CAACU,MAAM,CAACF,KAAK,CAC9B,KAAM,CAAAG,KAAK,CAAGV,kBAAkB,CAAG,CAAC,CAAC,CAAGA,kBAAkB,EAAIK,CAAC,CAC/D,KAAM,CAAAM,CAAC,CAAGH,IAAI,CAACG,CAAC,CAAG,CAACV,MAAM,CAACU,CAAC,CAAGH,IAAI,CAACG,CAAC,EAAIN,CAAC,CAC1C,KAAM,CAAAO,CAAC,CAAGJ,IAAI,CAACI,CAAC,CAAG,CAACX,MAAM,CAACW,CAAC,CAAGJ,IAAI,CAACI,CAAC,EAAIP,CAAC,CAC1C,MAAO,CAELH,OAAO,CAAEH,IAAI,CAACc,KAAK,CAACN,KAAK,CAAGL,OAAO,CACnCY,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,CAAC,CAAGR,MAAO,CAAC,CAAE,CAAEa,UAAU,CAAEJ,CAAC,CAAGT,MAAO,CAAC,CAAE,CAAEO,KAAA,CAAAA,KAAM,CAAC,CAC/E,CAAC,CACH\",\"ignoreList\":[]}"
|
|
612
592
|
};
|
|
613
593
|
function RippleWave({
|
|
614
594
|
wave,
|
|
@@ -618,8 +598,8 @@ function RippleWave({
|
|
|
618
598
|
opacity,
|
|
619
599
|
style
|
|
620
600
|
}) {
|
|
621
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
622
|
-
|
|
601
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkGPVNCJ3ZCjs5Factory({
|
|
602
|
+
_worklet_4180976500734_init_data,
|
|
623
603
|
wave,
|
|
624
604
|
RIPPLE_START_SCALE,
|
|
625
605
|
center,
|
|
@@ -627,7 +607,7 @@ function RippleWave({
|
|
|
627
607
|
radius
|
|
628
608
|
}) {
|
|
629
609
|
const _e = [new global.Error(), -6, -27];
|
|
630
|
-
const
|
|
610
|
+
const chunkGPVNCJ3ZCjs5 = function () {
|
|
631
611
|
const t = wave.expand.value;
|
|
632
612
|
const from = wave.origin.value;
|
|
633
613
|
const scale = RIPPLE_START_SCALE + (1 - RIPPLE_START_SCALE) * t;
|
|
@@ -645,20 +625,20 @@ function RippleWave({
|
|
|
645
625
|
}]
|
|
646
626
|
};
|
|
647
627
|
};
|
|
648
|
-
|
|
628
|
+
chunkGPVNCJ3ZCjs5.__closure = {
|
|
649
629
|
wave,
|
|
650
630
|
RIPPLE_START_SCALE,
|
|
651
631
|
center,
|
|
652
632
|
opacity,
|
|
653
633
|
radius
|
|
654
634
|
};
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
return
|
|
635
|
+
chunkGPVNCJ3ZCjs5.__workletHash = 4180976500734;
|
|
636
|
+
chunkGPVNCJ3ZCjs5.__pluginVersion = "0.7.4";
|
|
637
|
+
chunkGPVNCJ3ZCjs5.__initData = _worklet_4180976500734_init_data;
|
|
638
|
+
chunkGPVNCJ3ZCjs5.__stackDetails = _e;
|
|
639
|
+
return chunkGPVNCJ3ZCjs5;
|
|
660
640
|
}({
|
|
661
|
-
|
|
641
|
+
_worklet_4180976500734_init_data,
|
|
662
642
|
wave,
|
|
663
643
|
RIPPLE_START_SCALE,
|
|
664
644
|
center,
|
|
@@ -694,7 +674,6 @@ var PressableFeedback3 = Object.assign(PressableFeedback, {
|
|
|
694
674
|
Highlight: PressableFeedbackHighlight,
|
|
695
675
|
Ripple: PressableFeedbackRipple
|
|
696
676
|
});
|
|
697
|
-
exports.usePressState = usePressState;
|
|
698
677
|
exports.useFeedback = useFeedback;
|
|
699
678
|
exports.PRESS_SCALE = PRESS_SCALE;
|
|
700
679
|
exports.PRESS_DURATION = PRESS_DURATION;
|
|
@@ -5,11 +5,13 @@ import {
|
|
|
5
5
|
InputLabel,
|
|
6
6
|
InputRoot,
|
|
7
7
|
useInput
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-A5OCK3C2.js";
|
|
9
|
+
import {
|
|
10
|
+
createSlotContext
|
|
11
|
+
} from "./chunk-E2CWBQTV.js";
|
|
9
12
|
import {
|
|
10
|
-
createSlotContext,
|
|
11
13
|
useStyleProps
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-URSKA2VR.js";
|
|
13
15
|
|
|
14
16
|
// src/components/text-area/text-area-field.tsx
|
|
15
17
|
import { forwardRef, useMemo } from "react";
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useRotation
|
|
3
|
+
} from "./chunk-BVJQ3UPZ.js";
|
|
4
|
+
import {
|
|
5
|
+
createRecipe
|
|
6
|
+
} from "./chunk-4GTAZM2C.js";
|
|
7
|
+
import {
|
|
8
|
+
alpha,
|
|
9
|
+
useXAUITheme
|
|
10
|
+
} from "./chunk-A3EGFI6T.js";
|
|
11
|
+
import {
|
|
12
|
+
useStyleProps
|
|
13
|
+
} from "./chunk-URSKA2VR.js";
|
|
14
|
+
|
|
15
|
+
// src/components/spinner/spinner.tsx
|
|
16
|
+
import { forwardRef } from "react";
|
|
17
|
+
import { View } from "react-native";
|
|
18
|
+
import Animated from "react-native-reanimated";
|
|
19
|
+
|
|
20
|
+
// src/components/spinner/spinner.recipe.ts
|
|
21
|
+
var SLOTS = ["root", "arc"];
|
|
22
|
+
var VARIANT_TOKENS = {
|
|
23
|
+
primary: { fg: "accent" },
|
|
24
|
+
secondary: { fg: "accentSoftForeground" },
|
|
25
|
+
default: { fg: "foreground" },
|
|
26
|
+
tertiary: { fg: "muted" },
|
|
27
|
+
success: { fg: "success" },
|
|
28
|
+
warning: { fg: "warning" },
|
|
29
|
+
danger: { fg: "danger" }
|
|
30
|
+
};
|
|
31
|
+
var TRACK_OPACITY = 0.18;
|
|
32
|
+
function sizeAxis(step) {
|
|
33
|
+
return (theme) => {
|
|
34
|
+
const diameter = theme.spacing(step.diameter);
|
|
35
|
+
const stroke = theme.borderWidth.default * step.stroke;
|
|
36
|
+
return {
|
|
37
|
+
root: {
|
|
38
|
+
width: diameter,
|
|
39
|
+
height: diameter,
|
|
40
|
+
borderRadius: diameter / 2,
|
|
41
|
+
borderWidth: stroke
|
|
42
|
+
},
|
|
43
|
+
// The arc is the same ring, drawn one stroke outside the track's box so the two
|
|
44
|
+
// circles land on each other rather than nesting. R13 — `start` and `end`, so the
|
|
45
|
+
// inset mirrors with the layout instead of staying put.
|
|
46
|
+
arc: {
|
|
47
|
+
position: "absolute",
|
|
48
|
+
top: -stroke,
|
|
49
|
+
bottom: -stroke,
|
|
50
|
+
start: -stroke,
|
|
51
|
+
end: -stroke,
|
|
52
|
+
borderRadius: diameter / 2 + stroke,
|
|
53
|
+
borderWidth: stroke
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
var SIZES = {
|
|
59
|
+
xs: { diameter: 4, stroke: 2 },
|
|
60
|
+
sm: { diameter: 5, stroke: 2 },
|
|
61
|
+
md: { diameter: 6, stroke: 2 },
|
|
62
|
+
lg: { diameter: 8, stroke: 3 }
|
|
63
|
+
};
|
|
64
|
+
var spinnerRecipe = createRecipe({
|
|
65
|
+
slots: SLOTS,
|
|
66
|
+
base: () => ({
|
|
67
|
+
// Squircle corners are meaningless on a full circle, and `overflow` would clip the
|
|
68
|
+
// arc that deliberately sits outside this box.
|
|
69
|
+
root: { alignItems: "center", justifyContent: "center" }
|
|
70
|
+
}),
|
|
71
|
+
variantTokens: VARIANT_TOKENS,
|
|
72
|
+
/**
|
|
73
|
+
* One ink, two opacities, and the gap that makes the rotation visible.
|
|
74
|
+
*
|
|
75
|
+
* `borderTopColor: 'transparent'` is structural rather than a colour the theme has an
|
|
76
|
+
* opinion about — it is the quarter of the circle that is missing, and without it a
|
|
77
|
+
* rotating ring is a ring.
|
|
78
|
+
*/
|
|
79
|
+
paint: (_theme, colors) => ({
|
|
80
|
+
root: { borderColor: colors.fg ? alpha(colors.fg, TRACK_OPACITY) : void 0 },
|
|
81
|
+
arc: { borderColor: colors.fg, borderTopColor: "transparent" }
|
|
82
|
+
}),
|
|
83
|
+
variants: {
|
|
84
|
+
size: {
|
|
85
|
+
xs: sizeAxis(SIZES.xs),
|
|
86
|
+
sm: sizeAxis(SIZES.sm),
|
|
87
|
+
md: sizeAxis(SIZES.md),
|
|
88
|
+
lg: sizeAxis(SIZES.lg)
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
defaultVariants: { variant: "primary", size: "md" }
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// src/components/spinner/spinner.tsx
|
|
95
|
+
import { jsx } from "react/jsx-runtime";
|
|
96
|
+
var Spinner = forwardRef(function Spinner2({ variant, size, color, animation = true, style, ...props }, ref) {
|
|
97
|
+
const theme = useXAUITheme();
|
|
98
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
99
|
+
const selection = { variant, size };
|
|
100
|
+
const styles = spinnerRecipe.resolve({ theme, selection });
|
|
101
|
+
const tint = color ? spinnerRecipe.tint({ theme, color, selection }) : void 0;
|
|
102
|
+
const arcStyle = [styles.arc, tint?.arc];
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
View,
|
|
105
|
+
{
|
|
106
|
+
ref,
|
|
107
|
+
accessibilityRole: "progressbar",
|
|
108
|
+
accessibilityState: { busy: animation },
|
|
109
|
+
...rest,
|
|
110
|
+
style: [styles.root, tint?.root, styleProps, style],
|
|
111
|
+
children: animation ? /* @__PURE__ */ jsx(SpinningArc, { style: arcStyle }) : /* @__PURE__ */ jsx(View, { style: arcStyle })
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
Spinner.displayName = "XAUI.Spinner";
|
|
116
|
+
function SpinningArc({ style }) {
|
|
117
|
+
const rotation = useRotation();
|
|
118
|
+
return /* @__PURE__ */ jsx(Animated.View, { style: [style, rotation] });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
spinnerRecipe,
|
|
123
|
+
Spinner
|
|
124
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
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 _chunk7XKQJQF2cjs = require('./chunk-7XKQJQF2.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkFNEUOBCVcjs = require('./chunk-FNEUOBCV.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkGLGU2WFLcjs = require('./chunk-GLGU2WFL.cjs');
|
|
14
|
+
|
|
15
|
+
// src/components/spinner/spinner.tsx
|
|
16
|
+
var _react = require('react');
|
|
17
|
+
var _reactnative = require('react-native');
|
|
18
|
+
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
19
|
+
|
|
20
|
+
// src/components/spinner/spinner.recipe.ts
|
|
21
|
+
var SLOTS = ["root", "arc"];
|
|
22
|
+
var VARIANT_TOKENS = {
|
|
23
|
+
primary: { fg: "accent" },
|
|
24
|
+
secondary: { fg: "accentSoftForeground" },
|
|
25
|
+
default: { fg: "foreground" },
|
|
26
|
+
tertiary: { fg: "muted" },
|
|
27
|
+
success: { fg: "success" },
|
|
28
|
+
warning: { fg: "warning" },
|
|
29
|
+
danger: { fg: "danger" }
|
|
30
|
+
};
|
|
31
|
+
var TRACK_OPACITY = 0.18;
|
|
32
|
+
function sizeAxis(step) {
|
|
33
|
+
return (theme) => {
|
|
34
|
+
const diameter = theme.spacing(step.diameter);
|
|
35
|
+
const stroke = theme.borderWidth.default * step.stroke;
|
|
36
|
+
return {
|
|
37
|
+
root: {
|
|
38
|
+
width: diameter,
|
|
39
|
+
height: diameter,
|
|
40
|
+
borderRadius: diameter / 2,
|
|
41
|
+
borderWidth: stroke
|
|
42
|
+
},
|
|
43
|
+
// The arc is the same ring, drawn one stroke outside the track's box so the two
|
|
44
|
+
// circles land on each other rather than nesting. R13 — `start` and `end`, so the
|
|
45
|
+
// inset mirrors with the layout instead of staying put.
|
|
46
|
+
arc: {
|
|
47
|
+
position: "absolute",
|
|
48
|
+
top: -stroke,
|
|
49
|
+
bottom: -stroke,
|
|
50
|
+
start: -stroke,
|
|
51
|
+
end: -stroke,
|
|
52
|
+
borderRadius: diameter / 2 + stroke,
|
|
53
|
+
borderWidth: stroke
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
var SIZES = {
|
|
59
|
+
xs: { diameter: 4, stroke: 2 },
|
|
60
|
+
sm: { diameter: 5, stroke: 2 },
|
|
61
|
+
md: { diameter: 6, stroke: 2 },
|
|
62
|
+
lg: { diameter: 8, stroke: 3 }
|
|
63
|
+
};
|
|
64
|
+
var spinnerRecipe = _chunkFNEUOBCVcjs.createRecipe.call(void 0, {
|
|
65
|
+
slots: SLOTS,
|
|
66
|
+
base: () => ({
|
|
67
|
+
// Squircle corners are meaningless on a full circle, and `overflow` would clip the
|
|
68
|
+
// arc that deliberately sits outside this box.
|
|
69
|
+
root: { alignItems: "center", justifyContent: "center" }
|
|
70
|
+
}),
|
|
71
|
+
variantTokens: VARIANT_TOKENS,
|
|
72
|
+
/**
|
|
73
|
+
* One ink, two opacities, and the gap that makes the rotation visible.
|
|
74
|
+
*
|
|
75
|
+
* `borderTopColor: 'transparent'` is structural rather than a colour the theme has an
|
|
76
|
+
* opinion about — it is the quarter of the circle that is missing, and without it a
|
|
77
|
+
* rotating ring is a ring.
|
|
78
|
+
*/
|
|
79
|
+
paint: (_theme, colors) => ({
|
|
80
|
+
root: { borderColor: colors.fg ? _chunk57SJ4LJFcjs.alpha.call(void 0, colors.fg, TRACK_OPACITY) : void 0 },
|
|
81
|
+
arc: { borderColor: colors.fg, borderTopColor: "transparent" }
|
|
82
|
+
}),
|
|
83
|
+
variants: {
|
|
84
|
+
size: {
|
|
85
|
+
xs: sizeAxis(SIZES.xs),
|
|
86
|
+
sm: sizeAxis(SIZES.sm),
|
|
87
|
+
md: sizeAxis(SIZES.md),
|
|
88
|
+
lg: sizeAxis(SIZES.lg)
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
defaultVariants: { variant: "primary", size: "md" }
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// src/components/spinner/spinner.tsx
|
|
95
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
96
|
+
var Spinner = _react.forwardRef.call(void 0, function Spinner2({ variant, size, color, animation = true, style, ...props }, ref) {
|
|
97
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0, );
|
|
98
|
+
const [styleProps, rest] = _chunkGLGU2WFLcjs.useStyleProps.call(void 0, props);
|
|
99
|
+
const selection = { variant, size };
|
|
100
|
+
const styles = spinnerRecipe.resolve({ theme, selection });
|
|
101
|
+
const tint = color ? spinnerRecipe.tint({ theme, color, selection }) : void 0;
|
|
102
|
+
const arcStyle = [styles.arc, _optionalChain([tint, 'optionalAccess', _ => _.arc])];
|
|
103
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
104
|
+
_reactnative.View,
|
|
105
|
+
{
|
|
106
|
+
ref,
|
|
107
|
+
accessibilityRole: "progressbar",
|
|
108
|
+
accessibilityState: { busy: animation },
|
|
109
|
+
...rest,
|
|
110
|
+
style: [styles.root, _optionalChain([tint, 'optionalAccess', _2 => _2.root]), styleProps, style],
|
|
111
|
+
children: animation ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SpinningArc, { style: arcStyle }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style: arcStyle })
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
Spinner.displayName = "XAUI.Spinner";
|
|
116
|
+
function SpinningArc({ style }) {
|
|
117
|
+
const rotation = _chunk7XKQJQF2cjs.useRotation.call(void 0, );
|
|
118
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { style: [style, rotation] });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
exports.spinnerRecipe = spinnerRecipe; exports.Spinner = Spinner;
|