@salutejs/plasma-new-hope 0.159.0-canary.1443.11139400186.0 → 0.159.0-canary.1443.11141632830.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/cjs/components/Steps/Steps.css +10 -10
  2. package/cjs/components/Steps/Steps.js +5 -1
  3. package/cjs/components/Steps/Steps.js.map +1 -1
  4. package/cjs/components/Steps/Steps.styles.js +1 -1
  5. package/cjs/components/Steps/Steps.styles.js.map +1 -1
  6. package/cjs/components/Steps/Steps.styles_1xmqxqu.css +1 -0
  7. package/cjs/components/Steps/ui/StepItem/StepItem.css +9 -9
  8. package/cjs/components/Steps/ui/StepItem/StepItem.js +3 -1
  9. package/cjs/components/Steps/ui/StepItem/StepItem.js.map +1 -1
  10. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  11. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  12. package/cjs/components/Steps/ui/StepItem/{StepItem.styles_1y1xj5d.css → StepItem.styles_sp9rcd.css} +1 -1
  13. package/cjs/index.css +11 -11
  14. package/emotion/cjs/components/Steps/Steps.js +5 -1
  15. package/emotion/cjs/components/Steps/Steps.styles.js +1 -1
  16. package/emotion/cjs/components/Steps/ui/StepItem/StepItem.js +3 -1
  17. package/emotion/cjs/components/Steps/ui/StepItem/StepItem.styles.js +9 -9
  18. package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
  19. package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  20. package/emotion/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  21. package/emotion/es/components/Steps/Steps.js +5 -1
  22. package/emotion/es/components/Steps/Steps.styles.js +1 -1
  23. package/emotion/es/components/Steps/ui/StepItem/StepItem.js +3 -1
  24. package/emotion/es/components/Steps/ui/StepItem/StepItem.styles.js +9 -9
  25. package/emotion/es/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
  26. package/emotion/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  27. package/emotion/es/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  28. package/es/components/Steps/Steps.css +10 -10
  29. package/es/components/Steps/Steps.js +5 -1
  30. package/es/components/Steps/Steps.js.map +1 -1
  31. package/es/components/Steps/Steps.styles.js +1 -1
  32. package/es/components/Steps/Steps.styles.js.map +1 -1
  33. package/es/components/Steps/Steps.styles_1xmqxqu.css +1 -0
  34. package/es/components/Steps/ui/StepItem/StepItem.css +9 -9
  35. package/es/components/Steps/ui/StepItem/StepItem.js +3 -1
  36. package/es/components/Steps/ui/StepItem/StepItem.js.map +1 -1
  37. package/es/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  38. package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  39. package/es/components/Steps/ui/StepItem/{StepItem.styles_1y1xj5d.css → StepItem.styles_sp9rcd.css} +1 -1
  40. package/es/index.css +11 -11
  41. package/package.json +2 -2
  42. package/styled-components/cjs/components/Steps/Steps.js +5 -1
  43. package/styled-components/cjs/components/Steps/Steps.styles.js +1 -1
  44. package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.js +3 -1
  45. package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  46. package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
  47. package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  48. package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  49. package/styled-components/es/components/Steps/Steps.js +5 -1
  50. package/styled-components/es/components/Steps/Steps.styles.js +1 -1
  51. package/styled-components/es/components/Steps/ui/StepItem/StepItem.js +3 -1
  52. package/styled-components/es/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  53. package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
  54. package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  55. package/styled-components/es/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  56. package/types/components/Steps/Steps.d.ts.map +1 -1
  57. package/types/components/Steps/Steps.styles.d.ts.map +1 -1
  58. package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts.map +1 -1
  59. package/types/components/Steps/ui/StepItem/StepItem.types.d.ts +7 -5
  60. package/types/components/Steps/ui/StepItem/StepItem.types.d.ts.map +1 -1
  61. package/cjs/components/Steps/Steps.styles_vv31r6.css +0 -1
  62. package/es/components/Steps/Steps.styles_vv31r6.css +0 -1
