@megafon/ui-shared 8.4.0 → 8.6.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 (45) hide show
  1. package/dist/es/components/ChipsBox/ChipBox.d.ts +5 -0
  2. package/dist/es/components/ChipsBox/ChipBox.js +7 -0
  3. package/dist/es/components/ChipsBox/ChipsBox.css +1 -0
  4. package/dist/es/components/ChipsBox/ChipsBox.d.ts +16 -0
  5. package/dist/es/components/ChipsBox/ChipsBox.js +76 -0
  6. package/dist/es/components/Container/Container.css +1 -1
  7. package/dist/es/components/ImageBanner/ImageBanner.css +1 -1
  8. package/dist/es/components/ImageBanner/ImageBanner.d.ts +2 -0
  9. package/dist/es/components/ImageBanner/ImageBanner.js +3 -0
  10. package/dist/es/components/InfoCards/components/InfoCard/InfoCard.js +2 -2
  11. package/dist/es/components/PictureBox/PictureBox.css +1 -1
  12. package/dist/es/components/PictureBox/img/mac-book-1x.png +0 -0
  13. package/dist/es/components/PictureBox/img/mac-book-2x.png +0 -0
  14. package/dist/es/components/Stepper/Stepper.css +1 -1
  15. package/dist/es/components/Stepper/Stepper.d.ts +4 -0
  16. package/dist/es/components/Stepper/Stepper.js +38 -23
  17. package/dist/es/components/Stepper/StepperItem.css +1 -1
  18. package/dist/es/components/Stepper/StepperItem.d.ts +7 -0
  19. package/dist/es/components/Stepper/StepperItem.js +15 -5
  20. package/dist/es/components/Stepper/img/separator-mobile.png +0 -0
  21. package/dist/es/index.d.ts +2 -0
  22. package/dist/es/index.js +2 -0
  23. package/dist/lib/components/ChipsBox/ChipBox.d.ts +5 -0
  24. package/dist/lib/components/ChipsBox/ChipBox.js +17 -0
  25. package/dist/lib/components/ChipsBox/ChipsBox.css +1 -0
  26. package/dist/lib/components/ChipsBox/ChipsBox.d.ts +16 -0
  27. package/dist/lib/components/ChipsBox/ChipsBox.js +85 -0
  28. package/dist/lib/components/Container/Container.css +1 -1
  29. package/dist/lib/components/ImageBanner/ImageBanner.css +1 -1
  30. package/dist/lib/components/ImageBanner/ImageBanner.d.ts +2 -0
  31. package/dist/lib/components/ImageBanner/ImageBanner.js +3 -0
  32. package/dist/lib/components/InfoCards/components/InfoCard/InfoCard.js +1 -1
  33. package/dist/lib/components/PictureBox/PictureBox.css +1 -1
  34. package/dist/lib/components/PictureBox/img/mac-book-1x.png +0 -0
  35. package/dist/lib/components/PictureBox/img/mac-book-2x.png +0 -0
  36. package/dist/lib/components/Stepper/Stepper.css +1 -1
  37. package/dist/lib/components/Stepper/Stepper.d.ts +4 -0
  38. package/dist/lib/components/Stepper/Stepper.js +37 -22
  39. package/dist/lib/components/Stepper/StepperItem.css +1 -1
  40. package/dist/lib/components/Stepper/StepperItem.d.ts +7 -0
  41. package/dist/lib/components/Stepper/StepperItem.js +16 -6
  42. package/dist/lib/components/Stepper/img/separator-mobile.png +0 -0
  43. package/dist/lib/index.d.ts +2 -0
  44. package/dist/lib/index.js +14 -0
  45. package/package.json +4 -4
