@redsift/design-system 11.6.0-muiv5-alpha.5 → 11.6.0-muiv5-alpha.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.
Files changed (150) hide show
  1. package/_internal/Alert2.js +182 -39
  2. package/_internal/AppBar.js +240 -29
  3. package/_internal/AppContainer.js +132 -86
  4. package/_internal/AppContent.js +84 -17
  5. package/_internal/Badge2.js +137 -4
  6. package/_internal/BreadcrumbItem.js +85 -3
  7. package/_internal/Breadcrumbs2.js +86 -21
  8. package/_internal/Button2.js +81 -20
  9. package/_internal/ButtonGroup.js +165 -25
  10. package/_internal/ButtonLink.js +74 -18
  11. package/_internal/Card2.js +151 -29
  12. package/_internal/CardActions.js +38 -3
  13. package/_internal/CardBody.js +36 -3
  14. package/_internal/CardHeader.js +77 -3
  15. package/_internal/Checkbox2.js +234 -58
  16. package/_internal/CheckboxGroup.js +182 -4
  17. package/_internal/ConditionalWrapper.js +11 -12
  18. package/_internal/DetailedCard.js +6912 -48
  19. package/_internal/DetailedCardCollapsibleSectionItems.js +58 -3
  20. package/_internal/DetailedCardHeader.js +61 -3
  21. package/_internal/DetailedCardSection.js +166 -3
  22. package/_internal/DetailedCardSectionItem.js +88 -3
  23. package/_internal/Flexbox2.js +85 -22
  24. package/_internal/Grid2.js +87 -24
  25. package/_internal/GridItem.js +34 -3
  26. package/_internal/Heading2.js +107 -3
  27. package/_internal/Icon2.js +206 -5
  28. package/_internal/IconButton.js +71 -3
  29. package/_internal/IconButtonLink.js +65 -18
  30. package/_internal/Item2.js +390 -73
  31. package/_internal/Link2.js +56 -15
  32. package/_internal/LinkButton.js +56 -13
  33. package/_internal/Number2.js +103 -61
  34. package/_internal/NumberField.js +3959 -65
  35. package/_internal/Pill2.js +400 -4
  36. package/_internal/ProgressBar.js +61 -18
  37. package/_internal/Radio2.js +227 -56
  38. package/_internal/RadioGroup.js +170 -4
  39. package/_internal/Shield2.js +220 -4
  40. package/_internal/SideNavigationMenu.js +586 -4
  41. package/_internal/SideNavigationMenuItem.js +299 -4
  42. package/_internal/Skeleton2.js +36 -9
  43. package/_internal/SkeletonCircle.js +52 -3
  44. package/_internal/SkeletonText.js +71 -3
  45. package/_internal/Spinner2.js +319 -29
  46. package/_internal/Switch2.js +310 -56
  47. package/_internal/SwitchGroup.js +182 -4
  48. package/_internal/Text2.js +45 -3
  49. package/_internal/TextArea.js +430 -20
  50. package/_internal/TextField.js +463 -19
  51. package/_internal/alert.js +2 -5
  52. package/_internal/app-bar.js +2 -8
  53. package/_internal/app-container.js +3 -9
  54. package/_internal/app-content.js +2 -5
  55. package/_internal/app-side-panel.js +3 -11
  56. package/_internal/badge.js +2 -6
  57. package/_internal/breadcrumb-item.js +1 -4
  58. package/_internal/breadcrumbs.js +2 -6
  59. package/_internal/button-group.js +2 -5
  60. package/_internal/button-link.js +2 -8
  61. package/_internal/button.js +3 -8
  62. package/_internal/card-actions.js +1 -4
  63. package/_internal/card-body.js +1 -4
  64. package/_internal/card-header.js +1 -8
  65. package/_internal/card.js +2 -11
  66. package/_internal/checkbox-group.js +2 -6
  67. package/_internal/checkbox.js +2 -6
  68. package/_internal/colors.js +87 -91
  69. package/_internal/conditional-wrapper.js +2 -2
  70. package/_internal/detailed-card-collapsible-section-items.js +1 -3
  71. package/_internal/detailed-card-header.js +1 -7
  72. package/_internal/detailed-card-section-item.js +1 -10
  73. package/_internal/detailed-card-section.js +1 -6
  74. package/_internal/detailed-card.js +2 -16
  75. package/_internal/flexbox.js +2 -5
  76. package/_internal/focus-within-group.js +3 -3
  77. package/_internal/fonts.js +4 -6
  78. package/_internal/gradient-border.js +35 -16
  79. package/_internal/grid-item.js +1 -4
  80. package/_internal/grid.js +2 -6
  81. package/_internal/heading.js +2 -6
  82. package/_internal/icon-button-link.js +2 -8
  83. package/_internal/icon-button.js +2 -6
  84. package/_internal/icon.js +2 -6
  85. package/_internal/item.js +2 -8
  86. package/_internal/link-button.js +2 -8
  87. package/_internal/link.js +3 -8
  88. package/_internal/listbox.js +3 -6
  89. package/_internal/number-field.js +2 -9
  90. package/_internal/number.js +2 -7
  91. package/_internal/pill.js +2 -6
  92. package/_internal/progress-bar.js +2 -5
  93. package/_internal/radio-group.js +2 -6
  94. package/_internal/radio.js +2 -6
  95. package/_internal/shared.js +2 -5
  96. package/_internal/shield.js +2 -6
  97. package/_internal/side-navigation-menu-bar.js +3 -9
  98. package/_internal/side-navigation-menu-item.js +2 -8
  99. package/_internal/side-navigation-menu.js +2 -8
  100. package/_internal/skeleton-circle.js +1 -6
  101. package/_internal/skeleton-text.js +2 -6
  102. package/_internal/skeleton.js +1 -7
  103. package/_internal/spinner.js +2 -5
  104. package/_internal/styles.js +235 -17
  105. package/_internal/styles2.js +44 -280
  106. package/_internal/switch-group.js +2 -6
  107. package/_internal/switch.js +2 -6
  108. package/_internal/text-area.js +2 -9
  109. package/_internal/text-field.js +2 -10
  110. package/_internal/text.js +2 -6
  111. package/_internal/theme.js +1 -3
  112. package/_internal/types.js +7 -31
  113. package/_internal/types2.js +18 -29
  114. package/_internal/types3.js +15 -18
  115. package/_internal/useAppSidePanel.js +331 -6
  116. package/_internal/useFocusOnList.js +502 -44
  117. package/_internal/useListboxItem.js +120 -23
  118. package/_internal/useSideNavigationMenuBar.js +371 -7
  119. package/_internal/useTheme.js +10 -8
  120. package/index.d.ts +4667 -0
  121. package/index.js +523 -1674
  122. package/package.json +2 -2
  123. package/_internal/SideNavigationMenuBar.js +0 -9
  124. package/_internal/helpers.js +0 -23
  125. package/_internal/types10.js +0 -20
  126. package/_internal/types11.js +0 -27
  127. package/_internal/types12.js +0 -35
  128. package/_internal/types13.js +0 -143
  129. package/_internal/types14.js +0 -11
  130. package/_internal/types15.js +0 -62
  131. package/_internal/types16.js +0 -56
  132. package/_internal/types17.js +0 -57
  133. package/_internal/types18.js +0 -40
  134. package/_internal/types19.js +0 -101
  135. package/_internal/types20.js +0 -47
  136. package/_internal/types21.js +0 -68
  137. package/_internal/types22.js +0 -52
  138. package/_internal/types23.js +0 -174
  139. package/_internal/types24.js +0 -18
  140. package/_internal/types25.js +0 -12
  141. package/_internal/types26.js +0 -36
  142. package/_internal/types27.js +0 -72
  143. package/_internal/types28.js +0 -73
  144. package/_internal/types29.js +0 -99
  145. package/_internal/types4.js +0 -67
  146. package/_internal/types5.js +0 -11
  147. package/_internal/types6.js +0 -11
  148. package/_internal/types7.js +0 -28
  149. package/_internal/types8.js +0 -72
  150. package/_internal/types9.js +0 -16
