@salutejs/plasma-new-hope 0.159.0-canary.1443.11140129684.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 (52) 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.styles.js +1 -1
  9. package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  10. package/cjs/components/Steps/ui/StepItem/{StepItem.styles_1y1xj5d.css → StepItem.styles_sp9rcd.css} +1 -1
  11. package/cjs/index.css +11 -11
  12. package/emotion/cjs/components/Steps/Steps.js +5 -1
  13. package/emotion/cjs/components/Steps/Steps.styles.js +1 -1
  14. package/emotion/cjs/components/Steps/ui/StepItem/StepItem.styles.js +9 -9
  15. package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
  16. package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  17. package/emotion/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  18. package/emotion/es/components/Steps/Steps.js +5 -1
  19. package/emotion/es/components/Steps/Steps.styles.js +1 -1
  20. package/emotion/es/components/Steps/ui/StepItem/StepItem.styles.js +9 -9
  21. package/emotion/es/examples/plasma_b2c/components/Steps/Steps.config.js +5 -5
  22. package/emotion/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  23. package/emotion/es/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  24. package/es/components/Steps/Steps.css +10 -10
  25. package/es/components/Steps/Steps.js +5 -1
  26. package/es/components/Steps/Steps.js.map +1 -1
  27. package/es/components/Steps/Steps.styles.js +1 -1
  28. package/es/components/Steps/Steps.styles.js.map +1 -1
  29. package/es/components/Steps/Steps.styles_1xmqxqu.css +1 -0
  30. package/es/components/Steps/ui/StepItem/StepItem.css +9 -9
  31. package/es/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  32. package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -1
  33. package/es/components/Steps/ui/StepItem/{StepItem.styles_1y1xj5d.css → StepItem.styles_sp9rcd.css} +1 -1
  34. package/es/index.css +11 -11
  35. package/package.json +2 -2
  36. package/styled-components/cjs/components/Steps/Steps.js +5 -1
  37. package/styled-components/cjs/components/Steps/Steps.styles.js +1 -1
  38. package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  39. package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
  40. package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  41. package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  42. package/styled-components/es/components/Steps/Steps.js +5 -1
  43. package/styled-components/es/components/Steps/Steps.styles.js +1 -1
  44. package/styled-components/es/components/Steps/ui/StepItem/StepItem.styles.js +1 -1
  45. package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.config.js +1 -1
  46. package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +15 -8
  47. package/styled-components/es/examples/plasma_web/components/Steps/Steps.stories.tsx +15 -8
  48. package/types/components/Steps/Steps.d.ts.map +1 -1
  49. package/types/components/Steps/Steps.styles.d.ts.map +1 -1
  50. package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts.map +1 -1
  51. package/cjs/components/Steps/Steps.styles_vv31r6.css +0 -1
  52. package/es/components/Steps/Steps.styles_vv31r6.css +0 -1
@@ -13,7 +13,7 @@ var config = exports.config = {
13
13
  },
