From edc729044d261630303fc914d8d387535f5867ed Mon Sep 17 00:00:00 2001 From: dengfuping Date: Fri, 26 Jul 2024 12:09:36 +0800 Subject: [PATCH] chore(design): Add icon and dropdown button demo --- packages/design/src/button/demo/dropdown.tsx | 46 ++++++++++++++++++++ packages/design/src/button/demo/icon.tsx | 35 +++++++++++++++ packages/design/src/button/index.md | 12 ++--- 3 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 packages/design/src/button/demo/dropdown.tsx create mode 100644 packages/design/src/button/demo/icon.tsx diff --git a/packages/design/src/button/demo/dropdown.tsx b/packages/design/src/button/demo/dropdown.tsx new file mode 100644 index 000000000..81542bc5a --- /dev/null +++ b/packages/design/src/button/demo/dropdown.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { Dropdown, Space } from '@oceanbase/design'; +import { DownOutlined } from '@oceanbase/icons'; + +const items = [ + { + key: '1', + label: '1st item', + }, + { + key: '2', + label: '2nd item', + }, + { + key: '3', + label: '3rd item', + }, +]; + +const App: React.FC = () => ( + + { + console.log('click', e); + }, + }} + > + Dropdown + + { + console.log('click', e); + }, + }} + icon={} + > + Dropdown + + +); + +export default App; diff --git a/packages/design/src/button/demo/icon.tsx b/packages/design/src/button/demo/icon.tsx new file mode 100644 index 000000000..9a3a0de4b --- /dev/null +++ b/packages/design/src/button/demo/icon.tsx @@ -0,0 +1,35 @@ +import React, { useState } from 'react'; +import { PlusOutlined } from '@oceanbase/icons'; +import { Button, Divider, Radio, Space } from '@oceanbase/design'; + +const App: React.FC = () => { + const [position, setPosition] = useState<'start' | 'end'>('end'); + + return ( + <> + + setPosition(e.target.value)}> + start + end + + + + Preview + + + + + +