@xaui/native 0.9.1-alpha.3 → 0.9.1-alpha.31
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-3FV4COTM.js +68 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-42FMGB5M.js +661 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4XPLPQLM.cjs +147 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5GO7MAVY.cjs +74 -0
- package/dist/chunk-5PTBRJM7.cjs +346 -0
- package/dist/chunk-5RQ7AZPN.cjs +455 -0
- package/dist/chunk-5Z4P6WHR.cjs +525 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7SEZGVTY.js +62 -0
- package/dist/chunk-7XKQJQF2.cjs +70 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-A5OCK3C2.js +525 -0
- package/dist/chunk-AETWQQWU.cjs +92 -0
- package/dist/chunk-ANNUYP55.cjs +431 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BFMTUMTU.js +669 -0
- package/dist/chunk-BVJQ3UPZ.js +62 -0
- package/dist/chunk-DFME724B.js +147 -0
- package/dist/chunk-E2CWBQTV.js +119 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7K652GC.js +145 -0
- package/dist/chunk-GGW42MY4.js +20 -0
- package/dist/chunk-GLGU2WFL.cjs +190 -0
- package/dist/chunk-GPVNCJ3Z.cjs +696 -0
- package/dist/chunk-GVQOD3VW.js +74 -0
- package/dist/chunk-IHOCANCQ.js +293 -0
- package/dist/chunk-JDFV4W6N.cjs +700 -0
- package/dist/chunk-KOC3KQIT.js +124 -0
- package/dist/chunk-KPWZLUES.cjs +124 -0
- package/dist/chunk-L7JN6OBQ.cjs +314 -0
- package/dist/chunk-MC7SY2QH.cjs +20 -0
- package/dist/chunk-MDVSCWJI.js +314 -0
- package/dist/chunk-N527BTY4.cjs +366 -0
- package/dist/chunk-NYRXUGVL.js +104 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-OHEHPQLC.cjs} +72 -72
- package/dist/chunk-Q3WFY5N3.js +366 -0
- package/dist/chunk-QGN2BBJO.cjs +104 -0
- package/dist/chunk-RDTKAAHX.js +346 -0
- package/dist/chunk-TGZZ3RZU.cjs +86 -0
- package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
- package/dist/chunk-URSKA2VR.js +190 -0
- package/dist/chunk-V4WDMM6Z.js +86 -0
- package/dist/chunk-VJEER76X.js +455 -0
- package/dist/chunk-VZBWYWEI.cjs +736 -0
- package/dist/chunk-WR7YLDVV.cjs +68 -0
- package/dist/chunk-X4HQ4H2V.js +701 -0
- package/dist/chunk-XFSW3ZNI.cjs +145 -0
- package/dist/chunk-XQFAUDR2.cjs +62 -0
- package/dist/chunk-ZH5XVNHG.js +92 -0
- package/dist/chunk-ZH6BHLQR.js +431 -0
- package/dist/chunk-ZP2E2H2G.cjs +119 -0
- package/dist/chunk-ZVWXM3UK.cjs +293 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/alert/index.cjs +20 -0
- package/dist/components/alert/index.d.cts +169 -0
- package/dist/components/alert/index.d.ts +169 -0
- package/dist/components/alert/index.js +20 -0
- package/dist/components/button/index.cjs +21 -0
- package/dist/components/button/index.d.cts +613 -0
- package/dist/components/button/index.d.ts +613 -0
- package/dist/components/button/index.js +21 -0
- package/dist/components/card/index.cjs +22 -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 +22 -0
- package/dist/components/checkbox/index.cjs +26 -0
- package/dist/components/checkbox/index.d.cts +1136 -0
- package/dist/components/checkbox/index.d.ts +1136 -0
- package/dist/components/checkbox/index.js +26 -0
- package/dist/components/chip/index.cjs +20 -0
- package/dist/components/chip/index.d.cts +608 -0
- package/dist/components/chip/index.d.ts +608 -0
- package/dist/components/chip/index.js +20 -0
- package/dist/components/divider/index.cjs +13 -0
- package/dist/components/divider/index.d.cts +117 -0
- package/dist/components/divider/index.d.ts +117 -0
- package/dist/components/divider/index.js +13 -0
- package/dist/components/input/index.cjs +25 -0
- package/dist/components/input/index.d.cts +205 -0
- package/dist/components/input/index.d.ts +205 -0
- package/dist/components/input/index.js +25 -0
- package/dist/components/input-group/index.cjs +27 -0
- package/dist/components/input-group/index.d.cts +270 -0
- package/dist/components/input-group/index.d.ts +270 -0
- package/dist/components/input-group/index.js +27 -0
- package/dist/components/input-otp/index.cjs +29 -0
- package/dist/components/input-otp/index.d.cts +325 -0
- package/dist/components/input-otp/index.d.ts +325 -0
- package/dist/components/input-otp/index.js +29 -0
- package/dist/components/radio/index.cjs +26 -0
- package/dist/components/radio/index.d.cts +1102 -0
- package/dist/components/radio/index.d.ts +1102 -0
- package/dist/components/radio/index.js +26 -0
- 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 +27 -0
- package/dist/components/switch/index.d.cts +1154 -0
- package/dist/components/switch/index.d.ts +1154 -0
- package/dist/components/switch/index.js +27 -0
- package/dist/components/text-area/index.cjs +14 -0
- package/dist/components/text-area/index.d.cts +73 -0
- package/dist/components/text-area/index.d.ts +73 -0
- package/dist/components/text-area/index.js +14 -0
- package/dist/components/typography/index.cjs +15 -0
- package/dist/components/typography/index.d.cts +116 -0
- package/dist/components/typography/index.d.ts +116 -0
- package/dist/components/typography/index.js +15 -0
- package/dist/components/view/index.cjs +17 -0
- package/dist/components/view/index.d.cts +152 -0
- package/dist/components/view/index.d.ts +152 -0
- package/dist/components/view/index.js +17 -0
- package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
- package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
- package/dist/icon.type-Kml72iSz.d.ts +73 -0
- package/dist/icon.type-d_i9ma-i.d.cts +73 -0
- package/dist/index.cjs +252 -4
- package/dist/index.d.cts +110 -4
- package/dist/index.d.ts +110 -4
- package/dist/index.js +271 -23
- package/dist/input.type-BUMDlzL9.d.cts +167 -0
- package/dist/input.type-D2qgi03E.d.ts +167 -0
- package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
- package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
- package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
- package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
- package/dist/system/index.cjs +60 -3
- package/dist/system/index.d.cts +347 -181
- package/dist/system/index.d.ts +347 -181
- package/dist/system/index.js +71 -14
- package/dist/theme/index.cjs +4 -3
- package/dist/theme/index.d.cts +34 -23
- package/dist/theme/index.d.ts +34 -23
- package/dist/theme/index.js +3 -2
- package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
- package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
- package/package.json +184 -18
- package/dist/chunk-QAMNNTGM.js +0 -637
- package/dist/chunk-V63JO65F.cjs +0 -637
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
import { contrastOn, isHex, useXAUITheme } from "./chunk-A3EGFI6T.js";
|
|
2
|
+
import { Slot, createSlotContext } from "./chunk-E2CWBQTV.js";
|
|
3
|
+
import { useStyleProps } from "./chunk-URSKA2VR.js";
|
|
4
|
+
|
|
5
|
+
// src/system/pressable-feedback/pressable-feedback-context.ts
|
|
6
|
+
import { createContext } from "react";
|
|
7
|
+
var [FeedbackProvider, useFeedback] = createSlotContext("PressableFeedback");
|
|
8
|
+
var DisableAllContext = createContext(false);
|
|
9
|
+
|
|
10
|
+
// src/system/pressable-feedback/pressable-feedback.animation.ts
|
|
11
|
+
var PRESS_SCALE = 0.985;
|
|
12
|
+
var PRESS_DURATION = 300;
|
|
13
|
+
var SCALE_REFERENCE_WIDTH = 300;
|
|
14
|
+
const _worklet_17312197456628_init_data = {
|
|
15
|
+
code: "function pressScaleFor_chunkBFMTUMTUJs1(width){const{SCALE_REFERENCE_WIDTH,PRESS_SCALE}=this.__closure;const coefficient=width>0?SCALE_REFERENCE_WIDTH/width:1;return 1-(1-PRESS_SCALE)*coefficient;}",
|
|
16
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js",
|
|
17
|
+
sourceMap: "{\"version\":3,\"names\":[\"pressScaleFor_chunkBFMTUMTUJs1\",\"width\",\"SCALE_REFERENCE_WIDTH\",\"PRESS_SCALE\",\"__closure\",\"coefficient\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js\"],\"mappings\":\"AAsBA,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\":[]}"
|
|
18
|
+
};
|
|
19
|
+
const pressScaleFor = function pressScaleFor_chunkBFMTUMTUJs1Factory({
|
|
20
|
+
_worklet_17312197456628_init_data,
|
|
21
|
+
SCALE_REFERENCE_WIDTH,
|
|
22
|
+
PRESS_SCALE
|
|
23
|
+
}) {
|
|
24
|
+
const _e = [new global.Error(), -3, -27];
|
|
25
|
+
const pressScaleFor = function (width) {
|
|
26
|
+
const coefficient = width > 0 ? SCALE_REFERENCE_WIDTH / width : 1;
|
|
27
|
+
return 1 - (1 - PRESS_SCALE) * coefficient;
|
|
28
|
+
};
|
|
29
|
+
pressScaleFor.__closure = {
|
|
30
|
+
SCALE_REFERENCE_WIDTH,
|
|
31
|
+
PRESS_SCALE
|
|
32
|
+
};
|
|
33
|
+
pressScaleFor.__workletHash = 17312197456628;
|
|
34
|
+
pressScaleFor.__pluginVersion = "0.7.4";
|
|
35
|
+
pressScaleFor.__initData = _worklet_17312197456628_init_data;
|
|
36
|
+
pressScaleFor.__stackDetails = _e;
|
|
37
|
+
return pressScaleFor;
|
|
38
|
+
}({
|
|
39
|
+
_worklet_17312197456628_init_data,
|
|
40
|
+
SCALE_REFERENCE_WIDTH,
|
|
41
|
+
PRESS_SCALE
|
|
42
|
+
});
|
|
43
|
+
var HIGHLIGHT_OPACITY = 0.1;
|
|
44
|
+
var HIGHLIGHT_DURATION = 200;
|
|
45
|
+
var RIPPLE_OPACITY = 0.1;
|
|
46
|
+
var RIPPLE_START_SCALE = 0.3;
|
|
47
|
+
var RIPPLE_EXPAND_DURATION = 1e3;
|
|
48
|
+
var RIPPLE_CONFIRM_DURATION = 225;
|
|
49
|
+
var RIPPLE_FADE_IN = 75;
|
|
50
|
+
var RIPPLE_FADE_OUT_DELAY = 225;
|
|
51
|
+
var RIPPLE_FADE_OUT = 150;
|
|
52
|
+
const _worklet_549142897807_init_data = {
|
|
53
|
+
code: "function rippleRadiusFor_chunkBFMTUMTUJs2(width,height){return Math.sqrt(width*width+height*height)/2+5;}",
|
|
54
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js",
|
|
55
|
+
sourceMap: "{\"version\":3,\"names\":[\"rippleRadiusFor_chunkBFMTUMTUJs2\",\"width\",\"height\",\"Math\",\"sqrt\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js\"],\"mappings\":\"AAoCA,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\":[]}"
|
|
56
|
+
};
|
|
57
|
+
const rippleRadiusFor = function rippleRadiusFor_chunkBFMTUMTUJs2Factory({
|
|
58
|
+
_worklet_549142897807_init_data
|
|
59
|
+
}) {
|
|
60
|
+
const _e = [new global.Error(), 1, -27];
|
|
61
|
+
const rippleRadiusFor = function (width, height) {
|
|
62
|
+
return Math.sqrt(width * width + height * height) / 2 + 5;
|
|
63
|
+
};
|
|
64
|
+
rippleRadiusFor.__closure = {};
|
|
65
|
+
rippleRadiusFor.__workletHash = 549142897807;
|
|
66
|
+
rippleRadiusFor.__pluginVersion = "0.7.4";
|
|
67
|
+
rippleRadiusFor.__initData = _worklet_549142897807_init_data;
|
|
68
|
+
rippleRadiusFor.__stackDetails = _e;
|
|
69
|
+
return rippleRadiusFor;
|
|
70
|
+
}({
|
|
71
|
+
_worklet_549142897807_init_data
|
|
72
|
+
});
|
|
73
|
+
var ALL_OFF = {
|
|
74
|
+
scale: false,
|
|
75
|
+
highlight: false,
|
|
76
|
+
ripple: false,
|
|
77
|
+
none: true
|
|
78
|
+
};
|
|
79
|
+
var ALL_ON = {
|
|
80
|
+
scale: true,
|
|
81
|
+
highlight: true,
|
|
82
|
+
ripple: true,
|
|
83
|
+
none: false
|
|
84
|
+
};
|
|
85
|
+
function resolveAnimation(animation, inheritedDisableAll = false) {
|
|
86
|
+
if (inheritedDisableAll) return {
|
|
87
|
+
...ALL_OFF,
|
|
88
|
+
disableAll: true
|
|
89
|
+
};
|
|
90
|
+
if (animation === false || animation === "disabled") {
|
|
91
|
+
return {
|
|
92
|
+
...ALL_OFF,
|
|
93
|
+
disableAll: false
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (animation === "disable-all") return {
|
|
97
|
+
...ALL_OFF,
|
|
98
|
+
disableAll: true
|
|
99
|
+
};
|
|
100
|
+
if (animation === void 0 || animation === true) {
|
|
101
|
+
return {
|
|
102
|
+
...ALL_ON,
|
|
103
|
+
disableAll: false
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const scale = animation.scale ?? true;
|
|
107
|
+
const highlight = animation.highlight ?? true;
|
|
108
|
+
const ripple = animation.ripple ?? true;
|
|
109
|
+
return {
|
|
110
|
+
scale,
|
|
111
|
+
highlight,
|
|
112
|
+
ripple,
|
|
113
|
+
none: !scale && !highlight && !ripple,
|
|
114
|
+
disableAll: false
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function resolveSlotAnimation(override, enabledByRoot, defaultOpacity, defaultDuration = PRESS_DURATION) {
|
|
118
|
+
const fallback = {
|
|
119
|
+
enabled: enabledByRoot,
|
|
120
|
+
duration: defaultDuration,
|
|
121
|
+
opacity: defaultOpacity
|
|
122
|
+
};
|
|
123
|
+
if (override === void 0 || override === true) return fallback;
|
|
124
|
+
if (override === false) return {
|
|
125
|
+
...fallback,
|
|
126
|
+
enabled: false
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
enabled: enabledByRoot,
|
|
130
|
+
duration: override.duration ?? defaultDuration,
|
|
131
|
+
opacity: override.opacity ?? defaultOpacity
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// src/system/pressable-feedback/pressable-feedback.overlay.ts
|
|
136
|
+
import { Children, Fragment, createElement, isValidElement } from "react";
|
|
137
|
+
var FEEDBACK_OVERLAY = /* @__PURE__ */Symbol.for("xaui.PressableFeedback.overlay");
|
|
138
|
+
function markOverlay(component) {
|
|
139
|
+
return Object.assign(component, {
|
|
140
|
+
[FEEDBACK_OVERLAY]: true
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function isBareOverlay(node) {
|
|
144
|
+
if (!isValidElement(node)) return false;
|
|
145
|
+
const type = node.type;
|
|
146
|
+
if (typeof type !== "function" && typeof type !== "object") return false;
|
|
147
|
+
if (type === null) return false;
|
|
148
|
+
if (type[FEEDBACK_OVERLAY] !== true) return false;
|
|
149
|
+
return node.props.children === void 0;
|
|
150
|
+
}
|
|
151
|
+
function partitionOverlays(children) {
|
|
152
|
+
const all = Children.toArray(children);
|
|
153
|
+
const overlays = all.filter(isBareOverlay);
|
|
154
|
+
if (overlays.length === 0) return {
|
|
155
|
+
overlays: null,
|
|
156
|
+
content: children
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
overlays,
|
|
160
|
+
content: all.filter(node => !isBareOverlay(node))
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function feedbackChildren(children, asChild) {
|
|
164
|
+
if (asChild) return children;
|
|
165
|
+
const {
|
|
166
|
+
overlays,
|
|
167
|
+
content
|
|
168
|
+
} = partitionOverlays(children);
|
|
169
|
+
if (overlays === null) return content;
|
|
170
|
+
return createElement(Fragment, null, overlays, content);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
174
|
+
import { forwardRef, useContext, useEffect, useMemo, useRef } from "react";
|
|
175
|
+
import { Pressable, StyleSheet } from "react-native";
|
|
176
|
+
import Animated, { Easing, useAnimatedStyle, useDerivedValue, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
177
|
+
|
|
178
|
+
// src/system/pressable-feedback/pressable-feedback.surface.ts
|
|
179
|
+
function inkFor(background, colors) {
|
|
180
|
+
if (typeof background !== "string" || !isHex(background)) return colors.foreground;
|
|
181
|
+
return contrastOn(background, colors.snow, colors.eclipse);
|
|
182
|
+
}
|
|
183
|
+
var RADIUS_KEYS = ["borderRadius", "borderStartStartRadius", "borderStartEndRadius", "borderEndStartRadius", "borderEndEndRadius"];
|
|
184
|
+
function radiusFrom(style) {
|
|
185
|
+
if (!style) return {};
|
|
186
|
+
const radius = {};
|
|
187
|
+
for (const key of RADIUS_KEYS) {
|
|
188
|
+
const value = style[key];
|
|
189
|
+
if (value !== void 0) radius[key] = value;
|
|
190
|
+
}
|
|
191
|
+
return radius;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
195
|
+
import { jsx } from "react/jsx-runtime";
|
|
196
|
+
var AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
197
|
+
var AnimatedSlot = Animated.createAnimatedComponent(Slot);
|
|
198
|
+
var PressableFeedback = forwardRef(function PressableFeedback2({
|
|
199
|
+
animation,
|
|
200
|
+
style,
|
|
201
|
+
...props
|
|
202
|
+
}, ref) {
|
|
203
|
+
const inheritedDisableAll = useContext(DisableAllContext);
|
|
204
|
+
const resolved = resolveAnimation(animation, inheritedDisableAll);
|
|
205
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
206
|
+
const Feedback = resolved.none ? StaticFeedback : AnimatedFeedback;
|
|
207
|
+
const body = /* @__PURE__ */jsx(Feedback, {
|
|
208
|
+
ref,
|
|
209
|
+
animation: resolved,
|
|
210
|
+
style: [styleProps, style],
|
|
211
|
+
...rest
|
|
212
|
+
});
|
|
213
|
+
return resolved.disableAll ? /* @__PURE__ */jsx(DisableAllContext.Provider, {
|
|
214
|
+
value: true,
|
|
215
|
+
children: body
|
|
216
|
+
}) : body;
|
|
217
|
+
});
|
|
218
|
+
var StaticFeedback = forwardRef(function StaticFeedback2({
|
|
219
|
+
isPressed = false,
|
|
220
|
+
isDisabled,
|
|
221
|
+
asChild = false,
|
|
222
|
+
animation,
|
|
223
|
+
children,
|
|
224
|
+
style,
|
|
225
|
+
...rest
|
|
226
|
+
}, ref) {
|
|
227
|
+
const surface = useSurface(style);
|
|
228
|
+
const context = useMemo(() => ({
|
|
229
|
+
isPressed,
|
|
230
|
+
animation,
|
|
231
|
+
...surface
|
|
232
|
+
}), [isPressed, animation, surface]);
|
|
233
|
+
const Root = asChild ? Slot : Pressable;
|
|
234
|
+
return /* @__PURE__ */jsx(FeedbackProvider, {
|
|
235
|
+
value: context,
|
|
236
|
+
children: /* @__PURE__ */jsx(Root, {
|
|
237
|
+
ref,
|
|
238
|
+
style,
|
|
239
|
+
disabled: isDisabled,
|
|
240
|
+
...rest,
|
|
241
|
+
children: feedbackChildren(children, asChild)
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
const _worklet_12010692297274_init_data = {
|
|
246
|
+
code: "function chunkBFMTUMTUJs3(){const{pressScaleFor,size}=this.__closure;return pressScaleFor(size.value.width);}",
|
|
247
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js",
|
|
248
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkBFMTUMTUJs3\",\"pressScaleFor\",\"size\",\"__closure\",\"value\",\"width\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js\"],\"mappings\":\"AAkNuC,SAAAA,iBAAA,QAAAC,aAAA,CAAAC,IAAA,OAAAC,SAAA,OAAM,CAAAF,aAAc,CAAAC,IAAK,CAAAE,KAAM,CAAAC,KAAK\",\"ignoreList\":[]}"
|
|
249
|
+
};
|
|
250
|
+
const _worklet_10297242211818_init_data = {
|
|
251
|
+
code: "function chunkBFMTUMTUJs4(){const{animation,pressedScale,progress}=this.__closure;if(!animation.scale)return{};return{transform:[{scale:1-(1-pressedScale.value)*progress.value}]};}",
|
|
252
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js",
|
|
253
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkBFMTUMTUJs4\",\"animation\",\"pressedScale\",\"progress\",\"__closure\",\"scale\",\"transform\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js\"],\"mappings\":\"AAmNyC,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\":[]}"
|
|
254
|
+
};
|
|
255
|
+
var AnimatedFeedback = forwardRef(function AnimatedFeedback2({
|
|
256
|
+
isPressed = false,
|
|
257
|
+
isDisabled,
|
|
258
|
+
asChild = false,
|
|
259
|
+
animation,
|
|
260
|
+
children,
|
|
261
|
+
style,
|
|
262
|
+
onLayout,
|
|
263
|
+
onTouchStart,
|
|
264
|
+
onTouchEnd,
|
|
265
|
+
onTouchCancel,
|
|
266
|
+
...rest
|
|
267
|
+
}, ref) {
|
|
268
|
+
const progress = useSharedValue(0);
|
|
269
|
+
const size = useSharedValue({
|
|
270
|
+
width: 0,
|
|
271
|
+
height: 0
|
|
272
|
+
});
|
|
273
|
+
const waves = [useWave(), useWave()];
|
|
274
|
+
const nextWave = useRef(0);
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
progress.value = withTiming(isPressed ? 1 : 0, {
|
|
277
|
+
duration: PRESS_DURATION,
|
|
278
|
+
easing: Easing.out(Easing.ease)
|
|
279
|
+
});
|
|
280
|
+
}, [isPressed, progress]);
|
|
281
|
+
const pressedScale = useDerivedValue(function chunkBFMTUMTUJs3Factory({
|
|
282
|
+
_worklet_12010692297274_init_data,
|
|
283
|
+
pressScaleFor,
|
|
284
|
+
size
|
|
285
|
+
}) {
|
|
286
|
+
const _e = [new global.Error(), -3, -27];
|
|
287
|
+
const chunkBFMTUMTUJs3 = () => pressScaleFor(size.value.width);
|
|
288
|
+
chunkBFMTUMTUJs3.__closure = {
|
|
289
|
+
pressScaleFor,
|
|
290
|
+
size
|
|
291
|
+
};
|
|
292
|
+
chunkBFMTUMTUJs3.__workletHash = 12010692297274;
|
|
293
|
+
chunkBFMTUMTUJs3.__pluginVersion = "0.7.4";
|
|
294
|
+
chunkBFMTUMTUJs3.__initData = _worklet_12010692297274_init_data;
|
|
295
|
+
chunkBFMTUMTUJs3.__stackDetails = _e;
|
|
296
|
+
return chunkBFMTUMTUJs3;
|
|
297
|
+
}({
|
|
298
|
+
_worklet_12010692297274_init_data,
|
|
299
|
+
pressScaleFor,
|
|
300
|
+
size
|
|
301
|
+
}));
|
|
302
|
+
const animatedStyle = useAnimatedStyle(function chunkBFMTUMTUJs4Factory({
|
|
303
|
+
_worklet_10297242211818_init_data,
|
|
304
|
+
animation,
|
|
305
|
+
pressedScale,
|
|
306
|
+
progress
|
|
307
|
+
}) {
|
|
308
|
+
const _e = [new global.Error(), -4, -27];
|
|
309
|
+
const chunkBFMTUMTUJs4 = function () {
|
|
310
|
+
if (!animation.scale) return {};
|
|
311
|
+
return {
|
|
312
|
+
transform: [{
|
|
313
|
+
scale: 1 - (1 - pressedScale.value) * progress.value
|
|
314
|
+
}]
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
chunkBFMTUMTUJs4.__closure = {
|
|
318
|
+
animation,
|
|
319
|
+
pressedScale,
|
|
320
|
+
progress
|
|
321
|
+
};
|
|
322
|
+
chunkBFMTUMTUJs4.__workletHash = 10297242211818;
|
|
323
|
+
chunkBFMTUMTUJs4.__pluginVersion = "0.7.4";
|
|
324
|
+
chunkBFMTUMTUJs4.__initData = _worklet_10297242211818_init_data;
|
|
325
|
+
chunkBFMTUMTUJs4.__stackDetails = _e;
|
|
326
|
+
return chunkBFMTUMTUJs4;
|
|
327
|
+
}({
|
|
328
|
+
_worklet_10297242211818_init_data,
|
|
329
|
+
animation,
|
|
330
|
+
pressedScale,
|
|
331
|
+
progress
|
|
332
|
+
}), [animation.scale, progress, pressedScale]);
|
|
333
|
+
const surface = useSurface(style);
|
|
334
|
+
const context = useMemo(() => ({
|
|
335
|
+
isPressed,
|
|
336
|
+
animation,
|
|
337
|
+
progress,
|
|
338
|
+
size,
|
|
339
|
+
waves,
|
|
340
|
+
...surface
|
|
341
|
+
}), [isPressed, animation, progress, size, waves, surface]);
|
|
342
|
+
const handleTouchStart = event => {
|
|
343
|
+
const wave = waves[nextWave.current];
|
|
344
|
+
nextWave.current = nextWave.current === 0 ? 1 : 0;
|
|
345
|
+
const {
|
|
346
|
+
locationX,
|
|
347
|
+
locationY
|
|
348
|
+
} = event.nativeEvent;
|
|
349
|
+
wave.origin.value = {
|
|
350
|
+
x: locationX,
|
|
351
|
+
y: locationY
|
|
352
|
+
};
|
|
353
|
+
wave.expand.value = 0;
|
|
354
|
+
wave.expand.value = withTiming(1, {
|
|
355
|
+
duration: RIPPLE_EXPAND_DURATION,
|
|
356
|
+
easing: Easing.ease
|
|
357
|
+
});
|
|
358
|
+
wave.alpha.value = withTiming(1, {
|
|
359
|
+
duration: RIPPLE_FADE_IN
|
|
360
|
+
});
|
|
361
|
+
onTouchStart?.(event);
|
|
362
|
+
};
|
|
363
|
+
const releaseWave = () => {
|
|
364
|
+
const wave = waves[nextWave.current === 0 ? 1 : 0];
|
|
365
|
+
wave.expand.value = withTiming(1, {
|
|
366
|
+
duration: RIPPLE_CONFIRM_DURATION,
|
|
367
|
+
easing: Easing.ease
|
|
368
|
+
});
|
|
369
|
+
wave.alpha.value = withDelay(RIPPLE_FADE_OUT_DELAY, withTiming(0, {
|
|
370
|
+
duration: RIPPLE_FADE_OUT
|
|
371
|
+
}));
|
|
372
|
+
};
|
|
373
|
+
const handleTouchEnd = event => {
|
|
374
|
+
releaseWave();
|
|
375
|
+
onTouchEnd?.(event);
|
|
376
|
+
};
|
|
377
|
+
const handleTouchCancel = event => {
|
|
378
|
+
releaseWave();
|
|
379
|
+
onTouchCancel?.(event);
|
|
380
|
+
};
|
|
381
|
+
const handleLayout = event => {
|
|
382
|
+
const {
|
|
383
|
+
width,
|
|
384
|
+
height
|
|
385
|
+
} = event.nativeEvent.layout;
|
|
386
|
+
size.value = {
|
|
387
|
+
width,
|
|
388
|
+
height
|
|
389
|
+
};
|
|
390
|
+
onLayout?.(event);
|
|
391
|
+
};
|
|
392
|
+
const Root = asChild ? AnimatedSlot : AnimatedPressable;
|
|
393
|
+
return /* @__PURE__ */jsx(FeedbackProvider, {
|
|
394
|
+
value: context,
|
|
395
|
+
children: /* @__PURE__ */jsx(Root, {
|
|
396
|
+
ref,
|
|
397
|
+
style: [style, animatedStyle],
|
|
398
|
+
disabled: isDisabled,
|
|
399
|
+
onLayout: handleLayout,
|
|
400
|
+
onTouchStart: handleTouchStart,
|
|
401
|
+
onTouchEnd: handleTouchEnd,
|
|
402
|
+
onTouchCancel: handleTouchCancel,
|
|
403
|
+
...rest,
|
|
404
|
+
children: feedbackChildren(children, asChild)
|
|
405
|
+
})
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
PressableFeedback.displayName = "XAUI.PressableFeedback";
|
|
409
|
+
function useWave() {
|
|
410
|
+
return {
|
|
411
|
+
expand: useSharedValue(0),
|
|
412
|
+
alpha: useSharedValue(0),
|
|
413
|
+
origin: useSharedValue({
|
|
414
|
+
x: 0,
|
|
415
|
+
y: 0
|
|
416
|
+
})
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
function useSurface(style) {
|
|
420
|
+
const theme = useXAUITheme();
|
|
421
|
+
return useMemo(() => {
|
|
422
|
+
const flat = StyleSheet.flatten(style);
|
|
423
|
+
return {
|
|
424
|
+
ink: inkFor(flat?.backgroundColor, theme.colors),
|
|
425
|
+
corners: radiusFrom(flat)
|
|
426
|
+
};
|
|
427
|
+
}, [style, theme]);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// src/system/pressable-feedback/pressable-feedback-highlight.tsx
|
|
431
|
+
import { useEffect as useEffect2 } from "react";
|
|
432
|
+
import { StyleSheet as StyleSheet2, View as View2 } from "react-native";
|
|
433
|
+
import Animated2, { useAnimatedStyle as useAnimatedStyle2, useSharedValue as useSharedValue2, withTiming as withTiming2 } from "react-native-reanimated";
|
|
434
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
435
|
+
function PressableFeedbackHighlight({
|
|
436
|
+
style,
|
|
437
|
+
animation: override,
|
|
438
|
+
children,
|
|
439
|
+
...props
|
|
440
|
+
}) {
|
|
441
|
+
const {
|
|
442
|
+
isPressed,
|
|
443
|
+
animation,
|
|
444
|
+
progress,
|
|
445
|
+
ink,
|
|
446
|
+
corners
|
|
447
|
+
} = useFeedback();
|
|
448
|
+
const [styleProps] = useStyleProps(props);
|
|
449
|
+
const settings = resolveSlotAnimation(override, animation.highlight, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION);
|
|
450
|
+
const base = [StyleSheet2.absoluteFillObject, {
|
|
451
|
+
backgroundColor: ink,
|
|
452
|
+
pointerEvents: "none"
|
|
453
|
+
}, corners, styleProps, style];
|
|
454
|
+
if (!progress || !settings.enabled) {
|
|
455
|
+
return /* @__PURE__ */jsxs(Fragment2, {
|
|
456
|
+
children: [/* @__PURE__ */jsx2(View2, {
|
|
457
|
+
style: [base, {
|
|
458
|
+
opacity: isPressed ? settings.opacity : 0
|
|
459
|
+
}]
|
|
460
|
+
}), children]
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
return /* @__PURE__ */jsxs(Fragment2, {
|
|
464
|
+
children: [/* @__PURE__ */jsx2(AnimatedHighlight, {
|
|
465
|
+
base,
|
|
466
|
+
duration: settings.duration,
|
|
467
|
+
opacity: settings.opacity
|
|
468
|
+
}), children]
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
PressableFeedbackHighlight.displayName = "XAUI.PressableFeedback.Highlight";
|
|
472
|
+
markOverlay(PressableFeedbackHighlight);
|
|
473
|
+
const _worklet_16955843926426_init_data = {
|
|
474
|
+
code: "function chunkBFMTUMTUJs5(){const{shown,opacity}=this.__closure;return{opacity:shown.value*opacity};}",
|
|
475
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js",
|
|
476
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkBFMTUMTUJs5\",\"shown\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js\"],\"mappings\":\"AAiW0C,SAAAA,gBAAMA,CAAA,QAAAC,KAAA,CAAAC,OAAA,OAAAC,SAAA,CAE5C,MAAO,CAAED,OAAO,CAAED,KAAK,CAACG,KAAK,CAAGF,OAAQ,CAAC,CAC3C\",\"ignoreList\":[]}"
|
|
477
|
+
};
|
|
478
|
+
function AnimatedHighlight({
|
|
479
|
+
base,
|
|
480
|
+
duration,
|
|
481
|
+
opacity
|
|
482
|
+
}) {
|
|
483
|
+
const {
|
|
484
|
+
isPressed
|
|
485
|
+
} = useFeedback();
|
|
486
|
+
const shown = useSharedValue2(0);
|
|
487
|
+
useEffect2(() => {
|
|
488
|
+
shown.value = withTiming2(isPressed ? 1 : 0, {
|
|
489
|
+
duration
|
|
490
|
+
});
|
|
491
|
+
}, [isPressed, shown, duration]);
|
|
492
|
+
const animatedStyle = useAnimatedStyle2(function chunkBFMTUMTUJs5Factory({
|
|
493
|
+
_worklet_16955843926426_init_data,
|
|
494
|
+
shown,
|
|
495
|
+
opacity
|
|
496
|
+
}) {
|
|
497
|
+
const _e = [new global.Error(), -3, -27];
|
|
498
|
+
const chunkBFMTUMTUJs5 = function () {
|
|
499
|
+
return {
|
|
500
|
+
opacity: shown.value * opacity
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
chunkBFMTUMTUJs5.__closure = {
|
|
504
|
+
shown,
|
|
505
|
+
opacity
|
|
506
|
+
};
|
|
507
|
+
chunkBFMTUMTUJs5.__workletHash = 16955843926426;
|
|
508
|
+
chunkBFMTUMTUJs5.__pluginVersion = "0.7.4";
|
|
509
|
+
chunkBFMTUMTUJs5.__initData = _worklet_16955843926426_init_data;
|
|
510
|
+
chunkBFMTUMTUJs5.__stackDetails = _e;
|
|
511
|
+
return chunkBFMTUMTUJs5;
|
|
512
|
+
}({
|
|
513
|
+
_worklet_16955843926426_init_data,
|
|
514
|
+
shown,
|
|
515
|
+
opacity
|
|
516
|
+
}), [shown, opacity]);
|
|
517
|
+
return /* @__PURE__ */jsx2(Animated2.View, {
|
|
518
|
+
style: [base, animatedStyle]
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// src/system/pressable-feedback/pressable-feedback-ripple.tsx
|
|
523
|
+
import { useState } from "react";
|
|
524
|
+
import { StyleSheet as StyleSheet3, View as View3 } from "react-native";
|
|
525
|
+
import Animated3, { useAnimatedStyle as useAnimatedStyle3 } from "react-native-reanimated";
|
|
526
|
+
import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
527
|
+
function PressableFeedbackRipple({
|
|
528
|
+
style,
|
|
529
|
+
animation: override,
|
|
530
|
+
children,
|
|
531
|
+
...props
|
|
532
|
+
}) {
|
|
533
|
+
const {
|
|
534
|
+
animation,
|
|
535
|
+
waves,
|
|
536
|
+
ink,
|
|
537
|
+
corners
|
|
538
|
+
} = useFeedback();
|
|
539
|
+
const [styleProps] = useStyleProps(props);
|
|
540
|
+
const waveStyle = [styleProps, style];
|
|
541
|
+
const settings = resolveSlotAnimation(override, animation.ripple, RIPPLE_OPACITY);
|
|
542
|
+
const [size, setSize] = useState({
|
|
543
|
+
width: 0,
|
|
544
|
+
height: 0
|
|
545
|
+
});
|
|
546
|
+
const handleLayout = event => {
|
|
547
|
+
const {
|
|
548
|
+
width,
|
|
549
|
+
height
|
|
550
|
+
} = event.nativeEvent.layout;
|
|
551
|
+
setSize(current => current.width === width && current.height === height ? current : {
|
|
552
|
+
width,
|
|
553
|
+
height
|
|
554
|
+
});
|
|
555
|
+
};
|
|
556
|
+
if (!waves || !settings.enabled) return /* @__PURE__ */jsx3(Fragment3, {
|
|
557
|
+
children
|
|
558
|
+
});
|
|
559
|
+
const radius = rippleRadiusFor(size.width, size.height);
|
|
560
|
+
return /* @__PURE__ */jsxs2(Fragment3, {
|
|
561
|
+
children: [/* @__PURE__ */jsx3(View3, {
|
|
562
|
+
style: [StyleSheet3.absoluteFill, styles.clip, corners],
|
|
563
|
+
onLayout: handleLayout,
|
|
564
|
+
children: waves.map((wave, index) => /* @__PURE__ */jsx3(RippleWave, {
|
|
565
|
+
wave,
|
|
566
|
+
radius,
|
|
567
|
+
center: {
|
|
568
|
+
x: size.width / 2,
|
|
569
|
+
y: size.height / 2
|
|
570
|
+
},
|
|
571
|
+
color: ink,
|
|
572
|
+
opacity: settings.opacity,
|
|
573
|
+
style: waveStyle
|
|
574
|
+
}, index))
|
|
575
|
+
}), children]
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
PressableFeedbackRipple.displayName = "XAUI.PressableFeedback.Ripple";
|
|
579
|
+
markOverlay(PressableFeedbackRipple);
|
|
580
|
+
const _worklet_3850855000277_init_data = {
|
|
581
|
+
code: "function chunkBFMTUMTUJs6(){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}]};}",
|
|
582
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-BFMTUMTU.js",
|
|
583
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkBFMTUMTUJs6\",\"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-BFMTUMTU.js\"],\"mappings\":\"AAia0C,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\":[]}"
|
|
584
|
+
};
|
|
585
|
+
function RippleWave({
|
|
586
|
+
wave,
|
|
587
|
+
radius,
|
|
588
|
+
center,
|
|
589
|
+
color,
|
|
590
|
+
opacity,
|
|
591
|
+
style
|
|
592
|
+
}) {
|
|
593
|
+
const animatedStyle = useAnimatedStyle3(function chunkBFMTUMTUJs6Factory({
|
|
594
|
+
_worklet_3850855000277_init_data,
|
|
595
|
+
wave,
|
|
596
|
+
RIPPLE_START_SCALE,
|
|
597
|
+
center,
|
|
598
|
+
opacity,
|
|
599
|
+
radius
|
|
600
|
+
}) {
|
|
601
|
+
const _e = [new global.Error(), -6, -27];
|
|
602
|
+
const chunkBFMTUMTUJs6 = function () {
|
|
603
|
+
const t = wave.expand.value;
|
|
604
|
+
const from = wave.origin.value;
|
|
605
|
+
const scale = RIPPLE_START_SCALE + (1 - RIPPLE_START_SCALE) * t;
|
|
606
|
+
const x = from.x + (center.x - from.x) * t;
|
|
607
|
+
const y = from.y + (center.y - from.y) * t;
|
|
608
|
+
return {
|
|
609
|
+
// Its own curve, not the expansion's: full ink in 75ms, held while the circle grows.
|
|
610
|
+
opacity: wave.alpha.value * opacity,
|
|
611
|
+
transform: [{
|
|
612
|
+
translateX: x - radius
|
|
613
|
+
}, {
|
|
614
|
+
translateY: y - radius
|
|
615
|
+
}, {
|
|
616
|
+
scale
|
|
617
|
+
}]
|
|
618
|
+
};
|
|
619
|
+
};
|
|
620
|
+
chunkBFMTUMTUJs6.__closure = {
|
|
621
|
+
wave,
|
|
622
|
+
RIPPLE_START_SCALE,
|
|
623
|
+
center,
|
|
624
|
+
opacity,
|
|
625
|
+
radius
|
|
626
|
+
};
|
|
627
|
+
chunkBFMTUMTUJs6.__workletHash = 3850855000277;
|
|
628
|
+
chunkBFMTUMTUJs6.__pluginVersion = "0.7.4";
|
|
629
|
+
chunkBFMTUMTUJs6.__initData = _worklet_3850855000277_init_data;
|
|
630
|
+
chunkBFMTUMTUJs6.__stackDetails = _e;
|
|
631
|
+
return chunkBFMTUMTUJs6;
|
|
632
|
+
}({
|
|
633
|
+
_worklet_3850855000277_init_data,
|
|
634
|
+
wave,
|
|
635
|
+
RIPPLE_START_SCALE,
|
|
636
|
+
center,
|
|
637
|
+
opacity,
|
|
638
|
+
radius
|
|
639
|
+
}), [wave, radius, center, opacity]);
|
|
640
|
+
return /* @__PURE__ */jsx3(Animated3.View, {
|
|
641
|
+
style: [styles.wave, {
|
|
642
|
+
backgroundColor: color,
|
|
643
|
+
width: radius * 2,
|
|
644
|
+
height: radius * 2,
|
|
645
|
+
borderRadius: radius
|
|
646
|
+
}, style, animatedStyle]
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
var styles = StyleSheet3.create({
|
|
650
|
+
// `pointerEvents` in the style rather than as a prop: the prop form is deprecated, and it
|
|
651
|
+
// is not decoration — a container that ate touches would claim every press meant for the
|
|
652
|
+
// control it covers.
|
|
653
|
+
clip: {
|
|
654
|
+
overflow: "hidden",
|
|
655
|
+
pointerEvents: "none"
|
|
656
|
+
},
|
|
657
|
+
wave: {
|
|
658
|
+
position: "absolute",
|
|
659
|
+
top: 0,
|
|
660
|
+
start: 0
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// src/system/pressable-feedback/index.ts
|
|
665
|
+
var PressableFeedback3 = Object.assign(PressableFeedback, {
|
|
666
|
+
Highlight: PressableFeedbackHighlight,
|
|
667
|
+
Ripple: PressableFeedbackRipple
|
|
668
|
+
});
|
|
669
|
+
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 };
|