Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ui): Add Action demo with tooltip and popconfirm #902

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/ui/src/Action/demo/with-tooltip-popconfirm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { Popconfirm, Space } from '@oceanbase/design';
import { Action } from '@oceanbase/ui';
import { DownOutlined } from '@oceanbase/icons';

export default () => {
return (
<Action.Group
moreText={
<Space size={4}>
更多
<DownOutlined />
</Space>
}
>
<Action.Button type="primary" tooltip="This is tooltip">
action1
</Action.Button>
<Popconfirm placement="bottom" title="Confirm to delete it?">
<Action.Button danger tooltip="This is tooltip">
危险按钮
</Action.Button>
</Popconfirm>
<Action.Button>action3</Action.Button>
<Action.Button>action4</Action.Button>
<Action.Button>action5</Action.Button>
</Action.Group>
);
};
6 changes: 2 additions & 4 deletions packages/ui/src/Action/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ nav:

## 代码演示

<!-- prettier-ignore -->
<code src="./demo/link.tsx" title="Action.Link"></code>

<code src="./demo/button.tsx" title="Action.Button"></code>

<code src="./demo/loading.tsx" title="loading 状态"></code>

<code src="./demo/with-tooltip-popconfirm.tsx" title="带 Tooltip 和 Popconfirm"></code>
<code src="./demo/fixed.tsx" title="固定展示、不被折叠的 Action"></code>

<code src="./demo/groupControl.tsx" title="整体控制状态"></code>

## API
Expand Down
Loading