@common-origin/design-system 1.7.0 → 1.8.0
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/Badge/Badge.d.ts +18 -0
- package/dist/components/atoms/Badge/index.d.ts +2 -0
- package/dist/components/atoms/SectionSeparator/SectionSeparator.d.ts +26 -0
- package/dist/components/atoms/SectionSeparator/index.d.ts +1 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/index.esm.js +80 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +79 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -747,7 +747,7 @@ var AvatarContainer = styled.div.withConfig({
|
|
|
747
747
|
},
|
|
748
748
|
displayName: "Avatar__AvatarContainer",
|
|
749
749
|
componentId: "sc-ezn4ax-0"
|
|
750
|
-
})(templateObject_1$
|
|
750
|
+
})(templateObject_1$m || (templateObject_1$m = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n flex-shrink: 0;\n"], ["\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n border-radius: ", ";\n background-color: ", ";\n overflow: hidden;\n flex-shrink: 0;\n"])), function (_a) {
|
|
751
751
|
var $size = _a.$size;
|
|
752
752
|
return tokens.semantic.size.avatar[$size];
|
|
753
753
|
}, function (_a) {
|
|
@@ -760,14 +760,14 @@ var AvatarImage = styled.img.withConfig({
|
|
|
760
760
|
},
|
|
761
761
|
displayName: "Avatar__AvatarImage",
|
|
762
762
|
componentId: "sc-ezn4ax-1"
|
|
763
|
-
})(templateObject_2$
|
|
763
|
+
})(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: ", ";\n /* Remove the img role since the container already has role=\"img\" */\n"], ["\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: ", ";\n /* Remove the img role since the container already has role=\"img\" */\n"])), tokens.base.border.radius.circle);
|
|
764
764
|
var AvatarInitials = styled.span.withConfig({
|
|
765
765
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
766
766
|
return !prop.startsWith('$');
|
|
767
767
|
},
|
|
768
768
|
displayName: "Avatar__AvatarInitials",
|
|
769
769
|
componentId: "sc-ezn4ax-2"
|
|
770
|
-
})(templateObject_3$
|
|
770
|
+
})(templateObject_3$9 || (templateObject_3$9 = __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"
|
|
771
771
|
// Helper function to get initials from name
|
|
772
772
|
])), tokens.base.fontFamily.body, tokens.base.fontWeight[3], function (_a) {
|
|
773
773
|
var $size = _a.$size;
|
|
@@ -830,7 +830,80 @@ var Avatar = function Avatar(_a) {
|
|
|
830
830
|
"aria-hidden": "true"
|
|
831
831
|
}, initials));
|
|
832
832
|
};
|
|
833
|
-
var templateObject_1$
|
|
833
|
+
var templateObject_1$m, templateObject_2$b, templateObject_3$9;
|
|
834
|
+
|
|
835
|
+
React.createElement;
|
|
836
|
+
var _a$6 = tokens.semantic,
|
|
837
|
+
color$4 = _a$6.color,
|
|
838
|
+
typography$3 = _a$6.typography,
|
|
839
|
+
_b$2 = tokens.base,
|
|
840
|
+
fontSize = _b$2.fontSize;
|
|
841
|
+
_b$2.shadow;
|
|
842
|
+
var scaleIn = styled.keyframes(templateObject_1$l || (templateObject_1$l = __makeTemplateObject(["\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n"], ["\n from {\n transform: scale(0.8);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n"])));
|
|
843
|
+
var BadgeWrapper = styled.span.withConfig({
|
|
844
|
+
displayName: "Badge__BadgeWrapper",
|
|
845
|
+
componentId: "sc-tjz4pp-0"
|
|
846
|
+
})(templateObject_2$a || (templateObject_2$a = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n flex-shrink: 0;\n"], ["\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n flex-shrink: 0;\n"])));
|
|
847
|
+
var BadgeIndicator = styled.span.withConfig({
|
|
848
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
849
|
+
return !prop.startsWith('$');
|
|
850
|
+
},
|
|
851
|
+
displayName: "Badge__BadgeIndicator",
|
|
852
|
+
componentId: "sc-tjz4pp-1"
|
|
853
|
+
})(templateObject_3$8 || (templateObject_3$8 = __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 font: ", ";\n font-size: ", ";\n font-weight: 600;\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 font: ", ";\n font-size: ", ";\n font-weight: 600;\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) {
|
|
854
|
+
return props.$isVisible ? 'flex' : 'none';
|
|
855
|
+
}, function (props) {
|
|
856
|
+
return props.$isDot ? '8px' : '20px';
|
|
857
|
+
}, function (props) {
|
|
858
|
+
return props.$isDot ? '8px' : '20px';
|
|
859
|
+
}, function (props) {
|
|
860
|
+
return props.$isDot ? '0' : '0 6px';
|
|
861
|
+
}, tokens.base.border.radius.circle, typography$3.caption, fontSize[1], color$4.background["default"], scaleIn, function (props) {
|
|
862
|
+
switch (props.$variant) {
|
|
863
|
+
case 'primary':
|
|
864
|
+
return "\n background-color: ".concat(color$4.background.interactive, ";\n color: ").concat(color$4.text.inverse, ";\n ");
|
|
865
|
+
case 'error':
|
|
866
|
+
return "\n background-color: ".concat(color$4.background.error, ";\n color: ").concat(color$4.text.inverse, ";\n ");
|
|
867
|
+
case 'warning':
|
|
868
|
+
return "\n background-color: ".concat(color$4.background.warning, ";\n color: ").concat(color$4.text.inverse, ";\n ");
|
|
869
|
+
case 'success':
|
|
870
|
+
return "\n background-color: ".concat(color$4.background.success, ";\n color: ").concat(color$4.text.inverse, ";\n ");
|
|
871
|
+
default:
|
|
872
|
+
return "\n background-color: ".concat(color$4.background.emphasis, ";\n color: ").concat(color$4.text.inverse, ";\n ");
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
var ScreenReaderOnly = styled.span.withConfig({
|
|
876
|
+
displayName: "Badge__ScreenReaderOnly",
|
|
877
|
+
componentId: "sc-tjz4pp-2"
|
|
878
|
+
})(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n"], ["\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n"])));
|
|
879
|
+
var Badge = function Badge(_a) {
|
|
880
|
+
var children = _a.children,
|
|
881
|
+
_b = _a.count,
|
|
882
|
+
count = _b === void 0 ? 0 : _b,
|
|
883
|
+
_c = _a.max,
|
|
884
|
+
max = _c === void 0 ? 99 : _c,
|
|
885
|
+
_d = _a.variant,
|
|
886
|
+
variant = _d === void 0 ? 'default' : _d,
|
|
887
|
+
_e = _a.dot,
|
|
888
|
+
dot = _e === void 0 ? false : _e,
|
|
889
|
+
ariaLabel = _a["aria-label"],
|
|
890
|
+
className = _a.className;
|
|
891
|
+
var isVisible = dot || count > 0;
|
|
892
|
+
var displayCount = count > max ? "".concat(max, "+") : count.toString();
|
|
893
|
+
// Generate default aria-label if not provided
|
|
894
|
+
var defaultAriaLabel = dot ? 'New notification indicator' : count === 1 ? '1 notification' : "".concat(count, " notifications");
|
|
895
|
+
var label = ariaLabel || defaultAriaLabel;
|
|
896
|
+
return /*#__PURE__*/React.createElement(BadgeWrapper, {
|
|
897
|
+
className: className
|
|
898
|
+
}, children, /*#__PURE__*/React.createElement(BadgeIndicator, {
|
|
899
|
+
$variant: variant,
|
|
900
|
+
$isDot: dot,
|
|
901
|
+
$isVisible: isVisible,
|
|
902
|
+
role: "status",
|
|
903
|
+
"aria-live": "polite"
|
|
904
|
+
}, !dot && displayCount, /*#__PURE__*/React.createElement(ScreenReaderOnly, null, label)));
|
|
905
|
+
};
|
|
906
|
+
var templateObject_1$l, templateObject_2$a, templateObject_3$8, templateObject_4$6;
|
|
834
907
|
|
|
835
908
|
React.createElement;
|
|
836
909
|
var StyledBox = styled.div.withConfig({
|
|
@@ -1405,7 +1478,7 @@ var BaseChipStyled = styled.span.withConfig({
|
|
|
1405
1478
|
},
|
|
1406
1479
|
displayName: "ChipBase__BaseChipStyled",
|
|
1407
1480
|
componentId: "sc-moa6zc-0"
|
|
1408
|
-
})(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: 12px;\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: ", ";\n \n /* Use CSS custom properties set by wrapper */\n background-color: var(--chip-bg-color);\n color: var(--chip-text-color);\n font: var(--chip-font);\n padding: var(--chip-padding);\n opacity: var(--chip-opacity, 1);\n cursor: var(--chip-cursor, default);\n \n &:hover {\n opacity: var(--chip-hover-opacity, var(--chip-opacity, 1));\n }\n \n &:active {\n opacity: var(--chip-active-opacity, var(--chip-opacity, 1));\n }\n \n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: 12px;\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: ", ";\n \n /* Use CSS custom properties set by wrapper */\n background-color: var(--chip-bg-color);\n color: var(--chip-text-color);\n font: var(--chip-font);\n padding: var(--chip-padding);\n opacity: var(--chip-opacity, 1);\n cursor: var(--chip-cursor, default);\n \n &:hover {\n opacity: var(--chip-hover-opacity, var(--chip-opacity, 1));\n }\n \n &:active {\n opacity: var(--chip-active-opacity, var(--chip-opacity, 1));\n }\n \n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n"
|
|
1481
|
+
})(templateObject_1$h || (templateObject_1$h = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: 12px;\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: width ", ";\n \n /* Use CSS custom properties set by wrapper */\n background-color: var(--chip-bg-color);\n color: var(--chip-text-color);\n font: var(--chip-font);\n padding: var(--chip-padding);\n opacity: var(--chip-opacity, 1);\n cursor: var(--chip-cursor, default);\n \n &:hover {\n opacity: var(--chip-hover-opacity, var(--chip-opacity, 1));\n }\n \n &:active {\n opacity: var(--chip-active-opacity, var(--chip-opacity, 1));\n }\n \n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: max-content;\n border-radius: 12px;\n box-sizing: border-box;\n user-select: none;\n white-space: nowrap;\n transition: width ", ";\n \n /* Use CSS custom properties set by wrapper */\n background-color: var(--chip-bg-color);\n color: var(--chip-text-color);\n font: var(--chip-font);\n padding: var(--chip-padding);\n opacity: var(--chip-opacity, 1);\n cursor: var(--chip-cursor, default);\n \n &:hover {\n opacity: var(--chip-hover-opacity, var(--chip-opacity, 1));\n }\n \n &:active {\n opacity: var(--chip-active-opacity, var(--chip-opacity, 1));\n }\n \n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n"
|
|
1409
1482
|
// Icon container for selected indicator or leading icons
|
|
1410
1483
|
])), tokens.semantic.motion.interactive, chip.variants.interactive.backgroundColor);
|
|
1411
1484
|
// Icon container for selected indicator or leading icons
|
|
@@ -3040,6 +3113,7 @@ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, temp
|
|
|
3040
3113
|
|
|
3041
3114
|
exports.ArtCard = ArtCard;
|
|
3042
3115
|
exports.Avatar = Avatar;
|
|
3116
|
+
exports.Badge = Badge;
|
|
3043
3117
|
exports.BooleanChip = BooleanChip;
|
|
3044
3118
|
exports.Box = Box;
|
|
3045
3119
|
exports.Breadcrumbs = Breadcrumbs;
|