@xaui/native 0.9.1-alpha.20 → 0.9.1-alpha.21
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-A4VD4MHK.cjs → chunk-4NE3SLTM.cjs} +63 -125
- package/dist/chunk-5LC6KVL3.cjs +68 -0
- package/dist/{chunk-6ARON3XT.cjs → chunk-APCBIHLR.cjs} +23 -50
- package/dist/chunk-BPBY7ON7.cjs +451 -0
- package/dist/{chunk-WXAME7KB.js → chunk-IBRVMLUF.js} +97 -157
- package/dist/{chunk-4EPS7UBO.js → chunk-ISVUXVFL.js} +18 -43
- package/dist/chunk-JL27KVRT.js +68 -0
- package/dist/chunk-RRRGLRRP.cjs +28 -0
- package/dist/chunk-SGHP76GU.js +28 -0
- package/dist/{chunk-MWXE7D4L.js → chunk-TUJBDS5M.js} +1 -1
- package/dist/{chunk-BHTFIZTQ.cjs → chunk-UL263KGM.cjs} +1 -1
- package/dist/chunk-YRCUALUQ.js +451 -0
- package/dist/components/button/index.cjs +5 -3
- package/dist/components/button/index.d.cts +3 -2
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/button/index.js +4 -2
- package/dist/components/card/index.cjs +20 -0
- package/dist/components/card/index.d.cts +620 -0
- package/dist/components/card/index.d.ts +620 -0
- package/dist/components/card/index.js +20 -0
- package/dist/components/typography/index.d.cts +1 -1
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/{create-recipe-CPXFo2rk.d.ts → create-recipe-CC3NNCqF.d.ts} +6 -1
- package/dist/{create-recipe-C0XXjuow.d.cts → create-recipe-CPBFg7ym.d.cts} +6 -1
- package/dist/icon.type-BkcEPJbK.d.ts +73 -0
- package/dist/icon.type-Cs1tMX0W.d.cts +73 -0
- package/dist/index.cjs +21 -5
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +24 -8
- package/dist/{pressable-feedback.type-BwkKLQlX.d.ts → pressable-feedback.type-DsvWZXWC.d.ts} +4 -72
- package/dist/{pressable-feedback.type-1K8YEOb8.d.cts → pressable-feedback.type-wfeiJz5m.d.cts} +4 -72
- package/dist/system/index.cjs +4 -2
- package/dist/system/index.d.cts +5 -3
- package/dist/system/index.d.ts +5 -3
- package/dist/system/index.js +7 -5
- package/dist/theme/index.cjs +2 -2
- package/dist/theme/index.d.cts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +1 -1
- package/package.json +11 -1
|
@@ -1,82 +1,22 @@
|
|
|
1
1
|
import { Slot, createSlotContext, useStyleProps } from "./chunk-EXX6ATAS.js";
|
|
2
2
|
import { contrastOn, isHex, useXAUITheme } from "./chunk-A3EGFI6T.js";
|
|
3
3
|
|
|
4
|
-
// src/system/icon/icon-context.ts
|
|
5
|
-
import { createContext, useContext } from "react";
|
|
6
|
-
var IconContext = createContext({});
|
|
7
|
-
IconContext.displayName = "XAUI.Icon.Context";
|
|
8
|
-
function useIconContext() {
|
|
9
|
-
return useContext(IconContext);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// src/system/icon/icon.tsx
|
|
13
|
-
import { cloneElement, isValidElement } from "react";
|
|
14
|
-
import { Image } from "react-native";
|
|
15
|
-
import { jsx } from "react/jsx-runtime";
|
|
16
|
-
function Icon(props) {
|
|
17
|
-
const inherited = useIconContext();
|
|
18
|
-
const theme = useXAUITheme();
|
|
19
|
-
const size = props.size ?? inherited.size ?? theme.fontSizes.md;
|
|
20
|
-
const color = props.color ?? inherited.color ?? theme.colors.foreground;
|
|
21
|
-
if (props.as) {
|
|
22
|
-
const Component = props.as;
|
|
23
|
-
return /* @__PURE__ */jsx(Component, {
|
|
24
|
-
size,
|
|
25
|
-
color
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
if (isValidElement(props.children)) {
|
|
29
|
-
return cloneElement(props.children, {
|
|
30
|
-
width: size,
|
|
31
|
-
height: size,
|
|
32
|
-
color
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (props.source) return /* @__PURE__ */jsx(IconImage, {
|
|
36
|
-
...props,
|
|
37
|
-
resolved: {
|
|
38
|
-
size,
|
|
39
|
-
color
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
throw new Error("XAUI: Icon needs one of `as` (an icon component), a raw SVG element as its child, or `source` (an image). It renders nothing on its own.");
|
|
43
|
-
}
|
|
44
|
-
Icon.displayName = "XAUI.Icon";
|
|
45
|
-
function IconImage({
|
|
46
|
-
source,
|
|
47
|
-
style,
|
|
48
|
-
resolved,
|
|
49
|
-
size: _size,
|
|
50
|
-
color: _color,
|
|
51
|
-
...props
|
|
52
|
-
}) {
|
|
53
|
-
const [styleProps] = useStyleProps(props);
|
|
54
|
-
return /* @__PURE__ */jsx(Image, {
|
|
55
|
-
source,
|
|
56
|
-
style: [{
|
|
57
|
-
width: resolved.size,
|
|
58
|
-
height: resolved.size,
|
|
59
|
-
tintColor: resolved.color
|
|
60
|
-
}, styleProps, style]
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
4
|
// src/system/pressable-feedback/pressable-feedback-context.ts
|
|
65
|
-
import { createContext
|
|
5
|
+
import { createContext } from "react";
|
|
66
6
|
var [FeedbackProvider, useFeedback] = createSlotContext("PressableFeedback");
|
|
67
|
-
var DisableAllContext =
|
|
7
|
+
var DisableAllContext = createContext(false);
|
|
68
8
|
|
|
69
9
|
// src/system/pressable-feedback/pressable-feedback.animation.ts
|
|
70
10
|
var PRESS_SCALE = 0.985;
|
|
71
11
|
var PRESS_DURATION = 300;
|
|
72
12
|
var SCALE_REFERENCE_WIDTH = 300;
|
|
73
|
-
const
|
|
74
|
-
code: "function
|
|
75
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
76
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
13
|
+
const _worklet_8662087220269_init_data = {
|
|
14
|
+
code: "function pressScaleFor_chunkIBRVMLUFJs1(width){const{SCALE_REFERENCE_WIDTH,PRESS_SCALE}=this.__closure;const coefficient=width>0?SCALE_REFERENCE_WIDTH/width:1;return 1-(1-PRESS_SCALE)*coefficient;}",
|
|
15
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js",
|
|
16
|
+
sourceMap: "{\"version\":3,\"names\":[\"pressScaleFor_chunkIBRVMLUFJs1\",\"width\",\"SCALE_REFERENCE_WIDTH\",\"PRESS_SCALE\",\"__closure\",\"coefficient\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js\"],\"mappings\":\"AAoBA,SAAAA,8BAA8BA,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\":[]}"
|
|
77
17
|
};
|
|
78
|
-
const pressScaleFor = function
|
|
79
|
-
|
|
18
|
+
const pressScaleFor = function pressScaleFor_chunkIBRVMLUFJs1Factory({
|
|
19
|
+
_worklet_8662087220269_init_data,
|
|
80
20
|
SCALE_REFERENCE_WIDTH,
|
|
81
21
|
PRESS_SCALE
|
|
82
22
|
}) {
|
|
@@ -89,13 +29,13 @@ const pressScaleFor = function pressScaleFor_chunkWXAME7KBJs1Factory({
|
|
|
89
29
|
SCALE_REFERENCE_WIDTH,
|
|
90
30
|
PRESS_SCALE
|
|
91
31
|
};
|
|
92
|
-
pressScaleFor.__workletHash =
|
|
32
|
+
pressScaleFor.__workletHash = 8662087220269;
|
|
93
33
|
pressScaleFor.__pluginVersion = "0.7.4";
|
|
94
|
-
pressScaleFor.__initData =
|
|
34
|
+
pressScaleFor.__initData = _worklet_8662087220269_init_data;
|
|
95
35
|
pressScaleFor.__stackDetails = _e;
|
|
96
36
|
return pressScaleFor;
|
|
97
37
|
}({
|
|
98
|
-
|
|
38
|
+
_worklet_8662087220269_init_data,
|
|
99
39
|
SCALE_REFERENCE_WIDTH,
|
|
100
40
|
PRESS_SCALE
|
|
101
41
|
});
|
|
@@ -108,26 +48,26 @@ var RIPPLE_CONFIRM_DURATION = 225;
|
|
|
108
48
|
var RIPPLE_FADE_IN = 75;
|
|
109
49
|
var RIPPLE_FADE_OUT_DELAY = 225;
|
|
110
50
|
var RIPPLE_FADE_OUT = 150;
|
|
111
|
-
const
|
|
112
|
-
code: "function
|
|
113
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
114
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
51
|
+
const _worklet_10132409620502_init_data = {
|
|
52
|
+
code: "function rippleRadiusFor_chunkIBRVMLUFJs2(width,height){return Math.sqrt(width*width+height*height)/2+5;}",
|
|
53
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js",
|
|
54
|
+
sourceMap: "{\"version\":3,\"names\":[\"rippleRadiusFor_chunkIBRVMLUFJs2\",\"width\",\"height\",\"Math\",\"sqrt\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js\"],\"mappings\":\"AAkCA,SAAAA,gCAAwCA,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\":[]}"
|
|
115
55
|
};
|
|
116
|
-
const rippleRadiusFor = function
|
|
117
|
-
|
|
56
|
+
const rippleRadiusFor = function rippleRadiusFor_chunkIBRVMLUFJs2Factory({
|
|
57
|
+
_worklet_10132409620502_init_data
|
|
118
58
|
}) {
|
|
119
59
|
const _e = [new global.Error(), 1, -27];
|
|
120
60
|
const rippleRadiusFor = function (width, height) {
|
|
121
61
|
return Math.sqrt(width * width + height * height) / 2 + 5;
|
|
122
62
|
};
|
|
123
63
|
rippleRadiusFor.__closure = {};
|
|
124
|
-
rippleRadiusFor.__workletHash =
|
|
64
|
+
rippleRadiusFor.__workletHash = 10132409620502;
|
|
125
65
|
rippleRadiusFor.__pluginVersion = "0.7.4";
|
|
126
|
-
rippleRadiusFor.__initData =
|
|
66
|
+
rippleRadiusFor.__initData = _worklet_10132409620502_init_data;
|
|
127
67
|
rippleRadiusFor.__stackDetails = _e;
|
|
128
68
|
return rippleRadiusFor;
|
|
129
69
|
}({
|
|
130
|
-
|
|
70
|
+
_worklet_10132409620502_init_data
|
|
131
71
|
});
|
|
132
72
|
var ALL_OFF = {
|
|
133
73
|
scale: false,
|
|
@@ -192,7 +132,7 @@ function resolveSlotAnimation(override, enabledByRoot, defaultOpacity, defaultDu
|
|
|
192
132
|
}
|
|
193
133
|
|
|
194
134
|
// src/system/pressable-feedback/pressable-feedback.overlay.ts
|
|
195
|
-
import { Children, Fragment, createElement, isValidElement
|
|
135
|
+
import { Children, Fragment, createElement, isValidElement } from "react";
|
|
196
136
|
var FEEDBACK_OVERLAY = /* @__PURE__ */Symbol.for("xaui.PressableFeedback.overlay");
|
|
197
137
|
function markOverlay(component) {
|
|
198
138
|
return Object.assign(component, {
|
|
@@ -200,7 +140,7 @@ function markOverlay(component) {
|
|
|
200
140
|
});
|
|
201
141
|
}
|
|
202
142
|
function isBareOverlay(node) {
|
|
203
|
-
if (!
|
|
143
|
+
if (!isValidElement(node)) return false;
|
|
204
144
|
const type = node.type;
|
|
205
145
|
if (typeof type !== "function" && typeof type !== "object") return false;
|
|
206
146
|
if (type === null) return false;
|
|
@@ -230,7 +170,7 @@ function feedbackChildren(children, asChild) {
|
|
|
230
170
|
}
|
|
231
171
|
|
|
232
172
|
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
233
|
-
import { forwardRef, useContext
|
|
173
|
+
import { forwardRef, useContext, useEffect, useMemo, useRef } from "react";
|
|
234
174
|
import { Pressable, StyleSheet } from "react-native";
|
|
235
175
|
import Animated, { Easing, useAnimatedStyle, useDerivedValue, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
236
176
|
|
|
@@ -251,7 +191,7 @@ function radiusFrom(style) {
|
|
|
251
191
|
}
|
|
252
192
|
|
|
253
193
|
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
254
|
-
import { jsx
|
|
194
|
+
import { jsx } from "react/jsx-runtime";
|
|
255
195
|
var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
256
196
|
var AnimatedSlot = Animated.createAnimatedComponent(Slot);
|
|
257
197
|
var PressableFeedback = forwardRef(function PressableFeedback2({
|
|
@@ -259,17 +199,17 @@ var PressableFeedback = forwardRef(function PressableFeedback2({
|
|
|
259
199
|
style,
|
|
260
200
|
...props
|
|
261
201
|
}, ref) {
|
|
262
|
-
const inheritedDisableAll =
|
|
202
|
+
const inheritedDisableAll = useContext(DisableAllContext);
|
|
263
203
|
const resolved = resolveAnimation(animation, inheritedDisableAll);
|
|
264
204
|
const [styleProps, rest] = useStyleProps(props);
|
|
265
205
|
const Feedback = resolved.none ? StaticFeedback : AnimatedFeedback;
|
|
266
|
-
const body = /* @__PURE__ */
|
|
206
|
+
const body = /* @__PURE__ */jsx(Feedback, {
|
|
267
207
|
ref,
|
|
268
208
|
animation: resolved,
|
|
269
209
|
style: [styleProps, style],
|
|
270
210
|
...rest
|
|
271
211
|
});
|
|
272
|
-
return resolved.disableAll ? /* @__PURE__ */
|
|
212
|
+
return resolved.disableAll ? /* @__PURE__ */jsx(DisableAllContext.Provider, {
|
|
273
213
|
value: true,
|
|
274
214
|
children: body
|
|
275
215
|
}) : body;
|
|
@@ -290,9 +230,9 @@ var StaticFeedback = forwardRef(function StaticFeedback2({
|
|
|
290
230
|
...surface
|
|
291
231
|
}), [isPressed, animation, surface]);
|
|
292
232
|
const Root = asChild ? Slot : Pressable;
|
|
293
|
-
return /* @__PURE__ */
|
|
233
|
+
return /* @__PURE__ */jsx(FeedbackProvider, {
|
|
294
234
|
value: context,
|
|
295
|
-
children: /* @__PURE__ */
|
|
235
|
+
children: /* @__PURE__ */jsx(Root, {
|
|
296
236
|
ref,
|
|
297
237
|
style,
|
|
298
238
|
disabled: isDisabled,
|
|
@@ -301,15 +241,15 @@ var StaticFeedback = forwardRef(function StaticFeedback2({
|
|
|
301
241
|
})
|
|
302
242
|
});
|
|
303
243
|
});
|
|
304
|
-
const
|
|
305
|
-
code: "function
|
|
306
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
307
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
244
|
+
const _worklet_255922780899_init_data = {
|
|
245
|
+
code: "function chunkIBRVMLUFJs3(){const{pressScaleFor,size}=this.__closure;return pressScaleFor(size.value.width);}",
|
|
246
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js",
|
|
247
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkIBRVMLUFJs3\",\"pressScaleFor\",\"size\",\"__closure\",\"value\",\"width\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js\"],\"mappings\":\"AAgNuC,SAAAA,iBAAA,QAAAC,aAAA,CAAAC,IAAA,OAAAC,SAAA,OAAM,CAAAF,aAAc,CAAAC,IAAK,CAAAE,KAAM,CAAAC,KAAK\",\"ignoreList\":[]}"
|
|
308
248
|
};
|
|
309
|
-
const
|
|
310
|
-
code: "function
|
|
311
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
312
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
249
|
+
const _worklet_1871177836211_init_data = {
|
|
250
|
+
code: "function chunkIBRVMLUFJs4(){const{animation,pressedScale,progress}=this.__closure;if(!animation.scale)return{};return{transform:[{scale:1-(1-pressedScale.value)*progress.value}]};}",
|
|
251
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js",
|
|
252
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkIBRVMLUFJs4\",\"animation\",\"pressedScale\",\"progress\",\"__closure\",\"scale\",\"transform\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js\"],\"mappings\":\"AAiNyC,SAAAA,gBAAMA,CAAA,QAAAC,SAAA,CAAAC,YAAA,CAAAC,QAAA,OAAAC,SAAA,CAE3C,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\":[]}"
|
|
313
253
|
};
|
|
314
254
|
var AnimatedFeedback = forwardRef(function AnimatedFeedback2({
|
|
315
255
|
isPressed = false,
|
|
@@ -337,35 +277,35 @@ var AnimatedFeedback = forwardRef(function AnimatedFeedback2({
|
|
|
337
277
|
easing: Easing.out(Easing.ease)
|
|
338
278
|
});
|
|
339
279
|
}, [isPressed, progress]);
|
|
340
|
-
const pressedScale = useDerivedValue(function
|
|
341
|
-
|
|
280
|
+
const pressedScale = useDerivedValue(function chunkIBRVMLUFJs3Factory({
|
|
281
|
+
_worklet_255922780899_init_data,
|
|
342
282
|
pressScaleFor,
|
|
343
283
|
size
|
|
344
284
|
}) {
|
|
345
285
|
const _e = [new global.Error(), -3, -27];
|
|
346
|
-
const
|
|
347
|
-
|
|
286
|
+
const chunkIBRVMLUFJs3 = () => pressScaleFor(size.value.width);
|
|
287
|
+
chunkIBRVMLUFJs3.__closure = {
|
|
348
288
|
pressScaleFor,
|
|
349
289
|
size
|
|
350
290
|
};
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return
|
|
291
|
+
chunkIBRVMLUFJs3.__workletHash = 255922780899;
|
|
292
|
+
chunkIBRVMLUFJs3.__pluginVersion = "0.7.4";
|
|
293
|
+
chunkIBRVMLUFJs3.__initData = _worklet_255922780899_init_data;
|
|
294
|
+
chunkIBRVMLUFJs3.__stackDetails = _e;
|
|
295
|
+
return chunkIBRVMLUFJs3;
|
|
356
296
|
}({
|
|
357
|
-
|
|
297
|
+
_worklet_255922780899_init_data,
|
|
358
298
|
pressScaleFor,
|
|
359
299
|
size
|
|
360
300
|
}));
|
|
361
|
-
const animatedStyle = useAnimatedStyle(function
|
|
362
|
-
|
|
301
|
+
const animatedStyle = useAnimatedStyle(function chunkIBRVMLUFJs4Factory({
|
|
302
|
+
_worklet_1871177836211_init_data,
|
|
363
303
|
animation,
|
|
364
304
|
pressedScale,
|
|
365
305
|
progress
|
|
366
306
|
}) {
|
|
367
307
|
const _e = [new global.Error(), -4, -27];
|
|
368
|
-
const
|
|
308
|
+
const chunkIBRVMLUFJs4 = function () {
|
|
369
309
|
if (!animation.scale) return {};
|
|
370
310
|
return {
|
|
371
311
|
transform: [{
|
|
@@ -373,18 +313,18 @@ var AnimatedFeedback = forwardRef(function AnimatedFeedback2({
|
|
|
373
313
|
}]
|
|
374
314
|
};
|
|
375
315
|
};
|
|
376
|
-
|
|
316
|
+
chunkIBRVMLUFJs4.__closure = {
|
|
377
317
|
animation,
|
|
378
318
|
pressedScale,
|
|
379
319
|
progress
|
|
380
320
|
};
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
return
|
|
321
|
+
chunkIBRVMLUFJs4.__workletHash = 1871177836211;
|
|
322
|
+
chunkIBRVMLUFJs4.__pluginVersion = "0.7.4";
|
|
323
|
+
chunkIBRVMLUFJs4.__initData = _worklet_1871177836211_init_data;
|
|
324
|
+
chunkIBRVMLUFJs4.__stackDetails = _e;
|
|
325
|
+
return chunkIBRVMLUFJs4;
|
|
386
326
|
}({
|
|
387
|
-
|
|
327
|
+
_worklet_1871177836211_init_data,
|
|
388
328
|
animation,
|
|
389
329
|
pressedScale,
|
|
390
330
|
progress
|
|
@@ -449,9 +389,9 @@ var AnimatedFeedback = forwardRef(function AnimatedFeedback2({
|
|
|
449
389
|
onLayout?.(event);
|
|
450
390
|
};
|
|
451
391
|
const Root = asChild ? AnimatedSlot : AnimatedPressable;
|
|
452
|
-
return /* @__PURE__ */
|
|
392
|
+
return /* @__PURE__ */jsx(FeedbackProvider, {
|
|
453
393
|
value: context,
|
|
454
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */jsx(Root, {
|
|
455
395
|
ref,
|
|
456
396
|
style: [style, animatedStyle],
|
|
457
397
|
disabled: isDisabled,
|
|
@@ -490,7 +430,7 @@ function useSurface(style) {
|
|
|
490
430
|
import { useEffect as useEffect2 } from "react";
|
|
491
431
|
import { StyleSheet as StyleSheet2, View as View2 } from "react-native";
|
|
492
432
|
import Animated2, { useAnimatedStyle as useAnimatedStyle2, useSharedValue as useSharedValue2, withTiming as withTiming2 } from "react-native-reanimated";
|
|
493
|
-
import { Fragment as Fragment2, jsx as
|
|
433
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
494
434
|
function PressableFeedbackHighlight({
|
|
495
435
|
style,
|
|
496
436
|
animation: override,
|
|
@@ -512,7 +452,7 @@ function PressableFeedbackHighlight({
|
|
|
512
452
|
}, corners, styleProps, style];
|
|
513
453
|
if (!progress || !settings.enabled) {
|
|
514
454
|
return /* @__PURE__ */jsxs(Fragment2, {
|
|
515
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */jsx2(View2, {
|
|
516
456
|
style: [base, {
|
|
517
457
|
opacity: isPressed ? settings.opacity : 0
|
|
518
458
|
}]
|
|
@@ -520,7 +460,7 @@ function PressableFeedbackHighlight({
|
|
|
520
460
|
});
|
|
521
461
|
}
|
|
522
462
|
return /* @__PURE__ */jsxs(Fragment2, {
|
|
523
|
-
children: [/* @__PURE__ */
|
|
463
|
+
children: [/* @__PURE__ */jsx2(AnimatedHighlight, {
|
|
524
464
|
base,
|
|
525
465
|
duration: settings.duration,
|
|
526
466
|
opacity: settings.opacity
|
|
@@ -529,10 +469,10 @@ function PressableFeedbackHighlight({
|
|
|
529
469
|
}
|
|
530
470
|
PressableFeedbackHighlight.displayName = "XAUI.PressableFeedback.Highlight";
|
|
531
471
|
markOverlay(PressableFeedbackHighlight);
|
|
532
|
-
const
|
|
533
|
-
code: "function
|
|
534
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
535
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
472
|
+
const _worklet_9313686008259_init_data = {
|
|
473
|
+
code: "function chunkIBRVMLUFJs5(){const{shown,opacity}=this.__closure;return{opacity:shown.value*opacity};}",
|
|
474
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js",
|
|
475
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkIBRVMLUFJs5\",\"shown\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js\"],\"mappings\":\"AA+V0C,SAAAA,gBAAMA,CAAA,QAAAC,KAAA,CAAAC,OAAA,OAAAC,SAAA,CAE5C,MAAO,CAAED,OAAO,CAAED,KAAK,CAACG,KAAK,CAAGF,OAAQ,CAAC,CAC3C\",\"ignoreList\":[]}"
|
|
536
476
|
};
|
|
537
477
|
function AnimatedHighlight({
|
|
538
478
|
base,
|
|
@@ -548,32 +488,32 @@ function AnimatedHighlight({
|
|
|
548
488
|
duration
|
|
549
489
|
});
|
|
550
490
|
}, [isPressed, shown, duration]);
|
|
551
|
-
const animatedStyle = useAnimatedStyle2(function
|
|
552
|
-
|
|
491
|
+
const animatedStyle = useAnimatedStyle2(function chunkIBRVMLUFJs5Factory({
|
|
492
|
+
_worklet_9313686008259_init_data,
|
|
553
493
|
shown,
|
|
554
494
|
opacity
|
|
555
495
|
}) {
|
|
556
496
|
const _e = [new global.Error(), -3, -27];
|
|
557
|
-
const
|
|
497
|
+
const chunkIBRVMLUFJs5 = function () {
|
|
558
498
|
return {
|
|
559
499
|
opacity: shown.value * opacity
|
|
560
500
|
};
|
|
561
501
|
};
|
|
562
|
-
|
|
502
|
+
chunkIBRVMLUFJs5.__closure = {
|
|
563
503
|
shown,
|
|
564
504
|
opacity
|
|
565
505
|
};
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
return
|
|
506
|
+
chunkIBRVMLUFJs5.__workletHash = 9313686008259;
|
|
507
|
+
chunkIBRVMLUFJs5.__pluginVersion = "0.7.4";
|
|
508
|
+
chunkIBRVMLUFJs5.__initData = _worklet_9313686008259_init_data;
|
|
509
|
+
chunkIBRVMLUFJs5.__stackDetails = _e;
|
|
510
|
+
return chunkIBRVMLUFJs5;
|
|
571
511
|
}({
|
|
572
|
-
|
|
512
|
+
_worklet_9313686008259_init_data,
|
|
573
513
|
shown,
|
|
574
514
|
opacity
|
|
575
515
|
}), [shown, opacity]);
|
|
576
|
-
return /* @__PURE__ */
|
|
516
|
+
return /* @__PURE__ */jsx2(Animated2.View, {
|
|
577
517
|
style: [base, animatedStyle]
|
|
578
518
|
});
|
|
579
519
|
}
|
|
@@ -582,7 +522,7 @@ function AnimatedHighlight({
|
|
|
582
522
|
import { useState } from "react";
|
|
583
523
|
import { StyleSheet as StyleSheet3, View as View3 } from "react-native";
|
|
584
524
|
import Animated3, { useAnimatedStyle as useAnimatedStyle3 } from "react-native-reanimated";
|
|
585
|
-
import { Fragment as Fragment3, jsx as
|
|
525
|
+
import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
586
526
|
function PressableFeedbackRipple({
|
|
587
527
|
style,
|
|
588
528
|
animation: override,
|
|
@@ -612,15 +552,15 @@ function PressableFeedbackRipple({
|
|
|
612
552
|
height
|
|
613
553
|
});
|
|
614
554
|
};
|
|
615
|
-
if (!waves || !settings.enabled) return /* @__PURE__ */
|
|
555
|
+
if (!waves || !settings.enabled) return /* @__PURE__ */jsx3(Fragment3, {
|
|
616
556
|
children
|
|
617
557
|
});
|
|
618
558
|
const radius = rippleRadiusFor(size.width, size.height);
|
|
619
559
|
return /* @__PURE__ */jsxs2(Fragment3, {
|
|
620
|
-
children: [/* @__PURE__ */
|
|
560
|
+
children: [/* @__PURE__ */jsx3(View3, {
|
|
621
561
|
style: [StyleSheet3.absoluteFill, styles.clip, corners],
|
|
622
562
|
onLayout: handleLayout,
|
|
623
|
-
children: waves.map((wave, index) => /* @__PURE__ */
|
|
563
|
+
children: waves.map((wave, index) => /* @__PURE__ */jsx3(RippleWave, {
|
|
624
564
|
wave,
|
|
625
565
|
radius,
|
|
626
566
|
center: {
|
|
@@ -636,10 +576,10 @@ function PressableFeedbackRipple({
|
|
|
636
576
|
}
|
|
637
577
|
PressableFeedbackRipple.displayName = "XAUI.PressableFeedback.Ripple";
|
|
638
578
|
markOverlay(PressableFeedbackRipple);
|
|
639
|
-
const
|
|
640
|
-
code: "function
|
|
641
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
642
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
579
|
+
const _worklet_4133379733260_init_data = {
|
|
580
|
+
code: "function chunkIBRVMLUFJs6(){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}]};}",
|
|
581
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-IBRVMLUF.js",
|
|
582
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkIBRVMLUFJs6\",\"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-IBRVMLUF.js\"],\"mappings\":\"AA+Z0C,SAAAA,gBAAMA,CAAA,QAAAC,IAAA,CAAAC,kBAAA,CAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA,OAAAC,SAAA,CAE5C,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\":[]}"
|
|
643
583
|
};
|
|
644
584
|
function RippleWave({
|
|
645
585
|
wave,
|
|
@@ -649,8 +589,8 @@ function RippleWave({
|
|
|
649
589
|
opacity,
|
|
650
590
|
style
|
|
651
591
|
}) {
|
|
652
|
-
const animatedStyle = useAnimatedStyle3(function
|
|
653
|
-
|
|
592
|
+
const animatedStyle = useAnimatedStyle3(function chunkIBRVMLUFJs6Factory({
|
|
593
|
+
_worklet_4133379733260_init_data,
|
|
654
594
|
wave,
|
|
655
595
|
RIPPLE_START_SCALE,
|
|
656
596
|
center,
|
|
@@ -658,7 +598,7 @@ function RippleWave({
|
|
|
658
598
|
radius
|
|
659
599
|
}) {
|
|
660
600
|
const _e = [new global.Error(), -6, -27];
|
|
661
|
-
const
|
|
601
|
+
const chunkIBRVMLUFJs6 = function () {
|
|
662
602
|
const t = wave.expand.value;
|
|
663
603
|
const from = wave.origin.value;
|
|
664
604
|
const scale = RIPPLE_START_SCALE + (1 - RIPPLE_START_SCALE) * t;
|
|
@@ -676,27 +616,27 @@ function RippleWave({
|
|
|
676
616
|
}]
|
|
677
617
|
};
|
|
678
618
|
};
|
|
679
|
-
|
|
619
|
+
chunkIBRVMLUFJs6.__closure = {
|
|
680
620
|
wave,
|
|
681
621
|
RIPPLE_START_SCALE,
|
|
682
622
|
center,
|
|
683
623
|
opacity,
|
|
684
624
|
radius
|
|
685
625
|
};
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
return
|
|
626
|
+
chunkIBRVMLUFJs6.__workletHash = 4133379733260;
|
|
627
|
+
chunkIBRVMLUFJs6.__pluginVersion = "0.7.4";
|
|
628
|
+
chunkIBRVMLUFJs6.__initData = _worklet_4133379733260_init_data;
|
|
629
|
+
chunkIBRVMLUFJs6.__stackDetails = _e;
|
|
630
|
+
return chunkIBRVMLUFJs6;
|
|
691
631
|
}({
|
|
692
|
-
|
|
632
|
+
_worklet_4133379733260_init_data,
|
|
693
633
|
wave,
|
|
694
634
|
RIPPLE_START_SCALE,
|
|
695
635
|
center,
|
|
696
636
|
opacity,
|
|
697
637
|
radius
|
|
698
638
|
}), [wave, radius, center, opacity]);
|
|
699
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */jsx3(Animated3.View, {
|
|
700
640
|
style: [styles.wave, {
|
|
701
641
|
backgroundColor: color,
|
|
702
642
|
width: radius * 2,
|
|
@@ -725,4 +665,4 @@ var PressableFeedback3 = Object.assign(PressableFeedback, {
|
|
|
725
665
|
Highlight: PressableFeedbackHighlight,
|
|
726
666
|
Ripple: PressableFeedbackRipple
|
|
727
667
|
});
|
|
728
|
-
export {
|
|
668
|
+
export { useFeedback, PRESS_SCALE, PRESS_DURATION, SCALE_REFERENCE_WIDTH, pressScaleFor, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION, RIPPLE_OPACITY, RIPPLE_START_SCALE, RIPPLE_EXPAND_DURATION, RIPPLE_CONFIRM_DURATION, RIPPLE_FADE_IN, RIPPLE_FADE_OUT_DELAY, RIPPLE_FADE_OUT, rippleRadiusFor, resolveAnimation, resolveSlotAnimation, FEEDBACK_OVERLAY, markOverlay, PressableFeedback3 as PressableFeedback };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePressState, warnDev } from "./chunk-SGHP76GU.js";
|
|
2
|
+
import { Icon } from "./chunk-JL27KVRT.js";
|
|
3
|
+
import { PressableFeedback } from "./chunk-IBRVMLUF.js";
|
|
2
4
|
import { createRecipe } from "./chunk-N7C4UNUL.js";
|
|
3
5
|
import { childrenToString, createSlotContext, useStyleProps } from "./chunk-EXX6ATAS.js";
|
|
4
6
|
import { useXAUITheme } from "./chunk-A3EGFI6T.js";
|
|
@@ -72,10 +74,10 @@ function ButtonSpinner({
|
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
76
|
ButtonSpinner.displayName = "XAUI.Button.Spinner";
|
|
75
|
-
const
|
|
76
|
-
code: "function
|
|
77
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
78
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
77
|
+
const _worklet_4101557563546_init_data = {
|
|
78
|
+
code: "function chunkISVUXVFLJs1(){const{angle}=this.__closure;return{transform:[{rotate:angle.value+\"deg\"}]};}",
|
|
79
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-ISVUXVFL.js",
|
|
80
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkISVUXVFLJs1\",\"angle\",\"__closure\",\"transform\",\"rotate\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-ISVUXVFL.js\"],\"mappings\":\"AAoFyC,SAAAA,gBAAMA,CAAA,QAAAC,KAAA,OAAAC,SAAA,CAE3C,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,MAAM,CAAKH,KAAK,CAACI,KAAK,MAAM,CAAC,CAAE,CAAC,CACzD\",\"ignoreList\":[]}"
|
|
79
81
|
};
|
|
80
82
|
function SpinningRing({
|
|
81
83
|
style
|
|
@@ -88,28 +90,28 @@ function SpinningRing({
|
|
|
88
90
|
}), -1, false);
|
|
89
91
|
return () => cancelAnimation(angle);
|
|
90
92
|
}, [angle]);
|
|
91
|
-
const animatedStyle = useAnimatedStyle(function
|
|
92
|
-
|
|
93
|
+
const animatedStyle = useAnimatedStyle(function chunkISVUXVFLJs1Factory({
|
|
94
|
+
_worklet_4101557563546_init_data,
|
|
93
95
|
angle
|
|
94
96
|
}) {
|
|
95
97
|
const _e = [new global.Error(), -2, -27];
|
|
96
|
-
const
|
|
98
|
+
const chunkISVUXVFLJs1 = function () {
|
|
97
99
|
return {
|
|
98
100
|
transform: [{
|
|
99
101
|
rotate: `${angle.value}deg`
|
|
100
102
|
}]
|
|
101
103
|
};
|
|
102
104
|
};
|
|
103
|
-
|
|
105
|
+
chunkISVUXVFLJs1.__closure = {
|
|
104
106
|
angle
|
|
105
107
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return
|
|
108
|
+
chunkISVUXVFLJs1.__workletHash = 4101557563546;
|
|
109
|
+
chunkISVUXVFLJs1.__pluginVersion = "0.7.4";
|
|
110
|
+
chunkISVUXVFLJs1.__initData = _worklet_4101557563546_init_data;
|
|
111
|
+
chunkISVUXVFLJs1.__stackDetails = _e;
|
|
112
|
+
return chunkISVUXVFLJs1;
|
|
111
113
|
}({
|
|
112
|
-
|
|
114
|
+
_worklet_4101557563546_init_data,
|
|
113
115
|
angle
|
|
114
116
|
}), [angle]);
|
|
115
117
|
return /* @__PURE__ */jsx3(Animated.View, {
|
|
@@ -121,33 +123,6 @@ function SpinningRing({
|
|
|
121
123
|
import { forwardRef as forwardRef2, useMemo } from "react";
|
|
122
124
|
import { StyleSheet } from "react-native";
|
|
123
125
|
|
|
124
|
-
// src/hooks/use-press-state.ts
|
|
125
|
-
import { useCallback, useRef, useState } from "react";
|
|
126
|
-
function usePressState(handlers = {}) {
|
|
127
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
128
|
-
const latest = useRef(handlers);
|
|
129
|
-
latest.current = handlers;
|
|
130
|
-
const onPressIn = useCallback(event => {
|
|
131
|
-
setIsPressed(true);
|
|
132
|
-
latest.current.onPressIn?.(event);
|
|
133
|
-
}, []);
|
|
134
|
-
const onPressOut = useCallback(event => {
|
|
135
|
-
setIsPressed(false);
|
|
136
|
-
latest.current.onPressOut?.(event);
|
|
137
|
-
}, []);
|
|
138
|
-
const press = useRef({
|
|
139
|
-
onPressIn,
|
|
140
|
-
onPressOut
|
|
141
|
-
}).current;
|
|
142
|
-
return [isPressed, press];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// src/utils/warn-dev.ts
|
|
146
|
-
function warnDev(message) {
|
|
147
|
-
if (typeof __DEV__ !== "undefined" && !__DEV__) return;
|
|
148
|
-
console.warn(`XAUI: ${message}`);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
126
|
// src/components/button/button.recipe.ts
|
|
152
127
|
var SLOTS = ["root", "label", "icon", "spinner"];
|
|
153
128
|
var VARIANT_TOKENS = {
|
|
@@ -493,4 +468,4 @@ var Button2 = Object.assign(ButtonRoot, {
|
|
|
493
468
|
Icon: ButtonIcon,
|
|
494
469
|
Spinner: ButtonSpinner
|
|
495
470
|
});
|
|
496
|
-
export { useButton,
|
|
471
|
+
export { useButton, buttonRecipe, Button2 as Button };
|