@@ -1,34 +1,444 @@
1
- import { MutableRefObject, ComponentProps, ChangeEvent } from 'react';
2
- import { b as TextFieldProps, S as StyledTextFieldProps } from './types29.js';
3
- import { V as ValueOf, C as Comp } from './helpers.js';
1
+ import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
2
+ import React__default, { useState, forwardRef, useCallback, useEffect } from 'react';
3
+ import classNames from 'classnames';
4
+ import { w as warnIfNoAccessibleLabelFound } from './warnIfNoAccessibleLabelFound.js';
5
+ import styled, { css } from 'styled-components';
6
+ import { i as baseStyling } from './styles4.js';
7
+ import { T as Theme, B as ButtonsColorPalette } from './colors.js';
8
+ import { u as useFocusRing, a as useFocusWithin } from './useFocusRing.js';
9
+ import { u as useTheme } from './useTheme.js';
10
+ import { u as useId } from './useId.js';
11
+ import { a as Icon } from './Icon2.js';
12
+ import { F as Flexbox } from './Flexbox2.js';
13
+
14
+ /**
15
+ * Hook that allows to calculate the number of rows needed for a text area.
16
+ * @param minimumRows Minimum number of rows that we want to display.
17
+ * @return rows to be used and a callback to recalculate
18
+ */
19
+ const useComputeNumberOfRows = minimumRows => {
20
+ const [rows, setRows] = useState(minimumRows);
21
+ const recompute = target => {
22
+ /**
23
+ * HEAD's UP! This part is a little bit tricky. The idea here is to only
24
+ * display the necessary rows on the textarea. In order to dynamically adjust
25
+ * the height on that field, we need to:
26
+ * 1. Set the current amount of rows to the minimum. That will make the scroll appear.
27
+ * 2. With that, we will have the `scrollHeight`, meaning the height of the container adjusted to the current content
28
+ * 3. With the scroll height, we can figure out how many rows we need to use by dividing the scroll height
29
+ * by the line height.
30
+ * 4. With that number, we can readjust the number of rows on the text area. We need to do that here, if we leave that to
31
+ * the state change through React, there are some scenarios (resize, hitting ENTER or BACKSPACE which add or remove lines)
32
+ * when we will not see the update and the rows will be resized to the minimum.
33
+ * 5. In case there is any other update on the component that changes the UI, we need to keep the number of rows
34
+ * on the state in order to allow React to re-render. Therefore, we save them using `useState`
35
+ */
36
+ // eslint-disable-next-line no-param-reassign
37
+ target.rows = minimumRows;
38
+ let currentRows = target.scrollHeight / (target.clientHeight / minimumRows);
39
+ currentRows = currentRows >= minimumRows ? currentRows : minimumRows;
40
+ // eslint-disable-next-line no-param-reassign
41
+ target.rows = currentRows;
42
+ setRows(currentRows);
43
+ };
44
+ return {
45
+ recomputeNumberOfRows: recompute,
46
+ rows
47
+ };
48
+ };
4
49
 
