@keenmate/pure-admin-core 2.4.0 → 2.5.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.
Files changed (44) hide show
  1. package/README.md +11 -6
  2. package/dist/css/main.css +47 -130
  3. package/package.json +1 -1
  4. package/snippets/AUDIT.md +94 -0
  5. package/snippets/alerts.html +264 -89
  6. package/snippets/badges.html +193 -61
  7. package/snippets/buttons.html +178 -0
  8. package/snippets/callouts.html +210 -129
  9. package/snippets/cards.html +383 -200
  10. package/snippets/checkbox-lists.html +199 -65
  11. package/snippets/code.html +55 -11
  12. package/snippets/command-palette.html +401 -111
  13. package/snippets/comparison.html +144 -93
  14. package/snippets/customization.html +311 -104
  15. package/snippets/data-display.html +584 -0
  16. package/snippets/detail-panel.html +470 -138
  17. package/snippets/filter-card.html +246 -0
  18. package/snippets/forms.html +408 -308
  19. package/snippets/grid.html +253 -141
  20. package/snippets/layout.html +379 -480
  21. package/snippets/lists.html +144 -47
  22. package/snippets/loaders.html +64 -39
  23. package/snippets/manifest.json +330 -280
  24. package/snippets/modal-dialogs.html +137 -64
  25. package/snippets/modals.html +221 -151
  26. package/snippets/notifications.html +285 -0
  27. package/snippets/popconfirm.html +213 -19
  28. package/snippets/profile.html +290 -330
  29. package/snippets/statistics.html +247 -0
  30. package/snippets/tables.html +359 -150
  31. package/snippets/tabs.html +129 -45
  32. package/snippets/timeline.html +123 -56
  33. package/snippets/toasts.html +179 -31
  34. package/snippets/tooltips.html +199 -81
  35. package/snippets/typography.html +183 -58
  36. package/snippets/utilities.html +511 -415
  37. package/snippets/virtual-scroll.html +201 -75
  38. package/snippets/web-daterangepicker.html +369 -189
  39. package/snippets/web-multiselect.html +360 -124
  40. package/src/scss/core-components/_alerts.scss +51 -12
  41. package/src/scss/core-components/_pagers.scss +1 -1
  42. package/src/scss/core-components/_popconfirm.scss +35 -13
  43. package/src/scss/core-components/_tables.scss +2 -134
  44. package/src/scss/variables/_components.scss +17 -2
@@ -1,142 +1,349 @@
1
1
  <!-- ================================
2
- CUSTOMIZATION & CSS VARIABLES
2
+ CUSTOMIZATION
3
3
  Pure Admin Visual Framework
4
+
5
+ The framework has four layers of customization, in increasing
6
+ order of how much you want to change:
7
+
8
+ 1. RUNTIME — CSS variables on :root or any scope
9
+ (theme-aware, no rebuild, supports mode switching)
10
+ 2. MODE / VARIANT body classes
11
+ (toggle .pa-mode-dark, .pa-color-* on <body>)
12
+ 3. THEME SWAP
13
+ (load a different /dist/css/themes/<name>.css)
14
+ 4. BUILD-TIME SCSS overrides
15
+ (override $vars before importing the framework)
16
+
17
+ Use the lightest layer that does the job.
4
18
  ================================ -->
5
19
 
20
+
6
21
  <!-- ================================
7
- PAGE LOADER CSS VARIABLES
8
- Customize the loading screen appearance
22
+ CSS VARIABLE NAMESPACES
23
+ The framework exposes three groups of CSS custom properties.
24
+ Themes set them; consumers override at :root or scope tighter.
9
25
  ================================ -->
10
26
 
11
- <!-- Default Usage (uses theme values) -->
12
- <!-- The page loader appears during initial page load to prevent FOUC -->
13
- <!-- Each theme defines its own colors via CSS variables -->
27
+ <!--
28
+ --pa-* Framework runtime tokens (the bulk of the surface).
29
+ Each theme sets these on :root. Examples:
30
+ --pa-accent accent / brand colour
31
+ --pa-text-color-1 primary text
32
+ --pa-text-color-2 secondary / muted text
33
+ --pa-card-bg card surface
34
+ --pa-border-color borders
35
+ --pa-input-bg input background
36
+ --pa-success-bg / --pa-danger-bg / --pa-warning-bg / --pa-info-bg
37
+ --pa-color-1 ... --pa-color-9 + --pa-color-N-text
38
+ nine theme palette slots
39
+ Override at :root for app-wide change, or on a section /
40
+ element for localised changes.
14
41
 
