tango-ui-cw 1.0.10 → 1.2.0

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 (36) hide show
  1. package/README.md +133 -126
  2. package/dist/component/CSSFab/index.d.ts +61 -55
  3. package/dist/component/CSSFab/useTangoStyle.d.ts +1 -1
  4. package/dist/component/TBanner/index.d.ts +53 -50
  5. package/dist/component/TButton/index.d.ts +109 -107
  6. package/dist/component/TCard/index.d.ts +40 -0
  7. package/dist/component/TColorPicker/index.d.ts +42 -41
  8. package/dist/component/TDate/index.d.ts +42 -41
  9. package/dist/component/TDatePicker/index.d.ts +54 -49
  10. package/dist/component/TDrawer/index.d.ts +59 -58
  11. package/dist/component/TInput/index.d.ts +111 -81
  12. package/dist/component/TLayout/index.d.ts +136 -133
  13. package/dist/component/TLine/index.d.ts +36 -33
  14. package/dist/component/TMark/index.d.ts +41 -38
  15. package/dist/component/TModal/index.d.ts +107 -52
  16. package/dist/component/TNotice/index.d.ts +47 -30
  17. package/dist/component/TSearch/index.d.ts +56 -42
  18. package/dist/component/TSpace/index.d.ts +60 -59
  19. package/dist/component/TTable/index.d.ts +117 -76
  20. package/dist/component/TTooltip/index.d.ts +34 -31
  21. package/dist/component/TUpload/index.d.ts +74 -45
  22. package/dist/component/index.d.ts +167 -146
  23. package/dist/index.cjs +26 -8
  24. package/dist/index.d.cts +18 -18
  25. package/dist/index.d.ts +18 -18
  26. package/dist/index.js +3334 -2305
  27. package/dist/providers/NoticeProvider/NoticeProvider.d.ts +43 -19
  28. package/dist/providers/TangoI18nProvider/TangoI18nProvider.d.ts +27 -27
  29. package/dist/providers/ThemeProvider/ThemeProvider.d.ts +21 -21
  30. package/dist/scripts/check-peers.js +82 -82
  31. package/dist/styles/base.css +383 -353
  32. package/dist/styles/global.css +383 -353
  33. package/dist/styles/style.css +1 -1
  34. package/dist/styles/theme.css +13 -13
  35. package/dist/styles/utilities.css +1 -1
  36. package/package.json +68 -68
