@megafon/ui-shared 8.0.5 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Property/Property.d.ts +3 -42
- package/dist/es/components/Property/Property.js +6 -137
- package/dist/es/components/Stepper/Stepper.css +1 -0
- package/dist/es/components/Stepper/Stepper.d.ts +48 -0
- package/dist/es/components/Stepper/Stepper.js +140 -0
- package/dist/es/components/Stepper/StepperItem.css +1 -0
- package/dist/es/components/Stepper/StepperItem.d.ts +50 -0
- package/dist/es/components/Stepper/StepperItem.js +89 -0
- package/dist/es/index.d.ts +2 -1
- package/dist/es/index.js +2 -1
- package/dist/lib/components/Property/Property.d.ts +3 -42
- package/dist/lib/components/Property/Property.js +5 -136
- package/dist/lib/components/Stepper/Stepper.css +1 -0
- package/dist/lib/components/Stepper/Stepper.d.ts +48 -0
- package/dist/lib/components/Stepper/Stepper.js +149 -0
- package/dist/lib/components/Stepper/StepperItem.css +1 -0
- package/dist/lib/components/Stepper/StepperItem.d.ts +50 -0
- package/dist/lib/components/Stepper/StepperItem.js +98 -0
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +14 -7
- package/package.json +5 -5
- package/dist/es/components/Property/Property.css +0 -1
- package/dist/es/components/Property/PropertyDescription.css +0 -1
- package/dist/es/components/Property/PropertyDescription.d.ts +0 -6
- package/dist/es/components/Property/PropertyDescription.js +0 -43
- package/dist/es/components/Property/types.d.ts +0 -22
- package/dist/es/components/Property/types.js +0 -1
- package/dist/lib/components/Property/Property.css +0 -1
- package/dist/lib/components/Property/PropertyDescription.css +0 -1
- package/dist/lib/components/Property/PropertyDescription.d.ts +0 -6
- package/dist/lib/components/Property/PropertyDescription.js +0 -53
- package/dist/lib/components/Property/types.d.ts +0 -22
- package/dist/lib/components/Property/types.js +0 -5
@@ -1,43 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
4
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
5
|
-
import * as React from 'react';
|
6
|
-
import { Collapse } from '@megafon/ui-core';
|
7
|
-
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
8
|
-
import "./PropertyDescription.css";
|
9
|
-
export var testIdPrefix = 'PropertyDescription';
|
10
|
-
var cn = cnCreate('mfui-property-description');
|
11
|
-
var PropertyDescription = function PropertyDescription(_ref) {
|
12
|
-
var value = _ref.value,
|
13
|
-
_ref$isCollapsible = _ref.isCollapsible,
|
14
|
-
isCollapsible = _ref$isCollapsible === void 0 ? false : _ref$isCollapsible,
|
15
|
-
_ref$classes = _ref.classes,
|
16
|
-
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
17
|
-
dataAttrs = _ref.dataAttrs;
|
18
|
-
var _React$useState = React.useState(false),
|
19
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
20
|
-
isOpened = _React$useState2[0],
|
21
|
-
setIsOpened = _React$useState2[1];
|
22
|
-
var handleClickDesc = React.useCallback(function () {
|
23
|
-
return setIsOpened(!isOpened);
|
24
|
-
}, [isOpened]);
|
25
|
-
if (isCollapsible) {
|
26
|
-
return /*#__PURE__*/React.createElement("div", {
|
27
|
-
className: cn([isOpened ? classes.open : undefined]),
|
28
|
-
"data-testid": "".concat(testIdPrefix, "-collapsible")
|
29
|
-
}, /*#__PURE__*/React.createElement(Collapse, {
|
30
|
-
className: cn('content'),
|
31
|
-
classNameContainer: cn('content-inner'),
|
32
|
-
isOpened: isOpened
|
33
|
-
}, value), /*#__PURE__*/React.createElement("span", _extends({
|
34
|
-
onClick: handleClickDesc
|
35
|
-
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink), {
|
36
|
-
className: cn('collapse', classes.toggle)
|
37
|
-
}), isOpened ? 'Скрыть' : 'Подробнее'));
|
38
|
-
}
|
39
|
-
return /*#__PURE__*/React.createElement("div", {
|
40
|
-
className: cn()
|
41
|
-
}, value);
|
42
|
-
};
|
43
|
-
export default PropertyDescription;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export type DescriptionType = {
|
3
|
-
value: string | React.ReactNode[];
|
4
|
-
isCollapsible?: boolean;
|
5
|
-
classes?: {
|
6
|
-
toggle?: string;
|
7
|
-
open?: string;
|
8
|
-
};
|
9
|
-
dataAttrs?: {
|
10
|
-
moreLink?: Record<string, string>;
|
11
|
-
};
|
12
|
-
};
|
13
|
-
export type TitleSizeType = 'default' | 'big';
|
14
|
-
export type ValueFrameColor = 'none' | 'default' | 'gray';
|
15
|
-
export type Item = {
|
16
|
-
title?: React.ReactNode[];
|
17
|
-
titleSize?: TitleSizeType;
|
18
|
-
description?: DescriptionType[];
|
19
|
-
value?: string | React.ReactNode;
|
20
|
-
valueUnit?: string;
|
21
|
-
valueFrameColor?: 'none' | 'default' | 'gray';
|
22
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
@charset "UTF-8";h1,h2,h3,h4,h5{margin:0}.mfui-property__wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:24px 0}.mfui-property_border-top.mfui-property_border-color_default .mfui-property__wrapper{border-top:1px solid var(--spbSky1)}.mfui-property_border-bottom.mfui-property_border-color_default .mfui-property__wrapper{border-bottom:1px solid var(--spbSky1)}.mfui-property_border-top.mfui-property_border-color_darker .mfui-property__wrapper{border-top:1px solid var(--spbSky2)}.mfui-property_border-bottom.mfui-property_border-color_darker .mfui-property__wrapper{border-bottom:1px solid var(--spbSky2)}.mfui-property__main{display:-webkit-box;display:-ms-flexbox;display:flex;gap:20px;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.mfui-property__main:not(:first-child){margin-top:24px}.mfui-property__main_with-out-title{margin-top:16px!important}.mfui-property__main_with-badge{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-property__title-item_size_default{font-size:15px;font-weight:500;line-height:24px}.mfui-property__title-item_size_big{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px}@media screen and (min-width:1280px){.mfui-property__title-item_size_big{font-size:20px;line-height:28px}}@media screen and (max-width:767px){.mfui-property__title-item{font-size:15px;font-weight:500;line-height:24px}}.mfui-property__icon{display:inline-block;height:24px;margin-left:1px;margin-right:8px;overflow:hidden;vertical-align:bottom;width:24px}.mfui-property__badge{margin-bottom:8px}@media screen and (min-width:768px){.mfui-property__title .mfui-property__desc{width:100%}}.mfui-property__tooltip{cursor:pointer;display:inline-block;height:20px;margin-left:8px;vertical-align:text-bottom;width:20px;fill:var(--spbSky2)}.mfui-property__tooltip-inner{max-width:350px}.mfui-property__desc{margin-top:12px}@media screen and (min-width:768px){.mfui-property__desc{width:70%}}.mfui-property__desc_collapsible{margin-top:12px}.mfui-property__value-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;border-radius:8px;padding:4px 8px;text-align:right;white-space:pre-line}.mfui-property__value-wrapper_frame_default{background:var(--base)}.mfui-property__value-wrapper_frame_gray{background:var(--spbSky0)}.mfui-property__value{font-size:18px;font-weight:500;letter-spacing:.5px;line-height:24px}@media screen and (min-width:1280px){.mfui-property__value{font-size:20px;line-height:28px}}@media screen and (max-width:767px){.mfui-property__value{font-size:15px;font-weight:500;line-height:24px}}.mfui-property__value-unit:before{content:" "}
|
@@ -1 +0,0 @@
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-property-description__collapse{color:var(--systemBlue);cursor:pointer;font-size:12px;-webkit-text-decoration:underline dashed var(--systemBlue);text-decoration:underline dashed var(--systemBlue)}.mfui-property-description__content-inner{margin-bottom:8px}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import './PropertyDescription.scss';
|
3
|
-
import { DescriptionType } from './types';
|
4
|
-
export declare const testIdPrefix = "PropertyDescription";
|
5
|
-
declare const PropertyDescription: React.FC<DescriptionType>;
|
6
|
-
export default PropertyDescription;
|
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
5
|
-
value: true
|
6
|
-
});
|
7
|
-
exports.testIdPrefix = exports["default"] = void 0;
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
11
|
-
var _uiCore = require("@megafon/ui-core");
|
12
|
-
var _uiHelpers = require("@megafon/ui-helpers");
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
16
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
17
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
18
|
-
|
19
|
-
var testIdPrefix = exports.testIdPrefix = 'PropertyDescription';
|
20
|
-
var cn = (0, _uiHelpers.cnCreate)('mfui-property-description');
|
21
|
-
var PropertyDescription = function PropertyDescription(_ref) {
|
22
|
-
var value = _ref.value,
|
23
|
-
_ref$isCollapsible = _ref.isCollapsible,
|
24
|
-
isCollapsible = _ref$isCollapsible === void 0 ? false : _ref$isCollapsible,
|
25
|
-
_ref$classes = _ref.classes,
|
26
|
-
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
27
|
-
dataAttrs = _ref.dataAttrs;
|
28
|
-
var _React$useState = React.useState(false),
|
29
|
-
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
30
|
-
isOpened = _React$useState2[0],
|
31
|
-
setIsOpened = _React$useState2[1];
|
32
|
-
var handleClickDesc = React.useCallback(function () {
|
33
|
-
return setIsOpened(!isOpened);
|
34
|
-
}, [isOpened]);
|
35
|
-
if (isCollapsible) {
|
36
|
-
return /*#__PURE__*/React.createElement("div", {
|
37
|
-
className: cn([isOpened ? classes.open : undefined]),
|
38
|
-
"data-testid": "".concat(testIdPrefix, "-collapsible")
|
39
|
-
}, /*#__PURE__*/React.createElement(_uiCore.Collapse, {
|
40
|
-
className: cn('content'),
|
41
|
-
classNameContainer: cn('content-inner'),
|
42
|
-
isOpened: isOpened
|
43
|
-
}, value), /*#__PURE__*/React.createElement("span", (0, _extends2["default"])({
|
44
|
-
onClick: handleClickDesc
|
45
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink), {
|
46
|
-
className: cn('collapse', classes.toggle)
|
47
|
-
}), isOpened ? 'Скрыть' : 'Подробнее'));
|
48
|
-
}
|
49
|
-
return /*#__PURE__*/React.createElement("div", {
|
50
|
-
className: cn()
|
51
|
-
}, value);
|
52
|
-
};
|
53
|
-
var _default = exports["default"] = PropertyDescription;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export type DescriptionType = {
|
3
|
-
value: string | React.ReactNode[];
|
4
|
-
isCollapsible?: boolean;
|
5
|
-
classes?: {
|
6
|
-
toggle?: string;
|
7
|
-
open?: string;
|
8
|
-
};
|
9
|
-
dataAttrs?: {
|
10
|
-
moreLink?: Record<string, string>;
|
11
|
-
};
|
12
|
-
};
|
13
|
-
export type TitleSizeType = 'default' | 'big';
|
14
|
-
export type ValueFrameColor = 'none' | 'default' | 'gray';
|
15
|
-
export type Item = {
|
16
|
-
title?: React.ReactNode[];
|
17
|
-
titleSize?: TitleSizeType;
|
18
|
-
description?: DescriptionType[];
|
19
|
-
value?: string | React.ReactNode;
|
20
|
-
valueUnit?: string;
|
21
|
-
valueFrameColor?: 'none' | 'default' | 'gray';
|
22
|
-
};
|