@hh.ru/magritte-ui-form-label 4.2.31 → 4.3.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 +6 -3
- package/FormLabel.js.map +1 -1
- package/index.css +69 -14
- package/package.json +6 -6
- package/types.d.ts +4 -2
package/FormLabel.js
CHANGED
|
@@ -13,14 +13,14 @@ import { VSpacing } from '@hh.ru/magritte-ui-spacing';
|
|
|
13
13
|
import { Tooltip } from '@hh.ru/magritte-ui-tooltip';
|
|
14
14
|
import { Text } from '@hh.ru/magritte-ui-typography';
|
|
15
15
|
|
|
16
|
-
var styles = {"form-label":"magritte-form-label___Yzcxs_4-
|
|
16
|
+
var styles = {"form-label":"magritte-form-label___Yzcxs_4-3-0","formLabel":"magritte-form-label___Yzcxs_4-3-0","postfix":"magritte-postfix___UBcl3_4-3-0","form-label_disabled":"magritte-form-label_disabled___rq0Rq_4-3-0","formLabelDisabled":"magritte-form-label_disabled___rq0Rq_4-3-0","form-label_style-custom":"magritte-form-label_style-custom___hgmDr_4-3-0","formLabelStyleCustom":"magritte-form-label_style-custom___hgmDr_4-3-0","content":"magritte-content___o4wkg_4-3-0","icon":"magritte-icon___nwksH_4-3-0"};
|
|
17
17
|
|
|
18
18
|
const FormLabel = (props) => {
|
|
19
19
|
const disabled = useDisabled();
|
|
20
20
|
const [showBottomSheet, setShowBottomSheet] = useState(false);
|
|
21
21
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
22
22
|
const activatorRef = useRef(null);
|
|
23
|
-
const { children, info, postfix, 'data-qa': dataQa = 'form-label', ...restProps } = props;
|
|
23
|
+
const { children, info, postfix, 'data-qa': dataQa = 'form-label', style = 'default', ...restProps } = props;
|
|
24
24
|
const onClick = useCallback((event) => {
|
|
25
25
|
if (info) {
|
|
26
26
|
event.preventDefault();
|
|
@@ -49,7 +49,10 @@ const FormLabel = (props) => {
|
|
|
49
49
|
onBlur: () => setShowTooltip(false),
|
|
50
50
|
}
|
|
51
51
|
: {};
|
|
52
|
-
return (jsxs(Fragment, { children: [jsxs("label", { className: classNames(styles.formLabel, {
|
|
52
|
+
return (jsxs(Fragment, { children: [jsxs("label", { className: classNames(styles.formLabel, {
|
|
53
|
+
[styles.formLabelDisabled]: disabled,
|
|
54
|
+
[styles.formLabelStyleCustom]: style === 'custom',
|
|
55
|
+
}), "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 && (jsx("span", { "data-qa": "form-label-info-icon", className: styles.icon, ref: activatorRef, children: jsx(QuestionCircleOutlinedSize16, {}) }))] }), info && (jsxs(Fragment, { children: [jsx(Tooltip, { maxWidth: 300, visible: showTooltip, activatorRef: activatorRef, placement: "top-center", "data-qa": "form-label-tooltip", children: info }), jsxs(BottomSheet, { visible: showBottomSheet, onClose: () => {
|
|
53
56
|
setShowBottomSheet(false);
|
|
54
57
|
}, header: jsx(NavigationBar, { title: children, right: jsx(Action, { icon: CrossOutlinedSize24, onClick: () => setShowBottomSheet(false) }), showDivider: "always" }), "data-qa": "form-label-bottom-sheet", children: [jsx(Text, { typography: "label-2-regular", children: info }), jsx(VSpacing, { default: 16 })] })] }))] }));
|
|
55
58
|
};
|
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 { Action } from '@hh.ru/magritte-ui-action';\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 { VSpacing } from '@hh.ru/magritte-ui-spacing';\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
|
|
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 { Action } from '@hh.ru/magritte-ui-action';\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 { VSpacing } from '@hh.ru/magritte-ui-spacing';\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) => {\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', style = 'default', ...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, {\n [styles.formLabelDisabled]: disabled,\n [styles.formLabelStyleCustom]: style === 'custom',\n })}\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 <span data-qa=\"form-label-info-icon\" className={styles.icon} ref={activatorRef}>\n <QuestionCircleOutlinedSize16 />\n </span>\n )}\n </label>\n {info && (\n <>\n <Tooltip\n maxWidth={300}\n visible={showTooltip}\n activatorRef={activatorRef}\n placement=\"top-center\"\n data-qa=\"form-label-tooltip\"\n >\n {info}\n </Tooltip>\n <BottomSheet\n visible={showBottomSheet}\n onClose={() => {\n setShowBottomSheet(false);\n }}\n header={\n <NavigationBar\n title={children}\n right={<Action icon={CrossOutlinedSize24} onClick={() => setShowBottomSheet(false)} />}\n showDivider=\"always\"\n />\n }\n data-qa=\"form-label-bottom-sheet\"\n >\n <Text typography=\"label-2-regular\">{info}</Text>\n <VSpacing default={16} />\n </BottomSheet>\n </>\n )}\n </>\n );\n};\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;AAiBa,MAAA,SAAS,GAAuB,CAAC,KAAK,KAAI;AACnD,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG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aAAa,EACV,EAAA,KAAK,EAAE,QAAQ,EACf,KAAK,EAAEA,GAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC,KAAK,CAAC,EAAA,CAAI,EACtF,WAAW,EAAC,QAAQ,EACtB,CAAA,EAAA,SAAA,EAEE,yBAAyB,EAAA,QAAA,EAAA,CAEjCA,GAAC,CAAA,IAAI,EAAC,EAAA,UAAU,EAAC,iBAAiB,EAAE,QAAA,EAAA,IAAI,EAAQ,CAAA,EAChDA,GAAC,CAAA,QAAQ,EAAC,EAAA,OAAO,EAAE,EAAE,EAAI,CAAA,CAAA,EAAA,CACf,CACf,EAAA,CAAA,CACN,CACF,EAAA,CAAA,EACL;AACN;;;;"}
|
package/index.css
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
:root{
|
|
2
2
|
--magritte-color-stroke-state-focused-accessible-v19-0-0:#0070ff7a;
|
|
3
|
+
--magritte-color-text-primary-v19-0-0:#000000;
|
|
3
4
|
--magritte-color-text-secondary-v19-0-0:#768694;
|
|
4
5
|
--magritte-color-text-tertiary-v19-0-0:#AABBCA;
|
|
6
|
+
--magritte-color-text-state-primary-hovered-v19-0-0:#000000;
|
|
7
|
+
--magritte-color-text-state-primary-pressed-v19-0-0:#000000;
|
|
8
|
+
--magritte-color-text-state-primary-disabled-v19-0-0:#0000007a;
|
|
5
9
|
--magritte-color-text-state-secondary-hovered-v19-0-0:#768694;
|
|
6
10
|
--magritte-color-text-state-secondary-pressed-v19-0-0:#768694;
|
|
7
11
|
--magritte-color-text-state-secondary-disabled-v19-0-0:#7686947a;
|
|
8
12
|
--magritte-color-text-state-tertiary-hovered-v19-0-0:#AABBCA;
|
|
9
13
|
--magritte-color-text-state-tertiary-pressed-v19-0-0:#AABBCA;
|
|
10
14
|
--magritte-color-text-state-tertiary-disabled-v19-0-0:#aabbca7a;
|
|
15
|
+
--magritte-color-icon-primary-v19-0-0:#000000;
|
|
11
16
|
--magritte-color-icon-secondary-v19-0-0:#768694;
|
|
17
|
+
--magritte-color-icon-state-primary-hovered-v19-0-0:#000000;
|
|
18
|
+
--magritte-color-icon-state-primary-pressed-v19-0-0:#000000;
|
|
19
|
+
--magritte-color-icon-state-primary-disabled-v19-0-0:#BBC8D4;
|
|
12
20
|
--magritte-color-icon-state-secondary-hovered-v19-0-0:#20262b;
|
|
13
21
|
--magritte-color-icon-state-secondary-pressed-v19-0-0:#768694;
|
|
14
22
|
--magritte-color-icon-state-secondary-disabled-v19-0-0:#BBC8D4;
|
|
@@ -33,20 +41,28 @@
|
|
|
33
41
|
}
|
|
34
42
|
.magritte-night-theme{
|
|
35
43
|
--magritte-color-stroke-state-focused-accessible-v19-0-0:#0070ff7a;
|
|
44
|
+
--magritte-color-text-primary-v19-0-0:#ffffff;
|
|
36
45
|
--magritte-color-text-secondary-v19-0-0:#ABABAB;
|
|
37
46
|
--magritte-color-text-tertiary-v19-0-0:#767676;
|
|
47
|
+
--magritte-color-text-state-primary-hovered-v19-0-0:#ffffff;
|
|
48
|
+
--magritte-color-text-state-primary-disabled-v19-0-0:#ababab7a;
|
|
38
49
|
--magritte-color-text-state-secondary-hovered-v19-0-0:#ABABAB;
|
|
39
50
|
--magritte-color-text-state-secondary-disabled-v19-0-0:#ababab7a;
|
|
40
51
|
--magritte-color-text-state-tertiary-hovered-v19-0-0:#767676;
|
|
41
52
|
--magritte-color-text-state-tertiary-disabled-v19-0-0:#7676767a;
|
|
53
|
+
--magritte-color-text-state-primary-pressed-v19-0-0:#000000;
|
|
42
54
|
--magritte-color-text-state-secondary-pressed-v19-0-0:#768694;
|
|
43
55
|
--magritte-color-text-state-tertiary-pressed-v19-0-0:#AABBCA;
|
|
56
|
+
--magritte-color-icon-primary-v19-0-0:#ffffff;
|
|
44
57
|
--magritte-color-icon-secondary-v19-0-0:#ABABAB;
|
|
58
|
+
--magritte-color-icon-state-primary-hovered-v19-0-0:#ffffff;
|
|
59
|
+
--magritte-color-icon-state-primary-pressed-v19-0-0:#ffffff;
|
|
60
|
+
--magritte-color-icon-state-primary-disabled-v19-0-0:#767676;
|
|
45
61
|
--magritte-color-icon-state-secondary-hovered-v19-0-0:#ABABAB;
|
|
46
62
|
--magritte-color-icon-state-secondary-pressed-v19-0-0:#ABABAB;
|
|
47
63
|
--magritte-color-icon-state-secondary-disabled-v19-0-0:#767676;
|
|
48
64
|
}
|
|
49
|
-
.magritte-form-label___Yzcxs_4-
|
|
65
|
+
.magritte-form-label___Yzcxs_4-3-0{
|
|
50
66
|
font-family:var(--magritte-typography-label-2-regular-font-family-v19-0-0);
|
|
51
67
|
font-weight:var(--magritte-typography-label-2-regular-font-weight-v19-0-0);
|
|
52
68
|
line-height:var(--magritte-typography-label-2-regular-line-height-v19-0-0);
|
|
@@ -62,51 +78,90 @@
|
|
|
62
78
|
color:var(--magritte-color-text-secondary-v19-0-0);
|
|
63
79
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-secondary-v19-0-0);
|
|
64
80
|
}
|
|
65
|
-
.magritte-form-label___Yzcxs_4-
|
|
81
|
+
.magritte-form-label___Yzcxs_4-3-0 .magritte-postfix___UBcl3_4-3-0{
|
|
66
82
|
color:var(--magritte-color-text-tertiary-v19-0-0);
|
|
67
83
|
}
|
|
68
|
-
.magritte-form-label___Yzcxs_4-
|
|
84
|
+
.magritte-form-label___Yzcxs_4-3-0.focus-visible{
|
|
69
85
|
outline:var(--magritte-color-stroke-state-focused-accessible-v19-0-0) solid 4px;
|
|
70
86
|
}
|
|
71
|
-
.magritte-form-label___Yzcxs_4-
|
|
87
|
+
.magritte-form-label___Yzcxs_4-3-0:not(.magritte-form-label_disabled___rq0Rq_4-3-0):active{
|
|
72
88
|
color:var(--magritte-color-text-state-secondary-pressed-v19-0-0);
|
|
73
89
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-pressed-v19-0-0);
|
|
74
90
|
}
|
|
75
|
-
.magritte-form-label___Yzcxs_4-
|
|
91
|
+
.magritte-form-label___Yzcxs_4-3-0:not(.magritte-form-label_disabled___rq0Rq_4-3-0):active .magritte-postfix___UBcl3_4-3-0{
|
|
76
92
|
color:var(--magritte-color-text-state-tertiary-pressed-v19-0-0);
|
|
77
93
|
}
|
|
78
94
|
@media (min-width: 1020px){
|
|
79
|
-
body.magritte-old-layout .magritte-form-label___Yzcxs_4-
|
|
95
|
+
body.magritte-old-layout .magritte-form-label___Yzcxs_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active){
|
|
80
96
|
color:var(--magritte-color-text-state-secondary-hovered-v19-0-0);
|
|
81
97
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-hovered-v19-0-0);
|
|
82
98
|
}
|
|
83
|
-
body.magritte-old-layout .magritte-form-label___Yzcxs_4-
|
|
99
|
+
body.magritte-old-layout .magritte-form-label___Yzcxs_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active) .magritte-postfix___UBcl3_4-3-0{
|
|
84
100
|
color:var(--magritte-color-text-state-tertiary-hovered-v19-0-0);
|
|
85
101
|
}
|
|
86
102
|
}
|
|
87
103
|
@media (min-width: 1024px){
|
|
88
|
-
body:not(.magritte-old-layout) .magritte-form-label___Yzcxs_4-
|
|
104
|
+
body:not(.magritte-old-layout) .magritte-form-label___Yzcxs_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active){
|
|
89
105
|
color:var(--magritte-color-text-state-secondary-hovered-v19-0-0);
|
|
90
106
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-hovered-v19-0-0);
|
|
91
107
|
}
|
|
92
|
-
body:not(.magritte-old-layout) .magritte-form-label___Yzcxs_4-
|
|
108
|
+
body:not(.magritte-old-layout) .magritte-form-label___Yzcxs_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active) .magritte-postfix___UBcl3_4-3-0{
|
|
93
109
|
color:var(--magritte-color-text-state-tertiary-hovered-v19-0-0);
|
|
94
110
|
}
|
|
95
111
|
}
|
|
96
|
-
.magritte-form-label_disabled___rq0Rq_4-
|
|
112
|
+
.magritte-form-label_disabled___rq0Rq_4-3-0{
|
|
97
113
|
color:var(--magritte-color-text-state-secondary-disabled-v19-0-0);
|
|
98
114
|
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-secondary-disabled-v19-0-0);
|
|
99
115
|
}
|
|
100
|
-
.magritte-form-label_disabled___rq0Rq_4-
|
|
116
|
+
.magritte-form-label_disabled___rq0Rq_4-3-0 .magritte-postfix___UBcl3_4-3-0{
|
|
101
117
|
color:var(--magritte-color-text-state-tertiary-disabled-v19-0-0);
|
|
102
118
|
}
|
|
103
|
-
.magritte-
|
|
119
|
+
.magritte-form-label_style-custom___hgmDr_4-3-0{
|
|
120
|
+
color:var(--magritte-color-text-primary-v19-0-0);
|
|
121
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-primary-v19-0-0);
|
|
122
|
+
}
|
|
123
|
+
.magritte-form-label_style-custom___hgmDr_4-3-0 .magritte-postfix___UBcl3_4-3-0{
|
|
124
|
+
color:var(--magritte-color-text-secondary-v19-0-0);
|
|
125
|
+
}
|
|
126
|
+
.magritte-form-label_style-custom___hgmDr_4-3-0:not(.magritte-form-label_disabled___rq0Rq_4-3-0):active{
|
|
127
|
+
color:var(--magritte-color-text-state-primary-pressed-v19-0-0);
|
|
128
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-primary-pressed-v19-0-0);
|
|
129
|
+
}
|
|
130
|
+
.magritte-form-label_style-custom___hgmDr_4-3-0:not(.magritte-form-label_disabled___rq0Rq_4-3-0):active .magritte-postfix___UBcl3_4-3-0{
|
|
131
|
+
color:var(--magritte-color-text-state-secondary-pressed-v19-0-0);
|
|
132
|
+
}
|
|
133
|
+
@media (min-width: 1020px){
|
|
134
|
+
body.magritte-old-layout .magritte-form-label_style-custom___hgmDr_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active){
|
|
135
|
+
color:var(--magritte-color-text-state-primary-hovered-v19-0-0);
|
|
136
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-primary-hovered-v19-0-0);
|
|
137
|
+
}
|
|
138
|
+
body.magritte-old-layout .magritte-form-label_style-custom___hgmDr_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active) .magritte-postfix___UBcl3_4-3-0{
|
|
139
|
+
color:var(--magritte-color-text-state-secondary-hovered-v19-0-0);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
@media (min-width: 1024px){
|
|
143
|
+
body:not(.magritte-old-layout) .magritte-form-label_style-custom___hgmDr_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active){
|
|
144
|
+
color:var(--magritte-color-text-state-primary-hovered-v19-0-0);
|
|
145
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-primary-hovered-v19-0-0);
|
|
146
|
+
}
|
|
147
|
+
body:not(.magritte-old-layout) .magritte-form-label_style-custom___hgmDr_4-3-0:hover:not(.magritte-form-label_disabled___rq0Rq_4-3-0):not(:active) .magritte-postfix___UBcl3_4-3-0{
|
|
148
|
+
color:var(--magritte-color-text-state-secondary-hovered-v19-0-0);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
.magritte-form-label_style-custom___hgmDr_4-3-0.magritte-form-label_disabled___rq0Rq_4-3-0{
|
|
152
|
+
color:var(--magritte-color-text-state-primary-disabled-v19-0-0);
|
|
153
|
+
--magritte-ui-icon-color-override:var(--magritte-color-icon-state-primary-disabled-v19-0-0);
|
|
154
|
+
}
|
|
155
|
+
.magritte-form-label_style-custom___hgmDr_4-3-0.magritte-form-label_disabled___rq0Rq_4-3-0 .magritte-postfix___UBcl3_4-3-0{
|
|
156
|
+
color:var(--magritte-color-text-state-secondary-disabled-v19-0-0);
|
|
157
|
+
}
|
|
158
|
+
.magritte-content___o4wkg_4-3-0{
|
|
104
159
|
flex:0 1 auto;
|
|
105
160
|
min-width:0;
|
|
106
161
|
overflow:hidden;
|
|
107
162
|
text-overflow:ellipsis;
|
|
108
163
|
}
|
|
109
|
-
.magritte-postfix___UBcl3_4-
|
|
164
|
+
.magritte-postfix___UBcl3_4-3-0{
|
|
110
165
|
font-family:var(--magritte-typography-subtitle-1-semibold-font-family-v19-0-0);
|
|
111
166
|
font-weight:var(--magritte-typography-subtitle-1-semibold-font-weight-v19-0-0);
|
|
112
167
|
line-height:var(--magritte-typography-subtitle-1-semibold-line-height-v19-0-0);
|
|
@@ -121,7 +176,7 @@
|
|
|
121
176
|
text-overflow:ellipsis;
|
|
122
177
|
white-space:nowrap;
|
|
123
178
|
}
|
|
124
|
-
.magritte-icon___nwksH_4-
|
|
179
|
+
.magritte-icon___nwksH_4-3-0{
|
|
125
180
|
display:inline-flex;
|
|
126
181
|
align-items:center;
|
|
127
182
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-form-label",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"@hh.ru/magritte-common-use-disabled": "1.0.9",
|
|
26
26
|
"@hh.ru/magritte-design-tokens": "19.0.0",
|
|
27
27
|
"@hh.ru/magritte-types": "4.0.2",
|
|
28
|
-
"@hh.ru/magritte-ui-action": "4.4.
|
|
29
|
-
"@hh.ru/magritte-ui-bottom-sheet": "5.3.
|
|
28
|
+
"@hh.ru/magritte-ui-action": "4.4.4",
|
|
29
|
+
"@hh.ru/magritte-ui-bottom-sheet": "5.3.17",
|
|
30
30
|
"@hh.ru/magritte-ui-breakpoint": "4.0.3",
|
|
31
31
|
"@hh.ru/magritte-ui-icon": "7.5.3",
|
|
32
32
|
"@hh.ru/magritte-ui-mock-component": "1.0.11",
|
|
33
|
-
"@hh.ru/magritte-ui-navigation-bar": "6.0.
|
|
33
|
+
"@hh.ru/magritte-ui-navigation-bar": "6.0.5",
|
|
34
34
|
"@hh.ru/magritte-ui-spacing": "2.0.28",
|
|
35
35
|
"@hh.ru/magritte-ui-theme-provider": "1.1.28",
|
|
36
|
-
"@hh.ru/magritte-ui-tooltip": "7.0.
|
|
36
|
+
"@hh.ru/magritte-ui-tooltip": "7.0.15",
|
|
37
37
|
"@hh.ru/magritte-ui-typography": "3.0.15"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "fa497921302bf8da94de54c0fb2d1efe3a197667"
|
|
47
47
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { LabelHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
/** Текст подсказки */
|
|
2
|
+
interface FormLabelBaseProps {
|
|
4
3
|
info?: ReactNode;
|
|
5
4
|
/** Постфикс */
|
|
6
5
|
postfix?: string;
|
|
7
6
|
'data-qa'?: string;
|
|
7
|
+
style?: 'default' | 'custom';
|
|
8
8
|
}
|
|
9
|
+
export type FormLabelProps = FormLabelBaseProps & Omit<LabelHTMLAttributes<HTMLLabelElement>, keyof FormLabelBaseProps>;
|
|
10
|
+
export {};
|