@react-xp/design-system 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.
Files changed (34) hide show
  1. package/dist/cjs/components/button/button.native.js +4 -8
  2. package/dist/cjs/components/button/button.shared.js +11 -15
  3. package/dist/cjs/components/button/button.web.js +1 -1
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/cjs/{showcase/buttons/index.native.js → index.native.js} +6 -1
  6. package/dist/cjs/{showcase/buttons/index.js → index.web.js} +6 -1
  7. package/dist/esm/components/button/button.native.js +4 -8
  8. package/dist/esm/components/button/button.shared.js +11 -15
  9. package/dist/esm/components/button/button.web.js +1 -1
  10. package/dist/esm/index.js +1 -1
  11. package/dist/esm/index.native.js +6 -0
  12. package/dist/esm/index.web.js +6 -0
  13. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  14. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  15. package/dist/types/components/button/button.native.d.ts.map +1 -1
  16. package/dist/types/components/button/button.shared.d.ts +7 -11
  17. package/dist/types/components/button/button.shared.d.ts.map +1 -1
  18. package/dist/types/index.d.ts +1 -1
  19. package/dist/types/index.d.ts.map +1 -1
  20. package/dist/types/index.native.d.ts +7 -0
  21. package/dist/types/index.native.d.ts.map +1 -0
  22. package/dist/types/index.web.d.ts +7 -0
  23. package/dist/types/index.web.d.ts.map +1 -0
  24. package/package.json +11 -3
  25. package/dist/cjs/showcase/index.js +0 -17
  26. package/dist/esm/showcase/buttons/index.js +0 -1
  27. package/dist/esm/showcase/buttons/index.native.js +0 -1
  28. package/dist/esm/showcase/index.js +0 -1
  29. package/dist/types/showcase/buttons/index.d.ts +0 -2
  30. package/dist/types/showcase/buttons/index.d.ts.map +0 -1
  31. package/dist/types/showcase/buttons/index.native.d.ts +0 -2
  32. package/dist/types/showcase/buttons/index.native.d.ts.map +0 -1
  33. package/dist/types/showcase/index.d.ts +0 -2
  34. 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.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] }));
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
- // 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;
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
- 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
- },
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
- style: {
33
- container,
34
- label,
35
- icon,
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.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: {
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("./buttons.native"), exports);
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("./buttons.web"), exports);
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);
@@ -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.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] }));
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
- // 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;
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
- interactionStyle: {
18
- focusRing: {
19
- focused: normalizeSxForPlatform(platform, pickSxForPlatform(platform, getFocusRingSx(tokens, platform, {
20
- borderRadius: radius,
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
- style: {
30
- container,
31
- label,
32
- icon,
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.style.container, onClick: onClick, onPress: onPress, children: [applyIconStyle(leftIcon, st.style.icon), _jsx("span", { style: st.style.label, children: children }), applyIconStyle(rightIcon, st.style.icon), loading ? (_jsx("span", { "aria-hidden": "true", style: {
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
@@ -1,6 +1,6 @@
1
1
  export * from './components';
2
2
  export * from './helpers';
3
- export * from './showcase';
3
+ export * from './showcase/buttons/buttons.web';
4
4
  export * from './styles';
5
5
  export * from './theme';
6
6
  export * from './types';
@@ -0,0 +1,6 @@
1
+ export * from './components';
2
+ export * from './helpers';
3
+ export * from './showcase/buttons/buttons.native';
4
+ export * from './styles';
5
+ export * from './theme';
6
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ export * from './components';
2
+ export * from './helpers';
3
+ export * from './showcase/buttons/buttons.web';
4
+ export * from './styles';
5
+ export * from './theme';
6
+ export * from './types';