@react-xp/aeiou 1.0.0-beta.3 → 1.0.0-beta.4
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 -3
- package/dist/cjs/components/a/a.web.js +2 -3
- package/dist/cjs/components/d/d.native.js +20 -5
- package/dist/cjs/components/d/d.web.js +21 -6
- package/dist/cjs/components/e/e.native.js +2 -3
- package/dist/cjs/components/e/e.web.js +4 -3
- package/dist/cjs/components/i/i.native.js +4 -3
- package/dist/cjs/components/i/i.web.js +8 -3
- package/dist/cjs/components/l/l.web.js +2 -3
- package/dist/cjs/components/o/o.native.js +4 -3
- package/dist/cjs/components/o/o.web.js +2 -3
- package/dist/cjs/components/p/p.native.js +4 -3
- package/dist/cjs/components/p/p.web.js +4 -3
- package/dist/cjs/components/s/s.native.js +2 -3
- package/dist/cjs/components/t/t.native.js +2 -3
- package/dist/cjs/components/t/t.web.js +2 -3
- package/dist/esm/components/a/a.native.js +6 -2
- package/dist/esm/components/a/a.web.js +2 -2
- package/dist/esm/components/d/d.native.js +20 -4
- package/dist/esm/components/d/d.web.js +21 -5
- package/dist/esm/components/e/e.native.js +2 -2
- package/dist/esm/components/e/e.web.js +4 -2
- package/dist/esm/components/i/i.native.js +4 -2
- package/dist/esm/components/i/i.web.js +8 -2
- package/dist/esm/components/l/l.web.js +2 -2
- package/dist/esm/components/o/o.native.js +4 -2
- package/dist/esm/components/o/o.web.js +2 -2
- package/dist/esm/components/p/p.native.js +4 -2
- package/dist/esm/components/p/p.web.js +4 -2
- package/dist/esm/components/s/s.native.js +2 -2
- package/dist/esm/components/t/t.native.js +2 -2
- package/dist/esm/components/t/t.web.js +2 -2
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/components/d/d.native.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/native/cjs/components/a/a.native.js +0 -17
- package/dist/native/cjs/components/a/a.web.js +0 -15
- package/dist/native/cjs/components/a/index.native.js +0 -17
- package/dist/native/cjs/components/a/index.web.js +0 -17
- package/dist/native/cjs/components/d/d.native.js +0 -28
- package/dist/native/cjs/components/d/d.web.js +0 -38
- package/dist/native/cjs/components/d/index.native.js +0 -17
- package/dist/native/cjs/components/d/index.web.js +0 -17
- package/dist/native/cjs/components/e/e.native.js +0 -16
- package/dist/native/cjs/components/e/e.web.js +0 -15
- package/dist/native/cjs/components/e/index.native.js +0 -17
- package/dist/native/cjs/components/e/index.web.js +0 -17
- package/dist/native/cjs/components/i/i.native.js +0 -28
- package/dist/native/cjs/components/i/i.web.js +0 -27
- package/dist/native/cjs/components/i/index.native.js +0 -17
- package/dist/native/cjs/components/i/index.web.js +0 -17
- package/dist/native/cjs/components/i/useIUtils.js +0 -71
- package/dist/native/cjs/components/index.js +0 -26
- package/dist/native/cjs/components/index.native.js +0 -26
- package/dist/native/cjs/components/index.web.js +0 -26
- package/dist/native/cjs/components/l/index.native.js +0 -17
- package/dist/native/cjs/components/l/index.web.js +0 -17
- package/dist/native/cjs/components/l/l.native.js +0 -10
- package/dist/native/cjs/components/l/l.web.js +0 -15
- package/dist/native/cjs/components/o/index.native.js +0 -17
- package/dist/native/cjs/components/o/index.web.js +0 -17
- package/dist/native/cjs/components/o/o.native.js +0 -12
- package/dist/native/cjs/components/o/o.web.js +0 -15
- package/dist/native/cjs/components/p/index.native.js +0 -17
- package/dist/native/cjs/components/p/index.web.js +0 -17
- package/dist/native/cjs/components/p/p.native.js +0 -13
- package/dist/native/cjs/components/p/p.web.js +0 -16
- package/dist/native/cjs/components/s/index.native.js +0 -17
- package/dist/native/cjs/components/s/index.web.js +0 -17
- package/dist/native/cjs/components/s/s.native.js +0 -10
- package/dist/native/cjs/components/s/s.web.js +0 -10
- package/dist/native/cjs/components/t/index.native.js +0 -17
- package/dist/native/cjs/components/t/index.web.js +0 -17
- package/dist/native/cjs/components/t/t.native.js +0 -15
- package/dist/native/cjs/components/t/t.web.js +0 -15
- package/dist/native/cjs/components/u/context.js +0 -14
- package/dist/native/cjs/components/u/errorBoundary.js +0 -27
- package/dist/native/cjs/components/u/index.native.js +0 -19
- package/dist/native/cjs/components/u/index.web.js +0 -19
- package/dist/native/cjs/components/u/provider.native.js +0 -24
- package/dist/native/cjs/components/u/provider.web.js +0 -21
- package/dist/native/cjs/components/u/types.js +0 -2
- package/dist/native/cjs/components/u/useUniverse.js +0 -8
- package/dist/native/cjs/hooks/index.js +0 -19
- package/dist/native/cjs/hooks/index.native.js +0 -22
- package/dist/native/cjs/hooks/index.web.js +0 -22
- package/dist/native/cjs/hooks/useCn.js +0 -15
- package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +0 -43
- package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +0 -45
- package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.native.js +0 -69
- package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.web.js +0 -74
- package/dist/native/cjs/hooks/useOnChange.js +0 -18
- package/dist/native/cjs/hooks/useProps.js +0 -66
- package/dist/native/cjs/hooks/useStyles/useStyles.helpers.js +0 -35
- package/dist/native/cjs/hooks/useStyles/useStyles.native.js +0 -46
- package/dist/native/cjs/hooks/useStyles/useStyles.types.js +0 -2
- package/dist/native/cjs/hooks/useStyles/useStyles.web.js +0 -71
- package/dist/native/cjs/index.js +0 -19
- package/dist/native/cjs/index.native.js +0 -19
- package/dist/native/cjs/index.web.js +0 -19
- package/dist/native/cjs/types/base.js +0 -2
- package/dist/native/cjs/types/index.js +0 -17
- package/dist/native/esm/components/a/a.native.js +0 -13
- package/dist/native/esm/components/a/a.web.js +0 -11
- package/dist/native/esm/components/a/index.native.js +0 -1
- package/dist/native/esm/components/a/index.web.js +0 -1
- package/dist/native/esm/components/d/d.native.js +0 -24
- package/dist/native/esm/components/d/d.web.js +0 -34
- package/dist/native/esm/components/d/index.native.js +0 -1
- package/dist/native/esm/components/d/index.web.js +0 -1
- package/dist/native/esm/components/e/e.native.js +0 -12
- package/dist/native/esm/components/e/e.web.js +0 -11
- package/dist/native/esm/components/e/index.native.js +0 -1
- package/dist/native/esm/components/e/index.web.js +0 -1
- package/dist/native/esm/components/i/i.native.js +0 -24
- package/dist/native/esm/components/i/i.web.js +0 -23
- package/dist/native/esm/components/i/index.native.js +0 -1
- package/dist/native/esm/components/i/index.web.js +0 -1
- package/dist/native/esm/components/i/useIUtils.js +0 -67
- package/dist/native/esm/components/index.js +0 -10
- package/dist/native/esm/components/index.native.js +0 -10
- package/dist/native/esm/components/index.web.js +0 -10
- package/dist/native/esm/components/l/index.native.js +0 -1
- package/dist/native/esm/components/l/index.web.js +0 -1
- package/dist/native/esm/components/l/l.native.js +0 -6
- package/dist/native/esm/components/l/l.web.js +0 -11
- package/dist/native/esm/components/o/index.native.js +0 -1
- package/dist/native/esm/components/o/index.web.js +0 -1
- package/dist/native/esm/components/o/o.native.js +0 -8
- package/dist/native/esm/components/o/o.web.js +0 -11
- package/dist/native/esm/components/p/index.native.js +0 -1
- package/dist/native/esm/components/p/index.web.js +0 -1
- package/dist/native/esm/components/p/p.native.js +0 -9
- package/dist/native/esm/components/p/p.web.js +0 -12
- package/dist/native/esm/components/s/index.native.js +0 -1
- package/dist/native/esm/components/s/index.web.js +0 -1
- package/dist/native/esm/components/s/s.native.js +0 -7
- package/dist/native/esm/components/s/s.web.js +0 -6
- package/dist/native/esm/components/t/index.native.js +0 -1
- package/dist/native/esm/components/t/index.web.js +0 -1
- package/dist/native/esm/components/t/t.native.js +0 -11
- package/dist/native/esm/components/t/t.web.js +0 -11
- package/dist/native/esm/components/u/context.js +0 -11
- package/dist/native/esm/components/u/errorBoundary.js +0 -23
- package/dist/native/esm/components/u/index.native.js +0 -3
- package/dist/native/esm/components/u/index.web.js +0 -3
- package/dist/native/esm/components/u/provider.native.js +0 -20
- package/dist/native/esm/components/u/provider.web.js +0 -17
- package/dist/native/esm/components/u/types.js +0 -1
- package/dist/native/esm/components/u/useUniverse.js +0 -5
- package/dist/native/esm/hooks/index.js +0 -3
- package/dist/native/esm/hooks/index.native.js +0 -6
- package/dist/native/esm/hooks/index.web.js +0 -6
- package/dist/native/esm/hooks/useCn.js +0 -8
- package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +0 -40
- package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +0 -42
- package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.native.js +0 -66
- package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.web.js +0 -71
- package/dist/native/esm/hooks/useOnChange.js +0 -14
- package/dist/native/esm/hooks/useProps.js +0 -59
- package/dist/native/esm/hooks/useStyles/useStyles.helpers.js +0 -29
- package/dist/native/esm/hooks/useStyles/useStyles.native.js +0 -42
- package/dist/native/esm/hooks/useStyles/useStyles.types.js +0 -1
- package/dist/native/esm/hooks/useStyles/useStyles.web.js +0 -66
- package/dist/native/esm/index.js +0 -3
- package/dist/native/esm/index.native.js +0 -3
- package/dist/native/esm/index.web.js +0 -3
- package/dist/native/esm/types/base.js +0 -1
- package/dist/native/esm/types/index.js +0 -1
- package/dist/native/tsconfig.native.cjs.tsbuildinfo +0 -1
- package/dist/native/tsconfig.native.esm.tsbuildinfo +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Text = void 0;
|
|
4
|
-
exports.T = T;
|
|
5
|
-
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
|
-
const react_native_1 = require("react-native");
|
|
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 }));
|
|
14
|
-
}
|
|
15
|
-
exports.Text = T;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Text = void 0;
|
|
4
|
-
exports.T = T;
|
|
5
|
-
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
|
-
const useCn_1 = require("../../hooks/useCn");
|
|
7
|
-
const index_web_1 = require("../../index.web");
|
|
8
|
-
function T({ as = 'span', className, children, 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)();
|
|
12
|
-
const Comp = as;
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(Comp, { ref: ref, className: cn('leading-relaxed', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
|
|
14
|
-
}
|
|
15
|
-
exports.Text = T;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniverseContext = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const defaultValue = {
|
|
6
|
-
colorScheme: 'system',
|
|
7
|
-
locale: 'en-US',
|
|
8
|
-
platform: 'web',
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
10
|
-
setColorScheme: () => { },
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
12
|
-
setLocale: () => { },
|
|
13
|
-
};
|
|
14
|
-
exports.UniverseContext = (0, react_1.createContext)(defaultValue);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorBoundary = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
class ErrorBoundary extends react_1.Component {
|
|
7
|
-
constructor(props) {
|
|
8
|
-
super(props);
|
|
9
|
-
this.state = { hasError: false };
|
|
10
|
-
}
|
|
11
|
-
static getDerivedStateFromError() {
|
|
12
|
-
return { hasError: true };
|
|
13
|
-
}
|
|
14
|
-
componentDidCatch(error, errorInfo) {
|
|
15
|
-
this.props.onError?.callback?.(error, errorInfo);
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
if (this.state.hasError) {
|
|
19
|
-
if (this.props.onError?.render) {
|
|
20
|
-
return this.props.onError.render;
|
|
21
|
-
}
|
|
22
|
-
return (0, jsx_runtime_1.jsx)("h1", { children: "Ocorreu um erro. Por favor, tente novamente mais tarde." });
|
|
23
|
-
}
|
|
24
|
-
return this.props.children;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./provider.native"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./useUniverse"), exports);
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./provider.web"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./useUniverse"), exports);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Universe = void 0;
|
|
4
|
-
exports.U = U;
|
|
5
|
-
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
const context_1 = require("./context");
|
|
9
|
-
const errorBoundary_1 = require("./errorBoundary");
|
|
10
|
-
function U({ children, config, onError }) {
|
|
11
|
-
const systemColorScheme = react_native_1.Appearance.getColorScheme() ?? 'light';
|
|
12
|
-
const [colorScheme, setColorScheme] = (0, react_1.useState)(config?.colorScheme ?? 'system');
|
|
13
|
-
const [locale, setLocale] = (0, react_1.useState)(config?.locale ?? 'en-US');
|
|
14
|
-
const value = (0, react_1.useMemo)(() => ({
|
|
15
|
-
colorScheme,
|
|
16
|
-
locale,
|
|
17
|
-
platform: 'native',
|
|
18
|
-
systemColorScheme,
|
|
19
|
-
setColorScheme,
|
|
20
|
-
setLocale,
|
|
21
|
-
}), [colorScheme, locale, systemColorScheme]);
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { onError: onError, children: (0, jsx_runtime_1.jsx)(context_1.UniverseContext.Provider, { value: value, children: children }) }));
|
|
23
|
-
}
|
|
24
|
-
exports.Universe = U;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Universe = void 0;
|
|
4
|
-
exports.U = U;
|
|
5
|
-
const jsx_runtime_1 = require("nativewind/jsx-runtime");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const context_1 = require("./context");
|
|
8
|
-
const errorBoundary_1 = require("./errorBoundary");
|
|
9
|
-
function U({ children, config, onError }) {
|
|
10
|
-
const [colorScheme, setColorScheme] = (0, react_1.useState)(config?.colorScheme ?? 'system');
|
|
11
|
-
const [locale, setLocale] = (0, react_1.useState)(config?.locale ?? 'en-US');
|
|
12
|
-
const value = (0, react_1.useMemo)(() => ({
|
|
13
|
-
colorScheme,
|
|
14
|
-
locale,
|
|
15
|
-
platform: 'web',
|
|
16
|
-
setColorScheme,
|
|
17
|
-
setLocale,
|
|
18
|
-
}), [colorScheme, locale]);
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { onError: onError, children: (0, jsx_runtime_1.jsx)(context_1.UniverseContext.Provider, { value: value, children: children }) }));
|
|
20
|
-
}
|
|
21
|
-
exports.Universe = U;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUniverse = useUniverse;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const context_1 = require("./context");
|
|
6
|
-
function useUniverse() {
|
|
7
|
-
return (0, react_1.useContext)(context_1.UniverseContext);
|
|
8
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./useCn"), exports);
|
|
18
|
-
__exportStar(require("./useOnChange"), exports);
|
|
19
|
-
__exportStar(require("./useProps"), exports);
|
|
@@ -1,22 +0,0 @@
|
|
|
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("./useCn"), exports);
|
|
18
|
-
__exportStar(require("./useInteractiveHandlers/useInteractiveHandlers.native"), exports);
|
|
19
|
-
__exportStar(require("./useInteractiveState/useInteractiveState.native"), exports);
|
|
20
|
-
__exportStar(require("./useOnChange"), exports);
|
|
21
|
-
__exportStar(require("./useProps"), exports);
|
|
22
|
-
__exportStar(require("./useStyles/useStyles.native"), exports);
|
|
@@ -1,22 +0,0 @@
|
|
|
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("./useCn"), exports);
|
|
18
|
-
__exportStar(require("./useInteractiveHandlers/useInteractiveHandlers.web"), exports);
|
|
19
|
-
__exportStar(require("./useInteractiveState/useInteractiveState.web"), exports);
|
|
20
|
-
__exportStar(require("./useOnChange"), exports);
|
|
21
|
-
__exportStar(require("./useProps"), exports);
|
|
22
|
-
__exportStar(require("./useStyles/useStyles.web"), exports);
|
|
@@ -1,15 +0,0 @@
|
|
|
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.useCn = void 0;
|
|
7
|
-
const clsx_1 = __importDefault(require("clsx"));
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const tailwind_merge_1 = require("tailwind-merge");
|
|
10
|
-
const useCn = () => {
|
|
11
|
-
return (0, react_1.useMemo)(() => (...inputs) => {
|
|
12
|
-
return (0, tailwind_merge_1.twMerge)((0, clsx_1.default)(inputs));
|
|
13
|
-
}, []);
|
|
14
|
-
};
|
|
15
|
-
exports.useCn = useCn;
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useInteractiveState = useInteractiveState;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
function useInteractiveState({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
|
|
6
|
-
const offOn = (0, react_1.useRef)('off');
|
|
7
|
-
const [interactiveState, setInteractiveState] = (0, react_1.useState)('idle');
|
|
8
|
-
const dataAttrs = {
|
|
9
|
-
'data-state': interactiveState,
|
|
10
|
-
'data-disabled': disabled ? 'true' : 'false',
|
|
11
|
-
'data-focused': interactiveState === 'focused' ? 'true' : 'false',
|
|
12
|
-
'data-hovered': interactiveState === 'hovered' ? 'true' : 'false',
|
|
13
|
-
'data-pressed': interactiveState === 'pressed' ? 'true' : 'false',
|
|
14
|
-
};
|
|
15
|
-
const eventHandlers = {
|
|
16
|
-
onBlur: (e) => {
|
|
17
|
-
if (disabled) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
onBlur?.(e);
|
|
21
|
-
setInteractiveState('idle');
|
|
22
|
-
},
|
|
23
|
-
onFocus: (e) => {
|
|
24
|
-
if (disabled) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
onFocus?.(e);
|
|
28
|
-
setInteractiveState('focused');
|
|
29
|
-
},
|
|
30
|
-
onPress: (e) => {
|
|
31
|
-
if (disabled) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if ((onIn || onOut) && offOn.current === 'off') {
|
|
35
|
-
offOn.current = 'on';
|
|
36
|
-
onIn?.(e);
|
|
37
|
-
}
|
|
38
|
-
if ((onIn || onOut) && offOn.current === 'on') {
|
|
39
|
-
offOn.current = 'off';
|
|
40
|
-
onOut?.(e);
|
|
41
|
-
}
|
|
42
|
-
if (onPress) {
|
|
43
|
-
onPress?.(e);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
onClick?.(e);
|
|
47
|
-
},
|
|
48
|
-
onPressIn: (e) => {
|
|
49
|
-
if (disabled) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
onIn?.(e);
|
|
53
|
-
setInteractiveState('pressed');
|
|
54
|
-
},
|
|
55
|
-
onPressOut: (e) => {
|
|
56
|
-
if (disabled) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
onOut?.(e);
|
|
60
|
-
setInteractiveState('idle');
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
return {
|
|
64
|
-
dataAttrs,
|
|
65
|
-
disabled,
|
|
66
|
-
eventHandlers,
|
|
67
|
-
interactiveState,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useInteractiveState = useInteractiveState;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
function useInteractiveState({ disabled, onBlur, onClick, onFocus, onPress, onIn, onOut, } = {}) {
|
|
6
|
-
const [interactiveState, setInteractiveState] = (0, react_1.useState)('idle');
|
|
7
|
-
const dataAttrs = {
|
|
8
|
-
'data-state': interactiveState,
|
|
9
|
-
'data-disabled': disabled ? 'true' : 'false',
|
|
10
|
-
'data-focused': interactiveState === 'focused' ? 'true' : 'false',
|
|
11
|
-
'data-hovered': interactiveState === 'hovered' ? 'true' : 'false',
|
|
12
|
-
'data-pressed': interactiveState === 'pressed' ? 'true' : 'false',
|
|
13
|
-
};
|
|
14
|
-
const eventHandlers = {
|
|
15
|
-
onBlur: (e) => {
|
|
16
|
-
if (disabled) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
onBlur?.(e);
|
|
20
|
-
setInteractiveState('idle');
|
|
21
|
-
},
|
|
22
|
-
onClick: (e) => {
|
|
23
|
-
if (disabled) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (onClick) {
|
|
27
|
-
onClick?.(e);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
onPress?.(e);
|
|
31
|
-
},
|
|
32
|
-
onFocus: (e) => {
|
|
33
|
-
if (disabled) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
onFocus?.(e);
|
|
37
|
-
setInteractiveState('focused');
|
|
38
|
-
},
|
|
39
|
-
onMouseDown: (e) => {
|
|
40
|
-
if (disabled) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
setInteractiveState('pressed');
|
|
44
|
-
},
|
|
45
|
-
onMouseEnter: (e) => {
|
|
46
|
-
if (disabled) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
onIn?.(e);
|
|
50
|
-
setInteractiveState('hovered');
|
|
51
|
-
},
|
|
52
|
-
onMouseLeave: (e) => {
|
|
53
|
-
if (disabled) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
console.log('[DEBUG] onMouseLeave', typeof onOut, e);
|
|
57
|
-
onOut?.(e);
|
|
58
|
-
setInteractiveState('idle');
|
|
59
|
-
},
|
|
60
|
-
onMouseUp: (e) => {
|
|
61
|
-
if (disabled) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
console.log('[DEBUG] onMouseUp', e);
|
|
65
|
-
setInteractiveState('idle');
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
return {
|
|
69
|
-
dataAttrs,
|
|
70
|
-
disabled,
|
|
71
|
-
eventHandlers,
|
|
72
|
-
interactiveState,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,66 +0,0 @@
|
|
|
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;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toCssDecls = exports.toKebab = exports.extractStyles = void 0;
|
|
4
|
-
const extractStyles = (style) => {
|
|
5
|
-
const base = { ...style };
|
|
6
|
-
const disabled = style.$disabled || {};
|
|
7
|
-
const focused = style.$focused || {};
|
|
8
|
-
const hovered = style.$hovered || {};
|
|
9
|
-
const pressed = style.$pressed || {};
|
|
10
|
-
base.$disabled = undefined;
|
|
11
|
-
base.$focused = undefined;
|
|
12
|
-
base.$hovered = undefined;
|
|
13
|
-
base.$pressed = undefined;
|
|
14
|
-
return {
|
|
15
|
-
styleBase: base,
|
|
16
|
-
styleDisabled: disabled,
|
|
17
|
-
styleFocused: focused,
|
|
18
|
-
styleHovered: hovered,
|
|
19
|
-
stylePressed: pressed,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
exports.extractStyles = extractStyles;
|
|
23
|
-
const toKebab = (s) => s.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
24
|
-
exports.toKebab = toKebab;
|
|
25
|
-
const toCssDecls = (style) => {
|
|
26
|
-
if (!style) {
|
|
27
|
-
return '';
|
|
28
|
-
}
|
|
29
|
-
// TODO: adiconar os px ou outra medida quando necessario e faça sentido
|
|
30
|
-
return Object.entries(style)
|
|
31
|
-
.filter(([, v]) => v !== undefined && v !== null)
|
|
32
|
-
.map(([k, v]) => `${(0, exports.toKebab)(k)}:${typeof v === 'number' ? `${v}` : v};`)
|
|
33
|
-
.join('');
|
|
34
|
-
};
|
|
35
|
-
exports.toCssDecls = toCssDecls;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useStyles = void 0;
|
|
4
|
-
const useStyles_helpers_1 = require("./useStyles.helpers");
|
|
5
|
-
const getStyles = ({ disabled, style, }) => {
|
|
6
|
-
if (!style) {
|
|
7
|
-
return {};
|
|
8
|
-
}
|
|
9
|
-
const { styleBase, styleDisabled, styleFocused, styleHovered, stylePressed } = (0, useStyles_helpers_1.extractStyles)(style);
|
|
10
|
-
const composedStyle = { ...styleBase };
|
|
11
|
-
if (disabled) {
|
|
12
|
-
Object.assign(composedStyle, styleDisabled || {});
|
|
13
|
-
}
|
|
14
|
-
return { style: composedStyle };
|
|
15
|
-
};
|
|
16
|
-
const getStylesWithInteraction = ({ disabled, style, }) => ({
|
|
17
|
-
style: (options) => {
|
|
18
|
-
console.log('getStylesWithInteraction options:', options);
|
|
19
|
-
if (!style) {
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
const { styleBase, styleDisabled, styleFocused, styleHovered, stylePressed, } = (0, useStyles_helpers_1.extractStyles)(style);
|
|
23
|
-
const composedStyle = { ...styleBase };
|
|
24
|
-
if (disabled) {
|
|
25
|
-
Object.assign(composedStyle, styleDisabled || {});
|
|
26
|
-
}
|
|
27
|
-
if (options?.focused) {
|
|
28
|
-
Object.assign(composedStyle, styleFocused || {});
|
|
29
|
-
}
|
|
30
|
-
if (options?.hovered) {
|
|
31
|
-
Object.assign(composedStyle, styleHovered || {});
|
|
32
|
-
}
|
|
33
|
-
if (options?.pressed) {
|
|
34
|
-
Object.assign(composedStyle, stylePressed || {});
|
|
35
|
-
}
|
|
36
|
-
console.log('getStylesWithInteraction output:', composedStyle);
|
|
37
|
-
return composedStyle;
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
const useStyles = () => {
|
|
41
|
-
return {
|
|
42
|
-
getStyles,
|
|
43
|
-
getStylesWithInteraction,
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
exports.useStyles = useStyles;
|