@@ -85,7 +85,7 @@ var InfoCard = function InfoCard(_ref) {
85
85
  className: cn('title', [classes === null || classes === void 0 ? void 0 : classes.title])
86
86
  }), (0, _uiHelpers.convert)(title, {})), !!description && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.description), {
87
87
  className: cn('description')
88
- }), (0, _uiHelpers.convert)(description, {})), !!moreInfo && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreInfo), {
88
+ }), (0, _uiHelpers.convert)(description, _uiHelpers.textConvertConfig)), !!moreInfo && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreInfo), {
89
89
  className: cn('more-info')
90
90
  }), /*#__PURE__*/React.createElement("span", {
91
91
  className: cn('more-info-text')
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-picture-box_mask_none .mfui-picture-box__image{border-radius:24px;vertical-align:top;width:100%}@media screen and (min-width:768px){.mfui-picture-box_mask_none .mfui-picture-box__image{height:414px;-o-object-fit:cover;object-fit:cover}}@media screen and (min-width:1280px){.mfui-picture-box_mask_none .mfui-picture-box__image{height:520px}}.mfui-picture-box_mask_mac-book .mfui-picture-box__image{border-top-left-radius:1.4% 2.2988505747%;border-top-right-radius:1.4% 2.2988505747%;height:87%;left:0;margin:0 auto;-o-object-fit:cover;object-fit:cover;position:absolute;right:0;top:2%;width:82%}.mfui-picture-box__content{-ms-flex-item-align:center;align-self:center;margin-top:32px}@media screen and (min-width:1024px){.mfui-picture-box__content{margin-top:0}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-picture-box_align_left .mfui-picture-box__content{margin-left:12px}}@media screen and (min-width:1280px){.mfui-picture-box_align_left .mfui-picture-box__content{margin-left:44px}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-picture-box_align_right .mfui-picture-box__content{margin-right:12px}}@media screen and (min-width:1280px){.mfui-picture-box_align_right .mfui-picture-box__content{margin-right:44px}}.mfui-picture-box__button-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:20px;margin-top:32px}.mfui-picture-box_mask_mac-book .mfui-picture-box__mask{background-image:url(i/mac-book-1x.png);background-repeat:no-repeat;background-size:100% auto;padding-bottom:60.9%;position:relative}@media screen and (-webkit-min-device-pixel-ratio:2),screen and (min-device-pixel-ratio:2),screen and (min-resolution:192dpi),screen and (min-resolution:2dppx){.mfui-picture-box_mask_mac-book .mfui-picture-box__mask{background-image:url(i/mac-book-2x.png)}}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-picture-box_mask_none .mfui-picture-box__image{border-radius:24px;vertical-align:top;width:100%}@media screen and (min-width:768px){.mfui-picture-box_mask_none .mfui-picture-box__image{height:414px;-o-object-fit:cover;object-fit:cover}}@media screen and (min-width:1280px){.mfui-picture-box_mask_none .mfui-picture-box__image{height:520px}}.mfui-picture-box_mask_mac-book .mfui-picture-box__image{border-top-left-radius:1.4% 2.2988505747%;border-top-right-radius:1.4% 2.2988505747%;height:87%;left:0;margin:0 auto;-o-object-fit:cover;object-fit:cover;position:absolute;right:0;top:2%;width:82%}.mfui-picture-box__content{-ms-flex-item-align:center;align-self:center;margin-top:32px}@media screen and (min-width:1024px){.mfui-picture-box__content{margin-top:0}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-picture-box_align_left .mfui-picture-box__content{margin-left:12px}}@media screen and (min-width:1280px){.mfui-picture-box_align_left .mfui-picture-box__content{margin-left:44px}}@media screen and (min-width:1024px) and (max-width:1279px){.mfui-picture-box_align_right .mfui-picture-box__content{margin-right:12px}}@media screen and (min-width:1280px){.mfui-picture-box_align_right .mfui-picture-box__content{margin-right:44px}}.mfui-picture-box__button-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:20px;margin-top:32px}.mfui-picture-box_mask_mac-book .mfui-picture-box__mask{background-image:url(img/mac-book-1x.png);background-repeat:no-repeat;background-size:100% auto;padding-bottom:60.9%;position:relative}@media screen and (-webkit-min-device-pixel-ratio:2),screen and (min-device-pixel-ratio:2),screen and (min-resolution:192dpi),screen and (min-resolution:2dppx){.mfui-picture-box_mask_mac-book .mfui-picture-box__mask{background-image:url(img/mac-book-2x.png)}}
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-stepper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;overflow-x:auto}.mfui-stepper::-webkit-scrollbar{height:8px}.mfui-stepper::-webkit-scrollbar-thumb{background-color:var(--spbSky2);border-radius:8px}.mfui-stepper_is-horizontal{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-stepper{gap:16px}.mfui-stepper,.mfui-stepper__items-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.mfui-stepper__items-wrap{gap:12px;overflow-x:auto}.mfui-stepper::-webkit-scrollbar{height:8px}.mfui-stepper::-webkit-scrollbar-thumb{background-color:var(--spbSky2);border-radius:8px}.mfui-stepper_is-horizontal .mfui-stepper__items-wrap{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}
@@ -8,6 +8,7 @@ export interface IStepperProps {
8
8
  /** Дополнительные классы элементов */
9
9
  classes?: {
10
10
  root?: string;
11
+ itemsWrap?: string;
11
12
  item?: string;
12
13
  itemIconButton?: string;
13
14
  itemTitle?: string;
@@ -30,11 +31,14 @@ export interface IStepperProps {
30
31
  isDisabled?: boolean;
31
32
  /** Все шаги пройдены */
32
33
  isAllChecked?: boolean;
34
+ /** Отображение контента только активного шага */
35
+ showActiveStepContent?: boolean;
33
36
  /** Выравнивание */
34
37
  align?: 'center' | 'left';
35
38
  /** Дополнительные data атрибуты к внутренним элементам */
36
39
  dataAttrs?: {
37
40
  root?: Record<string, string>;
41
+ itemsWrap?: Record<string, string>;
38
42
  item?: Record<string, string>;
39
43
  itemIconButton?: Record<string, string>;
40
44
  itemTitle?: Record<string, string>;
@@ -29,6 +29,7 @@ var Stepper = function Stepper(_ref) {
29
29
  _ref$classes = _ref.classes,
30
30
  _ref$classes2 = _ref$classes === void 0 ? {} : _ref$classes,
31
31
  rootClassName = _ref$classes2.root,
32
+ itemsWrapClassName = _ref$classes2.itemsWrap,
32
33
  itemClassName = _ref$classes2.item,
33
34
  itemIconButtonClassName = _ref$classes2.itemIconButton,
34
35
  itemTitleClassName = _ref$classes2.itemTitle,
@@ -46,11 +47,14 @@ var Stepper = function Stepper(_ref) {
46
47
  isNumeric = _ref.isNumeric,
47
48
  isDisabled = _ref.isDisabled,
48
49
  isAllChecked = _ref.isAllChecked,
50
+ _ref$showActiveStepCo = _ref.showActiveStepContent,
51
+ showActiveStepContent = _ref$showActiveStepCo === void 0 ? false : _ref$showActiveStepCo,
49
52
  _ref$align = _ref.align,
50
53
  align = _ref$align === void 0 ? 'center' : _ref$align,
51
54
  _ref$dataAttrs = _ref.dataAttrs,
52
55
  _ref$dataAttrs2 = _ref$dataAttrs === void 0 ? {} : _ref$dataAttrs,
53
56
  rootAttrs = _ref$dataAttrs2.root,
57
+ itemsWrapAttrs = _ref$dataAttrs2.itemsWrap,
54
58
  itemAttrs = _ref$dataAttrs2.item,
55
59
  itemIconButtonAttrs = _ref$dataAttrs2.itemIconButton,
56
60
  itemTitleAttrs = _ref$dataAttrs2.itemTitle,
@@ -65,6 +69,7 @@ var Stepper = function Stepper(_ref) {
65
69
  currentIndex = _React$useState2[0],
66
70
  setCurrentIndex = _React$useState2[1];
67
71
  var hasCustomItems = !!items.length;
72
+ var isHorizontalContent = isHorizontal || showActiveStepContent;
68
73
  var currentItems = hasCustomItems ? items : Array.from({
69
74
  length: stepCount
70
75
  });
@@ -107,43 +112,53 @@ var Stepper = function Stepper(_ref) {
107
112
  }
108
113
  return /*#__PURE__*/React.createElement(CheckedIcon, null);
109
114
  }, [isNumeric]);
115
+ var renderItem = React.useCallback(function (props) {
116
+ return /*#__PURE__*/React.createElement(_StepperItem["default"], (0, _extends2["default"])({}, props, {
117
+ className: itemClassName,
118
+ classes: {
119
+ iconButton: itemIconButtonClassName,
120
+ title: itemTitleClassName,
121
+ text: itemTextClassname,
122
+ link: itemLinkClassName
123
+ },
124
+ dataAttrs: {
125
+ root: itemAttrs,
126
+ iconButton: itemIconButtonAttrs,
127
+ title: itemTitleAttrs,
128
+ text: itemTextAttrs,
129
+ link: itemLinkAttrs
130
+ }
131
+ }));
132
+ }, [itemAttrs, itemIconButtonAttrs, itemIconButtonClassName, itemClassName, itemLinkAttrs, itemLinkClassName, itemTextAttrs, itemTextClassname, itemTitleAttrs, itemTitleClassName]);
110
133
  var renderItems = React.useMemo(function () {
111
134
  return currentItems.map(function (elem, i) {
112
135
  var item = elem || {};
113
136
  var itemTheme = defineItemTheme(i);
114
137
  var itemIcon = item.icon || renderIcon(i, itemTheme);
115
- var hasSeparator = i < currentItems.length - 1;
116
- return /*#__PURE__*/React.createElement(_StepperItem["default"], (0, _extends2["default"])({}, item, {
117
- className: itemClassName,
118
- classes: {
119
- iconButton: itemIconButtonClassName,
120
- title: itemTitleClassName,
121
- text: itemTextClassname,
122
- link: itemLinkClassName
123
- },
124
- dataAttrs: {
125
- root: itemAttrs,
126
- iconButton: itemIconButtonAttrs,
127
- title: itemTitleAttrs,
128
- text: itemTextAttrs,
129
- link: itemLinkAttrs
130
- },
131
- key: i,
138
+ return renderItem((0, _extends2["default"])((0, _extends2["default"])({}, item), {
132
139
  icon: itemIcon,
133
- hasSeparator: hasSeparator,
134
- isHorizontal: isHorizontal,
140
+ hasSeparator: i < currentItems.length - 1,
141
+ isHorizontal: isHorizontalContent,
135
142
  isDisabled: isDisabled,
136
143
  align: align,
137
144
  theme: itemTheme,
145
+ view: showActiveStepContent ? _StepperItem.STEPPER_ITEM_VIEW_ENUM.ICON : _StepperItem.STEPPER_ITEM_VIEW_ENUM.DEFAULT,
138
146
  onClick: handleClickItem(i)
139
147
  }));
140
148
  });
141
- }, [align, currentItems, isDisabled, isHorizontal, itemAttrs, itemIconButtonAttrs, itemIconButtonClassName, itemClassName, itemLinkAttrs, itemLinkClassName, itemTextAttrs, itemTextClassname, itemTitleAttrs, itemTitleClassName, defineItemTheme, handleClickItem, renderIcon]);
149
+ }, [align, currentItems, isDisabled, showActiveStepContent, isHorizontalContent, defineItemTheme, handleClickItem, renderIcon, renderItem]);
150
+ var renderSingleItem = renderItem((0, _extends2["default"])((0, _extends2["default"])({}, currentItems[currentIndex]), {
151
+ isDisabled: isDisabled,
152
+ align: align,
153
+ view: _StepperItem.STEPPER_ITEM_VIEW_ENUM.CONTENT
154
+ }));
142
155
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(rootAttrs), {
143
156
  className: cn([className, rootClassName], {
144
- 'is-horizontal': isHorizontal
157
+ 'is-horizontal': isHorizontalContent
145
158
  }),
146
159
  ref: rootRef
147
- }), renderItems);
160
+ }), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(itemsWrapAttrs), {
161
+ className: cn('items-wrap', [itemsWrapClassName])
162
+ }), renderItems), showActiveStepContent && renderSingleItem);
148
163
  };
