@hh.ru/magritte-ui-form-label 3.3.5 → 4.0.0
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/FormLabel.js +3 -6
- package/FormLabel.js.map +1 -1
- package/index.css +103 -60
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +10 -11
- package/types.d.ts +2 -2
package/FormLabel.js
CHANGED
|
@@ -6,20 +6,19 @@ import '@hh.ru/magritte-common-focus-visible';
|
|
|
6
6
|
import { keyboardMatches, keyboardKeys } from '@hh.ru/magritte-common-keyboard';
|
|
7
7
|
import { useDisabled } from '@hh.ru/magritte-common-use-disabled';
|
|
8
8
|
import { BottomSheet } from '@hh.ru/magritte-ui-bottom-sheet';
|
|
9
|
-
import { Counter } from '@hh.ru/magritte-ui-counter';
|
|
10
9
|
import { QuestionCircleOutlinedSize16, CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';
|
|
11
10
|
import { NavigationBar } from '@hh.ru/magritte-ui-navigation-bar';
|
|
12
11
|
import { Tooltip } from '@hh.ru/magritte-ui-tooltip';
|
|
13
12
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
14
13
|
|
|
15
|
-
var styles = {"form-label":"magritte-form-
|
|
14
|
+
var styles = {"form-label":"magritte-form-label___Yzcxs_4-0-0","formLabel":"magritte-form-label___Yzcxs_4-0-0","postfix":"magritte-postfix___UBcl3_4-0-0","form-label_disabled":"magritte-form-label_disabled___rq0Rq_4-0-0","formLabelDisabled":"magritte-form-label_disabled___rq0Rq_4-0-0","content":"magritte-content___o4wkg_4-0-0","icon":"magritte-icon___nwksH_4-0-0"};
|
|
16
15
|
|
|
17
16
|
const FormLabel = (props) => {
|
|
18
17
|
const disabled = useDisabled();
|
|
19
18
|
const [showBottomSheet, setShowBottomSheet] = useState(false);
|
|
20
19
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
21
20
|
const activatorRef = useRef(null);
|
|
22
|
-
const { children, info,
|
|
21
|
+
const { children, info, postfix, 'data-qa': dataQa = 'form-label', ...restProps } = props;
|
|
23
22
|
const onClick = useCallback((event) => {
|
|
24
23
|
if (info) {
|
|
25
24
|
event.preventDefault();
|
|
@@ -48,9 +47,7 @@ const FormLabel = (props) => {
|
|
|
48
47
|
onBlur: () => setShowTooltip(false),
|
|
49
48
|
}
|
|
50
49
|
: {};
|
|
51
|
-
return (jsxs(Fragment, { children: [jsxs("label", { className: classNames(styles[
|
|
52
|
-
[styles[`form-label_disabled`]]: disabled,
|
|
53
|
-
}), "data-qa": dataQa, ...propsForInfo, ...restProps, children: [children, !!counter && (jsx("span", { className: styles['form-label__counter'], children: jsx(Counter, { label: counter, style: "attention", mode: "secondary", size: "medium", "data-qa": "form-label-counter" }) })), info && (jsxs(Fragment, { children: [jsx("span", { "data-qa": "form-label-info-icon", className: styles['form-label__icon'], ref: activatorRef, children: jsx(QuestionCircleOutlinedSize16, {}) }), jsx(Tooltip, { maxWidth: 300, visible: showTooltip, activatorRef: activatorRef, alignment: "center", direction: "top", "data-qa": "form-label-tooltip", children: info })] }))] }), info && (jsx(BottomSheet, { visible: showBottomSheet, onClose: () => {
|
|
50
|
+
return (jsxs(Fragment, { children: [jsxs("label", { className: classNames(styles.formLabel, { [styles.formLabelDisabled]: disabled }), "data-qa": dataQa, ...propsForInfo, ...restProps, children: [jsx("span", { className: styles.content, children: children }), postfix && (jsx("span", { className: styles.postfix, "data-qa": "form-label-postfix", children: postfix })), info && (jsxs(Fragment, { children: [jsx("span", { "data-qa": "form-label-info-icon", className: styles.icon, ref: activatorRef, children: jsx(QuestionCircleOutlinedSize16, {}) }), jsx(Tooltip, { maxWidth: 300, visible: showTooltip, activatorRef: activatorRef, alignment: "center", direction: "top", "data-qa": "form-label-tooltip", children: info })] }))] }), info && (jsx(BottomSheet, { visible: showBottomSheet, onClose: () => {
|
|
54
51
|
setShowBottomSheet(false);
|
|
55
52
|
}, header: jsx(NavigationBar, { title: children, right: {
|
|
56
53
|
icon: CrossOutlinedSize24,
|
package/FormLabel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLabel.js","sources":["../src/FormLabel.tsx"],"sourcesContent":["import { FC, useCallback, KeyboardEvent, MouseEvent, useState, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport '@hh.ru/magritte-common-focus-visible';\nimport { keyboardMatches, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { BottomSheet } from '@hh.ru/magritte-ui-bottom-sheet';\nimport {
|
|
1
|
+
{"version":3,"file":"FormLabel.js","sources":["../src/FormLabel.tsx"],"sourcesContent":["import { FC, useCallback, KeyboardEvent, MouseEvent, useState, useRef } from 'react';\nimport classNames from 'classnames';\n\nimport '@hh.ru/magritte-common-focus-visible';\nimport { keyboardMatches, keyboardKeys } from '@hh.ru/magritte-common-keyboard';\nimport { useDisabled } from '@hh.ru/magritte-common-use-disabled';\nimport { BottomSheet } from '@hh.ru/magritte-ui-bottom-sheet';\nimport { FormLabelProps } from '@hh.ru/magritte-ui-form-label/types';\nimport { QuestionCircleOutlinedSize16, CrossOutlinedSize24 } from '@hh.ru/magritte-ui-icon/icon';\nimport { NavigationBar } from '@hh.ru/magritte-ui-navigation-bar';\nimport { Tooltip } from '@hh.ru/magritte-ui-tooltip';\nimport { Text } from '@hh.ru/magritte-ui-typography';\n\nimport styles from './form-label.less';\n\nexport const FormLabel: FC<FormLabelProps> = (props: FormLabelProps) => {\n const disabled = useDisabled();\n const [showBottomSheet, setShowBottomSheet] = useState<boolean>(false);\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\n const activatorRef = useRef<HTMLSpanElement | null>(null);\n\n const { children, info, postfix, 'data-qa': dataQa = 'form-label', ...restProps } = props;\n\n const onClick = useCallback(\n (event: MouseEvent) => {\n if (info) {\n event.preventDefault();\n }\n\n if (!disabled) {\n setShowBottomSheet(true);\n }\n },\n [disabled, info]\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLLabelElement>) => {\n if (disabled || !onClick) {\n return;\n }\n\n if (keyboardMatches(event.nativeEvent, [keyboardKeys.Enter, keyboardKeys.Space])) {\n onClick(event as unknown as MouseEvent<HTMLLabelElement>);\n }\n },\n [onClick, disabled]\n );\n\n const propsForInfo = info\n ? {\n tabIndex: disabled ? -1 : 0,\n role: 'button',\n onKeyDown,\n onClick,\n onMouseEnter: () => setShowTooltip(true),\n onMouseLeave: () => setShowTooltip(false),\n onFocus: () => setShowTooltip(true),\n onBlur: () => setShowTooltip(false),\n }\n : {};\n\n return (\n <>\n <label\n className={classNames(styles.formLabel, { [styles.formLabelDisabled]: disabled })}\n data-qa={dataQa}\n {...propsForInfo}\n {...restProps}\n >\n <span className={styles.content}>{children}</span>\n {postfix && (\n <span className={styles.postfix} data-qa=\"form-label-postfix\">\n {postfix}\n </span>\n )}\n {info && (\n <>\n <span data-qa=\"form-label-info-icon\" className={styles.icon} ref={activatorRef}>\n <QuestionCircleOutlinedSize16 />\n </span>\n <Tooltip\n maxWidth={300}\n visible={showTooltip}\n activatorRef={activatorRef}\n alignment=\"center\"\n direction=\"top\"\n data-qa=\"form-label-tooltip\"\n >\n {info}\n </Tooltip>\n </>\n )}\n </label>\n {info && (\n <BottomSheet\n visible={showBottomSheet}\n onClose={() => {\n setShowBottomSheet(false);\n }}\n header={\n <NavigationBar\n title={children}\n right={{\n icon: CrossOutlinedSize24,\n onClick: () => {\n setShowBottomSheet(false);\n },\n }}\n showDivider\n />\n }\n data-qa=\"form-label-bottom-sheet\"\n >\n <Text typography=\"label-2-regular\">{info}</Text>\n </BottomSheet>\n )}\n </>\n );\n};\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;AAea,MAAA,SAAS,GAAuB,CAAC,KAAqB,KAAI;AACnE,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QA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BAAkB,CAAC,KAAK,CAAC,CAAC;iBAC7B,EACD,MAAM,EACFA,GAAC,CAAA,aAAa,EACV,EAAA,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE;AACH,wBAAA,IAAI,EAAE,mBAAmB;wBACzB,OAAO,EAAE,MAAK;4BACV,kBAAkB,CAAC,KAAK,CAAC,CAAC;yBAC7B;AACJ,qBAAA,EACD,WAAW,EACb,IAAA,EAAA,CAAA,EAAA,SAAA,EAEE,yBAAyB,EAEjC,QAAA,EAAAA,GAAA,CAAC,IAAI,EAAC,EAAA,UAAU,EAAC,iBAAiB,YAAE,IAAI,EAAA,CAAQ,GACtC,CACjB,CAAA,EAAA,CACF,EACL;AACN;;;;"}
|
package/index.css
CHANGED
|
@@ -1,85 +1,128 @@
|
|
|
1
1
|
:root{
|
|
2
|
-
--magritte-color-
|
|
3
|
-
--magritte-color-
|
|
4
|
-
--magritte-color-
|
|
5
|
-
--magritte-color-
|
|
6
|
-
--magritte-color-
|
|
7
|
-
--magritte-color-
|
|
8
|
-
--magritte-color-
|
|
9
|
-
--magritte-color-
|
|
10
|
-
--magritte-color-
|
|
11
|
-
--magritte-color-
|
|
12
|
-
--magritte-color-
|
|
2
|
+
--magritte-color-stroke-state-focused-accessible-v18-2-0:#0070ff7a;
|
|
3
|
+
--magritte-color-text-secondary-v18-2-0:#768694;
|
|
4
|
+
--magritte-color-text-tertiary-v18-2-0:#AABBCA;
|
|
5
|
+
--magritte-color-text-state-secondary-hovered-v18-2-0:#768694;
|
|
6
|
+
--magritte-color-text-state-secondary-pressed-v18-2-0:#768694;
|
|
7
|
+
--magritte-color-text-state-secondary-disabled-v18-2-0:#7686947a;
|
|
8
|
+
--magritte-color-text-state-tertiary-hovered-v18-2-0:#AABBCA;
|
|
9
|
+
--magritte-color-text-state-tertiary-pressed-v18-2-0:#AABBCA;
|
|
10
|
+
--magritte-color-text-state-tertiary-disabled-v18-2-0:#aabbca7a;
|
|
11
|
+
--magritte-color-icon-secondary-v18-2-0:#768694;
|
|
12
|
+
--magritte-color-icon-state-secondary-hovered-v18-2-0:#20262b;
|
|
13
|
+
--magritte-color-icon-state-secondary-pressed-v18-2-0:#768694;
|
|
14
|
+
--magritte-color-icon-state-secondary-disabled-v18-2-0:#BBC8D4;
|
|
13
15
|
}
|
|
14
16
|
:root{
|
|
15
|
-
--magritte-typography-
|
|
16
|
-
--magritte-typography-
|
|
17
|
-
--magritte-typography-
|
|
18
|
-
--magritte-typography-
|
|
19
|
-
--magritte-typography-
|
|
20
|
-
--magritte-typography-
|
|
21
|
-
--magritte-typography-
|
|
22
|
-
--magritte-typography-
|
|
17
|
+
--magritte-typography-subtitle-1-semibold-font-family-v18-2-0:"Inter";
|
|
18
|
+
--magritte-typography-subtitle-1-semibold-font-weight-v18-2-0:600;
|
|
19
|
+
--magritte-typography-subtitle-1-semibold-line-height-v18-2-0:22px;
|
|
20
|
+
--magritte-typography-subtitle-1-semibold-font-size-v18-2-0:16px;
|
|
21
|
+
--magritte-typography-subtitle-1-semibold-letter-spacing-v18-2-0:0em;
|
|
22
|
+
--magritte-typography-subtitle-1-semibold-text-indent-v18-2-0:0px;
|
|
23
|
+
--magritte-typography-subtitle-1-semibold-text-transform-v18-2-0:none;
|
|
24
|
+
--magritte-typography-subtitle-1-semibold-text-decoration-v18-2-0:none;
|
|
25
|
+
--magritte-typography-label-2-regular-font-family-v18-2-0:"Inter";
|
|
26
|
+
--magritte-typography-label-2-regular-font-weight-v18-2-0:400;
|
|
27
|
+
--magritte-typography-label-2-regular-line-height-v18-2-0:22px;
|
|
28
|
+
--magritte-typography-label-2-regular-font-size-v18-2-0:16px;
|
|
29
|
+
--magritte-typography-label-2-regular-letter-spacing-v18-2-0:0em;
|
|
30
|
+
--magritte-typography-label-2-regular-text-indent-v18-2-0:0px;
|
|
31
|
+
--magritte-typography-label-2-regular-text-transform-v18-2-0:none;
|
|
32
|
+
--magritte-typography-label-2-regular-text-decoration-v18-2-0:none;
|
|
23
33
|
}
|
|
24
34
|
.magritte-night-theme{
|
|
25
|
-
--magritte-color-
|
|
26
|
-
--magritte-color-
|
|
27
|
-
--magritte-color-
|
|
28
|
-
--magritte-color-
|
|
29
|
-
--magritte-color-
|
|
30
|
-
--magritte-color-
|
|
31
|
-
--magritte-color-
|
|
32
|
-
--magritte-color-
|
|
33
|
-
--magritte-color-
|
|
34
|
-
--magritte-color-
|
|
35
|
-
--magritte-color-
|
|
35
|
+
--magritte-color-stroke-state-focused-accessible-v18-2-0:#0070ff7a;
|
|
36
|
+
--magritte-color-text-secondary-v18-2-0:#ABABAB;
|
|
37
|
+
--magritte-color-text-tertiary-v18-2-0:#767676;
|
|
38
|
+
--magritte-color-text-state-secondary-hovered-v18-2-0:#ABABAB;
|
|
39
|
+
--magritte-color-text-state-secondary-disabled-v18-2-0:#ababab7a;
|
|
40
|
+
--magritte-color-text-state-tertiary-hovered-v18-2-0:#767676;
|
|
41
|
+
--magritte-color-text-state-tertiary-disabled-v18-2-0:#7676767a;
|
|
42
|
+
--magritte-color-text-state-secondary-pressed-v18-2-0:#768694;
|
|
43
|
+
--magritte-color-text-state-tertiary-pressed-v18-2-0:#AABBCA;
|
|
44
|
+
--magritte-color-icon-secondary-v18-2-0:#ABABAB;
|
|
45
|
+
--magritte-color-icon-state-secondary-hovered-v18-2-0:#ABABAB;
|
|
46
|
+
--magritte-color-icon-state-secondary-pressed-v18-2-0:#ABABAB;
|
|
47
|
+
--magritte-color-icon-state-secondary-disabled-v18-2-0:#767676;
|
|
36
48
|
}
|
|
37
|
-
.magritte-form-
|
|
38
|
-
font-family:var(--magritte-typography-label-2-regular-font-family-v18-
|
|
39
|
-
font-weight:var(--magritte-typography-label-2-regular-font-weight-v18-
|
|
40
|
-
line-height:var(--magritte-typography-label-2-regular-line-height-v18-
|
|
41
|
-
font-size:var(--magritte-typography-label-2-regular-font-size-v18-
|
|
42
|
-
letter-spacing:var(--magritte-typography-label-2-regular-letter-spacing-v18-
|
|
43
|
-
text-indent:var(--magritte-typography-label-2-regular-text-indent-v18-
|
|
44
|
-
text-transform:var(--magritte-typography-label-2-regular-text-transform-v18-
|
|
45
|
-
text-decoration:var(--magritte-typography-label-2-regular-text-decoration-v18-
|
|
49
|
+
.magritte-form-label___Yzcxs_4-0-0{
|
|
50
|
+
font-family:var(--magritte-typography-label-2-regular-font-family-v18-2-0);
|
|
51
|
+
font-weight:var(--magritte-typography-label-2-regular-font-weight-v18-2-0);
|
|
52
|
+
line-height:var(--magritte-typography-label-2-regular-line-height-v18-2-0);
|
|
53
|
+
font-size:var(--magritte-typography-label-2-regular-font-size-v18-2-0);
|
|
54
|
+
letter-spacing:var(--magritte-typography-label-2-regular-letter-spacing-v18-2-0);
|
|
55
|
+
text-indent:var(--magritte-typography-label-2-regular-text-indent-v18-2-0);
|
|
56
|
+
text-transform:var(--magritte-typography-label-2-regular-text-transform-v18-2-0);
|
|
57
|
+
text-decoration:var(--magritte-typography-label-2-regular-text-decoration-v18-2-0);
|
|
46
58
|
display:inline-flex;
|
|
47
59
|
gap:6px;
|
|
48
60
|
align-items:center;
|
|
49
61
|
border-radius:50vh;
|
|
50
|
-
color:var(--magritte-color-
|
|
51
|
-
--magritte-ui-icon-color-override:var(--magritte-color-
|
|
62
|
+
color:var(--magritte-color-text-secondary-v18-2-0);
|
|
63
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-secondary-v18-2-0);
|
|
52
64
|
}
|
|
53
|
-
.magritte-form-
|
|
54
|
-
|
|
65
|
+
.magritte-form-label___Yzcxs_4-0-0 .magritte-postfix___UBcl3_4-0-0{
|
|
66
|
+
color:var(--magritte-color-text-tertiary-v18-2-0);
|
|
55
67
|
}
|
|
56
|
-
.magritte-form-
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
.magritte-form-label___Yzcxs_4-0-0.focus-visible{
|
|
69
|
+
outline:var(--magritte-color-stroke-state-focused-accessible-v18-2-0) solid 4px;
|
|
70
|
+
}
|
|
71
|
+
.magritte-form-label___Yzcxs_4-0-0:not(.magritte-form-label_disabled___rq0Rq_4-0-0):active{
|
|
72
|
+
color:var(--magritte-color-text-state-secondary-pressed-v18-2-0);
|
|
73
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-pressed-v18-2-0);
|
|
74
|
+
}
|
|
75
|
+
.magritte-form-label___Yzcxs_4-0-0:not(.magritte-form-label_disabled___rq0Rq_4-0-0):active .magritte-postfix___UBcl3_4-0-0{
|
|
76
|
+
color:var(--magritte-color-text-state-tertiary-pressed-v18-2-0);
|
|
59
77
|
}
|
|
60
78
|
@media (min-width: 1020px){
|
|
61
|
-
body.magritte-old-layout .magritte-form-
|
|
62
|
-
color:var(--magritte-color-
|
|
63
|
-
--magritte-ui-icon-color-override:var(--magritte-color-
|
|
79
|
+
body.magritte-old-layout .magritte-form-label___Yzcxs_4-0-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-0-0):not(:active){
|
|
80
|
+
color:var(--magritte-color-text-state-secondary-hovered-v18-2-0);
|
|
81
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-hovered-v18-2-0);
|
|
82
|
+
}
|
|
83
|
+
body.magritte-old-layout .magritte-form-label___Yzcxs_4-0-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-0-0):not(:active) .magritte-postfix___UBcl3_4-0-0{
|
|
84
|
+
color:var(--magritte-color-text-state-tertiary-hovered-v18-2-0);
|
|
64
85
|
}
|
|
65
86
|
}
|
|
66
87
|
@media (min-width: 1024px){
|
|
67
|
-
body:not(.magritte-old-layout) .magritte-form-
|
|
68
|
-
color:var(--magritte-color-
|
|
69
|
-
--magritte-ui-icon-color-override:var(--magritte-color-
|
|
88
|
+
body:not(.magritte-old-layout) .magritte-form-label___Yzcxs_4-0-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-0-0):not(:active){
|
|
89
|
+
color:var(--magritte-color-text-state-secondary-hovered-v18-2-0);
|
|
90
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-hovered-v18-2-0);
|
|
70
91
|
}
|
|
92
|
+
body:not(.magritte-old-layout) .magritte-form-label___Yzcxs_4-0-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-0-0):not(:active) .magritte-postfix___UBcl3_4-0-0{
|
|
93
|
+
color:var(--magritte-color-text-state-tertiary-hovered-v18-2-0);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.magritte-form-label_disabled___rq0Rq_4-0-0{
|
|
97
|
+
color:var(--magritte-color-text-state-secondary-disabled-v18-2-0);
|
|
98
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-disabled-v18-2-0);
|
|
71
99
|
}
|
|
72
|
-
.magritte-form-
|
|
73
|
-
|
|
100
|
+
.magritte-form-label_disabled___rq0Rq_4-0-0 .magritte-postfix___UBcl3_4-0-0{
|
|
101
|
+
color:var(--magritte-color-text-state-tertiary-disabled-v18-2-0);
|
|
74
102
|
}
|
|
75
|
-
.magritte-
|
|
76
|
-
|
|
77
|
-
|
|
103
|
+
.magritte-content___o4wkg_4-0-0{
|
|
104
|
+
flex:0 1 auto;
|
|
105
|
+
min-width:0;
|
|
106
|
+
overflow:hidden;
|
|
107
|
+
text-overflow:ellipsis;
|
|
108
|
+
white-space:nowrap;
|
|
78
109
|
}
|
|
79
|
-
.magritte-
|
|
80
|
-
|
|
110
|
+
.magritte-postfix___UBcl3_4-0-0{
|
|
111
|
+
font-family:var(--magritte-typography-subtitle-1-semibold-font-family-v18-2-0);
|
|
112
|
+
font-weight:var(--magritte-typography-subtitle-1-semibold-font-weight-v18-2-0);
|
|
113
|
+
line-height:var(--magritte-typography-subtitle-1-semibold-line-height-v18-2-0);
|
|
114
|
+
font-size:var(--magritte-typography-subtitle-1-semibold-font-size-v18-2-0);
|
|
115
|
+
letter-spacing:var(--magritte-typography-subtitle-1-semibold-letter-spacing-v18-2-0);
|
|
116
|
+
text-indent:var(--magritte-typography-subtitle-1-semibold-text-indent-v18-2-0);
|
|
117
|
+
text-transform:var(--magritte-typography-subtitle-1-semibold-text-transform-v18-2-0);
|
|
118
|
+
text-decoration:var(--magritte-typography-subtitle-1-semibold-text-decoration-v18-2-0);
|
|
119
|
+
flex:0 0 auto;
|
|
120
|
+
max-width:100%;
|
|
121
|
+
overflow:hidden;
|
|
122
|
+
text-overflow:ellipsis;
|
|
123
|
+
white-space:nowrap;
|
|
81
124
|
}
|
|
82
|
-
.magritte-
|
|
125
|
+
.magritte-icon___nwksH_4-0-0{
|
|
83
126
|
display:inline-flex;
|
|
84
127
|
align-items:center;
|
|
85
128
|
}
|
package/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import '@hh.ru/magritte-common-focus-visible';
|
|
|
8
8
|
import '@hh.ru/magritte-common-keyboard';
|
|
9
9
|
import '@hh.ru/magritte-common-use-disabled';
|
|
10
10
|
import '@hh.ru/magritte-ui-bottom-sheet';
|
|
11
|
-
import '@hh.ru/magritte-ui-counter';
|
|
12
11
|
import '@hh.ru/magritte-ui-icon/icon';
|
|
13
12
|
import '@hh.ru/magritte-ui-navigation-bar';
|
|
14
13
|
import '@hh.ru/magritte-ui-tooltip';
|
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-form-label",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -22,18 +22,17 @@
|
|
|
22
22
|
"@hh.ru/magritte-common-focus-visible": "0.1.3",
|
|
23
23
|
"@hh.ru/magritte-common-keyboard": "4.0.0",
|
|
24
24
|
"@hh.ru/magritte-common-use-disabled": "1.0.8",
|
|
25
|
-
"@hh.ru/magritte-design-tokens": "18.
|
|
25
|
+
"@hh.ru/magritte-design-tokens": "18.2.0",
|
|
26
26
|
"@hh.ru/magritte-types": "4.0.1",
|
|
27
|
-
"@hh.ru/magritte-ui-action": "4.3.
|
|
28
|
-
"@hh.ru/magritte-ui-bottom-sheet": "4.1.
|
|
27
|
+
"@hh.ru/magritte-ui-action": "4.3.9",
|
|
28
|
+
"@hh.ru/magritte-ui-bottom-sheet": "4.1.30",
|
|
29
29
|
"@hh.ru/magritte-ui-breakpoint": "4.0.2",
|
|
30
|
-
"@hh.ru/magritte-ui-
|
|
31
|
-
"@hh.ru/magritte-ui-icon": "7.1.7",
|
|
30
|
+
"@hh.ru/magritte-ui-icon": "7.1.8",
|
|
32
31
|
"@hh.ru/magritte-ui-mock-component": "1.0.10",
|
|
33
|
-
"@hh.ru/magritte-ui-navigation-bar": "4.1.
|
|
34
|
-
"@hh.ru/magritte-ui-theme-provider": "1.1.
|
|
35
|
-
"@hh.ru/magritte-ui-tooltip": "6.1.
|
|
36
|
-
"@hh.ru/magritte-ui-typography": "3.0.
|
|
32
|
+
"@hh.ru/magritte-ui-navigation-bar": "4.1.15",
|
|
33
|
+
"@hh.ru/magritte-ui-theme-provider": "1.1.24",
|
|
34
|
+
"@hh.ru/magritte-ui-tooltip": "6.1.6",
|
|
35
|
+
"@hh.ru/magritte-ui-typography": "3.0.11"
|
|
37
36
|
},
|
|
38
37
|
"peerDependencies": {
|
|
39
38
|
"classnames": ">=2.3.2",
|
|
@@ -42,5 +41,5 @@
|
|
|
42
41
|
"publishConfig": {
|
|
43
42
|
"access": "public"
|
|
44
43
|
},
|
|
45
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "2096654db9454114e1dbf70e7a7786d7e5b688b8"
|
|
46
45
|
}
|
package/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LabelHTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
export interface FormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
3
3
|
/** Текст подсказки */
|
|
4
4
|
info?: ReactNode;
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/** Постфикс */
|
|
6
|
+
postfix?: string;
|
|
7
7
|
'data-qa'?: string;
|
|
8
8
|
}
|