@megafon/ui-shared 4.21.1 → 5.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/es/components/Card/Card.css +226 -83
  3. package/dist/es/components/Card/Card.d.ts +30 -62
  4. package/dist/es/components/Card/Card.js +237 -157
  5. package/dist/es/components/Card/types.d.ts +71 -0
  6. package/dist/es/components/Card/types.js +0 -0
  7. package/dist/es/components/CardsBox/CardsBox.d.ts +4 -7
  8. package/dist/es/components/CardsBox/CardsBox.js +21 -67
  9. package/dist/es/components/CardsBox/helpers.d.ts +10 -0
  10. package/dist/es/components/CardsBox/helpers.js +25 -0
  11. package/dist/es/components/CarouselBox/CarouselBox.d.ts +6 -1
  12. package/dist/es/components/CarouselBox/CarouselBox.js +27 -3
  13. package/dist/es/components/Instructions/img/android.png +0 -0
  14. package/dist/es/components/Instructions/img/blackIphone.png +0 -0
  15. package/dist/es/components/Instructions/img/laptop.png +0 -0
  16. package/dist/es/components/Instructions/img/newIphone.png +0 -0
  17. package/dist/es/components/Instructions/img/whiteIphone.png +0 -0
  18. package/dist/es/components/Property/Property.js +2 -2
  19. package/dist/es/components/Property/types.d.ts +1 -1
  20. package/dist/es/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
  21. package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
  22. package/dist/es/components/StoreBanner/doc/img/screen.png +0 -0
  23. package/dist/es/components/StoreBanner/img/android.png +0 -0
  24. package/dist/es/components/StoreBanner/img/black-iphone.png +0 -0
  25. package/dist/es/components/StoreBanner/img/new-iphone.png +0 -0
  26. package/dist/es/components/StoreBanner/img/white-iphone.png +0 -0
  27. package/dist/es/index.d.ts +1 -0
  28. package/dist/es/index.js +1 -0
  29. package/dist/lib/components/Card/Card.css +226 -83
  30. package/dist/lib/components/Card/Card.d.ts +30 -62
  31. package/dist/lib/components/Card/Card.js +233 -160
  32. package/dist/lib/components/Card/types.d.ts +71 -0
  33. package/dist/lib/components/Card/types.js +1 -0
  34. package/dist/lib/components/CardsBox/CardsBox.d.ts +4 -7
  35. package/dist/lib/components/CardsBox/CardsBox.js +19 -67
  36. package/dist/lib/components/CardsBox/helpers.d.ts +10 -0
  37. package/dist/lib/components/CardsBox/helpers.js +35 -0
  38. package/dist/lib/components/CarouselBox/CarouselBox.d.ts +6 -1
  39. package/dist/lib/components/CarouselBox/CarouselBox.js +29 -2
  40. package/dist/lib/components/Instructions/img/android.png +0 -0
  41. package/dist/lib/components/Instructions/img/blackIphone.png +0 -0
  42. package/dist/lib/components/Instructions/img/laptop.png +0 -0
  43. package/dist/lib/components/Instructions/img/newIphone.png +0 -0
  44. package/dist/lib/components/Instructions/img/whiteIphone.png +0 -0
  45. package/dist/lib/components/Property/Property.js +2 -2
  46. package/dist/lib/components/Property/types.d.ts +1 -1
  47. package/dist/lib/components/StoreBanner/doc/img/new-iphone-screen.png +0 -0
  48. package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
  49. package/dist/lib/components/StoreBanner/doc/img/screen.png +0 -0
  50. package/dist/lib/components/StoreBanner/img/android.png +0 -0
  51. package/dist/lib/components/StoreBanner/img/black-iphone.png +0 -0
  52. package/dist/lib/components/StoreBanner/img/new-iphone.png +0 -0
  53. package/dist/lib/components/StoreBanner/img/white-iphone.png +0 -0
  54. package/dist/lib/index.d.ts +1 -0
  55. package/dist/lib/index.js +8 -0
  56. package/package.json +3 -3
