@megafon/ui-core 2.4.0 → 3.0.0-beta.10
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/CHANGELOG.md +154 -7
- package/dist/es/colors/ColorItem/ColorItem.css +1 -8
- package/dist/es/colors/ColorItem/ColorItem.js +1 -1
- package/dist/es/colors/Colors.css +3 -11
- package/dist/es/colors/Colors.d.ts +2 -2
- package/dist/es/colors/Colors.js +64 -4
- package/dist/es/colors/colorsData.js +78 -71
- package/dist/es/components/Accordion/Accordion.css +7 -27
- package/dist/es/components/Accordion/Accordion.d.ts +12 -7
- package/dist/es/components/Accordion/Accordion.js +25 -20
- package/dist/es/components/Banner/Banner.css +2 -37
- package/dist/es/components/Banner/Banner.d.ts +10 -2
- package/dist/es/components/Banner/Banner.js +35 -26
- package/dist/es/components/Banner/BannerDot.css +4 -11
- package/dist/es/components/Banner/BannerDot.d.ts +3 -0
- package/dist/es/components/Banner/BannerDot.js +8 -3
- package/dist/es/components/Button/Button.css +83 -74
- package/dist/es/components/Button/Button.d.ts +8 -2
- package/dist/es/components/Button/Button.js +16 -8
- package/dist/es/components/Calendar/Calendar.css +0 -7
- package/dist/es/components/Calendar/Calendar.js +2 -3
- package/dist/es/components/Calendar/components/Day/Day.css +10 -17
- package/dist/es/components/Calendar/components/Day/Day.js +1 -1
- package/dist/es/components/Calendar/components/Month/Month.css +3 -10
- package/dist/es/components/Calendar/components/Month/Month.js +21 -5
- package/dist/es/components/Carousel/Carousel.css +4 -11
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +28 -25
- package/dist/es/components/Checkbox/Checkbox.css +18 -25
- package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/es/components/Checkbox/Checkbox.js +77 -90
- package/dist/es/components/Collapse/Collapse.d.ts +15 -3
- package/dist/es/components/Collapse/Collapse.js +11 -4
- package/dist/es/components/ContentArea/ContentArea.css +18 -28
- package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/es/components/ContentArea/ContentArea.js +5 -39
- package/dist/es/components/Counter/Counter.css +14 -11
- package/dist/es/components/Counter/Counter.js +3 -3
- package/dist/es/components/Grid/GridColumn.css +0 -7
- package/dist/es/components/Header/Header.css +8 -12
- package/dist/es/components/Header/Header.d.ts +7 -21
- package/dist/es/components/Header/Header.js +31 -67
- package/dist/es/components/InputLabel/InputLabel.css +0 -7
- package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/es/components/InputLabel/InputLabel.js +9 -4
- package/dist/es/components/Link/Link.d.ts +3 -3
- package/dist/es/components/Link/Link.js +32 -21
- package/dist/es/components/List/List.css +9 -13
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +2 -2
- package/dist/es/components/List/ListItem.css +0 -7
- package/dist/es/components/Logo/Logo.css +0 -7
- package/dist/es/components/Logo/Logo.js +4 -8
- package/dist/es/components/NavArrow/NavArrow.css +5 -12
- package/dist/es/components/Notification/Notification.css +41 -24
- package/dist/es/components/Notification/Notification.d.ts +8 -0
- package/dist/es/components/Notification/Notification.js +21 -4
- package/dist/es/components/Pagination/Pagination.css +0 -7
- package/dist/es/components/Pagination/Pagination.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/es/components/Pagination/helpers.d.ts +1 -1
- package/dist/es/components/Paragraph/Paragraph.css +10 -31
- package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/es/components/Paragraph/Paragraph.js +14 -40
- package/dist/es/components/Preloader/Preloader.css +5 -12
- package/dist/es/components/Preloader/Preloader.d.ts +4 -0
- package/dist/es/components/Preloader/Preloader.js +10 -5
- package/dist/es/components/RadioButton/RadioButton.css +7 -14
- package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/es/components/RadioButton/RadioButton.js +50 -85
- package/dist/es/components/Search/Search.css +20 -25
- package/dist/es/components/Search/Search.js +3 -4
- package/dist/es/components/Select/Select.css +34 -37
- package/dist/es/components/Select/Select.d.ts +43 -50
- package/dist/es/components/Select/Select.js +382 -461
- package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/es/components/Select/reducer/selectReducer.js +123 -0
- package/dist/es/components/Switcher/Switcher.css +18 -28
- package/dist/es/components/Switcher/Switcher.js +1 -1
- package/dist/es/components/Tabs/Tab.d.ts +5 -2
- package/dist/es/components/Tabs/Tab.js +4 -2
- package/dist/es/components/Tabs/Tabs.css +30 -37
- package/dist/es/components/Tabs/Tabs.d.ts +8 -0
- package/dist/es/components/Tabs/Tabs.js +38 -31
- package/dist/es/components/TextField/TextField.css +27 -33
- package/dist/es/components/TextField/TextField.d.ts +9 -3
- package/dist/es/components/TextField/TextField.js +32 -24
- package/dist/es/components/TextLink/TextLink.css +10 -14
- package/dist/es/components/TextLink/TextLink.d.ts +1 -1
- package/dist/es/components/TextLink/TextLink.js +7 -2
- package/dist/es/components/Tile/Tile.css +2 -8
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +2 -2
- package/dist/es/components/Tooltip/Tooltip.css +1 -8
- package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/es/components/Tooltip/Tooltip.js +28 -27
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
- package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
- package/dist/lib/colors/Colors.css +3 -11
- package/dist/lib/colors/Colors.d.ts +2 -2
- package/dist/lib/colors/Colors.js +63 -4
- package/dist/lib/colors/colorsData.js +78 -71
- package/dist/lib/components/Accordion/Accordion.css +7 -27
- package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
- package/dist/lib/components/Accordion/Accordion.js +24 -19
- package/dist/lib/components/Banner/Banner.css +2 -37
- package/dist/lib/components/Banner/Banner.d.ts +10 -2
- package/dist/lib/components/Banner/Banner.js +35 -25
- package/dist/lib/components/Banner/BannerDot.css +4 -11
- package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
- package/dist/lib/components/Banner/BannerDot.js +10 -2
- package/dist/lib/components/Button/Button.css +83 -74
- package/dist/lib/components/Button/Button.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +16 -8
- package/dist/lib/components/Calendar/Calendar.css +0 -7
- package/dist/lib/components/Calendar/Calendar.js +3 -3
- package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
- package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
- package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
- package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
- package/dist/lib/components/Carousel/Carousel.css +4 -11
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +26 -23
- package/dist/lib/components/Checkbox/Checkbox.css +18 -25
- package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/lib/components/Checkbox/Checkbox.js +82 -125
- package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
- package/dist/lib/components/Collapse/Collapse.js +13 -4
- package/dist/lib/components/ContentArea/ContentArea.css +18 -28
- package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/lib/components/ContentArea/ContentArea.js +5 -42
- package/dist/lib/components/Counter/Counter.css +14 -11
- package/dist/lib/components/Counter/Counter.js +3 -3
- package/dist/lib/components/Grid/GridColumn.css +0 -7
- package/dist/lib/components/Header/Header.css +8 -12
- package/dist/lib/components/Header/Header.d.ts +7 -21
- package/dist/lib/components/Header/Header.js +31 -98
- package/dist/lib/components/InputLabel/InputLabel.css +0 -7
- package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/lib/components/InputLabel/InputLabel.js +11 -3
- package/dist/lib/components/Link/Link.d.ts +3 -3
- package/dist/lib/components/Link/Link.js +44 -26
- package/dist/lib/components/List/List.css +9 -13
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +2 -2
- package/dist/lib/components/List/ListItem.css +0 -7
- package/dist/lib/components/Logo/Logo.css +0 -7
- package/dist/lib/components/Logo/Logo.js +4 -8
- package/dist/lib/components/NavArrow/NavArrow.css +5 -12
- package/dist/lib/components/Notification/Notification.css +41 -24
- package/dist/lib/components/Notification/Notification.d.ts +8 -0
- package/dist/lib/components/Notification/Notification.js +20 -3
- package/dist/lib/components/Pagination/Pagination.css +0 -7
- package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/lib/components/Pagination/helpers.d.ts +1 -1
- package/dist/lib/components/Paragraph/Paragraph.css +10 -31
- package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/lib/components/Paragraph/Paragraph.js +15 -41
- package/dist/lib/components/Preloader/Preloader.css +5 -12
- package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
- package/dist/lib/components/Preloader/Preloader.js +10 -4
- package/dist/lib/components/RadioButton/RadioButton.css +7 -14
- package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/lib/components/RadioButton/RadioButton.js +51 -117
- package/dist/lib/components/Search/Search.css +20 -25
- package/dist/lib/components/Search/Search.js +3 -4
- package/dist/lib/components/Select/Select.css +34 -37
- package/dist/lib/components/Select/Select.d.ts +43 -50
- package/dist/lib/components/Select/Select.js +375 -483
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
- package/dist/lib/components/Switcher/Switcher.css +18 -28
- package/dist/lib/components/Switcher/Switcher.js +1 -1
- package/dist/lib/components/Tabs/Tab.d.ts +5 -2
- package/dist/lib/components/Tabs/Tab.js +4 -2
- package/dist/lib/components/Tabs/Tabs.css +30 -37
- package/dist/lib/components/Tabs/Tabs.d.ts +8 -0
- package/dist/lib/components/Tabs/Tabs.js +38 -31
- package/dist/lib/components/TextField/TextField.css +27 -33
- package/dist/lib/components/TextField/TextField.d.ts +9 -3
- package/dist/lib/components/TextField/TextField.js +30 -23
- package/dist/lib/components/TextLink/TextLink.css +10 -14
- package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
- package/dist/lib/components/TextLink/TextLink.js +7 -2
- package/dist/lib/components/Tile/Tile.css +2 -8
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +2 -2
- package/dist/lib/components/Tooltip/Tooltip.css +1 -8
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/lib/components/Tooltip/Tooltip.js +27 -26
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +5 -4
- package/styles/base.less +2 -73
- package/styles/colors.css +60 -0
- package/styles/colorsDark.css +62 -0
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-text-field {
|
|
9
2
|
font-family: inherit;
|
|
10
3
|
font-size: 15px;
|
|
11
4
|
line-height: 24px;
|
|
12
|
-
color:
|
|
5
|
+
color: var(--content);
|
|
13
6
|
}
|
|
14
7
|
.mfui-text-field__field {
|
|
15
8
|
font-family: inherit;
|
|
@@ -45,13 +38,13 @@ h5 {
|
|
|
45
38
|
overflow: auto;
|
|
46
39
|
}
|
|
47
40
|
.mfui-text-field input::-webkit-input-placeholder {
|
|
48
|
-
color:
|
|
41
|
+
color: var(--spbSky3);
|
|
49
42
|
}
|
|
50
43
|
.mfui-text-field input:-moz-placeholder {
|
|
51
|
-
color:
|
|
44
|
+
color: var(--spbSky3);
|
|
52
45
|
}
|
|
53
46
|
.mfui-text-field input:-ms-input-placeholder {
|
|
54
|
-
color:
|
|
47
|
+
color: var(--spbSky3);
|
|
55
48
|
}
|
|
56
49
|
.mfui-text-field input::-ms-clear,
|
|
57
50
|
.mfui-text-field input::-ms-reveal {
|
|
@@ -62,7 +55,7 @@ h5 {
|
|
|
62
55
|
-webkit-box-flex: 1;
|
|
63
56
|
-ms-flex: 1 0 100px;
|
|
64
57
|
flex: 1 0 100px;
|
|
65
|
-
background:
|
|
58
|
+
background: var(--base);
|
|
66
59
|
}
|
|
67
60
|
.mfui-text-field__icon-box {
|
|
68
61
|
position: absolute;
|
|
@@ -83,6 +76,7 @@ h5 {
|
|
|
83
76
|
box-sizing: border-box;
|
|
84
77
|
padding-right: 16px;
|
|
85
78
|
text-align: center;
|
|
79
|
+
fill: var(--content);
|
|
86
80
|
}
|
|
87
81
|
.mfui-text-field__icon-box_error,
|
|
88
82
|
.mfui-text-field__icon-box_password,
|
|
@@ -105,7 +99,7 @@ h5 {
|
|
|
105
99
|
}
|
|
106
100
|
.mfui-text-field__require-mark {
|
|
107
101
|
margin-left: 1px;
|
|
108
|
-
color:
|
|
102
|
+
color: var(--fury);
|
|
109
103
|
font-size: 20px;
|
|
110
104
|
line-height: 0;
|
|
111
105
|
}
|
|
@@ -123,64 +117,64 @@ h5 {
|
|
|
123
117
|
opacity: 0.5;
|
|
124
118
|
}
|
|
125
119
|
.mfui-text-field__counter_error {
|
|
126
|
-
color:
|
|
120
|
+
color: var(--fury);
|
|
127
121
|
opacity: 1;
|
|
128
122
|
}
|
|
129
123
|
.mfui-text-field_theme_default .mfui-text-field__field {
|
|
130
|
-
border: 1px solid
|
|
131
|
-
color:
|
|
124
|
+
border: 1px solid var(--spbSky2);
|
|
125
|
+
color: var(--content);
|
|
132
126
|
background-color: transparent;
|
|
133
127
|
}
|
|
134
128
|
.mfui-text-field_theme_default .mfui-text-field__field-wrapper_no-touch:hover .mfui-text-field__field,
|
|
135
129
|
.mfui-text-field_theme_default .mfui-text-field__field:focus {
|
|
136
|
-
border-color:
|
|
130
|
+
border-color: var(--content);
|
|
137
131
|
}
|
|
138
132
|
.mfui-text-field_theme_default.mfui-text-field_valid .mfui-text-field__field-wrapper_no-touch:hover .mfui-text-field__field,
|
|
139
133
|
.mfui-text-field_theme_default.mfui-text-field_valid .mfui-text-field__field {
|
|
140
|
-
border-color:
|
|
134
|
+
border-color: var(--brandGreen);
|
|
141
135
|
}
|
|
142
136
|
.mfui-text-field_theme_default.mfui-text-field_valid .mfui-text-field__icon {
|
|
143
|
-
fill:
|
|
137
|
+
fill: var(--brandGreen);
|
|
144
138
|
}
|
|
145
139
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field-wrapper:hover .mfui-text-field__field,
|
|
146
140
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__field {
|
|
147
|
-
border-color:
|
|
141
|
+
border-color: var(--fury);
|
|
148
142
|
}
|
|
149
143
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__icon {
|
|
150
|
-
fill:
|
|
144
|
+
fill: var(--fury);
|
|
151
145
|
}
|
|
152
146
|
.mfui-text-field_theme_default.mfui-text-field_error .mfui-text-field__text_error {
|
|
153
|
-
color:
|
|
147
|
+
color: var(--fury);
|
|
154
148
|
}
|
|
155
149
|
.mfui-text-field_theme_white .mfui-text-field__field {
|
|
156
|
-
border: 1px solid
|
|
157
|
-
color:
|
|
150
|
+
border: 1px solid var(--base);
|
|
151
|
+
color: var(--content);
|
|
158
152
|
}
|
|
159
153
|
.mfui-text-field_theme_white .mfui-text-field__field-wrapper:hover .mfui-text-field__field,
|
|
160
154
|
.mfui-text-field_theme_white .mfui-text-field__field:focus {
|
|
161
|
-
border-color:
|
|
155
|
+
border-color: var(--content);
|
|
162
156
|
}
|
|
163
157
|
.mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__field-wrapper:hover .mfui-text-field__field,
|
|
164
158
|
.mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__field {
|
|
165
|
-
border-color:
|
|
159
|
+
border-color: var(--fury);
|
|
166
160
|
}
|
|
167
161
|
.mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__icon {
|
|
168
|
-
fill:
|
|
162
|
+
fill: var(--fury);
|
|
169
163
|
}
|
|
170
164
|
.mfui-text-field_theme_white.mfui-text-field_error .mfui-text-field__text_error {
|
|
171
|
-
color:
|
|
165
|
+
color: var(--fury);
|
|
172
166
|
}
|
|
173
167
|
.mfui-text-field__text_success {
|
|
174
|
-
color:
|
|
168
|
+
color: var(--brandGreen);
|
|
175
169
|
}
|
|
176
170
|
.mfui-text-field_disabled .mfui-text-field__field-wrapper {
|
|
177
|
-
background-color:
|
|
171
|
+
background-color: var(--spbSky1) !important;
|
|
178
172
|
}
|
|
179
173
|
.mfui-text-field_disabled .mfui-text-field__field {
|
|
180
|
-
border-color:
|
|
181
|
-
color:
|
|
174
|
+
border-color: var(--spbSky1) !important;
|
|
175
|
+
color: var(--content) !important;
|
|
182
176
|
cursor: default !important;
|
|
183
|
-
-webkit-text-fill-color:
|
|
177
|
+
-webkit-text-fill-color: var(--content) !important;
|
|
184
178
|
}
|
|
185
179
|
.mfui-text-field_disabled .mfui-text-field__icon-box {
|
|
186
180
|
cursor: default !important;
|
|
@@ -62,10 +62,16 @@ export declare type TextFieldProps = {
|
|
|
62
62
|
classes?: {
|
|
63
63
|
input?: string;
|
|
64
64
|
};
|
|
65
|
-
/**
|
|
65
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
66
|
+
dataAttrs?: {
|
|
67
|
+
root?: Record<string, string>;
|
|
68
|
+
label?: Record<string, string>;
|
|
69
|
+
notice?: Record<string, string>;
|
|
70
|
+
input?: Record<string, string>;
|
|
71
|
+
iconBox?: Record<string, string>;
|
|
72
|
+
};
|
|
73
|
+
/** Аргумент элемента input */
|
|
66
74
|
inputMode?: 'numeric' | 'tel' | 'decimal' | 'email' | 'url' | 'search' | 'none';
|
|
67
|
-
/** Атрибут элемента input. Не работает с textarea=true */
|
|
68
|
-
autoComplete?: string;
|
|
69
75
|
/** Переводит компонент в контролируемое состояние */
|
|
70
76
|
isControlled?: boolean;
|
|
71
77
|
/** Обработчик изменения значения */
|
|
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
5
5
|
import _extends from "@babel/runtime/helpers/extends";
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { useCallback, useEffect, useState, useRef, useMemo } from 'react';
|
|
8
|
-
import { cnCreate, detectTouch } from '@megafon/ui-helpers';
|
|
8
|
+
import { cnCreate, detectTouch, filterDataAttrs } from '@megafon/ui-helpers';
|
|
9
9
|
import * as PropTypes from 'prop-types';
|
|
10
10
|
import InputMask from 'react-input-mask';
|
|
11
11
|
import InputLabel from "../InputLabel/InputLabel";
|
|
@@ -96,10 +96,10 @@ var TextField = function TextField(_ref) {
|
|
|
96
96
|
noticeText = _ref.noticeText,
|
|
97
97
|
inputRef = _ref.inputRef,
|
|
98
98
|
inputMode = _ref.inputMode,
|
|
99
|
-
autoComplete = _ref.autoComplete,
|
|
100
99
|
_ref$classes = _ref.classes;
|
|
101
100
|
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
|
102
|
-
var input = _ref$classes.input
|
|
101
|
+
var input = _ref$classes.input,
|
|
102
|
+
dataAttrs = _ref.dataAttrs;
|
|
103
103
|
|
|
104
104
|
var _useState = useState(true),
|
|
105
105
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -150,7 +150,7 @@ var TextField = function TextField(_ref) {
|
|
|
150
150
|
useEffect(function () {
|
|
151
151
|
!isControlled && setInputValue(value);
|
|
152
152
|
checkSymbolMaxLimit(value);
|
|
153
|
-
}, [value, checkSymbolMaxLimit
|
|
153
|
+
}, [value, checkSymbolMaxLimit]);
|
|
154
154
|
useEffect(function () {
|
|
155
155
|
setTouch(detectTouch());
|
|
156
156
|
}, []);
|
|
@@ -158,7 +158,7 @@ var TextField = function TextField(_ref) {
|
|
|
158
158
|
return setPasswordHidden(function (prevPassState) {
|
|
159
159
|
return !prevPassState;
|
|
160
160
|
});
|
|
161
|
-
}, []);
|
|
161
|
+
}, [isPasswordHidden]);
|
|
162
162
|
|
|
163
163
|
var setTextareaHeight = function setTextareaHeight() {
|
|
164
164
|
if (!(fieldNode === null || fieldNode === void 0 ? void 0 : fieldNode.current)) {
|
|
@@ -181,7 +181,7 @@ var TextField = function TextField(_ref) {
|
|
|
181
181
|
|
|
182
182
|
!isControlled && setInputValue(e.target.value);
|
|
183
183
|
checkSymbolMaxLimit(e.target.value);
|
|
184
|
-
onChange
|
|
184
|
+
onChange && onChange(e);
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
var handleTextareaClick = function handleTextareaClick() {
|
|
@@ -198,25 +198,26 @@ var TextField = function TextField(_ref) {
|
|
|
198
198
|
var isClearFuncAvailable = !customIcon && !onCustomIconClick && verification === ERROR;
|
|
199
199
|
var field = fieldNode.current;
|
|
200
200
|
isPasswordType && togglePasswordHiding();
|
|
201
|
-
onCustomIconClick
|
|
201
|
+
onCustomIconClick && onCustomIconClick(e);
|
|
202
202
|
|
|
203
203
|
if (!isControlled && isClearFuncAvailable) {
|
|
204
204
|
setInputValue('');
|
|
205
|
-
field
|
|
205
|
+
field && field.focus();
|
|
206
206
|
}
|
|
207
|
-
}, [isPasswordType, togglePasswordHiding, onCustomIconClick, verification,
|
|
207
|
+
}, [isPasswordType, togglePasswordHiding, onCustomIconClick, verification, setInputValue]);
|
|
208
208
|
var handleFocus = useCallback(function (e) {
|
|
209
|
-
onFocus
|
|
209
|
+
onFocus && onFocus(e);
|
|
210
210
|
}, [onFocus]);
|
|
211
211
|
var handleBlur = useCallback(function (e) {
|
|
212
|
-
onBlur
|
|
212
|
+
onBlur && onBlur(e);
|
|
213
213
|
}, [onBlur]);
|
|
214
214
|
var handleBeforeMaskChange = useCallback(function (newState, oldState, inputedValue) {
|
|
215
215
|
return onBeforeMaskChange && onBeforeMaskChange(inputedValue, newState, oldState);
|
|
216
216
|
}, [onBeforeMaskChange]);
|
|
217
217
|
var textareaType = textarea === TextareaTypes.FLEXIBLE ? TextareaTypes.FLEXIBLE : TextareaTypes.FIXED;
|
|
218
218
|
var hasScrolling = initialTextareaHeight >= TEXTAREA_MAX_HEIGHT || isTextareaResized;
|
|
219
|
-
|
|
219
|
+
|
|
220
|
+
var commonParams = _extends(_extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.input)), {
|
|
220
221
|
disabled: disabled,
|
|
221
222
|
id: id,
|
|
222
223
|
name: name,
|
|
@@ -229,12 +230,11 @@ var TextField = function TextField(_ref) {
|
|
|
229
230
|
placeholder: placeholder,
|
|
230
231
|
required: required,
|
|
231
232
|
inputMode: inputMode
|
|
232
|
-
};
|
|
233
|
+
});
|
|
233
234
|
|
|
234
235
|
var inputParams = _extends(_extends({}, commonParams), {
|
|
235
236
|
className: cn('field', input),
|
|
236
|
-
type: isVisiblePassword ? 'text' : type
|
|
237
|
-
autoComplete: autoComplete
|
|
237
|
+
type: isVisiblePassword ? 'text' : type
|
|
238
238
|
});
|
|
239
239
|
|
|
240
240
|
var inputMaskParams = {
|
|
@@ -256,7 +256,7 @@ var TextField = function TextField(_ref) {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
fieldNode.current = node;
|
|
259
|
-
inputRef
|
|
259
|
+
inputRef && inputRef(node);
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
var getIcon = function getIcon() {
|
|
@@ -301,14 +301,14 @@ var TextField = function TextField(_ref) {
|
|
|
301
301
|
|
|
302
302
|
var renderIconBlock = function renderIconBlock() {
|
|
303
303
|
var icon = getIcon();
|
|
304
|
-
return icon && /*#__PURE__*/React.createElement("div", {
|
|
304
|
+
return icon && /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.iconBox), {
|
|
305
305
|
className: cn('icon-box', {
|
|
306
306
|
error: verification === Verification.ERROR && !customIcon,
|
|
307
307
|
password: isPasswordType,
|
|
308
308
|
'custom-handler': !!onCustomIconClick
|
|
309
309
|
}),
|
|
310
310
|
onClick: handleIconClick
|
|
311
|
-
}, icon);
|
|
311
|
+
}), icon);
|
|
312
312
|
};
|
|
313
313
|
|
|
314
314
|
var renderInput = function renderInput() {
|
|
@@ -330,7 +330,7 @@ var TextField = function TextField(_ref) {
|
|
|
330
330
|
var isPlaceholderShowed = isPasswordType && isPasswordHidden && !!inputValue;
|
|
331
331
|
var valueHasSymbols = inputValue !== null && inputValue !== undefined;
|
|
332
332
|
var currentSymbolCount = valueHasSymbols && String(inputValue).length || 0;
|
|
333
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
333
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
334
334
|
className: cn({
|
|
335
335
|
disabled: disabled,
|
|
336
336
|
theme: theme,
|
|
@@ -339,7 +339,10 @@ var TextField = function TextField(_ref) {
|
|
|
339
339
|
icon: !hideIcon && (!!verification || !!customIcon || type === 'password') && !textarea,
|
|
340
340
|
password: isPlaceholderShowed
|
|
341
341
|
}, className)
|
|
342
|
-
}, label && /*#__PURE__*/React.createElement(InputLabel, {
|
|
342
|
+
}), label && /*#__PURE__*/React.createElement(InputLabel, {
|
|
343
|
+
dataAttrs: {
|
|
344
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.label
|
|
345
|
+
},
|
|
343
346
|
htmlFor: id
|
|
344
347
|
}, label, required && /*#__PURE__*/React.createElement("span", {
|
|
345
348
|
className: cn('require-mark')
|
|
@@ -349,12 +352,12 @@ var TextField = function TextField(_ref) {
|
|
|
349
352
|
})
|
|
350
353
|
}, renderField()), /*#__PURE__*/React.createElement("div", {
|
|
351
354
|
className: cn('wrap')
|
|
352
|
-
}, noticeText && /*#__PURE__*/React.createElement("div", {
|
|
355
|
+
}, noticeText && /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.notice), {
|
|
353
356
|
className: cn('text', {
|
|
354
357
|
error: verification === Verification.ERROR,
|
|
355
358
|
success: verification === Verification.VALID
|
|
356
359
|
})
|
|
357
|
-
}, noticeText), symbolCounter && /*#__PURE__*/React.createElement(Paragraph, {
|
|
360
|
+
}), noticeText), symbolCounter && /*#__PURE__*/React.createElement(Paragraph, {
|
|
358
361
|
size: "small",
|
|
359
362
|
hasMargin: false,
|
|
360
363
|
className: cn('counter', {
|
|
@@ -372,8 +375,6 @@ TextField.propTypes = {
|
|
|
372
375
|
disabled: PropTypes.bool,
|
|
373
376
|
required: PropTypes.bool,
|
|
374
377
|
type: PropTypes.oneOf(['text', 'password', 'tel', 'email']),
|
|
375
|
-
inputMode: PropTypes.oneOf(['numeric', 'tel', 'decimal', 'email', 'url', 'search', 'none']),
|
|
376
|
-
autoComplete: PropTypes.string,
|
|
377
378
|
name: PropTypes.string,
|
|
378
379
|
placeholder: PropTypes.string,
|
|
379
380
|
id: PropTypes.string,
|
|
@@ -395,6 +396,13 @@ TextField.propTypes = {
|
|
|
395
396
|
inputRef: PropTypes.func,
|
|
396
397
|
classes: PropTypes.shape({
|
|
397
398
|
input: PropTypes.string
|
|
399
|
+
}),
|
|
400
|
+
dataAttrs: PropTypes.shape({
|
|
401
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
402
|
+
label: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
403
|
+
notice: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
404
|
+
input: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
405
|
+
iconBox: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
398
406
|
})
|
|
399
407
|
};
|
|
400
408
|
export default TextField;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-text-link {
|
|
9
2
|
font-family: inherit;
|
|
10
3
|
font-size: inherit;
|
|
@@ -34,20 +27,23 @@ h5 {
|
|
|
34
27
|
.mfui-text-link_underline-style_none:hover {
|
|
35
28
|
text-decoration: none;
|
|
36
29
|
}
|
|
30
|
+
.mfui-text-link_color_default {
|
|
31
|
+
color: var(--content);
|
|
32
|
+
}
|
|
33
|
+
.mfui-text-link_color_black {
|
|
34
|
+
color: var(--stcBlack);
|
|
35
|
+
}
|
|
37
36
|
.mfui-text-link_color_white {
|
|
38
|
-
color:
|
|
37
|
+
color: var(--stcWhite);
|
|
39
38
|
}
|
|
40
39
|
.mfui-text-link_color_blue {
|
|
41
|
-
color:
|
|
40
|
+
color: var(--systemBlue);
|
|
42
41
|
}
|
|
43
42
|
.mfui-text-link_color_green {
|
|
44
|
-
color:
|
|
45
|
-
}
|
|
46
|
-
.mfui-text-link_color_black {
|
|
47
|
-
color: #333333;
|
|
43
|
+
color: var(--brandGreen);
|
|
48
44
|
}
|
|
49
45
|
.mfui-text-link_color_gray {
|
|
50
|
-
color:
|
|
46
|
+
color: var(--spbSky3);
|
|
51
47
|
}
|
|
52
48
|
.mfui-text-link_color_inherit {
|
|
53
49
|
color: inherit;
|
|
@@ -3,7 +3,7 @@ import './TextLink.less';
|
|
|
3
3
|
import { ILinkProps } from '../Link/Link';
|
|
4
4
|
export interface ITextLinkProps extends ILinkProps {
|
|
5
5
|
/** Цвет */
|
|
6
|
-
color?: 'white' | 'black' | 'gray' | '
|
|
6
|
+
color?: 'default' | 'white' | 'black' | 'gray' | 'green' | 'blue' | 'inherit';
|
|
7
7
|
/** Отображение подчеркивания */
|
|
8
8
|
underlineVisibility?: 'hover' | 'always';
|
|
9
9
|
/** Стиль подчеркивания */
|
|
@@ -15,8 +15,10 @@ var TextLink = function TextLink(_ref) {
|
|
|
15
15
|
rel = _ref.rel,
|
|
16
16
|
onClick = _ref.onClick,
|
|
17
17
|
children = _ref.children,
|
|
18
|
-
download = _ref.download
|
|
18
|
+
download = _ref.download,
|
|
19
|
+
dataAttrs = _ref.dataAttrs;
|
|
19
20
|
return /*#__PURE__*/React.createElement(Link, {
|
|
21
|
+
dataAttrs: dataAttrs,
|
|
20
22
|
target: target,
|
|
21
23
|
href: href,
|
|
22
24
|
rel: rel,
|
|
@@ -31,9 +33,12 @@ var TextLink = function TextLink(_ref) {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
TextLink.propTypes = {
|
|
34
|
-
color: PropTypes.oneOf(['white', 'black', 'gray', '
|
|
36
|
+
color: PropTypes.oneOf(['default', 'white', 'black', 'gray', 'green', 'blue', 'inherit']),
|
|
35
37
|
underlineVisibility: PropTypes.oneOf(['hover', 'always']),
|
|
36
38
|
underlineStyle: PropTypes.oneOf(['solid', 'dashed', 'border', 'none']),
|
|
39
|
+
dataAttrs: PropTypes.shape({
|
|
40
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
41
|
+
}),
|
|
37
42
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.string, PropTypes.node])
|
|
38
43
|
};
|
|
39
44
|
TextLink.defaultProps = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
2
|
import './Tile.less';
|
|
4
3
|
export declare const Theme: {
|
|
5
4
|
readonly LIGHT: "light";
|
|
@@ -18,7 +17,7 @@ export declare const Shadow: {
|
|
|
18
17
|
readonly HOVER: "hover";
|
|
19
18
|
};
|
|
20
19
|
declare type ShadowType = typeof Shadow[keyof typeof Shadow];
|
|
21
|
-
export interface ITileProps
|
|
20
|
+
export interface ITileProps {
|
|
22
21
|
/** Ссылка */
|
|
23
22
|
href?: string;
|
|
24
23
|
/** Тема */
|
|
@@ -31,6 +30,10 @@ export interface ITileProps extends IFilterDataAttrs {
|
|
|
31
30
|
isInteractive?: boolean;
|
|
32
31
|
/** Дополнительный класс корневого элемента */
|
|
33
32
|
className?: string;
|
|
33
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
34
|
+
dataAttrs?: {
|
|
35
|
+
root?: Record<string, string>;
|
|
36
|
+
};
|
|
34
37
|
/** Обработчик клика */
|
|
35
38
|
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
36
39
|
}
|
|
@@ -36,7 +36,7 @@ var Tile = function Tile(_ref) {
|
|
|
36
36
|
dataAttrs = _ref.dataAttrs;
|
|
37
37
|
|
|
38
38
|
var handleClick = function handleClick(e) {
|
|
39
|
-
onClick
|
|
39
|
+
onClick && onClick(e);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
var isPointer = !!href || isInteractive;
|
|
@@ -49,7 +49,7 @@ var Tile = function Tile(_ref) {
|
|
|
49
49
|
interactive: isInteractive
|
|
50
50
|
}, className),
|
|
51
51
|
onClick: handleClick
|
|
52
|
-
}, filterDataAttrs(dataAttrs)), href && /*#__PURE__*/React.createElement("a", {
|
|
52
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), href && /*#__PURE__*/React.createElement("a", {
|
|
53
53
|
href: href,
|
|
54
54
|
className: cn('link')
|
|
55
55
|
}, children), !href && children);
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-tooltip {
|
|
9
2
|
z-index: 100;
|
|
10
3
|
visibility: hidden;
|
|
@@ -48,7 +41,7 @@ h5 {
|
|
|
48
41
|
left: 0;
|
|
49
42
|
-webkit-transform: rotate(45deg);
|
|
50
43
|
transform: rotate(45deg);
|
|
51
|
-
background-color:
|
|
44
|
+
background-color: var(--base);
|
|
52
45
|
}
|
|
53
46
|
.mfui-tooltip__arrow-shadow {
|
|
54
47
|
width: 12px;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { AccessibilityEventTypeNative } from '@megafon/ui-helpers';
|
|
2
3
|
import './Tooltip.less';
|
|
3
4
|
export declare const Placement: {
|
|
4
5
|
readonly LEFT: "left";
|
|
@@ -45,10 +46,15 @@ export interface ITooltipProps {
|
|
|
45
46
|
content?: string;
|
|
46
47
|
contentShadow?: string;
|
|
47
48
|
};
|
|
49
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
50
|
+
dataAttrs?: {
|
|
51
|
+
root?: Record<string, string>;
|
|
52
|
+
content?: Record<string, string>;
|
|
53
|
+
};
|
|
48
54
|
/** Обработчик на открытие */
|
|
49
|
-
onOpen?: (e:
|
|
55
|
+
onOpen?: (e: AccessibilityEventTypeNative) => void;
|
|
50
56
|
/** Обработчик на закрытие */
|
|
51
|
-
onClose?: (e:
|
|
57
|
+
onClose?: (e: AccessibilityEventTypeNative | FocusEvent) => void;
|
|
52
58
|
}
|
|
53
59
|
declare const Tooltip: React.FC<ITooltipProps>;
|
|
54
60
|
export default Tooltip;
|