@sima-land/moleculas 13.2.3 → 14.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 (32) hide show
  1. package/common/components/badge/index.d.ts +1 -3
  2. package/common/components/badge/index.js +1 -2
  3. package/common/components/intractive-image/index.d.ts +18 -0
  4. package/common/components/intractive-image/index.js +53 -0
  5. package/common/components/intractive-image/interactive-image.module.scss +50 -0
  6. package/common/constants.d.ts +2 -5
  7. package/common/constants.js +2 -2
  8. package/common/types.d.ts +1 -0
  9. package/common/types.js +2 -0
  10. package/desktop/components/modifiers/button/index.d.ts +5 -3
  11. package/desktop/components/modifiers/button/index.js +5 -7
  12. package/desktop/components/modifiers/button/modifier-button.module.scss +4 -0
  13. package/desktop/components/modifiers/group/index.d.ts +11 -81
  14. package/desktop/components/modifiers/group/index.js +29 -133
  15. package/desktop/components/modifiers/group/modifiers-group.module.scss +19 -31
  16. package/desktop/components/modifiers/group/utils.d.ts +20 -0
  17. package/desktop/components/modifiers/group/utils.js +73 -0
  18. package/desktop/components/modifiers/modifiers.scss +5 -0
  19. package/desktop/components/product-carousel/index.js +1 -1
  20. package/mobile/components/modifiers-list/modifier-item/index.d.ts +2 -1
  21. package/mobile/components/modifiers-list/modifier-item/index.js +3 -3
  22. package/package.json +1 -1
  23. package/desktop/components/item-image/index.d.ts +0 -88
  24. package/desktop/components/item-image/index.js +0 -135
  25. package/desktop/components/item-image/item-image.module.scss +0 -158
  26. package/desktop/components/modifiers/widget/index.d.ts +0 -18
  27. package/desktop/components/modifiers/widget/index.js +0 -36
  28. package/desktop/components/modifiers/widget/modifiers-widget.module.scss +0 -10
  29. package/desktop/components/modifiers/widget/readme.md +0 -53
  30. package/mobile/components/item-image/index.d.ts +0 -56
  31. package/mobile/components/item-image/index.js +0 -88
  32. package/mobile/components/item-image/item-image.module.scss +0 -79
