@rescui/textarea 0.10.2-RUI-286-Fix-tooltip-stacking-f4145b01.1 → 0.11.1
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/lib/_virtual/index.css.js +12 -12
- package/lib/index.css +257 -362
- package/lib/index.d.ts +4 -0
- package/lib/public-api.p.css +27 -233
- package/lib/public-api.pcss +27 -233
- package/lib/textarea.d.ts +9 -0
- package/lib/textarea.js +21 -12
- package/lib/textarea.p.module.css.js +21 -20
- package/lib/use-backward-compatible-id.d.ts +4 -0
- package/lib/use-backward-compatible-id.js +14 -0
- package/package.json +7 -6
- package/lib/_virtual/warning.js +0 -106
package/lib/public-api.pcss
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
&:not(html){
|
|
3
3
|
--_rs-textarea-vertical-padding:6px;
|
|
4
4
|
--_rs-textarea-horizontal-padding:8px;
|
|
5
|
-
--_rs-textarea-parts-offset:4px;
|
|
6
5
|
}
|
|
7
6
|
&:not(html) [data-rs-internal='textarea__busy-icon']:not(html){
|
|
8
7
|
--_rs-icons-height:20px;
|
|
@@ -34,8 +33,9 @@
|
|
|
34
33
|
)
|
|
35
34
|
);
|
|
36
35
|
--_rs-typography-text-auto-offset:8px;
|
|
37
|
-
--_rs-typography-ul-
|
|
38
|
-
--_rs-typography-
|
|
36
|
+
--_rs-typography-ul-bullet-offset:2px;
|
|
37
|
+
--_rs-typography-list-li-compact-left-offset:15px;
|
|
38
|
+
--_rs-typography-list-li-default-left-offset:19px;
|
|
39
39
|
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
40
40
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
41
41
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
@@ -71,8 +71,9 @@
|
|
|
71
71
|
)
|
|
72
72
|
);
|
|
73
73
|
--_rs-typography-text-auto-offset:8px;
|
|
74
|
-
--_rs-typography-ul-
|
|
75
|
-
--_rs-typography-
|
|
74
|
+
--_rs-typography-ul-bullet-offset:2px;
|
|
75
|
+
--_rs-typography-list-li-compact-left-offset:15px;
|
|
76
|
+
--_rs-typography-list-li-default-left-offset:19px;
|
|
76
77
|
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
77
78
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
78
79
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
@@ -102,87 +103,19 @@
|
|
|
102
103
|
)
|
|
103
104
|
);
|
|
104
105
|
--_rs-typography-text-auto-offset:0;
|
|
105
|
-
--_rs-typography-ul-
|
|
106
|
-
--_rs-typography-
|
|
106
|
+
--_rs-typography-ul-bullet-offset:initial;
|
|
107
|
+
--_rs-typography-list-li-compact-left-offset:initial;
|
|
108
|
+
--_rs-typography-list-li-default-left-offset:initial;
|
|
107
109
|
--_rs-typography-list-li-margin-top-from-text:initial;
|
|
108
110
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
109
111
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
110
112
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
111
113
|
}
|
|
112
|
-
&:not(html) [data-rs-internal='textarea__note']{
|
|
113
|
-
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
114
|
-
--_rs-typography-text-transform:initial;
|
|
115
|
-
--_rs-typography-font-variant-numeric:initial;
|
|
116
|
-
--_rs-typography-font-family:var(
|
|
117
|
-
--rs-font-family-ui,
|
|
118
|
-
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
119
|
-
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
120
|
-
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
121
|
-
);
|
|
122
|
-
--_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
|
|
123
|
-
--_rs-typography-font-weight:var(
|
|
124
|
-
--rs-font-weight-regular,
|
|
125
|
-
400
|
|
126
|
-
);
|
|
127
|
-
--_rs-typography-line-height:var(
|
|
128
|
-
--rs-text-3-line-height,
|
|
129
|
-
20px
|
|
130
|
-
);
|
|
131
|
-
--_rs-typography-base-color:var(
|
|
132
|
-
--_rs-typography-hardness-color,
|
|
133
|
-
var(
|
|
134
|
-
--rs-color-average,
|
|
135
|
-
rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.7)
|
|
136
|
-
)
|
|
137
|
-
);
|
|
138
|
-
--_rs-typography-text-auto-offset:8px;
|
|
139
|
-
--_rs-typography-ul-list-li-padding-left:28px;
|
|
140
|
-
--_rs-typography-ol-list-li-padding-left:21px;
|
|
141
|
-
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
142
|
-
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
143
|
-
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
144
|
-
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
145
|
-
}
|
|
146
|
-
&:not(html) [data-rs-internal='textarea__error-message']{
|
|
147
|
-
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
148
|
-
--_rs-typography-text-transform:initial;
|
|
149
|
-
--_rs-typography-font-variant-numeric:initial;
|
|
150
|
-
--_rs-typography-font-family:var(
|
|
151
|
-
--rs-font-family-ui,
|
|
152
|
-
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
153
|
-
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
154
|
-
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
155
|
-
);
|
|
156
|
-
--_rs-typography-font-size:var(--rs-h5-font-size, 13px);
|
|
157
|
-
--_rs-typography-font-weight:var(
|
|
158
|
-
--rs-font-weight-semi-bold,
|
|
159
|
-
600
|
|
160
|
-
);
|
|
161
|
-
--_rs-typography-line-height:var(--rs-h5-line-height, 20px);
|
|
162
|
-
--_rs-typography-base-color:var(
|
|
163
|
-
--_rs-typography-heading-hardness-color,
|
|
164
|
-
var(
|
|
165
|
-
--rs-color-hard,
|
|
166
|
-
rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227))
|
|
167
|
-
)
|
|
168
|
-
);
|
|
169
|
-
--_rs-typography-text-auto-offset:0;
|
|
170
|
-
--_rs-typography-ul-list-li-padding-left:initial;
|
|
171
|
-
--_rs-typography-ol-list-li-padding-left:initial;
|
|
172
|
-
--_rs-typography-list-li-margin-top-from-text:initial;
|
|
173
|
-
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
174
|
-
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
175
|
-
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
176
|
-
}
|
|
177
|
-
&:not(html) [data-rs-internal='textarea__error-icon']:not(html){
|
|
178
|
-
--_rs-icons-height:20px;
|
|
179
|
-
}
|
|
180
114
|
}
|
|
181
115
|
@define-mixin rs-textarea-size-m{
|
|
182
116
|
&:not(html){
|
|
183
117
|
--_rs-textarea-vertical-padding:8px;
|
|
184
118
|
--_rs-textarea-horizontal-padding:8px;
|
|
185
|
-
--_rs-textarea-parts-offset:8px;
|
|
186
119
|
}
|
|
187
120
|
&:not(html) [data-rs-internal='textarea__busy-icon']:not(html){
|
|
188
121
|
--_rs-icons-height:24px;
|
|
@@ -214,8 +147,9 @@
|
|
|
214
147
|
)
|
|
215
148
|
);
|
|
216
149
|
--_rs-typography-text-auto-offset:16px;
|
|
217
|
-
--_rs-typography-ul-
|
|
218
|
-
--_rs-typography-
|
|
150
|
+
--_rs-typography-ul-bullet-offset:2px;
|
|
151
|
+
--_rs-typography-list-li-compact-left-offset:18px;
|
|
152
|
+
--_rs-typography-list-li-default-left-offset:24px;
|
|
219
153
|
--_rs-typography-list-li-margin-top-from-text:var(
|
|
220
154
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
221
155
|
16px
|
|
@@ -259,8 +193,9 @@
|
|
|
259
193
|
)
|
|
260
194
|
);
|
|
261
195
|
--_rs-typography-text-auto-offset:16px;
|
|
262
|
-
--_rs-typography-ul-
|
|
263
|
-
--_rs-typography-
|
|
196
|
+
--_rs-typography-ul-bullet-offset:2px;
|
|
197
|
+
--_rs-typography-list-li-compact-left-offset:18px;
|
|
198
|
+
--_rs-typography-list-li-default-left-offset:24px;
|
|
264
199
|
--_rs-typography-list-li-margin-top-from-text:var(
|
|
265
200
|
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
266
201
|
16px
|
|
@@ -301,87 +236,19 @@
|
|
|
301
236
|
)
|
|
302
237
|
);
|
|
303
238
|
--_rs-typography-text-auto-offset:0;
|
|
304
|
-
--_rs-typography-ul-
|
|
305
|
-
--_rs-typography-
|
|
306
|
-
--_rs-typography-list-li-
|
|
307
|
-
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
308
|
-
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
309
|
-
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
310
|
-
}
|
|
311
|
-
&:not(html) [data-rs-internal='textarea__note']{
|
|
312
|
-
--_rs-typography-letter-spacing:var(--rs-text-3-letter-spacing, 0.0045em);
|
|
313
|
-
--_rs-typography-text-transform:initial;
|
|
314
|
-
--_rs-typography-font-variant-numeric:initial;
|
|
315
|
-
--_rs-typography-font-family:var(
|
|
316
|
-
--rs-font-family-ui,
|
|
317
|
-
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
318
|
-
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
319
|
-
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
320
|
-
);
|
|
321
|
-
--_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
|
|
322
|
-
--_rs-typography-font-weight:var(
|
|
323
|
-
--rs-font-weight-regular,
|
|
324
|
-
400
|
|
325
|
-
);
|
|
326
|
-
--_rs-typography-line-height:var(
|
|
327
|
-
--rs-text-3-line-height,
|
|
328
|
-
20px
|
|
329
|
-
);
|
|
330
|
-
--_rs-typography-base-color:var(
|
|
331
|
-
--_rs-typography-hardness-color,
|
|
332
|
-
var(
|
|
333
|
-
--rs-color-average,
|
|
334
|
-
rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.7)
|
|
335
|
-
)
|
|
336
|
-
);
|
|
337
|
-
--_rs-typography-text-auto-offset:8px;
|
|
338
|
-
--_rs-typography-ul-list-li-padding-left:28px;
|
|
339
|
-
--_rs-typography-ol-list-li-padding-left:21px;
|
|
340
|
-
--_rs-typography-list-li-margin-top-from-text:8px;
|
|
341
|
-
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
342
|
-
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
343
|
-
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
344
|
-
}
|
|
345
|
-
&:not(html) [data-rs-internal='textarea__error-message']{
|
|
346
|
-
--_rs-typography-letter-spacing:var(--rs-h5-letter-spacing, normal);
|
|
347
|
-
--_rs-typography-text-transform:initial;
|
|
348
|
-
--_rs-typography-font-variant-numeric:initial;
|
|
349
|
-
--_rs-typography-font-family:var(
|
|
350
|
-
--rs-font-family-ui,
|
|
351
|
-
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
352
|
-
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
353
|
-
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
354
|
-
);
|
|
355
|
-
--_rs-typography-font-size:var(--rs-h5-font-size, 13px);
|
|
356
|
-
--_rs-typography-font-weight:var(
|
|
357
|
-
--rs-font-weight-semi-bold,
|
|
358
|
-
600
|
|
359
|
-
);
|
|
360
|
-
--_rs-typography-line-height:var(--rs-h5-line-height, 20px);
|
|
361
|
-
--_rs-typography-base-color:var(
|
|
362
|
-
--_rs-typography-heading-hardness-color,
|
|
363
|
-
var(
|
|
364
|
-
--rs-color-hard,
|
|
365
|
-
rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227))
|
|
366
|
-
)
|
|
367
|
-
);
|
|
368
|
-
--_rs-typography-text-auto-offset:0;
|
|
369
|
-
--_rs-typography-ul-list-li-padding-left:initial;
|
|
370
|
-
--_rs-typography-ol-list-li-padding-left:initial;
|
|
239
|
+
--_rs-typography-ul-bullet-offset:initial;
|
|
240
|
+
--_rs-typography-list-li-compact-left-offset:initial;
|
|
241
|
+
--_rs-typography-list-li-default-left-offset:initial;
|
|
371
242
|
--_rs-typography-list-li-margin-top-from-text:initial;
|
|
372
243
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
373
244
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
374
245
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
375
246
|
}
|
|
376
|
-
&:not(html) [data-rs-internal='textarea__error-icon']:not(html){
|
|
377
|
-
--_rs-icons-height:20px;
|
|
378
|
-
}
|
|
379
247
|
}
|
|
380
248
|
@define-mixin rs-textarea-size-l{
|
|
381
249
|
&:not(html){
|
|
382
250
|
--_rs-textarea-vertical-padding:12px;
|
|
383
251
|
--_rs-textarea-horizontal-padding:16px;
|
|
384
|
-
--_rs-textarea-parts-offset:8px;
|
|
385
252
|
}
|
|
386
253
|
&:not(html) [data-rs-internal='textarea__busy-icon']:not(html){
|
|
387
254
|
--_rs-icons-height:28px;
|
|
@@ -413,8 +280,9 @@
|
|
|
413
280
|
)
|
|
414
281
|
);
|
|
415
282
|
--_rs-typography-text-auto-offset:32px;
|
|
416
|
-
--_rs-typography-ul-
|
|
417
|
-
--_rs-typography-
|
|
283
|
+
--_rs-typography-ul-bullet-offset:2px;
|
|
284
|
+
--_rs-typography-list-li-compact-left-offset:22px;
|
|
285
|
+
--_rs-typography-list-li-default-left-offset:28px;
|
|
418
286
|
--_rs-typography-list-li-margin-top-from-text:var(
|
|
419
287
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text,
|
|
420
288
|
24px
|
|
@@ -458,8 +326,9 @@
|
|
|
458
326
|
)
|
|
459
327
|
);
|
|
460
328
|
--_rs-typography-text-auto-offset:32px;
|
|
461
|
-
--_rs-typography-ul-
|
|
462
|
-
--_rs-typography-
|
|
329
|
+
--_rs-typography-ul-bullet-offset:2px;
|
|
330
|
+
--_rs-typography-list-li-compact-left-offset:22px;
|
|
331
|
+
--_rs-typography-list-li-default-left-offset:28px;
|
|
463
332
|
--_rs-typography-list-li-margin-top-from-text:var(
|
|
464
333
|
--_rs-typography-text-1-sm-list-li-margin-top-from-text,
|
|
465
334
|
24px
|
|
@@ -500,89 +369,14 @@
|
|
|
500
369
|
)
|
|
501
370
|
);
|
|
502
371
|
--_rs-typography-text-auto-offset:0;
|
|
503
|
-
--_rs-typography-ul-
|
|
504
|
-
--_rs-typography-
|
|
372
|
+
--_rs-typography-ul-bullet-offset:initial;
|
|
373
|
+
--_rs-typography-list-li-compact-left-offset:initial;
|
|
374
|
+
--_rs-typography-list-li-default-left-offset:initial;
|
|
505
375
|
--_rs-typography-list-li-margin-top-from-text:initial;
|
|
506
376
|
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
507
377
|
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
508
378
|
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
509
379
|
}
|
|
510
|
-
&:not(html) [data-rs-internal='textarea__note']{
|
|
511
|
-
--_rs-typography-letter-spacing:var(--rs-text-2-letter-spacing, 0.0015em);
|
|
512
|
-
--_rs-typography-text-transform:initial;
|
|
513
|
-
--_rs-typography-font-variant-numeric:initial;
|
|
514
|
-
--_rs-typography-font-family:var(
|
|
515
|
-
--rs-font-family-ui,
|
|
516
|
-
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
517
|
-
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
518
|
-
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
519
|
-
);
|
|
520
|
-
--_rs-typography-font-size:var(--rs-text-2-font-size, 16px);
|
|
521
|
-
--_rs-typography-font-weight:var(
|
|
522
|
-
--rs-font-weight-regular,
|
|
523
|
-
400
|
|
524
|
-
);
|
|
525
|
-
--_rs-typography-line-height:var(
|
|
526
|
-
--rs-text-2-line-height,
|
|
527
|
-
24px
|
|
528
|
-
);
|
|
529
|
-
--_rs-typography-base-color:var(
|
|
530
|
-
--_rs-typography-hardness-color,
|
|
531
|
-
var(
|
|
532
|
-
--rs-color-average,
|
|
533
|
-
rgba(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227), 0.7)
|
|
534
|
-
)
|
|
535
|
-
);
|
|
536
|
-
--_rs-typography-text-auto-offset:16px;
|
|
537
|
-
--_rs-typography-ul-list-li-padding-left:22px;
|
|
538
|
-
--_rs-typography-ol-list-li-padding-left:26px;
|
|
539
|
-
--_rs-typography-list-li-margin-top-from-text:var(
|
|
540
|
-
--_rs-typography-text-2-sm-list-li-margin-top-from-text,
|
|
541
|
-
16px
|
|
542
|
-
);
|
|
543
|
-
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
544
|
-
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
545
|
-
--_rs-typography-link-border-bottom-width-from-text:1px;
|
|
546
|
-
}
|
|
547
|
-
@media screen and (max-width: 640px){
|
|
548
|
-
&:not(html) [data-rs-internal='textarea__note']{
|
|
549
|
-
--_rs-typography-text-2-sm-list-li-margin-top-from-text:12px;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
&:not(html) [data-rs-internal='textarea__error-message']{
|
|
553
|
-
--_rs-typography-letter-spacing:var(--rs-h4-letter-spacing, normal);
|
|
554
|
-
--_rs-typography-text-transform:initial;
|
|
555
|
-
--_rs-typography-font-variant-numeric:initial;
|
|
556
|
-
--_rs-typography-font-family:var(
|
|
557
|
-
--rs-font-family-ui,
|
|
558
|
-
var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
|
|
559
|
-
BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
560
|
-
'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
|
|
561
|
-
);
|
|
562
|
-
--_rs-typography-font-size:var(--rs-h4-font-size, 16px);
|
|
563
|
-
--_rs-typography-font-weight:var(
|
|
564
|
-
--rs-font-weight-semi-bold,
|
|
565
|
-
600
|
|
566
|
-
);
|
|
567
|
-
--_rs-typography-line-height:var(--rs-h4-line-height, 24px);
|
|
568
|
-
--_rs-typography-base-color:var(
|
|
569
|
-
--_rs-typography-heading-hardness-color,
|
|
570
|
-
var(
|
|
571
|
-
--rs-color-hard,
|
|
572
|
-
rgb(calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(25 + var(--_rs-theme-dark-coefficient, 0)*230), calc(28 + var(--_rs-theme-dark-coefficient, 0)*227))
|
|
573
|
-
)
|
|
574
|
-
);
|
|
575
|
-
--_rs-typography-text-auto-offset:0;
|
|
576
|
-
--_rs-typography-ul-list-li-padding-left:initial;
|
|
577
|
-
--_rs-typography-ol-list-li-padding-left:initial;
|
|
578
|
-
--_rs-typography-list-li-margin-top-from-text:initial;
|
|
579
|
-
--_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
|
|
580
|
-
--_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
|
|
581
|
-
--_rs-typography-link-border-bottom-width-from-text:2px;
|
|
582
|
-
}
|
|
583
|
-
&:not(html) [data-rs-internal='textarea__error-icon']:not(html){
|
|
584
|
-
--_rs-icons-height:24px;
|
|
585
|
-
}
|
|
586
380
|
}
|
|
587
381
|
@define-mixin rs-textarea-mode-classic{
|
|
588
382
|
&:not(html){
|
package/lib/textarea.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ declare type TextareaExclusiveProps = {
|
|
|
23
23
|
* Error message to show
|
|
24
24
|
*/
|
|
25
25
|
error?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* If `true`, there will be reserved a space for a 1-line error message. Subsequent lines will be placed below normally.
|
|
28
|
+
* If `false`, there will be no reservation.
|
|
29
|
+
*/
|
|
30
|
+
reserveErrorLine?: boolean;
|
|
26
31
|
/**
|
|
27
32
|
* Set loading state
|
|
28
33
|
*/
|
|
@@ -88,6 +93,10 @@ declare type TextareaExclusiveProps = {
|
|
|
88
93
|
textareaRef?: React.Ref<HTMLTextAreaElement>;
|
|
89
94
|
enableClear?: boolean;
|
|
90
95
|
boldLabel?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Character counter slot
|
|
98
|
+
*/
|
|
99
|
+
characterCounter?: React.ReactNode;
|
|
91
100
|
};
|
|
92
101
|
export declare type TextareaProps = Omit<TextareaAutosizeProps, keyof TextareaExclusiveProps> & TextareaExclusiveProps;
|
|
93
102
|
export declare const Textarea: React.ForwardRefExoticComponent<Omit<TextareaAutosizeProps, keyof TextareaExclusiveProps> & TextareaExclusiveProps & React.RefAttributes<HTMLLabelElement>>;
|
package/lib/textarea.js
CHANGED
|
@@ -3,9 +3,10 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import TextareaAutosize from 'react-textarea-autosize';
|
|
5
5
|
import { useThemeWithUndefined } from '@rescui/ui-contexts';
|
|
6
|
+
import { shouldRenderErrorMessage, ErrorMessage } from '@rescui/form-field';
|
|
6
7
|
import cn from 'classnames';
|
|
7
|
-
import WarningIcon from './_virtual/warning.js';
|
|
8
8
|
import LoadingOutlineIcon from './_virtual/loading-outline.js';
|
|
9
|
+
import { useBackwardCompatibleId } from './use-backward-compatible-id.js';
|
|
9
10
|
import styles from './textarea.p.module.css.js';
|
|
10
11
|
const SIZE_STYLES = {
|
|
11
12
|
s: styles.sizeS,
|
|
@@ -27,6 +28,7 @@ const Textarea = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comp
|
|
|
27
28
|
className,
|
|
28
29
|
disabled,
|
|
29
30
|
error,
|
|
31
|
+
reserveErrorLine = false,
|
|
30
32
|
busy,
|
|
31
33
|
onChange,
|
|
32
34
|
size = 'm',
|
|
@@ -36,13 +38,17 @@ const Textarea = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comp
|
|
|
36
38
|
value,
|
|
37
39
|
tabIndex,
|
|
38
40
|
label,
|
|
39
|
-
boldLabel =
|
|
41
|
+
boldLabel = true,
|
|
40
42
|
note,
|
|
43
|
+
characterCounter,
|
|
41
44
|
...restProps
|
|
42
45
|
} = _ref;
|
|
43
46
|
const theme = useThemeWithUndefined(themeFromProps);
|
|
44
47
|
const isEmpty = !value;
|
|
45
48
|
const [focused, setFocused] = useState(false);
|
|
49
|
+
const uniqueId = `textarea-${useBackwardCompatibleId()}`;
|
|
50
|
+
const errorId = `${id ? id : uniqueId}-error`;
|
|
51
|
+
const hasFooter = Boolean(note) || Boolean(characterCounter) || shouldRenderErrorMessage(error, reserveErrorLine);
|
|
46
52
|
return /*#__PURE__*/React.createElement("label", {
|
|
47
53
|
ref: ref,
|
|
48
54
|
className: cn(styles.labelWrapper, SIZE_STYLES[size], MODE_STYLES[mode], THEME_STYLES[theme], !!error && styles.error, disabled ? styles.disabled : styles.enabled, focused && styles.focused, boldLabel && styles.boldLabel, isEmpty ? styles.empty : styles.filled, className),
|
|
@@ -62,7 +68,8 @@ const Textarea = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comp
|
|
|
62
68
|
value: value,
|
|
63
69
|
onChange: onChange,
|
|
64
70
|
ref: textareaRef,
|
|
65
|
-
"aria-
|
|
71
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
72
|
+
"aria-invalid": Boolean(error),
|
|
66
73
|
tabIndex: disabled ? -1 : tabIndex,
|
|
67
74
|
"data-test": 'textarea__input',
|
|
68
75
|
"data-rs-internal": "textarea__inner"
|
|
@@ -72,19 +79,20 @@ const Textarea = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comp
|
|
|
72
79
|
"data-test": "textarea__busy-icon",
|
|
73
80
|
"data-rs-internal": "textarea__busy-icon",
|
|
74
81
|
"data-render-all-sizes": true
|
|
75
|
-
}))),
|
|
82
|
+
}))), hasFooter && /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: styles.footer
|
|
84
|
+
}, characterCounter && /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: styles.characterCounter
|
|
86
|
+
}, characterCounter), /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
87
|
+
id: errorId,
|
|
76
88
|
className: styles.errorMessage,
|
|
77
89
|
"data-test": 'textarea__error',
|
|
78
|
-
|
|
79
|
-
}, /*#__PURE__*/React.createElement(
|
|
80
|
-
className: styles.errorIcon,
|
|
81
|
-
"data-rs-internal": "textarea__error-icon",
|
|
82
|
-
"data-render-all-sizes": true
|
|
83
|
-
}), /*#__PURE__*/React.createElement("span", null, error)), note && /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
reserveLine: reserveErrorLine
|
|
91
|
+
}, error), note && /*#__PURE__*/React.createElement("div", {
|
|
84
92
|
className: styles.note,
|
|
85
93
|
"data-test": 'textarea__note',
|
|
86
94
|
"data-rs-internal": "textarea__note"
|
|
87
|
-
}, note));
|
|
95
|
+
}, note)));
|
|
88
96
|
});
|
|
89
97
|
Textarea.displayName = 'Textarea';
|
|
90
98
|
Textarea.propTypes = {
|
|
@@ -93,7 +101,7 @@ Textarea.propTypes = {
|
|
|
93
101
|
placeholder: PropTypes.string,
|
|
94
102
|
disabled: PropTypes.bool,
|
|
95
103
|
busy: PropTypes.bool,
|
|
96
|
-
error:
|
|
104
|
+
error: ErrorMessage.propTypes.children,
|
|
97
105
|
onChange: PropTypes.func,
|
|
98
106
|
onFocus: PropTypes.func,
|
|
99
107
|
onBlur: PropTypes.func,
|
|
@@ -105,6 +113,7 @@ Textarea.propTypes = {
|
|
|
105
113
|
maxRows: PropTypes.number,
|
|
106
114
|
label: PropTypes.node,
|
|
107
115
|
note: PropTypes.node,
|
|
116
|
+
characterCounter: PropTypes.node,
|
|
108
117
|
boldLabel: PropTypes.bool
|
|
109
118
|
};
|
|
110
119
|
export { Textarea };
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"themeLight": "
|
|
3
|
-
"themeDark": "
|
|
4
|
-
"sizeS": "
|
|
5
|
-
"sizeM": "
|
|
6
|
-
"sizeL": "
|
|
7
|
-
"classic": "
|
|
8
|
-
"rock": "
|
|
9
|
-
"labelWrapper": "
|
|
10
|
-
"wrapper": "
|
|
11
|
-
"error": "
|
|
12
|
-
"disabled": "
|
|
13
|
-
"enabled": "
|
|
14
|
-
"focused": "
|
|
15
|
-
"filled": "
|
|
16
|
-
"inner": "
|
|
17
|
-
"busyIcon": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
2
|
+
"themeLight": "_themeLight_mozuuu_8",
|
|
3
|
+
"themeDark": "_themeDark_mozuuu_11",
|
|
4
|
+
"sizeS": "_sizeS_mozuuu_15",
|
|
5
|
+
"sizeM": "_sizeM_mozuuu_18",
|
|
6
|
+
"sizeL": "_sizeL_mozuuu_21",
|
|
7
|
+
"classic": "_classic_mozuuu_25",
|
|
8
|
+
"rock": "_rock_mozuuu_28",
|
|
9
|
+
"labelWrapper": "_labelWrapper_mozuuu_32",
|
|
10
|
+
"wrapper": "_wrapper_mozuuu_40",
|
|
11
|
+
"error": "_error_mozuuu_57",
|
|
12
|
+
"disabled": "_disabled_mozuuu_63",
|
|
13
|
+
"enabled": "_enabled_mozuuu_69",
|
|
14
|
+
"focused": "_focused_mozuuu_69",
|
|
15
|
+
"filled": "_filled_mozuuu_75",
|
|
16
|
+
"inner": "_inner_mozuuu_91",
|
|
17
|
+
"busyIcon": "_busyIcon_mozuuu_177",
|
|
18
|
+
"label": "_label_mozuuu_32",
|
|
19
|
+
"footer": "_footer_mozuuu_208",
|
|
20
|
+
"characterCounter": "_characterCounter_mozuuu_227",
|
|
21
|
+
"errorMessage": "_errorMessage_mozuuu_236",
|
|
22
|
+
"note": "_note_mozuuu_240"
|
|
22
23
|
};
|
|
23
24
|
export { styles as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
const useBackwardCompatibleId = () => {
|
|
4
|
+
const id = useRef(null);
|
|
5
|
+
|
|
6
|
+
if (id.current === null) {
|
|
7
|
+
id.current = useBackwardCompatibleId.counter++;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return (React.useId ? React.useId : () => id.current)();
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
useBackwardCompatibleId.counter = 0;
|
|
14
|
+
export { useBackwardCompatibleId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescui/textarea",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "JetBrains",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@babel/runtime-corejs3": "^7.26.0",
|
|
19
|
+
"@rescui/form-field": "^0.1.1",
|
|
19
20
|
"classnames": "^2.2.6",
|
|
20
21
|
"react-textarea-autosize": "^8.3.4"
|
|
21
22
|
},
|
|
@@ -25,10 +26,10 @@
|
|
|
25
26
|
"react": ">=16.8.0 <20"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@rescui/colors": "0.
|
|
29
|
-
"@rescui/scripts": "0.5.1",
|
|
30
|
-
"@rescui/typography": "0.
|
|
31
|
-
"@rescui/visual-regression": "0.1.4",
|
|
29
|
+
"@rescui/colors": "^0.3.0",
|
|
30
|
+
"@rescui/scripts": "^0.5.1",
|
|
31
|
+
"@rescui/typography": "^0.25.0",
|
|
32
|
+
"@rescui/visual-regression": "^0.1.4",
|
|
32
33
|
"@types/classnames": "^2.2.11"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
|
|
37
38
|
},
|
|
38
39
|
"nx": {},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "59db2e6ea5eabdcabc035779df2611d0df5a0cbe"
|
|
40
41
|
}
|