@rescui/textarea 0.7.5 → 0.7.7

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.
@@ -6,40 +6,6 @@
6
6
  }
7
7
  &:not(html) [data-rs-internal='textarea__busy-icon']:not(html){
8
8
  --_rs-icons-height:20px;
9
- }
10
- &:not(html) [data-rs-internal='textarea__inner']::-webkit-input-placeholder{
11
- --_rs-typography-letter-spacing:0.0045em;
12
- --_rs-typography-text-transform:initial;
13
- --_rs-typography-font-variant-numeric:initial;
14
- --_rs-typography-font-family:var(
15
- --rs-font-family-ui,
16
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
17
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
18
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
19
- );
20
- --_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
21
- --_rs-typography-font-weight:var(
22
- --rs-font-weight-regular,
23
- 400
24
- );
25
- --_rs-typography-line-height:var(
26
- --rs-text-3-line-height,
27
- 20px
28
- );
29
- --_rs-typography-base-color:var(
30
- --_rs-typography-hardness-color,
31
- var(
32
- --rs-color-average,
33
- 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)
34
- )
35
- );
36
- --_rs-typography-text-auto-offset:8px;
37
- --_rs-typography-ul-list-li-padding-left:28px;
38
- --_rs-typography-ol-list-li-padding-left:21px;
39
- --_rs-typography-list-li-margin-top-from-text:8px;
40
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
41
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
42
- --_rs-typography-link-border-bottom-width-from-text:1px;
43
9
  }
44
10
  &:not(html) [data-rs-internal='textarea__inner']::-moz-placeholder{
45
11
  --_rs-typography-letter-spacing:0.0045em;
@@ -65,74 +31,6 @@
65
31
  var(
66
32
  --rs-color-average,
67
33
  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)
68
- )
69
- );
70
- --_rs-typography-text-auto-offset:8px;
71
- --_rs-typography-ul-list-li-padding-left:28px;
72
- --_rs-typography-ol-list-li-padding-left:21px;
73
- --_rs-typography-list-li-margin-top-from-text:8px;
74
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
75
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
76
- --_rs-typography-link-border-bottom-width-from-text:1px;
77
- }
78
- &:not(html) [data-rs-internal='textarea__inner']:-ms-input-placeholder{
79
- --_rs-typography-letter-spacing:0.0045em;
80
- --_rs-typography-text-transform:initial;
81
- --_rs-typography-font-variant-numeric:initial;
82
- --_rs-typography-font-family:var(
83
- --rs-font-family-ui,
84
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
85
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
86
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
87
- );
88
- --_rs-typography-font-size:var(--rs-text-3-font-size, 13px);
89
- --_rs-typography-font-weight:var(
90
- --rs-font-weight-regular,
91
- 400
92
- );
93
- --_rs-typography-line-height:var(
94
- --rs-text-3-line-height,
95
- 20px
96
- );
97
- --_rs-typography-base-color:var(
98
- --_rs-typography-hardness-color,
99
- var(
100
- --rs-color-average,
101
- 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)
102
- )
103
- );
104
- --_rs-typography-text-auto-offset:8px;
105
- --_rs-typography-ul-list-li-padding-left:28px;
106
- --_rs-typography-ol-list-li-padding-left:21px;
107
- --_rs-typography-list-li-margin-top-from-text:8px;
108
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
109
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
110
- --_rs-typography-link-border-bottom-width-from-text:1px;
111
- }
112
- &:not(html) [data-rs-internal='textarea__inner']::-ms-input-placeholder{
113
- --_rs-typography-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
34
  )
137
35
  );
138
36
  --_rs-typography-text-auto-offset:8px;
@@ -288,45 +186,6 @@
288
186
  }
