@mantine-vue/spotlight 2.0.0 → 2.1.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.
- package/cjs/index.cjs +29 -39
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +30 -40
- package/esm/index.mjs.map +1 -1
- package/lib/Spotlight.d.ts +13 -11
- package/lib/SpotlightAction.d.ts +13 -10
- package/lib/SpotlightSearch.d.ts +1 -1
- package/package.json +4 -4
package/cjs/index.cjs
CHANGED
|
@@ -218,29 +218,6 @@ function useSpotlightContext() {
|
|
|
218
218
|
if (ctx === null) throw new Error("Spotlight component was not found in tree");
|
|
219
219
|
return ctx;
|
|
220
220
|
}
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region src/style-api.ts
|
|
223
|
-
function mergeClassNames(...items) {
|
|
224
|
-
return items.reduce((acc, item) => {
|
|
225
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
226
|
-
Object.entries(item).forEach(([key, value]) => {
|
|
227
|
-
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
228
|
-
});
|
|
229
|
-
return acc;
|
|
230
|
-
}, {});
|
|
231
|
-
}
|
|
232
|
-
function mergeStyles(...items) {
|
|
233
|
-
return items.reduce((acc, item) => {
|
|
234
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
235
|
-
Object.entries(item).forEach(([key, value]) => {
|
|
236
|
-
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
237
|
-
});
|
|
238
|
-
return acc;
|
|
239
|
-
}, {});
|
|
240
|
-
}
|
|
241
|
-
function renderContent$1(value) {
|
|
242
|
-
return typeof value === "function" ? value() : value;
|
|
243
|
-
}
|
|
244
221
|
var Spotlight_module_default = {
|
|
245
222
|
root: "_root_87n7g_1",
|
|
246
223
|
content: "_content_87n7g_7",
|
|
@@ -265,6 +242,7 @@ var defaultProps$3 = {
|
|
|
265
242
|
var SpotlightAction = (0, vue.defineComponent)({
|
|
266
243
|
name: "SpotlightAction",
|
|
267
244
|
inheritAttrs: false,
|
|
245
|
+
slots: Object,
|
|
268
246
|
props: {
|
|
269
247
|
label: {
|
|
270
248
|
type: String,
|
|
@@ -275,21 +253,11 @@ var SpotlightAction = (0, vue.defineComponent)({
|
|
|
275
253
|
default: void 0
|
|
276
254
|
},
|
|
277
255
|
leftSection: {
|
|
278
|
-
type:
|
|
279
|
-
String,
|
|
280
|
-
Number,
|
|
281
|
-
Object,
|
|
282
|
-
Function
|
|
283
|
-
],
|
|
256
|
+
type: null,
|
|
284
257
|
default: void 0
|
|
285
258
|
},
|
|
286
259
|
rightSection: {
|
|
287
|
-
type:
|
|
288
|
-
String,
|
|
289
|
-
Number,
|
|
290
|
-
Object,
|
|
291
|
-
Function
|
|
292
|
-
],
|
|
260
|
+
type: null,
|
|
293
261
|
default: void 0
|
|
294
262
|
},
|
|
295
263
|
dimmedSections: {
|
|
@@ -333,6 +301,8 @@ var SpotlightAction = (0, vue.defineComponent)({
|
|
|
333
301
|
classNames: props.classNames,
|
|
334
302
|
styles: props.styles
|
|
335
303
|
};
|
|
304
|
+
const leftSection = (0, _mantine_vue_core.resolveNode)(props.leftSection, slots.leftSection);
|
|
305
|
+
const rightSection = (0, _mantine_vue_core.resolveNode)(props.rightSection, slots.rightSection);
|
|
336
306
|
const labelNode = props.highlightQuery && typeof props.label === "string" ? (0, vue.h)(_mantine_vue_core.Highlight, {
|
|
337
307
|
component: "span",
|
|
338
308
|
highlight: ctx.query,
|
|
@@ -357,23 +327,23 @@ var SpotlightAction = (0, vue.defineComponent)({
|
|
|
357
327
|
},
|
|
358
328
|
tabindex: -1
|
|
359
329
|
}, () => slots.default?.() ?? [
|
|
360
|
-
|
|
330
|
+
(0, _mantine_vue_core.hasNode)(leftSection) ? (0, vue.h)(_mantine_vue_core.Box, {
|
|
361
331
|
component: "span",
|
|
362
332
|
mod: {
|
|
363
333
|
position: "left",
|
|
364
334
|
dimmed: props.dimmedSections
|
|
365
335
|
},
|
|
366
336
|
...ctx.getStyles("actionSection", stylesApi)
|
|
367
|
-
}, () =>
|
|
337
|
+
}, () => leftSection) : null,
|
|
368
338
|
(0, vue.h)("span", ctx.getStyles("actionBody", stylesApi), [labelNode, (0, vue.h)("span", ctx.getStyles("actionDescription", stylesApi), props.description)]),
|
|
369
|
-
|
|
339
|
+
(0, _mantine_vue_core.hasNode)(rightSection) ? (0, vue.h)(_mantine_vue_core.Box, {
|
|
370
340
|
component: "span",
|
|
371
341
|
mod: {
|
|
372
342
|
position: "right",
|
|
373
343
|
dimmed: props.dimmedSections
|
|
374
344
|
},
|
|
375
345
|
...ctx.getStyles("actionSection", stylesApi)
|
|
376
|
-
}, () =>
|
|
346
|
+
}, () => rightSection) : null
|
|
377
347
|
]);
|
|
378
348
|
};
|
|
379
349
|
}
|
|
@@ -545,6 +515,26 @@ function getHotkeys(hotkeys, store) {
|
|
|
545
515
|
return [[hotkeys, open]];
|
|
546
516
|
}
|
|
547
517
|
//#endregion
|
|
518
|
+
//#region src/style-api.ts
|
|
519
|
+
function mergeClassNames(...items) {
|
|
520
|
+
return items.reduce((acc, item) => {
|
|
521
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
522
|
+
Object.entries(item).forEach(([key, value]) => {
|
|
523
|
+
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
524
|
+
});
|
|
525
|
+
return acc;
|
|
526
|
+
}, {});
|
|
527
|
+
}
|
|
528
|
+
function mergeStyles(...items) {
|
|
529
|
+
return items.reduce((acc, item) => {
|
|
530
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
531
|
+
Object.entries(item).forEach(([key, value]) => {
|
|
532
|
+
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
533
|
+
});
|
|
534
|
+
return acc;
|
|
535
|
+
}, {});
|
|
536
|
+
}
|
|
537
|
+
//#endregion
|
|
548
538
|
//#region src/SpotlightRoot.ts
|
|
549
539
|
var defaultProps$2 = {
|
|
550
540
|
size: 600,
|
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/spotlight.store.ts","../src/is-actions-group.ts","../src/default-spotlight-filter.ts","../src/limit-actions.ts","../src/Spotlight.context.ts","../src/style-api.ts","../src/Spotlight.module.css","../src/SpotlightAction.ts","../src/SpotlightActionsGroup.ts","../src/SpotlightActionsList.ts","../src/SpotlightEmpty.ts","../src/SpotlightFooter.ts","../src/get-hotkeys.ts","../src/SpotlightRoot.ts","../src/SpotlightSearch.ts","../src/Spotlight.ts"],"sourcesContent":["import { type Ref } from 'vue'\nimport { createStore, type MantineStore } from '@mantine-vue/store'\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value))\n}\n\nexport interface SpotlightState {\n opened: boolean\n selected: number\n listId: string\n query: string\n empty: boolean\n registeredActions: Set<string>\n}\n\nexport type SpotlightStore = MantineStore<SpotlightState>\n\nexport const createSpotlightStore = () =>\n createStore<SpotlightState>({\n opened: false,\n empty: false,\n selected: -1,\n listId: '',\n query: '',\n registeredActions: new Set(),\n })\n\nexport const useSpotlight = (store: SpotlightStore): Readonly<Ref<SpotlightState>> => store.value\n\nexport function updateSpotlightStateAction(\n update: (state: SpotlightState) => Partial<SpotlightState>,\n store: SpotlightStore,\n) {\n const state = store.getState()\n store.setState({ ...state, ...update(store.getState()) })\n}\n\nexport function openSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: true, selected: -1 }), store)\n}\n\nexport function closeSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: false }), store)\n}\n\nexport function toggleSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(\n (state) => ({ opened: !state.opened, selected: state.opened ? state.selected : -1 }),\n store,\n )\n}\n\nexport function setSelectedAction(index: number, store: SpotlightStore) {\n store.setState((state) => ({ ...state, selected: index }))\n}\n\nexport function setListId(id: string, store: SpotlightStore) {\n store.setState((state) => ({ ...state, listId: id }))\n}\n\nfunction findElementByQuerySelector<T extends HTMLElement>(\n selector: string,\n root: Document | Element | ShadowRoot = document,\n): T | null {\n const element = root.querySelector<T>(selector)\n\n if (element) {\n return element\n }\n\n const children = root instanceof ShadowRoot ? root.host.children : root.children\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i]\n\n if (child.shadowRoot) {\n const shadowElement = findElementByQuerySelector<T>(selector, child.shadowRoot)\n\n if (shadowElement) {\n return shadowElement\n }\n }\n\n const nestedElement = findElementByQuerySelector<T>(selector, child)\n\n if (nestedElement) {\n return nestedElement\n }\n }\n\n return null\n}\n\nexport function selectAction(index: number, store: SpotlightStore): number {\n const state = store.getState()\n const actionsList = state.listId ? findElementByQuerySelector(`#${state.listId}`) : null\n const selected = actionsList?.querySelector<HTMLButtonElement>('[data-selected]')\n const actions = actionsList?.querySelectorAll<HTMLButtonElement>('[data-action]') ?? []\n const nextIndex = index === -1 ? actions.length - 1 : index === actions.length ? 0 : index\n const selectedIndex = clamp(nextIndex, 0, actions.length - 1)\n\n selected?.removeAttribute('data-selected')\n actions[selectedIndex]?.scrollIntoView?.({ block: 'nearest' })\n actions[selectedIndex]?.setAttribute('data-selected', 'true')\n setSelectedAction(selectedIndex, store)\n\n return selectedIndex\n}\n\nexport function selectNextAction(store: SpotlightStore) {\n return selectAction(store.getState().selected + 1, store)\n}\n\nexport function selectPreviousAction(store: SpotlightStore) {\n return selectAction(store.getState().selected - 1, store)\n}\n\nexport function triggerSelectedAction(store: SpotlightStore) {\n const state = store.getState()\n const selected = state.listId\n ? findElementByQuerySelector<HTMLButtonElement>(`#${state.listId} [data-selected]`)\n : null\n\n selected?.click()\n}\n\nexport function registerAction(id: string, store: SpotlightStore) {\n const state = store.getState()\n state.registeredActions.add(id)\n\n return () => {\n state.registeredActions.delete(id)\n }\n}\n\nexport function setQuery(query: string, store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ query }), store)\n Promise.resolve().then(() => {\n selectAction(0, store)\n updateSpotlightStateAction(\n (state) => ({\n empty: (state.query.trim().length > 0 && state.registeredActions.size === 0) || false,\n }),\n store,\n )\n })\n}\n\nexport function clearSpotlightState(\n { clearQuery }: { clearQuery: boolean | undefined },\n store: SpotlightStore,\n) {\n store.setState((state) => ({\n ...state,\n selected: -1,\n query: clearQuery ? '' : state.query,\n empty: clearQuery ? false : state.empty,\n }))\n}\n\nexport const spotlightActions = {\n open: openSpotlightAction,\n close: closeSpotlightAction,\n toggle: toggleSpotlightAction,\n updateState: updateSpotlightStateAction,\n setSelectedAction,\n setListId,\n selectAction,\n selectNextAction,\n selectPreviousAction,\n triggerSelectedAction,\n registerAction,\n setQuery,\n clearSpotlightState,\n}\n\nexport function createSpotlight() {\n const store = createSpotlightStore()\n const actions = {\n open: () => openSpotlightAction(store),\n close: () => closeSpotlightAction(store),\n toggle: () => toggleSpotlightAction(store),\n }\n\n return [store, actions] as const\n}\n\nexport const [spotlightStore, spotlight] = createSpotlight()\nexport const { open: openSpotlight, close: closeSpotlight, toggle: toggleSpotlight } = spotlight\n","import type { SpotlightActionData, SpotlightActionGroupData } from './Spotlight'\n\nexport function isActionsGroup(\n item: SpotlightActionData | SpotlightActionGroupData,\n): item is SpotlightActionGroupData {\n const group = item as SpotlightActionGroupData\n return group.group !== undefined && Array.isArray(group.actions)\n}\n","import type {\n SpotlightActionData,\n SpotlightActionGroupData,\n SpotlightActions,\n SpotlightFilterFunction,\n} from './Spotlight'\n\nfunction getKeywords(keywords: string | string[] | undefined) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim()\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim()\n }\n\n return ''\n}\n\nfunction getFlatActions(data: SpotlightActions[]) {\n return data.reduce<SpotlightActionData[]>((acc, item) => {\n if ('actions' in item) {\n return [\n ...acc,\n ...item.actions.map((action: SpotlightActionData) => ({ ...action, group: item.group })),\n ]\n }\n\n return [...acc, item]\n }, [])\n}\n\nfunction flatActionsToGroups(data: SpotlightActionData[]) {\n const groups: Record<string, { pushed: boolean; data: SpotlightActionGroupData }> = {}\n const result: SpotlightActions[] = []\n\n data.forEach((action) => {\n if (action.group) {\n if (!groups[action.group]) {\n groups[action.group] = { pushed: false, data: { group: action.group, actions: [] } }\n }\n\n groups[action.group].data.actions.push(action)\n\n if (!groups[action.group].pushed) {\n groups[action.group].pushed = true\n result.push(groups[action.group].data)\n }\n } else {\n result.push(action)\n }\n })\n\n return result\n}\n\nexport const defaultSpotlightFilter: SpotlightFilterFunction = (_query, data) => {\n const query = _query.trim().toLowerCase()\n const priorityMatrix: SpotlightActionData[][] = [[], []]\n const flatActions = getFlatActions(data)\n\n flatActions.forEach((item) => {\n if (item.label?.toLowerCase().includes(query)) {\n priorityMatrix[0].push(item)\n } else if (\n item.description?.toLowerCase().includes(query) ||\n getKeywords(item.keywords).includes(query)\n ) {\n priorityMatrix[1].push(item)\n }\n })\n\n return flatActionsToGroups(priorityMatrix.flat())\n}\n","import { isActionsGroup } from './is-actions-group'\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight'\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n if (!Array.isArray(actions)) {\n return []\n }\n\n let count = 0\n\n return actions.reduce<SpotlightActions[]>((acc, item) => {\n if (count >= limit) {\n return acc\n }\n\n if (isActionsGroup(item)) {\n const groupActions = limitActions(item.actions, limit - count)\n acc.push({\n group: item.group,\n actions: groupActions as SpotlightActionData[],\n })\n count += groupActions.length\n } else {\n acc.push(item)\n count += 1\n }\n\n return acc\n }, [])\n}\n","import type { InjectionKey } from 'vue'\nimport { inject, provide } from 'vue'\nimport type { SpotlightStore } from './spotlight.store'\n\nexport interface SpotlightContextValue {\n query: string\n setQuery: (query: string) => void\n getStyles: (selector: string, options?: Record<string, any>) => Record<string, any>\n store: SpotlightStore\n closeOnActionTrigger: boolean | undefined\n}\n\nconst SpotlightContextKey = Symbol('SpotlightContext') as InjectionKey<SpotlightContextValue>\n\nexport function provideSpotlightContext(value: SpotlightContextValue) {\n provide(SpotlightContextKey, value)\n}\n\nexport function useSpotlightContext() {\n const ctx = inject(SpotlightContextKey, null)\n\n if (ctx === null) {\n throw new Error('Spotlight component was not found in tree')\n }\n\n return ctx\n}\n","export function mergeClassNames(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function mergeStyles(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n",".root {\n &[data-scrollable] {\n --spotlight-content-height: 100%;\n }\n}\n\n.content {\n overflow: hidden;\n height: var(--spotlight-content-height, auto);\n max-height: var(--spotlight-max-height);\n}\n\n.body {\n display: flex;\n flex-direction: column;\n height: var(--spotlight-content-height, auto);\n}\n\n.search {\n border: 0;\n background-color: transparent;\n}\n\n.actionsList {\n --spotlight-actions-list-padding: 4px;\n\n border-top: 1px solid;\n flex: 1;\n padding: var(--spotlight-actions-list-padding);\n max-height: calc(100vh - 15rem);\n margin-inline-end: calc(var(--spotlight-actions-list-padding) * -1);\n width: 100%;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.action {\n display: flex;\n align-items: center;\n width: 100%;\n padding: 7px var(--mantine-spacing-md);\n border-radius: var(--mantine-radius-default);\n background-color: transparent;\n color: inherit;\n text-align: start;\n\n &:where(:not([data-selected])) {\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-selected]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-opacity: 0.7;\n }\n}\n\n.actionBody {\n flex: 1;\n}\n\n.actionSection {\n opacity: 1;\n color: inherit;\n\n &:where([data-dimmed]) {\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n }\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-md);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--mantine-spacing-md);\n }\n\n & > svg {\n display: block;\n }\n}\n\n.actionLabel {\n display: block;\n}\n\n.actionDescription {\n display: block;\n font-size: var(--mantine-font-size-xs);\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n}\n\n.empty {\n color: var(--mantine-color-dimmed);\n padding: var(--mantine-spacing-md);\n text-align: center;\n}\n\n.footer {\n padding: var(--mantine-spacing-xs) calc(var(--mantine-spacing-md) + rem(4px));\n border-top: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.actionsGroup {\n display: flex;\n flex-direction: column;\n margin-top: var(--mantine-spacing-md);\n\n &::before {\n content: var(--spotlight-label);\n text-transform: uppercase;\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n color: var(--mantine-color-dimmed);\n padding-inline-start: var(--mantine-spacing-md);\n }\n\n &:empty {\n display: none;\n }\n}\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, Highlight, UnstyledButton, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport { renderContent } from './style-api'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionStylesNames =\n | 'action'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionBody'\n\nexport interface SpotlightActionProps {\n label?: string\n description?: string\n leftSection?: any\n rightSection?: any\n dimmedSections?: boolean\n highlightQuery?: boolean\n highlightColor?: string\n closeSpotlightOnTrigger?: boolean\n keywords?: string | string[]\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n dimmedSections: true,\n highlightQuery: false,\n} satisfies Partial<SpotlightActionProps>\n\nexport const SpotlightAction = defineComponent({\n name: 'SpotlightAction',\n inheritAttrs: false,\n props: {\n label: { type: String, default: undefined },\n description: { type: String, default: undefined },\n leftSection: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n rightSection: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n dimmedSections: { type: Boolean, default: undefined },\n highlightQuery: { type: Boolean, default: undefined },\n highlightColor: { type: String, default: undefined },\n closeSpotlightOnTrigger: { type: Boolean, default: undefined },\n keywords: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionProps>('SpotlightAction', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () => {\n const stylesApi = { classNames: props.classNames, styles: props.styles }\n const labelNode =\n props.highlightQuery && typeof props.label === 'string'\n ? h(\n Highlight,\n {\n component: 'span',\n highlight: ctx.query,\n color: props.highlightColor,\n ...ctx.getStyles('actionLabel', stylesApi),\n },\n () => props.label,\n )\n : h('span', ctx.getStyles('actionLabel', stylesApi), props.label)\n\n return h(\n UnstyledButton,\n {\n ...attrs,\n 'data-action': true,\n ...ctx.getStyles('action', {\n className: attrs.class,\n style: attrs.style,\n ...stylesApi,\n }),\n onMousedown: (event: MouseEvent) => {\n event.preventDefault()\n ;(attrs.onMousedown as ((event: MouseEvent) => void) | undefined)?.(event)\n },\n onClick: (event: MouseEvent) => {\n ;(attrs.onClick as ((event: MouseEvent) => void) | undefined)?.(event)\n\n if (props.closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) {\n spotlightActions.close(ctx.store)\n }\n },\n tabindex: -1,\n },\n () =>\n slots.default?.() ?? [\n props.leftSection\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'left', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => renderContent(props.leftSection),\n )\n : null,\n h('span', ctx.getStyles('actionBody', stylesApi), [\n labelNode,\n h('span', ctx.getStyles('actionDescription', stylesApi), props.description),\n ]),\n props.rightSection\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'right', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => renderContent(props.rightSection),\n )\n : null,\n ],\n )\n }\n },\n})\n\nObject.assign(SpotlightAction, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup'\n\nexport interface SpotlightActionsGroupProps {\n label?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsGroup = defineComponent({\n name: 'SpotlightActionsGroup',\n inheritAttrs: false,\n props: {\n label: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsGroupProps>(\n 'SpotlightActionsGroup',\n null,\n rawProps as any,\n )\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('actionsGroup', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n style: [\n ctx.getStyles('actionsGroup', { styles: props.styles }).style,\n attrs.style as any,\n {\n '--spotlight-label': `'${props.label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n },\n ],\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsGroup, { classes })\n","import { defineComponent, h, onBeforeUnmount, onMounted, type PropType } from 'vue'\nimport { ScrollAreaAutosize, useProps } from '@mantine-vue/core'\nimport { useId } from '@mantine-vue/hooks'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsListStylesNames = 'actionsList' | 'actionsListInner'\n\nexport interface SpotlightActionsListProps {\n id?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsList = defineComponent({\n name: 'SpotlightActionsList',\n inheritAttrs: false,\n props: {\n id: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsListProps>('SpotlightActionsList', null, rawProps as any)\n const ctx = useSpotlightContext()\n const generatedId = useId()\n const listId = props.id || `mantine-${generatedId.value.replace(/:/g, '')}`\n\n onMounted(() => spotlightActions.setListId(listId, ctx.store))\n onBeforeUnmount(() => spotlightActions.setListId('', ctx.store))\n\n return () =>\n h(\n ScrollAreaAutosize,\n {\n ...attrs,\n ...ctx.getStyles('actionsList', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n type: 'scroll',\n scrollbarSize: 'var(--spotlight-actions-list-padding)',\n offsetScrollbars: 'y',\n id: listId,\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsList, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightEmptyStylesNames = 'empty'\n\nexport interface SpotlightEmptyProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightEmpty = defineComponent({\n name: 'SpotlightEmpty',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightEmptyProps>('SpotlightEmpty', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('empty', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightEmpty, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFooterStylesNames = 'footer'\n\nexport interface SpotlightFooterProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightFooter = defineComponent({\n name: 'SpotlightFooter',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightFooterProps>('SpotlightFooter', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('footer', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightFooter, { classes })\n","import type { HotkeyItem } from '@mantine-vue/hooks'\nimport type { SpotlightStore } from './spotlight.store'\nimport { spotlightActions } from './spotlight.store'\n\nexport function getHotkeys(\n hotkeys: string | string[] | null | undefined,\n store: SpotlightStore,\n): HotkeyItem[] {\n if (!hotkeys) {\n return []\n }\n\n const open = () => spotlightActions.open(store)\n\n if (Array.isArray(hotkeys)) {\n return hotkeys.map((hotkey) => [hotkey, open])\n }\n\n return [[hotkeys, open]]\n}\n","import { computed, defineComponent, h, ref, watch, type PropType } from 'vue'\nimport { Modal, getDefaultZIndex, rem, useProps, useStyles } from '@mantine-vue/core'\nimport { useHotkeys } from '@mantine-vue/hooks'\nimport { getHotkeys } from './get-hotkeys'\nimport { provideSpotlightContext } from './Spotlight.context'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport {\n spotlightActions,\n spotlightStore,\n useSpotlight,\n type SpotlightStore,\n} from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightRootStylesNames =\n | 'root'\n | 'body'\n | 'close'\n | 'content'\n | 'header'\n | 'inner'\n | 'overlay'\n | 'title'\n | 'search'\n | 'actionsList'\n | 'actionsListInner'\n | 'action'\n | 'empty'\n | 'footer'\n | 'actionBody'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionsGroup'\n\nexport interface SpotlightRootProps {\n store?: SpotlightStore\n query?: string\n onQueryChange?: (query: string) => void\n clearQueryOnClose?: boolean\n shortcut?: string | string[] | null\n tagsToIgnore?: string[]\n triggerOnContentEditable?: boolean\n disabled?: boolean\n onSpotlightOpen?: () => void\n onSpotlightClose?: () => void\n forceOpened?: boolean\n closeOnActionTrigger?: boolean\n maxHeight?: string | number\n scrollable?: boolean\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n unstyled?: boolean\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n maxHeight: 400,\n} satisfies Partial<SpotlightRootProps>\n\nexport const SpotlightRoot = defineComponent({\n name: 'SpotlightRoot',\n inheritAttrs: false,\n props: {\n store: { type: Object as PropType<SpotlightStore>, default: undefined },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: {\n type: [String, Array, null] as PropType<string | string[] | null>,\n default: undefined,\n },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightRootProps>('SpotlightRoot', defaultProps, rawProps as any)\n const state = useSpotlight(props.store!)\n const previousOpened = ref(state.value.opened)\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : state.value.query,\n )\n\n const setQuery = (query: string) => {\n props.onQueryChange?.(query)\n spotlightActions.setQuery(query, props.store!)\n }\n\n const getStyles = useStyles({\n name: 'Spotlight',\n classes,\n props,\n className: attrs.class,\n style: attrs.style as any,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n })\n\n provideSpotlightContext({\n get query() {\n return currentQuery.value\n },\n setQuery,\n getStyles,\n store: props.store!,\n get closeOnActionTrigger() {\n return props.closeOnActionTrigger\n },\n })\n\n useHotkeys(\n () => getHotkeys(props.shortcut, props.store!),\n () => props.tagsToIgnore,\n () => props.triggerOnContentEditable,\n )\n\n watch(\n () => state.value.opened,\n (opened) => {\n if (opened === previousOpened.value) {\n return\n }\n\n if (opened) {\n props.onSpotlightOpen?.()\n } else {\n props.onSpotlightClose?.()\n }\n previousOpened.value = opened\n },\n )\n\n return () => {\n if (props.disabled) {\n return null\n }\n\n const rootStyles = getStyles('root', { className: attrs.class, style: attrs.style as any })\n\n const {\n classNames: _classNames,\n styles: _styles,\n vars: _vars,\n unstyled: _unstyled,\n store: _store,\n query: _query,\n onQueryChange: _onQueryChange,\n clearQueryOnClose: _clearQueryOnClose,\n shortcut: _shortcut,\n tagsToIgnore: _tagsToIgnore,\n triggerOnContentEditable: _triggerOnContentEditable,\n disabled: _disabled,\n onSpotlightOpen: _onSpotlightOpen,\n onSpotlightClose: _onSpotlightClose,\n forceOpened: _forceOpened,\n closeOnActionTrigger: _closeOnActionTrigger,\n maxHeight: _maxHeight,\n scrollable: _scrollable,\n ...modalAttrs\n } = { ...attrs, ...props }\n\n return h(\n Modal,\n {\n ...modalAttrs,\n withCloseButton: false,\n opened: state.value.opened || !!props.forceOpened,\n padding: 0,\n onClose: () => spotlightActions.close(props.store!),\n class: rootStyles.class,\n style: rootStyles.style,\n classNames: mergeClassNames(\n {\n body: classes.body,\n content: classes.content,\n },\n props.classNames,\n ),\n styles: mergeStyles(props.styles),\n vars: mergeStyles(\n {\n root: {\n '--spotlight-max-height': props.scrollable ? rem(props.maxHeight) : undefined,\n },\n },\n props.vars,\n ),\n onExitTransitionEnd: () => {\n if (props.clearQueryOnClose) {\n setQuery('')\n }\n\n spotlightActions.clearSpotlightState(\n { clearQuery: props.clearQueryOnClose },\n props.store!,\n )\n props.transitionProps?.onExited?.()\n props.onExitTransitionEnd?.()\n },\n 'data-scrollable': props.scrollable || undefined,\n },\n slots,\n )\n }\n },\n})\n\nObject.assign(SpotlightRoot, { classes })\n","import { defineComponent, h, ref, type PropType } from 'vue'\nimport { Input, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightSearchStylesNames = 'input' | 'wrapper' | 'section' | 'bottomSection'\n\nexport interface SpotlightSearchProps {\n size?: string | number\n value?: string\n onChange?: (event: Event) => void\n onKeydown?: (event: KeyboardEvent) => void\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 'lg',\n} satisfies Partial<SpotlightSearchProps>\n\nexport const SpotlightSearch = defineComponent({\n name: 'SpotlightSearch',\n inheritAttrs: false,\n props: {\n size: { type: [String, Number] as PropType<string | number>, default: undefined },\n value: { type: String, default: undefined },\n onChange: { type: Function as PropType<(event: Event) => void>, default: undefined },\n onKeydown: { type: Function as PropType<(event: KeyboardEvent) => void>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightSearchProps>('SpotlightSearch', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n const isComposing = ref(false)\n\n const handleKeydown = (event: KeyboardEvent) => {\n props.onKeydown?.(event)\n\n if (isComposing.value) {\n return\n }\n\n if (event.code === 'ArrowDown') {\n event.preventDefault()\n spotlightActions.selectNextAction(ctx.store)\n }\n\n if (event.code === 'ArrowUp') {\n event.preventDefault()\n spotlightActions.selectPreviousAction(ctx.store)\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n event.preventDefault()\n spotlightActions.triggerSelectedAction(ctx.store)\n }\n }\n\n return () => {\n const inputStyles = ctx.getStyles('search')\n\n return h(Input, {\n ...attrs,\n size: props.size,\n value: props.value ?? ctx.query,\n classNames: mergeClassNames({ input: inputStyles.class }, props.classNames),\n styles: mergeStyles({ input: inputStyles.style }, props.styles),\n vars: props.vars,\n onInput: (event: Event) => {\n ctx.setQuery((event.currentTarget as HTMLInputElement).value)\n props.onChange?.(event)\n },\n onKeydown: handleKeydown,\n onCompositionstart: () => {\n isComposing.value = true\n },\n onCompositionend: () => {\n isComposing.value = false\n },\n })\n }\n },\n})\n\nObject.assign(SpotlightSearch, { classes })\n","import { computed, defineComponent, h, ref, type PropType } from 'vue'\nimport { getDefaultZIndex, useProps } from '@mantine-vue/core'\nimport { defaultSpotlightFilter } from './default-spotlight-filter'\nimport { isActionsGroup } from './is-actions-group'\nimport { limitActions } from './limit-actions'\nimport { spotlight, spotlightStore } from './spotlight.store'\nimport {\n SpotlightAction,\n type SpotlightActionProps,\n type SpotlightActionStylesNames,\n} from './SpotlightAction'\nimport {\n SpotlightActionsGroup,\n type SpotlightActionsGroupProps,\n type SpotlightActionsGroupStylesNames,\n} from './SpotlightActionsGroup'\nimport {\n SpotlightActionsList,\n type SpotlightActionsListProps,\n type SpotlightActionsListStylesNames,\n} from './SpotlightActionsList'\nimport {\n SpotlightEmpty,\n type SpotlightEmptyProps,\n type SpotlightEmptyStylesNames,\n} from './SpotlightEmpty'\nimport {\n SpotlightFooter,\n type SpotlightFooterProps,\n type SpotlightFooterStylesNames,\n} from './SpotlightFooter'\nimport {\n SpotlightRoot,\n type SpotlightRootProps,\n type SpotlightRootStylesNames,\n} from './SpotlightRoot'\nimport {\n SpotlightSearch,\n type SpotlightSearchProps,\n type SpotlightSearchStylesNames,\n} from './SpotlightSearch'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFilterFunction = (\n query: string,\n actions: SpotlightActions[],\n) => SpotlightActions[]\n\nexport interface SpotlightActionData extends SpotlightActionProps {\n id: string\n group?: string\n}\n\nexport interface SpotlightActionGroupData {\n group: string\n actions: SpotlightActionData[]\n}\n\nexport type SpotlightActions = SpotlightActionData | SpotlightActionGroupData\nexport type SpotlightStylesNames = SpotlightRootStylesNames\n\nexport interface SpotlightProps extends SpotlightRootProps {\n searchProps?: SpotlightSearchProps\n actions: SpotlightActions[]\n filter?: SpotlightFilterFunction\n nothingFound?: any\n highlightQuery?: boolean\n limit?: number\n scrollAreaProps?: Partial<SpotlightActionsListProps>\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n limit: Infinity,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n filter: defaultSpotlightFilter,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n} satisfies Partial<SpotlightProps>\n\nfunction renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n\nconst SpotlightBase = defineComponent({\n name: 'Spotlight',\n inheritAttrs: false,\n props: {\n searchProps: { type: Object as PropType<SpotlightSearchProps>, default: undefined },\n actions: { type: Array as PropType<SpotlightActions[]>, required: true },\n filter: { type: Function as PropType<SpotlightFilterFunction>, default: undefined },\n nothingFound: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n highlightQuery: { type: Boolean, default: false },\n limit: { type: Number, default: undefined },\n scrollAreaProps: {\n type: Object as PropType<Partial<SpotlightActionsListProps>>,\n default: undefined,\n },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n store: { type: Object as PropType<SpotlightRootProps['store']>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: { type: [String, Array] as PropType<string | string[] | null>, default: undefined },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightProps>('Spotlight', defaultProps, rawProps as any)\n const uncontrolledQuery = ref('')\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : uncontrolledQuery.value,\n )\n\n const setQuery = (query: string) => {\n if (typeof props.query !== 'string') {\n uncontrolledQuery.value = query\n }\n\n props.onQueryChange?.(query)\n }\n\n return () => {\n const filteredActions = limitActions(\n props.filter!(currentQuery.value, props.actions),\n props.limit!,\n )\n const renderedActions = filteredActions.map((item) => {\n if (isActionsGroup(item)) {\n return h(SpotlightActionsGroup, { key: item.group, label: item.group }, () =>\n item.actions.map(({ id, ...actionData }) =>\n h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n }),\n ),\n )\n }\n\n const { id, ...actionData } = item\n return h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n })\n })\n const {\n searchProps: _searchProps,\n actions: _actions,\n filter: _filter,\n nothingFound: _nothingFound,\n highlightQuery: _highlightQuery,\n limit: _limit,\n scrollAreaProps: _scrollAreaProps,\n query: _query,\n onQueryChange: _onQueryChange,\n ...rootProps\n } = props\n\n return h(\n SpotlightRoot,\n {\n ...attrs,\n ...rootProps,\n query: currentQuery.value,\n onQueryChange: setQuery,\n },\n () => [\n h(SpotlightSearch, props.searchProps),\n renderedActions.length > 0\n ? h(SpotlightActionsList, props.scrollAreaProps, () => renderedActions)\n : null,\n renderedActions.length === 0 && props.nothingFound\n ? h(SpotlightEmpty, null, () => renderContent(props.nothingFound))\n : null,\n ],\n )\n }\n },\n})\n\nexport const Spotlight = Object.assign(SpotlightBase, {\n classes,\n Search: SpotlightSearch,\n ActionsList: SpotlightActionsList,\n Action: SpotlightAction,\n Empty: SpotlightEmpty,\n Footer: SpotlightFooter,\n ActionsGroup: SpotlightActionsGroup,\n Root: SpotlightRoot,\n open: spotlight.open,\n close: spotlight.close,\n toggle: spotlight.toggle,\n})\n\nexport type {\n SpotlightActionProps,\n SpotlightActionStylesNames,\n SpotlightActionsGroupProps,\n SpotlightActionsGroupStylesNames,\n SpotlightActionsListProps,\n SpotlightActionsListStylesNames,\n SpotlightEmptyProps,\n SpotlightEmptyStylesNames,\n SpotlightFooterProps,\n SpotlightFooterStylesNames,\n SpotlightRootProps,\n SpotlightRootStylesNames,\n SpotlightSearchProps,\n SpotlightSearchStylesNames,\n}\n"],"mappings":";;;;;;AAGA,SAAS,MAAM,OAAe,KAAa,KAAa;CACtD,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;AAaA,IAAa,8BAAA,GAAA,mBAAA,aACiB;CAC1B,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,mCAAmB,IAAI,IAAI;AAC7B,CAAC;AAEH,IAAa,gBAAgB,UAAyD,MAAM;AAE5F,SAAgB,2BACd,QACA,OACA;CACA,MAAM,QAAQ,MAAM,SAAS;CAC7B,MAAM,SAAS;EAAE,GAAG;EAAO,GAAG,OAAO,MAAM,SAAS,CAAC;CAAE,CAAC;AAC1D;AAEA,SAAgB,oBAAoB,OAAuB;CACzD,kCAAkC;EAAE,QAAQ;EAAM,UAAU;CAAG,IAAI,KAAK;AAC1E;AAEA,SAAgB,qBAAqB,OAAuB;CAC1D,kCAAkC,EAAE,QAAQ,MAAM,IAAI,KAAK;AAC7D;AAEA,SAAgB,sBAAsB,OAAuB;CAC3D,4BACG,WAAW;EAAE,QAAQ,CAAC,MAAM;EAAQ,UAAU,MAAM,SAAS,MAAM,WAAW;CAAG,IAClF,KACF;AACF;AAEA,SAAgB,kBAAkB,OAAe,OAAuB;CACtE,MAAM,UAAU,WAAW;EAAE,GAAG;EAAO,UAAU;CAAM,EAAE;AAC3D;AAEA,SAAgB,UAAU,IAAY,OAAuB;CAC3D,MAAM,UAAU,WAAW;EAAE,GAAG;EAAO,QAAQ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F;IAGF,MAAM,EAAE,IAAI,GAAG,eAAe;IAC9B,QAAA,GAAA,IAAA,GAAS,iBAAiB;KACxB,KAAK;KACL,gBAAgB,MAAM;KACtB,GAAG;IACL,CAAC;GACH,CAAC;GACD,MAAM,EACJ,aAAa,cACb,SAAS,UACT,QAAQ,SACR,cAAc,eACd,gBAAgB,iBAChB,OAAO,QACP,iBAAiB,kBACjB,OAAO,QACP,eAAe,gBACf,GAAG,cACD;GAEJ,QAAA,GAAA,IAAA,GACE,eACA;IACE,GAAG;IACH,GAAG;IACH,OAAO,aAAa;IACpB,eAAe;GACjB,SACM;eACF,iBAAiB,MAAM,WAAW;IACpC,gBAAgB,SAAS,KAAA,GAAA,IAAA,GACnB,sBAAsB,MAAM,uBAAuB,eAAe,IACpE;IACJ,gBAAgB,WAAW,KAAK,MAAM,gBAAA,GAAA,IAAA,GAChC,gBAAgB,YAAY,cAAc,MAAM,YAAY,CAAC,IAC/D;GACN,CACF;EACF;CACF;AACF,CAAC;AAED,IAAa,YAAY,OAAO,OAAO,eAAe;CACpD,SAAA;CACA,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,cAAc;CACd,MAAM;CACN,MAAM,UAAU;CAChB,OAAO,UAAU;CACjB,QAAQ,UAAU;AACpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/spotlight.store.ts","../src/is-actions-group.ts","../src/default-spotlight-filter.ts","../src/limit-actions.ts","../src/Spotlight.context.ts","../src/Spotlight.module.css","../src/SpotlightAction.ts","../src/SpotlightActionsGroup.ts","../src/SpotlightActionsList.ts","../src/SpotlightEmpty.ts","../src/SpotlightFooter.ts","../src/get-hotkeys.ts","../src/style-api.ts","../src/SpotlightRoot.ts","../src/SpotlightSearch.ts","../src/Spotlight.ts"],"sourcesContent":["import { type Ref } from 'vue'\nimport { createStore, type MantineStore } from '@mantine-vue/store'\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value))\n}\n\nexport interface SpotlightState {\n opened: boolean\n selected: number\n listId: string\n query: string\n empty: boolean\n registeredActions: Set<string>\n}\n\nexport type SpotlightStore = MantineStore<SpotlightState>\n\nexport const createSpotlightStore = () =>\n createStore<SpotlightState>({\n opened: false,\n empty: false,\n selected: -1,\n listId: '',\n query: '',\n registeredActions: new Set(),\n })\n\nexport const useSpotlight = (store: SpotlightStore): Readonly<Ref<SpotlightState>> => store.value\n\nexport function updateSpotlightStateAction(\n update: (state: SpotlightState) => Partial<SpotlightState>,\n store: SpotlightStore,\n) {\n const state = store.getState()\n store.setState({ ...state, ...update(store.getState()) })\n}\n\nexport function openSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: true, selected: -1 }), store)\n}\n\nexport function closeSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: false }), store)\n}\n\nexport function toggleSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(\n (state) => ({ opened: !state.opened, selected: state.opened ? state.selected : -1 }),\n store,\n )\n}\n\nexport function setSelectedAction(index: number, store: SpotlightStore) {\n store.setState((state) => ({ ...state, selected: index }))\n}\n\nexport function setListId(id: string, store: SpotlightStore) {\n store.setState((state) => ({ ...state, listId: id }))\n}\n\nfunction findElementByQuerySelector<T extends HTMLElement>(\n selector: string,\n root: Document | Element | ShadowRoot = document,\n): T | null {\n const element = root.querySelector<T>(selector)\n\n if (element) {\n return element\n }\n\n const children = root instanceof ShadowRoot ? root.host.children : root.children\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i]\n\n if (child.shadowRoot) {\n const shadowElement = findElementByQuerySelector<T>(selector, child.shadowRoot)\n\n if (shadowElement) {\n return shadowElement\n }\n }\n\n const nestedElement = findElementByQuerySelector<T>(selector, child)\n\n if (nestedElement) {\n return nestedElement\n }\n }\n\n return null\n}\n\nexport function selectAction(index: number, store: SpotlightStore): number {\n const state = store.getState()\n const actionsList = state.listId ? findElementByQuerySelector(`#${state.listId}`) : null\n const selected = actionsList?.querySelector<HTMLButtonElement>('[data-selected]')\n const actions = actionsList?.querySelectorAll<HTMLButtonElement>('[data-action]') ?? []\n const nextIndex = index === -1 ? actions.length - 1 : index === actions.length ? 0 : index\n const selectedIndex = clamp(nextIndex, 0, actions.length - 1)\n\n selected?.removeAttribute('data-selected')\n actions[selectedIndex]?.scrollIntoView?.({ block: 'nearest' })\n actions[selectedIndex]?.setAttribute('data-selected', 'true')\n setSelectedAction(selectedIndex, store)\n\n return selectedIndex\n}\n\nexport function selectNextAction(store: SpotlightStore) {\n return selectAction(store.getState().selected + 1, store)\n}\n\nexport function selectPreviousAction(store: SpotlightStore) {\n return selectAction(store.getState().selected - 1, store)\n}\n\nexport function triggerSelectedAction(store: SpotlightStore) {\n const state = store.getState()\n const selected = state.listId\n ? findElementByQuerySelector<HTMLButtonElement>(`#${state.listId} [data-selected]`)\n : null\n\n selected?.click()\n}\n\nexport function registerAction(id: string, store: SpotlightStore) {\n const state = store.getState()\n state.registeredActions.add(id)\n\n return () => {\n state.registeredActions.delete(id)\n }\n}\n\nexport function setQuery(query: string, store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ query }), store)\n Promise.resolve().then(() => {\n selectAction(0, store)\n updateSpotlightStateAction(\n (state) => ({\n empty: (state.query.trim().length > 0 && state.registeredActions.size === 0) || false,\n }),\n store,\n )\n })\n}\n\nexport function clearSpotlightState(\n { clearQuery }: { clearQuery: boolean | undefined },\n store: SpotlightStore,\n) {\n store.setState((state) => ({\n ...state,\n selected: -1,\n query: clearQuery ? '' : state.query,\n empty: clearQuery ? false : state.empty,\n }))\n}\n\nexport const spotlightActions = {\n open: openSpotlightAction,\n close: closeSpotlightAction,\n toggle: toggleSpotlightAction,\n updateState: updateSpotlightStateAction,\n setSelectedAction,\n setListId,\n selectAction,\n selectNextAction,\n selectPreviousAction,\n triggerSelectedAction,\n registerAction,\n setQuery,\n clearSpotlightState,\n}\n\nexport function createSpotlight() {\n const store = createSpotlightStore()\n const actions = {\n open: () => openSpotlightAction(store),\n close: () => closeSpotlightAction(store),\n toggle: () => toggleSpotlightAction(store),\n }\n\n return [store, actions] as const\n}\n\nexport const [spotlightStore, spotlight] = createSpotlight()\nexport const { open: openSpotlight, close: closeSpotlight, toggle: toggleSpotlight } = spotlight\n","import type { SpotlightActionData, SpotlightActionGroupData } from './Spotlight'\n\nexport function isActionsGroup(\n item: SpotlightActionData | SpotlightActionGroupData,\n): item is SpotlightActionGroupData {\n const group = item as SpotlightActionGroupData\n return group.group !== undefined && Array.isArray(group.actions)\n}\n","import type {\n SpotlightActionData,\n SpotlightActionGroupData,\n SpotlightActions,\n SpotlightFilterFunction,\n} from './Spotlight'\n\nfunction getKeywords(keywords: string | string[] | undefined) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim()\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim()\n }\n\n return ''\n}\n\nfunction getFlatActions(data: SpotlightActions[]) {\n return data.reduce<SpotlightActionData[]>((acc, item) => {\n if ('actions' in item) {\n return [\n ...acc,\n ...item.actions.map((action: SpotlightActionData) => ({ ...action, group: item.group })),\n ]\n }\n\n return [...acc, item]\n }, [])\n}\n\nfunction flatActionsToGroups(data: SpotlightActionData[]) {\n const groups: Record<string, { pushed: boolean; data: SpotlightActionGroupData }> = {}\n const result: SpotlightActions[] = []\n\n data.forEach((action) => {\n if (action.group) {\n if (!groups[action.group]) {\n groups[action.group] = { pushed: false, data: { group: action.group, actions: [] } }\n }\n\n groups[action.group].data.actions.push(action)\n\n if (!groups[action.group].pushed) {\n groups[action.group].pushed = true\n result.push(groups[action.group].data)\n }\n } else {\n result.push(action)\n }\n })\n\n return result\n}\n\nexport const defaultSpotlightFilter: SpotlightFilterFunction = (_query, data) => {\n const query = _query.trim().toLowerCase()\n const priorityMatrix: SpotlightActionData[][] = [[], []]\n const flatActions = getFlatActions(data)\n\n flatActions.forEach((item) => {\n if (item.label?.toLowerCase().includes(query)) {\n priorityMatrix[0].push(item)\n } else if (\n item.description?.toLowerCase().includes(query) ||\n getKeywords(item.keywords).includes(query)\n ) {\n priorityMatrix[1].push(item)\n }\n })\n\n return flatActionsToGroups(priorityMatrix.flat())\n}\n","import { isActionsGroup } from './is-actions-group'\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight'\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n if (!Array.isArray(actions)) {\n return []\n }\n\n let count = 0\n\n return actions.reduce<SpotlightActions[]>((acc, item) => {\n if (count >= limit) {\n return acc\n }\n\n if (isActionsGroup(item)) {\n const groupActions = limitActions(item.actions, limit - count)\n acc.push({\n group: item.group,\n actions: groupActions as SpotlightActionData[],\n })\n count += groupActions.length\n } else {\n acc.push(item)\n count += 1\n }\n\n return acc\n }, [])\n}\n","import type { InjectionKey } from 'vue'\nimport { inject, provide } from 'vue'\nimport type { SpotlightStore } from './spotlight.store'\n\nexport interface SpotlightContextValue {\n query: string\n setQuery: (query: string) => void\n getStyles: (selector: string, options?: Record<string, any>) => Record<string, any>\n store: SpotlightStore\n closeOnActionTrigger: boolean | undefined\n}\n\nconst SpotlightContextKey = Symbol('SpotlightContext') as InjectionKey<SpotlightContextValue>\n\nexport function provideSpotlightContext(value: SpotlightContextValue) {\n provide(SpotlightContextKey, value)\n}\n\nexport function useSpotlightContext() {\n const ctx = inject(SpotlightContextKey, null)\n\n if (ctx === null) {\n throw new Error('Spotlight component was not found in tree')\n }\n\n return ctx\n}\n",".root {\n &[data-scrollable] {\n --spotlight-content-height: 100%;\n }\n}\n\n.content {\n overflow: hidden;\n height: var(--spotlight-content-height, auto);\n max-height: var(--spotlight-max-height);\n}\n\n.body {\n display: flex;\n flex-direction: column;\n height: var(--spotlight-content-height, auto);\n}\n\n.search {\n border: 0;\n background-color: transparent;\n}\n\n.actionsList {\n --spotlight-actions-list-padding: 4px;\n\n border-top: 1px solid;\n flex: 1;\n padding: var(--spotlight-actions-list-padding);\n max-height: calc(100vh - 15rem);\n margin-inline-end: calc(var(--spotlight-actions-list-padding) * -1);\n width: 100%;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.action {\n display: flex;\n align-items: center;\n width: 100%;\n padding: 7px var(--mantine-spacing-md);\n border-radius: var(--mantine-radius-default);\n background-color: transparent;\n color: inherit;\n text-align: start;\n\n &:where(:not([data-selected])) {\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-selected]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-opacity: 0.7;\n }\n}\n\n.actionBody {\n flex: 1;\n}\n\n.actionSection {\n opacity: 1;\n color: inherit;\n\n &:where([data-dimmed]) {\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n }\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-md);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--mantine-spacing-md);\n }\n\n & > svg {\n display: block;\n }\n}\n\n.actionLabel {\n display: block;\n}\n\n.actionDescription {\n display: block;\n font-size: var(--mantine-font-size-xs);\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n}\n\n.empty {\n color: var(--mantine-color-dimmed);\n padding: var(--mantine-spacing-md);\n text-align: center;\n}\n\n.footer {\n padding: var(--mantine-spacing-xs) calc(var(--mantine-spacing-md) + rem(4px));\n border-top: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.actionsGroup {\n display: flex;\n flex-direction: column;\n margin-top: var(--mantine-spacing-md);\n\n &::before {\n content: var(--spotlight-label);\n text-transform: uppercase;\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n color: var(--mantine-color-dimmed);\n padding-inline-start: var(--mantine-spacing-md);\n }\n\n &:empty {\n display: none;\n }\n}\n","import { defineComponent, h, type PropType, type SlotsType, type VNodeChild } from 'vue'\nimport {\n Box,\n Highlight,\n UnstyledButton,\n hasNode,\n resolveNode,\n type MantineNode,\n type SectionSlots,\n useProps,\n} from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionStylesNames =\n | 'action'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionBody'\n\nexport interface SpotlightActionProps {\n label?: string\n description?: string\n leftSection?: MantineNode\n rightSection?: MantineNode\n dimmedSections?: boolean\n highlightQuery?: boolean\n highlightColor?: string\n closeSpotlightOnTrigger?: boolean\n keywords?: string | string[]\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n dimmedSections: true,\n highlightQuery: false,\n} satisfies Partial<SpotlightActionProps>\n\nexport const SpotlightAction = defineComponent({\n name: 'SpotlightAction',\n inheritAttrs: false,\n slots: Object as SlotsType<SectionSlots & { default?: () => VNodeChild }>,\n props: {\n label: { type: String, default: undefined },\n description: { type: String, default: undefined },\n leftSection: { type: null as unknown as PropType<MantineNode>, default: undefined },\n rightSection: { type: null as unknown as PropType<MantineNode>, default: undefined },\n dimmedSections: { type: Boolean, default: undefined },\n highlightQuery: { type: Boolean, default: undefined },\n highlightColor: { type: String, default: undefined },\n closeSpotlightOnTrigger: { type: Boolean, default: undefined },\n keywords: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionProps>('SpotlightAction', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () => {\n const stylesApi = { classNames: props.classNames, styles: props.styles }\n const leftSection = resolveNode(props.leftSection, slots.leftSection)\n const rightSection = resolveNode(props.rightSection, slots.rightSection)\n const labelNode =\n props.highlightQuery && typeof props.label === 'string'\n ? h(\n Highlight,\n {\n component: 'span',\n highlight: ctx.query,\n color: props.highlightColor,\n ...ctx.getStyles('actionLabel', stylesApi),\n },\n () => props.label,\n )\n : h('span', ctx.getStyles('actionLabel', stylesApi), props.label)\n\n return h(\n UnstyledButton,\n {\n ...attrs,\n 'data-action': true,\n ...ctx.getStyles('action', {\n className: attrs.class,\n style: attrs.style,\n ...stylesApi,\n }),\n onMousedown: (event: MouseEvent) => {\n event.preventDefault()\n ;(attrs.onMousedown as ((event: MouseEvent) => void) | undefined)?.(event)\n },\n onClick: (event: MouseEvent) => {\n ;(attrs.onClick as ((event: MouseEvent) => void) | undefined)?.(event)\n\n if (props.closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) {\n spotlightActions.close(ctx.store)\n }\n },\n tabindex: -1,\n },\n () =>\n slots.default?.() ?? [\n hasNode(leftSection)\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'left', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => leftSection,\n )\n : null,\n h('span', ctx.getStyles('actionBody', stylesApi), [\n labelNode,\n h('span', ctx.getStyles('actionDescription', stylesApi), props.description),\n ]),\n hasNode(rightSection)\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'right', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => rightSection,\n )\n : null,\n ],\n )\n }\n },\n})\n\nObject.assign(SpotlightAction, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup'\n\nexport interface SpotlightActionsGroupProps {\n label?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsGroup = defineComponent({\n name: 'SpotlightActionsGroup',\n inheritAttrs: false,\n props: {\n label: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsGroupProps>(\n 'SpotlightActionsGroup',\n null,\n rawProps as any,\n )\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('actionsGroup', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n style: [\n ctx.getStyles('actionsGroup', { styles: props.styles }).style,\n attrs.style as any,\n {\n '--spotlight-label': `'${props.label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n },\n ],\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsGroup, { classes })\n","import { defineComponent, h, onBeforeUnmount, onMounted, type PropType } from 'vue'\nimport { ScrollAreaAutosize, useProps } from '@mantine-vue/core'\nimport { useId } from '@mantine-vue/hooks'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsListStylesNames = 'actionsList' | 'actionsListInner'\n\nexport interface SpotlightActionsListProps {\n id?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsList = defineComponent({\n name: 'SpotlightActionsList',\n inheritAttrs: false,\n props: {\n id: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsListProps>('SpotlightActionsList', null, rawProps as any)\n const ctx = useSpotlightContext()\n const generatedId = useId()\n const listId = props.id || `mantine-${generatedId.value.replace(/:/g, '')}`\n\n onMounted(() => spotlightActions.setListId(listId, ctx.store))\n onBeforeUnmount(() => spotlightActions.setListId('', ctx.store))\n\n return () =>\n h(\n ScrollAreaAutosize,\n {\n ...attrs,\n ...ctx.getStyles('actionsList', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n type: 'scroll',\n scrollbarSize: 'var(--spotlight-actions-list-padding)',\n offsetScrollbars: 'y',\n id: listId,\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsList, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightEmptyStylesNames = 'empty'\n\nexport interface SpotlightEmptyProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightEmpty = defineComponent({\n name: 'SpotlightEmpty',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightEmptyProps>('SpotlightEmpty', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('empty', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightEmpty, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFooterStylesNames = 'footer'\n\nexport interface SpotlightFooterProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightFooter = defineComponent({\n name: 'SpotlightFooter',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightFooterProps>('SpotlightFooter', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('footer', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightFooter, { classes })\n","import type { HotkeyItem } from '@mantine-vue/hooks'\nimport type { SpotlightStore } from './spotlight.store'\nimport { spotlightActions } from './spotlight.store'\n\nexport function getHotkeys(\n hotkeys: string | string[] | null | undefined,\n store: SpotlightStore,\n): HotkeyItem[] {\n if (!hotkeys) {\n return []\n }\n\n const open = () => spotlightActions.open(store)\n\n if (Array.isArray(hotkeys)) {\n return hotkeys.map((hotkey) => [hotkey, open])\n }\n\n return [[hotkeys, open]]\n}\n","export function mergeClassNames(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function mergeStyles(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n","import { computed, defineComponent, h, ref, watch, type PropType } from 'vue'\nimport { Modal, getDefaultZIndex, rem, useProps, useStyles } from '@mantine-vue/core'\nimport { useHotkeys } from '@mantine-vue/hooks'\nimport { getHotkeys } from './get-hotkeys'\nimport { provideSpotlightContext } from './Spotlight.context'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport {\n spotlightActions,\n spotlightStore,\n useSpotlight,\n type SpotlightStore,\n} from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightRootStylesNames =\n | 'root'\n | 'body'\n | 'close'\n | 'content'\n | 'header'\n | 'inner'\n | 'overlay'\n | 'title'\n | 'search'\n | 'actionsList'\n | 'actionsListInner'\n | 'action'\n | 'empty'\n | 'footer'\n | 'actionBody'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionsGroup'\n\nexport interface SpotlightRootProps {\n store?: SpotlightStore\n query?: string\n onQueryChange?: (query: string) => void\n clearQueryOnClose?: boolean\n shortcut?: string | string[] | null\n tagsToIgnore?: string[]\n triggerOnContentEditable?: boolean\n disabled?: boolean\n onSpotlightOpen?: () => void\n onSpotlightClose?: () => void\n forceOpened?: boolean\n closeOnActionTrigger?: boolean\n maxHeight?: string | number\n scrollable?: boolean\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n unstyled?: boolean\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n maxHeight: 400,\n} satisfies Partial<SpotlightRootProps>\n\nexport const SpotlightRoot = defineComponent({\n name: 'SpotlightRoot',\n inheritAttrs: false,\n props: {\n store: { type: Object as PropType<SpotlightStore>, default: undefined },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: {\n type: [String, Array, null] as PropType<string | string[] | null>,\n default: undefined,\n },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightRootProps>('SpotlightRoot', defaultProps, rawProps as any)\n const state = useSpotlight(props.store!)\n const previousOpened = ref(state.value.opened)\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : state.value.query,\n )\n\n const setQuery = (query: string) => {\n props.onQueryChange?.(query)\n spotlightActions.setQuery(query, props.store!)\n }\n\n const getStyles = useStyles({\n name: 'Spotlight',\n classes,\n props,\n className: attrs.class,\n style: attrs.style as any,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n })\n\n provideSpotlightContext({\n get query() {\n return currentQuery.value\n },\n setQuery,\n getStyles,\n store: props.store!,\n get closeOnActionTrigger() {\n return props.closeOnActionTrigger\n },\n })\n\n useHotkeys(\n () => getHotkeys(props.shortcut, props.store!),\n () => props.tagsToIgnore,\n () => props.triggerOnContentEditable,\n )\n\n watch(\n () => state.value.opened,\n (opened) => {\n if (opened === previousOpened.value) {\n return\n }\n\n if (opened) {\n props.onSpotlightOpen?.()\n } else {\n props.onSpotlightClose?.()\n }\n previousOpened.value = opened\n },\n )\n\n return () => {\n if (props.disabled) {\n return null\n }\n\n const rootStyles = getStyles('root', { className: attrs.class, style: attrs.style as any })\n\n const {\n classNames: _classNames,\n styles: _styles,\n vars: _vars,\n unstyled: _unstyled,\n store: _store,\n query: _query,\n onQueryChange: _onQueryChange,\n clearQueryOnClose: _clearQueryOnClose,\n shortcut: _shortcut,\n tagsToIgnore: _tagsToIgnore,\n triggerOnContentEditable: _triggerOnContentEditable,\n disabled: _disabled,\n onSpotlightOpen: _onSpotlightOpen,\n onSpotlightClose: _onSpotlightClose,\n forceOpened: _forceOpened,\n closeOnActionTrigger: _closeOnActionTrigger,\n maxHeight: _maxHeight,\n scrollable: _scrollable,\n ...modalAttrs\n } = { ...attrs, ...props }\n\n return h(\n Modal,\n {\n ...modalAttrs,\n withCloseButton: false,\n opened: state.value.opened || !!props.forceOpened,\n padding: 0,\n onClose: () => spotlightActions.close(props.store!),\n class: rootStyles.class,\n style: rootStyles.style,\n classNames: mergeClassNames(\n {\n body: classes.body,\n content: classes.content,\n },\n props.classNames,\n ),\n styles: mergeStyles(props.styles),\n vars: mergeStyles(\n {\n root: {\n '--spotlight-max-height': props.scrollable ? rem(props.maxHeight) : undefined,\n },\n },\n props.vars,\n ),\n onExitTransitionEnd: () => {\n if (props.clearQueryOnClose) {\n setQuery('')\n }\n\n spotlightActions.clearSpotlightState(\n { clearQuery: props.clearQueryOnClose },\n props.store!,\n )\n props.transitionProps?.onExited?.()\n props.onExitTransitionEnd?.()\n },\n 'data-scrollable': props.scrollable || undefined,\n },\n slots,\n )\n }\n },\n})\n\nObject.assign(SpotlightRoot, { classes })\n","import { defineComponent, h, ref, type PropType } from 'vue'\nimport { Input, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightSearchStylesNames = 'input' | 'wrapper' | 'section' | 'bottomSection'\n\nexport interface SpotlightSearchProps {\n size?: string | number\n value?: string\n onChange?: (event: Event) => void\n onKeydown?: (event: KeyboardEvent) => void\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 'lg',\n} satisfies Partial<SpotlightSearchProps>\n\nexport const SpotlightSearch = defineComponent({\n name: 'SpotlightSearch',\n inheritAttrs: false,\n props: {\n size: { type: [String, Number] as PropType<string | number>, default: undefined },\n value: { type: String, default: undefined },\n onChange: { type: Function as PropType<(event: Event) => void>, default: undefined },\n onKeydown: { type: Function as PropType<(event: KeyboardEvent) => void>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightSearchProps>('SpotlightSearch', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n const isComposing = ref(false)\n\n const handleKeydown = (event: KeyboardEvent) => {\n props.onKeydown?.(event)\n\n if (isComposing.value) {\n return\n }\n\n if (event.code === 'ArrowDown') {\n event.preventDefault()\n spotlightActions.selectNextAction(ctx.store)\n }\n\n if (event.code === 'ArrowUp') {\n event.preventDefault()\n spotlightActions.selectPreviousAction(ctx.store)\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n event.preventDefault()\n spotlightActions.triggerSelectedAction(ctx.store)\n }\n }\n\n return () => {\n const inputStyles = ctx.getStyles('search')\n\n return h(Input, {\n ...attrs,\n size: props.size,\n value: props.value ?? ctx.query,\n classNames: mergeClassNames({ input: inputStyles.class }, props.classNames),\n styles: mergeStyles({ input: inputStyles.style }, props.styles),\n vars: props.vars,\n onInput: (event: Event) => {\n ctx.setQuery((event.currentTarget as HTMLInputElement).value)\n props.onChange?.(event)\n },\n onKeydown: handleKeydown,\n onCompositionstart: () => {\n isComposing.value = true\n },\n onCompositionend: () => {\n isComposing.value = false\n },\n })\n }\n },\n})\n\nObject.assign(SpotlightSearch, { classes })\n","import { computed, defineComponent, h, ref, type PropType } from 'vue'\nimport { getDefaultZIndex, useProps } from '@mantine-vue/core'\nimport { defaultSpotlightFilter } from './default-spotlight-filter'\nimport { isActionsGroup } from './is-actions-group'\nimport { limitActions } from './limit-actions'\nimport { spotlight, spotlightStore } from './spotlight.store'\nimport {\n SpotlightAction,\n type SpotlightActionProps,\n type SpotlightActionStylesNames,\n} from './SpotlightAction'\nimport {\n SpotlightActionsGroup,\n type SpotlightActionsGroupProps,\n type SpotlightActionsGroupStylesNames,\n} from './SpotlightActionsGroup'\nimport {\n SpotlightActionsList,\n type SpotlightActionsListProps,\n type SpotlightActionsListStylesNames,\n} from './SpotlightActionsList'\nimport {\n SpotlightEmpty,\n type SpotlightEmptyProps,\n type SpotlightEmptyStylesNames,\n} from './SpotlightEmpty'\nimport {\n SpotlightFooter,\n type SpotlightFooterProps,\n type SpotlightFooterStylesNames,\n} from './SpotlightFooter'\nimport {\n SpotlightRoot,\n type SpotlightRootProps,\n type SpotlightRootStylesNames,\n} from './SpotlightRoot'\nimport {\n SpotlightSearch,\n type SpotlightSearchProps,\n type SpotlightSearchStylesNames,\n} from './SpotlightSearch'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFilterFunction = (\n query: string,\n actions: SpotlightActions[],\n) => SpotlightActions[]\n\nexport interface SpotlightActionData extends SpotlightActionProps {\n id: string\n group?: string\n}\n\nexport interface SpotlightActionGroupData {\n group: string\n actions: SpotlightActionData[]\n}\n\nexport type SpotlightActions = SpotlightActionData | SpotlightActionGroupData\nexport type SpotlightStylesNames = SpotlightRootStylesNames\n\nexport interface SpotlightProps extends SpotlightRootProps {\n searchProps?: SpotlightSearchProps\n actions: SpotlightActions[]\n filter?: SpotlightFilterFunction\n nothingFound?: any\n highlightQuery?: boolean\n limit?: number\n scrollAreaProps?: Partial<SpotlightActionsListProps>\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n limit: Infinity,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n filter: defaultSpotlightFilter,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n} satisfies Partial<SpotlightProps>\n\nfunction renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n\nconst SpotlightBase = defineComponent({\n name: 'Spotlight',\n inheritAttrs: false,\n props: {\n searchProps: { type: Object as PropType<SpotlightSearchProps>, default: undefined },\n actions: { type: Array as PropType<SpotlightActions[]>, required: true },\n filter: { type: Function as PropType<SpotlightFilterFunction>, default: undefined },\n nothingFound: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n highlightQuery: { type: Boolean, default: false },\n limit: { type: Number, default: undefined },\n scrollAreaProps: {\n type: Object as PropType<Partial<SpotlightActionsListProps>>,\n default: undefined,\n },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n store: { type: Object as PropType<SpotlightRootProps['store']>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: { type: [String, Array] as PropType<string | string[] | null>, default: undefined },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightProps>('Spotlight', defaultProps, rawProps as any)\n const uncontrolledQuery = ref('')\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : uncontrolledQuery.value,\n )\n\n const setQuery = (query: string) => {\n if (typeof props.query !== 'string') {\n uncontrolledQuery.value = query\n }\n\n props.onQueryChange?.(query)\n }\n\n return () => {\n const filteredActions = limitActions(\n props.filter!(currentQuery.value, props.actions),\n props.limit!,\n )\n const renderedActions = filteredActions.map((item) => {\n if (isActionsGroup(item)) {\n return h(SpotlightActionsGroup, { key: item.group, label: item.group }, () =>\n item.actions.map(({ id, ...actionData }) =>\n h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n }),\n ),\n )\n }\n\n const { id, ...actionData } = item\n return h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n })\n })\n const {\n searchProps: _searchProps,\n actions: _actions,\n filter: _filter,\n nothingFound: _nothingFound,\n highlightQuery: _highlightQuery,\n limit: _limit,\n scrollAreaProps: _scrollAreaProps,\n query: _query,\n onQueryChange: _onQueryChange,\n ...rootProps\n } = props\n\n return h(\n SpotlightRoot,\n {\n ...attrs,\n ...rootProps,\n query: currentQuery.value,\n onQueryChange: setQuery,\n },\n () => [\n h(SpotlightSearch, props.searchProps),\n renderedActions.length > 0\n ? h(SpotlightActionsList, props.scrollAreaProps, () => renderedActions)\n : null,\n renderedActions.length === 0 && props.nothingFound\n ? h(SpotlightEmpty, null, () => renderContent(props.nothingFound))\n : null,\n ],\n )\n }\n },\n})\n\nexport const Spotlight = Object.assign(SpotlightBase, {\n classes,\n Search: SpotlightSearch,\n ActionsList: SpotlightActionsList,\n Action: SpotlightAction,\n Empty: SpotlightEmpty,\n Footer: SpotlightFooter,\n ActionsGroup: SpotlightActionsGroup,\n Root: SpotlightRoot,\n open: spotlight.open,\n close: spotlight.close,\n toggle: spotlight.toggle,\n})\n\nexport type {\n SpotlightActionProps,\n SpotlightActionStylesNames,\n SpotlightActionsGroupProps,\n SpotlightActionsGroupStylesNames,\n SpotlightActionsListProps,\n SpotlightActionsListStylesNames,\n SpotlightEmptyProps,\n SpotlightEmptyStylesNames,\n SpotlightFooterProps,\n SpotlightFooterStylesNames,\n SpotlightRootProps,\n SpotlightRootStylesNames,\n SpotlightSearchProps,\n SpotlightSearchStylesNames,\n}\n"],"mappings":";;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;GACjB,SACM;eACF,iBAAiB,MAAM,WAAW;IACpC,gBAAgB,SAAS,KAAA,GAAA,IAAA,GACnB,sBAAsB,MAAM,uBAAuB,eAAe,IACpE;IACJ,gBAAgB,WAAW,KAAK,MAAM,gBAAA,GAAA,IAAA,GAChC,gBAAgB,YAAY,cAAc,MAAM,YAAY,CAAC,IAC/D;GACN,CACF;EACF;CACF;AACF,CAAC;AAED,IAAa,YAAY,OAAO,OAAO,eAAe;CACpD,SAAA;CACA,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,cAAc;CACd,MAAM;CACN,MAAM,UAAU;CAChB,OAAO,UAAU;CACjB,QAAQ,UAAU;AACpB,CAAC"}
|
package/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createStore } from "@mantine-vue/store";
|
|
2
2
|
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, provide, ref, watch } from "vue";
|
|
3
|
-
import { Box, Highlight, Input, Modal, ScrollAreaAutosize, UnstyledButton, getDefaultZIndex, rem, useProps, useStyles } from "@mantine-vue/core";
|
|
3
|
+
import { Box, Highlight, Input, Modal, ScrollAreaAutosize, UnstyledButton, getDefaultZIndex, hasNode, rem, resolveNode, useProps, useStyles } from "@mantine-vue/core";
|
|
4
4
|
import { useHotkeys, useId } from "@mantine-vue/hooks";
|
|
5
5
|
//#region src/spotlight.store.ts
|
|
6
6
|
function clamp(value, min, max) {
|
|
@@ -217,29 +217,6 @@ function useSpotlightContext() {
|
|
|
217
217
|
if (ctx === null) throw new Error("Spotlight component was not found in tree");
|
|
218
218
|
return ctx;
|
|
219
219
|
}
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/style-api.ts
|
|
222
|
-
function mergeClassNames(...items) {
|
|
223
|
-
return items.reduce((acc, item) => {
|
|
224
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
225
|
-
Object.entries(item).forEach(([key, value]) => {
|
|
226
|
-
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
227
|
-
});
|
|
228
|
-
return acc;
|
|
229
|
-
}, {});
|
|
230
|
-
}
|
|
231
|
-
function mergeStyles(...items) {
|
|
232
|
-
return items.reduce((acc, item) => {
|
|
233
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
234
|
-
Object.entries(item).forEach(([key, value]) => {
|
|
235
|
-
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
236
|
-
});
|
|
237
|
-
return acc;
|
|
238
|
-
}, {});
|
|
239
|
-
}
|
|
240
|
-
function renderContent$1(value) {
|
|
241
|
-
return typeof value === "function" ? value() : value;
|
|
242
|
-
}
|
|
243
220
|
var Spotlight_module_default = {
|
|
244
221
|
root: "_root_87n7g_1",
|
|
245
222
|
content: "_content_87n7g_7",
|
|
@@ -264,6 +241,7 @@ var defaultProps$3 = {
|
|
|
264
241
|
var SpotlightAction = defineComponent({
|
|
265
242
|
name: "SpotlightAction",
|
|
266
243
|
inheritAttrs: false,
|
|
244
|
+
slots: Object,
|
|
267
245
|
props: {
|
|
268
246
|
label: {
|
|
269
247
|
type: String,
|
|
@@ -274,21 +252,11 @@ var SpotlightAction = defineComponent({
|
|
|
274
252
|
default: void 0
|
|
275
253
|
},
|
|
276
254
|
leftSection: {
|
|
277
|
-
type:
|
|
278
|
-
String,
|
|
279
|
-
Number,
|
|
280
|
-
Object,
|
|
281
|
-
Function
|
|
282
|
-
],
|
|
255
|
+
type: null,
|
|
283
256
|
default: void 0
|
|
284
257
|
},
|
|
285
258
|
rightSection: {
|
|
286
|
-
type:
|
|
287
|
-
String,
|
|
288
|
-
Number,
|
|
289
|
-
Object,
|
|
290
|
-
Function
|
|
291
|
-
],
|
|
259
|
+
type: null,
|
|
292
260
|
default: void 0
|
|
293
261
|
},
|
|
294
262
|
dimmedSections: {
|
|
@@ -332,6 +300,8 @@ var SpotlightAction = defineComponent({
|
|
|
332
300
|
classNames: props.classNames,
|
|
333
301
|
styles: props.styles
|
|
334
302
|
};
|
|
303
|
+
const leftSection = resolveNode(props.leftSection, slots.leftSection);
|
|
304
|
+
const rightSection = resolveNode(props.rightSection, slots.rightSection);
|
|
335
305
|
const labelNode = props.highlightQuery && typeof props.label === "string" ? h(Highlight, {
|
|
336
306
|
component: "span",
|
|
337
307
|
highlight: ctx.query,
|
|
@@ -356,23 +326,23 @@ var SpotlightAction = defineComponent({
|
|
|
356
326
|
},
|
|
357
327
|
tabindex: -1
|
|
358
328
|
}, () => slots.default?.() ?? [
|
|
359
|
-
|
|
329
|
+
hasNode(leftSection) ? h(Box, {
|
|
360
330
|
component: "span",
|
|
361
331
|
mod: {
|
|
362
332
|
position: "left",
|
|
363
333
|
dimmed: props.dimmedSections
|
|
364
334
|
},
|
|
365
335
|
...ctx.getStyles("actionSection", stylesApi)
|
|
366
|
-
}, () =>
|
|
336
|
+
}, () => leftSection) : null,
|
|
367
337
|
h("span", ctx.getStyles("actionBody", stylesApi), [labelNode, h("span", ctx.getStyles("actionDescription", stylesApi), props.description)]),
|
|
368
|
-
|
|
338
|
+
hasNode(rightSection) ? h(Box, {
|
|
369
339
|
component: "span",
|
|
370
340
|
mod: {
|
|
371
341
|
position: "right",
|
|
372
342
|
dimmed: props.dimmedSections
|
|
373
343
|
},
|
|
374
344
|
...ctx.getStyles("actionSection", stylesApi)
|
|
375
|
-
}, () =>
|
|
345
|
+
}, () => rightSection) : null
|
|
376
346
|
]);
|
|
377
347
|
};
|
|
378
348
|
}
|
|
@@ -544,6 +514,26 @@ function getHotkeys(hotkeys, store) {
|
|
|
544
514
|
return [[hotkeys, open]];
|
|
545
515
|
}
|
|
546
516
|
//#endregion
|
|
517
|
+
//#region src/style-api.ts
|
|
518
|
+
function mergeClassNames(...items) {
|
|
519
|
+
return items.reduce((acc, item) => {
|
|
520
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
521
|
+
Object.entries(item).forEach(([key, value]) => {
|
|
522
|
+
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
523
|
+
});
|
|
524
|
+
return acc;
|
|
525
|
+
}, {});
|
|
526
|
+
}
|
|
527
|
+
function mergeStyles(...items) {
|
|
528
|
+
return items.reduce((acc, item) => {
|
|
529
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) return acc;
|
|
530
|
+
Object.entries(item).forEach(([key, value]) => {
|
|
531
|
+
acc[key] = acc[key] ? [acc[key], value] : value;
|
|
532
|
+
});
|
|
533
|
+
return acc;
|
|
534
|
+
}, {});
|
|
535
|
+
}
|
|
536
|
+
//#endregion
|
|
547
537
|
//#region src/SpotlightRoot.ts
|
|
548
538
|
var defaultProps$2 = {
|
|
549
539
|
size: 600,
|
package/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/spotlight.store.ts","../src/is-actions-group.ts","../src/default-spotlight-filter.ts","../src/limit-actions.ts","../src/Spotlight.context.ts","../src/style-api.ts","../src/Spotlight.module.css","../src/SpotlightAction.ts","../src/SpotlightActionsGroup.ts","../src/SpotlightActionsList.ts","../src/SpotlightEmpty.ts","../src/SpotlightFooter.ts","../src/get-hotkeys.ts","../src/SpotlightRoot.ts","../src/SpotlightSearch.ts","../src/Spotlight.ts"],"sourcesContent":["import { type Ref } from 'vue'\nimport { createStore, type MantineStore } from '@mantine-vue/store'\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value))\n}\n\nexport interface SpotlightState {\n opened: boolean\n selected: number\n listId: string\n query: string\n empty: boolean\n registeredActions: Set<string>\n}\n\nexport type SpotlightStore = MantineStore<SpotlightState>\n\nexport const createSpotlightStore = () =>\n createStore<SpotlightState>({\n opened: false,\n empty: false,\n selected: -1,\n listId: '',\n query: '',\n registeredActions: new Set(),\n })\n\nexport const useSpotlight = (store: SpotlightStore): Readonly<Ref<SpotlightState>> => store.value\n\nexport function updateSpotlightStateAction(\n update: (state: SpotlightState) => Partial<SpotlightState>,\n store: SpotlightStore,\n) {\n const state = store.getState()\n store.setState({ ...state, ...update(store.getState()) })\n}\n\nexport function openSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: true, selected: -1 }), store)\n}\n\nexport function closeSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: false }), store)\n}\n\nexport function toggleSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(\n (state) => ({ opened: !state.opened, selected: state.opened ? state.selected : -1 }),\n store,\n )\n}\n\nexport function setSelectedAction(index: number, store: SpotlightStore) {\n store.setState((state) => ({ ...state, selected: index }))\n}\n\nexport function setListId(id: string, store: SpotlightStore) {\n store.setState((state) => ({ ...state, listId: id }))\n}\n\nfunction findElementByQuerySelector<T extends HTMLElement>(\n selector: string,\n root: Document | Element | ShadowRoot = document,\n): T | null {\n const element = root.querySelector<T>(selector)\n\n if (element) {\n return element\n }\n\n const children = root instanceof ShadowRoot ? root.host.children : root.children\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i]\n\n if (child.shadowRoot) {\n const shadowElement = findElementByQuerySelector<T>(selector, child.shadowRoot)\n\n if (shadowElement) {\n return shadowElement\n }\n }\n\n const nestedElement = findElementByQuerySelector<T>(selector, child)\n\n if (nestedElement) {\n return nestedElement\n }\n }\n\n return null\n}\n\nexport function selectAction(index: number, store: SpotlightStore): number {\n const state = store.getState()\n const actionsList = state.listId ? findElementByQuerySelector(`#${state.listId}`) : null\n const selected = actionsList?.querySelector<HTMLButtonElement>('[data-selected]')\n const actions = actionsList?.querySelectorAll<HTMLButtonElement>('[data-action]') ?? []\n const nextIndex = index === -1 ? actions.length - 1 : index === actions.length ? 0 : index\n const selectedIndex = clamp(nextIndex, 0, actions.length - 1)\n\n selected?.removeAttribute('data-selected')\n actions[selectedIndex]?.scrollIntoView?.({ block: 'nearest' })\n actions[selectedIndex]?.setAttribute('data-selected', 'true')\n setSelectedAction(selectedIndex, store)\n\n return selectedIndex\n}\n\nexport function selectNextAction(store: SpotlightStore) {\n return selectAction(store.getState().selected + 1, store)\n}\n\nexport function selectPreviousAction(store: SpotlightStore) {\n return selectAction(store.getState().selected - 1, store)\n}\n\nexport function triggerSelectedAction(store: SpotlightStore) {\n const state = store.getState()\n const selected = state.listId\n ? findElementByQuerySelector<HTMLButtonElement>(`#${state.listId} [data-selected]`)\n : null\n\n selected?.click()\n}\n\nexport function registerAction(id: string, store: SpotlightStore) {\n const state = store.getState()\n state.registeredActions.add(id)\n\n return () => {\n state.registeredActions.delete(id)\n }\n}\n\nexport function setQuery(query: string, store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ query }), store)\n Promise.resolve().then(() => {\n selectAction(0, store)\n updateSpotlightStateAction(\n (state) => ({\n empty: (state.query.trim().length > 0 && state.registeredActions.size === 0) || false,\n }),\n store,\n )\n })\n}\n\nexport function clearSpotlightState(\n { clearQuery }: { clearQuery: boolean | undefined },\n store: SpotlightStore,\n) {\n store.setState((state) => ({\n ...state,\n selected: -1,\n query: clearQuery ? '' : state.query,\n empty: clearQuery ? false : state.empty,\n }))\n}\n\nexport const spotlightActions = {\n open: openSpotlightAction,\n close: closeSpotlightAction,\n toggle: toggleSpotlightAction,\n updateState: updateSpotlightStateAction,\n setSelectedAction,\n setListId,\n selectAction,\n selectNextAction,\n selectPreviousAction,\n triggerSelectedAction,\n registerAction,\n setQuery,\n clearSpotlightState,\n}\n\nexport function createSpotlight() {\n const store = createSpotlightStore()\n const actions = {\n open: () => openSpotlightAction(store),\n close: () => closeSpotlightAction(store),\n toggle: () => toggleSpotlightAction(store),\n }\n\n return [store, actions] as const\n}\n\nexport const [spotlightStore, spotlight] = createSpotlight()\nexport const { open: openSpotlight, close: closeSpotlight, toggle: toggleSpotlight } = spotlight\n","import type { SpotlightActionData, SpotlightActionGroupData } from './Spotlight'\n\nexport function isActionsGroup(\n item: SpotlightActionData | SpotlightActionGroupData,\n): item is SpotlightActionGroupData {\n const group = item as SpotlightActionGroupData\n return group.group !== undefined && Array.isArray(group.actions)\n}\n","import type {\n SpotlightActionData,\n SpotlightActionGroupData,\n SpotlightActions,\n SpotlightFilterFunction,\n} from './Spotlight'\n\nfunction getKeywords(keywords: string | string[] | undefined) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim()\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim()\n }\n\n return ''\n}\n\nfunction getFlatActions(data: SpotlightActions[]) {\n return data.reduce<SpotlightActionData[]>((acc, item) => {\n if ('actions' in item) {\n return [\n ...acc,\n ...item.actions.map((action: SpotlightActionData) => ({ ...action, group: item.group })),\n ]\n }\n\n return [...acc, item]\n }, [])\n}\n\nfunction flatActionsToGroups(data: SpotlightActionData[]) {\n const groups: Record<string, { pushed: boolean; data: SpotlightActionGroupData }> = {}\n const result: SpotlightActions[] = []\n\n data.forEach((action) => {\n if (action.group) {\n if (!groups[action.group]) {\n groups[action.group] = { pushed: false, data: { group: action.group, actions: [] } }\n }\n\n groups[action.group].data.actions.push(action)\n\n if (!groups[action.group].pushed) {\n groups[action.group].pushed = true\n result.push(groups[action.group].data)\n }\n } else {\n result.push(action)\n }\n })\n\n return result\n}\n\nexport const defaultSpotlightFilter: SpotlightFilterFunction = (_query, data) => {\n const query = _query.trim().toLowerCase()\n const priorityMatrix: SpotlightActionData[][] = [[], []]\n const flatActions = getFlatActions(data)\n\n flatActions.forEach((item) => {\n if (item.label?.toLowerCase().includes(query)) {\n priorityMatrix[0].push(item)\n } else if (\n item.description?.toLowerCase().includes(query) ||\n getKeywords(item.keywords).includes(query)\n ) {\n priorityMatrix[1].push(item)\n }\n })\n\n return flatActionsToGroups(priorityMatrix.flat())\n}\n","import { isActionsGroup } from './is-actions-group'\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight'\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n if (!Array.isArray(actions)) {\n return []\n }\n\n let count = 0\n\n return actions.reduce<SpotlightActions[]>((acc, item) => {\n if (count >= limit) {\n return acc\n }\n\n if (isActionsGroup(item)) {\n const groupActions = limitActions(item.actions, limit - count)\n acc.push({\n group: item.group,\n actions: groupActions as SpotlightActionData[],\n })\n count += groupActions.length\n } else {\n acc.push(item)\n count += 1\n }\n\n return acc\n }, [])\n}\n","import type { InjectionKey } from 'vue'\nimport { inject, provide } from 'vue'\nimport type { SpotlightStore } from './spotlight.store'\n\nexport interface SpotlightContextValue {\n query: string\n setQuery: (query: string) => void\n getStyles: (selector: string, options?: Record<string, any>) => Record<string, any>\n store: SpotlightStore\n closeOnActionTrigger: boolean | undefined\n}\n\nconst SpotlightContextKey = Symbol('SpotlightContext') as InjectionKey<SpotlightContextValue>\n\nexport function provideSpotlightContext(value: SpotlightContextValue) {\n provide(SpotlightContextKey, value)\n}\n\nexport function useSpotlightContext() {\n const ctx = inject(SpotlightContextKey, null)\n\n if (ctx === null) {\n throw new Error('Spotlight component was not found in tree')\n }\n\n return ctx\n}\n","export function mergeClassNames(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function mergeStyles(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n",".root {\n &[data-scrollable] {\n --spotlight-content-height: 100%;\n }\n}\n\n.content {\n overflow: hidden;\n height: var(--spotlight-content-height, auto);\n max-height: var(--spotlight-max-height);\n}\n\n.body {\n display: flex;\n flex-direction: column;\n height: var(--spotlight-content-height, auto);\n}\n\n.search {\n border: 0;\n background-color: transparent;\n}\n\n.actionsList {\n --spotlight-actions-list-padding: 4px;\n\n border-top: 1px solid;\n flex: 1;\n padding: var(--spotlight-actions-list-padding);\n max-height: calc(100vh - 15rem);\n margin-inline-end: calc(var(--spotlight-actions-list-padding) * -1);\n width: 100%;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.action {\n display: flex;\n align-items: center;\n width: 100%;\n padding: 7px var(--mantine-spacing-md);\n border-radius: var(--mantine-radius-default);\n background-color: transparent;\n color: inherit;\n text-align: start;\n\n &:where(:not([data-selected])) {\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-selected]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-opacity: 0.7;\n }\n}\n\n.actionBody {\n flex: 1;\n}\n\n.actionSection {\n opacity: 1;\n color: inherit;\n\n &:where([data-dimmed]) {\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n }\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-md);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--mantine-spacing-md);\n }\n\n & > svg {\n display: block;\n }\n}\n\n.actionLabel {\n display: block;\n}\n\n.actionDescription {\n display: block;\n font-size: var(--mantine-font-size-xs);\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n}\n\n.empty {\n color: var(--mantine-color-dimmed);\n padding: var(--mantine-spacing-md);\n text-align: center;\n}\n\n.footer {\n padding: var(--mantine-spacing-xs) calc(var(--mantine-spacing-md) + rem(4px));\n border-top: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.actionsGroup {\n display: flex;\n flex-direction: column;\n margin-top: var(--mantine-spacing-md);\n\n &::before {\n content: var(--spotlight-label);\n text-transform: uppercase;\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n color: var(--mantine-color-dimmed);\n padding-inline-start: var(--mantine-spacing-md);\n }\n\n &:empty {\n display: none;\n }\n}\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, Highlight, UnstyledButton, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport { renderContent } from './style-api'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionStylesNames =\n | 'action'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionBody'\n\nexport interface SpotlightActionProps {\n label?: string\n description?: string\n leftSection?: any\n rightSection?: any\n dimmedSections?: boolean\n highlightQuery?: boolean\n highlightColor?: string\n closeSpotlightOnTrigger?: boolean\n keywords?: string | string[]\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n dimmedSections: true,\n highlightQuery: false,\n} satisfies Partial<SpotlightActionProps>\n\nexport const SpotlightAction = defineComponent({\n name: 'SpotlightAction',\n inheritAttrs: false,\n props: {\n label: { type: String, default: undefined },\n description: { type: String, default: undefined },\n leftSection: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n rightSection: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n dimmedSections: { type: Boolean, default: undefined },\n highlightQuery: { type: Boolean, default: undefined },\n highlightColor: { type: String, default: undefined },\n closeSpotlightOnTrigger: { type: Boolean, default: undefined },\n keywords: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionProps>('SpotlightAction', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () => {\n const stylesApi = { classNames: props.classNames, styles: props.styles }\n const labelNode =\n props.highlightQuery && typeof props.label === 'string'\n ? h(\n Highlight,\n {\n component: 'span',\n highlight: ctx.query,\n color: props.highlightColor,\n ...ctx.getStyles('actionLabel', stylesApi),\n },\n () => props.label,\n )\n : h('span', ctx.getStyles('actionLabel', stylesApi), props.label)\n\n return h(\n UnstyledButton,\n {\n ...attrs,\n 'data-action': true,\n ...ctx.getStyles('action', {\n className: attrs.class,\n style: attrs.style,\n ...stylesApi,\n }),\n onMousedown: (event: MouseEvent) => {\n event.preventDefault()\n ;(attrs.onMousedown as ((event: MouseEvent) => void) | undefined)?.(event)\n },\n onClick: (event: MouseEvent) => {\n ;(attrs.onClick as ((event: MouseEvent) => void) | undefined)?.(event)\n\n if (props.closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) {\n spotlightActions.close(ctx.store)\n }\n },\n tabindex: -1,\n },\n () =>\n slots.default?.() ?? [\n props.leftSection\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'left', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => renderContent(props.leftSection),\n )\n : null,\n h('span', ctx.getStyles('actionBody', stylesApi), [\n labelNode,\n h('span', ctx.getStyles('actionDescription', stylesApi), props.description),\n ]),\n props.rightSection\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'right', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => renderContent(props.rightSection),\n )\n : null,\n ],\n )\n }\n },\n})\n\nObject.assign(SpotlightAction, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup'\n\nexport interface SpotlightActionsGroupProps {\n label?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsGroup = defineComponent({\n name: 'SpotlightActionsGroup',\n inheritAttrs: false,\n props: {\n label: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsGroupProps>(\n 'SpotlightActionsGroup',\n null,\n rawProps as any,\n )\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('actionsGroup', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n style: [\n ctx.getStyles('actionsGroup', { styles: props.styles }).style,\n attrs.style as any,\n {\n '--spotlight-label': `'${props.label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n },\n ],\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsGroup, { classes })\n","import { defineComponent, h, onBeforeUnmount, onMounted, type PropType } from 'vue'\nimport { ScrollAreaAutosize, useProps } from '@mantine-vue/core'\nimport { useId } from '@mantine-vue/hooks'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsListStylesNames = 'actionsList' | 'actionsListInner'\n\nexport interface SpotlightActionsListProps {\n id?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsList = defineComponent({\n name: 'SpotlightActionsList',\n inheritAttrs: false,\n props: {\n id: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsListProps>('SpotlightActionsList', null, rawProps as any)\n const ctx = useSpotlightContext()\n const generatedId = useId()\n const listId = props.id || `mantine-${generatedId.value.replace(/:/g, '')}`\n\n onMounted(() => spotlightActions.setListId(listId, ctx.store))\n onBeforeUnmount(() => spotlightActions.setListId('', ctx.store))\n\n return () =>\n h(\n ScrollAreaAutosize,\n {\n ...attrs,\n ...ctx.getStyles('actionsList', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n type: 'scroll',\n scrollbarSize: 'var(--spotlight-actions-list-padding)',\n offsetScrollbars: 'y',\n id: listId,\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsList, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightEmptyStylesNames = 'empty'\n\nexport interface SpotlightEmptyProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightEmpty = defineComponent({\n name: 'SpotlightEmpty',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightEmptyProps>('SpotlightEmpty', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('empty', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightEmpty, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFooterStylesNames = 'footer'\n\nexport interface SpotlightFooterProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightFooter = defineComponent({\n name: 'SpotlightFooter',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightFooterProps>('SpotlightFooter', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('footer', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightFooter, { classes })\n","import type { HotkeyItem } from '@mantine-vue/hooks'\nimport type { SpotlightStore } from './spotlight.store'\nimport { spotlightActions } from './spotlight.store'\n\nexport function getHotkeys(\n hotkeys: string | string[] | null | undefined,\n store: SpotlightStore,\n): HotkeyItem[] {\n if (!hotkeys) {\n return []\n }\n\n const open = () => spotlightActions.open(store)\n\n if (Array.isArray(hotkeys)) {\n return hotkeys.map((hotkey) => [hotkey, open])\n }\n\n return [[hotkeys, open]]\n}\n","import { computed, defineComponent, h, ref, watch, type PropType } from 'vue'\nimport { Modal, getDefaultZIndex, rem, useProps, useStyles } from '@mantine-vue/core'\nimport { useHotkeys } from '@mantine-vue/hooks'\nimport { getHotkeys } from './get-hotkeys'\nimport { provideSpotlightContext } from './Spotlight.context'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport {\n spotlightActions,\n spotlightStore,\n useSpotlight,\n type SpotlightStore,\n} from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightRootStylesNames =\n | 'root'\n | 'body'\n | 'close'\n | 'content'\n | 'header'\n | 'inner'\n | 'overlay'\n | 'title'\n | 'search'\n | 'actionsList'\n | 'actionsListInner'\n | 'action'\n | 'empty'\n | 'footer'\n | 'actionBody'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionsGroup'\n\nexport interface SpotlightRootProps {\n store?: SpotlightStore\n query?: string\n onQueryChange?: (query: string) => void\n clearQueryOnClose?: boolean\n shortcut?: string | string[] | null\n tagsToIgnore?: string[]\n triggerOnContentEditable?: boolean\n disabled?: boolean\n onSpotlightOpen?: () => void\n onSpotlightClose?: () => void\n forceOpened?: boolean\n closeOnActionTrigger?: boolean\n maxHeight?: string | number\n scrollable?: boolean\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n unstyled?: boolean\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n maxHeight: 400,\n} satisfies Partial<SpotlightRootProps>\n\nexport const SpotlightRoot = defineComponent({\n name: 'SpotlightRoot',\n inheritAttrs: false,\n props: {\n store: { type: Object as PropType<SpotlightStore>, default: undefined },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: {\n type: [String, Array, null] as PropType<string | string[] | null>,\n default: undefined,\n },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightRootProps>('SpotlightRoot', defaultProps, rawProps as any)\n const state = useSpotlight(props.store!)\n const previousOpened = ref(state.value.opened)\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : state.value.query,\n )\n\n const setQuery = (query: string) => {\n props.onQueryChange?.(query)\n spotlightActions.setQuery(query, props.store!)\n }\n\n const getStyles = useStyles({\n name: 'Spotlight',\n classes,\n props,\n className: attrs.class,\n style: attrs.style as any,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n })\n\n provideSpotlightContext({\n get query() {\n return currentQuery.value\n },\n setQuery,\n getStyles,\n store: props.store!,\n get closeOnActionTrigger() {\n return props.closeOnActionTrigger\n },\n })\n\n useHotkeys(\n () => getHotkeys(props.shortcut, props.store!),\n () => props.tagsToIgnore,\n () => props.triggerOnContentEditable,\n )\n\n watch(\n () => state.value.opened,\n (opened) => {\n if (opened === previousOpened.value) {\n return\n }\n\n if (opened) {\n props.onSpotlightOpen?.()\n } else {\n props.onSpotlightClose?.()\n }\n previousOpened.value = opened\n },\n )\n\n return () => {\n if (props.disabled) {\n return null\n }\n\n const rootStyles = getStyles('root', { className: attrs.class, style: attrs.style as any })\n\n const {\n classNames: _classNames,\n styles: _styles,\n vars: _vars,\n unstyled: _unstyled,\n store: _store,\n query: _query,\n onQueryChange: _onQueryChange,\n clearQueryOnClose: _clearQueryOnClose,\n shortcut: _shortcut,\n tagsToIgnore: _tagsToIgnore,\n triggerOnContentEditable: _triggerOnContentEditable,\n disabled: _disabled,\n onSpotlightOpen: _onSpotlightOpen,\n onSpotlightClose: _onSpotlightClose,\n forceOpened: _forceOpened,\n closeOnActionTrigger: _closeOnActionTrigger,\n maxHeight: _maxHeight,\n scrollable: _scrollable,\n ...modalAttrs\n } = { ...attrs, ...props }\n\n return h(\n Modal,\n {\n ...modalAttrs,\n withCloseButton: false,\n opened: state.value.opened || !!props.forceOpened,\n padding: 0,\n onClose: () => spotlightActions.close(props.store!),\n class: rootStyles.class,\n style: rootStyles.style,\n classNames: mergeClassNames(\n {\n body: classes.body,\n content: classes.content,\n },\n props.classNames,\n ),\n styles: mergeStyles(props.styles),\n vars: mergeStyles(\n {\n root: {\n '--spotlight-max-height': props.scrollable ? rem(props.maxHeight) : undefined,\n },\n },\n props.vars,\n ),\n onExitTransitionEnd: () => {\n if (props.clearQueryOnClose) {\n setQuery('')\n }\n\n spotlightActions.clearSpotlightState(\n { clearQuery: props.clearQueryOnClose },\n props.store!,\n )\n props.transitionProps?.onExited?.()\n props.onExitTransitionEnd?.()\n },\n 'data-scrollable': props.scrollable || undefined,\n },\n slots,\n )\n }\n },\n})\n\nObject.assign(SpotlightRoot, { classes })\n","import { defineComponent, h, ref, type PropType } from 'vue'\nimport { Input, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightSearchStylesNames = 'input' | 'wrapper' | 'section' | 'bottomSection'\n\nexport interface SpotlightSearchProps {\n size?: string | number\n value?: string\n onChange?: (event: Event) => void\n onKeydown?: (event: KeyboardEvent) => void\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 'lg',\n} satisfies Partial<SpotlightSearchProps>\n\nexport const SpotlightSearch = defineComponent({\n name: 'SpotlightSearch',\n inheritAttrs: false,\n props: {\n size: { type: [String, Number] as PropType<string | number>, default: undefined },\n value: { type: String, default: undefined },\n onChange: { type: Function as PropType<(event: Event) => void>, default: undefined },\n onKeydown: { type: Function as PropType<(event: KeyboardEvent) => void>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightSearchProps>('SpotlightSearch', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n const isComposing = ref(false)\n\n const handleKeydown = (event: KeyboardEvent) => {\n props.onKeydown?.(event)\n\n if (isComposing.value) {\n return\n }\n\n if (event.code === 'ArrowDown') {\n event.preventDefault()\n spotlightActions.selectNextAction(ctx.store)\n }\n\n if (event.code === 'ArrowUp') {\n event.preventDefault()\n spotlightActions.selectPreviousAction(ctx.store)\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n event.preventDefault()\n spotlightActions.triggerSelectedAction(ctx.store)\n }\n }\n\n return () => {\n const inputStyles = ctx.getStyles('search')\n\n return h(Input, {\n ...attrs,\n size: props.size,\n value: props.value ?? ctx.query,\n classNames: mergeClassNames({ input: inputStyles.class }, props.classNames),\n styles: mergeStyles({ input: inputStyles.style }, props.styles),\n vars: props.vars,\n onInput: (event: Event) => {\n ctx.setQuery((event.currentTarget as HTMLInputElement).value)\n props.onChange?.(event)\n },\n onKeydown: handleKeydown,\n onCompositionstart: () => {\n isComposing.value = true\n },\n onCompositionend: () => {\n isComposing.value = false\n },\n })\n }\n },\n})\n\nObject.assign(SpotlightSearch, { classes })\n","import { computed, defineComponent, h, ref, type PropType } from 'vue'\nimport { getDefaultZIndex, useProps } from '@mantine-vue/core'\nimport { defaultSpotlightFilter } from './default-spotlight-filter'\nimport { isActionsGroup } from './is-actions-group'\nimport { limitActions } from './limit-actions'\nimport { spotlight, spotlightStore } from './spotlight.store'\nimport {\n SpotlightAction,\n type SpotlightActionProps,\n type SpotlightActionStylesNames,\n} from './SpotlightAction'\nimport {\n SpotlightActionsGroup,\n type SpotlightActionsGroupProps,\n type SpotlightActionsGroupStylesNames,\n} from './SpotlightActionsGroup'\nimport {\n SpotlightActionsList,\n type SpotlightActionsListProps,\n type SpotlightActionsListStylesNames,\n} from './SpotlightActionsList'\nimport {\n SpotlightEmpty,\n type SpotlightEmptyProps,\n type SpotlightEmptyStylesNames,\n} from './SpotlightEmpty'\nimport {\n SpotlightFooter,\n type SpotlightFooterProps,\n type SpotlightFooterStylesNames,\n} from './SpotlightFooter'\nimport {\n SpotlightRoot,\n type SpotlightRootProps,\n type SpotlightRootStylesNames,\n} from './SpotlightRoot'\nimport {\n SpotlightSearch,\n type SpotlightSearchProps,\n type SpotlightSearchStylesNames,\n} from './SpotlightSearch'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFilterFunction = (\n query: string,\n actions: SpotlightActions[],\n) => SpotlightActions[]\n\nexport interface SpotlightActionData extends SpotlightActionProps {\n id: string\n group?: string\n}\n\nexport interface SpotlightActionGroupData {\n group: string\n actions: SpotlightActionData[]\n}\n\nexport type SpotlightActions = SpotlightActionData | SpotlightActionGroupData\nexport type SpotlightStylesNames = SpotlightRootStylesNames\n\nexport interface SpotlightProps extends SpotlightRootProps {\n searchProps?: SpotlightSearchProps\n actions: SpotlightActions[]\n filter?: SpotlightFilterFunction\n nothingFound?: any\n highlightQuery?: boolean\n limit?: number\n scrollAreaProps?: Partial<SpotlightActionsListProps>\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n limit: Infinity,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n filter: defaultSpotlightFilter,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n} satisfies Partial<SpotlightProps>\n\nfunction renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n\nconst SpotlightBase = defineComponent({\n name: 'Spotlight',\n inheritAttrs: false,\n props: {\n searchProps: { type: Object as PropType<SpotlightSearchProps>, default: undefined },\n actions: { type: Array as PropType<SpotlightActions[]>, required: true },\n filter: { type: Function as PropType<SpotlightFilterFunction>, default: undefined },\n nothingFound: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n highlightQuery: { type: Boolean, default: false },\n limit: { type: Number, default: undefined },\n scrollAreaProps: {\n type: Object as PropType<Partial<SpotlightActionsListProps>>,\n default: undefined,\n },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n store: { type: Object as PropType<SpotlightRootProps['store']>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: { type: [String, Array] as PropType<string | string[] | null>, default: undefined },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightProps>('Spotlight', defaultProps, rawProps as any)\n const uncontrolledQuery = ref('')\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : uncontrolledQuery.value,\n )\n\n const setQuery = (query: string) => {\n if (typeof props.query !== 'string') {\n uncontrolledQuery.value = query\n }\n\n props.onQueryChange?.(query)\n }\n\n return () => {\n const filteredActions = limitActions(\n props.filter!(currentQuery.value, props.actions),\n props.limit!,\n )\n const renderedActions = filteredActions.map((item) => {\n if (isActionsGroup(item)) {\n return h(SpotlightActionsGroup, { key: item.group, label: item.group }, () =>\n item.actions.map(({ id, ...actionData }) =>\n h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n }),\n ),\n )\n }\n\n const { id, ...actionData } = item\n return h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n })\n })\n const {\n searchProps: _searchProps,\n actions: _actions,\n filter: _filter,\n nothingFound: _nothingFound,\n highlightQuery: _highlightQuery,\n limit: _limit,\n scrollAreaProps: _scrollAreaProps,\n query: _query,\n onQueryChange: _onQueryChange,\n ...rootProps\n } = props\n\n return h(\n SpotlightRoot,\n {\n ...attrs,\n ...rootProps,\n query: currentQuery.value,\n onQueryChange: setQuery,\n },\n () => [\n h(SpotlightSearch, props.searchProps),\n renderedActions.length > 0\n ? h(SpotlightActionsList, props.scrollAreaProps, () => renderedActions)\n : null,\n renderedActions.length === 0 && props.nothingFound\n ? h(SpotlightEmpty, null, () => renderContent(props.nothingFound))\n : null,\n ],\n )\n }\n },\n})\n\nexport const Spotlight = Object.assign(SpotlightBase, {\n classes,\n Search: SpotlightSearch,\n ActionsList: SpotlightActionsList,\n Action: SpotlightAction,\n Empty: SpotlightEmpty,\n Footer: SpotlightFooter,\n ActionsGroup: SpotlightActionsGroup,\n Root: SpotlightRoot,\n open: spotlight.open,\n close: spotlight.close,\n toggle: spotlight.toggle,\n})\n\nexport type {\n SpotlightActionProps,\n SpotlightActionStylesNames,\n SpotlightActionsGroupProps,\n SpotlightActionsGroupStylesNames,\n SpotlightActionsListProps,\n SpotlightActionsListStylesNames,\n SpotlightEmptyProps,\n SpotlightEmptyStylesNames,\n SpotlightFooterProps,\n SpotlightFooterStylesNames,\n SpotlightRootProps,\n SpotlightRootStylesNames,\n SpotlightSearchProps,\n SpotlightSearchStylesNames,\n}\n"],"mappings":";;;;;AAGA,SAAS,MAAM,OAAe,KAAa,KAAa;CACtD,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;AAaA,IAAa,6BACX,YAA4B;CAC1B,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,mCAAmB,IAAI,IAAI;AAC7B,CAAC;AAEH,IAAa,gBAAgB,UAAyD,MAAM;AAE5F,SAAgB,2BACd,QACA,OACA;CACA,MAAM,QAAQ,MAAM,SAAS;CAC7B,MAAM,SAAS;EAAE,GAAG;EAAO,GAAG,OAAO,MAAM,SAAS,CAAC;CAAE,CAAC;AAC1D;AAEA,SAAgB,oBAAoB,OAAuB;CACzD,kCAAkC;EAAE,QAAQ;EAAM,UAAU;CAAG,IAAI,KAAK;AAC1E;AAEA,SAAg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EACL,eACA;IACE,GAAG;IACH,GAAG;IACH,OAAO,aAAa;IACpB,eAAe;GACjB,SACM;IACJ,EAAE,iBAAiB,MAAM,WAAW;IACpC,gBAAgB,SAAS,IACrB,EAAE,sBAAsB,MAAM,uBAAuB,eAAe,IACpE;IACJ,gBAAgB,WAAW,KAAK,MAAM,eAClC,EAAE,gBAAgB,YAAY,cAAc,MAAM,YAAY,CAAC,IAC/D;GACN,CACF;EACF;CACF;AACF,CAAC;AAED,IAAa,YAAY,OAAO,OAAO,eAAe;CACpD,SAAA;CACA,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,cAAc;CACd,MAAM;CACN,MAAM,UAAU;CAChB,OAAO,UAAU;CACjB,QAAQ,UAAU;AACpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/spotlight.store.ts","../src/is-actions-group.ts","../src/default-spotlight-filter.ts","../src/limit-actions.ts","../src/Spotlight.context.ts","../src/Spotlight.module.css","../src/SpotlightAction.ts","../src/SpotlightActionsGroup.ts","../src/SpotlightActionsList.ts","../src/SpotlightEmpty.ts","../src/SpotlightFooter.ts","../src/get-hotkeys.ts","../src/style-api.ts","../src/SpotlightRoot.ts","../src/SpotlightSearch.ts","../src/Spotlight.ts"],"sourcesContent":["import { type Ref } from 'vue'\nimport { createStore, type MantineStore } from '@mantine-vue/store'\n\nfunction clamp(value: number, min: number, max: number) {\n return Math.min(max, Math.max(min, value))\n}\n\nexport interface SpotlightState {\n opened: boolean\n selected: number\n listId: string\n query: string\n empty: boolean\n registeredActions: Set<string>\n}\n\nexport type SpotlightStore = MantineStore<SpotlightState>\n\nexport const createSpotlightStore = () =>\n createStore<SpotlightState>({\n opened: false,\n empty: false,\n selected: -1,\n listId: '',\n query: '',\n registeredActions: new Set(),\n })\n\nexport const useSpotlight = (store: SpotlightStore): Readonly<Ref<SpotlightState>> => store.value\n\nexport function updateSpotlightStateAction(\n update: (state: SpotlightState) => Partial<SpotlightState>,\n store: SpotlightStore,\n) {\n const state = store.getState()\n store.setState({ ...state, ...update(store.getState()) })\n}\n\nexport function openSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: true, selected: -1 }), store)\n}\n\nexport function closeSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ opened: false }), store)\n}\n\nexport function toggleSpotlightAction(store: SpotlightStore) {\n updateSpotlightStateAction(\n (state) => ({ opened: !state.opened, selected: state.opened ? state.selected : -1 }),\n store,\n )\n}\n\nexport function setSelectedAction(index: number, store: SpotlightStore) {\n store.setState((state) => ({ ...state, selected: index }))\n}\n\nexport function setListId(id: string, store: SpotlightStore) {\n store.setState((state) => ({ ...state, listId: id }))\n}\n\nfunction findElementByQuerySelector<T extends HTMLElement>(\n selector: string,\n root: Document | Element | ShadowRoot = document,\n): T | null {\n const element = root.querySelector<T>(selector)\n\n if (element) {\n return element\n }\n\n const children = root instanceof ShadowRoot ? root.host.children : root.children\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i]\n\n if (child.shadowRoot) {\n const shadowElement = findElementByQuerySelector<T>(selector, child.shadowRoot)\n\n if (shadowElement) {\n return shadowElement\n }\n }\n\n const nestedElement = findElementByQuerySelector<T>(selector, child)\n\n if (nestedElement) {\n return nestedElement\n }\n }\n\n return null\n}\n\nexport function selectAction(index: number, store: SpotlightStore): number {\n const state = store.getState()\n const actionsList = state.listId ? findElementByQuerySelector(`#${state.listId}`) : null\n const selected = actionsList?.querySelector<HTMLButtonElement>('[data-selected]')\n const actions = actionsList?.querySelectorAll<HTMLButtonElement>('[data-action]') ?? []\n const nextIndex = index === -1 ? actions.length - 1 : index === actions.length ? 0 : index\n const selectedIndex = clamp(nextIndex, 0, actions.length - 1)\n\n selected?.removeAttribute('data-selected')\n actions[selectedIndex]?.scrollIntoView?.({ block: 'nearest' })\n actions[selectedIndex]?.setAttribute('data-selected', 'true')\n setSelectedAction(selectedIndex, store)\n\n return selectedIndex\n}\n\nexport function selectNextAction(store: SpotlightStore) {\n return selectAction(store.getState().selected + 1, store)\n}\n\nexport function selectPreviousAction(store: SpotlightStore) {\n return selectAction(store.getState().selected - 1, store)\n}\n\nexport function triggerSelectedAction(store: SpotlightStore) {\n const state = store.getState()\n const selected = state.listId\n ? findElementByQuerySelector<HTMLButtonElement>(`#${state.listId} [data-selected]`)\n : null\n\n selected?.click()\n}\n\nexport function registerAction(id: string, store: SpotlightStore) {\n const state = store.getState()\n state.registeredActions.add(id)\n\n return () => {\n state.registeredActions.delete(id)\n }\n}\n\nexport function setQuery(query: string, store: SpotlightStore) {\n updateSpotlightStateAction(() => ({ query }), store)\n Promise.resolve().then(() => {\n selectAction(0, store)\n updateSpotlightStateAction(\n (state) => ({\n empty: (state.query.trim().length > 0 && state.registeredActions.size === 0) || false,\n }),\n store,\n )\n })\n}\n\nexport function clearSpotlightState(\n { clearQuery }: { clearQuery: boolean | undefined },\n store: SpotlightStore,\n) {\n store.setState((state) => ({\n ...state,\n selected: -1,\n query: clearQuery ? '' : state.query,\n empty: clearQuery ? false : state.empty,\n }))\n}\n\nexport const spotlightActions = {\n open: openSpotlightAction,\n close: closeSpotlightAction,\n toggle: toggleSpotlightAction,\n updateState: updateSpotlightStateAction,\n setSelectedAction,\n setListId,\n selectAction,\n selectNextAction,\n selectPreviousAction,\n triggerSelectedAction,\n registerAction,\n setQuery,\n clearSpotlightState,\n}\n\nexport function createSpotlight() {\n const store = createSpotlightStore()\n const actions = {\n open: () => openSpotlightAction(store),\n close: () => closeSpotlightAction(store),\n toggle: () => toggleSpotlightAction(store),\n }\n\n return [store, actions] as const\n}\n\nexport const [spotlightStore, spotlight] = createSpotlight()\nexport const { open: openSpotlight, close: closeSpotlight, toggle: toggleSpotlight } = spotlight\n","import type { SpotlightActionData, SpotlightActionGroupData } from './Spotlight'\n\nexport function isActionsGroup(\n item: SpotlightActionData | SpotlightActionGroupData,\n): item is SpotlightActionGroupData {\n const group = item as SpotlightActionGroupData\n return group.group !== undefined && Array.isArray(group.actions)\n}\n","import type {\n SpotlightActionData,\n SpotlightActionGroupData,\n SpotlightActions,\n SpotlightFilterFunction,\n} from './Spotlight'\n\nfunction getKeywords(keywords: string | string[] | undefined) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim()\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim()\n }\n\n return ''\n}\n\nfunction getFlatActions(data: SpotlightActions[]) {\n return data.reduce<SpotlightActionData[]>((acc, item) => {\n if ('actions' in item) {\n return [\n ...acc,\n ...item.actions.map((action: SpotlightActionData) => ({ ...action, group: item.group })),\n ]\n }\n\n return [...acc, item]\n }, [])\n}\n\nfunction flatActionsToGroups(data: SpotlightActionData[]) {\n const groups: Record<string, { pushed: boolean; data: SpotlightActionGroupData }> = {}\n const result: SpotlightActions[] = []\n\n data.forEach((action) => {\n if (action.group) {\n if (!groups[action.group]) {\n groups[action.group] = { pushed: false, data: { group: action.group, actions: [] } }\n }\n\n groups[action.group].data.actions.push(action)\n\n if (!groups[action.group].pushed) {\n groups[action.group].pushed = true\n result.push(groups[action.group].data)\n }\n } else {\n result.push(action)\n }\n })\n\n return result\n}\n\nexport const defaultSpotlightFilter: SpotlightFilterFunction = (_query, data) => {\n const query = _query.trim().toLowerCase()\n const priorityMatrix: SpotlightActionData[][] = [[], []]\n const flatActions = getFlatActions(data)\n\n flatActions.forEach((item) => {\n if (item.label?.toLowerCase().includes(query)) {\n priorityMatrix[0].push(item)\n } else if (\n item.description?.toLowerCase().includes(query) ||\n getKeywords(item.keywords).includes(query)\n ) {\n priorityMatrix[1].push(item)\n }\n })\n\n return flatActionsToGroups(priorityMatrix.flat())\n}\n","import { isActionsGroup } from './is-actions-group'\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight'\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n if (!Array.isArray(actions)) {\n return []\n }\n\n let count = 0\n\n return actions.reduce<SpotlightActions[]>((acc, item) => {\n if (count >= limit) {\n return acc\n }\n\n if (isActionsGroup(item)) {\n const groupActions = limitActions(item.actions, limit - count)\n acc.push({\n group: item.group,\n actions: groupActions as SpotlightActionData[],\n })\n count += groupActions.length\n } else {\n acc.push(item)\n count += 1\n }\n\n return acc\n }, [])\n}\n","import type { InjectionKey } from 'vue'\nimport { inject, provide } from 'vue'\nimport type { SpotlightStore } from './spotlight.store'\n\nexport interface SpotlightContextValue {\n query: string\n setQuery: (query: string) => void\n getStyles: (selector: string, options?: Record<string, any>) => Record<string, any>\n store: SpotlightStore\n closeOnActionTrigger: boolean | undefined\n}\n\nconst SpotlightContextKey = Symbol('SpotlightContext') as InjectionKey<SpotlightContextValue>\n\nexport function provideSpotlightContext(value: SpotlightContextValue) {\n provide(SpotlightContextKey, value)\n}\n\nexport function useSpotlightContext() {\n const ctx = inject(SpotlightContextKey, null)\n\n if (ctx === null) {\n throw new Error('Spotlight component was not found in tree')\n }\n\n return ctx\n}\n",".root {\n &[data-scrollable] {\n --spotlight-content-height: 100%;\n }\n}\n\n.content {\n overflow: hidden;\n height: var(--spotlight-content-height, auto);\n max-height: var(--spotlight-max-height);\n}\n\n.body {\n display: flex;\n flex-direction: column;\n height: var(--spotlight-content-height, auto);\n}\n\n.search {\n border: 0;\n background-color: transparent;\n}\n\n.actionsList {\n --spotlight-actions-list-padding: 4px;\n\n border-top: 1px solid;\n flex: 1;\n padding: var(--spotlight-actions-list-padding);\n max-height: calc(100vh - 15rem);\n margin-inline-end: calc(var(--spotlight-actions-list-padding) * -1);\n width: 100%;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.action {\n display: flex;\n align-items: center;\n width: 100%;\n padding: 7px var(--mantine-spacing-md);\n border-radius: var(--mantine-radius-default);\n background-color: transparent;\n color: inherit;\n text-align: start;\n\n &:where(:not([data-selected])) {\n @mixin hover {\n @mixin where-light {\n background-color: var(--mantine-color-gray-0);\n }\n\n @mixin where-dark {\n background-color: var(--mantine-color-dark-6);\n }\n }\n }\n\n &:where([data-selected]) {\n background-color: var(--mantine-primary-color-filled);\n color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-color: var(--mantine-primary-color-contrast, var(--mantine-color-white));\n --action-description-opacity: 0.7;\n }\n}\n\n.actionBody {\n flex: 1;\n}\n\n.actionSection {\n opacity: 1;\n color: inherit;\n\n &:where([data-dimmed]) {\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n }\n\n &:where([data-position='left']) {\n margin-inline-end: var(--mantine-spacing-md);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--mantine-spacing-md);\n }\n\n & > svg {\n display: block;\n }\n}\n\n.actionLabel {\n display: block;\n}\n\n.actionDescription {\n display: block;\n font-size: var(--mantine-font-size-xs);\n opacity: var(--action-description-opacity, 1);\n color: var(--action-description-color, var(--mantine-color-dimmed));\n}\n\n.empty {\n color: var(--mantine-color-dimmed);\n padding: var(--mantine-spacing-md);\n text-align: center;\n}\n\n.footer {\n padding: var(--mantine-spacing-xs) calc(var(--mantine-spacing-md) + rem(4px));\n border-top: 1px solid;\n\n @mixin where-light {\n border-color: var(--mantine-color-gray-2);\n }\n\n @mixin where-dark {\n border-color: var(--mantine-color-dark-4);\n }\n}\n\n.actionsGroup {\n display: flex;\n flex-direction: column;\n margin-top: var(--mantine-spacing-md);\n\n &::before {\n content: var(--spotlight-label);\n text-transform: uppercase;\n font-size: var(--mantine-font-size-xs);\n font-weight: var(--mantine-font-weight-bold);\n color: var(--mantine-color-dimmed);\n padding-inline-start: var(--mantine-spacing-md);\n }\n\n &:empty {\n display: none;\n }\n}\n","import { defineComponent, h, type PropType, type SlotsType, type VNodeChild } from 'vue'\nimport {\n Box,\n Highlight,\n UnstyledButton,\n hasNode,\n resolveNode,\n type MantineNode,\n type SectionSlots,\n useProps,\n} from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionStylesNames =\n | 'action'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionBody'\n\nexport interface SpotlightActionProps {\n label?: string\n description?: string\n leftSection?: MantineNode\n rightSection?: MantineNode\n dimmedSections?: boolean\n highlightQuery?: boolean\n highlightColor?: string\n closeSpotlightOnTrigger?: boolean\n keywords?: string | string[]\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n dimmedSections: true,\n highlightQuery: false,\n} satisfies Partial<SpotlightActionProps>\n\nexport const SpotlightAction = defineComponent({\n name: 'SpotlightAction',\n inheritAttrs: false,\n slots: Object as SlotsType<SectionSlots & { default?: () => VNodeChild }>,\n props: {\n label: { type: String, default: undefined },\n description: { type: String, default: undefined },\n leftSection: { type: null as unknown as PropType<MantineNode>, default: undefined },\n rightSection: { type: null as unknown as PropType<MantineNode>, default: undefined },\n dimmedSections: { type: Boolean, default: undefined },\n highlightQuery: { type: Boolean, default: undefined },\n highlightColor: { type: String, default: undefined },\n closeSpotlightOnTrigger: { type: Boolean, default: undefined },\n keywords: { type: [String, Array] as PropType<string | string[]>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionProps>('SpotlightAction', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () => {\n const stylesApi = { classNames: props.classNames, styles: props.styles }\n const leftSection = resolveNode(props.leftSection, slots.leftSection)\n const rightSection = resolveNode(props.rightSection, slots.rightSection)\n const labelNode =\n props.highlightQuery && typeof props.label === 'string'\n ? h(\n Highlight,\n {\n component: 'span',\n highlight: ctx.query,\n color: props.highlightColor,\n ...ctx.getStyles('actionLabel', stylesApi),\n },\n () => props.label,\n )\n : h('span', ctx.getStyles('actionLabel', stylesApi), props.label)\n\n return h(\n UnstyledButton,\n {\n ...attrs,\n 'data-action': true,\n ...ctx.getStyles('action', {\n className: attrs.class,\n style: attrs.style,\n ...stylesApi,\n }),\n onMousedown: (event: MouseEvent) => {\n event.preventDefault()\n ;(attrs.onMousedown as ((event: MouseEvent) => void) | undefined)?.(event)\n },\n onClick: (event: MouseEvent) => {\n ;(attrs.onClick as ((event: MouseEvent) => void) | undefined)?.(event)\n\n if (props.closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) {\n spotlightActions.close(ctx.store)\n }\n },\n tabindex: -1,\n },\n () =>\n slots.default?.() ?? [\n hasNode(leftSection)\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'left', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => leftSection,\n )\n : null,\n h('span', ctx.getStyles('actionBody', stylesApi), [\n labelNode,\n h('span', ctx.getStyles('actionDescription', stylesApi), props.description),\n ]),\n hasNode(rightSection)\n ? h(\n Box,\n {\n component: 'span',\n mod: { position: 'right', dimmed: props.dimmedSections },\n ...ctx.getStyles('actionSection', stylesApi),\n },\n () => rightSection,\n )\n : null,\n ],\n )\n }\n },\n})\n\nObject.assign(SpotlightAction, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup'\n\nexport interface SpotlightActionsGroupProps {\n label?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsGroup = defineComponent({\n name: 'SpotlightActionsGroup',\n inheritAttrs: false,\n props: {\n label: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsGroupProps>(\n 'SpotlightActionsGroup',\n null,\n rawProps as any,\n )\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('actionsGroup', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n style: [\n ctx.getStyles('actionsGroup', { styles: props.styles }).style,\n attrs.style as any,\n {\n '--spotlight-label': `'${props.label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n },\n ],\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsGroup, { classes })\n","import { defineComponent, h, onBeforeUnmount, onMounted, type PropType } from 'vue'\nimport { ScrollAreaAutosize, useProps } from '@mantine-vue/core'\nimport { useId } from '@mantine-vue/hooks'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightActionsListStylesNames = 'actionsList' | 'actionsListInner'\n\nexport interface SpotlightActionsListProps {\n id?: string\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightActionsList = defineComponent({\n name: 'SpotlightActionsList',\n inheritAttrs: false,\n props: {\n id: { type: String, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightActionsListProps>('SpotlightActionsList', null, rawProps as any)\n const ctx = useSpotlightContext()\n const generatedId = useId()\n const listId = props.id || `mantine-${generatedId.value.replace(/:/g, '')}`\n\n onMounted(() => spotlightActions.setListId(listId, ctx.store))\n onBeforeUnmount(() => spotlightActions.setListId('', ctx.store))\n\n return () =>\n h(\n ScrollAreaAutosize,\n {\n ...attrs,\n ...ctx.getStyles('actionsList', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n type: 'scroll',\n scrollbarSize: 'var(--spotlight-actions-list-padding)',\n offsetScrollbars: 'y',\n id: listId,\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightActionsList, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightEmptyStylesNames = 'empty'\n\nexport interface SpotlightEmptyProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightEmpty = defineComponent({\n name: 'SpotlightEmpty',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightEmptyProps>('SpotlightEmpty', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('empty', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightEmpty, { classes })\n","import { defineComponent, h, type PropType } from 'vue'\nimport { Box, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFooterStylesNames = 'footer'\n\nexport interface SpotlightFooterProps {\n classNames?: Record<string, any>\n styles?: Record<string, any>\n [key: string]: any\n}\n\nexport const SpotlightFooter = defineComponent({\n name: 'SpotlightFooter',\n inheritAttrs: false,\n props: {\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function] as PropType<any>, default: undefined },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightFooterProps>('SpotlightFooter', null, rawProps as any)\n const ctx = useSpotlightContext()\n\n return () =>\n h(\n Box,\n {\n ...attrs,\n ...ctx.getStyles('footer', {\n className: attrs.class,\n style: attrs.style,\n classNames: props.classNames,\n styles: props.styles,\n }),\n },\n () => slots.default?.(),\n )\n },\n})\n\nObject.assign(SpotlightFooter, { classes })\n","import type { HotkeyItem } from '@mantine-vue/hooks'\nimport type { SpotlightStore } from './spotlight.store'\nimport { spotlightActions } from './spotlight.store'\n\nexport function getHotkeys(\n hotkeys: string | string[] | null | undefined,\n store: SpotlightStore,\n): HotkeyItem[] {\n if (!hotkeys) {\n return []\n }\n\n const open = () => spotlightActions.open(store)\n\n if (Array.isArray(hotkeys)) {\n return hotkeys.map((hotkey) => [hotkey, open])\n }\n\n return [[hotkeys, open]]\n}\n","export function mergeClassNames(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function mergeStyles(...items: any[]) {\n return items.reduce<Record<string, any>>((acc, item) => {\n if (!item || typeof item !== 'object' || Array.isArray(item)) {\n return acc\n }\n\n Object.entries(item).forEach(([key, value]) => {\n acc[key] = acc[key] ? [acc[key], value] : value\n })\n\n return acc\n }, {})\n}\n\nexport function renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n","import { computed, defineComponent, h, ref, watch, type PropType } from 'vue'\nimport { Modal, getDefaultZIndex, rem, useProps, useStyles } from '@mantine-vue/core'\nimport { useHotkeys } from '@mantine-vue/hooks'\nimport { getHotkeys } from './get-hotkeys'\nimport { provideSpotlightContext } from './Spotlight.context'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport {\n spotlightActions,\n spotlightStore,\n useSpotlight,\n type SpotlightStore,\n} from './spotlight.store'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightRootStylesNames =\n | 'root'\n | 'body'\n | 'close'\n | 'content'\n | 'header'\n | 'inner'\n | 'overlay'\n | 'title'\n | 'search'\n | 'actionsList'\n | 'actionsListInner'\n | 'action'\n | 'empty'\n | 'footer'\n | 'actionBody'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionsGroup'\n\nexport interface SpotlightRootProps {\n store?: SpotlightStore\n query?: string\n onQueryChange?: (query: string) => void\n clearQueryOnClose?: boolean\n shortcut?: string | string[] | null\n tagsToIgnore?: string[]\n triggerOnContentEditable?: boolean\n disabled?: boolean\n onSpotlightOpen?: () => void\n onSpotlightClose?: () => void\n forceOpened?: boolean\n closeOnActionTrigger?: boolean\n maxHeight?: string | number\n scrollable?: boolean\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n unstyled?: boolean\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n maxHeight: 400,\n} satisfies Partial<SpotlightRootProps>\n\nexport const SpotlightRoot = defineComponent({\n name: 'SpotlightRoot',\n inheritAttrs: false,\n props: {\n store: { type: Object as PropType<SpotlightStore>, default: undefined },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: {\n type: [String, Array, null] as PropType<string | string[] | null>,\n default: undefined,\n },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs, slots }) {\n const props = useProps<SpotlightRootProps>('SpotlightRoot', defaultProps, rawProps as any)\n const state = useSpotlight(props.store!)\n const previousOpened = ref(state.value.opened)\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : state.value.query,\n )\n\n const setQuery = (query: string) => {\n props.onQueryChange?.(query)\n spotlightActions.setQuery(query, props.store!)\n }\n\n const getStyles = useStyles({\n name: 'Spotlight',\n classes,\n props,\n className: attrs.class,\n style: attrs.style as any,\n classNames: props.classNames as any,\n styles: props.styles as any,\n unstyled: props.unstyled,\n vars: props.vars as any,\n })\n\n provideSpotlightContext({\n get query() {\n return currentQuery.value\n },\n setQuery,\n getStyles,\n store: props.store!,\n get closeOnActionTrigger() {\n return props.closeOnActionTrigger\n },\n })\n\n useHotkeys(\n () => getHotkeys(props.shortcut, props.store!),\n () => props.tagsToIgnore,\n () => props.triggerOnContentEditable,\n )\n\n watch(\n () => state.value.opened,\n (opened) => {\n if (opened === previousOpened.value) {\n return\n }\n\n if (opened) {\n props.onSpotlightOpen?.()\n } else {\n props.onSpotlightClose?.()\n }\n previousOpened.value = opened\n },\n )\n\n return () => {\n if (props.disabled) {\n return null\n }\n\n const rootStyles = getStyles('root', { className: attrs.class, style: attrs.style as any })\n\n const {\n classNames: _classNames,\n styles: _styles,\n vars: _vars,\n unstyled: _unstyled,\n store: _store,\n query: _query,\n onQueryChange: _onQueryChange,\n clearQueryOnClose: _clearQueryOnClose,\n shortcut: _shortcut,\n tagsToIgnore: _tagsToIgnore,\n triggerOnContentEditable: _triggerOnContentEditable,\n disabled: _disabled,\n onSpotlightOpen: _onSpotlightOpen,\n onSpotlightClose: _onSpotlightClose,\n forceOpened: _forceOpened,\n closeOnActionTrigger: _closeOnActionTrigger,\n maxHeight: _maxHeight,\n scrollable: _scrollable,\n ...modalAttrs\n } = { ...attrs, ...props }\n\n return h(\n Modal,\n {\n ...modalAttrs,\n withCloseButton: false,\n opened: state.value.opened || !!props.forceOpened,\n padding: 0,\n onClose: () => spotlightActions.close(props.store!),\n class: rootStyles.class,\n style: rootStyles.style,\n classNames: mergeClassNames(\n {\n body: classes.body,\n content: classes.content,\n },\n props.classNames,\n ),\n styles: mergeStyles(props.styles),\n vars: mergeStyles(\n {\n root: {\n '--spotlight-max-height': props.scrollable ? rem(props.maxHeight) : undefined,\n },\n },\n props.vars,\n ),\n onExitTransitionEnd: () => {\n if (props.clearQueryOnClose) {\n setQuery('')\n }\n\n spotlightActions.clearSpotlightState(\n { clearQuery: props.clearQueryOnClose },\n props.store!,\n )\n props.transitionProps?.onExited?.()\n props.onExitTransitionEnd?.()\n },\n 'data-scrollable': props.scrollable || undefined,\n },\n slots,\n )\n }\n },\n})\n\nObject.assign(SpotlightRoot, { classes })\n","import { defineComponent, h, ref, type PropType } from 'vue'\nimport { Input, useProps } from '@mantine-vue/core'\nimport { useSpotlightContext } from './Spotlight.context'\nimport { spotlightActions } from './spotlight.store'\nimport { mergeClassNames, mergeStyles } from './style-api'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightSearchStylesNames = 'input' | 'wrapper' | 'section' | 'bottomSection'\n\nexport interface SpotlightSearchProps {\n size?: string | number\n value?: string\n onChange?: (event: Event) => void\n onKeydown?: (event: KeyboardEvent) => void\n classNames?: Record<string, any>\n styles?: Record<string, any>\n vars?: Record<string, any>\n [key: string]: any\n}\n\nconst defaultProps = {\n size: 'lg',\n} satisfies Partial<SpotlightSearchProps>\n\nexport const SpotlightSearch = defineComponent({\n name: 'SpotlightSearch',\n inheritAttrs: false,\n props: {\n size: { type: [String, Number] as PropType<string | number>, default: undefined },\n value: { type: String, default: undefined },\n onChange: { type: Function as PropType<(event: Event) => void>, default: undefined },\n onKeydown: { type: Function as PropType<(event: KeyboardEvent) => void>, default: undefined },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightSearchProps>('SpotlightSearch', defaultProps, rawProps as any)\n const ctx = useSpotlightContext()\n const isComposing = ref(false)\n\n const handleKeydown = (event: KeyboardEvent) => {\n props.onKeydown?.(event)\n\n if (isComposing.value) {\n return\n }\n\n if (event.code === 'ArrowDown') {\n event.preventDefault()\n spotlightActions.selectNextAction(ctx.store)\n }\n\n if (event.code === 'ArrowUp') {\n event.preventDefault()\n spotlightActions.selectPreviousAction(ctx.store)\n }\n\n if (event.code === 'Enter' || event.code === 'NumpadEnter') {\n event.preventDefault()\n spotlightActions.triggerSelectedAction(ctx.store)\n }\n }\n\n return () => {\n const inputStyles = ctx.getStyles('search')\n\n return h(Input, {\n ...attrs,\n size: props.size,\n value: props.value ?? ctx.query,\n classNames: mergeClassNames({ input: inputStyles.class }, props.classNames),\n styles: mergeStyles({ input: inputStyles.style }, props.styles),\n vars: props.vars,\n onInput: (event: Event) => {\n ctx.setQuery((event.currentTarget as HTMLInputElement).value)\n props.onChange?.(event)\n },\n onKeydown: handleKeydown,\n onCompositionstart: () => {\n isComposing.value = true\n },\n onCompositionend: () => {\n isComposing.value = false\n },\n })\n }\n },\n})\n\nObject.assign(SpotlightSearch, { classes })\n","import { computed, defineComponent, h, ref, type PropType } from 'vue'\nimport { getDefaultZIndex, useProps } from '@mantine-vue/core'\nimport { defaultSpotlightFilter } from './default-spotlight-filter'\nimport { isActionsGroup } from './is-actions-group'\nimport { limitActions } from './limit-actions'\nimport { spotlight, spotlightStore } from './spotlight.store'\nimport {\n SpotlightAction,\n type SpotlightActionProps,\n type SpotlightActionStylesNames,\n} from './SpotlightAction'\nimport {\n SpotlightActionsGroup,\n type SpotlightActionsGroupProps,\n type SpotlightActionsGroupStylesNames,\n} from './SpotlightActionsGroup'\nimport {\n SpotlightActionsList,\n type SpotlightActionsListProps,\n type SpotlightActionsListStylesNames,\n} from './SpotlightActionsList'\nimport {\n SpotlightEmpty,\n type SpotlightEmptyProps,\n type SpotlightEmptyStylesNames,\n} from './SpotlightEmpty'\nimport {\n SpotlightFooter,\n type SpotlightFooterProps,\n type SpotlightFooterStylesNames,\n} from './SpotlightFooter'\nimport {\n SpotlightRoot,\n type SpotlightRootProps,\n type SpotlightRootStylesNames,\n} from './SpotlightRoot'\nimport {\n SpotlightSearch,\n type SpotlightSearchProps,\n type SpotlightSearchStylesNames,\n} from './SpotlightSearch'\nimport classes from './Spotlight.module.css'\n\nexport type SpotlightFilterFunction = (\n query: string,\n actions: SpotlightActions[],\n) => SpotlightActions[]\n\nexport interface SpotlightActionData extends SpotlightActionProps {\n id: string\n group?: string\n}\n\nexport interface SpotlightActionGroupData {\n group: string\n actions: SpotlightActionData[]\n}\n\nexport type SpotlightActions = SpotlightActionData | SpotlightActionGroupData\nexport type SpotlightStylesNames = SpotlightRootStylesNames\n\nexport interface SpotlightProps extends SpotlightRootProps {\n searchProps?: SpotlightSearchProps\n actions: SpotlightActions[]\n filter?: SpotlightFilterFunction\n nothingFound?: any\n highlightQuery?: boolean\n limit?: number\n scrollAreaProps?: Partial<SpotlightActionsListProps>\n}\n\nconst defaultProps = {\n size: 600,\n yOffset: 80,\n limit: Infinity,\n zIndex: getDefaultZIndex('max'),\n overlayProps: { backgroundOpacity: 0.35, blur: 7 },\n transitionProps: { duration: 200, transition: 'pop' },\n store: spotlightStore,\n filter: defaultSpotlightFilter,\n clearQueryOnClose: true,\n closeOnActionTrigger: true,\n shortcut: 'mod + K',\n} satisfies Partial<SpotlightProps>\n\nfunction renderContent(value: any) {\n return typeof value === 'function' ? value() : value\n}\n\nconst SpotlightBase = defineComponent({\n name: 'Spotlight',\n inheritAttrs: false,\n props: {\n searchProps: { type: Object as PropType<SpotlightSearchProps>, default: undefined },\n actions: { type: Array as PropType<SpotlightActions[]>, required: true },\n filter: { type: Function as PropType<SpotlightFilterFunction>, default: undefined },\n nothingFound: { type: [String, Number, Object, Function] as PropType<any>, default: undefined },\n highlightQuery: { type: Boolean, default: false },\n limit: { type: Number, default: undefined },\n scrollAreaProps: {\n type: Object as PropType<Partial<SpotlightActionsListProps>>,\n default: undefined,\n },\n query: { type: String, default: undefined },\n onQueryChange: { type: Function as PropType<(query: string) => void>, default: undefined },\n store: { type: Object as PropType<SpotlightRootProps['store']>, default: undefined },\n clearQueryOnClose: { type: Boolean, default: undefined },\n shortcut: { type: [String, Array] as PropType<string | string[] | null>, default: undefined },\n tagsToIgnore: { type: Array as PropType<string[]>, default: undefined },\n triggerOnContentEditable: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n onSpotlightOpen: { type: Function as PropType<() => void>, default: undefined },\n onSpotlightClose: { type: Function as PropType<() => void>, default: undefined },\n forceOpened: { type: Boolean, default: false },\n closeOnActionTrigger: { type: Boolean, default: undefined },\n maxHeight: { type: [String, Number] as PropType<string | number>, default: undefined },\n scrollable: { type: Boolean, default: false },\n classNames: { type: [Object, Function], default: undefined },\n styles: { type: [Object, Function], default: undefined },\n vars: { type: [Object, Function], default: undefined },\n unstyled: { type: Boolean, default: false },\n },\n setup(rawProps, { attrs }) {\n const props = useProps<SpotlightProps>('Spotlight', defaultProps, rawProps as any)\n const uncontrolledQuery = ref('')\n const currentQuery = computed(() =>\n typeof props.query === 'string' ? props.query : uncontrolledQuery.value,\n )\n\n const setQuery = (query: string) => {\n if (typeof props.query !== 'string') {\n uncontrolledQuery.value = query\n }\n\n props.onQueryChange?.(query)\n }\n\n return () => {\n const filteredActions = limitActions(\n props.filter!(currentQuery.value, props.actions),\n props.limit!,\n )\n const renderedActions = filteredActions.map((item) => {\n if (isActionsGroup(item)) {\n return h(SpotlightActionsGroup, { key: item.group, label: item.group }, () =>\n item.actions.map(({ id, ...actionData }) =>\n h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n }),\n ),\n )\n }\n\n const { id, ...actionData } = item\n return h(SpotlightAction, {\n key: id,\n highlightQuery: props.highlightQuery,\n ...actionData,\n })\n })\n const {\n searchProps: _searchProps,\n actions: _actions,\n filter: _filter,\n nothingFound: _nothingFound,\n highlightQuery: _highlightQuery,\n limit: _limit,\n scrollAreaProps: _scrollAreaProps,\n query: _query,\n onQueryChange: _onQueryChange,\n ...rootProps\n } = props\n\n return h(\n SpotlightRoot,\n {\n ...attrs,\n ...rootProps,\n query: currentQuery.value,\n onQueryChange: setQuery,\n },\n () => [\n h(SpotlightSearch, props.searchProps),\n renderedActions.length > 0\n ? h(SpotlightActionsList, props.scrollAreaProps, () => renderedActions)\n : null,\n renderedActions.length === 0 && props.nothingFound\n ? h(SpotlightEmpty, null, () => renderContent(props.nothingFound))\n : null,\n ],\n )\n }\n },\n})\n\nexport const Spotlight = Object.assign(SpotlightBase, {\n classes,\n Search: SpotlightSearch,\n ActionsList: SpotlightActionsList,\n Action: SpotlightAction,\n Empty: SpotlightEmpty,\n Footer: SpotlightFooter,\n ActionsGroup: SpotlightActionsGroup,\n Root: SpotlightRoot,\n open: spotlight.open,\n close: spotlight.close,\n toggle: spotlight.toggle,\n})\n\nexport type {\n SpotlightActionProps,\n SpotlightActionStylesNames,\n SpotlightActionsGroupProps,\n SpotlightActionsGroupStylesNames,\n SpotlightActionsListProps,\n SpotlightActionsListStylesNames,\n SpotlightEmptyProps,\n SpotlightEmptyStylesNames,\n SpotlightFooterProps,\n SpotlightFooterStylesNames,\n SpotlightRootProps,\n SpotlightRootStylesNames,\n SpotlightSearchProps,\n SpotlightSearchStylesNames,\n}\n"],"mappings":";;;;;AAGA,SAAS,MAAM,OAAe,KAAa,KAAa;CACtD,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;AAaA,IAAa,6BACX,YAA4B;CAC1B,QAAQ;CACR,OAAO;CACP,UAAU;CACV,QAAQ;CACR,OAAO;CACP,mCAAmB,IAAI,IAAI;AAC7B,CAAC;AAEH,IAAa,gBAAgB,UAAyD,MAAM;AAE5F,SAAgB,2BACd,QACA,OACA;CACA,MAAM,QAAQ,MAAM,SAAS;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ACb,SAAS,UACT,QAAQ,SACR,cAAc,eACd,gBAAgB,iBAChB,OAAO,QACP,iBAAiB,kBACjB,OAAO,QACP,eAAe,gBACf,GAAG,cACD;GAEJ,OAAO,EACL,eACA;IACE,GAAG;IACH,GAAG;IACH,OAAO,aAAa;IACpB,eAAe;GACjB,SACM;IACJ,EAAE,iBAAiB,MAAM,WAAW;IACpC,gBAAgB,SAAS,IACrB,EAAE,sBAAsB,MAAM,uBAAuB,eAAe,IACpE;IACJ,gBAAgB,WAAW,KAAK,MAAM,eAClC,EAAE,gBAAgB,YAAY,cAAc,MAAM,YAAY,CAAC,IAC/D;GACN,CACF;EACF;CACF;AACF,CAAC;AAED,IAAa,YAAY,OAAO,OAAO,eAAe;CACpD,SAAA;CACA,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,cAAc;CACd,MAAM;CACN,MAAM,UAAU;CAChB,OAAO,UAAU;CACjB,QAAQ,UAAU;AACpB,CAAC"}
|
package/lib/Spotlight.d.ts
CHANGED
|
@@ -142,6 +142,7 @@ export declare const Spotlight: {
|
|
|
142
142
|
unstyled: boolean;
|
|
143
143
|
scrollAreaProps: Partial<SpotlightActionsListProps>;
|
|
144
144
|
store: import("./spotlight.store").SpotlightStore | undefined;
|
|
145
|
+
nothingFound: any;
|
|
145
146
|
shortcut: string | string[] | null;
|
|
146
147
|
highlightQuery: boolean;
|
|
147
148
|
onQueryChange: (query: string) => void;
|
|
@@ -154,7 +155,6 @@ export declare const Spotlight: {
|
|
|
154
155
|
closeOnActionTrigger: boolean;
|
|
155
156
|
scrollable: boolean;
|
|
156
157
|
searchProps: SpotlightSearchProps;
|
|
157
|
-
nothingFound: any;
|
|
158
158
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
159
159
|
P: {};
|
|
160
160
|
B: {};
|
|
@@ -277,6 +277,7 @@ export declare const Spotlight: {
|
|
|
277
277
|
unstyled: boolean;
|
|
278
278
|
scrollAreaProps: Partial<SpotlightActionsListProps>;
|
|
279
279
|
store: import("./spotlight.store").SpotlightStore | undefined;
|
|
280
|
+
nothingFound: any;
|
|
280
281
|
shortcut: string | string[] | null;
|
|
281
282
|
highlightQuery: boolean;
|
|
282
283
|
onQueryChange: (query: string) => void;
|
|
@@ -289,7 +290,6 @@ export declare const Spotlight: {
|
|
|
289
290
|
closeOnActionTrigger: boolean;
|
|
290
291
|
scrollable: boolean;
|
|
291
292
|
searchProps: SpotlightSearchProps;
|
|
292
|
-
nothingFound: any;
|
|
293
293
|
}>;
|
|
294
294
|
__isFragment?: never;
|
|
295
295
|
__isTeleport?: never;
|
|
@@ -409,6 +409,7 @@ export declare const Spotlight: {
|
|
|
409
409
|
unstyled: boolean;
|
|
410
410
|
scrollAreaProps: Partial<SpotlightActionsListProps>;
|
|
411
411
|
store: import("./spotlight.store").SpotlightStore | undefined;
|
|
412
|
+
nothingFound: any;
|
|
412
413
|
shortcut: string | string[] | null;
|
|
413
414
|
highlightQuery: boolean;
|
|
414
415
|
onQueryChange: (query: string) => void;
|
|
@@ -421,7 +422,6 @@ export declare const Spotlight: {
|
|
|
421
422
|
closeOnActionTrigger: boolean;
|
|
422
423
|
scrollable: boolean;
|
|
423
424
|
searchProps: SpotlightSearchProps;
|
|
424
|
-
nothingFound: any;
|
|
425
425
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
426
426
|
classes: Record<string, string>;
|
|
427
427
|
Search: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
@@ -486,8 +486,8 @@ export declare const Spotlight: {
|
|
|
486
486
|
};
|
|
487
487
|
}>> & Readonly<{}>, {
|
|
488
488
|
size: string | number;
|
|
489
|
-
onChange: (event: Event) => void;
|
|
490
489
|
onKeydown: (event: KeyboardEvent) => void;
|
|
490
|
+
onChange: (event: Event) => void;
|
|
491
491
|
value: string;
|
|
492
492
|
classNames: Function | Record<string, any>;
|
|
493
493
|
styles: Function | Record<string, any>;
|
|
@@ -545,11 +545,11 @@ export declare const Spotlight: {
|
|
|
545
545
|
default: undefined;
|
|
546
546
|
};
|
|
547
547
|
leftSection: {
|
|
548
|
-
type: PropType<
|
|
548
|
+
type: PropType<import("@mantine-vue/core").MantineNode>;
|
|
549
549
|
default: undefined;
|
|
550
550
|
};
|
|
551
551
|
rightSection: {
|
|
552
|
-
type: PropType<
|
|
552
|
+
type: PropType<import("@mantine-vue/core").MantineNode>;
|
|
553
553
|
default: undefined;
|
|
554
554
|
};
|
|
555
555
|
dimmedSections: {
|
|
@@ -596,11 +596,11 @@ export declare const Spotlight: {
|
|
|
596
596
|
default: undefined;
|
|
597
597
|
};
|
|
598
598
|
leftSection: {
|
|
599
|
-
type: PropType<
|
|
599
|
+
type: PropType<import("@mantine-vue/core").MantineNode>;
|
|
600
600
|
default: undefined;
|
|
601
601
|
};
|
|
602
602
|
rightSection: {
|
|
603
|
-
type: PropType<
|
|
603
|
+
type: PropType<import("@mantine-vue/core").MantineNode>;
|
|
604
604
|
default: undefined;
|
|
605
605
|
};
|
|
606
606
|
dimmedSections: {
|
|
@@ -641,14 +641,16 @@ export declare const Spotlight: {
|
|
|
641
641
|
styles: Function | Record<string, any>;
|
|
642
642
|
description: string;
|
|
643
643
|
vars: Function | Record<string, any>;
|
|
644
|
-
leftSection:
|
|
645
|
-
rightSection:
|
|
644
|
+
leftSection: import("@mantine-vue/core").MantineNode;
|
|
645
|
+
rightSection: import("@mantine-vue/core").MantineNode;
|
|
646
646
|
dimmedSections: boolean;
|
|
647
647
|
highlightQuery: boolean;
|
|
648
648
|
highlightColor: string;
|
|
649
649
|
closeSpotlightOnTrigger: boolean;
|
|
650
650
|
keywords: string | string[];
|
|
651
|
-
},
|
|
651
|
+
}, import("vue").SlotsType<import("@mantine-vue/core").SectionSlots & {
|
|
652
|
+
default?: () => import("vue").VNodeChild;
|
|
653
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
652
654
|
Empty: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
653
655
|
classNames: {
|
|
654
656
|
type: (ObjectConstructor | FunctionConstructor)[];
|
package/lib/SpotlightAction.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type PropType } from 'vue';
|
|
1
|
+
import { type PropType, type SlotsType, type VNodeChild } from 'vue';
|
|
2
|
+
import { type MantineNode, type SectionSlots } from '@mantine-vue/core';
|
|
2
3
|
export type SpotlightActionStylesNames = 'action' | 'actionLabel' | 'actionDescription' | 'actionSection' | 'actionBody';
|
|
3
4
|
export interface SpotlightActionProps {
|
|
4
5
|
label?: string;
|
|
5
6
|
description?: string;
|
|
6
|
-
leftSection?:
|
|
7
|
-
rightSection?:
|
|
7
|
+
leftSection?: MantineNode;
|
|
8
|
+
rightSection?: MantineNode;
|
|
8
9
|
dimmedSections?: boolean;
|
|
9
10
|
highlightQuery?: boolean;
|
|
10
11
|
highlightColor?: string;
|
|
@@ -25,11 +26,11 @@ export declare const SpotlightAction: import("vue").DefineComponent<import("vue"
|
|
|
25
26
|
default: undefined;
|
|
26
27
|
};
|
|
27
28
|
leftSection: {
|
|
28
|
-
type: PropType<
|
|
29
|
+
type: PropType<MantineNode>;
|
|
29
30
|
default: undefined;
|
|
30
31
|
};
|
|
31
32
|
rightSection: {
|
|
32
|
-
type: PropType<
|
|
33
|
+
type: PropType<MantineNode>;
|
|
33
34
|
default: undefined;
|
|
34
35
|
};
|
|
35
36
|
dimmedSections: {
|
|
@@ -76,11 +77,11 @@ export declare const SpotlightAction: import("vue").DefineComponent<import("vue"
|
|
|
76
77
|
default: undefined;
|
|
77
78
|
};
|
|
78
79
|
leftSection: {
|
|
79
|
-
type: PropType<
|
|
80
|
+
type: PropType<MantineNode>;
|
|
80
81
|
default: undefined;
|
|
81
82
|
};
|
|
82
83
|
rightSection: {
|
|
83
|
-
type: PropType<
|
|
84
|
+
type: PropType<MantineNode>;
|
|
84
85
|
default: undefined;
|
|
85
86
|
};
|
|
86
87
|
dimmedSections: {
|
|
@@ -121,11 +122,13 @@ export declare const SpotlightAction: import("vue").DefineComponent<import("vue"
|
|
|
121
122
|
styles: Function | Record<string, any>;
|
|
122
123
|
description: string;
|
|
123
124
|
vars: Function | Record<string, any>;
|
|
124
|
-
leftSection:
|
|
125
|
-
rightSection:
|
|
125
|
+
leftSection: MantineNode;
|
|
126
|
+
rightSection: MantineNode;
|
|
126
127
|
dimmedSections: boolean;
|
|
127
128
|
highlightQuery: boolean;
|
|
128
129
|
highlightColor: string;
|
|
129
130
|
closeSpotlightOnTrigger: boolean;
|
|
130
131
|
keywords: string | string[];
|
|
131
|
-
},
|
|
132
|
+
}, SlotsType<SectionSlots & {
|
|
133
|
+
default?: () => VNodeChild;
|
|
134
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/lib/SpotlightSearch.d.ts
CHANGED
|
@@ -72,8 +72,8 @@ export declare const SpotlightSearch: import("vue").DefineComponent<import("vue"
|
|
|
72
72
|
};
|
|
73
73
|
}>> & Readonly<{}>, {
|
|
74
74
|
size: string | number;
|
|
75
|
-
onChange: (event: Event) => void;
|
|
76
75
|
onKeydown: (event: KeyboardEvent) => void;
|
|
76
|
+
onChange: (event: Event) => void;
|
|
77
77
|
value: string;
|
|
78
78
|
classNames: Function | Record<string, any>;
|
|
79
79
|
styles: Function | Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine-vue/spotlight",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Vue command center components equivalent to @mantine/spotlight",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"vue": "^3.5.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@mantine-vue/core": "2.
|
|
40
|
-
"@mantine-vue/hooks": "2.
|
|
41
|
-
"@mantine-vue/store": "2.
|
|
39
|
+
"@mantine-vue/core": "2.1.0",
|
|
40
|
+
"@mantine-vue/hooks": "2.1.0",
|
|
41
|
+
"@mantine-vue/store": "2.1.0",
|
|
42
42
|
"vue": "^3.5.0"
|
|
43
43
|
}
|
|
44
44
|
}
|