@hh.ru/magritte-ui-textarea 2.1.15 → 2.1.17
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/TextArea.d.ts +1 -2
- package/TextArea.js +49 -4
- package/TextArea.js.map +1 -1
- package/UncontrolledTextArea.js +1 -0
- package/UncontrolledTextArea.js.map +1 -1
- package/index.css +114 -114
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +3 -2
package/TextArea.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type TextareaHTMLAttributes } from 'react';
|
|
2
1
|
import type { ControlledTextAreaProps } from '@hh.ru/magritte-ui-textarea/types';
|
|
3
|
-
declare const TextArea: import("react").ForwardRefExoticComponent<(ControlledTextAreaProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "placeholder" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "invalid" | "invalidLimit" | "elevatePlaceholder" | "onChange" | "value" | "maxLength" | "onValidate" | "layout" | "minHeight" | "resize">) & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
2
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<(ControlledTextAreaProps & Omit<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, "placeholder" | "onFocus" | "onBlur" | "description" | "errorMessage" | "disabled" | "invalid" | "invalidLimit" | "elevatePlaceholder" | "onChange" | "value" | "maxLength" | "onValidate" | "layout" | "minHeight" | "resize">) & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
4
3
|
export { TextArea };
|
package/TextArea.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useState, useRef, useId, useEffect } from 'react';
|
|
3
|
+
import { forwardRef, useState, useRef, useId, useContext, useEffect, useCallback, useLayoutEffect } from 'react';
|
|
4
4
|
import { CSSTransition } from 'react-transition-group';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
|
|
7
7
|
import { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';
|
|
8
|
+
import { BottomSheetContext } from '@hh.ru/magritte-ui-bottom-sheet';
|
|
8
9
|
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
9
10
|
import { FormHelper } from '@hh.ru/magritte-ui-form-helper';
|
|
10
11
|
import { GripSize24 } from '@hh.ru/magritte-ui-icon/private';
|
|
@@ -12,9 +13,23 @@ import { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';
|
|
|
12
13
|
import { useFocus } from './useFocus.js';
|
|
13
14
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
14
15
|
|
|
15
|
-
var styles = {"textarea":"magritte-textarea___ugvor_2-1-
|
|
16
|
+
var styles = {"textarea":"magritte-textarea___ugvor_2-1-17","textarea-focused":"magritte-textarea-focused___eiGyC_2-1-17","textareaFocused":"magritte-textarea-focused___eiGyC_2-1-17","textarea-invalid":"magritte-textarea-invalid___iKOPh_2-1-17","textareaInvalid":"magritte-textarea-invalid___iKOPh_2-1-17","textarea-disabled":"magritte-textarea-disabled___XN0cg_2-1-17","textareaDisabled":"magritte-textarea-disabled___XN0cg_2-1-17","textarea-position-container-wrapper":"magritte-textarea-position-container-wrapper___4Dsui_2-1-17","textareaPositionContainerWrapper":"magritte-textarea-position-container-wrapper___4Dsui_2-1-17","textarea-position-container":"magritte-textarea-position-container___cEpbv_2-1-17","textareaPositionContainer":"magritte-textarea-position-container___cEpbv_2-1-17","native-element":"magritte-native-element___a0RAE_2-1-17","nativeElement":"magritte-native-element___a0RAE_2-1-17","textarea-label":"magritte-textarea-label___sgTIH_2-1-17","textareaLabel":"magritte-textarea-label___sgTIH_2-1-17","textarea-label-elevated":"magritte-textarea-label-elevated___0lxOI_2-1-17","textareaLabelElevated":"magritte-textarea-label-elevated___0lxOI_2-1-17","textarea-limit":"magritte-textarea-limit___IjPJy_2-1-17","textareaLimit":"magritte-textarea-limit___IjPJy_2-1-17","textarea-limit-error":"magritte-textarea-limit-error___vLvZU_2-1-17","textareaLimitError":"magritte-textarea-limit-error___vLvZU_2-1-17","min-height-48":"magritte-min-height-48___jGf5Z_2-1-17","minHeight48":"magritte-min-height-48___jGf5Z_2-1-17","min-height-56":"magritte-min-height-56___2yI39_2-1-17","minHeight56":"magritte-min-height-56___2yI39_2-1-17","min-height-default":"magritte-min-height-default___zwRcq_2-1-17","minHeightDefault":"magritte-min-height-default___zwRcq_2-1-17","textarea-limited":"magritte-textarea-limited___cU1Rg_2-1-17","textareaLimited":"magritte-textarea-limited___cU1Rg_2-1-17","textarea-layout-fill-both":"magritte-textarea-layout-fill-both___ERS-q_2-1-17","textareaLayoutFillBoth":"magritte-textarea-layout-fill-both___ERS-q_2-1-17","textarea-layout-fill-vertical":"magritte-textarea-layout-fill-vertical___HmNtp_2-1-17","textareaLayoutFillVertical":"magritte-textarea-layout-fill-vertical___HmNtp_2-1-17","textarea-layout-fill-horizontal":"magritte-textarea-layout-fill-horizontal___imBH2_2-1-17","textareaLayoutFillHorizontal":"magritte-textarea-layout-fill-horizontal___imBH2_2-1-17","textarea-wrapper":"magritte-textarea-wrapper___yD7G6_2-1-17","textareaWrapper":"magritte-textarea-wrapper___yD7G6_2-1-17","textarea-layout-hug":"magritte-textarea-layout-hug___tdCMY_2-1-17","textareaLayoutHug":"magritte-textarea-layout-hug___tdCMY_2-1-17","textarea-elevated":"magritte-textarea-elevated___S0jk-_2-1-17","textareaElevated":"magritte-textarea-elevated___S0jk-_2-1-17","textarea-animation-timeout":"magritte-textarea-animation-timeout___zudbr_2-1-17","textareaAnimationTimeout":"magritte-textarea-animation-timeout___zudbr_2-1-17","textarea-rigging-container":"magritte-textarea-rigging-container___-1S6i_2-1-17","textareaRiggingContainer":"magritte-textarea-rigging-container___-1S6i_2-1-17","textarea-grip":"magritte-textarea-grip___iL7lq_2-1-17","textareaGrip":"magritte-textarea-grip___iL7lq_2-1-17","textarea-grip-icon":"magritte-textarea-grip-icon___YK-9w_2-1-17","textareaGripIcon":"magritte-textarea-grip-icon___YK-9w_2-1-17","textarea-limit-enter":"magritte-textarea-limit-enter___CygGz_2-1-17","textareaLimitEnter":"magritte-textarea-limit-enter___CygGz_2-1-17","textarea-limit-exit":"magritte-textarea-limit-exit___RMp-R_2-1-17","textareaLimitExit":"magritte-textarea-limit-exit___RMp-R_2-1-17","textarea-limit-enter-active":"magritte-textarea-limit-enter-active___8vN-t_2-1-17","textareaLimitEnterActive":"magritte-textarea-limit-enter-active___8vN-t_2-1-17","textarea-limit-exit-active":"magritte-textarea-limit-exit-active___a5kBr_2-1-17","textareaLimitExitActive":"magritte-textarea-limit-exit-active___a5kBr_2-1-17"};
|
|
16
17
|
|
|
17
18
|
const MIN_HEIGHT_WITH_VISIBLE_LIMIT = 112;
|
|
19
|
+
const findFlexContainer = (element) => {
|
|
20
|
+
if (!element) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
let parentElement = element.parentElement;
|
|
24
|
+
while (parentElement !== null) {
|
|
25
|
+
const { display } = window.getComputedStyle(parentElement);
|
|
26
|
+
if (display.includes('flex')) {
|
|
27
|
+
return parentElement;
|
|
28
|
+
}
|
|
29
|
+
parentElement = parentElement.parentElement;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
18
33
|
const TextAreaComponent = ({ onChange, onFocus, onBlur, onValidate, value, placeholder, disabled = false, elevatePlaceholder = false, invalid = false, invalidLimit = false, maxLength, description, errorMessage, resize = 'none', layout = 'fixed', minHeight, ...restProps }, ref) => {
|
|
19
34
|
const { isXS, isS } = useBreakpoint();
|
|
20
35
|
const [internalInvalid, setInternalInvalid] = useState(false);
|
|
@@ -33,6 +48,9 @@ const TextAreaComponent = ({ onChange, onFocus, onBlur, onValidate, value, place
|
|
|
33
48
|
const isResizable = currentResizeValue !== 'none';
|
|
34
49
|
const [isMaxLengthDisplayed, setMaxLengthDisplayed] = useState(!!maxLength && !minHeight);
|
|
35
50
|
const actualMinHeight = minHeight !== undefined && !value.includes('\n') ? minHeight : undefined;
|
|
51
|
+
const [maxAllowedHeight, setMaxAllowedHeight] = useState(null);
|
|
52
|
+
const bottomSheetContext = useContext(BottomSheetContext);
|
|
53
|
+
const wrapperRef = useRef(null);
|
|
36
54
|
const forceDisabled = useDisabled();
|
|
37
55
|
const isComponentDisabled = forceDisabled || !!disabled;
|
|
38
56
|
useEffect(() => {
|
|
@@ -99,6 +117,30 @@ const TextAreaComponent = ({ onChange, onFocus, onBlur, onValidate, value, place
|
|
|
99
117
|
},
|
|
100
118
|
// value нужен в зависимостях, чтобы проверять размер после ввода каждого символа
|
|
101
119
|
[maxLength, minHeight, value]);
|
|
120
|
+
const flexContainerRef = useRef(null);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
flexContainerRef.current = findFlexContainer(wrapperRef.current);
|
|
123
|
+
}, [wrapperRef.current]); // eslint-disable-line disable-autofix/react-hooks/exhaustive-deps
|
|
124
|
+
const recalcMaxAllowedHeight = useCallback(() => {
|
|
125
|
+
if (bottomSheetContext !== null && resizableDivRef.current !== null && flexContainerRef.current !== null) {
|
|
126
|
+
const lastFlexItem = flexContainerRef.current.childNodes[flexContainerRef.current.childNodes.length - 1];
|
|
127
|
+
const takenFlexSpace = lastFlexItem.offsetTop + lastFlexItem.offsetHeight - resizableDivRef.current.offsetHeight;
|
|
128
|
+
const availableFlexSpace = bottomSheetContext.visibleContentHeight - takenFlexSpace;
|
|
129
|
+
setMaxAllowedHeight(bottomSheetContext.remainingAvailableHeight + availableFlexSpace);
|
|
130
|
+
}
|
|
131
|
+
}, [bottomSheetContext, setMaxAllowedHeight]);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (layout === 'hug' && bottomSheetContext !== null) {
|
|
134
|
+
bottomSheetContext.subscribeToKeyboardResize(recalcMaxAllowedHeight);
|
|
135
|
+
}
|
|
136
|
+
}, [layout, bottomSheetContext, recalcMaxAllowedHeight]);
|
|
137
|
+
useLayoutEffect(() => {
|
|
138
|
+
if (layout === 'hug') {
|
|
139
|
+
recalcMaxAllowedHeight();
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
// value нужен в зависимостях, чтобы пересчитывать размер после ввода каждого символа
|
|
143
|
+
[layout, recalcMaxAllowedHeight, value]);
|
|
102
144
|
return (jsxs("div", { "data-qa": "textarea-wrapper", "data-interactive": true, className: classnames(styles.textarea, {
|
|
103
145
|
[styles.textareaFocused]: isFocused,
|
|
104
146
|
[styles.textareaDisabled]: isComponentDisabled,
|
|
@@ -112,9 +154,12 @@ const TextAreaComponent = ({ onChange, onFocus, onBlur, onValidate, value, place
|
|
|
112
154
|
[styles.textareaElevated]: placeholderIsElevated,
|
|
113
155
|
[styles[`minHeight${minHeight}`]]: actualMinHeight,
|
|
114
156
|
[styles.minHeightDefault]: !minHeight,
|
|
115
|
-
}), children: [jsxs("div", { className: classnames(styles.textareaPositionContainerWrapper, {
|
|
157
|
+
}), ref: wrapperRef, children: [jsxs("div", { className: classnames(styles.textareaPositionContainerWrapper, {
|
|
116
158
|
'focus-visible': isFocusVisible,
|
|
117
|
-
}), children: [jsxs("div", { className: classnames(styles.textareaPositionContainer), onClick: handleClick, onMouseDown: isResizable ? handleMouseDown : undefined, onMouseUp: isResizable ? handleMouseUp : undefined, style: {
|
|
159
|
+
}), children: [jsxs("div", { className: classnames(styles.textareaPositionContainer), onClick: handleClick, onMouseDown: isResizable ? handleMouseDown : undefined, onMouseUp: isResizable ? handleMouseUp : undefined, style: {
|
|
160
|
+
maxHeight: maxAllowedHeight !== null ? `${maxAllowedHeight}px` : undefined,
|
|
161
|
+
resize: currentResizeValue,
|
|
162
|
+
}, ref: resizableDivRef, children: [jsx("div", { className: styles.textareaWrapper, "data-qa": "textarea-native-wrapper", "data-replicated-value": layout === 'hug' && (bottomSheetContext === null || maxAllowedHeight !== null) ? value : '', children: jsx("textarea", { rows: actualMinHeight && 1, ...restProps, ...ariaProps, disabled: isComponentDisabled, suppressHydrationWarning: true, className: styles.nativeElement, value: value, onChange: onChange, onFocus: focusHandler, onBlur: blurHandler, ref: textAreaRefCallback }) }), showLabel && (jsx("div", { className: styles.textareaRiggingContainer, children: jsx("label", { className: classnames(styles.textareaLabel, {
|
|
118
163
|
[styles.textareaLabelElevated]: hasElevatedPlaceholderClass,
|
|
119
164
|
}), id: ariaProps['aria-labelledby'], children: placeholder }) })), !!maxLength && isMaxLengthDisplayed && (jsx(CSSTransition, { in: isFocused || value.length > maxLength, timeout: animationTimeout, classNames: {
|
|
120
165
|
enter: styles.textareaLimitEnter,
|
package/TextArea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../src/TextArea.tsx"],"sourcesContent":["import { forwardRef, type ForwardedRef, useId, useRef, useState, type TextareaHTMLAttributes, useEffect } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { FormHelper } from '@hh.ru/magritte-ui-form-helper';\nimport { GripSize24 } from '@hh.ru/magritte-ui-icon/private';\nimport { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';\nimport type { ControlledTextAreaProps } from '@hh.ru/magritte-ui-textarea/types';\nimport { useFocus } from '@hh.ru/magritte-ui-textarea/useFocus';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './textarea.less';\n\nconst MIN_HEIGHT_WITH_VISIBLE_LIMIT = 112;\n\nconst TextAreaComponent = (\n {\n onChange,\n onFocus,\n onBlur,\n onValidate,\n value,\n placeholder,\n disabled = false,\n elevatePlaceholder = false,\n invalid = false,\n invalidLimit = false,\n maxLength,\n description,\n errorMessage,\n resize = 'none',\n layout = 'fixed',\n minHeight,\n ...restProps\n }: ControlledTextAreaProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, keyof ControlledTextAreaProps>,\n ref: ForwardedRef<HTMLTextAreaElement>\n) => {\n const { isXS, isS } = useBreakpoint();\n const [internalInvalid, setInternalInvalid] = useState(false);\n const [isFocusVisible, setFocusVisible] = useState(false);\n const limitRef = useRef<HTMLDivElement>(null);\n const previousInvalid = useRef(internalInvalid);\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n const resizableDivRef = useRef<HTMLDivElement>(null);\n const resizableDivSizes = useRef<{ width?: number; height?: number } | null>(null);\n const resizableDivWasResized = useRef(false);\n const textAreaRefCallback = useMultipleRefs(ref, textAreaRef);\n const descriptionId = useId();\n const labelId = useId();\n const [animationTimeout, setAnimationTimeout] = useState(100);\n const currentResizeValue = isXS || isS ? 'none' : resize;\n const isResizable = currentResizeValue !== 'none';\n const [isMaxLengthDisplayed, setMaxLengthDisplayed] = useState(!!maxLength && !minHeight);\n const actualMinHeight = minHeight !== undefined && !value.includes('\\n') ? minHeight : undefined;\n\n const forceDisabled = useDisabled();\n const isComponentDisabled = forceDisabled || !!disabled;\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.textareaAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n const { focusHandler, blurHandler, isFocused } = useFocus<HTMLTextAreaElement>(onFocus, onBlur);\n\n const handleClick = () => {\n if (resizableDivWasResized.current) {\n resizableDivWasResized.current = false;\n return;\n }\n textAreaRef.current?.focus();\n };\n\n const handleMouseUp = () => {\n if (\n resizableDivRef.current?.offsetWidth !== resizableDivSizes.current?.width ||\n resizableDivRef.current?.offsetHeight !== resizableDivSizes.current?.height\n ) {\n resizableDivWasResized.current = true;\n }\n };\n\n const handleMouseDown = () => {\n resizableDivSizes.current = {\n width: resizableDivRef.current?.offsetWidth,\n height: resizableDivRef.current?.offsetHeight,\n };\n };\n\n useEffect(() => {\n if (maxLength) {\n const invalid = !isFocused && value.length > maxLength;\n setInternalInvalid(invalid);\n\n if (previousInvalid.current !== invalid) {\n onValidate({ invalidLimit: invalid });\n }\n previousInvalid.current = invalid;\n }\n }, [onValidate, value, internalInvalid, maxLength, isFocused]);\n\n useEffect(() => {\n if (textAreaRef.current) {\n setFocusVisible(isFocused && textAreaRef.current.classList.contains('focus-visible'));\n }\n }, [isFocused]);\n\n const placeholderIsElevated = !!elevatePlaceholder && !!placeholder;\n const showLabel = placeholderIsElevated || value === '';\n\n const invalidState = invalid || invalidLimit;\n const ariaProps = useInputAriaProps({\n invalid: invalidState || internalInvalid,\n hasDescription: !!description,\n hasPlaceholder: !!placeholder,\n descriptionId,\n labelId,\n });\n\n const hasElevatedPlaceholderClass = (isFocused || value !== '') && placeholderIsElevated;\n\n useEffect(\n () => {\n if (resizableDivRef.current !== null) {\n setMaxLengthDisplayed(\n !!maxLength && (!minHeight || resizableDivRef.current.offsetHeight >= MIN_HEIGHT_WITH_VISIBLE_LIMIT)\n );\n }\n },\n // value нужен в зависимостях, чтобы проверять размер после ввода каждого символа\n [maxLength, minHeight, value]\n );\n\n return (\n <div\n data-qa=\"textarea-wrapper\"\n data-interactive={true}\n className={classnames(styles.textarea, {\n [styles.textareaFocused]: isFocused,\n [styles.textareaDisabled]: isComponentDisabled,\n [styles.textareaInvalid]: !!(invalidState || internalInvalid),\n [styles.textareaLimitError]:\n invalidLimit || internalInvalid || (maxLength ? value.length > maxLength : false),\n [styles.textareaLimited]: isMaxLengthDisplayed,\n [styles.textareaLayoutFillBoth]: layout === 'fill-both',\n [styles.textareaLayoutFillVertical]: layout === 'fill-vertical',\n [styles.textareaLayoutFillHorizontal]: layout === 'fill-horizontal',\n [styles.textareaLayoutHug]: layout === 'hug',\n [styles.textareaElevated]: placeholderIsElevated,\n [styles[`minHeight${minHeight}`]]: actualMinHeight,\n [styles.minHeightDefault]: !minHeight,\n })}\n >\n <div\n className={classnames(styles.textareaPositionContainerWrapper, {\n 'focus-visible': isFocusVisible,\n })}\n >\n <div\n className={classnames(styles.textareaPositionContainer)}\n onClick={handleClick}\n onMouseDown={isResizable ? handleMouseDown : undefined}\n onMouseUp={isResizable ? handleMouseUp : undefined}\n style={{ resize: currentResizeValue }}\n ref={resizableDivRef}\n >\n <div\n className={styles.textareaWrapper}\n data-qa=\"textarea-native-wrapper\"\n data-replicated-value={layout === 'hug' ? value : ''}\n >\n <textarea\n rows={actualMinHeight && 1}\n {...restProps}\n {...ariaProps}\n disabled={isComponentDisabled}\n suppressHydrationWarning\n className={styles.nativeElement}\n value={value}\n onChange={onChange}\n onFocus={focusHandler}\n onBlur={blurHandler}\n ref={textAreaRefCallback}\n />\n </div>\n {showLabel && (\n <div className={styles.textareaRiggingContainer}>\n <label\n className={classnames(styles.textareaLabel, {\n [styles.textareaLabelElevated]: hasElevatedPlaceholderClass,\n })}\n id={ariaProps['aria-labelledby']}\n >\n {placeholder}\n </label>\n </div>\n )}\n {!!maxLength && isMaxLengthDisplayed && (\n <CSSTransition\n in={isFocused || value.length > maxLength}\n timeout={animationTimeout}\n classNames={{\n enter: styles.textareaLimitEnter,\n enterActive: styles.textareaLimitEnterActive,\n exit: styles.textareaLimitExit,\n exitActive: styles.textareaLimitExitActive,\n }}\n unmountOnExit\n nodeRef={limitRef}\n >\n <div className={styles.textareaLimit} ref={limitRef}>\n <Text typography=\"label-3-regular\">\n {value.length}/{maxLength}\n </Text>\n </div>\n </CSSTransition>\n )}\n </div>\n {currentResizeValue !== 'none' && (\n <div className={styles.textareaGrip}>\n <div className={styles.textareaGripIcon}>\n <GripSize24 />\n </div>\n </div>\n )}\n </div>\n <FormHelper\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\n invalid={invalidState}\n data-qa=\"textarea-hint-container\"\n />\n </div>\n );\n};\n\nconst TextArea = forwardRef(TextAreaComponent);\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAE1C,MAAM,iBAAiB,GAAG,CACtB,EACI,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,kBAAkB,GAAG,KAAK,EAC1B,OAAO,GAAG,KAAK,EACf,YAAY,GAAG,KAAK,EACpB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,GAAG,MAAM,EACf,MAAM,GAAG,OAAO,EAChB,SAAS,EACT,GAAG,SAAS,EAC6F,EAC7G,GAAsC,KACtC;IACA,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,aAAa,EAAE,CAAC;IACtC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1D,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AAC9C,IAAA,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAChD,IAAA,MAAM,WAAW,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;AACtD,IAAA,MAAM,eAAe,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;AACrD,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAA6C,IAAI,CAAC,CAAC;AACnF,IAAA,MAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,mBAAmB,GAAG,eAAe,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAC9D,IAAA,MAAM,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AA,EAAAA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,YAC/CD,IAAC,CAAA,IAAI,IAAC,UAAU,EAAC,iBAAiB,EAC7B,QAAA,EAAA,CAAA,KAAK,CAAC,MAAM,EAAA,GAAA,EAAG,SAAS,CACtB,EAAA,CAAA,EAAA,CACL,GACM,CACnB,CAAA,EAAA,CACC,EACL,kBAAkB,KAAK,MAAM,KAC1BC,aAAK,SAAS,EAAE,MAAM,CAAC,YAAY,YAC/BA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,gBAAgB,EACnC,QAAA,EAAAA,GAAA,CAAC,UAAU,EAAG,EAAA,CAAA,EAAA,CACZ,GACJ,CACT,CAAA,EAAA,CACC,EACNA,GAAC,CAAA,UAAU,IACP,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,YAAY,EAAA,SAAA,EACb,yBAAyB,EACnC,CAAA,CAAA,EAAA,CACA,EACR;AACN,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,UAAU,CAAC,iBAAiB,EAAE;AAE/C,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../src/TextArea.tsx"],"sourcesContent":["import { forwardRef, useCallback, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport classnames from 'classnames';\n\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { BottomSheetContext } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';\nimport { FormHelper } from '@hh.ru/magritte-ui-form-helper';\nimport { GripSize24 } from '@hh.ru/magritte-ui-icon/private';\nimport { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';\nimport type { ControlledTextAreaProps } from '@hh.ru/magritte-ui-textarea/types';\nimport { useFocus } from '@hh.ru/magritte-ui-textarea/useFocus';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './textarea.less';\n\nconst MIN_HEIGHT_WITH_VISIBLE_LIMIT = 112;\n\nconst findFlexContainer = (element: HTMLElement | null): HTMLElement | null => {\n if (!element) {\n return null;\n }\n\n let parentElement = element.parentElement;\n while (parentElement !== null) {\n const { display } = window.getComputedStyle(parentElement);\n if (display.includes('flex')) {\n return parentElement;\n }\n parentElement = parentElement.parentElement;\n }\n\n return null;\n};\n\nconst TextAreaComponent = (\n {\n onChange,\n onFocus,\n onBlur,\n onValidate,\n value,\n placeholder,\n disabled = false,\n elevatePlaceholder = false,\n invalid = false,\n invalidLimit = false,\n maxLength,\n description,\n errorMessage,\n resize = 'none',\n layout = 'fixed',\n minHeight,\n ...restProps\n }: ControlledTextAreaProps & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof ControlledTextAreaProps>,\n ref: React.ForwardedRef<HTMLTextAreaElement>\n) => {\n const { isXS, isS } = useBreakpoint();\n const [internalInvalid, setInternalInvalid] = useState(false);\n const [isFocusVisible, setFocusVisible] = useState(false);\n const limitRef = useRef<HTMLDivElement>(null);\n const previousInvalid = useRef(internalInvalid);\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n const resizableDivRef = useRef<HTMLDivElement>(null);\n const resizableDivSizes = useRef<{ width?: number; height?: number } | null>(null);\n const resizableDivWasResized = useRef(false);\n const textAreaRefCallback = useMultipleRefs(ref, textAreaRef);\n const descriptionId = useId();\n const labelId = useId();\n const [animationTimeout, setAnimationTimeout] = useState(100);\n const currentResizeValue = isXS || isS ? 'none' : resize;\n const isResizable = currentResizeValue !== 'none';\n const [isMaxLengthDisplayed, setMaxLengthDisplayed] = useState(!!maxLength && !minHeight);\n const actualMinHeight = minHeight !== undefined && !value.includes('\\n') ? minHeight : undefined;\n const [maxAllowedHeight, setMaxAllowedHeight] = useState<number | null>(null);\n const bottomSheetContext = useContext(BottomSheetContext);\n const wrapperRef = useRef(null);\n\n const forceDisabled = useDisabled();\n const isComponentDisabled = forceDisabled || !!disabled;\n\n useEffect(() => {\n const animationTimeoutElement = document.createElement('div');\n animationTimeoutElement.classList.add(styles.textareaAnimationTimeout);\n document.body.appendChild(animationTimeoutElement);\n const style = window.getComputedStyle(animationTimeoutElement);\n const animationTimeout = parseInt(style.getPropertyValue(`--animation-duration`), 10);\n if (Number.isInteger(animationTimeout)) {\n setAnimationTimeout(animationTimeout);\n }\n document.body.removeChild(animationTimeoutElement);\n }, []);\n\n const { focusHandler, blurHandler, isFocused } = useFocus<HTMLTextAreaElement>(onFocus, onBlur);\n\n const handleClick = () => {\n if (resizableDivWasResized.current) {\n resizableDivWasResized.current = false;\n return;\n }\n textAreaRef.current?.focus();\n };\n\n const handleMouseUp = () => {\n if (\n resizableDivRef.current?.offsetWidth !== resizableDivSizes.current?.width ||\n resizableDivRef.current?.offsetHeight !== resizableDivSizes.current?.height\n ) {\n resizableDivWasResized.current = true;\n }\n };\n\n const handleMouseDown = () => {\n resizableDivSizes.current = {\n width: resizableDivRef.current?.offsetWidth,\n height: resizableDivRef.current?.offsetHeight,\n };\n };\n\n useEffect(() => {\n if (maxLength) {\n const invalid = !isFocused && value.length > maxLength;\n setInternalInvalid(invalid);\n\n if (previousInvalid.current !== invalid) {\n onValidate({ invalidLimit: invalid });\n }\n previousInvalid.current = invalid;\n }\n }, [onValidate, value, internalInvalid, maxLength, isFocused]);\n\n useEffect(() => {\n if (textAreaRef.current) {\n setFocusVisible(isFocused && textAreaRef.current.classList.contains('focus-visible'));\n }\n }, [isFocused]);\n\n const placeholderIsElevated = !!elevatePlaceholder && !!placeholder;\n const showLabel = placeholderIsElevated || value === '';\n\n const invalidState = invalid || invalidLimit;\n const ariaProps = useInputAriaProps({\n invalid: invalidState || internalInvalid,\n hasDescription: !!description,\n hasPlaceholder: !!placeholder,\n descriptionId,\n labelId,\n });\n\n const hasElevatedPlaceholderClass = (isFocused || value !== '') && placeholderIsElevated;\n\n useEffect(\n () => {\n if (resizableDivRef.current !== null) {\n setMaxLengthDisplayed(\n !!maxLength && (!minHeight || resizableDivRef.current.offsetHeight >= MIN_HEIGHT_WITH_VISIBLE_LIMIT)\n );\n }\n },\n // value нужен в зависимостях, чтобы проверять размер после ввода каждого символа\n [maxLength, minHeight, value]\n );\n\n const flexContainerRef = useRef<HTMLElement | null>(null);\n useEffect(() => {\n flexContainerRef.current = findFlexContainer(wrapperRef.current);\n }, [wrapperRef.current]); // eslint-disable-line disable-autofix/react-hooks/exhaustive-deps\n\n const recalcMaxAllowedHeight = useCallback(() => {\n if (bottomSheetContext !== null && resizableDivRef.current !== null && flexContainerRef.current !== null) {\n const lastFlexItem = flexContainerRef.current.childNodes[\n flexContainerRef.current.childNodes.length - 1\n ] as HTMLElement;\n const takenFlexSpace =\n lastFlexItem.offsetTop + lastFlexItem.offsetHeight - resizableDivRef.current.offsetHeight;\n const availableFlexSpace = bottomSheetContext.visibleContentHeight - takenFlexSpace;\n setMaxAllowedHeight(bottomSheetContext.remainingAvailableHeight + availableFlexSpace);\n }\n }, [bottomSheetContext, setMaxAllowedHeight]);\n\n useEffect(() => {\n if (layout === 'hug' && bottomSheetContext !== null) {\n bottomSheetContext.subscribeToKeyboardResize(recalcMaxAllowedHeight);\n }\n }, [layout, bottomSheetContext, recalcMaxAllowedHeight]);\n\n useLayoutEffect(\n () => {\n if (layout === 'hug') {\n recalcMaxAllowedHeight();\n }\n },\n // value нужен в зависимостях, чтобы пересчитывать размер после ввода каждого символа\n [layout, recalcMaxAllowedHeight, value]\n );\n\n return (\n <div\n data-qa=\"textarea-wrapper\"\n data-interactive={true}\n className={classnames(styles.textarea, {\n [styles.textareaFocused]: isFocused,\n [styles.textareaDisabled]: isComponentDisabled,\n [styles.textareaInvalid]: !!(invalidState || internalInvalid),\n [styles.textareaLimitError]:\n invalidLimit || internalInvalid || (maxLength ? value.length > maxLength : false),\n [styles.textareaLimited]: isMaxLengthDisplayed,\n [styles.textareaLayoutFillBoth]: layout === 'fill-both',\n [styles.textareaLayoutFillVertical]: layout === 'fill-vertical',\n [styles.textareaLayoutFillHorizontal]: layout === 'fill-horizontal',\n [styles.textareaLayoutHug]: layout === 'hug',\n [styles.textareaElevated]: placeholderIsElevated,\n [styles[`minHeight${minHeight}`]]: actualMinHeight,\n [styles.minHeightDefault]: !minHeight,\n })}\n ref={wrapperRef}\n >\n <div\n className={classnames(styles.textareaPositionContainerWrapper, {\n 'focus-visible': isFocusVisible,\n })}\n >\n <div\n className={classnames(styles.textareaPositionContainer)}\n onClick={handleClick}\n onMouseDown={isResizable ? handleMouseDown : undefined}\n onMouseUp={isResizable ? handleMouseUp : undefined}\n style={{\n maxHeight: maxAllowedHeight !== null ? `${maxAllowedHeight}px` : undefined,\n resize: currentResizeValue,\n }}\n ref={resizableDivRef}\n >\n <div\n className={styles.textareaWrapper}\n data-qa=\"textarea-native-wrapper\"\n data-replicated-value={\n layout === 'hug' && (bottomSheetContext === null || maxAllowedHeight !== null) ? value : ''\n }\n >\n <textarea\n rows={actualMinHeight && 1}\n {...restProps}\n {...ariaProps}\n disabled={isComponentDisabled}\n suppressHydrationWarning\n className={styles.nativeElement}\n value={value}\n onChange={onChange}\n onFocus={focusHandler}\n onBlur={blurHandler}\n ref={textAreaRefCallback}\n />\n </div>\n {showLabel && (\n <div className={styles.textareaRiggingContainer}>\n <label\n className={classnames(styles.textareaLabel, {\n [styles.textareaLabelElevated]: hasElevatedPlaceholderClass,\n })}\n id={ariaProps['aria-labelledby']}\n >\n {placeholder}\n </label>\n </div>\n )}\n {!!maxLength && isMaxLengthDisplayed && (\n <CSSTransition\n in={isFocused || value.length > maxLength}\n timeout={animationTimeout}\n classNames={{\n enter: styles.textareaLimitEnter,\n enterActive: styles.textareaLimitEnterActive,\n exit: styles.textareaLimitExit,\n exitActive: styles.textareaLimitExitActive,\n }}\n unmountOnExit\n nodeRef={limitRef}\n >\n <div className={styles.textareaLimit} ref={limitRef}>\n <Text typography=\"label-3-regular\">\n {value.length}/{maxLength}\n </Text>\n </div>\n </CSSTransition>\n )}\n </div>\n {currentResizeValue !== 'none' && (\n <div className={styles.textareaGrip}>\n <div className={styles.textareaGripIcon}>\n <GripSize24 />\n </div>\n </div>\n )}\n </div>\n <FormHelper\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\n invalid={invalidState}\n data-qa=\"textarea-hint-container\"\n />\n </div>\n );\n};\n\nconst TextArea = forwardRef(TextAreaComponent);\n\nTextArea.displayName = 'TextArea';\n\nexport { TextArea };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAE1C,MAAM,iBAAiB,GAAG,CAAC,OAA2B,KAAwB;IAC1E,IAAI,CAAC,OAAO,EAAE;AACV,QAAA,OAAO,IAAI,CAAC;KACf;AAED,IAAA,IAAI,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAC1C,IAAA,OAAO,aAAa,KAAK,IAAI,EAAE;QAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC3D,QAAA,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC1B,YAAA,OAAO,aAAa,CAAC;SACxB;AACD,QAAA,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC;KAC/C;AAED,IAAA,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CACtB,EACI,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,kBAAkB,GAAG,KAAK,EAC1B,OA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EAAE,QAAQ,EAEjB,QAAA,EAAAA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,YAC/CD,IAAC,CAAA,IAAI,IAAC,UAAU,EAAC,iBAAiB,EAC7B,QAAA,EAAA,CAAA,KAAK,CAAC,MAAM,EAAA,GAAA,EAAG,SAAS,CACtB,EAAA,CAAA,EAAA,CACL,GACM,CACnB,CAAA,EAAA,CACC,EACL,kBAAkB,KAAK,MAAM,KAC1BC,aAAK,SAAS,EAAE,MAAM,CAAC,YAAY,YAC/BA,GAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,gBAAgB,EACnC,QAAA,EAAAA,GAAA,CAAC,UAAU,EAAG,EAAA,CAAA,EAAA,CACZ,GACJ,CACT,CAAA,EAAA,CACC,EACNA,GAAC,CAAA,UAAU,IACP,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,YAAY,EAAA,SAAA,EACb,yBAAyB,EACnC,CAAA,CAAA,EAAA,CACA,EACR;AACN,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,UAAU,CAAC,iBAAiB,EAAE;AAE/C,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}
|
package/UncontrolledTextArea.js
CHANGED
|
@@ -6,6 +6,7 @@ import 'react-transition-group';
|
|
|
6
6
|
import 'classnames';
|
|
7
7
|
import '@hh.ru/magritte-common-use-disabled';
|
|
8
8
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
9
|
+
import '@hh.ru/magritte-ui-bottom-sheet';
|
|
9
10
|
import '@hh.ru/magritte-ui-breakpoint';
|
|
10
11
|
import '@hh.ru/magritte-ui-form-helper';
|
|
11
12
|
import '@hh.ru/magritte-ui-icon/private';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UncontrolledTextArea.js","sources":["../src/UncontrolledTextArea.tsx"],"sourcesContent":["import { forwardRef, TextareaHTMLAttributes, useCallback, useState, type ChangeEvent } from 'react';\n\nimport { TextArea } from '@hh.ru/magritte-ui-textarea/TextArea';\nimport { UncontrolledTextAreaProps } from '@hh.ru/magritte-ui-textarea/types';\n\nexport const UncontrolledTextArea = forwardRef<\n HTMLTextAreaElement,\n UncontrolledTextAreaProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, keyof UncontrolledTextAreaProps>\n>(({ value = '', onChange, ...restProps }, ref) => {\n const [defaultValue, setDefaultValue] = useState(value);\n const changeHandler = useCallback(\n (event: ChangeEvent<HTMLTextAreaElement>) => {\n setDefaultValue(event.target.value);\n onChange?.(event);\n },\n [onChange]\n );\n\n return <TextArea {...restProps} value={defaultValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledTextArea.displayName = 'UncontrolledTextArea';\n"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"UncontrolledTextArea.js","sources":["../src/UncontrolledTextArea.tsx"],"sourcesContent":["import { forwardRef, TextareaHTMLAttributes, useCallback, useState, type ChangeEvent } from 'react';\n\nimport { TextArea } from '@hh.ru/magritte-ui-textarea/TextArea';\nimport { UncontrolledTextAreaProps } from '@hh.ru/magritte-ui-textarea/types';\n\nexport const UncontrolledTextArea = forwardRef<\n HTMLTextAreaElement,\n UncontrolledTextAreaProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, keyof UncontrolledTextAreaProps>\n>(({ value = '', onChange, ...restProps }, ref) => {\n const [defaultValue, setDefaultValue] = useState(value);\n const changeHandler = useCallback(\n (event: ChangeEvent<HTMLTextAreaElement>) => {\n setDefaultValue(event.target.value);\n onChange?.(event);\n },\n [onChange]\n );\n\n return <TextArea {...restProps} value={defaultValue} onChange={changeHandler} ref={ref} />;\n});\n\nUncontrolledTextArea.displayName = 'UncontrolledTextArea';\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;MAKa,oBAAoB,GAAG,UAAU,CAG5C,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG,KAAI;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxD,IAAA,MAAM,aAAa,GAAG,WAAW,CAC7B,CAAC,KAAuC,KAAI;AACxC,QAAA,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpC,QAAA,QAAQ,GAAG,KAAK,CAAC,CAAC;AACtB,KAAC,EACD,CAAC,QAAQ,CAAC,CACb,CAAC;AAEF,IAAA,OAAOA,IAAC,QAAQ,EAAA,EAAA,GAAK,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC/F,CAAC,EAAE;AAEH,oBAAoB,CAAC,WAAW,GAAG,sBAAsB;;;;"}
|
package/index.css
CHANGED
|
@@ -100,227 +100,227 @@
|
|
|
100
100
|
--magritte-color-component-input-text-state-description-invalid-v21-4-0:#ff4d3a;
|
|
101
101
|
--magritte-color-component-input-icon-grip-v21-4-0:#535353;
|
|
102
102
|
}
|
|
103
|
-
.magritte-textarea___ugvor_2-1-
|
|
103
|
+
.magritte-textarea___ugvor_2-1-17{
|
|
104
104
|
display:inline-flex;
|
|
105
105
|
flex-flow:column;
|
|
106
106
|
--animation-100-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v21-4-0);
|
|
107
107
|
--animation-300-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-0);
|
|
108
108
|
}
|
|
109
109
|
@media (min-width: 1020px){
|
|
110
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
110
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover{
|
|
111
111
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-hovered-v21-4-0);
|
|
112
112
|
}
|
|
113
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
113
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
114
114
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-hovered-v21-4-0);
|
|
115
115
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-hovered-v21-4-0);
|
|
116
116
|
border-width:1px;
|
|
117
117
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v21-4-0);
|
|
118
118
|
}
|
|
119
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
119
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
120
120
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-hovered-v21-4-0);
|
|
121
121
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v21-4-0);
|
|
122
122
|
}
|
|
123
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
123
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-native-element___a0RAE_2-1-17{
|
|
124
124
|
color:var(--magritte-color-component-input-text-state-content-hovered-v21-4-0);
|
|
125
125
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-hovered-v21-4-0);
|
|
126
126
|
opacity:1;
|
|
127
127
|
}
|
|
128
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
128
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-label___sgTIH_2-1-17{
|
|
129
129
|
color:var(--magritte-color-component-input-text-state-placeholder-hovered-v21-4-0);
|
|
130
130
|
}
|
|
131
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
131
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
132
132
|
color:var(--magritte-color-component-input-text-state-label-hovered-v21-4-0);
|
|
133
133
|
}
|
|
134
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
134
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-limit___IjPJy_2-1-17{
|
|
135
135
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v21-4-0);
|
|
136
136
|
}
|
|
137
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-1-
|
|
137
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-limit___IjPJy_2-1-17{
|
|
138
138
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-hovered-v21-4-0);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
@media (min-width: 1024px){
|
|
142
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
142
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover{
|
|
143
143
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-hovered-v21-4-0);
|
|
144
144
|
}
|
|
145
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
145
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
146
146
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-hovered-v21-4-0);
|
|
147
147
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-hovered-v21-4-0);
|
|
148
148
|
border-width:1px;
|
|
149
149
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v21-4-0);
|
|
150
150
|
}
|
|
151
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
151
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
152
152
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-hovered-v21-4-0);
|
|
153
153
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v21-4-0);
|
|
154
154
|
}
|
|
155
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
155
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-native-element___a0RAE_2-1-17{
|
|
156
156
|
color:var(--magritte-color-component-input-text-state-content-hovered-v21-4-0);
|
|
157
157
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-hovered-v21-4-0);
|
|
158
158
|
opacity:1;
|
|
159
159
|
}
|
|
160
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
160
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-label___sgTIH_2-1-17{
|
|
161
161
|
color:var(--magritte-color-component-input-text-state-placeholder-hovered-v21-4-0);
|
|
162
162
|
}
|
|
163
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
163
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
164
164
|
color:var(--magritte-color-component-input-text-state-label-hovered-v21-4-0);
|
|
165
165
|
}
|
|
166
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
166
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-limit___IjPJy_2-1-17{
|
|
167
167
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v21-4-0);
|
|
168
168
|
}
|
|
169
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-
|
|
169
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-1-17:not(.magritte-textarea-focused___eiGyC_2-1-17):not(.magritte-textarea-invalid___iKOPh_2-1-17):not(.magritte-textarea-disabled___XN0cg_2-1-17):hover .magritte-textarea-limit___IjPJy_2-1-17{
|
|
170
170
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-hovered-v21-4-0);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
.magritte-textarea___ugvor_2-1-
|
|
173
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17{
|
|
174
174
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-focused-v21-4-0);
|
|
175
175
|
}
|
|
176
|
-
.magritte-textarea___ugvor_2-1-
|
|
176
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
177
177
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-focused-v21-4-0);
|
|
178
178
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-focused-v21-4-0);
|
|
179
179
|
border-width:2px;
|
|
180
180
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v21-4-0);
|
|
181
181
|
}
|
|
182
|
-
.magritte-textarea___ugvor_2-1-
|
|
182
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
183
183
|
box-shadow:inset 0 0 0 2px var(--magritte-color-component-input-stroke-state-field-focused-v21-4-0);
|
|
184
184
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v21-4-0);
|
|
185
185
|
}
|
|
186
|
-
.magritte-textarea___ugvor_2-1-
|
|
186
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
187
187
|
color:var(--magritte-color-component-input-text-state-content-focused-v21-4-0);
|
|
188
188
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-focused-v21-4-0);
|
|
189
189
|
opacity:1;
|
|
190
190
|
}
|
|
191
|
-
.magritte-textarea___ugvor_2-1-
|
|
191
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-textarea-label___sgTIH_2-1-17{
|
|
192
192
|
color:var(--magritte-color-component-input-text-state-placeholder-focused-v21-4-0);
|
|
193
193
|
}
|
|
194
|
-
.magritte-textarea___ugvor_2-1-
|
|
194
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
195
195
|
color:var(--magritte-color-component-input-text-state-label-focused-v21-4-0);
|
|
196
196
|
}
|
|
197
|
-
.magritte-textarea___ugvor_2-1-
|
|
197
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
198
198
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v21-4-0);
|
|
199
199
|
}
|
|
200
|
-
.magritte-textarea___ugvor_2-1-
|
|
200
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
201
201
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-focused-v21-4-0);
|
|
202
202
|
}
|
|
203
|
-
.magritte-textarea___ugvor_2-1-
|
|
204
|
-
.magritte-textarea___ugvor_2-1-
|
|
203
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17,
|
|
204
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17{
|
|
205
205
|
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v21-4-0);
|
|
206
206
|
}
|
|
207
|
-
.magritte-textarea___ugvor_2-1-
|
|
208
|
-
.magritte-textarea___ugvor_2-1-
|
|
207
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after,
|
|
208
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
209
209
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-invalid-v21-4-0);
|
|
210
210
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-invalid-v21-4-0);
|
|
211
211
|
border-width:2px;
|
|
212
212
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v21-4-0);
|
|
213
213
|
}
|
|
214
|
-
.magritte-textarea___ugvor_2-1-
|
|
215
|
-
.magritte-textarea___ugvor_2-1-
|
|
214
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17,
|
|
215
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
216
216
|
box-shadow:inset 0 0 0 2px var(--magritte-color-component-input-stroke-state-field-invalid-v21-4-0);
|
|
217
217
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v21-4-0);
|
|
218
218
|
}
|
|
219
|
-
.magritte-textarea___ugvor_2-1-
|
|
220
|
-
.magritte-textarea___ugvor_2-1-
|
|
219
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-native-element___a0RAE_2-1-17,
|
|
220
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
221
221
|
color:var(--magritte-color-component-input-text-state-content-invalid-v21-4-0);
|
|
222
222
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v21-4-0);
|
|
223
223
|
opacity:1;
|
|
224
224
|
}
|
|
225
|
-
.magritte-textarea___ugvor_2-1-
|
|
226
|
-
.magritte-textarea___ugvor_2-1-
|
|
225
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-label___sgTIH_2-1-17,
|
|
226
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-label___sgTIH_2-1-17{
|
|
227
227
|
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v21-4-0);
|
|
228
228
|
}
|
|
229
|
-
.magritte-textarea___ugvor_2-1-
|
|
230
|
-
.magritte-textarea___ugvor_2-1-
|
|
229
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17,
|
|
230
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
231
231
|
color:var(--magritte-color-component-input-text-state-label-invalid-v21-4-0);
|
|
232
232
|
}
|
|
233
|
-
.magritte-textarea___ugvor_2-1-
|
|
234
|
-
.magritte-textarea___ugvor_2-1-
|
|
233
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17,
|
|
234
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
235
235
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v21-4-0);
|
|
236
236
|
}
|
|
237
|
-
.magritte-textarea___ugvor_2-1-
|
|
237
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-focused___eiGyC_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
238
238
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-invalid-v21-4-0);
|
|
239
239
|
}
|
|
240
|
-
.magritte-textarea___ugvor_2-1-
|
|
240
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17{
|
|
241
241
|
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v21-4-0);
|
|
242
242
|
}
|
|
243
|
-
.magritte-textarea___ugvor_2-1-
|
|
243
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
244
244
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-invalid-v21-4-0);
|
|
245
245
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-invalid-v21-4-0);
|
|
246
246
|
border-width:1px;
|
|
247
247
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v21-4-0);
|
|
248
248
|
}
|
|
249
|
-
.magritte-textarea___ugvor_2-1-
|
|
249
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
250
250
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-invalid-v21-4-0);
|
|
251
251
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v21-4-0);
|
|
252
252
|
}
|
|
253
|
-
.magritte-textarea___ugvor_2-1-
|
|
253
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
254
254
|
color:var(--magritte-color-component-input-text-state-content-invalid-v21-4-0);
|
|
255
255
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v21-4-0);
|
|
256
256
|
opacity:1;
|
|
257
257
|
}
|
|
258
|
-
.magritte-textarea___ugvor_2-1-
|
|
258
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-label___sgTIH_2-1-17{
|
|
259
259
|
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v21-4-0);
|
|
260
260
|
}
|
|
261
|
-
.magritte-textarea___ugvor_2-1-
|
|
261
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
262
262
|
color:var(--magritte-color-component-input-text-state-label-invalid-v21-4-0);
|
|
263
263
|
}
|
|
264
|
-
.magritte-textarea___ugvor_2-1-
|
|
264
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
265
265
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v21-4-0);
|
|
266
266
|
}
|
|
267
|
-
.magritte-textarea___ugvor_2-1-
|
|
267
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-limit-error___vLvZU_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
268
268
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-invalid-v21-4-0);
|
|
269
269
|
}
|
|
270
|
-
.magritte-textarea___ugvor_2-1-
|
|
270
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17{
|
|
271
271
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-disabled-v21-4-0);
|
|
272
272
|
}
|
|
273
|
-
.magritte-textarea___ugvor_2-1-
|
|
273
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
274
274
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-disabled-v21-4-0);
|
|
275
275
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-disabled-v21-4-0);
|
|
276
276
|
border-width:1px;
|
|
277
277
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v21-4-0);
|
|
278
278
|
}
|
|
279
|
-
.magritte-textarea___ugvor_2-1-
|
|
279
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
280
280
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-disabled-v21-4-0);
|
|
281
281
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v21-4-0);
|
|
282
282
|
}
|
|
283
|
-
.magritte-textarea___ugvor_2-1-
|
|
283
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
284
284
|
color:var(--magritte-color-component-input-text-state-content-disabled-v21-4-0);
|
|
285
285
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-disabled-v21-4-0);
|
|
286
286
|
opacity:1;
|
|
287
287
|
}
|
|
288
|
-
.magritte-textarea___ugvor_2-1-
|
|
288
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-label___sgTIH_2-1-17{
|
|
289
289
|
color:var(--magritte-color-component-input-text-state-placeholder-disabled-v21-4-0);
|
|
290
290
|
}
|
|
291
|
-
.magritte-textarea___ugvor_2-1-
|
|
291
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
292
292
|
color:var(--magritte-color-component-input-text-state-label-disabled-v21-4-0);
|
|
293
293
|
}
|
|
294
|
-
.magritte-textarea___ugvor_2-1-
|
|
294
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
295
295
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v21-4-0);
|
|
296
296
|
}
|
|
297
|
-
.magritte-textarea___ugvor_2-1-
|
|
297
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-limit___IjPJy_2-1-17{
|
|
298
298
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-disabled-v21-4-0);
|
|
299
299
|
}
|
|
300
|
-
.magritte-textarea___ugvor_2-1-
|
|
301
|
-
.magritte-textarea___ugvor_2-1-
|
|
300
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17,
|
|
301
|
+
.magritte-textarea___ugvor_2-1-17.magritte-textarea-disabled___XN0cg_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
302
302
|
cursor:not-allowed;
|
|
303
303
|
}
|
|
304
304
|
@media (prefers-reduced-motion){
|
|
305
|
-
.magritte-textarea___ugvor_2-1-
|
|
305
|
+
.magritte-textarea___ugvor_2-1-17{
|
|
306
306
|
--animation-100-duration:1ms;
|
|
307
307
|
--animation-300-duration:1ms;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
.magritte-textarea-invalid___iKOPh_2-1-
|
|
310
|
+
.magritte-textarea-invalid___iKOPh_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17.focus-visible{
|
|
311
311
|
outline:var(--magritte-color-component-input-stroke-state-negative-focused-accessible-v21-4-0) solid 4px;
|
|
312
312
|
}
|
|
313
|
-
.magritte-textarea-position-container-wrapper___4Dsui_2-1-
|
|
313
|
+
.magritte-textarea-position-container-wrapper___4Dsui_2-1-17{
|
|
314
314
|
display:inline-flex;
|
|
315
315
|
position:relative;
|
|
316
316
|
overflow:hidden;
|
|
317
317
|
width:100%;
|
|
318
318
|
border-radius:12px;
|
|
319
319
|
}
|
|
320
|
-
.magritte-textarea-position-container-wrapper___4Dsui_2-1-
|
|
320
|
+
.magritte-textarea-position-container-wrapper___4Dsui_2-1-17.focus-visible{
|
|
321
321
|
outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v21-4-0) solid 4px;
|
|
322
322
|
}
|
|
323
|
-
.magritte-textarea-position-container-wrapper___4Dsui_2-1-
|
|
323
|
+
.magritte-textarea-position-container-wrapper___4Dsui_2-1-17::after{
|
|
324
324
|
display:block;
|
|
325
325
|
pointer-events:none;
|
|
326
326
|
user-select:none;
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
border-bottom:1px solid var(--magritte-color-component-input-stroke-field-v21-4-0);
|
|
336
336
|
border-right:1px solid var(--magritte-color-component-input-stroke-field-v21-4-0);
|
|
337
337
|
}
|
|
338
|
-
.magritte-native-element___a0RAE_2-1-
|
|
338
|
+
.magritte-native-element___a0RAE_2-1-17{
|
|
339
339
|
font-family:var(--magritte-typography-label-2-regular-font-family-v21-4-0);
|
|
340
340
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v21-4-0);
|
|
341
341
|
line-height:var(--magritte-typography-label-2-regular-line-height-v21-4-0);
|
|
@@ -355,64 +355,64 @@
|
|
|
355
355
|
background:none;
|
|
356
356
|
appearance:none;
|
|
357
357
|
}
|
|
358
|
-
.magritte-native-element___a0RAE_2-1-
|
|
358
|
+
.magritte-native-element___a0RAE_2-1-17:focus{
|
|
359
359
|
outline:none;
|
|
360
360
|
}
|
|
361
|
-
.magritte-min-height-48___jGf5Z_2-1-
|
|
361
|
+
.magritte-min-height-48___jGf5Z_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
362
362
|
min-height:calc(36px - var(--magritte-typography-label-4-regular-line-height-v21-4-0));
|
|
363
363
|
}
|
|
364
|
-
.magritte-min-height-56___2yI39_2-1-
|
|
364
|
+
.magritte-min-height-56___2yI39_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
365
365
|
min-height:calc(40px - var(--magritte-typography-label-4-regular-line-height-v21-4-0));
|
|
366
366
|
}
|
|
367
|
-
.magritte-min-height-default___zwRcq_2-1-
|
|
367
|
+
.magritte-min-height-default___zwRcq_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
368
368
|
min-height:calc(78px - var(--magritte-typography-label-4-regular-line-height-v21-4-0));
|
|
369
369
|
}
|
|
370
|
-
.magritte-textarea-limited___cU1Rg_2-1-
|
|
370
|
+
.magritte-textarea-limited___cU1Rg_2-1-17.magritte-min-height-48___jGf5Z_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
371
371
|
min-height:calc(22px - var(--magritte-typography-label-4-regular-line-height-v21-4-0));
|
|
372
372
|
}
|
|
373
|
-
.magritte-textarea-limited___cU1Rg_2-1-
|
|
373
|
+
.magritte-textarea-limited___cU1Rg_2-1-17.magritte-min-height-56___2yI39_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
374
374
|
min-height:calc(22px - var(--magritte-typography-label-4-regular-line-height-v21-4-0));
|
|
375
375
|
}
|
|
376
|
-
.magritte-textarea-limited___cU1Rg_2-1-
|
|
376
|
+
.magritte-textarea-limited___cU1Rg_2-1-17.magritte-min-height-default___zwRcq_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
377
377
|
min-height:calc(64px - var(--magritte-typography-label-4-regular-line-height-v21-4-0));
|
|
378
378
|
}
|
|
379
|
-
.magritte-textarea-layout-fill-both___ERS-q_2-1-
|
|
380
|
-
.magritte-textarea-layout-fill-vertical___HmNtp_2-1-
|
|
381
|
-
.magritte-textarea-layout-fill-horizontal___imBH2_2-1-
|
|
379
|
+
.magritte-textarea-layout-fill-both___ERS-q_2-1-17,
|
|
380
|
+
.magritte-textarea-layout-fill-vertical___HmNtp_2-1-17,
|
|
381
|
+
.magritte-textarea-layout-fill-horizontal___imBH2_2-1-17{
|
|
382
382
|
flex-direction:column;
|
|
383
383
|
}
|
|
384
|
-
.magritte-textarea-layout-fill-both___ERS-q_2-1-
|
|
385
|
-
.magritte-textarea-layout-fill-vertical___HmNtp_2-1-
|
|
386
|
-
.magritte-textarea-layout-fill-horizontal___imBH2_2-1-
|
|
384
|
+
.magritte-textarea-layout-fill-both___ERS-q_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17,
|
|
385
|
+
.magritte-textarea-layout-fill-vertical___HmNtp_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17,
|
|
386
|
+
.magritte-textarea-layout-fill-horizontal___imBH2_2-1-17 .magritte-textarea-position-container-wrapper___4Dsui_2-1-17{
|
|
387
387
|
flex:1;
|
|
388
388
|
}
|
|
389
|
-
.magritte-textarea-layout-fill-both___ERS-q_2-1-
|
|
389
|
+
.magritte-textarea-layout-fill-both___ERS-q_2-1-17{
|
|
390
390
|
width:100%;
|
|
391
391
|
height:100%;
|
|
392
392
|
}
|
|
393
|
-
.magritte-textarea-layout-fill-vertical___HmNtp_2-1-
|
|
393
|
+
.magritte-textarea-layout-fill-vertical___HmNtp_2-1-17{
|
|
394
394
|
height:100%;
|
|
395
395
|
}
|
|
396
|
-
.magritte-textarea-layout-fill-horizontal___imBH2_2-1-
|
|
396
|
+
.magritte-textarea-layout-fill-horizontal___imBH2_2-1-17{
|
|
397
397
|
width:100%;
|
|
398
398
|
}
|
|
399
|
-
.magritte-textarea-wrapper___yD7G6_2-1-
|
|
399
|
+
.magritte-textarea-wrapper___yD7G6_2-1-17{
|
|
400
400
|
display:inline-flex;
|
|
401
401
|
width:100%;
|
|
402
402
|
}
|
|
403
|
-
.magritte-textarea-layout-hug___tdCMY_2-1-
|
|
403
|
+
.magritte-textarea-layout-hug___tdCMY_2-1-17{
|
|
404
404
|
width:100%;
|
|
405
405
|
}
|
|
406
|
-
.magritte-textarea-layout-hug___tdCMY_2-1-
|
|
406
|
+
.magritte-textarea-layout-hug___tdCMY_2-1-17 .magritte-textarea-wrapper___yD7G6_2-1-17{
|
|
407
407
|
display:grid;
|
|
408
408
|
}
|
|
409
|
-
.magritte-textarea-layout-hug___tdCMY_2-1-
|
|
410
|
-
.magritte-textarea-layout-hug___tdCMY_2-1-
|
|
409
|
+
.magritte-textarea-layout-hug___tdCMY_2-1-17 .magritte-textarea-wrapper___yD7G6_2-1-17::after,
|
|
410
|
+
.magritte-textarea-layout-hug___tdCMY_2-1-17 .magritte-textarea-wrapper___yD7G6_2-1-17 .magritte-native-element___a0RAE_2-1-17{
|
|
411
411
|
grid-area:1 / 1 / 2 / 2;
|
|
412
412
|
overflow:hidden;
|
|
413
413
|
width:auto;
|
|
414
414
|
}
|
|
415
|
-
.magritte-textarea-layout-hug___tdCMY_2-1-
|
|
415
|
+
.magritte-textarea-layout-hug___tdCMY_2-1-17 .magritte-textarea-wrapper___yD7G6_2-1-17::after{
|
|
416
416
|
font-family:var(--magritte-typography-label-2-regular-font-family-v21-4-0);
|
|
417
417
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v21-4-0);
|
|
418
418
|
line-height:var(--magritte-typography-label-2-regular-line-height-v21-4-0);
|
|
@@ -431,7 +431,7 @@
|
|
|
431
431
|
white-space:pre-wrap;
|
|
432
432
|
visibility:hidden;
|
|
433
433
|
}
|
|
434
|
-
.magritte-textarea-position-container___cEpbv_2-1-
|
|
434
|
+
.magritte-textarea-position-container___cEpbv_2-1-17{
|
|
435
435
|
display:inline-flex;
|
|
436
436
|
overflow:hidden;
|
|
437
437
|
position:relative;
|
|
@@ -443,57 +443,57 @@
|
|
|
443
443
|
box-sizing:border-box;
|
|
444
444
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-field-v21-4-0);
|
|
445
445
|
}
|
|
446
|
-
.magritte-textarea-position-container___cEpbv_2-1-
|
|
446
|
+
.magritte-textarea-position-container___cEpbv_2-1-17::-webkit-resizer{
|
|
447
447
|
display:none;
|
|
448
448
|
}
|
|
449
|
-
.magritte-textarea-elevated___S0jk-_2-1-
|
|
449
|
+
.magritte-textarea-elevated___S0jk-_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
450
450
|
padding-top:calc(var(--magritte-typography-label-4-regular-line-height-v21-4-0) + 18px);
|
|
451
451
|
}
|
|
452
|
-
.magritte-textarea-limited___cU1Rg_2-1-
|
|
452
|
+
.magritte-textarea-limited___cU1Rg_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
453
453
|
padding-bottom:30px;
|
|
454
454
|
}
|
|
455
|
-
.magritte-min-height-48___jGf5Z_2-1-
|
|
455
|
+
.magritte-min-height-48___jGf5Z_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
456
456
|
padding-top:12px;
|
|
457
457
|
padding-bottom:12px;
|
|
458
458
|
min-height:48px;
|
|
459
459
|
}
|
|
460
|
-
.magritte-min-height-56___2yI39_2-1-
|
|
460
|
+
.magritte-min-height-56___2yI39_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
461
461
|
padding-top:16px;
|
|
462
462
|
padding-bottom:16px;
|
|
463
463
|
min-height:56px;
|
|
464
464
|
}
|
|
465
|
-
.magritte-min-height-default___zwRcq_2-1-
|
|
465
|
+
.magritte-min-height-default___zwRcq_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
466
466
|
min-height:112px;
|
|
467
467
|
}
|
|
468
|
-
.magritte-textarea-elevated___S0jk-_2-1-
|
|
468
|
+
.magritte-textarea-elevated___S0jk-_2-1-17.magritte-min-height-48___jGf5Z_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
469
469
|
padding-top:22px;
|
|
470
470
|
padding-bottom:4px;
|
|
471
471
|
}
|
|
472
|
-
.magritte-textarea-elevated___S0jk-_2-1-
|
|
472
|
+
.magritte-textarea-elevated___S0jk-_2-1-17.magritte-min-height-56___2yI39_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
473
473
|
padding-top:26px;
|
|
474
474
|
padding-bottom:8px;
|
|
475
475
|
}
|
|
476
|
-
.magritte-textarea-limited___cU1Rg_2-1-
|
|
476
|
+
.magritte-textarea-limited___cU1Rg_2-1-17.magritte-min-height-48___jGf5Z_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
477
477
|
padding-bottom:26px;
|
|
478
478
|
}
|
|
479
|
-
.magritte-textarea-limited___cU1Rg_2-1-
|
|
479
|
+
.magritte-textarea-limited___cU1Rg_2-1-17.magritte-min-height-56___2yI39_2-1-17 .magritte-textarea-position-container___cEpbv_2-1-17{
|
|
480
480
|
padding-bottom:30px;
|
|
481
481
|
}
|
|
482
|
-
.magritte-textarea-animation-timeout___zudbr_2-1-
|
|
483
|
-
.magritte-textarea-position-container___cEpbv_2-1-
|
|
482
|
+
.magritte-textarea-animation-timeout___zudbr_2-1-17,
|
|
483
|
+
.magritte-textarea-position-container___cEpbv_2-1-17{
|
|
484
484
|
transition-property:transform, color, font-size, letter-spacing;
|
|
485
485
|
transition-duration:var(--animation-100-duration);
|
|
486
486
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v21-4-0);
|
|
487
487
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v21-4-0);
|
|
488
488
|
}
|
|
489
|
-
.magritte-textarea-rigging-container___-1S6i_2-1-
|
|
489
|
+
.magritte-textarea-rigging-container___-1S6i_2-1-17{
|
|
490
490
|
position:absolute;
|
|
491
491
|
pointer-events:none;
|
|
492
492
|
left:16px;
|
|
493
493
|
right:16px;
|
|
494
494
|
top:0;
|
|
495
495
|
}
|
|
496
|
-
.magritte-textarea-label___sgTIH_2-1-
|
|
496
|
+
.magritte-textarea-label___sgTIH_2-1-17{
|
|
497
497
|
font-family:var(--magritte-typography-label-2-regular-font-family-v21-4-0);
|
|
498
498
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v21-4-0);
|
|
499
499
|
line-height:var(--magritte-typography-label-2-regular-line-height-v21-4-0);
|
|
@@ -513,13 +513,13 @@
|
|
|
513
513
|
transition-duration:var(--animation-100-duration);
|
|
514
514
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v21-4-0);
|
|
515
515
|
}
|
|
516
|
-
.magritte-min-height-48___jGf5Z_2-1-
|
|
516
|
+
.magritte-min-height-48___jGf5Z_2-1-17 .magritte-textarea-label___sgTIH_2-1-17{
|
|
517
517
|
padding-top:12px;
|
|
518
518
|
}
|
|
519
|
-
.magritte-min-height-56___2yI39_2-1-
|
|
519
|
+
.magritte-min-height-56___2yI39_2-1-17 .magritte-textarea-label___sgTIH_2-1-17{
|
|
520
520
|
padding-top:16px;
|
|
521
521
|
}
|
|
522
|
-
.magritte-textarea-label-elevated___0lxOI_2-1-
|
|
522
|
+
.magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
523
523
|
font-family:var(--magritte-typography-label-4-regular-font-family-v21-4-0);
|
|
524
524
|
font-weight:var(--magritte-typography-label-4-regular-font-weight-v21-4-0);
|
|
525
525
|
line-height:var(--magritte-typography-label-4-regular-line-height-v21-4-0);
|
|
@@ -532,13 +532,13 @@
|
|
|
532
532
|
color:var(--magritte-color-component-input-text-label-v21-4-0);
|
|
533
533
|
transform:translateY(calc(var(--elevated-placeholder-gap) - var(--magritte-typography-label-2-regular-line-height-v21-4-0) / 2));
|
|
534
534
|
}
|
|
535
|
-
.magritte-min-height-48___jGf5Z_2-1-
|
|
535
|
+
.magritte-min-height-48___jGf5Z_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
536
536
|
--elevated-placeholder-gap:3px;
|
|
537
537
|
}
|
|
538
|
-
.magritte-min-height-56___2yI39_2-1-
|
|
538
|
+
.magritte-min-height-56___2yI39_2-1-17 .magritte-textarea-label-elevated___0lxOI_2-1-17{
|
|
539
539
|
--elevated-placeholder-gap:3px;
|
|
540
540
|
}
|
|
541
|
-
.magritte-textarea-limit___IjPJy_2-1-
|
|
541
|
+
.magritte-textarea-limit___IjPJy_2-1-17{
|
|
542
542
|
position:absolute;
|
|
543
543
|
bottom:10px;
|
|
544
544
|
right:28px;
|
|
@@ -548,7 +548,7 @@
|
|
|
548
548
|
pointer-events:none;
|
|
549
549
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-limit-v21-4-0);
|
|
550
550
|
}
|
|
551
|
-
.magritte-textarea-grip___iL7lq_2-1-
|
|
551
|
+
.magritte-textarea-grip___iL7lq_2-1-17{
|
|
552
552
|
position:absolute;
|
|
553
553
|
pointer-events:none;
|
|
554
554
|
display:inline-flex;
|
|
@@ -557,25 +557,25 @@
|
|
|
557
557
|
border-bottom-right-radius:12px;
|
|
558
558
|
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-grip-v21-4-0);
|
|
559
559
|
}
|
|
560
|
-
.magritte-textarea-grip-icon___YK-9w_2-1-
|
|
560
|
+
.magritte-textarea-grip-icon___YK-9w_2-1-17{
|
|
561
561
|
display:inline-flex;
|
|
562
562
|
z-index:1;
|
|
563
563
|
}
|
|
564
564
|
@media (prefers-reduced-motion: no-preference){
|
|
565
|
-
.magritte-textarea-limit-enter___CygGz_2-1-
|
|
565
|
+
.magritte-textarea-limit-enter___CygGz_2-1-17{
|
|
566
566
|
opacity:0;
|
|
567
567
|
}
|
|
568
|
-
.magritte-textarea-limit-exit___RMp-R_2-1-
|
|
569
|
-
.magritte-textarea-limit-enter-active___8vN-t_2-1-
|
|
568
|
+
.magritte-textarea-limit-exit___RMp-R_2-1-17,
|
|
569
|
+
.magritte-textarea-limit-enter-active___8vN-t_2-1-17{
|
|
570
570
|
opacity:1;
|
|
571
571
|
}
|
|
572
|
-
.magritte-textarea-limit-enter-active___8vN-t_2-1-
|
|
572
|
+
.magritte-textarea-limit-enter-active___8vN-t_2-1-17{
|
|
573
573
|
transition-property:opacity;
|
|
574
574
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-0);
|
|
575
575
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v21-4-0);
|
|
576
576
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v21-4-0);
|
|
577
577
|
}
|
|
578
|
-
.magritte-textarea-limit-exit-active___a5kBr_2-1-
|
|
578
|
+
.magritte-textarea-limit-exit-active___a5kBr_2-1-17{
|
|
579
579
|
opacity:0;
|
|
580
580
|
transition-property:opacity;
|
|
581
581
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v21-4-0);
|
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import 'react-transition-group';
|
|
|
7
7
|
import 'classnames';
|
|
8
8
|
import '@hh.ru/magritte-common-use-disabled';
|
|
9
9
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
10
|
+
import '@hh.ru/magritte-ui-bottom-sheet';
|
|
10
11
|
import '@hh.ru/magritte-ui-breakpoint';
|
|
11
12
|
import '@hh.ru/magritte-ui-form-helper';
|
|
12
13
|
import '@hh.ru/magritte-ui-icon/private';
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-textarea",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@hh.ru/magritte-common-use-disabled": "1.0.10",
|
|
24
24
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.5",
|
|
25
|
+
"@hh.ru/magritte-ui-bottom-sheet": "7.1.12",
|
|
25
26
|
"@hh.ru/magritte-ui-breakpoint": "5.0.0",
|
|
26
27
|
"@hh.ru/magritte-ui-form-helper": "1.0.28",
|
|
27
28
|
"@hh.ru/magritte-ui-icon": "10.2.1",
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"publishConfig": {
|
|
37
38
|
"access": "public"
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "e40543dd0a2b7e7e0e97cfefd75df39876421328"
|
|
40
41
|
}
|