289
187
  &:not(html) [data-rs-internal='textarea__busy-icon']:not(html){
290
188
  --_rs-icons-height:24px;
291
- }
292
- &:not(html) [data-rs-internal='textarea__inner']::-webkit-input-placeholder{
293
- --_rs-typography-letter-spacing:0.0015em;
294
- --_rs-typography-text-transform:initial;
295
- --_rs-typography-font-variant-numeric:initial;
296
- --_rs-typography-font-family:var(
297
- --rs-font-family-ui,
298
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
299
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
300
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
301
- );
302
- --_rs-typography-font-size:var(--rs-text-2-font-size, 16px);
303
- --_rs-typography-font-weight:var(
304
- --rs-font-weight-regular,
305
- 400
306
- );
307
- --_rs-typography-line-height:var(
308
- --rs-text-2-line-height,
309
- 24px
310
- );
311
- --_rs-typography-base-color:var(
312
- --_rs-typography-hardness-color,
313
- var(
314
- --rs-color-average,
315
- 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)
316
- )
317
- );
318
- --_rs-typography-text-auto-offset:16px;
319
- --_rs-typography-ul-list-li-padding-left:22px;
320
- --_rs-typography-ol-list-li-padding-left:26px;
321
- --_rs-typography-list-li-margin-top-from-text:16px;
322
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
323
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
324
- --_rs-typography-link-border-bottom-width-from-text:1px;
325
- }
326
- @media screen and (max-width: 640px){
327
- &:not(html) [data-rs-internal='textarea__inner']::-webkit-input-placeholder{
328
- --_rs-typography-list-li-margin-top-from-text:12px;
329
- }
330
189
  }
331
190
  &:not(html) [data-rs-internal='textarea__inner']::-moz-placeholder{
332
191
  --_rs-typography-letter-spacing:0.0015em;
@@ -366,84 +225,6 @@
366
225
  &:not(html) [data-rs-internal='textarea__inner']::-moz-placeholder{
367
226
  --_rs-typography-list-li-margin-top-from-text:12px;
368
227
  }
369
- }
370
- &:not(html) [data-rs-internal='textarea__inner']:-ms-input-placeholder{
371
- --_rs-typography-letter-spacing:0.0015em;
372
- --_rs-typography-text-transform:initial;
373
- --_rs-typography-font-variant-numeric:initial;
374
- --_rs-typography-font-family:var(
375
- --rs-font-family-ui,
376
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
377
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
378
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
379
- );
380
- --_rs-typography-font-size:var(--rs-text-2-font-size, 16px);
381
- --_rs-typography-font-weight:var(
382
- --rs-font-weight-regular,
383
- 400
384
- );
385
- --_rs-typography-line-height:var(
386
- --rs-text-2-line-height,
387
- 24px
388
- );
389
- --_rs-typography-base-color:var(
390
- --_rs-typography-hardness-color,
391
- var(
392
- --rs-color-average,
393
- 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)
394
- )
395
- );
396
- --_rs-typography-text-auto-offset:16px;
397
- --_rs-typography-ul-list-li-padding-left:22px;
398
- --_rs-typography-ol-list-li-padding-left:26px;
399
- --_rs-typography-list-li-margin-top-from-text:16px;
400
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
401
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
402
- --_rs-typography-link-border-bottom-width-from-text:1px;
403
- }
404
- @media screen and (max-width: 640px){
405
- &:not(html) [data-rs-internal='textarea__inner']:-ms-input-placeholder{
406
- --_rs-typography-list-li-margin-top-from-text:12px;
407
- }
408
- }
409
- &:not(html) [data-rs-internal='textarea__inner']::-ms-input-placeholder{
410
- --_rs-typography-letter-spacing:0.0015em;
411
- --_rs-typography-text-transform:initial;
412
- --_rs-typography-font-variant-numeric:initial;
413
- --_rs-typography-font-family:var(
414
- --rs-font-family-ui,
415
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
416
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
417
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
418
- );
419
- --_rs-typography-font-size:var(--rs-text-2-font-size, 16px);
420
- --_rs-typography-font-weight:var(
421
- --rs-font-weight-regular,
422
- 400
423
- );
424
- --_rs-typography-line-height:var(
425
- --rs-text-2-line-height,
426
- 24px
427
- );
428
- --_rs-typography-base-color:var(
429
- --_rs-typography-hardness-color,
430
- var(
431
- --rs-color-average,
432
- 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)
433
- )
434
- );
435
- --_rs-typography-text-auto-offset:16px;
436
- --_rs-typography-ul-list-li-padding-left:22px;
437
- --_rs-typography-ol-list-li-padding-left:26px;
438
- --_rs-typography-list-li-margin-top-from-text:16px;
439
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
440
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
441
- --_rs-typography-link-border-bottom-width-from-text:1px;
442
- }
443
- @media screen and (max-width: 640px){
444
- &:not(html) [data-rs-internal='textarea__inner']::-ms-input-placeholder{
445
- --_rs-typography-list-li-margin-top-from-text:12px;
446
- }
447
228
  }