@@ -0,0 +1,25 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ var getColumnConfig = function getColumnConfig(count, index, renderTwoColumnsInRow) {
4
+ var offset = renderTwoColumnsInRow ? '2' : undefined;
5
+ var offsetForEvenColumn = index % 2 ? undefined : offset;
6
+ var columnSize = {
7
+ all: '4',
8
+ tablet: '6',
9
+ mobile: '12'
10
+ };
11
+
12
+ switch (count) {
13
+ case 2:
14
+ case 4:
15
+ return _extends(_extends({}, columnSize), {
16
+ leftOffsetWide: offsetForEvenColumn,
17
+ leftOffsetDesktop: offsetForEvenColumn
18
+ });
19
+
20
+ default:
21
+ return _extends({}, columnSize);
22
+ }
23
+ };
24
+
25
+ export default getColumnConfig;
@@ -1,5 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { Carousel } from '@megafon/ui-core';
3
3
  declare type CarouselPropsTypes = React.ComponentProps<typeof Carousel>;
4
- declare const CarouselBox: React.FC<CarouselPropsTypes>;
4
+ declare type DesktopSlidesPerView = 3 | 4;
5
+ interface ICarouselBox extends CarouselPropsTypes {
6
+ /** Количество видимых слайдов на разрешении 1024 и выше */
7
+ desktopSlidesPerView?: DesktopSlidesPerView;
8
+ }
9
+ declare const CarouselBox: React.FC<ICarouselBox>;
5
10
  export default CarouselBox;
@@ -1,3 +1,5 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
3
  import "core-js/modules/es.array.index-of.js";
2
4
  import "core-js/modules/es.symbol.js";
3
5
 
@@ -16,16 +18,38 @@ var __rest = this && this.__rest || function (s, e) {
16
18
 
17
19
  import * as React from 'react';
18
20
  import { Carousel } from '@megafon/ui-core';
19
- import { cnCreate } from '@megafon/ui-helpers';
21
+ import { cnCreate, breakpoints } from '@megafon/ui-helpers';
22
+
23
+ var getDefaultSlideSettings = function getDefaultSlideSettings(desktopSlidesPerView) {
24
+ var _ref;
25
+
26
+ return _ref = {}, _defineProperty(_ref, breakpoints.MOBILE_SMALL_START, {
27
+ slidesPerView: 1,
28
+ spaceBetween: 16
29
+ }), _defineProperty(_ref, breakpoints.MOBILE_BIG_START, {
30
+ slidesPerView: 2,
31
+ spaceBetween: 20
32
+ }), _defineProperty(_ref, breakpoints.DESKTOP_SMALL_START, {
33
+ slidesPerView: desktopSlidesPerView,
34
+ spaceBetween: 20
35
+ }), _ref;
36
+ };
37
+
20
38
  var cn = cnCreate('mfui-carousel-box');
21
39
 
22
40
  var CarouselBox = function CarouselBox(_a) {
23
41
  var children = _a.children,
24
- props = __rest(_a, ["children"]);
42
+ slidesSettings = _a.slidesSettings,
43
+ _a$desktopSlidesPerVi = _a.desktopSlidesPerView,
44
+ desktopSlidesPerView = _a$desktopSlidesPerVi === void 0 ? 4 : _a$desktopSlidesPerVi,
45
+ props = __rest(_a, ["children", "slidesSettings", "desktopSlidesPerView"]);
25
46
 
47
+ var settings = slidesSettings || getDefaultSlideSettings(desktopSlidesPerView);
26
48
  return /*#__PURE__*/React.createElement("div", {
27
49
  className: cn()
28
- }, /*#__PURE__*/React.createElement(Carousel, props, children));
50
+ }, /*#__PURE__*/React.createElement(Carousel, _extends({}, props, {
51
+ slidesSettings: settings
52
+ }), children));
29
53
  };