14
14
  variations: {
15
15
  view: {
16
- "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary-hover);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":0.4;"], _Steps.stepsTokens.activeTitleColor, _Steps.stepsTokens.activeTitleColorHover, _Steps.stepsTokens.activeIndicatorBorder, _Steps.stepsTokens.activeIndicatorColor, _Steps.stepsTokens.activeIndicatorBackground, _Steps.stepsTokens.completedIndicatorColor, _Steps.stepsTokens.completedIndicatorColorHover, _Steps.stepsTokens.completedIndicatorBackground, _Steps.stepsTokens.completedIndicatorBackgroundHover, _Steps.stepsTokens.inactiveTitleColor, _Steps.stepsTokens.inactiveTitleColorHover, _Steps.stepsTokens.inactiveIndicatorColor, _Steps.stepsTokens.inactiveIndicatorColorHover, _Steps.stepsTokens.inactiveIndicatorBackground, _Steps.stepsTokens.inactiveIndicatorBackgroundHover, _Steps.stepsTokens.contentColor, _Steps.stepsTokens.disabledOpacity)
16
+ "default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":0.4;"], _Steps.stepsTokens.activeTitleColor, _Steps.stepsTokens.activeTitleColorHover, _Steps.stepsTokens.activeIndicatorBorder, _Steps.stepsTokens.activeIndicatorColor, _Steps.stepsTokens.activeIndicatorBackground, _Steps.stepsTokens.completedIndicatorColor, _Steps.stepsTokens.completedIndicatorColorHover, _Steps.stepsTokens.completedIndicatorBackground, _Steps.stepsTokens.completedIndicatorBackgroundHover, _Steps.stepsTokens.inactiveTitleColor, _Steps.stepsTokens.inactiveTitleColorHover, _Steps.stepsTokens.inactiveIndicatorColor, _Steps.stepsTokens.inactiveIndicatorColorHover, _Steps.stepsTokens.inactiveIndicatorBackground, _Steps.stepsTokens.inactiveIndicatorBackgroundHover, _Steps.stepsTokens.contentColor, _Steps.stepsTokens.disabledOpacity)
17
17
  },
18
18
  size: {
19
19
  l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1.5rem;", ":2.25rem;", ":0.5rem;", ":1rem;", ":0.75rem;", ":0.375rem;", ":2rem;", ":1.0625rem;", ":0.75rem;", ":1rem;", ":0.625rem;", ":1.5rem;", ":1.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.125rem;"], _Steps.stepsTokens.indicatorSize, _Steps.stepsTokens.activeIndicatorSize, _Steps.stepsTokens.bulletSize, _Steps.stepsTokens.activeBulletSize, _Steps.stepsTokens.titlePaddingTop, _Steps.stepsTokens.contentPaddingTop, _Steps.stepsTokens.contentSidePadding, _Steps.stepsTokens.contentVerticalPadding, _Steps.stepsTokens.verticalContentPaddingLeft, _Steps.stepsTokens.smallIndicatorIndentHeight, _Steps.stepsTokens.largeIndicatorIndentHeight, _Steps.stepsTokens.smallBulletIndentHeight, _Steps.stepsTokens.largeBulletIndentHeight, _Steps.stepsTokens.indicatorFontFamily, _Steps.stepsTokens.indicatorFontSize, _Steps.stepsTokens.indicatorFontStyle, _Steps.stepsTokens.indicatorFontWeight, _Steps.stepsTokens.indicatorLetterSpacing, _Steps.stepsTokens.indicatorLineHeight, _Steps.stepsTokens.activeIndicatorFontFamily, _Steps.stepsTokens.activeIndicatorFontSize, _Steps.stepsTokens.activeIndicatorFontStyle, _Steps.stepsTokens.activeIndicatorFontWeight, _Steps.stepsTokens.activeIndicatorLetterSpacing, _Steps.stepsTokens.activeIndicatorLineHeight, _Steps.stepsTokens.titleFontFamily, _Steps.stepsTokens.titleFontSize, _Steps.stepsTokens.titleFontStyle, _Steps.stepsTokens.titleFontWeight, _Steps.stepsTokens.titleLetterSpacing, _Steps.stepsTokens.titleLineHeight, _Steps.stepsTokens.contentFontFamily, _Steps.stepsTokens.contentFontSize, _Steps.stepsTokens.contentFontStyle, _Steps.stepsTokens.contentFontWeight, _Steps.stepsTokens.contentLetterSpacing, _Steps.stepsTokens.contentLineHeight, _Steps.stepsTokens.dividerThickness),
@@ -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}
@@ -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 'styled-components';
2
2
  import { classes, tokens } from './Steps.tokens';
3
- export var base = /*#__PURE__*/css(["display:flex;flex-direction:row;&.", "{align-items:center;&.", "{height:var(", ");}&:not(.", "){height:var(", ");}&.", "{&.", "{width:var(", ");height:100%;}&:not(.", "){width:var(", ");height:100%;}}}&.", "{display:inline;flex-direction:column;justify-content:center;&.", "{display:inline-flex;}}"], classes.simple, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.verticalOrientation, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.verticalOrientation, classes.simple);
3
+ export var base = /*#__PURE__*/css(["display:flex;flex-direction:row;&.", "{align-items:center;&:not(&.", "){&.", "{height:var(", ");}&:not(.", "){height:var(", ");}}&.", "{&.", "{width:var(", ");}&:not(.", "){width:var(", ");}}}&.", "{display:flex;flex-direction:column;justify-content:center;height:100%;&.", "{display:inline-flex;}}"], classes.simple, classes.verticalOrientation, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.verticalOrientation, classes.hasIndicator, tokens.activeIndicatorSize, classes.hasIndicator, tokens.activeBulletSize, classes.verticalOrientation, classes.simple);
@@ -42,4 +42,4 @@ export var StepItemContentWrapper = /*#__PURE__*/styled.div.withConfig({
42
42
  })(["&.", "{", "{padding-top:var(", ");padding-right:0;}", "{padding-top:var(", ");padding-bottom:var(", ");padding-right:0;}}"], classes.verticalOrientation, StepItemTitle, tokens.contentVerticalPadding, StepItemContent, tokens.contentVerticalPadding, tokens.contentVerticalPadding);
43
43
  export var StepItemStyled = /*#__PURE__*/styled.div.withConfig({
44
44
  componentId: "plasma-new-hope__sc-bjma6z-8"
45
- })(["display:flex;flex-direction:column;align-items:flex-start;&.", "{flex-direction:row;align-items:stretch;", "{width:var(", ");height:100%;}}&.", "{", "{color:var(", ");}}&.", "{", "{color:var(", ");}}&.", "{&:not(.", "){", "{cursor:pointer;color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}&.", "{", "{color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}", "{cursor:pointer;}}&.", "{align-items:center;", "{display:flex;flex-direction:column;align-items:center;padding-left:calc(var(", ") / 2);padding-right:calc(var(", ") / 2);", "{width:100%;}", ",", "{padding-right:0;text-align:center;}}}&.", "{opacity:var(", ");}"], classes.verticalOrientation, StepItemDivider, tokens.dividerThickness, classes.active, StepItemTitle, tokens.activeTitleColor, classes.inactive, StepItemTitle, tokens.inactiveTitleColor, classes.hovered, classes.active, StepItemTitle, tokens.activeTitleColorHover, BulletIndicator, Bullet, tokens.completedIndicatorColorHover, tokens.completedIndicatorBackgroundHover, classes.inactive, StepItemTitle, tokens.inactiveTitleColorHover, BulletIndicator, Bullet, tokens.inactiveIndicatorColorHover, tokens.inactiveIndicatorBackgroundHover, BulletIndicatorWrapper, classes.centered, StepItemContentWrapper, tokens.contentSidePadding, tokens.contentSidePadding, StepItemTitle, StepItemTitle, StepItemContent, classes.disabled, tokens.disabledOpacity);
45
+ })(["display:flex;flex-direction:column;align-items:flex-start;flex:1;&.", "{flex-direction:row;align-items:stretch;", "{width:var(", ");height:100%;}}&.", "{", "{color:var(", ");}}&.", "{", "{color:var(", ");}}&.", "{&:not(.", "){", "{cursor:pointer;color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}&.", "{", "{color:var(", ");}", ",", "{color:var(", ");background:var(", ");}}", "{cursor:pointer;}}&.", "{align-items:center;", "{display:flex;flex-direction:column;align-items:center;padding-left:calc(var(", ") / 2);padding-right:calc(var(", ") / 2);", "{width:100%;}", ",", "{padding-right:0;text-align:center;}}}&.", "{flex:0;}&.", "{opacity:var(", ");}"], classes.verticalOrientation, StepItemDivider, tokens.dividerThickness, classes.active, StepItemTitle, tokens.activeTitleColor, classes.inactive, StepItemTitle, tokens.inactiveTitleColor, classes.hovered, classes.active, StepItemTitle, tokens.activeTitleColorHover, BulletIndicator, Bullet, tokens.completedIndicatorColorHover, tokens.completedIndicatorBackgroundHover, classes.inactive, StepItemTitle, tokens.inactiveTitleColorHover, BulletIndicator, Bullet, tokens.inactiveIndicatorColorHover, tokens.inactiveIndicatorBackgroundHover, BulletIndicatorWrapper, classes.centered, StepItemContentWrapper, tokens.contentSidePadding, tokens.contentSidePadding, StepItemTitle, StepItemTitle, StepItemContent, classes.simple, classes.disabled, tokens.disabledOpacity);
@@ -7,7 +7,7 @@ export var config = {
7
7
  },
