@dsh-plugin/dsh-ui-components 0.0.1 → 0.1.0-dev.43613492370

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +21 -21
  2. package/NOTICE +21 -21
  3. package/README.md +136 -136
  4. package/README.zh_CN.md +136 -136
  5. package/docs/tokens.md +67 -67
  6. package/lib/basic/form.js +49 -49
  7. package/lib/basic/styles.js +391 -391
  8. package/lib/composites/styles.js +427 -427
  9. package/lib/data/styles.js +257 -257
  10. package/lib/display/styles.js +310 -310
  11. package/lib/feedback/styles.js +228 -228
  12. package/lib/foundation/bridge.js +203 -203
  13. package/lib/navigation/styles.js +417 -417
  14. package/package.json +104 -104
  15. package/scripts/check-size.mjs +69 -69
  16. package/scripts/dump-npm-latest.mjs +59 -59
  17. package/scripts/gen-host-tokens.mjs +61 -61
  18. package/scripts/gen-icons.mjs +188 -178
  19. package/scripts/verify-no-literal-colors.mjs +63 -63
  20. package/scripts/verify-tokens.mjs +135 -135
  21. package/src/basic/button.tsx +76 -76
  22. package/src/basic/form.tsx +187 -187
  23. package/src/basic/icon-button.tsx +66 -66
  24. package/src/basic/index.ts +38 -38
  25. package/src/basic/input.tsx +140 -140
  26. package/src/basic/select.tsx +120 -120
  27. package/src/basic/styles.ts +412 -412
  28. package/src/basic/toggle.tsx +116 -116
  29. package/src/composites/data-view.tsx +189 -189
  30. package/src/composites/index.ts +11 -11
  31. package/src/composites/indicator.tsx +90 -90
  32. package/src/composites/menu-select.tsx +230 -230
  33. package/src/composites/panel.tsx +72 -72
  34. package/src/composites/settings.tsx +80 -80
  35. package/src/composites/styles.ts +450 -450
  36. package/src/data/collection.tsx +71 -71
  37. package/src/data/index.ts +39 -39
  38. package/src/data/info.tsx +89 -89
  39. package/src/data/picker.tsx +113 -113
  40. package/src/data/styles.ts +278 -278
  41. package/src/display/container.tsx +67 -67
  42. package/src/display/feedback.tsx +92 -92
  43. package/src/display/index.ts +44 -44
  44. package/src/display/label.tsx +165 -165
  45. package/src/display/overlay.tsx +103 -103
  46. package/src/display/styles.ts +332 -332
  47. package/src/feedback/global.tsx +110 -110
  48. package/src/feedback/index.ts +19 -19
  49. package/src/feedback/inline.tsx +50 -50
  50. package/src/feedback/panel.tsx +93 -93
  51. package/src/feedback/styles.ts +250 -250
  52. package/src/foundation/bridge.ts +318 -318
  53. package/src/foundation/icons.tsx +315 -315
  54. package/src/foundation/index.ts +33 -33
  55. package/src/foundation/palette.ts +153 -153
  56. package/src/foundation/provider.tsx +62 -62
  57. package/src/foundation/style.ts +63 -63
  58. package/src/foundation/tokens.ts +62 -62
  59. package/src/index.ts +18 -18
  60. package/src/navigation/hierarchy.tsx +82 -82
  61. package/src/navigation/index.ts +21 -21
  62. package/src/navigation/indicator.tsx +125 -125
  63. package/src/navigation/menu.tsx +94 -94
  64. package/src/navigation/segmented.tsx +136 -136
  65. package/src/navigation/styles.ts +438 -438
