@nqlib/nqui 0.5.4 → 0.5.5
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 +660 -686
- package/dist/styles.css +41 -56
- 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
|
============================================ */
|
|
@@ -1026,18 +1026,18 @@
|
|
|
1026
1026
|
/* Light / system UI — warm paper */
|
|
1027
1027
|
--background: oklch(0.985 0.002 78);
|
|
1028
1028
|
--foreground: oklch(0.2416 0.0219 57);
|
|
1029
|
-
--card: oklch(0.
|
|
1029
|
+
--card: oklch(0.977 0.004 78);
|
|
1030
1030
|
--card-foreground: oklch(0.2416 0.0219 57);
|
|
1031
|
-
--popover: oklch(0.
|
|
1031
|
+
--popover: oklch(0.977 0.004 78);
|
|
1032
1032
|
--popover-foreground: oklch(0.2416 0.0219 57);
|
|
1033
|
-
--secondary: oklch(0.
|
|
1033
|
+
--secondary: oklch(0.928 0.008 78);
|
|
1034
1034
|
--secondary-foreground: oklch(0.3067 0.0309 56.81);
|
|
1035
|
-
--muted: oklch(0.
|
|
1035
|
+
--muted: oklch(0.914 0.007 78);
|
|
1036
1036
|
--muted-foreground: oklch(0.5576 0.0222 57.81);
|
|
1037
|
-
--accent: oklch(0.
|
|
1037
|
+
--accent: oklch(0.936 0.007 78);
|
|
1038
1038
|
--accent-foreground: oklch(0.2416 0.0219 57);
|
|
1039
|
-
--border: oklch(0.
|
|
1040
|
-
--input: oklch(0.
|
|
1039
|
+
--border: oklch(0.892 0.006 78);
|
|
1040
|
+
--input: oklch(0.892 0.006 78);
|
|
1041
1041
|
|
|
1042
1042
|
/* Chart colors */
|
|
1043
1043
|
--chart-1: oklch(0.809 0.105 251.813);
|
|
@@ -1050,48 +1050,13 @@
|
|
|
1050
1050
|
--radius: 0.45rem;
|
|
1051
1051
|
|
|
1052
1052
|
/* Sidebar */
|
|
1053
|
-
--sidebar: oklch(0.
|
|
1053
|
+
--sidebar: oklch(0.977 0.004 78);
|
|
1054
1054
|
--sidebar-foreground: oklch(0.2416 0.0219 57);
|
|
1055
1055
|
--sidebar-primary: var(--primary);
|
|
1056
1056
|
--sidebar-primary-foreground: var(--primary-foreground);
|
|
1057
|
-
--sidebar-accent: oklch(0.
|
|
1057
|
+
--sidebar-accent: oklch(0.962 0.006 78);
|
|
1058
1058
|
--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);
|
|
1059
|
+
--sidebar-border: oklch(0.892 0.006 78);
|
|
1095
1060
|
--sidebar-ring: var(--ring);
|
|
1096
1061
|
}
|
|
1097
1062
|
|
|
@@ -1177,14 +1142,14 @@
|
|
|
1177
1142
|
--card-foreground: oklch(0.92 0 0);
|
|
1178
1143
|
--popover: oklch(0.205 0 0);
|
|
1179
1144
|
--popover-foreground: oklch(0.92 0 0);
|
|
1180
|
-
--secondary: oklch(0.274 0.
|
|
1145
|
+
--secondary: oklch(0.274 0.003 0);
|
|
1181
1146
|
--secondary-foreground: oklch(0.92 0 0);
|
|
1182
|
-
--muted: oklch(0.24 0 0);
|
|
1147
|
+
--muted: oklch(0.24 0.002 0);
|
|
1183
1148
|
--muted-foreground: oklch(0.708 0 0);
|
|
1184
|
-
--accent: oklch(0.27 0 0);
|
|
1149
|
+
--accent: oklch(0.27 0.003 0);
|
|
1185
1150
|
--accent-foreground: oklch(0.92 0 0);
|
|
1186
|
-
--border: oklch(
|
|
1187
|
-
--input: oklch(
|
|
1151
|
+
--border: oklch(0.34 0.004 0);
|
|
1152
|
+
--input: oklch(0.30 0.003 0);
|
|
1188
1153
|
|
|
1189
1154
|
/* Chart colors (same for both modes) */
|
|
1190
1155
|
--chart-1: oklch(0.809 0.105 251.813);
|
|
@@ -1194,12 +1159,32 @@
|
|
|
1194
1159
|
--chart-5: oklch(0.424 0.199 265.638);
|
|
1195
1160
|
|
|
1196
1161
|
/* Sidebar for dark mode */
|
|
1197
|
-
--sidebar: oklch(0.205 0 0);
|
|
1162
|
+
--sidebar: oklch(0.205 0.001 0);
|
|
1198
1163
|
--sidebar-foreground: oklch(0.92 0 0);
|
|
1199
1164
|
--sidebar-primary: var(--primary);
|
|
1200
1165
|
--sidebar-primary-foreground: var(--primary-foreground);
|
|
1201
|
-
--sidebar-accent: oklch(0.269 0 0);
|
|
1166
|
+
--sidebar-accent: oklch(0.269 0.003 0);
|
|
1202
1167
|
--sidebar-accent-foreground: oklch(0.92 0 0);
|
|
1203
|
-
--sidebar-border: oklch(
|
|
1168
|
+
--sidebar-border: oklch(0.34 0.004 0);
|
|
1204
1169
|
--sidebar-ring: oklch(0.556 0 0);
|
|
1205
|
-
}
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/* Elevation component styles from elevation.css */
|
|
1173
|
+
/**
|
|
1174
|
+
* Card surface elevation — semantic --border + light shadow stack.
|
|
1175
|
+
* Dark mode matches v0.4.x (no inset / multi-stack drop shadows).
|
|
1176
|
+
* Lives here with the elevation system (was JS-injected from card.tsx).
|
|
1177
|
+
*/
|
|
1178
|
+
.nqui-card {
|
|
1179
|
+
border: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
|
|
1180
|
+
box-shadow:
|
|
1181
|
+
0 1px 0 0 color-mix(in oklch, var(--border) 40%, transparent),
|
|
1182
|
+
0 1px 2px 0 oklch(0.15 0 0 / 0.05);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.dark .nqui-card {
|
|
1186
|
+
border: 1px solid color-mix(in oklch, var(--border) 50%, transparent);
|
|
1187
|
+
box-shadow:
|
|
1188
|
+
0 1px 0 0 color-mix(in oklch, var(--border) 40%, transparent),
|
|
1189
|
+
0 1px 2px 0 oklch(0 0 0 / 0.3);
|
|
1190
|
+
}
|
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.');
|