@nqlib/nqui 0.5.4 → 0.5.6
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/dist/components/custom/rating.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +1 -6
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/hooks/use-resolved-theme.d.ts +1 -1
- package/dist/nqui.cjs.js +23 -26
- package/dist/nqui.es.js +661 -687
- package/dist/styles.css +60 -72
- package/package.json +1 -1
- package/scripts/build-styles.js +31 -3
- package/scripts/publish-npmjs.js +29 -0
package/dist/styles.css
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
/* Custom dark mode variant - matches when .dark class is on element or ancestor */
|
|
78
|
-
/* Non-dark
|
|
78
|
+
/* Non-dark theme — .light (warm paper) uses light: utilities */
|
|
79
79
|
/* Hit-area — https://bazza.dev/craft/2026/hit-area */
|
|
80
80
|
/* Bazza hit-area utilities — https://bazza.dev/craft/2026/hit-area */
|
|
81
81
|
|
|
@@ -792,7 +792,7 @@
|
|
|
792
792
|
nqui Additional System Variables
|
|
793
793
|
============================================ */
|
|
794
794
|
|
|
795
|
-
/* Default light theme variables (.
|
|
795
|
+
/* Default light theme variables (.dark block follows) */
|
|
796
796
|
/* ============================================
|
|
797
797
|
nqui Color System & Design Tokens
|
|
798
798
|
============================================ */
|
|
@@ -957,13 +957,13 @@
|
|
|
957
957
|
--z-debug: 9999;
|
|
958
958
|
|
|
959
959
|
/* Color system variables from colors.css */
|
|
960
|
-
/* Primary scale —
|
|
961
|
-
--primary-100: oklch(0.
|
|
962
|
-
--primary-200: oklch(0.
|
|
963
|
-
--primary-300: oklch(0.
|
|
964
|
-
--primary-400: oklch(0.
|
|
965
|
-
--primary-500: oklch(0.
|
|
966
|
-
--primary-600: oklch(0.
|
|
960
|
+
/* Primary scale — blue hue 240; toned down vs prior (lower L / slightly less chroma on saturated stops) */
|
|
961
|
+
--primary-100: oklch(0.655 0.11 240);
|
|
962
|
+
--primary-200: oklch(0.655 0.135 240);
|
|
963
|
+
--primary-300: oklch(0.655 0.155 240);
|
|
964
|
+
--primary-400: oklch(0.655 0.172 240);
|
|
965
|
+
--primary-500: oklch(0.605 0.215 240);
|
|
966
|
+
--primary-600: oklch(0.575 0.238 240);
|
|
967
967
|
|
|
968
968
|
/* ============================================
|
|
969
969
|
Semantic Color Scales — classic light (success / warning / danger / info)
|
|
@@ -1023,21 +1023,23 @@
|
|
|
1023
1023
|
--info-foreground: oklch(0.98 0 0);
|
|
1024
1024
|
|
|
1025
1025
|
/* Additional variables from index.css */
|
|
1026
|
-
/* Light / system UI — warm paper */
|
|
1027
|
-
--background: oklch(0.
|
|
1026
|
+
/* Light / system UI — Claude-adjacent warm paper (#FAF9F5 ≈ oklch(0.982 0.0054 95)) */
|
|
1027
|
+
--background: oklch(0.982 0.0054 95);
|
|
1028
1028
|
--foreground: oklch(0.2416 0.0219 57);
|
|
1029
|
-
|
|
1029
|
+
/* Surfaces: stepped darker than page bg for readable elevation */
|
|
1030
|
+
--card: oklch(0.966 0.0054 95);
|
|
1030
1031
|
--card-foreground: oklch(0.2416 0.0219 57);
|
|
1031
|
-
--popover: oklch(0.
|
|
1032
|
+
--popover: oklch(0.966 0.0054 95);
|
|
1032
1033
|
--popover-foreground: oklch(0.2416 0.0219 57);
|
|
1033
|
-
--secondary: oklch(0.
|
|
1034
|
+
--secondary: oklch(0.928 0.008 95);
|
|
1034
1035
|
--secondary-foreground: oklch(0.3067 0.0309 56.81);
|
|
1035
|
-
--muted: oklch(0.
|
|
1036
|
+
--muted: oklch(0.914 0.007 95);
|
|
1036
1037
|
--muted-foreground: oklch(0.5576 0.0222 57.81);
|
|
1037
|
-
|
|
1038
|
+
/* Slightly deeper than sidebar/card so row hovers read on pale paper */
|
|
1039
|
+
--accent: oklch(0.932 0.007 95);
|
|
1038
1040
|
--accent-foreground: oklch(0.2416 0.0219 57);
|
|
1039
|
-
--border: oklch(0.
|
|
1040
|
-
--input: oklch(0.
|
|
1041
|
+
--border: oklch(0.892 0.006 95);
|
|
1042
|
+
--input: oklch(0.892 0.006 95);
|
|
1041
1043
|
|
|
1042
1044
|
/* Chart colors */
|
|
1043
1045
|
--chart-1: oklch(0.809 0.105 251.813);
|
|
@@ -1049,49 +1051,14 @@
|
|
|
1049
1051
|
/* Layout */
|
|
1050
1052
|
--radius: 0.45rem;
|
|
1051
1053
|
|
|
1052
|
-
/* Sidebar */
|
|
1053
|
-
--sidebar: oklch(0.
|
|
1054
|
+
/* Sidebar — darker than page so rail + row hovers read clearly */
|
|
1055
|
+
--sidebar: oklch(0.953 0.006 95);
|
|
1054
1056
|
--sidebar-foreground: oklch(0.2416 0.0219 57);
|
|
1055
1057
|
--sidebar-primary: var(--primary);
|
|
1056
1058
|
--sidebar-primary-foreground: var(--primary-foreground);
|
|
1057
|
-
--sidebar-accent: oklch(0.
|
|
1059
|
+
--sidebar-accent: oklch(0.904 0.009 95);
|
|
1058
1060
|
--sidebar-accent-foreground: oklch(0.205 0.015 55);
|
|
1059
|
-
--sidebar-border: oklch(0.
|
|
1060
|
-
--sidebar-ring: var(--ring);
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
/* Mid — between warm paper and dark (neutral, slightly dimmer than light) */
|
|
1064
|
-
.mid {
|
|
1065
|
-
--background: oklch(0.915 0.01 78);
|
|
1066
|
-
--foreground: oklch(0.28 0.022 57);
|
|
1067
|
-
--card: oklch(0.895 0.012 78);
|
|
1068
|
-
--card-foreground: oklch(0.28 0.022 57);
|
|
1069
|
-
--popover: oklch(0.895 0.012 78);
|
|
1070
|
-
--popover-foreground: oklch(0.28 0.022 57);
|
|
1071
|
-
--secondary: oklch(0.88 0.012 73);
|
|
1072
|
-
--secondary-foreground: oklch(0.32 0.028 57);
|
|
1073
|
-
--muted: oklch(0.855 0.012 73);
|
|
1074
|
-
--muted-foreground: oklch(0.48 0.024 58);
|
|
1075
|
-
--accent: oklch(0.87 0.014 73);
|
|
1076
|
-
--accent-foreground: oklch(0.28 0.022 57);
|
|
1077
|
-
--border: oklch(0.82 0.016 73);
|
|
1078
|
-
--input: oklch(0.82 0.016 73);
|
|
1079
|
-
|
|
1080
|
-
--chart-1: oklch(0.809 0.105 251.813);
|
|
1081
|
-
--chart-2: oklch(0.623 0.214 259.815);
|
|
1082
|
-
--chart-3: oklch(0.546 0.245 262.881);
|
|
1083
|
-
--chart-4: oklch(0.488 0.243 264.376);
|
|
1084
|
-
--chart-5: oklch(0.424 0.199 265.638);
|
|
1085
|
-
|
|
1086
|
-
--radius: 0.45rem;
|
|
1087
|
-
|
|
1088
|
-
--sidebar: oklch(0.9 0.01 78);
|
|
1089
|
-
--sidebar-foreground: oklch(0.28 0.022 57);
|
|
1090
|
-
--sidebar-primary: var(--primary);
|
|
1091
|
-
--sidebar-primary-foreground: var(--primary-foreground);
|
|
1092
|
-
--sidebar-accent: oklch(0.875 0.012 75);
|
|
1093
|
-
--sidebar-accent-foreground: oklch(0.26 0.018 55);
|
|
1094
|
-
--sidebar-border: oklch(0.82 0.016 73);
|
|
1061
|
+
--sidebar-border: oklch(0.878 0.007 95);
|
|
1095
1062
|
--sidebar-ring: var(--ring);
|
|
1096
1063
|
}
|
|
1097
1064
|
|
|
@@ -1102,12 +1069,13 @@
|
|
|
1102
1069
|
============================================ */
|
|
1103
1070
|
|
|
1104
1071
|
/* Primary Color Scale (Dark Mode) - Blue Theme (Hue 240) */
|
|
1105
|
-
|
|
1106
|
-
--primary-
|
|
1107
|
-
--primary-
|
|
1108
|
-
--primary-
|
|
1109
|
-
--primary-
|
|
1110
|
-
--primary-
|
|
1072
|
+
/* Dark UI: keep blues subdued (lower L on 500/600); high chroma + high L reads “neon” on #111 */
|
|
1073
|
+
--primary-100: oklch(0.30 0.14 240);
|
|
1074
|
+
--primary-200: oklch(0.34 0.165 240);
|
|
1075
|
+
--primary-300: oklch(0.385 0.185 240);
|
|
1076
|
+
--primary-400: oklch(0.435 0.198 240);
|
|
1077
|
+
--primary-500: oklch(0.515 0.168 240); /* --primary: deeper accent blue */
|
|
1078
|
+
--primary-600: oklch(0.565 0.185 240);
|
|
1111
1079
|
|
|
1112
1080
|
/* ============================================
|
|
1113
1081
|
Semantic Color Scales - Dark Mode
|
|
@@ -1177,14 +1145,14 @@
|
|
|
1177
1145
|
--card-foreground: oklch(0.92 0 0);
|
|
1178
1146
|
--popover: oklch(0.205 0 0);
|
|
1179
1147
|
--popover-foreground: oklch(0.92 0 0);
|
|
1180
|
-
--secondary: oklch(0.274 0.
|
|
1148
|
+
--secondary: oklch(0.274 0.003 0);
|
|
1181
1149
|
--secondary-foreground: oklch(0.92 0 0);
|
|
1182
|
-
--muted: oklch(0.24 0 0);
|
|
1150
|
+
--muted: oklch(0.24 0.002 0);
|
|
1183
1151
|
--muted-foreground: oklch(0.708 0 0);
|
|
1184
|
-
--accent: oklch(0.27 0 0);
|
|
1152
|
+
--accent: oklch(0.27 0.003 0);
|
|
1185
1153
|
--accent-foreground: oklch(0.92 0 0);
|
|
1186
|
-
--border: oklch(
|
|
1187
|
-
--input: oklch(
|
|
1154
|
+
--border: oklch(0.34 0.004 0);
|
|
1155
|
+
--input: oklch(0.30 0.003 0);
|
|
1188
1156
|
|
|
1189
1157
|
/* Chart colors (same for both modes) */
|
|
1190
1158
|
--chart-1: oklch(0.809 0.105 251.813);
|
|
@@ -1194,12 +1162,32 @@
|
|
|
1194
1162
|
--chart-5: oklch(0.424 0.199 265.638);
|
|
1195
1163
|
|
|
1196
1164
|
/* Sidebar for dark mode */
|
|
1197
|
-
--sidebar: oklch(0.205 0 0);
|
|
1165
|
+
--sidebar: oklch(0.205 0.001 0);
|
|
1198
1166
|
--sidebar-foreground: oklch(0.92 0 0);
|
|
1199
1167
|
--sidebar-primary: var(--primary);
|
|
1200
1168
|
--sidebar-primary-foreground: var(--primary-foreground);
|
|
1201
|
-
--sidebar-accent: oklch(0.269 0 0);
|
|
1169
|
+
--sidebar-accent: oklch(0.269 0.003 0);
|
|
1202
1170
|
--sidebar-accent-foreground: oklch(0.92 0 0);
|
|
1203
|
-
--sidebar-border: oklch(
|
|
1171
|
+
--sidebar-border: oklch(0.34 0.004 0);
|
|
1204
1172
|
--sidebar-ring: oklch(0.556 0 0);
|
|
1205
|
-
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/* Elevation component styles from elevation.css */
|
|
1176
|
+
/**
|
|
1177
|
+
* Card surface elevation — semantic --border + light shadow stack.
|
|
1178
|
+
* Dark mode matches v0.4.x (no inset / multi-stack drop shadows).
|
|
1179
|
+
* Lives here with the elevation system (was JS-injected from card.tsx).
|
|
1180
|
+
*/
|
|
1181
|
+
.nqui-card {
|
|
1182
|
+
border: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
|
|
1183
|
+
box-shadow:
|
|
1184
|
+
0 1px 0 0 color-mix(in oklch, var(--border) 40%, transparent),
|
|
1185
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.05);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.dark .nqui-card {
|
|
1189
|
+
border: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
|
|
1190
|
+
box-shadow:
|
|
1191
|
+
0 1px 0 0 color-mix(in oklch, var(--border) 40%, transparent),
|
|
1192
|
+
0 1px 2px 0 oklch(0 0 0 / 0.3);
|
|
1193
|
+
}
|
package/package.json
CHANGED
package/scripts/build-styles.js
CHANGED
|
@@ -22,6 +22,23 @@ const elevationCssPath = join(projectRoot, 'src', 'styles', 'elevation.css');
|
|
|
22
22
|
const hitAreaCssPath = join(projectRoot, 'src', 'styles', 'hit-area.css');
|
|
23
23
|
const outputPath = join(projectRoot, 'dist', 'styles.css');
|
|
24
24
|
|
|
25
|
+
function extractLayerBlock(css, layerName) {
|
|
26
|
+
const layerStart = css.indexOf(`@layer ${layerName}`);
|
|
27
|
+
if (layerStart === -1) return '';
|
|
28
|
+
const firstBrace = css.indexOf('{', layerStart);
|
|
29
|
+
if (firstBrace === -1) return '';
|
|
30
|
+
let depth = 1;
|
|
31
|
+
let i = firstBrace + 1;
|
|
32
|
+
while (i < css.length && depth > 0) {
|
|
33
|
+
const ch = css[i];
|
|
34
|
+
if (ch === '{') depth++;
|
|
35
|
+
if (ch === '}') depth--;
|
|
36
|
+
i++;
|
|
37
|
+
}
|
|
38
|
+
if (depth !== 0) return '';
|
|
39
|
+
return css.slice(firstBrace + 1, i - 1).trim();
|
|
40
|
+
}
|
|
41
|
+
|
|
25
42
|
function extractStandaloneCSS() {
|
|
26
43
|
// Read the source CSS files
|
|
27
44
|
if (!existsSync(indexCssPath)) {
|
|
@@ -47,15 +64,22 @@ function extractStandaloneCSS() {
|
|
|
47
64
|
|
|
48
65
|
// Extract :root block from elevation.css (it's wrapped in @layer base)
|
|
49
66
|
let elevationRootContent = '';
|
|
67
|
+
let elevationComponentContent = '';
|
|
50
68
|
if (elevationCss) {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
69
|
+
const elevationBaseLayer = extractLayerBlock(elevationCss, 'base');
|
|
70
|
+
if (elevationBaseLayer) {
|
|
71
|
+
const elevationRootMatch = elevationBaseLayer.match(/:root\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s);
|
|
72
|
+
if (elevationRootMatch) {
|
|
73
|
+
elevationRootContent = elevationRootMatch[1].trim();
|
|
74
|
+
}
|
|
54
75
|
} else {
|
|
55
76
|
// Fallback: try to extract without @layer base wrapper
|
|
56
77
|
const rootMatch = elevationCss.match(/:root\s*\{([^}]+(?:\{[^}]*\}[^}]*)*)\}/s);
|
|
57
78
|
if (rootMatch) elevationRootContent = rootMatch[1].trim();
|
|
58
79
|
}
|
|
80
|
+
|
|
81
|
+
// Keep component-level elevation classes (e.g. .nqui-card) in dist/styles.css.
|
|
82
|
+
elevationComponentContent = extractLayerBlock(elevationCss, 'components');
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
// Extract :root and .dark blocks from colors.css (they're wrapped in @layer base)
|
|
@@ -229,6 +253,10 @@ function extractStandaloneCSS() {
|
|
|
229
253
|
combinedCss.slice(rootIndex);
|
|
230
254
|
}
|
|
231
255
|
|
|
256
|
+
if (elevationComponentContent) {
|
|
257
|
+
combinedCss += '\n\n/* Elevation component styles from elevation.css */\n' + elevationComponentContent + '\n';
|
|
258
|
+
}
|
|
259
|
+
|
|
232
260
|
// Clean up extra blank lines
|
|
233
261
|
combinedCss = combinedCss.replace(/\n{4,}/g, '\n\n\n');
|
|
234
262
|
|
package/scripts/publish-npmjs.js
CHANGED
|
@@ -27,6 +27,23 @@ function printSslTroubleshooting() {
|
|
|
27
27
|
`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function isVersionAlreadyPublished(pkgName, version, cwd) {
|
|
31
|
+
try {
|
|
32
|
+
const result = execSync(`npm view ${pkgName}@${version} version --registry=https://registry.npmjs.com`, {
|
|
33
|
+
encoding: 'utf-8',
|
|
34
|
+
cwd,
|
|
35
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
36
|
+
}).trim();
|
|
37
|
+
return result === version;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const errText = `${error?.message || ''} ${error?.stderr?.toString?.() || ''}`;
|
|
40
|
+
if (errText.includes('404') || errText.includes('E404')) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
async function main() {
|
|
31
48
|
// Read package.json
|
|
32
49
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
@@ -94,6 +111,14 @@ async function main() {
|
|
|
94
111
|
npm_config_registry: 'https://registry.npmjs.com',
|
|
95
112
|
};
|
|
96
113
|
|
|
114
|
+
const pkgName = packageJson.name;
|
|
115
|
+
const pkgVersion = packageJson.version;
|
|
116
|
+
if (isVersionAlreadyPublished(pkgName, pkgVersion, rootDir)) {
|
|
117
|
+
throw new Error(
|
|
118
|
+
`Version ${pkgVersion} is already published for ${pkgName}. Bump package.json version before publishing (e.g. npm version patch --no-git-tag-version).`
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
97
122
|
const maxAttempts = Math.min(
|
|
98
123
|
5,
|
|
99
124
|
Math.max(1, parseInt(process.env.NPM_PUBLISH_RETRIES || '3', 10) || 3)
|
|
@@ -142,6 +167,10 @@ async function main() {
|
|
|
142
167
|
if (error.message && error.message.includes('Authentication required')) {
|
|
143
168
|
throw error;
|
|
144
169
|
}
|
|
170
|
+
if (error.message && error.message.includes('already published')) {
|
|
171
|
+
console.error(`💡 ${error.message}`);
|
|
172
|
+
throw error;
|
|
173
|
+
}
|
|
145
174
|
const errText = `${error.message || ''} ${(error.output && error.output.toString()) || ''}`;
|
|
146
175
|
if (error.status === 404 || errText.includes('404')) {
|
|
147
176
|
console.error('💡 Package not found. This might be the first publish.');
|