@react-xp/aeiou 0.1.0-rc.1
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/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/cjs/components/a/a.native.js +16 -0
- package/dist/cjs/components/a/a.web.js +15 -0
- package/dist/cjs/components/a/index.native.js +17 -0
- package/dist/cjs/components/a/index.web.js +17 -0
- package/dist/cjs/components/d/d.native.js +28 -0
- package/dist/cjs/components/d/d.web.js +33 -0
- package/dist/cjs/components/d/index.native.js +17 -0
- package/dist/cjs/components/d/index.web.js +17 -0
- package/dist/cjs/components/e/e.native.js +20 -0
- package/dist/cjs/components/e/e.web.js +15 -0
- package/dist/cjs/components/e/index.native.js +17 -0
- package/dist/cjs/components/e/index.web.js +17 -0
- package/dist/cjs/components/i/i.native.js +30 -0
- package/dist/cjs/components/i/i.web.js +23 -0
- package/dist/cjs/components/i/index.native.js +17 -0
- package/dist/cjs/components/i/index.web.js +17 -0
- package/dist/cjs/components/i/useIUtils.js +71 -0
- package/dist/cjs/components/index.js +26 -0
- package/dist/cjs/components/index.native.js +26 -0
- package/dist/cjs/components/index.web.js +26 -0
- package/dist/cjs/components/l/index.native.js +17 -0
- package/dist/cjs/components/l/index.web.js +17 -0
- package/dist/cjs/components/l/l.native.js +10 -0
- package/dist/cjs/components/l/l.web.js +17 -0
- package/dist/cjs/components/o/index.native.js +17 -0
- package/dist/cjs/components/o/index.web.js +17 -0
- package/dist/cjs/components/o/o.native.js +12 -0
- package/dist/cjs/components/o/o.web.js +12 -0
- package/dist/cjs/components/p/index.native.js +17 -0
- package/dist/cjs/components/p/index.web.js +17 -0
- package/dist/cjs/components/p/p.native.js +13 -0
- package/dist/cjs/components/p/p.web.js +13 -0
- package/dist/cjs/components/s/index.native.js +17 -0
- package/dist/cjs/components/s/index.web.js +17 -0
- package/dist/cjs/components/s/s.native.js +10 -0
- package/dist/cjs/components/s/s.web.js +10 -0
- package/dist/cjs/components/t/index.native.js +17 -0
- package/dist/cjs/components/t/index.web.js +17 -0
- package/dist/cjs/components/t/t.native.js +16 -0
- package/dist/cjs/components/t/t.web.js +16 -0
- package/dist/cjs/components/u/context.js +14 -0
- package/dist/cjs/components/u/index.native.js +19 -0
- package/dist/cjs/components/u/index.web.js +19 -0
- package/dist/cjs/components/u/provider.native.js +23 -0
- package/dist/cjs/components/u/provider.web.js +20 -0
- package/dist/cjs/components/u/types.js +2 -0
- package/dist/cjs/components/u/useUniverse.js +8 -0
- package/dist/cjs/hooks/index.js +21 -0
- package/dist/cjs/hooks/index.native.js +21 -0
- package/dist/cjs/hooks/index.web.js +21 -0
- package/dist/cjs/hooks/useAction/types.js +2 -0
- package/dist/cjs/hooks/useAction/useAction.native.js +18 -0
- package/dist/cjs/hooks/useAction/useAction.web.js +21 -0
- package/dist/cjs/hooks/useCn.js +15 -0
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.native.js +71 -0
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.types.js +2 -0
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.web.js +71 -0
- package/dist/cjs/hooks/useOnChange.js +18 -0
- package/dist/cjs/hooks/useProps.js +66 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/index.native.js +19 -0
- package/dist/cjs/index.web.js +19 -0
- package/dist/cjs/types/base.js +2 -0
- package/dist/cjs/types/index.js +17 -0
- package/dist/esm/components/a/a.native.js +12 -0
- package/dist/esm/components/a/a.web.js +11 -0
- package/dist/esm/components/a/index.native.js +1 -0
- package/dist/esm/components/a/index.web.js +1 -0
- package/dist/esm/components/d/d.native.js +24 -0
- package/dist/esm/components/d/d.web.js +29 -0
- package/dist/esm/components/d/index.native.js +1 -0
- package/dist/esm/components/d/index.web.js +1 -0
- package/dist/esm/components/e/e.native.js +16 -0
- package/dist/esm/components/e/e.web.js +11 -0
- package/dist/esm/components/e/index.native.js +1 -0
- package/dist/esm/components/e/index.web.js +1 -0
- package/dist/esm/components/i/i.native.js +26 -0
- package/dist/esm/components/i/i.web.js +19 -0
- package/dist/esm/components/i/index.native.js +1 -0
- package/dist/esm/components/i/index.web.js +1 -0
- package/dist/esm/components/i/useIUtils.js +67 -0
- package/dist/esm/components/index.js +10 -0
- package/dist/esm/components/index.native.js +10 -0
- package/dist/esm/components/index.web.js +10 -0
- package/dist/esm/components/l/index.native.js +1 -0
- package/dist/esm/components/l/index.web.js +1 -0
- package/dist/esm/components/l/l.native.js +6 -0
- package/dist/esm/components/l/l.web.js +13 -0
- package/dist/esm/components/o/index.native.js +1 -0
- package/dist/esm/components/o/index.web.js +1 -0
- package/dist/esm/components/o/o.native.js +8 -0
- package/dist/esm/components/o/o.web.js +8 -0
- package/dist/esm/components/p/index.native.js +1 -0
- package/dist/esm/components/p/index.web.js +1 -0
- package/dist/esm/components/p/p.native.js +9 -0
- package/dist/esm/components/p/p.web.js +9 -0
- package/dist/esm/components/s/index.native.js +1 -0
- package/dist/esm/components/s/index.web.js +1 -0
- package/dist/esm/components/s/s.native.js +7 -0
- package/dist/esm/components/s/s.web.js +6 -0
- package/dist/esm/components/t/index.native.js +1 -0
- package/dist/esm/components/t/index.web.js +1 -0
- package/dist/esm/components/t/t.native.js +12 -0
- package/dist/esm/components/t/t.web.js +12 -0
- package/dist/esm/components/u/context.js +11 -0
- package/dist/esm/components/u/index.native.js +3 -0
- package/dist/esm/components/u/index.web.js +3 -0
- package/dist/esm/components/u/provider.native.js +19 -0
- package/dist/esm/components/u/provider.web.js +16 -0
- package/dist/esm/components/u/types.js +1 -0
- package/dist/esm/components/u/useUniverse.js +5 -0
- package/dist/esm/hooks/index.js +5 -0
- package/dist/esm/hooks/index.native.js +5 -0
- package/dist/esm/hooks/index.web.js +5 -0
- package/dist/esm/hooks/useAction/types.js +1 -0
- package/dist/esm/hooks/useAction/useAction.native.js +14 -0
- package/dist/esm/hooks/useAction/useAction.web.js +17 -0
- package/dist/esm/hooks/useCn.js +8 -0
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.native.js +68 -0
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.types.js +1 -0
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.web.js +68 -0
- package/dist/esm/hooks/useOnChange.js +14 -0
- package/dist/esm/hooks/useProps.js +59 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.native.js +3 -0
- package/dist/esm/index.web.js +3 -0
- package/dist/esm/types/base.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/types/components/a/a.native.d.ts +4 -0
- package/dist/types/components/a/a.native.d.ts.map +1 -0
- package/dist/types/components/a/a.web.d.ts +4 -0
- package/dist/types/components/a/a.web.d.ts.map +1 -0
- package/dist/types/components/a/index.native.d.ts +2 -0
- package/dist/types/components/a/index.native.d.ts.map +1 -0
- package/dist/types/components/a/index.web.d.ts +2 -0
- package/dist/types/components/a/index.web.d.ts.map +1 -0
- package/dist/types/components/d/d.native.d.ts +4 -0
- package/dist/types/components/d/d.native.d.ts.map +1 -0
- package/dist/types/components/d/d.web.d.ts +4 -0
- package/dist/types/components/d/d.web.d.ts.map +1 -0
- package/dist/types/components/d/index.native.d.ts +2 -0
- package/dist/types/components/d/index.native.d.ts.map +1 -0
- package/dist/types/components/d/index.web.d.ts +2 -0
- package/dist/types/components/d/index.web.d.ts.map +1 -0
- package/dist/types/components/e/e.native.d.ts +4 -0
- package/dist/types/components/e/e.native.d.ts.map +1 -0
- package/dist/types/components/e/e.web.d.ts +4 -0
- package/dist/types/components/e/e.web.d.ts.map +1 -0
- package/dist/types/components/e/index.native.d.ts +2 -0
- package/dist/types/components/e/index.native.d.ts.map +1 -0
- package/dist/types/components/e/index.web.d.ts +2 -0
- package/dist/types/components/e/index.web.d.ts.map +1 -0
- package/dist/types/components/i/i.native.d.ts +4 -0
- package/dist/types/components/i/i.native.d.ts.map +1 -0
- package/dist/types/components/i/i.web.d.ts +4 -0
- package/dist/types/components/i/i.web.d.ts.map +1 -0
- package/dist/types/components/i/index.native.d.ts +2 -0
- package/dist/types/components/i/index.native.d.ts.map +1 -0
- package/dist/types/components/i/index.web.d.ts +2 -0
- package/dist/types/components/i/index.web.d.ts.map +1 -0
- package/dist/types/components/i/useIUtils.d.ts +9 -0
- package/dist/types/components/i/useIUtils.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +11 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/index.native.d.ts +11 -0
- package/dist/types/components/index.native.d.ts.map +1 -0
- package/dist/types/components/index.web.d.ts +11 -0
- package/dist/types/components/index.web.d.ts.map +1 -0
- package/dist/types/components/l/index.native.d.ts +2 -0
- package/dist/types/components/l/index.native.d.ts.map +1 -0
- package/dist/types/components/l/index.web.d.ts +2 -0
- package/dist/types/components/l/index.web.d.ts.map +1 -0
- package/dist/types/components/l/l.native.d.ts +4 -0
- package/dist/types/components/l/l.native.d.ts.map +1 -0
- package/dist/types/components/l/l.web.d.ts +4 -0
- package/dist/types/components/l/l.web.d.ts.map +1 -0
- package/dist/types/components/o/index.native.d.ts +2 -0
- package/dist/types/components/o/index.native.d.ts.map +1 -0
- package/dist/types/components/o/index.web.d.ts +2 -0
- package/dist/types/components/o/index.web.d.ts.map +1 -0
- package/dist/types/components/o/o.native.d.ts +4 -0
- package/dist/types/components/o/o.native.d.ts.map +1 -0
- package/dist/types/components/o/o.web.d.ts +4 -0
- package/dist/types/components/o/o.web.d.ts.map +1 -0
- package/dist/types/components/p/index.native.d.ts +2 -0
- package/dist/types/components/p/index.native.d.ts.map +1 -0
- package/dist/types/components/p/index.web.d.ts +2 -0
- package/dist/types/components/p/index.web.d.ts.map +1 -0
- package/dist/types/components/p/p.native.d.ts +4 -0
- package/dist/types/components/p/p.native.d.ts.map +1 -0
- package/dist/types/components/p/p.web.d.ts +6 -0
- package/dist/types/components/p/p.web.d.ts.map +1 -0
- package/dist/types/components/s/index.native.d.ts +2 -0
- package/dist/types/components/s/index.native.d.ts.map +1 -0
- package/dist/types/components/s/index.web.d.ts +2 -0
- package/dist/types/components/s/index.web.d.ts.map +1 -0
- package/dist/types/components/s/s.native.d.ts +3 -0
- package/dist/types/components/s/s.native.d.ts.map +1 -0
- package/dist/types/components/s/s.web.d.ts +4 -0
- package/dist/types/components/s/s.web.d.ts.map +1 -0
- package/dist/types/components/t/index.native.d.ts +2 -0
- package/dist/types/components/t/index.native.d.ts.map +1 -0
- package/dist/types/components/t/index.web.d.ts +2 -0
- package/dist/types/components/t/index.web.d.ts.map +1 -0
- package/dist/types/components/t/t.native.d.ts +4 -0
- package/dist/types/components/t/t.native.d.ts.map +1 -0
- package/dist/types/components/t/t.web.d.ts +4 -0
- package/dist/types/components/t/t.web.d.ts.map +1 -0
- package/dist/types/components/u/context.d.ts +2 -0
- package/dist/types/components/u/context.d.ts.map +1 -0
- package/dist/types/components/u/index.native.d.ts +4 -0
- package/dist/types/components/u/index.native.d.ts.map +1 -0
- package/dist/types/components/u/index.web.d.ts +4 -0
- package/dist/types/components/u/index.web.d.ts.map +1 -0
- package/dist/types/components/u/provider.native.d.ts +4 -0
- package/dist/types/components/u/provider.native.d.ts.map +1 -0
- package/dist/types/components/u/provider.web.d.ts +4 -0
- package/dist/types/components/u/provider.web.d.ts.map +1 -0
- package/dist/types/components/u/types.d.ts +19 -0
- package/dist/types/components/u/types.d.ts.map +1 -0
- package/dist/types/components/u/useUniverse.d.ts +2 -0
- package/dist/types/components/u/useUniverse.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/index.native.d.ts +6 -0
- package/dist/types/hooks/index.native.d.ts.map +1 -0
- package/dist/types/hooks/index.web.d.ts +6 -0
- package/dist/types/hooks/index.web.d.ts.map +1 -0
- package/dist/types/hooks/useAction/types.d.ts +7 -0
- package/dist/types/hooks/useAction/types.d.ts.map +1 -0
- package/dist/types/hooks/useAction/useAction.native.d.ts +5 -0
- package/dist/types/hooks/useAction/useAction.native.d.ts.map +1 -0
- package/dist/types/hooks/useAction/useAction.web.d.ts +5 -0
- package/dist/types/hooks/useAction/useAction.web.d.ts.map +1 -0
- package/dist/types/hooks/useCn.d.ts +3 -0
- package/dist/types/hooks/useCn.d.ts.map +1 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts +3 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts.map +1 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts +24 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts.map +1 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts +3 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts.map +1 -0
- package/dist/types/hooks/useOnChange.d.ts +10 -0
- package/dist/types/hooks/useOnChange.d.ts.map +1 -0
- package/dist/types/hooks/useProps.d.ts +17 -0
- package/dist/types/hooks/useProps.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.native.d.ts +4 -0
- package/dist/types/index.native.d.ts.map +1 -0
- package/dist/types/index.web.d.ts +4 -0
- package/dist/types/index.web.d.ts.map +1 -0
- package/dist/types/types/base.d.ts +59 -0
- package/dist/types/types/base.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInteractiveState = useInteractiveState;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function computeVisualState(state) {
|
|
6
|
+
if (state.disabled)
|
|
7
|
+
return 'disabled';
|
|
8
|
+
if (state.pressed)
|
|
9
|
+
return 'pressed';
|
|
10
|
+
if (state.hovered)
|
|
11
|
+
return 'hovered';
|
|
12
|
+
if (state.focused)
|
|
13
|
+
return 'focused';
|
|
14
|
+
return 'default';
|
|
15
|
+
}
|
|
16
|
+
function toDataAttrs(state) {
|
|
17
|
+
const visual = computeVisualState(state);
|
|
18
|
+
return {
|
|
19
|
+
'data-state': visual,
|
|
20
|
+
'data-hovered': String(state.hovered),
|
|
21
|
+
'data-pressed': String(state.pressed),
|
|
22
|
+
'data-focused': String(state.focused),
|
|
23
|
+
'data-disabled': String(state.disabled),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function useInteractiveState(options = {}) {
|
|
27
|
+
const { disabled = false } = options;
|
|
28
|
+
const [state, setState] = (0, react_1.useState)({
|
|
29
|
+
hovered: false,
|
|
30
|
+
pressed: false,
|
|
31
|
+
focused: false,
|
|
32
|
+
disabled,
|
|
33
|
+
});
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
setState((prev) => ({ ...prev, disabled }));
|
|
36
|
+
}, [disabled]);
|
|
37
|
+
const eventHandlers = (0, react_1.useMemo)(() => ({
|
|
38
|
+
onMouseEnter: () => {
|
|
39
|
+
if (disabled)
|
|
40
|
+
return;
|
|
41
|
+
setState((prev) => ({ ...prev, hovered: true }));
|
|
42
|
+
},
|
|
43
|
+
onMouseLeave: () => {
|
|
44
|
+
if (disabled)
|
|
45
|
+
return;
|
|
46
|
+
setState((prev) => ({ ...prev, hovered: false, pressed: false }));
|
|
47
|
+
},
|
|
48
|
+
onMouseDown: () => {
|
|
49
|
+
if (disabled)
|
|
50
|
+
return;
|
|
51
|
+
setState((prev) => ({ ...prev, pressed: true }));
|
|
52
|
+
},
|
|
53
|
+
onMouseUp: () => {
|
|
54
|
+
if (disabled)
|
|
55
|
+
return;
|
|
56
|
+
setState((prev) => ({ ...prev, pressed: false }));
|
|
57
|
+
},
|
|
58
|
+
onFocus: () => {
|
|
59
|
+
if (disabled)
|
|
60
|
+
return;
|
|
61
|
+
setState((prev) => ({ ...prev, focused: true }));
|
|
62
|
+
},
|
|
63
|
+
onBlur: () => {
|
|
64
|
+
if (disabled)
|
|
65
|
+
return;
|
|
66
|
+
setState((prev) => ({ ...prev, focused: false, pressed: false }));
|
|
67
|
+
},
|
|
68
|
+
}), [disabled]);
|
|
69
|
+
const dataAttrs = toDataAttrs(state);
|
|
70
|
+
return { state, dataAttrs, eventHandlers };
|
|
71
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOnChange = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useOnChange = ({ onChange, onChangeValue }) => {
|
|
6
|
+
return (0, react_1.useMemo)(() => ({
|
|
7
|
+
onChange: (event) => {
|
|
8
|
+
if (onChange) {
|
|
9
|
+
onChange(event);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (onChangeValue) {
|
|
13
|
+
onChangeValue(event?.target?.value);
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
}), [onChange, onChangeValue]);
|
|
17
|
+
};
|
|
18
|
+
exports.useOnChange = useOnChange;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useProps = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const useProps = () => {
|
|
9
|
+
const handleOmit = react_1.default.useCallback((obj = {}, keys = []) => {
|
|
10
|
+
if (!obj) {
|
|
11
|
+
return {
|
|
12
|
+
props: {},
|
|
13
|
+
restProps: {},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
17
|
+
const result = {};
|
|
18
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
19
|
+
const nonUsedProps = {};
|
|
20
|
+
for (const key of Object.keys(obj)) {
|
|
21
|
+
if (!keys.includes(key)) {
|
|
22
|
+
result[key] = obj[key];
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
nonUsedProps[key] = obj[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
props: result,
|
|
30
|
+
restProps: nonUsedProps,
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
const handlePick = react_1.default.useCallback((obj = {}, keys = []) => {
|
|
34
|
+
if (!obj) {
|
|
35
|
+
return {
|
|
36
|
+
props: {},
|
|
37
|
+
restProps: {},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
41
|
+
const result = {};
|
|
42
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
43
|
+
const nonUsedProps = {};
|
|
44
|
+
for (const key of Object.keys(obj)) {
|
|
45
|
+
if (keys.includes(key)) {
|
|
46
|
+
result[key] = obj[key];
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
nonUsedProps[key] = obj[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
props: result /*Pick<
|
|
54
|
+
TObject,
|
|
55
|
+
Exclude<keyof TObject, Exclude<keyof TObject, TKeys>>
|
|
56
|
+
>*/,
|
|
57
|
+
restProps: nonUsedProps,
|
|
58
|
+
};
|
|
59
|
+
}, []);
|
|
60
|
+
return {
|
|
61
|
+
getPropKey: (obj = {}) => handlePick(obj, ['key']),
|
|
62
|
+
omitProps: handleOmit,
|
|
63
|
+
pickProps: handlePick,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.useProps = useProps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components/index.web"), exports);
|
|
18
|
+
__exportStar(require("./hooks/index.web"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components/index.native"), exports);
|
|
18
|
+
__exportStar(require("./hooks/index.native"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components/index.web"), exports);
|
|
18
|
+
__exportStar(require("./hooks/index.web"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./base"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { useAction, useCn } from '../../hooks/index.native';
|
|
4
|
+
export function A({ className, children, onPress, onClick, disabled, ref, ...rest }) {
|
|
5
|
+
const cn = useCn();
|
|
6
|
+
const { onAction } = useAction({
|
|
7
|
+
onClick,
|
|
8
|
+
onPress,
|
|
9
|
+
});
|
|
10
|
+
return (_jsx(Pressable, { ref: ref, onPress: onAction, disabled: disabled, ...rest, children: _jsx(View, { className: cn(disabled && 'opacity-60', className), children: children }) }));
|
|
11
|
+
}
|
|
12
|
+
export const Action = A;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAction, useCn } from '../../hooks/index.web';
|
|
3
|
+
export function A({ className, children, onPress, onClick, disabled, ref, ...rest }) {
|
|
4
|
+
const cn = useCn();
|
|
5
|
+
const { onAction } = useAction({
|
|
6
|
+
onClick,
|
|
7
|
+
onPress,
|
|
8
|
+
});
|
|
9
|
+
return (_jsx("button", { ref: ref, type: "button", disabled: disabled, className: cn('cursor-pointer', disabled && 'opacity-60', className), onClick: onAction, ...rest, children: children }));
|
|
10
|
+
}
|
|
11
|
+
export const Action = A;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './a.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './a.web';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal } from 'react-native';
|
|
3
|
+
import { useCn } from '../../hooks/index.native';
|
|
4
|
+
import { E } from '../e/index.native';
|
|
5
|
+
export function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, children, ref, ...rest }) {
|
|
6
|
+
const cn = useCn();
|
|
7
|
+
const placementClasses = {
|
|
8
|
+
center: 'items-center justify-center',
|
|
9
|
+
top: 'items-start justify-center',
|
|
10
|
+
bottom: 'items-end justify-center',
|
|
11
|
+
left: 'items-stretch justify-start',
|
|
12
|
+
right: 'items-stretch justify-end',
|
|
13
|
+
};
|
|
14
|
+
const containerClasses = cn('flex-1 bg-black/40 flex', placementClasses[placement], containerClassName, backdropClassName);
|
|
15
|
+
const contentClasses = cn('bg-background p-4 rounded-lg shadow-lg max-h-[90vh] w-full max-w-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', className, contentClassName);
|
|
16
|
+
const handleRequestClose = (e) => {
|
|
17
|
+
onOpenChange?.(false);
|
|
18
|
+
if (typeof rest.onRequestClose === 'function') {
|
|
19
|
+
rest.onRequestClose?.(e);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return (_jsx(Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...rest, children: _jsx(E, { className: containerClasses, children: _jsx(E, { ref: ref, className: contentClasses, children: children }) }) }));
|
|
23
|
+
}
|
|
24
|
+
export const Dialog = D;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { useCn } from '../../hooks/index.web';
|
|
4
|
+
import { E } from '../e/index.web';
|
|
5
|
+
export function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, closeOnBackdropClick = true, children, ref, ...rest }) {
|
|
6
|
+
const cn = useCn();
|
|
7
|
+
if (typeof document === 'undefined')
|
|
8
|
+
return null;
|
|
9
|
+
if (!open)
|
|
10
|
+
return null;
|
|
11
|
+
const placementClasses = {
|
|
12
|
+
center: 'items-center justify-center',
|
|
13
|
+
top: 'items-start justify-center',
|
|
14
|
+
bottom: 'items-end justify-center',
|
|
15
|
+
left: 'items-stretch justify-start',
|
|
16
|
+
right: 'items-stretch justify-end',
|
|
17
|
+
};
|
|
18
|
+
const handleBackdropClick = (event) => {
|
|
19
|
+
if (event.target !== event.currentTarget)
|
|
20
|
+
return;
|
|
21
|
+
if (closeOnBackdropClick) {
|
|
22
|
+
onOpenChange?.(false);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const backdropClasses = cn('fixed inset-0 z-50 flex bg-black/40', placementClasses[placement], containerClassName, backdropClassName);
|
|
26
|
+
const contentClasses = cn('relative max-h-[90vh] w-full max-w-lg overflow-auto rounded-lg bg-background p-4 shadow-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', className, contentClassName);
|
|
27
|
+
return createPortal(_jsx(E, { className: backdropClasses, role: "presentation", onClick: handleBackdropClick, children: _jsx("dialog", { ref: ref, "aria-modal": "true", className: contentClasses, ...rest, children: children }) }), document.body);
|
|
28
|
+
}
|
|
29
|
+
export const Dialog = D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './d.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './d.web';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { useAction, useCn } from '../../hooks/index.native';
|
|
4
|
+
export function E({ className, children, onPress, onClick, ref, ...rest }) {
|
|
5
|
+
const cn = useCn();
|
|
6
|
+
const { onAction } = useAction({
|
|
7
|
+
onClick,
|
|
8
|
+
onPress,
|
|
9
|
+
});
|
|
10
|
+
const handleOnPress = () => {
|
|
11
|
+
onAction();
|
|
12
|
+
return false;
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(View, { ref: ref, className: cn(className), onStartShouldSetResponder: handleOnPress, ...rest, children: children }));
|
|
15
|
+
}
|
|
16
|
+
export const Element = E;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAction, useCn } from '../../hooks/index.web';
|
|
3
|
+
export function E({ className, children, onPress, onClick, ref, ...rest }) {
|
|
4
|
+
const cn = useCn();
|
|
5
|
+
const { onAction } = useAction({
|
|
6
|
+
onClick,
|
|
7
|
+
onPress,
|
|
8
|
+
});
|
|
9
|
+
return (_jsx("div", { ref: ref, className: cn(className), onClick: onAction, ...rest, children: children }));
|
|
10
|
+
}
|
|
11
|
+
export const Element = E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './e.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './e.web';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TextInput } from 'react-native';
|
|
3
|
+
import { useCn, useOnChange } from '../../hooks/index.native';
|
|
4
|
+
import { useIUtils } from './useIUtils';
|
|
5
|
+
export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, disabled, ref, ...rest }) {
|
|
6
|
+
const { treatTypeModeAndKeyboardType } = useIUtils();
|
|
7
|
+
const cn = useCn();
|
|
8
|
+
const { onChange: handleOnChange } = useOnChange({
|
|
9
|
+
onChange,
|
|
10
|
+
onChangeValue,
|
|
11
|
+
});
|
|
12
|
+
const effectiveEditable = editable ?? !disabled;
|
|
13
|
+
const { masterInputType, masterInputKeyboardType } = treatTypeModeAndKeyboardType({
|
|
14
|
+
inputMode,
|
|
15
|
+
keyboardType,
|
|
16
|
+
type,
|
|
17
|
+
});
|
|
18
|
+
const handleChange = (event) => {
|
|
19
|
+
if (onChange)
|
|
20
|
+
onChange(event);
|
|
21
|
+
if (onChangeValue)
|
|
22
|
+
onChangeValue(event.nativeEvent.text);
|
|
23
|
+
};
|
|
24
|
+
return (_jsx(TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value, defaultValue: defaultValue, placeholder: placeholder, onChange: handleChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, ...rest }));
|
|
25
|
+
}
|
|
26
|
+
export const Input = I;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCn, useOnChange } from '../../hooks/index.web';
|
|
3
|
+
import { useIUtils } from './useIUtils';
|
|
4
|
+
export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, disabled, editable, ref, ...rest }) {
|
|
5
|
+
const { treatTypeModeAndKeyboardType } = useIUtils();
|
|
6
|
+
const cn = useCn();
|
|
7
|
+
const { onChange: handleOnChange } = useOnChange({
|
|
8
|
+
onChange,
|
|
9
|
+
onChangeValue,
|
|
10
|
+
});
|
|
11
|
+
const effectiveDisabled = disabled || editable === false;
|
|
12
|
+
const { masterInputType, masterInputMode } = treatTypeModeAndKeyboardType({
|
|
13
|
+
inputMode,
|
|
14
|
+
keyboardType,
|
|
15
|
+
type,
|
|
16
|
+
});
|
|
17
|
+
return (_jsx("input", { ref: ref, type: masterInputType, inputMode: masterInputMode, className: cn('outline-none', effectiveDisabled && 'opacity-60 cursor-not-allowed', className), value: value, defaultValue: defaultValue, placeholder: placeholder, onChange: handleOnChange, disabled: effectiveDisabled, ...rest }));
|
|
18
|
+
}
|
|
19
|
+
export const Input = I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './i.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './i.web';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const setWhenUndefined = (value, defaultValue) => {
|
|
2
|
+
return value === undefined ? defaultValue : value;
|
|
3
|
+
};
|
|
4
|
+
const treatTypeModeAndKeyboardType = ({ inputMode, keyboardType, type, }) => {
|
|
5
|
+
let masterInputKeyboardType = keyboardType;
|
|
6
|
+
let masterInputMode = inputMode;
|
|
7
|
+
let masterInputType = type;
|
|
8
|
+
// set values according to inputMode first
|
|
9
|
+
if (masterInputMode === 'numeric' || masterInputMode === 'decimal') {
|
|
10
|
+
masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'numeric');
|
|
11
|
+
masterInputType = setWhenUndefined(masterInputType, 'number');
|
|
12
|
+
}
|
|
13
|
+
else if (masterInputMode === 'email') {
|
|
14
|
+
masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'email-address');
|
|
15
|
+
masterInputType = setWhenUndefined(masterInputType, 'email');
|
|
16
|
+
}
|
|
17
|
+
else if (masterInputMode === 'search') {
|
|
18
|
+
masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'default');
|
|
19
|
+
masterInputType = setWhenUndefined(masterInputType, 'search');
|
|
20
|
+
}
|
|
21
|
+
else if (masterInputMode === 'tel') {
|
|
22
|
+
masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'phone-pad');
|
|
23
|
+
masterInputType = setWhenUndefined(masterInputType, 'tel');
|
|
24
|
+
}
|
|
25
|
+
else if (masterInputMode === 'url') {
|
|
26
|
+
masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'url');
|
|
27
|
+
masterInputType = setWhenUndefined(masterInputType, 'url');
|
|
28
|
+
}
|
|
29
|
+
else if (masterInputType === 'text') {
|
|
30
|
+
masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'default');
|
|
31
|
+
masterInputType = setWhenUndefined(masterInputType, 'text');
|
|
32
|
+
}
|
|
33
|
+
// set values according to keyboardType second
|
|
34
|
+
if (masterInputKeyboardType === 'email-address') {
|
|
35
|
+
masterInputMode = setWhenUndefined(masterInputMode, 'email');
|
|
36
|
+
masterInputType = setWhenUndefined(masterInputType, 'email');
|
|
37
|
+
}
|
|
38
|
+
else if (masterInputKeyboardType === 'numeric' ||
|
|
39
|
+
masterInputKeyboardType === 'decimal-pad') {
|
|
40
|
+
masterInputMode = setWhenUndefined(masterInputMode, 'numeric');
|
|
41
|
+
masterInputType = setWhenUndefined(masterInputType, 'number');
|
|
42
|
+
}
|
|
43
|
+
else if (masterInputKeyboardType === 'phone-pad') {
|
|
44
|
+
masterInputMode = setWhenUndefined(masterInputMode, 'tel');
|
|
45
|
+
masterInputType = setWhenUndefined(masterInputType, 'tel');
|
|
46
|
+
}
|
|
47
|
+
else if (masterInputKeyboardType === 'url') {
|
|
48
|
+
masterInputMode = setWhenUndefined(masterInputMode, 'url');
|
|
49
|
+
masterInputType = setWhenUndefined(masterInputType, 'url');
|
|
50
|
+
}
|
|
51
|
+
else if (masterInputKeyboardType === 'default') {
|
|
52
|
+
masterInputMode = setWhenUndefined(masterInputMode, 'text');
|
|
53
|
+
masterInputType = setWhenUndefined(masterInputType, 'text');
|
|
54
|
+
}
|
|
55
|
+
// finally, set default type if still undefined
|
|
56
|
+
masterInputType = setWhenUndefined(masterInputType, 'text');
|
|
57
|
+
return {
|
|
58
|
+
masterInputKeyboardType,
|
|
59
|
+
masterInputMode,
|
|
60
|
+
masterInputType,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export const useIUtils = () => {
|
|
64
|
+
return {
|
|
65
|
+
treatTypeModeAndKeyboardType,
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './a/index.web';
|
|
2
|
+
export * from './d/index.web';
|
|
3
|
+
export * from './e/index.web';
|
|
4
|
+
export * from './i/index.web';
|
|
5
|
+
export * from './l/index.web';
|
|
6
|
+
export * from './o/index.web';
|
|
7
|
+
export * from './p/index.web';
|
|
8
|
+
export * from './s/index.web';
|
|
9
|
+
export * from './t/index.web';
|
|
10
|
+
export * from './u/index.web';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './a/index.native';
|
|
2
|
+
export * from './d/index.native';
|
|
3
|
+
export * from './e/index.native';
|
|
4
|
+
export * from './i/index.native';
|
|
5
|
+
export * from './l/index.native';
|
|
6
|
+
export * from './o/index.native';
|
|
7
|
+
export * from './p/index.native';
|
|
8
|
+
export * from './s/index.native';
|
|
9
|
+
export * from './t/index.native';
|
|
10
|
+
export * from './u/index.native';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './a/index.web';
|
|
2
|
+
export * from './d/index.web';
|
|
3
|
+
export * from './e/index.web';
|
|
4
|
+
export * from './i/index.web';
|
|
5
|
+
export * from './l/index.web';
|
|
6
|
+
export * from './o/index.web';
|
|
7
|
+
export * from './p/index.web';
|
|
8
|
+
export * from './s/index.web';
|
|
9
|
+
export * from './t/index.web';
|
|
10
|
+
export * from './u/index.web';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './l.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './l.web';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAction } from '../../hooks/index.native';
|
|
3
|
+
import { useCn } from '../../hooks/index.web';
|
|
4
|
+
export function L({ className, children, to, href, onClick, onPress, preventDefault, ref, ...rest }) {
|
|
5
|
+
const cn = useCn();
|
|
6
|
+
const { onAction } = useAction({
|
|
7
|
+
onClick,
|
|
8
|
+
onPress,
|
|
9
|
+
});
|
|
10
|
+
const resolvedHref = href ?? to ?? '#';
|
|
11
|
+
return (_jsx("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), onClick: onAction, ...rest, children: children }));
|
|
12
|
+
}
|
|
13
|
+
export const Link = L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './o.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './o.web';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollView } from 'react-native';
|
|
3
|
+
import { useCn } from '../../hooks/index.native';
|
|
4
|
+
export function O({ className, children, horizontal, ref, ...rest }) {
|
|
5
|
+
const cn = useCn();
|
|
6
|
+
return (_jsx(ScrollView, { ref: ref, className: cn(className), horizontal: horizontal, ...rest, children: children }));
|
|
7
|
+
}
|
|
8
|
+
export const Overflow = O;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCn } from '../../hooks/index.web';
|
|
3
|
+
export function O({ className, children, horizontal, ref, ...rest }) {
|
|
4
|
+
const cn = useCn();
|
|
5
|
+
const overflowClass = horizontal ? 'overflow-x-auto' : 'overflow-y-auto';
|
|
6
|
+
return (_jsx("div", { ref: ref, className: cn(overflowClass, className), ...rest, children: children }));
|
|
7
|
+
}
|
|
8
|
+
export const Overflow = O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './p.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './p.web';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
|
+
import { useCn } from '../../hooks/index.native';
|
|
4
|
+
export function P({ className, src, source, ref, ...rest }) {
|
|
5
|
+
const cn = useCn();
|
|
6
|
+
const finalSource = src != null ? { uri: src } : source;
|
|
7
|
+
return (_jsx(Image, { ref: ref, className: cn(className), source: finalSource, ...rest }));
|
|
8
|
+
}
|
|
9
|
+
export const Picture = P;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCn } from '../../hooks/index.web';
|
|
3
|
+
export function P({ alt, className, ref, ...rest }) {
|
|
4
|
+
const cn = useCn();
|
|
5
|
+
return (
|
|
6
|
+
// biome-ignore lint/a11y/useAltText: <explanation>
|
|
7
|
+
_jsx("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), ...rest }));
|
|
8
|
+
}
|
|
9
|
+
export const Picture = P;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './s.native';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './s.web';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SafeAreaView, } from 'react-native-safe-area-context';
|
|
3
|
+
import { useCn } from '../../hooks/index.native';
|
|
4
|
+
export function S({ className, children, ref, ...rest }) {
|
|
5
|
+
const cn = useCn();
|
|
6
|
+
return (_jsx(SafeAreaView, { ref: ref, className: cn(className), ...rest, children: children }));
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './t.native';
|