@keenmate/pure-admin-core 2.1.0 → 2.2.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/README.md +9 -6
- package/dist/css/main.css +661 -7
- package/package.json +1 -1
- package/scripts/download-themes.js +83 -0
- package/snippets/alerts.html +19 -0
- package/snippets/cards.html +2 -3
- package/src/scss/_fonts.scss +36 -36
- package/src/scss/core-components/_alerts.scss +15 -0
- package/src/scss/core-components/_buttons.scss +24 -0
- package/src/scss/core-components/_callouts.scss +8 -0
- package/src/scss/core-components/_cards.scss +1 -6
- package/src/scss/core-components/_toasts.scss +93 -0
- package/src/scss/core-components/_utilities.scss +362 -362
- package/src/scss/core-components/layout/_sidebar.scss +2 -2
|
@@ -259,6 +259,89 @@ async function main() {
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
console.log(`\nDownloaded ${downloaded} theme(s), skipped ${localThemes.length} local path(s)`);
|
|
262
|
+
|
|
263
|
+
// Check compatibility with installed core version
|
|
264
|
+
checkCoreCompatibility();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Check if downloaded themes are compatible with the installed core version
|
|
269
|
+
*/
|
|
270
|
+
function checkCoreCompatibility() {
|
|
271
|
+
// Find installed core version
|
|
272
|
+
const corePkgPaths = [
|
|
273
|
+
path.join(PROJECT_ROOT, 'node_modules', '@keenmate', 'pure-admin-core', 'package.json'),
|
|
274
|
+
path.join(PROJECT_ROOT, '..', 'packages', 'core', 'package.json') // workspace
|
|
275
|
+
];
|
|
276
|
+
|
|
277
|
+
let coreVersion = null;
|
|
278
|
+
for (const p of corePkgPaths) {
|
|
279
|
+
if (fs.existsSync(p)) {
|
|
280
|
+
try {
|
|
281
|
+
const pkg = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
282
|
+
coreVersion = pkg.version;
|
|
283
|
+
break;
|
|
284
|
+
} catch (e) {}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!coreVersion) return;
|
|
289
|
+
|
|
290
|
+
// Check each downloaded theme
|
|
291
|
+
const warnings = [];
|
|
292
|
+
const themeDirs = fs.readdirSync(THEMES_DIR, { withFileTypes: true })
|
|
293
|
+
.filter(d => d.isDirectory())
|
|
294
|
+
.map(d => d.name);
|
|
295
|
+
|
|
296
|
+
for (const name of themeDirs) {
|
|
297
|
+
const manifestPath = path.join(THEMES_DIR, name, 'theme.json');
|
|
298
|
+
if (!fs.existsSync(manifestPath)) continue;
|
|
299
|
+
|
|
300
|
+
try {
|
|
301
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
302
|
+
const requiredCore = manifest.dependencies && manifest.dependencies.core;
|
|
303
|
+
if (!requiredCore) continue;
|
|
304
|
+
|
|
305
|
+
if (!satisfiesSemver(coreVersion, requiredCore)) {
|
|
306
|
+
warnings.push(` ${name} (v${manifest.version}) requires core ${requiredCore}, installed: ${coreVersion}`);
|
|
307
|
+
}
|
|
308
|
+
} catch (e) {}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (warnings.length > 0) {
|
|
312
|
+
console.log('\n⚠ Compatibility warnings:');
|
|
313
|
+
warnings.forEach(w => console.log(w));
|
|
314
|
+
console.log('\nConsider updating @keenmate/pure-admin-core');
|
|
315
|
+
} else if (themeDirs.length > 0) {
|
|
316
|
+
console.log(`\nAll themes compatible with core v${coreVersion}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Simple semver satisfaction check for ^major.minor.patch ranges
|
|
322
|
+
*/
|
|
323
|
+
function satisfiesSemver(version, range) {
|
|
324
|
+
// Parse version
|
|
325
|
+
const v = version.replace(/^v/, '').split('.').map(Number);
|
|
326
|
+
|
|
327
|
+
// Parse range (supports ^x.y.z and x.y.z)
|
|
328
|
+
const caret = range.startsWith('^');
|
|
329
|
+
const r = range.replace(/^[\^~]/, '').split('.').map(Number);
|
|
330
|
+
|
|
331
|
+
if (caret) {
|
|
332
|
+
// ^2.0.0 means >=2.0.0 <3.0.0
|
|
333
|
+
// ^0.2.0 means >=0.2.0 <0.3.0
|
|
334
|
+
if (r[0] > 0) {
|
|
335
|
+
return v[0] === r[0] && (v[1] > r[1] || (v[1] === r[1] && v[2] >= r[2]));
|
|
336
|
+
} else if (r[1] > 0) {
|
|
337
|
+
return v[0] === 0 && v[1] === r[1] && v[2] >= r[2];
|
|
338
|
+
} else {
|
|
339
|
+
return v[0] === 0 && v[1] === 0 && v[2] === r[2];
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Exact match
|
|
344
|
+
return v[0] === r[0] && v[1] === r[1] && v[2] === r[2];
|
|
262
345
|
}
|
|
263
346
|
|
|
264
347
|
console.log('Downloading themes...\n');
|
package/snippets/alerts.html
CHANGED
|
@@ -158,6 +158,21 @@
|
|
|
158
158
|
</div>
|
|
159
159
|
|
|
160
160
|
|
|
161
|
+
<!-- THEME COLOR ALERTS (color-1 through color-9) -->
|
|
162
|
+
|
|
163
|
+
<!-- Theme Color 1 Alert (filled) -->
|
|
164
|
+
<div class="pa-alert pa-alert--color-1">
|
|
165
|
+
<strong>Color 1!</strong> Theme color slot 1 alert.
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<!-- Theme Color 1 Alert (outline) -->
|
|
169
|
+
<div class="pa-alert pa-alert--outline-color-1">
|
|
170
|
+
<strong>Color 1 Outline!</strong> Theme color slot 1 outline alert.
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<!-- Pattern: pa-alert--color-{1-9} and pa-alert--outline-color-{1-9} -->
|
|
174
|
+
|
|
175
|
+
|
|
161
176
|
<!-- ALERT SIZES -->
|
|
162
177
|
|
|
163
178
|
<!-- Small Alert -->
|
|
@@ -235,6 +250,10 @@ OUTLINE VARIANTS (border only):
|
|
|
235
250
|
- .pa-alert--outline-warning: Orange outline
|
|
236
251
|
- .pa-alert--outline-info: Cyan outline
|
|
237
252
|
|
|
253
|
+
THEME COLOR VARIANTS (1-9):
|
|
254
|
+
- .pa-alert--color-{1-9}: Filled theme color slot
|
|
255
|
+
- .pa-alert--outline-color-{1-9}: Outline theme color slot
|
|
256
|
+
|
|
238
257
|
SIZES:
|
|
239
258
|
- .pa-alert--sm: Small alert (reduced padding and font)
|
|
240
259
|
- (default): Standard size
|
package/snippets/cards.html
CHANGED
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
<span class="pa-card__title-icon">📊</span>
|
|
177
177
|
<h3 class="pa-card__title-text">Analytics Dashboard</h3>
|
|
178
178
|
</div>
|
|
179
|
-
<div class="pa-
|
|
179
|
+
<div class="pa-card__actions">
|
|
180
180
|
<button class="pa-btn pa-btn--sm pa-btn--secondary">Refresh</button>
|
|
181
181
|
</div>
|
|
182
182
|
</div>
|
|
@@ -366,8 +366,7 @@ CARD ELEMENTS:
|
|
|
366
366
|
- .pa-card__title: Title container
|
|
367
367
|
- .pa-card__title-icon: Icon in title
|
|
368
368
|
- .pa-card__title-text: Title text
|
|
369
|
-
- .pa-
|
|
370
|
-
- .pa-card__actions: Actions container in footer
|
|
369
|
+
- .pa-card__actions: Actions container (used in header and footer)
|
|
371
370
|
|
|
372
371
|
CARD TABS:
|
|
373
372
|
- .pa-card__tabs: Tab container in header
|
package/src/scss/_fonts.scss
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/* Pure Admin Visual Framework - Default Font Definitions */
|
|
2
|
-
|
|
3
|
-
// Default framework fonts - themes can override these
|
|
4
|
-
// Note: Font size classes for <html> are in _utilities.scss (use px values for correct rem scaling)
|
|
5
|
-
|
|
6
|
-
// Font family classes with system defaults
|
|
7
|
-
.font-family-system {
|
|
8
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
9
|
-
|
|
10
|
-
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
11
|
-
font-family: inherit;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.font-family-sans {
|
|
16
|
-
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
17
|
-
|
|
18
|
-
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
19
|
-
font-family: inherit;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.font-family-serif {
|
|
24
|
-
font-family: Georgia, "Times New Roman", Times, serif;
|
|
25
|
-
|
|
26
|
-
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
27
|
-
font-family: inherit;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.font-family-mono {
|
|
32
|
-
font-family: "Courier New", Courier, monospace;
|
|
33
|
-
|
|
34
|
-
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
35
|
-
font-family: inherit;
|
|
36
|
-
}
|
|
1
|
+
/* Pure Admin Visual Framework - Default Font Definitions */
|
|
2
|
+
|
|
3
|
+
// Default framework fonts - themes can override these
|
|
4
|
+
// Note: Font size classes for <html> are in _utilities.scss (use px values for correct rem scaling)
|
|
5
|
+
|
|
6
|
+
// Font family classes with system defaults
|
|
7
|
+
.font-family-system {
|
|
8
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
9
|
+
|
|
10
|
+
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
11
|
+
font-family: inherit;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.font-family-sans {
|
|
16
|
+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
17
|
+
|
|
18
|
+
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
19
|
+
font-family: inherit;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.font-family-serif {
|
|
24
|
+
font-family: Georgia, "Times New Roman", Times, serif;
|
|
25
|
+
|
|
26
|
+
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
27
|
+
font-family: inherit;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.font-family-mono {
|
|
32
|
+
font-family: "Courier New", Courier, monospace;
|
|
33
|
+
|
|
34
|
+
*, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select {
|
|
35
|
+
font-family: inherit;
|
|
36
|
+
}
|
|
37
37
|
}
|
|
@@ -106,6 +106,21 @@
|
|
|
106
106
|
background-color: transparent;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
// Theme color slot variants (color-1 through color-9)
|
|
110
|
+
@for $i from 1 through 9 {
|
|
111
|
+
&--color-#{$i} {
|
|
112
|
+
color: var(--pa-color-#{$i}-text);
|
|
113
|
+
background-color: var(--pa-color-#{$i});
|
|
114
|
+
border-color: var(--pa-color-#{$i});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--outline-color-#{$i} {
|
|
118
|
+
color: var(--pa-color-#{$i});
|
|
119
|
+
border-color: var(--pa-color-#{$i});
|
|
120
|
+
background-color: transparent;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
109
124
|
// Alert sizes (size modifiers only change font-size, padding controlled by theme)
|
|
110
125
|
&--sm {
|
|
111
126
|
padding: $alert-padding-v $alert-padding-h;
|
|
@@ -204,6 +204,30 @@
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
// Theme color slot variants (color-1 through color-9)
|
|
208
|
+
@for $i from 1 through 9 {
|
|
209
|
+
&--color-#{$i} {
|
|
210
|
+
background-color: var(--pa-color-#{$i});
|
|
211
|
+
border-color: var(--pa-color-#{$i});
|
|
212
|
+
color: var(--pa-color-#{$i}-text);
|
|
213
|
+
|
|
214
|
+
&:hover {
|
|
215
|
+
filter: brightness($btn-hover-brightness);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&--outline-color-#{$i} {
|
|
220
|
+
background-color: transparent;
|
|
221
|
+
border-color: var(--pa-color-#{$i});
|
|
222
|
+
color: var(--pa-color-#{$i});
|
|
223
|
+
|
|
224
|
+
&:hover {
|
|
225
|
+
background-color: var(--pa-color-#{$i});
|
|
226
|
+
color: var(--pa-color-#{$i}-text);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
207
231
|
// Button states
|
|
208
232
|
&:disabled {
|
|
209
233
|
opacity: $btn-disabled-opacity;
|
|
@@ -54,6 +54,14 @@
|
|
|
54
54
|
background-color: var(--pa-info-bg-subtle);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// Theme color slot variants (color-1 through color-9)
|
|
58
|
+
@for $i from 1 through 9 {
|
|
59
|
+
&--color-#{$i} {
|
|
60
|
+
border-inline-start-color: var(--pa-color-#{$i});
|
|
61
|
+
background-color: color-mix(in srgb, var(--pa-color-#{$i}) 10%, transparent);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
// Callout sizes
|
|
58
66
|
&--sm {
|
|
59
67
|
padding: $spacing-sm $spacing-md;
|
|
@@ -228,15 +228,10 @@
|
|
|
228
228
|
align-items: center;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
&__tools {
|
|
232
|
-
display: flex;
|
|
233
|
-
gap: $spacing-sm;
|
|
234
|
-
align-items: center;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
231
|
&__actions {
|
|
238
232
|
display: flex;
|
|
239
233
|
gap: $spacing-sm;
|
|
234
|
+
align-items: center;
|
|
240
235
|
}
|
|
241
236
|
|
|
242
237
|
&__meta {
|
|
@@ -291,6 +291,99 @@
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
+
// Theme color slot variants (color-1 through color-9)
|
|
295
|
+
@for $i from 1 through 9 {
|
|
296
|
+
.pa-toast--color-#{$i} {
|
|
297
|
+
border-color: var(--pa-color-#{$i});
|
|
298
|
+
|
|
299
|
+
.pa-toast__icon {
|
|
300
|
+
background-color: color-mix(in srgb, var(--pa-color-#{$i}) 15%, transparent);
|
|
301
|
+
color: var(--pa-color-#{$i});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.pa-toast__progress {
|
|
305
|
+
color: var(--pa-color-#{$i});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// ===== FILLED TOAST VARIANTS =====
|
|
311
|
+
|
|
312
|
+
.pa-toast--filled-primary {
|
|
313
|
+
background-color: var(--pa-btn-primary-bg);
|
|
314
|
+
border-color: var(--pa-btn-primary-bg);
|
|
315
|
+
color: var(--pa-btn-primary-text);
|
|
316
|
+
|
|
317
|
+
.pa-toast__title,
|
|
318
|
+
.pa-toast__message { color: inherit; }
|
|
319
|
+
.pa-toast__icon { background-color: rgba(255, 255, 255, 0.2); color: inherit; }
|
|
320
|
+
.pa-toast__close { color: inherit; }
|
|
321
|
+
.pa-toast__progress { color: rgba(255, 255, 255, 0.5); }
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.pa-toast--filled-success {
|
|
325
|
+
background-color: var(--pa-btn-success-bg);
|
|
326
|
+
border-color: var(--pa-btn-success-bg);
|
|
327
|
+
color: var(--pa-btn-success-text);
|
|
328
|
+
|
|
329
|
+
.pa-toast__title,
|
|
330
|
+
.pa-toast__message { color: inherit; }
|
|
331
|
+
.pa-toast__icon { background-color: rgba(255, 255, 255, 0.2); color: inherit; }
|
|
332
|
+
.pa-toast__close { color: inherit; }
|
|
333
|
+
.pa-toast__progress { color: rgba(255, 255, 255, 0.5); }
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.pa-toast--filled-danger {
|
|
337
|
+
background-color: var(--pa-btn-danger-bg);
|
|
338
|
+
border-color: var(--pa-btn-danger-bg);
|
|
339
|
+
color: var(--pa-btn-danger-text);
|
|
340
|
+
|
|
341
|
+
.pa-toast__title,
|
|
342
|
+
.pa-toast__message { color: inherit; }
|
|
343
|
+
.pa-toast__icon { background-color: rgba(255, 255, 255, 0.2); color: inherit; }
|
|
344
|
+
.pa-toast__close { color: inherit; }
|
|
345
|
+
.pa-toast__progress { color: rgba(255, 255, 255, 0.5); }
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.pa-toast--filled-warning {
|
|
349
|
+
background-color: var(--pa-btn-warning-bg);
|
|
350
|
+
border-color: var(--pa-btn-warning-bg);
|
|
351
|
+
color: var(--pa-btn-warning-text);
|
|
352
|
+
|
|
353
|
+
.pa-toast__title,
|
|
354
|
+
.pa-toast__message { color: inherit; }
|
|
355
|
+
.pa-toast__icon { background-color: rgba(255, 255, 255, 0.2); color: inherit; }
|
|
356
|
+
.pa-toast__close { color: inherit; }
|
|
357
|
+
.pa-toast__progress { color: rgba(255, 255, 255, 0.5); }
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.pa-toast--filled-info {
|
|
361
|
+
background-color: var(--pa-btn-info-bg);
|
|
362
|
+
border-color: var(--pa-btn-info-bg);
|
|
363
|
+
color: var(--pa-btn-info-text);
|
|
364
|
+
|
|
365
|
+
.pa-toast__title,
|
|
366
|
+
.pa-toast__message { color: inherit; }
|
|
367
|
+
.pa-toast__icon { background-color: rgba(255, 255, 255, 0.2); color: inherit; }
|
|
368
|
+
.pa-toast__close { color: inherit; }
|
|
369
|
+
.pa-toast__progress { color: rgba(255, 255, 255, 0.5); }
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// Filled theme color slot variants (color-1 through color-9)
|
|
373
|
+
@for $i from 1 through 9 {
|
|
374
|
+
.pa-toast--filled-color-#{$i} {
|
|
375
|
+
background-color: var(--pa-color-#{$i});
|
|
376
|
+
border-color: var(--pa-color-#{$i});
|
|
377
|
+
color: var(--pa-color-#{$i}-text);
|
|
378
|
+
|
|
379
|
+
.pa-toast__title,
|
|
380
|
+
.pa-toast__message { color: inherit; }
|
|
381
|
+
.pa-toast__icon { background-color: rgba(255, 255, 255, 0.2); color: inherit; }
|
|
382
|
+
.pa-toast__close { color: inherit; }
|
|
383
|
+
.pa-toast__progress { color: rgba(255, 255, 255, 0.5); }
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
294
387
|
// ===== RESPONSIVE =====
|
|
295
388
|
|
|
296
389
|
@media (max-width: $mobile-breakpoint) {
|