8
8
  variations: {
9
9
  view: {
10
- "default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary-hover);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":0.4;"], tokens.activeTitleColor, tokens.activeTitleColorHover, tokens.activeIndicatorBorder, tokens.activeIndicatorColor, tokens.activeIndicatorBackground, tokens.completedIndicatorColor, tokens.completedIndicatorColorHover, tokens.completedIndicatorBackground, tokens.completedIndicatorBackgroundHover, tokens.inactiveTitleColor, tokens.inactiveTitleColorHover, tokens.inactiveIndicatorColor, tokens.inactiveIndicatorColorHover, tokens.inactiveIndicatorBackground, tokens.inactiveIndicatorBackgroundHover, tokens.contentColor, tokens.disabledOpacity)
10
+ "default": /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-primary-hover);", ":solid var(--surface-solid-default);", ":var(--text-primary);", ":var(--surface-clear);", ":var(--inverse-text-primary);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--surface-solid-default-hover);", ":var(--text-secondary);", ":var(--text-secondary-hover);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-secondary);", ":0.4;"], tokens.activeTitleColor, tokens.activeTitleColorHover, tokens.activeIndicatorBorder, tokens.activeIndicatorColor, tokens.activeIndicatorBackground, tokens.completedIndicatorColor, tokens.completedIndicatorColorHover, tokens.completedIndicatorBackground, tokens.completedIndicatorBackgroundHover, tokens.inactiveTitleColor, tokens.inactiveTitleColorHover, tokens.inactiveIndicatorColor, tokens.inactiveIndicatorColorHover, tokens.inactiveIndicatorBackground, tokens.inactiveIndicatorBackgroundHover, tokens.contentColor, tokens.disabledOpacity)
11
11
  },
