allaw-ui 3.2.1 → 3.2.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.
@@ -28,9 +28,15 @@
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 */
35
+ }
36
+
37
+ /* Classe pour désactiver la transition */
38
+ .no-transition {
39
+ transition: none !important;
34
40
  }
35
41
 
36
42
  /* Style default */
@@ -82,8 +88,14 @@
82
88
  font-size: 16px;
83
89
  line-height: 24px;
84
90
  padding: 8px;
91
+ min-height: 100px; /* Hauteur minimale par défaut, peut être remplacée via props */
85
92
  max-height: 400px; /* Hauteur maximale par défaut */
86
93
  overflow-y: auto; /* Ajoute une barre de défilement verticale si nécessaire */
94
+ transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
95
+ }
96
+
97
+ .text-area-default .text-area-input textarea.no-transition {
98
+ transition: none !important;
87
99
  }
88
100
 
89
101
  .text-area-variation {
@@ -120,8 +132,14 @@
120
132
  border: none;
121
133
  outline: none;
122
134
  color: var(--noir);
135
+ min-height: 100px; /* Hauteur minimale par défaut, peut être remplacée via props */
123
136
  max-height: 400px; /* Hauteur maximale par défaut */
124
137
  overflow-y: auto; /* Ajoute une barre de défilement verticale si nécessaire */
138
+ transition: min-height 0.3s ease-in-out; /* Transition fluide pour les changements de hauteur */
139
+ }
140
+
141
+ .text-area-variation .text-area-input textarea.no-transition {
142
+ transition: none !important;
125
143
  }
126
144
 
127
145
  .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,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 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 = _e === void 0 ? "medium" : _e, _f = _a.color, color = _f === void 0 ? "noir" : _f, dataCy = _a.dataCy;
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, minHeight = _a.minHeight, _e = _a.variant, variant = _e === void 0 ? "medium" : _e, _f = _a.color, color = _f === void 0 ? "noir" : _f, dataCy = _a.dataCy;
10
10
  var _g = useState(propValue || ""), value = _g[0], setValue = _g[1];
11
11
  var _h = useState(propError || ""), error = _h[0], setError = _h[1];
12
12
  var _j = useState(false), isTouched = _j[0], setIsTouched = _j[1];
@@ -50,6 +50,15 @@ var TextArea = forwardRef(function (_a, ref) {
50
50
  setIsTouched(true);
51
51
  validateTextArea();
52
52
  };
53
+ // Préparer les styles du textarea
54
+ var textareaStyle = {
55
+ maxHeight: "".concat(maxHeight, "px"),
56
+ };
57
+ // Ajouter minHeight si spécifiée, sans transition
58
+ if (minHeight !== undefined) {
59
+ textareaStyle.minHeight = "".concat(minHeight, "px");
60
+ textareaStyle.transition = "none";
61
+ }
53
62
  return (React.createElement("div", { className: "TextArea text-area-".concat(style) },
54
63
  React.createElement("div", { className: "text-area-title-container" },
55
64
  React.createElement(Paragraph, { variant: variant, color: color, text: title }),
@@ -58,7 +67,9 @@ var TextArea = forwardRef(function (_a, ref) {
58
67
  "*"))),
59
68
  React.createElement("div", { className: "text-area-container" },
60
69
  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: { maxHeight: "".concat(maxHeight, "px") } })),
70
+ React.createElement("textarea", { ref: textareaRef, placeholder: placeholder, className: minHeight !== undefined
71
+ ? "text-area-placeholder no-transition"
72
+ : "text-area-placeholder", value: value, onChange: handleChange, onBlur: handleBlur, style: textareaStyle })),
62
73
  error && isTouched && (React.createElement("div", { className: "error-message" },
63
74
  React.createElement(TinyInfo, { variant: "medium12", color: "actions-error", text: error }))))));
64
75
  });
@@ -33,23 +33,47 @@ declare namespace _default {
33
33
  }
34
34
  export { control_3 as control };
35
35
  }
36
- namespace variant {
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 { control_4 as control };
67
+ export { control_5 as control };
44
68
  }
45
69
  namespace color {
46
- export namespace control_5 {
47
- let type_4: string;
48
- export { type_4 as type };
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 { control_5 as control };
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",