@evixcard/evx-ui-kit 1.11.1 → 1.11.3
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/EvPopup/EvPopup.vue.d.ts +113 -9
- package/dist/components/EvPopup/index.d.ts +1 -1
- package/dist/components/EvToast/EvToast.vue.d.ts +16 -1
- package/dist/components/EvToast/EvToastContainer.vue.d.ts +11 -1
- package/dist/components/EvToast/index.d.ts +2 -1
- package/dist/components/EvToast/types.d.ts +46 -0
- package/dist/components/EvToast/useToast.d.ts +7 -1
- package/dist/evx-ui-kit.cjs.js +6 -6
- package/dist/evx-ui-kit.cjs.js.map +1 -1
- package/dist/evx-ui-kit.css +1 -1
- package/dist/evx-ui-kit.es.js +4961 -4829
- package/dist/evx-ui-kit.es.js.map +1 -1
- package/dist/histoire/histoire.setup.d.ts +1 -0
- package/package.json +2 -1
|
@@ -1,27 +1,46 @@
|
|
|
1
|
-
export type EvPopupSize = 'sm' | 'md';
|
|
1
|
+
export type EvPopupSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
2
2
|
/** Per-element class overrides, merged over the defaults via `twMerge`. */
|
|
3
3
|
export interface EvPopupClasses {
|
|
4
4
|
backdrop?: string;
|
|
5
5
|
panel?: string;
|
|
6
6
|
header?: string;
|
|
7
7
|
title?: string;
|
|
8
|
+
/** Overrides for the top-right close button. */
|
|
9
|
+
closeButton?: string;
|
|
10
|
+
/** Overrides for the close icon inside the top-right button. */
|
|
11
|
+
closeIcon?: string;
|
|
8
12
|
/** Overrides for the scrollable body region (the default slot wrapper). */
|
|
9
13
|
body?: string;
|
|
14
|
+
/** Overrides for the fixed footer region (only rendered when the `#footer` slot is used). */
|
|
15
|
+
footer?: string;
|
|
10
16
|
}
|
|
11
17
|
export interface EvPopupProps {
|
|
12
18
|
isOpen: boolean;
|
|
13
19
|
title?: string;
|
|
14
20
|
/**
|
|
15
|
-
* Panel size preset.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* - `
|
|
19
|
-
*
|
|
20
|
-
* modals and other action-focused flows.
|
|
21
|
+
* Panel size preset (max-width). `sm`/`md` are the compact defaults; `lg`/`xl`/`2xl`
|
|
22
|
+
* are wider presets (DEV-788, for richer forms migrated off the retired EvModal).
|
|
23
|
+
* - `sm`: `max-w-sm`, `rounded-2xl`.
|
|
24
|
+
* - `md` (default): `max-w-[500px]`, `rounded-lg`.
|
|
25
|
+
* - `lg`: `max-w-2xl`. `xl`: `max-w-4xl`. `2xl`: `max-w-2xl`.
|
|
21
26
|
*/
|
|
22
27
|
size?: EvPopupSize;
|
|
23
28
|
/** When `false`, the top-right close (X) button is hidden. Default: `true`. */
|
|
24
29
|
showCloseButton?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* When `false`, Escape and backdrop-click no longer request close (only a
|
|
32
|
+
* programmatic `isOpen` change or an explicit action closes the modal) — for
|
|
33
|
+
* confirm/blocking dialogs. Default: `true`.
|
|
34
|
+
*/
|
|
35
|
+
dismissable?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Where to move focus when the popup opens.
|
|
38
|
+
* - `first` (default): let HeadlessUI focus the first focusable element.
|
|
39
|
+
* - `none`: focus the panel itself without auto-focusing a control.
|
|
40
|
+
* - any other string: query that CSS selector inside the panel and focus the
|
|
41
|
+
* match; fall back to `first` when nothing matches.
|
|
42
|
+
*/
|
|
43
|
+
initialFocus?: 'first' | 'none' | string;
|
|
25
44
|
/**
|
|
26
45
|
* Backdrop style. When `true` (default), the backdrop dims and blurs the page
|
|
27
46
|
* behind it (`bg-black/40 backdrop-blur-sm`). Set `false` to dim only
|
|
@@ -35,8 +54,50 @@ declare function __VLS_template(): {
|
|
|
35
54
|
attrs: Partial<{}>;
|
|
36
55
|
slots: {
|
|
37
56
|
default?(_: {}): any;
|
|
57
|
+
footer?(_: {}): any;
|
|
58
|
+
};
|
|
59
|
+
refs: {
|
|
60
|
+
dialogPanelRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
61
|
+
as: {
|
|
62
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
63
|
+
default: string;
|
|
64
|
+
};
|
|
65
|
+
id: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: null;
|
|
68
|
+
};
|
|
69
|
+
}>>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}>[] | null, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, Record<string, any>, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, {
|
|
74
|
+
id: string;
|
|
75
|
+
as: string | Record<string, any>;
|
|
76
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
77
|
+
P: {};
|
|
78
|
+
B: {};
|
|
79
|
+
D: {};
|
|
80
|
+
C: {};
|
|
81
|
+
M: {};
|
|
82
|
+
Defaults: {};
|
|
83
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
84
|
+
as: {
|
|
85
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
id: {
|
|
89
|
+
type: StringConstructor;
|
|
90
|
+
default: null;
|
|
91
|
+
};
|
|
92
|
+
}>>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}>[] | null, {}, {}, {}, {
|
|
97
|
+
id: string;
|
|
98
|
+
as: string | Record<string, any>;
|
|
99
|
+
}> | null;
|
|
38
100
|
};
|
|
39
|
-
refs: {};
|
|
40
101
|
rootEl: any;
|
|
41
102
|
};
|
|
42
103
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -48,7 +109,50 @@ declare const __VLS_component: import('vue').DefineComponent<EvPopupProps, {}, {
|
|
|
48
109
|
size: EvPopupSize;
|
|
49
110
|
blur: boolean;
|
|
50
111
|
showCloseButton: boolean;
|
|
51
|
-
|
|
112
|
+
dismissable: boolean;
|
|
113
|
+
initialFocus: "first" | "none" | string;
|
|
114
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
115
|
+
dialogPanelRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
116
|
+
as: {
|
|
117
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
118
|
+
default: string;
|
|
119
|
+
};
|
|
120
|
+
id: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
default: null;
|
|
123
|
+
};
|
|
124
|
+
}>>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
125
|
+
[key: string]: any;
|
|
126
|
+
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
127
|
+
[key: string]: any;
|
|
128
|
+
}>[] | null, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, Record<string, any>, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, {
|
|
129
|
+
id: string;
|
|
130
|
+
as: string | Record<string, any>;
|
|
131
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
132
|
+
P: {};
|
|
133
|
+
B: {};
|
|
134
|
+
D: {};
|
|
135
|
+
C: {};
|
|
136
|
+
M: {};
|
|
137
|
+
Defaults: {};
|
|
138
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
139
|
+
as: {
|
|
140
|
+
type: (ObjectConstructor | StringConstructor)[];
|
|
141
|
+
default: string;
|
|
142
|
+
};
|
|
143
|
+
id: {
|
|
144
|
+
type: StringConstructor;
|
|
145
|
+
default: null;
|
|
146
|
+
};
|
|
147
|
+
}>>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
148
|
+
[key: string]: any;
|
|
149
|
+
}> | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
150
|
+
[key: string]: any;
|
|
151
|
+
}>[] | null, {}, {}, {}, {
|
|
152
|
+
id: string;
|
|
153
|
+
as: string | Record<string, any>;
|
|
154
|
+
}> | null;
|
|
155
|
+
}, any>;
|
|
52
156
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
53
157
|
export default _default;
|
|
54
158
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as EvPopup } from './EvPopup.vue';
|
|
2
|
-
export type { EvPopupProps, EvPopupSize } from './EvPopup.vue';
|
|
2
|
+
export type { EvPopupProps, EvPopupSize, EvPopupClasses } from './EvPopup.vue';
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { EvToastVariant } from './types';
|
|
1
|
+
import { EvToastAppearance, EvToastVariant } from './types';
|
|
2
2
|
export interface EvToastProps {
|
|
3
3
|
variant?: EvToastVariant;
|
|
4
4
|
title?: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Card look. `default` = compact card with a leading status icon (admin style);
|
|
8
|
+
* `plain` = larger, icon-less card with a display-size title (customer style).
|
|
9
|
+
*/
|
|
10
|
+
appearance?: EvToastAppearance;
|
|
11
|
+
/**
|
|
12
|
+
* Force the leading status icon on/off. Defaults to on for `default` and off for
|
|
13
|
+
* `plain`. Set `true` on a `plain` toast to keep the white card but add a colored
|
|
14
|
+
* status icon (e.g. a red icon for errors).
|
|
15
|
+
*/
|
|
16
|
+
icon?: boolean;
|
|
17
|
+
/** Show a spinner in place of the status icon (even in `plain`). */
|
|
18
|
+
loading?: boolean;
|
|
6
19
|
class?: string;
|
|
7
20
|
}
|
|
8
21
|
declare function __VLS_template(): {
|
|
@@ -21,6 +34,8 @@ declare const __VLS_component: import('vue').DefineComponent<EvToastProps, {}, {
|
|
|
21
34
|
onDismiss?: (() => any) | undefined;
|
|
22
35
|
}>, {
|
|
23
36
|
variant: EvToastVariant;
|
|
37
|
+
icon: boolean;
|
|
38
|
+
appearance: EvToastAppearance;
|
|
24
39
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
25
40
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
41
|
export default _default;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { EvToastAppearance, EvToastPlacement } from './types';
|
|
2
|
+
export interface EvToastContainerProps {
|
|
3
|
+
/** Where the stack is anchored. Default `bottom-right` (admin). */
|
|
4
|
+
placement?: EvToastPlacement;
|
|
5
|
+
/** Card look applied to every toast in the stack. Default `default` (admin). */
|
|
6
|
+
appearance?: EvToastAppearance;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<EvToastContainerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<EvToastContainerProps> & Readonly<{}>, {
|
|
9
|
+
appearance: EvToastAppearance;
|
|
10
|
+
placement: EvToastPlacement;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
2
12
|
export default _default;
|
|
@@ -2,6 +2,7 @@ export { default } from './EvToast.vue';
|
|
|
2
2
|
export { default as EvToast } from './EvToast.vue';
|
|
3
3
|
export type { EvToastProps } from './EvToast.vue';
|
|
4
4
|
export { default as EvToastContainer } from './EvToastContainer.vue';
|
|
5
|
+
export type { EvToastContainerProps } from './EvToastContainer.vue';
|
|
5
6
|
export { useToast } from './useToast';
|
|
6
7
|
export type { UseToastReturn } from './useToast';
|
|
7
|
-
export type { EvToastVariant, EvToastOptions, EvToastItem } from './types';
|
|
8
|
+
export type { EvToastVariant, EvToastAppearance, EvToastPlacement, EvToastOptions, EvToastItem, } from './types';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export type EvToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
2
|
+
/**
|
|
3
|
+
* Card look. `default` = compact card with a leading status icon (admin style);
|
|
4
|
+
* `plain` = larger, icon-less card with a display-size title (customer style).
|
|
5
|
+
*/
|
|
6
|
+
export type EvToastAppearance = 'default' | 'plain';
|
|
7
|
+
/** Where the toast stack is anchored on screen. */
|
|
8
|
+
export type EvToastPlacement = 'bottom-right' | 'top-center';
|
|
2
9
|
export interface EvToastOptions {
|
|
3
10
|
/** Optional bold title line. */
|
|
4
11
|
title?: string;
|
|
@@ -8,9 +15,48 @@ export interface EvToastOptions {
|
|
|
8
15
|
variant?: EvToastVariant;
|
|
9
16
|
/** Auto-dismiss delay in ms. `0` (or negative) disables auto-dismiss. Default `4000`. */
|
|
10
17
|
duration?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Force the leading status icon on/off. Defaults to `true` for the `default`
|
|
20
|
+
* appearance and `false` for `plain`. Set `true` on a `plain` toast to keep the
|
|
21
|
+
* white card but add a colored status icon (e.g. a red icon for errors).
|
|
22
|
+
*/
|
|
23
|
+
icon?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Show a spinner in place of the status icon (even in `plain`) and keep the
|
|
26
|
+
* toast sticky — auto-dismiss is disabled until it is `update()`d or dismissed.
|
|
27
|
+
* Default `false`.
|
|
28
|
+
*/
|
|
29
|
+
loading?: boolean;
|
|
11
30
|
}
|
|
12
31
|
export interface EvToastItem extends Required<Pick<EvToastOptions, 'variant' | 'duration'>> {
|
|
13
32
|
id: number;
|
|
14
33
|
title?: string;
|
|
15
34
|
description?: string;
|
|
35
|
+
icon?: boolean;
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Content for one state of a promise-toast: a plain title string, a
|
|
40
|
+
* `{ title, description }` object, or a function of the resolved value / error
|
|
41
|
+
* returning either.
|
|
42
|
+
*/
|
|
43
|
+
export type EvToastContent<T = unknown> = string | {
|
|
44
|
+
title?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
} | ((arg: T) => string | {
|
|
47
|
+
title?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
});
|
|
50
|
+
export interface EvToastPromiseOptions<T = unknown> {
|
|
51
|
+
/** Shown immediately with a spinner while the promise is pending. */
|
|
52
|
+
loading: string | {
|
|
53
|
+
title?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
};
|
|
56
|
+
/** Shown when the promise resolves. Receives the resolved value. */
|
|
57
|
+
success: EvToastContent<T>;
|
|
58
|
+
/** Shown when the promise rejects. Receives the thrown error. */
|
|
59
|
+
error: EvToastContent<unknown>;
|
|
60
|
+
/** Auto-dismiss delay (ms) for the resolved success/error toast. Default `4000`. */
|
|
61
|
+
duration?: number;
|
|
16
62
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { DeepReadonly, Ref } from 'vue';
|
|
2
|
-
import { EvToastItem, EvToastOptions } from './types';
|
|
2
|
+
import { EvToastItem, EvToastOptions, EvToastPromiseOptions } from './types';
|
|
3
3
|
export interface UseToastReturn {
|
|
4
4
|
/** Reactive, read-only list of currently visible toasts. */
|
|
5
5
|
items: DeepReadonly<Ref<EvToastItem[]>>;
|
|
6
6
|
/** Push a toast; returns its id. */
|
|
7
7
|
push: (toast?: EvToastOptions) => number;
|
|
8
|
+
/** Merge a patch into an existing toast (re-arms auto-dismiss if `duration` is set). */
|
|
9
|
+
update: (id: number, patch?: Partial<EvToastOptions>) => void;
|
|
8
10
|
/** Dismiss a toast by id. */
|
|
9
11
|
dismiss: (id: number) => void;
|
|
10
12
|
/** Dismiss every toast. */
|
|
@@ -13,5 +15,9 @@ export interface UseToastReturn {
|
|
|
13
15
|
showSuccess: (titleOrOptions?: string | EvToastOptions, description?: string, options?: EvToastOptions) => number;
|
|
14
16
|
showWarning: (titleOrOptions?: string | EvToastOptions, description?: string, options?: EvToastOptions) => number;
|
|
15
17
|
showError: (titleOrOptions?: string | EvToastOptions, description?: string, options?: EvToastOptions) => number;
|
|
18
|
+
/** Push a sticky loading toast (spinner, no auto-dismiss); returns its id. */
|
|
19
|
+
showLoading: (titleOrOptions?: string | EvToastOptions, description?: string, options?: EvToastOptions) => number;
|
|
20
|
+
/** Bind a promise to a loading toast that resolves in place to success/error. */
|
|
21
|
+
promise: <T>(promise: Promise<T>, options: EvToastPromiseOptions<T>) => Promise<T>;
|
|
16
22
|
}
|
|
17
23
|
export declare function useToast(): UseToastReturn;
|