@@ -1,165 +1,165 @@
1
- /**
2
- * 徽标类小组件:标签、可选中胶囊、头像、徽标数。
3
- *
4
- * `Tag` 与 `Pill` 的区别与宿主一致:`Tag` 是只读徽章(固定 11px 胶囊),
5
- * `Pill` 是可选中胶囊(24px 高、带激活态),用于视图切换与筛选。
6
- *
7
- * @module @dsh-plugin/dsh-ui-components/display/label
8
- */
9
- import * as React from 'react'
10
- import { Arco } from '@dsh-plugin/dsh-loader/client'
11
- import { cx } from '../foundation/style.js'
12
- import { injectDisplayStyles } from './styles.js'
13
-
14
- /** 标签的色调。 */
15
- export type TagTone =
16
- | 'neutral'
17
- | 'outline'
18
- | 'solid'
19
- | 'quiet'
20
- | 'success'
21
- | 'info'
22
- | 'warning'
23
- | 'danger'
24
-
25
- /** {@link Tag} 的 props。 */
26
- export interface TagProps {
27
- /** 语义色调,默认 `neutral`。 */
28
- tone?: TagTone
29
- /** 尺寸,默认 `md`。 */
30
- size?: 'sm' | 'md' | 'lg'
31
- /** 可关闭时显示关闭按钮。 */
32
- closable?: boolean
33
- /** 关闭时回调。 */
34
- onClose?: () => void
35
- /** 追加类名。 */
36
- className?: string
37
- /** 内联样式。 */
38
- style?: React.CSSProperties
39
- /** 内容。 */
40
- children?: React.ReactNode
41
- }
42
-
43
- /** DSH 色调到内联样式:状态色调自带填充与文字色,其余交给 Arco 变量。 */
44
- const TONE_STYLE: Record<TagTone, React.CSSProperties | undefined> = {
45
- neutral: undefined,
46
- outline: {
47
- border: '0.5px solid var(--dsw-alias-border-l4)',
48
- backgroundColor: 'transparent',
49
- color: 'var(--dsw-alias-label-tertiary)',
50
- },
51
- solid: {
52
- backgroundColor: 'var(--dsw-alias-label-primary)',
53
- color: 'var(--dsw-alias-bg-layer-3)',
54
- },
55
- quiet: {
56
- backgroundColor: 'transparent',
57
- color: 'var(--dsw-alias-label-tertiary)',
58
- },
59
- success: {
60
- backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent)',
61
- color: 'var(--dsw-alias-state-success-primary)',
62
- },
63
- info: {
64
- backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent)',
65
- color: 'var(--dsw-alias-state-business-primary)',
66
- },
67
- warning: {
68
- backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent)',
69
- color: 'var(--dsw-alias-state-warn-primary)',
70
- },
71
- danger: {
72
- backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent)',
73
- color: 'var(--dsw-alias-state-error-primary)',
74
- },
75
- }
76
-
77
- /** DSH 尺寸到 Arco 尺寸的映射。 */
78
- const ARCO_SIZE: Record<'sm' | 'md' | 'lg', 'small' | 'default' | 'large'> = {
79
- sm: 'small',
80
- md: 'default',
81
- lg: 'large',
82
- }
83
-
84
- /**
85
- * 只读标签。
86
- *
87
- * @param props - 见 {@link TagProps}。
88
- * @returns 标签元素。
89
- */
90
- export function Tag({ tone = 'neutral', size = 'md', closable, onClose, className, style, children }: TagProps): React.ReactElement {
91
- injectDisplayStyles()
92
- return (
93
- <Arco.Tag
94
- size={ARCO_SIZE[size]}
95
- closable={closable}
96
- onClose={onClose}
97
- className={className}
98
- style={{ ...TONE_STYLE[tone], ...style }}
99
- >
100
- {children}
101
- </Arco.Tag>
102
- )
103
- }
104
-
105
- /** {@link Pill} 的 props。 */
106
- export interface PillProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
107
- /** 选中态。 */
108
- active?: boolean
109
- /** 带前置图标。 */
110
- icon?: React.ReactNode
111
- }
112
-
113
- /**
114
- * 可选中胶囊,用于视图切换与筛选。
115
- *
116
- * @param props - 见 {@link PillProps}。
117
- * @param ref - 指向原生 `button` 元素。
118
- * @returns 胶囊按钮元素。
119
- */
120
- export const Pill = React.forwardRef<HTMLButtonElement, PillProps>(function Pill(
121
- { active, icon, className, children, type, ...rest },
122
- ref,
123
- ) {
124
- injectDisplayStyles()
125
- return (
126
- <button
127
- {...rest}
128
- ref={ref}
129
- type={type ?? 'button'}
130
- aria-pressed={active === true}
131
- className={cx('dsh-pill', 'dsh-pill--interactive', active === true && 'dsh-pill--active', className)}
132
- >
133
- {icon}
134
- {children}
135
- </button>
136
- )
137
- })
138
-
139
- /** {@link Avatar} 的 props。 */
140
- export type AvatarProps = React.ComponentPropsWithoutRef<typeof Arco.Avatar>
141
-
142
- /**
143
- * 头像。
144
- *
145
- * @param props - 见 {@link AvatarProps}。
146
- * @returns 头像元素。
147
- */
148
- export function Avatar(props: AvatarProps): React.ReactElement {
149
- injectDisplayStyles()
150
- return <Arco.Avatar {...props} />
151
- }
152
-
153
- /** {@link Badge} 的 props。 */
154
- export type BadgeProps = React.ComponentPropsWithoutRef<typeof Arco.Badge>
155
-
156
- /**
157
- * 徽标数或小红点。
158
- *
159
- * @param props - 见 {@link BadgeProps}。
160
- * @returns 徽标元素。
161
- */
162
- export function Badge(props: BadgeProps): React.ReactElement {
163
- injectDisplayStyles()
164
- return <Arco.Badge {...props} />
165
- }
1
+ /**
2
+ * 徽标类小组件:标签、可选中胶囊、头像、徽标数。
3
+ *
4
+ * `Tag` 与 `Pill` 的区别与宿主一致:`Tag` 是只读徽章(固定 11px 胶囊),
5
+ * `Pill` 是可选中胶囊(24px 高、带激活态),用于视图切换与筛选。
6
+ *
7
+ * @module @dsh-plugin/dsh-ui-components/display/label
8
+ */
9
+ import * as React from 'react'
10
+ import { Arco } from '@dsh-plugin/dsh-loader/client'
11
+ import { cx } from '../foundation/style.js'
12
+ import { injectDisplayStyles } from './styles.js'
13
+
14
+ /** 标签的色调。 */
15
+ export type TagTone =
16
+ | 'neutral'
17
+ | 'outline'
18
+ | 'solid'
19
+ | 'quiet'
20
+ | 'success'
21
+ | 'info'
22
+ | 'warning'
23
+ | 'danger'
24
+
25
+ /** {@link Tag} 的 props。 */
26
+ export interface TagProps {
27
+ /** 语义色调,默认 `neutral`。 */
28
+ tone?: TagTone
29
+ /** 尺寸,默认 `md`。 */
30
+ size?: 'sm' | 'md' | 'lg'
31
+ /** 可关闭时显示关闭按钮。 */
32
+ closable?: boolean
33
+ /** 关闭时回调。 */
34
+ onClose?: () => void
35
+ /** 追加类名。 */
36
+ className?: string
37
+ /** 内联样式。 */
38
+ style?: React.CSSProperties
39
+ /** 内容。 */
40
+ children?: React.ReactNode
41
+ }
42
+
43
+ /** DSH 色调到内联样式:状态色调自带填充与文字色,其余交给 Arco 变量。 */
44
+ const TONE_STYLE: Record<TagTone, React.CSSProperties | undefined> = {
45
+ neutral: undefined,
46
+ outline: {
47
+ border: '0.5px solid var(--dsw-alias-border-l4)',
48
+ backgroundColor: 'transparent',
49
+ color: 'var(--dsw-alias-label-tertiary)',
50
+ },
51
+ solid: {
52
+ backgroundColor: 'var(--dsw-alias-label-primary)',
53
+ color: 'var(--dsw-alias-bg-layer-3)',
54
+ },
55
+ quiet: {
56
+ backgroundColor: 'transparent',
57
+ color: 'var(--dsw-alias-label-tertiary)',
58
+ },
59
+ success: {
60
+ backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent)',
61
+ color: 'var(--dsw-alias-state-success-primary)',
62
+ },
63
+ info: {
64
+ backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent)',
65
+ color: 'var(--dsw-alias-state-business-primary)',
66
+ },
67
+ warning: {
68
+ backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent)',
69
+ color: 'var(--dsw-alias-state-warn-primary)',
70
+ },
71
+ danger: {
72
+ backgroundColor: 'color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent)',
73
+ color: 'var(--dsw-alias-state-error-primary)',
74
+ },
75
+ }
76
+
77
+ /** DSH 尺寸到 Arco 尺寸的映射。 */
78
+ const ARCO_SIZE: Record<'sm' | 'md' | 'lg', 'small' | 'default' | 'large'> = {
79
+ sm: 'small',
80
+ md: 'default',
81
+ lg: 'large',
82
+ }
83
+
84
+ /**
85
+ * 只读标签。
86
+ *
87
+ * @param props - 见 {@link TagProps}。
88
+ * @returns 标签元素。
89
+ */
90
+ export function Tag({ tone = 'neutral', size = 'md', closable, onClose, className, style, children }: TagProps): React.ReactElement {
91
+ injectDisplayStyles()
92
+ return (
93
+ <Arco.Tag
94
+ size={ARCO_SIZE[size]}
95
+ closable={closable}
96
+ onClose={onClose}
97
+ className={className}
98
+ style={{ ...TONE_STYLE[tone], ...style }}
99
+ >
100
+ {children}
101
+ </Arco.Tag>
102
+ )
103
+ }
104
+
105
+ /** {@link Pill} 的 props。 */
106
+ export interface PillProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
107
+ /** 选中态。 */
108
+ active?: boolean
109
+ /** 带前置图标。 */
110
+ icon?: React.ReactNode
111
+ }
112
+
113
+ /**
114
+ * 可选中胶囊,用于视图切换与筛选。
115
+ *
116
+ * @param props - 见 {@link PillProps}。
117
+ * @param ref - 指向原生 `button` 元素。
118
+ * @returns 胶囊按钮元素。
119
+ */
120
+ export const Pill = React.forwardRef<HTMLButtonElement, PillProps>(function Pill(
121
+ { active, icon, className, children, type, ...rest },
122
+ ref,
123
+ ) {
124
+ injectDisplayStyles()
125
+ return (
126
+ <button
127
+ {...rest}
128
+ ref={ref}
129
+ type={type ?? 'button'}
130
+ aria-pressed={active === true}
131
+ className={cx('dsh-pill', 'dsh-pill--interactive', active === true && 'dsh-pill--active', className)}
132
+ >
133
+ {icon}
134
+ {children}
135
+ </button>
136
+ )
137
+ })
138
+
139
+ /** {@link Avatar} 的 props。 */
140
+ export type AvatarProps = React.ComponentPropsWithoutRef<typeof Arco.Avatar>
141
+
142
+ /**
143
+ * 头像。
144
+ *
145
+ * @param props - 见 {@link AvatarProps}。
146
+ * @returns 头像元素。
147
+ */
148
+ export function Avatar(props: AvatarProps): React.ReactElement {
149
+ injectDisplayStyles()
150
+ return <Arco.Avatar {...props} />
151
+ }
152
+
153
+ /** {@link Badge} 的 props。 */
154
+ export type BadgeProps = React.ComponentPropsWithoutRef<typeof Arco.Badge>
155
+
156
+ /**
157
+ * 徽标数或小红点。
158
+ *
159
+ * @param props - 见 {@link BadgeProps}。
160
+ * @returns 徽标元素。
161
+ */
162
+ export function Badge(props: BadgeProps): React.ReactElement {
163
+ injectDisplayStyles()
164
+ return <Arco.Badge {...props} />
165
+ }
@@ -1,103 +1,103 @@
1
- /**
2
- * 浮层类展示组件:提示、气泡与折叠面板。
3
- *
4
- * 浮层通过 `DshProvider` 的 `getPopupContainer` 进入带皮肤变量的容器,因此
5
- * 即使在 `body` 层也能拿到同一套令牌。未挂 provider 时会退回 `body`,样式
6
- * 仍可用,只是拿不到 `.dsh-ui` 上的变量覆盖。
7
- *
8
- * @module @dsh-plugin/dsh-ui-components/display/overlay
9
- */
10
- import * as React from 'react'
11
- import { Arco } from '@dsh-plugin/dsh-loader/client'
12
- import { injectDisplayStyles } from './styles.js'
13
-
14
- /** {@link Tooltip} 的 props。 */
15
- export type TooltipProps = Omit<React.ComponentPropsWithoutRef<typeof Arco.Tooltip>, 'position'> & {
16
- /** 相对锚点的方位,默认 `bottom`。 */
17
- position?: React.ComponentPropsWithoutRef<typeof Arco.Tooltip>['position']
18
- }
19
-
20
- /**
21
- * 悬停或聚焦时显示的短提示,内容应只有一行文字。
22
- *
23
- * 宿主的气泡贴着锚点、没有箭头,默认出现在下方;Arco 的默认值是上方,且四向
24
- * 各留 12px 并预留箭头空间,间距因此明显偏大。箭头与间距都在样式表里收掉。
25
- *
26
- * @param props - 见 {@link TooltipProps}。
27
- * @returns 提示元素。
28
- */
29
- export function Tooltip({ position = 'bottom', ...rest }: TooltipProps): React.ReactElement {
30
- injectDisplayStyles()
31
- return <Arco.Tooltip {...rest} position={position} />
32
- }
33
-
34
- /** {@link Popover} 的 props。 */
35
- export type PopoverProps = React.ComponentPropsWithoutRef<typeof Arco.Popover>
36
-
37
- /**
38
- * 可承载富内容的气泡卡片。
39
- *
40
- * @param props - 见 {@link PopoverProps}。
41
- * @returns 气泡元素。
42
- */
43
- export function Popover(props: PopoverProps): React.ReactElement {
44
- injectDisplayStyles()
45
- return <Arco.Popover {...props} />
46
- }
47
-
48
- /** {@link HoverCard} 的 props。 */
49
- export type HoverCardProps = Omit<React.ComponentPropsWithoutRef<typeof Arco.Popover>, 'trigger'> & {
50
- /**
51
- * 悬停多久后显示,单位毫秒,默认 120。触屏设备上悬停不可用,因此调用方应
52
- * 保证同样的信息也能通过点击路径获得。
53
- */
54
- delayMs?: number
55
- }
56
-
57
- /**
58
- * 悬停预览卡片,用于在列表里展开一段只读详情。
59
- *
60
- * 与 `Popover` 的差别只在触发方式:这里固定为悬停加键盘聚焦,并且带一个很短
61
- * 的延迟,避免指针划过整列时连续弹层。
62
- *
63
- * @param props - 见 {@link HoverCardProps}。
64
- * @returns 悬停卡片元素。
65
- */
66
- export function HoverCard({ delayMs = 120, triggerProps, ...rest }: HoverCardProps): React.ReactElement {
67
- injectDisplayStyles()
68
- return (
69
- <Arco.Popover
70
- {...rest}
71
- trigger="hover"
72
- triggerProps={{ ...triggerProps, mouseEnterDelay: delayMs, mouseLeaveDelay: 80 }}
73
- />
74
- )
75
- }
76
-
77
- /** {@link Collapse} 的 props。 */
78
- export type CollapseProps = React.ComponentPropsWithoutRef<typeof Arco.Collapse>
79
-
80
- /**
81
- * 折叠面板组。
82
- *
83
- * @param props - 见 {@link CollapseProps}。
84
- * @returns 折叠面板组元素。
85
- */
86
- export function Collapse(props: CollapseProps): React.ReactElement {
87
- injectDisplayStyles()
88
- return <Arco.Collapse {...props} />
89
- }
90
-
91
- /** {@link CollapseItem} 的 props。 */
92
- export type CollapseItemProps = React.ComponentPropsWithoutRef<typeof Arco.Collapse.Item>
93
-
94
- /**
95
- * 折叠面板中的一项。
96
- *
97
- * @param props - 见 {@link CollapseItemProps}。
98
- * @returns 折叠面板项元素。
99
- */
100
- export function CollapseItem(props: CollapseItemProps): React.ReactElement {
101
- injectDisplayStyles()
102
- return <Arco.Collapse.Item {...props} />
103
- }
1
+ /**
2
+ * 浮层类展示组件:提示、气泡与折叠面板。
3
+ *
4
+ * 浮层通过 `DshProvider` 的 `getPopupContainer` 进入带皮肤变量的容器,因此
5
+ * 即使在 `body` 层也能拿到同一套令牌。未挂 provider 时会退回 `body`,样式
6
+ * 仍可用,只是拿不到 `.dsh-ui` 上的变量覆盖。
7
+ *
8
+ * @module @dsh-plugin/dsh-ui-components/display/overlay
9
+ */
10
+ import * as React from 'react'
11
+ import { Arco } from '@dsh-plugin/dsh-loader/client'
12
+ import { injectDisplayStyles } from './styles.js'
13
+
14
+ /** {@link Tooltip} 的 props。 */
15
+ export type TooltipProps = Omit<React.ComponentPropsWithoutRef<typeof Arco.Tooltip>, 'position'> & {
16
+ /** 相对锚点的方位,默认 `bottom`。 */
17
+ position?: React.ComponentPropsWithoutRef<typeof Arco.Tooltip>['position']
18
+ }
19
+
20
+ /**
21
+ * 悬停或聚焦时显示的短提示,内容应只有一行文字。
22
+ *
23
+ * 宿主的气泡贴着锚点、没有箭头,默认出现在下方;Arco 的默认值是上方,且四向
24
+ * 各留 12px 并预留箭头空间,间距因此明显偏大。箭头与间距都在样式表里收掉。
25
+ *
26
+ * @param props - 见 {@link TooltipProps}。
27
+ * @returns 提示元素。
28
+ */
29
+ export function Tooltip({ position = 'bottom', ...rest }: TooltipProps): React.ReactElement {
30
+ injectDisplayStyles()
31
+ return <Arco.Tooltip {...rest} position={position} />
32
+ }
33
+
34
+ /** {@link Popover} 的 props。 */
35
+ export type PopoverProps = React.ComponentPropsWithoutRef<typeof Arco.Popover>
36
+
37
+ /**
38
+ * 可承载富内容的气泡卡片。
39
+ *
40
+ * @param props - 见 {@link PopoverProps}。
41
+ * @returns 气泡元素。
42
+ */
43
+ export function Popover(props: PopoverProps): React.ReactElement {
44
+ injectDisplayStyles()
45
+ return <Arco.Popover {...props} />
46
+ }
47
+
48
+ /** {@link HoverCard} 的 props。 */
49
+ export type HoverCardProps = Omit<React.ComponentPropsWithoutRef<typeof Arco.Popover>, 'trigger'> & {
50
+ /**
51
+ * 悬停多久后显示,单位毫秒,默认 120。触屏设备上悬停不可用,因此调用方应
52
+ * 保证同样的信息也能通过点击路径获得。
53
+ */
54
+ delayMs?: number
55
+ }
56
+
57
+ /**
58
+ * 悬停预览卡片,用于在列表里展开一段只读详情。
59
+ *
60
+ * 与 `Popover` 的差别只在触发方式:这里固定为悬停加键盘聚焦,并且带一个很短
61
+ * 的延迟,避免指针划过整列时连续弹层。
62
+ *
63
+ * @param props - 见 {@link HoverCardProps}。
64
+ * @returns 悬停卡片元素。
65
+ */
66
+ export function HoverCard({ delayMs = 120, triggerProps, ...rest }: HoverCardProps): React.ReactElement {
67
+ injectDisplayStyles()
68
+ return (
69
+ <Arco.Popover
70
+ {...rest}
71
+ trigger="hover"
72
+ triggerProps={{ ...triggerProps, mouseEnterDelay: delayMs, mouseLeaveDelay: 80 }}
73
+ />
74
+ )
75
+ }
76
+
77
+ /** {@link Collapse} 的 props。 */
78
+ export type CollapseProps = React.ComponentPropsWithoutRef<typeof Arco.Collapse>
79
+
80
+ /**
81
+ * 折叠面板组。
82
+ *
83
+ * @param props - 见 {@link CollapseProps}。
84
+ * @returns 折叠面板组元素。
85
+ */
86
+ export function Collapse(props: CollapseProps): React.ReactElement {
87
+ injectDisplayStyles()
88
+ return <Arco.Collapse {...props} />
89
+ }
90
+
91
+ /** {@link CollapseItem} 的 props。 */
92
+ export type CollapseItemProps = React.ComponentPropsWithoutRef<typeof Arco.Collapse.Item>
93
+
94
+ /**
95
+ * 折叠面板中的一项。
96
+ *
97
+ * @param props - 见 {@link CollapseItemProps}。
98
+ * @returns 折叠面板项元素。
99
+ */
100
+ export function CollapseItem(props: CollapseItemProps): React.ReactElement {
101
+ injectDisplayStyles()
102
+ return <Arco.Collapse.Item {...props} />
103
+ }