@hh.ru/magritte-ui-input 5.0.15 → 5.0.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/BaseInput.js +4 -4
- package/BaseInput.js.map +1 -1
- package/DateTimeInput.js +1 -1
- package/Input.js +1 -1
- package/NumberInput.js +1 -1
- package/PasswordInput.js +1 -1
- package/SearchInput.js +1 -1
- package/UncontrolledDateTimeInput.js +1 -1
- package/UncontrolledInput.js +1 -1
- package/UncontrolledNumberInput.js +1 -1
- package/UncontrolledPasswordInput.js +1 -1
- package/UncontrolledSearchInput.js +1 -1
- package/index.css +145 -108
- package/index.js +1 -1
- package/package.json +5 -5
package/BaseInput.js
CHANGED
|
@@ -5,15 +5,15 @@ import classnames from 'classnames';
|
|
|
5
5
|
import { Selection } from '@hh.ru/magritte-common-text-selection';
|
|
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 { FieldHint } from '@hh.ru/magritte-internal-field-hint';
|
|
9
8
|
import { Action } from '@hh.ru/magritte-ui-action';
|
|
10
9
|
import { Counter } from '@hh.ru/magritte-ui-counter';
|
|
10
|
+
import { FormHelper } from '@hh.ru/magritte-ui-form-helper';
|
|
11
11
|
import { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
|
|
12
12
|
import { useFocus } from './useFocus.js';
|
|
13
13
|
import { useInputAriaProps } from './useInputAriaProps.js';
|
|
14
14
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
15
15
|
|
|
16
|
-
var styles = {"input":"magritte-input___LVTID_5-0-
|
|
16
|
+
var styles = {"input":"magritte-input___LVTID_5-0-17","label":"magritte-label___YlOQk_5-0-17","elevated":"magritte-elevated___kPcsM_5-0-17","focused":"magritte-focused___dxrHD_5-0-17","invalid":"magritte-invalid___L5MVa_5-0-17","disabled":"magritte-disabled___0NH6E_5-0-17","position-container":"magritte-position-container___kZnvZ_5-0-17","positionContainer":"magritte-position-container___kZnvZ_5-0-17","field":"magritte-field___9S8Tw_5-0-17","hint":"magritte-hint___EFGK0_5-0-17","additional-value":"magritte-additional-value___9Kyap_5-0-17","additionalValue":"magritte-additional-value___9Kyap_5-0-17","label_elevated":"magritte-label_elevated___PVcpC_5-0-17","labelElevated":"magritte-label_elevated___PVcpC_5-0-17","fixed-placeholder":"magritte-fixed-placeholder___PYJIH_5-0-17","fixedPlaceholder":"magritte-fixed-placeholder___PYJIH_5-0-17","icon":"magritte-icon___HEDsQ_5-0-17","focus-visible":"magritte-focus-visible___QvCO1_5-0-17","focusVisible":"magritte-focus-visible___QvCO1_5-0-17","right-container":"magritte-right-container___N0B0o_5-0-17","rightContainer":"magritte-right-container___N0B0o_5-0-17","with-icon":"magritte-with-icon___TPBe2_5-0-17","withIcon":"magritte-with-icon___TPBe2_5-0-17","large":"magritte-large___9frRh_5-0-17","rigging-container":"magritte-rigging-container___Up9Lb_5-0-17","riggingContainer":"magritte-rigging-container___Up9Lb_5-0-17","input__mask":"magritte-input__mask___CHda2_5-0-17","inputMask":"magritte-input__mask___CHda2_5-0-17","value-ghost":"magritte-value-ghost___IXNZj_5-0-17","valueGhost":"magritte-value-ghost___IXNZj_5-0-17","hint-container":"magritte-hint-container___rGsD8_5-0-17","hintContainer":"magritte-hint-container___rGsD8_5-0-17","with-right":"magritte-with-right___NUNiP_5-0-17","withRight":"magritte-with-right___NUNiP_5-0-17","content-container":"magritte-content-container___s-0kX_5-0-17","contentContainer":"magritte-content-container___s-0kX_5-0-17","counter":"magritte-counter___Bld3Q_5-0-17","value-container":"magritte-value-container___6ReT7_5-0-17","valueContainer":"magritte-value-container___6ReT7_5-0-17"};
|
|
17
17
|
|
|
18
18
|
const BaseInputComponent = ({ onChange, onFocus, onBlur, value, placeholder, disabled = false, postfix, size = 'medium', elevatePlaceholder = false, invalid = false, description, errorMessage, formatter, buttonIcon, clearable = false, clearableOnFocus, onButtonClick, buttonDataQa, buttonRef, inputIcon, wrapperRef, counter, fixedPlaceholder, maxLength, hint, showHintAlways = false, ...restProps }, ref) => {
|
|
19
19
|
const wrapperCurrentRef = useRef(null);
|
|
@@ -111,12 +111,12 @@ const BaseInputComponent = ({ onChange, onFocus, onBlur, value, placeholder, dis
|
|
|
111
111
|
[styles.disabled]: isComponentDisabled,
|
|
112
112
|
[styles.large]: size === 'large',
|
|
113
113
|
[styles.elevated]: placeholderCanElevated,
|
|
114
|
-
[styles.invalid]: !!invalid
|
|
114
|
+
[styles.invalid]: !!invalid,
|
|
115
115
|
[styles.withRight]: !!buttonIcon || showClearButton || counter,
|
|
116
116
|
[styles.withIcon]: !!inputIcon,
|
|
117
117
|
}), onFocus: clearableOnFocus ? handleWrapperFocus : undefined, onBlur: clearableOnFocus ? handleWrapperBlur : undefined, children: [jsxs("div", { className: styles.positionContainer, children: [jsxs("div", { className: styles.hintContainer, children: [jsxs("div", { className: styles.contentContainer, children: [!!InputIconComponent && (jsx("div", { className: styles.icon, children: jsx(InputIconComponent, {}) })), jsxs("div", { className: styles.valueContainer, children: [jsx("input", { ...restProps, ...ariaProps, maxLength: maxLength, disabled: isComponentDisabled, suppressHydrationWarning: true, className: styles.field, value: currentValue, onInput: changeHandler, onFocus: focusHandler, onBlur: blurHandler, ref: inputRefCallback }), jsx("div", { className: styles.additionalValue, children: jsxs(Text, { Element: "span", typography: "label-2-regular", children: [jsx("span", { className: styles.valueGhost, children: currentValue }), showFixedPlaceholder && (jsx("span", { className: styles.fixedPlaceholder, children: fixedPlaceholder.slice(value.length) })), showPostfix && (jsxs(Fragment, { children: ['\u00A0', postfix] }))] }) })] }), jsx("div", { className: styles.riggingContainer, children: showLabel && (jsx("label", { className: classnames(styles.label, {
|
|
118
118
|
[styles.labelElevated]: placeholderIsElevated,
|
|
119
|
-
}), id: ariaProps['aria-labelledby'], children: placeholder })) })] }), showHint && (jsx("div", { className: styles.hint, ref: hintWrapperRefCallback, "data-qa": "input-hint", children: jsx(Text, { Element: "span", typography: "label-3-regular", children: jsx("span", { ref: hintRef, children: hint }) }) }))] }), (buttonIcon || showClearButton || counter) && (jsxs("div", { className: styles.rightContainer, children: [(buttonIcon || showClearButton) && (jsx(Action, { "data-qa": buttonQaLabel, mode: "secondary", onMouseDown: (event) => event.preventDefault(), onClick: showClearButton ? clearClickHandler : onButtonClick, icon: showClearButton ? CrossOutlinedSize24 : buttonIcon, disabled: isComponentDisabled, ref: buttonRef })), counter && (jsx("span", { className: styles.counter, children: jsx(Counter, { label: counter }) }))] }))] }), jsx(
|
|
119
|
+
}), id: ariaProps['aria-labelledby'], children: placeholder })) })] }), showHint && (jsx("div", { className: styles.hint, ref: hintWrapperRefCallback, "data-qa": "input-hint", children: jsx(Text, { Element: "span", typography: "label-3-regular", children: jsx("span", { ref: hintRef, children: hint }) }) }))] }), (buttonIcon || showClearButton || counter) && (jsxs("div", { className: styles.rightContainer, children: [(buttonIcon || showClearButton) && (jsx(Action, { "data-qa": buttonQaLabel, mode: "secondary", onMouseDown: (event) => event.preventDefault(), onClick: showClearButton ? clearClickHandler : onButtonClick, icon: showClearButton ? CrossOutlinedSize24 : buttonIcon, disabled: isComponentDisabled, ref: buttonRef })), counter && (jsx("span", { className: styles.counter, children: jsx(Counter, { label: counter }) }))] }))] }), jsx(FormHelper, { description: description, errorMessage: errorMessage, descriptionId: ariaProps['aria-describedby'], disabled: isComponentDisabled, invalid: invalid })] }));
|
|
120
120
|
};
|
|
121
121
|
const BaseInput = forwardRef(BaseInputComponent);
|
|
122
122
|
BaseInput.displayName = 'BaseInput';
|
package/BaseInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.js","sources":["../src/BaseInput.tsx"],"sourcesContent":["import {\n InputHTMLAttributes,\n forwardRef,\n ForwardedRef,\n useCallback,\n useId,\n useRef,\n useState,\n useEffect,\n RefCallback,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { Selection } from '@hh.ru/magritte-common-text-selection';\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { FieldHint } from '@hh.ru/magritte-internal-field-hint';\nimport { Action } from '@hh.ru/magritte-ui-action';\nimport { Counter } from '@hh.ru/magritte-ui-counter';\nimport { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon/src/iconTypes';\nimport { BaseInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useFocus } from '@hh.ru/magritte-ui-input/useFocus';\nimport { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './input.less';\n\nconst BaseInputComponent = (\n {\n onChange,\n onFocus,\n onBlur,\n value,\n placeholder,\n disabled = false,\n postfix,\n size = 'medium',\n elevatePlaceholder = false,\n invalid = false,\n description,\n errorMessage,\n formatter,\n buttonIcon,\n clearable = false,\n clearableOnFocus,\n onButtonClick,\n buttonDataQa,\n buttonRef,\n inputIcon,\n wrapperRef,\n counter,\n fixedPlaceholder,\n maxLength,\n hint,\n showHintAlways = false,\n ...restProps\n }: BaseInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof BaseInputProps>,\n ref: ForwardedRef<HTMLInputElement>\n) => {\n const wrapperCurrentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const [isActionVisible, setActionVisible] = useState(false);\n const inputRefCallback = useMultipleRefs(ref, inputRef);\n const wrapperRefCallback = useMultipleRefs(wrapperRef, wrapperCurrentRef);\n const descriptionId = useId();\n const labelId = useId();\n const hintRef = useRef<HTMLDivElement>(null);\n const hintMaxWidthRef = useRef<{ width: number; text: string } | null>(null);\n const change = useCallback(\n (newValue: string) => {\n if (inputRef.current && formatter) {\n const caretPosition = Selection.getCaretPosition(inputRef.current);\n const formatResult = formatter(value, newValue, caretPosition || 0);\n requestAnimationFrame(() => {\n if (inputRef.current) {\n Selection.setCaretPosition(inputRef.current, formatResult.caretPosition);\n }\n });\n onChange(formatResult.outputValue);\n return;\n }\n onChange(newValue);\n },\n [formatter, onChange, value, inputRef]\n );\n\n const clearClickHandler = useCallback(\n (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n onChange('');\n inputRef.current && inputRef.current.focus();\n onButtonClick?.(event);\n },\n [onChange, inputRef, onButtonClick]\n );\n\n const forceDisabled = useDisabled();\n const isComponentDisabled = forceDisabled || !!disabled;\n\n const { changeHandler, focusHandler, blurHandler, isFocused } = useFocus(change, onFocus, onBlur);\n const placeholderCanElevated = size === 'large' && !!elevatePlaceholder && !!placeholder;\n const [isFocusVisible, setFocusVisible] = useState(false);\n const currentValue = formatter?.('', value, 0).formattedValue || value;\n const buttonQaLabel = buttonDataQa || `input-${clearable ? 'clearable-' : ''}button`;\n const ariaProps = useInputAriaProps({\n invalid,\n hasDescription: !!description,\n hasPlaceholder: !!placeholder,\n descriptionId,\n labelId,\n });\n\n const handleWrapperFocus = () => {\n setActionVisible(true);\n };\n\n const handleWrapperBlur = () => {\n requestAnimationFrame(() => {\n if (!wrapperCurrentRef.current?.contains(document.activeElement)) {\n setActionVisible(false);\n }\n });\n };\n\n const focusedOrFilled = isFocused || value !== '';\n const placeholderIsElevated = focusedOrFilled && placeholderCanElevated;\n const showPostfix = !!postfix && (placeholderIsElevated || value !== '');\n const showFixedPlaceholder = focusedOrFilled && !!fixedPlaceholder;\n const showLabel = placeholderCanElevated || (value === '' && !showFixedPlaceholder);\n\n const InputIconComponent = inputIcon || null;\n const showClearButton = value.length > 0 && (clearable || (!!clearableOnFocus && isActionVisible));\n const showHint = !!hint && (showHintAlways || value.length > 0);\n\n const hintWrapperRefCallback: RefCallback<HTMLDivElement> = useCallback(\n (element) => {\n if (element && hintRef.current) {\n const text = hintRef.current.innerText;\n if (text.length > 30) {\n let maxWidth;\n if (text !== hintMaxWidthRef.current?.text) {\n const newText = text.slice(0, 30);\n hintRef.current.innerText = newText;\n maxWidth = hintRef.current.offsetWidth;\n hintRef.current.innerText = text;\n hintMaxWidthRef.current = {\n width: maxWidth,\n text,\n };\n } else {\n maxWidth = hintMaxWidthRef.current.width;\n }\n\n element.style.maxWidth = `${maxWidth}px`;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [hint]\n );\n\n useEffect(() => {\n if (inputRef.current) {\n setFocusVisible(isFocused && inputRef.current.classList.contains('focus-visible'));\n }\n }, [isFocused]);\n\n return (\n <div\n ref={wrapperRefCallback}\n className={classnames(styles.input, {\n [styles.focused]: isFocused,\n [styles.focusVisible]: isFocusVisible,\n [styles.disabled]: isComponentDisabled,\n [styles.large]: size === 'large',\n [styles.elevated]: placeholderCanElevated,\n [styles.invalid]: !!invalid && !isFocused,\n [styles.withRight]: !!buttonIcon || showClearButton || counter,\n [styles.withIcon]: !!inputIcon,\n })}\n onFocus={clearableOnFocus ? handleWrapperFocus : undefined}\n onBlur={clearableOnFocus ? handleWrapperBlur : undefined}\n >\n <div className={styles.positionContainer}>\n <div className={styles.hintContainer}>\n <div className={styles.contentContainer}>\n {!!InputIconComponent && (\n <div className={styles.icon}>\n <InputIconComponent />\n </div>\n )}\n <div className={styles.valueContainer}>\n <input\n {...restProps}\n {...ariaProps}\n maxLength={maxLength}\n disabled={isComponentDisabled}\n suppressHydrationWarning\n className={styles.field}\n value={currentValue}\n onInput={changeHandler} // maskito требует onInput, (https://maskito.dev/frameworks/react) который работает аналогично onChange\n onFocus={focusHandler}\n onBlur={blurHandler}\n ref={inputRefCallback}\n />\n <div className={styles.additionalValue}>\n <Text Element=\"span\" typography=\"label-2-regular\">\n <span className={styles.valueGhost}>{currentValue}</span>\n {showFixedPlaceholder && (\n <span className={styles.fixedPlaceholder}>\n {fixedPlaceholder.slice(value.length)}\n </span>\n )}\n {showPostfix && (\n <>\n {'\\u00A0'}\n {postfix}\n </>\n )}\n </Text>\n </div>\n </div>\n <div className={styles.riggingContainer}>\n {showLabel && (\n <label\n className={classnames(styles.label, {\n [styles.labelElevated]: placeholderIsElevated,\n })}\n id={ariaProps['aria-labelledby']}\n >\n {placeholder}\n </label>\n )}\n </div>\n </div>\n {showHint && (\n <div className={styles.hint} ref={hintWrapperRefCallback} data-qa=\"input-hint\">\n <Text Element=\"span\" typography=\"label-3-regular\">\n <span ref={hintRef}>{hint}</span>\n </Text>\n </div>\n )}\n </div>\n {(buttonIcon || showClearButton || counter) && (\n <div className={styles.rightContainer}>\n {(buttonIcon || showClearButton) && (\n <Action\n data-qa={buttonQaLabel}\n mode=\"secondary\"\n onMouseDown={(event) => event.preventDefault()} // чтобы инпут не терял фокус\n onClick={showClearButton ? clearClickHandler : (onButtonClick as () => void)}\n icon={\n showClearButton ? CrossOutlinedSize24 : (buttonIcon as IconWrapperComponentSize24)\n }\n disabled={isComponentDisabled}\n ref={buttonRef}\n />\n )}\n {counter && (\n <span className={styles.counter}>\n <Counter label={counter} />\n </span>\n )}\n </div>\n )}\n </div>\n <FieldHint\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\n focused={isFocused}\n invalid={invalid}\n />\n </div>\n );\n};\n\nconst BaseInput = forwardRef(BaseInputComponent);\n\nBaseInput.displayName = 'BaseInput';\n\nexport { BaseInput };\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAM,kBAAkB,GAAG,CACvB,EACI,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,kBAAkB,GAAG,KAAK,EAC1B,OAAO,GAAG,KAAK,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,gBAAg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A,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,MAAM,CAAC,cAAc,EAAA,QAAA,EAAA,CAChC,CAAC,UAAU,IAAI,eAAe,MAC3BC,GAAC,CAAA,MAAM,eACM,aAAa,EACtB,IAAI,EAAC,WAAW,EAChB,WAAW,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,EAAE,EAC9C,OAAO,EAAE,eAAe,GAAG,iBAAiB,GAAI,aAA4B,EAC5E,IAAI,EACA,eAAe,GAAG,mBAAmB,GAAI,UAAyC,EAEtF,QAAQ,EAAE,mBAAmB,EAC7B,GAAG,EAAE,SAAS,GAChB,CACL,EACA,OAAO,KACJA,cAAM,SAAS,EAAE,MAAM,CAAC,OAAO,YAC3BA,GAAC,CAAA,OAAO,IAAC,KAAK,EAAE,OAAO,EAAI,CAAA,EAAA,CACxB,CACV,CACC,EAAA,CAAA,CACT,IACC,EACNA,GAAA,CAAC,SAAS,EACN,EAAA,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,OAAO,EAClB,CAAA,CAAA,EAAA,CACA,EACR;AACN,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,UAAU,CAAC,kBAAkB,EAAE;AAEjD,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseInput.js","sources":["../src/BaseInput.tsx"],"sourcesContent":["import {\n InputHTMLAttributes,\n forwardRef,\n ForwardedRef,\n useCallback,\n useId,\n useRef,\n useState,\n useEffect,\n RefCallback,\n} from 'react';\nimport classnames from 'classnames';\n\nimport { Selection } from '@hh.ru/magritte-common-text-selection';\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { useMultipleRefs } from '@hh.ru/magritte-common-use-multiple-refs';\nimport { Action } from '@hh.ru/magritte-ui-action';\nimport { Counter } from '@hh.ru/magritte-ui-counter';\nimport { FormHelper } from '@hh.ru/magritte-ui-form-helper';\nimport { CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { IconWrapperComponentSize24 } from '@hh.ru/magritte-ui-icon/src/iconTypes';\nimport { BaseInputProps } from '@hh.ru/magritte-ui-input/types';\nimport { useFocus } from '@hh.ru/magritte-ui-input/useFocus';\nimport { useInputAriaProps } from '@hh.ru/magritte-ui-input/useInputAriaProps';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './input.less';\n\nconst BaseInputComponent = (\n {\n onChange,\n onFocus,\n onBlur,\n value,\n placeholder,\n disabled = false,\n postfix,\n size = 'medium',\n elevatePlaceholder = false,\n invalid = false,\n description,\n errorMessage,\n formatter,\n buttonIcon,\n clearable = false,\n clearableOnFocus,\n onButtonClick,\n buttonDataQa,\n buttonRef,\n inputIcon,\n wrapperRef,\n counter,\n fixedPlaceholder,\n maxLength,\n hint,\n showHintAlways = false,\n ...restProps\n }: BaseInputProps & Omit<InputHTMLAttributes<HTMLInputElement>, keyof BaseInputProps>,\n ref: ForwardedRef<HTMLInputElement>\n) => {\n const wrapperCurrentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const [isActionVisible, setActionVisible] = useState(false);\n const inputRefCallback = useMultipleRefs(ref, inputRef);\n const wrapperRefCallback = useMultipleRefs(wrapperRef, wrapperCurrentRef);\n const descriptionId = useId();\n const labelId = useId();\n const hintRef = useRef<HTMLDivElement>(null);\n const hintMaxWidthRef = useRef<{ width: number; text: string } | null>(null);\n const change = useCallback(\n (newValue: string) => {\n if (inputRef.current && formatter) {\n const caretPosition = Selection.getCaretPosition(inputRef.current);\n const formatResult = formatter(value, newValue, caretPosition || 0);\n requestAnimationFrame(() => {\n if (inputRef.current) {\n Selection.setCaretPosition(inputRef.current, formatResult.caretPosition);\n }\n });\n onChange(formatResult.outputValue);\n return;\n }\n onChange(newValue);\n },\n [formatter, onChange, value, inputRef]\n );\n\n const clearClickHandler = useCallback(\n (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n onChange('');\n inputRef.current && inputRef.current.focus();\n onButtonClick?.(event);\n },\n [onChange, inputRef, onButtonClick]\n );\n\n const forceDisabled = useDisabled();\n const isComponentDisabled = forceDisabled || !!disabled;\n\n const { changeHandler, focusHandler, blurHandler, isFocused } = useFocus(change, onFocus, onBlur);\n const placeholderCanElevated = size === 'large' && !!elevatePlaceholder && !!placeholder;\n const [isFocusVisible, setFocusVisible] = useState(false);\n const currentValue = formatter?.('', value, 0).formattedValue || value;\n const buttonQaLabel = buttonDataQa || `input-${clearable ? 'clearable-' : ''}button`;\n const ariaProps = useInputAriaProps({\n invalid,\n hasDescription: !!description,\n hasPlaceholder: !!placeholder,\n descriptionId,\n labelId,\n });\n\n const handleWrapperFocus = () => {\n setActionVisible(true);\n };\n\n const handleWrapperBlur = () => {\n requestAnimationFrame(() => {\n if (!wrapperCurrentRef.current?.contains(document.activeElement)) {\n setActionVisible(false);\n }\n });\n };\n\n const focusedOrFilled = isFocused || value !== '';\n const placeholderIsElevated = focusedOrFilled && placeholderCanElevated;\n const showPostfix = !!postfix && (placeholderIsElevated || value !== '');\n const showFixedPlaceholder = focusedOrFilled && !!fixedPlaceholder;\n const showLabel = placeholderCanElevated || (value === '' && !showFixedPlaceholder);\n\n const InputIconComponent = inputIcon || null;\n const showClearButton = value.length > 0 && (clearable || (!!clearableOnFocus && isActionVisible));\n const showHint = !!hint && (showHintAlways || value.length > 0);\n\n const hintWrapperRefCallback: RefCallback<HTMLDivElement> = useCallback(\n (element) => {\n if (element && hintRef.current) {\n const text = hintRef.current.innerText;\n if (text.length > 30) {\n let maxWidth;\n if (text !== hintMaxWidthRef.current?.text) {\n const newText = text.slice(0, 30);\n hintRef.current.innerText = newText;\n maxWidth = hintRef.current.offsetWidth;\n hintRef.current.innerText = text;\n hintMaxWidthRef.current = {\n width: maxWidth,\n text,\n };\n } else {\n maxWidth = hintMaxWidthRef.current.width;\n }\n\n element.style.maxWidth = `${maxWidth}px`;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [hint]\n );\n\n useEffect(() => {\n if (inputRef.current) {\n setFocusVisible(isFocused && inputRef.current.classList.contains('focus-visible'));\n }\n }, [isFocused]);\n\n return (\n <div\n ref={wrapperRefCallback}\n className={classnames(styles.input, {\n [styles.focused]: isFocused,\n [styles.focusVisible]: isFocusVisible,\n [styles.disabled]: isComponentDisabled,\n [styles.large]: size === 'large',\n [styles.elevated]: placeholderCanElevated,\n [styles.invalid]: !!invalid,\n [styles.withRight]: !!buttonIcon || showClearButton || counter,\n [styles.withIcon]: !!inputIcon,\n })}\n onFocus={clearableOnFocus ? handleWrapperFocus : undefined}\n onBlur={clearableOnFocus ? handleWrapperBlur : undefined}\n >\n <div className={styles.positionContainer}>\n <div className={styles.hintContainer}>\n <div className={styles.contentContainer}>\n {!!InputIconComponent && (\n <div className={styles.icon}>\n <InputIconComponent />\n </div>\n )}\n <div className={styles.valueContainer}>\n <input\n {...restProps}\n {...ariaProps}\n maxLength={maxLength}\n disabled={isComponentDisabled}\n suppressHydrationWarning\n className={styles.field}\n value={currentValue}\n onInput={changeHandler} // maskito требует onInput, (https://maskito.dev/frameworks/react) который работает аналогично onChange\n onFocus={focusHandler}\n onBlur={blurHandler}\n ref={inputRefCallback}\n />\n <div className={styles.additionalValue}>\n <Text Element=\"span\" typography=\"label-2-regular\">\n <span className={styles.valueGhost}>{currentValue}</span>\n {showFixedPlaceholder && (\n <span className={styles.fixedPlaceholder}>\n {fixedPlaceholder.slice(value.length)}\n </span>\n )}\n {showPostfix && (\n <>\n {'\\u00A0'}\n {postfix}\n </>\n )}\n </Text>\n </div>\n </div>\n <div className={styles.riggingContainer}>\n {showLabel && (\n <label\n className={classnames(styles.label, {\n [styles.labelElevated]: placeholderIsElevated,\n })}\n id={ariaProps['aria-labelledby']}\n >\n {placeholder}\n </label>\n )}\n </div>\n </div>\n {showHint && (\n <div className={styles.hint} ref={hintWrapperRefCallback} data-qa=\"input-hint\">\n <Text Element=\"span\" typography=\"label-3-regular\">\n <span ref={hintRef}>{hint}</span>\n </Text>\n </div>\n )}\n </div>\n {(buttonIcon || showClearButton || counter) && (\n <div className={styles.rightContainer}>\n {(buttonIcon || showClearButton) && (\n <Action\n data-qa={buttonQaLabel}\n mode=\"secondary\"\n onMouseDown={(event) => event.preventDefault()} // чтобы инпут не терял фокус\n onClick={showClearButton ? clearClickHandler : (onButtonClick as () => void)}\n icon={\n showClearButton ? CrossOutlinedSize24 : (buttonIcon as IconWrapperComponentSize24)\n }\n disabled={isComponentDisabled}\n ref={buttonRef}\n />\n )}\n {counter && (\n <span className={styles.counter}>\n <Counter label={counter} />\n </span>\n )}\n </div>\n )}\n </div>\n <FormHelper\n description={description}\n errorMessage={errorMessage}\n descriptionId={ariaProps['aria-describedby']}\n disabled={isComponentDisabled}\n invalid={invalid}\n />\n </div>\n );\n};\n\nconst BaseInput = forwardRef(BaseInputComponent);\n\nBaseInput.displayName = 'BaseInput';\n\nexport { BaseInput };\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AA4BA,MAAM,kBAAkB,GAAG,CACvB,EACI,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,kBAAkB,GAAG,KAAK,EAC1B,OAAO,GAAG,KAAK,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,OAAO,EACP,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,cAAc,GAAG,KAAK,EACtB,GAAG,SAAS,EACqE,EACrF,GAAmC,KACnC;AACA,IAAA,MAAM,iBAAiB,GAAG,MAAM,CAAiB,IA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Aa,EACtB,IAAI,EAAC,WAAW,EAChB,WAAW,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,EAAE,EAC9C,OAAO,EAAE,eAAe,GAAG,iBAAiB,GAAI,aAA4B,EAC5E,IAAI,EACA,eAAe,GAAG,mBAAmB,GAAI,UAAyC,EAEtF,QAAQ,EAAE,mBAAmB,EAC7B,GAAG,EAAE,SAAS,GAChB,CACL,EACA,OAAO,KACJA,cAAM,SAAS,EAAE,MAAM,CAAC,OAAO,EAC3B,QAAA,EAAAA,GAAA,CAAC,OAAO,EAAC,EAAA,KAAK,EAAE,OAAO,EAAA,CAAI,GACxB,CACV,CAAA,EAAA,CACC,CACT,CACC,EAAA,CAAA,EACNA,IAAC,UAAU,EAAA,EACP,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAAC,EAC5C,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,OAAO,EAClB,CAAA,CAAA,EAAA,CACA,EACR;AACN,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,UAAU,CAAC,kBAAkB,EAAE;AAEjD,SAAS,CAAC,WAAW,GAAG,WAAW;;;;"}
|
package/DateTimeInput.js
CHANGED
|
@@ -8,9 +8,9 @@ import { useDateTimeMask } from './useDateTimeMask.js';
|
|
|
8
8
|
import 'classnames';
|
|
9
9
|
import '@hh.ru/magritte-common-text-selection';
|
|
10
10
|
import '@hh.ru/magritte-common-use-disabled';
|
|
11
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
12
11
|
import '@hh.ru/magritte-ui-action';
|
|
13
12
|
import '@hh.ru/magritte-ui-counter';
|
|
13
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
14
14
|
import './useFocus.js';
|
|
15
15
|
import './useInputAriaProps.js';
|
|
16
16
|
import '@hh.ru/magritte-ui-typography';
|
package/Input.js
CHANGED
|
@@ -6,9 +6,9 @@ import 'classnames';
|
|
|
6
6
|
import '@hh.ru/magritte-common-text-selection';
|
|
7
7
|
import '@hh.ru/magritte-common-use-disabled';
|
|
8
8
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
9
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
10
9
|
import '@hh.ru/magritte-ui-action';
|
|
11
10
|
import '@hh.ru/magritte-ui-counter';
|
|
11
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
12
12
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
13
13
|
import './useFocus.js';
|
|
14
14
|
import './useInputAriaProps.js';
|
package/NumberInput.js
CHANGED
|
@@ -9,9 +9,9 @@ import 'classnames';
|
|
|
9
9
|
import '@hh.ru/magritte-common-text-selection';
|
|
10
10
|
import '@hh.ru/magritte-common-use-disabled';
|
|
11
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
12
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
13
12
|
import '@hh.ru/magritte-ui-action';
|
|
14
13
|
import '@hh.ru/magritte-ui-counter';
|
|
14
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
15
15
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
16
16
|
import './useFocus.js';
|
|
17
17
|
import './useInputAriaProps.js';
|
package/PasswordInput.js
CHANGED
|
@@ -8,9 +8,9 @@ import { Input } from './Input.js';
|
|
|
8
8
|
import './BaseInput.js';
|
|
9
9
|
import 'classnames';
|
|
10
10
|
import '@hh.ru/magritte-common-use-disabled';
|
|
11
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
12
11
|
import '@hh.ru/magritte-ui-action';
|
|
13
12
|
import '@hh.ru/magritte-ui-counter';
|
|
13
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
14
14
|
import './useFocus.js';
|
|
15
15
|
import './useInputAriaProps.js';
|
|
16
16
|
import '@hh.ru/magritte-ui-typography';
|
package/SearchInput.js
CHANGED
|
@@ -7,9 +7,9 @@ import 'classnames';
|
|
|
7
7
|
import '@hh.ru/magritte-common-text-selection';
|
|
8
8
|
import '@hh.ru/magritte-common-use-disabled';
|
|
9
9
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
10
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
11
10
|
import '@hh.ru/magritte-ui-action';
|
|
12
11
|
import '@hh.ru/magritte-ui-counter';
|
|
12
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
13
13
|
import './useFocus.js';
|
|
14
14
|
import './useInputAriaProps.js';
|
|
15
15
|
import '@hh.ru/magritte-ui-typography';
|
|
@@ -9,9 +9,9 @@ import './BaseInput.js';
|
|
|
9
9
|
import 'classnames';
|
|
10
10
|
import '@hh.ru/magritte-common-text-selection';
|
|
11
11
|
import '@hh.ru/magritte-common-use-disabled';
|
|
12
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
13
12
|
import '@hh.ru/magritte-ui-action';
|
|
14
13
|
import '@hh.ru/magritte-ui-counter';
|
|
14
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
15
15
|
import './useFocus.js';
|
|
16
16
|
import './useInputAriaProps.js';
|
|
17
17
|
import '@hh.ru/magritte-ui-typography';
|
package/UncontrolledInput.js
CHANGED
|
@@ -8,9 +8,9 @@ import 'classnames';
|
|
|
8
8
|
import '@hh.ru/magritte-common-text-selection';
|
|
9
9
|
import '@hh.ru/magritte-common-use-disabled';
|
|
10
10
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
11
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
12
11
|
import '@hh.ru/magritte-ui-action';
|
|
13
12
|
import '@hh.ru/magritte-ui-counter';
|
|
13
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
14
14
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
15
15
|
import './useFocus.js';
|
|
16
16
|
import './useInputAriaProps.js';
|
|
@@ -10,9 +10,9 @@ import 'classnames';
|
|
|
10
10
|
import '@hh.ru/magritte-common-text-selection';
|
|
11
11
|
import '@hh.ru/magritte-common-use-disabled';
|
|
12
12
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
13
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
14
13
|
import '@hh.ru/magritte-ui-action';
|
|
15
14
|
import '@hh.ru/magritte-ui-counter';
|
|
15
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
16
16
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
17
17
|
import './useFocus.js';
|
|
18
18
|
import './useInputAriaProps.js';
|
|
@@ -10,9 +10,9 @@ import './Input.js';
|
|
|
10
10
|
import './BaseInput.js';
|
|
11
11
|
import 'classnames';
|
|
12
12
|
import '@hh.ru/magritte-common-use-disabled';
|
|
13
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
14
13
|
import '@hh.ru/magritte-ui-action';
|
|
15
14
|
import '@hh.ru/magritte-ui-counter';
|
|
15
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
16
16
|
import './useFocus.js';
|
|
17
17
|
import './useInputAriaProps.js';
|
|
18
18
|
import '@hh.ru/magritte-ui-typography';
|
|
@@ -9,9 +9,9 @@ import 'classnames';
|
|
|
9
9
|
import '@hh.ru/magritte-common-text-selection';
|
|
10
10
|
import '@hh.ru/magritte-common-use-disabled';
|
|
11
11
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
12
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
13
12
|
import '@hh.ru/magritte-ui-action';
|
|
14
13
|
import '@hh.ru/magritte-ui-counter';
|
|
14
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
15
15
|
import './useFocus.js';
|
|
16
16
|
import './useInputAriaProps.js';
|
|
17
17
|
import '@hh.ru/magritte-ui-typography';
|
package/index.css
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
:root{
|
|
2
2
|
--magritte-color-text-primary-v18-1-2:#000000;
|
|
3
|
-
--magritte-color-component-input-stroke-state-field-hovered-v18-1-2:#CCD5DF;
|
|
4
3
|
--magritte-color-component-input-stroke-state-field-focused-v18-1-2:#0070ff;
|
|
5
4
|
--magritte-color-component-input-stroke-state-accent-focused-accessible-v18-1-2:#0070ff7a;
|
|
6
5
|
--magritte-color-component-input-stroke-state-field-invalid-v18-1-2:#ff4d3a;
|
|
6
|
+
--magritte-color-component-input-stroke-state-negative-focused-accessible-v18-1-2:#ff4d3a7a;
|
|
7
7
|
--magritte-color-component-input-stroke-state-field-disabled-v18-1-2:#EEF1F7;
|
|
8
8
|
--magritte-color-component-input-background-field-v18-1-2:#ffffff;
|
|
9
|
-
--magritte-color-component-input-background-state-field-hovered-v18-1-2:#ffffff;
|
|
10
9
|
--magritte-color-component-input-background-state-field-focused-v18-1-2:#ffffff;
|
|
11
10
|
--magritte-color-component-input-background-state-field-invalid-v18-1-2:#ffffff;
|
|
12
11
|
--magritte-color-component-input-background-state-field-disabled-v18-1-2:#F4F6FB;
|
|
@@ -15,23 +14,19 @@
|
|
|
15
14
|
--magritte-color-component-input-text-state-label-disabled-v18-1-2:#AABBCA;
|
|
16
15
|
--magritte-color-component-input-text-state-placeholder-disabled-v18-1-2:#AABBCA;
|
|
17
16
|
--magritte-color-component-input-text-state-description-disabled-v18-1-2:#AABBCA;
|
|
18
|
-
--magritte-color-component-input-text-state-content-hovered-v18-1-2:#000000;
|
|
19
17
|
--magritte-color-component-input-text-state-content-focused-v18-1-2:#000000;
|
|
20
18
|
--magritte-color-component-input-text-state-content-invalid-v18-1-2:#000000;
|
|
21
|
-
--magritte-color-component-input-text-state-label-hovered-v18-1-2:#768694;
|
|
22
19
|
--magritte-color-component-input-text-state-label-focused-v18-1-2:#768694;
|
|
23
20
|
--magritte-color-component-input-text-state-label-invalid-v18-1-2:#768694;
|
|
24
|
-
--magritte-color-component-input-text-state-placeholder-hovered-v18-1-2:#768694;
|
|
25
21
|
--magritte-color-component-input-text-state-placeholder-focused-v18-1-2:#AABBCA;
|
|
26
22
|
--magritte-color-component-input-text-state-placeholder-invalid-v18-1-2:#AABBCA;
|
|
27
|
-
--magritte-color-component-input-text-state-description-hovered-v18-1-2:#768694;
|
|
28
23
|
--magritte-color-component-input-text-state-description-focused-v18-1-2:#768694;
|
|
24
|
+
--magritte-color-component-input-text-state-description-invalid-v18-1-2:#ff4d3a;
|
|
29
25
|
--magritte-color-component-input-counter-background-content-v18-1-2:#EEF1F7;
|
|
30
26
|
--magritte-color-component-input-counter-background-state-content-disabled-v18-1-2:#CCD5DF;
|
|
31
27
|
--magritte-color-component-input-counter-text-state-content-disabled-v18-1-2:#96aabb;
|
|
32
28
|
--magritte-color-component-input-counter-text-content-v18-1-2:#8293a2;
|
|
33
29
|
--magritte-color-component-input-icon-content-v18-1-2:#6a7885;
|
|
34
|
-
--magritte-color-component-input-icon-state-content-hovered-v18-1-2:#6a7885;
|
|
35
30
|
--magritte-color-component-input-icon-state-content-focused-v18-1-2:#000000;
|
|
36
31
|
--magritte-color-component-input-icon-state-content-invalid-v18-1-2:#6a7885;
|
|
37
32
|
--magritte-color-component-input-icon-state-content-disabled-v18-1-2:#AABBCA;
|
|
@@ -63,13 +58,12 @@
|
|
|
63
58
|
}
|
|
64
59
|
.magritte-night-theme{
|
|
65
60
|
--magritte-color-text-primary-v18-1-2:#ffffff;
|
|
66
|
-
--magritte-color-component-input-stroke-state-field-hovered-v18-1-2:#3B3B3B;
|
|
67
61
|
--magritte-color-component-input-stroke-state-field-focused-v18-1-2:#0070ff;
|
|
68
62
|
--magritte-color-component-input-stroke-state-accent-focused-accessible-v18-1-2:#0070ff7a;
|
|
69
63
|
--magritte-color-component-input-stroke-state-field-invalid-v18-1-2:#ff4d3a;
|
|
64
|
+
--magritte-color-component-input-stroke-state-negative-focused-accessible-v18-1-2:#ff4d3a7a;
|
|
70
65
|
--magritte-color-component-input-stroke-state-field-disabled-v18-1-2:#111;
|
|
71
66
|
--magritte-color-component-input-background-field-v18-1-2:#1B1B1B;
|
|
72
|
-
--magritte-color-component-input-background-state-field-hovered-v18-1-2:#1B1B1B;
|
|
73
67
|
--magritte-color-component-input-background-state-field-focused-v18-1-2:#1B1B1B;
|
|
74
68
|
--magritte-color-component-input-background-state-field-invalid-v18-1-2:#1B1B1B;
|
|
75
69
|
--magritte-color-component-input-background-state-field-disabled-v18-1-2:#111;
|
|
@@ -82,43 +76,39 @@
|
|
|
82
76
|
--magritte-color-component-input-text-state-label-disabled-v18-1-2:#474747;
|
|
83
77
|
--magritte-color-component-input-text-state-placeholder-disabled-v18-1-2:#474747;
|
|
84
78
|
--magritte-color-component-input-text-state-description-disabled-v18-1-2:#535353;
|
|
85
|
-
--magritte-color-component-input-text-state-content-hovered-v18-1-2:#ffffff;
|
|
86
79
|
--magritte-color-component-input-text-state-content-focused-v18-1-2:#ffffff;
|
|
87
80
|
--magritte-color-component-input-text-state-content-invalid-v18-1-2:#ffffff;
|
|
88
|
-
--magritte-color-component-input-text-state-label-hovered-v18-1-2:#919191;
|
|
89
81
|
--magritte-color-component-input-text-state-label-focused-v18-1-2:#919191;
|
|
90
82
|
--magritte-color-component-input-text-state-label-invalid-v18-1-2:#919191;
|
|
91
|
-
--magritte-color-component-input-text-state-placeholder-hovered-v18-1-2:#5E5E5E;
|
|
92
83
|
--magritte-color-component-input-text-state-placeholder-focused-v18-1-2:#535353;
|
|
93
84
|
--magritte-color-component-input-text-state-placeholder-invalid-v18-1-2:#535353;
|
|
94
|
-
--magritte-color-component-input-text-state-description-hovered-v18-1-2:#535353;
|
|
95
85
|
--magritte-color-component-input-text-state-description-focused-v18-1-2:#535353;
|
|
86
|
+
--magritte-color-component-input-text-state-description-invalid-v18-1-2:#ff4d3a;
|
|
96
87
|
--magritte-color-component-input-counter-background-content-v18-1-2:#EEF1F7;
|
|
97
88
|
--magritte-color-component-input-counter-background-state-content-disabled-v18-1-2:#CCD5DF;
|
|
98
89
|
--magritte-color-component-input-counter-text-state-content-disabled-v18-1-2:#96aabb;
|
|
99
90
|
--magritte-color-component-input-counter-text-content-v18-1-2:#6a7885;
|
|
100
|
-
--magritte-color-component-input-icon-state-content-hovered-v18-1-2:#5E5E5E;
|
|
101
91
|
--magritte-color-component-input-icon-state-content-focused-v18-1-2:#ffffff;
|
|
102
92
|
--magritte-color-component-input-icon-state-content-invalid-v18-1-2:#767676;
|
|
103
93
|
--magritte-color-component-input-icon-state-content-disabled-v18-1-2:#474747;
|
|
104
94
|
--magritte-color-component-input-icon-content-v18-1-2:#ABABAB;
|
|
105
95
|
}
|
|
106
|
-
.magritte-input___LVTID_5-0-
|
|
96
|
+
.magritte-input___LVTID_5-0-17{
|
|
107
97
|
display:inline-block;
|
|
108
98
|
width:100%;
|
|
109
99
|
--animation-100-duration:var(--magritte-semantic-animation-ease-in-out-100-duration-v18-1-2);
|
|
110
100
|
--animation-200-duration:var(--magritte-semantic-animation-ease-in-out-200-duration-v18-1-2);
|
|
111
101
|
}
|
|
112
|
-
.magritte-input___LVTID_5-0-
|
|
102
|
+
.magritte-input___LVTID_5-0-17:has(input:autofill) .magritte-label___YlOQk_5-0-17{
|
|
113
103
|
display:none;
|
|
114
104
|
}
|
|
115
|
-
.magritte-input___LVTID_5-0-
|
|
105
|
+
.magritte-input___LVTID_5-0-17.magritte-elevated___kPcsM_5-0-17:has(input:autofill) .magritte-label___YlOQk_5-0-17{
|
|
116
106
|
display:block;
|
|
117
107
|
transform:translateY(calc(0px - ((var(--magritte-typography-label-4-regular-line-height-v18-1-2) + var(--magritte-typography-label-2-regular-line-height-v18-1-2)) / 2) + (var(--magritte-typography-label-4-regular-line-height-v18-1-2) / 2)));
|
|
118
108
|
transition-duration:0ms;
|
|
119
109
|
color:var(--magritte-color-component-input-text-label-v18-1-2);
|
|
120
110
|
}
|
|
121
|
-
.magritte-input___LVTID_5-0-
|
|
111
|
+
.magritte-input___LVTID_5-0-17.magritte-elevated___kPcsM_5-0-17:has(input:autofill) .magritte-label___YlOQk_5-0-17 > *{
|
|
122
112
|
font-family:var(--magritte-typography-label-4-regular-font-family-v18-1-2);
|
|
123
113
|
font-weight:var(--magritte-typography-label-4-regular-font-weight-v18-1-2);
|
|
124
114
|
line-height:var(--magritte-typography-label-4-regular-line-height-v18-1-2);
|
|
@@ -129,153 +119,200 @@
|
|
|
129
119
|
text-decoration:var(--magritte-typography-label-4-regular-text-decoration-v18-1-2);
|
|
130
120
|
}
|
|
131
121
|
@media (min-width: 1020px){
|
|
132
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
133
|
-
|
|
134
|
-
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-hovered-v18-1-2);
|
|
122
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover{
|
|
123
|
+
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
135
124
|
}
|
|
136
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
137
|
-
color:var(--magritte-color-component-input-
|
|
138
|
-
-
|
|
125
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-position-container___kZnvZ_5-0-17{
|
|
126
|
+
background-color:var(--magritte-color-component-input-background-state-field-invalid-v18-1-2);
|
|
127
|
+
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-invalid-v18-1-2);
|
|
128
|
+
}
|
|
129
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-field___9S8Tw_5-0-17{
|
|
130
|
+
color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
131
|
+
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
139
132
|
opacity:1;
|
|
140
133
|
}
|
|
141
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
142
|
-
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-
|
|
143
|
-
color:var(--magritte-color-component-input-text-state-description-
|
|
134
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-hint___EFGK0_5-0-17{
|
|
135
|
+
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-invalid';
|
|
136
|
+
color:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
144
137
|
}
|
|
145
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
146
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-
|
|
138
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-additional-value___9Kyap_5-0-17{
|
|
139
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
147
140
|
}
|
|
148
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
149
|
-
color:var(--magritte-color-component-input-text-state-label-
|
|
141
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-label_elevated___PVcpC_5-0-17{
|
|
142
|
+
color:var(--magritte-color-component-input-text-state-label-invalid-v18-1-2);
|
|
150
143
|
}
|
|
151
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
152
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
153
|
-
color:var(--magritte-color-component-input-text-state-placeholder-
|
|
144
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-label___YlOQk_5-0-17:not(.magritte-label_elevated___PVcpC_5-0-17),
|
|
145
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
146
|
+
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v18-1-2);
|
|
154
147
|
}
|
|
155
|
-
body.magritte-old-layout .magritte-input___LVTID_5-0-
|
|
156
|
-
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-
|
|
148
|
+
body.magritte-old-layout .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-icon___HEDsQ_5-0-17{
|
|
149
|
+
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-invalid-v18-1-2);
|
|
157
150
|
}
|
|
158
151
|
}
|
|
159
152
|
@media (min-width: 1024px){
|
|
160
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
161
|
-
|
|
162
|
-
|
|
153
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover{
|
|
154
|
+
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
155
|
+
}
|
|
156
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-position-container___kZnvZ_5-0-17{
|
|
157
|
+
background-color:var(--magritte-color-component-input-background-state-field-invalid-v18-1-2);
|
|
158
|
+
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-invalid-v18-1-2);
|
|
163
159
|
}
|
|
164
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
165
|
-
color:var(--magritte-color-component-input-text-state-content-
|
|
166
|
-
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-
|
|
160
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-field___9S8Tw_5-0-17{
|
|
161
|
+
color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
162
|
+
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
167
163
|
opacity:1;
|
|
168
164
|
}
|
|
169
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
170
|
-
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-
|
|
171
|
-
color:var(--magritte-color-component-input-text-state-description-
|
|
165
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-hint___EFGK0_5-0-17{
|
|
166
|
+
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-invalid';
|
|
167
|
+
color:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
172
168
|
}
|
|
173
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
174
|
-
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-
|
|
169
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-additional-value___9Kyap_5-0-17{
|
|
170
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
175
171
|
}
|
|
176
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
177
|
-
color:var(--magritte-color-component-input-text-state-label-
|
|
172
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-label_elevated___PVcpC_5-0-17{
|
|
173
|
+
color:var(--magritte-color-component-input-text-state-label-invalid-v18-1-2);
|
|
178
174
|
}
|
|
179
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
180
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
181
|
-
color:var(--magritte-color-component-input-text-state-placeholder-
|
|
175
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-label___YlOQk_5-0-17:not(.magritte-label_elevated___PVcpC_5-0-17),
|
|
176
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
177
|
+
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v18-1-2);
|
|
182
178
|
}
|
|
183
|
-
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-
|
|
184
|
-
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-
|
|
179
|
+
body:not(.magritte-old-layout) .magritte-input___LVTID_5-0-17:not(.magritte-focused___dxrHD_5-0-17):not(.magritte-invalid___L5MVa_5-0-17):not(.magritte-disabled___0NH6E_5-0-17):hover .magritte-icon___HEDsQ_5-0-17{
|
|
180
|
+
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-invalid-v18-1-2);
|
|
185
181
|
}
|
|
186
182
|
}
|
|
187
|
-
.magritte-input___LVTID_5-0-
|
|
183
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17{
|
|
184
|
+
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-focused-v18-1-2);
|
|
185
|
+
}
|
|
186
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
188
187
|
background-color:var(--magritte-color-component-input-background-state-field-focused-v18-1-2);
|
|
189
188
|
box-shadow:inset 0 0 0 2px var(--magritte-color-component-input-stroke-state-field-focused-v18-1-2);
|
|
190
189
|
}
|
|
191
|
-
.magritte-input___LVTID_5-0-
|
|
190
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-field___9S8Tw_5-0-17{
|
|
192
191
|
color:var(--magritte-color-component-input-text-state-content-focused-v18-1-2);
|
|
193
192
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-focused-v18-1-2);
|
|
194
193
|
opacity:1;
|
|
195
194
|
}
|
|
196
|
-
.magritte-input___LVTID_5-0-
|
|
195
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-hint___EFGK0_5-0-17{
|
|
197
196
|
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-focused';
|
|
198
197
|
color:var(--magritte-color-component-input-text-state-description-focused-v18-1-2);
|
|
199
198
|
}
|
|
200
|
-
.magritte-input___LVTID_5-0-
|
|
199
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-additional-value___9Kyap_5-0-17{
|
|
201
200
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-focused-v18-1-2);
|
|
202
201
|
}
|
|
203
|
-
.magritte-input___LVTID_5-0-
|
|
202
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-label_elevated___PVcpC_5-0-17{
|
|
204
203
|
color:var(--magritte-color-component-input-text-state-label-focused-v18-1-2);
|
|
205
204
|
}
|
|
206
|
-
.magritte-input___LVTID_5-0-
|
|
207
|
-
.magritte-input___LVTID_5-0-
|
|
205
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-label___YlOQk_5-0-17:not(.magritte-label_elevated___PVcpC_5-0-17),
|
|
206
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
208
207
|
color:var(--magritte-color-component-input-text-state-placeholder-focused-v18-1-2);
|
|
209
208
|
}
|
|
210
|
-
.magritte-input___LVTID_5-0-
|
|
209
|
+
.magritte-input___LVTID_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-icon___HEDsQ_5-0-17{
|
|
211
210
|
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-focused-v18-1-2);
|
|
212
211
|
}
|
|
213
|
-
.magritte-input___LVTID_5-0-
|
|
212
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17{
|
|
213
|
+
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
214
|
+
}
|
|
215
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
214
216
|
background-color:var(--magritte-color-component-input-background-state-field-invalid-v18-1-2);
|
|
215
217
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-invalid-v18-1-2);
|
|
216
218
|
}
|
|
217
|
-
.magritte-input___LVTID_5-0-
|
|
219
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-field___9S8Tw_5-0-17{
|
|
218
220
|
color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
219
221
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
220
222
|
opacity:1;
|
|
221
223
|
}
|
|
222
|
-
.magritte-input___LVTID_5-0-
|
|
223
|
-
--magritte-ui-text-color-override:'magritte-color-component-input-text-description';
|
|
224
|
-
color:var(--magritte-color-component-input-text-description-v18-1-2);
|
|
224
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-hint___EFGK0_5-0-17{
|
|
225
|
+
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-invalid';
|
|
226
|
+
color:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
225
227
|
}
|
|
226
|
-
.magritte-input___LVTID_5-0-
|
|
228
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-additional-value___9Kyap_5-0-17{
|
|
227
229
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
228
230
|
}
|
|
229
|
-
.magritte-input___LVTID_5-0-
|
|
231
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-label_elevated___PVcpC_5-0-17{
|
|
230
232
|
color:var(--magritte-color-component-input-text-state-label-invalid-v18-1-2);
|
|
231
233
|
}
|
|
232
|
-
.magritte-input___LVTID_5-0-
|
|
233
|
-
.magritte-input___LVTID_5-0-
|
|
234
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-label___YlOQk_5-0-17:not(.magritte-label_elevated___PVcpC_5-0-17),
|
|
235
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
234
236
|
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v18-1-2);
|
|
235
237
|
}
|
|
236
|
-
.magritte-input___LVTID_5-0-
|
|
238
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-icon___HEDsQ_5-0-17{
|
|
237
239
|
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-invalid-v18-1-2);
|
|
238
240
|
}
|
|
239
|
-
.magritte-input___LVTID_5-0-
|
|
241
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17{
|
|
242
|
+
--magritte-ui-form-helper-error-color-override:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
243
|
+
}
|
|
244
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
245
|
+
background-color:var(--magritte-color-component-input-background-state-field-invalid-v18-1-2);
|
|
246
|
+
box-shadow:inset 0 0 0 2px var(--magritte-color-component-input-stroke-state-field-invalid-v18-1-2);
|
|
247
|
+
}
|
|
248
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-field___9S8Tw_5-0-17{
|
|
249
|
+
color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
250
|
+
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
251
|
+
opacity:1;
|
|
252
|
+
}
|
|
253
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-hint___EFGK0_5-0-17{
|
|
254
|
+
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-invalid';
|
|
255
|
+
color:var(--magritte-color-component-input-text-state-description-invalid-v18-1-2);
|
|
256
|
+
}
|
|
257
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-additional-value___9Kyap_5-0-17{
|
|
258
|
+
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-invalid-v18-1-2);
|
|
259
|
+
}
|
|
260
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-label_elevated___PVcpC_5-0-17{
|
|
261
|
+
color:var(--magritte-color-component-input-text-state-label-invalid-v18-1-2);
|
|
262
|
+
}
|
|
263
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-label___YlOQk_5-0-17:not(.magritte-label_elevated___PVcpC_5-0-17),
|
|
264
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
265
|
+
color:var(--magritte-color-component-input-text-state-placeholder-invalid-v18-1-2);
|
|
266
|
+
}
|
|
267
|
+
.magritte-input___LVTID_5-0-17.magritte-invalid___L5MVa_5-0-17.magritte-focused___dxrHD_5-0-17 .magritte-icon___HEDsQ_5-0-17{
|
|
268
|
+
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-invalid-v18-1-2);
|
|
269
|
+
}
|
|
270
|
+
.magritte-input___LVTID_5-0-17.magritte-focus-visible___QvCO1_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
240
271
|
outline:var(--magritte-color-component-input-stroke-state-accent-focused-accessible-v18-1-2) solid 4px;
|
|
241
272
|
}
|
|
242
|
-
.magritte-input___LVTID_5-0-
|
|
273
|
+
.magritte-input___LVTID_5-0-17.magritte-focus-visible___QvCO1_5-0-17.magritte-invalid___L5MVa_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
274
|
+
outline-color:var(--magritte-color-component-input-stroke-state-negative-focused-accessible-v18-1-2);
|
|
275
|
+
}
|
|
276
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17{
|
|
277
|
+
--magritte-ui-form-helper-description-color-override:var(--magritte-color-component-input-text-state-description-disabled-v18-1-2);
|
|
278
|
+
}
|
|
279
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
243
280
|
background-color:var(--magritte-color-component-input-background-state-field-disabled-v18-1-2);
|
|
244
281
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-state-field-disabled-v18-1-2);
|
|
245
282
|
}
|
|
246
|
-
.magritte-input___LVTID_5-0-
|
|
283
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-field___9S8Tw_5-0-17{
|
|
247
284
|
color:var(--magritte-color-component-input-text-state-content-disabled-v18-1-2);
|
|
248
285
|
-webkit-text-fill-color:var(--magritte-color-component-input-text-state-content-disabled-v18-1-2);
|
|
249
286
|
opacity:1;
|
|
250
287
|
}
|
|
251
|
-
.magritte-input___LVTID_5-0-
|
|
288
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-hint___EFGK0_5-0-17{
|
|
252
289
|
--magritte-ui-text-color-override:'magritte-color-component-input-text-state-description-disabled';
|
|
253
290
|
color:var(--magritte-color-component-input-text-state-description-disabled-v18-1-2);
|
|
254
291
|
}
|
|
255
|
-
.magritte-input___LVTID_5-0-
|
|
292
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-additional-value___9Kyap_5-0-17{
|
|
256
293
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-state-content-disabled-v18-1-2);
|
|
257
294
|
}
|
|
258
|
-
.magritte-input___LVTID_5-0-
|
|
295
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-label_elevated___PVcpC_5-0-17{
|
|
259
296
|
color:var(--magritte-color-component-input-text-state-label-disabled-v18-1-2);
|
|
260
297
|
}
|
|
261
|
-
.magritte-input___LVTID_5-0-
|
|
262
|
-
.magritte-input___LVTID_5-0-
|
|
298
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-label___YlOQk_5-0-17:not(.magritte-label_elevated___PVcpC_5-0-17),
|
|
299
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
263
300
|
color:var(--magritte-color-component-input-text-state-placeholder-disabled-v18-1-2);
|
|
264
301
|
}
|
|
265
|
-
.magritte-input___LVTID_5-0-
|
|
302
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-icon___HEDsQ_5-0-17{
|
|
266
303
|
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-state-content-disabled-v18-1-2);
|
|
267
304
|
}
|
|
268
|
-
.magritte-input___LVTID_5-0-
|
|
305
|
+
.magritte-input___LVTID_5-0-17.magritte-disabled___0NH6E_5-0-17 .magritte-right-container___N0B0o_5-0-17{
|
|
269
306
|
--magritte-counter-background-color:var(--magritte-color-component-input-counter-background-state-content-disabled-v18-1-2);
|
|
270
307
|
--magritte-counter-label-color:var(--magritte-color-component-input-counter-text-state-content-disabled-v18-1-2);
|
|
271
308
|
}
|
|
272
309
|
@media (prefers-reduced-motion){
|
|
273
|
-
.magritte-input___LVTID_5-0-
|
|
310
|
+
.magritte-input___LVTID_5-0-17{
|
|
274
311
|
--animation-100-duration:1ms;
|
|
275
312
|
--animation-200-duration:1ms;
|
|
276
313
|
}
|
|
277
314
|
}
|
|
278
|
-
.magritte-position-container___kZnvZ_5-0-
|
|
315
|
+
.magritte-position-container___kZnvZ_5-0-17{
|
|
279
316
|
display:flex;
|
|
280
317
|
align-items:center;
|
|
281
318
|
position:relative;
|
|
@@ -285,20 +322,20 @@
|
|
|
285
322
|
box-shadow:inset 0 0 0 1px var(--magritte-color-component-input-stroke-field-v18-1-2);
|
|
286
323
|
padding:4px 4px 4px 16px;
|
|
287
324
|
}
|
|
288
|
-
.magritte-with-icon___TPBe2_5-0-
|
|
325
|
+
.magritte-with-icon___TPBe2_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
289
326
|
padding-left:12px;
|
|
290
327
|
}
|
|
291
|
-
.magritte-large___9frRh_5-0-
|
|
328
|
+
.magritte-large___9frRh_5-0-17 .magritte-position-container___kZnvZ_5-0-17{
|
|
292
329
|
padding:8px 8px 8px 16px;
|
|
293
330
|
}
|
|
294
|
-
.magritte-right-container___N0B0o_5-0-
|
|
331
|
+
.magritte-right-container___N0B0o_5-0-17{
|
|
295
332
|
display:flex;
|
|
296
333
|
align-items:center;
|
|
297
334
|
justify-content:center;
|
|
298
335
|
--magritte-counter-background-color:var(--magritte-color-component-input-counter-background-content-v18-1-2);
|
|
299
336
|
--magritte-counter-label-color:var(--magritte-color-component-input-counter-text-content-v18-1-2);
|
|
300
337
|
}
|
|
301
|
-
.magritte-field___9S8Tw_5-0-
|
|
338
|
+
.magritte-field___9S8Tw_5-0-17{
|
|
302
339
|
position:absolute;
|
|
303
340
|
inset:0;
|
|
304
341
|
background:none;
|
|
@@ -320,7 +357,7 @@
|
|
|
320
357
|
text-transform:var(--magritte-typography-label-2-regular-text-transform-v18-1-2);
|
|
321
358
|
text-decoration:var(--magritte-typography-label-2-regular-text-decoration-v18-1-2);
|
|
322
359
|
}
|
|
323
|
-
.magritte-icon___HEDsQ_5-0-
|
|
360
|
+
.magritte-icon___HEDsQ_5-0-17{
|
|
324
361
|
display:flex;
|
|
325
362
|
align-items:center;
|
|
326
363
|
position:absolute;
|
|
@@ -329,14 +366,14 @@
|
|
|
329
366
|
pointer-events:none;
|
|
330
367
|
--magritte-ui-icon-color-override:var(--magritte-color-component-input-icon-content-v18-1-2);
|
|
331
368
|
}
|
|
332
|
-
.magritte-with-icon___TPBe2_5-0-
|
|
333
|
-
.magritte-with-icon___TPBe2_5-0-
|
|
369
|
+
.magritte-with-icon___TPBe2_5-0-17 .magritte-field___9S8Tw_5-0-17,
|
|
370
|
+
.magritte-with-icon___TPBe2_5-0-17 .magritte-additional-value___9Kyap_5-0-17{
|
|
334
371
|
padding-left:calc(24px + 12px);
|
|
335
372
|
}
|
|
336
|
-
.magritte-with-icon___TPBe2_5-0-
|
|
373
|
+
.magritte-with-icon___TPBe2_5-0-17 .magritte-rigging-container___Up9Lb_5-0-17{
|
|
337
374
|
left:calc(24px + 12px);
|
|
338
375
|
}
|
|
339
|
-
.magritte-rigging-container___Up9Lb_5-0-
|
|
376
|
+
.magritte-rigging-container___Up9Lb_5-0-17{
|
|
340
377
|
display:flex;
|
|
341
378
|
align-items:center;
|
|
342
379
|
position:absolute;
|
|
@@ -344,8 +381,8 @@
|
|
|
344
381
|
inset:0;
|
|
345
382
|
pointer-events:none;
|
|
346
383
|
}
|
|
347
|
-
.magritte-label___YlOQk_5-0-
|
|
348
|
-
.magritte-fixed-placeholder___PYJIH_5-0-
|
|
384
|
+
.magritte-label___YlOQk_5-0-17,
|
|
385
|
+
.magritte-fixed-placeholder___PYJIH_5-0-17{
|
|
349
386
|
font-family:var(--magritte-typography-label-2-regular-font-family-v18-1-2);
|
|
350
387
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v18-1-2);
|
|
351
388
|
line-height:var(--magritte-typography-label-2-regular-line-height-v18-1-2);
|
|
@@ -363,11 +400,11 @@
|
|
|
363
400
|
transition-timing-function:var(--magritte-semantic-animation-ease-in-out-100-timing-function-v18-1-2);
|
|
364
401
|
color:var(--magritte-color-component-input-text-placeholder-v18-1-2);
|
|
365
402
|
}
|
|
366
|
-
.magritte-label___YlOQk_5-0-
|
|
403
|
+
.magritte-label___YlOQk_5-0-17{
|
|
367
404
|
display:block;
|
|
368
405
|
transition-property:transform, color, font-size, letter-spacing;
|
|
369
406
|
}
|
|
370
|
-
.magritte-label_elevated___PVcpC_5-0-
|
|
407
|
+
.magritte-label_elevated___PVcpC_5-0-17{
|
|
371
408
|
font-family:var(--magritte-typography-label-4-regular-font-family-v18-1-2);
|
|
372
409
|
font-weight:var(--magritte-typography-label-4-regular-font-weight-v18-1-2);
|
|
373
410
|
line-height:var(--magritte-typography-label-4-regular-line-height-v18-1-2);
|
|
@@ -379,7 +416,7 @@
|
|
|
379
416
|
color:var(--magritte-color-component-input-text-label-v18-1-2);
|
|
380
417
|
transform:translateY(calc(0px - ((var(--magritte-typography-label-4-regular-line-height-v18-1-2) + var(--magritte-typography-label-2-regular-line-height-v18-1-2)) / 2) + (var(--magritte-typography-label-4-regular-line-height-v18-1-2) / 2)));
|
|
381
418
|
}
|
|
382
|
-
.magritte-input__mask___CHda2_5-0-
|
|
419
|
+
.magritte-input__mask___CHda2_5-0-17{
|
|
383
420
|
position:absolute;
|
|
384
421
|
width:100%;
|
|
385
422
|
pointer-events:none;
|
|
@@ -389,11 +426,11 @@
|
|
|
389
426
|
text-overflow:ellipsis;
|
|
390
427
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-content-v18-1-2);
|
|
391
428
|
}
|
|
392
|
-
.magritte-value-ghost___IXNZj_5-0-
|
|
429
|
+
.magritte-value-ghost___IXNZj_5-0-17{
|
|
393
430
|
visibility:hidden;
|
|
394
431
|
white-space:pre;
|
|
395
432
|
}
|
|
396
|
-
.magritte-hint-container___rGsD8_5-0-
|
|
433
|
+
.magritte-hint-container___rGsD8_5-0-17{
|
|
397
434
|
display:flex;
|
|
398
435
|
flex-grow:1;
|
|
399
436
|
align-items:center;
|
|
@@ -401,10 +438,10 @@
|
|
|
401
438
|
gap:12px;
|
|
402
439
|
min-width:0;
|
|
403
440
|
}
|
|
404
|
-
.magritte-with-right___NUNiP_5-0-
|
|
441
|
+
.magritte-with-right___NUNiP_5-0-17 .magritte-hint-container___rGsD8_5-0-17{
|
|
405
442
|
padding-right:4px;
|
|
406
443
|
}
|
|
407
|
-
.magritte-hint___EFGK0_5-0-
|
|
444
|
+
.magritte-hint___EFGK0_5-0-17{
|
|
408
445
|
--magritte-ui-text-color-override:var(--magritte-color-component-input-text-description-v18-1-2);
|
|
409
446
|
color:var(--magritte-color-component-input-text-description-v18-1-2);
|
|
410
447
|
overflow:hidden;
|
|
@@ -412,25 +449,25 @@
|
|
|
412
449
|
text-overflow:ellipsis;
|
|
413
450
|
flex:0 1 auto;
|
|
414
451
|
}
|
|
415
|
-
.magritte-content-container___s-0kX_5-0-
|
|
452
|
+
.magritte-content-container___s-0kX_5-0-17{
|
|
416
453
|
position:relative;
|
|
417
454
|
flex:1 0 auto;
|
|
418
455
|
display:flex;
|
|
419
456
|
padding:8px 0;
|
|
420
457
|
max-width:100%;
|
|
421
458
|
}
|
|
422
|
-
.magritte-elevated___kPcsM_5-0-
|
|
459
|
+
.magritte-elevated___kPcsM_5-0-17 .magritte-content-container___s-0kX_5-0-17{
|
|
423
460
|
padding:18px 0 0;
|
|
424
461
|
}
|
|
425
|
-
.magritte-counter___Bld3Q_5-0-
|
|
462
|
+
.magritte-counter___Bld3Q_5-0-17{
|
|
426
463
|
padding:0 8px;
|
|
427
464
|
}
|
|
428
|
-
.magritte-value-container___6ReT7_5-0-
|
|
465
|
+
.magritte-value-container___6ReT7_5-0-17{
|
|
429
466
|
position:relative;
|
|
430
467
|
display:grid;
|
|
431
468
|
width:100%;
|
|
432
469
|
}
|
|
433
|
-
.magritte-additional-value___9Kyap_5-0-
|
|
470
|
+
.magritte-additional-value___9Kyap_5-0-17{
|
|
434
471
|
display:flex;
|
|
435
472
|
align-items:center;
|
|
436
473
|
grid-area:1 / 1;
|
|
@@ -440,6 +477,6 @@
|
|
|
440
477
|
color:transparent;
|
|
441
478
|
min-height:24px;
|
|
442
479
|
}
|
|
443
|
-
.magritte-elevated___kPcsM_5-0-
|
|
480
|
+
.magritte-elevated___kPcsM_5-0-17 .magritte-additional-value___9Kyap_5-0-17{
|
|
444
481
|
min-height:22px;
|
|
445
482
|
}
|
package/index.js
CHANGED
|
@@ -20,9 +20,9 @@ import 'classnames';
|
|
|
20
20
|
import '@hh.ru/magritte-common-text-selection';
|
|
21
21
|
import '@hh.ru/magritte-common-use-disabled';
|
|
22
22
|
import '@hh.ru/magritte-common-use-multiple-refs';
|
|
23
|
-
import '@hh.ru/magritte-internal-field-hint';
|
|
24
23
|
import '@hh.ru/magritte-ui-action';
|
|
25
24
|
import '@hh.ru/magritte-ui-counter';
|
|
25
|
+
import '@hh.ru/magritte-ui-form-helper';
|
|
26
26
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
27
27
|
import './useFocus.js';
|
|
28
28
|
import '@hh.ru/magritte-ui-typography';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-input",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.17",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@hh.ru/magritte-common-use-disabled": "1.0.8",
|
|
30
30
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.2",
|
|
31
31
|
"@hh.ru/magritte-design-tokens": "18.1.2",
|
|
32
|
-
"@hh.ru/magritte-
|
|
33
|
-
"@hh.ru/magritte-ui-action": "4.3.5",
|
|
32
|
+
"@hh.ru/magritte-ui-action": "4.3.6",
|
|
34
33
|
"@hh.ru/magritte-ui-breakpoint": "4.0.1",
|
|
35
34
|
"@hh.ru/magritte-ui-counter": "4.0.9",
|
|
36
|
-
"@hh.ru/magritte-ui-
|
|
35
|
+
"@hh.ru/magritte-ui-form-helper": "1.0.1",
|
|
36
|
+
"@hh.ru/magritte-ui-icon": "7.1.6",
|
|
37
37
|
"@hh.ru/magritte-ui-mock-component": "1.0.10",
|
|
38
38
|
"@hh.ru/magritte-ui-theme-provider": "1.1.22",
|
|
39
39
|
"@hh.ru/magritte-ui-typography": "3.0.9",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "77a359961872f43d688f9507b225fa72ba99a3e8"
|
|
48
48
|
}
|