@rescui/textarea 0.10.2-RUI-286-Fix-tooltip-stacking-f4145b01.1 → 0.11.1-RUI-280-Update-select-component-026338d06.52

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.
@@ -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-list-li-padding-left:28px;
38
- --_rs-typography-ol-list-li-padding-left:21px;
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-list-li-padding-left:28px;
75
- --_rs-typography-ol-list-li-padding-left:21px;
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-list-li-padding-left:initial;
106
- --_rs-typography-ol-list-li-padding-left:initial;
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-list-li-padding-left:22px;
218
- --_rs-typography-ol-list-li-padding-left:26px;
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-list-li-padding-left:22px;
263
- --_rs-typography-ol-list-li-padding-left:26px;
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-list-li-padding-left:initial;
305
- --_rs-typography-ol-list-li-padding-left:initial;
306
- --_rs-typography-list-li-margin-top-from-text:initial;
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-list-li-padding-left:26px;
417
- --_rs-typography-ol-list-li-padding-left:32px;
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-list-li-padding-left:26px;
462
- --_rs-typography-ol-list-li-padding-left:32px;
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-list-li-padding-left:initial;
504
- --_rs-typography-ol-list-li-padding-left:initial;
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 = false,
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-invalid": !!error,
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
- }))), error && typeof error !== 'boolean' && /*#__PURE__*/React.createElement("div", {
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
- "data-rs-internal": "textarea__error-message"
79
- }, /*#__PURE__*/React.createElement(WarningIcon, {
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: PropTypes.node,
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": "_themeLight_bhaxh0_8",
3
- "themeDark": "_themeDark_bhaxh0_11",
4
- "sizeS": "_sizeS_bhaxh0_15",
5
- "sizeM": "_sizeM_bhaxh0_18",
6
- "sizeL": "_sizeL_bhaxh0_21",
7
- "classic": "_classic_bhaxh0_25",
8
- "rock": "_rock_bhaxh0_28",
9
- "labelWrapper": "_labelWrapper_bhaxh0_32",
10
- "wrapper": "_wrapper_bhaxh0_39",
11
- "error": "_error_bhaxh0_56",
12
- "disabled": "_disabled_bhaxh0_62",
13
- "enabled": "_enabled_bhaxh0_68",
14
- "focused": "_focused_bhaxh0_68",
15
- "filled": "_filled_bhaxh0_74",
16
- "inner": "_inner_bhaxh0_90",
17
- "busyIcon": "_busyIcon_bhaxh0_176",
18
- "errorMessage": "_errorMessage_bhaxh0_196",
19
- "errorIcon": "_errorIcon_bhaxh0_208",
20
- "note": "_note_bhaxh0_214",
21
- "label": "_label_bhaxh0_32"
2
+ "themeLight": "_themeLight_r8fqis_8",
3
+ "themeDark": "_themeDark_r8fqis_11",
4
+ "sizeS": "_sizeS_r8fqis_15",
5
+ "sizeM": "_sizeM_r8fqis_18",
6
+ "sizeL": "_sizeL_r8fqis_21",
7
+ "classic": "_classic_r8fqis_25",
8
+ "rock": "_rock_r8fqis_28",
9
+ "labelWrapper": "_labelWrapper_r8fqis_32",
10
+ "wrapper": "_wrapper_r8fqis_40",
11
+ "error": "_error_r8fqis_57",
12
+ "disabled": "_disabled_r8fqis_63",
13
+ "enabled": "_enabled_r8fqis_69",
14
+ "focused": "_focused_r8fqis_69",
15
+ "filled": "_filled_r8fqis_75",
16
+ "inner": "_inner_r8fqis_91",
17
+ "busyIcon": "_busyIcon_r8fqis_177",
18
+ "label": "_label_r8fqis_32",
19
+ "footer": "_footer_r8fqis_208",
20
+ "characterCounter": "_characterCounter_r8fqis_227",
21
+ "errorMessage": "_errorMessage_r8fqis_236",
22
+ "note": "_note_r8fqis_240"
22
23
  };
23
24
  export { styles as default };
@@ -0,0 +1,4 @@
1
+ export declare const useBackwardCompatibleId: {
2
+ (): string | number;
3
+ counter: number;
4
+ };
@@ -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.10.2-RUI-286-Fix-tooltip-stacking-f4145b01.1+f4145b01",
3
+ "version": "0.11.1-RUI-280-Update-select-component-026338d06.52+026338d06",
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-RUI-280-Update-select-component-026338d06.52+026338d06",
19
20
  "classnames": "^2.2.6",
20
21
  "react-textarea-autosize": "^8.3.4"
21
22
  },
@@ -25,9 +26,9 @@
25
26
  "react": ">=16.8.0 <20"
26
27
  },
27
28
  "devDependencies": {
28
- "@rescui/colors": "0.2.13-RUI-286-Fix-tooltip-stacking-f4145b01.50+f4145b01",
29
+ "@rescui/colors": "0.3.1-RUI-280-Update-select-component-026338d06.52+026338d06",
29
30
  "@rescui/scripts": "0.5.1",
30
- "@rescui/typography": "0.24.4-RUI-286-Fix-tooltip-stacking-f4145b01.1+f4145b01",
31
+ "@rescui/typography": "0.24.5-RUI-280-Update-select-component-026338d06.52+026338d06",
31
32
  "@rescui/visual-regression": "0.1.4",
32
33
  "@types/classnames": "^2.2.11"
33
34
  },
