@omnitend/dashboard-for-laravel 0.16.3 → 0.16.4
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/composables/useToast.d.ts +2 -1
- package/dist/dashboard-for-laravel.js +5043 -5023
- package/dist/dashboard-for-laravel.js.map +1 -1
- package/dist/dashboard-for-laravel.umd.cjs +7 -7
- package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/docs/public/api-reference.json +2 -2
- package/docs/public/docs-map.md +1 -1
- package/package.json +1 -1
- package/resources/css/theme.scss +17 -13
- package/resources/js/composables/useToast.ts +53 -1
package/docs/public/docs-map.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Documentation Map
|
|
2
2
|
|
|
3
3
|
> Auto-generated hierarchical overview of all documentation
|
|
4
|
-
> Last updated: 2026-07-
|
|
4
|
+
> Last updated: 2026-07-06T20:01:04.293Z
|
|
5
5
|
|
|
6
6
|
This file provides a complete map of all available documentation for AI agents and developers.
|
|
7
7
|
|
package/package.json
CHANGED
package/resources/css/theme.scss
CHANGED
|
@@ -221,17 +221,24 @@ $dashboard-navbar-height: 64px;
|
|
|
221
221
|
// Toasts
|
|
222
222
|
// ----------------------------------------------------------------------------
|
|
223
223
|
// Bootstrap Vue Next renders toasts with Bootstrap's `.text-bg-{variant}`
|
|
224
|
-
// utility, which fills the whole toast with a saturated colour and
|
|
225
|
-
// loud "candy" blocks that are wrong for a dashboard. Restyle
|
|
226
|
-
// neutral surface with a subtle semantic tint
|
|
227
|
-
//
|
|
228
|
-
//
|
|
224
|
+
// utility by default, which fills the whole toast with a saturated colour and
|
|
225
|
+
// white text — loud "candy" blocks that are wrong for a dashboard. Restyle
|
|
226
|
+
// them as a calm, neutral surface with a subtle semantic tint. Colour still
|
|
227
|
+
// signals the toast type, but the bold palette stays where it belongs
|
|
228
|
+
// (actions, badges, selected states).
|
|
229
|
+
//
|
|
230
|
+
// `useToast()` (resources/js/composables/useToast.ts) intercepts a themed
|
|
231
|
+
// `variant` and swaps it for a `toast-{variant}` class instead of BVN's own
|
|
232
|
+
// `variant` prop, so these rules drive Bootstrap's own `--bs-toast-*`
|
|
233
|
+
// variables — no `!important` needed to fight the `.text-bg-*` utility, which
|
|
234
|
+
// sets its colours `!important` by design. An untouched (non-themed) variant
|
|
235
|
+
// still falls through to BVN's default `.text-bg-*` styling.
|
|
229
236
|
|
|
230
237
|
.toast {
|
|
231
238
|
overflow: hidden; // clip the bottom progress bar to the rounded corners
|
|
232
239
|
border: 1px solid $border-color;
|
|
233
240
|
border-radius: $border-radius;
|
|
234
|
-
|
|
241
|
+
--bs-toast-bg: #{$white};
|
|
235
242
|
box-shadow:
|
|
236
243
|
0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
237
244
|
0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
@@ -260,19 +267,16 @@ $dashboard-navbar-height: 64px;
|
|
|
260
267
|
display: none;
|
|
261
268
|
}
|
|
262
269
|
|
|
263
|
-
// Semantic variants: subtle tinted surface
|
|
264
|
-
// `.
|
|
265
|
-
// muted body from the base rules above stay.
|
|
270
|
+
// Semantic variants: subtle tinted surface, driven through the CSS variable
|
|
271
|
+
// the base `.toast` rule (above, and Bootstrap's own) already reads.
|
|
266
272
|
@each $name, $color in (
|
|
267
273
|
"success": $success,
|
|
268
274
|
"danger": $danger,
|
|
269
275
|
"warning": $warning,
|
|
270
276
|
"info": $info
|
|
271
277
|
) {
|
|
272
|
-
&.
|
|
273
|
-
|
|
274
|
-
// saturated background-color !important that BVN applies per variant.
|
|
275
|
-
background-color: mix($color, $white, 8%) !important;
|
|
278
|
+
&.toast-#{$name} {
|
|
279
|
+
--bs-toast-bg: #{mix($color, $white, 8%)};
|
|
276
280
|
}
|
|
277
281
|
}
|
|
278
282
|
}
|
|
@@ -1 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
import { isRef } from "vue";
|
|
2
|
+
import { useToast as useBvnToast } from "bootstrap-vue-next";
|
|
3
|
+
import type {
|
|
4
|
+
OrchestratorCreateOptions,
|
|
5
|
+
ToastOrchestratorCreateParam,
|
|
6
|
+
} from "bootstrap-vue-next";
|
|
7
|
+
|
|
8
|
+
// Bootstrap Vue Next maps a toast's `variant` prop straight to Bootstrap's
|
|
9
|
+
// `.text-bg-{variant}` utility class, which sets background/text colour
|
|
10
|
+
// `!important` (all Bootstrap utilities are `!important` by design) — so
|
|
11
|
+
// restyling it can only ever fight that with `!important` too. The variants
|
|
12
|
+
// this theme restyles (see theme.scss) are instead applied as a `toast-{variant}`
|
|
13
|
+
// class, driving Bootstrap's own `--bs-toast-*` variables cleanly. An
|
|
14
|
+
// unrecognised variant (e.g. "primary", "dark", or none) falls through to
|
|
15
|
+
// BVN's default `.text-bg-*` styling unchanged.
|
|
16
|
+
const THEMED_TOAST_VARIANTS = new Set(["success", "danger", "warning", "info"]);
|
|
17
|
+
|
|
18
|
+
function themeToastParam(param: Record<string, unknown>): Record<string, unknown> {
|
|
19
|
+
const variant = param.variant as string | null | undefined;
|
|
20
|
+
if (!variant || !THEMED_TOAST_VARIANTS.has(variant)) return param;
|
|
21
|
+
|
|
22
|
+
const { variant: _variant, toastClass, ...rest } = param;
|
|
23
|
+
return {
|
|
24
|
+
...rest,
|
|
25
|
+
toastClass: [toastClass, `toast-${variant}`],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Thin wrapper around Bootstrap Vue Next's `useToast()`. Public API is
|
|
31
|
+
* identical (`create({ title, body, variant })`, `show(...)`) — a themed
|
|
32
|
+
* `variant` is translated internally into a `toast-{variant}` class instead
|
|
33
|
+
* of being passed through to BVN, so it's styled via `--bs-toast-*` variables
|
|
34
|
+
* (see theme.scss) rather than an `!important`-overridden utility class.
|
|
35
|
+
*/
|
|
36
|
+
// A ref-wrapped param (rare — most callers pass a plain object) is forwarded
|
|
37
|
+
// untouched: reading through it once here would snapshot every field, losing
|
|
38
|
+
// reactivity for the rest of the toast, not just its variant.
|
|
39
|
+
function maybeThemeParam(obj?: ToastOrchestratorCreateParam): ToastOrchestratorCreateParam | undefined {
|
|
40
|
+
if (!obj || isRef(obj)) return obj;
|
|
41
|
+
return themeToastParam(obj as Record<string, unknown>) as unknown as ToastOrchestratorCreateParam;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function useToast(): ReturnType<typeof useBvnToast> {
|
|
45
|
+
const toast = useBvnToast();
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
...toast,
|
|
49
|
+
create: (obj?: ToastOrchestratorCreateParam, options?: OrchestratorCreateOptions) =>
|
|
50
|
+
toast.create(maybeThemeParam(obj), options),
|
|
51
|
+
show: (obj?: ToastOrchestratorCreateParam) => toast.show(maybeThemeParam(obj)),
|
|
52
|
+
};
|
|
53
|
+
}
|