448
229
  &:not(html) [data-rs-internal='textarea__label'],
449
230
  &:not(html) [data-rs-internal='textarea__inner'],
@@ -598,45 +379,6 @@
598
379
  }
599
380
  &:not(html) [data-rs-internal='textarea__busy-icon']:not(html){
600
381
  --_rs-icons-height:28px;
601
- }
602
- &:not(html) [data-rs-internal='textarea__inner']::-webkit-input-placeholder{
603
- --_rs-typography-letter-spacing:normal;
604
- --_rs-typography-text-transform:initial;
605
- --_rs-typography-font-variant-numeric:initial;
606
- --_rs-typography-font-family:var(
607
- --rs-font-family-ui,
608
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
609
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
610
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
611
- );
612
- --_rs-typography-font-size:var(--rs-text-1-font-size, 20px);
613
- --_rs-typography-font-weight:var(
614
- --rs-font-weight-regular,
615
- 400
616
- );
617
- --_rs-typography-line-height:var(
618
- --rs-text-1-line-height,
619
- 28px
620
- );
621
- --_rs-typography-base-color:var(
622
- --_rs-typography-hardness-color,
623
- var(
624
- --rs-color-average,
625
- 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)
626
- )
627
- );
628
- --_rs-typography-text-auto-offset:32px;
629
- --_rs-typography-ul-list-li-padding-left:26px;
630
- --_rs-typography-ol-list-li-padding-left:32px;
631
- --_rs-typography-list-li-margin-top-from-text:24px;
632
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
633
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
634
- --_rs-typography-link-border-bottom-width-from-text:1px;
635
- }
636
- @media screen and (max-width: 640px){
637
- &:not(html) [data-rs-internal='textarea__inner']::-webkit-input-placeholder{
638
- --_rs-typography-list-li-margin-top-from-text:16px;
639
- }
640
382
  }