@@ -1,107 +1,109 @@
1
- import type {
2
- ButtonHTMLAttributes,
3
- CSSProperties,
4
- ElementType,
5
- ReactNode,
6
- } from "react";
7
- import type { SxValue } from "../CSSFab";
8
-
9
- export type ButtonVariant = "default" | "transparent" | "danger" | "success";
10
- export type ButtonSize = "small" | "medium" | "large" | "huge";
11
- export type LoadingMode = boolean | "light" | "dark" | [boolean | "light" | "dark", "light" | "dark"];
12
- export type ButtonI18nKey =
13
- | "default"
14
- | "loading"
15
- | "submit"
16
- | "confirm"
17
- | "cancel"
18
- | "search"
19
- | "save"
20
- | "delete"
21
- | "back"
22
- | "next"
23
- | "prev"
24
- | "add"
25
- | (string & {});
26
-
27
- export type ButtonLocaleText = Partial<
28
- Record<
29
- | "default"
30
- | "loading"
31
- | "iconAlt"
32
- | "submit"
33
- | "confirm"
34
- | "cancel"
35
- | "search"
36
- | "save"
37
- | "delete"
38
- | "back"
39
- | "next"
40
- | "prev"
41
- | "add"
42
- | string,
43
- string
44
- >
45
- >;
46
-
47
- export interface ButtonProps
48
- extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
49
- type?: ButtonVariant;
50
- size?: ButtonSize;
51
- sx?: SxValue;
52
- style?: CSSProperties;
53
- className?: string;
54
- children?: ReactNode;
55
- disabled?: boolean;
56
- outline?: boolean;
57
- icon?: ElementType | ReactNode | string;
58
- iconPosition?: "left" | "right";
59
- loading?: LoadingMode;
60
- i18nKey?: ButtonI18nKey;
61
- localeText?: ButtonLocaleText;
62
- }
63
-
64
- declare function Button(props: ButtonProps): JSX.Element;
65
-
66
- // MaterialButton 类型
67
- export type MaterialButtonVariant = "default" | "transparent" | "danger" | "success";
68
- export type MaterialButtonSize = "small" | "medium" | "large" | "huge";
69
-
70
- export interface MaterialButtonLocaleText {
71
- default?: string;
72
- loading?: string;
73
- iconAlt?: string;
74
- [key: string]: string | undefined;
75
- }
76
-
77
- export interface MaterialButtonProps
78
- extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
79
- type?: MaterialButtonVariant;
80
- size?: MaterialButtonSize;
81
- sx?: SxValue;
82
- style?: CSSProperties;
83
- className?: string;
84
- children?: ReactNode;
85
- disabled?: boolean;
86
- outline?: boolean;
87
- icon?: ElementType | ReactNode | string;
88
- iconPosition?: "left" | "right";
89
- loading?: LoadingMode;
90
- i18nKey?: string;
91
- localeText?: MaterialButtonLocaleText;
92
- /** 涟漪颜色,默认使用 --material-button-ripple */
93
- rippleColor?: string;
94
- }
95
-
96
- declare function MaterialButton(props: MaterialButtonProps): JSX.Element;
97
-
98
- // antd 风格:Button.MaterialButton / const { MaterialButton } = Button
99
- interface ButtonNamespace {
100
- (props: ButtonProps): JSX.Element;
101
- MaterialButton: typeof MaterialButton;
102
- }
103
-
104
- declare const ButtonWithType: ButtonNamespace;
105
- export { ButtonWithType as Button };
106
- export { MaterialButton };
107
- export default Button;
1
+ import type {
2
+ ButtonHTMLAttributes,
3
+ CSSProperties,
4
+ ElementType,
5
+ ReactNode,
6
+ } from "react";
7
+ import type { SxValue } from "../CSSFab";
8
+
9
+ export type ButtonSlotNames = readonly ["root", "content", "icon", "loading"];
10
+ export type ButtonVariant = "default" | "transparent" | "danger" | "success";
11
+ export type ButtonSize = "small" | "medium" | "large" | "huge";
12
+ export type LoadingMode = boolean | "light" | "dark" | [boolean | "light" | "dark", "light" | "dark"];
13
+ export type ButtonI18nKey =
14
+ | "default"
15
+ | "loading"
16
+ | "submit"
17
+ | "confirm"
18
+ | "cancel"
19
+ | "search"
20
+ | "save"
21
+ | "delete"
22
+ | "back"
23
+ | "next"
24
+ | "prev"
25
+ | "add"
26
+ | (string & {});
27
+
28
+ export type ButtonLocaleText = Partial<
29
+ Record<
30
+ | "default"
31
+ | "loading"
32
+ | "iconAlt"
33
+ | "submit"
34
+ | "confirm"
35
+ | "cancel"
36
+ | "search"
37
+ | "save"
38
+ | "delete"
39
+ | "back"
40
+ | "next"
41
+ | "prev"
42
+ | "add"
43
+ | string,
44
+ string
45
+ >
46
+ >;
47
+
48
+ export interface ButtonProps
49
+ extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
50
+ type?: ButtonVariant;
51
+ size?: ButtonSize;
52
+ sx?: SxValue;
53
+ style?: CSSProperties;
54
+ className?: string;
55
+ children?: ReactNode;
56
+ disabled?: boolean;
57
+ outline?: boolean;
58
+ icon?: ElementType | ReactNode | string;
59
+ iconPosition?: "left" | "right";
60
+ loading?: LoadingMode;
61
+ i18nKey?: ButtonI18nKey;
62
+ localeText?: ButtonLocaleText;
63
+ }
64
+
65
+ declare function Button(props: ButtonProps): JSX.Element;
66
+
67
+ // MaterialButton 类型
68
+ export type MaterialButtonSlotNames = readonly ["root", "content", "icon", "loading"];
69
+ export type MaterialButtonVariant = "default" | "transparent" | "danger" | "success";
70
+ export type MaterialButtonSize = "small" | "medium" | "large" | "huge";
71
+
72
+ export interface MaterialButtonLocaleText {
73
+ default?: string;
74
+ loading?: string;
75
+ iconAlt?: string;
76
+ [key: string]: string | undefined;
77
+ }
78
+
79
+ export interface MaterialButtonProps
80
+ extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "style" | "className" | "children"> {
81
+ type?: MaterialButtonVariant;
82
+ size?: MaterialButtonSize;
83
+ sx?: SxValue;
84
+ style?: CSSProperties;
85
+ className?: string;
86
+ children?: ReactNode;
87
+ disabled?: boolean;
88
+ outline?: boolean;
89
+ icon?: ElementType | ReactNode | string;
90
+ iconPosition?: "left" | "right";
91
+ loading?: LoadingMode;
92
+ i18nKey?: string;
93
+ localeText?: MaterialButtonLocaleText;
94
+ /** 涟漪颜色,默认使用 --material-button-ripple */
95
+ rippleColor?: string;
96
+ }
97
+
98
+ declare function MaterialButton(props: MaterialButtonProps): JSX.Element;
99
+
100
+ // antd 风格:Button.MaterialButton / const { MaterialButton } = Button
101
+ interface ButtonNamespace {
102
+ (props: ButtonProps): JSX.Element;
103
+ MaterialButton: typeof MaterialButton;
104
+ }
105
+
106
+ declare const ButtonWithType: ButtonNamespace;
107
+ export { ButtonWithType as Button };
108
+ export { MaterialButton };
109
+ export default Button;
@@ -0,0 +1,40 @@
1
+ import type {
2
+ CSSProperties,
3
+ HTMLAttributes,
4
+ ReactNode,
5
+ Ref,
6
+ } from "react";
7
+
8
+ /** Card sx slot 名列表 */
9
+ export type CardSlotNames = readonly ["root", "header", "body"];
10
+
11
+ /** sx 值类型 */
12
+ export type SxValue =
13
+ | string
14
+ | { tw?: string; className?: string; css?: CSSProperties; style?: CSSProperties }
15
+ | Record<string, unknown>;
16
+
17
+ /** Card Props */
18
+ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "title"> {
19
+ /** 卡片标题 */
20
+ title?: ReactNode;
21
+ /** 卡片标题右侧额外内容(如操作按钮) */
22
+ extra?: ReactNode;
23
+ /** 是否显示边框 */
24
+ bordered?: boolean;
25
+ /** 样式扩展 */
26
+ sx?: SxValue;
27
+ /** 行内样式 */
28
+ style?: CSSProperties;
29
+ /** 额外 CSS 类名 */
30
+ className?: string;
31
+ /** 卡片内容 */
32
+ children?: ReactNode;
33
+ /** ref 转发 */
34
+ ref?: Ref<HTMLDivElement>;
35
+ }
36
+
37
+ declare const Card: React.ForwardRefExoticComponent<
38
+ CardProps & React.RefAttributes<HTMLDivElement>
39
+ >;
40
+ export default Card;
@@ -1,41 +1,42 @@
1
- import type { CSSProperties, InputHTMLAttributes } from "react";
2
- import type { SxValue } from "../CSSFab";
3
-
4
- export type ColorPickerSize = "small" | "medium" | "large";
5
- export type ColorPickerFormat = "hex" | "rgb" | "hsl";
6
- export type ColorPickerShowText = boolean | ColorPickerFormat;
7
- export type ColorPickerI18nKey = "hex" | "rgb" | "hsl" | (string & {});
8
- export type ColorPickerLocaleText = Partial<
9
- Record<"hex" | "rgb" | "hsl" | string, string>
10
- >;
11
-
12
- export interface ColorPickerProps
13
- extends Omit<InputHTMLAttributes<HTMLInputElement>, "style" | "className" | "size" | "type" | "value" | "onChange"> {
14
- /** 受控颜色值(HEX) */
15
- value?: string;
16
- /** 非受控默认颜色值 */
17
- defaultValue?: string;
18
- /** 颜色变化回调,参数为 HEX 值 */
19
- onChange?: (hex: string) => void;
20
- /** 是否禁用 */
21
- disabled?: boolean;
22
- /** 是否显示颜色文本;传格式字符串仅显示对应格式 */
23
- showText?: ColorPickerShowText;
24
- /** 文本输出格式(showText 为 true 时决定主格式) */
25
- format?: ColorPickerFormat;
26
- /** 尺寸变体 */
27
- size?: ColorPickerSize;
28
- /** Style extension via CSSFab sx */
29
- sx?: SxValue;
30
- style?: CSSProperties;
31
- className?: string;
32
- /** i18n key */
33
- i18nKey?: ColorPickerI18nKey;
34
- /** 覆盖 locale 文案 */
35
- localeText?: ColorPickerLocaleText;
36
- }
37
-
38
- declare function ColorPicker(props: ColorPickerProps): JSX.Element;
39
-
40
- export { ColorPicker };
41
- export default ColorPicker;
1
+ import type { CSSProperties, InputHTMLAttributes } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type ColorPickerSlotNames = readonly ["root", "input", "text"];
5
+ export type ColorPickerSize = "small" | "medium" | "large";
6
+ export type ColorPickerFormat = "hex" | "rgb" | "hsl";
7
+ export type ColorPickerShowText = boolean | ColorPickerFormat;
8
+ export type ColorPickerI18nKey = "hex" | "rgb" | "hsl" | (string & {});
9
+ export type ColorPickerLocaleText = Partial<
10
+ Record<"hex" | "rgb" | "hsl" | string, string>
11
+ >;
12
+
13
+ export interface ColorPickerProps
14
+ extends Omit<InputHTMLAttributes<HTMLInputElement>, "style" | "className" | "size" | "type" | "value" | "onChange"> {
15
+ /** 受控颜色值(HEX) */
16
+ value?: string;
17
+ /** 非受控默认颜色值 */
18
+ defaultValue?: string;
19
+ /** 颜色变化回调,参数为 HEX */
20
+ onChange?: (hex: string) => void;
21
+ /** 是否禁用 */
22
+ disabled?: boolean;
23
+ /** 是否显示颜色文本;传格式字符串仅显示对应格式 */
24
+ showText?: ColorPickerShowText;
25
+ /** 文本输出格式(showText 为 true 时决定主格式) */
26
+ format?: ColorPickerFormat;
27
+ /** 尺寸变体 */
28
+ size?: ColorPickerSize;
29
+ /** Style extension via CSSFab sx */
30
+ sx?: SxValue;
31
+ style?: CSSProperties;
32
+ className?: string;
33
+ /** i18n key */
34
+ i18nKey?: ColorPickerI18nKey;
35
+ /** 覆盖 locale 文案 */
36
+ localeText?: ColorPickerLocaleText;
37
+ }
38
+
39
+ declare function ColorPicker(props: ColorPickerProps): JSX.Element;
40
+
41
+ export { ColorPicker };
42
+ export default ColorPicker;
@@ -1,41 +1,42 @@
1
- import type { CSSProperties, HTMLAttributes } from "react";
2
- import type { SxValue } from "../CSSFab";
3
-
4
- export type DateType =
5
- | "default"
6
- | "line"
7
- | "full"
8
- | "full-line"
9
- | "year-week"
10
- | "year-week-line"
11
- | "week-time"
12
- | "no-s"
13
- | "no-s-line";
14
-
15
- export type DateI18nKey = DateType | (string & {});
16
-
17
- export type DateLocaleText = Partial<{
18
- weekdayPrefix: string;
19
- weekdayShortPrefix: string;
20
- }>;
21
-
22
- export interface DateProps
23
- extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className"> {
24
- /** 显示格式类型 */
25
- type?: DateType;
26
- /** 中文星期简写:true 显示"周X",false 显示"星期X" */
27
- single?: boolean;
28
- /** Style extension via CSSFab sx */
29
- sx?: SxValue;
30
- style?: CSSProperties;
31
- className?: string;
32
- /** i18n key,可指定 type 作为快捷格式 */
33
- i18nKey?: DateI18nKey;
34
- /** 覆盖 locale 文案 */
35
- localeText?: DateLocaleText;
36
- }
37
-
38
- declare function DateDisplay(props: DateProps): JSX.Element;
39
-
40
- export { DateDisplay };
41
- export default DateDisplay;
1
+ import type { CSSProperties, HTMLAttributes } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type DateSlotNames = readonly ["root", "date", "weekday", "time"];
5
+ export type DateType =
6
+ | "default"
7
+ | "line"
8
+ | "full"
9
+ | "full-line"
10
+ | "year-week"
11
+ | "year-week-line"
12
+ | "week-time"
13
+ | "no-s"
14
+ | "no-s-line";
15
+
16
+ export type DateI18nKey = DateType | (string & {});
17
+
18
+ export type DateLocaleText = Partial<{
19
+ weekdayPrefix: string;
20
+ weekdayShortPrefix: string;
21
+ }>;
22
+
23
+ export interface DateProps
24
+ extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className"> {
25
+ /** 显示格式类型 */
26
+ type?: DateType;
27
+ /** 中文星期简写:true 显示"周X",false 显示"星期X" */
28
+ single?: boolean;
29
+ /** Style extension via CSSFab sx */
30
+ sx?: SxValue;
31
+ style?: CSSProperties;
32
+ className?: string;
33
+ /** i18n key,可指定 type 作为快捷格式 */
34
+ i18nKey?: DateI18nKey;
35
+ /** 覆盖 locale 文案 */
36
+ localeText?: DateLocaleText;
37
+ }
38
+
39
+ declare function DateDisplay(props: DateProps): JSX.Element;
40
+
41
+ export { DateDisplay };
42
+ export default DateDisplay;
@@ -1,49 +1,54 @@
1
- import type { CSSProperties, HTMLAttributes } from "react";
2
- import type { SxValue } from "../CSSFab";
3
-
4
- export type DatePickerSize = "small" | "medium" | "large";
5
-
6
- export type DatePickerI18nKey = "placeholder" | "placeholderTime" | "timeLabel" | "confirm" | "cancel" | "prevMonth" | "nextMonth" | (string & {});
7
-
8
- export type DatePickerLocaleText = Partial<{
9
- placeholder: string;
10
- placeholderTime: string;
11
- timeLabel: string;
12
- confirm: string;
13
- cancel: string;
14
- prevMonth: string;
15
- nextMonth: string;
16
- weekDays: string[];
17
- monthFormat: string;
18
- }>;
19
-
20
- export interface DatePickerProps
21
- extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className" | "onChange"> {
22
- /** 受控值(YYYY-MM-DD 或 YYYY-MM-DD HH:mm) */
23
- value?: string;
24
- /** 非受控默认值 */
25
- defaultValue?: string;
26
- /** 日期变化回调:(formatted, raw) => void */
27
- onChange?: (formatted: string, raw: string) => void;
28
- /** 是否禁用 */
29
- disabled?: boolean;
30
- /** 是否显示时间选择 */
31
- time?: boolean;
32
- /** 尺寸变体 */
33
- size?: DatePickerSize;
34
- /** Style extension via CSSFab sx */
35
- sx?: SxValue;
36
- style?: CSSProperties;
37
- className?: string;
38
- /** i18n key */
39
- i18nKey?: DatePickerI18nKey;
40
- /** 覆盖 locale 文案 */
41
- localeText?: DatePickerLocaleText;
42
- /** 输入框占位文本,优先级高于 i18n / localeText */
43
- placeholder?: string;
44
- }
45
-
46
- declare function DatePicker(props: DatePickerProps): JSX.Element;
47
-
48
- export { DatePicker };
49
- export default DatePicker;
1
+ import type { CSSProperties, HTMLAttributes } from "react";
2
+ import type { SxValue } from "../CSSFab";
3
+
4
+ export type DatePickerSize = "small" | "medium" | "large";
5
+
6
+ export type DatePickerSlotNames = readonly ["root", "input", "panel", "header", "body", "footer"];
7
+
8
+ export type DatePickerI18nKey = "placeholder" | "placeholderTime" | "timeLabel" | "confirm" | "cancel" | "prevMonth" | "nextMonth" | "hourLabel" | "minuteLabel" | "panelAriaLabel" | (string & {});
9
+
10
+ export type DatePickerLocaleText = Partial<{
11
+ placeholder: string;
12
+ placeholderTime: string;
13
+ timeLabel: string;
14
+ confirm: string;
15
+ cancel: string;
16
+ prevMonth: string;
17
+ nextMonth: string;
18
+ weekDays: string[];
19
+ monthFormat: string;
20
+ hourLabel: string;
21
+ minuteLabel: string;
22
+ panelAriaLabel: string;
23
+ }>;
24
+
25
+ export interface DatePickerProps
26
+ extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className" | "onChange"> {
27
+ /** 受控值(YYYY-MM-DD YYYY-MM-DD HH:mm) */
28
+ value?: string;
29
+ /** 非受控默认值 */
30
+ defaultValue?: string;
31
+ /** 日期变化回调:(formatted, raw) => void */
32
+ onChange?: (formatted: string, raw: string) => void;
33
+ /** 是否禁用 */
34
+ disabled?: boolean;
35
+ /** 是否显示时间选择 */
36
+ time?: boolean;
37
+ /** 尺寸变体 */
38
+ size?: DatePickerSize;
39
+ /** Style extension via CSSFab sx */
40
+ sx?: SxValue;
41
+ style?: CSSProperties;
42
+ className?: string;
43
+ /** i18n key */
44
+ i18nKey?: DatePickerI18nKey;
45
+ /** 覆盖 locale 文案 */
46
+ localeText?: DatePickerLocaleText;
47
+ /** 输入框占位文本,优先级高于 i18n / localeText */
48
+ placeholder?: string;
49
+ }
50
+
51
+ declare function DatePicker(props: DatePickerProps): JSX.Element;
52
+
53
+ export { DatePicker };
54
+ export default DatePicker;