allaw-ui 3.3.5 → 3.3.6
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.
|
@@ -3,7 +3,7 @@ import Link from "next/link";
|
|
|
3
3
|
import "./TertiaryButton.css";
|
|
4
4
|
import "../../../styles/global.css";
|
|
5
5
|
var TertiaryButton = function (_a) {
|
|
6
|
-
var startIcon = _a.startIcon, label = _a.label, _b = _a.variant, variant = _b === void 0 ? false : _b, href = _a.href, onClick = _a.onClick, _c = _a.color, color = _c === void 0 ? "noir" : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d;
|
|
6
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, label = _a.label, _b = _a.variant, variant = _b === void 0 ? false : _b, href = _a.href, onClick = _a.onClick, _c = _a.color, color = _c === void 0 ? "noir" : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d;
|
|
7
7
|
var buttonClass = "tertiary-button tertiary-button-".concat(color, " ").concat(variant ? "tertiary-button-variant" : "tertiary-button-default", " ").concat(isDisabled ? "tertiary-button-disabled" : "");
|
|
8
8
|
var handleClick = function (e) {
|
|
9
9
|
if (isDisabled) {
|
|
@@ -14,8 +14,10 @@ var TertiaryButton = function (_a) {
|
|
|
14
14
|
};
|
|
15
15
|
return href ? (React.createElement(Link, { href: href, className: buttonClass, onClick: handleClick },
|
|
16
16
|
startIcon && React.createElement("span", { className: "tertiary-button-icon ".concat(startIcon) }),
|
|
17
|
-
React.createElement("span", { className: "tertiary-button-label" }, label)
|
|
17
|
+
React.createElement("span", { className: "tertiary-button-label" }, label),
|
|
18
|
+
endIcon && React.createElement("span", { className: "tertiary-button-icon ".concat(endIcon) }))) : (React.createElement("button", { type: "button", className: buttonClass, onClick: handleClick, disabled: isDisabled },
|
|
18
19
|
startIcon && React.createElement("span", { className: "tertiary-button-icon ".concat(startIcon) }),
|
|
19
|
-
React.createElement("span", { className: "tertiary-button-label" }, label)
|
|
20
|
+
React.createElement("span", { className: "tertiary-button-label" }, label),
|
|
21
|
+
endIcon && React.createElement("span", { className: "tertiary-button-icon ".concat(endIcon) })));
|
|
20
22
|
};
|
|
21
23
|
export default TertiaryButton;
|
|
@@ -13,27 +13,34 @@ declare namespace _default {
|
|
|
13
13
|
let type: string;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
export namespace
|
|
16
|
+
export namespace endIcon {
|
|
17
17
|
export namespace control_1 {
|
|
18
18
|
let type_1: string;
|
|
19
19
|
export { type_1 as type };
|
|
20
20
|
}
|
|
21
21
|
export { control_1 as control };
|
|
22
22
|
}
|
|
23
|
-
export namespace
|
|
23
|
+
export namespace variant {
|
|
24
24
|
export namespace control_2 {
|
|
25
25
|
let type_2: string;
|
|
26
26
|
export { type_2 as type };
|
|
27
27
|
}
|
|
28
28
|
export { control_2 as control };
|
|
29
|
-
export let options: string[];
|
|
30
29
|
}
|
|
31
|
-
export namespace
|
|
30
|
+
export namespace color {
|
|
32
31
|
export namespace control_3 {
|
|
33
32
|
let type_3: string;
|
|
34
33
|
export { type_3 as type };
|
|
35
34
|
}
|
|
36
35
|
export { control_3 as control };
|
|
36
|
+
export let options: string[];
|
|
37
|
+
}
|
|
38
|
+
export namespace isDisabled {
|
|
39
|
+
export namespace control_4 {
|
|
40
|
+
let type_4: string;
|
|
41
|
+
export { type_4 as type };
|
|
42
|
+
}
|
|
43
|
+
export { control_4 as control };
|
|
37
44
|
}
|
|
38
45
|
export namespace onClick_1 {
|
|
39
46
|
let action: string;
|
|
@@ -56,6 +63,8 @@ export const Default: any;
|
|
|
56
63
|
export const BlueButton: any;
|
|
57
64
|
export const ErrorButton: any;
|
|
58
65
|
export const Variant: any;
|
|
66
|
+
export const WithEndIcon: any;
|
|
67
|
+
export const WithBothIcons: any;
|
|
59
68
|
export const Disabled: any;
|
|
60
69
|
export const ColoredButton: any;
|
|
61
70
|
import TertiaryButton from "./TertiaryButton";
|
|
@@ -27,6 +27,11 @@ export default {
|
|
|
27
27
|
type: "text",
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
|
+
endIcon: {
|
|
31
|
+
control: {
|
|
32
|
+
type: "text",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
30
35
|
variant: {
|
|
31
36
|
control: {
|
|
32
37
|
type: "boolean",
|
|
@@ -94,6 +99,21 @@ Variant.args = {
|
|
|
94
99
|
color: "dark-grey",
|
|
95
100
|
isDisabled: false,
|
|
96
101
|
};
|
|
102
|
+
export var WithEndIcon = Template.bind({});
|
|
103
|
+
WithEndIcon.args = {
|
|
104
|
+
label: "Ouvrir le lien",
|
|
105
|
+
endIcon: "allaw-icon-external-link",
|
|
106
|
+
variant: false,
|
|
107
|
+
color: "bleu-allaw",
|
|
108
|
+
};
|
|
109
|
+
export var WithBothIcons = Template.bind({});
|
|
110
|
+
WithBothIcons.args = {
|
|
111
|
+
label: "Télécharger",
|
|
112
|
+
startIcon: "allaw-icon-download",
|
|
113
|
+
endIcon: "allaw-icon-chevron-right",
|
|
114
|
+
variant: false,
|
|
115
|
+
color: "noir",
|
|
116
|
+
};
|
|
97
117
|
export var Disabled = Template.bind({});
|
|
98
118
|
Disabled.args = {
|
|
99
119
|
label: "Bouton désactivé",
|