@softium/styles 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sunghoon Lee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @softium/styles
2
+
3
+ Shared design tokens (CSS custom properties) + base theme for all softium-ui
4
+ packages. Light/dark mode included. No JavaScript.
5
+
6
+ Part of [softium-ui](https://github.com/HOONY-LEE/softium-ui).
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm i @softium/styles
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ Import once at your app entry:
17
+
18
+ ```ts
19
+ import '@softium/styles';
20
+ ```
21
+
22
+ This defines the `--sft-*` custom properties (colors, spacing, radii, z-index,
23
+ typography), the dark theme, and a minimal opt-in base layer. Component
24
+ packages (`@softium/table-styles`, `@softium/calendar`, `@softium/ui`) already
25
+ inline these tokens into their own stylesheets, so you only import this
26
+ directly if you're building custom UI on the same token system.
27
+
28
+ Subpath entries are available if you want just one layer:
29
+
30
+ ```ts
31
+ import '@softium/styles/tokens.css';
32
+ import '@softium/styles/theme.css';
33
+ import '@softium/styles/base.css';
34
+ ```
35
+
36
+ ## Dark mode
37
+
38
+ Automatic via `prefers-color-scheme`, or force it with `<html data-theme="dark">`
39
+ (or `data-theme="light"` to lock light).
40
+
41
+ ## License
42
+
43
+ MIT © Sunghoon Lee
package/index.css ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * softium-ui shared styles — single import.
3
+ *
4
+ * import '@softium/styles';
5
+ *
6
+ * Design tokens + dark theme + a minimal opt-in base layer.
7
+ */
8
+
9
+ @import "./src/tokens.css";
10
+ @import "./src/theme.css";
11
+ @import "./src/base.css";
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@softium/styles",
3
+ "version": "0.1.0",
4
+ "description": "Shared design tokens (CSS custom properties) + base theme for all softium-ui packages. Dark mode included.",
5
+ "license": "MIT",
6
+ "author": "Sunghoon Lee",
7
+ "homepage": "https://github.com/HOONY-LEE/softium-ui/tree/main/packages/styles#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/HOONY-LEE/softium-ui.git",
11
+ "directory": "packages/styles"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/HOONY-LEE/softium-ui/issues"
15
+ },
16
+ "keywords": [
17
+ "css",
18
+ "design-tokens",
19
+ "theme",
20
+ "dark-mode",
21
+ "erp",
22
+ "softium-ui"
23
+ ],
24
+ "sideEffects": [
25
+ "*.css"
26
+ ],
27
+ "files": [
28
+ "src",
29
+ "index.css",
30
+ "LICENSE"
31
+ ],
32
+ "main": "index.css",
33
+ "exports": {
34
+ ".": "./index.css",
35
+ "./tokens.css": "./src/tokens.css",
36
+ "./theme.css": "./src/theme.css",
37
+ "./base.css": "./src/base.css"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ }
42
+ }
package/src/base.css ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * softium-ui — minimal base layer (opt-in).
3
+ *
4
+ * Only sets sane defaults scoped to the app shell, not a global reset, so dropping
5
+ * the library into an existing app doesn't fight the host's own resets.
6
+ */
7
+
8
+ .sft-app {
9
+ color: var(--sft-color-text);
10
+ background: var(--sft-color-bg);
11
+ font-family: var(--sft-font-family);
12
+ font-size: var(--sft-font-size-md);
13
+ line-height: var(--sft-line-height);
14
+ -webkit-font-smoothing: antialiased;
15
+ transition: background var(--sft-duration-base) var(--sft-ease), color var(--sft-duration-base)
16
+ var(--sft-ease);
17
+ }
18
+
19
+ .sft-app *,
20
+ .sft-app *::before,
21
+ .sft-app *::after {
22
+ box-sizing: border-box;
23
+ }
package/src/theme.css ADDED
@@ -0,0 +1,58 @@
1
+ /**
2
+ * softium-ui — dark theme overrides (shared)
3
+ *
4
+ * Two activation paths:
5
+ * 1. Explicit: <html data-theme="dark"> (host controls the toggle)
6
+ * 2. Automatic: prefers-color-scheme, only when the host hasn't forced a theme
7
+ *
8
+ * Dark mode re-points the SAME `--sft-*` tokens — components never branch on theme.
9
+ */
10
+
11
+ [data-theme="dark"] {
12
+ --sft-color-bg: #16181d;
13
+ --sft-color-bg-subtle: #1c1f26;
14
+ --sft-color-bg-hover: #232730;
15
+ --sft-color-bg-selected: #1e2c4a;
16
+ --sft-color-surface: #1a1d23;
17
+ --sft-color-border: #2a2f38;
18
+ --sft-color-border-strong: #3a414d;
19
+
20
+ --sft-color-text: #eceef2;
21
+ --sft-color-text-secondary: #aab2bf;
22
+ --sft-color-text-muted: #6f7884;
23
+ --sft-color-text-on-accent: #ffffff;
24
+
25
+ --sft-color-accent: #5b8bff;
26
+ --sft-color-accent-hover: #6f9bff;
27
+ --sft-color-accent-subtle: #1e2c4a;
28
+ --sft-color-danger: #ff6166;
29
+ --sft-color-success: #46c98a;
30
+ --sft-color-warning: #f5b542;
31
+
32
+ --sft-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
33
+ --sft-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
34
+ --sft-shadow-overlay: 0 8px 28px rgba(0, 0, 0, 0.55);
35
+ }
36
+
37
+ @media (prefers-color-scheme: dark) {
38
+ :root:not([data-theme="light"]):not([data-theme="dark"]) {
39
+ --sft-color-bg: #16181d;
40
+ --sft-color-bg-subtle: #1c1f26;
41
+ --sft-color-bg-hover: #232730;
42
+ --sft-color-bg-selected: #1e2c4a;
43
+ --sft-color-surface: #1a1d23;
44
+ --sft-color-border: #2a2f38;
45
+ --sft-color-border-strong: #3a414d;
46
+
47
+ --sft-color-text: #eceef2;
48
+ --sft-color-text-secondary: #aab2bf;
49
+ --sft-color-text-muted: #6f7884;
50
+
51
+ --sft-color-accent: #5b8bff;
52
+ --sft-color-accent-hover: #6f9bff;
53
+ --sft-color-accent-subtle: #1e2c4a;
54
+ --sft-color-danger: #ff6166;
55
+ --sft-color-success: #46c98a;
56
+ --sft-color-warning: #f5b542;
57
+ }
58
+ }
package/src/tokens.css ADDED
@@ -0,0 +1,81 @@
1
+ /**
2
+ * softium-ui — shared design tokens
3
+ *
4
+ * Theme via CSS custom properties only (no Tailwind hard-dependency, AG-Grid style).
5
+ * Every visual value across the libraries resolves to one of these `--sft-*` vars,
6
+ * so a host app re-skins everything by overriding tokens — nothing else.
7
+ *
8
+ * Naming follows an Apple-adjacent / Phosphor convention: semantic over literal.
9
+ * Package-specific tokens (e.g. `--sft-table-*`) live in their own package.
10
+ */
11
+
12
+ :root {
13
+ /* ── color: neutral ramp ─────────────────────────────── */
14
+ --sft-color-bg: #ffffff;
15
+ --sft-color-bg-subtle: #f7f8fa;
16
+ --sft-color-bg-hover: #f0f2f5;
17
+ --sft-color-bg-selected: #eaf2ff;
18
+ --sft-color-surface: #ffffff;
19
+ --sft-color-border: #e3e6ea;
20
+ --sft-color-border-strong: #c9ced6;
21
+
22
+ /* ── color: text ─────────────────────────────────────── */
23
+ --sft-color-text: #1d2127;
24
+ --sft-color-text-secondary: #5b6470;
25
+ --sft-color-text-muted: #8a93a0;
26
+ --sft-color-text-on-accent: #ffffff;
27
+
28
+ /* ── color: accent / state ───────────────────────────── */
29
+ --sft-color-accent: #2f6bff;
30
+ --sft-color-accent-hover: #1f57e6;
31
+ --sft-color-accent-subtle: #eaf2ff;
32
+ --sft-color-danger: #e5484d;
33
+ --sft-color-success: #30a46c;
34
+ --sft-color-warning: #f2a31b;
35
+
36
+ /* ── typography ──────────────────────────────────────── */
37
+ --sft-font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto,
38
+ "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
39
+ --sft-font-family-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
40
+ --sft-font-size-xs: 11px;
41
+ --sft-font-size-sm: 12px;
42
+ --sft-font-size-md: 13px;
43
+ --sft-font-size-lg: 15px;
44
+ --sft-font-size-xl: 20px;
45
+ --sft-font-weight-regular: 400;
46
+ --sft-font-weight-medium: 500;
47
+ --sft-font-weight-bold: 600;
48
+ --sft-line-height: 1.45;
49
+
50
+ /* ── spacing (4px base) ──────────────────────────────── */
51
+ --sft-space-1: 4px;
52
+ --sft-space-2: 8px;
53
+ --sft-space-3: 12px;
54
+ --sft-space-4: 16px;
55
+ --sft-space-5: 24px;
56
+ --sft-space-6: 32px;
57
+ --sft-space-7: 48px;
58
+ --sft-space-8: 64px;
59
+
60
+ /* ── radius ──────────────────────────────────────────── */
61
+ --sft-radius-sm: 4px;
62
+ --sft-radius-md: 8px;
63
+ --sft-radius-lg: 12px;
64
+ --sft-radius-full: 9999px;
65
+
66
+ /* ── elevation ───────────────────────────────────────── */
67
+ --sft-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
68
+ --sft-shadow-md: 0 4px 12px rgba(16, 24, 40, 0.1);
69
+ --sft-shadow-overlay: 0 8px 28px rgba(16, 24, 40, 0.16);
70
+
71
+ /* ── motion ──────────────────────────────────────────── */
72
+ --sft-duration-fast: 120ms;
73
+ --sft-duration-base: 200ms;
74
+ --sft-ease: cubic-bezier(0.2, 0, 0, 1);
75
+
76
+ /* ── shared z-index scale ────────────────────────────── */
77
+ --sft-z-header: 2;
78
+ --sft-z-pinned: 3;
79
+ --sft-z-overlay: 10;
80
+ --sft-z-modal: 100;
81
+ }