admin-lte 4.0.4 → 4.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/README.md +6 -6
  3. package/dist/css/adminlte-docs.css +878 -0
  4. package/dist/css/adminlte-docs.css.map +1 -0
  5. package/dist/css/adminlte-docs.min.css +7 -0
  6. package/dist/css/adminlte-docs.min.css.map +1 -0
  7. package/dist/css/adminlte-docs.rtl.css +877 -0
  8. package/dist/css/adminlte-docs.rtl.css.map +1 -0
  9. package/dist/css/adminlte-docs.rtl.min.css +7 -0
  10. package/dist/css/adminlte-docs.rtl.min.css.map +1 -0
  11. package/dist/css/adminlte.css +132 -912
  12. package/dist/css/adminlte.css.map +1 -1
  13. package/dist/css/adminlte.min.css +2 -2
  14. package/dist/css/adminlte.min.css.map +1 -1
  15. package/dist/css/adminlte.rtl.css +132 -912
  16. package/dist/css/adminlte.rtl.css.map +1 -1
  17. package/dist/css/adminlte.rtl.min.css +2 -2
  18. package/dist/css/adminlte.rtl.min.css.map +1 -1
  19. package/dist/js/adminlte.esm.js +1406 -0
  20. package/dist/js/adminlte.esm.js.map +1 -0
  21. package/dist/js/adminlte.esm.min.js +7 -0
  22. package/dist/js/adminlte.esm.min.js.map +1 -0
  23. package/dist/js/adminlte.js +449 -215
  24. package/dist/js/adminlte.js.map +1 -1
  25. package/dist/js/adminlte.min.js +2 -2
  26. package/dist/js/adminlte.min.js.map +1 -1
  27. package/dist/js/types/accessibility.d.ts +46 -0
  28. package/dist/js/types/adminlte.d.ts +10 -0
  29. package/dist/js/types/base-component.d.ts +60 -0
  30. package/dist/js/types/card-widget.d.ts +30 -0
  31. package/dist/js/types/color-mode.d.ts +74 -0
  32. package/dist/js/types/direct-chat.d.ts +19 -0
  33. package/dist/js/types/fullscreen.d.ts +21 -0
  34. package/dist/js/types/layout.d.ts +19 -0
  35. package/dist/js/types/push-menu.d.ts +123 -0
  36. package/dist/js/types/treeview.d.ts +27 -0
  37. package/dist/js/types/util/index.d.ts +79 -0
  38. package/package.json +52 -25
  39. package/src/scss/_app-header.scss +3 -1
  40. package/src/scss/_app-main.scss +4 -0
  41. package/src/scss/_app-sidebar.scss +3 -1
  42. package/src/scss/_bootstrap-overrides.scss +60 -0
  43. package/src/scss/_info-box.scss +3 -1
  44. package/src/scss/_progress-bars.scss +3 -1
  45. package/src/scss/_table.scss +4 -2
  46. package/src/scss/adminlte-docs.scss +25 -0
  47. package/src/scss/adminlte.scss +5 -4
  48. package/src/scss/pages/_login_and_register.scss +3 -1
  49. package/src/ts/accessibility.ts +6 -2
  50. package/src/ts/adminlte.ts +7 -3
  51. package/src/ts/base-component.ts +111 -0
  52. package/src/ts/card-widget.ts +124 -100
  53. package/src/ts/color-mode.ts +254 -0
  54. package/src/ts/direct-chat.ts +38 -32
  55. package/src/ts/fullscreen.ts +32 -23
  56. package/src/ts/push-menu.ts +106 -43
  57. package/src/ts/treeview.ts +84 -50
  58. package/src/ts/util/index.ts +80 -16
  59. package/src/scss/_bootstrap-variables.scss +0 -1766
