allaw-ui 0.0.304 → 0.0.306
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/typography/Heading.css +11 -2
- package/dist/components/atoms/typography/Heading.d.ts +1 -0
- package/dist/components/atoms/typography/Heading.js +2 -2
- package/dist/components/atoms/typography/Paragraph.d.ts +2 -0
- package/dist/components/atoms/typography/Paragraph.js +17 -2
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
font-family: Poppins;
|
|
5
5
|
font-style: normal;
|
|
6
6
|
line-height: normal;
|
|
7
|
-
text-align: center;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.heading.h1 {
|
|
@@ -65,4 +64,14 @@
|
|
|
65
64
|
color: var(--pure-white);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
|
|
67
|
+
.heading.align-left {
|
|
68
|
+
text-align: left;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.heading.align-justify {
|
|
72
|
+
text-align: justify;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.heading.align-center {
|
|
76
|
+
text-align: center;
|
|
77
|
+
}
|
|
@@ -4,6 +4,7 @@ export interface HeadingProps {
|
|
|
4
4
|
variant: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "h7";
|
|
5
5
|
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
|
|
6
6
|
text: React.ReactNode;
|
|
7
|
+
align?: "left" | "justify" | "center";
|
|
7
8
|
}
|
|
8
9
|
declare const Heading: React.FC<HeadingProps>;
|
|
9
10
|
export default Heading;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Heading.css";
|
|
3
3
|
var Heading = function (_a) {
|
|
4
|
-
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text;
|
|
5
|
-
return React.createElement("div", { className: "heading ".concat(variant, " color-").concat(color) }, text);
|
|
4
|
+
var variant = _a.variant, _b = _a.color, color = _b === void 0 ? "pure-white" : _b, text = _a.text, _c = _a.align, align = _c === void 0 ? "center" : _c;
|
|
5
|
+
return (React.createElement("div", { className: "heading ".concat(variant, " color-").concat(color, " align-").concat(align) }, text));
|
|
6
6
|
};
|
|
7
7
|
export default Heading;
|
|
@@ -4,6 +4,8 @@ export interface ParagraphProps {
|
|
|
4
4
|
variant: "bold" | "semiBold" | "medium";
|
|
5
5
|
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white";
|
|
6
6
|
text: string;
|
|
7
|
+
maxLines?: number;
|
|
8
|
+
maxChars?: number;
|
|
7
9
|
}
|
|
8
10
|
declare const Paragraph: React.FC<ParagraphProps>;
|
|
9
11
|
export default Paragraph;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Paragraph.css";
|
|
3
3
|
var Paragraph = function (_a) {
|
|
4
|
-
var variant = _a.variant, color = _a.color, text = _a.text;
|
|
5
|
-
|
|
4
|
+
var variant = _a.variant, color = _a.color, text = _a.text, maxLines = _a.maxLines, maxChars = _a.maxChars;
|
|
5
|
+
// Fonction pour tronquer le texte en fonction du nombre maximum de caractères
|
|
6
|
+
var truncateText = function (text, maxChars) {
|
|
7
|
+
if (text.length <= maxChars)
|
|
8
|
+
return text;
|
|
9
|
+
return text.slice(0, maxChars) + "...";
|
|
10
|
+
};
|
|
11
|
+
// Tronquer le texte si maxChars est défini
|
|
12
|
+
var truncatedText = maxChars ? truncateText(text, maxChars) : text;
|
|
13
|
+
return (React.createElement("p", { className: "paragraph ".concat(variant, " ").concat(color ? "color-".concat(color) : ""), style: maxLines
|
|
14
|
+
? {
|
|
15
|
+
WebkitLineClamp: maxLines,
|
|
16
|
+
display: "-webkit-box",
|
|
17
|
+
WebkitBoxOrient: "vertical",
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
}
|
|
20
|
+
: {}, dangerouslySetInnerHTML: { __html: truncatedText } }));
|
|
6
21
|
};
|
|
7
22
|
export default Paragraph;
|