@wintermuted/ui-theme 0.21.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 +131 -0
- package/index.css +6 -0
- package/index.js +1 -0
- package/package.json +73 -0
- package/styles/base.css +145 -0
- package/styles/components/badge.css +17 -0
- package/styles/components/button.css +319 -0
- package/styles/components/card.css +92 -0
- package/styles/components/chart.css +54 -0
- package/styles/components/checkbox-filter.css +69 -0
- package/styles/components/code-block.css +89 -0
- package/styles/components/empty-state.css +29 -0
- package/styles/components/file-upload.css +29 -0
- package/styles/components/gallery.css +286 -0
- package/styles/components/inline-panel.css +53 -0
- package/styles/components/layout.css +525 -0
- package/styles/components/list.css +27 -0
- package/styles/components/modal.css +92 -0
- package/styles/components/separator.css +7 -0
- package/styles/components/side-nav.css +56 -0
- package/styles/components/slider.css +155 -0
- package/styles/components/stat-card.css +82 -0
- package/styles/components/tab-bar.css +175 -0
- package/styles/components/tag.css +29 -0
- package/styles/components/toast.css +120 -0
- package/styles/components/toggle-group.css +124 -0
- package/styles/components/toggle.css +116 -0
- package/styles/components/view-header.css +60 -0
- package/styles/components.css +25 -0
- package/styles/tokens.css +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Onnyeholt
|
|
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,131 @@
|
|
|
1
|
+
# `@wintermuted/ui-theme`
|
|
2
|
+
|
|
3
|
+
Shared design tokens and base component styles for Wintermuted projects.
|
|
4
|
+
|
|
5
|
+
The package is derived from the styling language introduced in the CV project and extracts the reusable parts of that system so application repositories can depend on a single source of truth instead of copying CSS.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
### npmjs
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @wintermuted/ui-theme
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### GitHub repository release
|
|
16
|
+
|
|
17
|
+
If you prefer to consume the package directly from GitHub without GitHub Packages auth, install from a tagged release:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install github:wintermuted/ui-theme#v0.1.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Includes
|
|
24
|
+
|
|
25
|
+
- Core color, spacing, radius, shadow, and typography tokens
|
|
26
|
+
- Base document and form-control styling
|
|
27
|
+
- Shared surface, button, badge, tag, list, separator, and side-nav primitives
|
|
28
|
+
- Light and dark theme variables via `[data-theme="dark"]`
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### Full Theme (single import)
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import "@wintermuted/ui-theme";
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then use the exported CSS variables in application styles:
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
.app-shell {
|
|
42
|
+
color: var(--wm-color-text);
|
|
43
|
+
background: var(--wm-color-surface);
|
|
44
|
+
border: 1px solid var(--wm-color-border);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Modular Imports (factor by need)
|
|
49
|
+
|
|
50
|
+
Import only the slices you need. Most component files require tokens, and many apps also want base element styles.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import "@wintermuted/ui-theme/styles/tokens.css";
|
|
54
|
+
import "@wintermuted/ui-theme/styles/base.css";
|
|
55
|
+
import "@wintermuted/ui-theme/styles/components/button.css";
|
|
56
|
+
import "@wintermuted/ui-theme/styles/components/card.css";
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Available modular entry points:
|
|
60
|
+
|
|
61
|
+
- `@wintermuted/ui-theme/styles/tokens.css`
|
|
62
|
+
- `@wintermuted/ui-theme/styles/base.css`
|
|
63
|
+
- `@wintermuted/ui-theme/styles/components.css` (all components)
|
|
64
|
+
- `@wintermuted/ui-theme/styles/components/button.css`
|
|
65
|
+
- `@wintermuted/ui-theme/styles/components/card.css`
|
|
66
|
+
- `@wintermuted/ui-theme/styles/components/badge.css`
|
|
67
|
+
- `@wintermuted/ui-theme/styles/components/tag.css`
|
|
68
|
+
- `@wintermuted/ui-theme/styles/components/list.css`
|
|
69
|
+
- `@wintermuted/ui-theme/styles/components/separator.css`
|
|
70
|
+
- `@wintermuted/ui-theme/styles/components/side-nav.css`
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Static Design System Test Page
|
|
74
|
+
|
|
75
|
+
This repo includes a static showcase app for validating common component scenarios.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm run showcase:serve
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Then open `http://localhost:4174/showcase/`.
|
|
82
|
+
|
|
83
|
+
The showcase includes:
|
|
84
|
+
|
|
85
|
+
- Light and dark theme toggle
|
|
86
|
+
- Buttons, badges, cards, and alerts
|
|
87
|
+
- Form controls and focus states
|
|
88
|
+
- A representative data table
|
|
89
|
+
|
|
90
|
+
Files:
|
|
91
|
+
|
|
92
|
+
- `showcase/index.html`
|
|
93
|
+
- `showcase/showcase.css`
|
|
94
|
+
|
|
95
|
+
## Local Symlink Workflow (No Publish Step)
|
|
96
|
+
|
|
97
|
+
Use npm link to symlink this theme into local consuming apps so style changes appear immediately.
|
|
98
|
+
|
|
99
|
+
From this repo:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run link:local -- <consumer-path> [consumer-path-2 ...]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Workspace example:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm run link:local -- ../sub-killer ../cv
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
When done testing, revert consumers back to normal package resolution:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm run unlink:local -- ../sub-killer ../cv
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Scripts:
|
|
118
|
+
|
|
119
|
+
- `scripts/link-local.sh`
|
|
120
|
+
- `scripts/unlink-local.sh`
|
|
121
|
+
## Publishing
|
|
122
|
+
|
|
123
|
+
- Merges to main trigger auto-release, which bumps the minor version in package.json, creates a matching vX.Y.Z tag, and creates a GitHub release.
|
|
124
|
+
- Tag pushes matching v* trigger the publish workflow, which publishes to npmjs using npm provenance.
|
|
125
|
+
- Set the NPM_TOKEN repository secret with an npm automation token before running the workflow.
|
|
126
|
+
|
|
127
|
+
## Notes
|
|
128
|
+
|
|
129
|
+
- The package intentionally avoids application-specific layout opinions.
|
|
130
|
+
- Projects should keep product-specific selectors and layout rules in their own repositories.
|
|
131
|
+
- Publishing is handled through GitHub Actions to npmjs.
|
package/index.css
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.css";
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wintermuted/ui-theme",
|
|
3
|
+
"version": "0.21.0",
|
|
4
|
+
"description": "Shared Wintermuted UI theme derived from the CV styling language.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"css",
|
|
10
|
+
"design-system",
|
|
11
|
+
"theme",
|
|
12
|
+
"ui"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
"index.js",
|
|
16
|
+
"index.css",
|
|
17
|
+
"styles/**/*.css",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/wintermuted/ui-theme.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/wintermuted/ui-theme/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/wintermuted/ui-theme#readme",
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"registry": "https://registry.npmjs.org",
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./index.js",
|
|
35
|
+
"./index.css": "./index.css",
|
|
36
|
+
"./styles/tokens.css": "./styles/tokens.css",
|
|
37
|
+
"./styles/base.css": "./styles/base.css",
|
|
38
|
+
"./styles/components.css": "./styles/components.css",
|
|
39
|
+
"./styles/components/card.css": "./styles/components/card.css",
|
|
40
|
+
"./styles/components/button.css": "./styles/components/button.css",
|
|
41
|
+
"./styles/components/badge.css": "./styles/components/badge.css",
|
|
42
|
+
"./styles/components/tag.css": "./styles/components/tag.css",
|
|
43
|
+
"./styles/components/list.css": "./styles/components/list.css",
|
|
44
|
+
"./styles/components/separator.css": "./styles/components/separator.css",
|
|
45
|
+
"./styles/components/side-nav.css": "./styles/components/side-nav.css",
|
|
46
|
+
"./styles/components/stat-card.css": "./styles/components/stat-card.css",
|
|
47
|
+
"./styles/components/tab-bar.css": "./styles/components/tab-bar.css",
|
|
48
|
+
"./styles/components/modal.css": "./styles/components/modal.css",
|
|
49
|
+
"./styles/components/empty-state.css": "./styles/components/empty-state.css",
|
|
50
|
+
"./styles/components/file-upload.css": "./styles/components/file-upload.css",
|
|
51
|
+
"./styles/components/view-header.css": "./styles/components/view-header.css",
|
|
52
|
+
"./styles/components/layout.css": "./styles/components/layout.css",
|
|
53
|
+
"./styles/components/inline-panel.css": "./styles/components/inline-panel.css",
|
|
54
|
+
"./styles/components/checkbox-filter.css": "./styles/components/checkbox-filter.css",
|
|
55
|
+
"./styles/components/chart.css": "./styles/components/chart.css",
|
|
56
|
+
"./styles/components/gallery.css": "./styles/components/gallery.css",
|
|
57
|
+
"./styles/components/toggle.css": "./styles/components/toggle.css",
|
|
58
|
+
"./styles/components/slider.css": "./styles/components/slider.css",
|
|
59
|
+
"./styles/components/toggle-group.css": "./styles/components/toggle-group.css",
|
|
60
|
+
"./styles/components/toast.css": "./styles/components/toast.css",
|
|
61
|
+
"./styles/components/code-block.css": "./styles/components/code-block.css"
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"showcase:serve": "python3 -m http.server 4174",
|
|
65
|
+
"link:local": "bash scripts/link-local.sh",
|
|
66
|
+
"unlink:local": "bash scripts/unlink-local.sh",
|
|
67
|
+
"lint": "stylelint \"styles/**/*.css\" \"index.css\""
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"stylelint": "^17.10.0",
|
|
71
|
+
"stylelint-config-standard": "^40.0.0"
|
|
72
|
+
}
|
|
73
|
+
}
|
package/styles/base.css
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* Base document and element styles. */
|
|
2
|
+
|
|
3
|
+
*,
|
|
4
|
+
*::before,
|
|
5
|
+
*::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html {
|
|
10
|
+
font-size: 16px;
|
|
11
|
+
text-size-adjust: 100%;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
font-family: var(--wm-font-sans);
|
|
19
|
+
color: var(--wm-color-text);
|
|
20
|
+
background:
|
|
21
|
+
radial-gradient(circle at top, rgb(42 74 138 / 8%), transparent 32rem),
|
|
22
|
+
linear-gradient(180deg, var(--wm-color-surface-muted) 0%, var(--wm-color-bg) 18rem);
|
|
23
|
+
line-height: 1.6;
|
|
24
|
+
transition: color 0.2s ease, background 0.2s ease;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
::selection {
|
|
28
|
+
background: var(--wm-color-accent-soft);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
a {
|
|
32
|
+
color: var(--wm-color-text);
|
|
33
|
+
text-decoration: underline;
|
|
34
|
+
text-decoration-color: var(--wm-color-link-underline);
|
|
35
|
+
text-underline-offset: 0.15em;
|
|
36
|
+
transition: text-decoration-color 0.15s ease, color 0.2s ease;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
a:hover {
|
|
40
|
+
text-decoration-color: var(--wm-color-text);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
button,
|
|
44
|
+
input,
|
|
45
|
+
select,
|
|
46
|
+
textarea {
|
|
47
|
+
font: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
button {
|
|
51
|
+
color: inherit;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
input,
|
|
55
|
+
select,
|
|
56
|
+
textarea {
|
|
57
|
+
width: 100%;
|
|
58
|
+
color: var(--wm-color-text);
|
|
59
|
+
background: var(--wm-color-bg);
|
|
60
|
+
border: 1px solid var(--wm-color-border-strong);
|
|
61
|
+
border-radius: var(--wm-radius-xs);
|
|
62
|
+
padding: 0.7rem 0.85rem;
|
|
63
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
input:focus,
|
|
67
|
+
select:focus,
|
|
68
|
+
textarea:focus {
|
|
69
|
+
outline: none;
|
|
70
|
+
border-color: var(--wm-color-accent);
|
|
71
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--wm-color-accent) 12%, transparent);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
input::placeholder,
|
|
75
|
+
textarea::placeholder {
|
|
76
|
+
color: var(--wm-color-text-faint);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
h1,
|
|
80
|
+
h2,
|
|
81
|
+
h3,
|
|
82
|
+
h4,
|
|
83
|
+
h5,
|
|
84
|
+
h6 {
|
|
85
|
+
margin: 0;
|
|
86
|
+
line-height: 1.2;
|
|
87
|
+
font-weight: 500;
|
|
88
|
+
letter-spacing: -0.01em;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
h1 {
|
|
92
|
+
font-size: clamp(2rem, 4vw, 3rem);
|
|
93
|
+
font-weight: 400;
|
|
94
|
+
letter-spacing: -0.03em;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
h2 {
|
|
98
|
+
font-size: 0.76rem;
|
|
99
|
+
text-transform: uppercase;
|
|
100
|
+
letter-spacing: 0.12em;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
h3 {
|
|
104
|
+
font-size: 1.05rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
p {
|
|
108
|
+
margin: 0;
|
|
109
|
+
color: var(--wm-color-text-secondary);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
table {
|
|
113
|
+
width: 100%;
|
|
114
|
+
border-collapse: collapse;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.table-responsive {
|
|
118
|
+
width: 100%;
|
|
119
|
+
overflow-x: auto;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
th,
|
|
123
|
+
td {
|
|
124
|
+
text-align: left;
|
|
125
|
+
padding: 0.8rem 0.9rem;
|
|
126
|
+
border-bottom: 1px solid var(--wm-color-border);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
th {
|
|
130
|
+
font-size: 0.72rem;
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
text-transform: uppercase;
|
|
133
|
+
letter-spacing: 0.08em;
|
|
134
|
+
color: var(--wm-color-text-muted);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:not(pre) > code {
|
|
138
|
+
font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace;
|
|
139
|
+
font-size: 0.8em;
|
|
140
|
+
background: var(--wm-color-surface-strong);
|
|
141
|
+
color: var(--wm-color-accent);
|
|
142
|
+
padding: 0.15em 0.4em;
|
|
143
|
+
border-radius: var(--wm-radius-xs);
|
|
144
|
+
border: 1px solid var(--wm-color-border);
|
|
145
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* Badge primitive. */
|
|
2
|
+
|
|
3
|
+
.badge,
|
|
4
|
+
.wm-badge {
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 0.3rem;
|
|
8
|
+
padding: 0.22rem 0.65rem;
|
|
9
|
+
border: 1px solid var(--wm-color-border);
|
|
10
|
+
border-radius: var(--wm-radius-pill);
|
|
11
|
+
background: var(--wm-color-surface-muted);
|
|
12
|
+
color: var(--wm-color-text-secondary);
|
|
13
|
+
font-size: 0.7rem;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
letter-spacing: 0.06em;
|
|
16
|
+
text-transform: uppercase;
|
|
17
|
+
}
|