@common-origin/design-system 1.15.1 → 1.15.3
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/components/atoms/Button/Button.d.ts +2 -2
- package/dist/index.esm.js +20 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { type IconName } from '../Icon';
|
|
3
3
|
export interface BaseButtonProps {
|
|
4
4
|
variant?: 'primary' | 'secondary' | 'naked';
|
|
5
5
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -7,7 +7,7 @@ export interface BaseButtonProps {
|
|
|
7
7
|
purpose?: 'button' | 'link';
|
|
8
8
|
target?: string;
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
-
iconName?:
|
|
10
|
+
iconName?: IconName;
|
|
11
11
|
id?: string;
|
|
12
12
|
'data-testid'?: string;
|
|
13
13
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -804,7 +804,7 @@ var AvatarInitials = styled.span.withConfig({
|
|
|
804
804
|
},
|
|
805
805
|
displayName: "Avatar__AvatarInitials",
|
|
806
806
|
componentId: "sc-ezn4ax-2"
|
|
807
|
-
})(templateObject_3$
|
|
807
|
+
})(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n color: ", ";\n line-height: 1;\n text-transform: uppercase;\n user-select: none;\n"], ["\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n color: ", ";\n line-height: 1;\n text-transform: uppercase;\n user-select: none;\n"
|
|
808
808
|
// Helper function to get initials from name
|
|
809
809
|
])), tokensData.base.fontFamily.body, tokensData.base.fontWeight[3], function (_a) {
|
|
810
810
|
var $size = _a.$size;
|
|
@@ -867,7 +867,7 @@ var Avatar = function Avatar(_a) {
|
|
|
867
867
|
"aria-hidden": "true"
|
|
868
868
|
}, initials));
|
|
869
869
|
};
|
|
870
|
-
var templateObject_1$y, templateObject_2$l, templateObject_3$
|
|
870
|
+
var templateObject_1$y, templateObject_2$l, templateObject_3$i;
|
|
871
871
|
|
|
872
872
|
React.createElement;
|
|
873
873
|
var _a$5 = tokensData.semantic,
|
|
@@ -1018,7 +1018,7 @@ var BadgeIndicator = styled.span.withConfig({
|
|
|
1018
1018
|
},
|
|
1019
1019
|
displayName: "Badge__BadgeIndicator",
|
|
1020
1020
|
componentId: "sc-tjz4pp-1"
|
|
1021
|
-
})(templateObject_3$
|
|
1021
|
+
})(templateObject_3$h || (templateObject_3$h = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: ", ";\n align-items: center;\n justify-content: center;\n min-width: ", ";\n height: ", ";\n padding: ", ";\n border-radius: ", ";\n line-height: 1;\n white-space: nowrap;\n box-shadow: 0 0 0 2px ", ";\n animation: ", " 0.2s ease-out;\n \n ", "\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: ", ";\n align-items: center;\n justify-content: center;\n min-width: ", ";\n height: ", ";\n padding: ", ";\n border-radius: ", ";\n line-height: 1;\n white-space: nowrap;\n box-shadow: 0 0 0 2px ", ";\n animation: ", " 0.2s ease-out;\n \n ", "\n"])), function (props) {
|
|
1022
1022
|
return props.$isVisible ? 'flex' : 'none';
|
|
1023
1023
|
}, function (props) {
|
|
1024
1024
|
return props.$isDot ? '8px' : '16px';
|
|
@@ -1074,7 +1074,7 @@ var Badge = function Badge(_a) {
|
|
|
1074
1074
|
color: "inverse"
|
|
1075
1075
|
}, displayCount), /*#__PURE__*/React.createElement(ScreenReaderOnly, null, label)));
|
|
1076
1076
|
};
|
|
1077
|
-
var templateObject_1$w, templateObject_2$k, templateObject_3$
|
|
1077
|
+
var templateObject_1$w, templateObject_2$k, templateObject_3$h, templateObject_4$e;
|
|
1078
1078
|
|
|
1079
1079
|
React.createElement;
|
|
1080
1080
|
var StyledBox = styled.div.withConfig({
|
|
@@ -1090,7 +1090,7 @@ var StyledBox = styled.div.withConfig({
|
|
|
1090
1090
|
}, function (props) {
|
|
1091
1091
|
return props.$flexDirection && css(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["flex-direction: ", ";"], ["flex-direction: ", ";"])), props.$flexDirection);
|
|
1092
1092
|
}, function (props) {
|
|
1093
|
-
return props.$justifyContent && css(templateObject_3$
|
|
1093
|
+
return props.$justifyContent && css(templateObject_3$g || (templateObject_3$g = __makeTemplateObject(["justify-content: ", ";"], ["justify-content: ", ";"])), props.$justifyContent);
|
|
1094
1094
|
}, function (props) {
|
|
1095
1095
|
return props.$alignItems && css(templateObject_4$d || (templateObject_4$d = __makeTemplateObject(["align-items: ", ";"], ["align-items: ", ";"])), props.$alignItems);
|
|
1096
1096
|
}, function (props) {
|
|
@@ -1276,7 +1276,7 @@ var BoxTransform = function BoxTransform(props) {
|
|
|
1276
1276
|
}, rest), children);
|
|
1277
1277
|
};
|
|
1278
1278
|
var Box = BoxTransform;
|
|
1279
|
-
var templateObject_1$v, templateObject_2$j, templateObject_3$
|
|
1279
|
+
var templateObject_1$v, templateObject_2$j, templateObject_3$g, templateObject_4$d, templateObject_5$a, templateObject_6$9, templateObject_7$7, templateObject_8$3, templateObject_9$2, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$1, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21$1, templateObject_22$1, templateObject_23$1, templateObject_24$1, templateObject_25$1, templateObject_26$1, templateObject_27$1, templateObject_28$1, templateObject_29$1, templateObject_30$1, templateObject_31$1, templateObject_32$1, templateObject_33$1, templateObject_34$1, templateObject_35$1, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43;
|
|
1280
1280
|
|
|
1281
1281
|
var add = {
|
|
1282
1282
|
path: "M13 11H19V13H13V19H11V13H5V11H11V5H13V11Z",
|
|
@@ -1571,6 +1571,16 @@ var StyledLink = styled.a.withConfig({
|
|
|
1571
1571
|
displayName: "Button__StyledLink",
|
|
1572
1572
|
componentId: "sc-1eiuum9-1"
|
|
1573
1573
|
})(templateObject_2$i || (templateObject_2$i = __makeTemplateObject(["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"], ["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"
|
|
1574
|
+
// Styled Next.js Link component (modern API without legacyBehavior)
|
|
1575
|
+
])), baseButtonStyles, button.primary.borderRadius, getVariantStyles, getSizeStyles);
|
|
1576
|
+
// Styled Next.js Link component (modern API without legacyBehavior)
|
|
1577
|
+
var StyledNextLink = styled(Link).withConfig({
|
|
1578
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
1579
|
+
return !prop.startsWith('$');
|
|
1580
|
+
},
|
|
1581
|
+
displayName: "Button__StyledNextLink",
|
|
1582
|
+
componentId: "sc-1eiuum9-2"
|
|
1583
|
+
})(templateObject_3$f || (templateObject_3$f = __makeTemplateObject(["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"], ["\n ", "\n border-radius: ", ";\n \n ", "\n ", "\n"
|
|
1574
1584
|
// Helper function to get icon size based on button size
|
|
1575
1585
|
])), baseButtonStyles, button.primary.borderRadius, getVariantStyles, getSizeStyles);
|
|
1576
1586
|
// Helper function to get icon size based on button size
|
|
@@ -1609,18 +1619,14 @@ var Button = function Button(_a) {
|
|
|
1609
1619
|
iconName = _a.iconName,
|
|
1610
1620
|
dataTestId = _a["data-testid"],
|
|
1611
1621
|
rest = __rest(_a, ["variant", "size", "url", "purpose", "children", "target", "iconName", 'data-testid']);
|
|
1612
|
-
// For internal links, use Next.js Link
|
|
1622
|
+
// For internal links, use Next.js Link (modern API without legacyBehavior)
|
|
1613
1623
|
if (purpose === 'link' && url && !url.startsWith('http') && !target) {
|
|
1614
|
-
|
|
1615
|
-
return /*#__PURE__*/React.createElement(Link, {
|
|
1624
|
+
return /*#__PURE__*/React.createElement(StyledNextLink, {
|
|
1616
1625
|
href: url,
|
|
1617
|
-
passHref: true,
|
|
1618
|
-
legacyBehavior: true
|
|
1619
|
-
}, /*#__PURE__*/React.createElement(StyledLink, _extends({
|
|
1620
1626
|
$variant: variant,
|
|
1621
1627
|
$size: size,
|
|
1622
1628
|
"data-testid": dataTestId
|
|
1623
|
-
},
|
|
1629
|
+
}, renderButtonContent(children, iconName, size));
|
|
1624
1630
|
}
|
|
1625
1631
|
// For external links or links with target
|
|
1626
1632
|
if (purpose === 'link' && url) {
|
|
@@ -1663,7 +1669,7 @@ var Button = function Button(_a) {
|
|
|
1663
1669
|
"data-testid": dataTestId
|
|
1664
1670
|
}, buttonProps), renderButtonContent(children, iconName, size));
|
|
1665
1671
|
};
|
|
1666
|
-
var templateObject_1$t, templateObject_2$i;
|
|
1672
|
+
var templateObject_1$t, templateObject_2$i, templateObject_3$f;
|
|
1667
1673
|
|
|
1668
1674
|
var chip = tokensData.component.chip;
|
|
1669
1675
|
// Helper function to get variant styles as objects for CSS custom properties
|