design-zystem 1.0.281 → 1.0.282
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/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -687,6 +687,8 @@ var Icon_default = Icon;
|
|
|
687
687
|
// src/Components/Divider/Divider.tsx
|
|
688
688
|
var import_styled_components7 = __toESM(require("styled-components"));
|
|
689
689
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
690
|
+
var isColorToken = (value) => Object.prototype.hasOwnProperty.call(colors, value);
|
|
691
|
+
var resolveColor = (value) => isColorToken(value) ? colors[value] : value;
|
|
690
692
|
var StyledDivider = import_styled_components7.default.div`
|
|
691
693
|
background-color: ${({ $color }) => $color || "#DCDCDC"};
|
|
692
694
|
${({ $orientation, $thickness }) => $orientation === "vertical" ? `
|
|
@@ -719,7 +721,7 @@ var Divider = (_a) => {
|
|
|
719
721
|
StyledDivider,
|
|
720
722
|
__spreadValues({
|
|
721
723
|
$orientation: orientation,
|
|
722
|
-
$color: color,
|
|
724
|
+
$color: resolveColor(color),
|
|
723
725
|
$thickness: thickness,
|
|
724
726
|
$ySpacing: ySpacing,
|
|
725
727
|
className,
|
|
@@ -2141,7 +2143,7 @@ var Initials = import_styled_components18.default.span`
|
|
|
2141
2143
|
line-height: 1;
|
|
2142
2144
|
user-select: none;
|
|
2143
2145
|
`;
|
|
2144
|
-
var
|
|
2146
|
+
var resolveColor2 = (token, fallback) => {
|
|
2145
2147
|
if (!token) return fallback;
|
|
2146
2148
|
return colors[token] || token;
|
|
2147
2149
|
};
|
|
@@ -2157,8 +2159,8 @@ var Avatar = ({
|
|
|
2157
2159
|
}) => {
|
|
2158
2160
|
var _a, _b, _c;
|
|
2159
2161
|
const [hasImageError, setHasImageError] = (0, import_react9.useState)(false);
|
|
2160
|
-
const resolvedBackground =
|
|
2161
|
-
const resolvedText =
|
|
2162
|
+
const resolvedBackground = resolveColor2(backgroundColor, colors.grey_300);
|
|
2163
|
+
const resolvedText = resolveColor2(textColor, colors.dark);
|
|
2162
2164
|
const initials = getInitials(name);
|
|
2163
2165
|
const sizePx = `${size}px`;
|
|
2164
2166
|
const borderRadius = shape === "circle" ? "50%" : "4px";
|
package/dist/index.mjs
CHANGED
|
@@ -548,6 +548,8 @@ var Icon_default = Icon;
|
|
|
548
548
|
// src/Components/Divider/Divider.tsx
|
|
549
549
|
import styled7 from "styled-components";
|
|
550
550
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
551
|
+
var isColorToken = (value) => Object.prototype.hasOwnProperty.call(colors, value);
|
|
552
|
+
var resolveColor = (value) => isColorToken(value) ? colors[value] : value;
|
|
551
553
|
var StyledDivider = styled7.div`
|
|
552
554
|
background-color: ${({ $color }) => $color || "#DCDCDC"};
|
|
553
555
|
${({ $orientation, $thickness }) => $orientation === "vertical" ? `
|
|
@@ -580,7 +582,7 @@ var Divider = (_a) => {
|
|
|
580
582
|
StyledDivider,
|
|
581
583
|
__spreadValues({
|
|
582
584
|
$orientation: orientation,
|
|
583
|
-
$color: color,
|
|
585
|
+
$color: resolveColor(color),
|
|
584
586
|
$thickness: thickness,
|
|
585
587
|
$ySpacing: ySpacing,
|
|
586
588
|
className,
|
|
@@ -2002,7 +2004,7 @@ var Initials = styled18.span`
|
|
|
2002
2004
|
line-height: 1;
|
|
2003
2005
|
user-select: none;
|
|
2004
2006
|
`;
|
|
2005
|
-
var
|
|
2007
|
+
var resolveColor2 = (token, fallback) => {
|
|
2006
2008
|
if (!token) return fallback;
|
|
2007
2009
|
return colors[token] || token;
|
|
2008
2010
|
};
|
|
@@ -2018,8 +2020,8 @@ var Avatar = ({
|
|
|
2018
2020
|
}) => {
|
|
2019
2021
|
var _a, _b, _c;
|
|
2020
2022
|
const [hasImageError, setHasImageError] = useState5(false);
|
|
2021
|
-
const resolvedBackground =
|
|
2022
|
-
const resolvedText =
|
|
2023
|
+
const resolvedBackground = resolveColor2(backgroundColor, colors.grey_300);
|
|
2024
|
+
const resolvedText = resolveColor2(textColor, colors.dark);
|
|
2023
2025
|
const initials = getInitials(name);
|
|
2024
2026
|
const sizePx = `${size}px`;
|
|
2025
2027
|
const borderRadius = shape === "circle" ? "50%" : "4px";
|