@@ -0,0 +1,30 @@
1
+ /**
2
+ * --------------------------------------------
3
+ * @file AdminLTE card-widget.ts
4
+ * @description Card widget for AdminLTE.
5
+ * @license MIT
6
+ * --------------------------------------------
7
+ */
8
+ import { BaseComponent } from './base-component';
9
+ type Config = {
10
+ animationSpeed: number;
11
+ collapseTrigger: string;
12
+ removeTrigger: string;
13
+ maximizeTrigger: string;
14
+ };
15
+ declare class CardWidget extends BaseComponent {
16
+ static get NAME(): string;
17
+ static getInstance(element: Element | null | undefined): CardWidget | null;
18
+ static getOrCreateInstance(element: HTMLElement, config?: Partial<Config>): CardWidget;
19
+ _parent: HTMLElement | undefined;
20
+ _config: Config;
21
+ constructor(element: HTMLElement, config?: Partial<Config>);
22
+ collapse(): void;
23
+ expand(): void;
24
+ remove(): void;
25
+ toggle(): void;
26
+ maximize(): void;
27
+ minimize(): void;
28
+ toggleMaximize(): void;
29
+ }
30
+ export default CardWidget;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * --------------------------------------------
3
+ * @file AdminLTE color-mode.ts
4
+ * @description Color mode (light/dark/auto) switcher for AdminLTE.
5
+ * Resolves the theme from, in order: the visitor's stored choice, the theme
6
+ * the page itself declared in <html data-bs-theme="…">, and finally the OS
7
+ * preference. Keeps [data-bs-theme-value] toggles and [data-lte-theme-icon]
8
+ * indicator icons in sync.
9
+ *
10
+ * Ships in the bundle so applications no longer need to copy the demo's
11
+ * inline script. The tiny no-flash snippet in <head> (see _head.astro)
12
+ * remains inline by design — it must run before first paint. That snippet
13
+ * flags the values it computes itself with [data-lte-theme-resolved], so a
14
+ * theme authored in the markup can be told apart from one it resolved.
15
+ *
16
+ * Applications with their own theming opt out entirely with
17
+ * <html data-lte-color-mode="off">.
18
+ * @license MIT
19
+ * --------------------------------------------
20
+ */
21
+ type Theme = 'light' | 'dark' | 'auto';
22
+ /**
23
+ * Class Definition
24
+ * ====================================================
25
+ */
26
+ declare class ColorMode {
27
+ /**
28
+ * Read the persisted theme choice, or null when nothing was stored or
29
+ * localStorage is unavailable (private mode, sandboxed iframe).
30
+ */
31
+ getStoredTheme(): Theme | null;
32
+ /**
33
+ * The theme declared in the markup, for applications that render it
34
+ * server-side from a cookie or a user record. Null when the page declared
35
+ * none, or when the value is a custom Bootstrap theme ColorMode cannot
36
+ * resolve — see `isDisabled` for those.
37
+ */
38
+ getMarkupTheme(): Theme | null;
39
+ /**
40
+ * The user's effective choice: the stored theme, then the theme declared in
41
+ * the markup, falling back to the OS preference. Storage comes first because
42
+ * it is the visitor's own click on this device; markup is only the default
43
+ * the page shipped with.
44
+ */
45
+ getPreferredTheme(): Theme;
46
+ /**
47
+ * Resolve "auto" against the OS preference.
48
+ */
49
+ resolveTheme(theme: Theme): 'light' | 'dark';
50
+ /**
51
+ * Apply a theme and persist the choice. Dispatches
52
+ * `changed.lte.color-mode` on the document with { theme, resolved }.
53
+ */
54
+ setTheme(theme: Theme): void;
55
+ /**
56
+ * Apply without persisting — used on init and when the OS preference
57
+ * changes while in "auto" mode.
58
+ */
59
+ _applyTheme(theme: Theme): void;
60
+ /**
61
+ * Whether the OS preference is currently dark.
62
+ */
63
+ _prefersDark(): boolean;
64
+ /**
65
+ * Sync the [data-bs-theme-value] toggles (active state, pressed state,
66
+ * check mark) and the [data-lte-theme-icon] indicator icons.
67
+ */
68
+ _showActiveTheme(theme: Theme): void;
69
+ /**
70
+ * Apply the preferred theme and sync the UI without persisting anything.
71
+ */
72
+ init(): void;
73
+ }
74
+ export default ColorMode;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * --------------------------------------------
3
+ * @file AdminLTE direct-chat.ts
4
+ * @description Direct chat for AdminLTE.
5
+ * @license MIT
6
+ * --------------------------------------------
7
+ */
8
+ import { BaseComponent } from './base-component';
9
+ /**
10
+ * Class Definition
11
+ * ====================================================
12
+ */
13
+ declare class DirectChat extends BaseComponent {
14
+ static get NAME(): string;
15
+ static getInstance(element: Element | null | undefined): DirectChat | null;
16
+ static getOrCreateInstance(element: HTMLElement): DirectChat;
17
+ toggle(): void;
18
+ }
19
+ export default DirectChat;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * --------------------------------------------
3
+ * @file AdminLTE fullscreen.ts
4
+ * @description Fullscreen plugin for AdminLTE.
5
+ * @license MIT
6
+ * --------------------------------------------
7
+ */
8
+ import { BaseComponent } from './base-component';
9
+ /**
10
+ * Class Definition.
11
+ * ============================================================================
12
+ */
13
+ declare class FullScreen extends BaseComponent {
14
+ static get NAME(): string;
15
+ static getInstance(element: Element | null | undefined): FullScreen | null;
16
+ static getOrCreateInstance(element: HTMLElement): FullScreen;
17
+ inFullScreen(): void;
18
+ outFullscreen(): void;
19
+ toggleFullScreen(): void;
20
+ }
21
+ export default FullScreen;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * @file AdminLTE layout.ts
4
+ * @description Layout for AdminLTE.
5
+ * @license MIT
6
+ * ----------------------------------------------------------------------------
7
+ */
8
+ /**
9
+ * ----------------------------------------------------------------------------
10
+ * Class Definition
11
+ * ----------------------------------------------------------------------------
12
+ */
13
+ declare class Layout {
14
+ _element: HTMLElement;
15
+ _holdTransitionTimer: ReturnType<typeof setTimeout> | undefined;
16
+ constructor(element: HTMLElement);
17
+ holdTransition(time?: number): void;
18
+ }
19
+ export default Layout;
@@ -0,0 +1,123 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * @file AdminLTE push-menu.ts
4
+ * @description Push menu for AdminLTE.
5
+ * @license MIT
6
+ * ----------------------------------------------------------------------------
7
+ */
8
+ import { BaseComponent } from './base-component';
9
+ /**
10
+ * ----------------------------------------------------------------------------
11
+ * Configuration Object Interface
12
+ * - sidebarBreakpoint: The screen width (in pixels) below which the sidebar
13
+ * is considered to be on a "mobile" size and should be collapsed by default
14
+ * unless explicitly opened.
15
+ * - enablePersistence: Whether to save the sidebar state (collapsed/open) in
16
+ * localStorage and restore it on page load.
17
+ * ----------------------------------------------------------------------------
18
+ */
19
+ type Config = {
20
+ sidebarBreakpoint: number;
21
+ enablePersistence: boolean;
22
+ };
23
+ /**
24
+ * ----------------------------------------------------------------------------
25
+ * Class Definition
26
+ * ----------------------------------------------------------------------------
27
+ */
28
+ declare class PushMenu extends BaseComponent {
29
+ static get NAME(): string;
30
+ /**
31
+ * Look up the PushMenu already attached to the given element.
32
+ *
33
+ * @param element The sidebar element to look up.
34
+ * @returns The existing instance, or null if the sidebar has none yet.
35
+ */
36
+ static getInstance(element: Element | null | undefined): PushMenu | null;
37
+ /**
38
+ * Look up the PushMenu attached to the given element, creating one when the
39
+ * element has none. `config` is ignored if an instance already exists.
40
+ *
41
+ * @param element The sidebar element.
42
+ * @param config Overrides merged over the defaults for a new instance.
43
+ * @returns The existing or newly created instance.
44
+ */
45
+ static getOrCreateInstance(element: HTMLElement, config?: Partial<Config>): PushMenu;
46
+ /**
47
+ * The defaults merged with the overrides this instance was created with.
48
+ */
49
+ _config: Config;
50
+ /**
51
+ * @param element The sidebar element to attach to.
52
+ * @param config Overrides merged over the defaults.
53
+ */
54
+ constructor(element: HTMLElement, config?: Partial<Config>);
55
+ /**
56
+ * Check if the sidebar is collapsed.
57
+ *
58
+ * @returns True if the sidebar is collapsed, false otherwise.
59
+ */
60
+ isCollapsed(): boolean;
61
+ /**
62
+ * Check if the sidebar is explicitly open on mobile sizes.
63
+ *
64
+ * @returns True if the sidebar is explicitly open, false otherwise.
65
+ */
66
+ isExplicitlyOpen(): boolean;
67
+ /**
68
+ * Check if the sidebar is in mini mode.
69
+ *
70
+ * @returns True if the sidebar is in mini mode, false otherwise.
71
+ */
72
+ isMiniMode(): boolean;
73
+ /**
74
+ * Check if the current screen size is considered "mobile" based on the
75
+ * sidebarBreakpoint config value.
76
+ *
77
+ * @returns True if the screen size is mobile, false otherwise.
78
+ */
79
+ isMobileSize(): boolean;
80
+ /**
81
+ * Expand the sidebar menu.
82
+ */
83
+ expand(): void;
84
+ /**
85
+ * Collapse the sidebar menu.
86
+ */
87
+ collapse(): void;
88
+ /**
89
+ * Toggle the sidebar menu state.
90
+ */
91
+ toggle(): void;
92
+ /**
93
+ * Read the CSS breakpoint of the sidebar from the DOM and update the
94
+ * sidebarBreakpoint config. This breakpoint is defined using a CSS ::before
95
+ * pseudo element on the sidebar-expand element when @media queries are used
96
+ * to change the sidebar behavior based on screen size.
97
+ */
98
+ setupSidebarBreakPoint(): void;
99
+ /**
100
+ * Update the sidebar state based on the current screen size and the
101
+ * sidebarBreakpoint config value.
102
+ */
103
+ updateStateByResponsiveLogic(): void;
104
+ /**
105
+ * Save sidebar state to localStorage.
106
+ *
107
+ * @param state The state to save ('sidebar-open' or 'sidebar-collapse').
108
+ */
109
+ saveSidebarState(state: string): void;
110
+ /**
111
+ * Load sidebar state from localStorage.
112
+ */
113
+ loadSidebarState(): void;
114
+ /**
115
+ * Clear sidebar state from localStorage.
116
+ */
117
+ clearSidebarState(): void;
118
+ /**
119
+ * Initialize the push menu plugin and setup the initial sidebar state.
120
+ */
121
+ init(): void;
122
+ }
123
+ export default PushMenu;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * --------------------------------------------
3
+ * @file AdminLTE treeview.ts
4
+ * @description Treeview plugin for AdminLTE.
5
+ * @license MIT
6
+ * --------------------------------------------
7
+ */
8
+ import { BaseComponent } from './base-component';
9
+ type Config = {
10
+ animationSpeed: number;
11
+ accordion: boolean;
12
+ };
13
+ /**
14
+ * Class Definition
15
+ * ====================================================
16
+ */
17
+ declare class Treeview extends BaseComponent {
18
+ static get NAME(): string;
19
+ static getInstance(element: Element | null | undefined): Treeview | null;
20
+ static getOrCreateInstance(element: HTMLElement, config?: Partial<Config>): Treeview;
21
+ _config: Config;
22
+ constructor(element: HTMLElement, config?: Partial<Config>);
23
+ open(): void;
24
+ close(): void;
25
+ toggle(): void;
26
+ }
27
+ export default Treeview;
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Lifecycle management
3
+ * ============================================================================
4
+ *
5
+ * Plugins register their initialisation through `onDOMContentLoaded`. Besides
6
+ * the initial page load, every registered callback is re-run on Hotwired Turbo
7
+ * navigations (`turbo:load`): Turbo Drive swaps the <body> without a full page
8
+ * reload, so without re-initialisation plugins such as PushMenu and TreeView
9
+ * stop working after the first in-app link click (#563, #5890).
10
+ *
11
+ * Re-running init would normally leak listeners, because callbacks also bind to
12
+ * `window`/`document`, which survive Turbo's <body> swap. To prevent that, each
13
+ * cycle has its own `AbortController`: callbacks should attach their
14
+ * window/document-level listeners with the signal from `getLifecycleSignal()`.
15
+ * The signal is aborted on `turbo:before-render`, tearing down the previous
16
+ * cycle's listeners before the callbacks run again. Listeners bound to elements
17
+ * inside <body> don't need the signal — Turbo discards the old <body>, so they
18
+ * are cleaned up automatically.
19
+ *
20
+ * Turbo is not the only environment that renders after `DOMContentLoaded`:
21
+ * client-side frameworks that build the layout themselves (GWT, and other
22
+ * imperative widget toolkits) have an empty <body> when the initial batch runs,
23
+ * so the per-page init pass finds no sidebar and no menu. Those consumers call
24
+ * the exported `initialize()` once the layout is attached — it performs the same
25
+ * reset-then-replay cycle Turbo gets, without faking Turbo events.
26
+ *
27
+ * Unlike Turbo, such frameworks keep the same <body> across a re-init, so
28
+ * element-level listeners are NOT discarded for them. Callbacks should therefore
29
+ * pass `getLifecycleSignal()` to every `addEventListener` they make — including
30
+ * ones on elements — whenever the element can outlive the cycle.
31
+ */
32
+ /**
33
+ * The AbortSignal for the current lifecycle. Pass it as the
34
+ * `{ signal }` option to window/document `addEventListener` calls made during
35
+ * initialisation so they are removed automatically on the next Turbo render.
36
+ */
37
+ declare const getLifecycleSignal: () => AbortSignal;
38
+ declare const onDOMContentLoaded: (callback: () => void) => void;
39
+ /**
40
+ * End the current lifecycle: abort the cycle's signal so listeners registered
41
+ * with it are removed, then arm a fresh cycle for the next replay.
42
+ *
43
+ * Exported for SPA containers that unmount the AdminLTE layout: calling it
44
+ * drops the window/document listeners the current cycle added without
45
+ * immediately re-initialising. Internally it is also the first half of
46
+ * `initialize()` and the `turbo:before-render` handler.
47
+ */
48
+ declare const teardown: () => void;
49
+ /**
50
+ * Re-run every plugin's initialisation against the DOM as it stands right now.
51
+ *
52
+ * Intended for frameworks that render the layout after `DOMContentLoaded` has
53
+ * already fired — call it once the sidebar and menu are attached, and PushMenu,
54
+ * Treeview and ColorMode pick them up as if they had been in the initial HTML.
55
+ * Delegated click handling never needs this; only the per-page init pass does.
56
+ *
57
+ * The previous cycle is torn down first, so calling it repeatedly does not stack
58
+ * listeners registered with `getLifecycleSignal()`. Calling it before the
59
+ * initial batch has run (while `document.readyState === 'loading'`) runs that
60
+ * batch early, against whatever DOM exists at the time — the initial
61
+ * `DOMContentLoaded` pass below still replays against the complete DOM.
62
+ */
63
+ declare const initialize: () => void;
64
+ /**
65
+ * Check if an element has a specific data attribute using ES2022 Object.hasOwn()
66
+ */
67
+ declare const hasDataAttribute: (element: HTMLElement, attribute: string) => boolean;
68
+ /**
69
+ * Get the last element from a NodeList using ES2022 Array.at()
70
+ */
71
+ declare const getLastElement: <T extends Element>(elements: NodeListOf<T> | T[]) => T | undefined;
72
+ /**
73
+ * Safe property access with better error handling
74
+ */
75
+ declare const safePropertyAccess: (obj: Record<string, unknown>, property: string) => unknown;
76
+ declare const slideUp: (target: HTMLElement, duration?: number) => void;
77
+ declare const slideDown: (target: HTMLElement, duration?: number) => void;
78
+ declare const slideToggle: (target: HTMLElement, duration?: number) => void;
79
+ export { onDOMContentLoaded, getLifecycleSignal, initialize, teardown, slideUp, slideDown, slideToggle, hasDataAttribute, getLastElement, safePropertyAccess };
package/package.json CHANGED
@@ -1,11 +1,25 @@
1
1
  {
2
2
  "name": "admin-lte",
3
3
  "description": "Responsive open source admin dashboard and control panel.",
4
- "version": "4.0.4",
4
+ "version": "4.2.0",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Colorlib <https://colorlib.com>",
8
8
  "main": "dist/js/adminlte.min.js",
9
+ "module": "dist/js/adminlte.esm.js",
10
+ "types": "dist/js/types/adminlte.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/js/types/adminlte.d.ts",
14
+ "sass": "./src/scss/adminlte.scss",
15
+ "style": "./dist/css/adminlte.css",
16
+ "import": "./dist/js/adminlte.esm.js",
17
+ "require": "./dist/js/adminlte.min.js"
18
+ },
19
+ "./dist/*": "./dist/*",
20
+ "./src/scss/*": "./src/scss/*",
21
+ "./package.json": "./package.json"
22
+ },
9
23
  "files": [
10
24
  "dist/css/",
11
25
  "dist/js/",
@@ -23,17 +37,20 @@
23
37
  "dev": "npm-run-all --parallel watch docs-serve",
24
38
  "build": "npm-run-all clean compile",
25
39
  "css": "npm-run-all css-compile css-prefix css-rtl css-minify",
26
- "css-compile": "sass --style expanded --load-path=\"node_modules\" --source-map --embed-sources --no-error-css --quiet src/scss/:dist/css/",
40
+ "css-compile": "sass --style expanded --load-path=\"node_modules\" --source-map --embed-sources --no-error-css --quiet-deps --silence-deprecation=import src/scss/:dist/css/",
27
41
  "css-rtl": "cross-env NODE_ENV=RTL postcss --config src/config/postcss.config.mjs --dir \"dist/css\" --ext \".rtl.css\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*.rtl.css\"",
28
42
  "css-lint": "stylelint \"src/scss/**/*.scss\" --cache --cache-location .cache/.stylelintcache --rd",
29
43
  "css-minify": "npm-run-all --aggregate-output --parallel css-minify-*",
30
44
  "css-minify-main": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\" \"!dist/css/*rtl*.css\"",
31
45
  "css-minify-rtl": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*rtl.css\" \"!dist/css/*.min.css\"",
32
46
  "css-prefix": "postcss --config src/config/postcss.config.mjs --replace \"dist/css/*.css\" \"!dist/css/*.rtl*.css\" \"!dist/css/*.min.css\"",
33
- "js": "npm-run-all js-compile js-minify",
47
+ "js": "npm-run-all js-compile js-types js-minify",
34
48
  "js-compile": "rollup --config src/config/rollup.config.js --sourcemap",
49
+ "js-types": "tsc -p tsconfig.types.json",
35
50
  "js-lint": "eslint --format=stylish .",
36
- "js-minify": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/adminlte.js.map,includeSources,url=adminlte.min.js.map\" --output dist/js/adminlte.min.js dist/js/adminlte.js",
51
+ "js-minify": "npm-run-all --aggregate-output --parallel js-minify-*",
52
+ "js-minify-main": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/adminlte.js.map,includeSources,url=adminlte.min.js.map\" --output dist/js/adminlte.min.js dist/js/adminlte.js",
53
+ "js-minify-esm": "terser --compress passes=2 --module --mangle --comments \"/^!/\" --source-map \"content=dist/js/adminlte.esm.js.map,includeSources,url=adminlte.esm.min.js.map\" --output dist/js/adminlte.esm.min.js dist/js/adminlte.esm.js",
37
54
  "bundlewatch": "bundlewatch --config .bundlewatch.config.json",
38
55
  "lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
39
56
  "docs-compile": "npm run copy-assets && astro --config src/config/astro.config.mjs build",
@@ -44,10 +61,13 @@
44
61
  "flatten-build": "shx cp -r dist/html/* dist/ && shx rm -rf dist/html && shx rm -rf dist/.astro && shx mkdir -p dist/docs && shx mv dist/docs.html dist/docs/index.html",
45
62
  "assets": "node src/config/assets.config.mjs",
46
63
  "version": "node src/config/sync-version.mjs",
64
+ "test": "vitest run",
65
+ "test-watch": "vitest",
66
+ "test-a11y": "node tests/a11y.mjs",
47
67
  "lint": "npm-run-all --aggregate-output --continue-on-error --parallel js-lint css-lint docs-lint lockfile-lint",
48
68
  "clean": "rimraf dist",
49
69
  "compile": "npm-run-all css js assets copy-assets docs-compile docs-format flatten-build",
50
- "production": "npm-run-all clean lint compile bundlewatch",
70
+ "production": "npm-run-all clean lint test compile bundlewatch",
51
71
  "watch": "concurrently \"npm:watch-*\"",
52
72
  "watch-css-main": "nodemon --watch src/scss/ --ext scss --exec \"npm-run-all css-lint css-compile css-prefix copy-assets\"",
53
73
  "watch-css-dist": "nodemon --watch dist/css/ --ext css --ignore \"dist/css/*.rtl.*\" --exec \"npm run css-rtl\"",
@@ -75,49 +95,56 @@
75
95
  "bugs": {
76
96
  "url": "https://github.com/ColorlibHQ/AdminLTE/issues"
77
97
  },
98
+ "peerDependencies": {
99
+ "bootstrap": "^5.3.8"
100
+ },
78
101
  "overrides": {
79
- "axios": "0.32.0",
102
+ "axios": "^0.33.0",
103
+ "shell-quote": "^1.10.0",
80
104
  "stylelint-config-twbs-bootstrap": {
81
105
  "stylelint": "$stylelint"
82
106
  },
83
107
  "yaml": "^2.9.0"
84
108
  },
85
109
  "devDependencies": {
86
- "@astrojs/check": "^0.9.9",
87
- "@astrojs/mdx": "^7.0.0",
110
+ "@astrojs/check": "^0.9.10",
111
+ "@astrojs/mdx": "^7.0.5",
88
112
  "@eslint/js": "^10.0.1",
89
113
  "@rollup/plugin-typescript": "^12.3.0",
90
- "@typescript-eslint/eslint-plugin": "^8.62.1",
91
- "@typescript-eslint/parser": "^8.62.1",
92
- "astro": "^7.0.4",
93
- "autoprefixer": "^10.5.2",
114
+ "@typescript-eslint/eslint-plugin": "^8.66.0",
115
+ "@typescript-eslint/parser": "^8.66.0",
116
+ "astro": "^7.1.6",
117
+ "autoprefixer": "^10.5.4",
118
+ "axe-core": "^4.12.1",
94
119
  "bootstrap": "^5.3.8",
95
120
  "bundlewatch": "^0.4.2",
96
121
  "clean-css-cli": "^5.6.3",
97
- "concurrently": "^10.0.3",
122
+ "concurrently": "^10.0.4",
98
123
  "cross-env": "^10.1.0",
99
- "eslint": "^10.6.0",
100
- "eslint-plugin-astro": "^2.1.1",
101
- "eslint-plugin-unicorn": "^69.0.0",
102
- "fs-extra": "^11.3.6",
103
- "globals": "^17.7.0",
124
+ "eslint": "^10.8.0",
125
+ "eslint-plugin-astro": "^3.1.0",
126
+ "eslint-plugin-unicorn": "^73.0.0",
127
+ "fs-extra": "^11.4.0",
128
+ "globals": "^17.9.0",
129
+ "happy-dom": "^20.11.1",
104
130
  "lockfile-lint": "^5.0.0",
105
131
  "nodemon": "^3.1.14",
106
132
  "npm-run-all": "^4.1.5",
107
- "postcss": "^8.5.16",
133
+ "postcss": "^8.5.25",
108
134
  "postcss-cli": "^11.0.1",
109
- "prettier": "^3.9.4",
135
+ "prettier": "^3.9.6",
110
136
  "prettier-plugin-astro": "^0.14.1",
111
137
  "rimraf": "^6.1.3",
112
- "rollup": "^4.62.2",
138
+ "rollup": "^4.62.4",
113
139
  "rtlcss": "^4.3.0",
114
- "sass": "^1.101.0",
140
+ "sass": "^1.102.0",
115
141
  "shx": "^0.4.0",
116
- "stylelint": "^17.14.0",
142
+ "stylelint": "^17.14.1",
117
143
  "stylelint-config-twbs-bootstrap": "^16.1.0",
118
- "terser": "^5.48.0",
144
+ "terser": "^5.49.2",
119
145
  "tslib": "^2.8.1",
120
146
  "typescript": "^6.0.3",
121
- "typescript-eslint": "^8.62.1"
147
+ "typescript-eslint": "^8.66.0",
148
+ "vitest": "^4.1.10"
122
149
  }
123
150
  }