@@ -57,11 +57,12 @@ const DefaultStory = (args) => {
57
57
  useEffect(() => {
58
58
  const newItems = new Array(quantity).fill(null).map((_, index) => {
59
59
  const indicator = index + 1;
60
+ const status = index === 0 ? 'active' : 'inactive';
60
61
 
61
62
  if (simple) {
62
63
  return {
63
64
  indicator,
64
- status: 'inactive',
65
+ status,
65
66
  };
66
67
  }
67
68
 
@@ -69,32 +70,38 @@ const DefaultStory = (args) => {
69
70
  title: innerTitle,
70
71
  content,
71
72
  indicator,
72
- status: 'inactive',
73
+ status,
73
74
  };
74
75
  });
75
76
 
76
77
  setItems(newItems);
77
- }, [hasContent, loading, quantity, innerTitle, content, simple]);
78
+ }, [loading, quantity, simple]);
78
79
 
79
80
  useEffect(() => {
80
81
  setItems((curItems) =>
81
82
  curItems.map((item, index) => {
82
83
  if (indicatorType === 'numbered') {
83
- return { ...item, indicator: index + 1 };
84
+ return simple
85
+ ? { ...item, indicator: index + 1 }
86
+ : { ...item, title: innerTitle, content, indicator: index + 1 };
84
87
  }
85
88
 
86
89
  if (indicatorType === 'bullet') {
87
- return { ...item, indicator: undefined };
90
+ return simple
91
+ ? { ...item, indicator: undefined }
92
+ : { ...item, title: innerTitle, content, indicator: undefined };
88
93
  }
89
94
 
90
95
  if (indicatorType === 'icon') {
91
- return { ...item, indicator: renderIndicator };
96
+ return simple
97
+ ? { ...item, indicator: renderIndicator }
98
+ : { ...item, title: innerTitle, content, indicator: renderIndicator };
92
99
  }
93
100
 
94
101
  return item;
95
102
  }),
96
103
  );
97
- }, [indicatorType]);
104
+ }, [indicatorType, innerTitle, content, simple]);
98
105
 
