allaw-ui 2.5.8 → 2.6.0

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.
@@ -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 _f = useState(false), internalIsLoading = _f[0], setInternalIsLoading = _f[1];
67
- var _g = useState(""), loadingDots = _g[0], setLoadingDots = _g[1];
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
- background-color 0.2s,
16
- opacity 0.2s,
17
- color 0.2s;
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 _h = useState(false), internalIsLoading = _h[0], setInternalIsLoading = _h[1];
67
- var _j = useState(""), loadingDots = _j[0], setLoadingDots = _j[1];
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" });
@@ -16,6 +16,8 @@ export interface InputProps {
16
16
  value?: string;
17
17
  error?: string;
18
18
  type?: string;
19
+ name?: string;
20
+ onKeyDown?: any;
19
21
  color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
20
22
  variant?: "bold" | "semiBold" | "medium";
21
23
  }
@@ -6,7 +6,7 @@ import { commonRegex } from "../../../utils/regex";
6
6
  import TinyInfo from "../typography/TinyInfo";
7
7
  import Paragraph from "../typography/Paragraph";
8
8
  var Input = forwardRef(function (_a, ref) {
9
- var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, rowChange = _a.rowChange, placeholder = _a.placeholder, endIcon = _a.endIcon, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, _d = _a.type, type = _d === void 0 ? "text" : _d, propError = _a.error, _e = _a.color, color = _e === void 0 ? "noir" : _e, _f = _a.variant, variant = _f === void 0 ? "medium" : _f;
9
+ var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, rowChange = _a.rowChange, placeholder = _a.placeholder, endIcon = _a.endIcon, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, _d = _a.type, type = _d === void 0 ? "text" : _d, propError = _a.error, _e = _a.color, color = _e === void 0 ? "noir" : _e, _f = _a.variant, variant = _f === void 0 ? "medium" : _f, onKeyDown = _a.onKeyDown, name = _a.name;
10
10
  var _g = useState(false), isPasswordVisible = _g[0], setIsPasswordVisible = _g[1];
11
11
  var _h = useState(propValue || ""), value = _h[0], setValue = _h[1];
12
12
  var _j = useState(propError || ""), error = _j[0], setError = _j[1];
@@ -85,7 +85,7 @@ var Input = forwardRef(function (_a, ref) {
85
85
  React.createElement("input", { ref: inputRef, type: style === "password" && !isPasswordVisible ? "password" : type, placeholder: placeholder, className: "Input-placeholder", value: value, onChange: function (e) {
86
86
  handleChange(e);
87
87
  rowChange && rowChange(e);
88
- }, onBlur: handleBlur })),
88
+ }, name: name, onKeyDown: onKeyDown, onBlur: handleBlur })),
89
89
  renderEndIcon()),
90
90
  error && isTouched && (React.createElement("div", { className: "error-message" },
91
91
  React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "2.5.8",
3
+ "version": "2.6.0",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",