@@ -1,3 +1,5 @@
1
+ @use "sass:map";
2
+
1
3
  //
2
4
  // Core: Main Header
3
5
  //
@@ -38,7 +40,7 @@
38
40
  // stay visible while the page content scrolls beneath the fixed header.
39
41
  // Only applied on `sidebar-expand-*` breakpoints, since the mobile sidebar
40
42
  // is an off-canvas overlay that handles its own positioning.
41
- @each $breakpoint in map-keys($grid-breakpoints) {
43
+ @each $breakpoint in map.keys($grid-breakpoints) {
42
44
  $next: breakpoint-next($breakpoint, $grid-breakpoints);
43
45
  $infix: breakpoint-infix($next, $grid-breakpoints);
44
46
 
@@ -16,6 +16,10 @@
16
16
  line-height: 2.5rem;
17
17
 
18
18
  a {
19
+ // Bootstrap's default link blue is only 4.26:1 against the
20
+ // body-secondary background the demo uses behind the content header;
21
+ // the hover shade clears WCAG AA's 4.5:1 in both color modes.
22
+ color: var(--#{$prefix}link-hover-color);
19
23
  text-decoration: none;
20
24
  }
21
25
  }
@@ -1,3 +1,5 @@
1
+ @use "sass:map";
2
+
1
3
  .app-sidebar {
2
4
  --#{$lte-prefix}sidebar-hover-bg: #{$lte-sidebar-hover-bg};
3
5
  --#{$lte-prefix}sidebar-color: #{$lte-sidebar-color};
@@ -462,7 +464,7 @@
462
464
  }
463
465
 
464
466
  .sidebar-expand {
465
- @each $breakpoint in map-keys($grid-breakpoints) {
467
+ @each $breakpoint in map.keys($grid-breakpoints) {
466
468
  $next: breakpoint-next($breakpoint, $grid-breakpoints);
467
469
  $infix: breakpoint-infix($next, $grid-breakpoints);
468
470
 
@@ -0,0 +1,60 @@
1
+ //
2
+ // AdminLTE's Bootstrap overrides.
3
+ //
4
+ // Loaded BEFORE `bootstrap/scss/variables`: every Bootstrap variable uses
5
+ // `!default`, so anything declared here wins while everything not declared
6
+ // keeps Bootstrap's own default. This replaces the old 1,700-line vendored
7
+ // copy of Bootstrap's variables file (which carried these same ~10 changes
8
+ // and had to be re-synced by hand on every Bootstrap release).
9
+ //
10
+ // To override any variable yourself, declare it before importing AdminLTE —
11
+ // see the Customization docs.
12
+ //
13
+
14
+ // Options
15
+ $enable-shadows: true !default;
16
+ $enable-negative-margins: true !default;
17
+
18
+ // Typography
19
+ // stylelint-disable-next-line value-keyword-case
20
+ $font-family-sans-serif: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
21
+
22
+ // The type-scale variables below mirror Bootstrap's defaults. They are
23
+ // declared here (still with !default, so user overrides keep working) only
24
+ // because AdminLTE's extra sizes and the extended $font-sizes map need them
25
+ // before `bootstrap/scss/variables` has loaded.
26
+ $font-size-base: 1rem !default;
27
+ $font-size-sm: $font-size-base * .875 !default;
28
+ $font-size-lg: $font-size-base * 1.25 !default;
29
+
30
+ // AdminLTE additions to the type scale.
31
+ $font-size-xs: $font-size-base * .75 !default;
32
+ $font-size-xl: $font-size-base * 2 !default;
33
+
34
+ $h1-font-size: $font-size-base * 2.5 !default;
35
+ $h2-font-size: $font-size-base * 2 !default;
36
+ $h3-font-size: $font-size-base * 1.75 !default;
37
+ $h4-font-size: $font-size-base * 1.5 !default;
38
+ $h5-font-size: $font-size-base * 1.25 !default;
39
+ $h6-font-size: $font-size-base !default;
40
+ $h7-font-size: $font-size-sm !default;
41
+ $h8-font-size: $font-size-xs !default;
42
+
43
+ // Extends Bootstrap's map with sizes 7 and 8 (.fs-7 / .fs-8 utilities).
44
+ $font-sizes: (
45
+ 1: $h1-font-size,
46
+ 2: $h2-font-size,
47
+ 3: $h3-font-size,
48
+ 4: $h4-font-size,
49
+ 5: $h5-font-size,
50
+ 6: $h6-font-size,
51
+ 7: $h7-font-size,
52
+ 8: $h8-font-size
53
+ ) !default;
54
+
55
+ // Navbar
56
+ $navbar-nav-link-padding-x: 1rem !default;
57
+
58
+ // AdminLTE keeps `$modal-content-color: null` so the modal text colour is
59
+ // inherited from the document. Bootstrap's default is `var(--#{$prefix}body-color)`.
60
+ $modal-content-color: null !default;
@@ -1,3 +1,5 @@
1
+ @use "sass:map";
2
+
1
3
  //
2
4
  // Component: Info Box
3
5
  //
@@ -11,7 +13,7 @@
11
13
  width: 100%;
12
14
  min-height: 80px;
13
15
  padding: .5rem;
14
- margin-bottom: map-get($spacers, 3);
16
+ margin-bottom: map.get($spacers, 3);
15
17
  color: var(--#{$prefix}body-color);
16
18
  background-color: var(--#{$prefix}body-bg);
17
19