-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add or update sotries of alert, avatar and button
affects: @gio-design/components
- Loading branch information
Showing
15 changed files
with
6,713 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/components/src/components/alert/Alert.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { Story, Meta } from '@storybook/react/types-6-0'; | ||
|
||
import Alert from './index'; | ||
import { AlertProps } from './interfaces'; | ||
import './style'; | ||
|
||
export default { | ||
title: 'Components/Basic/Alert', | ||
component: Alert, | ||
} as Meta; | ||
|
||
const Template: Story<AlertProps> = (args) => <Alert {...args} />; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
type: 'success', | ||
message: 'Success Alert', | ||
}; |
6,828 changes: 6,585 additions & 243 deletions
6,828
packages/components/src/components/alert/__tests__/__snapshots__/alert.test.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import Alert from './alert'; | ||
|
||
export { AlertProps } from './interfaces'; | ||
export default Alert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export interface AlertProps { | ||
/** | ||
指定警告提示的样式 | ||
*/ | ||
type?: 'success' | 'info' | 'warning' | 'error'; | ||
/** | ||
指定警告的尺寸 | ||
*/ | ||
size?: 'small' | 'middle'; | ||
/** | ||
是否显示关闭按钮 | ||
*/ | ||
closeable?: boolean; | ||
/** | ||
自定义关闭按钮 | ||
*/ | ||
colseText?: React.ReactNode; | ||
/** | ||
警告提示的辅助性文字介绍 | ||
*/ | ||
description?: React.ReactNode; | ||
/** | ||
警告提示内容 | ||
*/ | ||
message?: React.ReactNode; | ||
/** | ||
是否显示辅助图标 | ||
*/ | ||
showIcon?: boolean; | ||
/** | ||
自定义图标,showIcon 为 true 时有效 | ||
*/ | ||
icon?: React.ReactNode; | ||
/** | ||
关闭时触发的回调函数 | ||
*/ | ||
onClose?: () => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.