641
383
  &:not(html) [data-rs-internal='textarea__inner']::-moz-placeholder{
642
384
  --_rs-typography-letter-spacing:normal;
@@ -676,84 +418,6 @@
676
418
  &:not(html) [data-rs-internal='textarea__inner']::-moz-placeholder{
677
419
  --_rs-typography-list-li-margin-top-from-text:16px;
678
420
  }
679
- }
680
- &:not(html) [data-rs-internal='textarea__inner']:-ms-input-placeholder{
681
- --_rs-typography-letter-spacing:normal;
682
- --_rs-typography-text-transform:initial;
683
- --_rs-typography-font-variant-numeric:initial;
684
- --_rs-typography-font-family:var(
685
- --rs-font-family-ui,
686
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
687
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
688
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
689
- );
690
- --_rs-typography-font-size:var(--rs-text-1-font-size, 20px);
691
- --_rs-typography-font-weight:var(
692
- --rs-font-weight-regular,
693
- 400
694
- );
695
- --_rs-typography-line-height:var(
696
- --rs-text-1-line-height,
697
- 28px
698
- );
699
- --_rs-typography-base-color:var(
700
- --_rs-typography-hardness-color,
701
- var(
702
- --rs-color-average,
703
- 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)
704
- )
705
- );
706
- --_rs-typography-text-auto-offset:32px;
707
- --_rs-typography-ul-list-li-padding-left:26px;
708
- --_rs-typography-ol-list-li-padding-left:32px;
709
- --_rs-typography-list-li-margin-top-from-text:24px;
710
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
711
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
712
- --_rs-typography-link-border-bottom-width-from-text:1px;
713
- }
714
- @media screen and (max-width: 640px){
715
- &:not(html) [data-rs-internal='textarea__inner']:-ms-input-placeholder{
716
- --_rs-typography-list-li-margin-top-from-text:16px;
717
- }
718
- }
719
- &:not(html) [data-rs-internal='textarea__inner']::-ms-input-placeholder{
720
- --_rs-typography-letter-spacing:normal;
721
- --_rs-typography-text-transform:initial;
722
- --_rs-typography-font-variant-numeric:initial;
723
- --_rs-typography-font-family:var(
724
- --rs-font-family-ui,
725
- var(--rs-font-family-jb-sans, 'JetBrains Sans', Inter, system-ui, -apple-system,
726
- BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
727
- 'Droid Sans', 'Helvetica Neue', Arial, sans-serif)
728
- );
729
- --_rs-typography-font-size:var(--rs-text-1-font-size, 20px);
730
- --_rs-typography-font-weight:var(
731
- --rs-font-weight-regular,
732
- 400
733
- );
734
- --_rs-typography-line-height:var(
735
- --rs-text-1-line-height,
736
- 28px
737
- );
738
- --_rs-typography-base-color:var(
739
- --_rs-typography-hardness-color,
740
- var(
741
- --rs-color-average,
742
- 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)
743
- )
744
- );
745
- --_rs-typography-text-auto-offset:32px;
746
- --_rs-typography-ul-list-li-padding-left:26px;
747
- --_rs-typography-ol-list-li-padding-left:32px;
748
- --_rs-typography-list-li-margin-top-from-text:24px;
749
- --_rs-typography-link-standalone-border-offset-from-text-base:1.15em;
750
- --_rs-typography-link-external-standalone-border-offset-from-text-base:1.02em;
751
- --_rs-typography-link-border-bottom-width-from-text:1px;
752
- }
753
- @media screen and (max-width: 640px){
754
- &:not(html) [data-rs-internal='textarea__inner']::-ms-input-placeholder{
755
- --_rs-typography-list-li-margin-top-from-text:16px;
756
- }
757
421
  }
758
422
  &:not(html) [data-rs-internal='textarea__label'],
759
423
  &:not(html) [data-rs-internal='textarea__inner'],
package/lib/textarea.js CHANGED
@@ -1,19 +1,3 @@
1
- import "core-js/modules/es.object.to-string.js";
2
- import "core-js/modules/web.dom-collections.for-each.js";
3
- import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
4
- import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
5
- import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
6
- import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
7
- import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
8
- import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
9
- import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
10
- import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
11
- var _excluded = ["id", "className", "disabled", "error", "busy", "onChange", "size", "mode", "theme", "textareaRef", "value", "tabIndex", "label", "boldLabel", "note"];
12
-
13
- function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
-
15
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
16
-
17
1
  import React, { useState } from 'react';
18
2
  import PropTypes from 'prop-types';
19
3
  import TextareaAutosize from 'react-textarea-autosize';
@@ -22,49 +6,42 @@ import cn from 'classnames';
22
6
  import LoadingIcon from './_virtual/loading.js';
23
7
  import WarningIcon from './_virtual/warning.js';
24
8
  import styles from './textarea.p.module.css.js';
