allaw-ui 5.0.2 → 5.0.3
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/tags/InlineTag.d.ts +1 -0
- package/dist/components/atoms/tags/InlineTag.js +19 -3
- package/dist/components/atoms/tags/InlineTag.stories.d.ts +31 -4
- package/dist/components/atoms/tags/InlineTag.stories.js +43 -0
- package/dist/components/atoms/tags/inlineTag.module.css +45 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export interface InlineTagProps {
|
|
|
5
5
|
weight?: "medium" | "semiBold" | "bold";
|
|
6
6
|
backgroundColor?: "bleu-allaw" | "actions-error" | "actions-valid" | "actions-warning" | "mid-grey";
|
|
7
7
|
startIcon?: string;
|
|
8
|
+
style?: "default" | "border";
|
|
8
9
|
}
|
|
9
10
|
declare const InlineTag: React.FC<InlineTagProps>;
|
|
10
11
|
export default InlineTag;
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import TinyInfo from "../typography/TinyInfo";
|
|
4
4
|
import styles from "./inlineTag.module.css";
|
|
5
5
|
var InlineTag = function (_a) {
|
|
6
|
-
var text = _a.text, _b = _a.size, size = _b === void 0 ? "14" : _b, _c = _a.weight, weight = _c === void 0 ? "medium" : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? "bleu-allaw" : _d, startIcon = _a.startIcon;
|
|
6
|
+
var text = _a.text, _b = _a.size, size = _b === void 0 ? "14" : _b, _c = _a.weight, weight = _c === void 0 ? "medium" : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? "bleu-allaw" : _d, startIcon = _a.startIcon, _e = _a.style, style = _e === void 0 ? "default" : _e;
|
|
7
7
|
var variant;
|
|
8
8
|
if (weight === "bold") {
|
|
9
9
|
variant = "bold".concat(size);
|
|
@@ -14,7 +14,23 @@ var InlineTag = function (_a) {
|
|
|
14
14
|
else {
|
|
15
15
|
variant = "".concat(weight).concat(size);
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
var isBorderStyle = style === "border";
|
|
18
|
+
var styleClass = isBorderStyle
|
|
19
|
+
? styles["border-".concat(backgroundColor)]
|
|
20
|
+
: styles["bg-".concat(backgroundColor)];
|
|
21
|
+
// Mapping des couleurs pour TinyInfo
|
|
22
|
+
var getTextColor = function () {
|
|
23
|
+
if (!isBorderStyle)
|
|
24
|
+
return "pure-white";
|
|
25
|
+
// actions-warning n'est pas supporté par TinyInfo, on utilise une classe CSS custom
|
|
26
|
+
if (backgroundColor === "actions-warning")
|
|
27
|
+
return undefined;
|
|
28
|
+
// Pour les autres couleurs, on peut les utiliser directement
|
|
29
|
+
return backgroundColor;
|
|
30
|
+
};
|
|
31
|
+
return (React.createElement("div", { className: "".concat(styles.inlineTag, " ").concat(styleClass) },
|
|
32
|
+
React.createElement(TinyInfo, { text: text, variant: variant, color: getTextColor(), startIcon: startIcon, className: isBorderStyle && backgroundColor === "actions-warning"
|
|
33
|
+
? styles["color-".concat(backgroundColor)]
|
|
34
|
+
: undefined })));
|
|
19
35
|
};
|
|
20
36
|
export default InlineTag;
|
|
@@ -49,13 +49,24 @@ declare namespace _default {
|
|
|
49
49
|
let description_4: string;
|
|
50
50
|
export { description_4 as description };
|
|
51
51
|
}
|
|
52
|
+
namespace style {
|
|
53
|
+
export namespace control_5 {
|
|
54
|
+
let type_5: string;
|
|
55
|
+
export { type_5 as type };
|
|
56
|
+
}
|
|
57
|
+
export { control_5 as control };
|
|
58
|
+
let options_3: string[];
|
|
59
|
+
export { options_3 as options };
|
|
60
|
+
let description_5: string;
|
|
61
|
+
export { description_5 as description };
|
|
62
|
+
}
|
|
52
63
|
}
|
|
53
64
|
export namespace parameters {
|
|
54
65
|
namespace docs {
|
|
55
|
-
export namespace
|
|
66
|
+
export namespace description_6 {
|
|
56
67
|
let component: string;
|
|
57
68
|
}
|
|
58
|
-
export {
|
|
69
|
+
export { description_6 as description };
|
|
59
70
|
}
|
|
60
71
|
}
|
|
61
72
|
}
|
|
@@ -65,18 +76,34 @@ export const WithIcon: any;
|
|
|
65
76
|
export const Error: any;
|
|
66
77
|
export const Warning: any;
|
|
67
78
|
export const Small: any;
|
|
79
|
+
export const BorderStyle: any;
|
|
80
|
+
export const BorderWithIcon: any;
|
|
68
81
|
export function AllVariants(): React.JSX.Element;
|
|
69
82
|
export namespace AllVariants {
|
|
70
83
|
export namespace parameters_1 {
|
|
71
84
|
export namespace docs_1 {
|
|
72
|
-
export namespace
|
|
85
|
+
export namespace description_7 {
|
|
73
86
|
let story: string;
|
|
74
87
|
}
|
|
75
|
-
export {
|
|
88
|
+
export { description_7 as description };
|
|
76
89
|
}
|
|
77
90
|
export { docs_1 as docs };
|
|
78
91
|
}
|
|
79
92
|
export { parameters_1 as parameters };
|
|
80
93
|
}
|
|
94
|
+
export function AllBorderVariants(): React.JSX.Element;
|
|
95
|
+
export namespace AllBorderVariants {
|
|
96
|
+
export namespace parameters_2 {
|
|
97
|
+
export namespace docs_2 {
|
|
98
|
+
export namespace description_8 {
|
|
99
|
+
let story_1: string;
|
|
100
|
+
export { story_1 as story };
|
|
101
|
+
}
|
|
102
|
+
export { description_8 as description };
|
|
103
|
+
}
|
|
104
|
+
export { docs_2 as docs };
|
|
105
|
+
}
|
|
106
|
+
export { parameters_2 as parameters };
|
|
107
|
+
}
|
|
81
108
|
import InlineTag from "./InlineTag";
|
|
82
109
|
import React from "react";
|
|
@@ -45,6 +45,11 @@ export default {
|
|
|
45
45
|
control: { type: "text" },
|
|
46
46
|
description: "Icône à afficher au début (classe CSS)",
|
|
47
47
|
},
|
|
48
|
+
style: {
|
|
49
|
+
control: { type: "select" },
|
|
50
|
+
options: ["default", "border"],
|
|
51
|
+
description: "Style du tag (default: fond coloré, border: bordure colorée)",
|
|
52
|
+
},
|
|
48
53
|
},
|
|
49
54
|
parameters: {
|
|
50
55
|
docs: {
|
|
@@ -93,6 +98,23 @@ Small.args = {
|
|
|
93
98
|
weight: "medium",
|
|
94
99
|
backgroundColor: "mid-grey",
|
|
95
100
|
};
|
|
101
|
+
export var BorderStyle = Template.bind({});
|
|
102
|
+
BorderStyle.args = {
|
|
103
|
+
text: "Style Border",
|
|
104
|
+
size: "14",
|
|
105
|
+
weight: "medium",
|
|
106
|
+
backgroundColor: "bleu-allaw",
|
|
107
|
+
style: "border",
|
|
108
|
+
};
|
|
109
|
+
export var BorderWithIcon = Template.bind({});
|
|
110
|
+
BorderWithIcon.args = {
|
|
111
|
+
text: "Certifié",
|
|
112
|
+
size: "14",
|
|
113
|
+
weight: "semiBold",
|
|
114
|
+
backgroundColor: "actions-valid",
|
|
115
|
+
startIcon: "allaw-icon-check",
|
|
116
|
+
style: "border",
|
|
117
|
+
};
|
|
96
118
|
export var AllVariants = function () { return (React.createElement("div", { style: {
|
|
97
119
|
display: "flex",
|
|
98
120
|
flexWrap: "wrap",
|
|
@@ -114,3 +136,24 @@ AllVariants.parameters = {
|
|
|
114
136
|
},
|
|
115
137
|
},
|
|
116
138
|
};
|
|
139
|
+
export var AllBorderVariants = function () { return (React.createElement("div", { style: {
|
|
140
|
+
display: "flex",
|
|
141
|
+
flexWrap: "wrap",
|
|
142
|
+
gap: "12px",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
} },
|
|
145
|
+
React.createElement(InlineTag, { text: "Bleu Allaw", backgroundColor: "bleu-allaw", style: "border" }),
|
|
146
|
+
React.createElement(InlineTag, { text: "Succ\u00E8s", backgroundColor: "actions-valid", startIcon: "allaw-icon-check", style: "border" }),
|
|
147
|
+
React.createElement(InlineTag, { text: "Erreur", backgroundColor: "actions-error", startIcon: "allaw-icon-alert", style: "border" }),
|
|
148
|
+
React.createElement(InlineTag, { text: "Attention", backgroundColor: "actions-warning", startIcon: "allaw-icon-warning", style: "border" }),
|
|
149
|
+
React.createElement(InlineTag, { text: "Neutre", backgroundColor: "mid-grey", style: "border" }),
|
|
150
|
+
React.createElement(InlineTag, { text: "Petit 12px", size: "12", backgroundColor: "bleu-allaw", style: "border" }),
|
|
151
|
+
React.createElement(InlineTag, { text: "Gras", weight: "bold", backgroundColor: "actions-valid", style: "border" }),
|
|
152
|
+
React.createElement(InlineTag, { text: "Semi-Bold", weight: "semiBold", backgroundColor: "bleu-allaw", style: "border" }))); };
|
|
153
|
+
AllBorderVariants.parameters = {
|
|
154
|
+
docs: {
|
|
155
|
+
description: {
|
|
156
|
+
story: "Toutes les variantes du composant InlineTag avec le style border.",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
};
|
|
@@ -26,3 +26,48 @@
|
|
|
26
26
|
.bg-mid-grey {
|
|
27
27
|
background-color: #728ea7;
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
.border-bleu-allaw {
|
|
31
|
+
background-color: #ffffff;
|
|
32
|
+
border: 1px solid #25beeb;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.border-actions-error {
|
|
36
|
+
background-color: #ffffff;
|
|
37
|
+
border: 1px solid #e15151;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.border-actions-valid {
|
|
41
|
+
background-color: #ffffff;
|
|
42
|
+
border: 1px solid #29a36a;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.border-actions-warning {
|
|
46
|
+
background-color: #ffffff;
|
|
47
|
+
border: 1px solid #ffc857;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.border-mid-grey {
|
|
51
|
+
background-color: #ffffff;
|
|
52
|
+
border: 1px solid #728ea7;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.color-bleu-allaw {
|
|
56
|
+
color: #25beeb;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.color-actions-error {
|
|
60
|
+
color: #e15151;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.color-actions-valid {
|
|
64
|
+
color: #29a36a;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.color-actions-warning {
|
|
68
|
+
color: #ffc857 !important;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.color-mid-grey {
|
|
72
|
+
color: #728ea7;
|
|
73
|
+
}
|