design-zystem 1.0.351 → 1.0.352
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/ui/index.d.mts +7 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.js +31 -9
- package/dist/ui/index.mjs +31 -9
- package/package.json +1 -1
package/dist/ui/index.d.mts
CHANGED
|
@@ -50,6 +50,7 @@ declare const Layout: react.ForwardRefExoticComponent<LayoutProps & react.RefAtt
|
|
|
50
50
|
*/
|
|
51
51
|
declare const COLOR_TOKENS: readonly ["blue-700", "blue-900", "blue-950", "red-900", "red-500", "green-700", "green-100", "grey-600", "yellow-500", "yellow-300", "yellow-200", "orange-600", "purple-700"];
|
|
52
52
|
type ColorToken = (typeof COLOR_TOKENS)[number];
|
|
53
|
+
/** Couleur brute hors palette fermée — cf. `Badge`/`Icon`/`Text` `backgroundColor`/`textColor`. */
|
|
53
54
|
type HexColor = `#${string}`;
|
|
54
55
|
|
|
55
56
|
declare const boxVariants: (props?: ({
|
|
@@ -97,6 +98,8 @@ interface TextProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>, VariantP
|
|
|
97
98
|
as?: ElementType;
|
|
98
99
|
/** Pour `as="label"`. */
|
|
99
100
|
htmlFor?: string;
|
|
101
|
+
/** Contourne la palette fermée `color` avec une couleur brute (ex: statut métier). */
|
|
102
|
+
hexColor?: HexColor;
|
|
100
103
|
}
|
|
101
104
|
declare const Text: react.ForwardRefExoticComponent<TextProps & react.RefAttributes<HTMLElement>>;
|
|
102
105
|
|
|
@@ -119,6 +122,8 @@ interface IconProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onClick
|
|
|
119
122
|
family?: IconFamily;
|
|
120
123
|
size?: IconSize;
|
|
121
124
|
color?: IconColor;
|
|
125
|
+
/** Contourne la palette fermée `color` avec une couleur brute (ex: statut métier). */
|
|
126
|
+
hexColor?: HexColor;
|
|
122
127
|
className?: string;
|
|
123
128
|
onClick?: () => void;
|
|
124
129
|
/** Action indisponible : icône grisée, clic inerte. N'a de sens qu'avec `onClick`. */
|
|
@@ -450,6 +455,8 @@ interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'>, Var
|
|
|
450
455
|
pointer?: boolean;
|
|
451
456
|
pulse?: boolean;
|
|
452
457
|
fullWidth?: boolean;
|
|
458
|
+
/** Tronque le contenu avec ellipsis au-delà de N caractères (largeur en `ch`). */
|
|
459
|
+
maxChars?: number;
|
|
453
460
|
/** Rend l'enfant à la place du `span` (un `button` ou un `a` pour un badge cliquable) en lui transmettant classes et props. */
|
|
454
461
|
asChild?: boolean;
|
|
455
462
|
}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare const Layout: react.ForwardRefExoticComponent<LayoutProps & react.RefAtt
|
|
|
50
50
|
*/
|
|
51
51
|
declare const COLOR_TOKENS: readonly ["blue-700", "blue-900", "blue-950", "red-900", "red-500", "green-700", "green-100", "grey-600", "yellow-500", "yellow-300", "yellow-200", "orange-600", "purple-700"];
|
|
52
52
|
type ColorToken = (typeof COLOR_TOKENS)[number];
|
|
53
|
+
/** Couleur brute hors palette fermée — cf. `Badge`/`Icon`/`Text` `backgroundColor`/`textColor`. */
|
|
53
54
|
type HexColor = `#${string}`;
|
|
54
55
|
|
|
55
56
|
declare const boxVariants: (props?: ({
|
|
@@ -97,6 +98,8 @@ interface TextProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>, VariantP
|
|
|
97
98
|
as?: ElementType;
|
|
98
99
|
/** Pour `as="label"`. */
|
|
99
100
|
htmlFor?: string;
|
|
101
|
+
/** Contourne la palette fermée `color` avec une couleur brute (ex: statut métier). */
|
|
102
|
+
hexColor?: HexColor;
|
|
100
103
|
}
|
|
101
104
|
declare const Text: react.ForwardRefExoticComponent<TextProps & react.RefAttributes<HTMLElement>>;
|
|
102
105
|
|
|
@@ -119,6 +122,8 @@ interface IconProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'onClick
|
|
|
119
122
|
family?: IconFamily;
|
|
120
123
|
size?: IconSize;
|
|
121
124
|
color?: IconColor;
|
|
125
|
+
/** Contourne la palette fermée `color` avec une couleur brute (ex: statut métier). */
|
|
126
|
+
hexColor?: HexColor;
|
|
122
127
|
className?: string;
|
|
123
128
|
onClick?: () => void;
|
|
124
129
|
/** Action indisponible : icône grisée, clic inerte. N'a de sens qu'avec `onClick`. */
|
|
@@ -450,6 +455,8 @@ interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'>, Var
|
|
|
450
455
|
pointer?: boolean;
|
|
451
456
|
pulse?: boolean;
|
|
452
457
|
fullWidth?: boolean;
|
|
458
|
+
/** Tronque le contenu avec ellipsis au-delà de N caractères (largeur en `ch`). */
|
|
459
|
+
maxChars?: number;
|
|
453
460
|
/** Rend l'enfant à la place du `span` (un `button` ou un `a` pour un badge cliquable) en lui transmettant classes et props. */
|
|
454
461
|
asChild?: boolean;
|
|
455
462
|
}
|
package/dist/ui/index.js
CHANGED
|
@@ -701,7 +701,9 @@ var Text = (0, import_react4.forwardRef)(
|
|
|
701
701
|
align,
|
|
702
702
|
lineClamp,
|
|
703
703
|
italic,
|
|
704
|
-
className
|
|
704
|
+
className,
|
|
705
|
+
hexColor,
|
|
706
|
+
style
|
|
705
707
|
} = _b, props = __objRest(_b, [
|
|
706
708
|
"as",
|
|
707
709
|
"size",
|
|
@@ -710,16 +712,26 @@ var Text = (0, import_react4.forwardRef)(
|
|
|
710
712
|
"align",
|
|
711
713
|
"lineClamp",
|
|
712
714
|
"italic",
|
|
713
|
-
"className"
|
|
715
|
+
"className",
|
|
716
|
+
"hexColor",
|
|
717
|
+
"style"
|
|
714
718
|
]);
|
|
715
719
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
716
720
|
Component,
|
|
717
721
|
__spreadValues({
|
|
718
722
|
ref,
|
|
719
723
|
className: cn(
|
|
720
|
-
textVariants({
|
|
724
|
+
textVariants({
|
|
725
|
+
size,
|
|
726
|
+
weight,
|
|
727
|
+
color: hexColor ? void 0 : color,
|
|
728
|
+
align,
|
|
729
|
+
lineClamp,
|
|
730
|
+
italic
|
|
731
|
+
}),
|
|
721
732
|
className
|
|
722
|
-
)
|
|
733
|
+
),
|
|
734
|
+
style: hexColor ? __spreadValues({ color: hexColor }, style) : style
|
|
723
735
|
}, props)
|
|
724
736
|
);
|
|
725
737
|
}
|
|
@@ -825,6 +837,7 @@ var Icon = (0, import_react7.forwardRef)(
|
|
|
825
837
|
family = "regular",
|
|
826
838
|
size = "m",
|
|
827
839
|
color,
|
|
840
|
+
hexColor,
|
|
828
841
|
className,
|
|
829
842
|
onClick,
|
|
830
843
|
disabled = false
|
|
@@ -833,14 +846,16 @@ var Icon = (0, import_react7.forwardRef)(
|
|
|
833
846
|
"family",
|
|
834
847
|
"size",
|
|
835
848
|
"color",
|
|
849
|
+
"hexColor",
|
|
836
850
|
"className",
|
|
837
851
|
"onClick",
|
|
838
852
|
"disabled"
|
|
839
853
|
]);
|
|
840
854
|
const glyphClassName = cn(
|
|
841
|
-
disabled ? "text-grey-500" : color ? COLOR_CLASS[color] : "text-neutral-800",
|
|
855
|
+
disabled ? "text-grey-500" : hexColor ? void 0 : color ? COLOR_CLASS[color] : "text-neutral-800",
|
|
842
856
|
className
|
|
843
857
|
);
|
|
858
|
+
const glyphStyle = !disabled && hexColor ? { color: hexColor } : void 0;
|
|
844
859
|
if (!onClick && !disabled) {
|
|
845
860
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
846
861
|
FaIcon,
|
|
@@ -849,7 +864,8 @@ var Icon = (0, import_react7.forwardRef)(
|
|
|
849
864
|
name,
|
|
850
865
|
family,
|
|
851
866
|
size: SIZE_PX[size],
|
|
852
|
-
className: glyphClassName
|
|
867
|
+
className: glyphClassName,
|
|
868
|
+
style: glyphStyle
|
|
853
869
|
}, rest)
|
|
854
870
|
);
|
|
855
871
|
}
|
|
@@ -871,7 +887,8 @@ var Icon = (0, import_react7.forwardRef)(
|
|
|
871
887
|
name,
|
|
872
888
|
family,
|
|
873
889
|
size: SIZE_PX[size],
|
|
874
|
-
className: glyphClassName
|
|
890
|
+
className: glyphClassName,
|
|
891
|
+
style: glyphStyle
|
|
875
892
|
}
|
|
876
893
|
)
|
|
877
894
|
})
|
|
@@ -1869,7 +1886,7 @@ var import_react_slot = require("@radix-ui/react-slot");
|
|
|
1869
1886
|
var import_class_variance_authority10 = require("class-variance-authority");
|
|
1870
1887
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1871
1888
|
var badgeVariants = (0, import_class_variance_authority10.cva)(
|
|
1872
|
-
"inline-flex w-fit items-center overflow-hidden whitespace-nowrap font-semibold",
|
|
1889
|
+
"inline-flex w-fit items-center overflow-hidden text-ellipsis whitespace-nowrap font-semibold",
|
|
1873
1890
|
{
|
|
1874
1891
|
variants: {
|
|
1875
1892
|
size: {
|
|
@@ -1899,6 +1916,7 @@ var Badge = (0, import_react18.forwardRef)(
|
|
|
1899
1916
|
pointer = false,
|
|
1900
1917
|
pulse = false,
|
|
1901
1918
|
fullWidth = false,
|
|
1919
|
+
maxChars,
|
|
1902
1920
|
asChild = false,
|
|
1903
1921
|
className,
|
|
1904
1922
|
style
|
|
@@ -1912,6 +1930,7 @@ var Badge = (0, import_react18.forwardRef)(
|
|
|
1912
1930
|
"pointer",
|
|
1913
1931
|
"pulse",
|
|
1914
1932
|
"fullWidth",
|
|
1933
|
+
"maxChars",
|
|
1915
1934
|
"asChild",
|
|
1916
1935
|
"className",
|
|
1917
1936
|
"style"
|
|
@@ -1929,7 +1948,10 @@ var Badge = (0, import_react18.forwardRef)(
|
|
|
1929
1948
|
pulse && "animate-[badge-pulse_2s_ease-in-out_infinite] motion-reduce:animate-none",
|
|
1930
1949
|
className
|
|
1931
1950
|
),
|
|
1932
|
-
style: __spreadValues({
|
|
1951
|
+
style: __spreadValues(__spreadValues({
|
|
1952
|
+
backgroundColor,
|
|
1953
|
+
color: textColor
|
|
1954
|
+
}, maxChars ? { maxWidth: `${maxChars}ch` } : {}), style)
|
|
1933
1955
|
}, props)
|
|
1934
1956
|
);
|
|
1935
1957
|
}
|
package/dist/ui/index.mjs
CHANGED
|
@@ -512,7 +512,9 @@ var Text = forwardRef4(
|
|
|
512
512
|
align,
|
|
513
513
|
lineClamp,
|
|
514
514
|
italic,
|
|
515
|
-
className
|
|
515
|
+
className,
|
|
516
|
+
hexColor,
|
|
517
|
+
style
|
|
516
518
|
} = _b, props = __objRest(_b, [
|
|
517
519
|
"as",
|
|
518
520
|
"size",
|
|
@@ -521,16 +523,26 @@ var Text = forwardRef4(
|
|
|
521
523
|
"align",
|
|
522
524
|
"lineClamp",
|
|
523
525
|
"italic",
|
|
524
|
-
"className"
|
|
526
|
+
"className",
|
|
527
|
+
"hexColor",
|
|
528
|
+
"style"
|
|
525
529
|
]);
|
|
526
530
|
return /* @__PURE__ */ jsx5(
|
|
527
531
|
Component,
|
|
528
532
|
__spreadValues({
|
|
529
533
|
ref,
|
|
530
534
|
className: cn(
|
|
531
|
-
textVariants({
|
|
535
|
+
textVariants({
|
|
536
|
+
size,
|
|
537
|
+
weight,
|
|
538
|
+
color: hexColor ? void 0 : color,
|
|
539
|
+
align,
|
|
540
|
+
lineClamp,
|
|
541
|
+
italic
|
|
542
|
+
}),
|
|
532
543
|
className
|
|
533
|
-
)
|
|
544
|
+
),
|
|
545
|
+
style: hexColor ? __spreadValues({ color: hexColor }, style) : style
|
|
534
546
|
}, props)
|
|
535
547
|
);
|
|
536
548
|
}
|
|
@@ -636,6 +648,7 @@ var Icon = forwardRef7(
|
|
|
636
648
|
family = "regular",
|
|
637
649
|
size = "m",
|
|
638
650
|
color,
|
|
651
|
+
hexColor,
|
|
639
652
|
className,
|
|
640
653
|
onClick,
|
|
641
654
|
disabled = false
|
|
@@ -644,14 +657,16 @@ var Icon = forwardRef7(
|
|
|
644
657
|
"family",
|
|
645
658
|
"size",
|
|
646
659
|
"color",
|
|
660
|
+
"hexColor",
|
|
647
661
|
"className",
|
|
648
662
|
"onClick",
|
|
649
663
|
"disabled"
|
|
650
664
|
]);
|
|
651
665
|
const glyphClassName = cn(
|
|
652
|
-
disabled ? "text-grey-500" : color ? COLOR_CLASS[color] : "text-neutral-800",
|
|
666
|
+
disabled ? "text-grey-500" : hexColor ? void 0 : color ? COLOR_CLASS[color] : "text-neutral-800",
|
|
653
667
|
className
|
|
654
668
|
);
|
|
669
|
+
const glyphStyle = !disabled && hexColor ? { color: hexColor } : void 0;
|
|
655
670
|
if (!onClick && !disabled) {
|
|
656
671
|
return /* @__PURE__ */ jsx8(
|
|
657
672
|
FaIcon,
|
|
@@ -660,7 +675,8 @@ var Icon = forwardRef7(
|
|
|
660
675
|
name,
|
|
661
676
|
family,
|
|
662
677
|
size: SIZE_PX[size],
|
|
663
|
-
className: glyphClassName
|
|
678
|
+
className: glyphClassName,
|
|
679
|
+
style: glyphStyle
|
|
664
680
|
}, rest)
|
|
665
681
|
);
|
|
666
682
|
}
|
|
@@ -682,7 +698,8 @@ var Icon = forwardRef7(
|
|
|
682
698
|
name,
|
|
683
699
|
family,
|
|
684
700
|
size: SIZE_PX[size],
|
|
685
|
-
className: glyphClassName
|
|
701
|
+
className: glyphClassName,
|
|
702
|
+
style: glyphStyle
|
|
686
703
|
}
|
|
687
704
|
)
|
|
688
705
|
})
|
|
@@ -1686,7 +1703,7 @@ import { Slot } from "@radix-ui/react-slot";
|
|
|
1686
1703
|
import { cva as cva10 } from "class-variance-authority";
|
|
1687
1704
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1688
1705
|
var badgeVariants = cva10(
|
|
1689
|
-
"inline-flex w-fit items-center overflow-hidden whitespace-nowrap font-semibold",
|
|
1706
|
+
"inline-flex w-fit items-center overflow-hidden text-ellipsis whitespace-nowrap font-semibold",
|
|
1690
1707
|
{
|
|
1691
1708
|
variants: {
|
|
1692
1709
|
size: {
|
|
@@ -1716,6 +1733,7 @@ var Badge = forwardRef16(
|
|
|
1716
1733
|
pointer = false,
|
|
1717
1734
|
pulse = false,
|
|
1718
1735
|
fullWidth = false,
|
|
1736
|
+
maxChars,
|
|
1719
1737
|
asChild = false,
|
|
1720
1738
|
className,
|
|
1721
1739
|
style
|
|
@@ -1729,6 +1747,7 @@ var Badge = forwardRef16(
|
|
|
1729
1747
|
"pointer",
|
|
1730
1748
|
"pulse",
|
|
1731
1749
|
"fullWidth",
|
|
1750
|
+
"maxChars",
|
|
1732
1751
|
"asChild",
|
|
1733
1752
|
"className",
|
|
1734
1753
|
"style"
|
|
@@ -1746,7 +1765,10 @@ var Badge = forwardRef16(
|
|
|
1746
1765
|
pulse && "animate-[badge-pulse_2s_ease-in-out_infinite] motion-reduce:animate-none",
|
|
1747
1766
|
className
|
|
1748
1767
|
),
|
|
1749
|
-
style: __spreadValues({
|
|
1768
|
+
style: __spreadValues(__spreadValues({
|
|
1769
|
+
backgroundColor,
|
|
1770
|
+
color: textColor
|
|
1771
|
+
}, maxChars ? { maxWidth: `${maxChars}ch` } : {}), style)
|
|
1750
1772
|
}, props)
|
|
1751
1773
|
);
|
|
1752
1774
|
}
|