149
164
  var _default = exports["default"] = Stepper;
@@ -1 +1 @@
1
- h1,h2,h3,h4,h5{margin:0}.mfui-stepper-item{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;gap:16px}.mfui-stepper-item_is-horizontal{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-stepper-item_is-horizontal .mfui-stepper-item__separator{-o-border-image:url(img/separator.png) 2 repeat;border-image:url(img/separator.png) 2 repeat;border-left:none;border-radius:100px;border-top:2px solid transparent;height:2px;left:calc(50% + 24px);min-height:2px;position:absolute;top:19px;width:calc(100% - 36px)}@media screen and (min-width:1024px){.mfui-stepper-item_is-horizontal .mfui-stepper-item__separator{left:calc(50% + 32px);width:calc(100% - 52px)}}.mfui-stepper-item_theme_active .mfui-stepper-item__icon-button{background-color:var(--night20)}.mfui-stepper-item_theme_active .mfui-stepper-item__icon{background-color:var(--night)}.mfui-stepper-item_theme_checked .mfui-stepper-item__icon-button{background-color:var(--brandGreen20)}.mfui-stepper-item_theme_checked .mfui-stepper-item__icon{background-color:var(--brandGreen)}.mfui-stepper-item_theme_checked .mfui-stepper-item__separator{border-color:var(--brandGreen);-o-border-image:none;border-image:none}.mfui-stepper-item_align_left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-stepper-item_align_left .mfui-stepper-item__separator{left:auto;right:0}.mfui-stepper-item_align_left .mfui-stepper-item__content,.mfui-stepper-item_align_left .mfui-stepper-item__icon-button-area{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-stepper-item__icon-button-area{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;-ms-flex-align:center;-ms-flex-item-align:stretch;align-self:stretch}.mfui-stepper-item__icon-button,.mfui-stepper-item__icon-button-area{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;align-items:center}.mfui-stepper-item__icon-button{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:var(--spbSky0);border-radius:100%;height:40px;justify-content:center;-webkit-transition:background-color .25s ease-out;transition:background-color .25s ease-out;width:40px}.mfui-stepper-item__icon-button:disabled{cursor:default}.mfui-stepper-item__icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:var(--spbSky2);border-radius:100%;color:var(--stcWhite);font-weight:500;height:24px;justify-content:center;-webkit-transition:background-color .25s ease-out;transition:background-color .25s ease-out;width:24px}.mfui-stepper-item__icon svg{width:20px;fill:var(--stcWhite)}.mfui-stepper-item__separator{-o-border-image:url(img/separator-vertical.png) 2 repeat;border-image:url(img/separator-vertical.png) 2 repeat;border-left:2px solid transparent;border-top:none;height:100%;min-height:20px;position:static;-webkit-transition:border-color .25s ease-out;transition:border-color .25s ease-out;width:2px}.mfui-stepper-item__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:4px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-width:160px;padding-bottom:20px}.mfui-stepper-item__link{margin-top:13px}
1
+ h1,h2,h3,h4,h5{margin:0}.mfui-stepper-item{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;gap:16px}.mfui-stepper-item_is-horizontal{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-stepper-item_is-horizontal .mfui-stepper-item__separator{-o-border-image:url(img/separator-mobile.png) 2 round;border-image:url(img/separator-mobile.png) 2 round;border-left:none;border-radius:100px;border-top:2px solid transparent;height:2px;left:calc(50% + 22px);min-height:2px;position:absolute;top:19px;width:calc(100% - 32px)}@media screen and (min-width:768px){.mfui-stepper-item_is-horizontal .mfui-stepper-item__separator{-o-border-image:url(img/separator.png) 2 repeat;border-image:url(img/separator.png) 2 repeat}}@media screen and (min-width:1024px){.mfui-stepper-item_is-horizontal .mfui-stepper-item__separator{left:calc(50% + 32px);width:calc(100% - 52px)}}.mfui-stepper-item_theme_active .mfui-stepper-item__icon-button{background-color:var(--night20)}.mfui-stepper-item_theme_active .mfui-stepper-item__icon{background-color:var(--night)}.mfui-stepper-item_theme_checked .mfui-stepper-item__icon-button{background-color:var(--brandGreen20)}.mfui-stepper-item_theme_checked .mfui-stepper-item__icon{background-color:var(--brandGreen)}.mfui-stepper-item_theme_checked .mfui-stepper-item__separator{border-color:var(--brandGreen);-o-border-image:none;border-image:none}.mfui-stepper-item_align_left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-stepper-item_align_left .mfui-stepper-item__separator{left:42px;right:0}@media screen and (min-width:1024px){.mfui-stepper-item_align_left .mfui-stepper-item__separator{left:auto}}.mfui-stepper-item_align_left .mfui-stepper-item__content,.mfui-stepper-item_align_left .mfui-stepper-item__icon-button-area{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.mfui-stepper-item__icon-button-area{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:12px;-ms-flex-align:center;-ms-flex-item-align:stretch;align-self:stretch}.mfui-stepper-item__icon-button,.mfui-stepper-item__icon-button-area{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;align-items:center}.mfui-stepper-item__icon-button{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:var(--spbSky0);border-radius:100%;height:40px;justify-content:center;-webkit-transition:background-color .25s ease-out;transition:background-color .25s ease-out;width:40px}.mfui-stepper-item__icon-button:disabled{cursor:default}.mfui-stepper-item__icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:var(--spbSky2);border-radius:100%;color:var(--stcWhite);font-weight:500;height:24px;justify-content:center;-webkit-transition:background-color .25s ease-out;transition:background-color .25s ease-out;width:24px}.mfui-stepper-item__icon svg{width:20px;fill:var(--stcWhite)}.mfui-stepper-item__separator{-o-border-image:url(img/separator-vertical.png) 2 repeat;border-image:url(img/separator-vertical.png) 2 repeat;border-left:2px solid transparent;border-top:none;height:100%;min-height:20px;position:static;-webkit-transition:border-color .25s ease-out;transition:border-color .25s ease-out;width:2px}.mfui-stepper-item__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:4px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-width:160px;padding-bottom:20px}.mfui-stepper-item__link{margin-top:13px}
@@ -5,6 +5,11 @@ export declare enum STEPPER_ITEM_THEME_ENUM {
5
5
  ACTIVE = "active",
6
6
  DEFAULT = "default"
7
7
  }
