@react-xp/aeiou 0.1.0-beta.13 → 0.1.0-beta.14
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 +6 -4
- package/dist/cjs/components/a/a.web.js +6 -4
- package/dist/cjs/components/d/d.native.js +7 -7
- package/dist/cjs/components/d/d.web.js +8 -8
- package/dist/cjs/components/e/e.native.js +7 -5
- package/dist/cjs/components/e/e.web.js +7 -5
- package/dist/cjs/components/i/i.native.js +9 -5
- package/dist/cjs/components/i/i.web.js +9 -5
- package/dist/cjs/components/l/l.web.js +7 -5
- package/dist/cjs/components/o/o.native.js +4 -4
- package/dist/cjs/components/o/o.web.js +7 -4
- package/dist/cjs/components/p/p.native.js +4 -4
- package/dist/cjs/components/p/p.web.js +7 -4
- package/dist/cjs/components/s/s.native.js +4 -4
- package/dist/cjs/components/t/t.native.js +7 -5
- package/dist/cjs/components/t/t.web.js +7 -5
- package/dist/cjs/hooks/index.js +0 -1
- package/dist/cjs/hooks/index.native.js +2 -0
- package/dist/cjs/hooks/index.web.js +2 -0
- package/dist/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +43 -0
- package/dist/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +45 -0
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.native.js +16 -38
- package/dist/cjs/hooks/useInteractiveState/useInteractiveState.web.js +19 -48
- package/dist/cjs/hooks/useStyles/useStyles.helpers.js +35 -0
- package/dist/cjs/hooks/useStyles/useStyles.native.js +42 -0
- package/dist/cjs/hooks/useStyles/useStyles.web.js +71 -0
- package/dist/esm/components/a/a.native.js +6 -4
- package/dist/esm/components/a/a.web.js +6 -4
- package/dist/esm/components/d/d.native.js +5 -5
- package/dist/esm/components/d/d.web.js +5 -5
- package/dist/esm/components/e/e.native.js +6 -4
- package/dist/esm/components/e/e.web.js +6 -4
- package/dist/esm/components/i/i.native.js +7 -3
- package/dist/esm/components/i/i.web.js +7 -3
- package/dist/esm/components/l/l.web.js +6 -4
- package/dist/esm/components/o/o.native.js +3 -3
- package/dist/esm/components/o/o.web.js +6 -3
- package/dist/esm/components/p/p.native.js +3 -3
- package/dist/esm/components/p/p.web.js +6 -3
- package/dist/esm/components/s/s.native.js +3 -3
- package/dist/esm/components/t/t.native.js +6 -4
- package/dist/esm/components/t/t.web.js +6 -4
- package/dist/esm/hooks/index.js +0 -1
- package/dist/esm/hooks/index.native.js +2 -0
- package/dist/esm/hooks/index.web.js +2 -0
- package/dist/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +40 -0
- package/dist/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +42 -0
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.native.js +16 -38
- package/dist/esm/hooks/useInteractiveState/useInteractiveState.web.js +19 -48
- package/dist/esm/hooks/useStyles/useStyles.helpers.js +29 -0
- package/dist/esm/hooks/useStyles/useStyles.native.js +38 -0
- package/dist/esm/hooks/useStyles/useStyles.web.js +66 -0
- package/dist/native/cjs/components/a/a.native.js +6 -4
- package/dist/native/cjs/components/a/a.web.js +6 -4
- package/dist/native/cjs/components/d/d.native.js +7 -7
- package/dist/native/cjs/components/d/d.web.js +8 -8
- package/dist/native/cjs/components/e/e.native.js +7 -5
- package/dist/native/cjs/components/e/e.web.js +7 -5
- package/dist/native/cjs/components/i/i.native.js +9 -5
- package/dist/native/cjs/components/i/i.web.js +9 -5
- package/dist/native/cjs/components/l/l.web.js +7 -5
- package/dist/native/cjs/components/o/o.native.js +4 -4
- package/dist/native/cjs/components/o/o.web.js +7 -4
- package/dist/native/cjs/components/p/p.native.js +4 -4
- package/dist/native/cjs/components/p/p.web.js +7 -4
- package/dist/native/cjs/components/s/s.native.js +4 -4
- package/dist/native/cjs/components/t/t.native.js +7 -5
- package/dist/native/cjs/components/t/t.web.js +7 -5
- package/dist/native/cjs/hooks/index.js +0 -1
- package/dist/native/cjs/hooks/index.native.js +2 -0
- package/dist/native/cjs/hooks/index.web.js +2 -0
- package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +43 -0
- package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +45 -0
- package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.native.js +16 -38
- package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.web.js +19 -48
- package/dist/native/cjs/hooks/useStyles/useStyles.helpers.js +35 -0
- package/dist/native/cjs/hooks/useStyles/useStyles.native.js +42 -0
- package/dist/native/cjs/hooks/useStyles/useStyles.web.js +71 -0
- package/dist/native/esm/components/a/a.native.js +6 -4
- package/dist/native/esm/components/a/a.web.js +6 -4
- package/dist/native/esm/components/d/d.native.js +5 -5
- package/dist/native/esm/components/d/d.web.js +5 -5
- package/dist/native/esm/components/e/e.native.js +6 -4
- package/dist/native/esm/components/e/e.web.js +6 -4
- package/dist/native/esm/components/i/i.native.js +7 -3
- package/dist/native/esm/components/i/i.web.js +7 -3
- package/dist/native/esm/components/l/l.web.js +6 -4
- package/dist/native/esm/components/o/o.native.js +3 -3
- package/dist/native/esm/components/o/o.web.js +6 -3
- package/dist/native/esm/components/p/p.native.js +3 -3
- package/dist/native/esm/components/p/p.web.js +6 -3
- package/dist/native/esm/components/s/s.native.js +3 -3
- package/dist/native/esm/components/t/t.native.js +6 -4
- package/dist/native/esm/components/t/t.web.js +6 -4
- package/dist/native/esm/hooks/index.js +0 -1
- package/dist/native/esm/hooks/index.native.js +2 -0
- package/dist/native/esm/hooks/index.web.js +2 -0
- package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +40 -0
- package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +42 -0
- package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.native.js +16 -38
- package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.web.js +19 -48
- package/dist/native/esm/hooks/useStyles/useStyles.helpers.js +29 -0
- package/dist/native/esm/hooks/useStyles/useStyles.native.js +38 -0
- package/dist/native/esm/hooks/useStyles/useStyles.web.js +66 -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 -1
- package/dist/types/components/a/a.native.d.ts.map +1 -1
- package/dist/types/components/a/a.web.d.ts +1 -1
- package/dist/types/components/a/a.web.d.ts.map +1 -1
- package/dist/types/components/d/d.native.d.ts +1 -1
- package/dist/types/components/d/d.native.d.ts.map +1 -1
- package/dist/types/components/d/d.web.d.ts +1 -1
- package/dist/types/components/d/d.web.d.ts.map +1 -1
- package/dist/types/components/e/e.native.d.ts +1 -1
- package/dist/types/components/e/e.native.d.ts.map +1 -1
- package/dist/types/components/e/e.web.d.ts +1 -1
- package/dist/types/components/e/e.web.d.ts.map +1 -1
- package/dist/types/components/i/i.native.d.ts +1 -1
- package/dist/types/components/i/i.native.d.ts.map +1 -1
- package/dist/types/components/i/i.web.d.ts +1 -1
- package/dist/types/components/i/i.web.d.ts.map +1 -1
- package/dist/types/components/l/l.web.d.ts +1 -1
- package/dist/types/components/l/l.web.d.ts.map +1 -1
- package/dist/types/components/o/o.native.d.ts +1 -1
- package/dist/types/components/o/o.native.d.ts.map +1 -1
- package/dist/types/components/o/o.web.d.ts +1 -1
- package/dist/types/components/o/o.web.d.ts.map +1 -1
- package/dist/types/components/p/p.native.d.ts +1 -1
- package/dist/types/components/p/p.native.d.ts.map +1 -1
- package/dist/types/components/p/p.web.d.ts +1 -1
- package/dist/types/components/p/p.web.d.ts.map +1 -1
- package/dist/types/components/s/s.native.d.ts +1 -1
- package/dist/types/components/s/s.native.d.ts.map +1 -1
- package/dist/types/components/t/t.native.d.ts +1 -1
- package/dist/types/components/t/t.native.d.ts.map +1 -1
- package/dist/types/components/t/t.web.d.ts +1 -1
- package/dist/types/components/t/t.web.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/index.native.d.ts +2 -0
- package/dist/types/hooks/index.native.d.ts.map +1 -1
- package/dist/types/hooks/index.web.d.ts +2 -0
- package/dist/types/hooks/index.web.d.ts.map +1 -1
- package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.native.d.ts +11 -0
- package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.native.d.ts.map +1 -0
- package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.web.d.ts +12 -0
- package/dist/types/hooks/useInteractiveHandlers/useInteractiveHandlers.web.d.ts.map +1 -0
- package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts +5 -7
- package/dist/types/hooks/useInteractiveState/useInteractiveState.native.d.ts.map +1 -1
- package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts +5 -7
- package/dist/types/hooks/useInteractiveState/useInteractiveState.web.d.ts.map +1 -1
- package/dist/types/hooks/useStyles/useStyles.helpers.d.ts +171 -0
- package/dist/types/hooks/useStyles/useStyles.helpers.d.ts.map +1 -0
- package/dist/types/hooks/useStyles/useStyles.native.d.ts +15 -0
- package/dist/types/hooks/useStyles/useStyles.native.d.ts.map +1 -0
- package/dist/types/hooks/useStyles/useStyles.types.d.ts +6 -0
- package/dist/types/hooks/useStyles/useStyles.types.d.ts.map +1 -0
- package/dist/types/hooks/useStyles/useStyles.web.d.ts +11 -0
- package/dist/types/hooks/useStyles/useStyles.web.d.ts.map +1 -0
- package/dist/types/types/base.d.ts +28 -6
- package/dist/types/types/base.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts +0 -18
- package/dist/types/hooks/useInteractiveState/useInteractiveState.types.d.ts.map +0 -1
- /package/dist/cjs/hooks/{useInteractiveState/useInteractiveState.types.js → useStyles/useStyles.types.js} +0 -0
- /package/dist/esm/hooks/{useInteractiveState/useInteractiveState.types.js → useStyles/useStyles.types.js} +0 -0
- /package/dist/native/cjs/hooks/{useInteractiveState/useInteractiveState.types.js → useStyles/useStyles.types.js} +0 -0
- /package/dist/native/esm/hooks/{useInteractiveState/useInteractiveState.types.js → useStyles/useStyles.types.js} +0 -0
|
@@ -5,11 +5,13 @@ exports.A = A;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
7
|
const index_native_1 = require("../../hooks/index.native");
|
|
8
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
9
|
const index_native_2 = require("../e/index.native");
|
|
9
|
-
function A({ accessibilityLabel, accessibilityRole, accessibilityState, className, children, loading,
|
|
10
|
-
const cn = (0,
|
|
11
|
-
const { eventHandlers } = (0, index_native_1.
|
|
10
|
+
function A({ accessibilityLabel, accessibilityRole, accessibilityState, className, children, loading, ref, style, testId, ...restProps }) {
|
|
11
|
+
const cn = (0, useCn_1.useCn)();
|
|
12
|
+
const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
|
|
13
|
+
const { getStylesWithInteraction } = (0, index_native_1.useStyles)();
|
|
12
14
|
const isDisabled = Boolean(disabled || loading);
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { ref: ref, disabled: isDisabled, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState, ...eventHandlers, children: (0, jsx_runtime_1.jsx)(index_native_2.E, { className: cn(disabled && 'opacity-60', className), style: style, ...
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { ref: ref, disabled: isDisabled, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState, testID: testId, ...eventHandlers, ...getStylesWithInteraction({ disabled, style }), children: (0, jsx_runtime_1.jsx)(index_native_2.E, { className: cn(disabled && 'opacity-60', className), style: style, ...restProps, children: children }) }));
|
|
14
16
|
}
|
|
15
17
|
exports.Action = A;
|
|
@@ -4,10 +4,12 @@ exports.Action = void 0;
|
|
|
4
4
|
exports.A = A;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const index_web_1 = require("../../hooks/index.web");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
function A({ className, children, loading, ref, testId, accessibilityLabel, accessibilityRole, accessibilityState, style, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
11
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
10
12
|
const isDisabled = Boolean(disabled || loading);
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button",
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button", className: cn('cursor-pointer', disabled && 'opacity-60', className), "aria-disabled": isDisabled || undefined, "aria-busy": loading || undefined, "aria-label": accessibilityLabel, "data-testid": testId, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
12
14
|
}
|
|
13
15
|
exports.Action = A;
|
|
@@ -4,10 +4,10 @@ exports.Dialog = void 0;
|
|
|
4
4
|
exports.D = D;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, children, ref, ...
|
|
10
|
-
const cn = (0,
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
const index_native_1 = require("../e/index.native");
|
|
9
|
+
function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, children, ref, ...restProps }) {
|
|
10
|
+
const cn = (0, useCn_1.useCn)();
|
|
11
11
|
const placementClasses = {
|
|
12
12
|
center: 'items-center justify-center',
|
|
13
13
|
top: 'items-start justify-center',
|
|
@@ -19,10 +19,10 @@ function D({ open, onOpenChange, placement = 'center', backdropClassName, backdr
|
|
|
19
19
|
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' : '', contentClassName);
|
|
20
20
|
const handleRequestClose = (e) => {
|
|
21
21
|
onOpenChange?.(false);
|
|
22
|
-
if (typeof
|
|
23
|
-
|
|
22
|
+
if (typeof restProps.onRequestClose === 'function') {
|
|
23
|
+
restProps.onRequestClose?.(e);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...restProps, children: (0, jsx_runtime_1.jsx)(index_native_1.E, { className: containerClasses, style: { ...containerStyle, ...backdropStyle }, children: (0, jsx_runtime_1.jsx)(index_native_1.E, { ref: ref, className: contentClasses, style: contentStyle, children: children }) }) }));
|
|
27
27
|
}
|
|
28
28
|
exports.Dialog = D;
|
|
@@ -4,10 +4,10 @@ exports.Dialog = void 0;
|
|
|
4
4
|
exports.D = D;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_dom_1 = require("react-dom");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, closeOnBackdropClick = true, children, ref, ...
|
|
10
|
-
const cn = (0,
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
const index_web_1 = require("../e/index.web");
|
|
9
|
+
function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, closeOnBackdropClick = true, children, ref, ...restProps }) {
|
|
10
|
+
const cn = (0, useCn_1.useCn)();
|
|
11
11
|
if (typeof document === 'undefined')
|
|
12
12
|
return null;
|
|
13
13
|
if (!open)
|
|
@@ -28,11 +28,11 @@ function D({ open, onOpenChange, placement = 'center', backdropClassName, backdr
|
|
|
28
28
|
};
|
|
29
29
|
const backdropClasses = cn('fixed inset-0 z-50 flex bg-black/40', placementClasses[placement], containerClassName, backdropClassName);
|
|
30
30
|
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' : '', contentClassName);
|
|
31
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(
|
|
32
|
-
...containerStyle,
|
|
33
|
-
...backdropStyle,
|
|
31
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(index_web_1.E, { className: backdropClasses, role: "presentation", onClick: handleBackdropClick, style: {
|
|
32
|
+
...(containerStyle || {}),
|
|
33
|
+
...(backdropStyle || {}),
|
|
34
34
|
}, children: (0, jsx_runtime_1.jsx)("div", { ref: ref,
|
|
35
35
|
// biome-ignore lint/a11y/useSemanticElements: <explanation>
|
|
36
|
-
role: "dialog", "aria-modal": "true", className: contentClasses, style: contentStyle, ...
|
|
36
|
+
role: "dialog", "aria-modal": "true", className: contentClasses, style: contentStyle, ...restProps, children: children }) }), document.body);
|
|
37
37
|
}
|
|
38
38
|
exports.Dialog = D;
|
|
@@ -4,11 +4,13 @@ exports.Element = void 0;
|
|
|
4
4
|
exports.E = E;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
const index_native_1 = require("../../index.native");
|
|
8
9
|
const index_native_2 = require("../t/index.native");
|
|
9
|
-
function E({ className, children, ref, style, ...
|
|
10
|
-
const cn = (0,
|
|
11
|
-
const {
|
|
12
|
-
|
|
10
|
+
function E({ className, children, ref, style, ...restProps }) {
|
|
11
|
+
const cn = (0, useCn_1.useCn)();
|
|
12
|
+
const { getStyles } = (0, index_native_1.useStyles)();
|
|
13
|
+
const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, className: cn(className), ...eventHandlers, ...getStyles({ disabled, style }), children: typeof children === 'string' ? (0, jsx_runtime_1.jsx)(index_native_2.T, { children: children }) : children }));
|
|
13
15
|
}
|
|
14
16
|
exports.Element = E;
|
|
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Element = void 0;
|
|
4
4
|
exports.E = E;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
const index_web_1 = require("../../index.web");
|
|
8
|
+
function E({ className, children, ref, role, style, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
11
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(className), role: role, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
11
13
|
}
|
|
12
14
|
exports.Element = E;
|
|
@@ -4,21 +4,25 @@ exports.Input = void 0;
|
|
|
4
4
|
exports.I = I;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
const useOnChange_1 = require("../../hooks/useOnChange");
|
|
9
|
+
const index_native_1 = require("../../index.native");
|
|
8
10
|
const useIUtils_1 = require("./useIUtils");
|
|
9
|
-
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable,
|
|
11
|
+
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, ref, name, style, ...restProps }) {
|
|
10
12
|
const { treatTypeModeAndKeyboardType } = (0, useIUtils_1.useIUtils)();
|
|
11
|
-
const cn = (0,
|
|
12
|
-
const { onChange: handleOnChange } = (0,
|
|
13
|
+
const cn = (0, useCn_1.useCn)();
|
|
14
|
+
const { onChange: handleOnChange } = (0, useOnChange_1.useOnChange)({
|
|
13
15
|
onChange,
|
|
14
16
|
onChangeValue,
|
|
15
17
|
});
|
|
18
|
+
const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
|
|
19
|
+
const { getStyles } = (0, index_native_1.useStyles)();
|
|
16
20
|
const effectiveEditable = editable ?? !disabled;
|
|
17
21
|
const { masterInputType, masterInputKeyboardType } = treatTypeModeAndKeyboardType({
|
|
18
22
|
inputMode,
|
|
19
23
|
keyboardType,
|
|
20
24
|
type,
|
|
21
25
|
});
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable,
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
|
|
23
27
|
}
|
|
24
28
|
exports.Input = I;
|
|
@@ -3,21 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Input = void 0;
|
|
4
4
|
exports.I = I;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
const useOnChange_1 = require("../../hooks/useOnChange");
|
|
8
|
+
const index_web_1 = require("../../index.web");
|
|
7
9
|
const useIUtils_1 = require("./useIUtils");
|
|
8
|
-
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType,
|
|
10
|
+
function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, ref, style, ...restProps }) {
|
|
9
11
|
const { treatTypeModeAndKeyboardType } = (0, useIUtils_1.useIUtils)();
|
|
10
|
-
const cn = (0,
|
|
11
|
-
const { onChange: handleOnChange } = (0,
|
|
12
|
+
const cn = (0, useCn_1.useCn)();
|
|
13
|
+
const { onChange: handleOnChange } = (0, useOnChange_1.useOnChange)({
|
|
12
14
|
onChange,
|
|
13
15
|
onChangeValue,
|
|
14
16
|
});
|
|
17
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
18
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
15
19
|
const effectiveDisabled = disabled || editable === false;
|
|
16
20
|
const { masterInputType, masterInputMode } = treatTypeModeAndKeyboardType({
|
|
17
21
|
inputMode,
|
|
18
22
|
keyboardType,
|
|
19
23
|
type,
|
|
20
24
|
});
|
|
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?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, disabled: effectiveDisabled,
|
|
25
|
+
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?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, disabled: effectiveDisabled, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
|
|
22
26
|
}
|
|
23
27
|
exports.Input = I;
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Link = void 0;
|
|
4
4
|
exports.L = L;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
const index_web_1 = require("../../index.web");
|
|
8
|
+
function L({ className, children, to, href, preventDefault, ref, style, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
11
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
10
12
|
const resolvedHref = href ?? to ?? '#';
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className),
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
12
14
|
}
|
|
13
15
|
exports.Link = L;
|
|
@@ -4,9 +4,9 @@ exports.Overflow = void 0;
|
|
|
4
4
|
exports.O = O;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
8
|
-
function O({ className, children, horizontal, ref, ...
|
|
9
|
-
const cn = (0,
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: ref, className: cn(className), horizontal: horizontal, ...
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
function O({ className, children, horizontal, ref, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: ref, className: cn(className), horizontal: horizontal, ...restProps, children: children }));
|
|
11
11
|
}
|
|
12
12
|
exports.Overflow = O;
|
|
@@ -3,10 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Overflow = void 0;
|
|
4
4
|
exports.O = O;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
const index_web_1 = require("../../index.web");
|
|
8
|
+
function O({ className, children, horizontal, ref, style, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
11
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
9
12
|
const overflowClass = horizontal ? 'overflow-x-auto' : 'overflow-y-auto';
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(overflowClass, className),
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cn(overflowClass, className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
11
14
|
}
|
|
12
15
|
exports.Overflow = O;
|
|
@@ -4,10 +4,10 @@ exports.Picture = void 0;
|
|
|
4
4
|
exports.P = P;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
8
|
-
function P({ className, src, source, ref, ...
|
|
9
|
-
const cn = (0,
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
function P({ className, src, source, ref, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
10
|
const finalSource = src != null ? { uri: src } : source;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Image, { ref: ref, className: cn(className), source: finalSource, ...
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Image, { ref: ref, className: cn(className), source: finalSource, ...restProps }));
|
|
12
12
|
}
|
|
13
13
|
exports.Picture = P;
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Picture = void 0;
|
|
4
4
|
exports.P = P;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
const index_web_1 = require("../../index.web");
|
|
8
|
+
function P({ alt, className, ref, style, source, src, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
11
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
9
12
|
return (
|
|
10
13
|
// 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),
|
|
14
|
+
(0, jsx_runtime_1.jsx)("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), src: src ?? source, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
|
|
12
15
|
}
|
|
13
16
|
exports.Picture = P;
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.S = S;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
|
-
const
|
|
7
|
-
function S({ className, children, ref, ...
|
|
8
|
-
const cn = (0,
|
|
9
|
-
return ((0, jsx_runtime_1.jsx)(react_native_safe_area_context_1.SafeAreaView, { ref: ref, className: cn(className), ...
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
function S({ className, children, ref, ...restProps }) {
|
|
8
|
+
const cn = (0, useCn_1.useCn)();
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(react_native_safe_area_context_1.SafeAreaView, { ref: ref, className: cn(className), ...restProps, children: children }));
|
|
10
10
|
}
|
|
@@ -4,10 +4,12 @@ exports.Text = void 0;
|
|
|
4
4
|
exports.T = T;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_native_1 = require("react-native");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
7
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
8
|
+
const index_native_1 = require("../../index.native");
|
|
9
|
+
function T({ className, children, ref, style, ...restProps }) {
|
|
10
|
+
const cn = (0, useCn_1.useCn)();
|
|
11
|
+
const { disabled, eventHandlers } = (0, index_native_1.useInteractiveHandlers)(restProps);
|
|
12
|
+
const { getStyles } = (0, index_native_1.useStyles)();
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, className: cn('leading-relaxed', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
12
14
|
}
|
|
13
15
|
exports.Text = T;
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Text = void 0;
|
|
4
4
|
exports.T = T;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
6
|
+
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
+
const index_web_1 = require("../../index.web");
|
|
8
|
+
function T({ className, children, as = 'span', ref, style, ...restProps }) {
|
|
9
|
+
const cn = (0, useCn_1.useCn)();
|
|
10
|
+
const { disabled, eventHandlers } = (0, index_web_1.useInteractiveHandlers)(restProps);
|
|
11
|
+
const { getStyles } = (0, index_web_1.useStyles)();
|
|
10
12
|
const Comp = as;
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(Comp, { ref: ref, className: cn('leading-relaxed', className), ...
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(Comp, { ref: ref, className: cn('leading-relaxed', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
12
14
|
}
|
|
13
15
|
exports.Text = T;
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -15,6 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./useCn"), exports);
|
|
18
|
-
__exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
|
|
19
18
|
__exportStar(require("./useOnChange"), exports);
|
|
20
19
|
__exportStar(require("./useProps"), exports);
|
|
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./useCn"), exports);
|
|
18
|
+
__exportStar(require("./useInteractiveHandlers/useInteractiveHandlers.native"), exports);
|
|
18
19
|
__exportStar(require("./useInteractiveState/useInteractiveState.native"), exports);
|
|
19
20
|
__exportStar(require("./useOnChange"), exports);
|
|
20
21
|
__exportStar(require("./useProps"), exports);
|
|
22
|
+
__exportStar(require("./useStyles/useStyles.native"), exports);
|
|
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./useCn"), exports);
|
|
18
|
+
__exportStar(require("./useInteractiveHandlers/useInteractiveHandlers.web"), exports);
|
|
18
19
|
__exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
|
|
19
20
|
__exportStar(require("./useOnChange"), exports);
|
|
20
21
|
__exportStar(require("./useProps"), exports);
|
|
22
|
+
__exportStar(require("./useStyles/useStyles.web"), exports);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInteractiveHandlers = useInteractiveHandlers;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function useInteractiveHandlers({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
|
|
6
|
+
const offOn = (0, react_1.useRef)('off');
|
|
7
|
+
const eventHandlers = {
|
|
8
|
+
onBlur: (e) => {
|
|
9
|
+
if (disabled) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
onBlur?.(e);
|
|
13
|
+
},
|
|
14
|
+
onFocus: (e) => {
|
|
15
|
+
if (disabled) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
onFocus?.(e);
|
|
19
|
+
},
|
|
20
|
+
onPress: (e) => {
|
|
21
|
+
if (disabled) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if ((onIn || onOut) && offOn.current === 'off') {
|
|
25
|
+
offOn.current = 'on';
|
|
26
|
+
onIn?.(e);
|
|
27
|
+
}
|
|
28
|
+
if ((onIn || onOut) && offOn.current === 'on') {
|
|
29
|
+
offOn.current = 'off';
|
|
30
|
+
onOut?.(e);
|
|
31
|
+
}
|
|
32
|
+
if (onPress) {
|
|
33
|
+
onPress?.(e);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
onClick?.(e);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
disabled,
|
|
41
|
+
eventHandlers,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInteractiveHandlers = useInteractiveHandlers;
|
|
4
|
+
function useInteractiveHandlers({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
|
|
5
|
+
const eventHandlers = {
|
|
6
|
+
onBlur: (e) => {
|
|
7
|
+
if (disabled) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
onBlur?.(e);
|
|
11
|
+
},
|
|
12
|
+
onClick: (e) => {
|
|
13
|
+
if (disabled) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (onClick) {
|
|
17
|
+
onClick?.(e);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
onPress?.(e);
|
|
21
|
+
},
|
|
22
|
+
onFocus: (e) => {
|
|
23
|
+
if (disabled) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
onFocus?.(e);
|
|
27
|
+
},
|
|
28
|
+
onMouseEnter: (e) => {
|
|
29
|
+
if (disabled) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
onIn?.(e);
|
|
33
|
+
},
|
|
34
|
+
onMouseLeave: (e) => {
|
|
35
|
+
if (disabled) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
onOut?.(e);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
disabled,
|
|
43
|
+
eventHandlers,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -2,27 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useInteractiveState = useInteractiveState;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
function useInteractiveState(
|
|
6
|
-
const { disabled, onBlur, onClick, onFocus, onPress, onIn, onOut } = options;
|
|
7
|
-
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
8
|
-
const [pressed, setPressed] = (0, react_1.useState)(false);
|
|
9
|
-
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
5
|
+
function useInteractiveState({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
|
|
10
6
|
const offOn = (0, react_1.useRef)('off');
|
|
11
|
-
const
|
|
12
|
-
? 'disabled'
|
|
13
|
-
: pressed
|
|
14
|
-
? 'pressed'
|
|
15
|
-
: hovered
|
|
16
|
-
? 'hovered'
|
|
17
|
-
: focused
|
|
18
|
-
? 'focused'
|
|
19
|
-
: 'idle';
|
|
7
|
+
const [interactiveState, setInteractiveState] = (0, react_1.useState)('idle');
|
|
20
8
|
const dataAttrs = {
|
|
21
|
-
'data-state':
|
|
9
|
+
'data-state': interactiveState,
|
|
22
10
|
'data-disabled': disabled ? 'true' : 'false',
|
|
23
|
-
'data-focused': focused ? 'true' : 'false',
|
|
24
|
-
'data-hovered': hovered ? 'true' : 'false',
|
|
25
|
-
'data-pressed': pressed ? 'true' : 'false',
|
|
11
|
+
'data-focused': interactiveState === 'focused' ? 'true' : 'false',
|
|
12
|
+
'data-hovered': interactiveState === 'hovered' ? 'true' : 'false',
|
|
13
|
+
'data-pressed': interactiveState === 'pressed' ? 'true' : 'false',
|
|
26
14
|
};
|
|
27
15
|
const eventHandlers = {
|
|
28
16
|
onBlur: (e) => {
|
|
@@ -30,22 +18,14 @@ function useInteractiveState(options = {}) {
|
|
|
30
18
|
return;
|
|
31
19
|
}
|
|
32
20
|
onBlur?.(e);
|
|
33
|
-
|
|
34
|
-
setPressed(false);
|
|
21
|
+
setInteractiveState('idle');
|
|
35
22
|
},
|
|
36
23
|
onFocus: (e) => {
|
|
37
24
|
if (disabled) {
|
|
38
25
|
return;
|
|
39
26
|
}
|
|
40
27
|
onFocus?.(e);
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
onIn: (e) => {
|
|
44
|
-
if (disabled) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
console.log('[DEBUG] onIn', typeof onIn, e);
|
|
48
|
-
onIn?.(e);
|
|
28
|
+
setInteractiveState('focused');
|
|
49
29
|
},
|
|
50
30
|
onPress: (e) => {
|
|
51
31
|
if (disabled) {
|
|
@@ -70,22 +50,20 @@ function useInteractiveState(options = {}) {
|
|
|
70
50
|
return;
|
|
71
51
|
}
|
|
72
52
|
onIn?.(e);
|
|
73
|
-
|
|
53
|
+
setInteractiveState('pressed');
|
|
74
54
|
},
|
|
75
55
|
onPressOut: (e) => {
|
|
76
56
|
if (disabled) {
|
|
77
57
|
return;
|
|
78
58
|
}
|
|
79
59
|
onOut?.(e);
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
onOut: (e) => {
|
|
83
|
-
if (disabled) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
console.log('[DEBUG] onOut', typeof onOut, e);
|
|
87
|
-
onOut?.(e);
|
|
60
|
+
setInteractiveState('idle');
|
|
88
61
|
},
|
|
89
62
|
};
|
|
90
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
dataAttrs,
|
|
65
|
+
disabled,
|
|
66
|
+
eventHandlers,
|
|
67
|
+
interactiveState,
|
|
68
|
+
};
|
|
91
69
|
}
|