@redsift/design-system 11.9.4-muiv5 → 12.0.0-muiv5
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/CONTRIBUTING.md +1 -5
- package/_internal/Alert2.js +9 -4
- package/_internal/Alert2.js.map +1 -1
- package/_internal/AppContent.js +9 -4
- package/_internal/AppContent.js.map +1 -1
- package/_internal/Badge2.js +9 -4
- package/_internal/Badge2.js.map +1 -1
- package/_internal/Breadcrumbs2.js +9 -4
- package/_internal/Breadcrumbs2.js.map +1 -1
- package/_internal/Button2.js +9 -4
- package/_internal/Button2.js.map +1 -1
- package/_internal/ButtonGroup.js +15 -6
- package/_internal/ButtonGroup.js.map +1 -1
- package/_internal/ButtonLink.js +1 -1
- package/_internal/Card2.js +9 -4
- package/_internal/Card2.js.map +1 -1
- package/_internal/CardActions.js +16 -12
- package/_internal/CardActions.js.map +1 -1
- package/_internal/CardBody.js +9 -4
- package/_internal/CardBody.js.map +1 -1
- package/_internal/CardHeader.js +13 -4
- package/_internal/CardHeader.js.map +1 -1
- package/_internal/Checkbox2.js +9 -4
- package/_internal/Checkbox2.js.map +1 -1
- package/_internal/CheckboxGroup.js +9 -4
- package/_internal/CheckboxGroup.js.map +1 -1
- package/_internal/DetailedCard.js +24 -12
- package/_internal/DetailedCard.js.map +1 -1
- package/_internal/Flexbox2.js +21 -16
- package/_internal/Flexbox2.js.map +1 -1
- package/_internal/Grid2.js +21 -16
- package/_internal/Grid2.js.map +1 -1
- package/_internal/GridItem.js +9 -4
- package/_internal/GridItem.js.map +1 -1
- package/_internal/Heading2.js +9 -4
- package/_internal/Heading2.js.map +1 -1
- package/_internal/Icon2.js +10 -5
- package/_internal/Icon2.js.map +1 -1
- package/_internal/IconButton.js +9 -4
- package/_internal/IconButton.js.map +1 -1
- package/_internal/IconButtonLink.js +1 -1
- package/_internal/Item2.js +16 -7
- package/_internal/Item2.js.map +1 -1
- package/_internal/Link2.js +9 -4
- package/_internal/Link2.js.map +1 -1
- package/_internal/LinkButton.js +2 -1
- package/_internal/LinkButton.js.map +1 -1
- package/_internal/Listbox2.js +14 -8
- package/_internal/Listbox2.js.map +1 -1
- package/_internal/Number2.js +10 -5
- package/_internal/Number2.js.map +1 -1
- package/_internal/NumberField.js +11 -6
- package/_internal/NumberField.js.map +1 -1
- package/_internal/Pill2.js +9 -4
- package/_internal/Pill2.js.map +1 -1
- package/_internal/ProgressBar.js +20 -11
- package/_internal/ProgressBar.js.map +1 -1
- package/_internal/Radio2.js +9 -4
- package/_internal/Radio2.js.map +1 -1
- package/_internal/RadioGroup.js +9 -4
- package/_internal/RadioGroup.js.map +1 -1
- package/_internal/Shield2.js +12 -7
- package/_internal/Shield2.js.map +1 -1
- package/_internal/SideNavigationMenu.js +1 -1
- package/_internal/Skeleton2.js +9 -4
- package/_internal/Skeleton2.js.map +1 -1
- package/_internal/SkeletonCircle.js +1 -1
- package/_internal/SkeletonText.js +1 -1
- package/_internal/Spinner2.js +9 -4
- package/_internal/Spinner2.js.map +1 -1
- package/_internal/Switch2.js +9 -4
- package/_internal/Switch2.js.map +1 -1
- package/_internal/SwitchGroup.js +9 -4
- package/_internal/SwitchGroup.js.map +1 -1
- package/_internal/Text2.js +13 -6
- package/_internal/Text2.js.map +1 -1
- package/_internal/TextArea.js +18 -12
- package/_internal/TextArea.js.map +1 -1
- package/_internal/TextField.js +12 -6
- package/_internal/TextField.js.map +1 -1
- package/_internal/_rollupPluginBabelHelpers.js +1 -1
- package/_internal/button.js +1 -1
- package/_internal/colors.js +1 -1
- package/_internal/icon-button.js +1 -1
- package/_internal/link.js +1 -1
- package/_internal/shared.js +1 -1
- package/_internal/styles.js +309 -217
- package/_internal/styles.js.map +1 -1
- package/_internal/styles2.js +202 -14
- package/_internal/styles2.js.map +1 -1
- package/_internal/styles3.js +30 -128
- package/_internal/styles3.js.map +1 -1
- package/_internal/styles4.js +129 -234
- package/_internal/styles4.js.map +1 -1
- package/_internal/styles5.js +227 -118
- package/_internal/styles5.js.map +1 -1
- package/_internal/styles6.js +128 -69
- package/_internal/styles6.js.map +1 -1
- package/_internal/styles7.js +84 -0
- package/_internal/styles7.js.map +1 -0
- package/_internal/text.js +1 -1
- package/_internal/types2.js.map +1 -1
- package/_internal/useFocusOnList.js +1 -1
- package/_internal/useFocusRing.js +1 -1
- package/_internal/useListboxItem.js.map +1 -1
- package/_internal/useLocalizedStringFormatter.js +1 -1
- package/_internal/useMessageFormatter.js +1 -1
- package/_internal/useNumberFormatter.js +1 -1
- package/index.d.ts +227 -136
- package/index.js +8 -164
- package/index.js.map +1 -1
- package/package.json +5 -6
package/_internal/TextArea.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
|
|
1
|
+
import { a as _objectSpread2, b as _objectWithoutProperties, c as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default, { useState, forwardRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { w as warnIfNoAccessibleLabelFound } from './warnIfNoAccessibleLabelFound.js';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import { i as baseStyling } from './
|
|
6
|
+
import { i as baseStyling } from './styles5.js';
|
|
7
7
|
import { T as Theme, B as ButtonsColorPalette } from './colors.js';
|
|
8
8
|
import { u as useFocusRing, a as useFocusWithin } from './useFocusRing.js';
|
|
9
|
+
import { f as getStylingTransientProps } from './styles.js';
|
|
9
10
|
import { u as useTheme } from './useTheme.js';
|
|
10
11
|
import { u as useId } from './useId.js';
|
|
11
12
|
import { a as Icon } from './Icon2.js';
|
|
@@ -78,7 +79,7 @@ const StyledTextArea = styled.div`
|
|
|
78
79
|
|
|
79
80
|
${_ref => {
|
|
80
81
|
let {
|
|
81
|
-
label,
|
|
82
|
+
$label,
|
|
82
83
|
$hasLeftIcon,
|
|
83
84
|
$hasContent,
|
|
84
85
|
$isFocused,
|
|
@@ -177,7 +178,7 @@ const StyledTextArea = styled.div`
|
|
|
177
178
|
${$variant !== TextAreaVariant.underline && !$hasLeftIcon ? css`
|
|
178
179
|
padding-left: 16px;
|
|
179
180
|
` : ''}
|
|
180
|
-
padding-top: ${label ? '10px' : '9px'};
|
|
181
|
+
padding-top: ${$label ? '10px' : '9px'};
|
|
181
182
|
padding-right: 8px;
|
|
182
183
|
}
|
|
183
184
|
|
|
@@ -292,7 +293,7 @@ const StyledTextArea = styled.div`
|
|
|
292
293
|
}}
|
|
293
294
|
`;
|
|
294
295
|
|
|
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"
|
|
296
|
+
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"];
|
|
296
297
|
const COMPONENT_NAME = 'TextArea';
|
|
297
298
|
const CLASSNAME = 'redsift-text-area';
|
|
298
299
|
|
|
@@ -301,6 +302,13 @@ const CLASSNAME = 'redsift-text-area';
|
|
|
301
302
|
* Can be used as controlled or uncontrolled.
|
|
302
303
|
*/
|
|
303
304
|
const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
305
|
+
const propsWithDefaults = _objectSpread2({
|
|
306
|
+
width: '100%'
|
|
307
|
+
}, props);
|
|
308
|
+
const {
|
|
309
|
+
transientProps,
|
|
310
|
+
otherProps
|
|
311
|
+
} = getStylingTransientProps(propsWithDefaults);
|
|
304
312
|
const {
|
|
305
313
|
'aria-label': ariaLabel,
|
|
306
314
|
'aria-labelledby': ariaLabelledby,
|
|
@@ -327,10 +335,9 @@ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
327
335
|
textareaRef: propsTextareaRef,
|
|
328
336
|
theme: propsTheme,
|
|
329
337
|
value: propsValue,
|
|
330
|
-
variant = TextAreaVariant.default
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
338
|
+
variant = TextAreaVariant.default
|
|
339
|
+
} = otherProps,
|
|
340
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded);
|
|
334
341
|
const theme = useTheme(propsTheme);
|
|
335
342
|
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : isColored ? 'primary' : 'grey';
|
|
336
343
|
const isGradient = color === ButtonsColorPalette.radar;
|
|
@@ -376,9 +383,8 @@ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
376
383
|
recomputeNumberOfRows(textareaRef.current);
|
|
377
384
|
}
|
|
378
385
|
}, [textareaRef, recomputeNumberOfRows, value]);
|
|
379
|
-
return /*#__PURE__*/React__default.createElement(StyledTextArea, _extends({
|
|
380
|
-
|
|
381
|
-
}, focusWithinProps, forwardedProps, {
|
|
386
|
+
return /*#__PURE__*/React__default.createElement(StyledTextArea, _extends({}, focusWithinProps, forwardedProps, transientProps, {
|
|
387
|
+
$label: label,
|
|
382
388
|
$hasContent: isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder),
|
|
383
389
|
$hasLeftIcon: Boolean(leftIcon),
|
|
384
390
|
$color: color,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../src/hooks/useComputeNumberOfRows.ts","../../src/components/text-area/types.ts","../../src/components/text-area/styles.ts","../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import { useState } from 'react';\n\n/**\n * Hook that allows to calculate the number of rows needed for a text area.\n * @param minimumRows Minimum number of rows that we want to display.\n * @return rows to be used and a callback to recalculate\n */\nexport const useComputeNumberOfRows = (\n minimumRows: number\n): {\n /** number of rows to be used on the text area */\n rows: number;\n /**\n * Callback in order to recalculate the number of rows due to a change on the text area\n */\n recomputeNumberOfRows(target: Element): void;\n} => {\n const [rows, setRows] = useState(minimumRows);\n\n const recompute = (target: Element) => {\n /**\n * HEAD's UP! This part is a little bit tricky. The idea here is to only\n * display the necessary rows on the textarea. In order to dynamically adjust\n * the height on that field, we need to:\n * 1. Set the current amount of rows to the minimum. That will make the scroll appear.\n * 2. With that, we will have the `scrollHeight`, meaning the height of the container adjusted to the current content\n * 3. With the scroll height, we can figure out how many rows we need to use by dividing the scroll height\n * by the line height.\n * 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\n * the state change through React, there are some scenarios (resize, hitting ENTER or BACKSPACE which add or remove lines)\n * when we will not see the update and the rows will be resized to the minimum.\n * 5. In case there is any other update on the component that changes the UI, we need to keep the number of rows\n * on the state in order to allow React to re-render. Therefore, we save them using `useState`\n */\n // eslint-disable-next-line no-param-reassign\n (target as HTMLTextAreaElement).rows = minimumRows;\n let currentRows = target.scrollHeight / (target.clientHeight / minimumRows);\n currentRows = currentRows >= minimumRows ? currentRows : minimumRows;\n // eslint-disable-next-line no-param-reassign\n (target as HTMLTextAreaElement).rows = currentRows;\n\n setRows(currentRows);\n };\n\n return {\n recomputeNumberOfRows: recompute,\n rows,\n };\n};\n","import { ChangeEvent, ComponentProps, MutableRefObject } from 'react';\nimport { ValueOf } from '../../types';\nimport { StyledTextFieldProps, TextFieldProps } from '../text-field';\n\n/**\n * Component variant.\n */\nexport const TextAreaVariant = {\n default: 'default',\n underline: 'underline',\n} as const;\nexport type TextAreaVariant = ValueOf<typeof TextAreaVariant>;\n\n/**\n * Component props.\n */\nexport interface TextAreaProps\n extends Omit<\n TextFieldProps,\n 'onChange' | 'inputRef' | 'inputProps' | 'pills' | 'internal' | 'hasClearButton' | 'onClear'\n > {\n /** Custom ref object to pass to the textarea element. */\n textareaRef?: MutableRefObject<HTMLTextAreaElement>;\n /** Custom props to pass to the textarea element. */\n textareaProps?: ComponentProps<'textarea'>;\n /** Method to handle component change. */\n onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLTextAreaElement>): void;\n /** Minimum number of rows displayed in multiline mode (requires `multiline` to be enabled). */\n minimumRows?: number;\n}\n\nexport type StyledTextAreaProps = StyledTextFieldProps;\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledTextAreaProps, TextAreaVariant } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledTextArea = styled.div<StyledTextAreaProps>`\n height: fit-content;\n position: relative;\n width: fit-content;\n margin: 0;\n min-width: 0;\n padding: 0;\n ${baseStyling}\n\n border: 0;\n display: inline-flex;\n flex-direction: column;\n vertical-align: top;\n\n ${({\n label,\n $hasLeftIcon,\n $hasContent,\n $isFocused,\n $isDisabled,\n $isInvalid,\n $color,\n $isGradient,\n $theme,\n $variant,\n }) => css`\n ${$isDisabled\n ? css`\n pointer-events: none;\n `\n : ''}\n\n .redsift-text-area__label {\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: ${$hasContent ? '-8px' : '-6px'};\n transform-origin: top left;\n transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,\n max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n white-space: nowrap;\n z-index: 1;\n\n ${!$hasContent\n ? css`\n max-width: calc(100% - 24px);\n transform: translate(${$variant === TextAreaVariant.underline ? '0px' : '14px'}, 16px) scale(1);\n `\n : css`\n max-width: calc(133% - 32px);\n transform: translate(${$variant === TextAreaVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);\n `}\n\n ${!$isGradient\n ? css`\n color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});\n ${$variant !== TextAreaVariant.underline\n ? css`\n padding-right: 7px;\n padding-left: 5px;\n `\n : ''}\n > span {\n background: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n background-clip: text;\n color: transparent;\n }\n `}\n }\n\n .redsift-text-area__text-area-wrapper {\n align-items: flex-start;\n box-sizing: border-box;\n cursor: text;\n display: inline-flex;\n min-height: 42px;\n position: relative;\n width: 100%;\n }\n\n .redsift-text-area-text-area-wrapper__text-area {\n textarea {\n background: transparent;\n display: block;\n border: none;\n outline: none;\n width: 100%;\n padding: 0;\n margin: 0;\n box-sizing: content-box;\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: 14px;\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n resize: none;\n\n ${$isDisabled\n ? css`\n color: var(--redsift-color-neutral-light-grey);\n `\n : css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n }\n\n flex: 1 1 auto;\n padding-bottom: 9px;\n ${$variant !== TextAreaVariant.underline && !$hasLeftIcon\n ? css`\n padding-left: 16px;\n `\n : ''}\n padding-top: ${label ? '10px' : '9px'};\n padding-right: 8px;\n }\n\n .redsift-text-area-text-area-wrapper-pills-and-text-area__text-area::placeholder {\n color: var(--redsift-color-neutral-mid-grey);\n }\n\n .redsift-text-area-text-area-wrapper-pills-and-text-area__text-area:focus {\n outline: 0;\n }\n\n .redsift-text-area-text-area-wrapper__fieldset {\n border-style: solid;\n bottom: 0;\n left: 1px;\n margin: 0;\n min-width: 0%;\n overflow: hidden;\n padding: 0 8px;\n pointer-events: none;\n position: absolute;\n right: 0;\n text-align: left;\n top: -5px;\n\n ${!$isGradient || $isDisabled || !$isFocused || $isInvalid\n ? css`\n ${$variant === TextAreaVariant.underline\n ? css`\n border-bottom-width: 2px;\n `\n : css`\n border-radius: 4px;\n border-width: 2px;\n `}\n border-color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n ${$variant === TextAreaVariant.underline\n ? css`\n border-bottom: 2px solid transparent;\n `\n : css`\n border: 2px solid transparent;\n border-radius: 4px;\n `}\n background: transparent;\n background-clip: padding-box, border-box;\n background-origin: border-box;\n background-image: linear-gradient(\n 90deg,\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})\n ),\n var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);\n `}\n }\n\n .redsift-text-area-text-area-wrapper-fieldset__legend {\n display: block;\n float: unset;\n font-size: 11px;\n height: 11px;\n overflow: hidden;\n padding: 0;\n visibility: hidden;\n white-space: nowrap;\n width: auto;\n\n ${!$hasContent\n ? css`\n max-width: 0.01px;\n transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n `\n : css`\n max-width: 100%;\n transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;\n `}\n }\n\n .redsift-text-area-text-area-wrapper-fieldset__legend > span {\n display: inline-block;\n opacity: 0;\n padding-left: 5px;\n padding-right: 5px;\n visibility: visible;\n }\n\n .redsift-text-area-text-area-wrapper__toolbar {\n position: relative;\n top: 7px;\n }\n\n .redsift-icon-button {\n padding: 2px;\n height: 28px;\n width: 28px;\n }\n\n ${$variant !== TextAreaVariant.underline\n ? css`\n .redsift-icon.left {\n padding-left: 12px;\n padding-right: 8px;\n line-height: 28px;\n top: 10px;\n }\n\n .redsift-text-area-text-area-wrapper__toolbar {\n padding-right: 8px;\n }\n `\n : css`\n .redsift-icon.left {\n padding-right: 8px;\n top: 10px;\n }\n `}\n `}\n`;\n","import React, {\n ComponentProps,\n FocusEvent,\n forwardRef,\n MutableRefObject,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextAreaProps, TextAreaVariant } from './types';\nimport { StyledTextArea } from './styles';\nimport { Icon } from '../../components/icon';\nimport { useTheme } from '../theme';\nimport { useComputeNumberOfRows } from '../../hooks';\nimport { useId } from '../../utils';\nimport { Flexbox } from '../flexbox';\n\nconst COMPONENT_NAME = 'TextArea';\nconst CLASSNAME = 'redsift-text-area';\n\n/**\n * The TextArea component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextArea: Comp<TextAreaProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n minimumRows,\n name,\n onBlur: onBlurProps,\n onChange,\n onFocus: onFocusProps,\n placeholder,\n textareaProps,\n textareaRef: propsTextareaRef,\n theme: propsTheme,\n value: propsValue,\n variant = TextAreaVariant.default,\n width = '100%',\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const _textareaRef = React.useRef(null);\n const textareaRef = propsTextareaRef ?? _textareaRef;\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextArea');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const { rows, recomputeNumberOfRows } = useComputeNumberOfRows(minimumRows || 4);\n useEffect(() => {\n // Recompute the number of rows for the first rendering\n if (textareaRef && textareaRef.current) {\n recomputeNumberOfRows(textareaRef.current);\n }\n }, [textareaRef, recomputeNumberOfRows, value]);\n\n return (\n <StyledTextArea\n width={width}\n {...focusWithinProps}\n {...forwardedProps}\n $hasContent={isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder)}\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextArea.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextArea.className}-text-area-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextArea.className}-text-area-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextArea.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextArea.className}__text-area-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextArea.className}-text-area-wrapper__text-area`}>\n <textarea\n {...textareaProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event as unknown as FocusEvent<HTMLDivElement, Element>);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event as unknown as FocusEvent<HTMLDivElement, Element>);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={textareaRef as MutableRefObject<HTMLTextAreaElement>}\n value={isControlled ? propsValue : value}\n rows={rows}\n />\n </div>\n {after ? (\n <Flexbox className={`${TextArea.className}-text-area-wrapper__toolbar`} gap=\"8px\">\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextArea>\n );\n});\nTextArea.className = CLASSNAME;\nTextArea.displayName = COMPONENT_NAME;\n"],"names":["useComputeNumberOfRows","minimumRows","rows","setRows","useState","recompute","target","currentRows","scrollHeight","clientHeight","recomputeNumberOfRows","TextAreaVariant","default","underline","StyledTextArea","styled","div","baseStyling","_ref","label","$hasLeftIcon","$hasContent","$isFocused","$isDisabled","$isInvalid","$color","$isGradient","$theme","$variant","css","Theme","dark","COMPONENT_NAME","CLASSNAME","TextArea","forwardRef","props","ref","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","isColored","isDisabled","isInvalid","isReadOnly","isRequired","leftIcon","name","onBlur","onBlurProps","onChange","onFocus","onFocusProps","placeholder","textareaProps","textareaRef","propsTextareaRef","theme","propsTheme","value","propsValue","variant","width","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","_textareaRef","React","useRef","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","useEffect","current","createElement","_extends","$isFocusVisible","$isRequired","classNames","id","Icon","disabled","Flexbox","gap","displayName"],"mappings":";;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACaA,MAAAA,sBAAsB,GACjCC,WAAmB,IAQhB;EACH,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,QAAQ,CAACH,WAAW,CAAC,CAAA;EAE7C,MAAMI,SAAS,GAAIC,MAAe,IAAK;AACrC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI;IACCA,MAAM,CAAyBJ,IAAI,GAAGD,WAAW,CAAA;IAClD,IAAIM,WAAW,GAAGD,MAAM,CAACE,YAAY,IAAIF,MAAM,CAACG,YAAY,GAAGR,WAAW,CAAC,CAAA;AAC3EM,IAAAA,WAAW,GAAGA,WAAW,IAAIN,WAAW,GAAGM,WAAW,GAAGN,WAAW,CAAA;AACpE;IACCK,MAAM,CAAyBJ,IAAI,GAAGK,WAAW,CAAA;IAElDJ,OAAO,CAACI,WAAW,CAAC,CAAA;GACrB,CAAA;EAED,OAAO;AACLG,IAAAA,qBAAqB,EAAEL,SAAS;AAChCH,IAAAA,IAAAA;GACD,CAAA;AACH;;AC5CA;AACA;AACA;AACO,MAAMS,eAAe,GAAG;AAC7BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAA;AACb,EAAU;;AAGV;AACA;AACA;;ACVA;AACA;AACA;AACO,MAAMC,c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E4B,YAAY,GAAG3B,UAAU,GAAGD,KAAM;AACzC/D,IAAAA,IAAI,EAAEA,IAAAA;GACP,CAAA,CACE,CAAC,EACLsC,KAAK,gBACJwC,cAAA,CAAAuB,aAAA,CAACQ,OAAO,EAAA;AAACrE,IAAAA,SAAS,EAAG,CAAA,EAAER,QAAQ,CAACQ,SAAU,CAA6B,2BAAA,CAAA;AAACsE,IAAAA,GAAG,EAAC,KAAA;AAAK,GAAA,EAC9E,OAAOxE,KAAK,KAAK,UAAU,GACxBA,KAAK,CACHqD,YAAY,GAAG3B,UAAU,GAAGD,KAAK,EACjCjB,UAAU,EACVC,SAAS,IAAKE,UAAU,IAAI,EAAE0C,YAAY,GAAG3B,UAAU,GAAGD,KAAK,CAAE,EACjEd,UACF,CAAC,GACDX,KACG,CAAC,GACR,IACD,CACS,CAAC,CAAA;AAErB,CAAC,EAAC;AACFN,QAAQ,CAACQ,SAAS,GAAGT,SAAS,CAAA;AAC9BC,QAAQ,CAAC+E,WAAW,GAAGjF,cAAc;;;;"}
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../src/hooks/useComputeNumberOfRows.ts","../../src/components/text-area/types.ts","../../src/components/text-area/styles.ts","../../src/components/text-area/TextArea.tsx"],"sourcesContent":["import { useState } from 'react';\n\n/**\n * Hook that allows to calculate the number of rows needed for a text area.\n * @param minimumRows Minimum number of rows that we want to display.\n * @return rows to be used and a callback to recalculate\n */\nexport const useComputeNumberOfRows = (\n minimumRows: number\n): {\n /** number of rows to be used on the text area */\n rows: number;\n /**\n * Callback in order to recalculate the number of rows due to a change on the text area\n */\n recomputeNumberOfRows(target: Element): void;\n} => {\n const [rows, setRows] = useState(minimumRows);\n\n const recompute = (target: Element) => {\n /**\n * HEAD's UP! This part is a little bit tricky. The idea here is to only\n * display the necessary rows on the textarea. In order to dynamically adjust\n * the height on that field, we need to:\n * 1. Set the current amount of rows to the minimum. That will make the scroll appear.\n * 2. With that, we will have the `scrollHeight`, meaning the height of the container adjusted to the current content\n * 3. With the scroll height, we can figure out how many rows we need to use by dividing the scroll height\n * by the line height.\n * 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\n * the state change through React, there are some scenarios (resize, hitting ENTER or BACKSPACE which add or remove lines)\n * when we will not see the update and the rows will be resized to the minimum.\n * 5. In case there is any other update on the component that changes the UI, we need to keep the number of rows\n * on the state in order to allow React to re-render. Therefore, we save them using `useState`\n */\n // eslint-disable-next-line no-param-reassign\n (target as HTMLTextAreaElement).rows = minimumRows;\n let currentRows = target.scrollHeight / (target.clientHeight / minimumRows);\n currentRows = currentRows >= minimumRows ? currentRows : minimumRows;\n // eslint-disable-next-line no-param-reassign\n (target as HTMLTextAreaElement).rows = currentRows;\n\n setRows(currentRows);\n };\n\n return {\n recomputeNumberOfRows: recompute,\n rows,\n };\n};\n","import { ChangeEvent, ComponentProps, MutableRefObject } from 'react';\nimport { ValueOf } from '../../types';\nimport { StyledTextFieldProps, TextFieldProps } from '../text-field';\n\n/**\n * Component variant.\n */\nexport const TextAreaVariant = {\n default: 'default',\n underline: 'underline',\n} as const;\nexport type TextAreaVariant = ValueOf<typeof TextAreaVariant>;\n\n/**\n * Component props.\n */\nexport interface TextAreaProps\n extends Omit<\n TextFieldProps,\n 'onChange' | 'inputRef' | 'inputProps' | 'pills' | 'internal' | 'hasClearButton' | 'onClear'\n > {\n /** Custom ref object to pass to the textarea element. */\n textareaRef?: MutableRefObject<HTMLTextAreaElement>;\n /** Custom props to pass to the textarea element. */\n textareaProps?: ComponentProps<'textarea'>;\n /** Method to handle component change. */\n onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLTextAreaElement>): void;\n /** Minimum number of rows displayed in multiline mode (requires `multiline` to be enabled). */\n minimumRows?: number;\n}\n\nexport type StyledTextAreaProps = StyledTextFieldProps;\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledTextAreaProps, TextAreaVariant } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledTextArea = styled.div<StyledTextAreaProps>`\n height: fit-content;\n position: relative;\n width: fit-content;\n margin: 0;\n min-width: 0;\n padding: 0;\n ${baseStyling}\n\n border: 0;\n display: inline-flex;\n flex-direction: column;\n vertical-align: top;\n\n ${({\n $label,\n $hasLeftIcon,\n $hasContent,\n $isFocused,\n $isDisabled,\n $isInvalid,\n $color,\n $isGradient,\n $theme,\n $variant,\n }) => css`\n ${$isDisabled\n ? css`\n pointer-events: none;\n `\n : ''}\n\n .redsift-text-area__label {\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: ${$hasContent ? '-8px' : '-6px'};\n transform-origin: top left;\n transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,\n max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n white-space: nowrap;\n z-index: 1;\n\n ${!$hasContent\n ? css`\n max-width: calc(100% - 24px);\n transform: translate(${$variant === TextAreaVariant.underline ? '0px' : '14px'}, 16px) scale(1);\n `\n : css`\n max-width: calc(133% - 32px);\n transform: translate(${$variant === TextAreaVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);\n `}\n\n ${!$isGradient\n ? css`\n color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});\n ${$variant !== TextAreaVariant.underline\n ? css`\n padding-right: 7px;\n padding-left: 5px;\n `\n : ''}\n > span {\n background: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n background-clip: text;\n color: transparent;\n }\n `}\n }\n\n .redsift-text-area__text-area-wrapper {\n align-items: flex-start;\n box-sizing: border-box;\n cursor: text;\n display: inline-flex;\n min-height: 42px;\n position: relative;\n width: 100%;\n }\n\n .redsift-text-area-text-area-wrapper__text-area {\n textarea {\n background: transparent;\n display: block;\n border: none;\n outline: none;\n width: 100%;\n padding: 0;\n margin: 0;\n box-sizing: content-box;\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: 14px;\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n resize: none;\n\n ${$isDisabled\n ? css`\n color: var(--redsift-color-neutral-light-grey);\n `\n : css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n }\n\n flex: 1 1 auto;\n padding-bottom: 9px;\n ${$variant !== TextAreaVariant.underline && !$hasLeftIcon\n ? css`\n padding-left: 16px;\n `\n : ''}\n padding-top: ${$label ? '10px' : '9px'};\n padding-right: 8px;\n }\n\n .redsift-text-area-text-area-wrapper-pills-and-text-area__text-area::placeholder {\n color: var(--redsift-color-neutral-mid-grey);\n }\n\n .redsift-text-area-text-area-wrapper-pills-and-text-area__text-area:focus {\n outline: 0;\n }\n\n .redsift-text-area-text-area-wrapper__fieldset {\n border-style: solid;\n bottom: 0;\n left: 1px;\n margin: 0;\n min-width: 0%;\n overflow: hidden;\n padding: 0 8px;\n pointer-events: none;\n position: absolute;\n right: 0;\n text-align: left;\n top: -5px;\n\n ${!$isGradient || $isDisabled || !$isFocused || $isInvalid\n ? css`\n ${$variant === TextAreaVariant.underline\n ? css`\n border-bottom-width: 2px;\n `\n : css`\n border-radius: 4px;\n border-width: 2px;\n `}\n border-color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n ${$variant === TextAreaVariant.underline\n ? css`\n border-bottom: 2px solid transparent;\n `\n : css`\n border: 2px solid transparent;\n border-radius: 4px;\n `}\n background: transparent;\n background-clip: padding-box, border-box;\n background-origin: border-box;\n background-image: linear-gradient(\n 90deg,\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})\n ),\n var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);\n `}\n }\n\n .redsift-text-area-text-area-wrapper-fieldset__legend {\n display: block;\n float: unset;\n font-size: 11px;\n height: 11px;\n overflow: hidden;\n padding: 0;\n visibility: hidden;\n white-space: nowrap;\n width: auto;\n\n ${!$hasContent\n ? css`\n max-width: 0.01px;\n transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n `\n : css`\n max-width: 100%;\n transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;\n `}\n }\n\n .redsift-text-area-text-area-wrapper-fieldset__legend > span {\n display: inline-block;\n opacity: 0;\n padding-left: 5px;\n padding-right: 5px;\n visibility: visible;\n }\n\n .redsift-text-area-text-area-wrapper__toolbar {\n position: relative;\n top: 7px;\n }\n\n .redsift-icon-button {\n padding: 2px;\n height: 28px;\n width: 28px;\n }\n\n ${$variant !== TextAreaVariant.underline\n ? css`\n .redsift-icon.left {\n padding-left: 12px;\n padding-right: 8px;\n line-height: 28px;\n top: 10px;\n }\n\n .redsift-text-area-text-area-wrapper__toolbar {\n padding-right: 8px;\n }\n `\n : css`\n .redsift-icon.left {\n padding-right: 8px;\n top: 10px;\n }\n `}\n `}\n`;\n","import React, {\n ComponentProps,\n FocusEvent,\n forwardRef,\n MutableRefObject,\n useCallback,\n useEffect,\n useState,\n} from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp, getStylingTransientProps } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextAreaProps, TextAreaVariant } from './types';\nimport { StyledTextArea } from './styles';\nimport { Icon } from '../../components/icon';\nimport { useTheme } from '../theme';\nimport { useComputeNumberOfRows } from '../../hooks';\nimport { useId } from '../../utils';\nimport { Flexbox } from '../flexbox';\n\nconst COMPONENT_NAME = 'TextArea';\nconst CLASSNAME = 'redsift-text-area';\n\n/**\n * The TextArea component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextArea: Comp<TextAreaProps, HTMLDivElement> = forwardRef((props, ref) => {\n const propsWithDefaults = {\n width: '100%' as const,\n ...props,\n };\n\n const { transientProps, otherProps } = getStylingTransientProps(propsWithDefaults);\n\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n minimumRows,\n name,\n onBlur: onBlurProps,\n onChange,\n onFocus: onFocusProps,\n placeholder,\n textareaProps,\n textareaRef: propsTextareaRef,\n theme: propsTheme,\n value: propsValue,\n variant = TextAreaVariant.default,\n ...forwardedProps\n } = otherProps;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const _textareaRef = React.useRef(null);\n const textareaRef = propsTextareaRef ?? _textareaRef;\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextArea');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const { rows, recomputeNumberOfRows } = useComputeNumberOfRows(minimumRows || 4);\n useEffect(() => {\n // Recompute the number of rows for the first rendering\n if (textareaRef && textareaRef.current) {\n recomputeNumberOfRows(textareaRef.current);\n }\n }, [textareaRef, recomputeNumberOfRows, value]);\n\n return (\n <StyledTextArea\n {...focusWithinProps}\n {...forwardedProps}\n {...transientProps}\n $label={label}\n $hasContent={isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder)}\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextArea.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextArea.className}-text-area-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextArea.className}-text-area-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextArea.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextArea.className}__text-area-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextArea.className}-text-area-wrapper__text-area`}>\n <textarea\n {...textareaProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event as unknown as FocusEvent<HTMLDivElement, Element>);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event as unknown as FocusEvent<HTMLDivElement, Element>);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={textareaRef as MutableRefObject<HTMLTextAreaElement>}\n value={isControlled ? propsValue : value}\n rows={rows}\n />\n </div>\n {after ? (\n <Flexbox className={`${TextArea.className}-text-area-wrapper__toolbar`} gap=\"8px\">\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextArea>\n );\n});\nTextArea.className = CLASSNAME;\nTextArea.displayName = COMPONENT_NAME;\n"],"names":["useComputeNumberOfRows","minimumRows","rows","setRows","useState","recompute","target","currentRows","scrollHeight","clientHeight","recomputeNumberOfRows","TextAreaVariant","default","underline","StyledTextArea","styled","div","baseStyling","_ref","$label","$hasLeftIcon","$hasContent","$isFocused","$isDisabled","$isInvalid","$color","$isGradient","$theme","$variant","css","Theme","dark","COMPONENT_NAME","CLASSNAME","TextArea","forwardRef","props","ref","propsWithDefaults","_objectSpread","width","transientProps","otherProps","getStylingTransientProps","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","isColored","isDisabled","isInvalid","isReadOnly","isRequired","label","leftIcon","name","onBlur","onBlurProps","onChange","onFocus","onFocusProps","placeholder","textareaProps","textareaRef","propsTextareaRef","theme","propsTheme","value","propsValue","variant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","_textareaRef","React","useRef","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","useEffect","current","createElement","_extends","$isFocusVisible","$isRequired","classNames","id","Icon","disabled","Flexbox","gap","displayName"],"mappings":";;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACaA,MAAAA,sBAAsB,GACjCC,WAAmB,IAQhB;EACH,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,QAAQ,CAACH,WAAW,CAAC,CAAA;EAE7C,MAAMI,SAAS,GAAIC,MAAe,IAAK;AACrC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI;IACCA,MAAM,CAAyBJ,IAAI,GAAGD,WAAW,CAAA;IAClD,IAAIM,WAAW,GAAGD,MAAM,CAACE,YAAY,IAAIF,MAAM,CAACG,YAAY,GAAGR,WAAW,CAAC,CAAA;AAC3EM,IAAAA,WAAW,GAAGA,WAAW,IAAIN,WAAW,GAAGM,WAAW,GAAGN,WAAW,CAAA;AACpE;IACCK,MAAM,CAAyBJ,IAAI,GAAGK,WAAW,CAAA;IAElDJ,OAAO,CAACI,WAAW,CAAC,CAAA;GACrB,CAAA;EAED,OAAO;AACLG,IAAAA,qBAAqB,EAAEL,SAAS;AAChCH,IAAAA,IAAAA;GACD,CAAA;AACH;;AC5CA;AACA;AACA;AACO,MAAMS,eAAe,GAAG;AAC7BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAA;AACb,EAAU;;AAGV;AACA;AACA;;ACVA;AACA;AACA;AACO,MAAMC,cAAc,GAAGC,MAAM,CAACC,GAAyB,CAAA;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA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,IAAAA,KAAK,EAAE2B,YAAY,GAAG1B,UAAU,GAAGD,KAAM;AACzCtE,IAAAA,IAAI,EAAEA,IAAAA;GACP,CAAA,CACE,CAAC,EACL4C,KAAK,gBACJwC,cAAA,CAAAuB,aAAA,CAACQ,OAAO,EAAA;AAACrE,IAAAA,SAAS,EAAG,CAAA,EAAEd,QAAQ,CAACc,SAAU,CAA6B,2BAAA,CAAA;AAACsE,IAAAA,GAAG,EAAC,KAAA;AAAK,GAAA,EAC9E,OAAOxE,KAAK,KAAK,UAAU,GACxBA,KAAK,CACHqD,YAAY,GAAG1B,UAAU,GAAGD,KAAK,EACjClB,UAAU,EACVC,SAAS,IAAKE,UAAU,IAAI,EAAE0C,YAAY,GAAG1B,UAAU,GAAGD,KAAK,CAAE,EACjEf,UACF,CAAC,GACDX,KACG,CAAC,GACR,IACD,CACS,CAAC,CAAA;AAErB,CAAC,EAAC;AACFZ,QAAQ,CAACc,SAAS,GAAGf,SAAS,CAAA;AAC9BC,QAAQ,CAACqF,WAAW,GAAGvF,cAAc;;;;"}
|
package/_internal/TextField.js
CHANGED
|
@@ -3,11 +3,12 @@ import React__default, { forwardRef, useState, useCallback } from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { w as warnIfNoAccessibleLabelFound } from './warnIfNoAccessibleLabelFound.js';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import { i as baseStyling } from './
|
|
6
|
+
import { i as baseStyling } from './styles5.js';
|
|
7
7
|
import { T as Theme, B as ButtonsColorPalette } from './colors.js';
|
|
8
8
|
import { mdiClose } from '@redsift/icons';
|
|
9
9
|
import { u as useMessageFormatter } from './useMessageFormatter.js';
|
|
10
10
|
import { u as useFocusRing, a as useFocusWithin } from './useFocusRing.js';
|
|
11
|
+
import { f as getStylingTransientProps } from './styles.js';
|
|
11
12
|
import { u as useTheme } from './useTheme.js';
|
|
12
13
|
import { u as useId } from './useId.js';
|
|
13
14
|
import { a as Icon } from './Icon2.js';
|
|
@@ -50,7 +51,7 @@ const StyledTextField = styled.div`
|
|
|
50
51
|
|
|
51
52
|
${_ref => {
|
|
52
53
|
let {
|
|
53
|
-
label,
|
|
54
|
+
$label,
|
|
54
55
|
$hasLeftIcon,
|
|
55
56
|
$hasContent,
|
|
56
57
|
$isFocused,
|
|
@@ -131,7 +132,7 @@ const StyledTextField = styled.div`
|
|
|
131
132
|
${$variant !== TextFieldVariant.underline && !$hasLeftIcon ? css`
|
|
132
133
|
padding-left: 16px;
|
|
133
134
|
` : ''}
|
|
134
|
-
padding-top: ${label ? '9px' : '7px'};
|
|
135
|
+
padding-top: ${$label ? '9px' : '7px'};
|
|
135
136
|
|
|
136
137
|
.redsift-pill {
|
|
137
138
|
margin: 3px 6px 3px 0;
|
|
@@ -302,6 +303,10 @@ const CLASSNAME = 'redsift-text-field';
|
|
|
302
303
|
* Can be used as controlled or uncontrolled.
|
|
303
304
|
*/
|
|
304
305
|
const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
306
|
+
const {
|
|
307
|
+
transientProps,
|
|
308
|
+
otherProps
|
|
309
|
+
} = getStylingTransientProps(props);
|
|
305
310
|
const {
|
|
306
311
|
'aria-label': ariaLabel,
|
|
307
312
|
'aria-labelledby': ariaLabelledby,
|
|
@@ -333,8 +338,8 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
333
338
|
type,
|
|
334
339
|
value: propsValue,
|
|
335
340
|
variant = TextFieldVariant.default
|
|
336
|
-
} =
|
|
337
|
-
forwardedProps = _objectWithoutProperties(
|
|
341
|
+
} = otherProps,
|
|
342
|
+
forwardedProps = _objectWithoutProperties(otherProps, _excluded);
|
|
338
343
|
const theme = useTheme(propsTheme);
|
|
339
344
|
const color = Object.values(ButtonsColorPalette).includes(propsColor) ? propsColor : isColored ? 'primary' : 'grey';
|
|
340
345
|
const isGradient = color === ButtonsColorPalette.radar;
|
|
@@ -384,7 +389,8 @@ const TextField = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
384
389
|
}
|
|
385
390
|
setValue('');
|
|
386
391
|
}, [onChange]);
|
|
387
|
-
return /*#__PURE__*/React__default.createElement(StyledTextField, _extends({}, focusWithinProps, forwardedProps, {
|
|
392
|
+
return /*#__PURE__*/React__default.createElement(StyledTextField, _extends({}, focusWithinProps, forwardedProps, transientProps, {
|
|
393
|
+
$label: label,
|
|
388
394
|
$hasContent: isFocusWithin || Boolean(isControlled ? propsValue : value) || Boolean(placeholder) || Boolean(pills && pills.length > 0),
|
|
389
395
|
$hasLeftIcon: Boolean(leftIcon),
|
|
390
396
|
$color: color,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sources":["../../src/components/text-field/types.ts","../../src/components/text-field/styles.ts","../../src/components/text-field/intl/index.ts","../../src/components/text-field/TextField.tsx"],"sourcesContent":["import { ChangeEvent, ComponentProps, MutableRefObject, ReactNode } from 'react';\nimport { ButtonsColorPalette, StylingProps, Theme, ValueOf } from '../../types';\nimport { IconProps } from '../icon';\nimport { IconButtonProps } from '../icon-button';\nimport { PillProps } from '../pill';\n\n/**\n * Component variant.\n */\nexport const TextFieldVariant = {\n default: 'default',\n underline: 'underline',\n} as const;\nexport type TextFieldVariant = ValueOf<typeof TextFieldVariant>;\n\n/**\n * Component color.\n */\nexport type TextFieldColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface TextFieldProps extends Omit<ComponentProps<'div'>, 'onChange'>, StylingProps {\n /** Whether the component can be autofocused. */\n autoFocus?: boolean;\n /** Color variant. */\n color?: TextFieldColor;\n /** Force color even when not focused. */\n forceColor?: boolean;\n /**\n * Default value.\n * Used for uncontrolled version.\n */\n defaultValue?: string;\n /** Whether the clear button is displayed or not. */\n hasClearButton?: boolean | Omit<Partial<IconButtonProps>, 'ref'>;\n /** Place for icon buttons between the clear button and the separator. */\n internal?:\n | ReactNode\n | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Place for icon buttons after the separator. */\n after?: ReactNode | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Custom props to pass to the input element. */\n inputProps?: ComponentProps<'input'>;\n /** Custom ref object to pass to the input element. */\n inputRef?: MutableRefObject<HTMLInputElement>;\n /** @deprecated Whether the component should use the product colors or shades of grey. */\n isColored?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is invalid or not. */\n isInvalid?: boolean;\n /** Whether the component is read only or not. */\n isReadOnly?: boolean;\n /** Whether the component is required or not. */\n isRequired?: boolean;\n /** Label */\n label?: string;\n /**\n * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />\n * Can also be a ReactElement.\n */\n leftIcon?: Omit<IconProps, 'ref'>;\n /** Name to pass to the input element. */\n name?: string;\n /** Method to handle component change. */\n onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLInputElement>): void;\n /** Method to handle component clear. */\n onClear?(): void;\n /** List of Pills. */\n pills?: Omit<PillProps, 'ref'>[];\n /** Placeholder. */\n placeholder?: string;\n /** Theme. */\n theme?: Theme;\n /** Input type. */\n type?: string;\n /**\n * Input value.\n * Used for controlled version.\n */\n value?: string;\n /** TextField variant. */\n variant?: TextFieldVariant;\n}\n\nexport type StyledTextFieldProps = Omit<\n TextFieldProps,\n 'color' | 'isColored' | 'isDisabled' | 'isInvalid' | 'isRequired' | 'onChange'\n> & {\n $color: TextFieldProps['color'];\n $isGradient: boolean;\n $hasLeftIcon: boolean;\n $hasContent: boolean;\n $isDisabled: TextFieldProps['isDisabled'];\n $isInvalid: TextFieldProps['isInvalid'];\n $isFocused: boolean;\n $isFocusVisible: boolean;\n $isRequired: TextFieldProps['isRequired'];\n $theme: TextFieldProps['theme'];\n $variant: TextFieldProps['variant'];\n};\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledTextFieldProps, TextFieldVariant } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledTextField = styled.div<StyledTextFieldProps>`\n height: fit-content;\n position: relative;\n width: fit-content;\n margin: 0;\n min-width: 0;\n padding: 0;\n ${baseStyling}\n\n border: 0;\n display: inline-flex;\n flex-direction: column;\n vertical-align: top;\n\n ${({\n label,\n $hasLeftIcon,\n $hasContent,\n $isFocused,\n $isDisabled,\n $isInvalid,\n $color,\n $isGradient,\n $theme,\n $variant,\n }) => css`\n ${$isDisabled\n ? css`\n pointer-events: none;\n `\n : ''}\n\n .redsift-text-field__label {\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: ${$hasContent ? '-8px' : '-7px'};\n transform-origin: top left;\n transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,\n max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n white-space: nowrap;\n z-index: 1;\n\n ${!$hasContent\n ? css`\n max-width: calc(100% - 24px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 16px) scale(1);\n `\n : css`\n max-width: calc(133% - 32px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);\n `}\n\n ${!$isGradient\n ? css`\n color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});\n ${$variant !== TextFieldVariant.underline\n ? css`\n padding-right: 7px;\n padding-left: 5px;\n `\n : ''}\n > span {\n background: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n background-clip: text;\n color: transparent;\n }\n `}\n }\n\n .redsift-text-field__input-wrapper {\n align-items: flex-start;\n box-sizing: border-box;\n cursor: text;\n display: inline-flex;\n min-height: 42px;\n position: relative;\n }\n\n .redsift-text-field-input-wrapper__pills-and-input {\n align-items: flex-start;\n box-sizing: border-box;\n display: flex;\n flex-direction: column-reverse;\n flex-wrap: wrap;\n flex: 1 1 auto;\n padding-bottom: 7px;\n ${$variant !== TextFieldVariant.underline && !$hasLeftIcon\n ? css`\n padding-left: 16px;\n `\n : ''}\n padding-top: ${label ? '9px' : '7px'};\n\n .redsift-pill {\n margin: 3px 6px 3px 0;\n }\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input {\n background: none;\n border: 0;\n box-sizing: content-box;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n min-width: 0;\n min-width: 100px;\n padding: 2px 0;\n width: 100%;\n\n ${$isDisabled\n ? css`\n color: var(--redsift-color-grey-l2);\n `\n : css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input::placeholder {\n color: var(--redsift-color-neutral-mid-grey);\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input:focus {\n outline: 0;\n }\n\n .redsift-text-field-input-wrapper__fieldset {\n border-style: solid;\n bottom: 0;\n left: 1px;\n margin: 0;\n min-width: 0%;\n overflow: hidden;\n padding: 0 8px;\n pointer-events: none;\n position: absolute;\n right: 0;\n text-align: left;\n top: -5px;\n\n ${!$isGradient || $isDisabled || !$isFocused || $isInvalid\n ? css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom-width: 2px;\n `\n : css`\n border-radius: 4px;\n border-width: 2px;\n `}\n border-color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom: 2px solid transparent;\n `\n : css`\n border: 2px solid transparent;\n border-radius: 4px;\n `}\n background: transparent;\n background-clip: padding-box, border-box;\n background-origin: border-box;\n background-image: linear-gradient(\n 90deg,\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})\n ),\n var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend {\n display: block;\n float: unset;\n font-size: 11px;\n height: 11px;\n overflow: hidden;\n padding: 0;\n visibility: hidden;\n white-space: nowrap;\n width: auto;\n\n ${!$hasContent\n ? css`\n max-width: 0.01px;\n transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n `\n : css`\n max-width: 100%;\n transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend > span {\n display: inline-block;\n opacity: 0;\n padding-left: 5px;\n padding-right: 5px;\n visibility: visible;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n position: relative;\n top: 9px;\n }\n\n .redsift-icon-button:not(.redsift-pill > .redsift-icon-button) {\n padding: 2px;\n position: relative;\n top: -2px;\n height: 28px;\n width: 28px;\n }\n\n ${$variant !== TextFieldVariant.underline\n ? css`\n .redsift-icon.left {\n padding-left: 12px;\n padding-right: 8px;\n line-height: 28px;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n padding-right: 8px;\n }\n `\n : css`\n .redsift-icon.left {\n padding-right: 8px;\n }\n `}\n\n .redsift-icon.left,\n .redsift-icon.right {\n top: 9px;\n }\n `}\n`;\n","import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n","import React, { MouseEvent, ComponentProps, forwardRef, MutableRefObject, useCallback, useState } from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextFieldProps, TextFieldVariant } from './types';\nimport { StyledTextField } from './styles';\nimport { Icon } from '../../components/icon';\nimport { mdiClose } from '@redsift/icons';\nimport { Flexbox } from '../flexbox';\nimport { IconButton } from '../icon-button';\nimport { Pill } from '../pill';\nimport { useTheme } from '../theme';\nimport { useMessageFormatter } from '../../react-aria/react-aria/i18n';\nimport { useId } from '../../utils';\n\nimport intlMessages from './intl';\n\nconst COMPONENT_NAME = 'TextField';\nconst CLASSNAME = 'redsift-text-field';\n\n/**\n * The TextField component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextField: Comp<TextFieldProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n hasClearButton,\n inputProps,\n inputRef,\n internal,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n name,\n onBlur: onBlurProps,\n onChange,\n onClear,\n onFocus: onFocusProps,\n pills,\n placeholder,\n theme: propsTheme,\n type,\n value: propsValue,\n variant = TextFieldVariant.default,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const format = useMessageFormatter(intlMessages);\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextField');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const handleClear = useCallback(() => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange('');\n }\n if (onClear) {\n onClear();\n }\n if (hasClearButton && hasClearButton !== true && hasClearButton.onClick) {\n hasClearButton.onClick({} as MouseEvent<HTMLButtonElement>);\n }\n setValue('');\n }, [onChange]);\n\n return (\n <StyledTextField\n {...focusWithinProps}\n {...forwardedProps}\n $hasContent={\n isFocusWithin ||\n Boolean(isControlled ? propsValue : value) ||\n Boolean(placeholder) ||\n Boolean(pills && pills.length > 0)\n }\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextField.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextField.className}-input-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextField.className}-input-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextField.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextField.className}__input-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextField.className}-input-wrapper__pills-and-input`}>\n <input\n {...inputProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n className={`${TextField.className}-input-wrapper-pills-and-input__input`}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={inputRef as MutableRefObject<HTMLInputElement>}\n type={type}\n value={isControlled ? propsValue : value}\n />\n <div>\n {pills?.map((pill, index) => (\n <Pill theme={theme} key={`${labelId}-pill-${index}`} color=\"blue\" size=\"small\" {...pill} />\n ))}\n </div>\n </div>\n {hasClearButton || internal || after ? (\n <Flexbox className={`${TextField.className}-input-wrapper__toolbar`} gap=\"8px\">\n {hasClearButton ? (\n <IconButton\n theme={theme}\n aria-label={label ? format('clear-field', { label }) : format('clear')}\n color=\"grey\"\n isDisabled={isDisabled}\n icon={mdiClose}\n {...(hasClearButton !== true && hasClearButton)}\n onClick={handleClear}\n className=\"right clear\"\n />\n ) : null}\n {typeof internal === 'function'\n ? internal(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : internal}\n {(hasClearButton || internal) && after ? (\n <span\n style={{\n borderLeft: '1px solid var(--redsift-color-neutral-mid-grey)',\n position: 'relative',\n top: '-2px',\n }}\n />\n ) : null}\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextField>\n );\n});\nTextField.className = CLASSNAME;\nTextField.displayName = COMPONENT_NAME;\n"],"names":["TextFieldVariant","default","underline","StyledTextField","styled","div","baseStyling","_ref","label","$hasLeftIcon","$hasContent","$isFocused","$isDisabled","$isInvalid","$color","$isGradient","$theme","$variant","css","Theme","dark","enUS","frFR","COMPONENT_NAME","CLASSNAME","TextField","forwardRef","props","ref","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","hasClearButton","inputProps","inputRef","internal","isColored","isDisabled","isInvalid","isReadOnly","isRequired","leftIcon","name","onBlur","onBlurProps","onChange","onClear","onFocus","onFocusProps","pills","placeholder","theme","propsTheme","type","value","propsValue","variant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","format","useMessageFormatter","intlMessages","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","useState","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","target","handleClear","onClick","React","createElement","_extends","length","$isFocusVisible","$isRequired","classNames","id","Icon","disabled","map","pill","index","Pill","key","size","Flexbox","gap","IconButton","icon","mdiClose","style","borderLeft","position","top","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG;AAC9BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAA;AACb,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;ACjBA;AACA;AACA;AACaC,MAAAA,eAAe,GAAGC,MAAM,CAACC,GAA0B,CAAA;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC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AA;AAC9C4D,IAAAA,OAAO,EAAED,WAAY;AACrBhE,IAAAA,SAAS,EAAC,aAAA;GACX,CAAA,CAAC,GACA,IAAI,EACP,OAAOQ,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CACN+C,YAAY,GAAG3B,UAAU,GAAGD,KAAK,EACjCjB,UAAU,EACVC,SAAS,IAAKE,UAAU,IAAI,EAAE0C,YAAY,GAAG3B,UAAU,GAAGD,KAAK,CAAE,EACjEd,UACF,CAAC,GACDL,QAAQ,EACX,CAACH,cAAc,IAAIG,QAAQ,KAAKV,KAAK,gBACpCoE,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACEoB,IAAAA,KAAK,EAAE;AACLC,MAAAA,UAAU,EAAE,iDAAiD;AAC7DC,MAAAA,QAAQ,EAAE,UAAU;AACpBC,MAAAA,GAAG,EAAE,MAAA;AACP,KAAA;AAAE,GACH,CAAC,GACA,IAAI,EACP,OAAO5F,KAAK,KAAK,UAAU,GACxBA,KAAK,CACHyD,YAAY,GAAG3B,UAAU,GAAGD,KAAK,EACjCjB,UAAU,EACVC,SAAS,IAAKE,UAAU,IAAI,EAAE0C,YAAY,GAAG3B,UAAU,GAAGD,KAAK,CAAE,EACjEd,UACF,CAAC,GACDf,KACG,CAAC,GACR,IACD,CACU,CAAC,CAAA;AAEtB,CAAC,EAAC;AACFN,SAAS,CAACQ,SAAS,GAAGT,SAAS,CAAA;AAC/BC,SAAS,CAACmG,WAAW,GAAGrG,cAAc;;;;"}
|
|
1
|
+
{"version":3,"file":"TextField.js","sources":["../../src/components/text-field/types.ts","../../src/components/text-field/styles.ts","../../src/components/text-field/intl/index.ts","../../src/components/text-field/TextField.tsx"],"sourcesContent":["import { ChangeEvent, ComponentProps, MutableRefObject, ReactNode } from 'react';\nimport { ButtonsColorPalette, StylingProps, StylingTransientProps, Theme, ValueOf } from '../../types';\nimport { IconProps } from '../icon';\nimport { IconButtonProps } from '../icon-button';\nimport { PillProps } from '../pill';\n\n/**\n * Component variant.\n */\nexport const TextFieldVariant = {\n default: 'default',\n underline: 'underline',\n} as const;\nexport type TextFieldVariant = ValueOf<typeof TextFieldVariant>;\n\n/**\n * Component color.\n */\nexport type TextFieldColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface TextFieldProps extends Omit<ComponentProps<'div'>, 'onChange'>, StylingProps {\n /** Whether the component can be autofocused. */\n autoFocus?: boolean;\n /** Color variant. */\n color?: TextFieldColor;\n /** Force color even when not focused. */\n forceColor?: boolean;\n /**\n * Default value.\n * Used for uncontrolled version.\n */\n defaultValue?: string;\n /** Whether the clear button is displayed or not. */\n hasClearButton?: boolean | Omit<Partial<IconButtonProps>, 'ref'>;\n /** Place for icon buttons between the clear button and the separator. */\n internal?:\n | ReactNode\n | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Place for icon buttons after the separator. */\n after?: ReactNode | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Custom props to pass to the input element. */\n inputProps?: ComponentProps<'input'>;\n /** Custom ref object to pass to the input element. */\n inputRef?: MutableRefObject<HTMLInputElement>;\n /** @deprecated Whether the component should use the product colors or shades of grey. */\n isColored?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is invalid or not. */\n isInvalid?: boolean;\n /** Whether the component is read only or not. */\n isReadOnly?: boolean;\n /** Whether the component is required or not. */\n isRequired?: boolean;\n /** Label */\n label?: string;\n /**\n * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />\n * Can also be a ReactElement.\n */\n leftIcon?: Omit<IconProps, 'ref'>;\n /** Name to pass to the input element. */\n name?: string;\n /** Method to handle component change. */\n onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLInputElement>): void;\n /** Method to handle component clear. */\n onClear?(): void;\n /** List of Pills. */\n pills?: Omit<PillProps, 'ref'>[];\n /** Placeholder. */\n placeholder?: string;\n /** Theme. */\n theme?: Theme;\n /** Input type. */\n type?: string;\n /**\n * Input value.\n * Used for controlled version.\n */\n value?: string;\n /** TextField variant. */\n variant?: TextFieldVariant;\n}\n\nexport interface StyledTextFieldProps extends ComponentProps<'div'>, StylingTransientProps {\n $label?: TextFieldProps['label'];\n $color: TextFieldProps['color'];\n $isGradient: boolean;\n $hasLeftIcon: boolean;\n $hasContent: boolean;\n $isDisabled: TextFieldProps['isDisabled'];\n $isInvalid: TextFieldProps['isInvalid'];\n $isFocused: boolean;\n $isFocusVisible: boolean;\n $isRequired: TextFieldProps['isRequired'];\n $theme: TextFieldProps['theme'];\n $variant: TextFieldProps['variant'];\n}\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledTextFieldProps, TextFieldVariant } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledTextField = styled.div<StyledTextFieldProps>`\n height: fit-content;\n position: relative;\n width: fit-content;\n margin: 0;\n min-width: 0;\n padding: 0;\n ${baseStyling}\n\n border: 0;\n display: inline-flex;\n flex-direction: column;\n vertical-align: top;\n\n ${({\n $label,\n $hasLeftIcon,\n $hasContent,\n $isFocused,\n $isDisabled,\n $isInvalid,\n $color,\n $isGradient,\n $theme,\n $variant,\n }) => css`\n ${$isDisabled\n ? css`\n pointer-events: none;\n `\n : ''}\n\n .redsift-text-field__label {\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: ${$hasContent ? '-8px' : '-7px'};\n transform-origin: top left;\n transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,\n max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n white-space: nowrap;\n z-index: 1;\n\n ${!$hasContent\n ? css`\n max-width: calc(100% - 24px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 16px) scale(1);\n `\n : css`\n max-width: calc(133% - 32px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);\n `}\n\n ${!$isGradient\n ? css`\n color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});\n ${$variant !== TextFieldVariant.underline\n ? css`\n padding-right: 7px;\n padding-left: 5px;\n `\n : ''}\n > span {\n background: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n background-clip: text;\n color: transparent;\n }\n `}\n }\n\n .redsift-text-field__input-wrapper {\n align-items: flex-start;\n box-sizing: border-box;\n cursor: text;\n display: inline-flex;\n min-height: 42px;\n position: relative;\n }\n\n .redsift-text-field-input-wrapper__pills-and-input {\n align-items: flex-start;\n box-sizing: border-box;\n display: flex;\n flex-direction: column-reverse;\n flex-wrap: wrap;\n flex: 1 1 auto;\n padding-bottom: 7px;\n ${$variant !== TextFieldVariant.underline && !$hasLeftIcon\n ? css`\n padding-left: 16px;\n `\n : ''}\n padding-top: ${$label ? '9px' : '7px'};\n\n .redsift-pill {\n margin: 3px 6px 3px 0;\n }\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input {\n background: none;\n border: 0;\n box-sizing: content-box;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n min-width: 0;\n min-width: 100px;\n padding: 2px 0;\n width: 100%;\n\n ${$isDisabled\n ? css`\n color: var(--redsift-color-grey-l2);\n `\n : css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input::placeholder {\n color: var(--redsift-color-neutral-mid-grey);\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input:focus {\n outline: 0;\n }\n\n .redsift-text-field-input-wrapper__fieldset {\n border-style: solid;\n bottom: 0;\n left: 1px;\n margin: 0;\n min-width: 0%;\n overflow: hidden;\n padding: 0 8px;\n pointer-events: none;\n position: absolute;\n right: 0;\n text-align: left;\n top: -5px;\n\n ${!$isGradient || $isDisabled || !$isFocused || $isInvalid\n ? css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom-width: 2px;\n `\n : css`\n border-radius: 4px;\n border-width: 2px;\n `}\n border-color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom: 2px solid transparent;\n `\n : css`\n border: 2px solid transparent;\n border-radius: 4px;\n `}\n background: transparent;\n background-clip: padding-box, border-box;\n background-origin: border-box;\n background-image: linear-gradient(\n 90deg,\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})\n ),\n var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend {\n display: block;\n float: unset;\n font-size: 11px;\n height: 11px;\n overflow: hidden;\n padding: 0;\n visibility: hidden;\n white-space: nowrap;\n width: auto;\n\n ${!$hasContent\n ? css`\n max-width: 0.01px;\n transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n `\n : css`\n max-width: 100%;\n transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend > span {\n display: inline-block;\n opacity: 0;\n padding-left: 5px;\n padding-right: 5px;\n visibility: visible;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n position: relative;\n top: 9px;\n }\n\n .redsift-icon-button:not(.redsift-pill > .redsift-icon-button) {\n padding: 2px;\n position: relative;\n top: -2px;\n height: 28px;\n width: 28px;\n }\n\n ${$variant !== TextFieldVariant.underline\n ? css`\n .redsift-icon.left {\n padding-left: 12px;\n padding-right: 8px;\n line-height: 28px;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n padding-right: 8px;\n }\n `\n : css`\n .redsift-icon.left {\n padding-right: 8px;\n }\n `}\n\n .redsift-icon.left,\n .redsift-icon.right {\n top: 9px;\n }\n `}\n`;\n","import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n","import React, { MouseEvent, ComponentProps, forwardRef, MutableRefObject, useCallback, useState } from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp, getStylingTransientProps } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextFieldProps, TextFieldVariant } from './types';\nimport { StyledTextField } from './styles';\nimport { Icon } from '../../components/icon';\nimport { mdiClose } from '@redsift/icons';\nimport { Flexbox } from '../flexbox';\nimport { IconButton } from '../icon-button';\nimport { Pill } from '../pill';\nimport { useTheme } from '../theme';\nimport { useMessageFormatter } from '../../react-aria/react-aria/i18n';\nimport { useId } from '../../utils';\n\nimport intlMessages from './intl';\n\nconst COMPONENT_NAME = 'TextField';\nconst CLASSNAME = 'redsift-text-field';\n\n/**\n * The TextField component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextField: Comp<TextFieldProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { transientProps, otherProps } = getStylingTransientProps(props);\n\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n hasClearButton,\n inputProps,\n inputRef,\n internal,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n name,\n onBlur: onBlurProps,\n onChange,\n onClear,\n onFocus: onFocusProps,\n pills,\n placeholder,\n theme: propsTheme,\n type,\n value: propsValue,\n variant = TextFieldVariant.default,\n ...forwardedProps\n } = otherProps;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const format = useMessageFormatter(intlMessages);\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextField');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const handleClear = useCallback(() => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange('');\n }\n if (onClear) {\n onClear();\n }\n if (hasClearButton && hasClearButton !== true && hasClearButton.onClick) {\n hasClearButton.onClick({} as MouseEvent<HTMLButtonElement>);\n }\n setValue('');\n }, [onChange]);\n\n return (\n <StyledTextField\n {...focusWithinProps}\n {...forwardedProps}\n {...transientProps}\n $label={label}\n $hasContent={\n isFocusWithin ||\n Boolean(isControlled ? propsValue : value) ||\n Boolean(placeholder) ||\n Boolean(pills && pills.length > 0)\n }\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextField.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextField.className}-input-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextField.className}-input-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextField.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextField.className}__input-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextField.className}-input-wrapper__pills-and-input`}>\n <input\n {...inputProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n className={`${TextField.className}-input-wrapper-pills-and-input__input`}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={inputRef as MutableRefObject<HTMLInputElement>}\n type={type}\n value={isControlled ? propsValue : value}\n />\n <div>\n {pills?.map((pill, index) => (\n <Pill theme={theme} key={`${labelId}-pill-${index}`} color=\"blue\" size=\"small\" {...pill} />\n ))}\n </div>\n </div>\n {hasClearButton || internal || after ? (\n <Flexbox className={`${TextField.className}-input-wrapper__toolbar`} gap=\"8px\">\n {hasClearButton ? (\n <IconButton\n theme={theme}\n aria-label={label ? format('clear-field', { label }) : format('clear')}\n color=\"grey\"\n isDisabled={isDisabled}\n icon={mdiClose}\n {...(hasClearButton !== true && hasClearButton)}\n onClick={handleClear}\n className=\"right clear\"\n />\n ) : null}\n {typeof internal === 'function'\n ? internal(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : internal}\n {(hasClearButton || internal) && after ? (\n <span\n style={{\n borderLeft: '1px solid var(--redsift-color-neutral-mid-grey)',\n position: 'relative',\n top: '-2px',\n }}\n />\n ) : null}\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextField>\n );\n});\nTextField.className = CLASSNAME;\nTextField.displayName = COMPONENT_NAME;\n"],"names":["TextFieldVariant","default","underline","StyledTextField","styled","div","baseStyling","_ref","$label","$hasLeftIcon","$hasContent","$isFocused","$isDisabled","$isInvalid","$color","$isGradient","$theme","$variant","css","Theme","dark","enUS","frFR","COMPONENT_NAME","CLASSNAME","TextField","forwardRef","props","ref","transientProps","otherProps","getStylingTransientProps","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","hasClearButton","inputProps","inputRef","internal","isColored","isDisabled","isInvalid","isReadOnly","isRequired","label","leftIcon","name","onBlur","onBlurProps","onChange","onClear","onFocus","onFocusProps","pills","placeholder","theme","propsTheme","type","value","propsValue","variant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","format","useMessageFormatter","intlMessages","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","useState","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","target","handleClear","onClick","React","createElement","_extends","length","$isFocusVisible","$isRequired","classNames","id","Icon","disabled","map","pill","index","Pill","key","size","Flexbox","gap","IconButton","icon","mdiClose","style","borderLeft","position","top","displayName"],"mappings":";;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG;AAC9BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAA;AACb,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;ACjBA;AACA;AACA;AACaC,MAAAA,eAAe,GAAGC,MAAM,CAACC,GAA0B,CAAA;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;IACDC,MAAM;IACNC,YAAY;IACZC,WAAW;IACXC,UAAU;IACVC,WAAW;IACXC,UAAU;IACVC,MAAM;IACNC,WAAW;IACXC,MAAM;AACNC,IAAAA,QAAAA;AACF,GAAC,GAAAV,IAAA,CAAA;AAAA,EAAA,OAAKW,GAAI,CAAA;AACZ,IAAMN,EAAAA,WAAW,GACTM,GAAI,CAAA;AACZ;AACA,QAAA,CAAS,GACD,EAAG,CAAA;AACX;AACA;AACA;AACA;AACA;AACA;AACA,YAAA,EAAcT,YAAY,IAAI,CAACC,WAAW,GAAG,MAAM,GAAG,GAAI,CAAA;AAC1D;AACA;AACA;AACA;AACA,WAAA,EAAaA,WAAW,GAAG,MAAM,GAAG,MAAO,CAAA;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,MAAQ,EAAA,CAACA,WAAW,GACVQ,GAAI,CAAA;AACd;AACA,iCAAmCD,EAAAA,QAAQ,KAAKjB,gBAAgB,CAACE,SAAS,GAAG,KAAK,GAAG,MA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AC7DC,MAAAA,QAAQ,EAAE,UAAU;AACpBC,MAAAA,GAAG,EAAE,MAAA;AACP,KAAA;AAAE,GACH,CAAC,GACA,IAAI,EACP,OAAO7F,KAAK,KAAK,UAAU,GACxBA,KAAK,CACH0D,YAAY,GAAG3B,UAAU,GAAGD,KAAK,EACjClB,UAAU,EACVC,SAAS,IAAKE,UAAU,IAAI,EAAE2C,YAAY,GAAG3B,UAAU,GAAGD,KAAK,CAAE,EACjEf,UACF,CAAC,GACDf,KACG,CAAC,GACR,IACD,CACU,CAAC,CAAA;AAEtB,CAAC,EAAC;AACFT,SAAS,CAACW,SAAS,GAAGZ,SAAS,CAAA;AAC/BC,SAAS,CAACuG,WAAW,GAAGzG,cAAc;;;;"}
|
|
@@ -129,5 +129,5 @@ function _classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
|
129
129
|
privateMap.set(obj, value);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
export {
|
|
132
|
+
export { _defineProperty as _, _objectSpread2 as a, _objectWithoutProperties as b, _extends as c, _classPrivateFieldInitSpec as d, _classPrivateFieldSet as e, _classPrivateFieldGet as f };
|
|
133
133
|
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
package/_internal/button.js
CHANGED
package/_internal/colors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { rsiAsmHorizontal, rsiBrandTrustHorizontal, rsiCertificatesHorizontal, rsiOndmarcHorizontal, rsiPulseHorizontal, rsiRadarHorizontal, rsiRojoDsHorizontal, rsiVendorSecureHorizontal, rsiRedSiftHorizontal } from '@redsift/icons';
|
|
3
3
|
|
|
4
4
|
const Product = {
|
package/_internal/icon-button.js
CHANGED
package/_internal/link.js
CHANGED
package/_internal/shared.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { f as baseBorder, j as baseContainer, g as baseFlexbox, h as baseGrid, c as baseInternalSpacing, b as baseLayout, e as basePositioning, d as baseSizing, a as baseSpacing, i as baseStyling, k as focusRing, s as srOnly } from './
|
|
1
|
+
export { f as baseBorder, j as baseContainer, g as baseFlexbox, h as baseGrid, c as baseInternalSpacing, b as baseLayout, e as basePositioning, d as baseSizing, a as baseSpacing, i as baseStyling, k as focusRing, s as srOnly } from './styles5.js';
|
|
2
2
|
//# sourceMappingURL=shared.js.map
|