15
- <!-- Custom Override Example -->
16
- <style>
17
- :root {
18
- /* Background overlay color (with transparency) */
19
- --page-loader-bg: rgba(255, 0, 0, 0.9);
42
+ --base-* Bridge variables for @keenmate web components
43
+ (web-multiselect, web-daterangepicker, web-grid).
44
+ Themes export ~45 of these so external web components
45
+ theme automatically. Rarely overridden directly they
46
+ cascade from the theme. See packages/core/CSS-VARIABLES.md
47
+ for the catalogue.
20
48
 
21
- /* Spinner border color */
22
- --page-loader-spinner-border: #333;
49
+ --page-loader-* The pre-FOUC loading screen (3 variables only).
50
+ Special-cased because it must paint BEFORE the
51
+ theme CSS loads. See "Page Loader" section below.
52
+ -->
23
53
 
24
- /* Spinner accent color (animated top border) */
25
- --page-loader-spinner-accent: #00ff00;
26
- }
54
+
55
+ <!-- ================================
56
+ RUNTIME OVERRIDES — :root
57
+ Set on :root in your own stylesheet AFTER the theme CSS link, or
58
+ scope tighter (body / a section / a single component) for
59
+ localised changes.
60
+ ================================ -->
61
+
62
+ <style>
63
+ /* App-wide accent + main background override */
64
+ :root {
65
+ --pa-accent: #ff6b35;
66
+ --pa-main-bg: #fafafa;
67
+ }
68
+
69
+ /* Scope to a single section without affecting the rest of the app */
70
+ .special-section {
71
+ --pa-accent: #6b46c1;
72
+ --pa-card-bg: #ffffff;
73
+ }
27
74
  </style>
28
75
 
29
- <!-- Theme Default Values -->
30
- <!--
31
- CORPORATE THEME:
32
- --page-loader-bg: rgba(26, 26, 26, 0.95)
33
- --page-loader-spinner-border: #333
34
- --page-loader-spinner-accent: #0066cc
35
-
36
- EXPRESS THEME:
37
- --page-loader-bg: rgba(0, 0, 0, 0.95)
38
- --page-loader-spinner-border: #333
39
- --page-loader-spinner-accent: #FFCC00
40
-
41
- AUDI THEME (DARK):
42
- --page-loader-bg: rgba(10, 10, 10, 0.95)
43
- --page-loader-spinner-border: #333
44
- --page-loader-spinner-accent: #ff0000
45
-
46
- AUDI LIGHT THEME:
47
- --page-loader-bg: rgba(240, 240, 240, 0.95)
48
- --page-loader-spinner-border: #d0d0d0
49
- --page-loader-spinner-accent: #bb0a30
50
-
51
- MINIMAL THEME:
52
- --page-loader-bg: rgba(255, 255, 255, 0.95)
53
- --page-loader-spinner-border: #e0e0e0
54
- --page-loader-spinner-accent: #000000
55
-
56
- DARK THEMES (dark, dark-blue, dark-green, dark-red):
57
- --page-loader-bg: rgba(26, 26, 26, 0.95)
58
- --page-loader-spinner-border: #333
59
- --page-loader-spinner-accent: <theme-color>
60
- - dark: #0ea5e9 (blue)
61
- - dark-blue: #3b82f6 (blue)
62
- - dark-green: #10b981 (green)
63
- - dark-red: #ef4444 (red)
64
- -->
65
76
 
66
- <!-- Why CSS Variables? -->
67
- <!--
68
- The page loader uses CSS variables instead of SCSS variables because:
69
- 1. It loads BEFORE the theme CSS (to prevent FOUC)
70
- 2. Projects can easily override without recompiling SCSS
71
- 3. Supports runtime theme switching if needed
77
+ <!-- ================================
78
+ COLOR-SLOT SYSTEM (--pa-color-1 .. --pa-color-9)
79
+ Themes pick nine palette colours. Most theme-coloured component
80
+ variants (pa-btn--color-3, pa-badge--color-5, pa-table-card--
81
+ color-7, pa-card--color-9, etc.) read directly from these slots,
82
+ so swapping them re-tints the whole app without per-component
83
+ overrides.
84
+
85
+ Each slot has a paired text colour for legibility:
86
+ --pa-color-N (background / fill / border)
87
+ --pa-color-N-text (text on top of the fill)
88
+ ================================ -->
72
89
 
