@sima-land/moleculas 12.3.0 → 13.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 (83) hide show
  1. package/common/components/adult-block/{adult-block.d.ts → index.d.ts} +1 -2
  2. package/common/components/adult-block/{adult-block.js → index.js} +2 -1
  3. package/common/components/badge-list/index.d.ts +2 -6
  4. package/common/components/badge-list/index.js +26 -5
  5. package/common/components/product-info/index.d.ts +11 -49
  6. package/common/components/product-info/index.js +24 -35
  7. package/common/components/product-info/parts.d.ts +41 -0
  8. package/common/components/product-info/parts.js +176 -0
  9. package/common/components/product-info/product-info.module.scss +154 -31
  10. package/common/components/product-info/types.d.ts +5 -0
  11. package/common/components/product-info/types.js +2 -0
  12. package/common/components/product-info/utils.d.ts +3 -0
  13. package/{mobile/components/product-slider → common/components/product-info}/utils.js +2 -2
  14. package/common/components/quick-view-button/index.js +1 -1
  15. package/common/components/wish-button/index.js +1 -1
  16. package/common/icons/eighteen-plus.svg +3 -1
  17. package/desktop/components/breadcrumbs/index.js +5 -5
  18. package/desktop/components/gallery-modal/components/all-round-view.js +11 -11
  19. package/desktop/components/gallery-modal/components/gallery-modal.js +7 -7
  20. package/desktop/components/gallery-modal/components/image-overlay.js +1 -1
  21. package/desktop/components/gallery-modal/components/review-info.js +1 -1
  22. package/desktop/components/gallery-modal/utils.js +5 -5
  23. package/desktop/components/item-image/index.d.ts +1 -1
  24. package/desktop/components/item-image/index.js +8 -6
  25. package/desktop/components/modifiers/button/index.js +2 -2
  26. package/desktop/components/modifiers/group/index.js +12 -12
  27. package/desktop/components/modifiers/widget/index.js +2 -2
  28. package/desktop/components/person-modal/index.d.ts +0 -1
  29. package/desktop/components/person-modal/index.js +1 -2
  30. package/desktop/components/product-card/index.d.ts +11 -24
  31. package/desktop/components/product-card/index.js +43 -31
  32. package/desktop/components/product-card/product-card.module.scss +7 -48
  33. package/desktop/components/product-carousel/hover-card.d.ts +1 -4
  34. package/desktop/components/product-carousel/hover-card.js +22 -10
  35. package/desktop/components/product-carousel/index.d.ts +5 -9
  36. package/desktop/components/product-carousel/index.js +29 -28
  37. package/desktop/components/product-carousel/utils.js +10 -10
  38. package/desktop/components/promotion-card/banner-title.js +5 -5
  39. package/desktop/components/promotion-card/estimate.js +5 -3
  40. package/desktop/components/promotion-card/index.d.ts +3 -1
  41. package/desktop/components/promotion-card/index.js +6 -6
  42. package/desktop/components/promotion-card/placeholder.js +4 -4
  43. package/mobile/components/garland-calculator-button/garland-calculator-button.module.scss +32 -3
  44. package/mobile/components/garland-calculator-button/index.d.ts +2 -3
  45. package/mobile/components/garland-calculator-button/index.js +9 -14
  46. package/mobile/components/item-image/index.d.ts +4 -4
  47. package/mobile/components/item-image/index.js +10 -11
  48. package/mobile/components/modifiers-list/modifier-item/index.js +7 -7
  49. package/mobile/components/person-screen/index.d.ts +3 -3
  50. package/mobile/components/person-screen/index.js +16 -14
  51. package/mobile/components/product-actions-alert/index.d.ts +2 -5
  52. package/mobile/components/product-actions-alert/index.js +2 -5
  53. package/mobile/components/product-slider/index.d.ts +6 -9
  54. package/mobile/components/product-slider/index.js +17 -14
  55. package/mobile/components/product-slider/{item.module.scss → product-slider.module.scss} +1 -12
  56. package/mobile/components/pseudo-input/index.d.ts +5 -8
  57. package/mobile/components/pseudo-input/index.js +21 -10
  58. package/mobile/components/pseudo-input/pseudo-input.module.scss +6 -9
  59. package/mobile/components/search-bar/index.js +25 -25
  60. package/mobile/components/select-screen/index.d.ts +2 -2
  61. package/mobile/components/select-screen/index.js +7 -18
  62. package/package.json +30 -30
  63. package/README.md +0 -86
  64. package/common/__fixtures__/list-item.d.ts +0 -53
  65. package/common/__fixtures__/list-item.js +0 -107
  66. package/common/helpers/get-contained-items.d.ts +0 -7
  67. package/common/helpers/get-contained-items.js +0 -18
  68. package/common/icons/filled-rate.svg +0 -3
  69. package/common/icons/full-left-arrow.svg +0 -1
  70. package/common/icons/full-right-arrow.svg +0 -1
  71. package/common/icons/grid-small.svg +0 -11
  72. package/common/icons/grid.svg +0 -6
  73. package/common/icons/list.svg +0 -5
  74. package/common/icons/page.svg +0 -1
  75. package/common/icons/step-arrows.svg +0 -4
  76. package/common/icons/triple-dots.svg +0 -3
  77. package/common/icons/white-spinner.svg +0 -3
  78. package/desktop/components/breadcrumbs/items.d.ts +0 -3
  79. package/desktop/components/breadcrumbs/items.js +0 -157
  80. package/mobile/components/garland-calculator-button/tree-in-circle.svg +0 -6
  81. package/mobile/components/product-slider/item.d.ts +0 -18
  82. package/mobile/components/product-slider/item.js +0 -58
  83. package/mobile/components/product-slider/utils.d.ts +0 -4
@@ -1,37 +1,47 @@
1
+ @use 'node_modules/@sima-land/ui-nucleons/colors';
2
+ @use 'node_modules/@sima-land/ui-nucleons/breakpoints';
3
+
1
4
  .image-overlay {
2
5
  position: relative;
3
6
  max-width: 100%;
4
7
  margin-bottom: 8px;
5
- }
6
-
7
- .favorite-btn {
8
- position: absolute;
9
- top: 4px;
10
- right: 4px;
8
+ overflow: hidden;
9
+ aspect-ratio: 1 / 1;
11
10
  }
