@sabrenski/spire-ui-vue 0.2.9 → 0.2.12
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/Dropdown/Dropdown.vue.d.ts +8 -3
- package/dist/components/Toast/Toast.vue.d.ts +5 -1
- package/dist/components/Toast/types.d.ts +13 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useOverlayRegistry/index.d.ts +1 -0
- package/dist/composables/useOverlayRegistry/useOverlayRegistry.d.ts +14 -0
- package/dist/composables/useToast/toastStore.d.ts +12 -0
- package/dist/spire-ui.cjs +36 -36
- package/dist/spire-ui.css +1 -1
- package/dist/spire-ui.js +16904 -16834
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DropdownProps, DropdownType } from './types';
|
|
2
|
+
declare function open(): void;
|
|
3
|
+
declare function toggle(): void;
|
|
2
4
|
declare function __VLS_template(): {
|
|
3
5
|
attrs: Partial<{}>;
|
|
4
6
|
slots: {
|
|
@@ -9,15 +11,18 @@ declare function __VLS_template(): {
|
|
|
9
11
|
};
|
|
10
12
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
13
|
declare const __VLS_component: import('vue').DefineComponent<DropdownProps, {
|
|
12
|
-
open:
|
|
14
|
+
open: typeof open;
|
|
13
15
|
close: () => void;
|
|
14
|
-
toggle:
|
|
16
|
+
toggle: typeof toggle;
|
|
15
17
|
isOpen: import('vue').Ref<boolean, boolean>;
|
|
16
18
|
setAnchorRef: (el: HTMLElement | null) => void;
|
|
17
19
|
setFloatingRef: (el: HTMLElement | null) => void;
|
|
18
20
|
triggerRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
19
21
|
menuRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
20
|
-
triggerProps: import('vue').ComputedRef<
|
|
22
|
+
triggerProps: import('vue').ComputedRef<{
|
|
23
|
+
onClick: (e: MouseEvent) => void;
|
|
24
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
25
|
+
}>;
|
|
21
26
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
27
|
close: () => any;
|
|
23
28
|
open: () => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToastColor, ToastVariant, ToastAction, ToastPlacement } from './types';
|
|
1
|
+
import { ToastColor, ToastVariant, ToastAction, ToastPlacement, ToastAvatar } from './types';
|
|
2
2
|
export interface ToastProps {
|
|
3
3
|
/** Unique identifier for the toast */
|
|
4
4
|
id: string;
|
|
@@ -6,12 +6,16 @@ export interface ToastProps {
|
|
|
6
6
|
title?: string;
|
|
7
7
|
/** Description/message text */
|
|
8
8
|
description?: string;
|
|
9
|
+
/** HTML content for description (use with caution - only trusted content) */
|
|
10
|
+
descriptionHtml?: string;
|
|
9
11
|
/** Color variant determining background/text colors */
|
|
10
12
|
color?: ToastColor;
|
|
11
13
|
/** Visual style variant */
|
|
12
14
|
variant?: ToastVariant;
|
|
13
15
|
/** Hide the default color-based icon */
|
|
14
16
|
hideIcon?: boolean;
|
|
17
|
+
/** Avatar configuration to display instead of icon */
|
|
18
|
+
avatar?: ToastAvatar;
|
|
15
19
|
/** Auto-dismiss timeout in milliseconds (0 = no auto-dismiss) */
|
|
16
20
|
timeout?: number;
|
|
17
21
|
/** Show close button */
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Component, InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { AvatarColor } from '../Avatar/types';
|
|
2
3
|
export type ToastColor = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
4
|
+
export interface ToastAvatar {
|
|
5
|
+
/** Image source URL */
|
|
6
|
+
src?: string;
|
|
7
|
+
/** Name used to generate initials fallback */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Background color for fallback state */
|
|
10
|
+
color?: AvatarColor;
|
|
11
|
+
}
|
|
3
12
|
export type ToastVariant = 'solid' | 'bordered' | 'flat';
|
|
4
13
|
export type ToastPlacement = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
5
14
|
export interface ToastAction {
|
|
@@ -14,6 +23,8 @@ export interface ToastProps {
|
|
|
14
23
|
title?: string;
|
|
15
24
|
/** Description/message text */
|
|
16
25
|
description?: string;
|
|
26
|
+
/** HTML content for description (use with caution - only trusted content) */
|
|
27
|
+
descriptionHtml?: string;
|
|
17
28
|
/** Color variant determining background/text colors */
|
|
18
29
|
color?: ToastColor;
|
|
19
30
|
/** Visual style variant */
|
|
@@ -22,6 +33,8 @@ export interface ToastProps {
|
|
|
22
33
|
icon?: Component;
|
|
23
34
|
/** Hide the default color-based icon */
|
|
24
35
|
hideIcon?: boolean;
|
|
36
|
+
/** Avatar configuration to display instead of icon */
|
|
37
|
+
avatar?: ToastAvatar;
|
|
25
38
|
/** Auto-dismiss timeout in milliseconds (0 = no auto-dismiss) */
|
|
26
39
|
timeout?: number;
|
|
27
40
|
/** Show close button */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useOverlayRegistry, type OverlayType } from './useOverlayRegistry';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type OverlayType = 'dropdown' | 'popover' | 'tooltip';
|
|
2
|
+
/**
|
|
3
|
+
* Global registry for managing overlay components (dropdowns, popovers, tooltips).
|
|
4
|
+
* Allows higher-priority overlays (like modals) to dismiss lower-priority ones when opening.
|
|
5
|
+
* Also tracks active modals to enforce containment rules.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useOverlayRegistry(): {
|
|
8
|
+
register: (id: string, type: OverlayType, close: () => void) => void;
|
|
9
|
+
unregister: (id: string) => void;
|
|
10
|
+
dismissAll: (types?: OverlayType[]) => void;
|
|
11
|
+
registerModal: (id: string, element: HTMLElement) => void;
|
|
12
|
+
unregisterModal: (id: string) => void;
|
|
13
|
+
canOpenOverlay: (triggerElement: HTMLElement | null) => boolean;
|
|
14
|
+
};
|
|
@@ -27,6 +27,7 @@ export declare const toastState: Ref<{
|
|
|
27
27
|
variant?: import('../..').ToastVariant | undefined;
|
|
28
28
|
title?: string | undefined;
|
|
29
29
|
description?: string | undefined;
|
|
30
|
+
descriptionHtml?: string | undefined;
|
|
30
31
|
color?: import('../..').ToastColor | undefined;
|
|
31
32
|
icon?: import('vue').FunctionalComponent<any, {}, any, {}> | {
|
|
32
33
|
new (...args: any[]): any;
|
|
@@ -152,6 +153,11 @@ export declare const toastState: Ref<{
|
|
|
152
153
|
} | undefined;
|
|
153
154
|
} | undefined;
|
|
154
155
|
hideIcon?: boolean | undefined;
|
|
156
|
+
avatar?: {
|
|
157
|
+
src?: string | undefined;
|
|
158
|
+
name?: string | undefined;
|
|
159
|
+
color?: import('../..').AvatarColor | undefined;
|
|
160
|
+
} | undefined;
|
|
155
161
|
timeout?: number | undefined;
|
|
156
162
|
closable?: boolean | undefined;
|
|
157
163
|
draggable?: boolean | undefined;
|
|
@@ -183,6 +189,7 @@ export declare const toastState: Ref<{
|
|
|
183
189
|
variant?: import('../..').ToastVariant | undefined;
|
|
184
190
|
title?: string | undefined;
|
|
185
191
|
description?: string | undefined;
|
|
192
|
+
descriptionHtml?: string | undefined;
|
|
186
193
|
color?: import('../..').ToastColor | undefined;
|
|
187
194
|
icon?: import('vue').FunctionalComponent<any, {}, any, {}> | {
|
|
188
195
|
new (...args: any[]): any;
|
|
@@ -308,6 +315,11 @@ export declare const toastState: Ref<{
|
|
|
308
315
|
} | undefined;
|
|
309
316
|
} | undefined;
|
|
310
317
|
hideIcon?: boolean | undefined;
|
|
318
|
+
avatar?: {
|
|
319
|
+
src?: string | undefined;
|
|
320
|
+
name?: string | undefined;
|
|
321
|
+
color?: import('../..').AvatarColor | undefined;
|
|
322
|
+
} | undefined;
|
|
311
323
|
timeout?: number | undefined;
|
|
312
324
|
closable?: boolean | undefined;
|
|
313
325
|
draggable?: boolean | undefined;
|