25
- var SIZE_STYLES = {
9
+ const SIZE_STYLES = {
26
10
  s: styles.sizeS,
27
11
  m: styles.sizeM,
28
12
  l: styles.sizeL
29
13
  };
30
- var THEME_STYLES = {
14
+ const THEME_STYLES = {
31
15
  light: styles.themeLight,
32
16
  dark: styles.themeDark
33
17
  };
34
- var MODE_STYLES = {
18
+ const MODE_STYLES = {
35
19
  classic: styles.classic,
36
20
  rock: styles.rock
37
21
  };
38
- var Textarea = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line complexity
39
- function (_ref, ref) {
40
- var id = _ref.id,
41
- className = _ref.className,
42
- disabled = _ref.disabled,
43
- error = _ref.error,
44
- busy = _ref.busy,
45
- onChange = _ref.onChange,
46
- _ref$size = _ref.size,
47
- size = _ref$size === void 0 ? 'm' : _ref$size,
48
- _ref$mode = _ref.mode,
49
- mode = _ref$mode === void 0 ? 'classic' : _ref$mode,
50
- themeFromProps = _ref.theme,
51
- textareaRef = _ref.textareaRef,
52
- value = _ref.value,
53
- tabIndex = _ref.tabIndex,
54
- label = _ref.label,
55
- _ref$boldLabel = _ref.boldLabel,
56
- boldLabel = _ref$boldLabel === void 0 ? false : _ref$boldLabel,
57
- note = _ref.note,
58
- restProps = _objectWithoutProperties(_ref, _excluded);
59
-
60
- var theme = useThemeWithUndefined(themeFromProps);
61
- var isEmpty = !value;
62
-
63
- var _useState = useState(false),
64
- _useState2 = _slicedToArray(_useState, 2),
65
- focused = _useState2[0],
66
- setFocused = _useState2[1];
67
-
22
+ const Textarea = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line complexity
23
+ (_ref, ref) => {
24
+ let {
25
+ id,
26
+ className,
27
+ disabled,
28
+ error,
29
+ busy,
30
+ onChange,
31
+ size = 'm',
32
+ mode = 'classic',
33
+ theme: themeFromProps,
34
+ textareaRef,
35
+ value,
36
+ tabIndex,
37
+ label,
38
+ boldLabel = false,
39
+ note,
40
+ ...restProps
41
+ } = _ref;
42
+ const theme = useThemeWithUndefined(themeFromProps);
43
+ const isEmpty = !value;
44
+ const [focused, setFocused] = useState(false);
68
45
  return /*#__PURE__*/React.createElement("label", {
69
46
  ref: ref,
70
47
  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, className),
@@ -76,13 +53,9 @@ function (_ref, ref) {
76
53
  "data-rs-internal": boldLabel ? 'textarea__bold-label' : 'textarea__label'
77
54
  }, label), /*#__PURE__*/React.createElement("div", {
78
55
  className: styles.wrapper,
79
- onFocus: function onFocus() {
80
- return setFocused(true);
81
- },
82
- onBlur: function onBlur() {
83
- return setFocused(false);
84
- }
85
- }, /*#__PURE__*/React.createElement(TextareaAutosize, _objectSpread(_objectSpread({}, restProps), {}, {
56
+ onFocus: () => setFocused(true),
57
+ onBlur: () => setFocused(false)
58
+ }, /*#__PURE__*/React.createElement(TextareaAutosize, { ...restProps,
86
59
  className: cn(styles.inner, isEmpty ? styles.empty : styles.filled),
87
60
  disabled: disabled,
88
61
  value: value,
@@ -92,7 +65,7 @@ function (_ref, ref) {
92
65
  tabIndex: disabled ? -1 : tabIndex,
93
66
  "data-test": 'textarea__input',
94
67
  "data-rs-internal": "textarea__inner"
95
- })), busy && /*#__PURE__*/React.createElement("span", {
68
+ }), busy && /*#__PURE__*/React.createElement("span", {
96
69
  className: styles.busyIcon
97
70
  }, /*#__PURE__*/React.createElement(LoadingIcon, {
98
71
  "data-test": "textarea__busy-icon",
@@ -1,22 +1,22 @@
1
1
  var styles = {
2
- "themeLight": "_themeLight_1aj65iv_8",
3
- "themeDark": "_themeDark_1aj65iv_11",
4
- "sizeS": "_sizeS_1aj65iv_15",
5
- "sizeM": "_sizeM_1aj65iv_18",
6
- "sizeL": "_sizeL_1aj65iv_21",
7
- "classic": "_classic_1aj65iv_25",
8
- "rock": "_rock_1aj65iv_28",
9
- "labelWrapper": "_labelWrapper_1aj65iv_32",
10
- "wrapper": "_wrapper_1aj65iv_39",
11
- "disabled": "_disabled_1aj65iv_47",
12
- "inner": "_inner_1aj65iv_52",
13
- "focused": "_focused_1aj65iv_104",
14
- "error": "_error_1aj65iv_129",
15
- "filled": "_filled_1aj65iv_133",
16
- "busyIcon": "_busyIcon_1aj65iv_167",
17
- "errorMessage": "_errorMessage_1aj65iv_187",
18
- "errorIcon": "_errorIcon_1aj65iv_199",
19
- "note": "_note_1aj65iv_205",
20
- "label": "_label_1aj65iv_32"
2
+ "themeLight": "_themeLight_1inf9eu_8",
3
+ "themeDark": "_themeDark_1inf9eu_11",
4
+ "sizeS": "_sizeS_1inf9eu_15",
5
+ "sizeM": "_sizeM_1inf9eu_18",
6
+ "sizeL": "_sizeL_1inf9eu_21",
7
+ "classic": "_classic_1inf9eu_25",
8
+ "rock": "_rock_1inf9eu_28",
9
+ "labelWrapper": "_labelWrapper_1inf9eu_32",
10
+ "wrapper": "_wrapper_1inf9eu_39",
11
+ "disabled": "_disabled_1inf9eu_47",
12
+ "inner": "_inner_1inf9eu_52",
13
+ "focused": "_focused_1inf9eu_104",
14
+ "error": "_error_1inf9eu_129",
15
+ "filled": "_filled_1inf9eu_133",
16
+ "busyIcon": "_busyIcon_1inf9eu_167",
17
+ "errorMessage": "_errorMessage_1inf9eu_187",
18
+ "errorIcon": "_errorIcon_1inf9eu_199",
19
+ "note": "_note_1inf9eu_205",
20
+ "label": "_label_1inf9eu_32"
21
21
  };
22
22
  export { styles as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescui/textarea",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "JetBrains",
@@ -14,9 +14,8 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@babel/runtime-corejs3": "^7.14.0",
17
+ "@babel/runtime-corejs3": "^7.26.0",
18
18
  "classnames": "^2.2.6",
19
- "core-js": "^3.9.1",
20
19
  "react-textarea-autosize": "^8.3.4"
21
20
  },
22
21
  "peerDependencies": {
@@ -25,9 +24,9 @@
25
24
  "react": ">=16.8.0 <19"
26
25
  },
27
26
  "devDependencies": {
28
- "@rescui/colors": "^0.2.5",
29
- "@rescui/scripts": "^0.3.4",
30
- "@rescui/typography": "^0.19.0",
27
+ "@rescui/colors": "^0.2.6",
28
+ "@rescui/scripts": "^0.3.5",
29
+ "@rescui/typography": "^0.20.0",
31
30
  "@rescui/visual-regression": "^0.1.2",
32
31
  "@types/classnames": "^2.2.11"
33
32
  },
@@ -36,5 +35,5 @@
36
35
  "build-pcss-api": "rescui-scripts build-pcss-api --file public-api.p.css"
37
36
  },
38
37
  "nx": {},
39
- "gitHead": "69a84812628809943698f0b27643c83dc449f119"
38
+ "gitHead": "5531e3d285d6e38bf5536ff0690a252f1308c49b"
40
39
  }