design-zystem 1.0.280 → 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.d.mts CHANGED
@@ -887,8 +887,10 @@ declare const Popover: ({ items, children, anchorRef, offsetY, align, fullWidth,
887
887
 
888
888
  interface MetricCardProps {
889
889
  icon: string;
890
- title: string;
891
- value: string | number;
890
+ /** Optionnel quand children est fourni. */
891
+ title?: string;
892
+ /** Optionnel quand children est fourni. */
893
+ value?: string | number;
892
894
  valueColor?: string;
893
895
  /** Muted secondary text shown right after the value (e.g. "17 pénalités"). */
894
896
  subtitle?: string;
@@ -897,8 +899,10 @@ interface MetricCardProps {
897
899
  contentLayout?: 'col' | 'row';
898
900
  onClick?: () => void;
899
901
  checked?: boolean;
902
+ /** Contenu libre à droite de l'icône. Remplace title/value quand fourni. */
903
+ children?: ReactNode;
900
904
  }
901
- declare const MetricCard: ({ icon, title, value, valueColor, subtitle, iconBackgroundColor, iconColor, contentLayout, onClick, checked, }: MetricCardProps) => react_jsx_runtime.JSX.Element;
905
+ declare const MetricCard: ({ icon, title, value, valueColor, subtitle, iconBackgroundColor, iconColor, contentLayout, onClick, checked, children, }: MetricCardProps) => react_jsx_runtime.JSX.Element;
902
906
 
903
907
  interface CardProps {
904
908
  children?: ReactNode;
package/dist/index.d.ts CHANGED
@@ -887,8 +887,10 @@ declare const Popover: ({ items, children, anchorRef, offsetY, align, fullWidth,
887
887
 
888
888
  interface MetricCardProps {
889
889
  icon: string;
890
- title: string;
891
- value: string | number;
890
+ /** Optionnel quand children est fourni. */
891
+ title?: string;
892
+ /** Optionnel quand children est fourni. */
893
+ value?: string | number;
892
894
  valueColor?: string;
893
895
  /** Muted secondary text shown right after the value (e.g. "17 pénalités"). */
894
896
  subtitle?: string;
@@ -897,8 +899,10 @@ interface MetricCardProps {
897
899
  contentLayout?: 'col' | 'row';
898
900
  onClick?: () => void;
899
901
  checked?: boolean;
902
+ /** Contenu libre à droite de l'icône. Remplace title/value quand fourni. */
903
+ children?: ReactNode;
900
904
  }
901
- declare const MetricCard: ({ icon, title, value, valueColor, subtitle, iconBackgroundColor, iconColor, contentLayout, onClick, checked, }: MetricCardProps) => react_jsx_runtime.JSX.Element;
905
+ declare const MetricCard: ({ icon, title, value, valueColor, subtitle, iconBackgroundColor, iconColor, contentLayout, onClick, checked, children, }: MetricCardProps) => react_jsx_runtime.JSX.Element;
902
906
 
903
907
  interface CardProps {
904
908
  children?: ReactNode;
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 resolveColor = (token, fallback) => {
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 = resolveColor(backgroundColor, colors.grey_300);
2161
- const resolvedText = resolveColor(textColor, colors.dark);
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";
@@ -5135,7 +5137,8 @@ var MetricCard = ({
5135
5137
  iconColor = "blue_950",
5136
5138
  contentLayout = "col",
5137
5139
  onClick,
5138
- checked = false
5140
+ checked = false,
5141
+ children
5139
5142
  }) => {
5140
5143
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5141
5144
  Box,
@@ -5163,7 +5166,7 @@ var MetricCard = ({
5163
5166
  children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { name: icon, size: "m", color: iconColor, family: "regular" })
5164
5167
  }
5165
5168
  ),
5166
- contentLayout === "row" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Row, { gap: "6", alignItems: "center", children: [
5169
+ children ? children : contentLayout === "row" ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Row, { gap: "6", alignItems: "center", children: [
5167
5170
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value }),
5168
5171
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Text, { size: "s", variant: "grey_600", children: title })
5169
5172
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Col, { gap: "4", children: [
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 resolveColor = (token, fallback) => {
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 = resolveColor(backgroundColor, colors.grey_300);
2022
- const resolvedText = resolveColor(textColor, colors.dark);
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";
@@ -5016,7 +5018,8 @@ var MetricCard = ({
5016
5018
  iconColor = "blue_950",
5017
5019
  contentLayout = "col",
5018
5020
  onClick,
5019
- checked = false
5021
+ checked = false,
5022
+ children
5020
5023
  }) => {
5021
5024
  return /* @__PURE__ */ jsx52(
5022
5025
  Box,
@@ -5044,7 +5047,7 @@ var MetricCard = ({
5044
5047
  children: /* @__PURE__ */ jsx52(Icon, { name: icon, size: "m", color: iconColor, family: "regular" })
5045
5048
  }
5046
5049
  ),
5047
- contentLayout === "row" ? /* @__PURE__ */ jsxs27(Row, { gap: "6", alignItems: "center", children: [
5050
+ children ? children : contentLayout === "row" ? /* @__PURE__ */ jsxs27(Row, { gap: "6", alignItems: "center", children: [
5048
5051
  /* @__PURE__ */ jsx52(Text, { size: "s", weight: "bold", variant: valueColor || "grey_600", children: value }),
5049
5052
  /* @__PURE__ */ jsx52(Text, { size: "s", variant: "grey_600", children: title })
5050
5053
  ] }) : /* @__PURE__ */ jsxs27(Col, { gap: "4", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "design-zystem",
3
- "version": "1.0.280",
3
+ "version": "1.0.282",
4
4
  "description": "A React design system of importable components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",