73
- Just add your custom CSS AFTER the theme CSS link:
74
- <link rel="stylesheet" href="/dist/css/themes/corporate.css">
75
90
  <style>
76
- :root {
77
- --page-loader-bg: rgba(0, 100, 200, 0.95);
78
- }
91
+ :root {
92
+ --pa-color-1: #ef4444; --pa-color-1-text: #ffffff;
93
+ --pa-color-2: #f97316; --pa-color-2-text: #ffffff;
94
+ --pa-color-3: #f59e0b; --pa-color-3-text: #1f2937;
95
+ --pa-color-4: #84cc16; --pa-color-4-text: #1f2937;
96
+ --pa-color-5: #10b981; --pa-color-5-text: #ffffff;
97
+ --pa-color-6: #14b8a6; --pa-color-6-text: #ffffff;
98
+ --pa-color-7: #3b82f6; --pa-color-7-text: #ffffff;
99
+ --pa-color-8: #8b5cf6; --pa-color-8-text: #ffffff;
100
+ --pa-color-9: #ec4899; --pa-color-9-text: #ffffff;
101
+ }
79
102
  </style>
80
- -->
81
103
 
82
- <!-- Integration Example -->
83
- <!--
84
- In your project's custom CSS file:
85
- -->
104
+
105
+ <!-- ================================
106
+ MODE CLASSES (light / dark)
107
+ Toggled on <body> by your JS. Themes provide the dark/light look —
108
+ core just adds a few mode-aware tweaks (e.g. dark-mode webkit
109
+ calendar icon inversion). data-theme on <body> mirrors the same
110
+ state for web components.
111
+ ================================ -->
112
+
113
+ <script>
114
+ function setThemeMode(mode /* 'light' | 'dark' */) {
115
+ const body = document.body;
116
+ body.classList.remove('pa-mode-light', 'pa-mode-dark');
117
+ body.classList.add(`pa-mode-${mode}`);
118
+ body.dataset.theme = mode; // for web components keyed on data-theme
119
+ localStorage.setItem('theme-mode', mode);
120
+ }
121
+ </script>
122
+
123
+
124
+ <!-- ================================
125
+ COLOR-VARIANT BODY CLASSES
126
+ Some themes ship multiple colour palettes selectable at runtime
127
+ (e.g. dark + dark-blue + dark-green + dark-red as variants of the
128
+ same dark theme). Apply via a body class:
129
+ ================================ -->
130
+
131
+ <script>
132
+ function setColorVariant(name /* e.g. 'red', 'green' */) {
133
+ const body = document.body;
134
+ [...body.classList].forEach(c => c.startsWith('pa-color-') && body.classList.remove(c));
135
+ if (name) body.classList.add(`pa-color-${name}`);
136
+ localStorage.setItem('color-variant', name || '');
137
+ }
138
+ </script>
139
+
140
+
141
+ <!-- ================================
142
+ PAGE LOADER (--page-loader-* CSS variables)
143
+ A separate variable set because the loader paints BEFORE the
144
+ theme CSS finishes loading — that's the whole point: avoid a
145
+ flash of unstyled content. The values live in critical inline
146
+ CSS in the layout's <head>; CSS variables let you override
147
+ without rebuilding.
148
+
149
+ Variables:
150
+ --page-loader-bg full-screen overlay colour
151
+ (rgba — keep some transparency)
152
+ --page-loader-spinner-border spinner ring colour (muted)
153
+ --page-loader-spinner-accent spinner animated arc colour
154
+
155
+ Defaults are theme-defined. Override AFTER the theme CSS link:
156
+ ================================ -->
157
+
158
+ <link rel="stylesheet" href="/dist/css/themes/corporate.css">
86
159
  <style>
87
- /* custom.css */
88
160
  :root {
89
- /* Brand-specific loader colors */
90
- --page-loader-bg: rgba(30, 30, 30, 0.98);
91
- --page-loader-spinner-border: #444;
92
- --page-loader-spinner-accent: #ff6b35; /* Orange brand color */
161
+ --page-loader-bg: rgba(30, 30, 30, 0.98);
162
+ --page-loader-spinner-border: #444;
163
+ --page-loader-spinner-accent: #ff6b35;
93
164
  }
94
165
 
95
- /* You can also override other aspects if needed */
166
+ /* Optionally tweak structural styles too */
96
167
  .page-loader {
97
- /* Add custom backdrop blur */
98
- backdrop-filter: blur(15px);
168
+ backdrop-filter: blur(15px);
99
169
  }