5
50
  /**
6
51
  * Component variant.
7
52
  */
8
- declare const TextAreaVariant: {
9
- readonly default: "default";
10
- readonly underline: "underline";
53
+ const TextAreaVariant = {
54
+ default: 'default',
55
+ underline: 'underline'
11
56
  };
12
- type TextAreaVariant = ValueOf<typeof TextAreaVariant>;
57
+
13
58
  /**
14
59
  * Component props.
15
60
  */
16
- interface TextAreaProps extends Omit<TextFieldProps, 'onChange' | 'inputRef' | 'inputProps' | 'pills' | 'internal' | 'hasClearButton' | 'onClear'> {
17
- /** Custom ref object to pass to the textarea element. */
18
- textareaRef?: MutableRefObject<HTMLTextAreaElement>;
19
- /** Custom props to pass to the textarea element. */
20
- textareaProps?: ComponentProps<'textarea'>;
21
- /** Method to handle component change. */
22
- onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLTextAreaElement>): void;
23
- /** Minimum number of rows displayed in multiline mode (requires `multiline` to be enabled). */
24
- minimumRows?: number;
25
- }
26
- type StyledTextAreaProps = StyledTextFieldProps;
61
+
62
+ /**
63
+ * Component style.
64
+ */
65
+ const StyledTextArea = styled.div`
66
+ height: fit-content;
67
+ position: relative;
68
+ width: fit-content;
69
+ margin: 0;
70
+ min-width: 0;
71
+ padding: 0;
72
+ ${baseStyling}
73
+
74
+ border: 0;
75
+ display: inline-flex;
76
+ flex-direction: column;
77
+ vertical-align: top;
78
+
79
+ ${_ref => {
80
+ let {
81
+ label,
82
+ $hasLeftIcon,
83
+ $hasContent,
84
+ $isFocused,
85
+ $isDisabled,
86
+ $isInvalid,
87
+ $color,
88
+ $isGradient,
89
+ $theme,
90
+ $variant
91
+ } = _ref;
92
+ return css`
93
+ ${$isDisabled ? css`
94
+ pointer-events: none;
95
+ ` : ''}
96
+
97
+ .redsift-text-area__label {
98
+ font-family: var(--redsift-typography-input-text-font-family);
99
+ font-size: var(--redsift-typography-input-text-font-size);
100
+ font-weight: var(--redsift-typography-input-text-font-weight);
101
+ line-height: var(--redsift-typography-input-text-line-height);
102
+ left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};
103
+ overflow: hidden;
104
+ pointer-events: none;
105
+ position: absolute;
106
+ text-overflow: ellipsis;
107
+ top: ${$hasContent ? '-8px' : '-6px'};
108
+ transform-origin: top left;
109
+ transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,
110
+ max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
111
+ white-space: nowrap;
112
+ z-index: 1;
113
+
114
+ ${!$hasContent ? css`
115
+ max-width: calc(100% - 24px);
116
+ transform: translate(${$variant === TextAreaVariant.underline ? '0px' : '14px'}, 16px) scale(1);
117
+ ` : css`
118
+ max-width: calc(133% - 32px);
119
+ transform: translate(${$variant === TextAreaVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);
120
+ `}
121
+
122
+ ${!$isGradient ? css`
123
+ color: var(
124
+ --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid ? 'error' : $isFocused ? $color : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}
125
+ );
126
+ ` : css`
127
+ background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});
128
+ ${$variant !== TextAreaVariant.underline ? css`
129
+ padding-right: 7px;
130
+ padding-left: 5px;
131
+ ` : ''}
132
+ > span {
133
+ background: var(
134
+ --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid ? 'error' : $isFocused ? $color : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}
135
+ );
136
+ background-clip: text;
137
+ color: transparent;
138
+ }
139
+ `}
140
+ }
141
+
142
+ .redsift-text-area__text-area-wrapper {
143
+ align-items: flex-start;
144
+ box-sizing: border-box;
145
+ cursor: text;
146
+ display: inline-flex;
147
+ min-height: 42px;
148
+ position: relative;
149
+ width: 100%;
150
+ }
151
+
152
+ .redsift-text-area-text-area-wrapper__text-area {
153
+ textarea {
154
+ background: transparent;
155
+ display: block;
156
+ border: none;
157
+ outline: none;
158
+ width: 100%;
159
+ padding: 0;
160
+ margin: 0;
161
+ box-sizing: content-box;
162
+ font-family: var(--redsift-typography-input-text-font-family);
163
+ font-size: 14px;
164
+ font-weight: var(--redsift-typography-input-text-font-weight);
165
+ line-height: var(--redsift-typography-input-text-line-height);
166
+ resize: none;
167
+
168
+ ${$isDisabled ? css`
169
+ color: var(--redsift-color-neutral-light-grey);
170
+ ` : css`
171
+ color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});
172
+ `}
173
+ }
174
+
175
+ flex: 1 1 auto;
176
+ padding-bottom: 9px;
177
+ ${$variant !== TextAreaVariant.underline && !$hasLeftIcon ? css`
178
+ padding-left: 16px;
179
+ ` : ''}
180
+ padding-top: ${label ? '10px' : '9px'};
181
+ padding-right: 8px;
182
+ }
183
+
184
+ .redsift-text-area-text-area-wrapper-pills-and-text-area__text-area::placeholder {
185
+ color: var(--redsift-color-neutral-mid-grey);
186
+ }
187
+
188
+ .redsift-text-area-text-area-wrapper-pills-and-text-area__text-area:focus {
189
+ outline: 0;
190
+ }
191
+
192
+ .redsift-text-area-text-area-wrapper__fieldset {
193
+ border-style: solid;
194
+ bottom: 0;
195
+ left: 1px;
196
+ margin: 0;
197
+ min-width: 0%;
198
+ overflow: hidden;
199
+ padding: 0 8px;
200
+ pointer-events: none;
201
+ position: absolute;
202
+ right: 0;
203
+ text-align: left;
204
+ top: -5px;
205
+
206
+ ${!$isGradient || $isDisabled || !$isFocused || $isInvalid ? css`
207
+ ${$variant === TextAreaVariant.underline ? css`
208
+ border-bottom-width: 2px;
209
+ ` : css`
210
+ border-radius: 4px;
211
+ border-width: 2px;
212
+ `}
213
+ border-color: var(
214
+ --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid ? 'error' : $isFocused ? $color : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}
215
+ );
216
+ ` : css`
217
+ ${$variant === TextAreaVariant.underline ? css`
218
+ border-bottom: 2px solid transparent;
219
+ ` : css`
220
+ border: 2px solid transparent;
221
+ border-radius: 4px;
222
+ `}
223
+ background: transparent;
224
+ background-clip: padding-box, border-box;
225
+ background-origin: border-box;
226
+ background-image: linear-gradient(
227
+ 90deg,
228
+ var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),
229
+ var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})
230
+ ),
231
+ var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);
232
+ `}
233
+ }
234
+
235
+ .redsift-text-area-text-area-wrapper-fieldset__legend {
236
+ display: block;
237
+ float: unset;
238
+ font-size: 11px;
239
+ height: 11px;
240
+ overflow: hidden;
241
+ padding: 0;
242
+ visibility: hidden;
243
+ white-space: nowrap;
244
+ width: auto;
245
+
246
+ ${!$hasContent ? css`
247
+ max-width: 0.01px;
248
+ transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;
249
+ ` : css`
250
+ max-width: 100%;
251
+ transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;
252
+ `}
253
+ }
254
+
255
+ .redsift-text-area-text-area-wrapper-fieldset__legend > span {
256
+ display: inline-block;
257
+ opacity: 0;
258
+ padding-left: 5px;
259
+ padding-right: 5px;
260
+ visibility: visible;
261
+ }
262
+
263
+ .redsift-text-area-text-area-wrapper__toolbar {
264
+ position: relative;
265
+ top: 7px;
266
+ }
267
+
268
+ .redsift-icon-button {
269
+ padding: 2px;
270
+ height: 28px;
271
+ width: 28px;
272
+ }
273
+
274
+ ${$variant !== TextAreaVariant.underline ? css`
275
+ .redsift-icon.left {
276
+ padding-left: 12px;
277
+ padding-right: 8px;
278
+ line-height: 28px;
279
+ top: 10px;
280
+ }
281
+
282
+ .redsift-text-area-text-area-wrapper__toolbar {
283
+ padding-right: 8px;
284
+ }
285
+ ` : css`
286
+ .redsift-icon.left {
287
+ padding-right: 8px;
288
+ top: 10px;
289
+ }
290
+ `}
291
+ `;
292
+ }}
293
+ `;
294
+
295
+ const _excluded = ["aria-label", "aria-labelledby", "after", "autoFocus", "className", "color", "defaultValue", "forceColor", "isColored", "isDisabled", "isInvalid", "isReadOnly", "isRequired", "label", "leftIcon", "minimumRows", "name", "onBlur", "onChange", "onFocus", "placeholder", "textareaProps", "textareaRef", "theme", "value", "variant", "width"];
296
+ const COMPONENT_NAME = 'TextArea';
297
+ const CLASSNAME = 'redsift-text-area';
27
298
 
