@salutejs/plasma-new-hope 0.158.0-dev.0 → 0.159.0-canary.1443.11131308290.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Steps/Steps.css +18 -0
- package/cjs/components/Steps/Steps.js +120 -0
- package/cjs/components/Steps/Steps.js.map +1 -0
- package/cjs/components/Steps/Steps.styles.js +9 -0
- package/cjs/components/Steps/Steps.styles.js.map +1 -0
- package/cjs/components/Steps/Steps.styles_o055q.css +1 -0
- package/cjs/components/Steps/Steps.tokens.js +81 -0
- package/cjs/components/Steps/Steps.tokens.js.map +1 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.css +16 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.js +117 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.js.map +1 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js +83 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -0
- package/cjs/components/Steps/ui/StepItem/StepItem.styles_urheiv.css +9 -0
- package/cjs/components/Steps/variations/_size/base.js +9 -0
- package/cjs/components/Steps/variations/_size/base.js.map +1 -0
- package/cjs/components/Steps/variations/_size/base_x642ct.css +1 -0
- package/cjs/components/Steps/variations/_view/base.js +9 -0
- package/cjs/components/Steps/variations/_view/base.js.map +1 -0
- package/cjs/components/Steps/variations/_view/base_x642ct.css +1 -0
- package/cjs/index.css +12 -0
- package/cjs/index.js +5 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Steps/Steps.js +132 -0
- package/emotion/cjs/components/Steps/Steps.review-doc.mdx +304 -0
- package/emotion/cjs/components/Steps/Steps.styles.js +9 -0
- package/emotion/cjs/components/Steps/Steps.template-doc.mdx +84 -0
- package/emotion/cjs/components/Steps/Steps.tokens.js +79 -0
- package/emotion/cjs/components/Steps/Steps.types.js +5 -0
- package/emotion/cjs/components/Steps/index.js +25 -0
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.js +127 -0
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.styles.js +52 -0
- package/emotion/cjs/components/Steps/ui/StepItem/StepItem.types.js +5 -0
- package/emotion/cjs/components/Steps/ui/StepItem/index.js +12 -0
- package/emotion/cjs/components/Steps/ui/index.js +16 -0
- package/emotion/cjs/components/Steps/variations/_size/base.js +8 -0
- package/emotion/cjs/components/Steps/variations/_size/tokens.json +1 -0
- package/emotion/cjs/components/Steps/variations/_view/base.js +8 -0
- package/emotion/cjs/components/Steps/variations/_view/tokens.json +1 -0
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +25 -0
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.js +13 -0
- package/emotion/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/emotion/cjs/examples/plasma_web/components/Steps/Steps.config.js +25 -0
- package/emotion/cjs/examples/plasma_web/components/Steps/Steps.js +13 -0
- package/emotion/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +169 -0
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Steps/Steps.js +123 -0
- package/emotion/es/components/Steps/Steps.review-doc.mdx +304 -0
- package/emotion/es/components/Steps/Steps.styles.js +3 -0
- package/emotion/es/components/Steps/Steps.template-doc.mdx +84 -0
- package/emotion/es/components/Steps/Steps.tokens.js +73 -0
- package/emotion/es/components/Steps/Steps.types.js +1 -0
- package/emotion/es/components/Steps/index.js +2 -0
- package/emotion/es/components/Steps/ui/StepItem/StepItem.js +118 -0
- package/emotion/es/components/Steps/ui/StepItem/StepItem.styles.js +45 -0
- package/emotion/es/components/Steps/ui/StepItem/StepItem.types.js +1 -0
- package/emotion/es/components/Steps/ui/StepItem/index.js +1 -0
- package/emotion/es/components/Steps/ui/index.js +1 -0
- package/emotion/es/components/Steps/variations/_size/base.js +2 -0
- package/emotion/es/components/Steps/variations/_size/tokens.json +1 -0
- package/emotion/es/components/Steps/variations/_view/base.js +2 -0
- package/emotion/es/components/Steps/variations/_view/tokens.json +1 -0
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.config.js +19 -0
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.js +9 -0
- package/emotion/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/emotion/es/examples/plasma_web/components/Steps/Steps.config.js +19 -0
- package/emotion/es/examples/plasma_web/components/Steps/Steps.js +9 -0
- package/emotion/es/examples/plasma_web/components/Steps/Steps.stories.tsx +169 -0
- package/emotion/es/index.js +1 -0
- package/es/components/Steps/Steps.css +18 -0
- package/es/components/Steps/Steps.js +115 -0
- package/es/components/Steps/Steps.js.map +1 -0
- package/es/components/Steps/Steps.styles.js +5 -0
- package/es/components/Steps/Steps.styles.js.map +1 -0
- package/es/components/Steps/Steps.styles_o055q.css +1 -0
- package/es/components/Steps/Steps.tokens.js +76 -0
- package/es/components/Steps/Steps.tokens.js.map +1 -0
- package/es/components/Steps/ui/StepItem/StepItem.css +16 -0
- package/es/components/Steps/ui/StepItem/StepItem.js +113 -0
- package/es/components/Steps/ui/StepItem/StepItem.js.map +1 -0
- package/es/components/Steps/ui/StepItem/StepItem.styles.js +71 -0
- package/es/components/Steps/ui/StepItem/StepItem.styles.js.map +1 -0
- package/es/components/Steps/ui/StepItem/StepItem.styles_urheiv.css +9 -0
- package/es/components/Steps/variations/_size/base.js +5 -0
- package/es/components/Steps/variations/_size/base.js.map +1 -0
- package/es/components/Steps/variations/_size/base_x642ct.css +1 -0
- package/es/components/Steps/variations/_view/base.js +5 -0
- package/es/components/Steps/variations/_view/base.js.map +1 -0
- package/es/components/Steps/variations/_view/base_x642ct.css +1 -0
- package/es/index.css +12 -0
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/Steps/Steps.js +132 -0
- package/styled-components/cjs/components/Steps/Steps.review-doc.mdx +304 -0
- package/styled-components/cjs/components/Steps/Steps.styles.js +9 -0
- package/styled-components/cjs/components/Steps/Steps.template-doc.mdx +84 -0
- package/styled-components/cjs/components/Steps/Steps.tokens.js +79 -0
- package/styled-components/cjs/components/Steps/Steps.types.js +5 -0
- package/styled-components/cjs/components/Steps/index.js +25 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.js +127 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.styles.js +43 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/StepItem.types.js +5 -0
- package/styled-components/cjs/components/Steps/ui/StepItem/index.js +12 -0
- package/styled-components/cjs/components/Steps/ui/index.js +16 -0
- package/styled-components/cjs/components/Steps/variations/_size/base.js +8 -0
- package/styled-components/cjs/components/Steps/variations/_size/tokens.json +1 -0
- package/styled-components/cjs/components/Steps/variations/_view/base.js +8 -0
- package/styled-components/cjs/components/Steps/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.config.js +25 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.js +13 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.config.js +25 -0
- package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.js +13 -0
- package/styled-components/cjs/examples/plasma_web/components/Steps/Steps.stories.tsx +169 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Steps/Steps.js +123 -0
- package/styled-components/es/components/Steps/Steps.review-doc.mdx +304 -0
- package/styled-components/es/components/Steps/Steps.styles.js +3 -0
- package/styled-components/es/components/Steps/Steps.template-doc.mdx +84 -0
- package/styled-components/es/components/Steps/Steps.tokens.js +73 -0
- package/styled-components/es/components/Steps/Steps.types.js +1 -0
- package/styled-components/es/components/Steps/index.js +2 -0
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.js +118 -0
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.styles.js +36 -0
- package/styled-components/es/components/Steps/ui/StepItem/StepItem.types.js +1 -0
- package/styled-components/es/components/Steps/ui/StepItem/index.js +1 -0
- package/styled-components/es/components/Steps/ui/index.js +1 -0
- package/styled-components/es/components/Steps/variations/_size/base.js +2 -0
- package/styled-components/es/components/Steps/variations/_size/tokens.json +1 -0
- package/styled-components/es/components/Steps/variations/_view/base.js +2 -0
- package/styled-components/es/components/Steps/variations/_view/tokens.json +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.config.js +19 -0
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.js +9 -0
- package/styled-components/es/examples/plasma_b2c/components/Steps/Steps.stories.tsx +169 -0
- package/styled-components/es/examples/plasma_web/components/Steps/Steps.config.js +19 -0
- package/styled-components/es/examples/plasma_web/components/Steps/Steps.js +9 -0
- package/styled-components/es/examples/plasma_web/components/Steps/Steps.stories.tsx +169 -0
- package/styled-components/es/index.js +1 -0
- package/types/components/Steps/Steps.d.ts +19 -0
- package/types/components/Steps/Steps.d.ts.map +1 -0
- package/types/components/Steps/Steps.styles.d.ts +2 -0
- package/types/components/Steps/Steps.styles.d.ts.map +1 -0
- package/types/components/Steps/Steps.tokens.d.ts +74 -0
- package/types/components/Steps/Steps.tokens.d.ts.map +1 -0
- package/types/components/Steps/Steps.types.d.ts +63 -0
- package/types/components/Steps/Steps.types.d.ts.map +1 -0
- package/types/components/Steps/index.d.ts +4 -0
- package/types/components/Steps/index.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/StepItem.d.ts +17 -0
- package/types/components/Steps/ui/StepItem/StepItem.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts +20 -0
- package/types/components/Steps/ui/StepItem/StepItem.styles.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/StepItem.types.d.ts +34 -0
- package/types/components/Steps/ui/StepItem/StepItem.types.d.ts.map +1 -0
- package/types/components/Steps/ui/StepItem/index.d.ts +3 -0
- package/types/components/Steps/ui/StepItem/index.d.ts.map +1 -0
- package/types/components/Steps/ui/index.d.ts +2 -0
- package/types/components/Steps/ui/index.d.ts.map +1 -0
- package/types/components/Steps/variations/_size/base.d.ts +2 -0
- package/types/components/Steps/variations/_size/base.d.ts.map +1 -0
- package/types/components/Steps/variations/_view/base.d.ts +2 -0
- package/types/components/Steps/variations/_view/base.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.config.d.ts +18 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.d.ts +35 -0
- package/types/examples/plasma_b2c/components/Steps/Steps.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Steps/Steps.config.d.ts +18 -0
- package/types/examples/plasma_web/components/Steps/Steps.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Steps/Steps.d.ts +35 -0
- package/types/examples/plasma_web/components/Steps/Steps.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
@@ -0,0 +1,19 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { stepsTokens as tokens } from '../../../../components/Steps';
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
size: 's',
|
6
|
+
view: 'default'
|
7
|
+
},
|
8
|
+
variations: {
|
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)
|
11
|
+
},
|
12
|
+
size: {
|
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),
|
14
|
+
m: /*#__PURE__*/css(["", ":1.5rem;", ":2.25rem;", ":0.5rem;", ":1rem;", ":0.625rem;", ":0.375rem;", ":1.75rem;", ":0.875rem;", ":0.75rem;", ":0.75rem;", ":0.4375rem;", ":1.5rem;", ":1.125rem;", ":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-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);", ":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);", ":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),
|
15
|
+
s: /*#__PURE__*/css(["", ":1.5rem;", ":1.5rem;", ":0.5rem;", ":1rem;", ":0.5rem;", ":0.375rem;", ":1.5rem;", ":0.6875rem;", ":0.75rem;", ":0.5rem;", ":0.5rem;", ":1rem;", ":0.75rem;", ":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-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-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);", ":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),
|
16
|
+
xs: /*#__PURE__*/css(["", ":1.5rem;", ":1.5rem;", ":0.5rem;", ":1rem;", ":0.5rem;", ":0.25rem;", ":1.5rem;", ":0.5625rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":0.75rem;", ":0.5rem;", ":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-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-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-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);", ":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)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { stepsConfig } from '../../../../components/Steps';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './Steps.config';
|
4
|
+
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
6
|
+
// @ts-ignore todo
|
7
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(stepsConfig, config);
|
8
|
+
var Steps = /*#__PURE__*/component(mergedConfig);
|
9
|
+
export { Steps, mergedConfig };
|
@@ -0,0 +1,169 @@
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
2
|
+
import type { ComponentProps } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import { disableProps } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { IconMic } from '../../../../components/_Icon';
|
7
|
+
import { argTypesFromConfig, WithTheme } from '../../../_helpers';
|
8
|
+
import { StepItemProps } from '../../../../components/Steps/ui';
|
9
|
+
|
10
|
+
import { Steps, mergedConfig } from './Steps';
|
11
|
+
|
12
|
+
const meta: Meta<typeof Steps> = {
|
13
|
+
title: 'plasma_b2c/Steps',
|
14
|
+
decorators: [WithTheme],
|
15
|
+
component: Steps,
|
16
|
+
argTypes: {
|
17
|
+
...argTypesFromConfig(mergedConfig),
|
18
|
+
},
|
19
|
+
};
|
20
|
+
|
21
|
+
export default meta;
|
22
|
+
|
23
|
+
type Story = StoryObj<ComponentProps<typeof Steps>>;
|
24
|
+
|
25
|
+
const renderIndicator = ({ status, size }) => {
|
26
|
+
let iconSize;
|
27
|
+
if (size === 'xs' || size === 's') {
|
28
|
+
iconSize = 'xs';
|
29
|
+
} else if (status === 'active') {
|
30
|
+
iconSize = 's';
|
31
|
+
} else {
|
32
|
+
iconSize = 'xs';
|
33
|
+
}
|
34
|
+
|
35
|
+
return <IconMic color="inherit" size={iconSize} />;
|
36
|
+
};
|
37
|
+
|
38
|
+
const DefaultStory = (args) => {
|
39
|
+
const { maxWidth, title, content, size, indicatorType, quantity, hasContent, loading, disabled, simple } = args;
|
40
|
+
|
41
|
+
const innerTitle = title || 'Title';
|
42
|
+
|
43
|
+
const [items, setItems] = useState([]);
|
44
|
+
|
45
|
+
useEffect(() => {
|
46
|
+
const newItems = new Array(quantity).fill(null).map((_, index) => {
|
47
|
+
const indicator = index + 1;
|
48
|
+
|
49
|
+
if (simple) {
|
50
|
+
return {
|
51
|
+
indicator,
|
52
|
+
status: 'inactive',
|
53
|
+
};
|
54
|
+
}
|
55
|
+
|
56
|
+
return {
|
57
|
+
title: innerTitle,
|
58
|
+
content,
|
59
|
+
indicator,
|
60
|
+
status: 'inactive',
|
61
|
+
};
|
62
|
+
});
|
63
|
+
|
64
|
+
setItems(newItems);
|
65
|
+
}, [hasContent, loading, quantity, innerTitle, content, simple]);
|
66
|
+
|
67
|
+
useEffect(() => {
|
68
|
+
setItems((curItems) =>
|
69
|
+
curItems.map((item, index) => {
|
70
|
+
if (indicatorType === 'numbered') {
|
71
|
+
return { ...item, indicator: index + 1 };
|
72
|
+
}
|
73
|
+
|
74
|
+
if (indicatorType === 'bullet') {
|
75
|
+
return { ...item, indicator: undefined };
|
76
|
+
}
|
77
|
+
|
78
|
+
if (indicatorType === 'icon') {
|
79
|
+
return { ...item, indicator: renderIndicator };
|
80
|
+
}
|
81
|
+
|
82
|
+
return item;
|
83
|
+
}),
|
84
|
+
);
|
85
|
+
}, [indicatorType]);
|
86
|
+
|
87
|
+
useEffect(() => {
|
88
|
+
setItems((curItems) => curItems.map((item) => ({ ...item, disabled })));
|
89
|
+
}, [disabled]);
|
90
|
+
|
91
|
+
const onChange = (item: StepItemProps, index: number, prevIndex: number) => {
|
92
|
+
if (prevIndex !== undefined) {
|
93
|
+
items[prevIndex].status = 'completed';
|
94
|
+
}
|
95
|
+
|
96
|
+
items[index].status = 'active';
|
97
|
+
|
98
|
+
setItems([...items]);
|
99
|
+
};
|
100
|
+
|
101
|
+
return (
|
102
|
+
<div style={{ maxWidth }}>
|
103
|
+
<Steps size={size} items={items} onChange={onChange} hasLoader={loading} {...args} />
|
104
|
+
</div>
|
105
|
+
);
|
106
|
+
};
|
107
|
+
|
108
|
+
export const Default: Story = {
|
109
|
+
args: {
|
110
|
+
maxWidth: '100%',
|
111
|
+
quantity: 6,
|
112
|
+
size: 'm',
|
113
|
+
title: 'Title',
|
114
|
+
content: 'Content',
|
115
|
+
contentAlign: 'left',
|
116
|
+
indicatorType: 'numbered',
|
117
|
+
orientation: 'horizontal',
|
118
|
+
hasLine: true,
|
119
|
+
hasContent: 'all',
|
120
|
+
disabled: false,
|
121
|
+
loading: false,
|
122
|
+
simple: false,
|
123
|
+
},
|
124
|
+
argTypes: {
|
125
|
+
maxWidth: {
|
126
|
+
control: {
|
127
|
+
type: 'text',
|
128
|
+
},
|
129
|
+
},
|
130
|
+
size: {
|
131
|
+
options: ['xs', 's', 'm', 'l'],
|
132
|
+
control: {
|
133
|
+
type: 'inline-radio',
|
134
|
+
},
|
135
|
+
},
|
136
|
+
orientation: {
|
137
|
+
options: ['horizontal', 'vertical'],
|
138
|
+
control: {
|
139
|
+
type: 'inline-radio',
|
140
|
+
},
|
141
|
+
},
|
142
|
+
contentAlign: {
|
143
|
+
options: ['left', 'center'],
|
144
|
+
control: {
|
145
|
+
type: 'inline-radio',
|
146
|
+
},
|
147
|
+
if: { arg: 'orientation', eq: 'horizontal' },
|
148
|
+
},
|
149
|
+
indicatorType: {
|
150
|
+
options: ['numbered', 'bullet', 'icon'],
|
151
|
+
control: {
|
152
|
+
type: 'inline-radio',
|
153
|
+
},
|
154
|
+
},
|
155
|
+
hasContent: {
|
156
|
+
options: ['all', 'active', 'none'],
|
157
|
+
control: {
|
158
|
+
type: 'inline-radio',
|
159
|
+
},
|
160
|
+
},
|
161
|
+
simple: {
|
162
|
+
control: {
|
163
|
+
type: 'boolean',
|
164
|
+
},
|
165
|
+
},
|
166
|
+
...disableProps(['view']),
|
167
|
+
},
|
168
|
+
render: (args) => <DefaultStory {...args} />,
|
169
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { stepsTokens as tokens } from '../../../../components/Steps';
|
3
|
+
export var config = {
|
4
|
+
defaults: {
|
5
|
+
size: 's',
|
6
|
+
view: 'default'
|
7
|
+
},
|
8
|
+
variations: {
|
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)
|
11
|
+
},
|
12
|
+
size: {
|
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),
|
14
|
+
m: /*#__PURE__*/css(["", ":1.5rem;", ":2.25rem;", ":0.5rem;", ":1rem;", ":0.625rem;", ":0.375rem;", ":1.75rem;", ":0.875rem;", ":0.75rem;", ":0.75rem;", ":0.4375rem;", ":1.5rem;", ":1.125rem;", ":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-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);", ":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);", ":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),
|
15
|
+
s: /*#__PURE__*/css(["", ":1.5rem;", ":1.5rem;", ":0.5rem;", ":1rem;", ":0.5rem;", ":0.375rem;", ":1.5rem;", ":0.6875rem;", ":0.75rem;", ":0.5rem;", ":0.5rem;", ":1rem;", ":0.75rem;", ":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-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-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);", ":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),
|
16
|
+
xs: /*#__PURE__*/css(["", ":1.5rem;", ":1.5rem;", ":0.5rem;", ":1rem;", ":0.5rem;", ":0.25rem;", ":1.5rem;", ":0.5625rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":0.75rem;", ":0.5rem;", ":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-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-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-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);", ":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)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { stepsConfig } from '../../../../components/Steps';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './Steps.config';
|
4
|
+
|
5
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
6
|
+
// @ts-ignore todo
|
7
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(stepsConfig, config);
|
8
|
+
var Steps = /*#__PURE__*/component(mergedConfig);
|
9
|
+
export { Steps, mergedConfig };
|
@@ -0,0 +1,169 @@
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
2
|
+
import type { ComponentProps } from 'react';
|
3
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
4
|
+
import { disableProps } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { IconMic } from '../../../../components/_Icon';
|
7
|
+
import { argTypesFromConfig, WithTheme } from '../../../_helpers';
|
8
|
+
import { StepItemProps } from '../../../../components/Steps/ui';
|
9
|
+
|
10
|
+
import { Steps, mergedConfig } from './Steps';
|
11
|
+
|
12
|
+
const meta: Meta<typeof Steps> = {
|
13
|
+
title: 'plasma_web/Steps',
|
14
|
+
decorators: [WithTheme],
|
15
|
+
component: Steps,
|
16
|
+
argTypes: {
|
17
|
+
...argTypesFromConfig(mergedConfig),
|
18
|
+
},
|
19
|
+
};
|
20
|
+
|
21
|
+
export default meta;
|
22
|
+
|
23
|
+
type Story = StoryObj<ComponentProps<typeof Steps>>;
|
24
|
+
|
25
|
+
const renderIndicator = ({ status, size }) => {
|
26
|
+
let iconSize;
|
27
|
+
if (size === 'xs' || size === 's') {
|
28
|
+
iconSize = 'xs';
|
29
|
+
} else if (status === 'active') {
|
30
|
+
iconSize = 's';
|
31
|
+
} else {
|
32
|
+
iconSize = 'xs';
|
33
|
+
}
|
34
|
+
|
35
|
+
return <IconMic color="inherit" size={iconSize} />;
|
36
|
+
};
|
37
|
+
|
38
|
+
const DefaultStory = (args) => {
|
39
|
+
const { maxWidth, title, content, size, indicatorType, quantity, hasContent, loading, disabled, simple } = args;
|
40
|
+
|
41
|
+
const innerTitle = title || 'Title';
|
42
|
+
|
43
|
+
const [items, setItems] = useState([]);
|
44
|
+
|
45
|
+
useEffect(() => {
|
46
|
+
const newItems = new Array(quantity).fill(null).map((_, index) => {
|
47
|
+
const indicator = index + 1;
|
48
|
+
|
49
|
+
if (simple) {
|
50
|
+
return {
|
51
|
+
indicator,
|
52
|
+
status: 'inactive',
|
53
|
+
};
|
54
|
+
}
|
55
|
+
|
56
|
+
return {
|
57
|
+
title: innerTitle,
|
58
|
+
content,
|
59
|
+
indicator,
|
60
|
+
status: 'inactive',
|
61
|
+
};
|
62
|
+
});
|
63
|
+
|
64
|
+
setItems(newItems);
|
65
|
+
}, [hasContent, loading, quantity, innerTitle, content, simple]);
|
66
|
+
|
67
|
+
useEffect(() => {
|
68
|
+
setItems((curItems) =>
|
69
|
+
curItems.map((item, index) => {
|
70
|
+
if (indicatorType === 'numbered') {
|
71
|
+
return { ...item, indicator: index + 1 };
|
72
|
+
}
|
73
|
+
|
74
|
+
if (indicatorType === 'bullet') {
|
75
|
+
return { ...item, indicator: undefined };
|
76
|
+
}
|
77
|
+
|
78
|
+
if (indicatorType === 'icon') {
|
79
|
+
return { ...item, indicator: renderIndicator };
|
80
|
+
}
|
81
|
+
|
82
|
+
return item;
|
83
|
+
}),
|
84
|
+
);
|
85
|
+
}, [indicatorType]);
|
86
|
+
|
87
|
+
useEffect(() => {
|
88
|
+
setItems((curItems) => curItems.map((item) => ({ ...item, disabled })));
|
89
|
+
}, [disabled]);
|
90
|
+
|
91
|
+
const onChange = (item: StepItemProps, index: number, prevIndex: number) => {
|
92
|
+
if (prevIndex !== undefined) {
|
93
|
+
items[prevIndex].status = 'completed';
|
94
|
+
}
|
95
|
+
|
96
|
+
items[index].status = 'active';
|
97
|
+
|
98
|
+
setItems([...items]);
|
99
|
+
};
|
100
|
+
|
101
|
+
return (
|
102
|
+
<div style={{ maxWidth }}>
|
103
|
+
<Steps size={size} items={items} onChange={onChange} hasLoader={loading} {...args} />
|
104
|
+
</div>
|
105
|
+
);
|
106
|
+
};
|
107
|
+
|
108
|
+
export const Default: Story = {
|
109
|
+
args: {
|
110
|
+
maxWidth: '100%',
|
111
|
+
quantity: 6,
|
112
|
+
size: 'm',
|
113
|
+
title: 'Title',
|
114
|
+
content: 'Content',
|
115
|
+
contentAlign: 'left',
|
116
|
+
indicatorType: 'numbered',
|
117
|
+
orientation: 'horizontal',
|
118
|
+
hasLine: true,
|
119
|
+
hasContent: 'all',
|
120
|
+
disabled: false,
|
121
|
+
loading: false,
|
122
|
+
simple: false,
|
123
|
+
},
|
124
|
+
argTypes: {
|
125
|
+
maxWidth: {
|
126
|
+
control: {
|
127
|
+
type: 'text',
|
128
|
+
},
|
129
|
+
},
|
130
|
+
size: {
|
131
|
+
options: ['xs', 's', 'm', 'l'],
|
132
|
+
control: {
|
133
|
+
type: 'inline-radio',
|
134
|
+
},
|
135
|
+
},
|
136
|
+
orientation: {
|
137
|
+
options: ['horizontal', 'vertical'],
|
138
|
+
control: {
|
139
|
+
type: 'inline-radio',
|
140
|
+
},
|
141
|
+
},
|
142
|
+
contentAlign: {
|
143
|
+
options: ['left', 'center'],
|
144
|
+
control: {
|
145
|
+
type: 'inline-radio',
|
146
|
+
},
|
147
|
+
if: { arg: 'orientation', eq: 'horizontal' },
|
148
|
+
},
|
149
|
+
indicatorType: {
|
150
|
+
options: ['numbered', 'bullet', 'icon'],
|
151
|
+
control: {
|
152
|
+
type: 'inline-radio',
|
153
|
+
},
|
154
|
+
},
|
155
|
+
hasContent: {
|
156
|
+
options: ['all', 'active', 'none'],
|
157
|
+
control: {
|
158
|
+
type: 'inline-radio',
|
159
|
+
},
|
160
|
+
},
|
161
|
+
simple: {
|
162
|
+
control: {
|
163
|
+
type: 'boolean',
|
164
|
+
},
|
165
|
+
},
|
166
|
+
...disableProps(['view']),
|
167
|
+
},
|
168
|
+
render: (args) => <DefaultStory {...args} />,
|
169
|
+
};
|
@@ -50,6 +50,7 @@ export * from './components/Divider';
|
|
50
50
|
export * from './components/Toolbar';
|
51
51
|
export * from './components/Sheet';
|
52
52
|
export * from './components/Slider';
|
53
|
+
export * from './components/Steps';
|
53
54
|
export * from './components/Range';
|
54
55
|
export * from './components/Accordion';
|
55
56
|
export * from './components/DatePicker';
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
2
|
+
import type { RootPropsOmitOnChange } from '../../engines/types';
|
3
|
+
import { StepsProps } from './Steps.types';
|
4
|
+
export declare const stepsRoot: (Root: RootPropsOmitOnChange<HTMLDivElement, StepsProps & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>>) => React.ForwardRefExoticComponent<StepsProps & React.RefAttributes<HTMLDivElement>>;
|
5
|
+
export declare const stepsConfig: {
|
6
|
+
name: string;
|
7
|
+
tag: string;
|
8
|
+
layout: (Root: RootPropsOmitOnChange<HTMLDivElement, StepsProps & Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>>) => React.ForwardRefExoticComponent<StepsProps & React.RefAttributes<HTMLDivElement>>;
|
9
|
+
base: import("@linaria/core").LinariaClassName;
|
10
|
+
variations: {
|
11
|
+
size: import("@linaria/core").LinariaClassName;
|
12
|
+
view: import("@linaria/core").LinariaClassName;
|
13
|
+
};
|
14
|
+
defaults: {
|
15
|
+
view: string;
|
16
|
+
size: string;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
//# sourceMappingURL=Steps.d.ts.map
|
@@ -0,0 +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,EAAE,MAAM,eAAe,CAAC;AAM3C,eAAO,MAAM,SAAS,SACZ,sBAAsB,cAAc,EAAE,UAAU,GAAG,KAAK,eAAe,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC,sFA2FxG,CAAC;AAEP,eAAO,MAAM,WAAW;;;mBA7Fd,sBAAsB,cAAc,EAAE,UAAU,GAAG,KAAK,eAAe,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;;;;;;;;;;CA0G7G,CAAC"}
|
@@ -0,0 +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"}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
export declare const classes: {
|
2
|
+
simple: string;
|
3
|
+
centered: string;
|
4
|
+
active: string;
|
5
|
+
inactive: string;
|
6
|
+
clickable: string;
|
7
|
+
hovered: string;
|
8
|
+
disabled: string;
|
9
|
+
verticalOrientation: string;
|
10
|
+
hasIndicator: string;
|
11
|
+
activeItem: string;
|
12
|
+
transparentDivider: string;
|
13
|
+
};
|
14
|
+
export declare const tokens: {
|
15
|
+
indicatorSize: string;
|
16
|
+
activeIndicatorSize: string;
|
17
|
+
bulletSize: string;
|
18
|
+
activeBulletSize: string;
|
19
|
+
titlePaddingTop: string;
|
20
|
+
contentPaddingTop: string;
|
21
|
+
contentPaddingRight: string;
|
22
|
+
contentSidePadding: string;
|
23
|
+
contentVerticalPadding: string;
|
24
|
+
verticalContentPaddingLeft: string;
|
25
|
+
smallIndicatorIndentHeight: string;
|
26
|
+
largeIndicatorIndentHeight: string;
|
27
|
+
smallBulletIndentHeight: string;
|
28
|
+
largeBulletIndentHeight: string;
|
29
|
+
titleFontFamily: string;
|
30
|
+
titleFontSize: string;
|
31
|
+
titleFontStyle: string;
|
32
|
+
titleFontWeight: string;
|
33
|
+
titleLetterSpacing: string;
|
34
|
+
titleLineHeight: string;
|
35
|
+
contentFontFamily: string;
|
36
|
+
contentFontSize: string;
|
37
|
+
contentFontStyle: string;
|
38
|
+
contentFontWeight: string;
|
39
|
+
contentLetterSpacing: string;
|
40
|
+
contentLineHeight: string;
|
41
|
+
indicatorFontFamily: string;
|
42
|
+
indicatorFontSize: string;
|
43
|
+
indicatorFontStyle: string;
|
44
|
+
indicatorFontWeight: string;
|
45
|
+
indicatorLetterSpacing: string;
|
46
|
+
indicatorLineHeight: string;
|
47
|
+
activeIndicatorFontFamily: string;
|
48
|
+
activeIndicatorFontSize: string;
|
49
|
+
activeIndicatorFontStyle: string;
|
50
|
+
activeIndicatorFontWeight: string;
|
51
|
+
activeIndicatorLetterSpacing: string;
|
52
|
+
activeIndicatorLineHeight: string;
|
53
|
+
activeTitleColor: string;
|
54
|
+
activeTitleColorHover: string;
|
55
|
+
inactiveTitleColor: string;
|
56
|
+
inactiveTitleColorHover: string;
|
57
|
+
contentColor: string;
|
58
|
+
activeIndicatorBorder: string;
|
59
|
+
activeIndicatorBorderHover: string;
|
60
|
+
activeIndicatorColor: string;
|
61
|
+
activeIndicatorColorHover: string;
|
62
|
+
activeIndicatorBackground: string;
|
63
|
+
completedIndicatorColor: string;
|
64
|
+
completedIndicatorColorHover: string;
|
65
|
+
completedIndicatorBackground: string;
|
66
|
+
completedIndicatorBackgroundHover: string;
|
67
|
+
inactiveIndicatorColor: string;
|
68
|
+
inactiveIndicatorColorHover: string;
|
69
|
+
inactiveIndicatorBackground: string;
|
70
|
+
inactiveIndicatorBackgroundHover: string;
|
71
|
+
disabledOpacity: string;
|
72
|
+
dividerThickness: string;
|
73
|
+
};
|
74
|
+
//# sourceMappingURL=Steps.tokens.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Steps.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyElB,CAAC"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { StepStatus, StepItemProps } from './ui';
|
2
|
+
export declare type StepsContent = 'all' | 'active' | 'none';
|
3
|
+
export declare type StepsContentAlign = 'left' | 'center';
|
4
|
+
export declare type StepsOrientation = 'horizontal' | 'vertical';
|
5
|
+
export interface StepsProps {
|
6
|
+
/**
|
7
|
+
* Массив шагов
|
8
|
+
* @default []
|
9
|
+
*/
|
10
|
+
items?: StepItemProps[];
|
11
|
+
/**
|
12
|
+
* Размер шага
|
13
|
+
*/
|
14
|
+
size?: string;
|
15
|
+
/**
|
16
|
+
* Отображение шага
|
17
|
+
*/
|
18
|
+
view?: string;
|
19
|
+
/**
|
20
|
+
* Ориентация компонента
|
21
|
+
* @default 'horizontal'
|
22
|
+
*/
|
23
|
+
orientation?: StepsOrientation;
|
24
|
+
/**
|
25
|
+
* Выравнивание контента в шагах
|
26
|
+
* @default 'left'
|
27
|
+
* @description
|
28
|
+
* left - выравнивание по левому краю
|
29
|
+
* center - выравнивание по центру
|
30
|
+
*/
|
31
|
+
contentAlign?: StepsContentAlign;
|
32
|
+
/**
|
33
|
+
* Включает разделительную линию
|
34
|
+
* @default true
|
35
|
+
*/
|
36
|
+
hasLine?: boolean;
|
37
|
+
/**
|
38
|
+
* Режим отображения контента
|
39
|
+
* @default 'all'
|
40
|
+
* @description
|
41
|
+
* all - контент у всех элементов
|
42
|
+
* active - только у активного
|
43
|
+
* none - контент скрыт
|
44
|
+
*/
|
45
|
+
hasContent?: StepsContent;
|
46
|
+
/**
|
47
|
+
* Отображает лоадер вместо индикатора активного шага.
|
48
|
+
*/
|
49
|
+
hasLoader?: boolean;
|
50
|
+
/**
|
51
|
+
* Индекс текущего шага, для uncontrolled компонента
|
52
|
+
*/
|
53
|
+
current?: number;
|
54
|
+
/**
|
55
|
+
* Статус текущего шага, имеет приоритет над item.status
|
56
|
+
*/
|
57
|
+
status?: StepStatus;
|
58
|
+
/**
|
59
|
+
* Обработчик изменения шага, делает индикаторы и заголовки шагов кликабельными
|
60
|
+
*/
|
61
|
+
onChange?: (item: StepItemProps, index: number, prevIndex?: number) => void;
|
62
|
+
}
|
63
|
+
//# sourceMappingURL=Steps.types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Steps.types.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/Steps.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAEjD,oBAAY,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AACrD,oBAAY,iBAAiB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAClD,oBAAY,gBAAgB,GAAG,YAAY,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,UAAU;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/E"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Steps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvD,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { StepsContent, StepsContentAlign, StepsOrientation } from '../../Steps.types';
|
3
|
+
import type { StepItemProps } from './StepItem.types';
|
4
|
+
export declare const StepItem: React.FC<StepItemProps & {
|
5
|
+
index: number;
|
6
|
+
items: StepItemProps[];
|
7
|
+
size: string;
|
8
|
+
hasLine?: boolean;
|
9
|
+
hasContent?: StepsContent;
|
10
|
+
hasLoader?: boolean;
|
11
|
+
isFirst?: boolean;
|
12
|
+
isLast?: boolean;
|
13
|
+
onClick?: (item: StepItemProps, index: number) => void;
|
14
|
+
contentAlign?: StepsContentAlign;
|
15
|
+
orientation?: StepsOrientation;
|
16
|
+
}>;
|
17
|
+
//# sourceMappingURL=StepItem.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"StepItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Steps/ui/StepItem/StepItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoBtD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAC3B,aAAa,GAAG;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAClC,CA+LJ,CAAC"}
|