@xaui/native 0.9.1-alpha.26 → 0.9.1-alpha.28
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-3YN7JQ55.js +342 -0
- package/dist/{chunk-PQHC65AG.js → chunk-56KVKM27.js} +15 -15
- package/dist/chunk-5A4M6X5B.cjs +289 -0
- package/dist/{chunk-BULNTP5N.cjs → chunk-63TWVWHG.cjs} +9 -45
- package/dist/chunk-7EIHHOHP.cjs +42 -0
- package/dist/{chunk-WVCAFORA.cjs → chunk-CQRUNV6S.cjs} +15 -15
- package/dist/chunk-E6EFYPJR.cjs +41 -0
- package/dist/chunk-EYJEUXXC.js +98 -0
- package/dist/chunk-F6W3JQ7K.js +42 -0
- package/dist/chunk-LKB3RIR2.js +289 -0
- package/dist/{chunk-I6UCYAO2.js → chunk-N4UJYDOW.js} +23 -56
- package/dist/chunk-V6DGGDHF.cjs +342 -0
- package/dist/components/alert/index.cjs +1 -1
- package/dist/components/alert/index.d.cts +1 -1
- package/dist/components/alert/index.d.ts +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/button/index.cjs +3 -3
- package/dist/components/button/index.d.cts +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/card/index.d.cts +1 -1
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/checkbox/index.cjs +24 -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 +24 -0
- package/dist/components/chip/index.cjs +3 -3
- package/dist/components/chip/index.d.cts +1 -1
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/index.js +2 -2
- package/dist/components/input/index.d.cts +3 -3
- package/dist/components/input/index.d.ts +3 -3
- package/dist/components/input-otp/index.cjs +3 -2
- package/dist/components/input-otp/index.d.cts +3 -3
- package/dist/components/input-otp/index.d.ts +3 -3
- package/dist/components/input-otp/index.js +2 -1
- package/dist/components/radio/index.cjs +24 -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 +24 -0
- package/dist/components/typography/index.d.cts +1 -1
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/{create-recipe-dBN_ewZc.d.cts → create-recipe-CWvI5ot3.d.cts} +8 -1
- package/dist/{create-recipe-C4JkINrA.d.ts → create-recipe-DUo8doTt.d.ts} +8 -1
- package/dist/index.cjs +45 -11
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +50 -16
- package/dist/system/index.cjs +7 -3
- package/dist/system/index.d.cts +36 -3
- package/dist/system/index.d.ts +36 -3
- package/dist/system/index.js +6 -2
- package/package.json +21 -1
- package/dist/{chunk-3WISQT22.js → chunk-EHARM2EN.js} +3 -3
- package/dist/{chunk-I7G77Q65.cjs → chunk-H7DVR52Z.cjs} +2 -2
- /package/dist/{chunk-6HXWQ5AU.cjs → chunk-VZGBEGDV.cjs} +0 -0
- /package/dist/{chunk-AKXG43S4.js → chunk-Y4BPKSD3.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7EIHHOHPcjs = require('./chunk-7EIHHOHP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -179,41 +179,6 @@ InputOTPSeparator.displayName = "XAUI.InputOTP.Separator";
|
|
|
179
179
|
// src/components/input-otp/input-otp.hook.ts
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
// src/hooks/use-controllable-state.ts
|
|
183
|
-
|
|
184
|
-
function useControllableState({
|
|
185
|
-
value,
|
|
186
|
-
defaultValue,
|
|
187
|
-
onChange
|
|
188
|
-
}) {
|
|
189
|
-
const [uncontrolled, setUncontrolled] = _react.useState.call(void 0, defaultValue);
|
|
190
|
-
const isControlled = value !== void 0;
|
|
191
|
-
const current = isControlled ? value : uncontrolled;
|
|
192
|
-
useControlWarning(isControlled);
|
|
193
|
-
const latest = _react.useRef.call(void 0, current);
|
|
194
|
-
latest.current = current;
|
|
195
|
-
const onChangeRef = _react.useRef.call(void 0, onChange);
|
|
196
|
-
onChangeRef.current = onChange;
|
|
197
|
-
const controlled = _react.useRef.call(void 0, isControlled);
|
|
198
|
-
controlled.current = isControlled;
|
|
199
|
-
const set = _react.useCallback.call(void 0, (next) => {
|
|
200
|
-
const resolved = typeof next === "function" ? next(latest.current) : next;
|
|
201
|
-
if (resolved === latest.current) return;
|
|
202
|
-
if (!controlled.current) setUncontrolled(resolved);
|
|
203
|
-
_optionalChain([onChangeRef, 'access', _6 => _6.current, 'optionalCall', _7 => _7(resolved)]);
|
|
204
|
-
}, []);
|
|
205
|
-
return [current, set];
|
|
206
|
-
}
|
|
207
|
-
function useControlWarning(isControlled) {
|
|
208
|
-
const wasControlled = _react.useRef.call(void 0, isControlled);
|
|
209
|
-
if (wasControlled.current !== isControlled) {
|
|
210
|
-
_chunkEJQCQPETcjs.warnDev.call(void 0,
|
|
211
|
-
`a component switched from ${wasControlled.current ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Decide for the life of the component: pass \`value\` always, or never. Passing \`undefined\` for a value you do control reads as "uncontrolled" here.`
|
|
212
|
-
);
|
|
213
|
-
wasControlled.current = isControlled;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
182
|
// src/components/input-otp/input-otp.utils.ts
|
|
218
183
|
function buildSlots({
|
|
219
184
|
value,
|
|
@@ -240,7 +205,7 @@ function placeholderFor(placeholder, index) {
|
|
|
240
205
|
}
|
|
241
206
|
function extractPastedCode(pasted, maxLength) {
|
|
242
207
|
const match = pasted.match(new RegExp(`(?<!\\d)(\\d{${maxLength}})(?!\\d)`));
|
|
243
|
-
return _nullishCoalesce(_optionalChain([match, 'optionalAccess',
|
|
208
|
+
return _nullishCoalesce(_optionalChain([match, 'optionalAccess', _6 => _6[1]]), () => ( ""));
|
|
244
209
|
}
|
|
245
210
|
function isPaste(text, previous) {
|
|
246
211
|
return text.length > previous.length + 1;
|
|
@@ -259,7 +224,7 @@ function useInputOTPState({
|
|
|
259
224
|
pattern,
|
|
260
225
|
placeholder
|
|
261
226
|
}) {
|
|
262
|
-
const [value, setValue] = useControllableState({
|
|
227
|
+
const [value, setValue] = _chunk7EIHHOHPcjs.useControllableState.call(void 0, {
|
|
263
228
|
value: valueProp,
|
|
264
229
|
defaultValue,
|
|
265
230
|
onChange: onChangeTextProp
|
|
@@ -282,18 +247,18 @@ function useInputOTPState({
|
|
|
282
247
|
const next = candidate.slice(0, current.maxLength);
|
|
283
248
|
if (next.length > 0 && current.regexp && !current.regexp.test(next)) return;
|
|
284
249
|
current.setValue(next);
|
|
285
|
-
if (next.length === current.maxLength) _optionalChain([current, 'access',
|
|
250
|
+
if (next.length === current.maxLength) _optionalChain([current, 'access', _7 => _7.onComplete, 'optionalCall', _8 => _8(next)]);
|
|
286
251
|
}, []);
|
|
287
252
|
const onFocus = _react.useCallback.call(void 0, () => setIsFocused(true), []);
|
|
288
253
|
const onBlur = _react.useCallback.call(void 0, () => setIsFocused(false), []);
|
|
289
254
|
const handle = _react.useMemo.call(void 0,
|
|
290
255
|
() => ({
|
|
291
|
-
focus: () => _optionalChain([inputRef, 'access',
|
|
292
|
-
blur: () => _optionalChain([inputRef, 'access',
|
|
256
|
+
focus: () => _optionalChain([inputRef, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.focus, 'call', _11 => _11()]),
|
|
257
|
+
blur: () => _optionalChain([inputRef, 'access', _12 => _12.current, 'optionalAccess', _13 => _13.blur, 'call', _14 => _14()]),
|
|
293
258
|
// Both halves: the native buffer and our value. Clearing one and not the other is
|
|
294
259
|
// how a cleared field comes back on the next keystroke.
|
|
295
260
|
clear: () => {
|
|
296
|
-
_optionalChain([inputRef, 'access',
|
|
261
|
+
_optionalChain([inputRef, 'access', _15 => _15.current, 'optionalAccess', _16 => _16.clear, 'call', _17 => _17()]);
|
|
297
262
|
latest.current.setValue("");
|
|
298
263
|
}
|
|
299
264
|
}),
|
|
@@ -567,7 +532,7 @@ var InputOTPRoot = _react.forwardRef.call(void 0,
|
|
|
567
532
|
isInvalid
|
|
568
533
|
]
|
|
569
534
|
);
|
|
570
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputOTPProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles.root, _optionalChain([tint, 'optionalAccess',
|
|
535
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InputOTPProvider, { value: context, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _reactnative.View, { style: [styles.root, _optionalChain([tint, 'optionalAccess', _18 => _18.root]), styleProps, style], ...rest, children: [
|
|
571
536
|
children,
|
|
572
537
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
573
538
|
_reactnative.TextInput,
|
|
@@ -616,5 +581,4 @@ var InputOTP2 = Object.assign(InputOTPRoot, {
|
|
|
616
581
|
|
|
617
582
|
|
|
618
583
|
|
|
619
|
-
|
|
620
|
-
exports.useInputOTP = useInputOTP; exports.useInputOTPBox = useInputOTPBox; exports.useControllableState = useControllableState; exports.buildSlots = buildSlots; exports.extractPastedCode = extractPastedCode; exports.OTP_DIGITS = OTP_DIGITS; exports.OTP_LETTERS = OTP_LETTERS; exports.OTP_ALPHANUMERIC = OTP_ALPHANUMERIC; exports.inputOTPRecipe = inputOTPRecipe; exports.InputOTP = InputOTP2;
|
|
584
|
+
exports.useInputOTP = useInputOTP; exports.useInputOTPBox = useInputOTPBox; exports.buildSlots = buildSlots; exports.extractPastedCode = extractPastedCode; exports.OTP_DIGITS = OTP_DIGITS; exports.OTP_LETTERS = OTP_LETTERS; exports.OTP_ALPHANUMERIC = OTP_ALPHANUMERIC; exports.inputOTPRecipe = inputOTPRecipe; exports.InputOTP = InputOTP2;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-controllable-state.ts
|
|
6
|
+
var _react = require('react');
|
|
7
|
+
function useControllableState({
|
|
8
|
+
value,
|
|
9
|
+
defaultValue,
|
|
10
|
+
onChange
|
|
11
|
+
}) {
|
|
12
|
+
const [uncontrolled, setUncontrolled] = _react.useState.call(void 0, defaultValue);
|
|
13
|
+
const isControlled = value !== void 0;
|
|
14
|
+
const current = isControlled ? value : uncontrolled;
|
|
15
|
+
useControlWarning(isControlled);
|
|
16
|
+
const latest = _react.useRef.call(void 0, current);
|
|
17
|
+
latest.current = current;
|
|
18
|
+
const onChangeRef = _react.useRef.call(void 0, onChange);
|
|
19
|
+
onChangeRef.current = onChange;
|
|
20
|
+
const controlled = _react.useRef.call(void 0, isControlled);
|
|
21
|
+
controlled.current = isControlled;
|
|
22
|
+
const set = _react.useCallback.call(void 0, (next) => {
|
|
23
|
+
const resolved = typeof next === "function" ? next(latest.current) : next;
|
|
24
|
+
if (resolved === latest.current) return;
|
|
25
|
+
if (!controlled.current) setUncontrolled(resolved);
|
|
26
|
+
_optionalChain([onChangeRef, 'access', _ => _.current, 'optionalCall', _2 => _2(resolved)]);
|
|
27
|
+
}, []);
|
|
28
|
+
return [current, set];
|
|
29
|
+
}
|
|
30
|
+
function useControlWarning(isControlled) {
|
|
31
|
+
const wasControlled = _react.useRef.call(void 0, isControlled);
|
|
32
|
+
if (wasControlled.current !== isControlled) {
|
|
33
|
+
_chunkEJQCQPETcjs.warnDev.call(void 0,
|
|
34
|
+
`a component switched from ${wasControlled.current ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Decide for the life of the component: pass \`value\` always, or never. Passing \`undefined\` for a value you do control reads as "uncontrolled" here.`
|
|
35
|
+
);
|
|
36
|
+
wasControlled.current = isControlled;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.useControllableState = useControllableState;
|
|
@@ -37,8 +37,8 @@ function _optionalChain(ops) {
|
|
|
37
37
|
return value;
|
|
38
38
|
}
|
|
39
39
|
var _chunkIG4Q3WQOcjs = require('./chunk-IG4Q3WQO.cjs');
|
|
40
|
-
var _chunkB4W2XNBPcjs = require('./chunk-B4W2XNBP.cjs');
|
|
41
40
|
var _chunkEJQCQPETcjs = require('./chunk-EJQCQPET.cjs');
|
|
41
|
+
var _chunkB4W2XNBPcjs = require('./chunk-B4W2XNBP.cjs');
|
|
42
42
|
var _chunkYXVKQMCKcjs = require('./chunk-YXVKQMCK.cjs');
|
|
43
43
|
var _chunkHUZ4AUM2cjs = require('./chunk-HUZ4AUM2.cjs');
|
|
44
44
|
var _chunk57SJ4LJFcjs = require('./chunk-57SJ4LJF.cjs');
|
|
@@ -110,10 +110,10 @@ function ButtonSpinner({
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
ButtonSpinner.displayName = "XAUI.Button.Spinner";
|
|
113
|
-
const
|
|
114
|
-
code: "function
|
|
115
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
116
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
113
|
+
const _worklet_3366338208300_init_data = {
|
|
114
|
+
code: "function chunkCQRUNV6SCjs1(){const{angle}=this.__closure;return{transform:[{rotate:angle.value+\"deg\"}]};}",
|
|
115
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-CQRUNV6S.cjs",
|
|
116
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkCQRUNV6SCjs1\",\"angle\",\"__closure\",\"transform\",\"rotate\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-CQRUNV6S.cjs\"],\"mappings\":\"AAqF6E,SAAAA,iBAAMA,CAAA,QAAAC,KAAA,OAAAC,SAAA,CAE/E,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,MAAM,CAAKH,KAAK,CAACI,KAAK,MAAM,CAAC,CAAE,CAAC,CACzD\",\"ignoreList\":[]}"
|
|
117
117
|
};
|
|
118
118
|
function SpinningRing({
|
|
119
119
|
style
|
|
@@ -126,28 +126,28 @@ function SpinningRing({
|
|
|
126
126
|
}), -1, false);
|
|
127
127
|
return () => _reactnativereanimated.cancelAnimation.call(void 0, angle);
|
|
128
128
|
}, [angle]);
|
|
129
|
-
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function
|
|
130
|
-
|
|
129
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, function chunkCQRUNV6SCjs1Factory({
|
|
130
|
+
_worklet_3366338208300_init_data,
|
|
131
131
|
angle
|
|
132
132
|
}) {
|
|
133
133
|
const _e = [new global.Error(), -2, -27];
|
|
134
|
-
const
|
|
134
|
+
const chunkCQRUNV6SCjs1 = function () {
|
|
135
135
|
return {
|
|
136
136
|
transform: [{
|
|
137
137
|
rotate: `${angle.value}deg`
|
|
138
138
|
}]
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
|
|
141
|
+
chunkCQRUNV6SCjs1.__closure = {
|
|
142
142
|
angle
|
|
143
143
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return
|
|
144
|
+
chunkCQRUNV6SCjs1.__workletHash = 3366338208300;
|
|
145
|
+
chunkCQRUNV6SCjs1.__pluginVersion = "0.7.4";
|
|
146
|
+
chunkCQRUNV6SCjs1.__initData = _worklet_3366338208300_init_data;
|
|
147
|
+
chunkCQRUNV6SCjs1.__stackDetails = _e;
|
|
148
|
+
return chunkCQRUNV6SCjs1;
|
|
149
149
|
}({
|
|
150
|
-
|
|
150
|
+
_worklet_3366338208300_init_data,
|
|
151
151
|
angle
|
|
152
152
|
}), [angle]);
|
|
153
153
|
return /* @__PURE__ */_jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/system/selection-fill/selection-fill.tsx
|
|
2
|
+
var _reactnative = require('react-native');
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
8
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
9
|
+
var DURATION = 120;
|
|
10
|
+
var FROM_SCALE = 0.8;
|
|
11
|
+
function SelectionFill({
|
|
12
|
+
isVisible,
|
|
13
|
+
style,
|
|
14
|
+
animation = true,
|
|
15
|
+
children
|
|
16
|
+
}) {
|
|
17
|
+
if (!animation) {
|
|
18
|
+
return isVisible ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnative.View, { style, children }) : null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AnimatedFill, { isVisible, style, children });
|
|
21
|
+
}
|
|
22
|
+
SelectionFill.displayName = "XAUI.SelectionFill";
|
|
23
|
+
function AnimatedFill({
|
|
24
|
+
isVisible,
|
|
25
|
+
style,
|
|
26
|
+
children
|
|
27
|
+
}) {
|
|
28
|
+
const progress = _reactnativereanimated.useDerivedValue.call(void 0,
|
|
29
|
+
() => _reactnativereanimated.withTiming.call(void 0, isVisible ? 1 : 0, { duration: DURATION }),
|
|
30
|
+
[isVisible]
|
|
31
|
+
);
|
|
32
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, () => ({
|
|
33
|
+
opacity: progress.value,
|
|
34
|
+
transform: [{ scale: FROM_SCALE + (1 - FROM_SCALE) * progress.value }]
|
|
35
|
+
}));
|
|
36
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactnativereanimated2.default.View, { style: [style, animatedStyle], children });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
exports.SelectionFill = SelectionFill;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// src/system/selection-fill/selection-fill.tsx
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle, useDerivedValue, withTiming } from "react-native-reanimated";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var DURATION = 120;
|
|
6
|
+
var FROM_SCALE = 0.8;
|
|
7
|
+
function SelectionFill({
|
|
8
|
+
isVisible,
|
|
9
|
+
style,
|
|
10
|
+
animation = true,
|
|
11
|
+
children
|
|
12
|
+
}) {
|
|
13
|
+
if (!animation) {
|
|
14
|
+
return isVisible ? /* @__PURE__ */jsx(View, {
|
|
15
|
+
style,
|
|
16
|
+
children
|
|
17
|
+
}) : null;
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */jsx(AnimatedFill, {
|
|
20
|
+
isVisible,
|
|
21
|
+
style,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
SelectionFill.displayName = "XAUI.SelectionFill";
|
|
26
|
+
const _worklet_7679226029618_init_data = {
|
|
27
|
+
code: "function chunkEYJEUXXCJs1(){const{withTiming,isVisible,DURATION}=this.__closure;return withTiming(isVisible?1:0,{duration:DURATION});}",
|
|
28
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-EYJEUXXC.js",
|
|
29
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkEYJEUXXCJs1\",\"withTiming\",\"isVisible\",\"DURATION\",\"__closure\",\"duration\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-EYJEUXXC.js\"],\"mappings\":\"AA4BI,SAAAA,iBAAA,QAAAC,UAAA,CAAAC,SAAA,CAAAC,QAAA,OAAAC,SAAA,OAAM,CAAAH,UAAW,CAAAC,SAAS,CAAI,EAAI,EAAE,CAAEG,QAAQ,CAAEF,QAAS,CAAC\",\"ignoreList\":[]}"
|
|
30
|
+
};
|
|
31
|
+
const _worklet_7274007758171_init_data = {
|
|
32
|
+
code: "function chunkEYJEUXXCJs2(){const{progress,FROM_SCALE}=this.__closure;return{opacity:progress.value,transform:[{scale:FROM_SCALE+(1-FROM_SCALE)*progress.value}]};}",
|
|
33
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-EYJEUXXC.js",
|
|
34
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunkEYJEUXXCJs2\",\"progress\",\"FROM_SCALE\",\"__closure\",\"opacity\",\"value\",\"transform\",\"scale\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-EYJEUXXC.js\"],\"mappings\":\"AA+ByC,SAAAA,iBAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC5CC,OAAO,CAAEH,QAAQ,CAACI,KAAK,CACvBC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEL,UAAU,CAAG,CAAC,CAAC,CAAGA,UAAU,EAAID,QAAQ,CAACI,KAAM,CAAC,CACvE,CAAC\",\"ignoreList\":[]}"
|
|
35
|
+
};
|
|
36
|
+
function AnimatedFill({
|
|
37
|
+
isVisible,
|
|
38
|
+
style,
|
|
39
|
+
children
|
|
40
|
+
}) {
|
|
41
|
+
const progress = useDerivedValue(function chunkEYJEUXXCJs1Factory({
|
|
42
|
+
_worklet_7679226029618_init_data,
|
|
43
|
+
withTiming,
|
|
44
|
+
isVisible,
|
|
45
|
+
DURATION
|
|
46
|
+
}) {
|
|
47
|
+
const _e = [new global.Error(), -4, -27];
|
|
48
|
+
const chunkEYJEUXXCJs1 = () => withTiming(isVisible ? 1 : 0, {
|
|
49
|
+
duration: DURATION
|
|
50
|
+
});
|
|
51
|
+
chunkEYJEUXXCJs1.__closure = {
|
|
52
|
+
withTiming,
|
|
53
|
+
isVisible,
|
|
54
|
+
DURATION
|
|
55
|
+
};
|
|
56
|
+
chunkEYJEUXXCJs1.__workletHash = 7679226029618;
|
|
57
|
+
chunkEYJEUXXCJs1.__pluginVersion = "0.7.4";
|
|
58
|
+
chunkEYJEUXXCJs1.__initData = _worklet_7679226029618_init_data;
|
|
59
|
+
chunkEYJEUXXCJs1.__stackDetails = _e;
|
|
60
|
+
return chunkEYJEUXXCJs1;
|
|
61
|
+
}({
|
|
62
|
+
_worklet_7679226029618_init_data,
|
|
63
|
+
withTiming,
|
|
64
|
+
isVisible,
|
|
65
|
+
DURATION
|
|
66
|
+
}), [isVisible]);
|
|
67
|
+
const animatedStyle = useAnimatedStyle(function chunkEYJEUXXCJs2Factory({
|
|
68
|
+
_worklet_7274007758171_init_data,
|
|
69
|
+
progress,
|
|
70
|
+
FROM_SCALE
|
|
71
|
+
}) {
|
|
72
|
+
const _e = [new global.Error(), -3, -27];
|
|
73
|
+
const chunkEYJEUXXCJs2 = () => ({
|
|
74
|
+
opacity: progress.value,
|
|
75
|
+
transform: [{
|
|
76
|
+
scale: FROM_SCALE + (1 - FROM_SCALE) * progress.value
|
|
77
|
+
}]
|
|
78
|
+
});
|
|
79
|
+
chunkEYJEUXXCJs2.__closure = {
|
|
80
|
+
progress,
|
|
81
|
+
FROM_SCALE
|
|
82
|
+
};
|
|
83
|
+
chunkEYJEUXXCJs2.__workletHash = 7274007758171;
|
|
84
|
+
chunkEYJEUXXCJs2.__pluginVersion = "0.7.4";
|
|
85
|
+
chunkEYJEUXXCJs2.__initData = _worklet_7274007758171_init_data;
|
|
86
|
+
chunkEYJEUXXCJs2.__stackDetails = _e;
|
|
87
|
+
return chunkEYJEUXXCJs2;
|
|
88
|
+
}({
|
|
89
|
+
_worklet_7274007758171_init_data,
|
|
90
|
+
progress,
|
|
91
|
+
FROM_SCALE
|
|
92
|
+
}));
|
|
93
|
+
return /* @__PURE__ */jsx(Animated.View, {
|
|
94
|
+
style: [style, animatedStyle],
|
|
95
|
+
children
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
export { SelectionFill };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
warnDev
|
|
3
|
+
} from "./chunk-EGLLDKN6.js";
|
|
4
|
+
|
|
5
|
+
// src/hooks/use-controllable-state.ts
|
|
6
|
+
import { useCallback, useRef, useState } from "react";
|
|
7
|
+
function useControllableState({
|
|
8
|
+
value,
|
|
9
|
+
defaultValue,
|
|
10
|
+
onChange
|
|
11
|
+
}) {
|
|
12
|
+
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
13
|
+
const isControlled = value !== void 0;
|
|
14
|
+
const current = isControlled ? value : uncontrolled;
|
|
15
|
+
useControlWarning(isControlled);
|
|
16
|
+
const latest = useRef(current);
|
|
17
|
+
latest.current = current;
|
|
18
|
+
const onChangeRef = useRef(onChange);
|
|
19
|
+
onChangeRef.current = onChange;
|
|
20
|
+
const controlled = useRef(isControlled);
|
|
21
|
+
controlled.current = isControlled;
|
|
22
|
+
const set = useCallback((next) => {
|
|
23
|
+
const resolved = typeof next === "function" ? next(latest.current) : next;
|
|
24
|
+
if (resolved === latest.current) return;
|
|
25
|
+
if (!controlled.current) setUncontrolled(resolved);
|
|
26
|
+
onChangeRef.current?.(resolved);
|
|
27
|
+
}, []);
|
|
28
|
+
return [current, set];
|
|
29
|
+
}
|
|
30
|
+
function useControlWarning(isControlled) {
|
|
31
|
+
const wasControlled = useRef(isControlled);
|
|
32
|
+
if (wasControlled.current !== isControlled) {
|
|
33
|
+
warnDev(
|
|
34
|
+
`a component switched from ${wasControlled.current ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}. Decide for the life of the component: pass \`value\` always, or never. Passing \`undefined\` for a value you do control reads as "uncontrolled" here.`
|
|
35
|
+
);
|
|
36
|
+
wasControlled.current = isControlled;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
useControllableState
|
|
42
|
+
};
|