@xaui/native 0.9.1-alpha.3 → 0.9.1-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-27ZRTZEE.js +293 -0
- package/dist/chunk-3FV4COTM.js +68 -0
- package/dist/chunk-423RQBOX.js +21 -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-5RQ7AZPN.cjs +455 -0
- package/dist/chunk-5Z4P6WHR.cjs +525 -0
- package/dist/chunk-6RVCGLKZ.js +661 -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-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-E4TS6632.cjs +314 -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-FMZQW35T.js +431 -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-GI24YJPE.js +314 -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-KOC3KQIT.js +124 -0
- package/dist/chunk-KPWZLUES.cjs +124 -0
- package/dist/chunk-KWCHSIMI.cjs +293 -0
- package/dist/chunk-MC7SY2QH.cjs +20 -0
- package/dist/chunk-N527BTY4.cjs +366 -0
- package/dist/chunk-NBFWWQFW.cjs +346 -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-TGZZ3RZU.cjs +86 -0
- package/dist/{chunk-2KXQATVL.js → chunk-TZG3DERP.js} +46 -46
- package/dist/chunk-UBQLKIZC.cjs +431 -0
- 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-YKL6XHM6.js +346 -0
- package/dist/chunk-ZP2E2H2G.cjs +119 -0
- package/dist/chunk-ZSLNGBDS.cjs +700 -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/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 +246 -4
- package/dist/index.d.cts +109 -4
- package/dist/index.d.ts +109 -4
- package/dist/index.js +266 -24
- 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 +174 -18
- package/dist/chunk-QAMNNTGM.js +0 -637
- package/dist/chunk-V63JO65F.cjs +0 -637
|
@@ -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;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useStyleProps
|
|
3
|
+
} from "./chunk-URSKA2VR.js";
|
|
4
|
+
|
|
5
|
+
// src/system/portal/portal.tsx
|
|
6
|
+
import { useContext, useId, useLayoutEffect } from "react";
|
|
7
|
+
|
|
8
|
+
// src/system/portal/portal-context.ts
|
|
9
|
+
import { createContext } from "react";
|
|
10
|
+
var PortalContext = createContext(null);
|
|
11
|
+
|
|
12
|
+
// src/system/portal/portal.tsx
|
|
13
|
+
function Portal({ children }) {
|
|
14
|
+
const context = useContext(PortalContext);
|
|
15
|
+
const key = useId();
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
context?.addPortal(key, children);
|
|
18
|
+
}, [children, context, key]);
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
return () => context?.removePortal(key);
|
|
21
|
+
}, [context, key]);
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
Portal.displayName = "XAUI.Portal";
|
|
25
|
+
|
|
26
|
+
// src/system/portal/portal-host.tsx
|
|
27
|
+
import { Fragment, useCallback, useMemo, useState } from "react";
|
|
28
|
+
import { StyleSheet, View } from "react-native";
|
|
29
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
var styles = StyleSheet.create({
|
|
31
|
+
container: { flex: 1 }
|
|
32
|
+
});
|
|
33
|
+
function PortalHost({ children, ...props }) {
|
|
34
|
+
const [styleProps] = useStyleProps(props);
|
|
35
|
+
const [portals, setPortals] = useState(/* @__PURE__ */ new Map());
|
|
36
|
+
const addPortal = useCallback((key, element) => {
|
|
37
|
+
setPortals((current) => new Map(current).set(key, element));
|
|
38
|
+
}, []);
|
|
39
|
+
const removePortal = useCallback((key) => {
|
|
40
|
+
setPortals((current) => {
|
|
41
|
+
if (!current.has(key)) return current;
|
|
42
|
+
const next = new Map(current);
|
|
43
|
+
next.delete(key);
|
|
44
|
+
return next;
|
|
45
|
+
});
|
|
46
|
+
}, []);
|
|
47
|
+
const methods = useMemo(
|
|
48
|
+
() => ({ addPortal, removePortal }),
|
|
49
|
+
[addPortal, removePortal]
|
|
50
|
+
);
|
|
51
|
+
return /* @__PURE__ */ jsx(PortalContext.Provider, { value: methods, children: /* @__PURE__ */ jsxs(View, { style: [styles.container, styleProps], children: [
|
|
52
|
+
children,
|
|
53
|
+
Array.from(portals, ([key, element]) => /* @__PURE__ */ jsx(Fragment, { children: element }, key))
|
|
54
|
+
] }) });
|
|
55
|
+
}
|
|
56
|
+
PortalHost.displayName = "XAUI.PortalHost";
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
PortalContext,
|
|
60
|
+
Portal,
|
|
61
|
+
PortalHost
|
|
62
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _chunkGLGU2WFLcjs = require('./chunk-GLGU2WFL.cjs');
|
|
7
|
+
|
|
8
|
+
// src/hooks/use-merged-ref.ts
|
|
9
|
+
var _react = require('react');
|
|
10
|
+
function useMergedRef(...refs) {
|
|
11
|
+
return _react.useMemo.call(void 0, () => _chunkGLGU2WFLcjs.mergeRefs.call(void 0, ...refs), refs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/hooks/use-previous.ts
|
|
15
|
+
|
|
16
|
+
function usePrevious(value) {
|
|
17
|
+
const previous = _react.useRef.call(void 0, void 0);
|
|
18
|
+
_react.useEffect.call(void 0, () => {
|
|
19
|
+
previous.current = value;
|
|
20
|
+
}, [value]);
|
|
21
|
+
return previous.current;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/hooks/use-rotation.ts
|
|
25
|
+
|
|
26
|
+
var _reactnativereanimated = require('react-native-reanimated');
|
|
27
|
+
var ROTATION_DURATION = 900;
|
|
28
|
+
const _worklet_4260628533630_init_data = {
|
|
29
|
+
code: "function chunk7XKQJQF2Cjs1(){const{angle}=this.__closure;return{transform:[{rotate:angle.value+\"deg\"}]};}",
|
|
30
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-7XKQJQF2.cjs",
|
|
31
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunk7XKQJQF2Cjs1\",\"angle\",\"__closure\",\"transform\",\"rotate\",\"value\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-7XKQJQF2.cjs\"],\"mappings\":\"AAyC8D,SAAAA,iBAAMA,CAAA,QAAAC,KAAA,OAAAC,SAAA,CAEhE,MAAO,CAAEC,SAAS,CAAE,CAAC,CAAEC,MAAM,CAAKH,KAAK,CAACI,KAAK,MAAM,CAAC,CAAE,CAAC,CACzD\",\"ignoreList\":[]}"
|
|
32
|
+
};
|
|
33
|
+
function useRotation() {
|
|
34
|
+
const angle = _reactnativereanimated.useSharedValue.call(void 0, 0);
|
|
35
|
+
_react.useEffect.call(void 0, () => {
|
|
36
|
+
angle.value = _reactnativereanimated.withRepeat.call(void 0, _reactnativereanimated.withTiming.call(void 0, 360, {
|
|
37
|
+
duration: ROTATION_DURATION,
|
|
38
|
+
easing: _reactnativereanimated.Easing.linear
|
|
39
|
+
}), -1, false);
|
|
40
|
+
return () => _reactnativereanimated.cancelAnimation.call(void 0, angle);
|
|
41
|
+
}, [angle]);
|
|
42
|
+
return _reactnativereanimated.useAnimatedStyle.call(void 0, function chunk7XKQJQF2Cjs1Factory({
|
|
43
|
+
_worklet_4260628533630_init_data,
|
|
44
|
+
angle
|
|
45
|
+
}) {
|
|
46
|
+
const _e = [new global.Error(), -2, -27];
|
|
47
|
+
const chunk7XKQJQF2Cjs1 = function () {
|
|
48
|
+
return {
|
|
49
|
+
transform: [{
|
|
50
|
+
rotate: `${angle.value}deg`
|
|
51
|
+
}]
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
chunk7XKQJQF2Cjs1.__closure = {
|
|
55
|
+
angle
|
|
56
|
+
};
|
|
57
|
+
chunk7XKQJQF2Cjs1.__workletHash = 4260628533630;
|
|
58
|
+
chunk7XKQJQF2Cjs1.__pluginVersion = "0.7.4";
|
|
59
|
+
chunk7XKQJQF2Cjs1.__initData = _worklet_4260628533630_init_data;
|
|
60
|
+
chunk7XKQJQF2Cjs1.__stackDetails = _e;
|
|
61
|
+
return chunk7XKQJQF2Cjs1;
|
|
62
|
+
}({
|
|
63
|
+
_worklet_4260628533630_init_data,
|
|
64
|
+
angle
|
|
65
|
+
}), [angle]);
|
|
66
|
+
}
|
|
67
|
+
exports.useMergedRef = useMergedRef;
|
|
68
|
+
exports.usePrevious = usePrevious;
|
|
69
|
+
exports.ROTATION_DURATION = ROTATION_DURATION;
|
|
70
|
+
exports.useRotation = useRotation;
|
|
@@ -107,7 +107,10 @@ function deriveTint(tint, theme) {
|
|
|
107
107
|
foreground,
|
|
108
108
|
soft: alpha(tint, 0.15),
|
|
109
109
|
softForeground: mix(tint, theme.colors.foreground, 0.2),
|
|
110
|
-
|
|
110
|
+
// Towards the mode's ink, not the tint's own foreground — the same single direction
|
|
111
|
+
// the token layer takes (P2-API-REVIEW §E). A raw tint has to behave like `accent`
|
|
112
|
+
// under the finger as much as it does at rest.
|
|
113
|
+
pressed: mix(tint, theme.colors.foreground, 0.1),
|
|
111
114
|
softPressed: alpha(tint, 0.2)
|
|
112
115
|
};
|
|
113
116
|
cache.set(key, derived);
|
|
@@ -119,7 +122,9 @@ export {
|
|
|
119
122
|
useXAUITheme,
|
|
120
123
|
useColorMode,
|
|
121
124
|
useThemeColor,
|
|
125
|
+
isHex,
|
|
122
126
|
mix,
|
|
123
127
|
alpha,
|
|
128
|
+
contrastOn,
|
|
124
129
|
deriveTint
|
|
125
130
|
};
|