@mantine/spotlight 9.0.0-alpha.7 → 9.0.1
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/Spotlight.cjs.map +1 -1
- package/esm/Spotlight.mjs.map +1 -1
- package/lib/Spotlight.d.ts +42 -6
- package/lib/index.d.mts +0 -36
- package/lib/index.d.ts +0 -36
- package/package.json +4 -4
package/cjs/Spotlight.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spotlight.cjs","names":["spotlightStore","defaultSpotlightFilter","limitActions","isActionsGroup","SpotlightAction","SpotlightActionsGroup","SpotlightRoot","SpotlightSearch","SpotlightActionsList","SpotlightEmpty","classes","SpotlightFooter","spotlight"],"sources":["../src/Spotlight.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n getDefaultZIndex,\n ScrollAreaAutosizeProps,\n useProps,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { defaultSpotlightFilter } from './default-spotlight-filter';\nimport { isActionsGroup } from './is-actions-group';\nimport { limitActions } from './limit-actions';\nimport { spotlight, spotlightStore } from './spotlight.store';\nimport {
|
|
1
|
+
{"version":3,"file":"Spotlight.cjs","names":["spotlightStore","defaultSpotlightFilter","limitActions","isActionsGroup","SpotlightAction","SpotlightActionsGroup","SpotlightRoot","SpotlightSearch","SpotlightActionsList","SpotlightEmpty","classes","SpotlightFooter","spotlight"],"sources":["../src/Spotlight.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n getDefaultZIndex,\n ScrollAreaAutosizeProps,\n useProps,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\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 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 { SpotlightRoot, SpotlightRootProps, SpotlightRootStylesNames } from './SpotlightRoot';\nimport {\n SpotlightSearch,\n 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;\n\nexport type SpotlightStylesNames = SpotlightRootStylesNames;\n\nexport interface SpotlightProps extends SpotlightRootProps {\n /** Props passed down to the `Spotlight.Search` */\n searchProps?: SpotlightSearchProps;\n\n /** Actions data, passed down to `Spotlight.Action` component */\n actions: SpotlightActions[];\n\n /** Function to filter actions data based on search query, by default actions are filtered by title, description and keywords */\n filter?: SpotlightFilterFunction;\n\n /** Message displayed when none of the actions match given `filter` */\n nothingFound?: React.ReactNode;\n\n /** Determines whether search query should be highlighted in action label @default false */\n highlightQuery?: boolean;\n\n /** Maximum number of actions displayed at a time @default Infinity */\n limit?: number;\n\n /** Props passed down to the `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaAutosizeProps>;\n}\n\nexport type SpotlightFactory = Factory<{\n props: SpotlightProps;\n ref: HTMLDivElement;\n stylesNames: SpotlightStylesNames;\n staticComponents: {\n Search: typeof SpotlightSearch;\n ActionsList: typeof SpotlightActionsList;\n Action: typeof SpotlightAction;\n Empty: typeof SpotlightEmpty;\n Footer: typeof SpotlightFooter;\n ActionsGroup: typeof SpotlightActionsGroup;\n Root: typeof SpotlightRoot;\n open: typeof spotlight.open;\n close: typeof spotlight.close;\n toggle: typeof spotlight.toggle;\n };\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\nexport const Spotlight = factory<SpotlightFactory>((_props) => {\n const props = useProps('Spotlight', defaultProps, _props);\n const {\n searchProps,\n filter,\n query,\n onQueryChange,\n actions,\n nothingFound,\n highlightQuery,\n limit,\n scrollAreaProps,\n ...others\n } = props;\n\n const [_query, setQuery] = useUncontrolled({\n value: query,\n defaultValue: '',\n finalValue: '',\n onChange: onQueryChange,\n });\n\n const filteredActions = limitActions(filter(_query, actions), limit).map((item) => {\n if (isActionsGroup(item)) {\n const items = item.actions.map(({ id, ...actionData }) => (\n <SpotlightAction key={id} highlightQuery={highlightQuery} {...actionData} />\n ));\n\n return (\n <SpotlightActionsGroup key={item.group} label={item.group}>\n {items}\n </SpotlightActionsGroup>\n );\n }\n\n return <SpotlightAction key={item.id} highlightQuery={highlightQuery} {...item} />;\n });\n\n return (\n <SpotlightRoot {...others} query={_query} onQueryChange={setQuery}>\n <SpotlightSearch {...searchProps} />\n {filteredActions.length > 0 && (\n <SpotlightActionsList {...(scrollAreaProps as any)}>{filteredActions}</SpotlightActionsList>\n )}\n {filteredActions.length === 0 && nothingFound && (\n <SpotlightEmpty>{nothingFound}</SpotlightEmpty>\n )}\n </SpotlightRoot>\n );\n});\n\nSpotlight.classes = classes;\nSpotlight.displayName = '@mantine/spotlight/Spotlight';\nSpotlight.Search = SpotlightSearch;\nSpotlight.ActionsList = SpotlightActionsList;\nSpotlight.Action = SpotlightAction;\nSpotlight.Empty = SpotlightEmpty;\nSpotlight.ActionsGroup = SpotlightActionsGroup;\nSpotlight.Footer = SpotlightFooter;\nSpotlight.Root = SpotlightRoot;\nSpotlight.open = spotlight.open;\nSpotlight.close = spotlight.close;\nSpotlight.toggle = spotlight.toggle;\n\nexport namespace Spotlight {\n export type Props = SpotlightProps;\n export type StylesNames = SpotlightStylesNames;\n export type Factory = SpotlightFactory;\n export type FilterFunction = SpotlightFilterFunction;\n export type ActionData = SpotlightActionData;\n export type ActionGroupData = SpotlightActionGroupData;\n\n export namespace Action {\n export type Props = SpotlightActionProps;\n export type StylesNames = SpotlightActionStylesNames;\n }\n\n export namespace ActionsGroup {\n export type Props = SpotlightActionsGroupProps;\n export type StylesNames = SpotlightActionsGroupStylesNames;\n }\n\n export namespace ActionsList {\n export type Props = SpotlightActionsListProps;\n export type StylesNames = SpotlightActionsListStylesNames;\n }\n\n export namespace Empty {\n export type Props = SpotlightEmptyProps;\n export type StylesNames = SpotlightEmptyStylesNames;\n }\n\n export namespace Footer {\n export type Props = SpotlightFooterProps;\n export type StylesNames = SpotlightFooterStylesNames;\n }\n\n export namespace Search {\n export type Props = SpotlightSearchProps;\n export type StylesNames = SpotlightSearchStylesNames;\n }\n\n export namespace Root {\n export type Props = SpotlightRootProps;\n export type StylesNames = SpotlightRootStylesNames;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,MAAM;CACN,SAAS;CACT,OAAO;CACP,SAAA,GAAA,cAAA,kBAAyB,MAAM;CAC/B,cAAc;EAAE,mBAAmB;EAAM,MAAM;EAAG;CAClD,iBAAiB;EAAE,UAAU;EAAK,YAAY;EAAO;CACrD,OAAOA,wBAAAA;CACP,QAAQC,iCAAAA;CACR,mBAAmB;CACnB,sBAAsB;CACtB,UAAU;CACX;AAED,MAAa,aAAA,GAAA,cAAA,UAAuC,WAAW;CAE7D,MAAM,EACJ,aACA,QACA,OACA,eACA,SACA,cACA,gBACA,OACA,iBACA,GAAG,YAAA,GAAA,cAAA,UAXkB,aAAa,cAAc,OAAO;CAczD,MAAM,CAAC,QAAQ,aAAA,GAAA,eAAA,iBAA4B;EACzC,OAAO;EACP,cAAc;EACd,YAAY;EACZ,UAAU;EACX,CAAC;CAEF,MAAM,kBAAkBC,sBAAAA,aAAa,OAAO,QAAQ,QAAQ,EAAE,MAAM,CAAC,KAAK,SAAS;AACjF,MAAIC,yBAAAA,eAAe,KAAK,EAAE;GACxB,MAAM,QAAQ,KAAK,QAAQ,KAAK,EAAE,IAAI,GAAG,iBACvC,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD;IAA0C;IAAgB,GAAI;IAAc,EAAtD,GAAsD,CAC5E;AAEF,UACE,iBAAA,GAAA,kBAAA,KAACC,8BAAAA,uBAAD;IAAwC,OAAO,KAAK;cACjD;IACqB,EAFI,KAAK,MAET;;AAI5B,SAAO,iBAAA,GAAA,kBAAA,KAACD,wBAAAA,iBAAD;GAA+C;GAAgB,GAAI;GAAQ,EAArD,KAAK,GAAgD;GAClF;AAEF,QACE,iBAAA,GAAA,kBAAA,MAACE,sBAAAA,eAAD;EAAe,GAAI;EAAQ,OAAO;EAAQ,eAAe;YAAzD;GACE,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD,EAAiB,GAAI,aAAe,CAAA;GACnC,gBAAgB,SAAS,KACxB,iBAAA,GAAA,kBAAA,KAACC,6BAAAA,sBAAD;IAAsB,GAAK;cAA0B;IAAuC,CAAA;GAE7F,gBAAgB,WAAW,KAAK,gBAC/B,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,gBAAD,EAAA,UAAiB,cAA8B,CAAA;GAEnC;;EAElB;AAEF,UAAU,UAAUC,yBAAAA;AACpB,UAAU,cAAc;AACxB,UAAU,SAASH,wBAAAA;AACnB,UAAU,cAAcC,6BAAAA;AACxB,UAAU,SAASJ,wBAAAA;AACnB,UAAU,QAAQK,uBAAAA;AAClB,UAAU,eAAeJ,8BAAAA;AACzB,UAAU,SAASM,wBAAAA;AACnB,UAAU,OAAOL,sBAAAA;AACjB,UAAU,OAAOM,wBAAAA,UAAU;AAC3B,UAAU,QAAQA,wBAAAA,UAAU;AAC5B,UAAU,SAASA,wBAAAA,UAAU"}
|
package/esm/Spotlight.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spotlight.mjs","names":["classes"],"sources":["../src/Spotlight.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n getDefaultZIndex,\n ScrollAreaAutosizeProps,\n useProps,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\nimport { defaultSpotlightFilter } from './default-spotlight-filter';\nimport { isActionsGroup } from './is-actions-group';\nimport { limitActions } from './limit-actions';\nimport { spotlight, spotlightStore } from './spotlight.store';\nimport {
|
|
1
|
+
{"version":3,"file":"Spotlight.mjs","names":["classes"],"sources":["../src/Spotlight.tsx"],"sourcesContent":["import {\n factory,\n Factory,\n getDefaultZIndex,\n ScrollAreaAutosizeProps,\n useProps,\n} from '@mantine/core';\nimport { useUncontrolled } from '@mantine/hooks';\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 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 { SpotlightRoot, SpotlightRootProps, SpotlightRootStylesNames } from './SpotlightRoot';\nimport {\n SpotlightSearch,\n 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;\n\nexport type SpotlightStylesNames = SpotlightRootStylesNames;\n\nexport interface SpotlightProps extends SpotlightRootProps {\n /** Props passed down to the `Spotlight.Search` */\n searchProps?: SpotlightSearchProps;\n\n /** Actions data, passed down to `Spotlight.Action` component */\n actions: SpotlightActions[];\n\n /** Function to filter actions data based on search query, by default actions are filtered by title, description and keywords */\n filter?: SpotlightFilterFunction;\n\n /** Message displayed when none of the actions match given `filter` */\n nothingFound?: React.ReactNode;\n\n /** Determines whether search query should be highlighted in action label @default false */\n highlightQuery?: boolean;\n\n /** Maximum number of actions displayed at a time @default Infinity */\n limit?: number;\n\n /** Props passed down to the `ScrollArea` component */\n scrollAreaProps?: Partial<ScrollAreaAutosizeProps>;\n}\n\nexport type SpotlightFactory = Factory<{\n props: SpotlightProps;\n ref: HTMLDivElement;\n stylesNames: SpotlightStylesNames;\n staticComponents: {\n Search: typeof SpotlightSearch;\n ActionsList: typeof SpotlightActionsList;\n Action: typeof SpotlightAction;\n Empty: typeof SpotlightEmpty;\n Footer: typeof SpotlightFooter;\n ActionsGroup: typeof SpotlightActionsGroup;\n Root: typeof SpotlightRoot;\n open: typeof spotlight.open;\n close: typeof spotlight.close;\n toggle: typeof spotlight.toggle;\n };\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\nexport const Spotlight = factory<SpotlightFactory>((_props) => {\n const props = useProps('Spotlight', defaultProps, _props);\n const {\n searchProps,\n filter,\n query,\n onQueryChange,\n actions,\n nothingFound,\n highlightQuery,\n limit,\n scrollAreaProps,\n ...others\n } = props;\n\n const [_query, setQuery] = useUncontrolled({\n value: query,\n defaultValue: '',\n finalValue: '',\n onChange: onQueryChange,\n });\n\n const filteredActions = limitActions(filter(_query, actions), limit).map((item) => {\n if (isActionsGroup(item)) {\n const items = item.actions.map(({ id, ...actionData }) => (\n <SpotlightAction key={id} highlightQuery={highlightQuery} {...actionData} />\n ));\n\n return (\n <SpotlightActionsGroup key={item.group} label={item.group}>\n {items}\n </SpotlightActionsGroup>\n );\n }\n\n return <SpotlightAction key={item.id} highlightQuery={highlightQuery} {...item} />;\n });\n\n return (\n <SpotlightRoot {...others} query={_query} onQueryChange={setQuery}>\n <SpotlightSearch {...searchProps} />\n {filteredActions.length > 0 && (\n <SpotlightActionsList {...(scrollAreaProps as any)}>{filteredActions}</SpotlightActionsList>\n )}\n {filteredActions.length === 0 && nothingFound && (\n <SpotlightEmpty>{nothingFound}</SpotlightEmpty>\n )}\n </SpotlightRoot>\n );\n});\n\nSpotlight.classes = classes;\nSpotlight.displayName = '@mantine/spotlight/Spotlight';\nSpotlight.Search = SpotlightSearch;\nSpotlight.ActionsList = SpotlightActionsList;\nSpotlight.Action = SpotlightAction;\nSpotlight.Empty = SpotlightEmpty;\nSpotlight.ActionsGroup = SpotlightActionsGroup;\nSpotlight.Footer = SpotlightFooter;\nSpotlight.Root = SpotlightRoot;\nSpotlight.open = spotlight.open;\nSpotlight.close = spotlight.close;\nSpotlight.toggle = spotlight.toggle;\n\nexport namespace Spotlight {\n export type Props = SpotlightProps;\n export type StylesNames = SpotlightStylesNames;\n export type Factory = SpotlightFactory;\n export type FilterFunction = SpotlightFilterFunction;\n export type ActionData = SpotlightActionData;\n export type ActionGroupData = SpotlightActionGroupData;\n\n export namespace Action {\n export type Props = SpotlightActionProps;\n export type StylesNames = SpotlightActionStylesNames;\n }\n\n export namespace ActionsGroup {\n export type Props = SpotlightActionsGroupProps;\n export type StylesNames = SpotlightActionsGroupStylesNames;\n }\n\n export namespace ActionsList {\n export type Props = SpotlightActionsListProps;\n export type StylesNames = SpotlightActionsListStylesNames;\n }\n\n export namespace Empty {\n export type Props = SpotlightEmptyProps;\n export type StylesNames = SpotlightEmptyStylesNames;\n }\n\n export namespace Footer {\n export type Props = SpotlightFooterProps;\n export type StylesNames = SpotlightFooterStylesNames;\n }\n\n export namespace Search {\n export type Props = SpotlightSearchProps;\n export type StylesNames = SpotlightSearchStylesNames;\n }\n\n export namespace Root {\n export type Props = SpotlightRootProps;\n export type StylesNames = SpotlightRootStylesNames;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyGA,MAAM,eAAe;CACnB,MAAM;CACN,SAAS;CACT,OAAO;CACP,QAAQ,iBAAiB,MAAM;CAC/B,cAAc;EAAE,mBAAmB;EAAM,MAAM;EAAG;CAClD,iBAAiB;EAAE,UAAU;EAAK,YAAY;EAAO;CACrD,OAAO;CACP,QAAQ;CACR,mBAAmB;CACnB,sBAAsB;CACtB,UAAU;CACX;AAED,MAAa,YAAY,SAA2B,WAAW;CAE7D,MAAM,EACJ,aACA,QACA,OACA,eACA,SACA,cACA,gBACA,OACA,iBACA,GAAG,WAXS,SAAS,aAAa,cAAc,OAAO;CAczD,MAAM,CAAC,QAAQ,YAAY,gBAAgB;EACzC,OAAO;EACP,cAAc;EACd,YAAY;EACZ,UAAU;EACX,CAAC;CAEF,MAAM,kBAAkB,aAAa,OAAO,QAAQ,QAAQ,EAAE,MAAM,CAAC,KAAK,SAAS;AACjF,MAAI,eAAe,KAAK,EAAE;GACxB,MAAM,QAAQ,KAAK,QAAQ,KAAK,EAAE,IAAI,GAAG,iBACvC,oBAAC,iBAAD;IAA0C;IAAgB,GAAI;IAAc,EAAtD,GAAsD,CAC5E;AAEF,UACE,oBAAC,uBAAD;IAAwC,OAAO,KAAK;cACjD;IACqB,EAFI,KAAK,MAET;;AAI5B,SAAO,oBAAC,iBAAD;GAA+C;GAAgB,GAAI;GAAQ,EAArD,KAAK,GAAgD;GAClF;AAEF,QACE,qBAAC,eAAD;EAAe,GAAI;EAAQ,OAAO;EAAQ,eAAe;YAAzD;GACE,oBAAC,iBAAD,EAAiB,GAAI,aAAe,CAAA;GACnC,gBAAgB,SAAS,KACxB,oBAAC,sBAAD;IAAsB,GAAK;cAA0B;IAAuC,CAAA;GAE7F,gBAAgB,WAAW,KAAK,gBAC/B,oBAAC,gBAAD,EAAA,UAAiB,cAA8B,CAAA;GAEnC;;EAElB;AAEF,UAAU,UAAUA;AACpB,UAAU,cAAc;AACxB,UAAU,SAAS;AACnB,UAAU,cAAc;AACxB,UAAU,SAAS;AACnB,UAAU,QAAQ;AAClB,UAAU,eAAe;AACzB,UAAU,SAAS;AACnB,UAAU,OAAO;AACjB,UAAU,OAAO,UAAU;AAC3B,UAAU,QAAQ,UAAU;AAC5B,UAAU,SAAS,UAAU"}
|
package/lib/Spotlight.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Factory, ScrollAreaAutosizeProps } from '@mantine/core';
|
|
2
2
|
import { spotlight } from './spotlight.store';
|
|
3
|
-
import { SpotlightAction, SpotlightActionProps } from './SpotlightAction';
|
|
4
|
-
import { SpotlightActionsGroup } from './SpotlightActionsGroup';
|
|
5
|
-
import { SpotlightActionsList } from './SpotlightActionsList';
|
|
6
|
-
import { SpotlightEmpty } from './SpotlightEmpty';
|
|
7
|
-
import { SpotlightFooter } from './SpotlightFooter';
|
|
3
|
+
import { SpotlightAction, SpotlightActionProps, type SpotlightActionStylesNames } from './SpotlightAction';
|
|
4
|
+
import { SpotlightActionsGroup, type SpotlightActionsGroupProps, type SpotlightActionsGroupStylesNames } from './SpotlightActionsGroup';
|
|
5
|
+
import { SpotlightActionsList, type SpotlightActionsListProps, type SpotlightActionsListStylesNames } from './SpotlightActionsList';
|
|
6
|
+
import { SpotlightEmpty, type SpotlightEmptyProps, type SpotlightEmptyStylesNames } from './SpotlightEmpty';
|
|
7
|
+
import { SpotlightFooter, type SpotlightFooterProps, type SpotlightFooterStylesNames } from './SpotlightFooter';
|
|
8
8
|
import { SpotlightRoot, SpotlightRootProps, SpotlightRootStylesNames } from './SpotlightRoot';
|
|
9
|
-
import { SpotlightSearch, SpotlightSearchProps } from './SpotlightSearch';
|
|
9
|
+
import { SpotlightSearch, SpotlightSearchProps, type SpotlightSearchStylesNames } from './SpotlightSearch';
|
|
10
10
|
export type SpotlightFilterFunction = (query: string, actions: SpotlightActions[]) => SpotlightActions[];
|
|
11
11
|
export interface SpotlightActionData extends SpotlightActionProps {
|
|
12
12
|
id: string;
|
|
@@ -68,3 +68,39 @@ export declare const Spotlight: import("@mantine/core").MantineComponent<{
|
|
|
68
68
|
toggle: typeof spotlight.toggle;
|
|
69
69
|
};
|
|
70
70
|
}>;
|
|
71
|
+
export declare namespace Spotlight {
|
|
72
|
+
type Props = SpotlightProps;
|
|
73
|
+
type StylesNames = SpotlightStylesNames;
|
|
74
|
+
type Factory = SpotlightFactory;
|
|
75
|
+
type FilterFunction = SpotlightFilterFunction;
|
|
76
|
+
type ActionData = SpotlightActionData;
|
|
77
|
+
type ActionGroupData = SpotlightActionGroupData;
|
|
78
|
+
namespace Action {
|
|
79
|
+
type Props = SpotlightActionProps;
|
|
80
|
+
type StylesNames = SpotlightActionStylesNames;
|
|
81
|
+
}
|
|
82
|
+
namespace ActionsGroup {
|
|
83
|
+
type Props = SpotlightActionsGroupProps;
|
|
84
|
+
type StylesNames = SpotlightActionsGroupStylesNames;
|
|
85
|
+
}
|
|
86
|
+
namespace ActionsList {
|
|
87
|
+
type Props = SpotlightActionsListProps;
|
|
88
|
+
type StylesNames = SpotlightActionsListStylesNames;
|
|
89
|
+
}
|
|
90
|
+
namespace Empty {
|
|
91
|
+
type Props = SpotlightEmptyProps;
|
|
92
|
+
type StylesNames = SpotlightEmptyStylesNames;
|
|
93
|
+
}
|
|
94
|
+
namespace Footer {
|
|
95
|
+
type Props = SpotlightFooterProps;
|
|
96
|
+
type StylesNames = SpotlightFooterStylesNames;
|
|
97
|
+
}
|
|
98
|
+
namespace Search {
|
|
99
|
+
type Props = SpotlightSearchProps;
|
|
100
|
+
type StylesNames = SpotlightSearchStylesNames;
|
|
101
|
+
}
|
|
102
|
+
namespace Root {
|
|
103
|
+
type Props = SpotlightRootProps;
|
|
104
|
+
type StylesNames = SpotlightRootStylesNames;
|
|
105
|
+
}
|
|
106
|
+
}
|
package/lib/index.d.mts
CHANGED
|
@@ -18,39 +18,3 @@ export { SpotlightEmpty } from './SpotlightEmpty.js';
|
|
|
18
18
|
export { SpotlightFooter } from './SpotlightFooter.js';
|
|
19
19
|
export { SpotlightSearch } from './SpotlightSearch.js';
|
|
20
20
|
export type { SpotlightProps, SpotlightStylesNames, SpotlightFactory, SpotlightFilterFunction, SpotlightActionData, SpotlightActionGroupData, SpotlightActionProps, SpotlightActionStylesNames, SpotlightActionsGroupProps, SpotlightActionsGroupStylesNames, SpotlightActionsListProps, SpotlightActionsListStylesNames, SpotlightEmptyProps, SpotlightEmptyStylesNames, SpotlightFooterProps, SpotlightFooterStylesNames, SpotlightSearchProps, SpotlightSearchStylesNames, SpotlightRootProps, SpotlightRootStylesNames, };
|
|
21
|
-
export declare namespace Spotlight {
|
|
22
|
-
type Props = SpotlightProps;
|
|
23
|
-
type StylesNames = SpotlightStylesNames;
|
|
24
|
-
type Factory = SpotlightFactory;
|
|
25
|
-
type FilterFunction = SpotlightFilterFunction;
|
|
26
|
-
type ActionData = SpotlightActionData;
|
|
27
|
-
type ActionGroupData = SpotlightActionGroupData;
|
|
28
|
-
namespace Action {
|
|
29
|
-
type Props = SpotlightActionProps;
|
|
30
|
-
type StylesNames = SpotlightActionStylesNames;
|
|
31
|
-
}
|
|
32
|
-
namespace ActionsGroup {
|
|
33
|
-
type Props = SpotlightActionsGroupProps;
|
|
34
|
-
type StylesNames = SpotlightActionsGroupStylesNames;
|
|
35
|
-
}
|
|
36
|
-
namespace ActionsList {
|
|
37
|
-
type Props = SpotlightActionsListProps;
|
|
38
|
-
type StylesNames = SpotlightActionsListStylesNames;
|
|
39
|
-
}
|
|
40
|
-
namespace Empty {
|
|
41
|
-
type Props = SpotlightEmptyProps;
|
|
42
|
-
type StylesNames = SpotlightEmptyStylesNames;
|
|
43
|
-
}
|
|
44
|
-
namespace Footer {
|
|
45
|
-
type Props = SpotlightFooterProps;
|
|
46
|
-
type StylesNames = SpotlightFooterStylesNames;
|
|
47
|
-
}
|
|
48
|
-
namespace Search {
|
|
49
|
-
type Props = SpotlightSearchProps;
|
|
50
|
-
type StylesNames = SpotlightSearchStylesNames;
|
|
51
|
-
}
|
|
52
|
-
namespace Root {
|
|
53
|
-
type Props = SpotlightRootProps;
|
|
54
|
-
type StylesNames = SpotlightRootStylesNames;
|
|
55
|
-
}
|
|
56
|
-
}
|
package/lib/index.d.ts
CHANGED
|
@@ -18,39 +18,3 @@ export { SpotlightEmpty } from './SpotlightEmpty.js';
|
|
|
18
18
|
export { SpotlightFooter } from './SpotlightFooter.js';
|
|
19
19
|
export { SpotlightSearch } from './SpotlightSearch.js';
|
|
20
20
|
export type { SpotlightProps, SpotlightStylesNames, SpotlightFactory, SpotlightFilterFunction, SpotlightActionData, SpotlightActionGroupData, SpotlightActionProps, SpotlightActionStylesNames, SpotlightActionsGroupProps, SpotlightActionsGroupStylesNames, SpotlightActionsListProps, SpotlightActionsListStylesNames, SpotlightEmptyProps, SpotlightEmptyStylesNames, SpotlightFooterProps, SpotlightFooterStylesNames, SpotlightSearchProps, SpotlightSearchStylesNames, SpotlightRootProps, SpotlightRootStylesNames, };
|
|
21
|
-
export declare namespace Spotlight {
|
|
22
|
-
type Props = SpotlightProps;
|
|
23
|
-
type StylesNames = SpotlightStylesNames;
|
|
24
|
-
type Factory = SpotlightFactory;
|
|
25
|
-
type FilterFunction = SpotlightFilterFunction;
|
|
26
|
-
type ActionData = SpotlightActionData;
|
|
27
|
-
type ActionGroupData = SpotlightActionGroupData;
|
|
28
|
-
namespace Action {
|
|
29
|
-
type Props = SpotlightActionProps;
|
|
30
|
-
type StylesNames = SpotlightActionStylesNames;
|
|
31
|
-
}
|
|
32
|
-
namespace ActionsGroup {
|
|
33
|
-
type Props = SpotlightActionsGroupProps;
|
|
34
|
-
type StylesNames = SpotlightActionsGroupStylesNames;
|
|
35
|
-
}
|
|
36
|
-
namespace ActionsList {
|
|
37
|
-
type Props = SpotlightActionsListProps;
|
|
38
|
-
type StylesNames = SpotlightActionsListStylesNames;
|
|
39
|
-
}
|
|
40
|
-
namespace Empty {
|
|
41
|
-
type Props = SpotlightEmptyProps;
|
|
42
|
-
type StylesNames = SpotlightEmptyStylesNames;
|
|
43
|
-
}
|
|
44
|
-
namespace Footer {
|
|
45
|
-
type Props = SpotlightFooterProps;
|
|
46
|
-
type StylesNames = SpotlightFooterStylesNames;
|
|
47
|
-
}
|
|
48
|
-
namespace Search {
|
|
49
|
-
type Props = SpotlightSearchProps;
|
|
50
|
-
type StylesNames = SpotlightSearchStylesNames;
|
|
51
|
-
}
|
|
52
|
-
namespace Root {
|
|
53
|
-
type Props = SpotlightRootProps;
|
|
54
|
-
type StylesNames = SpotlightRootStylesNames;
|
|
55
|
-
}
|
|
56
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/spotlight",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "Command center components for react and Mantine",
|
|
5
5
|
"homepage": "https://mantine.dev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"directory": "packages/@mantine/spotlight"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@mantine/core": "9.0.
|
|
45
|
-
"@mantine/hooks": "9.0.
|
|
44
|
+
"@mantine/core": "9.0.1",
|
|
45
|
+
"@mantine/hooks": "9.0.1",
|
|
46
46
|
"react": "^19.2.0",
|
|
47
47
|
"react-dom": "^19.2.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mantine/store": "9.0.
|
|
50
|
+
"@mantine/store": "9.0.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@mantine-tests/core": "workspace:*",
|