From 481402e09fe760634b826b09e302e2e1bfec88b1 Mon Sep 17 00:00:00 2001 From: shu Date: Mon, 7 Sep 2026 15:48:36 +0800 Subject: feat: initialize React Spectrum template with layouts and showcases --- src/components/ui-kit/actions-feedback.tsx | 101 +++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 src/components/ui-kit/actions-feedback.tsx (limited to 'src/components/ui-kit/actions-feedback.tsx') diff --git a/src/components/ui-kit/actions-feedback.tsx b/src/components/ui-kit/actions-feedback.tsx new file mode 100644 index 0000000..ade8d48 --- /dev/null +++ b/src/components/ui-kit/actions-feedback.tsx @@ -0,0 +1,101 @@ +import { useEffect, useRef, useState } from 'react' +import { Button, Text } from '@react-spectrum/s2/Button' +import { ActionButton } from '@react-spectrum/s2/ActionButton' +import { ToggleButton } from '@react-spectrum/s2/ToggleButton' +import { ActionMenu, MenuItem } from '@react-spectrum/s2/ActionMenu' +import { Badge } from '@react-spectrum/s2/Badge' +import { StatusLight } from '@react-spectrum/s2/StatusLight' +import { ProgressBar } from '@react-spectrum/s2/ProgressBar' +import { ProgressCircle } from '@react-spectrum/s2/ProgressCircle' +import { Meter } from '@react-spectrum/s2/Meter' +import { InlineAlert, Heading, Content } from '@react-spectrum/s2/InlineAlert' +import { DialogTrigger, Dialog, ButtonGroup } from '@react-spectrum/s2/Dialog' +import { Popover } from '@react-spectrum/s2/Popover' +import { Tooltip, TooltipTrigger } from '@react-spectrum/s2/Tooltip' +import { ToastContainer, ToastQueue } from '@react-spectrum/s2/Toast' +import AddIcon from '@react-spectrum/s2/icons/Add' +import EditIcon from '@react-spectrum/s2/icons/Edit' +import InfoIcon from '@react-spectrum/s2/icons/InfoCircle' +import styles from './ui-kit.module.css' + +export default function ActionsFeedback() { + const [message, setMessage] = useState('点击按钮体验交互。') + const [selected, setSelected] = useState(false) + const [progress, setProgress] = useState(40) + const toastClosers = useRef void>>([]) + useEffect(() => () => { toastClosers.current.forEach((close) => close()) }, []) + + return ( + <> +
+

按钮与操作

+
+ + + + + +
+
+ {(['S', 'M', 'L', 'XL'] as const).map((size) => )} + setMessage('已点击图标按钮。')}>编辑示例 + {selected ? '已收藏' : '收藏'} + setMessage(key === 'copy' ? '已选择复制示例。' : '已选择重命名示例。')}> + 复制重命名 + +
+

{message}

+
+ +
+

徽标与状态

+
+ 默认信息成功提醒错误强调 +
+
+ 已完成待处理失败草稿 +
+
+ 信息提示用于展示与当前操作相关的说明。 + 成功提示这是一条成功状态示例。 + 注意事项操作前需要留意的提示信息。 + 错误提示展示问题原因及后续处理方式。 +
+
+ +
+

进度与容量

+
+ + + +
加载中
+
+
+ + +
+
+ +
+

弹层与通知

+
+ + + + {({ close }) => <>对话框示例对话框用于需要用户确认的操作。} + + + + +

Popover 用于在操作附近展示补充内容,点击外部或按 Esc 关闭。

+
+ 这是一条 Tooltip 提示。 + + +
+
+ + + ) +} -- cgit v1.2.3