100
-
101
170
  .page-loader__spinner {
102
- /* Make spinner larger */
103
- width: 60px;
104
- height: 60px;
105
- border-width: 5px;
171
+ width: 60px;
172
+ height: 60px;
173
+ border-width: 5px;
106
174
  }
107
175
  </style>
108
176
 
177
+
109
178
  <!-- ================================
110
- FUTURE CUSTOMIZATION OPTIONS
111
- More CSS variables coming soon
179
+ BUILD-TIME SCSS OVERRIDES
180
+ For deeper changes (spacing scale, typography, component sizes),
181
+ define SCSS variables BEFORE importing the framework. Every
182
+ framework variable is declared with !default, so your earlier
183
+ definition wins.
112
184
  ================================ -->
113
185
 
114
- <!-- Planned CSS Variables -->
115
186
  <!--
116
- Future versions may include CSS variables for:
117
- - Color scheme switching
118
- - Dynamic accent colors
119
- - Component-specific overrides
120
- - Animation timing customization
121
-
122
- For now, use SCSS variables for deep customization:
123
- $main-bg: #your-color;
124
- $accent-color: #your-accent;
125
- @import '@pure-admin/core/scss';
187
+ // your-app.scss
188
+ $primary-bg: #ff6b35; // accent background everywhere
189
+ $body-font-family: 'Inter', sans-serif;
190
+ $card-border-radius: 0; // square cards across the whole app
191
+ $sidebar-width: 32rem; // wider default sidebar
192
+
193
+ @import '@keenmate/pure-admin-core/scss/main';
126
194
  -->
127
195
 
196
+
128
197
  <!-- ================================
129
- QUICK REFERENCE
198
+ THEME SWAPPING
199
+ The framework ships a single core CSS file (main.css). Themes are
200
+ separate CSS files compiled from the @keenmate/pure-admin-themes
201
+ repo. To switch theme at runtime, swap the <link> href:
202
+ ================================ -->
203
+
204
+ <link rel="stylesheet" href="/dist/css/themes/corporate.css" id="theme-css">
205
+
206
+ <script>
207
+ function setTheme(name /* e.g. 'corporate', 'audi', 'minimal' */) {
208
+ document.getElementById('theme-css').href = `/dist/css/themes/${name}.css`;
209
+ localStorage.setItem('selectedTheme', name);
210
+ }
211
+ </script>
212
+
213
+
214
+ <!-- ================================
215
+ COMPONENT-LEVEL OVERRIDES VIA UTILITY CLASSES
216
+ Several components use a low-specificity :where() rule for their
217
+ dimensions so utility classes (.wr-*, .minwr-*, .maxwr-*) win
218
+ without specificity battles. Same pattern in:
219
+ - sidebar (layout.html — --pa-local-sidebar-width)
220
+ - profile panel (profile.html — --pa-local-profile-panel-width)
221
+ - detail panel (detail-panel.html — --pa-local-detail-panel-width)
222
+ ================================ -->
223
+
224
+ <aside class="pa-layout__sidebar wr-25">
225
+ <!-- sidebar fixed at 25rem because .wr-25 wins against the :where() rule -->
226
+ </aside>
227
+
228
+
229
+ <!-- ================================
230
+ COMPONENT REFERENCE
130
231
  ================================ -->
131
232
 
132
233
  <!--
