9 |
--------------------------------------------------------------------------------
/docs/demo/inline.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: inline
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: simple
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/nav-base.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: nav-base
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/nextStep.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: nextStep
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/stepIcon.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: stepIcon
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/vertical.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: vertical
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/composable.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: composable
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/customIcon.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: customIcon
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/errorStep.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: errorStep
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/smallSize.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: smallSize
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | hero:
3 | title: "@rc-component/steps"
4 | description: React Steps Component
5 | ---
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/demo/progressDot.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: progressDot
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/verticalSmall.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: verticalSmall
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/custom-svg-icon.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: custom-svg-icon
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/demo/alternativeLabel.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: alternativeLabel
3 | nav:
4 | title: Demo
5 | path: /demo
6 | ---
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: ✅ test
2 | on: [push, pull_request]
3 | jobs:
4 | test:
5 | uses: react-component/rc-test/.github/workflows/test.yml@main
6 | secrets: inherit
--------------------------------------------------------------------------------
/docs/examples/nextStep.css:
--------------------------------------------------------------------------------
1 | .my-step-form {
2 | width: 100%;
3 | }
4 | .my-step-form > div {
5 | margin-bottom: 20px;
6 | }
7 | .my-step-container {
8 | width: 100%;
9 | }
10 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | const base = require('@umijs/fabric/dist/eslint');
2 |
3 | module.exports = {
4 | ...base,
5 | rules: {
6 | ...base.rules,
7 | 'arrow-parens': 0,
8 | 'react/sort-comp': 0,
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | # Unix-style newlines with a newline ending every file
5 | [*.{js,css}]
6 | end_of_line = lf
7 | insert_final_newline = true
8 | indent_style = space
9 | indent_size = 2
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import Steps, { type StepsProps } from './Steps';
2 | import Step from './Step';
3 |
4 | export { Step };
5 | export type { StepsProps };
6 | export { UnstableContext } from './UnstableContext';
7 | export default Steps;
8 |
--------------------------------------------------------------------------------
/src/UnstableContext.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export interface UnstableContextProps {
4 | /**
5 | * Used for Timeline component `reverse` prop.
6 | * Safe to remove if refactor.
7 | */
8 | railFollowPrevStatus?: boolean;
9 | }
10 |
11 | export const UnstableContext = React.createContext
24 | `,
25 | 'utf8',
26 | function(error) {
27 | if(error){
28 | console.log(error);
29 | return false;
30 | }
31 | console.log(`${name} 更新成功~`);
32 | }
33 | )
34 | });
35 |
--------------------------------------------------------------------------------
/docs/examples/composable.jsx:
--------------------------------------------------------------------------------
1 | import '../../assets/index.less';
2 | import '../../assets/iconfont.less';
3 | import React from 'react';
4 | import Steps from '@rc-component/steps';
5 |
6 | const description =
7 | '这里是多信息的描述啊描述啊描述啊描述啊哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶哦耶';
8 |
9 | export default () => (
10 | | name | 50 |type | 51 |default | 52 |description | 53 |
|---|---|---|---|
| type | 58 |string | 59 |default | 60 |diretypetion of Steps, could be `default` `navigation` `inline` | 61 |
| direction | 64 |string | 65 |horizontal | 66 |direction of Steps, enum: `horizontal` or `vertical` | 67 |
| current | 70 |number | 71 |0 | 72 |index of current step | 73 |
| initial | 76 |number | 77 |0 | 78 |index initial | 79 |
| size | 82 |string | 83 |84 | | size of Steps, could be `small` | 85 |
| titlePlacement | 88 |string | 89 |90 | | placement of step title, could be `vertical` | 91 |
| status | 94 |string | 95 |wait | 96 |status of current Steps, could be `error` `process` `finish` `wait` | 97 |
| icons | 100 |{ finish: ReactNode, error: ReactNode } | 101 |102 | | specify the default finish icon and error icon | 103 |
| itemRender | 106 |(item: StepProps, stepItem: React.ReactNode) => React.ReactNode | 107 |108 | | custom step item renderer | 109 |
| onChange | 112 |(current: number) => void | 113 |114 | | Trigger when Step changed | 115 |
| name | 125 |type | 126 |default | 127 |description | 128 |
|---|---|---|---|
| title | 133 |ReactNode | 134 |135 | | title of step item | 136 |
| subTitle | 139 |ReactNode | 140 |141 | | subTitle of step item | 142 |
| description | 145 |ReactNode | 146 |147 | | description of step item | 148 |
| icon | 151 |ReactNode | 152 |153 | | set icon of step item | 154 |
| status | 157 |string | 158 |159 | | status of current Steps, could be `error` `process` `finish` `wait` | 160 |
| tailContent | 163 |ReactNode | 164 |165 | | content above tail | 166 |
| disabled | 169 |bool | 170 |false | 171 |disabled step when onChange exist | 172 |
| render | 175 |(stepItem: React.ReactNode) => React.ReactNode | 176 |177 | | custom step item renderer | 178 |