@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40
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-2EGR4LWD.js +145 -0
- package/dist/chunk-2NRZKJG7.js +531 -0
- package/dist/chunk-2PMXMKS5.js +67 -0
- package/dist/chunk-2XPG2243.js +586 -0
- package/dist/chunk-36PRYGAM.js +13 -0
- package/dist/chunk-3E7CDKFO.cjs +696 -0
- package/dist/chunk-3GFRSZYR.js +54 -0
- package/dist/chunk-423RQBOX.js +21 -0
- package/dist/chunk-4CUZZWFW.js +92 -0
- package/dist/chunk-4GTAZM2C.js +174 -0
- package/dist/chunk-4KFKWBN5.cjs +89 -0
- package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
- package/dist/chunk-5R26NM4M.cjs +402 -0
- package/dist/chunk-5VKYNBNA.js +607 -0
- package/dist/chunk-64MXEVT3.js +66 -0
- package/dist/chunk-6DOLGZVV.cjs +147 -0
- package/dist/chunk-6L2TS2R3.cjs +92 -0
- package/dist/chunk-6UEZJRVI.js +669 -0
- package/dist/chunk-734MFAX4.js +27 -0
- package/dist/chunk-73RKQC5X.js +104 -0
- package/dist/chunk-7DPL3ZDS.cjs +21 -0
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/chunk-7GHM4GKL.cjs +119 -0
- package/dist/chunk-7YF5NAHQ.cjs +74 -0
- package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
- package/dist/chunk-ABAGZTXZ.cjs +736 -0
- package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
- package/dist/chunk-AMCSSOJT.cjs +104 -0
- package/dist/chunk-BA2DBSAN.js +102 -0
- package/dist/chunk-BRRXFOBY.js +431 -0
- package/dist/chunk-C5YLPCFC.cjs +293 -0
- package/dist/chunk-DA3OKXHV.cjs +700 -0
- package/dist/chunk-DD4276RF.js +366 -0
- package/dist/chunk-DG2I4PJG.js +701 -0
- package/dist/chunk-DHGLGSH6.js +661 -0
- package/dist/chunk-DIBUQ46Y.js +346 -0
- package/dist/chunk-EGLLDKN6.js +9 -0
- package/dist/chunk-EJQCQPET.cjs +9 -0
- package/dist/chunk-EKS3W46M.cjs +66 -0
- package/dist/chunk-EZEYMLO3.js +402 -0
- package/dist/chunk-F6CQ6CBI.cjs +112 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-FHUYHV6J.js +89 -0
- package/dist/chunk-FNEUOBCV.cjs +174 -0
- package/dist/chunk-G7P3ERYF.cjs +478 -0
- package/dist/chunk-GA6PBWNT.js +147 -0
- package/dist/chunk-GFUZ3MUT.cjs +455 -0
- package/dist/chunk-GGW43Q37.cjs +1 -0
- package/dist/chunk-GTR5X65M.cjs +27 -0
- package/dist/chunk-H4E4HDEP.cjs +13 -0
- package/dist/chunk-H7DS4IO7.js +198 -0
- package/dist/chunk-HDVVZG4S.cjs +198 -0
- package/dist/chunk-IKJVLJKT.js +151 -0
- package/dist/chunk-J3MB4PI5.cjs +531 -0
- package/dist/chunk-K72UDPVN.js +119 -0
- package/dist/chunk-KCMYU7WF.js +86 -0
- package/dist/chunk-LRN3RNDO.js +940 -0
- package/dist/chunk-LTX6TB5I.js +124 -0
- package/dist/chunk-LUPCPLND.cjs +145 -0
- package/dist/chunk-M63GFNKV.js +194 -0
- package/dist/chunk-N3KTZMPG.js +293 -0
- package/dist/chunk-NCTOTTVW.js +13 -0
- package/dist/chunk-NWGLP6JX.cjs +410 -0
- package/dist/chunk-R73XQK7X.cjs +314 -0
- package/dist/chunk-RU7JCMWC.cjs +881 -0
- package/dist/chunk-SNIHUKDA.cjs +184 -0
- package/dist/chunk-T5FV5F7A.cjs +607 -0
- package/dist/chunk-TDTUAIFF.cjs +153 -0
- package/dist/chunk-TJ74XVZN.cjs +431 -0
- package/dist/chunk-TK44VBIE.cjs +194 -0
- package/dist/chunk-UAWBAD4E.cjs +346 -0
- package/dist/chunk-UFTCTTKK.js +381 -0
- package/dist/chunk-WDDXU3OH.cjs +67 -0
- package/dist/chunk-WFEMJCXO.cjs +13 -0
- package/dist/chunk-WHJTBTYM.js +0 -0
- package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
- package/dist/chunk-XFPQFCEK.js +455 -0
- package/dist/chunk-XSQPVDFH.cjs +60 -0
- package/dist/chunk-XTC2SLFT.js +153 -0
- package/dist/chunk-XV735BSA.cjs +366 -0
- package/dist/chunk-XWNG2U4K.cjs +124 -0
- package/dist/chunk-YGYYJ3LQ.js +314 -0
- package/dist/chunk-YVHT2UVW.js +74 -0
- package/dist/chunk-ZFOOJK37.cjs +86 -0
- package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
- package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
- package/dist/components/accordion/index.cjs +35 -0
- package/dist/components/accordion/index.d.cts +299 -0
- package/dist/components/accordion/index.d.ts +299 -0
- package/dist/components/accordion/index.js +35 -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/avatar/index.cjs +16 -0
- package/dist/components/avatar/index.d.cts +131 -0
- package/dist/components/avatar/index.d.ts +131 -0
- package/dist/components/avatar/index.js +16 -0
- package/dist/components/badge/index.cjs +15 -0
- package/dist/components/badge/index.d.cts +157 -0
- package/dist/components/badge/index.d.ts +157 -0
- package/dist/components/badge/index.js +15 -0
- package/dist/components/button/index.cjs +22 -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 +22 -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/field-group/index.cjs +27 -0
- package/dist/components/field-group/index.d.cts +270 -0
- package/dist/components/field-group/index.d.ts +270 -0
- package/dist/components/field-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/menu/index.cjs +49 -0
- package/dist/components/menu/index.d.cts +351 -0
- package/dist/components/menu/index.d.ts +351 -0
- package/dist/components/menu/index.js +49 -0
- package/dist/components/popover/index.cjs +38 -0
- package/dist/components/popover/index.d.cts +254 -0
- package/dist/components/popover/index.d.ts +254 -0
- package/dist/components/popover/index.js +38 -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/select/index.cjs +50 -0
- package/dist/components/select/index.d.cts +498 -0
- package/dist/components/select/index.d.ts +498 -0
- package/dist/components/select/index.js +50 -0
- package/dist/components/skeleton/index.cjs +11 -0
- package/dist/components/skeleton/index.d.cts +111 -0
- package/dist/components/skeleton/index.d.ts +111 -0
- package/dist/components/skeleton/index.js +11 -0
- package/dist/components/spinner/index.cjs +17 -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 +17 -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/text-field/index.cjs +25 -0
- package/dist/components/text-field/index.d.cts +205 -0
- package/dist/components/text-field/index.d.ts +205 -0
- package/dist/components/text-field/index.js +25 -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 +400 -4
- package/dist/index.d.cts +118 -4
- package/dist/index.d.ts +118 -4
- package/dist/index.js +423 -27
- package/dist/placement-DHa0Rrh1.d.cts +38 -0
- package/dist/placement-DHa0Rrh1.d.ts +38 -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 +73 -4
- package/dist/system/index.d.cts +379 -193
- package/dist/system/index.d.ts +379 -193
- package/dist/system/index.js +87 -18
- package/dist/text-field.type-0l73acce.d.ts +167 -0
- package/dist/text-field.type-DBh06DU5.d.cts +167 -0
- package/dist/theme/index.cjs +5 -3
- package/dist/theme/index.d.cts +55 -24
- package/dist/theme/index.d.ts +55 -24
- package/dist/theme/index.js +4 -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 +254 -18
- package/dist/chunk-ECDWSSHJ.js +0 -688
- package/dist/chunk-IYFGO523.cjs +0 -688
|
@@ -0,0 +1,696 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _interopRequireDefault(obj) {
|
|
7
|
+
return obj && obj.__esModule ? obj : {
|
|
8
|
+
default: obj
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
12
|
+
if (lhs != null) {
|
|
13
|
+
return lhs;
|
|
14
|
+
} else {
|
|
15
|
+
return rhsFn();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function _optionalChain(ops) {
|
|
19
|
+
let lastAccessLHS = undefined;
|
|
20
|
+
let value = ops[0];
|
|
21
|
+
let i = 1;
|
|
22
|
+
while (i < ops.length) {
|
|
23
|
+
const op = ops[i];
|
|
24
|
+
const fn = ops[i + 1];
|
|
25
|
+
i += 2;
|
|
26
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
30
|
+
lastAccessLHS = value;
|
|
31
|
+
value = fn(value);
|
|
32
|
+
} else if (op === 'call' || op === 'optionalCall') {
|
|
33
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
34
|
+
lastAccessLHS = undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
40
|
+
var _chunk7GHM4GKLcjs = require('./chunk-7GHM4GKL.cjs');
|
|
41
|
+
var _chunkTK44VBIEcjs = require('./chunk-TK44VBIE.cjs');
|
|
42
|
+
|
|
43
|
+
// src/system/pressable-feedback/pressable-feedback-context.ts
|
|
44
|
+
var _react = require('react');
|
|
45
|
+
var [FeedbackProvider, useFeedback] = _chunk7GHM4GKLcjs.createSlotContext.call(void 0, "PressableFeedback");
|
|
46
|
+
var DisableAllContext = _react.createContext.call(void 0, false);
|
|
47
|
+
|
|
48
|
+
// src/system/pressable-feedback/pressable-feedback.animation.ts
|
|
49
|
+
var PRESS_SCALE = 0.985;
|
|
50
|
+
var PRESS_DURATION = 300;
|
|
51
|
+
var SCALE_REFERENCE_WIDTH = 300;
|
|
52
|
+
const _worklet_14435407638231_init_data = {
|
|
53
|
+
code: "function pressScaleFor_chunk3E7CDKFOCjs1(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-3E7CDKFO.cjs",
|
|
55
|
+
sourceMap: "{\"version\":3,\"names\":[\"pressScaleFor_chunk3E7CDKFOCjs1\",\"width\",\"SCALE_REFERENCE_WIDTH\",\"PRESS_SCALE\",\"__closure\",\"coefficient\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-3E7CDKFO.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\":[]}"
|
|
56
|
+
};
|
|
57
|
+
const pressScaleFor = function pressScaleFor_chunk3E7CDKFOCjs1Factory({
|
|
58
|
+
_worklet_14435407638231_init_data,
|
|
59
|
+
SCALE_REFERENCE_WIDTH,
|
|
60
|
+
PRESS_SCALE
|
|
61
|
+
}) {
|
|
62
|
+
const _e = [new global.Error(), -3, -27];
|
|
63
|
+
const pressScaleFor = function (width) {
|
|
64
|
+
const coefficient = width > 0 ? SCALE_REFERENCE_WIDTH / width : 1;
|
|
65
|
+
return 1 - (1 - PRESS_SCALE) * coefficient;
|
|
66
|
+
};
|
|
67
|
+
pressScaleFor.__closure = {
|
|
68
|
+
SCALE_REFERENCE_WIDTH,
|
|
69
|
+
PRESS_SCALE
|
|
70
|
+
};
|
|
71
|
+
pressScaleFor.__workletHash = 14435407638231;
|
|
72
|
+
pressScaleFor.__pluginVersion = "0.7.4";
|
|
73
|
+
pressScaleFor.__initData = _worklet_14435407638231_init_data;
|
|
74
|
+
pressScaleFor.__stackDetails = _e;
|
|
75
|
+
return pressScaleFor;
|
|
76
|
+
}({
|
|
77
|
+
_worklet_14435407638231_init_data,
|
|
78
|
+
SCALE_REFERENCE_WIDTH,
|
|
79
|
+
PRESS_SCALE
|
|
80
|
+
});
|
|
81
|
+
var HIGHLIGHT_OPACITY = 0.1;
|
|
82
|
+
var HIGHLIGHT_DURATION = 200;
|
|
83
|
+
var RIPPLE_OPACITY = 0.1;
|
|
84
|
+
var RIPPLE_START_SCALE = 0.3;
|
|
85
|
+
var RIPPLE_EXPAND_DURATION = 1e3;
|
|
86
|
+
var RIPPLE_CONFIRM_DURATION = 225;
|
|
87
|
+
var RIPPLE_FADE_IN = 75;
|
|
88
|
+
var RIPPLE_FADE_OUT_DELAY = 225;
|
|
89
|
+
var RIPPLE_FADE_OUT = 150;
|
|
90
|
+
const _worklet_7514373601452_init_data = {
|
|
91
|
+
code: "function rippleRadiusFor_chunk3E7CDKFOCjs2(width,height){return Math.sqrt(width*width+height*height)/2+5;}",
|
|
92
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-3E7CDKFO.cjs",
|
|
93
|
+
sourceMap: "{\"version\":3,\"names\":[\"rippleRadiusFor_chunk3E7CDKFOCjs2\",\"width\",\"height\",\"Math\",\"sqrt\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-3E7CDKFO.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\":[]}"
|
|
94
|
+
};
|
|
95
|
+
const rippleRadiusFor = function rippleRadiusFor_chunk3E7CDKFOCjs2Factory({
|
|
96
|
+
_worklet_7514373601452_init_data
|
|
97
|
+
}) {
|
|
98
|
+
const _e = [new global.Error(), 1, -27];
|
|
99
|
+
const rippleRadiusFor = function (width, height) {
|
|
100
|
+
return Math.sqrt(width * width + height * height) / 2 + 5;
|
|
101
|
+
};
|
|
102
|
+
rippleRadiusFor.__closure = {};
|
|
103
|
+
rippleRadiusFor.__workletHash = 7514373601452;
|
|
104
|
+
rippleRadiusFor.__pluginVersion = "0.7.4";
|
|
105
|
+
rippleRadiusFor.__initData = _worklet_7514373601452_init_data;
|
|
106
|
+
rippleRadiusFor.__stackDetails = _e;
|
|
107
|
+
return rippleRadiusFor;
|
|
108
|
+
}({
|
|
109
|
+
_worklet_7514373601452_init_data
|
|
110
|
+
});
|
|
111
|
+
var ALL_OFF = {
|
|
112
|
+
scale: false,
|
|
113
|
+
highlight: false,
|
|
114
|
+
ripple: false,
|
|
115
|
+
none: true
|
|
116
|
+
};
|
|
117
|
+
var ALL_ON = {
|
|
118
|
+
scale: true,
|
|
119
|
+
highlight: true,
|
|
120
|
+
ripple: true,
|
|
121
|
+
none: false
|
|
122
|
+
};
|
|
123
|
+
function resolveAnimation(animation, inheritedDisableAll = false) {
|
|
124
|
+
if (inheritedDisableAll) return {
|
|
125
|
+
...ALL_OFF,
|
|
126
|
+
disableAll: true
|
|
127
|
+
};
|
|
128
|
+
if (animation === false || animation === "disabled") {
|
|
129
|
+
return {
|
|
130
|
+
...ALL_OFF,
|
|
131
|
+
disableAll: false
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (animation === "disable-all") return {
|
|
135
|
+
...ALL_OFF,
|
|
136
|
+
disableAll: true
|
|
137
|
+
};
|
|
138
|
+
if (animation === void 0 || animation === true) {
|
|
139
|
+
return {
|
|
140
|
+
...ALL_ON,
|
|
141
|
+
disableAll: false
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const scale = _nullishCoalesce(animation.scale, () => true);
|
|
145
|
+
const highlight = _nullishCoalesce(animation.highlight, () => true);
|
|
146
|
+
const ripple = _nullishCoalesce(animation.ripple, () => true);
|
|
147
|
+
return {
|
|
148
|
+
scale,
|
|
149
|
+
highlight,
|
|
150
|
+
ripple,
|
|
151
|
+
none: !scale && !highlight && !ripple,
|
|
152
|
+
disableAll: false
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function resolveSlotAnimation(override, enabledByRoot, defaultOpacity, defaultDuration = PRESS_DURATION) {
|
|
156
|
+
const fallback = {
|
|
157
|
+
enabled: enabledByRoot,
|
|
158
|
+
duration: defaultDuration,
|
|
159
|
+
opacity: defaultOpacity
|
|
160
|
+
};
|
|
161
|
+
if (override === void 0 || override === true) return fallback;
|
|
162
|
+
if (override === false) return {
|
|
163
|
+
...fallback,
|
|
164
|
+
enabled: false
|
|
165
|
+
};
|
|
166
|
+
return {
|
|
167
|
+
enabled: enabledByRoot,
|
|
168
|
+
duration: _nullishCoalesce(override.duration, () => defaultDuration),
|
|
169
|
+
opacity: _nullishCoalesce(override.opacity, () => defaultOpacity)
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// src/system/pressable-feedback/pressable-feedback.overlay.ts
|
|
174
|
+
|
|
175
|
+
var FEEDBACK_OVERLAY = /* @__PURE__ */Symbol.for("xaui.PressableFeedback.overlay");
|
|
176
|
+
function markOverlay(component) {
|
|
177
|
+
return Object.assign(component, {
|
|
178
|
+
[FEEDBACK_OVERLAY]: true
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function isBareOverlay(node) {
|
|
182
|
+
if (!_react.isValidElement.call(void 0, node)) return false;
|
|
183
|
+
const type = node.type;
|
|
184
|
+
if (typeof type !== "function" && typeof type !== "object") return false;
|
|
185
|
+
if (type === null) return false;
|
|
186
|
+
if (type[FEEDBACK_OVERLAY] !== true) return false;
|
|
187
|
+
return node.props.children === void 0;
|
|
188
|
+
}
|
|
189
|
+
function partitionOverlays(children) {
|
|
190
|
+
const all = _react.Children.toArray(children);
|
|
191
|
+
const overlays = all.filter(isBareOverlay);
|
|
192
|
+
if (overlays.length === 0) return {
|
|
193
|
+
overlays: null,
|
|
194
|
+
content: children
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
overlays,
|
|
198
|
+
content: all.filter(node => !isBareOverlay(node))
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function feedbackChildren(children, asChild) {
|
|
202
|
+
if (asChild) return children;
|
|
203
|
+
const {
|
|
204
|
+
overlays,
|
|
205
|
+
content
|
|
206
|
+
} = partitionOverlays(children);
|
|
207
|
+
if (overlays === null) return content;
|
|
208
|
+
return _react.createElement.call(void 0, _react.Fragment, null, overlays, content);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
212
|
+
|
|
213
|
+
var _reactnative = require('react-native');
|
|
214
|
+
var _reactnativereanimated = require('react-native-reanimated');
|
|
215
|
+
var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
216
|
+
|
|
217
|
+
// src/system/pressable-feedback/pressable-feedback.surface.ts
|
|
218
|
+
function inkFor(background, colors) {
|
|
219
|
+
if (typeof background !== "string" || !_chunk57SJ4LJFcjs.isHex.call(void 0, background)) return colors.foreground;
|
|
220
|
+
return _chunk57SJ4LJFcjs.contrastOn.call(void 0, background, colors.snow, colors.eclipse);
|
|
221
|
+
}
|
|
222
|
+
var RADIUS_KEYS = ["borderRadius", "borderStartStartRadius", "borderStartEndRadius", "borderEndStartRadius", "borderEndEndRadius"];
|
|
223
|
+
function radiusFrom(style) {
|
|
224
|
+
if (!style) return {};
|
|
225
|
+
const radius = {};
|
|
226
|
+
for (const key of RADIUS_KEYS) {
|
|
227
|
+
const value = style[key];
|
|
228
|
+
if (value !== void 0) radius[key] = value;
|
|
229
|
+
}
|
|
230
|
+
return radius;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// src/system/pressable-feedback/pressable-feedback.tsx
|
|
234
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
235
|
+
var AnimatedPressable = _reactnativereanimated2.default.createAnimatedComponent(_reactnative.Pressable);
|
|
236
|
+
var AnimatedSlot = _reactnativereanimated2.default.createAnimatedComponent(_chunk7GHM4GKLcjs.Slot);
|
|
237
|
+
var PressableFeedback = _react.forwardRef.call(void 0, function PressableFeedback2({
|
|
238
|
+
animation,
|
|
239
|
+
style,
|
|
240
|
+
...props
|
|
241
|
+
}, ref) {
|
|
242
|
+
const inheritedDisableAll = _react.useContext.call(void 0, DisableAllContext);
|
|
243
|
+
const resolved = resolveAnimation(animation, inheritedDisableAll);
|
|
244
|
+
const [styleProps, rest] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
245
|
+
const Feedback = resolved.none ? StaticFeedback : AnimatedFeedback;
|
|
246
|
+
const body = /* @__PURE__ */_jsxruntime.jsx.call(void 0, Feedback, {
|
|
247
|
+
ref,
|
|
248
|
+
animation: resolved,
|
|
249
|
+
style: [styleProps, style],
|
|
250
|
+
...rest
|
|
251
|
+
});
|
|
252
|
+
return resolved.disableAll ? /* @__PURE__ */_jsxruntime.jsx.call(void 0, DisableAllContext.Provider, {
|
|
253
|
+
value: true,
|
|
254
|
+
children: body
|
|
255
|
+
}) : body;
|
|
256
|
+
});
|
|
257
|
+
var StaticFeedback = _react.forwardRef.call(void 0, function StaticFeedback2({
|
|
258
|
+
isPressed = false,
|
|
259
|
+
isDisabled,
|
|
260
|
+
asChild = false,
|
|
261
|
+
animation,
|
|
262
|
+
children,
|
|
263
|
+
style,
|
|
264
|
+
...rest
|
|
265
|
+
}, ref) {
|
|
266
|
+
const surface = useSurface(style);
|
|
267
|
+
const context = _react.useMemo.call(void 0, () => ({
|
|
268
|
+
isPressed,
|
|
269
|
+
animation,
|
|
270
|
+
...surface
|
|
271
|
+
}), [isPressed, animation, surface]);
|
|
272
|
+
const Root = asChild ? _chunk7GHM4GKLcjs.Slot : _reactnative.Pressable;
|
|
273
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, FeedbackProvider, {
|
|
274
|
+
value: context,
|
|
275
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, Root, {
|
|
276
|
+
ref,
|
|
277
|
+
style,
|
|
278
|
+
disabled: isDisabled,
|
|
279
|
+
...rest,
|
|
280
|
+
children: feedbackChildren(children, asChild)
|
|
281
|
+
})
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
const _worklet_9209681642894_init_data = {
|
|
285
|
+
code: "function chunk3E7CDKFOCjs3(){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-3E7CDKFO.cjs",
|
|
287
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunk3E7CDKFOCjs3\",\"animation\",\"pressedScale\",\"progress\",\"__closure\",\"scale\",\"transform\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-3E7CDKFO.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\":[]}"
|
|
288
|
+
};
|
|
289
|
+
var AnimatedFeedback = _react.forwardRef.call(void 0, function AnimatedFeedback2({
|
|
290
|
+
isPressed = false,
|
|
291
|
+
isDisabled,
|
|
292
|
+
asChild = false,
|
|
293
|
+
animation,
|
|
294
|
+
children,
|
|
295
|
+
style,
|
|
296
|
+
onLayout,
|
|
297
|
+
onTouchStart,
|
|
298
|
+
onTouchEnd,
|
|
299
|
+
onTouchCancel,
|
|
300
|
+
...rest
|
|
301
|
+
}, ref) {
|
|
302
|
+
const progress = _reactnativereanimated.useSharedValue.call(void 0, 0);
|
|
303
|
+
const size = _reactnativereanimated.useSharedValue.call(void 0, {
|
|
304
|
+
width: 0,
|
|
305
|
+
height: 0
|
|
306
|
+
});
|
|
307
|
+
const waves = [useWave(), useWave()];
|
|
308
|
+
const nextWave = _react.useRef.call(void 0, 0);
|
|
309
|
+
_react.useEffect.call(void 0, () => {
|
|
310
|
+
progress.value = _reactnativereanimated.withTiming.call(void 0, isPressed ? 1 : 0, {
|
|
311
|
+
duration: PRESS_DURATION,
|
|
312
|
+
easing: _reactnativereanimated.Easing.out(_reactnativereanimated.Easing.ease)
|
|
313
|
+
});
|
|
314
|
+
}, [isPressed, progress]);
|
|
315
|
+
const pressedScale = _reactnativereanimated.useDerivedValue.call(void 0, () => pressScaleFor(size.value.width));
|
|
316
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunk3E7CDKFOCjs3Factory({
|
|
317
|
+
_worklet_9209681642894_init_data,
|
|
318
|
+
animation,
|
|
319
|
+
pressedScale,
|
|
320
|
+
progress
|
|
321
|
+
}) {
|
|
322
|
+
const _e = [new global.Error(), -4, -27];
|
|
323
|
+
const chunk3E7CDKFOCjs3 = function () {
|
|
324
|
+
if (!animation.scale) return {};
|
|
325
|
+
return {
|
|
326
|
+
transform: [{
|
|
327
|
+
scale: 1 - (1 - pressedScale.value) * progress.value
|
|
328
|
+
}]
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
chunk3E7CDKFOCjs3.__closure = {
|
|
332
|
+
animation,
|
|
333
|
+
pressedScale,
|
|
334
|
+
progress
|
|
335
|
+
};
|
|
336
|
+
chunk3E7CDKFOCjs3.__workletHash = 9209681642894;
|
|
337
|
+
chunk3E7CDKFOCjs3.__pluginVersion = "0.7.4";
|
|
338
|
+
chunk3E7CDKFOCjs3.__initData = _worklet_9209681642894_init_data;
|
|
339
|
+
chunk3E7CDKFOCjs3.__stackDetails = _e;
|
|
340
|
+
return chunk3E7CDKFOCjs3;
|
|
341
|
+
}({
|
|
342
|
+
_worklet_9209681642894_init_data,
|
|
343
|
+
animation,
|
|
344
|
+
pressedScale,
|
|
345
|
+
progress
|
|
346
|
+
}), [animation.scale, progress, pressedScale]);
|
|
347
|
+
const surface = useSurface(style);
|
|
348
|
+
const context = _react.useMemo.call(void 0, () => ({
|
|
349
|
+
isPressed,
|
|
350
|
+
animation,
|
|
351
|
+
progress,
|
|
352
|
+
size,
|
|
353
|
+
waves,
|
|
354
|
+
...surface
|
|
355
|
+
}), [isPressed, animation, progress, size, waves, surface]);
|
|
356
|
+
const handleTouchStart = event => {
|
|
357
|
+
const wave = waves[nextWave.current];
|
|
358
|
+
nextWave.current = nextWave.current === 0 ? 1 : 0;
|
|
359
|
+
const {
|
|
360
|
+
locationX,
|
|
361
|
+
locationY
|
|
362
|
+
} = event.nativeEvent;
|
|
363
|
+
wave.origin.value = {
|
|
364
|
+
x: locationX,
|
|
365
|
+
y: locationY
|
|
366
|
+
};
|
|
367
|
+
wave.expand.value = 0;
|
|
368
|
+
wave.expand.value = _reactnativereanimated.withTiming.call(void 0, 1, {
|
|
369
|
+
duration: RIPPLE_EXPAND_DURATION,
|
|
370
|
+
easing: _reactnativereanimated.Easing.ease
|
|
371
|
+
});
|
|
372
|
+
wave.alpha.value = _reactnativereanimated.withTiming.call(void 0, 1, {
|
|
373
|
+
duration: RIPPLE_FADE_IN
|
|
374
|
+
});
|
|
375
|
+
_optionalChain([onTouchStart, 'optionalCall', _ => _(event)]);
|
|
376
|
+
};
|
|
377
|
+
const releaseWave = () => {
|
|
378
|
+
const wave = waves[nextWave.current === 0 ? 1 : 0];
|
|
379
|
+
wave.expand.value = _reactnativereanimated.withTiming.call(void 0, 1, {
|
|
380
|
+
duration: RIPPLE_CONFIRM_DURATION,
|
|
381
|
+
easing: _reactnativereanimated.Easing.ease
|
|
382
|
+
});
|
|
383
|
+
wave.alpha.value = _reactnativereanimated.withDelay.call(void 0, RIPPLE_FADE_OUT_DELAY, _reactnativereanimated.withTiming.call(void 0, 0, {
|
|
384
|
+
duration: RIPPLE_FADE_OUT
|
|
385
|
+
}));
|
|
386
|
+
};
|
|
387
|
+
const handleTouchEnd = event => {
|
|
388
|
+
releaseWave();
|
|
389
|
+
_optionalChain([onTouchEnd, 'optionalCall', _2 => _2(event)]);
|
|
390
|
+
};
|
|
391
|
+
const handleTouchCancel = event => {
|
|
392
|
+
releaseWave();
|
|
393
|
+
_optionalChain([onTouchCancel, 'optionalCall', _3 => _3(event)]);
|
|
394
|
+
};
|
|
395
|
+
const handleLayout = event => {
|
|
396
|
+
const {
|
|
397
|
+
width,
|
|
398
|
+
height
|
|
399
|
+
} = event.nativeEvent.layout;
|
|
400
|
+
size.value = {
|
|
401
|
+
width,
|
|
402
|
+
height
|
|
403
|
+
};
|
|
404
|
+
_optionalChain([onLayout, 'optionalCall', _4 => _4(event)]);
|
|
405
|
+
};
|
|
406
|
+
const Root = asChild ? AnimatedSlot : AnimatedPressable;
|
|
407
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, FeedbackProvider, {
|
|
408
|
+
value: context,
|
|
409
|
+
children: /* @__PURE__ */_jsxruntime.jsx.call(void 0, Root, {
|
|
410
|
+
ref,
|
|
411
|
+
style: [style, animatedStyle],
|
|
412
|
+
disabled: isDisabled,
|
|
413
|
+
onLayout: handleLayout,
|
|
414
|
+
onTouchStart: handleTouchStart,
|
|
415
|
+
onTouchEnd: handleTouchEnd,
|
|
416
|
+
onTouchCancel: handleTouchCancel,
|
|
417
|
+
...rest,
|
|
418
|
+
children: feedbackChildren(children, asChild)
|
|
419
|
+
})
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
PressableFeedback.displayName = "XAUI.PressableFeedback";
|
|
423
|
+
function useWave() {
|
|
424
|
+
return {
|
|
425
|
+
expand: _reactnativereanimated.useSharedValue.call(void 0, 0),
|
|
426
|
+
alpha: _reactnativereanimated.useSharedValue.call(void 0, 0),
|
|
427
|
+
origin: _reactnativereanimated.useSharedValue.call(void 0, {
|
|
428
|
+
x: 0,
|
|
429
|
+
y: 0
|
|
430
|
+
})
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
function useSurface(style) {
|
|
434
|
+
const theme = _chunk57SJ4LJFcjs.useXAUITheme.call(void 0);
|
|
435
|
+
return _react.useMemo.call(void 0, () => {
|
|
436
|
+
const flat = _reactnative.StyleSheet.flatten(style);
|
|
437
|
+
return {
|
|
438
|
+
ink: inkFor(_optionalChain([flat, 'optionalAccess', _5 => _5.backgroundColor]), theme.colors),
|
|
439
|
+
corners: radiusFrom(flat)
|
|
440
|
+
};
|
|
441
|
+
}, [style, theme]);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// src/system/pressable-feedback/pressable-feedback-highlight.tsx
|
|
445
|
+
|
|
446
|
+
function PressableFeedbackHighlight({
|
|
447
|
+
style,
|
|
448
|
+
animation: override,
|
|
449
|
+
children,
|
|
450
|
+
...props
|
|
451
|
+
}) {
|
|
452
|
+
const {
|
|
453
|
+
isPressed,
|
|
454
|
+
animation,
|
|
455
|
+
progress,
|
|
456
|
+
ink,
|
|
457
|
+
corners
|
|
458
|
+
} = useFeedback();
|
|
459
|
+
const [styleProps] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
460
|
+
const settings = resolveSlotAnimation(override, animation.highlight, HIGHLIGHT_OPACITY, HIGHLIGHT_DURATION);
|
|
461
|
+
const base = [_reactnative.StyleSheet.absoluteFillObject, {
|
|
462
|
+
backgroundColor: ink,
|
|
463
|
+
pointerEvents: "none"
|
|
464
|
+
}, corners, styleProps, style];
|
|
465
|
+
if (!progress || !settings.enabled) {
|
|
466
|
+
return /* @__PURE__ */_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
|
|
467
|
+
children: [/* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
|
|
468
|
+
style: [base, {
|
|
469
|
+
opacity: isPressed ? settings.opacity : 0
|
|
470
|
+
}]
|
|
471
|
+
}), children]
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
return /* @__PURE__ */_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
|
|
475
|
+
children: [/* @__PURE__ */_jsxruntime.jsx.call(void 0, AnimatedHighlight, {
|
|
476
|
+
base,
|
|
477
|
+
duration: settings.duration,
|
|
478
|
+
opacity: settings.opacity
|
|
479
|
+
}), children]
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
PressableFeedbackHighlight.displayName = "XAUI.PressableFeedback.Highlight";
|
|
483
|
+
markOverlay(PressableFeedbackHighlight);
|
|
484
|
+
const _worklet_10119725823288_init_data = {
|
|
485
|
+
code: "function chunk3E7CDKFOCjs4(){const{shown,opacity}=this.__closure;return{opacity:shown.value*opacity};}",
|
|
486
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-3E7CDKFO.cjs",
|
|
487
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunk3E7CDKFOCjs4\",\"shown\",\"opacity\",\"__closure\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-3E7CDKFO.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\":[]}"
|
|
488
|
+
};
|
|
489
|
+
function AnimatedHighlight({
|
|
490
|
+
base,
|
|
491
|
+
duration,
|
|
492
|
+
opacity
|
|
493
|
+
}) {
|
|
494
|
+
const {
|
|
495
|
+
isPressed
|
|
496
|
+
} = useFeedback();
|
|
497
|
+
const shown = _reactnativereanimated.useSharedValue.call(void 0, 0);
|
|
498
|
+
_react.useEffect.call(void 0, () => {
|
|
499
|
+
shown.value = _reactnativereanimated.withTiming.call(void 0, isPressed ? 1 : 0, {
|
|
500
|
+
duration
|
|
501
|
+
});
|
|
502
|
+
}, [isPressed, shown, duration]);
|
|
503
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunk3E7CDKFOCjs4Factory({
|
|
504
|
+
_worklet_10119725823288_init_data,
|
|
505
|
+
shown,
|
|
506
|
+
opacity
|
|
507
|
+
}) {
|
|
508
|
+
const _e = [new global.Error(), -3, -27];
|
|
509
|
+
const chunk3E7CDKFOCjs4 = function () {
|
|
510
|
+
return {
|
|
511
|
+
opacity: shown.value * opacity
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
chunk3E7CDKFOCjs4.__closure = {
|
|
515
|
+
shown,
|
|
516
|
+
opacity
|
|
517
|
+
};
|
|
518
|
+
chunk3E7CDKFOCjs4.__workletHash = 10119725823288;
|
|
519
|
+
chunk3E7CDKFOCjs4.__pluginVersion = "0.7.4";
|
|
520
|
+
chunk3E7CDKFOCjs4.__initData = _worklet_10119725823288_init_data;
|
|
521
|
+
chunk3E7CDKFOCjs4.__stackDetails = _e;
|
|
522
|
+
return chunk3E7CDKFOCjs4;
|
|
523
|
+
}({
|
|
524
|
+
_worklet_10119725823288_init_data,
|
|
525
|
+
shown,
|
|
526
|
+
opacity
|
|
527
|
+
}), [shown, opacity]);
|
|
528
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
|
|
529
|
+
style: [base, animatedStyle]
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// src/system/pressable-feedback/pressable-feedback-ripple.tsx
|
|
534
|
+
|
|
535
|
+
function PressableFeedbackRipple({
|
|
536
|
+
style,
|
|
537
|
+
animation: override,
|
|
538
|
+
children,
|
|
539
|
+
...props
|
|
540
|
+
}) {
|
|
541
|
+
const {
|
|
542
|
+
animation,
|
|
543
|
+
waves,
|
|
544
|
+
ink,
|
|
545
|
+
corners
|
|
546
|
+
} = useFeedback();
|
|
547
|
+
const [styleProps] = _chunkTK44VBIEcjs.useStyleProps.call(void 0, props);
|
|
548
|
+
const waveStyle = [styleProps, style];
|
|
549
|
+
const settings = resolveSlotAnimation(override, animation.ripple, RIPPLE_OPACITY);
|
|
550
|
+
const [size, setSize] = _react.useState.call(void 0, {
|
|
551
|
+
width: 0,
|
|
552
|
+
height: 0
|
|
553
|
+
});
|
|
554
|
+
const handleLayout = event => {
|
|
555
|
+
const {
|
|
556
|
+
width,
|
|
557
|
+
height
|
|
558
|
+
} = event.nativeEvent.layout;
|
|
559
|
+
setSize(current => current.width === width && current.height === height ? current : {
|
|
560
|
+
width,
|
|
561
|
+
height
|
|
562
|
+
});
|
|
563
|
+
};
|
|
564
|
+
if (!waves || !settings.enabled) return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {
|
|
565
|
+
children
|
|
566
|
+
});
|
|
567
|
+
const radius = rippleRadiusFor(size.width, size.height);
|
|
568
|
+
return /* @__PURE__ */_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, {
|
|
569
|
+
children: [/* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnative.View, {
|
|
570
|
+
style: [_reactnative.StyleSheet.absoluteFill, styles.clip, corners],
|
|
571
|
+
onLayout: handleLayout,
|
|
572
|
+
children: waves.map((wave, index) => /* @__PURE__ */_jsxruntime.jsx.call(void 0, RippleWave, {
|
|
573
|
+
wave,
|
|
574
|
+
radius,
|
|
575
|
+
center: {
|
|
576
|
+
x: size.width / 2,
|
|
577
|
+
y: size.height / 2
|
|
578
|
+
},
|
|
579
|
+
color: ink,
|
|
580
|
+
opacity: settings.opacity,
|
|
581
|
+
style: waveStyle
|
|
582
|
+
}, index))
|
|
583
|
+
}), children]
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
PressableFeedbackRipple.displayName = "XAUI.PressableFeedback.Ripple";
|
|
587
|
+
markOverlay(PressableFeedbackRipple);
|
|
588
|
+
const _worklet_12631975666453_init_data = {
|
|
589
|
+
code: "function chunk3E7CDKFOCjs5(){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-3E7CDKFO.cjs",
|
|
591
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunk3E7CDKFOCjs5\",\"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-3E7CDKFO.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\":[]}"
|
|
592
|
+
};
|
|
593
|
+
function RippleWave({
|
|
594
|
+
wave,
|
|
595
|
+
radius,
|
|
596
|
+
center,
|
|
597
|
+
color,
|
|
598
|
+
opacity,
|
|
599
|
+
style
|
|
600
|
+
}) {
|
|
601
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunk3E7CDKFOCjs5Factory({
|
|
602
|
+
_worklet_12631975666453_init_data,
|
|
603
|
+
wave,
|
|
604
|
+
RIPPLE_START_SCALE,
|
|
605
|
+
center,
|
|
606
|
+
opacity,
|
|
607
|
+
radius
|
|
608
|
+
}) {
|
|
609
|
+
const _e = [new global.Error(), -6, -27];
|
|
610
|
+
const chunk3E7CDKFOCjs5 = function () {
|
|
611
|
+
const t = wave.expand.value;
|
|
612
|
+
const from = wave.origin.value;
|
|
613
|
+
const scale = RIPPLE_START_SCALE + (1 - RIPPLE_START_SCALE) * t;
|
|
614
|
+
const x = from.x + (center.x - from.x) * t;
|
|
615
|
+
const y = from.y + (center.y - from.y) * t;
|
|
616
|
+
return {
|
|
617
|
+
// Its own curve, not the expansion's: full ink in 75ms, held while the circle grows.
|
|
618
|
+
opacity: wave.alpha.value * opacity,
|
|
619
|
+
transform: [{
|
|
620
|
+
translateX: x - radius
|
|
621
|
+
}, {
|
|
622
|
+
translateY: y - radius
|
|
623
|
+
}, {
|
|
624
|
+
scale
|
|
625
|
+
}]
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
chunk3E7CDKFOCjs5.__closure = {
|
|
629
|
+
wave,
|
|
630
|
+
RIPPLE_START_SCALE,
|
|
631
|
+
center,
|
|
632
|
+
opacity,
|
|
633
|
+
radius
|
|
634
|
+
};
|
|
635
|
+
chunk3E7CDKFOCjs5.__workletHash = 12631975666453;
|
|
636
|
+
chunk3E7CDKFOCjs5.__pluginVersion = "0.7.4";
|
|
637
|
+
chunk3E7CDKFOCjs5.__initData = _worklet_12631975666453_init_data;
|
|
638
|
+
chunk3E7CDKFOCjs5.__stackDetails = _e;
|
|
639
|
+
return chunk3E7CDKFOCjs5;
|
|
640
|
+
}({
|
|
641
|
+
_worklet_12631975666453_init_data,
|
|
642
|
+
wave,
|
|
643
|
+
RIPPLE_START_SCALE,
|
|
644
|
+
center,
|
|
645
|
+
opacity,
|
|
646
|
+
radius
|
|
647
|
+
}), [wave, radius, center, opacity]);
|
|
648
|
+
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
|
|
649
|
+
style: [styles.wave, {
|
|
650
|
+
backgroundColor: color,
|
|
651
|
+
width: radius * 2,
|
|
652
|
+
height: radius * 2,
|
|
653
|
+
borderRadius: radius
|
|
654
|
+
}, style, animatedStyle]
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
var styles = _reactnative.StyleSheet.create({
|
|
658
|
+
// `pointerEvents` in the style rather than as a prop: the prop form is deprecated, and it
|
|
659
|
+
// is not decoration — a container that ate touches would claim every press meant for the
|
|
660
|
+
// control it covers.
|
|
661
|
+
clip: {
|
|
662
|
+
overflow: "hidden",
|
|
663
|
+
pointerEvents: "none"
|
|
664
|
+
},
|
|
665
|
+
wave: {
|
|
666
|
+
position: "absolute",
|
|
667
|
+
top: 0,
|
|
668
|
+
start: 0
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
// src/system/pressable-feedback/index.ts
|
|
673
|
+
var PressableFeedback3 = Object.assign(PressableFeedback, {
|
|
674
|
+
Highlight: PressableFeedbackHighlight,
|
|
675
|
+
Ripple: PressableFeedbackRipple
|
|
676
|
+
});
|
|
677
|
+
exports.useFeedback = useFeedback;
|
|
678
|
+
exports.PRESS_SCALE = PRESS_SCALE;
|
|
679
|
+
exports.PRESS_DURATION = PRESS_DURATION;
|
|
680
|
+
exports.SCALE_REFERENCE_WIDTH = SCALE_REFERENCE_WIDTH;
|
|
681
|
+
exports.pressScaleFor = pressScaleFor;
|
|
682
|
+
exports.HIGHLIGHT_OPACITY = HIGHLIGHT_OPACITY;
|
|
683
|
+
exports.HIGHLIGHT_DURATION = HIGHLIGHT_DURATION;
|
|
684
|
+
exports.RIPPLE_OPACITY = RIPPLE_OPACITY;
|
|
685
|
+
exports.RIPPLE_START_SCALE = RIPPLE_START_SCALE;
|
|
686
|
+
exports.RIPPLE_EXPAND_DURATION = RIPPLE_EXPAND_DURATION;
|
|
687
|
+
exports.RIPPLE_CONFIRM_DURATION = RIPPLE_CONFIRM_DURATION;
|
|
688
|
+
exports.RIPPLE_FADE_IN = RIPPLE_FADE_IN;
|
|
689
|
+
exports.RIPPLE_FADE_OUT_DELAY = RIPPLE_FADE_OUT_DELAY;
|
|
690
|
+
exports.RIPPLE_FADE_OUT = RIPPLE_FADE_OUT;
|
|
691
|
+
exports.rippleRadiusFor = rippleRadiusFor;
|
|
692
|
+
exports.resolveAnimation = resolveAnimation;
|
|
693
|
+
exports.resolveSlotAnimation = resolveSlotAnimation;
|
|
694
|
+
exports.FEEDBACK_OVERLAY = FEEDBACK_OVERLAY;
|
|
695
|
+
exports.markOverlay = markOverlay;
|
|
696
|
+
exports.PressableFeedback = PressableFeedback3;
|