@mantine-vue/spotlight 1.1.2
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/cjs/index.cjs +1007 -0
- package/cjs/index.cjs.map +1 -0
- package/esm/index.mjs +991 -0
- package/esm/index.mjs.map +1 -0
- package/lib/Spotlight.context.d.ts +10 -0
- package/lib/Spotlight.d.ts +932 -0
- package/lib/SpotlightAction.d.ts +131 -0
- package/lib/SpotlightActionsGroup.d.ts +50 -0
- package/lib/SpotlightActionsList.d.ts +50 -0
- package/lib/SpotlightEmpty.d.ts +40 -0
- package/lib/SpotlightFooter.d.ts +40 -0
- package/lib/SpotlightRoot.d.ts +192 -0
- package/lib/SpotlightSearch.d.ts +81 -0
- package/lib/default-spotlight-filter.d.ts +2 -0
- package/lib/get-hotkeys.d.ts +3 -0
- package/lib/index.d.mts +12 -0
- package/lib/index.d.ts +12 -0
- package/lib/is-actions-group.d.ts +2 -0
- package/lib/limit-actions.d.ts +2 -0
- package/lib/spotlight.store.d.ts +54 -0
- package/lib/style-api.d.ts +3 -0
- package/package.json +44 -0
- package/styles.css +153 -0
- package/styles.layer.css +155 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export type SpotlightActionStylesNames = 'action' | 'actionLabel' | 'actionDescription' | 'actionSection' | 'actionBody';
|
|
3
|
+
export interface SpotlightActionProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
leftSection?: any;
|
|
7
|
+
rightSection?: any;
|
|
8
|
+
dimmedSections?: boolean;
|
|
9
|
+
highlightQuery?: boolean;
|
|
10
|
+
highlightColor?: string;
|
|
11
|
+
closeSpotlightOnTrigger?: boolean;
|
|
12
|
+
keywords?: string | string[];
|
|
13
|
+
classNames?: Record<string, any>;
|
|
14
|
+
styles?: Record<string, any>;
|
|
15
|
+
vars?: Record<string, any>;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export declare const SpotlightAction: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
|
+
label: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
description: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: undefined;
|
|
26
|
+
};
|
|
27
|
+
leftSection: {
|
|
28
|
+
type: PropType<any>;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
rightSection: {
|
|
32
|
+
type: PropType<any>;
|
|
33
|
+
default: undefined;
|
|
34
|
+
};
|
|
35
|
+
dimmedSections: {
|
|
36
|
+
type: BooleanConstructor;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
39
|
+
highlightQuery: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: undefined;
|
|
42
|
+
};
|
|
43
|
+
highlightColor: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: undefined;
|
|
46
|
+
};
|
|
47
|
+
closeSpotlightOnTrigger: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: undefined;
|
|
50
|
+
};
|
|
51
|
+
keywords: {
|
|
52
|
+
type: PropType<string | string[]>;
|
|
53
|
+
default: undefined;
|
|
54
|
+
};
|
|
55
|
+
classNames: {
|
|
56
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
57
|
+
default: undefined;
|
|
58
|
+
};
|
|
59
|
+
styles: {
|
|
60
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
63
|
+
vars: {
|
|
64
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
67
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
68
|
+
[key: string]: any;
|
|
69
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
70
|
+
label: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
74
|
+
description: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
leftSection: {
|
|
79
|
+
type: PropType<any>;
|
|
80
|
+
default: undefined;
|
|
81
|
+
};
|
|
82
|
+
rightSection: {
|
|
83
|
+
type: PropType<any>;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
dimmedSections: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
highlightQuery: {
|
|
91
|
+
type: BooleanConstructor;
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
highlightColor: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
default: undefined;
|
|
97
|
+
};
|
|
98
|
+
closeSpotlightOnTrigger: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: undefined;
|
|
101
|
+
};
|
|
102
|
+
keywords: {
|
|
103
|
+
type: PropType<string | string[]>;
|
|
104
|
+
default: undefined;
|
|
105
|
+
};
|
|
106
|
+
classNames: {
|
|
107
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
108
|
+
default: undefined;
|
|
109
|
+
};
|
|
110
|
+
styles: {
|
|
111
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
112
|
+
default: undefined;
|
|
113
|
+
};
|
|
114
|
+
vars: {
|
|
115
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
118
|
+
}>> & Readonly<{}>, {
|
|
119
|
+
label: string;
|
|
120
|
+
classNames: Function | Record<string, any>;
|
|
121
|
+
styles: Function | Record<string, any>;
|
|
122
|
+
description: string;
|
|
123
|
+
vars: Function | Record<string, any>;
|
|
124
|
+
leftSection: any;
|
|
125
|
+
rightSection: any;
|
|
126
|
+
dimmedSections: boolean;
|
|
127
|
+
highlightQuery: boolean;
|
|
128
|
+
highlightColor: string;
|
|
129
|
+
closeSpotlightOnTrigger: boolean;
|
|
130
|
+
keywords: string | string[];
|
|
131
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export type SpotlightActionsGroupStylesNames = 'actionsGroup';
|
|
3
|
+
export interface SpotlightActionsGroupProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
classNames?: Record<string, any>;
|
|
6
|
+
styles?: Record<string, any>;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export declare const SpotlightActionsGroup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
classNames: {
|
|
15
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
styles: {
|
|
19
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
20
|
+
default: undefined;
|
|
21
|
+
};
|
|
22
|
+
vars: {
|
|
23
|
+
type: PropType<any>;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
label: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
classNames: {
|
|
34
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
styles: {
|
|
38
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
vars: {
|
|
42
|
+
type: PropType<any>;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
}>> & Readonly<{}>, {
|
|
46
|
+
label: string;
|
|
47
|
+
classNames: Function | Record<string, any>;
|
|
48
|
+
styles: Function | Record<string, any>;
|
|
49
|
+
vars: any;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export type SpotlightActionsListStylesNames = 'actionsList' | 'actionsListInner';
|
|
3
|
+
export interface SpotlightActionsListProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
classNames?: Record<string, any>;
|
|
6
|
+
styles?: Record<string, any>;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export declare const SpotlightActionsList: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
id: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: undefined;
|
|
13
|
+
};
|
|
14
|
+
classNames: {
|
|
15
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
styles: {
|
|
19
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
20
|
+
default: undefined;
|
|
21
|
+
};
|
|
22
|
+
vars: {
|
|
23
|
+
type: PropType<any>;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
id: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
classNames: {
|
|
34
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
styles: {
|
|
38
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
39
|
+
default: undefined;
|
|
40
|
+
};
|
|
41
|
+
vars: {
|
|
42
|
+
type: PropType<any>;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
}>> & Readonly<{}>, {
|
|
46
|
+
classNames: Function | Record<string, any>;
|
|
47
|
+
styles: Function | Record<string, any>;
|
|
48
|
+
id: string;
|
|
49
|
+
vars: any;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export type SpotlightEmptyStylesNames = 'empty';
|
|
3
|
+
export interface SpotlightEmptyProps {
|
|
4
|
+
classNames?: Record<string, any>;
|
|
5
|
+
styles?: Record<string, any>;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const SpotlightEmpty: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
|
+
classNames: {
|
|
10
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
styles: {
|
|
14
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
vars: {
|
|
18
|
+
type: PropType<any>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
classNames: {
|
|
25
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
styles: {
|
|
29
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
30
|
+
default: undefined;
|
|
31
|
+
};
|
|
32
|
+
vars: {
|
|
33
|
+
type: PropType<any>;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
classNames: Function | Record<string, any>;
|
|
38
|
+
styles: Function | Record<string, any>;
|
|
39
|
+
vars: any;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export type SpotlightFooterStylesNames = 'footer';
|
|
3
|
+
export interface SpotlightFooterProps {
|
|
4
|
+
classNames?: Record<string, any>;
|
|
5
|
+
styles?: Record<string, any>;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const SpotlightFooter: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
|
+
classNames: {
|
|
10
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
11
|
+
default: undefined;
|
|
12
|
+
};
|
|
13
|
+
styles: {
|
|
14
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
15
|
+
default: undefined;
|
|
16
|
+
};
|
|
17
|
+
vars: {
|
|
18
|
+
type: PropType<any>;
|
|
19
|
+
default: undefined;
|
|
20
|
+
};
|
|
21
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
classNames: {
|
|
25
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
styles: {
|
|
29
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
30
|
+
default: undefined;
|
|
31
|
+
};
|
|
32
|
+
vars: {
|
|
33
|
+
type: PropType<any>;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
classNames: Function | Record<string, any>;
|
|
38
|
+
styles: Function | Record<string, any>;
|
|
39
|
+
vars: any;
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import { type SpotlightStore } from './spotlight.store';
|
|
3
|
+
export type SpotlightRootStylesNames = 'root' | 'body' | 'close' | 'content' | 'header' | 'inner' | 'overlay' | 'title' | 'search' | 'actionsList' | 'actionsListInner' | 'action' | 'empty' | 'footer' | 'actionBody' | 'actionLabel' | 'actionDescription' | 'actionSection' | 'actionsGroup';
|
|
4
|
+
export interface SpotlightRootProps {
|
|
5
|
+
store?: SpotlightStore;
|
|
6
|
+
query?: string;
|
|
7
|
+
onQueryChange?: (query: string) => void;
|
|
8
|
+
clearQueryOnClose?: boolean;
|
|
9
|
+
shortcut?: string | string[] | null;
|
|
10
|
+
tagsToIgnore?: string[];
|
|
11
|
+
triggerOnContentEditable?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
onSpotlightOpen?: () => void;
|
|
14
|
+
onSpotlightClose?: () => void;
|
|
15
|
+
forceOpened?: boolean;
|
|
16
|
+
closeOnActionTrigger?: boolean;
|
|
17
|
+
maxHeight?: string | number;
|
|
18
|
+
scrollable?: boolean;
|
|
19
|
+
classNames?: Record<string, any>;
|
|
20
|
+
styles?: Record<string, any>;
|
|
21
|
+
vars?: Record<string, any>;
|
|
22
|
+
unstyled?: boolean;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
export declare const SpotlightRoot: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
|
+
store: {
|
|
27
|
+
type: PropType<SpotlightStore>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
query: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
onQueryChange: {
|
|
35
|
+
type: PropType<(query: string) => void>;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
clearQueryOnClose: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
shortcut: {
|
|
43
|
+
type: PropType<string | string[] | null>;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
tagsToIgnore: {
|
|
47
|
+
type: PropType<string[]>;
|
|
48
|
+
default: undefined;
|
|
49
|
+
};
|
|
50
|
+
triggerOnContentEditable: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
disabled: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: boolean;
|
|
57
|
+
};
|
|
58
|
+
onSpotlightOpen: {
|
|
59
|
+
type: PropType<() => void>;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
onSpotlightClose: {
|
|
63
|
+
type: PropType<() => void>;
|
|
64
|
+
default: undefined;
|
|
65
|
+
};
|
|
66
|
+
forceOpened: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
closeOnActionTrigger: {
|
|
71
|
+
type: BooleanConstructor;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
74
|
+
maxHeight: {
|
|
75
|
+
type: PropType<string | number>;
|
|
76
|
+
default: undefined;
|
|
77
|
+
};
|
|
78
|
+
scrollable: {
|
|
79
|
+
type: BooleanConstructor;
|
|
80
|
+
default: boolean;
|
|
81
|
+
};
|
|
82
|
+
classNames: {
|
|
83
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
styles: {
|
|
87
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
vars: {
|
|
91
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
unstyled: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
101
|
+
store: {
|
|
102
|
+
type: PropType<SpotlightStore>;
|
|
103
|
+
default: undefined;
|
|
104
|
+
};
|
|
105
|
+
query: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: undefined;
|
|
108
|
+
};
|
|
109
|
+
onQueryChange: {
|
|
110
|
+
type: PropType<(query: string) => void>;
|
|
111
|
+
default: undefined;
|
|
112
|
+
};
|
|
113
|
+
clearQueryOnClose: {
|
|
114
|
+
type: BooleanConstructor;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
shortcut: {
|
|
118
|
+
type: PropType<string | string[] | null>;
|
|
119
|
+
default: undefined;
|
|
120
|
+
};
|
|
121
|
+
tagsToIgnore: {
|
|
122
|
+
type: PropType<string[]>;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
triggerOnContentEditable: {
|
|
126
|
+
type: BooleanConstructor;
|
|
127
|
+
default: undefined;
|
|
128
|
+
};
|
|
129
|
+
disabled: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
default: boolean;
|
|
132
|
+
};
|
|
133
|
+
onSpotlightOpen: {
|
|
134
|
+
type: PropType<() => void>;
|
|
135
|
+
default: undefined;
|
|
136
|
+
};
|
|
137
|
+
onSpotlightClose: {
|
|
138
|
+
type: PropType<() => void>;
|
|
139
|
+
default: undefined;
|
|
140
|
+
};
|
|
141
|
+
forceOpened: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: boolean;
|
|
144
|
+
};
|
|
145
|
+
closeOnActionTrigger: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: undefined;
|
|
148
|
+
};
|
|
149
|
+
maxHeight: {
|
|
150
|
+
type: PropType<string | number>;
|
|
151
|
+
default: undefined;
|
|
152
|
+
};
|
|
153
|
+
scrollable: {
|
|
154
|
+
type: BooleanConstructor;
|
|
155
|
+
default: boolean;
|
|
156
|
+
};
|
|
157
|
+
classNames: {
|
|
158
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
159
|
+
default: undefined;
|
|
160
|
+
};
|
|
161
|
+
styles: {
|
|
162
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
163
|
+
default: undefined;
|
|
164
|
+
};
|
|
165
|
+
vars: {
|
|
166
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
167
|
+
default: undefined;
|
|
168
|
+
};
|
|
169
|
+
unstyled: {
|
|
170
|
+
type: BooleanConstructor;
|
|
171
|
+
default: boolean;
|
|
172
|
+
};
|
|
173
|
+
}>> & Readonly<{}>, {
|
|
174
|
+
classNames: Function | Record<string, any>;
|
|
175
|
+
styles: Function | Record<string, any>;
|
|
176
|
+
query: string;
|
|
177
|
+
disabled: boolean;
|
|
178
|
+
maxHeight: string | number;
|
|
179
|
+
vars: Function | Record<string, any>;
|
|
180
|
+
unstyled: boolean;
|
|
181
|
+
store: SpotlightStore;
|
|
182
|
+
shortcut: string | string[] | null;
|
|
183
|
+
onQueryChange: (query: string) => void;
|
|
184
|
+
clearQueryOnClose: boolean;
|
|
185
|
+
tagsToIgnore: string[];
|
|
186
|
+
triggerOnContentEditable: boolean;
|
|
187
|
+
onSpotlightOpen: () => void;
|
|
188
|
+
onSpotlightClose: () => void;
|
|
189
|
+
forceOpened: boolean;
|
|
190
|
+
closeOnActionTrigger: boolean;
|
|
191
|
+
scrollable: boolean;
|
|
192
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
export type SpotlightSearchStylesNames = 'input' | 'wrapper' | 'section' | 'bottomSection';
|
|
3
|
+
export interface SpotlightSearchProps {
|
|
4
|
+
size?: string | number;
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (event: Event) => void;
|
|
7
|
+
onKeydown?: (event: KeyboardEvent) => void;
|
|
8
|
+
classNames?: Record<string, any>;
|
|
9
|
+
styles?: Record<string, any>;
|
|
10
|
+
vars?: Record<string, any>;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
export declare const SpotlightSearch: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
size: {
|
|
15
|
+
type: PropType<string | number>;
|
|
16
|
+
default: undefined;
|
|
17
|
+
};
|
|
18
|
+
value: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: undefined;
|
|
21
|
+
};
|
|
22
|
+
onChange: {
|
|
23
|
+
type: PropType<(event: Event) => void>;
|
|
24
|
+
default: undefined;
|
|
25
|
+
};
|
|
26
|
+
onKeydown: {
|
|
27
|
+
type: PropType<(event: KeyboardEvent) => void>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
classNames: {
|
|
31
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
32
|
+
default: undefined;
|
|
33
|
+
};
|
|
34
|
+
styles: {
|
|
35
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
vars: {
|
|
39
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
40
|
+
default: undefined;
|
|
41
|
+
};
|
|
42
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
|
+
size: {
|
|
46
|
+
type: PropType<string | number>;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
value: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
onChange: {
|
|
54
|
+
type: PropType<(event: Event) => void>;
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
onKeydown: {
|
|
58
|
+
type: PropType<(event: KeyboardEvent) => void>;
|
|
59
|
+
default: undefined;
|
|
60
|
+
};
|
|
61
|
+
classNames: {
|
|
62
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
63
|
+
default: undefined;
|
|
64
|
+
};
|
|
65
|
+
styles: {
|
|
66
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
67
|
+
default: undefined;
|
|
68
|
+
};
|
|
69
|
+
vars: {
|
|
70
|
+
type: (ObjectConstructor | FunctionConstructor)[];
|
|
71
|
+
default: undefined;
|
|
72
|
+
};
|
|
73
|
+
}>> & Readonly<{}>, {
|
|
74
|
+
size: string | number;
|
|
75
|
+
onChange: (event: Event) => void;
|
|
76
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
77
|
+
value: string;
|
|
78
|
+
classNames: Function | Record<string, any>;
|
|
79
|
+
styles: Function | Record<string, any>;
|
|
80
|
+
vars: Function | Record<string, any>;
|
|
81
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/lib/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { spotlight, createSpotlight, createSpotlightStore, useSpotlight, openSpotlight, closeSpotlight, toggleSpotlight, } from './spotlight.store';
|
|
2
|
+
export type { SpotlightState, SpotlightStore } from './spotlight.store';
|
|
3
|
+
export { isActionsGroup } from './is-actions-group';
|
|
4
|
+
export { Spotlight } from './Spotlight';
|
|
5
|
+
export { SpotlightRoot } from './SpotlightRoot';
|
|
6
|
+
export { SpotlightAction } from './SpotlightAction';
|
|
7
|
+
export { SpotlightActionsGroup } from './SpotlightActionsGroup';
|
|
8
|
+
export { SpotlightActionsList } from './SpotlightActionsList';
|
|
9
|
+
export { SpotlightEmpty } from './SpotlightEmpty';
|
|
10
|
+
export { SpotlightFooter } from './SpotlightFooter';
|
|
11
|
+
export { SpotlightSearch } from './SpotlightSearch';
|
|
12
|
+
export type { SpotlightActionData, SpotlightActionGroupData, SpotlightActions, SpotlightActionProps, SpotlightActionStylesNames, SpotlightActionsGroupProps, SpotlightActionsGroupStylesNames, SpotlightActionsListProps, SpotlightActionsListStylesNames, SpotlightEmptyProps, SpotlightEmptyStylesNames, SpotlightFilterFunction, SpotlightFooterProps, SpotlightFooterStylesNames, SpotlightProps, SpotlightRootProps, SpotlightRootStylesNames, SpotlightSearchProps, SpotlightSearchStylesNames, SpotlightStylesNames, } from './Spotlight';
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { spotlight, createSpotlight, createSpotlightStore, useSpotlight, openSpotlight, closeSpotlight, toggleSpotlight, } from './spotlight.store';
|
|
2
|
+
export type { SpotlightState, SpotlightStore } from './spotlight.store';
|
|
3
|
+
export { isActionsGroup } from './is-actions-group';
|
|
4
|
+
export { Spotlight } from './Spotlight';
|
|
5
|
+
export { SpotlightRoot } from './SpotlightRoot';
|
|
6
|
+
export { SpotlightAction } from './SpotlightAction';
|
|
7
|
+
export { SpotlightActionsGroup } from './SpotlightActionsGroup';
|
|
8
|
+
export { SpotlightActionsList } from './SpotlightActionsList';
|
|
9
|
+
export { SpotlightEmpty } from './SpotlightEmpty';
|
|
10
|
+
export { SpotlightFooter } from './SpotlightFooter';
|
|
11
|
+
export { SpotlightSearch } from './SpotlightSearch';
|
|
12
|
+
export type { SpotlightActionData, SpotlightActionGroupData, SpotlightActions, SpotlightActionProps, SpotlightActionStylesNames, SpotlightActionsGroupProps, SpotlightActionsGroupStylesNames, SpotlightActionsListProps, SpotlightActionsListStylesNames, SpotlightEmptyProps, SpotlightEmptyStylesNames, SpotlightFilterFunction, SpotlightFooterProps, SpotlightFooterStylesNames, SpotlightProps, SpotlightRootProps, SpotlightRootStylesNames, SpotlightSearchProps, SpotlightSearchStylesNames, SpotlightStylesNames, } from './Spotlight';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import { type MantineStore } from '@mantine-vue/store';
|
|
3
|
+
export interface SpotlightState {
|
|
4
|
+
opened: boolean;
|
|
5
|
+
selected: number;
|
|
6
|
+
listId: string;
|
|
7
|
+
query: string;
|
|
8
|
+
empty: boolean;
|
|
9
|
+
registeredActions: Set<string>;
|
|
10
|
+
}
|
|
11
|
+
export type SpotlightStore = MantineStore<SpotlightState>;
|
|
12
|
+
export declare const createSpotlightStore: () => MantineStore<SpotlightState>;
|
|
13
|
+
export declare const useSpotlight: (store: SpotlightStore) => Readonly<Ref<SpotlightState>>;
|
|
14
|
+
export declare function updateSpotlightStateAction(update: (state: SpotlightState) => Partial<SpotlightState>, store: SpotlightStore): void;
|
|
15
|
+
export declare function openSpotlightAction(store: SpotlightStore): void;
|
|
16
|
+
export declare function closeSpotlightAction(store: SpotlightStore): void;
|
|
17
|
+
export declare function toggleSpotlightAction(store: SpotlightStore): void;
|
|
18
|
+
export declare function setSelectedAction(index: number, store: SpotlightStore): void;
|
|
19
|
+
export declare function setListId(id: string, store: SpotlightStore): void;
|
|
20
|
+
export declare function selectAction(index: number, store: SpotlightStore): number;
|
|
21
|
+
export declare function selectNextAction(store: SpotlightStore): number;
|
|
22
|
+
export declare function selectPreviousAction(store: SpotlightStore): number;
|
|
23
|
+
export declare function triggerSelectedAction(store: SpotlightStore): void;
|
|
24
|
+
export declare function registerAction(id: string, store: SpotlightStore): () => void;
|
|
25
|
+
export declare function setQuery(query: string, store: SpotlightStore): void;
|
|
26
|
+
export declare function clearSpotlightState({ clearQuery }: {
|
|
27
|
+
clearQuery: boolean | undefined;
|
|
28
|
+
}, store: SpotlightStore): void;
|
|
29
|
+
export declare const spotlightActions: {
|
|
30
|
+
open: typeof openSpotlightAction;
|
|
31
|
+
close: typeof closeSpotlightAction;
|
|
32
|
+
toggle: typeof toggleSpotlightAction;
|
|
33
|
+
updateState: typeof updateSpotlightStateAction;
|
|
34
|
+
setSelectedAction: typeof setSelectedAction;
|
|
35
|
+
setListId: typeof setListId;
|
|
36
|
+
selectAction: typeof selectAction;
|
|
37
|
+
selectNextAction: typeof selectNextAction;
|
|
38
|
+
selectPreviousAction: typeof selectPreviousAction;
|
|
39
|
+
triggerSelectedAction: typeof triggerSelectedAction;
|
|
40
|
+
registerAction: typeof registerAction;
|
|
41
|
+
setQuery: typeof setQuery;
|
|
42
|
+
clearSpotlightState: typeof clearSpotlightState;
|
|
43
|
+
};
|
|
44
|
+
export declare function createSpotlight(): readonly [MantineStore<SpotlightState>, {
|
|
45
|
+
open: () => void;
|
|
46
|
+
close: () => void;
|
|
47
|
+
toggle: () => void;
|
|
48
|
+
}];
|
|
49
|
+
export declare const spotlightStore: MantineStore<SpotlightState>, spotlight: {
|
|
50
|
+
open: () => void;
|
|
51
|
+
close: () => void;
|
|
52
|
+
toggle: () => void;
|
|
53
|
+
};
|
|
54
|
+
export declare const openSpotlight: () => void, closeSpotlight: () => void, toggleSpotlight: () => void;
|