allaw-ui 2.5.7 → 2.5.9
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/buttons/PrimaryButton.css +22 -0
- package/dist/components/atoms/buttons/PrimaryButton.d.ts +1 -0
- package/dist/components/atoms/buttons/PrimaryButton.js +4 -4
- package/dist/components/atoms/buttons/PrimaryButton.stories.d.ts +12 -0
- package/dist/components/atoms/buttons/PrimaryButton.stories.js +13 -0
- package/dist/components/atoms/buttons/SecondaryButton.css +18 -4
- package/dist/components/atoms/buttons/SecondaryButton.d.ts +1 -0
- package/dist/components/atoms/buttons/SecondaryButton.js +4 -4
- package/dist/components/atoms/buttons/SecondaryButton.stories.d.ts +12 -0
- package/dist/components/atoms/buttons/SecondaryButton.stories.js +13 -0
- package/dist/components/atoms/inputs/Input.css +9 -3
- package/package.json +1 -1
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
text-wrap: nowrap;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.primary-button-large {
|
|
17
|
+
height: 46px;
|
|
18
|
+
padding: 1.1rem 1.4rem;
|
|
19
|
+
border-radius: 26px;
|
|
20
|
+
gap: 0.6rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
.primary-button-enabled {
|
|
17
24
|
background-color: #171e25;
|
|
18
25
|
color: white;
|
|
@@ -43,6 +50,11 @@
|
|
|
43
50
|
color: white;
|
|
44
51
|
}
|
|
45
52
|
|
|
53
|
+
.primary-button-large .primary-button-icon {
|
|
54
|
+
width: 22px;
|
|
55
|
+
height: 22px;
|
|
56
|
+
}
|
|
57
|
+
|
|
46
58
|
.primary-button-label {
|
|
47
59
|
font-family: "Open Sans", sans-serif;
|
|
48
60
|
font-weight: 500;
|
|
@@ -51,6 +63,11 @@
|
|
|
51
63
|
letter-spacing: 0em;
|
|
52
64
|
}
|
|
53
65
|
|
|
66
|
+
.primary-button-large .primary-button-label {
|
|
67
|
+
font-size: 15px;
|
|
68
|
+
line-height: 23px;
|
|
69
|
+
}
|
|
70
|
+
|
|
54
71
|
.primary-button-full-width {
|
|
55
72
|
width: 100%;
|
|
56
73
|
}
|
|
@@ -67,6 +84,11 @@
|
|
|
67
84
|
font-size: 0.9rem;
|
|
68
85
|
}
|
|
69
86
|
|
|
87
|
+
.primary-button-large .primary-button-loading-dots {
|
|
88
|
+
width: 1.35rem;
|
|
89
|
+
font-size: 1rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
70
92
|
.primary-button-warning {
|
|
71
93
|
background: var(--red-tag-dark, #e15151);
|
|
72
94
|
color: var(--pure-white, #fff);
|
|
@@ -13,6 +13,7 @@ export interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonEleme
|
|
|
13
13
|
type?: "button" | "submit" | "reset";
|
|
14
14
|
isLoading?: boolean;
|
|
15
15
|
variant?: "default" | "warning";
|
|
16
|
+
size?: "medium" | "large";
|
|
16
17
|
}
|
|
17
18
|
declare const PrimaryButton: React.ForwardRefExoticComponent<PrimaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
18
19
|
export default PrimaryButton;
|
|
@@ -61,10 +61,10 @@ import React, { forwardRef, useImperativeHandle, useState, useEffect, } from "re
|
|
|
61
61
|
import "./PrimaryButton.css";
|
|
62
62
|
import "../../../styles/global.css";
|
|
63
63
|
var PrimaryButton = forwardRef(function (_a, ref) {
|
|
64
|
-
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, variant = _a.variant, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type", "isLoading", "variant"]);
|
|
64
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, variant = _a.variant, _f = _a.size, size = _f === void 0 ? "medium" : _f, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "onClick", "fullWidth", "type", "isLoading", "variant", "size"]);
|
|
65
65
|
var buttonRef = React.useRef(null);
|
|
66
|
-
var
|
|
67
|
-
var
|
|
66
|
+
var _g = useState(false), internalIsLoading = _g[0], setInternalIsLoading = _g[1];
|
|
67
|
+
var _h = useState(""), loadingDots = _h[0], setLoadingDots = _h[1];
|
|
68
68
|
useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
69
69
|
var isButtonLoading = isLoading || internalIsLoading;
|
|
70
70
|
useEffect(function () {
|
|
@@ -108,7 +108,7 @@ var PrimaryButton = forwardRef(function (_a, ref) {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}); };
|
|
111
|
-
return (React.createElement("button", __assign({ ref: buttonRef, className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : "", " ").concat(isButtonLoading ? "primary-button-loading" : "").concat(variant === "warning" ? "primary-button-warning" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
111
|
+
return (React.createElement("button", __assign({ ref: buttonRef, className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : "", " ").concat(isButtonLoading ? "primary-button-loading" : "").concat(variant === "warning" ? "primary-button-warning" : "", " ").concat(size === "large" ? "primary-button-large" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
112
112
|
startIcon && (React.createElement("span", { className: "primary-button-icon ".concat(startIconName) })),
|
|
113
113
|
React.createElement("span", { className: "primary-button-label" }, label),
|
|
114
114
|
isButtonLoading ? (React.createElement("span", { className: "primary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) }))));
|
|
@@ -70,6 +70,15 @@ declare namespace _default {
|
|
|
70
70
|
}
|
|
71
71
|
export { control_6 as control };
|
|
72
72
|
}
|
|
73
|
+
export namespace size {
|
|
74
|
+
export namespace control_7 {
|
|
75
|
+
let type_8: string;
|
|
76
|
+
export { type_8 as type };
|
|
77
|
+
let options_2: string[];
|
|
78
|
+
export { options_2 as options };
|
|
79
|
+
}
|
|
80
|
+
export { control_7 as control };
|
|
81
|
+
}
|
|
73
82
|
}
|
|
74
83
|
export namespace parameters {
|
|
75
84
|
namespace backgrounds {
|
|
@@ -93,4 +102,7 @@ export const SubmitButton: any;
|
|
|
93
102
|
export const ResetButton: any;
|
|
94
103
|
export const AsyncButton: any;
|
|
95
104
|
export const WarningButton: any;
|
|
105
|
+
export const LargeButton: any;
|
|
106
|
+
export const LargeButtonWithIcons: any;
|
|
107
|
+
export const LargeWarningButton: any;
|
|
96
108
|
import PrimaryButton from "./PrimaryButton";
|
|
@@ -101,6 +101,12 @@ export default {
|
|
|
101
101
|
options: ["default", "warning"],
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
|
+
size: {
|
|
105
|
+
control: {
|
|
106
|
+
type: "select",
|
|
107
|
+
options: ["medium", "large"],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
104
110
|
},
|
|
105
111
|
parameters: {
|
|
106
112
|
backgrounds: {
|
|
@@ -125,6 +131,7 @@ Default.args = {
|
|
|
125
131
|
disabled: false,
|
|
126
132
|
type: "button",
|
|
127
133
|
isLoading: false,
|
|
134
|
+
size: "medium",
|
|
128
135
|
};
|
|
129
136
|
export var WithStartIcon = Template.bind({});
|
|
130
137
|
WithStartIcon.args = __assign(__assign({}, Default.args), { startIcon: true });
|
|
@@ -153,3 +160,9 @@ AsyncButton.args = __assign(__assign({}, Default.args), { label: "Async Action",
|
|
|
153
160
|
}); } });
|
|
154
161
|
export var WarningButton = Template.bind({});
|
|
155
162
|
WarningButton.args = __assign(__assign({}, Default.args), { label: "Warning", variant: "warning" });
|
|
163
|
+
export var LargeButton = Template.bind({});
|
|
164
|
+
LargeButton.args = __assign(__assign({}, Default.args), { label: "Grand Bouton", size: "large" });
|
|
165
|
+
export var LargeButtonWithIcons = Template.bind({});
|
|
166
|
+
LargeButtonWithIcons.args = __assign(__assign({}, Default.args), { label: "Grand Bouton avec Icônes", startIcon: true, endIcon: true, size: "large" });
|
|
167
|
+
export var LargeWarningButton = Template.bind({});
|
|
168
|
+
LargeWarningButton.args = __assign(__assign({}, Default.args), { label: "Grand Bouton d'Alerte", variant: "warning", size: "large" });
|
|
@@ -11,10 +11,14 @@
|
|
|
11
11
|
border-radius: 24px;
|
|
12
12
|
border: 2px solid var(--noir);
|
|
13
13
|
cursor: pointer;
|
|
14
|
-
transition:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
transition: background-color 0.2s, opacity 0.2s, color 0.2s;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.secondary-button-large {
|
|
18
|
+
height: 46px;
|
|
19
|
+
padding: 1.1rem 1.4rem;
|
|
20
|
+
border-radius: 26px;
|
|
21
|
+
gap: 0.6rem;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
.secondary-button-enabled {
|
|
@@ -53,6 +57,11 @@
|
|
|
53
57
|
transition: color 0.2s;
|
|
54
58
|
}
|
|
55
59
|
|
|
60
|
+
.secondary-button-large .secondary-button-icon {
|
|
61
|
+
width: 22px;
|
|
62
|
+
height: 22px;
|
|
63
|
+
}
|
|
64
|
+
|
|
56
65
|
.secondary-button-enabled:hover .secondary-button-icon {
|
|
57
66
|
color: var(--bleu-allaw);
|
|
58
67
|
}
|
|
@@ -65,6 +74,11 @@
|
|
|
65
74
|
letter-spacing: 0em;
|
|
66
75
|
}
|
|
67
76
|
|
|
77
|
+
.secondary-button-large .secondary-button-label {
|
|
78
|
+
font-size: 15px;
|
|
79
|
+
line-height: 23px;
|
|
80
|
+
}
|
|
81
|
+
|
|
68
82
|
/* Styles pour le mode dark */
|
|
69
83
|
.secondary-button-dark {
|
|
70
84
|
color: var(--noir);
|
|
@@ -14,6 +14,7 @@ export interface SecondaryButtonProps extends ButtonHTMLAttributes<HTMLButtonEle
|
|
|
14
14
|
fullWidth?: boolean;
|
|
15
15
|
type?: "button" | "submit" | "reset";
|
|
16
16
|
isLoading?: boolean;
|
|
17
|
+
size?: "medium" | "large";
|
|
17
18
|
}
|
|
18
19
|
declare const SecondaryButton: React.ForwardRefExoticComponent<SecondaryButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
20
|
export default SecondaryButton;
|
|
@@ -61,10 +61,10 @@ import React, { forwardRef, useImperativeHandle, useState, useEffect, } from "re
|
|
|
61
61
|
import "./SecondaryButton.css";
|
|
62
62
|
import "../../../styles/global.css";
|
|
63
63
|
var SecondaryButton = forwardRef(function (_a, ref) {
|
|
64
|
-
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.mode, mode = _c === void 0 ? "dark" : _c, _d = _a.color, color = _d === void 0 ? "noir" : _d, onClick = _a.onClick, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, _f = _a.type, type = _f === void 0 ? "button" : _f, _g = _a.isLoading, isLoading = _g === void 0 ? false : _g, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "mode", "color", "onClick", "fullWidth", "type", "isLoading"]);
|
|
64
|
+
var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.mode, mode = _c === void 0 ? "dark" : _c, _d = _a.color, color = _d === void 0 ? "noir" : _d, onClick = _a.onClick, _e = _a.fullWidth, fullWidth = _e === void 0 ? false : _e, _f = _a.type, type = _f === void 0 ? "button" : _f, _g = _a.isLoading, isLoading = _g === void 0 ? false : _g, _h = _a.size, size = _h === void 0 ? "medium" : _h, props = __rest(_a, ["startIcon", "endIcon", "startIconName", "endIconName", "label", "disabled", "mode", "color", "onClick", "fullWidth", "type", "isLoading", "size"]);
|
|
65
65
|
var buttonRef = React.useRef(null);
|
|
66
|
-
var
|
|
67
|
-
var
|
|
66
|
+
var _j = useState(false), internalIsLoading = _j[0], setInternalIsLoading = _j[1];
|
|
67
|
+
var _k = useState(""), loadingDots = _k[0], setLoadingDots = _k[1];
|
|
68
68
|
useImperativeHandle(ref, function () { return buttonRef.current; });
|
|
69
69
|
var isButtonLoading = isLoading || internalIsLoading;
|
|
70
70
|
useEffect(function () {
|
|
@@ -108,7 +108,7 @@ var SecondaryButton = forwardRef(function (_a, ref) {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}); };
|
|
111
|
-
return (React.createElement("button", __assign({ ref: buttonRef, className: "secondary-button ".concat(disabled ? "secondary-button-disabled" : "secondary-button-enabled", " secondary-button-").concat(mode, " ").concat(fullWidth ? "secondary-button-full-width" : "", " ").concat(isButtonLoading ? "secondary-button-loading" : "", " ").concat(color ? "secondary-button-color-".concat(color) : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
111
|
+
return (React.createElement("button", __assign({ ref: buttonRef, className: "secondary-button ".concat(disabled ? "secondary-button-disabled" : "secondary-button-enabled", " secondary-button-").concat(mode, " ").concat(fullWidth ? "secondary-button-full-width" : "", " ").concat(isButtonLoading ? "secondary-button-loading" : "", " ").concat(color ? "secondary-button-color-".concat(color) : "", " ").concat(size === "large" ? "secondary-button-large" : ""), disabled: disabled, onClick: handleClick, type: type }, props),
|
|
112
112
|
startIcon && (React.createElement("span", { className: "secondary-button-icon ".concat(startIconName) })),
|
|
113
113
|
React.createElement("span", { className: "secondary-button-label" }, label),
|
|
114
114
|
isButtonLoading ? (React.createElement("span", { className: "secondary-button-loading-dots" }, loadingDots)) : (endIcon && React.createElement("span", { className: "secondary-button-icon ".concat(endIconName) }))));
|
|
@@ -43,6 +43,15 @@ declare namespace _default {
|
|
|
43
43
|
export let options: string[];
|
|
44
44
|
export let defaultValue: string;
|
|
45
45
|
}
|
|
46
|
+
namespace size {
|
|
47
|
+
export namespace control_3 {
|
|
48
|
+
let type_3: string;
|
|
49
|
+
export { type_3 as type };
|
|
50
|
+
let options_1: string[];
|
|
51
|
+
export { options_1 as options };
|
|
52
|
+
}
|
|
53
|
+
export { control_3 as control };
|
|
54
|
+
}
|
|
46
55
|
}
|
|
47
56
|
export namespace parameters {
|
|
48
57
|
namespace backgrounds {
|
|
@@ -69,4 +78,7 @@ export const AsyncClick: any;
|
|
|
69
78
|
export const WithCustomColor: any;
|
|
70
79
|
export const WithErrorColor: any;
|
|
71
80
|
export const WithValidColor: any;
|
|
81
|
+
export const LargeButton: any;
|
|
82
|
+
export const LargeButtonWithIcons: any;
|
|
83
|
+
export const LargeColoredButton: any;
|
|
72
84
|
import SecondaryButton from "./SecondaryButton";
|
|
@@ -90,6 +90,12 @@ export default {
|
|
|
90
90
|
],
|
|
91
91
|
defaultValue: "noir",
|
|
92
92
|
},
|
|
93
|
+
size: {
|
|
94
|
+
control: {
|
|
95
|
+
type: "select",
|
|
96
|
+
options: ["medium", "large"],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
93
99
|
},
|
|
94
100
|
parameters: {
|
|
95
101
|
backgrounds: {
|
|
@@ -113,6 +119,7 @@ Default.args = {
|
|
|
113
119
|
fullWidth: false,
|
|
114
120
|
type: "button",
|
|
115
121
|
isLoading: false,
|
|
122
|
+
size: "medium",
|
|
116
123
|
};
|
|
117
124
|
export var WithStartIcon = Template.bind({});
|
|
118
125
|
WithStartIcon.args = __assign(__assign({}, Default.args), { startIcon: true, endIcon: false });
|
|
@@ -147,3 +154,9 @@ export var WithErrorColor = Template.bind({});
|
|
|
147
154
|
WithErrorColor.args = __assign(__assign({}, Default.args), { color: "actions-error" });
|
|
148
155
|
export var WithValidColor = Template.bind({});
|
|
149
156
|
WithValidColor.args = __assign(__assign({}, Default.args), { color: "actions-valid" });
|
|
157
|
+
export var LargeButton = Template.bind({});
|
|
158
|
+
LargeButton.args = __assign(__assign({}, Default.args), { label: "Grand Bouton", size: "large" });
|
|
159
|
+
export var LargeButtonWithIcons = Template.bind({});
|
|
160
|
+
LargeButtonWithIcons.args = __assign(__assign({}, Default.args), { label: "Grand Bouton avec Icônes", startIcon: true, endIcon: true, size: "large" });
|
|
161
|
+
export var LargeColoredButton = Template.bind({});
|
|
162
|
+
LargeColoredButton.args = __assign(__assign({}, Default.args), { label: "Grand Bouton Coloré", color: "bleu-allaw", size: "large" });
|
|
@@ -38,12 +38,18 @@
|
|
|
38
38
|
gap: 11px;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
.Input-default .Input-wrapper {
|
|
42
|
+
width: 100%;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
.Input-default .Input-container {
|
|
42
48
|
display: flex;
|
|
43
49
|
width: 100%;
|
|
44
|
-
flex-direction:
|
|
45
|
-
justify-content:
|
|
46
|
-
align-items:
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
align-items: center;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
.Input-default .Input-input {
|