30
54
 
31
55
  export default CarouselBox;
@@ -128,7 +128,7 @@ var Property = function Property(_ref) {
128
128
  _ref3$titleSize = _ref3.titleSize,
129
129
  titleSize = _ref3$titleSize === void 0 ? 'default' : _ref3$titleSize,
130
130
  _ref3$valueFrameColor = _ref3.valueFrameColor,
131
- valueFrameColor = _ref3$valueFrameColor === void 0 ? 'default' : _ref3$valueFrameColor;
131
+ valueFrameColor = _ref3$valueFrameColor === void 0 ? 'none' : _ref3$valueFrameColor;
132
132
  var isFirstItem = i === 0;
133
133
  var isRenderBadge = isFirstItem && !!badge;
134
134
  return /*#__PURE__*/React.createElement(Fragment, {
@@ -160,7 +160,7 @@ Property.propTypes = {
160
160
  value: PropTypes.string,
161
161
  titleSize: PropTypes.oneOf(['default', 'big']),
162
162
  valueUnit: PropTypes.string,
163
- valueFrameColor: PropTypes.oneOf(['default', 'gray'])
163
+ valueFrameColor: PropTypes.oneOf(['none', 'default', 'gray'])
164
164
  }).isRequired).isRequired,
165
165
  className: PropTypes.string,
166
166
  badge: PropTypes.string,
@@ -16,5 +16,5 @@ export declare type Item = {
16
16
  description?: Desc[];
17
17
  value?: string;
18
18
  valueUnit?: string;
19
- valueFrameColor?: 'default' | 'gray';
19
+ valueFrameColor?: 'none' | 'default' | 'gray';
20
20
  };
@@ -18,6 +18,7 @@ export { default as Container } from './components/Container/Container';
18
18
  export { default as DownloadLink } from './components/DownloadLinks/DownloadLink';
19
19
  export { default as DownloadLinks } from './components/DownloadLinks/DownloadLinks';
20
20
  export { default as FaqWrapper } from './components/FaqWrapper/FaqWrapper';
21
+ export { default as helpers } from './components/CardsBox/helpers';
21
22
  export { default as Instructions } from './components/Instructions/Instructions';
22
23
  export { default as NotificationBox } from './components/NotificationBox/NotificationBox';
23
24
  export { default as PageTitle } from './components/PageTitle/PageTitle';
package/dist/es/index.js CHANGED
@@ -18,6 +18,7 @@ export { default as Container } from "./components/Container/Container";
18
18
  export { default as DownloadLink } from "./components/DownloadLinks/DownloadLink";
19
19
  export { default as DownloadLinks } from "./components/DownloadLinks/DownloadLinks";
20
20
  export { default as FaqWrapper } from "./components/FaqWrapper/FaqWrapper";
21
+ export { default as helpers } from "./components/CardsBox/helpers";
21
22
  export { default as Instructions } from "./components/Instructions/Instructions";
22
23
  export { default as NotificationBox } from "./components/NotificationBox/NotificationBox";
23
24
  export { default as PageTitle } from "./components/PageTitle/PageTitle";
@@ -5,17 +5,99 @@ h4,
5
5
  h5 {
6
6
  margin: 0;
7
7
  }
8
- .mfui-card-old {
8
+ .mfui-card {
9
+ font-family: inherit;
10
+ font-size: 15px;
11
+ line-height: 24px;
12
+ font-weight: 400;
9
13
  display: -webkit-box;
10
14
  display: -ms-flexbox;
11
15
  display: flex;
16
+ -webkit-box-orient: vertical;
17
+ -webkit-box-direction: normal;
18
+ -ms-flex-direction: column;
19
+ flex-direction: column;
20
+ padding: 16px 16px 24px;
12
21
  border-radius: 12px;
13
- overflow: hidden;
22
+ color: var(--content);
23
+ text-decoration: none;
14
24
  background-color: var(--base);
15
- -webkit-box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
16
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
17
25
  }
18
- .mfui-card-old__inner {
26
+ @media screen and (min-width: 1280px) {
27
+ .mfui-card {
28
+ padding: 24px 24px 32px;
29
+ }
30
+ }
31
+ .mfui-card_full-height {
32
+ height: 100%;
33
+ }
34
+ .mfui-card_link {
35
+ cursor: pointer;
36
+ }
37
+ .mfui-card_view_shadow {
38
+ -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
39
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
40
+ }
41
+ .mfui-card_link.mfui-card_view_shadow:hover {
42
+ -webkit-box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
43
+ box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.1);
44
+ }
45
+ .mfui-card_view_background {
46
+ background-color: var(--spbSky0);
47
+ }
48
+ .mfui-card_link.mfui-card_view_background:hover {
49
+ background-color: var(--spbSky1);
50
+ }
51
+ .mfui-card_only-title {
52
+ padding: 24px;
53
+ }
54
+ @media screen and (min-width: 1280px) {
55
+ .mfui-card_only-title {
56
+ padding: 32px;
57
+ }
58
+ }
59
+ .mfui-card__icon {
60
+ width: 40px;
61
+ height: 40px;
62
+ margin-bottom: 32px;
63
+ }
64
+ .mfui-card__img-box {
65
+ position: relative;
66
+ margin-bottom: 24px;
67
+ padding-bottom: 56.25%;
68
+ border-radius: 12px;
69
+ overflow: hidden;
70
+ }
71
+ @media screen and (min-width: 1280px) {
72
+ .mfui-card__img-box {
73
+ margin-bottom: 32px;
74
+ }
75
+ }
76
+ .mfui-card__img-box_position_bottom {
77
+ margin-top: 24px;
78
+ margin-bottom: 0;
79
+ }
80
+ @media screen and (min-width: 1280px) {
81
+ .mfui-card__img-box_position_bottom {
82
+ margin-top: 32px;
83
+ }
84
+ }
85
+ .mfui-card__img {
86
+ position: absolute;
87
+ width: 100%;
88
+ height: 100%;
89
+ -o-object-fit: cover;
90
+ object-fit: cover;
91
+ -webkit-transition: -webkit-transform 0.3s;
92
+ transition: -webkit-transform 0.3s;
93
+ transition: transform 0.3s;
94
+ transition: transform 0.3s, -webkit-transform 0.3s;
95
+ }
96
+ .mfui-card_link:hover .mfui-card__img {
97
+ -webkit-transform: scale(1.2);
98
+ transform: scale(1.2);
99
+ }
100
+ .mfui-card__texts {
19
101
  display: -webkit-box;
20
102
  display: -ms-flexbox;
21
103
  display: flex;
@@ -23,108 +105,169 @@ h5 {
23
105
  -webkit-box-direction: normal;
24
106
  -ms-flex-direction: column;
25
107
  flex-direction: column;
26
- -webkit-box-flex: 0;
27
- -ms-flex-positive: 0;
28
- flex-grow: 0;
29
- -ms-flex-negative: 1;
30
- flex-shrink: 1;
31
- -webkit-box-sizing: border-box;
32
- box-sizing: border-box;
33
- width: 100%;
34
- padding: 32px 20px;
108
+ gap: 12px;
109
+ margin-top: 16px;
35
110
  }
36
- @media screen and (max-width: 767px) {
37
- .mfui-card-old__inner {
38
- padding: 24px 16px;
39
- }
111
+ .mfui-card__texts ol,
112
+ .mfui-card__texts ul {
113
+ margin: 0;
114
+ padding-left: 24px;
40
115
  }
41
- .mfui-card-old__text {
42
- font-size: 15px;
43
- line-height: 24px;
44
- font-weight: 400;
45
- margin-top: 12px;
46
- color: var(--content);
116
+ .mfui-card__texts-title {
117
+ font-weight: 500;
47
118
  }
48
- .mfui-card-old__btns-wrapper {
119
+ .mfui-card__features {
49
120
  display: -webkit-box;
50
121
  display: -ms-flexbox;
51
122
  display: flex;
52
- -ms-flex-wrap: wrap;
53
- flex-wrap: wrap;
54
- -webkit-box-align: center;
55
- -ms-flex-align: center;
56
- align-items: center;
57
- -webkit-box-pack: space-evenly;
58
- -ms-flex-pack: space-evenly;
59
- justify-content: space-evenly;
60
- margin-top: auto;
61
- padding-top: 12px;
123
+ -webkit-box-orient: vertical;
124
+ -webkit-box-direction: normal;
125
+ -ms-flex-direction: column;
126
+ flex-direction: column;
127
+ gap: 12px;
128
+ margin-top: 16px;
62
129
  }
63
- .mfui-card-old__btns-wrapper_left-align {
64
- -webkit-box-pack: start;
65
- -ms-flex-pack: start;
66
- justify-content: flex-start;
130
+ .mfui-card__features-item {
131
+ display: -webkit-box;
132
+ display: -ms-flexbox;
133
+ display: flex;
134
+ gap: 4px;
135
+ -webkit-box-align: baseline;
136
+ -ms-flex-align: baseline;
137
+ align-items: baseline;
138
+ -webkit-box-pack: justify;
139
+ -ms-flex-pack: justify;
140
+ justify-content: space-between;
67
141
  }
68
- .mfui-card-old__fake-link {
69
- color: var(--systemBlue);
142
+ .mfui-card__features-item-separator {
143
+ -webkit-box-flex: 1;
144
+ -ms-flex-positive: 1;
145
+ flex-grow: 1;
146
+ height: 2px;
147
+ background-image: radial-gradient(circle, var(--spbSky3) 1px, transparent 1px);
148
+ background-size: 6px 2px;
70
149
  }
71
- .mfui-card-old__button,
72
- .mfui-card-old__link,
73
- .mfui-card-old__fake-link {
74
- margin: 12px 10px;
150
+ .mfui-card__icons {
151
+ margin-top: 16px;
75
152
  }
76
- .mfui-card-old__svg-wrapper {
77
- margin-bottom: 24px;
153
+ .mfui-card__icons-desc {
154
+ margin-bottom: 12px;
78
155
  }
79
- .mfui-card-old__svg-wrapper svg {
80
- width: 40px;
81
- height: 40px;
156
+ .mfui-card__icons-list {
157
+ display: -webkit-box;
158
+ display: -ms-flexbox;
159
+ display: flex;
160
+ -webkit-box-orient: vertical;
161
+ -webkit-box-direction: normal;
162
+ -ms-flex-direction: column;
163
+ flex-direction: column;
164
+ gap: 12px;
165
+ }
166
+ .mfui-card__icons-item {
167
+ display: -webkit-box;
168
+ display: -ms-flexbox;
169
+ display: flex;
170
+ }
171
+ .mfui-card__icons-item-icon {
172
+ -ms-flex-negative: 0;
173
+ flex-shrink: 0;
174
+ width: 32px;
175
+ height: 32px;
176
+ margin-right: 8px;
82
177
  }
83
- .mfui-card-old__pic-wrapper .mfui-card-old__img {
84
- max-width: 100%;
178
+ .mfui-card__icons-item-text {
179
+ margin-top: 4px;
85
180
  }
86
- .mfui-card-old__pic-wrapper {
181
+ .mfui-card__price {
87
182
  display: -webkit-box;
88
183
  display: -ms-flexbox;
89
184
  display: flex;
90
- -webkit-box-align: center;
91
- -ms-flex-align: center;
92
- align-items: center;
185
+ -ms-flex-wrap: wrap;
186
+ flex-wrap: wrap;
187
+ gap: 8px;
188
+ -webkit-box-align: baseline;
189
+ -ms-flex-align: baseline;
190
+ align-items: baseline;
93
191
  -webkit-box-pack: center;
94
192
  -ms-flex-pack: center;
95
193
  justify-content: center;
96
- margin-top: -32px;
97
- margin-right: -20px;
98
- margin-bottom: 32px;
99
- margin-left: -20px;
100
- }
101
- @media screen and (max-width: 767px) {
102
- .mfui-card-old__pic-wrapper {
103
- margin-top: -24px;
104
- margin-right: -16px;
105
- margin-bottom: 24px;
106
- margin-left: -16px;
194
+ margin-top: 24px;
195
+ padding-top: 24px;
196
+ border-top: 1px solid var(--spbSky1);
197
+ }
198
+ @media screen and (min-width: 1280px) {
199
+ .mfui-card__price {
200
+ margin-top: 32px;
107
201
  }
108
202
  }
109
- .mfui-card-old__pic-wrapper_object-fit_fill img {
110
- width: 100%;
111
- height: auto;
203
+ .mfui-card__img-box + .mfui-card__price {
204
+ padding-top: 0;
205
+ border: none;
112
206
  }
113
- .mfui-card-old__pic-wrapper_object-fit_contain img {
114
- width: auto;
115
- height: 100%;
207
+ .mfui-card__price-old-value {
208
+ position: relative;
209
+ color: var(--spbSky3);
116
210
  }
117
- .mfui-card-old_href * {
118
- text-decoration: none !important;
211
+ .mfui-card__price-old-value:before {
212
+ content: '';
213
+ position: absolute;
214
+ top: 50%;
215
+ right: -1px;
216
+ left: -1px;
217
+ height: 1px;
218
+ background-color: var(--warmRedC);
119
219
  }
120
- .mfui-card-old_href:hover {
121
- -webkit-box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
122
- box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
220
+ .mfui-card__price-value {
221
+ font-weight: 600;
222
+ font-size: 22px;
223
+ line-height: 28px;
224
+ letter-spacing: 0.5px;
123
225
  }
124
- .mfui-card-old_full-height {
125
- height: 100%;
226
+ @media screen and (min-width: 768px) and (max-width: 1023px) {
227
+ .mfui-card__price-value {
228
+ font-size: 26px;
229
+ line-height: 32px;
230
+ }
231
+ }
232
+ @media screen and (min-width: 1024px) {
233
+ .mfui-card__price-value {
234
+ font-size: 28px;
235
+ line-height: 36px;
236
+ }
237
+ }
238
+ @media screen and (min-width: 1280px) {
239
+ .mfui-card__price-value {
240
+ font-size: 32px;
241
+ line-height: 40px;
242
+ }
243
+ }
244
+ .mfui-card__buttons {
245
+ display: -webkit-box;
246
+ display: -ms-flexbox;
247
+ display: flex;
248
+ -ms-flex-wrap: wrap;
249
+ flex-wrap: wrap;
250
+ gap: 16px;
251
+ margin-top: 32px;
252
+ }
253
+ .mfui-card__price + .mfui-card__buttons {
254
+ margin-top: 24px;
255
+ }
256
+ .mfui-card__buttons_centered {
257
+ -webkit-box-pack: center;
258
+ -ms-flex-pack: center;
259
+ justify-content: center;
260
+ }
261
+ .mfui-card__button {
262
+ -ms-flex-preferred-size: 190px;
263
+ flex-basis: 190px;
264
+ -webkit-box-flex: 1;
265
+ -ms-flex-positive: 1;
266
+ flex-grow: 1;
267
+ -ms-flex-negative: 1;
268
+ flex-shrink: 1;
269
+ max-width: 320px;
126
270
  }
127
- .mfui-card-old_centered-text .mfui-card-old__text,
128
- .mfui-card-old_centered-text .mfui-card-old__title {
129
- text-align: center;
271
+ .mfui-card__footer {
272
+ margin-top: auto;
130
273
  }
@@ -1,74 +1,42 @@
1
- import React, { Ref } from 'react';
1
+ import React from 'react';
2
2
  import './Card.less';
3
- export declare const Target: {
4
- readonly SELF: "_self";
5
- readonly BLANK: "_blank";
6
- };
7
- declare type TargetType = typeof Target[keyof typeof Target];
8
- interface IButton {
9
- title: string;
10
- href?: string;
11
- target?: TargetType;
12
- download?: boolean;
13
- rel?: string;
14
- onClick?: () => void;
15
- }
16
- interface ILink {
17
- title: string;
18
- href?: string;
19
- target?: TargetType;
20
- download?: boolean;
21
- rel?: string;
22
- }
23
- export declare const ObjectFit: {
24
- readonly FILL: "fill";
25
- readonly CONTAIN: "contain";
26
- };
27
- declare type ObjectFitType = typeof ObjectFit[keyof typeof ObjectFit];
3
+ import { ButtonType, FeaturesList, IconsList, Image, Link, Price, TextsList, Title } from './types';
28
4
  export interface ICard {
29
5
  /** Дополнительные data атрибуты к внутренним элементам */
30
6
  dataAttrs?: {
31
7
  root?: Record<string, string>;
32
- link?: Record<string, string>;
8
+ icon?: Record<string, string>;
9
+ imgBox?: Record<string, string>;
33
10
  button?: Record<string, string>;
11
+ extraButton?: Record<string, string>;
34
12
  };
35
- /** Дополнительный класс корневого элемента */
13
+ /** Дополнительный класс для компонента */
36
14
  className?: string;
37
- /** Дополнительные классы для корневого и внутренних элементов */
38
- classes?: {
39
- root?: string;
40
- button?: string;
41
- link?: string;
42
- inner?: string;
43
- };
44
- /** Ссылка на корневой элемент */
45
- rootRef?: Ref<HTMLDivElement>;
46
- /** Изображение в карточке */
47
- imageSrc?: string;
48
- /** Значение тега alt для изображения */
49
- imageAlt?: string;
50
- /** Иконка в карточке */
51
- svgSrc?: React.ReactNode;
52
- /** Заголовок карточки */
53
- title: string | React.ReactNode[] | React.ReactNode;
54
- /** Текст карточки */
55
- text?: string | React.ReactNode[] | React.ReactNode;
56
- /** Данные для кнопки */
57
- button?: IButton;
58
- /** Данные для ссылки */
59
- link?: ILink;
60
- /** Выравнивание текста по центру */
61
- isCenteredText?: boolean;
62
- /** Расположение кнопки/ссылки по левой стороне */
63
- isLeftHAlign?: boolean;
64
- /** Высота корневого элемента 100% */
65
15
  isFullHeight?: boolean;
66
- /** Ссылка для всей карточки */
67
- href?: string;
68
- /** Target свойство, аналогично свойству 'target' тега 'a' */
69
- target?: TargetType;
70
- /** Режим позиционирования изображения */
71
- objectFit?: ObjectFitType;
16
+ /** Вид */
17
+ view?: 'shadow' | 'background';
18
+ /** Ссылка для карточки */
19
+ link?: Link;
20
+ /** Изображение */
21
+ image?: Image;
22
+ /** Иконка */
23
+ icon?: React.ReactNode;
24
+ /** Заголовок */
25
+ title: Title;
26
+ /** Список текстов */
27
+ textsList?: TextsList;
28
+ /** Список характеристик */
29
+ featuresList?: FeaturesList;
30
+ /** Список иконок */
31
+ iconsList?: IconsList;
32
+ /** Цена */
33
+ price?: Price;
34
+ /** Кнопка */
35
+ button?: ButtonType;
36
+ /** Дополнительная кнопка */
37
+ extraButton?: ButtonType;
38
+ /** Обработчик клика по карточке */
39
+ onClick?: () => void;
72
40
  }
73
41
  declare const Card: React.FC<ICard>;
74
42
  export default Card;