28
299
  /**
29
300
  * The TextArea component.
30
301
  * Can be used as controlled or uncontrolled.
31
302
  */
32
- declare const TextArea: Comp<TextAreaProps, HTMLDivElement>;
303
+ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
304
+ const {
305
+ 'aria-label': ariaLabel,
306
+ 'aria-labelledby': ariaLabelledby,
307
+ after,
308
+ autoFocus,
309
+ className,
310
+ color: propsColor,
311
+ defaultValue = '',
312
+ forceColor,
313
+ isColored = true,
314
+ isDisabled,
315
+ isInvalid,
316
+ isReadOnly,
317
+ isRequired,
318
+ label,
319
+ leftIcon,
320
+ minimumRows,
321
+ name,
322
+ onBlur: onBlurProps,
323
+ onChange,
324
+ onFocus: onFocusProps,
325
+ placeholder,
326
+ textareaProps,
327
+ textareaRef: propsTextareaRef,
328
+ theme: propsTheme,
329
+ value: propsValue,
330
+ variant = TextAreaVariant.default,
331
+ width = '100%'
332
+ } = props,
333
+ forwardedProps = _objectWithoutProperties(props, _excluded);
334
+ const theme = useTheme(propsTheme);
335
+ const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : isColored ? 'primary' : 'grey';
336
+ const isGradient = color === ButtonsColorPalette.radar;
337
+ const _textareaRef = React__default.useRef(null);
338
+ const textareaRef = propsTextareaRef !== null && propsTextareaRef !== void 0 ? propsTextareaRef : _textareaRef;
339
+ const {
340
+ isFocusVisible,
341
+ isFocused,
342
+ focusProps: {
343
+ onFocus,
344
+ onBlur
345
+ }
346
+ } = useFocusRing({
347
+ autoFocus
348
+ });
349
+ const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));
350
+ const {
351
+ focusWithinProps
352
+ } = useFocusWithin({
353
+ onFocusWithinChange: isFocusWithin => setFocusWithin(isFocusWithin)
354
+ });
355
+ const [value, setValue] = useState(defaultValue);
356
+ const isControlled = propsValue !== null && propsValue !== undefined;
357
+ const [labelId] = useId();
358
+ warnIfNoAccessibleLabelFound(props, [label], 'TextArea');
359
+ const handleChange = useCallback(event => {
360
+ if (isDisabled || isReadOnly) {
361
+ return;
362
+ }
363
+ if (onChange) {
364
+ onChange(event.target.value, name, event);
365
+ } else {
366
+ setValue(event.target.value);
367
+ }
368
+ }, [onChange]);
369
+ const {
370
+ rows,
371
+ recomputeNumberOfRows
372
+ } = useComputeNumberOfRows(minimumRows || 4);
373
+ useEffect(() => {
374
+ // Recompute the number of rows for the first rendering
375
+ if (textareaRef && textareaRef.current) {
376
+ recomputeNumberOfRows(textareaRef.current);
377
+ }
378
+ }, [textareaRef, recomputeNumberOfRows, value]);
379
+ return /*#__PURE__*/React__default.createElement(StyledTextArea, _extends({
380
+ width: width
381
+ }, focusWithinProps, forwardedProps, {
382
+ $hasContent: isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder),
383
+ $hasLeftIcon: Boolean(leftIcon),
384
+ $color: color,
385
+ $isGradient: isGradient,
386
+ $isDisabled: isDisabled,
387
+ $isFocusVisible: isFocusVisible,
388
+ $isInvalid: isInvalid || isRequired && !(isControlled ? propsValue : value),
389
+ $isRequired: isRequired,
390
+ $isFocused: Boolean(isFocused || forceColor),
391
+ $theme: theme,
392
+ $variant: variant,
393
+ className: classNames(TextArea.className, className),
394
+ ref: ref
395
+ }), /*#__PURE__*/React__default.createElement("fieldset", {
396
+ "aria-hidden": "true",
397
+ className: `${TextArea.className}-text-area-wrapper__fieldset`
398
+ }, /*#__PURE__*/React__default.createElement("legend", {
399
+ id: labelId,
400
+ className: `${TextArea.className}-text-area-wrapper-fieldset__legend`
401
+ }, label ? /*#__PURE__*/React__default.createElement("span", null, label) : null)), label ? /*#__PURE__*/React__default.createElement("label", {
402
+ className: `${TextArea.className}__label`
403
+ }, /*#__PURE__*/React__default.createElement("span", null, label)) : null, /*#__PURE__*/React__default.createElement("div", {
404
+ className: `${TextArea.className}__text-area-wrapper`
405
+ }, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, _extends({
406
+ color: isDisabled ? 'question' : 'black'
407
+ }, leftIcon, {
408
+ "aria-hidden": "true",
409
+ className: "left"
410
+ })) : null, /*#__PURE__*/React__default.createElement("div", {
411
+ className: `${TextArea.className}-text-area-wrapper__text-area`
412
+ }, /*#__PURE__*/React__default.createElement("textarea", _extends({}, textareaProps, {
413
+ onBlur: event => {
414
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
415
+ onBlurProps === null || onBlurProps === void 0 ? void 0 : onBlurProps(event);
416
+ },
417
+ onFocus: event => {
418
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
419
+ onFocusProps === null || onFocusProps === void 0 ? void 0 : onFocusProps(event);
420
+ },
421
+ "aria-disabled": isDisabled,
422
+ "aria-invalid": isInvalid || isRequired && !(isControlled ? propsValue : value),
423
+ "aria-label": ariaLabel,
424
+ "aria-labelledby": ariaLabelledby || (label ? labelId : undefined),
425
+ "aria-readonly": isReadOnly,
426
+ "aria-required": isRequired,
427
+ autoFocus: autoFocus,
428
+ disabled: isDisabled,
429
+ name: name,
430
+ onChange: handleChange,
431
+ placeholder: placeholder,
432
+ ref: textareaRef,
433
+ value: isControlled ? propsValue : value,
434
+ rows: rows
435
+ }))), after ? /*#__PURE__*/React__default.createElement(Flexbox, {
436
+ className: `${TextArea.className}-text-area-wrapper__toolbar`,
437
+ gap: "8px"
438
+ }, typeof after === 'function' ? after(isControlled ? propsValue : value, isDisabled, isInvalid || isRequired && !(isControlled ? propsValue : value), isRequired) : after) : null));
439
+ });
440
+ TextArea.className = CLASSNAME;
441
+ TextArea.displayName = COMPONENT_NAME;
33
442
 
34
- export { StyledTextAreaProps as S, TextAreaVariant as T, TextAreaProps as a, TextArea as b };
443
+ export { TextAreaVariant as T, TextArea as a, useComputeNumberOfRows as u };
444
+ //# sourceMappingURL=TextArea.js.map