@mortenbrudvik/waveui 0.4.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 +262 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2438 -0
- package/dist/index.mjs +5695 -0
- package/package.json +100 -0
- package/src/styles/animations.css +39 -0
- package/src/styles/globals.css +22 -0
- package/src/styles/tokens.css +221 -0
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mortenbrudvik/waveui",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A comprehensive React component library with modern design tokens — accessible, composable components built with TypeScript and Tailwind CSS",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/waveui/wave-ui-react.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/waveui/wave-ui-react#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/waveui/wave-ui-react/issues"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20.19.0"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"react",
|
|
20
|
+
"component-library",
|
|
21
|
+
"waveui",
|
|
22
|
+
"design-system",
|
|
23
|
+
"typescript",
|
|
24
|
+
"tailwind",
|
|
25
|
+
"accessible"
|
|
26
|
+
],
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"*.css"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.cjs",
|
|
31
|
+
"module": "./dist/index.mjs",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs",
|
|
37
|
+
"require": "./dist/index.cjs"
|
|
38
|
+
},
|
|
39
|
+
"./styles": "./src/styles/globals.css",
|
|
40
|
+
"./tokens": "./src/styles/tokens.css"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"dist",
|
|
44
|
+
"src/styles"
|
|
45
|
+
],
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "storybook dev -p 6006",
|
|
48
|
+
"build": "tsc --noEmit && vite build",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"test:coverage": "vitest run --coverage",
|
|
52
|
+
"storybook": "storybook dev -p 6006",
|
|
53
|
+
"build-storybook": "storybook build",
|
|
54
|
+
"typecheck": "tsc --noEmit",
|
|
55
|
+
"lint": "eslint src/ stories/",
|
|
56
|
+
"lint:fix": "eslint src/ stories/ --fix",
|
|
57
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"stories/**/*.{ts,tsx}\"",
|
|
58
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\" \"stories/**/*.{ts,tsx}\"",
|
|
59
|
+
"prepublishOnly": "npm run build && npm test"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "^19.0.0",
|
|
63
|
+
"react-dom": "^19.0.0"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"clsx": "^2.1.1",
|
|
67
|
+
"tailwind-merge": "^3.5.0"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@eslint/js": "^10.0.1",
|
|
71
|
+
"@storybook/addon-a11y": "^10.2.19",
|
|
72
|
+
"@storybook/react": "^10.2.19",
|
|
73
|
+
"@storybook/react-vite": "^10.2.19",
|
|
74
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
75
|
+
"@testing-library/dom": "^10.4.1",
|
|
76
|
+
"@testing-library/jest-dom": "^6.6.0",
|
|
77
|
+
"@testing-library/react": "^16.3.2",
|
|
78
|
+
"@testing-library/user-event": "^14.6.1",
|
|
79
|
+
"@types/react": "^19.2.14",
|
|
80
|
+
"@types/react-dom": "^19.2.3",
|
|
81
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
82
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
83
|
+
"ajv": "^8.18.0",
|
|
84
|
+
"eslint": "^10.0.3",
|
|
85
|
+
"eslint-config-prettier": "^10.1.8",
|
|
86
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
87
|
+
"jsdom": "^29.0.0",
|
|
88
|
+
"prettier": "^3.8.1",
|
|
89
|
+
"react": "^19.2.4",
|
|
90
|
+
"react-dom": "^19.2.4",
|
|
91
|
+
"storybook": "^10.2.19",
|
|
92
|
+
"tailwindcss": "^4.2.1",
|
|
93
|
+
"typescript": "^5.7.0",
|
|
94
|
+
"typescript-eslint": "^8.57.1",
|
|
95
|
+
"vite": "^8.0.0",
|
|
96
|
+
"vite-plugin-dts": "^4.5.4",
|
|
97
|
+
"vitest": "^4.1.0",
|
|
98
|
+
"vitest-axe": "^0.1.0"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@keyframes wave-spin {
|
|
2
|
+
from {
|
|
3
|
+
transform: rotate(0deg);
|
|
4
|
+
}
|
|
5
|
+
to {
|
|
6
|
+
transform: rotate(360deg);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@keyframes wave-pulse {
|
|
11
|
+
0%,
|
|
12
|
+
100% {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
50% {
|
|
16
|
+
opacity: 0.4;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes wave-indeterminate {
|
|
21
|
+
0% {
|
|
22
|
+
transform: translateX(-100%);
|
|
23
|
+
}
|
|
24
|
+
100% {
|
|
25
|
+
transform: translateX(350%);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Respect user preference for reduced motion (WCAG 2.1 SC 2.3.3) */
|
|
30
|
+
@media (prefers-reduced-motion: reduce) {
|
|
31
|
+
*,
|
|
32
|
+
*::before,
|
|
33
|
+
*::after {
|
|
34
|
+
animation-duration: 0.01ms !important;
|
|
35
|
+
animation-iteration-count: 1 !important;
|
|
36
|
+
transition-duration: 0.01ms !important;
|
|
37
|
+
scroll-behavior: auto !important;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@import './tokens.css';
|
|
3
|
+
@import './animations.css';
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
body {
|
|
7
|
+
font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system,
|
|
8
|
+
BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
|
|
9
|
+
color: var(--foreground);
|
|
10
|
+
background-color: var(--background);
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
-webkit-font-smoothing: antialiased;
|
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
*,
|
|
18
|
+
*::before,
|
|
19
|
+
*::after {
|
|
20
|
+
border-color: var(--border);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Light theme colors */
|
|
3
|
+
--background: #ffffff;
|
|
4
|
+
--foreground: #242424;
|
|
5
|
+
--card: #fafafa;
|
|
6
|
+
--primary: #0f6cbd;
|
|
7
|
+
--secondary: #f5f5f5;
|
|
8
|
+
--muted: #f0f0f0;
|
|
9
|
+
--muted-foreground: #707070;
|
|
10
|
+
--accent: #0f6cbd;
|
|
11
|
+
--destructive: #c50f1f;
|
|
12
|
+
--subtle: transparent;
|
|
13
|
+
--border: #e0e0e0;
|
|
14
|
+
--input: #d1d1d1;
|
|
15
|
+
--ring: #0f6cbd;
|
|
16
|
+
|
|
17
|
+
/* Foreground on colored backgrounds */
|
|
18
|
+
--primary-foreground: #ffffff;
|
|
19
|
+
--destructive-foreground: #ffffff;
|
|
20
|
+
--accent-foreground: #ffffff;
|
|
21
|
+
--card-foreground: var(--foreground);
|
|
22
|
+
--secondary-foreground: var(--foreground);
|
|
23
|
+
|
|
24
|
+
/* Semantic / status colors */
|
|
25
|
+
--success: #107c10;
|
|
26
|
+
--warning: #fde300;
|
|
27
|
+
--error: #c50f1f;
|
|
28
|
+
--info: #0f6cbd;
|
|
29
|
+
--severe: #da3b01;
|
|
30
|
+
|
|
31
|
+
/* Brand ramp */
|
|
32
|
+
--brand-10: #061724;
|
|
33
|
+
--brand-20: #082338;
|
|
34
|
+
--brand-30: #0a2e4a;
|
|
35
|
+
--brand-40: #0c3b5e;
|
|
36
|
+
--brand-50: #0e4775;
|
|
37
|
+
--brand-60: #0f548c;
|
|
38
|
+
--brand-70: #115ea3;
|
|
39
|
+
--brand-80: #0f6cbd;
|
|
40
|
+
--brand-90: #2886de;
|
|
41
|
+
--brand-100: #479ef5;
|
|
42
|
+
--brand-110: #62abf5;
|
|
43
|
+
--brand-120: #77b7f7;
|
|
44
|
+
--brand-130: #96c6fa;
|
|
45
|
+
--brand-140: #b4d6fa;
|
|
46
|
+
--brand-150: #cfe4fa;
|
|
47
|
+
--brand-160: #ebf3fc;
|
|
48
|
+
|
|
49
|
+
/* Neutral grey palette */
|
|
50
|
+
--grey-2: #050505;
|
|
51
|
+
--grey-4: #0a0a0a;
|
|
52
|
+
--grey-6: #0f0f0f;
|
|
53
|
+
--grey-8: #141414;
|
|
54
|
+
--grey-10: #1a1a1a;
|
|
55
|
+
--grey-12: #1f1f1f;
|
|
56
|
+
--grey-14: #242424;
|
|
57
|
+
--grey-16: #292929;
|
|
58
|
+
--grey-20: #333333;
|
|
59
|
+
--grey-24: #3d3d3d;
|
|
60
|
+
--grey-26: #424242;
|
|
61
|
+
--grey-30: #4d4d4d;
|
|
62
|
+
--grey-34: #575757;
|
|
63
|
+
--grey-38: #616161;
|
|
64
|
+
--grey-40: #666666;
|
|
65
|
+
--grey-44: #707070;
|
|
66
|
+
--grey-50: #808080;
|
|
67
|
+
--grey-60: #999999;
|
|
68
|
+
--grey-68: #adadad;
|
|
69
|
+
--grey-74: #bdbdbd;
|
|
70
|
+
--grey-78: #c7c7c7;
|
|
71
|
+
--grey-82: #d1d1d1;
|
|
72
|
+
--grey-86: #dbdbdb;
|
|
73
|
+
--grey-88: #e0e0e0;
|
|
74
|
+
--grey-90: #e6e6e6;
|
|
75
|
+
--grey-92: #ebebeb;
|
|
76
|
+
--grey-94: #f0f0f0;
|
|
77
|
+
--grey-96: #f5f5f5;
|
|
78
|
+
--grey-98: #fafafa;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Dark theme */
|
|
82
|
+
.dark {
|
|
83
|
+
--background: #292929;
|
|
84
|
+
--foreground: #ffffff;
|
|
85
|
+
--primary: #479ef5;
|
|
86
|
+
--secondary: #333333;
|
|
87
|
+
--muted: #383838;
|
|
88
|
+
--muted-foreground: #adadad;
|
|
89
|
+
--accent: #479ef5;
|
|
90
|
+
--card: #333333;
|
|
91
|
+
--destructive: #dc626d;
|
|
92
|
+
--border: #666666;
|
|
93
|
+
--input: #666666;
|
|
94
|
+
--ring: #479ef5;
|
|
95
|
+
--subtle: transparent;
|
|
96
|
+
--primary-foreground: #ffffff;
|
|
97
|
+
--destructive-foreground: #ffffff;
|
|
98
|
+
--accent-foreground: #ffffff;
|
|
99
|
+
--card-foreground: var(--foreground);
|
|
100
|
+
--secondary-foreground: var(--foreground);
|
|
101
|
+
--success: #54b054;
|
|
102
|
+
--warning: #fde300;
|
|
103
|
+
--error: #dc626d;
|
|
104
|
+
--info: #479ef5;
|
|
105
|
+
--severe: #e97548;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* High-contrast theme — WCAG AAA compliant */
|
|
109
|
+
.high-contrast {
|
|
110
|
+
--background: #000000;
|
|
111
|
+
--foreground: #ffffff;
|
|
112
|
+
--primary: #1aebff;
|
|
113
|
+
--secondary: #000000;
|
|
114
|
+
--muted: #1a1a1a;
|
|
115
|
+
--muted-foreground: #ffffff;
|
|
116
|
+
--accent: #1aebff;
|
|
117
|
+
--card: #000000;
|
|
118
|
+
--destructive: #ff6060;
|
|
119
|
+
--border: #ffffff;
|
|
120
|
+
--input: #ffffff;
|
|
121
|
+
--ring: #ffff00;
|
|
122
|
+
--subtle: transparent;
|
|
123
|
+
--success: #3ff23f;
|
|
124
|
+
--warning: #ffff00;
|
|
125
|
+
--error: #ff6060;
|
|
126
|
+
--info: #1aebff;
|
|
127
|
+
--severe: #ff8c00;
|
|
128
|
+
|
|
129
|
+
/* Primary foreground needs to be black for contrast on cyan background */
|
|
130
|
+
--primary-foreground: #000000;
|
|
131
|
+
--destructive-foreground: #000000;
|
|
132
|
+
--accent-foreground: #000000;
|
|
133
|
+
--card-foreground: var(--foreground);
|
|
134
|
+
--secondary-foreground: var(--foreground);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* --- Tailwind 4 theme (replaces tailwind.config.ts) --- */
|
|
138
|
+
@theme inline {
|
|
139
|
+
/* Colors */
|
|
140
|
+
--color-border: var(--border);
|
|
141
|
+
--color-input: var(--input);
|
|
142
|
+
--color-ring: var(--ring);
|
|
143
|
+
--color-background: var(--background);
|
|
144
|
+
--color-foreground: var(--foreground);
|
|
145
|
+
--color-primary: var(--primary);
|
|
146
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
147
|
+
--color-secondary: var(--secondary);
|
|
148
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
149
|
+
--color-destructive: var(--destructive);
|
|
150
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
151
|
+
--color-muted: var(--muted);
|
|
152
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
153
|
+
--color-accent: var(--accent);
|
|
154
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
155
|
+
--color-card: var(--card);
|
|
156
|
+
--color-card-foreground: var(--card-foreground);
|
|
157
|
+
--color-subtle: var(--subtle);
|
|
158
|
+
--color-success: var(--success);
|
|
159
|
+
--color-warning: var(--warning);
|
|
160
|
+
--color-error: var(--error);
|
|
161
|
+
--color-info: var(--info);
|
|
162
|
+
--color-severe: var(--severe);
|
|
163
|
+
|
|
164
|
+
/* Font family */
|
|
165
|
+
--font-sans: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
|
|
166
|
+
|
|
167
|
+
/* Font sizes */
|
|
168
|
+
--text-caption-2: 10px;
|
|
169
|
+
--text-caption-2--line-height: 14px;
|
|
170
|
+
--text-caption-1: 12px;
|
|
171
|
+
--text-caption-1--line-height: 16px;
|
|
172
|
+
--text-body-1: 14px;
|
|
173
|
+
--text-body-1--line-height: 20px;
|
|
174
|
+
--text-body-2: 16px;
|
|
175
|
+
--text-body-2--line-height: 22px;
|
|
176
|
+
--text-subtitle-2: 16px;
|
|
177
|
+
--text-subtitle-2--line-height: 22px;
|
|
178
|
+
--text-subtitle-2--font-weight: 600;
|
|
179
|
+
--text-subtitle-1: 20px;
|
|
180
|
+
--text-subtitle-1--line-height: 28px;
|
|
181
|
+
--text-subtitle-1--font-weight: 600;
|
|
182
|
+
--text-title-3: 24px;
|
|
183
|
+
--text-title-3--line-height: 32px;
|
|
184
|
+
--text-title-3--font-weight: 600;
|
|
185
|
+
--text-title-2: 28px;
|
|
186
|
+
--text-title-2--line-height: 36px;
|
|
187
|
+
--text-title-2--font-weight: 600;
|
|
188
|
+
--text-title-1: 32px;
|
|
189
|
+
--text-title-1--line-height: 40px;
|
|
190
|
+
--text-title-1--font-weight: 600;
|
|
191
|
+
--text-large-title: 40px;
|
|
192
|
+
--text-large-title--line-height: 52px;
|
|
193
|
+
--text-large-title--font-weight: 600;
|
|
194
|
+
--text-display: 68px;
|
|
195
|
+
--text-display--line-height: 92px;
|
|
196
|
+
--text-display--font-weight: 600;
|
|
197
|
+
|
|
198
|
+
/* Border radius */
|
|
199
|
+
--radius-none: 0;
|
|
200
|
+
--radius-sm: 2px;
|
|
201
|
+
--radius-DEFAULT: 4px;
|
|
202
|
+
--radius-md: 4px;
|
|
203
|
+
--radius-lg: 6px;
|
|
204
|
+
--radius-xl: 8px;
|
|
205
|
+
--radius-2xl: 12px;
|
|
206
|
+
--radius-3xl: 16px;
|
|
207
|
+
--radius-full: 10000px;
|
|
208
|
+
|
|
209
|
+
/* Box shadows */
|
|
210
|
+
--shadow-2: 0 0 2px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.14);
|
|
211
|
+
--shadow-4: 0 0 2px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.14);
|
|
212
|
+
--shadow-8: 0 0 2px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.14);
|
|
213
|
+
--shadow-16: 0 0 2px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.14);
|
|
214
|
+
--shadow-28: 0 0 8px rgba(0,0,0,0.12), 0 14px 28px rgba(0,0,0,0.14);
|
|
215
|
+
--shadow-64: 0 0 8px rgba(0,0,0,0.12), 0 32px 64px rgba(0,0,0,0.14);
|
|
216
|
+
|
|
217
|
+
/* Animations */
|
|
218
|
+
--animate-wave-spin: wave-spin 0.8s linear infinite;
|
|
219
|
+
--animate-wave-pulse: wave-pulse 1.5s ease-in-out infinite;
|
|
220
|
+
--animate-wave-indeterminate: wave-indeterminate 1.5s ease-in-out infinite;
|
|
221
|
+
}
|