@olundot/ui 0.1.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/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +31 -0
- package/dist/index.d.ts +976 -0
- package/dist/index.js +7313 -0
- package/dist/tailwind.preset.d.ts +18 -0
- package/dist/tailwind.preset.js +29 -0
- package/dist/tokens.css +73 -0
- package/package.json +80 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @olundot/ui Tailwind preset.
|
|
5
|
+
*
|
|
6
|
+
* This re-exports the canonical @olundot/tokens preset (single source of truth:
|
|
7
|
+
* packages/tokens/src/tailwind.preset.ts) and layers on UI-package-specific
|
|
8
|
+
* additions. Consuming `@olundot/ui/tailwind.preset` is therefore equivalent to
|
|
9
|
+
* consuming `@olundot/tokens/tailwind`, plus the UI extras below.
|
|
10
|
+
*
|
|
11
|
+
* Keep this file thin: anything that belongs to the design system at large
|
|
12
|
+
* (colors, fontFamily, borderRadius, boxShadow, darkMode, …) lives in the core
|
|
13
|
+
* preset and must NOT be duplicated here. Only add keys that are genuinely
|
|
14
|
+
* UI-package-specific.
|
|
15
|
+
*/
|
|
16
|
+
declare const preset: Partial<Config>;
|
|
17
|
+
|
|
18
|
+
export { preset as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// tailwind.preset.ts
|
|
2
|
+
import corePreset from "@olundot/tokens/tailwind";
|
|
3
|
+
var preset = {
|
|
4
|
+
...corePreset,
|
|
5
|
+
theme: {
|
|
6
|
+
...corePreset.theme,
|
|
7
|
+
extend: {
|
|
8
|
+
...corePreset.theme?.extend,
|
|
9
|
+
// ─── @olundot/ui-specific additions ──────────────────────────────
|
|
10
|
+
// `sans` alias → body font. The core preset names the brand body role
|
|
11
|
+
// `body` (not `sans`); this alias keeps `font-sans` consumers on the
|
|
12
|
+
// brand body font.
|
|
13
|
+
fontFamily: {
|
|
14
|
+
...corePreset.theme?.extend?.fontFamily,
|
|
15
|
+
sans: ["var(--font-body)"]
|
|
16
|
+
},
|
|
17
|
+
// tabular-nums via the `font-variant-numeric` plugin axis. Components
|
|
18
|
+
// mostly use the built-in `tabular-nums` utility directly, but this keeps
|
|
19
|
+
// the named role available for preset consumers.
|
|
20
|
+
fontVariantNumeric: {
|
|
21
|
+
tabular: "tabular-nums"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var tailwind_preset_default = preset;
|
|
27
|
+
export {
|
|
28
|
+
tailwind_preset_default as default
|
|
29
|
+
};
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @olundot/ui — OLUN token hub
|
|
3
|
+
*
|
|
4
|
+
* 앱에서는 이 파일만 import하면 토큰 CSS 변수 + Tailwind v4 매핑이 모두 적용됩니다.
|
|
5
|
+
*
|
|
6
|
+
* Usage (consumer global CSS):
|
|
7
|
+
* @import 'tailwindcss';
|
|
8
|
+
* @import '@olundot/ui/tokens.css';
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* 1. CSS custom properties (light/dark, semantic tokens) */
|
|
12
|
+
@import '@olundot/tokens/css';
|
|
13
|
+
|
|
14
|
+
/* 2. Tailwind v4 @theme inline mappings (runtime-reactive) */
|
|
15
|
+
@import '@olundot/tokens/tailwind/v4';
|
|
16
|
+
|
|
17
|
+
/* 3. UI package convenience aliases not exposed by @olundot/tokens/tailwind/v4.
|
|
18
|
+
* Keep these here because they are component-package utilities, not core
|
|
19
|
+
* token package API.
|
|
20
|
+
*/
|
|
21
|
+
@theme inline {
|
|
22
|
+
/* Action state overlays (mode-aware alpha overlays) */
|
|
23
|
+
--color-action-hover: var(--action-hover);
|
|
24
|
+
--color-action-selected: var(--action-selected);
|
|
25
|
+
--color-action-focus: var(--action-focus);
|
|
26
|
+
--color-action-active: var(--action-active);
|
|
27
|
+
|
|
28
|
+
/* Semantic aliases exposed for component package utilities. */
|
|
29
|
+
--color-semantic-error: var(--semantic-error);
|
|
30
|
+
--color-semantic-success: var(--semantic-success);
|
|
31
|
+
--color-semantic-warning: var(--semantic-warning);
|
|
32
|
+
--color-semantic-info: var(--semantic-info);
|
|
33
|
+
|
|
34
|
+
/* bg-base / text-base 충돌 방지용 alias.
|
|
35
|
+
* Tailwind에서 `text-base`는 font-size 예약어 → `text-bg-base`로 노출.
|
|
36
|
+
* 참고: tailwind-v4.css의 --color-base는 bg-base로는 작동하나, text-base는 font-size와 충돌.
|
|
37
|
+
*/
|
|
38
|
+
--color-base: initial;
|
|
39
|
+
--color-bg-base: var(--bg-base);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* color-scheme + `--semantic-*` aliases are now defined in the core
|
|
43
|
+
* @olundot/tokens SSOT (packages/tokens/src/tokens.css). They were previously
|
|
44
|
+
* patched here on `:root, :root[data-theme="light"]`, but `:root` always
|
|
45
|
+
* matches, so a dark toggle could never override `color-scheme: light`. The
|
|
46
|
+
* core token blocks set color-scheme per mode and declare --semantic-* once,
|
|
47
|
+
* unconditionally — removing the duplicate avoids cascade conflicts.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/* Org-namespaced brand tokens (client-specific)
|
|
51
|
+
* 패턴: --org-{slug}-{role}.
|
|
52
|
+
*
|
|
53
|
+
* tokens.css(token hub)에 정의 → @olundot/ui/tokens.css를 import하는 모든 app에서 자동 적용.
|
|
54
|
+
*
|
|
55
|
+
* Light-default system: plain :root carries the light value (JBNU Blue).
|
|
56
|
+
* Dark is the override on :root[data-theme="dark"] and the OS-prefers media
|
|
57
|
+
* block — mirroring the per-mode flip pattern of every other token. Without
|
|
58
|
+
* this, a first paint with no data-theme attribute showed the dark Wine color
|
|
59
|
+
* on a light background (light-default contract violation).
|
|
60
|
+
*/
|
|
61
|
+
:root {
|
|
62
|
+
--org-jbnu-emblem: #004387; /* JBNU Blue — light default */
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:root[data-theme="dark"] {
|
|
66
|
+
--org-jbnu-emblem: #a6165f; /* JBNU Wine — dark */
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (prefers-color-scheme: dark) {
|
|
70
|
+
:root:not([data-theme="light"]) {
|
|
71
|
+
--org-jbnu-emblem: #a6165f; /* JBNU Wine — OS-preferred dark */
|
|
72
|
+
}
|
|
73
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@olundot/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OLUN. shared React UI components built on OLUN design tokens",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"design-system",
|
|
8
|
+
"olun",
|
|
9
|
+
"react",
|
|
10
|
+
"tailwindcss",
|
|
11
|
+
"components",
|
|
12
|
+
"radix-ui"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://olun-design-system.vercel.app",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/armedical-dev/olun-design-system",
|
|
18
|
+
"directory": "packages/ui"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"**/*.css"
|
|
23
|
+
],
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"CHANGELOG.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./tokens.css": "./dist/tokens.css",
|
|
36
|
+
"./tailwind.preset": {
|
|
37
|
+
"types": "./dist/tailwind.preset.d.ts",
|
|
38
|
+
"import": "./dist/tailwind.preset.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"class-variance-authority": "^0.7.1",
|
|
43
|
+
"clsx": "^2.1.1",
|
|
44
|
+
"lucide-react": "^1.8.0",
|
|
45
|
+
"radix-ui": "^1.4.3",
|
|
46
|
+
"tailwind-merge": "^3.5.0",
|
|
47
|
+
"@olundot/tokens": "^0.6.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": ">=18",
|
|
51
|
+
"react-dom": ">=18",
|
|
52
|
+
"tailwindcss": ">=4"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"tailwindcss": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/node": "^24.10.0",
|
|
61
|
+
"@types/react": "^19.2.14",
|
|
62
|
+
"@types/react-dom": "^19.2.3",
|
|
63
|
+
"react": "^19.2.6",
|
|
64
|
+
"react-dom": "^19.2.6",
|
|
65
|
+
"tailwindcss": "^4.1.17",
|
|
66
|
+
"tsup": "^8.5.1",
|
|
67
|
+
"tsx": "^4.21.0",
|
|
68
|
+
"typescript": "^5.9.3"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsup",
|
|
75
|
+
"lint": "node scripts/verify-source-imports.mjs",
|
|
76
|
+
"test": "sh -c 'set -e; if [ \"$#\" -gt 0 ]; then for test_file in \"$@\"; do node --import tsx \"$test_file\"; done; else for test_file in src/components/ui/*.test.tsx; do node --import tsx \"$test_file\"; done; fi' --",
|
|
77
|
+
"test:accent-contracts": "node scripts/verify-accent-contracts.mjs",
|
|
78
|
+
"type-check": "tsc --noEmit"
|
|
79
|
+
}
|
|
80
|
+
}
|