@@ -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": "f4145b012449db94a8903565358efc101a5f4ac2"
40
+ "gitHead": "026338d06dba5f4f8b42762b25aca5fb1f28fffb"
40
41
  }
@@ -1,106 +0,0 @@
1
- import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import cn from 'classnames';
5
- import styles from './index.css.js';
6
- const sizeStyles = {
7
- "xs": styles.sizeXS,
8
- "s": styles.sizeS,
9
- "m": styles.sizeM,
10
- "l": styles.sizeL
11
- };
12
- const Size = {
13
- "xs": "xs",
14
- "s": "s",
15
- "m": "m",
16
- "l": "l"
17
- };
18
- const WarningIcon16 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
19
- viewBox: "0 0 16 16"
20
- }, props, {
21
- ref: ref
22
- }), /*#__PURE__*/React.createElement("path", {
23
- d: "m6.303 1.989-5.027 8.874C.483 12.263 1.494 14 3.103 14h9.793c1.609 0 2.62-1.736 1.827-3.137L9.696 1.99C8.949.67 7.05.67 6.303 1.989M8 12a1 1 0 1 1 0-2 1 1 0 0 1 0 2m0-8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0v-4A.5.5 0 0 1 8 4"
24
- })));
25
- WarningIcon16.displayName = 'WarningIcon16';
26
- const WarningIcon20 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
27
- viewBox: "0 0 20 20"
28
- }, props, {
29
- ref: ref
30
- }), /*#__PURE__*/React.createElement("path", {
31
- d: "m8.042 3.141-5.8 10.24C1.327 14.997 2.494 17 4.35 17h11.3c1.856 0 3.023-2.003 2.108-3.62l-5.8-10.239c-.862-1.521-3.054-1.521-3.916 0M10 5.25a.75.75 0 0 1 .75.75v5a.75.75 0 0 1-1.5 0V6a.75.75 0 0 1 .75-.75m0 9.25a1 1 0 1 1 0-2 1 1 0 0 1 0 2"
32
- })));
33
- WarningIcon20.displayName = 'WarningIcon20';
34
- const WarningIcon24 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
35
- viewBox: "0 0 24 24"
36
- }, props, {
37
- ref: ref
38
- }), /*#__PURE__*/React.createElement("path", {
39
- d: "m9.52 3.446-7.346 12.97C1.014 18.463 2.492 21 4.844 21h14.312c2.352 0 3.83-2.537 2.67-4.584L14.48 3.446c-1.092-1.928-3.868-1.928-4.96 0M12 7a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V8a1 1 0 0 1 1-1m0 11a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"
40
- })));
41
- WarningIcon24.displayName = 'WarningIcon24';
42
- const WarningIcon28 = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("svg", _extends({
43
- viewBox: "0 0 28 28"
44
- }, props, {
45
- ref: ref
46
- }), /*#__PURE__*/React.createElement("path", {
47
- d: "M11.26 4.598 3.14 18.933C1.858 21.195 3.492 24 6.09 24h15.82c2.599 0 4.232-2.805 2.951-5.067l-8.12-14.335c-1.207-2.13-4.275-2.13-5.481 0M14 8a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1m0 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"
48
- })));
49
- WarningIcon28.displayName = 'WarningIcon28';
50
- const WarningIcon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
51
- let {
52
- theme,
53
- size: sizeFromProps = "m",
54
- className,
55
- style,
56
- ['data-render-all-sizes']: renderAllSizes = false,
57
- ...props
58
- } = _ref;
59
- const size = sizeFromProps in Size ? sizeFromProps : "m";
60
- const mainProps = { ...props,
61
- className: cn(styles.icon, styles[theme], sizeStyles[size], renderAllSizes && styles.allVariants, className),
62
- style: renderAllSizes ? {
63
- '--rs-icon-ar-width': 28,
64
- '--rs-icon-ar-height': 28,
65
- ...style
66
- } : style,
67
- ref
68
- };
69
-
70
- if (renderAllSizes) {
71
- return /*#__PURE__*/React.createElement("svg", _extends({
72
- viewBox: "0 0 28 28"
73
- }, mainProps), /*#__PURE__*/React.createElement(WarningIcon16, {
74
- className: styles.variant16
75
- }), /*#__PURE__*/React.createElement(WarningIcon20, {
76
- className: styles.variant20
77
- }), /*#__PURE__*/React.createElement(WarningIcon24, {
78
- className: styles.variant24
79
- }), /*#__PURE__*/React.createElement(WarningIcon28, {
80
- className: styles.variant28
81
- }));
82
- }
83
-
84
- if (size === Size['xs']) {
85
- return /*#__PURE__*/React.createElement(WarningIcon16, mainProps);
86
- }
87
-
88
- if (size === Size['s']) {
89
- return /*#__PURE__*/React.createElement(WarningIcon20, mainProps);
90
- }
91
-
92
- if (size === Size['m']) {
93
- return /*#__PURE__*/React.createElement(WarningIcon24, mainProps);
94
- }
95
-
96
- return /*#__PURE__*/React.createElement(WarningIcon28, mainProps);
97
- });
98
- WarningIcon.displayName = 'WarningIcon';
99
- WarningIcon.propTypes = {
100
- className: PropTypes.string,
101
- theme: PropTypes.oneOf(["light", "dark"]),
102
- size: PropTypes.oneOf(["xs", "s", "m", "l"]),
103
- 'data-render-all-sizes': PropTypes.bool,
104
- style: PropTypes.object
105
- };
106
- export { Size, WarningIcon as default };