12
11
 
13
12
  .image-link {
14
13
  display: block;
15
- // фиксируем соотношение сторон чтобы размер не скакал при загрузке изображения
16
- &::before {
17
- display: block;
18
- content: '';
19
- padding-top: 100%;
20
- pointer-events: none;
21
- }
14
+ height: 100%;
22
15
  }
23
16
 
24
17
  .image {
25
18
  display: block;
26
- position: absolute;
27
- top: 0;
28
- left: 0;
19
+ object-fit: contain;
29
20
  width: 100%;
30
21
  height: 100%;
31
- object-fit: contain;
22
+ &:not(.adult) {
23
+ position: absolute;
24
+ top: 0;
25
+ left: 0;
26
+ }
27
+ &.adult {
28
+ opacity: 0.2;
29
+ filter: blur(24px);
30
+ pointer-events: none;
31
+ }
32
+ }
33
+
34
+ .adult-icon {
35
+ position: absolute;
36
+ width: 40%;
37
+ height: 40%;
38
+ top: 50%;
39
+ left: 50%;
40
+ transform: translate(-50%, -50%);
41
+ fill: colors.$gray38;
32
42
  }
33
43
 
34
- .on-image {
44
+ .image-buttons {
35
45
  position: absolute;
36
46
  top: 0;
37
47
  left: 0;
@@ -43,6 +53,32 @@
43
53
  }
44
54
  }
45
55
 
56
+ .image-button {
57
+ display: block;
58
+ border: 0;
59
+ outline: 0;
60
+ background: transparent;
61
+ position: absolute;
62
+ --gutter: 8px;
63
+ right: var(--gutter);
64
+ cursor: pointer;
65
+ &:nth-child(1) {
66
+ top: var(--gutter);
67
+ }
68
+ &:nth-child(2) {
69
+ bottom: var(--gutter);
70
+ }
71
+ &:nth-child(n + 3) {
72
+ display: none;
73
+ }
74
+ &:hover {
75
+ fill: colors.$gray54;
76
+ }
77
+ @include breakpoints.down('ml') {
78
+ --gutter: 4px;
79
+ }
80
+ }
81
+
46
82
  .badges {
47
83
  margin-bottom: 8px;
48
84
  }
@@ -52,34 +88,50 @@
52
88
  display: flex;
53
89
  align-items: center;
54
90
 
55
- // чтобы старая цена скрывалась если не влазит, согласовано с дизайнерами
56
- height: 24px;
57
- overflow: hidden;
58
- flex-wrap: wrap;
91
+ font-size: 16px;
92
+ font-weight: 700;
93
+ line-height: 24px;
94
+
95
+ // чтобы старая цена скрывалась если не влазит
96
+ &.height-limit {
97
+ height: 24px;
98
+ overflow: hidden;
99
+ flex-wrap: wrap;
100
+ }
59
101
  }
60
102
 
61
103
  .price {
62
- font-size: 16px;
63
- font-weight: 600;
64
- line-height: 24px;
104
+ font-size: inherit;
105
+ line-height: inherit;
65
106
  margin-right: 8px;
66
107
  }
67
108
 
68
109
  .old-price {
69
110
  font-size: 12px;
70
111
  line-height: 16px;
112
+ font-weight: 400;
71
113
  }
72
114
 
73
115
  .link {
74
- overflow: hidden;
75
- word-break: break-word;
76
- max-height: 40px;
77
116
  max-width: 100%;
78
117
  font-size: 14px;
79
118
  line-height: 20px;
80
- display: -webkit-box;
81
- -webkit-line-clamp: 2;
82
- -webkit-box-orient: vertical;
119
+ &.line-clamp {
120
+ overflow: hidden;
121
+ word-break: break-word;
122
+ max-height: 40px;
123
+ display: -webkit-box;
124
+ -webkit-line-clamp: 2;
125
+ -webkit-box-orient: vertical;
126
+ }
127
+ }
128
+
129
+ .adult-info {
130
+ display: block;
131
+ max-width: 100%;
132
+ font-size: 14px;
133
+ line-height: 20px;
134
+ color: colors.$gray87;
83
135
  }
84
136
 
85
137
  .trademark-link {
@@ -91,3 +143,74 @@
91
143
  overflow: hidden;
92
144
  text-overflow: ellipsis;
93
145
  }
