sud-ui 1.9.2 → 2.0.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.
- package/LICENSE +21 -0
- package/README.md +26 -8
- package/dist/components/SoonUIDesign.d.ts +11 -11
- package/dist/components/commonType.d.ts +10 -10
- package/dist/components/dataDisplay/Calendar.d.ts +9 -8
- package/dist/components/dataDisplay/Card.d.ts +23 -14
- package/dist/components/dataDisplay/Carousel.d.ts +7 -6
- package/dist/components/dataDisplay/Collapse.d.ts +12 -11
- package/dist/components/dataDisplay/Drawer.d.ts +15 -13
- package/dist/components/dataDisplay/Modal.d.ts +12 -11
- package/dist/components/dataDisplay/Segmented.d.ts +2 -1
- package/dist/components/dataDisplay/Table.d.ts +2 -1
- package/dist/components/dataDisplay/Tabs.d.ts +2 -1
- package/dist/components/dataEntry/Checkbox.d.ts +22 -4
- package/dist/components/dataEntry/ColorPicker.d.ts +2 -1
- package/dist/components/dataEntry/Input.d.ts +10 -10
- package/dist/components/dataEntry/Radio.d.ts +22 -4
- package/dist/components/dataEntry/Rate.d.ts +3 -2
- package/dist/components/dataEntry/Select.d.ts +17 -16
- package/dist/components/dataEntry/Slider.d.ts +2 -1
- package/dist/components/dataEntry/Switch.d.ts +22 -3
- package/dist/components/dataEntry/TimeSelector.d.ts +2 -1
- package/dist/components/feedback/Progress.d.ts +19 -19
- package/dist/components/general/Button.d.ts +11 -8
- package/dist/components/layout/index.d.ts +10 -10
- package/dist/components/navigation/Breadcrumb.d.ts +6 -4
- package/dist/components/navigation/Divider.d.ts +2 -1
- package/dist/components/navigation/Dropdown.d.ts +11 -11
- package/dist/components/navigation/Menu.d.ts +2 -1
- package/dist/components/navigation/Pagination.d.ts +2 -1
- package/dist/components/navigation/base/PopupBase.d.ts +15 -12
- package/dist/index.css +1 -1
- package/dist/index.d.ts +64 -64
- package/dist/index.js +5091 -4791
- package/dist/index.js.map +1 -1
- package/dist/theme/ThemeContext.d.ts +42 -42
- package/dist/theme/darkTheme.d.ts +3 -3
- package/dist/theme/defaultTheme.d.ts +3 -3
- package/dist/theme/index.d.ts +4 -4
- package/dist/theme/themeUtils.d.ts +80 -80
- package/docs/improvement-plan.md +271 -271
- package/docs/surface-guidelines.md +29 -29
- package/package.json +20 -6
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import type { Context, FC, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export type ThemeScale = Record<string | number, string>;
|
|
4
|
-
|
|
5
|
-
export interface ComponentColorToken {
|
|
6
|
-
bg?: string;
|
|
7
|
-
txt?: string;
|
|
8
|
-
border?: string;
|
|
9
|
-
separator?: string;
|
|
10
|
-
text?: string;
|
|
11
|
-
now?: string;
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface SUDTheme {
|
|
16
|
-
body?: {
|
|
17
|
-
backgroundColor?: string;
|
|
18
|
-
color?: string;
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
colors?: Record<string, ThemeScale>;
|
|
22
|
-
components?: Record<string, Record<string, ComponentColorToken>>;
|
|
23
|
-
typography?: {
|
|
24
|
-
fontSize?: Record<string, string>;
|
|
25
|
-
fontWeight?: Record<string, string | number>;
|
|
26
|
-
[key: string]: unknown;
|
|
27
|
-
};
|
|
28
|
-
shadows?: Record<string, string>;
|
|
29
|
-
shapes?: Record<string, Record<string, string | number>>;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface ThemeProviderProps {
|
|
34
|
-
theme?: SUDTheme;
|
|
35
|
-
darkTheme?: SUDTheme;
|
|
36
|
-
isDarkMode?: boolean;
|
|
37
|
-
children?: ReactNode;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export declare const ThemeContext: Context<SUDTheme | null>;
|
|
41
|
-
export declare const useTheme: () => SUDTheme;
|
|
42
|
-
export declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
1
|
+
import type { Context, FC, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export type ThemeScale = Record<string | number, string>;
|
|
4
|
+
|
|
5
|
+
export interface ComponentColorToken {
|
|
6
|
+
bg?: string;
|
|
7
|
+
txt?: string;
|
|
8
|
+
border?: string;
|
|
9
|
+
separator?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
now?: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SUDTheme {
|
|
16
|
+
body?: {
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
color?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
colors?: Record<string, ThemeScale>;
|
|
22
|
+
components?: Record<string, Record<string, ComponentColorToken>>;
|
|
23
|
+
typography?: {
|
|
24
|
+
fontSize?: Record<string, string>;
|
|
25
|
+
fontWeight?: Record<string, string | number>;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
};
|
|
28
|
+
shadows?: Record<string, string>;
|
|
29
|
+
shapes?: Record<string, Record<string, string | number>>;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ThemeProviderProps {
|
|
34
|
+
theme?: SUDTheme;
|
|
35
|
+
darkTheme?: SUDTheme;
|
|
36
|
+
isDarkMode?: boolean;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare const ThemeContext: Context<SUDTheme | null>;
|
|
41
|
+
export declare const useTheme: () => SUDTheme;
|
|
42
|
+
export declare const ThemeProvider: FC<ThemeProviderProps>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SUDTheme } from "./ThemeContext";
|
|
2
|
-
|
|
3
|
-
export declare const darkTheme: SUDTheme;
|
|
1
|
+
import type { SUDTheme } from "./ThemeContext";
|
|
2
|
+
|
|
3
|
+
export declare const darkTheme: SUDTheme;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SUDTheme } from "./ThemeContext";
|
|
2
|
-
|
|
3
|
-
export declare const defaultTheme: SUDTheme;
|
|
1
|
+
import type { SUDTheme } from "./ThemeContext";
|
|
2
|
+
|
|
3
|
+
export declare const defaultTheme: SUDTheme;
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./ThemeContext.d";
|
|
2
|
-
export * from "./defaultTheme.d";
|
|
3
|
-
export * from "./darkTheme.d";
|
|
4
|
-
export * from "./themeUtils.d";
|
|
1
|
+
export * from "./ThemeContext.d";
|
|
2
|
+
export * from "./defaultTheme.d";
|
|
3
|
+
export * from "./darkTheme.d";
|
|
4
|
+
export * from "./themeUtils.d";
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import type { shadowType, surfaceType } from "../components/commonType";
|
|
2
|
-
import type { SUDTheme } from "./ThemeContext";
|
|
3
|
-
|
|
4
|
-
export interface ComputeColorStylesOptions {
|
|
5
|
-
theme?: SUDTheme;
|
|
6
|
-
border?: boolean;
|
|
7
|
-
fallback?: string;
|
|
8
|
-
componentType?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface ColorStyleResult {
|
|
12
|
-
bgColor?: string;
|
|
13
|
-
txtColor?: string;
|
|
14
|
-
borColor?: string | null;
|
|
15
|
-
separator?: string;
|
|
16
|
-
text?: string;
|
|
17
|
-
now?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ParsedColorString {
|
|
21
|
-
color?: string;
|
|
22
|
-
intensity?: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ResolveSurfaceStyleOptions {
|
|
26
|
-
surface?: surfaceType;
|
|
27
|
-
border?: boolean;
|
|
28
|
-
shadow?: shadowType | boolean | null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface ResolvedSurfaceStyle {
|
|
32
|
-
border: boolean;
|
|
33
|
-
shadow: shadowType;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export declare const computeColorStyles: (
|
|
37
|
-
options?: ComputeColorStylesOptions
|
|
38
|
-
) => ColorStyleResult;
|
|
39
|
-
export declare const parseColorString: (colorString?: string) => ParsedColorString;
|
|
40
|
-
export declare const resolveColor: (
|
|
41
|
-
colorString?: string,
|
|
42
|
-
theme?: SUDTheme
|
|
43
|
-
) => string;
|
|
44
|
-
export declare const adjustBrightness: (hex: string, percent: number) => string;
|
|
45
|
-
export declare const getColorWithIntensity: (
|
|
46
|
-
color: string,
|
|
47
|
-
intensity?: number,
|
|
48
|
-
theme?: SUDTheme
|
|
49
|
-
) => string;
|
|
50
|
-
export declare const mergeClassNames: (
|
|
51
|
-
...args: Array<string | false | null | undefined>
|
|
52
|
-
) => string;
|
|
53
|
-
export declare const normalizeShadow: (
|
|
54
|
-
shadow?: shadowType | boolean | null | ""
|
|
55
|
-
) => shadowType;
|
|
56
|
-
export declare const surfacePresets: Record<
|
|
57
|
-
surfaceType,
|
|
58
|
-
{ border: boolean; shadow: shadowType }
|
|
59
|
-
>;
|
|
60
|
-
export declare const resolveSurfaceStyle: (
|
|
61
|
-
options?: ResolveSurfaceStyleOptions
|
|
62
|
-
) => ResolvedSurfaceStyle;
|
|
63
|
-
export declare const getShadowStyle: (
|
|
64
|
-
shadow?: shadowType | boolean | null,
|
|
65
|
-
theme?: SUDTheme
|
|
66
|
-
) => string;
|
|
67
|
-
export declare const getShapeStyles: (
|
|
68
|
-
shape?: string,
|
|
69
|
-
theme?: SUDTheme
|
|
70
|
-
) => Record<string, string | number>;
|
|
71
|
-
export declare const getFontStyles: (options: {
|
|
72
|
-
size?: string;
|
|
73
|
-
weight?: string;
|
|
74
|
-
theme: SUDTheme;
|
|
75
|
-
}) => {
|
|
76
|
-
fontSize: string;
|
|
77
|
-
fontWeight: string | number;
|
|
78
|
-
};
|
|
79
|
-
export declare const applyPulseEffect: (element: HTMLElement) => void;
|
|
80
|
-
export declare const pulseThumbScaleWithBounce: (element: HTMLElement) => void;
|
|
1
|
+
import type { shadowType, surfaceType } from "../components/commonType";
|
|
2
|
+
import type { SUDTheme } from "./ThemeContext";
|
|
3
|
+
|
|
4
|
+
export interface ComputeColorStylesOptions {
|
|
5
|
+
theme?: SUDTheme;
|
|
6
|
+
border?: boolean;
|
|
7
|
+
fallback?: string;
|
|
8
|
+
componentType?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ColorStyleResult {
|
|
12
|
+
bgColor?: string;
|
|
13
|
+
txtColor?: string;
|
|
14
|
+
borColor?: string | null;
|
|
15
|
+
separator?: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
now?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ParsedColorString {
|
|
21
|
+
color?: string;
|
|
22
|
+
intensity?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ResolveSurfaceStyleOptions {
|
|
26
|
+
surface?: surfaceType;
|
|
27
|
+
border?: boolean;
|
|
28
|
+
shadow?: shadowType | boolean | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ResolvedSurfaceStyle {
|
|
32
|
+
border: boolean;
|
|
33
|
+
shadow: shadowType;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare const computeColorStyles: (
|
|
37
|
+
options?: ComputeColorStylesOptions
|
|
38
|
+
) => ColorStyleResult;
|
|
39
|
+
export declare const parseColorString: (colorString?: string) => ParsedColorString;
|
|
40
|
+
export declare const resolveColor: (
|
|
41
|
+
colorString?: string,
|
|
42
|
+
theme?: SUDTheme
|
|
43
|
+
) => string;
|
|
44
|
+
export declare const adjustBrightness: (hex: string, percent: number) => string;
|
|
45
|
+
export declare const getColorWithIntensity: (
|
|
46
|
+
color: string,
|
|
47
|
+
intensity?: number,
|
|
48
|
+
theme?: SUDTheme
|
|
49
|
+
) => string;
|
|
50
|
+
export declare const mergeClassNames: (
|
|
51
|
+
...args: Array<string | false | null | undefined>
|
|
52
|
+
) => string;
|
|
53
|
+
export declare const normalizeShadow: (
|
|
54
|
+
shadow?: shadowType | boolean | null | ""
|
|
55
|
+
) => shadowType;
|
|
56
|
+
export declare const surfacePresets: Record<
|
|
57
|
+
surfaceType,
|
|
58
|
+
{ border: boolean; shadow: shadowType }
|
|
59
|
+
>;
|
|
60
|
+
export declare const resolveSurfaceStyle: (
|
|
61
|
+
options?: ResolveSurfaceStyleOptions
|
|
62
|
+
) => ResolvedSurfaceStyle;
|
|
63
|
+
export declare const getShadowStyle: (
|
|
64
|
+
shadow?: shadowType | boolean | null,
|
|
65
|
+
theme?: SUDTheme
|
|
66
|
+
) => string;
|
|
67
|
+
export declare const getShapeStyles: (
|
|
68
|
+
shape?: string,
|
|
69
|
+
theme?: SUDTheme
|
|
70
|
+
) => Record<string, string | number>;
|
|
71
|
+
export declare const getFontStyles: (options: {
|
|
72
|
+
size?: string;
|
|
73
|
+
weight?: string;
|
|
74
|
+
theme: SUDTheme;
|
|
75
|
+
}) => {
|
|
76
|
+
fontSize: string;
|
|
77
|
+
fontWeight: string | number;
|
|
78
|
+
};
|
|
79
|
+
export declare const applyPulseEffect: (element: HTMLElement) => void;
|
|
80
|
+
export declare const pulseThumbScaleWithBounce: (element: HTMLElement) => void;
|