@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,67 +1,67 @@
1
- /**
2
- * 容器与表面类展示组件。
3
- *
4
- * @module @dsh-plugin/dsh-ui-components/display/container
5
- */
6
- import * as React from 'react'
7
- import { Arco } from '@dsh-plugin/dsh-loader/client'
8
- import { cx } from '../foundation/style.js'
9
- import { injectDisplayStyles } from './styles.js'
10
-
11
- /** {@link Card} 的 props。 */
12
- export type CardProps = Omit<React.ComponentPropsWithoutRef<typeof Arco.Card>, 'title'> & {
13
- /** 卡片标题,渲染在带分隔线的头部。 */
14
- title?: React.ReactNode
15
- /** 头部右侧的操作区。 */
16
- extra?: React.ReactNode
17
- /** 视觉形态。`elevated` 用描边阴影,`flat` 用极细实线边框。 */
18
- variant?: 'elevated' | 'flat'
19
- /** 收紧内边距,用于密集列表。 */
20
- tight?: boolean
21
- }
22
-
23
- /**
24
- * 一张卡片。
25
- *
26
- * @param props - 见 {@link CardProps}。
27
- * @returns 卡片元素。
28
- */
29
- export function Card({ title, extra, variant = 'elevated', tight, className, ...rest }: CardProps): React.ReactElement {
30
- injectDisplayStyles()
31
- return (
32
- <Arco.Card
33
- {...rest}
34
- title={title}
35
- extra={extra}
36
- className={cx(variant === 'flat' && 'dsh-card--flat', tight === true && 'dsh-card--tight', Array.isArray(className) ? className.join(' ') : className)}
37
- />
38
- )
39
- }
40
-
41
- /** {@link Divider} 的 props。 */
42
- export type DividerProps = React.ComponentPropsWithoutRef<typeof Arco.Divider>
43
-
44
- /**
45
- * 一条分隔线。
46
- *
47
- * @param props - 见 {@link DividerProps}。
48
- * @returns 分隔线元素。
49
- */
50
- export function Divider(props: DividerProps): React.ReactElement {
51
- injectDisplayStyles()
52
- return <Arco.Divider {...props} />
53
- }
54
-
55
- /** {@link Descriptions} 的 props。 */
56
- export type DescriptionsProps = React.ComponentPropsWithoutRef<typeof Arco.Descriptions>
57
-
58
- /**
59
- * 键值对描述列表。条目通过 `data` 数组提供,不单独导出子组件。
60
- *
61
- * @param props - 见 {@link DescriptionsProps}。
62
- * @returns 描述列表元素。
63
- */
64
- export function Descriptions(props: DescriptionsProps): React.ReactElement {
65
- injectDisplayStyles()
66
- return <Arco.Descriptions {...props} />
67
- }
1
+ /**
2
+ * 容器与表面类展示组件。
3
+ *
4
+ * @module @dsh-plugin/dsh-ui-components/display/container
5
+ */
6
+ import * as React from 'react'
7
+ import { Arco } from '@dsh-plugin/dsh-loader/client'
8
+ import { cx } from '../foundation/style.js'
9
+ import { injectDisplayStyles } from './styles.js'
10
+
11
+ /** {@link Card} 的 props。 */
12
+ export type CardProps = Omit<React.ComponentPropsWithoutRef<typeof Arco.Card>, 'title'> & {
13
+ /** 卡片标题,渲染在带分隔线的头部。 */
14
+ title?: React.ReactNode
15
+ /** 头部右侧的操作区。 */
16
+ extra?: React.ReactNode
17
+ /** 视觉形态。`elevated` 用描边阴影,`flat` 用极细实线边框。 */
18
+ variant?: 'elevated' | 'flat'
19
+ /** 收紧内边距,用于密集列表。 */
20
+ tight?: boolean
21
+ }
22
+
23
+ /**
24
+ * 一张卡片。
25
+ *
26
+ * @param props - 见 {@link CardProps}。
27
+ * @returns 卡片元素。
28
+ */
29
+ export function Card({ title, extra, variant = 'elevated', tight, className, ...rest }: CardProps): React.ReactElement {
30
+ injectDisplayStyles()
31
+ return (
32
+ <Arco.Card
33
+ {...rest}
34
+ title={title}
35
+ extra={extra}
36
+ className={cx(variant === 'flat' && 'dsh-card--flat', tight === true && 'dsh-card--tight', Array.isArray(className) ? className.join(' ') : className)}
37
+ />
38
+ )
39
+ }
40
+
41
+ /** {@link Divider} 的 props。 */
42
+ export type DividerProps = React.ComponentPropsWithoutRef<typeof Arco.Divider>
43
+
44
+ /**
45
+ * 一条分隔线。
46
+ *
47
+ * @param props - 见 {@link DividerProps}。
48
+ * @returns 分隔线元素。
49
+ */
50
+ export function Divider(props: DividerProps): React.ReactElement {
51
+ injectDisplayStyles()
52
+ return <Arco.Divider {...props} />
53
+ }
54
+
55
+ /** {@link Descriptions} 的 props。 */
56
+ export type DescriptionsProps = React.ComponentPropsWithoutRef<typeof Arco.Descriptions>
57
+
58
+ /**
59
+ * 键值对描述列表。条目通过 `data` 数组提供,不单独导出子组件。
60
+ *
61
+ * @param props - 见 {@link DescriptionsProps}。
62
+ * @returns 描述列表元素。
63
+ */
64
+ export function Descriptions(props: DescriptionsProps): React.ReactElement {
65
+ injectDisplayStyles()
66
+ return <Arco.Descriptions {...props} />
67
+ }
@@ -1,92 +1,92 @@
1
- /**
2
- * 排版、空状态与加载占位。
3
- *
4
- * @module @dsh-plugin/dsh-ui-components/display/feedback
5
- */
6
- import * as React from 'react'
7
- import { Arco } from '@dsh-plugin/dsh-loader/client'
8
- import { injectDisplayStyles } from './styles.js'
9
-
10
- /** {@link Typography} 的 props。 */
11
- export type TypographyProps = React.ComponentPropsWithoutRef<typeof Arco.Typography>
12
-
13
- /**
14
- * 富文本排版容器,提供标题、段落、代码与引用样式。
15
- *
16
- * @param props - 见 {@link TypographyProps}。
17
- * @returns 排版元素。
18
- */
19
- export function Typography(props: TypographyProps): React.ReactElement {
20
- injectDisplayStyles()
21
- return <Arco.Typography {...props} />
22
- }
23
-
24
- /** {@link Text} 的 props。 */
25
- export type TextProps = React.ComponentPropsWithoutRef<typeof Arco.Typography.Text>
26
-
27
- /**
28
- * 行内文本,可标记为次要、成功、警告或危险。
29
- *
30
- * @param props - 见 {@link TextProps}。
31
- * @returns 文本元素。
32
- */
33
- export function Text(props: TextProps): React.ReactElement {
34
- injectDisplayStyles()
35
- return <Arco.Typography.Text {...props} />
36
- }
37
-
38
- /** {@link Paragraph} 的 props。 */
39
- export type ParagraphProps = React.ComponentPropsWithoutRef<typeof Arco.Typography.Paragraph>
40
-
41
- /**
42
- * 段落。
43
- *
44
- * @param props - 见 {@link ParagraphProps}。
45
- * @returns 段落元素。
46
- */
47
- export function Paragraph(props: ParagraphProps): React.ReactElement {
48
- injectDisplayStyles()
49
- return <Arco.Typography.Paragraph {...props} />
50
- }
51
-
52
- /** {@link Empty} 的 props。 */
53
- export type EmptyProps = React.ComponentPropsWithoutRef<typeof Arco.Empty>
54
-
55
- /**
56
- * 空状态占位。
57
- *
58
- * @param props - 见 {@link EmptyProps}。
59
- * @returns 空状态元素。
60
- */
61
- export function Empty(props: EmptyProps): React.ReactElement {
62
- injectDisplayStyles()
63
- return <Arco.Empty {...props} />
64
- }
65
-
66
- /** {@link Skeleton} 的 props。 */
67
- export type SkeletonProps = React.ComponentPropsWithoutRef<typeof Arco.Skeleton>
68
-
69
- /**
70
- * 骨架屏占位。
71
- *
72
- * @param props - 见 {@link SkeletonProps}。
73
- * @returns 骨架元素。
74
- */
75
- export function Skeleton(props: SkeletonProps): React.ReactElement {
76
- injectDisplayStyles()
77
- return <Arco.Skeleton {...props} />
78
- }
79
-
80
- /** {@link Spin} 的 props。 */
81
- export type SpinProps = React.ComponentPropsWithoutRef<typeof Arco.Spin>
82
-
83
- /**
84
- * 加载指示器。
85
- *
86
- * @param props - 见 {@link SpinProps}。
87
- * @returns 加载元素。
88
- */
89
- export function Spin(props: SpinProps): React.ReactElement {
90
- injectDisplayStyles()
91
- return <Arco.Spin {...props} />
92
- }
1
+ /**
2
+ * 排版、空状态与加载占位。
3
+ *
4
+ * @module @dsh-plugin/dsh-ui-components/display/feedback
5
+ */
6
+ import * as React from 'react'
7
+ import { Arco } from '@dsh-plugin/dsh-loader/client'
8
+ import { injectDisplayStyles } from './styles.js'
9
+
10
+ /** {@link Typography} 的 props。 */
11
+ export type TypographyProps = React.ComponentPropsWithoutRef<typeof Arco.Typography>
12
+
13
+ /**
14
+ * 富文本排版容器,提供标题、段落、代码与引用样式。
15
+ *
16
+ * @param props - 见 {@link TypographyProps}。
17
+ * @returns 排版元素。
18
+ */
19
+ export function Typography(props: TypographyProps): React.ReactElement {
20
+ injectDisplayStyles()
21
+ return <Arco.Typography {...props} />
22
+ }
23
+
24
+ /** {@link Text} 的 props。 */
25
+ export type TextProps = React.ComponentPropsWithoutRef<typeof Arco.Typography.Text>
26
+
27
+ /**
28
+ * 行内文本,可标记为次要、成功、警告或危险。
29
+ *
30
+ * @param props - 见 {@link TextProps}。
31
+ * @returns 文本元素。
32
+ */
33
+ export function Text(props: TextProps): React.ReactElement {
34
+ injectDisplayStyles()
35
+ return <Arco.Typography.Text {...props} />
36
+ }
37
+
38
+ /** {@link Paragraph} 的 props。 */
39
+ export type ParagraphProps = React.ComponentPropsWithoutRef<typeof Arco.Typography.Paragraph>
40
+
41
+ /**
42
+ * 段落。
43
+ *
44
+ * @param props - 见 {@link ParagraphProps}。
45
+ * @returns 段落元素。
46
+ */
47
+ export function Paragraph(props: ParagraphProps): React.ReactElement {
48
+ injectDisplayStyles()
49
+ return <Arco.Typography.Paragraph {...props} />
50
+ }
51
+
52
+ /** {@link Empty} 的 props。 */
53
+ export type EmptyProps = React.ComponentPropsWithoutRef<typeof Arco.Empty>
54
+
55
+ /**
56
+ * 空状态占位。
57
+ *
58
+ * @param props - 见 {@link EmptyProps}。
59
+ * @returns 空状态元素。
60
+ */
61
+ export function Empty(props: EmptyProps): React.ReactElement {
62
+ injectDisplayStyles()
63
+ return <Arco.Empty {...props} />
64
+ }
65
+
66
+ /** {@link Skeleton} 的 props。 */
67
+ export type SkeletonProps = React.ComponentPropsWithoutRef<typeof Arco.Skeleton>
68
+
69
+ /**
70
+ * 骨架屏占位。
71
+ *
72
+ * @param props - 见 {@link SkeletonProps}。
73
+ * @returns 骨架元素。
74
+ */
75
+ export function Skeleton(props: SkeletonProps): React.ReactElement {
76
+ injectDisplayStyles()
77
+ return <Arco.Skeleton {...props} />
78
+ }
79
+
80
+ /** {@link Spin} 的 props。 */
81
+ export type SpinProps = React.ComponentPropsWithoutRef<typeof Arco.Spin>
82
+
83
+ /**
84
+ * 加载指示器。
85
+ *
86
+ * @param props - 见 {@link SpinProps}。
87
+ * @returns 加载元素。
88
+ */
89
+ export function Spin(props: SpinProps): React.ReactElement {
90
+ injectDisplayStyles()
91
+ return <Arco.Spin {...props} />
92
+ }
@@ -1,44 +1,44 @@
1
- /**
2
- * 展示组件出口。
3
- *
4
- * @module @dsh-plugin/dsh-ui-components/display
5
- */
6
- export { Card, Descriptions, Divider, type CardProps, type DescriptionsProps, type DividerProps } from './container.js'
7
- export {
8
- Avatar,
9
- Badge,
10
- Pill,
11
- Tag,
12
- type AvatarProps,
13
- type BadgeProps,
14
- type PillProps,
15
- type TagProps,
16
- type TagTone,
17
- } from './label.js'
18
- export {
19
- Empty,
20
- Paragraph,
21
- Skeleton,
22
- Spin,
23
- Text,
24
- Typography,
25
- type EmptyProps,
26
- type ParagraphProps,
27
- type SkeletonProps,
28
- type SpinProps,
29
- type TextProps,
30
- type TypographyProps,
31
- } from './feedback.js'
32
- export {
33
- Collapse,
34
- CollapseItem,
35
- HoverCard,
36
- Popover,
37
- Tooltip,
38
- type CollapseItemProps,
39
- type CollapseProps,
40
- type HoverCardProps,
41
- type PopoverProps,
42
- type TooltipProps,
43
- } from './overlay.js'
44
- export { DISPLAY_CSS, injectDisplayStyles } from './styles.js'
1
+ /**
2
+ * 展示组件出口。
3
+ *
4
+ * @module @dsh-plugin/dsh-ui-components/display
5
+ */
6
+ export { Card, Descriptions, Divider, type CardProps, type DescriptionsProps, type DividerProps } from './container.js'
7
+ export {
8
+ Avatar,
9
+ Badge,
10
+ Pill,
11
+ Tag,
12
+ type AvatarProps,
13
+ type BadgeProps,
14
+ type PillProps,
15
+ type TagProps,
16
+ type TagTone,
17
+ } from './label.js'
18
+ export {
19
+ Empty,
20
+ Paragraph,
21
+ Skeleton,
22
+ Spin,
23
+ Text,
24
+ Typography,
25
+ type EmptyProps,
26
+ type ParagraphProps,
27
+ type SkeletonProps,
28
+ type SpinProps,
29
+ type TextProps,
30
+ type TypographyProps,
31
+ } from './feedback.js'
32
+ export {
33
+ Collapse,
34
+ CollapseItem,
35
+ HoverCard,
36
+ Popover,
37
+ Tooltip,
38
+ type CollapseItemProps,
39
+ type CollapseProps,
40
+ type HoverCardProps,
41
+ type PopoverProps,
42
+ type TooltipProps,
43
+ } from './overlay.js'
44
+ export { DISPLAY_CSS, injectDisplayStyles } from './styles.js'