12
12
  size: {
13
13
  l: /*#__PURE__*/css(["", ":1.5rem;", ":2.25rem;", ":0.5rem;", ":1rem;", ":0.75rem;", ":0.375rem;", ":2rem;", ":1.0625rem;", ":0.75rem;", ":1rem;", ":0.625rem;", ":1.5rem;", ":1.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.125rem;"], tokens.indicatorSize, tokens.activeIndicatorSize, tokens.bulletSize, tokens.activeBulletSize, tokens.titlePaddingTop, tokens.contentPaddingTop, tokens.contentSidePadding, tokens.contentVerticalPadding, tokens.verticalContentPaddingLeft, tokens.smallIndicatorIndentHeight, tokens.largeIndicatorIndentHeight, tokens.smallBulletIndentHeight, tokens.largeBulletIndentHeight, tokens.indicatorFontFamily, tokens.indicatorFontSize, tokens.indicatorFontStyle, tokens.indicatorFontWeight, tokens.indicatorLetterSpacing, tokens.indicatorLineHeight, tokens.activeIndicatorFontFamily, tokens.activeIndicatorFontSize, tokens.activeIndicatorFontStyle, tokens.activeIndicatorFontWeight, tokens.activeIndicatorLetterSpacing, tokens.activeIndicatorLineHeight, tokens.titleFontFamily, tokens.titleFontSize, tokens.titleFontStyle, tokens.titleFontWeight, tokens.titleLetterSpacing, tokens.titleLineHeight, tokens.contentFontFamily, tokens.contentFontSize, tokens.contentFontStyle, tokens.contentFontWeight, tokens.contentLetterSpacing, tokens.contentLineHeight, tokens.dividerThickness),
@@ -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}
@@ -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}
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmC,cAAc,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAO7D,aAAK,UAAU,GAAG,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAEpF,eAAO,MAAM,SAAS,SAAU,sBAAsB,cAAc,EAAE,UAAU,CAAC,mJA6E3E,CAAC;AAEP,eAAO,MAAM,WAAW;;;mBA/EQ,sBAAsB,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;CA4FhF,CAAC"}
1
+ {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAmC,cAAc,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGjE,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAO7D,aAAK,UAAU,GAAG,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAEpF,eAAO,MAAM,SAAS,SAAU,sBAAsB,cAAc,EAAE,UAAU,CAAC,mJAmF3E,CAAC;AAEP,eAAO,MAAM,WAAW;;;mBArFQ,sBAAsB,cAAc,EAAE,UAAU,CAAC;;;;;;;;;;CAkGhF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,0CAmChB,CAAC"}
1
+ {"version":3,"file":"Steps.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,IAAI,0CAqChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StepItem.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Steps/ui/StepItem/StepItem.styles.ts"],"names":[],"mappings":";AASA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;qDAIzB,CAAC;AAEF,eAAO,MAAM,aAAa,qKAYzB,CAAC;AAEF,eAAO,MAAM,eAAe,qKAc3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,qKAsClC,CAAC;AAEF,eAAO,MAAM,eAAe,qKA+C3B,CAAC;AAEF,eAAO,MAAM,MAAM;;EAYlB,CAAC;AAEF,eAAO,MAAM,eAAe;;EA8B3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,qKAalC,CAAC;AAEF,eAAO,MAAM,cAAc,qKA+E1B,CAAC"}
1
+ {"version":3,"file":"StepItem.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Steps/ui/StepItem/StepItem.styles.ts"],"names":[],"mappings":";AASA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;qDAIzB,CAAC;AAEF,eAAO,MAAM,aAAa,qKAYzB,CAAC;AAEF,eAAO,MAAM,eAAe,qKAc3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,qKAsClC,CAAC;AAEF,eAAO,MAAM,eAAe,qKA+C3B,CAAC;AAEF,eAAO,MAAM,MAAM;;EAYlB,CAAC;AAEF,eAAO,MAAM,eAAe;;EA8B3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,qKAalC,CAAC;AAEF,eAAO,MAAM,cAAc,qKAoF1B,CAAC"}
@@ -1 +0,0 @@
1
- .b7q3upx{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.b7q3upx.simple{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.b7q3upx.simple.item-has-indicator{height:var(--plasma-step-item-active-indicator-size);}.b7q3upx.simple:not(.item-has-indicator){height:var(--plasma-step-item-active-bullet-size);}.b7q3upx.simple.vertical-orientation.item-has-indicator{width:var(--plasma-step-item-active-indicator-size);height:100%;}.b7q3upx.simple.vertical-orientation:not(.item-has-indicator){width:var(--plasma-step-item-active-bullet-size);height:100%;}.b7q3upx.vertical-orientation{display:inline;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}.b7q3upx.vertical-orientation.simple{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
@@ -1 +0,0 @@
1
- .b7q3upx{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.b7q3upx.simple{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.b7q3upx.simple.item-has-indicator{height:var(--plasma-step-item-active-indicator-size);}.b7q3upx.simple:not(.item-has-indicator){height:var(--plasma-step-item-active-bullet-size);}.b7q3upx.simple.vertical-orientation.item-has-indicator{width:var(--plasma-step-item-active-indicator-size);height:100%;}.b7q3upx.simple.vertical-orientation:not(.item-has-indicator){width:var(--plasma-step-item-active-bullet-size);height:100%;}.b7q3upx.vertical-orientation{display:inline;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}.b7q3upx.vertical-orientation.simple{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}