@uniai-fe/uds-foundation 0.0.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.
@@ -0,0 +1,3 @@
1
+ export { NextLocalFontOptions, ThemeFontDefinition, ThemeFontDisplay, ThemeFontSource, ThemeFontStyle, createLocalFontOptions } from './typography/fonts/types.js';
2
+ export { pretendardFont, pretendardLocalFont } from './typography/fonts/pretendard.js';
3
+ export { interFont, interLocalFont } from './typography/fonts/inter.js';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import "./index.scss";
2
+ export * from "./typography/fonts";
@@ -0,0 +1,36 @@
1
+ interface ThemeTypographyVariant {
2
+ readonly size: number;
3
+ readonly line_height: string;
4
+ readonly letter_spacing: number;
5
+ readonly font_weight: number;
6
+ }
7
+ type ThemeColorPrimitive = Record<string, string>;
8
+ interface ThemeColorSemanticSection {
9
+ readonly [token: string]: string | ThemeColorSemanticSection;
10
+ }
11
+ type ThemeSpacingScale = Record<string, number>;
12
+ type ThemeLayoutSizes = Record<string, number>;
13
+ type ThemeTypographyCategory = Record<string, ThemeTypographyVariant>;
14
+ interface ThemeTokens {
15
+ readonly color: {
16
+ readonly primitive: ThemeColorPrimitive;
17
+ readonly semantic: ThemeColorSemanticSection;
18
+ };
19
+ readonly spacing: {
20
+ readonly padding: ThemeSpacingScale;
21
+ readonly gap: ThemeSpacingScale;
22
+ };
23
+ readonly layout: {
24
+ readonly breakpoint: Record<"xsmall" | "small" | "medium" | "large", number>;
25
+ readonly size: ThemeLayoutSizes;
26
+ readonly radius: {
27
+ readonly size: ThemeLayoutSizes;
28
+ readonly level: ThemeLayoutSizes;
29
+ };
30
+ };
31
+ readonly typography: {
32
+ readonly [category: string]: ThemeTypographyCategory;
33
+ };
34
+ }
35
+
36
+ export type { ThemeColorPrimitive, ThemeColorSemanticSection, ThemeLayoutSizes, ThemeSpacingScale, ThemeTokens, ThemeTypographyCategory, ThemeTypographyVariant };
File without changes
@@ -0,0 +1,3 @@
1
+ export { NextLocalFontOptions, ThemeFontDefinition, ThemeFontDisplay, ThemeFontSource, ThemeFontStyle, createLocalFontOptions } from './types.js';
2
+ export { pretendardFont, pretendardLocalFont } from './pretendard.js';
3
+ export { interFont, interLocalFont } from './inter.js';
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./pretendard";
3
+ export * from "./inter";
@@ -0,0 +1,6 @@
1
+ import { ThemeFontDefinition, NextLocalFontOptions } from './types.js';
2
+
3
+ declare const interFont: ThemeFontDefinition;
4
+ declare const interLocalFont: NextLocalFontOptions;
5
+
6
+ export { interFont, interLocalFont };
@@ -0,0 +1,34 @@
1
+ import { createLocalFontOptions } from "./types";
2
+ const INTER_SRC = "../../fonts/inter/InterVariable.woff2";
3
+ const interFont = {
4
+ name: "InterVariable",
5
+ family: "InterVariable",
6
+ cssVariable: "--theme-font-family-inter",
7
+ fallbacks: [
8
+ "Inter",
9
+ "-apple-system",
10
+ "BlinkMacSystemFont",
11
+ "Segoe UI",
12
+ "Roboto",
13
+ "Helvetica Neue",
14
+ "Arial",
15
+ "sans-serif"
16
+ ],
17
+ display: "swap",
18
+ preload: false,
19
+ sources: [
20
+ {
21
+ filename: INTER_SRC,
22
+ weight: "100 900",
23
+ style: "normal"
24
+ }
25
+ ]
26
+ };
27
+ const interLocalFont = createLocalFontOptions(
28
+ interFont,
29
+ import.meta.url
30
+ );
31
+ export {
32
+ interFont,
33
+ interLocalFont
34
+ };
@@ -0,0 +1,6 @@
1
+ import { ThemeFontDefinition, NextLocalFontOptions } from './types.js';
2
+
3
+ declare const pretendardFont: ThemeFontDefinition;
4
+ declare const pretendardLocalFont: NextLocalFontOptions;
5
+
6
+ export { pretendardFont, pretendardLocalFont };
@@ -0,0 +1,36 @@
1
+ import { createLocalFontOptions } from "./types";
2
+ const PRETENDARD_SRC = "../../fonts/pretendard-jp/PretendardJPVariable.woff2";
3
+ const pretendardFont = {
4
+ name: "PretendardJPVariable",
5
+ family: "Pretendard JP Variable",
6
+ cssVariable: "--theme-font-family-pretendard",
7
+ fallbacks: [
8
+ "Pretendard Variable",
9
+ "Pretendard",
10
+ "Inter",
11
+ "-apple-system",
12
+ "BlinkMacSystemFont",
13
+ "Segoe UI",
14
+ "Apple SD Gothic Neo",
15
+ "Noto Sans KR",
16
+ "Malgun Gothic",
17
+ "sans-serif"
18
+ ],
19
+ display: "swap",
20
+ preload: true,
21
+ sources: [
22
+ {
23
+ filename: PRETENDARD_SRC,
24
+ weight: "100 900",
25
+ style: "normal"
26
+ }
27
+ ]
28
+ };
29
+ const pretendardLocalFont = createLocalFontOptions(
30
+ pretendardFont,
31
+ import.meta.url
32
+ );
33
+ export {
34
+ pretendardFont,
35
+ pretendardLocalFont
36
+ };
@@ -0,0 +1,30 @@
1
+ type ThemeFontStyle = "normal" | "italic";
2
+ type ThemeFontDisplay = "auto" | "block" | "swap" | "fallback" | "optional";
3
+ interface ThemeFontSource {
4
+ filename: string;
5
+ weight: string;
6
+ style: ThemeFontStyle;
7
+ }
8
+ interface ThemeFontDefinition {
9
+ name: string;
10
+ family: string;
11
+ cssVariable: string;
12
+ fallbacks: string[];
13
+ display?: ThemeFontDisplay;
14
+ preload?: boolean;
15
+ sources: readonly ThemeFontSource[];
16
+ }
17
+ interface NextLocalFontOptions {
18
+ variable: string;
19
+ display?: ThemeFontDisplay;
20
+ fallback: string[];
21
+ preload?: boolean;
22
+ src: ReadonlyArray<{
23
+ path: string;
24
+ weight: string;
25
+ style: ThemeFontStyle;
26
+ }>;
27
+ }
28
+ declare function createLocalFontOptions(font: ThemeFontDefinition, metaUrl: string): NextLocalFontOptions;
29
+
30
+ export { type NextLocalFontOptions, type ThemeFontDefinition, type ThemeFontDisplay, type ThemeFontSource, type ThemeFontStyle, createLocalFontOptions };
@@ -0,0 +1,16 @@
1
+ function createLocalFontOptions(font, metaUrl) {
2
+ return {
3
+ variable: font.cssVariable,
4
+ display: font.display,
5
+ fallback: font.fallbacks,
6
+ preload: font.preload,
7
+ src: font.sources.map((source) => ({
8
+ path: new URL(source.filename, metaUrl).pathname,
9
+ weight: source.weight,
10
+ style: source.style
11
+ }))
12
+ };
13
+ }
14
+ export {
15
+ createLocalFontOptions
16
+ };
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@uniai-fe/uds-foundation",
3
+ "version": "0.0.1",
4
+ "description": "UNIAI Design System; Design Foundation Package",
5
+ "type": "module",
6
+ "private": false,
7
+ "sideEffects": [
8
+ "./dist/index.css"
9
+ ],
10
+ "license": "MIT",
11
+ "homepage": "https://www.uniai.co.kr/",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "packageManager": "pnpm@10.25.0",
16
+ "engines": {
17
+ "node": ">=24",
18
+ "pnpm": ">=10"
19
+ },
20
+ "author": {
21
+ "name": "GraffitoRyu",
22
+ "email": "yth4135@naver.com",
23
+ "url": "https://github.com/GraffitoRyu"
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "main": "./dist/index.js",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "./typography/fonts": {
38
+ "types": "./dist/typography/fonts/index.d.ts",
39
+ "import": "./dist/typography/fonts/index.js",
40
+ "default": "./dist/typography/fonts/index.js"
41
+ },
42
+ "./typography/fonts/types": {
43
+ "types": "./dist/typography/fonts/types.d.ts",
44
+ "import": "./dist/typography/fonts/types.js",
45
+ "default": "./dist/typography/fonts/types.js"
46
+ },
47
+ "./typography/fonts/pretendard": {
48
+ "types": "./dist/typography/fonts/pretendard.d.ts",
49
+ "import": "./dist/typography/fonts/pretendard.js",
50
+ "default": "./dist/typography/fonts/pretendard.js"
51
+ },
52
+ "./typography/fonts/inter": {
53
+ "types": "./dist/typography/fonts/inter.d.ts",
54
+ "import": "./dist/typography/fonts/inter.js",
55
+ "default": "./dist/typography/fonts/inter.js"
56
+ },
57
+ "./data/tokens": {
58
+ "types": "./dist/data/tokens.d.ts",
59
+ "import": "./dist/data/tokens.js",
60
+ "default": "./dist/data/tokens.js"
61
+ },
62
+ "./helpers": {
63
+ "types": "./dist/helpers/index.d.ts",
64
+ "import": "./dist/helpers/index.js",
65
+ "default": "./dist/helpers/index.js"
66
+ },
67
+ "./types/theme-tokens": {
68
+ "types": "./dist/types/theme-tokens.d.ts",
69
+ "import": "./dist/types/theme-tokens.js",
70
+ "default": "./dist/types/theme-tokens.js"
71
+ },
72
+ "./css": "./dist/index.css"
73
+ },
74
+ "scripts": {
75
+ "format": "prettier --write .",
76
+ "format:check": "prettier --check .",
77
+ "build": "pnpm format && pnpm typecheck && pnpm tsup && pnpm css:build && pnpm assets:fonts",
78
+ "typecheck": "tsc --project tsconfig.build.json --noEmit",
79
+ "css:build": "pnpm css:compile && pnpm css:post",
80
+ "css:compile": "sass src/index.scss dist/index.css --style=expanded --no-source-map",
81
+ "css:post": "postcss dist/index.css --config postcss.config.mjs --replace",
82
+ "assets:fonts": "node ./scripts/copy-fonts.mjs",
83
+ "dev": "node ../../../scripts/tsup-watch-filter.mjs --watch",
84
+ "tokens:doc": "node ./scripts/generate-tokens-doc.mjs",
85
+ "module:typecheck": "pnpm typecheck",
86
+ "module:build": "pnpm build",
87
+ "module:dev": "pnpm dev",
88
+ "foundation:build": "pnpm run build",
89
+ "foundation:dev": "pnpm run dev"
90
+ },
91
+ "devDependencies": {
92
+ "@types/node": "^24.10.2",
93
+ "@uniai-fe/tsconfig": "workspace:*",
94
+ "autoprefixer": "^10.4.22",
95
+ "postcss": "^8.5.6",
96
+ "postcss-cli": "^11.0.1",
97
+ "prettier": "^3.7.4",
98
+ "sass": "^1.95.0",
99
+ "tsup": "^8.5.1",
100
+ "typescript": "~5.9.3"
101
+ }
102
+ }