146
+
147
+ // футер
148
+ .footer {
149
+ margin-top: 16px;
150
+ }
151
+
152
+ .text-button {
153
+ font-size: 16px;
154
+ line-height: 24px;
155
+ font-weight: 600;
156
+ &:hover,
157
+ &:active {
158
+ font-weight: 600;
159
+ }
160
+ @include breakpoints.down('ml') {
161
+ font-size: 14px;
162
+ line-height: 20px;
163
+ }
164
+ }
165
+
166
+ .wait-list-added-text {
167
+ font-size: 16px;
168
+ line-height: 24px;
169
+ font-weight: 600;
170
+ color: colors.$gray24;
171
+ @include breakpoints.down('ml') {
172
+ font-size: 14px;
173
+ line-height: 20px;
174
+ }
175
+ }
176
+
177
+ // блок корзины
178
+ .control-wrapper {
179
+ display: flex;
180
+ flex-wrap: wrap;
181
+ margin-top: 16px;
182
+ &.loading {
183
+ .control {
184
+ background: colors.$gray4;
185
+ border-radius: 4px;
186
+ }
187
+ .unit-text::before {
188
+ content: '';
189
+ display: block;
190
+ background: colors.$gray4;
191
+ border-radius: 4px;
192
+ width: 48px;
193
+ height: 16px;
194
+ }
195
+ }
196
+ }
197
+
198
+ .control {
199
+ width: 122px;
200
+ height: 40px;
201
+ margin-right: 16px;
202
+ }
203
+
204
+ .unit-text {
205
+ padding-top: 12px; // чтобы при переносе на следующую строку правильно отступил от кнопки
206
+ font-size: 12px;
207
+ line-height: 16px;
208
+ color: colors.$gray38;
209
+ }
210
+
211
+ .bottom-text {
212
+ margin-top: 12px;
213
+ font-size: 12px;
214
+ line-height: 16px;
215
+ color: colors.$gray38;
216
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface ProductInfoProps {
3
+ restriction?: 'adult' | 'unavailable';
4
+ children?: React.ReactNode;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ProductInfoProps } from './types';
3
+ export declare const ProductInfoContext: import("react").Context<Pick<ProductInfoProps, "restriction">>;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SliderContext = void 0;
3
+ exports.ProductInfoContext = void 0;
4
4
  const react_1 = require("react");
5
- exports.SliderContext = react_1.createContext({ needLoadImages: false });
5
+ exports.ProductInfoContext = (0, react_1.createContext)({});
@@ -44,7 +44,7 @@ const cx = bind_1.default.bind(quick_view_button_module_scss_1.default);
44
44
  * @param props Свойства компонента.
45
45
  * @return Элемент.
46
46
  */
47
- exports.QuickViewButton = react_1.forwardRef((_a, ref) => {
47
+ exports.QuickViewButton = (0, react_1.forwardRef)((_a, ref) => {
48
48
  var { onClick, className } = _a, restProps = __rest(_a, ["onClick", "className"]);
49
49
  return (react_1.default.createElement(quick_view_svg_1.default, Object.assign({}, restProps, { ref: ref, role: 'button', "aria-label": '\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440', className: cx('root', className), width: 24, height: 24, onClick: onClick, "data-testid": 'quick-view-button' })));
50
50
  });
@@ -49,7 +49,7 @@ const cx = bind_1.default.bind(wish_button_module_scss_1.default);
49
49
  * @param props.disabled Признак загрузки добавления товара в список избранного.
50
50
  * @return Элемент.
51
51
  */
52
- exports.WishButton = react_1.forwardRef((_a, ref) => {
52
+ exports.WishButton = (0, react_1.forwardRef)((_a, ref) => {
53
53
  var { checked, className, onClick, disabled } = _a, restProps = __rest(_a, ["checked", "className", "onClick", "disabled"]);
54
54
  const Icon = checked ? filled_heart_svg_1.default : heart_svg_1.default;
55
55
  return (react_1.default.createElement(Icon, Object.assign({}, restProps, { ref: ref, role: 'button', "aria-label": checked ? 'Убрать из избранного' : 'Добавить в избранное', className: cx('button', className, { checked, disabled }), onClick: disabled ? undefined : onClick, "data-testid": 'favorite-button', width: 24, height: 24 })));
@@ -1,3 +1,5 @@
1
1
  <svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
2
- <path opacity="0.3" fill-rule="evenodd" d="M106.163 37.2641H101.212V23.2372H87.1854V18.2862H101.212V4.2587H106.163V18.2862H120.191V23.2372H106.163V37.2641ZM70.2788 52.7828C71.5464 54.2213 73.8876 55.6569 77.3059 57.0961C80.3783 55.7891 82.5529 54.3858 83.831 52.8827C85.1099 51.3788 85.7497 49.6254 85.7497 47.6209C85.7497 45.4231 84.9714 43.6746 83.4134 42.3782C81.8561 41.0824 79.7118 40.4356 76.9846 40.4356C74.2968 40.4356 72.1918 41.088 70.6662 42.3943C69.1412 43.7006 68.3777 45.4442 68.3777 47.6209C68.3777 49.6254 69.0104 51.3472 70.2788 52.7828ZM69.0217 66.3583C67.5832 68.0449 66.8633 70.0648 66.8633 72.4166C66.8633 75.0306 67.759 77.0667 69.5532 78.5269C71.3467 79.9872 73.8658 80.7142 77.1119 80.7142C80.315 80.7142 82.8053 79.9549 84.5883 78.4299C86.3719 76.905 87.2655 74.8148 87.2655 72.1558C87.2655 70.0438 86.4282 68.1652 84.7507 66.5221C83.0739 64.8762 80.1526 63.2817 75.9848 61.7349C72.7824 63.1277 70.4616 64.6688 69.0217 66.3583ZM65.0585 54.0083C63.7698 52.039 63.1237 49.8328 63.1237 47.3917C63.1237 43.9298 64.3857 41.1689 66.9111 39.1103C69.4358 37.0524 72.814 36.0225 77.0479 36.0225C81.3464 36.0225 84.7507 37.0356 87.2655 39.0618C89.7797 41.088 91.0368 43.8869 91.0368 47.4592C91.0368 49.8117 90.3168 51.9553 88.8762 53.8951C87.4378 55.8327 85.1388 57.5967 81.9792 59.1863C85.8031 61.0368 88.5226 62.9822 90.1333 65.019C91.7469 67.0557 92.5519 69.4131 92.5519 72.0911C92.5519 76.0564 91.1858 79.2188 88.4586 81.5825C85.7286 83.9448 81.989 85.1273 77.2426 85.1273C72.2136 85.1273 68.3461 84.0094 65.6378 81.7786C62.9296 79.545 61.5762 76.3826 61.5762 72.2872C61.5762 66.8216 64.8645 62.5617 71.4395 59.5126C68.474 57.8154 66.3472 55.9804 65.0585 54.0083ZM62.0185 123.903C27.8404 123.903 0.133301 96.1964 0.133301 62.0183C0.133301 27.8402 27.8404 0.133118 62.0185 0.133118C69.2333 0.133118 76.1606 1.3677 82.5986 3.63789C82.6471 4.73608 82.6471 8.81386 82.6471 8.79698C76.2274 6.28845 69.3261 5.0841 62.0185 5.0841C30.5746 5.0841 5.08428 30.5744 5.08428 62.0183C5.08428 93.4621 30.5746 118.952 62.0185 118.952C93.4623 118.952 118.953 93.4621 118.953 62.0183C118.953 54.7296 117.583 47.7608 115.087 41.3552C117.817 41.3897 119.9 41.3897 120.38 41.3833C122.662 47.8368 123.904 54.7823 123.904 62.0183C123.904 96.1964 96.1966 123.903 62.0185 123.903ZM32.6789 50.2019L29.8434 46.4791L42.3165 36.7101H46.8273V84.4728H41.6071V50.4311C41.6071 47.5991 41.6922 44.9212 41.8651 42.3943C41.413 42.852 40.9082 43.3322 40.35 43.8335C39.7918 44.3341 37.2347 46.4573 32.6789 50.2019Z" transform="matrix(0.2903226,0,0,0.2903226,0,0)"/>
2
+ <path fill-rule="evenodd"
3
+ d="M106.163 37.2641H101.212V23.2372H87.1854V18.2862H101.212V4.2587H106.163V18.2862H120.191V23.2372H106.163V37.2641ZM70.2788 52.7828C71.5464 54.2213 73.8876 55.6569 77.3059 57.0961C80.3783 55.7891 82.5529 54.3858 83.831 52.8827C85.1099 51.3788 85.7497 49.6254 85.7497 47.6209C85.7497 45.4231 84.9714 43.6746 83.4134 42.3782C81.8561 41.0824 79.7118 40.4356 76.9846 40.4356C74.2968 40.4356 72.1918 41.088 70.6662 42.3943C69.1412 43.7006 68.3777 45.4442 68.3777 47.6209C68.3777 49.6254 69.0104 51.3472 70.2788 52.7828ZM69.0217 66.3583C67.5832 68.0449 66.8633 70.0648 66.8633 72.4166C66.8633 75.0306 67.759 77.0667 69.5532 78.5269C71.3467 79.9872 73.8658 80.7142 77.1119 80.7142C80.315 80.7142 82.8053 79.9549 84.5883 78.4299C86.3719 76.905 87.2655 74.8148 87.2655 72.1558C87.2655 70.0438 86.4282 68.1652 84.7507 66.5221C83.0739 64.8762 80.1526 63.2817 75.9848 61.7349C72.7824 63.1277 70.4616 64.6688 69.0217 66.3583ZM65.0585 54.0083C63.7698 52.039 63.1237 49.8328 63.1237 47.3917C63.1237 43.9298 64.3857 41.1689 66.9111 39.1103C69.4358 37.0524 72.814 36.0225 77.0479 36.0225C81.3464 36.0225 84.7507 37.0356 87.2655 39.0618C89.7797 41.088 91.0368 43.8869 91.0368 47.4592C91.0368 49.8117 90.3168 51.9553 88.8762 53.8951C87.4378 55.8327 85.1388 57.5967 81.9792 59.1863C85.8031 61.0368 88.5226 62.9822 90.1333 65.019C91.7469 67.0557 92.5519 69.4131 92.5519 72.0911C92.5519 76.0564 91.1858 79.2188 88.4586 81.5825C85.7286 83.9448 81.989 85.1273 77.2426 85.1273C72.2136 85.1273 68.3461 84.0094 65.6378 81.7786C62.9296 79.545 61.5762 76.3826 61.5762 72.2872C61.5762 66.8216 64.8645 62.5617 71.4395 59.5126C68.474 57.8154 66.3472 55.9804 65.0585 54.0083ZM62.0185 123.903C27.8404 123.903 0.133301 96.1964 0.133301 62.0183C0.133301 27.8402 27.8404 0.133118 62.0185 0.133118C69.2333 0.133118 76.1606 1.3677 82.5986 3.63789C82.6471 4.73608 82.6471 8.81386 82.6471 8.79698C76.2274 6.28845 69.3261 5.0841 62.0185 5.0841C30.5746 5.0841 5.08428 30.5744 5.08428 62.0183C5.08428 93.4621 30.5746 118.952 62.0185 118.952C93.4623 118.952 118.953 93.4621 118.953 62.0183C118.953 54.7296 117.583 47.7608 115.087 41.3552C117.817 41.3897 119.9 41.3897 120.38 41.3833C122.662 47.8368 123.904 54.7823 123.904 62.0183C123.904 96.1964 96.1966 123.903 62.0185 123.903ZM32.6789 50.2019L29.8434 46.4791L42.3165 36.7101H46.8273V84.4728H41.6071V50.4311C41.6071 47.5991 41.6922 44.9212 41.8651 42.3943C41.413 42.852 40.9082 43.3322 40.35 43.8335C39.7918 44.3341 37.2347 46.4573 32.6789 50.2019Z"
4
+ transform="matrix(0.2903226,0,0,0.2903226,0,0)" />
3
5
  </svg>
@@ -47,12 +47,12 @@ exports.Breadcrumbs = Breadcrumbs;
47
47
  */
48
48
  const Breadcrumb = ({ data, onSiblingsPopupOpen, isSiblingActive, }) => {
49
49
  var _a;
50
- const popupRef = react_1.useRef(null);
51
- const [withPopup, togglePopup] = react_1.useState(false);
50
+ const popupRef = (0, react_1.useRef)(null);
51
+ const [withPopup, togglePopup] = (0, react_1.useState)(false);
52
52
  // с useOutsideClick не работает после обновления React до 17 версии, пока так
53
- react_1.useEffect(() => {
53
+ (0, react_1.useEffect)(() => {
54
54
  if (withPopup) {
55
- return on_1.default(window, 'mousedown', togglePopup.bind(null, false));
55
+ return (0, on_1.default)(window, 'mousedown', togglePopup.bind(null, false));
56
56
  }
57
57
  }, [withPopup]);
58
58
  const selfName = (react_1.default.createElement(link_1.Link, { color: 'gray87', href: data.url }, data.name));
@@ -74,6 +74,6 @@ const Breadcrumb = ({ data, onSiblingsPopupOpen, isSiblingActive, }) => {
74
74
  selfName,
75
75
  react_1.default.createElement(square_arrow_down_svg_1.default, { "data-testid": 'breadcrumb:siblings-closer', className: cx('toggle-icon', 'close'), onClick: () => togglePopup(false) })),
76
76
  react_1.default.createElement("ul", { className: cx('siblings') },
77
- data.siblings.state === 'fetching' && (react_1.default.createElement(react_1.default.Fragment, null, lodash_1.times(8).map(index => (react_1.default.createElement("div", { key: index, className: cx('sibling-placeholder') }))))),
77
+ data.siblings.state === 'fetching' && (react_1.default.createElement(react_1.default.Fragment, null, (0, lodash_1.times)(8).map(index => (react_1.default.createElement("div", { key: index, className: cx('sibling-placeholder') }))))),
78
78
  data.siblings.state === 'ready' && (react_1.default.createElement(react_1.default.Fragment, null, (_a = data.siblings.data) === null || _a === void 0 ? void 0 : _a.map((sibling, index) => (react_1.default.createElement("li", { key: index, className: cx('sibling'), "data-testid": 'breadcrumb-sibling' }, isSiblingActive(sibling) ? (react_1.default.createElement("span", { className: cx('active') }, sibling.name)) : (react_1.default.createElement(link_1.Link, { color: 'gray87', className: cx('link'), href: sibling.url, children: sibling.name }))))))))))))));
79
79
  };
@@ -36,16 +36,16 @@ const turn_left_svg_1 = __importDefault(require("../icons/turn-left.svg"));
36
36
  const turn_right_svg_1 = __importDefault(require("../icons/turn-right.svg"));
37
37
  const cx = bind_1.default.bind(all_round_view_module_scss_1.default);
38
38
  const AllRoundView = ({ photos }) => {
39
- const imageRef = react_1.useRef(null);
40
- const dragStartRef = react_1.useRef(null);
41
- const [state, setState] = react_1.useState('autoplay');
39
+ const imageRef = (0, react_1.useRef)(null);
40
+ const dragStartRef = (0, react_1.useRef)(null);
41
+ const [state, setState] = (0, react_1.useState)('autoplay');
42
42
  const autoplay = state === 'autoplay';
43
43
  const ChangeState = (bindState) => () => setState(bindState);
44
- const [index, setIndex] = react_1.useState(0);
45
- const indexRef = identity_1.useIdentityRef(index);
46
- const photosReady = utils_1.useImagesLoad(photos);
44
+ const [index, setIndex] = (0, react_1.useState)(0);
45
+ const indexRef = (0, identity_1.useIdentityRef)(index);
46
+ const photosReady = (0, utils_1.useImagesLoad)(photos);
47
47
  // запуск/остановка вращения
48
- react_1.useEffect(() => {
48
+ (0, react_1.useEffect)(() => {
49
49
  if (state !== 'default' && photosReady) {
50
50
  const timerId = window.setInterval(() => {
51
51
  const increment = state === 'turn-left' ? -1 : 1;
@@ -55,14 +55,14 @@ const AllRoundView = ({ photos }) => {
55
55
  }
56
56
  }, [state, photosReady]);
57
57
  // перетаскивание
58
- react_1.useEffect(() => {
58
+ (0, react_1.useEffect)(() => {
59
59
  // переданное число всегда замениться на такое, которое будет в промежутке от 0 до количества фото
60
60
  const wrap = (value) => (photos.length + value) % photos.length;
61
61
  const image = imageRef.current;
62
62
  const imageWidth = image.clientWidth;
63
63
  const imageLeft = image.getBoundingClientRect().left;
64
64
  const offList = [
65
- on_1.default(image, 'pointerdown', e => {
65
+ (0, on_1.default)(image, 'pointerdown', e => {
66
66
  e.preventDefault();
67
67
  setState('default');
68
68
  image.style.touchAction = 'none';
@@ -71,7 +71,7 @@ const AllRoundView = ({ photos }) => {
71
71
  index: indexRef.current,
72
72
  };
73
73
  }),
74
- on_1.default(window, 'pointermove', e => {
74
+ (0, on_1.default)(window, 'pointermove', e => {
75
75
  if (dragStartRef.current !== null) {
76
76
  const startX = dragStartRef.current.position;
77
77
  const currentX = e.clientX - imageLeft;
@@ -81,7 +81,7 @@ const AllRoundView = ({ photos }) => {
81
81
  setIndex(nextIndex);
82
82
  }
83
83
  }),
84
- on_1.default(window, 'pointerup', () => {
84
+ (0, on_1.default)(window, 'pointerup', () => {
85
85
  dragStartRef.current = null;
86
86
  image.style.touchAction = '';
87
87
  }),
@@ -49,23 +49,23 @@ const bind_1 = __importDefault(require("classnames/bind"));
49
49
  const gallery_modal_module_scss_1 = __importDefault(require("./gallery-modal.module.scss"));
50
50
  const cx = bind_1.default.bind(gallery_modal_module_scss_1.default);
51
51
  const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToReview, onMediaChange, withScrollDisable, scrollDisableOptions, onVideoEvent, }) => {
52
- const [currentIndex, setCurrent] = react_1.useState(defaultMediaIndex);
53
- const thumbnailsRef = react_1.useRef(null);
54
- const areaRef = react_1.useRef(null);
52
+ const [currentIndex, setCurrent] = (0, react_1.useState)(defaultMediaIndex);
53
+ const thumbnailsRef = (0, react_1.useRef)(null);
54
+ const areaRef = (0, react_1.useRef)(null);
55
55
  const footerGutter = 40;
56
56
  const footerHeight = 20;
57
57
  const correction = review ? footerGutter + footerHeight : 0;
58
- const size = utils_1.useRectFit(areaRef, { correction });
58
+ const size = (0, utils_1.useRectFit)(areaRef, { correction });
59
59
  const innerStyles = Object.assign({}, (size !== null && {
60
60
  '--area-height': `${size + correction}px`,
61
61
  '--all-round-view-size': `${size}px`,
62
62
  }));
63
- const handlerRef = identity_1.useIdentityRef(onMediaChange);
64
- react_1.useEffect(() => {
63
+ const handlerRef = (0, identity_1.useIdentityRef)(onMediaChange);
64
+ (0, react_1.useEffect)(() => {
65
65
  var _a;
66
66
  (_a = handlerRef.current) === null || _a === void 0 ? void 0 : _a.call(handlerRef, media[currentIndex], currentIndex);
67
67
  thumbnailsRef.current &&
68
- scroll_to_child_1.scrollToChild(thumbnailsRef.current, thumbnailsRef.current.children[currentIndex]);
68
+ (0, scroll_to_child_1.scrollToChild)(thumbnailsRef.current, thumbnailsRef.current.children[currentIndex]);
69
69
  }, [currentIndex]);
70
70
  return (react_1.default.createElement(modal_1.Modal, Object.assign({ size: 'fullscreen', onClose: onClose }, { withScrollDisable, scrollDisableOptions }),
71
71
  react_1.default.createElement(modal_1.Modal.Header, { onClose: onClose }),
@@ -20,6 +20,6 @@ const classnames_1 = __importDefault(require("classnames"));
20
20
  const image_overlay_module_scss_1 = __importDefault(require("./image-overlay.module.scss"));
21
21
  const ImageOverlay = (_a) => {
22
22
  var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
23
- return (react_1.default.createElement("div", Object.assign({ className: classnames_1.default(image_overlay_module_scss_1.default.root, className) }, restProps), children));
23
+ return (react_1.default.createElement("div", Object.assign({ className: (0, classnames_1.default)(image_overlay_module_scss_1.default.root, className) }, restProps), children));
24
24
  };
25
25
  exports.ImageOverlay = ImageOverlay;
@@ -9,7 +9,7 @@ const link_1 = require("@sima-land/ui-nucleons/link");
9
9
  const rating_1 = require("@sima-land/ui-nucleons/rating");
10
10
  const classnames_1 = __importDefault(require("classnames"));
11
11
  const review_info_module_scss_1 = __importDefault(require("./review-info.module.scss"));
12
- const ReviewInfo = ({ rating, author, onGoToReview, className }) => (react_1.default.createElement("div", { className: classnames_1.default(review_info_module_scss_1.default.root, className) },
12
+ const ReviewInfo = ({ rating, author, onGoToReview, className }) => (react_1.default.createElement("div", { className: (0, classnames_1.default)(review_info_module_scss_1.default.root, className) },
13
13
  react_1.default.createElement(rating_1.Rating, { value: rating }),
14
14
  react_1.default.createElement("div", { className: review_info_module_scss_1.default.author }, author),
15
15
  onGoToReview && (react_1.default.createElement(link_1.Link, { className: review_info_module_scss_1.default.link, pseudo: true, onClick: onGoToReview, "data-testid": 'gallery-modal:go-to-review-link' }, "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u0442\u0437\u044B\u0432\u0443"))));
@@ -12,8 +12,8 @@ const on_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/on"));
12
12
  * @return Загружены ли все фото.
13
13
  */
14
14
  const useImagesLoad = (srcList) => {
15
- const [loadedCount, setLoadedCount] = react_1.useState(0);
16
- react_1.useEffect(() => {
15
+ const [loadedCount, setLoadedCount] = (0, react_1.useState)(0);
16
+ (0, react_1.useEffect)(() => {
17
17
  srcList.forEach(src => {
18
18
  const image = new Image();
19
19
  image.onload = () => setLoadedCount(c => c + 1);
@@ -31,8 +31,8 @@ exports.useImagesLoad = useImagesLoad;
31
31
  * @return Размер или null.
32
32
  */
33
33
  const useRectFit = (areaRef, { correction }) => {
34
- const [size, setSize] = react_1.useState(null);
35
- react_1.useEffect(() => {
34
+ const [size, setSize] = (0, react_1.useState)(null);
35
+ (0, react_1.useEffect)(() => {
36
36
  const calcSquareSize = () => {
37
37
  if (areaRef.current) {
38
38
  const availWidth = areaRef.current.clientWidth;
@@ -46,7 +46,7 @@ const useRectFit = (areaRef, { correction }) => {
46
46
  }
47
47
  };
48
48
  calcSquareSize();
49
- return on_1.default(window, 'resize', () => window.requestAnimationFrame(calcSquareSize));
49
+ return (0, on_1.default)(window, 'resize', () => window.requestAnimationFrame(calcSquareSize));
50
50
  }, [areaRef]);
51
51
  return size;
52
52
  };
@@ -60,7 +60,7 @@ export interface ItemImageProps {
60
60
  * @param {boolean} props.hasSelectionButton Признак наличия кнопки выделения товара.
61
61
  * @return {ReactElement} Компонент изображения.
62
62
  */
63
- export default class ItemImage extends Component<ItemImageProps, any> {
63
+ export declare class ItemImage extends Component<ItemImageProps, any> {
64
64
  bootStartTime: any;
65
65
  image: any;
66
66
  imageWrapper: any;
@@ -22,12 +22,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.ItemImage = void 0;
25
26
  const react_1 = __importStar(require("react"));
26
27
  const link_1 = require("@sima-land/ui-nucleons/link");
27
28
  const bind_1 = __importDefault(require("classnames/bind"));
28
29
  const lodash_1 = require("lodash");
29
30
  const item_image_module_scss_1 = __importDefault(require("./item-image.module.scss"));
30
31
  const badge_list_1 = require("../../../common/components/badge-list");
32
+ const badge_1 = require("../../../common/components/badge");
31
33
  const eighteen_plus_svg_1 = __importDefault(require("../../../common/icons/eighteen-plus.svg"));
32
34
  const selected_svg_1 = __importDefault(require("../../../common/icons/selected.svg"));
33
35
  const wish_button_1 = require("../../../common/components/wish-button");
@@ -88,8 +90,8 @@ class ItemImage extends react_1.Component {
88
90
  this.state = {
89
91
  currentPhotoIndex: null,
90
92
  };
91
- this.image = react_1.createRef();
92
- this.imageWrapper = react_1.createRef();
93
+ this.image = (0, react_1.createRef)();
94
+ this.imageWrapper = (0, react_1.createRef)();
93
95
  this.bootStartTime = Date.now();
94
96
  }
95
97
  /**
@@ -98,7 +100,7 @@ class ItemImage extends react_1.Component {
98
100
  componentDidMount() {
99
101
  const img = this.image.current;
100
102
  const { onLoadImage } = this.props;
101
- if (img && img.complete && lodash_1.isFunction(onLoadImage)) {
103
+ if (img && img.complete && (0, lodash_1.isFunction)(onLoadImage)) {
102
104
  onLoadImage(Date.now() - this.bootStartTime);
103
105
  }
104
106
  }
@@ -111,7 +113,7 @@ class ItemImage extends react_1.Component {
111
113
  const currentPhoto = currentPhotoIndex === null ? src : photos[currentPhotoIndex];
112
114
  return (react_1.default.createElement("div", { className: cx('wrapper', className), ref: this.imageWrapper, onMouseLeave: () => this.setState({ currentPhotoIndex: null }) },
113
115
  withBlur && (react_1.default.createElement("div", { className: cx('with-blur') },
114
- react_1.default.createElement(eighteen_plus_svg_1.default, { width: 124, height: 124 }))),
116
+ react_1.default.createElement(eighteen_plus_svg_1.default, { width: 124, height: 124, opacity: '0.3' }))),
115
117
  react_1.default.createElement("div", { className: cx('image-wrapper') },
116
118
  react_1.default.createElement(link_1.Link, { href: itemUrl },
117
119
  Array.isArray(photos) && photos.length > 1 && !withBlur && this.imageWrapper.current && (react_1.default.createElement("div", { className: cx('fake-hover-wrapper', fakeDivClassName) }, photos.map((value, index) => (react_1.default.createElement("div", { className: cx('fake-hover', { selected: index === currentPhotoIndex }), style: {
@@ -123,11 +125,11 @@ class ItemImage extends react_1.Component {
123
125
  withBlur ? (react_1.default.createElement("div", { className: cx('with-filter-blur'), children: this.getImage({ src: currentPhoto, alt }, onClick) })) : (this.getImage({ src: currentPhoto, alt }, onClick))),
124
126
  hasTrashButton && (react_1.default.createElement(trash_cart_svg_1.default, { width: 24, height: 24, color: 'gray87', className: cx('icon', buttonsPos, trashButtonProps.className), onClick: trashButtonProps.onClick, "data-testid": 'item-image:remove-button' }))),
125
127
  Array.isArray(badges) && Boolean(badges.length) && (react_1.default.createElement("div", { className: cx('badges') },
126
- react_1.default.createElement(badge_list_1.BadgeList, { items: badges }))),
128
+ react_1.default.createElement(badge_list_1.BadgeList, null, badges.map((badge, index) => (react_1.default.createElement(badge_1.Badge, Object.assign({ key: index }, badge))))))),
127
129
  hasWishButton && (react_1.default.createElement(wish_button_1.WishButton, { checked: wishProps.isWished, className: cx('icon', buttonsPos, hasTrashButton && 'as-second', wishProps.className), onClick: wishProps.onClick, disabled: isFetchingWishItems })),
128
130
  hasQuickPreview && (react_1.default.createElement(quick_view_button_1.QuickViewButton, { onClick: quickViewBtnProps.onClick, className: cx('icon', buttonsPos, (hasTrashButton || hasWishButton) && 'as-second', hasTrashButton && hasWishButton && 'as-third', quickViewBtnProps.className) })),
129
131
  hasSelectionButton && selectionProps && (react_1.default.createElement("div", { onClick: selectionProps.onSelect, className: cx('selection-container') },
130
132
  react_1.default.createElement("div", { className: cx('selection-circle') }, selectionProps.isSelected && react_1.default.createElement(selected_svg_1.default, { width: 56, height: 56 }))))));
131
133
  }
132
134
  }
133
- exports.default = ItemImage;
135
+ exports.ItemImage = ItemImage;
@@ -33,9 +33,9 @@ const typesList = Object.values(constants_1.MODIFIERS_TYPES);
33
33
  /**
34
34
  * Компонент модификатора.
35
35
  */
36
- exports.ModifierButton = react_1.forwardRef(function ModifierButton({ count = null, content, selected, color, image, type: typeProp = 'text', className, onClick, isMarkdown: hasMarkdown, squared = [constants_1.MODIFIERS_TYPES.color, constants_1.MODIFIERS_TYPES.image].includes(typeProp), 'data-testid': testId = 'modifier-button', }, ref) {
36
+ exports.ModifierButton = (0, react_1.forwardRef)(function ModifierButton({ count = null, content, selected, color, image, type: typeProp = 'text', className, onClick, isMarkdown: hasMarkdown, squared = [constants_1.MODIFIERS_TYPES.color, constants_1.MODIFIERS_TYPES.image].includes(typeProp), 'data-testid': testId = 'modifier-button', }, ref) {
37
37
  const type = typesList.includes(typeProp) ? typeProp : 'text';
38
- const hasCount = lodash_1.isNumber(count) && count >= 0;
38
+ const hasCount = (0, lodash_1.isNumber)(count) && count >= 0;
39
39
  return (react_1.default.createElement("div", { ref: ref, className: cx('modifier-button', squared && 'squared', selected && 'selected', className), style: color ? { background: color } : undefined, onClick: onClick, "data-testid": testId },
40
40
  (hasCount || hasMarkdown) && (react_1.default.createElement("span", { className: cx('label', hasCount && 'with-count'), "data-testid": 'modifier-button:badge' },
41
41
  hasCount && (count > 99 ? '99+' : count),
@@ -48,13 +48,13 @@ const createHiddenNodeIndexFinder = (container) => (childNode) => {
48
48
  return childOffsetTop - container.offsetTop >= container.clientHeight;
49
49
  };
50
50
  exports.createHiddenNodeIndexFinder = createHiddenNodeIndexFinder;
51
- const defaultGetItemType = prop_1.default('type');
52
- const defaultGetItemCount = prop_1.default('count');
53
- const defaultGetItemColor = prop_1.default('color');
54
- const defaultGetItemContent = prop_1.default('content');
55
- const defaultIsSelectedItem = prop_1.default('selected');
56
- const defaultGetItemImage = prop_1.default('image');
57
- const defaultGetIsMarkdown = prop_1.default('isMarkdown');
51
+ const defaultGetItemType = (0, prop_1.default)('type');
52
+ const defaultGetItemCount = (0, prop_1.default)('count');
53
+ const defaultGetItemColor = (0, prop_1.default)('color');
54
+ const defaultGetItemContent = (0, prop_1.default)('content');
55
+ const defaultIsSelectedItem = (0, prop_1.default)('selected');
56
+ const defaultGetItemImage = (0, prop_1.default)('image');
57
+ const defaultGetIsMarkdown = (0, prop_1.default)('isMarkdown');
58
58
  /**
59
59
  * Возвращает компонент списка модификаторов.
60
60
  * @param {Object} props Свойства компонента.
@@ -82,12 +82,12 @@ class ModifiersGroup extends react_1.Component {
82
82
  lastVisibleChildIndex: null,
83
83
  };
84
84
  this.windowWidth = 0;
85
- this.containerRef = react_1.createRef();
86
- this.showingButtonRef = react_1.createRef();
85
+ this.containerRef = (0, react_1.createRef)();
86
+ this.showingButtonRef = (0, react_1.createRef)();
87
87
  /**
88
88
  * Сбрасывает информацию о видимых и невидимых дочерних узлах контейнера.
89
89
  */
90
- this.resetVisibleNodesData = lodash_1.debounce(() => {
90
+ this.resetVisibleNodesData = (0, lodash_1.debounce)(() => {
91
91
  if (document.documentElement.offsetWidth !== this.windowWidth) {
92
92
  this.windowWidth = document.documentElement.offsetWidth;
93
93
  this.setState({
@@ -107,7 +107,7 @@ class ModifiersGroup extends react_1.Component {
107
107
  const showingButtonEl = this.showingButtonRef.current;
108
108
  if (containerEl && showingButtonEl) {
109
109
  const childList = [...containerEl.children];
110
- const firstHiddenNodeIndex = childList.findIndex(exports.createHiddenNodeIndexFinder(containerEl));
110
+ const firstHiddenNodeIndex = childList.findIndex((0, exports.createHiddenNodeIndexFinder)(containerEl));
111
111
  if (firstHiddenNodeIndex !== -1) {
112
112
  const lastVisibleElIndex = firstHiddenNodeIndex - 1;
113
113
  const lastVisibleNode = childList[lastVisibleElIndex];
@@ -143,7 +143,7 @@ class ModifiersGroup extends react_1.Component {
143
143
  */
144
144
  componentDidMount() {
145
145
  this.windowWidth = document.documentElement.offsetWidth;
146
- this.removeGlobalListener = on_1.default(window, 'resize', this.resetVisibleNodesData);
146
+ this.removeGlobalListener = (0, on_1.default)(window, 'resize', this.resetVisibleNodesData);
147
147
  this.checkVisibleNodes();
148
148
  }
149
149
  /**
@@ -27,9 +27,9 @@ const ModifiersWidget = ({ title, items, sizesTableUrl, onSelectItem, }) => (rea
27
27
  " (",
28
28
  items.length,
29
29
  "\u00A0",
30
- get_declination_1.default(items.length, ['вариант', 'варианта', 'вариантов']),
30
+ (0, get_declination_1.default)(items.length, ['вариант', 'варианта', 'вариантов']),
31
31
  "):")),
32
- react_1.default.createElement(group_1.ModifiersGroup, { items: items, getItemContent: prop_1.default('name'), getItemCount: prop_1.default('inCartQty'), onSelectItem: (item, selected) => {
32
+ react_1.default.createElement(group_1.ModifiersGroup, { items: items, getItemContent: (0, prop_1.default)('name'), getItemCount: (0, prop_1.default)('inCartQty'), onSelectItem: (item, selected) => {
33
33
  !selected && onSelectItem && onSelectItem(item);
34
34
  } }),
35
35
  Boolean(sizesTableUrl) && (react_1.default.createElement(link_1.Link, { href: sizesTableUrl, className: cx('modifiers-link') }, "\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u0432"))));
@@ -36,4 +36,3 @@ export interface PersonModalProps {
36
36
  * @return Элемент.
37
37
  */
38
38
  export declare const PersonModal: ({ name, appointment, photoUrl, email, skype, social, phoneHref, phoneText, secondPhoneHref, secondPhoneText, arbitraryLinkProps, onClose, withScrollDisable, scrollDisableOptions, }: PersonModalProps) => JSX.Element;
39
- export default PersonModal;
@@ -21,7 +21,7 @@ const cx = bind_1.default.bind(person_modal_module_scss_1.default);
21
21
  * @return Элемент.
22
22
  */
23
23
  const PersonModal = ({ name, appointment, photoUrl, email, skype, social, phoneHref, phoneText, secondPhoneHref, secondPhoneText, arbitraryLinkProps, onClose, withScrollDisable, scrollDisableOptions, }) => {
24
- keydown_1.useKeydown('Escape', onClose);
24
+ (0, keydown_1.useKeydown)('Escape', onClose);
25
25
  return (react_1.default.createElement(modal_1.Modal, { size: 's', withScrollDisable: withScrollDisable, scrollDisableOptions: scrollDisableOptions, onClose: onClose },
26
26
  react_1.default.createElement(modal_1.Modal.Body, null,
27
27
  react_1.default.createElement("div", { className: cx('main') },
@@ -53,4 +53,3 @@ const PersonModal = ({ name, appointment, photoUrl, email, skype, social, phoneH
53
53
  react_1.default.createElement(clean_buttons_1.Clean.Button, { onClick: onClose }, "\u0417\u0430\u043A\u0440\u044B\u0442\u044C")))));
54
54
  };
55
55
  exports.PersonModal = PersonModal;
56
- exports.default = exports.PersonModal;