8
+ export declare enum STEPPER_ITEM_VIEW_ENUM {
9
+ ICON = "icon",
10
+ CONTENT = "content",
11
+ DEFAULT = "default"
12
+ }
8
13
  export interface IStepperItemProps {
9
14
  /** Дополнительный класс корневого элемента */
10
15
  className?: string;
@@ -35,6 +40,8 @@ export interface IStepperItemProps {
35
40
  isDisabled?: boolean;
36
41
  /** Выравнивание */
37
42
  align?: 'center' | 'left';
43
+ /** Варианты отображения */
44
+ view?: STEPPER_ITEM_VIEW_ENUM;
38
45
  /** Дополнительные data атрибуты к внутренним элементам */
39
46
  dataAttrs?: {
40
47
  root?: Record<string, string>;
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports["default"] = exports.STEPPER_ITEM_THEME_ENUM = void 0;
7
+ exports["default"] = exports.STEPPER_ITEM_VIEW_ENUM = exports.STEPPER_ITEM_THEME_ENUM = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  require("core-js/modules/es.string.link.js");
10
10
  var React = _interopRequireWildcard(require("react"));
@@ -19,6 +19,12 @@ var STEPPER_ITEM_THEME_ENUM;
19
19
  STEPPER_ITEM_THEME_ENUM["ACTIVE"] = "active";
20
20
  STEPPER_ITEM_THEME_ENUM["DEFAULT"] = "default";
21
21
  })(STEPPER_ITEM_THEME_ENUM || (exports.STEPPER_ITEM_THEME_ENUM = STEPPER_ITEM_THEME_ENUM = {}));
22
+ var STEPPER_ITEM_VIEW_ENUM;
23
+ (function (STEPPER_ITEM_VIEW_ENUM) {
24
+ STEPPER_ITEM_VIEW_ENUM["ICON"] = "icon";
25
+ STEPPER_ITEM_VIEW_ENUM["CONTENT"] = "content";
26
+ STEPPER_ITEM_VIEW_ENUM["DEFAULT"] = "default";
27
+ })(STEPPER_ITEM_VIEW_ENUM || (exports.STEPPER_ITEM_VIEW_ENUM = STEPPER_ITEM_VIEW_ENUM = {}));
22
28
  var cn = (0, _uiHelpers.cnCreate)('mfui-stepper-item');
23
29
  var StepperItem = function StepperItem(_ref) {
24
30
  var className = _ref.className,
@@ -29,7 +35,7 @@ var StepperItem = function StepperItem(_ref) {
29
35
  textClassName = _ref$classes2.text,
30
36
  linkClassName = _ref$classes2.link,
31
37
  _ref$theme = _ref.theme,
32
- theme = _ref$theme === void 0 ? 'default' : _ref$theme,
38
+ theme = _ref$theme === void 0 ? STEPPER_ITEM_THEME_ENUM.DEFAULT : _ref$theme,
33
39
  title = _ref.title,
34
40
  text = _ref.text,
35
41
  linkText = _ref.linkText,
@@ -41,6 +47,8 @@ var StepperItem = function StepperItem(_ref) {
41
47
  isDisabled = _ref.isDisabled,
42
48
  _ref$align = _ref.align,
43
49
  align = _ref$align === void 0 ? 'center' : _ref$align,
50
+ _ref$view = _ref.view,
51
+ view = _ref$view === void 0 ? STEPPER_ITEM_VIEW_ENUM.DEFAULT : _ref$view,
44
52
  _ref$dataAttrs = _ref.dataAttrs,
45
53
  _ref$dataAttrs2 = _ref$dataAttrs === void 0 ? {} : _ref$dataAttrs,
46
54
  rootAttrs = _ref$dataAttrs2.root,
@@ -51,6 +59,8 @@ var StepperItem = function StepperItem(_ref) {
51
59
  onClick = _ref.onClick;
52
60
  var hasLink = !!linkText && !!linkUrl;
53
61
  var hasContent = !!title || !!text || hasLink;
62
+ var showContent = view !== STEPPER_ITEM_VIEW_ENUM.ICON && hasContent;
63
+ var showIcon = view !== STEPPER_ITEM_VIEW_ENUM.CONTENT;
54
64
  var renderContent = /*#__PURE__*/React.createElement("div", {
55
65
  className: cn('content')
56
66
  }, title && /*#__PURE__*/React.createElement(_uiCore.Header, {
@@ -78,11 +88,11 @@ var StepperItem = function StepperItem(_ref) {
78
88
  }, linkText));
79
89
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(rootAttrs), {
80
90
  className: cn([className], {
81
- 'is-horizontal': isHorizontal,
82
91
  theme: theme,
83
- align: align
92
+ align: align,
93
+ 'is-horizontal': isHorizontal
84
94
  })
85
- }), /*#__PURE__*/React.createElement("div", {
95
+ }), showIcon && /*#__PURE__*/React.createElement("div", {
86
96
  className: cn('icon-button-area')
87
97
  }, /*#__PURE__*/React.createElement("button", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(iconButtonAttrs), {
88
98
  className: cn('icon-button', [iconButtonClassName]),
@@ -93,6 +103,6 @@ var StepperItem = function StepperItem(_ref) {
93
103
  className: cn('icon')
94
104
  }, icon)), hasSeparator && /*#__PURE__*/React.createElement("span", {
95
105
  className: cn('separator')
96
- })), hasContent && renderContent);
106
+ })), showContent && renderContent);
97
107
  };
