diff --git a/src/components/Modal/modal.stories.tsx b/src/components/Modal/modal.stories.tsx index 3e3aaea0..0722b2ae 100644 --- a/src/components/Modal/modal.stories.tsx +++ b/src/components/Modal/modal.stories.tsx @@ -5,27 +5,6 @@ import Button from "../Button"; import ModalDoc from "./modal-doc.mdx"; import Card from "../Card/card"; -const BaseModal2 = (props: ModalProps) => { - const [visible2, setVisible2] = useState(false); - const [visible3, setVisible3] = useState(false); - const [visible4, setVisible4] = useState(false); - const [visible5, setVisible5] = useState(false); - const [visible6, setVisible6] = useState(false); - const [visible7, setVisible7] = useState(false); - const [visible8, setVisible8] = useState(false); - const [visible9, setVisible9] = useState(false); - - return ( - <> -
-
- -
-
- - ); -}; - const BaseModal = () => { const commonCss = { fontSize: 13, marginBottom: 20 }; const cardCss = { margin: "20px 20px 0 0" }; diff --git a/src/components/Progress/progress-doc.mdx b/src/components/Progress/progress-doc.mdx index 234b7b02..70189ff0 100644 --- a/src/components/Progress/progress-doc.mdx +++ b/src/components/Progress/progress-doc.mdx @@ -19,14 +19,4 @@ import dedent from 'ts-dedent'; ### 具体参数 -export const Template = (args) => - - -### 组件展示 - - -##### primary 类型 - - -{Template.bind({})} - \ No newline at end of file +export const Template = (args) => \ No newline at end of file diff --git a/src/components/Progress/progress.stories.tsx b/src/components/Progress/progress.stories.tsx new file mode 100644 index 00000000..4d84249a --- /dev/null +++ b/src/components/Progress/progress.stories.tsx @@ -0,0 +1,140 @@ +import React from "react"; +import { Meta, Story } from "@storybook/react"; +import Progress, { ProgressProps } from "./progress"; +import ProgressDoc from "./progress-doc.mdx"; +import Card from "../Card/card"; + +const BaseProgress = () => { + const commonCss = { marginBottom: 20 }; + const commonCssText = { fontSize: 14, marginBottom: 20 }; + const cardCss = { margin: "20px 20px 0 0", width: 500 }; + return ( +
+ + + + + + + + + + + + + + + + + + + + + +
通过 strokeHeight 来设置进度条的粗细
+ + + + + + + + +
+
+ ); +}; + +export default { + component: Progress, + title: "Progress 进度条", + parameters: { + docs: { + page: ProgressDoc, + source: { + type: "code", + }, + }, + controls: { + // include: ['percent', 'strokeHeight', 'showText', 'theme'], + hideNoControlsWarning: true, + }, + }, + argTypes: { + percent: { + control: { + type: "range", + min: 0, + max: 100, + step: 1, + }, + }, + theme: { + control: { + type: "select", + options: [ + "primary", + "secondary", + "success", + "info", + "warning", + "danger", + "light", + "dark", + ], + }, + }, + }, +} as Meta; + +const _default: Story = () => ; + +// primary +export const Primary = _default.bind({}); + +Primary.args = { + theme: "primary", + percent: 30, + strokeHeight: 10, + showText: true, +}; diff --git a/src/components/Progress/progress.tsx b/src/components/Progress/progress.tsx index 976c4e88..eba54b8d 100644 --- a/src/components/Progress/progress.tsx +++ b/src/components/Progress/progress.tsx @@ -20,7 +20,7 @@ export interface ProgressProps { /** * 自定义样式 */ - styles?: React.CSSProperties, + style?: React.CSSProperties, /** * 主题 */ @@ -32,11 +32,11 @@ export const Progress: FC = (props) => { percent, strokeHeight, showText, - styles, + style, theme, } = props; return ( -
+
{ - const { percent, theme, strokeHeight, showText } = props; - return -} - -export default { - component: Progress, - title: 'Progress', - parameters: { - docs: { - page: ProgressDoc, - source: { - type: 'code' - } - }, - controls: { - // include: ['percent', 'strokeHeight', 'showText', 'theme'], - hideNoControlsWarning: true - } - }, - argTypes: { - percent: { - control: { - type: 'range', min: 0, max: 100, step: 1, - } - }, - theme: { - control: { - type: 'select', - options: ['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'light', 'dark'], - } - } - } -} as Meta; - -const _default: Story = (args) => ; - -// primary -export const Primary = _default.bind({}); - -Primary.args = { - theme: 'primary', - percent: 30, - strokeHeight: 10, - showText: true, -} \ No newline at end of file