allaw-ui 3.2.0 → 3.2.2
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/inputs/TextArea.css +6 -1
- package/dist/components/atoms/inputs/TextArea.d.ts +1 -0
- package/dist/components/atoms/inputs/TextArea.js +8 -5
- package/dist/components/atoms/inputs/TextArea.stories.d.ts +31 -6
- package/dist/components/atoms/inputs/TextArea.stories.js +28 -0
- package/dist/components/atoms/selects/ComboBox.css +12 -0
- package/dist/components/atoms/selects/ComboBox.d.ts +1 -0
- package/dist/components/atoms/selects/ComboBox.js +11 -11
- package/dist/components/atoms/selects/ComboBox.stories.d.ts +22 -0
- package/dist/components/atoms/selects/ComboBox.stories.js +14 -0
- package/package.json +1 -1
|
@@ -28,9 +28,10 @@
|
|
|
28
28
|
width: 100%;
|
|
29
29
|
padding-left: 4px;
|
|
30
30
|
resize: vertical;
|
|
31
|
-
min-height: 100px;
|
|
31
|
+
min-height: 100px; /* Hauteur minimale par défaut, peut être remplacée via props */
|
|
32
32
|
max-height: 400px; /* Hauteur maximale par défaut */
|
|
33
33
|
overflow-y: auto; /* Ajoute une barre de défilement verticale si nécessaire */
|
|
34
|
+
transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/* Style default */
|
|
@@ -82,8 +83,10 @@
|
|
|
82
83
|
font-size: 16px;
|
|
83
84
|
line-height: 24px;
|
|
84
85
|
padding: 8px;
|
|
86
|
+
min-height: 100px; /* Hauteur minimale par défaut, peut être remplacée via props */
|
|
85
87
|
max-height: 400px; /* Hauteur maximale par défaut */
|
|
86
88
|
overflow-y: auto; /* Ajoute une barre de défilement verticale si nécessaire */
|
|
89
|
+
transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
.text-area-variation {
|
|
@@ -120,8 +123,10 @@
|
|
|
120
123
|
border: none;
|
|
121
124
|
outline: none;
|
|
122
125
|
color: var(--noir);
|
|
126
|
+
min-height: 100px; /* Hauteur minimale par défaut, peut être remplacée via props */
|
|
123
127
|
max-height: 400px; /* Hauteur maximale par défaut */
|
|
124
128
|
overflow-y: auto; /* Ajoute une barre de défilement verticale si nécessaire */
|
|
129
|
+
transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
.text-area-variation .text-area-icon-button {
|
|
@@ -13,6 +13,7 @@ export interface TextAreaProps {
|
|
|
13
13
|
value?: string;
|
|
14
14
|
error?: string;
|
|
15
15
|
maxHeight?: number;
|
|
16
|
+
minHeight?: number;
|
|
16
17
|
variant?: "bold" | "semiBold" | "medium";
|
|
17
18
|
color?: "bleu-allaw" | "mid-grey" | "dark-grey" | "noir" | "pure-white" | "grey-venom" | "venom-grey-dark";
|
|
18
19
|
dataCy?: string;
|
|
@@ -6,10 +6,10 @@ import { commonRegex } from "../../../utils/regex";
|
|
|
6
6
|
import TinyInfo from "../typography/TinyInfo";
|
|
7
7
|
import Paragraph from "../typography/Paragraph";
|
|
8
8
|
var TextArea = forwardRef(function (_a, ref) {
|
|
9
|
-
var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.maxHeight, maxHeight = _d === void 0 ? 400 : _d, _e = _a.variant, variant =
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
9
|
+
var title = _a.title, _b = _a.style, style = _b === void 0 ? "default" : _b, placeholder = _a.placeholder, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, validate = _a.validate, onError = _a.onError, onChange = _a.onChange, propValue = _a.value, propError = _a.error, _d = _a.maxHeight, maxHeight = _d === void 0 ? 400 : _d, _e = _a.minHeight, minHeight = _e === void 0 ? 100 : _e, _f = _a.variant, variant = _f === void 0 ? "medium" : _f, _g = _a.color, color = _g === void 0 ? "noir" : _g, dataCy = _a.dataCy;
|
|
10
|
+
var _h = useState(propValue || ""), value = _h[0], setValue = _h[1];
|
|
11
|
+
var _j = useState(propError || ""), error = _j[0], setError = _j[1];
|
|
12
|
+
var _k = useState(false), isTouched = _k[0], setIsTouched = _k[1];
|
|
13
13
|
var textareaRef = useRef(null);
|
|
14
14
|
useEffect(function () {
|
|
15
15
|
setValue(propValue || "");
|
|
@@ -58,7 +58,10 @@ var TextArea = forwardRef(function (_a, ref) {
|
|
|
58
58
|
"*"))),
|
|
59
59
|
React.createElement("div", { className: "text-area-container" },
|
|
60
60
|
React.createElement("div", { className: "text-area-input", "data-cy": dataCy || "text-area" },
|
|
61
|
-
React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className: "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur, style: {
|
|
61
|
+
React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className: "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur, style: {
|
|
62
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
63
|
+
minHeight: "".concat(minHeight, "px"),
|
|
64
|
+
} })),
|
|
62
65
|
error && isTouched && (React.createElement("div", { className: "error-message" },
|
|
63
66
|
React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
|
|
64
67
|
});
|
|
@@ -33,23 +33,47 @@ declare namespace _default {
|
|
|
33
33
|
}
|
|
34
34
|
export { control_3 as control };
|
|
35
35
|
}
|
|
36
|
-
namespace
|
|
36
|
+
namespace minHeight {
|
|
37
37
|
export namespace control_4 {
|
|
38
38
|
let type_3: string;
|
|
39
39
|
export { type_3 as type };
|
|
40
|
+
let min_1: number;
|
|
41
|
+
export { min_1 as min };
|
|
42
|
+
let max_1: number;
|
|
43
|
+
export { max_1 as max };
|
|
44
|
+
let step_1: number;
|
|
45
|
+
export { step_1 as step };
|
|
46
|
+
}
|
|
47
|
+
export { control_4 as control };
|
|
48
|
+
export let description: string;
|
|
49
|
+
export namespace table {
|
|
50
|
+
export namespace type_4 {
|
|
51
|
+
let summary: string;
|
|
52
|
+
}
|
|
53
|
+
export { type_4 as type };
|
|
54
|
+
export namespace defaultValue {
|
|
55
|
+
let summary_1: number;
|
|
56
|
+
export { summary_1 as summary };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
namespace variant {
|
|
61
|
+
export namespace control_5 {
|
|
62
|
+
let type_5: string;
|
|
63
|
+
export { type_5 as type };
|
|
40
64
|
let options_1: string[];
|
|
41
65
|
export { options_1 as options };
|
|
42
66
|
}
|
|
43
|
-
export {
|
|
67
|
+
export { control_5 as control };
|
|
44
68
|
}
|
|
45
69
|
namespace color {
|
|
46
|
-
export namespace
|
|
47
|
-
let
|
|
48
|
-
export {
|
|
70
|
+
export namespace control_6 {
|
|
71
|
+
let type_6: string;
|
|
72
|
+
export { type_6 as type };
|
|
49
73
|
let options_2: string[];
|
|
50
74
|
export { options_2 as options };
|
|
51
75
|
}
|
|
52
|
-
export {
|
|
76
|
+
export { control_6 as control };
|
|
53
77
|
}
|
|
54
78
|
}
|
|
55
79
|
export namespace parameters {
|
|
@@ -67,4 +91,5 @@ export default _default;
|
|
|
67
91
|
export const Default: any;
|
|
68
92
|
export const Variation: any;
|
|
69
93
|
export const WithValidation: any;
|
|
94
|
+
export const LargeMinHeight: any;
|
|
70
95
|
import TextArea from "./TextArea";
|
|
@@ -43,6 +43,19 @@ export default {
|
|
|
43
43
|
step: 50,
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
+
minHeight: {
|
|
47
|
+
control: {
|
|
48
|
+
type: "number",
|
|
49
|
+
min: 50,
|
|
50
|
+
max: 500,
|
|
51
|
+
step: 10,
|
|
52
|
+
},
|
|
53
|
+
description: "Hauteur minimale du TextArea en pixels",
|
|
54
|
+
table: {
|
|
55
|
+
type: { summary: "number" },
|
|
56
|
+
defaultValue: { summary: 100 },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
46
59
|
variant: {
|
|
47
60
|
control: {
|
|
48
61
|
type: "select",
|
|
@@ -89,6 +102,7 @@ Default.args = {
|
|
|
89
102
|
style: "default",
|
|
90
103
|
isRequired: false,
|
|
91
104
|
maxHeight: 400,
|
|
105
|
+
minHeight: 100,
|
|
92
106
|
variant: "medium",
|
|
93
107
|
color: "noir",
|
|
94
108
|
};
|
|
@@ -100,6 +114,7 @@ Variation.args = {
|
|
|
100
114
|
style: "variation",
|
|
101
115
|
isRequired: true,
|
|
102
116
|
maxHeight: 400,
|
|
117
|
+
minHeight: 100,
|
|
103
118
|
};
|
|
104
119
|
export var WithValidation = Template.bind({});
|
|
105
120
|
WithValidation.args = {
|
|
@@ -110,4 +125,17 @@ WithValidation.args = {
|
|
|
110
125
|
isRequired: true,
|
|
111
126
|
validate: "email",
|
|
112
127
|
maxHeight: 400,
|
|
128
|
+
minHeight: 100,
|
|
129
|
+
};
|
|
130
|
+
export var LargeMinHeight = Template.bind({});
|
|
131
|
+
LargeMinHeight.args = {
|
|
132
|
+
name: "largeTextArea",
|
|
133
|
+
title: "Description détaillée",
|
|
134
|
+
placeholder: "Entrez une description détaillée",
|
|
135
|
+
style: "default",
|
|
136
|
+
isRequired: false,
|
|
137
|
+
maxHeight: 400,
|
|
138
|
+
minHeight: 200,
|
|
139
|
+
variant: "medium",
|
|
140
|
+
color: "noir",
|
|
113
141
|
};
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
color: var(--dark-grey, #456073);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
.combo-box-title-medium {
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.combo-box-title-semiBold {
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.combo-box-title-bold {
|
|
27
|
+
font-weight: 700;
|
|
28
|
+
}
|
|
29
|
+
|
|
18
30
|
.combo-box-input-container {
|
|
19
31
|
display: flex;
|
|
20
32
|
align-items: center;
|
|
@@ -5,24 +5,24 @@ import TinyInfo from "../typography/TinyInfo";
|
|
|
5
5
|
import Paragraph from "../typography/Paragraph";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
7
|
function ComboBox(_a, ref) {
|
|
8
|
-
var items = _a.items, selectedItem = _a.selectedItem, _b = _a.placeholder, placeholder = _b === void 0 ? "Sélectionner..." : _b, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, _d = _a.showError, showError = _d === void 0 ? false : _d, _e = _a.width, width = _e === void 0 ? 100 : _e, onSelect = _a.onSelect, onChange = _a.onChange, onError = _a.onError, _f = _a.openOnMount, openOnMount = _f === void 0 ? true : _f, title = _a.title;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
8
|
+
var items = _a.items, selectedItem = _a.selectedItem, _b = _a.placeholder, placeholder = _b === void 0 ? "Sélectionner..." : _b, _c = _a.isRequired, isRequired = _c === void 0 ? false : _c, _d = _a.showError, showError = _d === void 0 ? false : _d, _e = _a.width, width = _e === void 0 ? 100 : _e, onSelect = _a.onSelect, onChange = _a.onChange, onError = _a.onError, _f = _a.openOnMount, openOnMount = _f === void 0 ? true : _f, title = _a.title, _g = _a.titleStyle, titleStyle = _g === void 0 ? "semiBold" : _g;
|
|
9
|
+
var _h = useState(openOnMount), isOpen = _h[0], setIsOpen = _h[1];
|
|
10
|
+
var _j = useState(""), inputValue = _j[0], setInputValue = _j[1];
|
|
11
|
+
var _k = useState(items), filteredItems = _k[0], setFilteredItems = _k[1];
|
|
12
|
+
var _l = useState(""), error = _l[0], setError = _l[1];
|
|
13
|
+
var _m = useState(false), isHovered = _m[0], setIsHovered = _m[1];
|
|
14
|
+
var _o = useState(-1), selectedIndex = _o[0], setSelectedIndex = _o[1];
|
|
15
15
|
var comboBoxRef = useRef(null);
|
|
16
16
|
var inputContainerRef = useRef(null);
|
|
17
17
|
var listRef = useRef(null);
|
|
18
18
|
var inputRef = useRef(null);
|
|
19
19
|
var chevronRef = useRef(null);
|
|
20
|
-
var
|
|
21
|
-
var
|
|
20
|
+
var _p = useState(true), isInputValid = _p[0], setIsInputValid = _p[1];
|
|
21
|
+
var _q = useState({
|
|
22
22
|
top: 0,
|
|
23
23
|
left: 0,
|
|
24
24
|
width: 0,
|
|
25
|
-
}), listPosition =
|
|
25
|
+
}), listPosition = _q[0], setListPosition = _q[1];
|
|
26
26
|
useEffect(function () {
|
|
27
27
|
if (selectedItem) {
|
|
28
28
|
var selectedItemData = items.find(function (item) { return item.value === selectedItem; });
|
|
@@ -150,7 +150,7 @@ function ComboBox(_a, ref) {
|
|
|
150
150
|
}, [isOpen, filteredItems, selectedIndex]);
|
|
151
151
|
return (React.createElement("div", { ref: comboBoxRef, className: "combo-box-container ".concat(isOpen ? "combo-box-pressed" : "", " ").concat(isHovered ? "combo-box-hovered" : ""), style: { width: "".concat(width, "%") }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
152
152
|
title && (React.createElement("div", { className: "combo-box-title-container" },
|
|
153
|
-
React.createElement(Paragraph, { variant:
|
|
153
|
+
React.createElement(Paragraph, { variant: titleStyle, color: "noir", text: title }),
|
|
154
154
|
isRequired && (React.createElement("span", { className: "combo-box-required" },
|
|
155
155
|
"\u00A0",
|
|
156
156
|
"*")))),
|
|
@@ -61,6 +61,26 @@ declare namespace _default {
|
|
|
61
61
|
export { control_6 as control };
|
|
62
62
|
}
|
|
63
63
|
export { title_1 as title };
|
|
64
|
+
export namespace titleStyle {
|
|
65
|
+
export let options: string[];
|
|
66
|
+
export namespace control_7 {
|
|
67
|
+
let type_7: string;
|
|
68
|
+
export { type_7 as type };
|
|
69
|
+
}
|
|
70
|
+
export { control_7 as control };
|
|
71
|
+
export let description: string;
|
|
72
|
+
export namespace table_1 {
|
|
73
|
+
export namespace type_8 {
|
|
74
|
+
let summary: string;
|
|
75
|
+
}
|
|
76
|
+
export { type_8 as type };
|
|
77
|
+
export namespace defaultValue {
|
|
78
|
+
let summary_1: string;
|
|
79
|
+
export { summary_1 as summary };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export { table_1 as table };
|
|
83
|
+
}
|
|
64
84
|
}
|
|
65
85
|
export namespace parameters {
|
|
66
86
|
namespace backgrounds {
|
|
@@ -91,4 +111,6 @@ export const Pressed: any;
|
|
|
91
111
|
export const Required: any;
|
|
92
112
|
export const CustomWidth: any;
|
|
93
113
|
export const OpenOnMount: any;
|
|
114
|
+
export const TitleMedium: any;
|
|
115
|
+
export const TitleBold: any;
|
|
94
116
|
import ComboBox from "./ComboBox";
|
|
@@ -63,6 +63,15 @@ export default {
|
|
|
63
63
|
type: "text",
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
+
titleStyle: {
|
|
67
|
+
options: ["medium", "semiBold", "bold"],
|
|
68
|
+
control: { type: "select" },
|
|
69
|
+
description: "Style du titre (graisse de police)",
|
|
70
|
+
table: {
|
|
71
|
+
type: { summary: "string" },
|
|
72
|
+
defaultValue: { summary: "semiBold" },
|
|
73
|
+
},
|
|
74
|
+
},
|
|
66
75
|
},
|
|
67
76
|
parameters: {
|
|
68
77
|
backgrounds: {
|
|
@@ -111,6 +120,7 @@ Default.args = {
|
|
|
111
120
|
width: 100,
|
|
112
121
|
openOnMount: true,
|
|
113
122
|
title: "Sélectionnez une date",
|
|
123
|
+
titleStyle: "semiBold",
|
|
114
124
|
};
|
|
115
125
|
export var Pressed = Template.bind({});
|
|
116
126
|
Pressed.args = __assign(__assign({}, Default.args), { selectedItem: "lundi-12-aout" });
|
|
@@ -120,3 +130,7 @@ export var CustomWidth = Template.bind({});
|
|
|
120
130
|
CustomWidth.args = __assign(__assign({}, Default.args), { width: 50 });
|
|
121
131
|
export var OpenOnMount = Template.bind({});
|
|
122
132
|
OpenOnMount.args = __assign(__assign({}, Default.args), { openOnMount: true });
|
|
133
|
+
export var TitleMedium = Template.bind({});
|
|
134
|
+
TitleMedium.args = __assign(__assign({}, Default.args), { titleStyle: "medium" });
|
|
135
|
+
export var TitleBold = Template.bind({});
|
|
136
|
+
TitleBold.args = __assign(__assign({}, Default.args), { titleStyle: "bold" });
|