sud-ui 1.5.4 → 1.9.1
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/README.md +19 -13
- package/dist/components/SoonUIDesign.d.ts +11 -0
- package/dist/components/commonType.d.ts +10 -3
- package/dist/components/dataDisplay/Card.d.ts +11 -8
- package/dist/components/dataDisplay/Collapse.d.ts +10 -8
- package/dist/components/dataDisplay/Drawer.d.ts +10 -8
- package/dist/components/dataDisplay/Modal.d.ts +10 -8
- package/dist/components/dataEntry/Input.d.ts +13 -4
- package/dist/components/dataEntry/Rate.d.ts +1 -3
- package/dist/components/dataEntry/Select.d.ts +10 -8
- package/dist/components/feedback/Progress.d.ts +19 -10
- package/dist/components/layout/index.d.ts +10 -0
- package/dist/components/navigation/Dropdown.d.ts +9 -7
- package/dist/components/navigation/base/PopupBase.d.ts +10 -8
- package/dist/index.css +1 -1
- package/dist/index.d.ts +26 -5
- package/dist/index.js +6499 -6400
- package/dist/index.js.map +1 -1
- package/dist/theme/ThemeContext.d.ts +42 -0
- package/dist/theme/darkTheme.d.ts +3 -0
- package/dist/theme/defaultTheme.d.ts +3 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/themeUtils.d.ts +80 -0
- package/docs/surface-guidelines.md +29 -0
- package/package.json +12 -4
- package/dist/fonts/GmarketSansBold.woff +0 -0
- package/dist/fonts/GmarketSansLight.woff +0 -0
- package/dist/fonts/GmarketSansMedium.woff +0 -0
- package/dist/fonts/IntelOneMono-Medium.woff2 +0 -0
- package/dist/fonts/Pretendard-Black.woff2 +0 -0
- package/dist/fonts/Pretendard-Bold.woff2 +0 -0
- package/dist/fonts/Pretendard-ExtraBold.woff2 +0 -0
- package/dist/fonts/Pretendard-ExtraLight.woff2 +0 -0
- package/dist/fonts/Pretendard-Light.woff2 +0 -0
- package/dist/fonts/Pretendard-Medium.woff2 +0 -0
- package/dist/fonts/Pretendard-Regular.woff2 +0 -0
- package/dist/fonts/Pretendard-SemiBold.woff2 +0 -0
- package/dist/fonts/Pretendard-Thin.woff2 +0 -0
- package/dist/fonts/SUITE-Bold.woff2 +0 -0
- package/dist/fonts/SUITE-ExtraBold.woff2 +0 -0
- package/dist/fonts/SUITE-Heavy.woff2 +0 -0
- package/dist/fonts/SUITE-Light.woff2 +0 -0
- package/dist/fonts/SUITE-Medium.woff2 +0 -0
- package/dist/fonts/SUITE-Regular.woff2 +0 -0
- package/dist/fonts/SUITE-SemiBold.woff2 +0 -0
- package/dist/fonts/fonts/GmarketSansBold.woff +0 -0
- package/dist/fonts/fonts/GmarketSansLight.woff +0 -0
- package/dist/fonts/fonts/GmarketSansMedium.woff +0 -0
- package/dist/fonts/fonts/IntelOneMono-Medium.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-Black.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-Bold.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-ExtraBold.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-ExtraLight.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-Light.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-Medium.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-Regular.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-SemiBold.woff2 +0 -0
- package/dist/fonts/fonts/Pretendard-Thin.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-Bold.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-ExtraBold.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-Heavy.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-Light.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-Medium.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-Regular.woff2 +0 -0
- package/dist/fonts/fonts/SUITE-SemiBold.woff2 +0 -0
|
@@ -0,0 +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>;
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Surface Guidelines
|
|
2
|
+
|
|
3
|
+
Sud UI components should not enable border and shadow at the same time by default.
|
|
4
|
+
|
|
5
|
+
## Defaults
|
|
6
|
+
|
|
7
|
+
- Content and form surfaces use a border by default and no shadow.
|
|
8
|
+
- Floating surfaces use a shadow by default and no border.
|
|
9
|
+
- Action components such as `Button` stay flat by default unless the caller asks for a shadow.
|
|
10
|
+
|
|
11
|
+
## Component Types
|
|
12
|
+
|
|
13
|
+
- `content`: `Card`, `Collapse`, dense layout panels
|
|
14
|
+
- `input`: `Input`, `Select`, form controls
|
|
15
|
+
- `floating`: `Modal`, `Drawer`, `PopupBase`, `Dropdown`, overlays
|
|
16
|
+
- `action`: `Button`, icon buttons, compact commands
|
|
17
|
+
|
|
18
|
+
Use `surface`, `border`, and `shadow` to override these defaults explicitly.
|
|
19
|
+
|
|
20
|
+
## Release Check
|
|
21
|
+
|
|
22
|
+
Before publishing, run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm run lint
|
|
26
|
+
npm run build
|
|
27
|
+
npm run check:exports
|
|
28
|
+
npm pack --dry-run
|
|
29
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sud-ui",
|
|
3
3
|
"description": "A React UI component library with dark mode support, customizable styles, reusable components, and utility-style class names.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -16,11 +16,13 @@
|
|
|
16
16
|
"./dist/index.css": "./dist/index.css"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
-
"dist"
|
|
19
|
+
"dist",
|
|
20
|
+
"docs"
|
|
20
21
|
],
|
|
21
22
|
"scripts": {
|
|
22
23
|
"dev": "vite",
|
|
23
24
|
"build": "vite build && node scripts/copy-types.mjs",
|
|
25
|
+
"check:exports": "node scripts/check-exports.mjs",
|
|
24
26
|
"lint": "eslint .",
|
|
25
27
|
"preview": "vite preview"
|
|
26
28
|
},
|
|
@@ -33,12 +35,18 @@
|
|
|
33
35
|
"sud-icons": "^1.0.3"
|
|
34
36
|
},
|
|
35
37
|
"devDependencies": {
|
|
38
|
+
"@eslint/js": "^9.29.0",
|
|
36
39
|
"@vitejs/plugin-react": "^4.7.0",
|
|
40
|
+
"autoprefixer": "^10.5.0",
|
|
37
41
|
"eslint": "^9.21.0",
|
|
42
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
43
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
44
|
+
"globals": "^15.15.0",
|
|
45
|
+
"postcss": "^8.5.15",
|
|
38
46
|
"react": "^19.0.0",
|
|
39
47
|
"react-dom": "^19.0.0",
|
|
40
|
-
"
|
|
41
|
-
"vite
|
|
48
|
+
"tailwindcss": "^3.4.17",
|
|
49
|
+
"vite": "^6.2.0"
|
|
42
50
|
},
|
|
43
51
|
"sideEffects": [
|
|
44
52
|
"**/*.css"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|