99
106
  useEffect(() => {
100
107
  setItems((curItems) => curItems.map((item) => ({ ...item, disabled })));
@@ -111,7 +118,7 @@ const DefaultStory = (args) => {
111
118
  };
112
119
 
113
120
  return (
114
- <div style={{ maxWidth }}>
121
+ <div style={{ maxWidth, height: '400px' }}>
115
122
  <Steps
116
123
  size={size}
117
124
  items={items}
@@ -52,7 +52,7 @@ export var stepsRoot = function stepsRoot(Root) {
52
52
  return !item.title && !item.content;
53
53
  });
54
54
  useEffect(function () {
55
- return function () {
55
+ var calcPrevIndex = function calcPrevIndex() {
56
56
  if (current !== undefined) {
57
57
  setPrevIndex(current);
58
58
  } else {
@@ -62,6 +62,10 @@ export var stepsRoot = function stepsRoot(Root) {
62
62
  setPrevIndex(index !== -1 ? index : undefined);
63
63
  }
64
64
  };
65
+ calcPrevIndex();
66
+ return function () {
67
+ calcPrevIndex();
68
+ };
65
69
  }, [current, items]);
66
70
  return /*#__PURE__*/React.createElement(Root, _extends({
67
71
  size: size,
@@ -1,3 +1,3 @@
1
1
  import { css } from '@emotion/react';
2
2
  import { classes, tokens } from './Steps.tokens';
3
- export var base = /*#__PURE__*/css("display:flex;flex-direction:row;&.", classes.simple, "{align-items:center;&.", classes.hasIndicator, "{height:var(", tokens.activeIndicatorSize, ");}&:not(.", classes.hasIndicator, "){height:var(", tokens.activeBulletSize, ");}&.", classes.verticalOrientation, "{&.", classes.hasIndicator, "{width:var(", tokens.activeIndicatorSize, ");height:100%;}&:not(.", classes.hasIndicator, "){width:var(", tokens.activeBulletSize, ");height:100%;}}}&.", classes.verticalOrientation, "{display:inline;flex-direction:column;justify-content:center;&.", classes.simple, "{display:inline-flex;}};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3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SW5kaWNhdG9yfSkge1xuICAgICAgICAgICAgICAgIHdpZHRoOiB2YXIoJHt0b2tlbnMuYWN0aXZlQnVsbGV0U2l6ZX0pO1xuICAgICAgICAgICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgICYuJHtjbGFzc2VzLnZlcnRpY2FsT3JpZW50YXRpb259IHtcbiAgICAgICAgZGlzcGxheTogaW5saW5lO1xuICAgICAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcblxuICAgICAgICAmLiR7Y2xhc3Nlcy5zaW1wbGV9IHtcbiAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1mbGV4O1xuICAgICAgICB9XG4gICAgfVxuYDtcbiJdfQ== */"));
3
+ export var base = /*#__PURE__*/css("display:flex;flex-direction:row;&.", classes.simple, "{align-items:center;&:not(&.", classes.verticalOrientation, "){&.", classes.hasIndicator, "{height:var(", tokens.activeIndicatorSize, ");}&:not(.", classes.hasIndicator, "){height:var(", tokens.activeBulletSize, ");}}&.", classes.verticalOrientation, "{&.", classes.hasIndicator, "{width:var(", tokens.activeIndicatorSize, ");}&:not(.", classes.hasIndicator, "){width:var(", tokens.activeBulletSize, ");}}}&.", classes.verticalOrientation, "{display:flex;flex-direction:column;justify-content:center;height:100%;&.", classes.simple, "{display:inline-flex;}};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvU3RlcHMvU3RlcHMuc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUl1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1N0ZXB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ZX0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgJi4ke2NsYXNzZXMudmVydGljYWxPcmllbnRhdGlvbn0ge1xuICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgICAgICAgaGVpZ2h0OiAxMDAlO1xuXG4gICAgICAgICYuJHtjbGFzc2VzLnNpbXBsZX0ge1xuICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWZsZXg7XG4gICAgICAgIH1cbiAgICB9XG5gO1xuIl19 */"));
@@ -64,6 +64,8 @@ export var StepItem = function StepItem(_ref) {
64
64
  resultIndicatorSize = isActive ? 16 : 8;
65
65
  }
66
66
  var indentToken = indicatorSizesIndentsMap[resultIndicatorSize];
67
+
68
+ // todo заменить на callback с условиями внутри
67
69
  var onMouseOver = clickable && !isDisabled ? function () {
68
70
  if (isDisabled) {
69
71
  setIsHovered(false);
@@ -110,7 +112,7 @@ export var StepItem = function StepItem(_ref) {
110
112
  onBlur: onMouseOut,
111
113
  onMouseOver: onMouseOver,
112
114
  onMouseOut: onMouseOut
113
- }, title), content && /*#__PURE__*/React.createElement(StepItemContent, null, typeof content === 'function' && content(status, index, items), typeof content !== 'function' && content))), isSimple && !isLast && /*#__PURE__*/React.createElement(StepItemDivider, {
115
+ }, title), content && /*#__PURE__*/React.createElement(StepItemContent, null, typeof content === 'function' ? content(status, index, items) : content))), isSimple && !isLast && /*#__PURE__*/React.createElement(StepItemDivider, {
114
116
  className: cls(classes.simple, _defineProperty(_defineProperty(_defineProperty({}, classes.verticalOrientation, isVertical), classes.transparentDivider, !hasLine), classes.inactive, isInactive || isNextInactive))
115
117
  }));
116
118
  };