@@ -1,56 +0,0 @@
1
- import React, { Component } from 'react';
2
- import { BadgeProps } from '../../../common/components/badge';
3
- export interface ItemImageProps {
4
- src?: string;
5
- alt?: string;
6
- hasWishButton?: boolean;
7
- wishProps?: {
8
- isWished?: boolean;
9
- className?: string;
10
- onClick?: React.MouseEventHandler;
11
- };
12
- className?: string;
13
- onClick?: React.MouseEventHandler;
14
- badges?: BadgeProps[];
15
- withBlur?: boolean;
16
- itemUrl?: string;
17
- isFetchingWishItems?: boolean;
18
- onLoadImage?: (duration: number) => void;
19
- }
20
- /**
21
- * Компонент изображения товара с избранным.
22
- * @param props Свойства компонента.
23
- * @param props.src Ссылка на изображение.
24
- * @param props.alt Alt для изображения.
25
- * @param props.className Дополнительный класс для компонента.
26
- * @param props.onClick Обработчик клика по картинке.
27
- * @param props.badges Шильдики.
28
- * @param props.wishProps Свойства для избранного.
29
- * @param props.withBlur Добавление блюра.
30
- * @param props.isFetchingWishItems Признак загрузки добавления товара в список избранного.
31
- */
32
- export declare class ItemImage extends Component<ItemImageProps> {
33
- bootStartTime: number;
34
- image: any;
35
- /**
36
- * @inheritdoc
37
- */
38
- constructor(props: any);
39
- /**
40
- * @inheritdoc
41
- */
42
- componentDidMount(): void;
43
- /**
44
- * Возвращает фото.
45
- * @param {Object} image Данные изображения.
46
- * @param {string} image.src Url изображения.
47
- * @param {string} image.alt Alt изображения.
48
- * @param {Function} onClick Колбэк на клик по изображению.
49
- * @return {Object} Свойства для компонента.
50
- */
51
- getImage: ({ src, alt }: any, onClick: any) => JSX.Element;
52
- /**
53
- * @inheritdoc
54
- */
55
- render(): JSX.Element;
56
- }
@@ -1,88 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.ItemImage = void 0;
26
- const react_1 = __importStar(require("react"));
27
- const link_1 = require("@sima-land/ui-nucleons/link");
28
- const badge_list_1 = require("../../../common/components/badge-list");
29
- const badge_1 = require("../../../common/components/badge");
30
- const wish_button_1 = require("../../../common/components/wish-button");
31
- const eighteen_plus_svg_1 = __importDefault(require("../../../common/icons/eighteen-plus.svg"));
32
- const bind_1 = __importDefault(require("classnames/bind"));
33
- const item_image_module_scss_1 = __importDefault(require("./item-image.module.scss"));
34
- const cx = bind_1.default.bind(item_image_module_scss_1.default);
35
- /**
36
- * Компонент изображения товара с избранным.
37
- * @param props Свойства компонента.
38
- * @param props.src Ссылка на изображение.
39
- * @param props.alt Alt для изображения.
40
- * @param props.className Дополнительный класс для компонента.
41
- * @param props.onClick Обработчик клика по картинке.
42
- * @param props.badges Шильдики.
43
- * @param props.wishProps Свойства для избранного.
44
- * @param props.withBlur Добавление блюра.
45
- * @param props.isFetchingWishItems Признак загрузки добавления товара в список избранного.
46
- */
47
- class ItemImage extends react_1.Component {
48
- /**
49
- * @inheritdoc
50
- */
51
- constructor(props) {
52
- super(props);
53
- /**
54
- * Возвращает фото.
55
- * @param {Object} image Данные изображения.
56
- * @param {string} image.src Url изображения.
57
- * @param {string} image.alt Alt изображения.
58
- * @param {Function} onClick Колбэк на клик по изображению.
59
- * @return {Object} Свойства для компонента.
60
- */
61
- this.getImage = ({ src, alt }, onClick) => (react_1.default.createElement("img", { className: cx('image'), src: src, alt: alt, ref: this.image, onClick: onClick }));
62
- this.image = (0, react_1.createRef)();
63
- this.bootStartTime = Date.now();
64
- }
65
- /**
66
- * @inheritdoc
67
- */
68
- componentDidMount() {
69
- const img = this.image.current;
70
- const { onLoadImage } = this.props;
71
- img && img.complete && (onLoadImage === null || onLoadImage === void 0 ? void 0 : onLoadImage(Date.now() - this.bootStartTime));
72
- }
73
- /**
74
- * @inheritdoc
75
- */
76
- render() {
77
- const { src, alt, hasWishButton, wishProps, className, onClick, badges, withBlur, itemUrl, isFetchingWishItems, } = this.props;
78
- return (react_1.default.createElement("div", { className: cx('wrapper', className) },
79
- withBlur && (react_1.default.createElement("div", { className: cx('with-blur') },
80
- react_1.default.createElement(eighteen_plus_svg_1.default, { width: 124, height: 124, opacity: '0.3' }))),
81
- react_1.default.createElement("div", { className: cx('image-wrapper') },
82
- react_1.default.createElement(link_1.Link, { href: itemUrl }, withBlur ? (react_1.default.createElement("div", { className: cx('with-filter-blur'), children: this.getImage({ src, alt }, onClick) })) : (this.getImage({ src, alt }, onClick)))),
83
- Array.isArray(badges) && Boolean(badges.length) && !withBlur && (react_1.default.createElement("div", { className: cx('badges') },
84
- 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))))))),
85
- hasWishButton && (react_1.default.createElement(wish_button_1.WishButton, { checked: wishProps === null || wishProps === void 0 ? void 0 : wishProps.isWished, className: wishProps === null || wishProps === void 0 ? void 0 : wishProps.className, onClick: wishProps === null || wishProps === void 0 ? void 0 : wishProps.onClick, disabled: isFetchingWishItems }))));
86
- }
87
- }
88
- exports.ItemImage = ItemImage;
@@ -1,79 +0,0 @@
1
- .wrapper {
2
- min-width: 1px;
3
- position: relative;
4
- display: flex;
5
- flex-flow: column;
6
- &.row {
7
- .image-wrapper {
8
- min-height: 108px;
9
- @media (min-width: 600px) {
10
- min-height: 200px;
11
- }
12
- @media (min-width: 960px) {
13
- min-height: 256px;
14
- }
15
- }
16
- .badges {
17
- margin-top: 4px;
18
- }
19
- }
20
- }
21
-
22
- .image-wrapper {
23
- background: #fafafa;
24
- overflow: hidden;
25
- position: relative;
26
- box-sizing: border-box;
27
- padding-bottom: 100%;
28
- height: 0;
29
- .with-filter-blur {
30
- filter: blur(24px);
31
- }
32
- @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
33
- a {
34
- display: block;
35
- position: relative;
36
- }
37
- a::before {
38
- content: '';
39
- display: block;
40
- position: absolute;
41
- top: 0;
42
- left: 0;
43
- right: 0;
44
- bottom: 0;
45
- background-color: rgba(0, 0, 0, 0.04);
46
- }
47
- }
48
- }
49
-
50
- .badges {
51
- margin-top: 4px;
52
- margin-bottom: 8px;
53
- }
54
-
55
- .image {
56
- display: block;
57
- filter: brightness(96%);
58
- width: 100%;
59
- height: auto;
60
- font-size: 14px;
61
- min-height: 1px;
62
- min-width: 1px;
63
- }
64
-
65
- .with-blur {
66
- position: absolute;
67
- top: -5px;
68
- left: -5px;
69
- width: calc(100% + 10px);
70
- height: calc(100% + 10px);
71
- background: rgba(255, 255, 255, 0.5);
72
- z-index: 10;
73
- display: flex;
74
- justify-content: center;
75
- align-items: center;
76
- @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
77
- background: rgba(255, 255, 255, 0.95);
78
- }
79
- }