@react-xp/design-system 1.0.0-beta.0 → 1.0.0-beta.2
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/button/button.native.js +31 -0
- package/dist/cjs/components/button/button.shared.js +59 -0
- package/dist/cjs/{styles/buttons.js → components/button/button.styles.js} +24 -13
- package/dist/cjs/components/button/button.types.js +2 -0
- package/dist/cjs/components/button/button.web.js +46 -0
- package/dist/cjs/components/button/index.js +18 -0
- package/dist/cjs/components/index.js +17 -0
- package/dist/cjs/helpers/styles.js +18 -2
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/showcase/buttons/buttons.web.js +10 -0
- package/dist/cjs/showcase/buttons/index.js +17 -0
- package/dist/cjs/showcase/index.js +17 -0
- package/dist/cjs/showcase/themeWrapper.native.js +40 -0
- package/dist/cjs/showcase/themeWrapper.web.js +42 -0
- package/dist/cjs/styles/index.js +0 -1
- package/dist/cjs/theme/index.js +19 -0
- package/dist/cjs/theme/themeContext.js +5 -0
- package/dist/cjs/theme/themeProvider.js +9 -0
- package/dist/cjs/theme/themes/corporate/colors.js +45 -0
- package/dist/cjs/theme/themes/corporate/index.js +17 -0
- package/dist/cjs/theme/useTheme.js +13 -0
- package/dist/cjs/theme/useTokens.js +6 -0
- package/dist/cjs/types/states.js +1 -4
- package/dist/esm/components/button/button.native.js +27 -0
- package/dist/esm/components/button/button.shared.js +54 -0
- package/dist/esm/{styles/buttons.js → components/button/button.styles.js} +24 -13
- package/dist/esm/components/button/button.types.js +1 -0
- package/dist/esm/components/button/button.web.js +42 -0
- package/dist/esm/components/button/index.js +2 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/helpers/styles.js +16 -2
- package/dist/esm/index.js +3 -0
- package/dist/esm/showcase/buttons/buttons.web.js +6 -0
- package/dist/esm/showcase/buttons/index.js +1 -0
- package/dist/esm/showcase/index.js +1 -0
- package/dist/esm/showcase/themeWrapper.native.js +36 -0
- package/dist/esm/showcase/themeWrapper.web.js +38 -0
- package/dist/esm/styles/cards.js +1 -1
- package/dist/esm/styles/checkboxes.js +1 -1
- package/dist/esm/styles/chips.js +1 -1
- package/dist/esm/styles/datePickers.js +1 -1
- package/dist/esm/styles/index.js +0 -1
- package/dist/esm/styles/inputs.js +1 -1
- package/dist/esm/styles/listItems.js +1 -1
- package/dist/esm/styles/popovers.js +1 -1
- package/dist/esm/styles/radios.js +1 -1
- package/dist/esm/styles/selects.js +1 -1
- package/dist/esm/styles/steppers.js +1 -1
- package/dist/esm/styles/switches.js +1 -1
- package/dist/esm/styles/tabs.js +1 -1
- package/dist/esm/styles/toasts.js +1 -1
- package/dist/esm/styles/tooltips.js +1 -1
- package/dist/esm/theme/index.js +3 -0
- package/dist/esm/theme/themeContext.js +2 -0
- package/dist/esm/theme/themeProvider.js +5 -0
- package/dist/esm/theme/themes/corporate/colors.js +42 -0
- package/dist/esm/theme/themes/corporate/index.js +1 -0
- package/dist/esm/theme/useTheme.js +9 -0
- package/dist/esm/theme/useTokens.js +2 -0
- package/dist/esm/types/states.js +0 -2
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/components/button/button.native.d.ts +3 -0
- package/dist/types/components/button/button.native.d.ts.map +1 -0
- package/dist/types/components/button/button.shared.d.ts +27 -0
- package/dist/types/components/button/button.shared.d.ts.map +1 -0
- package/dist/types/components/button/button.styles.d.ts +20 -0
- package/dist/types/components/button/button.styles.d.ts.map +1 -0
- package/dist/types/components/button/button.types.d.ts +19 -0
- package/dist/types/components/button/button.types.d.ts.map +1 -0
- package/dist/types/components/button/button.web.d.ts +3 -0
- package/dist/types/components/button/button.web.d.ts.map +1 -0
- package/dist/types/components/button/index.d.ts +3 -0
- package/dist/types/components/button/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/helpers/a11y.d.ts +5 -5
- package/dist/types/helpers/a11y.d.ts.map +1 -1
- package/dist/types/helpers/styles.d.ts +12 -9
- package/dist/types/helpers/styles.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/showcase/buttons/buttons.web.d.ts +2 -0
- package/dist/types/showcase/buttons/buttons.web.d.ts.map +1 -0
- package/dist/types/showcase/buttons/index.d.ts +2 -0
- package/dist/types/showcase/buttons/index.d.ts.map +1 -0
- package/dist/types/showcase/index.d.ts +2 -0
- package/dist/types/showcase/index.d.ts.map +1 -0
- package/dist/types/showcase/themeWrapper.native.d.ts +5 -0
- package/dist/types/showcase/themeWrapper.native.d.ts.map +1 -0
- package/dist/types/showcase/themeWrapper.web.d.ts +5 -0
- package/dist/types/showcase/themeWrapper.web.d.ts.map +1 -0
- package/dist/types/styles/avatars.d.ts +2 -2
- package/dist/types/styles/avatars.d.ts.map +1 -1
- package/dist/types/styles/badges.d.ts +2 -2
- package/dist/types/styles/badges.d.ts.map +1 -1
- package/dist/types/styles/bottomSheets.d.ts +2 -2
- package/dist/types/styles/bottomSheets.d.ts.map +1 -1
- package/dist/types/styles/cards.d.ts +2 -2
- package/dist/types/styles/cards.d.ts.map +1 -1
- package/dist/types/styles/checkboxes.d.ts +2 -2
- package/dist/types/styles/checkboxes.d.ts.map +1 -1
- package/dist/types/styles/chips.d.ts +2 -2
- package/dist/types/styles/chips.d.ts.map +1 -1
- package/dist/types/styles/datePickers.d.ts +3 -3
- package/dist/types/styles/datePickers.d.ts.map +1 -1
- package/dist/types/styles/dividers.d.ts +2 -2
- package/dist/types/styles/dividers.d.ts.map +1 -1
- package/dist/types/styles/emptyStates.d.ts +2 -2
- package/dist/types/styles/emptyStates.d.ts.map +1 -1
- package/dist/types/styles/forms.d.ts +2 -2
- package/dist/types/styles/forms.d.ts.map +1 -1
- package/dist/types/styles/headers.d.ts +2 -2
- package/dist/types/styles/headers.d.ts.map +1 -1
- package/dist/types/styles/index.d.ts +0 -1
- package/dist/types/styles/index.d.ts.map +1 -1
- package/dist/types/styles/inputs.d.ts +2 -2
- package/dist/types/styles/inputs.d.ts.map +1 -1
- package/dist/types/styles/listItems.d.ts +2 -2
- package/dist/types/styles/listItems.d.ts.map +1 -1
- package/dist/types/styles/modals.d.ts +2 -2
- package/dist/types/styles/modals.d.ts.map +1 -1
- package/dist/types/styles/pagination.d.ts +2 -2
- package/dist/types/styles/pagination.d.ts.map +1 -1
- package/dist/types/styles/popovers.d.ts +2 -2
- package/dist/types/styles/popovers.d.ts.map +1 -1
- package/dist/types/styles/progress.d.ts +4 -4
- package/dist/types/styles/progress.d.ts.map +1 -1
- package/dist/types/styles/radios.d.ts +2 -2
- package/dist/types/styles/radios.d.ts.map +1 -1
- package/dist/types/styles/selects.d.ts +2 -2
- package/dist/types/styles/selects.d.ts.map +1 -1
- package/dist/types/styles/skeletons.d.ts +3 -3
- package/dist/types/styles/skeletons.d.ts.map +1 -1
- package/dist/types/styles/steppers.d.ts +3 -3
- package/dist/types/styles/steppers.d.ts.map +1 -1
- package/dist/types/styles/switches.d.ts +2 -2
- package/dist/types/styles/switches.d.ts.map +1 -1
- package/dist/types/styles/tables.d.ts +2 -2
- package/dist/types/styles/tables.d.ts.map +1 -1
- package/dist/types/styles/tabs.d.ts +3 -3
- package/dist/types/styles/tabs.d.ts.map +1 -1
- package/dist/types/styles/toasts.d.ts +3 -3
- package/dist/types/styles/toasts.d.ts.map +1 -1
- package/dist/types/styles/tooltips.d.ts +2 -2
- package/dist/types/styles/tooltips.d.ts.map +1 -1
- package/dist/types/theme/index.d.ts +4 -0
- package/dist/types/theme/index.d.ts.map +1 -0
- package/dist/types/theme/themeContext.d.ts +6 -0
- package/dist/types/theme/themeContext.d.ts.map +1 -0
- package/dist/types/theme/themeProvider.d.ts +6 -0
- package/dist/types/theme/themeProvider.d.ts.map +1 -0
- package/dist/types/theme/themes/corporate/colors.d.ts +8 -0
- package/dist/types/theme/themes/corporate/colors.d.ts.map +1 -0
- package/dist/types/theme/themes/corporate/index.d.ts +2 -0
- package/dist/types/theme/themes/corporate/index.d.ts.map +1 -0
- package/dist/types/theme/useTheme.d.ts +2 -0
- package/dist/types/theme/useTheme.d.ts.map +1 -0
- package/dist/types/theme/useTokens.d.ts +2 -0
- package/dist/types/theme/useTokens.d.ts.map +1 -0
- package/dist/types/types/states.d.ts +3 -9
- package/dist/types/types/states.d.ts.map +1 -1
- package/dist/types/types/tokens.d.ts +5 -6
- package/dist/types/types/tokens.d.ts.map +1 -1
- package/package.json +10 -3
- package/dist/types/styles/buttons.d.ts +0 -22
- package/dist/types/styles/buttons.d.ts.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const aeiou_1 = require("@react-xp/aeiou");
|
|
6
|
+
// src/button/Button.native.tsx
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const theme_1 = require("../../theme");
|
|
9
|
+
const button_shared_1 = require("./button.shared");
|
|
10
|
+
const Button = (props) => {
|
|
11
|
+
const tokens = (0, theme_1.useTokens)();
|
|
12
|
+
const { children, variant = 'primary', size = 'md', disabled, loading, fullWidth, leftIcon, rightIcon, onClick, onPress, accessibilityLabel, testId, } = props;
|
|
13
|
+
const isDisabled = Boolean(disabled || loading);
|
|
14
|
+
const st = (0, button_shared_1.resolveButtonStyles)({
|
|
15
|
+
platform: 'native',
|
|
16
|
+
tokens,
|
|
17
|
+
variant,
|
|
18
|
+
size,
|
|
19
|
+
props,
|
|
20
|
+
});
|
|
21
|
+
const content = ((0, jsx_runtime_1.jsxs)(aeiou_1.A, { testId: testId, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled: isDisabled, busy: !!loading }, disabled: isDisabled, onPress: onPress, style: st.style.container, onClick: onClick, children: [(0, button_shared_1.applyIconStyle)(leftIcon, st.style.icon), (0, jsx_runtime_1.jsx)(aeiou_1.T, { style: st.style.label, children: children }), (0, button_shared_1.applyIconStyle)(rightIcon, st.style.icon), loading ? ((0, jsx_runtime_1.jsx)(aeiou_1.E, { style: { marginLeft: 8 }, children: (0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, {}) })) : null] }));
|
|
22
|
+
// focus wrapper (RN) – quando focused, coloca ring + gap
|
|
23
|
+
// if (!st.focusWrapper || !st.focusRing) return content;
|
|
24
|
+
// return (
|
|
25
|
+
// <E style={st.focusWrapper as TAny}>
|
|
26
|
+
// <E style={st.focusRing as TAny}>{content}</E>
|
|
27
|
+
// </E>
|
|
28
|
+
// );
|
|
29
|
+
return content;
|
|
30
|
+
};
|
|
31
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyIconStyle = exports.resolveButtonStyles = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const helpers_1 = require("../../helpers");
|
|
6
|
+
const button_styles_1 = require("./button.styles");
|
|
7
|
+
const resolveButtonStyles = ({ platform, tokens, variant, size, props, }) => {
|
|
8
|
+
const parts = (0, button_styles_1.getButtonParts)(tokens, {
|
|
9
|
+
variant,
|
|
10
|
+
size,
|
|
11
|
+
props,
|
|
12
|
+
});
|
|
13
|
+
// foco: wrapper + ring cross-platform (para ser consistente)
|
|
14
|
+
const radius = parts.container.borderRadius;
|
|
15
|
+
// filtra props web-only/native-only e normaliza px->number no native
|
|
16
|
+
const container = (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, parts.container));
|
|
17
|
+
const label = (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, parts.label));
|
|
18
|
+
const icon = (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, parts.icon));
|
|
19
|
+
return {
|
|
20
|
+
interactionStyle: {
|
|
21
|
+
focusRing: {
|
|
22
|
+
focused: (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, (0, helpers_1.getFocusRingSx)(tokens, platform, {
|
|
23
|
+
borderRadius: radius,
|
|
24
|
+
}))),
|
|
25
|
+
},
|
|
26
|
+
focusWrapper: {
|
|
27
|
+
focused: (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, (0, helpers_1.getFocusWrapperSx)(tokens, platform, {
|
|
28
|
+
borderRadius: radius,
|
|
29
|
+
}))),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
style: {
|
|
33
|
+
container,
|
|
34
|
+
label,
|
|
35
|
+
icon,
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.resolveButtonStyles = resolveButtonStyles;
|
|
40
|
+
const applyIconStyle = (node, iconSx) => {
|
|
41
|
+
if (!node)
|
|
42
|
+
return null;
|
|
43
|
+
// Se for ReactElement, tentamos clonar com props/style
|
|
44
|
+
if (typeof node === 'object' && node && 'type' in node) {
|
|
45
|
+
const el = node;
|
|
46
|
+
const prevStyle = el.props?.style;
|
|
47
|
+
return (0, react_1.cloneElement)(el, {
|
|
48
|
+
...el.props,
|
|
49
|
+
style: Array.isArray(prevStyle)
|
|
50
|
+
? [...prevStyle, iconSx]
|
|
51
|
+
: prevStyle
|
|
52
|
+
? [prevStyle, iconSx]
|
|
53
|
+
: iconSx,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// Se for string/number/etc, devolve como está
|
|
57
|
+
return node;
|
|
58
|
+
};
|
|
59
|
+
exports.applyIconStyle = applyIconStyle;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getButtonParts = void 0;
|
|
4
4
|
// styles/buttons.ts
|
|
5
|
-
const tokens_1 = require("
|
|
5
|
+
const tokens_1 = require("../../types/tokens");
|
|
6
6
|
const variantStyles = (t) => ({
|
|
7
7
|
primary: {
|
|
8
8
|
container: {
|
|
@@ -77,10 +77,11 @@ const sizeStyles = (t) => ({
|
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
});
|
|
80
|
-
const getButtonParts = (t, opts = {}) => {
|
|
80
|
+
const getButtonParts = (t, opts = { props: {} }) => {
|
|
81
81
|
const variant = opts.variant ?? 'primary';
|
|
82
82
|
const size = opts.size ?? 'md';
|
|
83
|
-
const
|
|
83
|
+
const disabled = opts.props.disabled ?? false;
|
|
84
|
+
const fullWidth = opts.props.fullWidth ?? false;
|
|
84
85
|
const baseContainer = {
|
|
85
86
|
borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
|
|
86
87
|
borderRadius: (0, tokens_1.tok)(t, 'radius-3'),
|
|
@@ -109,21 +110,31 @@ const getButtonParts = (t, opts = {}) => {
|
|
|
109
110
|
label: { color: (0, tokens_1.tok)(t, 'color-state-disabled-fg') },
|
|
110
111
|
};
|
|
111
112
|
const interaction = {
|
|
112
|
-
hovered: { container: { opacity: 0.
|
|
113
|
-
pressed: {
|
|
113
|
+
hovered: { container: { opacity: 0.7 } },
|
|
114
|
+
pressed: {
|
|
115
|
+
container: { opacity: (0, tokens_1.tok)(t, 'opacity-pressed') },
|
|
116
|
+
},
|
|
114
117
|
fullWidth: { container: { alignSelf: 'stretch' } },
|
|
115
118
|
};
|
|
116
119
|
const v = variantStyles(t)[variant];
|
|
117
120
|
const s = sizeStyles(t)[size];
|
|
118
121
|
return {
|
|
119
|
-
container:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
container: {
|
|
123
|
+
...(0, tokens_1.merge)(baseContainer, s.container, v.container, fullWidth && interaction.fullWidth.container, disabled && disabledStyles.container),
|
|
124
|
+
$hovered: interaction.hovered.container,
|
|
125
|
+
$pressed: interaction.pressed.container,
|
|
126
|
+
},
|
|
127
|
+
focusRing: {
|
|
128
|
+
$focused: focusRing,
|
|
129
|
+
},
|
|
130
|
+
icon: {
|
|
131
|
+
...(0, tokens_1.merge)(s.icon, { color: v.label.color }),
|
|
132
|
+
$disabled: { color: disabledStyles.label.color },
|
|
133
|
+
},
|
|
134
|
+
label: {
|
|
135
|
+
...(0, tokens_1.merge)(baseLabel, s.label, v.label),
|
|
136
|
+
$disabled: disabled && disabledStyles.label,
|
|
137
|
+
},
|
|
127
138
|
};
|
|
128
139
|
};
|
|
129
140
|
exports.getButtonParts = getButtonParts;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const aeiou_1 = require("@react-xp/aeiou");
|
|
6
|
+
const theme_1 = require("../../theme");
|
|
7
|
+
const button_shared_1 = require("./button.shared");
|
|
8
|
+
const Button = (props) => {
|
|
9
|
+
const tokens = (0, theme_1.useTokens)();
|
|
10
|
+
const { children, variant = 'primary', size = 'md', disabled, loading, fullWidth, leftIcon, rightIcon, type = 'button', onClick, onPress, accessibilityLabel, testId, } = props;
|
|
11
|
+
const isDisabled = Boolean(disabled || loading);
|
|
12
|
+
const st = (0, button_shared_1.resolveButtonStyles)({
|
|
13
|
+
platform: 'web',
|
|
14
|
+
tokens,
|
|
15
|
+
variant,
|
|
16
|
+
size,
|
|
17
|
+
props,
|
|
18
|
+
});
|
|
19
|
+
// wrapper + ring (para "gap" + outline consistente)
|
|
20
|
+
const Wrapper = ({ children }) => {
|
|
21
|
+
// if (!st.focusWrapper || !st.focusRing) return <>{children}</>;
|
|
22
|
+
return (
|
|
23
|
+
// <span style={st.focusWrapper as TAny}>
|
|
24
|
+
// <span style={st.focusRing as TAny}>{children}</span>
|
|
25
|
+
// </span>
|
|
26
|
+
(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }));
|
|
27
|
+
};
|
|
28
|
+
console.log('button web render', {
|
|
29
|
+
isDisabled,
|
|
30
|
+
loading,
|
|
31
|
+
st,
|
|
32
|
+
});
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsxs)(aeiou_1.A, { disabled: isDisabled, loading: loading, accessibilityLabel: accessibilityLabel, testId: testId, style: st.style.container, onClick: onClick, onPress: onPress, children: [(0, button_shared_1.applyIconStyle)(leftIcon, st.style.icon), (0, jsx_runtime_1.jsx)("span", { style: st.style.label, children: children }), (0, button_shared_1.applyIconStyle)(rightIcon, st.style.icon), loading ? ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", style: {
|
|
34
|
+
marginLeft: 8,
|
|
35
|
+
display: 'inline-flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
}, children: (0, jsx_runtime_1.jsx)("span", { style: {
|
|
39
|
+
width: 14,
|
|
40
|
+
height: 14,
|
|
41
|
+
borderRadius: 9999,
|
|
42
|
+
border: '2px solid currentColor',
|
|
43
|
+
borderTopColor: 'transparent',
|
|
44
|
+
} }) })) : null] }) }));
|
|
45
|
+
};
|
|
46
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./button.shared"), exports);
|
|
18
|
+
__exportStar(require("./button.types"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./button"), exports);
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
// - mapear shadow tokens (CSS box-shadow) para RN shadow props
|
|
7
7
|
// - focus ring cross-platform (wrapper approach)
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getFocusWrapperSx = exports.getFocusRingSx = exports.resolveShadow = exports.pickSxForPlatform = exports.getFocusRingGap = exports.getTapTargetMin = exports.getBorderWidthFocus = exports.getBorderWidthDefault = exports.normalizeValueForPlatform = exports.toPx = exports.toNumber = void 0;
|
|
10
|
-
// Nota: aqui não dependemos das tuas primitives — isto é “infra” para o teu runtime/binding.
|
|
9
|
+
exports.mergeSx = exports.normalizeSxForPlatform = exports.getFocusWrapperSx = exports.getFocusRingSx = exports.resolveShadow = exports.pickSxForPlatform = exports.getFocusRingGap = exports.getTapTargetMin = exports.getBorderWidthFocus = exports.getBorderWidthDefault = exports.normalizeValueForPlatform = exports.toPx = exports.toNumber = void 0;
|
|
11
10
|
const types_1 = require("../types");
|
|
12
11
|
/**
|
|
13
12
|
* Tokens utilitários são string com px (ex.: "1px", "44px")
|
|
@@ -170,3 +169,20 @@ const getFocusWrapperSx = (t, platform, opts) => ({
|
|
|
170
169
|
borderRadius: opts?.borderRadius,
|
|
171
170
|
});
|
|
172
171
|
exports.getFocusWrapperSx = getFocusWrapperSx;
|
|
172
|
+
const isPx = (v) => typeof v === 'string' && v.trim().endsWith('px');
|
|
173
|
+
const pxToNumber = (v) => Number.parseFloat(v);
|
|
174
|
+
const normalizeSxForPlatform = (platform, sx) => {
|
|
175
|
+
if (platform === 'web')
|
|
176
|
+
return sx;
|
|
177
|
+
// native: converter strings "Npx" -> number
|
|
178
|
+
const out = {};
|
|
179
|
+
for (const [k, v] of Object.entries(sx)) {
|
|
180
|
+
if (v === undefined)
|
|
181
|
+
continue;
|
|
182
|
+
out[k] = isPx(v) ? pxToNumber(v) : v;
|
|
183
|
+
}
|
|
184
|
+
return out;
|
|
185
|
+
};
|
|
186
|
+
exports.normalizeSxForPlatform = normalizeSxForPlatform;
|
|
187
|
+
const mergeSx = (...styles) => Object.assign({}, ...styles.filter(Boolean));
|
|
188
|
+
exports.mergeSx = mergeSx;
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,6 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
17
18
|
__exportStar(require("./helpers"), exports);
|
|
19
|
+
__exportStar(require("./showcase"), exports);
|
|
18
20
|
__exportStar(require("./styles"), exports);
|
|
21
|
+
__exportStar(require("./theme"), exports);
|
|
19
22
|
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonsShowcase = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const button_web_1 = require("../../components/button/button.web");
|
|
6
|
+
const themeWrapper_web_1 = require("../themeWrapper.web");
|
|
7
|
+
const ButtonsShowcase = () => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(themeWrapper_web_1.ThemeWrapper, { children: (0, jsx_runtime_1.jsx)(button_web_1.Button, { children: "Button example" }) }));
|
|
9
|
+
};
|
|
10
|
+
exports.ButtonsShowcase = ButtonsShowcase;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./buttons.web"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./buttons"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeWrapper = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styleguide_1 = require("@react-xp/styleguide");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const button_native_1 = require("../components/button/button.native");
|
|
8
|
+
const theme_1 = require("../theme");
|
|
9
|
+
const corporate_1 = require("../theme/themes/corporate");
|
|
10
|
+
const ThemeWrapper = ({ children }) => {
|
|
11
|
+
const [currentTheme, setCurrentTheme] = (0, react_1.useState)('corporate');
|
|
12
|
+
const [currentThemeMode, setCurrentThemeMode] = (0, react_1.useState)('light');
|
|
13
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
14
|
+
const themeTokens = (() => {
|
|
15
|
+
switch (currentTheme) {
|
|
16
|
+
case 'corporate':
|
|
17
|
+
return currentThemeMode === 'light'
|
|
18
|
+
? corporate_1.themeCorporateColors.light
|
|
19
|
+
: corporate_1.themeCorporateColors.dark;
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(theme_1.ThemeProvider, { tokens: {
|
|
23
|
+
...styleguide_1.styleguideBreakpoints,
|
|
24
|
+
...styleguide_1.styleguideComponentPadding,
|
|
25
|
+
...styleguide_1.styleguideLayoutGrid,
|
|
26
|
+
...styleguide_1.styleguideMotionDuration,
|
|
27
|
+
...styleguide_1.styleguideMotionEasing,
|
|
28
|
+
...styleguide_1.styleguideMotionPreset,
|
|
29
|
+
...styleguide_1.styleguideRadius,
|
|
30
|
+
...styleguide_1.styleguideShadows,
|
|
31
|
+
...styleguide_1.styleguideSpaceX,
|
|
32
|
+
...styleguide_1.styleguideSpaceY,
|
|
33
|
+
...styleguide_1.styleguideSpacing,
|
|
34
|
+
...styleguide_1.styleguideTypography,
|
|
35
|
+
...styleguide_1.styleguideUtils,
|
|
36
|
+
...styleguide_1.styleguideZIndex,
|
|
37
|
+
...themeTokens,
|
|
38
|
+
}, children: [(0, jsx_runtime_1.jsx)(button_native_1.Button, { onClick: () => setCurrentThemeMode(currentThemeMode === 'light' ? 'dark' : 'light'), children: "Toggle Theme Mode" }), children] }));
|
|
39
|
+
};
|
|
40
|
+
exports.ThemeWrapper = ThemeWrapper;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeWrapper = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styleguide_1 = require("@react-xp/styleguide");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const button_web_1 = require("../components/button/button.web");
|
|
8
|
+
const theme_1 = require("../theme");
|
|
9
|
+
const corporate_1 = require("../theme/themes/corporate");
|
|
10
|
+
const ThemeWrapper = ({ children }) => {
|
|
11
|
+
const [currentTheme, setCurrentTheme] = (0, react_1.useState)('corporate');
|
|
12
|
+
const [currentThemeMode, setCurrentThemeMode] = (0, react_1.useState)('light');
|
|
13
|
+
const themeTokens = (() => {
|
|
14
|
+
switch (currentTheme) {
|
|
15
|
+
case 'corporate':
|
|
16
|
+
return currentThemeMode === 'light'
|
|
17
|
+
? corporate_1.themeCorporateColors.light
|
|
18
|
+
: corporate_1.themeCorporateColors.dark;
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
21
|
+
console.log('themeTokens', themeTokens);
|
|
22
|
+
console.log('currentThemeMode', currentThemeMode);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(theme_1.ThemeProvider, { tokens: {
|
|
24
|
+
...styleguide_1.styleguideBreakpoints,
|
|
25
|
+
...styleguide_1.styleguideComponentPadding,
|
|
26
|
+
...styleguide_1.styleguideLayoutGrid,
|
|
27
|
+
...styleguide_1.styleguideMotionDuration,
|
|
28
|
+
...styleguide_1.styleguideMotionEasing,
|
|
29
|
+
...styleguide_1.styleguideMotionPreset,
|
|
30
|
+
...styleguide_1.styleguideRadius,
|
|
31
|
+
...styleguide_1.styleguideShadows,
|
|
32
|
+
...styleguide_1.styleguideSpaceX,
|
|
33
|
+
...styleguide_1.styleguideSpaceY,
|
|
34
|
+
...styleguide_1.styleguideSpacing,
|
|
35
|
+
...styleguide_1.styleguideTypography,
|
|
36
|
+
...styleguide_1.styleguideUtils,
|
|
37
|
+
...styleguide_1.styleguideZIndex,
|
|
38
|
+
...themeTokens,
|
|
39
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
40
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex m-4", style: { backgroundColor: themeTokens['color-bg-default'] }, children: [(0, jsx_runtime_1.jsx)(button_web_1.Button, { onClick: () => setCurrentThemeMode(currentThemeMode === 'light' ? 'dark' : 'light'), children: "Toggle Theme Mode" }), children] }) }));
|
|
41
|
+
};
|
|
42
|
+
exports.ThemeWrapper = ThemeWrapper;
|
package/dist/cjs/styles/index.js
CHANGED
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./avatars"), exports);
|
|
18
18
|
__exportStar(require("./badges"), exports);
|
|
19
19
|
__exportStar(require("./bottomSheets"), exports);
|
|
20
|
-
__exportStar(require("./buttons"), exports);
|
|
21
20
|
__exportStar(require("./cards"), exports);
|
|
22
21
|
__exportStar(require("./checkboxes"), exports);
|
|
23
22
|
__exportStar(require("./chips"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./themeProvider"), exports);
|
|
18
|
+
__exportStar(require("./useTheme"), exports);
|
|
19
|
+
__exportStar(require("./useTokens"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const themeContext_1 = require("./themeContext");
|
|
6
|
+
const ThemeProvider = ({ children, tokens, }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(themeContext_1.ThemeContext.Provider, { value: { tokens }, children: children }));
|
|
8
|
+
};
|
|
9
|
+
exports.ThemeProvider = ThemeProvider;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.themeCorporateColors = void 0;
|
|
4
|
+
exports.themeCorporateColors = {
|
|
5
|
+
dark: {
|
|
6
|
+
'color-brand': '#60A5FA',
|
|
7
|
+
'color-action-primary': '#60A5FA',
|
|
8
|
+
'color-action-primary-fg': '#020617',
|
|
9
|
+
'color-action-secondary': '#CBD5E1',
|
|
10
|
+
'color-action-secondary-fg': '#020617',
|
|
11
|
+
'color-accent': '#FDBA74',
|
|
12
|
+
'color-accent-fg': '#111827',
|
|
13
|
+
'color-bg-default': '#020617',
|
|
14
|
+
'color-bg-subtle': '#111827',
|
|
15
|
+
'color-surface': '#111827',
|
|
16
|
+
'color-surface-alt': '#111827',
|
|
17
|
+
'color-fg-default': '#E5E7EB',
|
|
18
|
+
'color-fg-muted': '#9CA3AF',
|
|
19
|
+
'color-fg-subtle': '#64748B',
|
|
20
|
+
'color-fg-on-inverted': '#020617',
|
|
21
|
+
'color-border-subtle': '#1E293B',
|
|
22
|
+
'color-border-strong': '#475569',
|
|
23
|
+
'color-focus-ring': '#F97316',
|
|
24
|
+
},
|
|
25
|
+
light: {
|
|
26
|
+
'color-brand': '#1D4ED8',
|
|
27
|
+
'color-action-primary': '#2563EB',
|
|
28
|
+
'color-action-primary-fg': '#FFFFFF',
|
|
29
|
+
'color-action-secondary': '#64748B',
|
|
30
|
+
'color-action-secondary-fg': '#0F172A',
|
|
31
|
+
'color-accent': '#F97316',
|
|
32
|
+
'color-accent-fg': '#111827',
|
|
33
|
+
'color-bg-default': '#F9FAFB',
|
|
34
|
+
'color-bg-subtle': '#E5E7EB',
|
|
35
|
+
'color-surface': '#FFFFFF',
|
|
36
|
+
'color-surface-alt': '#F3F4F6',
|
|
37
|
+
'color-fg-default': '#0F172A',
|
|
38
|
+
'color-fg-muted': '#6B7280',
|
|
39
|
+
'color-fg-subtle': '#9CA3AF',
|
|
40
|
+
'color-fg-on-inverted': '#F9FAFB',
|
|
41
|
+
'color-border-subtle': '#E5E7EB',
|
|
42
|
+
'color-border-strong': '#9CA3AF',
|
|
43
|
+
'color-focus-ring': '#2563EB',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./colors"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTheme = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const themeContext_1 = require("./themeContext");
|
|
6
|
+
const useTheme = () => {
|
|
7
|
+
const ctx = (0, react_1.useContext)(themeContext_1.ThemeContext);
|
|
8
|
+
if (!ctx) {
|
|
9
|
+
throw new Error('useTheme must be used within <ThemeProvider>');
|
|
10
|
+
}
|
|
11
|
+
return ctx;
|
|
12
|
+
};
|
|
13
|
+
exports.useTheme = useTheme;
|
package/dist/cjs/types/states.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInvalid =
|
|
4
|
-
// Helpers pequenos (opcionais)
|
|
5
|
-
const isDisabled = (s) => Boolean(s?.disabled || s?.loading);
|
|
6
|
-
exports.isDisabled = isDisabled;
|
|
3
|
+
exports.isInvalid = void 0;
|
|
7
4
|
const isInvalid = (s) => Boolean(s?.error || s?.invalid);
|
|
8
5
|
exports.isInvalid = isInvalid;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { A, E, T } from '@react-xp/aeiou';
|
|
3
|
+
// src/button/Button.native.tsx
|
|
4
|
+
import { ActivityIndicator } from 'react-native';
|
|
5
|
+
import { useTokens } from '../../theme';
|
|
6
|
+
import { applyIconStyle, resolveButtonStyles } from './button.shared';
|
|
7
|
+
export const Button = (props) => {
|
|
8
|
+
const tokens = useTokens();
|
|
9
|
+
const { children, variant = 'primary', size = 'md', disabled, loading, fullWidth, leftIcon, rightIcon, onClick, onPress, accessibilityLabel, testId, } = props;
|
|
10
|
+
const isDisabled = Boolean(disabled || loading);
|
|
11
|
+
const st = resolveButtonStyles({
|
|
12
|
+
platform: 'native',
|
|
13
|
+
tokens,
|
|
14
|
+
variant,
|
|
15
|
+
size,
|
|
16
|
+
props,
|
|
17
|
+
});
|
|
18
|
+
const content = (_jsxs(A, { testId: testId, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled: isDisabled, busy: !!loading }, disabled: isDisabled, onPress: onPress, style: st.style.container, onClick: onClick, children: [applyIconStyle(leftIcon, st.style.icon), _jsx(T, { style: st.style.label, children: children }), applyIconStyle(rightIcon, st.style.icon), loading ? (_jsx(E, { style: { marginLeft: 8 }, children: _jsx(ActivityIndicator, {}) })) : null] }));
|
|
19
|
+
// focus wrapper (RN) – quando focused, coloca ring + gap
|
|
20
|
+
// if (!st.focusWrapper || !st.focusRing) return content;
|
|
21
|
+
// return (
|
|
22
|
+
// <E style={st.focusWrapper as TAny}>
|
|
23
|
+
// <E style={st.focusRing as TAny}>{content}</E>
|
|
24
|
+
// </E>
|
|
25
|
+
// );
|
|
26
|
+
return content;
|
|
27
|
+
};
|