98
108
  var _default = exports["default"] = StepperItem;
@@ -17,6 +17,8 @@ export { default as ButtonsBox } from './components/ButtonsBox/ButtonsBox';
17
17
  export { default as Card } from './components/Card/Card';
18
18
  export { default as CardsBox } from './components/CardsBox/CardsBox';
19
19
  export { default as CarouselBox } from './components/CarouselBox/CarouselBox';
20
+ export { default as ChipBox } from './components/ChipsBox/ChipBox';
21
+ export { default as ChipsBox } from './components/ChipsBox/ChipsBox';
20
22
  export { default as Container } from './components/Container/Container';
21
23
  export { default as DarkGradientCard } from './components/DarkGradientCards/components/DarkGradientCard';
22
24
  export { default as DarkGradientCards } from './components/DarkGradientCards/DarkGradientCards';
package/dist/lib/index.js CHANGED
@@ -117,6 +117,18 @@ Object.defineProperty(exports, "CarouselBox", {
117
117
  return _CarouselBox["default"];
118
118
  }
119
119
  });
120
+ Object.defineProperty(exports, "ChipBox", {
121
+ enumerable: true,
122
+ get: function get() {
123
+ return _ChipBox["default"];
124
+ }
125
+ });
126
+ Object.defineProperty(exports, "ChipsBox", {
127
+ enumerable: true,
128
+ get: function get() {
129
+ return _ChipsBox["default"];
130
+ }
131
+ });
120
132
  Object.defineProperty(exports, "Container", {
121
133
  enumerable: true,
122
134
  get: function get() {
@@ -412,6 +424,8 @@ var _ButtonsBox = _interopRequireDefault(require("./components/ButtonsBox/Button
412
424
  var _Card = _interopRequireDefault(require("./components/Card/Card"));
413
425
  var _CardsBox = _interopRequireDefault(require("./components/CardsBox/CardsBox"));
414
426
  var _CarouselBox = _interopRequireDefault(require("./components/CarouselBox/CarouselBox"));
427
+ var _ChipBox = _interopRequireDefault(require("./components/ChipsBox/ChipBox"));
428
+ var _ChipsBox = _interopRequireDefault(require("./components/ChipsBox/ChipsBox"));
415
429
  var _Container = _interopRequireDefault(require("./components/Container/Container"));
416
430
  var _DarkGradientCard = _interopRequireDefault(require("./components/DarkGradientCards/components/DarkGradientCard"));
417
431
  var _DarkGradientCards = _interopRequireDefault(require("./components/DarkGradientCards/DarkGradientCards"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-shared",
3
- "version": "8.4.0",
3
+ "version": "8.6.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -77,13 +77,13 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@babel/runtime": "^7.8.4",
80
- "@megafon/ui-core": "^8.4.0",
80
+ "@megafon/ui-core": "^8.5.0",
81
81
  "@megafon/ui-helpers": "^4.0.1",
82
- "@megafon/ui-icons": "^3.9.2",
82
+ "@megafon/ui-icons": "^3.9.3",
83
83
  "core-js": "^3.6.4",
84
84
  "htmr": "^1.0.2",
85
85
  "lodash.throttle": "^4.1.1",
86
86
  "swiper": "^11.1.1"
87
87
  },
88
- "gitHead": "af0cdb99cd17efe392e36532a219bafaf5c986d6"
88
+ "gitHead": "af9a564fdf22e9eb215fb59d36d45bb0c44570c4"
89
89
  }