133
- PAGE LOADER VARIABLES:
134
- - --page-loader-bg (background overlay color with opacity)
135
- - --page-loader-spinner-border (spinner border color)
136
- - --page-loader-spinner-accent (spinner animated color)
137
-
138
- USAGE:
139
- Define in :root selector AFTER theme CSS loads
140
- Values can use rgba(), hex, or any CSS color format
141
- Include alpha/transparency for overlay effect
234
+ LAYERS pick the lightest one that does the job:
235
+
236
+ 1. RUNTIME (CSS vars)
237
+ Any --pa-*, --base-*, --page-loader-* variable on :root or any
238
+ scope. Cascades into components automatically.
239
+ Use for: brand colours, accent swap, mode toggles, per-section
240
+ theming, page loader overrides.
241
+
242
+ 2. MODE / VARIANT BODY CLASSES (set by JS)
243
+ - .pa-mode-light / .pa-mode-dark
244
+ - .pa-color-{name} (theme-defined colour variants)
245
+ - data-theme="light"|"dark" (web components keyed on data-theme)
246
+ Use for: user-controlled theme / mode toggles.
247
+
248
+ 3. THEME SWAP
249
+ <link rel="stylesheet" href="/dist/css/themes/<name>.css">
250
+ Themes live in the separate @keenmate/pure-admin-themes repo
251
+ (and pure-admin-themes/ at the workspace level).
252
+ Use for: shipping multiple distinct looks under one app, or
253
+ letting users pick a theme.
254
+
255
+ 4. BUILD-TIME SCSS
256
+ Override $variables BEFORE the framework import. All framework
257
+ variables use !default, so your earlier definition wins.
258
+ Use for: design-system level changes (spacing scale, typography,
259
+ border radii, sidebar default width) that apply across themes.
260
+
261
+ CSS VARIABLE NAMESPACES:
262
+
263
+ --pa-* Framework runtime tokens. Themes set these.
264
+ Consumers override at :root for app-wide
265
+ changes, or scoped for sections.
266
+
267
+ --pa-color-{1..9} Theme palette slots. Each has a paired
268
+ --pa-color-{1..9}-text text colour for legible foregrounds.
269
+ Most theme-colour component variants read
270
+ from these slots (pa-btn--color-3,
271
+ pa-badge--color-5, pa-table-card--color-7…).
272
+
273
+ --base-* Bridge variables for @keenmate web components
274
+ (web-multiselect, web-daterangepicker,
275
+ web-grid). Themes export ~45 of these so the
276
+ components inherit the theme automatically.
277
+ Rarely overridden directly. See
278
+ packages/core/CSS-VARIABLES.md for the full list.
279
+
280
+ --pa-local-* Per-component runtime widths/dimensions
281
+ (sidebar, profile panel, detail panel).
282
+ Applied via :where() so utility classes can
283
+ override without !important.
284
+
285
+ --page-loader-* The pre-FOUC loader specifically. Loads BEFORE
286
+ theme CSS, so it's a separate variable set —
287
+ 3 vars: bg, spinner-border, spinner-accent.
288
+
289
+ LOAD ORDER (matters):
290
+ <link rel="stylesheet" href="/dist/css/themes/<theme>.css">
291
+ <style> :root { /* your overrides */ } </style>
292
+
293
+ Theme CSS sets the defaults; your inline / linked stylesheet that
294
+ follows wins.
295
+
296
+ REM BASE:
297
+ html { font-size: 10px } in core means every rem value in the
298
+ framework reads at 1rem = 10px. Set html { font-size: 11px } / 12px
299
+ to scale the whole UI proportionally (see typography.html for the
300
+ html.font-size-* classes that flip this at runtime).
301
+
302
+ THEMES REPO:
303
+ @keenmate/pure-admin-themes (separate package; workspace path
304
+ ../pure-admin-themes from the demo). Each theme is a small SCSS
305
+ file that overrides $variables and calls
306
+ @include output-base-css-variables to expose --base-*. See the
307
+ themes repo's CLAUDE.md for the build / pack / publish pipeline.
308
+
309
+ STRUCTURE PATTERNS:
310
+
311
+ App-wide accent override:
312
+ <style>
313
+ :root { --pa-accent: #ff6b35; }
314
+ </style>
315
+
316
+ Section-scoped theme tweak:
317
+ <style>
318
+ .marketing-section {
319
+ --pa-accent: #6b46c1;
320
+ --pa-card-bg: #ffffff;
321
+ }
322
+ </style>
323
+
324
+ Light/dark toggle (body class set by JS):
325
+ <body class="pa-mode-dark" data-theme="dark">…</body>
326
+
327
+ Theme swap at runtime:
328
+ <link id="theme-css" rel="stylesheet" href="/dist/css/themes/corporate.css">
329
+ <script>
330
+ function setTheme(name) {
331
+ document.getElementById('theme-css').href = `/dist/css/themes/${name}.css`;
332
+ }
333
+ </script>
334
+
335
+ Build-time SCSS override:
336
+ // in your-app.scss
337
+ $primary-bg: #ff6b35;
338
+ $card-border-radius: 0;
339
+ @import '@keenmate/pure-admin-core/scss/main';
340
+
341
+ Page loader override (must come AFTER theme CSS):
342
+ <link rel="stylesheet" href="/dist/css/themes/corporate.css">
343
+ <style>
344
+ :root {
345
+ --page-loader-bg: rgba(30, 30, 30, 0.98);
346
+ --page-loader-spinner-accent: #ff6b35;
347
+ }
348
+ </style>
142
349
  -->