@react-xp/design-system 1.0.0-beta.2 → 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/button/button.native.js +4 -8
- package/dist/cjs/components/button/button.shared.js +11 -15
- package/dist/cjs/components/button/button.web.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{showcase/index.js → index.native.js} +6 -1
- package/dist/cjs/{showcase/buttons/index.js → index.web.js} +6 -1
- package/dist/cjs/showcase/buttons/buttons.native.js +10 -0
- package/dist/esm/components/button/button.native.js +4 -8
- package/dist/esm/components/button/button.shared.js +11 -15
- package/dist/esm/components/button/button.web.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.native.js +6 -0
- package/dist/esm/index.web.js +6 -0
- package/dist/esm/showcase/buttons/buttons.native.js +6 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/components/button/button.native.d.ts.map +1 -1
- package/dist/types/components/button/button.shared.d.ts +7 -11
- package/dist/types/components/button/button.shared.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.native.d.ts +7 -0
- package/dist/types/index.native.d.ts.map +1 -0
- package/dist/types/index.web.d.ts +7 -0
- package/dist/types/index.web.d.ts.map +1 -0
- package/dist/types/showcase/buttons/buttons.native.d.ts +2 -0
- package/dist/types/showcase/buttons/buttons.native.d.ts.map +1 -0
- package/package.json +11 -3
- package/dist/esm/showcase/buttons/index.js +0 -1
- package/dist/esm/showcase/index.js +0 -1
- package/dist/types/showcase/buttons/index.d.ts +0 -2
- package/dist/types/showcase/buttons/index.d.ts.map +0 -1
- package/dist/types/showcase/index.d.ts +0 -2
- package/dist/types/showcase/index.d.ts.map +0 -1
|
@@ -18,14 +18,10 @@ const Button = (props) => {
|
|
|
18
18
|
size,
|
|
19
19
|
props,
|
|
20
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.
|
|
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.container, onClick: onClick, children: [(0, button_shared_1.applyIconStyle)(leftIcon, st.icon), (0, jsx_runtime_1.jsx)(aeiou_1.T, { style: st.label, children: children }), (0, button_shared_1.applyIconStyle)(rightIcon, st.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
22
|
// focus wrapper (RN) – quando focused, coloca ring + gap
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// <E style={st.focusRing as TAny}>{content}</E>
|
|
27
|
-
// </E>
|
|
28
|
-
// );
|
|
29
|
-
return content;
|
|
23
|
+
if (!st.focusWrapper || !st.focusRing)
|
|
24
|
+
return content;
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(aeiou_1.E, { style: st.focusWrapper, children: (0, jsx_runtime_1.jsx)(aeiou_1.E, { style: st.focusRing, children: content }) }));
|
|
30
26
|
};
|
|
31
27
|
exports.Button = Button;
|
|
@@ -17,23 +17,19 @@ const resolveButtonStyles = ({ platform, tokens, variant, size, props, }) => {
|
|
|
17
17
|
const label = (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, parts.label));
|
|
18
18
|
const icon = (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, parts.icon));
|
|
19
19
|
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
},
|
|
20
|
+
container,
|
|
21
|
+
focusRing: {
|
|
22
|
+
$focused: (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, (0, helpers_1.getFocusRingSx)(tokens, platform, {
|
|
23
|
+
borderRadius: radius,
|
|
24
|
+
}))),
|
|
31
25
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
focusWrapper: {
|
|
27
|
+
$focused: (0, helpers_1.normalizeSxForPlatform)(platform, (0, helpers_1.pickSxForPlatform)(platform, (0, helpers_1.getFocusWrapperSx)(tokens, platform, {
|
|
28
|
+
borderRadius: radius,
|
|
29
|
+
}))),
|
|
36
30
|
},
|
|
31
|
+
label,
|
|
32
|
+
icon,
|
|
37
33
|
};
|
|
38
34
|
};
|
|
39
35
|
exports.resolveButtonStyles = resolveButtonStyles;
|
|
@@ -30,7 +30,7 @@ const Button = (props) => {
|
|
|
30
30
|
loading,
|
|
31
31
|
st,
|
|
32
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.
|
|
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.container, onClick: onClick, onPress: onPress, children: [(0, button_shared_1.applyIconStyle)(leftIcon, st.icon), (0, jsx_runtime_1.jsx)("span", { style: st.label, children: children }), (0, button_shared_1.applyIconStyle)(rightIcon, st.icon), loading ? ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", style: {
|
|
34
34
|
marginLeft: 8,
|
|
35
35
|
display: 'inline-flex',
|
|
36
36
|
alignItems: 'center',
|
package/dist/cjs/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./components"), exports);
|
|
18
18
|
__exportStar(require("./helpers"), exports);
|
|
19
|
-
__exportStar(require("./showcase"), exports);
|
|
19
|
+
__exportStar(require("./showcase/buttons/buttons.web"), exports);
|
|
20
20
|
__exportStar(require("./styles"), exports);
|
|
21
21
|
__exportStar(require("./theme"), exports);
|
|
22
22
|
__exportStar(require("./types"), exports);
|
|
@@ -14,4 +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("./
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
18
|
+
__exportStar(require("./helpers"), exports);
|
|
19
|
+
__exportStar(require("./showcase/buttons/buttons.native"), exports);
|
|
20
|
+
__exportStar(require("./styles"), exports);
|
|
21
|
+
__exportStar(require("./theme"), exports);
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
@@ -14,4 +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("./
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
18
|
+
__exportStar(require("./helpers"), exports);
|
|
19
|
+
__exportStar(require("./showcase/buttons/buttons.web"), exports);
|
|
20
|
+
__exportStar(require("./styles"), exports);
|
|
21
|
+
__exportStar(require("./theme"), exports);
|
|
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_native_1 = require("../../components/button/button.native");
|
|
6
|
+
const themeWrapper_native_1 = require("../themeWrapper.native");
|
|
7
|
+
const ButtonsShowcase = () => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(themeWrapper_native_1.ThemeWrapper, { children: (0, jsx_runtime_1.jsx)(button_native_1.Button, { children: "Button example" }) }));
|
|
9
|
+
};
|
|
10
|
+
exports.ButtonsShowcase = ButtonsShowcase;
|
|
@@ -15,13 +15,9 @@ export const Button = (props) => {
|
|
|
15
15
|
size,
|
|
16
16
|
props,
|
|
17
17
|
});
|
|
18
|
-
const content = (_jsxs(A, { testId: testId, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled: isDisabled, busy: !!loading }, disabled: isDisabled, onPress: onPress, style: st.
|
|
18
|
+
const content = (_jsxs(A, { testId: testId, accessibilityRole: "button", accessibilityLabel: accessibilityLabel, accessibilityState: { disabled: isDisabled, busy: !!loading }, disabled: isDisabled, onPress: onPress, style: st.container, onClick: onClick, children: [applyIconStyle(leftIcon, st.icon), _jsx(T, { style: st.label, children: children }), applyIconStyle(rightIcon, st.icon), loading ? (_jsx(E, { style: { marginLeft: 8 }, children: _jsx(ActivityIndicator, {}) })) : null] }));
|
|
19
19
|
// focus wrapper (RN) – quando focused, coloca ring + gap
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// <E style={st.focusRing as TAny}>{content}</E>
|
|
24
|
-
// </E>
|
|
25
|
-
// );
|
|
26
|
-
return content;
|
|
20
|
+
if (!st.focusWrapper || !st.focusRing)
|
|
21
|
+
return content;
|
|
22
|
+
return (_jsx(E, { style: st.focusWrapper, children: _jsx(E, { style: st.focusRing, children: content }) }));
|
|
27
23
|
};
|
|
@@ -14,23 +14,19 @@ export const resolveButtonStyles = ({ platform, tokens, variant, size, props, })
|
|
|
14
14
|
const label = normalizeSxForPlatform(platform, pickSxForPlatform(platform, parts.label));
|
|
15
15
|
const icon = normalizeSxForPlatform(platform, pickSxForPlatform(platform, parts.icon));
|
|
16
16
|
return {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
focusWrapper: {
|
|
24
|
-
focused: normalizeSxForPlatform(platform, pickSxForPlatform(platform, getFocusWrapperSx(tokens, platform, {
|
|
25
|
-
borderRadius: radius,
|
|
26
|
-
}))),
|
|
27
|
-
},
|
|
17
|
+
container,
|
|
18
|
+
focusRing: {
|
|
19
|
+
$focused: normalizeSxForPlatform(platform, pickSxForPlatform(platform, getFocusRingSx(tokens, platform, {
|
|
20
|
+
borderRadius: radius,
|
|
21
|
+
}))),
|
|
28
22
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
focusWrapper: {
|
|
24
|
+
$focused: normalizeSxForPlatform(platform, pickSxForPlatform(platform, getFocusWrapperSx(tokens, platform, {
|
|
25
|
+
borderRadius: radius,
|
|
26
|
+
}))),
|
|
33
27
|
},
|
|
28
|
+
label,
|
|
29
|
+
icon,
|
|
34
30
|
};
|
|
35
31
|
};
|
|
36
32
|
export const applyIconStyle = (node, iconSx) => {
|
|
@@ -27,7 +27,7 @@ export const Button = (props) => {
|
|
|
27
27
|
loading,
|
|
28
28
|
st,
|
|
29
29
|
});
|
|
30
|
-
return (_jsx(Wrapper, { children: _jsxs(A, { disabled: isDisabled, loading: loading, accessibilityLabel: accessibilityLabel, testId: testId, style: st.
|
|
30
|
+
return (_jsx(Wrapper, { children: _jsxs(A, { disabled: isDisabled, loading: loading, accessibilityLabel: accessibilityLabel, testId: testId, style: st.container, onClick: onClick, onPress: onPress, children: [applyIconStyle(leftIcon, st.icon), _jsx("span", { style: st.label, children: children }), applyIconStyle(rightIcon, st.icon), loading ? (_jsx("span", { "aria-hidden": "true", style: {
|
|
31
31
|
marginLeft: 8,
|
|
32
32
|
display: 'inline-flex',
|
|
33
33
|
alignItems: 'center',
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../components/button/button.native';
|
|
3
|
+
import { ThemeWrapper } from '../themeWrapper.native';
|
|
4
|
+
export const ButtonsShowcase = () => {
|
|
5
|
+
return (_jsx(ThemeWrapper, { children: _jsx(Button, { children: "Button example" }) }));
|
|
6
|
+
};
|