@hh.ru/magritte-ui-textarea 2.2.8 → 2.3.1
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.js +7 -4
- package/TextArea.js.map +1 -1
- package/UncontrolledTextArea.js +1 -0
- package/UncontrolledTextArea.js.map +1 -1
- package/index.css +118 -116
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +7 -6
package/TextArea.js
CHANGED
|
@@ -5,6 +5,7 @@ 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 { useTranslation } from '@hh.ru/magritte-common-use-translation';
|
|
8
9
|
import { BottomSheetContext } from '@hh.ru/magritte-ui-bottom-sheet';
|
|
9
10
|
import { useBreakpoint } from '@hh.ru/magritte-ui-breakpoint';
|
|
10
11
|
import { FormHelper } from '@hh.ru/magritte-ui-form-helper';
|
|
@@ -13,7 +14,7 @@ import { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';
|
|
|
13
14
|
import { useFocus } from './useFocus.js';
|
|
14
15
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
15
16
|
|
|
16
|
-
var styles = {"textarea":"magritte-textarea___ugvor_2-
|
|
17
|
+
var styles = {"textarea":"magritte-textarea___ugvor_2-3-1","textarea-focused":"magritte-textarea-focused___eiGyC_2-3-1","textareaFocused":"magritte-textarea-focused___eiGyC_2-3-1","textarea-invalid":"magritte-textarea-invalid___iKOPh_2-3-1","textareaInvalid":"magritte-textarea-invalid___iKOPh_2-3-1","textarea-disabled":"magritte-textarea-disabled___XN0cg_2-3-1","textareaDisabled":"magritte-textarea-disabled___XN0cg_2-3-1","textarea-position-container-wrapper":"magritte-textarea-position-container-wrapper___4Dsui_2-3-1","textareaPositionContainerWrapper":"magritte-textarea-position-container-wrapper___4Dsui_2-3-1","textarea-position-container":"magritte-textarea-position-container___cEpbv_2-3-1","textareaPositionContainer":"magritte-textarea-position-container___cEpbv_2-3-1","native-element":"magritte-native-element___a0RAE_2-3-1","nativeElement":"magritte-native-element___a0RAE_2-3-1","textarea-label":"magritte-textarea-label___sgTIH_2-3-1","textareaLabel":"magritte-textarea-label___sgTIH_2-3-1","textarea-label-elevated":"magritte-textarea-label-elevated___0lxOI_2-3-1","textareaLabelElevated":"magritte-textarea-label-elevated___0lxOI_2-3-1","textarea-limit":"magritte-textarea-limit___IjPJy_2-3-1","textareaLimit":"magritte-textarea-limit___IjPJy_2-3-1","textarea-limit-error":"magritte-textarea-limit-error___vLvZU_2-3-1","textareaLimitError":"magritte-textarea-limit-error___vLvZU_2-3-1","min-height-48":"magritte-min-height-48___jGf5Z_2-3-1","minHeight48":"magritte-min-height-48___jGf5Z_2-3-1","min-height-56":"magritte-min-height-56___2yI39_2-3-1","minHeight56":"magritte-min-height-56___2yI39_2-3-1","min-height-default":"magritte-min-height-default___zwRcq_2-3-1","minHeightDefault":"magritte-min-height-default___zwRcq_2-3-1","textarea-limited":"magritte-textarea-limited___cU1Rg_2-3-1","textareaLimited":"magritte-textarea-limited___cU1Rg_2-3-1","textarea-layout-fill-both":"magritte-textarea-layout-fill-both___ERS-q_2-3-1","textareaLayoutFillBoth":"magritte-textarea-layout-fill-both___ERS-q_2-3-1","textarea-layout-fill-vertical":"magritte-textarea-layout-fill-vertical___HmNtp_2-3-1","textareaLayoutFillVertical":"magritte-textarea-layout-fill-vertical___HmNtp_2-3-1","textarea-layout-fill-horizontal":"magritte-textarea-layout-fill-horizontal___imBH2_2-3-1","textareaLayoutFillHorizontal":"magritte-textarea-layout-fill-horizontal___imBH2_2-3-1","textarea-wrapper":"magritte-textarea-wrapper___yD7G6_2-3-1","textareaWrapper":"magritte-textarea-wrapper___yD7G6_2-3-1","textarea-layout-hug":"magritte-textarea-layout-hug___tdCMY_2-3-1","textareaLayoutHug":"magritte-textarea-layout-hug___tdCMY_2-3-1","textarea-elevated":"magritte-textarea-elevated___S0jk-_2-3-1","textareaElevated":"magritte-textarea-elevated___S0jk-_2-3-1","textarea-animation-timeout":"magritte-textarea-animation-timeout___zudbr_2-3-1","textareaAnimationTimeout":"magritte-textarea-animation-timeout___zudbr_2-3-1","textarea-rigging-container":"magritte-textarea-rigging-container___-1S6i_2-3-1","textareaRiggingContainer":"magritte-textarea-rigging-container___-1S6i_2-3-1","label-no-wrap":"magritte-label-no-wrap___RxZ3A_2-3-1","labelNoWrap":"magritte-label-no-wrap___RxZ3A_2-3-1","textarea-grip":"magritte-textarea-grip___iL7lq_2-3-1","textareaGrip":"magritte-textarea-grip___iL7lq_2-3-1","textarea-grip-icon":"magritte-textarea-grip-icon___YK-9w_2-3-1","textareaGripIcon":"magritte-textarea-grip-icon___YK-9w_2-3-1","textarea-limit-enter":"magritte-textarea-limit-enter___CygGz_2-3-1","textareaLimitEnter":"magritte-textarea-limit-enter___CygGz_2-3-1","textarea-limit-exit":"magritte-textarea-limit-exit___RMp-R_2-3-1","textareaLimitExit":"magritte-textarea-limit-exit___RMp-R_2-3-1","textarea-limit-enter-active":"magritte-textarea-limit-enter-active___8vN-t_2-3-1","textareaLimitEnterActive":"magritte-textarea-limit-enter-active___8vN-t_2-3-1","textarea-limit-exit-active":"magritte-textarea-limit-exit-active___a5kBr_2-3-1","textareaLimitExitActive":"magritte-textarea-limit-exit-active___a5kBr_2-3-1"};
|
|
17
18
|
|
|
18
19
|
const MIN_HEIGHT_WITH_VISIBLE_LIMIT = 112;
|
|
19
20
|
const findFlexContainer = (element) => {
|
|
@@ -31,7 +32,7 @@ const findFlexContainer = (element) => {
|
|
|
31
32
|
return null;
|
|
32
33
|
};
|
|
33
34
|
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) => {
|
|
34
|
-
const {
|
|
35
|
+
const { isMobile } = useBreakpoint();
|
|
35
36
|
const [internalInvalid, setInternalInvalid] = useState(false);
|
|
36
37
|
const [isFocusVisible, setFocusVisible] = useState(false);
|
|
37
38
|
const limitRef = useRef(null);
|
|
@@ -44,13 +45,14 @@ const TextAreaComponent = ({ onChange, onFocus, onBlur, onValidate, value, place
|
|
|
44
45
|
const descriptionId = useId();
|
|
45
46
|
const labelId = useId();
|
|
46
47
|
const [animationTimeout, setAnimationTimeout] = useState(100);
|
|
47
|
-
const currentResizeValue =
|
|
48
|
+
const currentResizeValue = isMobile ? 'none' : resize;
|
|
48
49
|
const isResizable = currentResizeValue !== 'none';
|
|
49
50
|
const [isMaxLengthDisplayed, setMaxLengthDisplayed] = useState(!!maxLength && !minHeight);
|
|
50
51
|
const actualMinHeight = minHeight !== undefined && !value.includes('\n') ? minHeight : undefined;
|
|
51
52
|
const [maxAllowedHeight, setMaxAllowedHeight] = useState(null);
|
|
52
53
|
const bottomSheetContext = useContext(BottomSheetContext);
|
|
53
54
|
const wrapperRef = useRef(null);
|
|
55
|
+
const trlOf = useTranslation('TextArea', 'of');
|
|
54
56
|
const forceDisabled = useDisabled();
|
|
55
57
|
const isComponentDisabled = forceDisabled || !!disabled;
|
|
56
58
|
useEffect(() => {
|
|
@@ -160,13 +162,14 @@ const TextAreaComponent = ({ onChange, onFocus, onBlur, onValidate, value, place
|
|
|
160
162
|
maxHeight: maxAllowedHeight !== null ? `${maxAllowedHeight}px` : undefined,
|
|
161
163
|
resize: currentResizeValue,
|
|
162
164
|
}, 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, {
|
|
165
|
+
[styles.labelNoWrap]: elevatePlaceholder,
|
|
163
166
|
[styles.textareaLabelElevated]: hasElevatedPlaceholderClass,
|
|
164
167
|
}), id: ariaProps['aria-labelledby'], children: placeholder }) })), !!maxLength && isMaxLengthDisplayed && (jsx(CSSTransition, { in: isFocused || value.length > maxLength, timeout: animationTimeout, classNames: {
|
|
165
168
|
enter: styles.textareaLimitEnter,
|
|
166
169
|
enterActive: styles.textareaLimitEnterActive,
|
|
167
170
|
exit: styles.textareaLimitExit,
|
|
168
171
|
exitActive: styles.textareaLimitExitActive,
|
|
169
|
-
}, unmountOnExit: true, nodeRef: limitRef, children: jsx("div", { className: styles.textareaLimit, ref: limitRef, children: jsxs(Text, { typography: "label-3-regular", children: [value.length,
|
|
172
|
+
}, unmountOnExit: true, nodeRef: limitRef, children: jsx("div", { className: styles.textareaLimit, ref: limitRef, children: jsxs(Text, { typography: "label-3-regular", children: [value.length, trlOf, maxLength] }) }) }))] }), currentResizeValue !== 'none' && (jsx("div", { className: styles.textareaGrip, children: jsx("div", { className: styles.textareaGripIcon, children: jsx(GripSize24, {}) }) }))] }), jsx(FormHelper, { description: description, errorMessage: errorMessage, descriptionId: ariaProps['aria-describedby'], disabled: isComponentDisabled, invalid: invalidState, "data-qa": "textarea-hint-container" })] }));
|
|
170
173
|
};
|
|
171
174
|
const TextArea = forwardRef(TextAreaComponent);
|
|
172
175
|
TextArea.displayName = 'TextArea';
|
package/TextArea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,CA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AC,kBAAkB;oCAChC,WAAW,EAAE,MAAM,CAAC,wBAAwB;oCAC5C,IAAI,EAAE,MAAM,CAAC,iBAAiB;oCAC9B,UAAU,EAAE,MAAM,CAAC,uBAAuB;iCAC7C,EACD,aAAa,QACb,OAAO,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;;;;"}
|
|
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 { useTranslation } from '@hh.ru/magritte-common-use-translation';\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 { isMobile } = 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 = isMobile ? '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 trlOf = useTranslation('TextArea', 'of');\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.labelNoWrap]: elevatePlaceholder,\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}\n {trlOf}\n {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":";;;;;;;;;;;;;;;;;AAkBA,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;AAC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,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-common-use-translation';
|
|
9
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';
|
|
@@ -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
|
@@ -140,228 +140,228 @@
|
|
|
140
140
|
--magritte-color-component-input-text-state-description-invalid-v22-1-0:#ff4d3a;
|
|
141
141
|
--magritte-color-component-input-icon-grip-v22-1-0:#AABBCA;
|
|
142
142
|
}
|
|
143
|
-
.magritte-textarea___ugvor_2-
|
|
143
|
+
.magritte-textarea___ugvor_2-3-1{
|
|
144
144
|
display:inline-flex;
|
|
145
145
|
flex-flow:column;
|
|
146
146
|
--animation-100-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v22-1-0);
|
|
147
147
|
--animation-300-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v22-1-0);
|
|
148
148
|
}
|
|
149
149
|
@media (min-width: 1020px){
|
|
150
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
150
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover{
|
|
151
151
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-hovered-v22-1-0);
|
|
152
152
|
}
|
|
153
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
153
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
154
154
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-hovered-v22-1-0);
|
|
155
155
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-hovered-v22-1-0);
|
|
156
156
|
border-width:1px;
|
|
157
157
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v22-1-0);
|
|
158
158
|
}
|
|
159
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
159
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
160
160
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-hovered-v22-1-0);
|
|
161
161
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v22-1-0);
|
|
162
162
|
}
|
|
163
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
163
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-native-element___a0RAE_2-3-1{
|
|
164
164
|
color:var(--magritte-color-component-input-text-state-content-hovered-v22-1-0);
|
|
165
165
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-hovered-v22-1-0);
|
|
166
166
|
opacity:1;
|
|
167
167
|
}
|
|
168
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
168
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-label___sgTIH_2-3-1{
|
|
169
169
|
color:var(--magritte-color-component-input-text-state-placeholder-hovered-v22-1-0);
|
|
170
170
|
}
|
|
171
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
171
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
172
172
|
color:var(--magritte-color-component-input-text-state-label-hovered-v22-1-0);
|
|
173
173
|
}
|
|
174
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
174
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-limit___IjPJy_2-3-1{
|
|
175
175
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v22-1-0);
|
|
176
176
|
}
|
|
177
|
-
body.magritte-old-layout .magritte-textarea___ugvor_2-
|
|
177
|
+
body.magritte-old-layout .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-limit___IjPJy_2-3-1{
|
|
178
178
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-hovered-v22-1-0);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
@media (min-width: 1024px){
|
|
182
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
182
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover{
|
|
183
183
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-hovered-v22-1-0);
|
|
184
184
|
}
|
|
185
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
185
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
186
186
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-hovered-v22-1-0);
|
|
187
187
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-hovered-v22-1-0);
|
|
188
188
|
border-width:1px;
|
|
189
189
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v22-1-0);
|
|
190
190
|
}
|
|
191
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
191
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
192
192
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-hovered-v22-1-0);
|
|
193
193
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v22-1-0);
|
|
194
194
|
}
|
|
195
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
195
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-native-element___a0RAE_2-3-1{
|
|
196
196
|
color:var(--magritte-color-component-input-text-state-content-hovered-v22-1-0);
|
|
197
197
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-hovered-v22-1-0);
|
|
198
198
|
opacity:1;
|
|
199
199
|
}
|
|
200
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
200
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-label___sgTIH_2-3-1{
|
|
201
201
|
color:var(--magritte-color-component-input-text-state-placeholder-hovered-v22-1-0);
|
|
202
202
|
}
|
|
203
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
203
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
204
204
|
color:var(--magritte-color-component-input-text-state-label-hovered-v22-1-0);
|
|
205
205
|
}
|
|
206
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
206
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-limit___IjPJy_2-3-1{
|
|
207
207
|
background-color:var(--magritte-color-component-input-background-state-field-hovered-v22-1-0);
|
|
208
208
|
}
|
|
209
|
-
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-
|
|
209
|
+
body:not(.magritte-old-layout) .magritte-textarea___ugvor_2-3-1:not(.magritte-textarea-focused___eiGyC_2-3-1):not(.magritte-textarea-invalid___iKOPh_2-3-1):not(.magritte-textarea-disabled___XN0cg_2-3-1):hover .magritte-textarea-limit___IjPJy_2-3-1{
|
|
210
210
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-hovered-v22-1-0);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
.magritte-textarea___ugvor_2-
|
|
213
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1{
|
|
214
214
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-focused-v22-1-0);
|
|
215
215
|
}
|
|
216
|
-
.magritte-textarea___ugvor_2-
|
|
216
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
217
217
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-focused-v22-1-0);
|
|
218
218
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-focused-v22-1-0);
|
|
219
219
|
border-width:2px;
|
|
220
220
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v22-1-0);
|
|
221
221
|
}
|
|
222
|
-
.magritte-textarea___ugvor_2-
|
|
222
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
223
223
|
box-shadow:inset 0 0 0 2px var(--magritte-color-component-input-stroke-state-field-focused-v22-1-0);
|
|
224
224
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v22-1-0);
|
|
225
225
|
}
|
|
226
|
-
.magritte-textarea___ugvor_2-
|
|
226
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
227
227
|
color:var(--magritte-color-component-input-text-state-content-focused-v22-1-0);
|
|
228
228
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-focused-v22-1-0);
|
|
229
229
|
opacity:1;
|
|
230
230
|
}
|
|
231
|
-
.magritte-textarea___ugvor_2-
|
|
231
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-textarea-label___sgTIH_2-3-1{
|
|
232
232
|
color:var(--magritte-color-component-input-text-state-placeholder-focused-v22-1-0);
|
|
233
233
|
}
|
|
234
|
-
.magritte-textarea___ugvor_2-
|
|
234
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
235
235
|
color:var(--magritte-color-component-input-text-state-label-focused-v22-1-0);
|
|
236
236
|
}
|
|
237
|
-
.magritte-textarea___ugvor_2-
|
|
237
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
238
238
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v22-1-0);
|
|
239
239
|
}
|
|
240
|
-
.magritte-textarea___ugvor_2-
|
|
240
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
241
241
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-focused-v22-1-0);
|
|
242
242
|
}
|
|
243
|
-
.magritte-textarea___ugvor_2-
|
|
244
|
-
.magritte-textarea___ugvor_2-
|
|
243
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1,
|
|
244
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1{
|
|
245
245
|
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v22-1-0);
|
|
246
246
|
}
|
|
247
|
-
.magritte-textarea___ugvor_2-
|
|
248
|
-
.magritte-textarea___ugvor_2-
|
|
247
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after,
|
|
248
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
249
249
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-invalid-v22-1-0);
|
|
250
250
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-invalid-v22-1-0);
|
|
251
251
|
border-width:2px;
|
|
252
252
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v22-1-0);
|
|
253
253
|
}
|
|
254
|
-
.magritte-textarea___ugvor_2-
|
|
255
|
-
.magritte-textarea___ugvor_2-
|
|
254
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1,
|
|
255
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
256
256
|
box-shadow:inset 0 0 0 2px var(--magritte-color-component-input-stroke-state-field-invalid-v22-1-0);
|
|
257
257
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v22-1-0);
|
|
258
258
|
}
|
|
259
|
-
.magritte-textarea___ugvor_2-
|
|
260
|
-
.magritte-textarea___ugvor_2-
|
|
259
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-native-element___a0RAE_2-3-1,
|
|
260
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
261
261
|
color:var(--magritte-color-component-input-text-state-content-invalid-v22-1-0);
|
|
262
262
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v22-1-0);
|
|
263
263
|
opacity:1;
|
|
264
264
|
}
|
|
265
|
-
.magritte-textarea___ugvor_2-
|
|
266
|
-
.magritte-textarea___ugvor_2-
|
|
265
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-label___sgTIH_2-3-1,
|
|
266
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-label___sgTIH_2-3-1{
|
|
267
267
|
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v22-1-0);
|
|
268
268
|
}
|
|
269
|
-
.magritte-textarea___ugvor_2-
|
|
270
|
-
.magritte-textarea___ugvor_2-
|
|
269
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1,
|
|
270
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
271
271
|
color:var(--magritte-color-component-input-text-state-label-invalid-v22-1-0);
|
|
272
272
|
}
|
|
273
|
-
.magritte-textarea___ugvor_2-
|
|
274
|
-
.magritte-textarea___ugvor_2-
|
|
273
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1,
|
|
274
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
275
275
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v22-1-0);
|
|
276
276
|
}
|
|
277
|
-
.magritte-textarea___ugvor_2-
|
|
277
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-focused___eiGyC_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
278
278
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-invalid-v22-1-0);
|
|
279
279
|
}
|
|
280
|
-
.magritte-textarea___ugvor_2-
|
|
280
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1{
|
|
281
281
|
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v22-1-0);
|
|
282
282
|
}
|
|
283
|
-
.magritte-textarea___ugvor_2-
|
|
283
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
284
284
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-invalid-v22-1-0);
|
|
285
285
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-invalid-v22-1-0);
|
|
286
286
|
border-width:1px;
|
|
287
287
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v22-1-0);
|
|
288
288
|
}
|
|
289
|
-
.magritte-textarea___ugvor_2-
|
|
289
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
290
290
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-invalid-v22-1-0);
|
|
291
291
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v22-1-0);
|
|
292
292
|
}
|
|
293
|
-
.magritte-textarea___ugvor_2-
|
|
293
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
294
294
|
color:var(--magritte-color-component-input-text-state-content-invalid-v22-1-0);
|
|
295
295
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v22-1-0);
|
|
296
296
|
opacity:1;
|
|
297
297
|
}
|
|
298
|
-
.magritte-textarea___ugvor_2-
|
|
298
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-label___sgTIH_2-3-1{
|
|
299
299
|
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v22-1-0);
|
|
300
300
|
}
|
|
301
|
-
.magritte-textarea___ugvor_2-
|
|
301
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
302
302
|
color:var(--magritte-color-component-input-text-state-label-invalid-v22-1-0);
|
|
303
303
|
}
|
|
304
|
-
.magritte-textarea___ugvor_2-
|
|
304
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
305
305
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v22-1-0);
|
|
306
306
|
}
|
|
307
|
-
.magritte-textarea___ugvor_2-
|
|
307
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
308
308
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-invalid-v22-1-0);
|
|
309
309
|
}
|
|
310
|
-
.magritte-textarea___ugvor_2-
|
|
310
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1{
|
|
311
311
|
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-disabled-v22-1-0);
|
|
312
312
|
}
|
|
313
|
-
.magritte-textarea___ugvor_2-
|
|
313
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
314
314
|
border-bottom-color:var(--magritte-color-component-input-stroke-state-field-disabled-v22-1-0);
|
|
315
315
|
border-right-color:var(--magritte-color-component-input-stroke-state-field-disabled-v22-1-0);
|
|
316
316
|
border-width:1px;
|
|
317
317
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v22-1-0);
|
|
318
318
|
}
|
|
319
|
-
.magritte-textarea___ugvor_2-
|
|
319
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
320
320
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-disabled-v22-1-0);
|
|
321
321
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v22-1-0);
|
|
322
322
|
}
|
|
323
|
-
.magritte-textarea___ugvor_2-
|
|
323
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
324
324
|
color:var(--magritte-color-component-input-text-state-content-disabled-v22-1-0);
|
|
325
325
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-disabled-v22-1-0);
|
|
326
326
|
opacity:1;
|
|
327
327
|
}
|
|
328
|
-
.magritte-textarea___ugvor_2-
|
|
328
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-label___sgTIH_2-3-1{
|
|
329
329
|
color:var(--magritte-color-component-input-text-state-placeholder-disabled-v22-1-0);
|
|
330
330
|
}
|
|
331
|
-
.magritte-textarea___ugvor_2-
|
|
331
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
332
332
|
color:var(--magritte-color-component-input-text-state-label-disabled-v22-1-0);
|
|
333
333
|
}
|
|
334
|
-
.magritte-textarea___ugvor_2-
|
|
334
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
335
335
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v22-1-0);
|
|
336
336
|
}
|
|
337
|
-
.magritte-textarea___ugvor_2-
|
|
337
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-limit___IjPJy_2-3-1{
|
|
338
338
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-limit-disabled-v22-1-0);
|
|
339
339
|
}
|
|
340
|
-
.magritte-textarea___ugvor_2-
|
|
341
|
-
.magritte-textarea___ugvor_2-
|
|
340
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1,
|
|
341
|
+
.magritte-textarea___ugvor_2-3-1.magritte-textarea-disabled___XN0cg_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
342
342
|
cursor:not-allowed;
|
|
343
343
|
}
|
|
344
344
|
@media (prefers-reduced-motion){
|
|
345
|
-
.magritte-textarea___ugvor_2-
|
|
345
|
+
.magritte-textarea___ugvor_2-3-1{
|
|
346
346
|
--animation-100-duration:1ms;
|
|
347
347
|
--animation-300-duration:1ms;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
.magritte-textarea-position-container-wrapper___4Dsui_2-
|
|
350
|
+
.magritte-textarea-position-container-wrapper___4Dsui_2-3-1{
|
|
351
351
|
display:inline-flex;
|
|
352
352
|
position:relative;
|
|
353
353
|
overflow:hidden;
|
|
354
354
|
width:100%;
|
|
355
355
|
border-radius:12px;
|
|
356
356
|
}
|
|
357
|
-
.magritte-textarea-position-container-wrapper___4Dsui_2-
|
|
357
|
+
.magritte-textarea-position-container-wrapper___4Dsui_2-3-1.focus-visible{
|
|
358
358
|
outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v22-1-0) solid 4px;
|
|
359
359
|
}
|
|
360
|
-
.magritte-textarea-invalid___iKOPh_2-
|
|
361
|
-
.magritte-textarea-limit-error___vLvZU_2-
|
|
360
|
+
.magritte-textarea-invalid___iKOPh_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1.focus-visible,
|
|
361
|
+
.magritte-textarea-limit-error___vLvZU_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1.focus-visible{
|
|
362
362
|
outline-color:var(--magritte-color-component-input-stroke-state-negative-focused-accessible-v22-1-0);
|
|
363
363
|
}
|
|
364
|
-
.magritte-textarea-position-container-wrapper___4Dsui_2-
|
|
364
|
+
.magritte-textarea-position-container-wrapper___4Dsui_2-3-1::after{
|
|
365
365
|
display:block;
|
|
366
366
|
pointer-events:none;
|
|
367
367
|
user-select:none;
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
border-bottom:1px solid var(--magritte-color-component-input-stroke-field-v22-1-0);
|
|
377
377
|
border-right:1px solid var(--magritte-color-component-input-stroke-field-v22-1-0);
|
|
378
378
|
}
|
|
379
|
-
.magritte-native-element___a0RAE_2-
|
|
379
|
+
.magritte-native-element___a0RAE_2-3-1{
|
|
380
380
|
font-family:var(--magritte-typography-label-2-regular-font-family-v22-1-0);
|
|
381
381
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v22-1-0);
|
|
382
382
|
line-height:var(--magritte-typography-label-2-regular-line-height-v22-1-0);
|
|
@@ -396,64 +396,64 @@
|
|
|
396
396
|
background:none;
|
|
397
397
|
appearance:none;
|
|
398
398
|
}
|
|
399
|
-
.magritte-native-element___a0RAE_2-
|
|
399
|
+
.magritte-native-element___a0RAE_2-3-1:focus{
|
|
400
400
|
outline:none;
|
|
401
401
|
}
|
|
402
|
-
.magritte-min-height-48___jGf5Z_2-
|
|
402
|
+
.magritte-min-height-48___jGf5Z_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
403
403
|
min-height:calc(36px - var(--magritte-typography-label-4-regular-line-height-v22-1-0));
|
|
404
404
|
}
|
|
405
|
-
.magritte-min-height-56___2yI39_2-
|
|
405
|
+
.magritte-min-height-56___2yI39_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
406
406
|
min-height:calc(40px - var(--magritte-typography-label-4-regular-line-height-v22-1-0));
|
|
407
407
|
}
|
|
408
|
-
.magritte-min-height-default___zwRcq_2-
|
|
408
|
+
.magritte-min-height-default___zwRcq_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
409
409
|
min-height:calc(78px - var(--magritte-typography-label-4-regular-line-height-v22-1-0));
|
|
410
410
|
}
|
|
411
|
-
.magritte-textarea-limited___cU1Rg_2-
|
|
411
|
+
.magritte-textarea-limited___cU1Rg_2-3-1.magritte-min-height-48___jGf5Z_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
412
412
|
min-height:calc(22px - var(--magritte-typography-label-4-regular-line-height-v22-1-0));
|
|
413
413
|
}
|
|
414
|
-
.magritte-textarea-limited___cU1Rg_2-
|
|
414
|
+
.magritte-textarea-limited___cU1Rg_2-3-1.magritte-min-height-56___2yI39_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
415
415
|
min-height:calc(22px - var(--magritte-typography-label-4-regular-line-height-v22-1-0));
|
|
416
416
|
}
|
|
417
|
-
.magritte-textarea-limited___cU1Rg_2-
|
|
417
|
+
.magritte-textarea-limited___cU1Rg_2-3-1.magritte-min-height-default___zwRcq_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
418
418
|
min-height:calc(64px - var(--magritte-typography-label-4-regular-line-height-v22-1-0));
|
|
419
419
|
}
|
|
420
|
-
.magritte-textarea-layout-fill-both___ERS-q_2-
|
|
421
|
-
.magritte-textarea-layout-fill-vertical___HmNtp_2-
|
|
422
|
-
.magritte-textarea-layout-fill-horizontal___imBH2_2-
|
|
420
|
+
.magritte-textarea-layout-fill-both___ERS-q_2-3-1,
|
|
421
|
+
.magritte-textarea-layout-fill-vertical___HmNtp_2-3-1,
|
|
422
|
+
.magritte-textarea-layout-fill-horizontal___imBH2_2-3-1{
|
|
423
423
|
flex-direction:column;
|
|
424
424
|
}
|
|
425
|
-
.magritte-textarea-layout-fill-both___ERS-q_2-
|
|
426
|
-
.magritte-textarea-layout-fill-vertical___HmNtp_2-
|
|
427
|
-
.magritte-textarea-layout-fill-horizontal___imBH2_2-
|
|
425
|
+
.magritte-textarea-layout-fill-both___ERS-q_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1,
|
|
426
|
+
.magritte-textarea-layout-fill-vertical___HmNtp_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1,
|
|
427
|
+
.magritte-textarea-layout-fill-horizontal___imBH2_2-3-1 .magritte-textarea-position-container-wrapper___4Dsui_2-3-1{
|
|
428
428
|
flex:1;
|
|
429
429
|
}
|
|
430
|
-
.magritte-textarea-layout-fill-both___ERS-q_2-
|
|
430
|
+
.magritte-textarea-layout-fill-both___ERS-q_2-3-1{
|
|
431
431
|
width:100%;
|
|
432
432
|
height:100%;
|
|
433
433
|
}
|
|
434
|
-
.magritte-textarea-layout-fill-vertical___HmNtp_2-
|
|
434
|
+
.magritte-textarea-layout-fill-vertical___HmNtp_2-3-1{
|
|
435
435
|
height:100%;
|
|
436
436
|
}
|
|
437
|
-
.magritte-textarea-layout-fill-horizontal___imBH2_2-
|
|
437
|
+
.magritte-textarea-layout-fill-horizontal___imBH2_2-3-1{
|
|
438
438
|
width:100%;
|
|
439
439
|
}
|
|
440
|
-
.magritte-textarea-wrapper___yD7G6_2-
|
|
440
|
+
.magritte-textarea-wrapper___yD7G6_2-3-1{
|
|
441
441
|
display:inline-flex;
|
|
442
442
|
width:100%;
|
|
443
443
|
}
|
|
444
|
-
.magritte-textarea-layout-hug___tdCMY_2-
|
|
444
|
+
.magritte-textarea-layout-hug___tdCMY_2-3-1{
|
|
445
445
|
width:100%;
|
|
446
446
|
}
|
|
447
|
-
.magritte-textarea-layout-hug___tdCMY_2-
|
|
447
|
+
.magritte-textarea-layout-hug___tdCMY_2-3-1 .magritte-textarea-wrapper___yD7G6_2-3-1{
|
|
448
448
|
display:grid;
|
|
449
449
|
}
|
|
450
|
-
.magritte-textarea-layout-hug___tdCMY_2-
|
|
451
|
-
.magritte-textarea-layout-hug___tdCMY_2-
|
|
450
|
+
.magritte-textarea-layout-hug___tdCMY_2-3-1 .magritte-textarea-wrapper___yD7G6_2-3-1::after,
|
|
451
|
+
.magritte-textarea-layout-hug___tdCMY_2-3-1 .magritte-textarea-wrapper___yD7G6_2-3-1 .magritte-native-element___a0RAE_2-3-1{
|
|
452
452
|
grid-area:1 / 1 / 2 / 2;
|
|
453
453
|
overflow:hidden;
|
|
454
454
|
width:auto;
|
|
455
455
|
}
|
|
456
|
-
.magritte-textarea-layout-hug___tdCMY_2-
|
|
456
|
+
.magritte-textarea-layout-hug___tdCMY_2-3-1 .magritte-textarea-wrapper___yD7G6_2-3-1::after{
|
|
457
457
|
font-family:var(--magritte-typography-label-2-regular-font-family-v22-1-0);
|
|
458
458
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v22-1-0);
|
|
459
459
|
line-height:var(--magritte-typography-label-2-regular-line-height-v22-1-0);
|
|
@@ -472,7 +472,7 @@
|
|
|
472
472
|
white-space:pre-wrap;
|
|
473
473
|
visibility:hidden;
|
|
474
474
|
}
|
|
475
|
-
.magritte-textarea-position-container___cEpbv_2-
|
|
475
|
+
.magritte-textarea-position-container___cEpbv_2-3-1{
|
|
476
476
|
display:inline-flex;
|
|
477
477
|
overflow:hidden;
|
|
478
478
|
position:relative;
|
|
@@ -484,57 +484,57 @@
|
|
|
484
484
|
box-sizing:border-box;
|
|
485
485
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-field-v22-1-0);
|
|
486
486
|
}
|
|
487
|
-
.magritte-textarea-position-container___cEpbv_2-
|
|
487
|
+
.magritte-textarea-position-container___cEpbv_2-3-1::-webkit-resizer{
|
|
488
488
|
display:none;
|
|
489
489
|
}
|
|
490
|
-
.magritte-textarea-elevated___S0jk-_2-
|
|
490
|
+
.magritte-textarea-elevated___S0jk-_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
491
491
|
padding-top:calc(var(--magritte-typography-label-4-regular-line-height-v22-1-0) + 18px);
|
|
492
492
|
}
|
|
493
|
-
.magritte-textarea-limited___cU1Rg_2-
|
|
493
|
+
.magritte-textarea-limited___cU1Rg_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
494
494
|
padding-bottom:30px;
|
|
495
495
|
}
|
|
496
|
-
.magritte-min-height-48___jGf5Z_2-
|
|
496
|
+
.magritte-min-height-48___jGf5Z_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
497
497
|
padding-top:12px;
|
|
498
498
|
padding-bottom:12px;
|
|
499
499
|
min-height:48px;
|
|
500
500
|
}
|
|
501
|
-
.magritte-min-height-56___2yI39_2-
|
|
501
|
+
.magritte-min-height-56___2yI39_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
502
502
|
padding-top:16px;
|
|
503
503
|
padding-bottom:16px;
|
|
504
504
|
min-height:56px;
|
|
505
505
|
}
|
|
506
|
-
.magritte-min-height-default___zwRcq_2-
|
|
506
|
+
.magritte-min-height-default___zwRcq_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
507
507
|
min-height:112px;
|
|
508
508
|
}
|
|
509
|
-
.magritte-textarea-elevated___S0jk-_2-
|
|
509
|
+
.magritte-textarea-elevated___S0jk-_2-3-1.magritte-min-height-48___jGf5Z_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
510
510
|
padding-top:22px;
|
|
511
511
|
padding-bottom:4px;
|
|
512
512
|
}
|
|
513
|
-
.magritte-textarea-elevated___S0jk-_2-
|
|
513
|
+
.magritte-textarea-elevated___S0jk-_2-3-1.magritte-min-height-56___2yI39_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
514
514
|
padding-top:26px;
|
|
515
515
|
padding-bottom:8px;
|
|
516
516
|
}
|
|
517
|
-
.magritte-textarea-limited___cU1Rg_2-
|
|
517
|
+
.magritte-textarea-limited___cU1Rg_2-3-1.magritte-min-height-48___jGf5Z_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
518
518
|
padding-bottom:26px;
|
|
519
519
|
}
|
|
520
|
-
.magritte-textarea-limited___cU1Rg_2-
|
|
520
|
+
.magritte-textarea-limited___cU1Rg_2-3-1.magritte-min-height-56___2yI39_2-3-1 .magritte-textarea-position-container___cEpbv_2-3-1{
|
|
521
521
|
padding-bottom:30px;
|
|
522
522
|
}
|
|
523
|
-
.magritte-textarea-animation-timeout___zudbr_2-
|
|
524
|
-
.magritte-textarea-position-container___cEpbv_2-
|
|
523
|
+
.magritte-textarea-animation-timeout___zudbr_2-3-1,
|
|
524
|
+
.magritte-textarea-position-container___cEpbv_2-3-1{
|
|
525
525
|
transition-property:transform, color, font-size, letter-spacing;
|
|
526
526
|
transition-duration:var(--animation-100-duration);
|
|
527
527
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v22-1-0);
|
|
528
528
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v22-1-0);
|
|
529
529
|
}
|
|
530
|
-
.magritte-textarea-rigging-container___-1S6i_2-
|
|
530
|
+
.magritte-textarea-rigging-container___-1S6i_2-3-1{
|
|
531
531
|
position:absolute;
|
|
532
532
|
pointer-events:none;
|
|
533
533
|
left:16px;
|
|
534
534
|
right:16px;
|
|
535
535
|
top:0;
|
|
536
536
|
}
|
|
537
|
-
.magritte-textarea-label___sgTIH_2-
|
|
537
|
+
.magritte-textarea-label___sgTIH_2-3-1{
|
|
538
538
|
font-family:var(--magritte-typography-label-2-regular-font-family-v22-1-0);
|
|
539
539
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v22-1-0);
|
|
540
540
|
line-height:var(--magritte-typography-label-2-regular-line-height-v22-1-0);
|
|
@@ -544,7 +544,6 @@
|
|
|
544
544
|
text-transform:var(--magritte-typography-label-2-regular-text-transform-v22-1-0);
|
|
545
545
|
text-decoration:var(--magritte-typography-label-2-regular-text-decoration-v22-1-0);
|
|
546
546
|
display:block;
|
|
547
|
-
white-space:nowrap;
|
|
548
547
|
overflow:hidden;
|
|
549
548
|
text-overflow:ellipsis;
|
|
550
549
|
user-select:none;
|
|
@@ -554,13 +553,16 @@
|
|
|
554
553
|
transition-duration:var(--animation-100-duration);
|
|
555
554
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v22-1-0);
|
|
556
555
|
}
|
|
557
|
-
.magritte-min-height-48___jGf5Z_2-
|
|
556
|
+
.magritte-min-height-48___jGf5Z_2-3-1 .magritte-textarea-label___sgTIH_2-3-1{
|
|
558
557
|
padding-top:12px;
|
|
559
558
|
}
|
|
560
|
-
.magritte-min-height-56___2yI39_2-
|
|
559
|
+
.magritte-min-height-56___2yI39_2-3-1 .magritte-textarea-label___sgTIH_2-3-1{
|
|
561
560
|
padding-top:16px;
|
|
562
561
|
}
|
|
563
|
-
.magritte-
|
|
562
|
+
.magritte-label-no-wrap___RxZ3A_2-3-1{
|
|
563
|
+
white-space:nowrap;
|
|
564
|
+
}
|
|
565
|
+
.magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
564
566
|
font-family:var(--magritte-typography-label-4-regular-font-family-v22-1-0);
|
|
565
567
|
font-weight:var(--magritte-typography-label-4-regular-font-weight-v22-1-0);
|
|
566
568
|
line-height:var(--magritte-typography-label-4-regular-line-height-v22-1-0);
|
|
@@ -573,13 +575,13 @@
|
|
|
573
575
|
color:var(--magritte-color-component-input-text-label-v22-1-0);
|
|
574
576
|
transform:translateY(calc(var(--elevated-placeholder-gap) - var(--magritte-typography-label-2-regular-line-height-v22-1-0) / 2));
|
|
575
577
|
}
|
|
576
|
-
.magritte-min-height-48___jGf5Z_2-
|
|
578
|
+
.magritte-min-height-48___jGf5Z_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
577
579
|
--elevated-placeholder-gap:3px;
|
|
578
580
|
}
|
|
579
|
-
.magritte-min-height-56___2yI39_2-
|
|
581
|
+
.magritte-min-height-56___2yI39_2-3-1 .magritte-textarea-label-elevated___0lxOI_2-3-1{
|
|
580
582
|
--elevated-placeholder-gap:3px;
|
|
581
583
|
}
|
|
582
|
-
.magritte-textarea-limit___IjPJy_2-
|
|
584
|
+
.magritte-textarea-limit___IjPJy_2-3-1{
|
|
583
585
|
position:absolute;
|
|
584
586
|
bottom:10px;
|
|
585
587
|
right:28px;
|
|
@@ -589,7 +591,7 @@
|
|
|
589
591
|
pointer-events:none;
|
|
590
592
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-limit-v22-1-0);
|
|
591
593
|
}
|
|
592
|
-
.magritte-textarea-grip___iL7lq_2-
|
|
594
|
+
.magritte-textarea-grip___iL7lq_2-3-1{
|
|
593
595
|
position:absolute;
|
|
594
596
|
pointer-events:none;
|
|
595
597
|
display:inline-flex;
|
|
@@ -598,25 +600,25 @@
|
|
|
598
600
|
border-bottom-right-radius:12px;
|
|
599
601
|
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-grip-v22-1-0);
|
|
600
602
|
}
|
|
601
|
-
.magritte-textarea-grip-icon___YK-9w_2-
|
|
603
|
+
.magritte-textarea-grip-icon___YK-9w_2-3-1{
|
|
602
604
|
display:inline-flex;
|
|
603
605
|
z-index:1;
|
|
604
606
|
}
|
|
605
607
|
@media (prefers-reduced-motion: no-preference){
|
|
606
|
-
.magritte-textarea-limit-enter___CygGz_2-
|
|
608
|
+
.magritte-textarea-limit-enter___CygGz_2-3-1{
|
|
607
609
|
opacity:0;
|
|
608
610
|
}
|
|
609
|
-
.magritte-textarea-limit-exit___RMp-R_2-
|
|
610
|
-
.magritte-textarea-limit-enter-active___8vN-t_2-
|
|
611
|
+
.magritte-textarea-limit-exit___RMp-R_2-3-1,
|
|
612
|
+
.magritte-textarea-limit-enter-active___8vN-t_2-3-1{
|
|
611
613
|
opacity:1;
|
|
612
614
|
}
|
|
613
|
-
.magritte-textarea-limit-enter-active___8vN-t_2-
|
|
615
|
+
.magritte-textarea-limit-enter-active___8vN-t_2-3-1{
|
|
614
616
|
transition-property:opacity;
|
|
615
617
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v22-1-0);
|
|
616
618
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-200-timing-function-v22-1-0);
|
|
617
619
|
--animation-duration:var(--magritte-semantic-animation-ease-in-out-300-duration-v22-1-0);
|
|
618
620
|
}
|
|
619
|
-
.magritte-textarea-limit-exit-active___a5kBr_2-
|
|
621
|
+
.magritte-textarea-limit-exit-active___a5kBr_2-3-1{
|
|
620
622
|
opacity:0;
|
|
621
623
|
transition-property:opacity;
|
|
622
624
|
transition-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v22-1-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-common-use-translation';
|
|
10
11
|
import '@hh.ru/magritte-ui-bottom-sheet';
|
|
11
12
|
import '@hh.ru/magritte-ui-breakpoint';
|
|
12
13
|
import '@hh.ru/magritte-ui-form-helper';
|
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.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -20,13 +20,14 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@hh.ru/magritte-common-use-disabled": "1.0.12",
|
|
23
|
-
"@hh.ru/magritte-common-use-multiple-refs": "1.1.
|
|
23
|
+
"@hh.ru/magritte-common-use-multiple-refs": "1.1.8",
|
|
24
|
+
"@hh.ru/magritte-common-use-translation": "1.0.1",
|
|
24
25
|
"@hh.ru/magritte-design-tokens": "22.1.0",
|
|
25
|
-
"@hh.ru/magritte-ui-bottom-sheet": "8.1.
|
|
26
|
+
"@hh.ru/magritte-ui-bottom-sheet": "8.1.4",
|
|
26
27
|
"@hh.ru/magritte-ui-breakpoint": "6.0.0",
|
|
27
28
|
"@hh.ru/magritte-ui-form-helper": "2.0.1",
|
|
28
|
-
"@hh.ru/magritte-ui-icon": "12.
|
|
29
|
-
"@hh.ru/magritte-ui-input": "9.0.
|
|
29
|
+
"@hh.ru/magritte-ui-icon": "12.1.0",
|
|
30
|
+
"@hh.ru/magritte-ui-input": "9.0.3",
|
|
30
31
|
"@hh.ru/magritte-ui-typography": "4.1.0"
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
"publishConfig": {
|
|
38
39
|
"access": "public"
|
|
39
40
|
},
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "84be7fb81c268510672bdaa32f856319f7022df8"
|
|
41
42
|
}
|