@react-xp/aeiou 0.1.0-beta.6 → 0.1.0-beta.8
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/cjs/components/a/a.native.js +2 -2
- package/dist/cjs/components/a/a.web.js +2 -2
- package/dist/cjs/components/d/d.native.js +2 -2
- package/dist/cjs/components/d/d.web.js +3 -3
- package/dist/cjs/components/e/e.native.js +4 -2
- package/dist/cjs/components/e/e.web.js +3 -2
- package/dist/cjs/components/i/i.native.js +2 -8
- package/dist/cjs/components/i/i.web.js +2 -2
- package/dist/cjs/components/l/l.web.js +2 -2
- package/dist/cjs/components/o/o.web.js +2 -2
- package/dist/cjs/components/p/p.web.js +2 -2
- package/dist/cjs/hooks/index.js +1 -0
- package/dist/cjs/hooks/index.native.js +1 -0
- package/dist/cjs/hooks/index.web.js +1 -0
- package/dist/cjs/hooks/useOnHoverOrPress.js +21 -0
- package/dist/esm/components/a/a.native.js +2 -2
- package/dist/esm/components/a/a.web.js +2 -2
- package/dist/esm/components/d/d.native.js +2 -2
- package/dist/esm/components/d/d.web.js +3 -3
- package/dist/esm/components/e/e.native.js +5 -3
- package/dist/esm/components/e/e.web.js +4 -3
- package/dist/esm/components/i/i.native.js +2 -8
- package/dist/esm/components/i/i.web.js +2 -2
- package/dist/esm/components/l/l.web.js +2 -2
- package/dist/esm/components/o/o.web.js +2 -2
- package/dist/esm/components/p/p.web.js +2 -2
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/index.native.js +1 -0
- package/dist/esm/hooks/index.web.js +1 -0
- package/dist/esm/hooks/useOnHoverOrPress.js +17 -0
- package/dist/native/cjs/components/a/a.native.js +2 -2
- package/dist/native/cjs/components/a/a.web.js +2 -2
- package/dist/native/cjs/components/d/d.native.js +2 -2
- package/dist/native/cjs/components/d/d.web.js +3 -3
- package/dist/native/cjs/components/e/e.native.js +4 -2
- package/dist/native/cjs/components/e/e.web.js +3 -2
- package/dist/native/cjs/components/i/i.native.js +2 -8
- package/dist/native/cjs/components/i/i.web.js +2 -2
- package/dist/native/cjs/components/l/l.web.js +2 -2
- package/dist/native/cjs/components/o/o.web.js +2 -2
- package/dist/native/cjs/components/p/p.web.js +2 -2
- package/dist/native/cjs/hooks/index.js +1 -0
- package/dist/native/cjs/hooks/index.native.js +1 -0
- package/dist/native/cjs/hooks/index.web.js +1 -0
- package/dist/native/cjs/hooks/useOnHoverOrPress.js +21 -0
- package/dist/native/esm/components/a/a.native.js +2 -2
- package/dist/native/esm/components/a/a.web.js +2 -2
- package/dist/native/esm/components/d/d.native.js +2 -2
- package/dist/native/esm/components/d/d.web.js +3 -3
- package/dist/native/esm/components/e/e.native.js +5 -3
- package/dist/native/esm/components/e/e.web.js +4 -3
- package/dist/native/esm/components/i/i.native.js +2 -8
- package/dist/native/esm/components/i/i.web.js +2 -2
- package/dist/native/esm/components/l/l.web.js +2 -2
- package/dist/native/esm/components/o/o.web.js +2 -2
- package/dist/native/esm/components/p/p.web.js +2 -2
- package/dist/native/esm/hooks/index.js +1 -0
- package/dist/native/esm/hooks/index.native.js +1 -0
- package/dist/native/esm/hooks/index.web.js +1 -0
- package/dist/native/esm/hooks/useOnHoverOrPress.js +17 -0
- package/dist/native/tsconfig.native.cjs.tsbuildinfo +1 -1
- package/dist/native/tsconfig.native.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/components/a/a.native.d.ts +1 -4
- package/dist/types/components/a/a.native.d.ts.map +1 -1
- package/dist/types/components/a/a.web.d.ts +1 -4
- package/dist/types/components/a/a.web.d.ts.map +1 -1
- package/dist/types/components/d/d.native.d.ts +1 -4
- package/dist/types/components/d/d.native.d.ts.map +1 -1
- package/dist/types/components/d/d.web.d.ts +1 -4
- package/dist/types/components/d/d.web.d.ts.map +1 -1
- package/dist/types/components/e/e.native.d.ts +1 -4
- package/dist/types/components/e/e.native.d.ts.map +1 -1
- package/dist/types/components/e/e.web.d.ts +1 -4
- package/dist/types/components/e/e.web.d.ts.map +1 -1
- package/dist/types/components/i/i.native.d.ts +1 -4
- package/dist/types/components/i/i.native.d.ts.map +1 -1
- package/dist/types/components/i/i.web.d.ts +1 -4
- package/dist/types/components/i/i.web.d.ts.map +1 -1
- package/dist/types/components/i/useIUtils.d.ts +1 -1
- package/dist/types/components/l/l.native.d.ts +1 -4
- package/dist/types/components/l/l.native.d.ts.map +1 -1
- package/dist/types/components/l/l.web.d.ts +1 -4
- package/dist/types/components/l/l.web.d.ts.map +1 -1
- package/dist/types/components/o/o.native.d.ts +1 -4
- package/dist/types/components/o/o.native.d.ts.map +1 -1
- package/dist/types/components/o/o.web.d.ts +1 -4
- package/dist/types/components/o/o.web.d.ts.map +1 -1
- package/dist/types/components/p/p.native.d.ts +1 -4
- package/dist/types/components/p/p.native.d.ts.map +1 -1
- package/dist/types/components/p/p.web.d.ts +1 -3
- package/dist/types/components/p/p.web.d.ts.map +1 -1
- package/dist/types/components/s/s.native.d.ts +1 -4
- package/dist/types/components/s/s.native.d.ts.map +1 -1
- package/dist/types/components/s/s.web.d.ts +1 -4
- package/dist/types/components/s/s.web.d.ts.map +1 -1
- package/dist/types/components/t/t.native.d.ts +1 -4
- package/dist/types/components/t/t.native.d.ts.map +1 -1
- package/dist/types/components/t/t.web.d.ts +1 -4
- package/dist/types/components/t/t.web.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/index.native.d.ts +1 -0
- package/dist/types/hooks/index.native.d.ts.map +1 -1
- package/dist/types/hooks/index.web.d.ts +1 -0
- package/dist/types/hooks/index.web.d.ts.map +1 -1
- package/dist/types/hooks/useOnHoverOrPress.d.ts +12 -0
- package/dist/types/hooks/useOnHoverOrPress.d.ts.map +1 -0
- package/dist/types/types/base.d.ts +13 -2
- package/dist/types/types/base.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
7
|
const index_native_1 = require("../../hooks/index.native");
|
|
8
8
|
const useIUtils_1 = require("./useIUtils");
|
|
9
|
-
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, disabled, ref, ...rest }) {
|
|
9
|
+
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, disabled, ref, style, ...rest }) {
|
|
10
10
|
const { treatTypeModeAndKeyboardType } = (0, useIUtils_1.useIUtils)();
|
|
11
11
|
const cn = (0, index_native_1.useCn)();
|
|
12
12
|
const { onChange: handleOnChange } = (0, index_native_1.useOnChange)({
|
|
@@ -19,12 +19,6 @@ function I({ className, value, defaultValue, placeholder, onChange, onChangeValu
|
|
|
19
19
|
keyboardType,
|
|
20
20
|
type,
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
if (onChange)
|
|
24
|
-
onChange(event);
|
|
25
|
-
if (onChangeValue)
|
|
26
|
-
onChangeValue(event.nativeEvent.text);
|
|
27
|
-
};
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.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 }));
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value, defaultValue: defaultValue, placeholder: placeholder, onChange: handleOnChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, style: style, ...rest }));
|
|
29
23
|
}
|
|
30
24
|
exports.Input = I;
|
|
@@ -5,7 +5,7 @@ exports.I = I;
|
|
|
5
5
|
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
6
|
const index_web_1 = require("../../hooks/index.web");
|
|
7
7
|
const useIUtils_1 = require("./useIUtils");
|
|
8
|
-
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, disabled, editable, ref, ...rest }) {
|
|
8
|
+
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, disabled, editable, ref, style, ...rest }) {
|
|
9
9
|
const { treatTypeModeAndKeyboardType } = (0, useIUtils_1.useIUtils)();
|
|
10
10
|
const cn = (0, index_web_1.useCn)();
|
|
11
11
|
const { onChange: handleOnChange } = (0, index_web_1.useOnChange)({
|
|
@@ -18,6 +18,6 @@ function I({ className, value, defaultValue, placeholder, onChange, onChangeValu
|
|
|
18
18
|
keyboardType,
|
|
19
19
|
type,
|
|
20
20
|
});
|
|
21
|
-
return ((0, jsx_runtime_1.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 }));
|
|
21
|
+
return ((0, jsx_runtime_1.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, style: style, ...rest }));
|
|
22
22
|
}
|
|
23
23
|
exports.Input = I;
|
|
@@ -5,13 +5,13 @@ exports.L = L;
|
|
|
5
5
|
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
6
|
const index_native_1 = require("../../hooks/index.native");
|
|
7
7
|
const index_web_1 = require("../../hooks/index.web");
|
|
8
|
-
function L({ className, children, to, href, onClick, onPress, preventDefault, ref, ...rest }) {
|
|
8
|
+
function L({ className, children, to, href, onClick, onPress, preventDefault, ref, style, ...rest }) {
|
|
9
9
|
const cn = (0, index_web_1.useCn)();
|
|
10
10
|
const { onAction } = (0, index_native_1.useAction)({
|
|
11
11
|
onClick,
|
|
12
12
|
onPress,
|
|
13
13
|
});
|
|
14
14
|
const resolvedHref = href ?? to ?? '#';
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), onClick: onAction, ...rest, children: children }));
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), onClick: onAction, style: style, ...rest, children: children }));
|
|
16
16
|
}
|
|
17
17
|
exports.Link = L;
|
|
@@ -4,9 +4,9 @@ exports.Overflow = void 0;
|
|
|
4
4
|
exports.O = O;
|
|
5
5
|
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
6
|
const index_web_1 = require("../../hooks/index.web");
|
|
7
|
-
function O({ className, children, horizontal, ref, ...rest }) {
|
|
7
|
+
function O({ className, children, horizontal, ref, style, ...rest }) {
|
|
8
8
|
const cn = (0, index_web_1.useCn)();
|
|
9
9
|
const overflowClass = horizontal ? 'overflow-x-auto' : 'overflow-y-auto';
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(overflowClass, className), ...rest, children: children }));
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(overflowClass, className), style: style, ...rest, children: children }));
|
|
11
11
|
}
|
|
12
12
|
exports.Overflow = O;
|
|
@@ -4,10 +4,10 @@ exports.Picture = void 0;
|
|
|
4
4
|
exports.P = P;
|
|
5
5
|
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
6
|
const index_web_1 = require("../../hooks/index.web");
|
|
7
|
-
function P({ alt, className, ref, ...rest }) {
|
|
7
|
+
function P({ alt, className, ref, style, ...rest }) {
|
|
8
8
|
const cn = (0, index_web_1.useCn)();
|
|
9
9
|
return (
|
|
10
10
|
// biome-ignore lint/a11y/useAltText: <explanation>
|
|
11
|
-
(0, jsx_runtime_1.jsx)("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), ...rest }));
|
|
11
|
+
(0, jsx_runtime_1.jsx)("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), style: style, ...rest }));
|
|
12
12
|
}
|
|
13
13
|
exports.Picture = P;
|
|
@@ -18,4 +18,5 @@ __exportStar(require("./useAction/useAction.web"), exports);
|
|
|
18
18
|
__exportStar(require("./useCn"), exports);
|
|
19
19
|
__exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
|
|
20
20
|
__exportStar(require("./useOnChange"), exports);
|
|
21
|
+
__exportStar(require("./useOnHoverOrPress"), exports);
|
|
21
22
|
__exportStar(require("./useProps"), exports);
|
|
@@ -18,4 +18,5 @@ __exportStar(require("./useAction/useAction.native"), exports);
|
|
|
18
18
|
__exportStar(require("./useCn"), exports);
|
|
19
19
|
__exportStar(require("./useInteractiveState/useInteractiveState.native"), exports);
|
|
20
20
|
__exportStar(require("./useOnChange"), exports);
|
|
21
|
+
__exportStar(require("./useOnHoverOrPress"), exports);
|
|
21
22
|
__exportStar(require("./useProps"), exports);
|
|
@@ -18,4 +18,5 @@ __exportStar(require("./useAction/useAction.web"), exports);
|
|
|
18
18
|
__exportStar(require("./useCn"), exports);
|
|
19
19
|
__exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
|
|
20
20
|
__exportStar(require("./useOnChange"), exports);
|
|
21
|
+
__exportStar(require("./useOnHoverOrPress"), exports);
|
|
21
22
|
__exportStar(require("./useProps"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOnHoverOrPress = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useOnHoverOrPress = ({ onIn, onOut }) => {
|
|
6
|
+
const value = (0, react_1.useRef)('on');
|
|
7
|
+
return (0, react_1.useMemo)(() => ({
|
|
8
|
+
onMouseEnter: onIn,
|
|
9
|
+
onMouseLeave: onOut,
|
|
10
|
+
onPress: (event) => {
|
|
11
|
+
if (value.current === 'on') {
|
|
12
|
+
value.current = 'off';
|
|
13
|
+
onOut?.(event);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
value.current = 'on';
|
|
17
|
+
onIn?.(event);
|
|
18
|
+
},
|
|
19
|
+
}), [onIn, onOut]);
|
|
20
|
+
};
|
|
21
|
+
exports.useOnHoverOrPress = useOnHoverOrPress;
|
|
@@ -2,12 +2,12 @@ import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { Pressable } from 'react-native';
|
|
3
3
|
import { useAction, useCn } from '../../hooks/index.native';
|
|
4
4
|
import { E } from '../e/index.native';
|
|
5
|
-
export function A({ className, children, onPress, onClick, disabled, ref, ...rest }) {
|
|
5
|
+
export function A({ className, children, onPress, onClick, disabled, ref, style, ...rest }) {
|
|
6
6
|
const cn = useCn();
|
|
7
7
|
const { onAction } = useAction({
|
|
8
8
|
onClick,
|
|
9
9
|
onPress,
|
|
10
10
|
});
|
|
11
|
-
return (_jsx(Pressable, { ref: ref, onPress: onAction, disabled: disabled, children: _jsx(E, { className: cn(disabled && 'opacity-60', className), ...rest, children: children }) }));
|
|
11
|
+
return (_jsx(Pressable, { ref: ref, onPress: onAction, disabled: disabled, children: _jsx(E, { className: cn(disabled && 'opacity-60', className), style: style, ...rest, children: children }) }));
|
|
12
12
|
}
|
|
13
13
|
export const Action = A;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { useAction, useCn } from '../../hooks/index.web';
|
|
3
|
-
export function A({ className, children, onPress, onClick, disabled, ref, ...rest }) {
|
|
3
|
+
export function A({ className, children, onPress, onClick, disabled, ref, style, ...rest }) {
|
|
4
4
|
const cn = useCn();
|
|
5
5
|
const { onAction } = useAction({
|
|
6
6
|
onClick,
|
|
7
7
|
onPress,
|
|
8
8
|
});
|
|
9
|
-
return (_jsx("button", { ref: ref, type: "button", disabled: disabled, className: cn('cursor-pointer', disabled && 'opacity-60', className), onClick: onAction, ...rest, children: children }));
|
|
9
|
+
return (_jsx("button", { ref: ref, type: "button", disabled: disabled, className: cn('cursor-pointer', disabled && 'opacity-60', className), onClick: onAction, style: style, ...rest, children: children }));
|
|
10
10
|
}
|
|
11
11
|
export const Action = A;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { Modal } from 'react-native';
|
|
3
3
|
import { useCn } from '../../hooks/index.native';
|
|
4
4
|
import { E } from '../e/index.native';
|
|
5
|
-
export function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, children, ref, ...rest }) {
|
|
5
|
+
export function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, children, ref, containerStyle, contentStyle, ...rest }) {
|
|
6
6
|
const cn = useCn();
|
|
7
7
|
const placementClasses = {
|
|
8
8
|
center: 'items-center justify-center',
|
|
@@ -19,6 +19,6 @@ export function D({ open, onOpenChange, placement = 'center', className, backdro
|
|
|
19
19
|
rest.onRequestClose?.(e);
|
|
20
20
|
}
|
|
21
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 }) }) }));
|
|
22
|
+
return (_jsx(Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...rest, children: _jsx(E, { className: containerClasses, style: containerStyle, children: _jsx(E, { ref: ref, className: contentClasses, style: contentStyle, children: children }) }) }));
|
|
23
23
|
}
|
|
24
24
|
export const Dialog = D;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { useCn } from '../../hooks/index.web';
|
|
4
4
|
import { E } from '../e/index.web';
|
|
5
|
-
export function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, closeOnBackdropClick = true, children, ref, ...rest }) {
|
|
5
|
+
export function D({ open, onOpenChange, placement = 'center', className, backdropClassName, containerClassName, contentClassName, closeOnBackdropClick = true, children, ref, containerStyle, contentStyle, ...rest }) {
|
|
6
6
|
const cn = useCn();
|
|
7
7
|
if (typeof document === 'undefined')
|
|
8
8
|
return null;
|
|
@@ -24,8 +24,8 @@ export function D({ open, onOpenChange, placement = 'center', className, backdro
|
|
|
24
24
|
};
|
|
25
25
|
const backdropClasses = cn('fixed inset-0 z-50 flex bg-black/40', placementClasses[placement], containerClassName, backdropClassName);
|
|
26
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("div", { ref: ref,
|
|
27
|
+
return createPortal(_jsx(E, { className: backdropClasses, role: "presentation", onClick: handleBackdropClick, style: containerStyle, children: _jsx("div", { ref: ref,
|
|
28
28
|
// biome-ignore lint/a11y/useSemanticElements: <explanation>
|
|
29
|
-
role: "dialog", "aria-modal": "true", className: contentClasses, ...rest, children: children }) }), document.body);
|
|
29
|
+
role: "dialog", "aria-modal": "true", className: contentClasses, style: contentStyle, ...rest, children: children }) }), document.body);
|
|
30
30
|
}
|
|
31
31
|
export const Dialog = D;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { useAction, useCn } from '../../hooks/index.native';
|
|
3
|
+
import { useAction, useCn, useOnHoverOrPress } from '../../hooks/index.native';
|
|
4
4
|
import { T } from '../t/index.native';
|
|
5
|
-
export function E({ className, children,
|
|
5
|
+
export function E({ className, children, onIn, onOut, onClick, onPress, ref, style, ...rest }) {
|
|
6
6
|
const cn = useCn();
|
|
7
7
|
const { onAction } = useAction({
|
|
8
8
|
onClick,
|
|
9
9
|
onPress,
|
|
10
10
|
});
|
|
11
|
+
const { onPress: onHoverOrPress } = useOnHoverOrPress({ onIn, onOut });
|
|
11
12
|
const handleOnPress = () => {
|
|
12
13
|
onAction();
|
|
14
|
+
onHoverOrPress();
|
|
13
15
|
return false;
|
|
14
16
|
};
|
|
15
|
-
return (_jsx(View, { ref: ref, className: cn(className), onStartShouldSetResponder: handleOnPress, ...rest, children: typeof children === 'string' ? _jsx(T, { children: children }) : children }));
|
|
17
|
+
return (_jsx(View, { ref: ref, className: cn(className), onStartShouldSetResponder: handleOnPress, style: style, ...rest, children: typeof children === 'string' ? _jsx(T, { children: children }) : children }));
|
|
16
18
|
}
|
|
17
19
|
export const Element = E;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
|
-
import { useAction, useCn } from '../../hooks/index.web';
|
|
3
|
-
export function E({ className, children, onPress, onClick, ref, ...rest }) {
|
|
2
|
+
import { useAction, useCn, useOnHoverOrPress } from '../../hooks/index.web';
|
|
3
|
+
export function E({ className, children, onIn, onOut, onPress, onClick, ref, style, ...rest }) {
|
|
4
4
|
const cn = useCn();
|
|
5
5
|
const { onAction } = useAction({
|
|
6
6
|
onClick,
|
|
7
7
|
onPress,
|
|
8
8
|
});
|
|
9
|
-
|
|
9
|
+
const { onMouseEnter, onMouseLeave } = useOnHoverOrPress({ onIn, onOut });
|
|
10
|
+
return (_jsx("div", { ref: ref, className: cn(className), onClick: onAction, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: style, ...rest, children: children }));
|
|
10
11
|
}
|
|
11
12
|
export const Element = E;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
3
|
import { useCn, useOnChange } from '../../hooks/index.native';
|
|
4
4
|
import { useIUtils } from './useIUtils';
|
|
5
|
-
export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, disabled, ref, ...rest }) {
|
|
5
|
+
export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, disabled, ref, style, ...rest }) {
|
|
6
6
|
const { treatTypeModeAndKeyboardType } = useIUtils();
|
|
7
7
|
const cn = useCn();
|
|
8
8
|
const { onChange: handleOnChange } = useOnChange({
|
|
@@ -15,12 +15,6 @@ export function I({ className, value, defaultValue, placeholder, onChange, onCha
|
|
|
15
15
|
keyboardType,
|
|
16
16
|
type,
|
|
17
17
|
});
|
|
18
|
-
|
|
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 }));
|
|
18
|
+
return (_jsx(TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value, defaultValue: defaultValue, placeholder: placeholder, onChange: handleOnChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, style: style, ...rest }));
|
|
25
19
|
}
|
|
26
20
|
export const Input = I;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { useCn, useOnChange } from '../../hooks/index.web';
|
|
3
3
|
import { useIUtils } from './useIUtils';
|
|
4
|
-
export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, disabled, editable, ref, ...rest }) {
|
|
4
|
+
export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, disabled, editable, ref, style, ...rest }) {
|
|
5
5
|
const { treatTypeModeAndKeyboardType } = useIUtils();
|
|
6
6
|
const cn = useCn();
|
|
7
7
|
const { onChange: handleOnChange } = useOnChange({
|
|
@@ -14,6 +14,6 @@ export function I({ className, value, defaultValue, placeholder, onChange, onCha
|
|
|
14
14
|
keyboardType,
|
|
15
15
|
type,
|
|
16
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 }));
|
|
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, style: style, ...rest }));
|
|
18
18
|
}
|
|
19
19
|
export const Input = I;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { useAction } from '../../hooks/index.native';
|
|
3
3
|
import { useCn } from '../../hooks/index.web';
|
|
4
|
-
export function L({ className, children, to, href, onClick, onPress, preventDefault, ref, ...rest }) {
|
|
4
|
+
export function L({ className, children, to, href, onClick, onPress, preventDefault, ref, style, ...rest }) {
|
|
5
5
|
const cn = useCn();
|
|
6
6
|
const { onAction } = useAction({
|
|
7
7
|
onClick,
|
|
8
8
|
onPress,
|
|
9
9
|
});
|
|
10
10
|
const resolvedHref = href ?? to ?? '#';
|
|
11
|
-
return (_jsx("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), onClick: onAction, ...rest, children: children }));
|
|
11
|
+
return (_jsx("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), onClick: onAction, style: style, ...rest, children: children }));
|
|
12
12
|
}
|
|
13
13
|
export const Link = L;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { useCn } from '../../hooks/index.web';
|
|
3
|
-
export function O({ className, children, horizontal, ref, ...rest }) {
|
|
3
|
+
export function O({ className, children, horizontal, ref, style, ...rest }) {
|
|
4
4
|
const cn = useCn();
|
|
5
5
|
const overflowClass = horizontal ? 'overflow-x-auto' : 'overflow-y-auto';
|
|
6
|
-
return (_jsx("div", { ref: ref, className: cn(overflowClass, className), ...rest, children: children }));
|
|
6
|
+
return (_jsx("div", { ref: ref, className: cn(overflowClass, className), style: style, ...rest, children: children }));
|
|
7
7
|
}
|
|
8
8
|
export const Overflow = O;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "nativewind/jsx-runtime";
|
|
2
2
|
import { useCn } from '../../hooks/index.web';
|
|
3
|
-
export function P({ alt, className, ref, ...rest }) {
|
|
3
|
+
export function P({ alt, className, ref, style, ...rest }) {
|
|
4
4
|
const cn = useCn();
|
|
5
5
|
return (
|
|
6
6
|
// biome-ignore lint/a11y/useAltText: <explanation>
|
|
7
|
-
_jsx("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), ...rest }));
|
|
7
|
+
_jsx("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), style: style, ...rest }));
|
|
8
8
|
}
|
|
9
9
|
export const Picture = P;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useMemo, useRef } from 'react';
|
|
2
|
+
export const useOnHoverOrPress = ({ onIn, onOut }) => {
|
|
3
|
+
const value = useRef('on');
|
|
4
|
+
return useMemo(() => ({
|
|
5
|
+
onMouseEnter: onIn,
|
|
6
|
+
onMouseLeave: onOut,
|
|
7
|
+
onPress: (event) => {
|
|
8
|
+
if (value.current === 'on') {
|
|
9
|
+
value.current = 'off';
|
|
10
|
+
onOut?.(event);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
value.current = 'on';
|
|
14
|
+
onIn?.(event);
|
|
15
|
+
},
|
|
16
|
+
}), [onIn, onOut]);
|
|
17
|
+
};
|