@mantine/spotlight 9.0.0-alpha.4 → 9.0.0-alpha.6
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 +85 -75
- package/cjs/Spotlight.cjs.map +1 -1
- package/cjs/Spotlight.context.cjs +6 -10
- package/cjs/Spotlight.context.cjs.map +1 -1
- package/cjs/Spotlight.module.cjs +21 -0
- package/cjs/Spotlight.module.cjs.map +1 -0
- package/cjs/SpotlightAction.cjs +75 -92
- package/cjs/SpotlightAction.cjs.map +1 -1
- package/cjs/SpotlightActionsGroup.cjs +23 -29
- package/cjs/SpotlightActionsGroup.cjs.map +1 -1
- package/cjs/SpotlightActionsList.cjs +35 -38
- package/cjs/SpotlightActionsList.cjs.map +1 -1
- package/cjs/SpotlightEmpty.cjs +21 -19
- package/cjs/SpotlightEmpty.cjs.map +1 -1
- package/cjs/SpotlightFooter.cjs +21 -19
- package/cjs/SpotlightFooter.cjs.map +1 -1
- package/cjs/SpotlightRoot.cjs +92 -120
- package/cjs/SpotlightRoot.cjs.map +1 -1
- package/cjs/SpotlightSearch.cjs +48 -60
- package/cjs/SpotlightSearch.cjs.map +1 -1
- package/cjs/default-spotlight-filter.cjs +41 -46
- package/cjs/default-spotlight-filter.cjs.map +1 -1
- package/cjs/get-hotkeys.cjs +10 -15
- package/cjs/get-hotkeys.cjs.map +1 -1
- package/cjs/index.cjs +27 -32
- package/cjs/is-actions-group.cjs +7 -7
- package/cjs/is-actions-group.cjs.map +1 -1
- package/cjs/limit-actions.cjs +23 -28
- package/cjs/limit-actions.cjs.map +1 -1
- package/cjs/spotlight.store.cjs +98 -117
- package/cjs/spotlight.store.cjs.map +1 -1
- package/esm/Spotlight.context.mjs +7 -8
- package/esm/Spotlight.context.mjs.map +1 -1
- package/esm/Spotlight.mjs +74 -62
- package/esm/Spotlight.mjs.map +1 -1
- package/esm/Spotlight.module.mjs +21 -0
- package/esm/Spotlight.module.mjs.map +1 -0
- package/esm/SpotlightAction.mjs +74 -89
- package/esm/SpotlightAction.mjs.map +1 -1
- package/esm/SpotlightActionsGroup.mjs +22 -26
- package/esm/SpotlightActionsGroup.mjs.map +1 -1
- package/esm/SpotlightActionsList.mjs +34 -35
- package/esm/SpotlightActionsList.mjs.map +1 -1
- package/esm/SpotlightEmpty.mjs +20 -16
- package/esm/SpotlightEmpty.mjs.map +1 -1
- package/esm/SpotlightFooter.mjs +20 -16
- package/esm/SpotlightFooter.mjs.map +1 -1
- package/esm/SpotlightRoot.mjs +91 -117
- package/esm/SpotlightRoot.mjs.map +1 -1
- package/esm/SpotlightSearch.mjs +47 -57
- package/esm/SpotlightSearch.mjs.map +1 -1
- package/esm/default-spotlight-filter.mjs +41 -44
- package/esm/default-spotlight-filter.mjs.map +1 -1
- package/esm/get-hotkeys.mjs +10 -13
- package/esm/get-hotkeys.mjs.map +1 -1
- package/esm/index.mjs +11 -11
- package/esm/is-actions-group.mjs +7 -5
- package/esm/is-actions-group.mjs.map +1 -1
- package/esm/limit-actions.mjs +23 -26
- package/esm/limit-actions.mjs.map +1 -1
- package/esm/spotlight.store.mjs +96 -100
- package/esm/spotlight.store.mjs.map +1 -1
- package/package.json +8 -8
- package/cjs/Spotlight.module.css.cjs +0 -7
- package/cjs/Spotlight.module.css.cjs.map +0 -1
- package/cjs/index.cjs.map +0 -1
- package/esm/Spotlight.module.css.mjs +0 -5
- package/esm/Spotlight.module.css.mjs.map +0 -1
- package/esm/index.mjs.map +0 -1
package/cjs/Spotlight.cjs
CHANGED
|
@@ -1,80 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var SpotlightSearch = require('./SpotlightSearch.cjs');
|
|
19
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
const require_spotlight_store = require("./spotlight.store.cjs");
|
|
3
|
+
const require_is_actions_group = require("./is-actions-group.cjs");
|
|
4
|
+
const require_default_spotlight_filter = require("./default-spotlight-filter.cjs");
|
|
5
|
+
const require_limit_actions = require("./limit-actions.cjs");
|
|
6
|
+
const require_Spotlight_module = require("./Spotlight.module.cjs");
|
|
7
|
+
const require_SpotlightAction = require("./SpotlightAction.cjs");
|
|
8
|
+
const require_SpotlightActionsGroup = require("./SpotlightActionsGroup.cjs");
|
|
9
|
+
const require_SpotlightActionsList = require("./SpotlightActionsList.cjs");
|
|
10
|
+
const require_SpotlightEmpty = require("./SpotlightEmpty.cjs");
|
|
11
|
+
const require_SpotlightFooter = require("./SpotlightFooter.cjs");
|
|
12
|
+
const require_SpotlightRoot = require("./SpotlightRoot.cjs");
|
|
13
|
+
const require_SpotlightSearch = require("./SpotlightSearch.cjs");
|
|
14
|
+
let _mantine_hooks = require("@mantine/hooks");
|
|
15
|
+
let _mantine_core = require("@mantine/core");
|
|
16
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
17
|
+
//#region packages/@mantine/spotlight/src/Spotlight.tsx
|
|
20
18
|
const defaultProps = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
size: 600,
|
|
20
|
+
yOffset: 80,
|
|
21
|
+
limit: Infinity,
|
|
22
|
+
zIndex: (0, _mantine_core.getDefaultZIndex)("max"),
|
|
23
|
+
overlayProps: {
|
|
24
|
+
backgroundOpacity: .35,
|
|
25
|
+
blur: 7
|
|
26
|
+
},
|
|
27
|
+
transitionProps: {
|
|
28
|
+
duration: 200,
|
|
29
|
+
transition: "pop"
|
|
30
|
+
},
|
|
31
|
+
store: require_spotlight_store.spotlightStore,
|
|
32
|
+
filter: require_default_spotlight_filter.defaultSpotlightFilter,
|
|
33
|
+
clearQueryOnClose: true,
|
|
34
|
+
closeOnActionTrigger: true,
|
|
35
|
+
shortcut: "mod + K"
|
|
32
36
|
};
|
|
33
|
-
const Spotlight =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
37
|
+
const Spotlight = (0, _mantine_core.factory)((_props) => {
|
|
38
|
+
const { searchProps, filter, query, onQueryChange, actions, nothingFound, highlightQuery, limit, scrollAreaProps, ...others } = (0, _mantine_core.useProps)("Spotlight", defaultProps, _props);
|
|
39
|
+
const [_query, setQuery] = (0, _mantine_hooks.useUncontrolled)({
|
|
40
|
+
value: query,
|
|
41
|
+
defaultValue: "",
|
|
42
|
+
finalValue: "",
|
|
43
|
+
onChange: onQueryChange
|
|
44
|
+
});
|
|
45
|
+
const filteredActions = require_limit_actions.limitActions(filter(_query, actions), limit).map((item) => {
|
|
46
|
+
if (require_is_actions_group.isActionsGroup(item)) {
|
|
47
|
+
const items = item.actions.map(({ id, ...actionData }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpotlightAction.SpotlightAction, {
|
|
48
|
+
highlightQuery,
|
|
49
|
+
...actionData
|
|
50
|
+
}, id));
|
|
51
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpotlightActionsGroup.SpotlightActionsGroup, {
|
|
52
|
+
label: item.group,
|
|
53
|
+
children: items
|
|
54
|
+
}, item.group);
|
|
55
|
+
}
|
|
56
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpotlightAction.SpotlightAction, {
|
|
57
|
+
highlightQuery,
|
|
58
|
+
...item
|
|
59
|
+
}, item.id);
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_SpotlightRoot.SpotlightRoot, {
|
|
62
|
+
...others,
|
|
63
|
+
query: _query,
|
|
64
|
+
onQueryChange: setQuery,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpotlightSearch.SpotlightSearch, { ...searchProps }),
|
|
67
|
+
filteredActions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpotlightActionsList.SpotlightActionsList, {
|
|
68
|
+
...scrollAreaProps,
|
|
69
|
+
children: filteredActions
|
|
70
|
+
}),
|
|
71
|
+
filteredActions.length === 0 && nothingFound && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_SpotlightEmpty.SpotlightEmpty, { children: nothingFound })
|
|
72
|
+
]
|
|
73
|
+
});
|
|
65
74
|
});
|
|
66
|
-
Spotlight.classes =
|
|
75
|
+
Spotlight.classes = require_Spotlight_module.default;
|
|
67
76
|
Spotlight.displayName = "@mantine/spotlight/Spotlight";
|
|
68
|
-
Spotlight.Search =
|
|
69
|
-
Spotlight.ActionsList =
|
|
70
|
-
Spotlight.Action =
|
|
71
|
-
Spotlight.Empty =
|
|
72
|
-
Spotlight.ActionsGroup =
|
|
73
|
-
Spotlight.Footer =
|
|
74
|
-
Spotlight.Root =
|
|
75
|
-
Spotlight.open =
|
|
76
|
-
Spotlight.close =
|
|
77
|
-
Spotlight.toggle =
|
|
78
|
-
|
|
77
|
+
Spotlight.Search = require_SpotlightSearch.SpotlightSearch;
|
|
78
|
+
Spotlight.ActionsList = require_SpotlightActionsList.SpotlightActionsList;
|
|
79
|
+
Spotlight.Action = require_SpotlightAction.SpotlightAction;
|
|
80
|
+
Spotlight.Empty = require_SpotlightEmpty.SpotlightEmpty;
|
|
81
|
+
Spotlight.ActionsGroup = require_SpotlightActionsGroup.SpotlightActionsGroup;
|
|
82
|
+
Spotlight.Footer = require_SpotlightFooter.SpotlightFooter;
|
|
83
|
+
Spotlight.Root = require_SpotlightRoot.SpotlightRoot;
|
|
84
|
+
Spotlight.open = require_spotlight_store.spotlight.open;
|
|
85
|
+
Spotlight.close = require_spotlight_store.spotlight.close;
|
|
86
|
+
Spotlight.toggle = require_spotlight_store.spotlight.toggle;
|
|
87
|
+
//#endregion
|
|
79
88
|
exports.Spotlight = Spotlight;
|
|
80
|
-
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=Spotlight.cjs.map
|
package/cjs/Spotlight.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spotlight.cjs","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 classes from './Spotlight.module.css';\nimport { spotlight, spotlightStore } from './spotlight.store';\nimport { SpotlightAction, SpotlightActionProps } from './SpotlightAction';\nimport { SpotlightActionsGroup } from './SpotlightActionsGroup';\nimport { SpotlightActionsList } from './SpotlightActionsList';\nimport { SpotlightEmpty } from './SpotlightEmpty';\nimport { SpotlightFooter } from './SpotlightFooter';\nimport { SpotlightRoot, SpotlightRootProps, SpotlightRootStylesNames } from './SpotlightRoot';\nimport { SpotlightSearch, SpotlightSearchProps } from './SpotlightSearch';\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"],"names":["getDefaultZIndex","spotlightStore","defaultSpotlightFilter","factory","useProps","useUncontrolled","limitActions","isActionsGroup","SpotlightAction","SpotlightActionsGroup","SpotlightRoot","jsx","SpotlightSearch","SpotlightActionsList","SpotlightEmpty","classes","SpotlightFooter","spotlight"],"mappings":";;;;;;;;;;;;;;;;;;;AAiFA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,YAAA,CAAA,CAAA,CAAe,CAAA;AAAA,CAAA,CACnB,CAAA,CAAA,CAAA,CAAA,EAAM,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACN,CAAA,CAAA,CA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,IAASA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
|
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 { SpotlightAction, SpotlightActionProps } from './SpotlightAction';\nimport { SpotlightActionsGroup } from './SpotlightActionsGroup';\nimport { SpotlightActionsList } from './SpotlightActionsList';\nimport { SpotlightEmpty } from './SpotlightEmpty';\nimport { SpotlightFooter } from './SpotlightFooter';\nimport { SpotlightRoot, SpotlightRootProps, SpotlightRootStylesNames } from './SpotlightRoot';\nimport { SpotlightSearch, SpotlightSearchProps } 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"],"mappings":";;;;;;;;;;;;;;;;;AAiFA,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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AAC3B,UAAU,QAAQA,wBAAAA,UAAU;AAC5B,UAAU,SAASA,wBAAAA,UAAU"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const [SpotlightProvider, useSpotlightContext] = core.createSafeContext(
|
|
7
|
-
"Spotlight component was not found in tree"
|
|
8
|
-
);
|
|
9
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@mantine/spotlight/src/Spotlight.context.ts
|
|
3
|
+
const [SpotlightProvider, useSpotlightContext] = (0, require("@mantine/core").createSafeContext)("Spotlight component was not found in tree");
|
|
4
|
+
//#endregion
|
|
10
5
|
exports.SpotlightProvider = SpotlightProvider;
|
|
11
6
|
exports.useSpotlightContext = useSpotlightContext;
|
|
12
|
-
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=Spotlight.context.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spotlight.context.cjs","sources":["../src/Spotlight.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '@mantine/core';\nimport { SpotlightStore } from './spotlight.store';\nimport type { SpotlightRootFactory } from './SpotlightRoot';\n\ninterface SpotlightContextValue {\n query: string;\n setQuery: (query: string) => void;\n getStyles: GetStylesApi<SpotlightRootFactory>;\n store: SpotlightStore;\n closeOnActionTrigger: boolean | undefined;\n}\n\nexport const [SpotlightProvider, useSpotlightContext] = createSafeContext<SpotlightContextValue>(\n 'Spotlight component was not found in tree'\n);\n"],"
|
|
1
|
+
{"version":3,"file":"Spotlight.context.cjs","names":[],"sources":["../src/Spotlight.context.ts"],"sourcesContent":["import { createSafeContext, GetStylesApi } from '@mantine/core';\nimport { SpotlightStore } from './spotlight.store';\nimport type { SpotlightRootFactory } from './SpotlightRoot';\n\ninterface SpotlightContextValue {\n query: string;\n setQuery: (query: string) => void;\n getStyles: GetStylesApi<SpotlightRootFactory>;\n store: SpotlightStore;\n closeOnActionTrigger: boolean | undefined;\n}\n\nexport const [SpotlightProvider, useSpotlightContext] = createSafeContext<SpotlightContextValue>(\n 'Spotlight component was not found in tree'\n);\n"],"mappings":";;AAYA,MAAa,CAAC,mBAAmB,wBAAA,4BAAA,mBAC/B,4CACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@mantine/spotlight/src/Spotlight.module.css
|
|
3
|
+
var Spotlight_module_default = {
|
|
4
|
+
"root": "m_d2b315db",
|
|
5
|
+
"content": "m_3cd250e0",
|
|
6
|
+
"body": "m_d2abce9b",
|
|
7
|
+
"search": "m_f366a061",
|
|
8
|
+
"actionsList": "m_6e463822",
|
|
9
|
+
"action": "m_d49bb8ef",
|
|
10
|
+
"actionBody": "m_3d475731",
|
|
11
|
+
"actionSection": "m_832642f6",
|
|
12
|
+
"actionLabel": "m_6c2a1345",
|
|
13
|
+
"actionDescription": "m_a6d9d78d",
|
|
14
|
+
"empty": "m_82f78f74",
|
|
15
|
+
"footer": "m_ddcaf054",
|
|
16
|
+
"actionsGroup": "m_5a3e5f7b"
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.default = Spotlight_module_default;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Spotlight.module.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spotlight.module.cjs","names":[],"sources":["../src/Spotlight.module.css"],"sourcesContent":[".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 /* Used in child ScrollArea */\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: left;\n\n @mixin where-rtl {\n text-align: right;\n }\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"],"mappings":""}
|
package/cjs/SpotlightAction.cjs
CHANGED
|
@@ -1,97 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var spotlight_store = require('./spotlight.store.cjs');
|
|
9
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
const require_spotlight_store = require("./spotlight.store.cjs");
|
|
3
|
+
const require_Spotlight_context = require("./Spotlight.context.cjs");
|
|
4
|
+
const require_Spotlight_module = require("./Spotlight.module.cjs");
|
|
5
|
+
let _mantine_core = require("@mantine/core");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
//#region packages/@mantine/spotlight/src/SpotlightAction.tsx
|
|
10
8
|
const defaultProps = {
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
dimmedSections: true,
|
|
10
|
+
highlightQuery: false
|
|
13
11
|
};
|
|
14
|
-
const SpotlightAction =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { ...ctx.getStyles("actionBody", stylesApi), children: [
|
|
77
|
-
labelNode,
|
|
78
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { ...ctx.getStyles("actionDescription", stylesApi), children: description })
|
|
79
|
-
] }),
|
|
80
|
-
rightSection && /* @__PURE__ */ jsxRuntime.jsx(
|
|
81
|
-
core.Box,
|
|
82
|
-
{
|
|
83
|
-
component: "span",
|
|
84
|
-
mod: { position: "right", dimmed: dimmedSections },
|
|
85
|
-
...ctx.getStyles("actionSection", stylesApi),
|
|
86
|
-
children: rightSection
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
] })
|
|
90
|
-
}
|
|
91
|
-
);
|
|
12
|
+
const SpotlightAction = (0, _mantine_core.factory)((_props) => {
|
|
13
|
+
const { className, style, classNames, styles, id, description, label, leftSection, rightSection, children, dimmedSections, highlightQuery, highlightColor, closeSpotlightOnTrigger, onClick, onMouseDown, keywords, vars, ...others } = (0, _mantine_core.useProps)("SpotlightAction", defaultProps, _props);
|
|
14
|
+
const ctx = require_Spotlight_context.useSpotlightContext();
|
|
15
|
+
const stylesApi = {
|
|
16
|
+
classNames,
|
|
17
|
+
styles
|
|
18
|
+
};
|
|
19
|
+
const labelNode = highlightQuery && typeof label === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Highlight, {
|
|
20
|
+
component: "span",
|
|
21
|
+
highlight: ctx.query,
|
|
22
|
+
color: highlightColor,
|
|
23
|
+
...ctx.getStyles("actionLabel", stylesApi),
|
|
24
|
+
children: label
|
|
25
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
26
|
+
...ctx.getStyles("actionLabel", stylesApi),
|
|
27
|
+
children: label
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.UnstyledButton, {
|
|
30
|
+
"data-action": true,
|
|
31
|
+
...ctx.getStyles("action", {
|
|
32
|
+
className,
|
|
33
|
+
style,
|
|
34
|
+
...stylesApi
|
|
35
|
+
}),
|
|
36
|
+
...others,
|
|
37
|
+
onMouseDown: (event) => {
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
onMouseDown?.(event);
|
|
40
|
+
},
|
|
41
|
+
onClick: (event) => {
|
|
42
|
+
onClick?.(event);
|
|
43
|
+
if (closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) require_spotlight_store.spotlightActions.close(ctx.store);
|
|
44
|
+
},
|
|
45
|
+
tabIndex: -1,
|
|
46
|
+
children: children || /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
47
|
+
leftSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
|
|
48
|
+
component: "span",
|
|
49
|
+
mod: {
|
|
50
|
+
position: "left",
|
|
51
|
+
dimmed: dimmedSections
|
|
52
|
+
},
|
|
53
|
+
...ctx.getStyles("actionSection", stylesApi),
|
|
54
|
+
children: leftSection
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
57
|
+
...ctx.getStyles("actionBody", stylesApi),
|
|
58
|
+
children: [labelNode, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
59
|
+
...ctx.getStyles("actionDescription", stylesApi),
|
|
60
|
+
children: description
|
|
61
|
+
})]
|
|
62
|
+
}),
|
|
63
|
+
rightSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
|
|
64
|
+
component: "span",
|
|
65
|
+
mod: {
|
|
66
|
+
position: "right",
|
|
67
|
+
dimmed: dimmedSections
|
|
68
|
+
},
|
|
69
|
+
...ctx.getStyles("actionSection", stylesApi),
|
|
70
|
+
children: rightSection
|
|
71
|
+
})
|
|
72
|
+
] })
|
|
73
|
+
});
|
|
92
74
|
});
|
|
93
|
-
SpotlightAction.classes =
|
|
75
|
+
SpotlightAction.classes = require_Spotlight_module.default;
|
|
94
76
|
SpotlightAction.displayName = "@mantine/spotlight/SpotlightAction";
|
|
95
|
-
|
|
77
|
+
//#endregion
|
|
96
78
|
exports.SpotlightAction = SpotlightAction;
|
|
97
|
-
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=SpotlightAction.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightAction.cjs","sources":["../src/SpotlightAction.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n Highlight,\n MantineColor,\n UnstyledButton,\n useProps,\n} from '@mantine/core';\nimport { useSpotlightContext } from './Spotlight.context';\nimport classes from './Spotlight.module.css';\nimport { spotlightActions } from './spotlight.store';\n\nexport type SpotlightActionStylesNames =\n | 'action'\n | 'actionLabel'\n | 'actionDescription'\n | 'actionSection'\n | 'actionBody';\n\nexport interface SpotlightActionProps\n extends BoxProps, CompoundStylesApiProps<SpotlightActionFactory>, ElementProps<'button'> {\n /** Action label, pass string to use in default filter */\n label?: string;\n\n /** Action description, pass string to use in default filter */\n description?: string;\n\n /** Section displayed on the left side of the label, for example, icon */\n leftSection?: React.ReactNode;\n\n /** Section displayed on the right side of the label, for example, hotkey */\n rightSection?: React.ReactNode;\n\n /** Children override default action elements, if passed, label, description and sections are hidden */\n children?: React.ReactNode;\n\n /** Determines whether left and right sections should have dimmed styles @default true */\n dimmedSections?: boolean;\n\n /** Determines whether search query should be highlighted in action label @default false */\n highlightQuery?: boolean;\n\n /** Key of `theme.colors` of any valid CSS color that will be used to highlight search query @default 'yellow' */\n highlightColor?: MantineColor;\n\n /** Determines whether the spotlight should be closed when action is triggered, overrides `closeOnActionTrigger` prop set on `Spotlight` */\n closeSpotlightOnTrigger?: boolean;\n\n /** Keywords that are used for default filtering, not displayed anywhere, can be a string: \"react,router,javascript\" or an array: ['react', 'router', 'javascript'] */\n keywords?: string | string[];\n}\n\nexport type SpotlightActionFactory = Factory<{\n props: SpotlightActionProps;\n ref: HTMLButtonElement;\n stylesNames: SpotlightActionStylesNames;\n compound: true;\n}>;\n\nconst defaultProps = {\n dimmedSections: true,\n highlightQuery: false,\n} satisfies Partial<SpotlightActionProps>;\n\nexport const SpotlightAction = factory<SpotlightActionFactory>((_props) => {\n const props = useProps('SpotlightAction', defaultProps, _props);\n const {\n className,\n style,\n classNames,\n styles,\n id,\n description,\n label,\n leftSection,\n rightSection,\n children,\n dimmedSections,\n highlightQuery,\n highlightColor,\n closeSpotlightOnTrigger,\n onClick,\n onMouseDown,\n keywords,\n vars,\n ...others\n } = props;\n\n const ctx = useSpotlightContext();\n\n const stylesApi = { classNames, styles };\n\n const labelNode =\n highlightQuery && typeof label === 'string' ? (\n <Highlight\n component=\"span\"\n highlight={ctx.query}\n color={highlightColor}\n {...ctx.getStyles('actionLabel', stylesApi)}\n >\n {label}\n </Highlight>\n ) : (\n <span {...ctx.getStyles('actionLabel', stylesApi)}>{label}</span>\n );\n\n return (\n <UnstyledButton\n data-action\n {...ctx.getStyles('action', { className, style, ...stylesApi })}\n {...others}\n onMouseDown={(event) => {\n event.preventDefault();\n onMouseDown?.(event);\n }}\n onClick={(event) => {\n onClick?.(event);\n if (closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) {\n spotlightActions.close(ctx.store);\n }\n }}\n tabIndex={-1}\n >\n {children || (\n <>\n {leftSection && (\n <Box\n component=\"span\"\n mod={{ position: 'left', dimmed: dimmedSections }}\n {...ctx.getStyles('actionSection', stylesApi)}\n >\n {leftSection}\n </Box>\n )}\n\n <span {...ctx.getStyles('actionBody', stylesApi)}>\n {labelNode}\n <span {...ctx.getStyles('actionDescription', stylesApi)}>{description}</span>\n </span>\n\n {rightSection && (\n <Box\n component=\"span\"\n mod={{ position: 'right', dimmed: dimmedSections }}\n {...ctx.getStyles('actionSection', stylesApi)}\n >\n {rightSection}\n </Box>\n )}\n </>\n )}\n </UnstyledButton>\n );\n});\n\nSpotlightAction.classes = classes;\nSpotlightAction.displayName = '@mantine/spotlight/SpotlightAction';\n"],"names":["factory","useProps","useSpotlightContext","jsx","Highlight","UnstyledButton","spotlightActions","jsxs","Fragment","Box","classes"],"mappings":";;;;;;;;;AA+DA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,YAAA,CAAA,CAAA,CAAe,CAAA;AAAA,CAAA,CACnB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CAChB,cAAA,CAAA,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA;AAClB,CAAA,CAAA;AAEO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,eAAA,CAAA,CAAA,CAAkBA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAgC,CAAC,MAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA;AACzE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAS,iBAAA,CAAA,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"SpotlightAction.cjs","names":["useSpotlightContext","Highlight","UnstyledButton","Box","classes"],"sources":["../src/SpotlightAction.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n Highlight,\n MantineColor,\n UnstyledButton,\n useProps,\n} from '@mantine/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 extends BoxProps, CompoundStylesApiProps<SpotlightActionFactory>, ElementProps<'button'> {\n /** Action label, pass string to use in default filter */\n label?: string;\n\n /** Action description, pass string to use in default filter */\n description?: string;\n\n /** Section displayed on the left side of the label, for example, icon */\n leftSection?: React.ReactNode;\n\n /** Section displayed on the right side of the label, for example, hotkey */\n rightSection?: React.ReactNode;\n\n /** Children override default action elements, if passed, label, description and sections are hidden */\n children?: React.ReactNode;\n\n /** Determines whether left and right sections should have dimmed styles @default true */\n dimmedSections?: boolean;\n\n /** Determines whether search query should be highlighted in action label @default false */\n highlightQuery?: boolean;\n\n /** Key of `theme.colors` of any valid CSS color that will be used to highlight search query @default 'yellow' */\n highlightColor?: MantineColor;\n\n /** Determines whether the spotlight should be closed when action is triggered, overrides `closeOnActionTrigger` prop set on `Spotlight` */\n closeSpotlightOnTrigger?: boolean;\n\n /** Keywords that are used for default filtering, not displayed anywhere, can be a string: \"react,router,javascript\" or an array: ['react', 'router', 'javascript'] */\n keywords?: string | string[];\n}\n\nexport type SpotlightActionFactory = Factory<{\n props: SpotlightActionProps;\n ref: HTMLButtonElement;\n stylesNames: SpotlightActionStylesNames;\n compound: true;\n}>;\n\nconst defaultProps = {\n dimmedSections: true,\n highlightQuery: false,\n} satisfies Partial<SpotlightActionProps>;\n\nexport const SpotlightAction = factory<SpotlightActionFactory>((_props) => {\n const props = useProps('SpotlightAction', defaultProps, _props);\n const {\n className,\n style,\n classNames,\n styles,\n id,\n description,\n label,\n leftSection,\n rightSection,\n children,\n dimmedSections,\n highlightQuery,\n highlightColor,\n closeSpotlightOnTrigger,\n onClick,\n onMouseDown,\n keywords,\n vars,\n ...others\n } = props;\n\n const ctx = useSpotlightContext();\n\n const stylesApi = { classNames, styles };\n\n const labelNode =\n highlightQuery && typeof label === 'string' ? (\n <Highlight\n component=\"span\"\n highlight={ctx.query}\n color={highlightColor}\n {...ctx.getStyles('actionLabel', stylesApi)}\n >\n {label}\n </Highlight>\n ) : (\n <span {...ctx.getStyles('actionLabel', stylesApi)}>{label}</span>\n );\n\n return (\n <UnstyledButton\n data-action\n {...ctx.getStyles('action', { className, style, ...stylesApi })}\n {...others}\n onMouseDown={(event) => {\n event.preventDefault();\n onMouseDown?.(event);\n }}\n onClick={(event) => {\n onClick?.(event);\n if (closeSpotlightOnTrigger ?? ctx.closeOnActionTrigger) {\n spotlightActions.close(ctx.store);\n }\n }}\n tabIndex={-1}\n >\n {children || (\n <>\n {leftSection && (\n <Box\n component=\"span\"\n mod={{ position: 'left', dimmed: dimmedSections }}\n {...ctx.getStyles('actionSection', stylesApi)}\n >\n {leftSection}\n </Box>\n )}\n\n <span {...ctx.getStyles('actionBody', stylesApi)}>\n {labelNode}\n <span {...ctx.getStyles('actionDescription', stylesApi)}>{description}</span>\n </span>\n\n {rightSection && (\n <Box\n component=\"span\"\n mod={{ position: 'right', dimmed: dimmedSections }}\n {...ctx.getStyles('actionSection', stylesApi)}\n >\n {rightSection}\n </Box>\n )}\n </>\n )}\n </UnstyledButton>\n );\n});\n\nSpotlightAction.classes = classes;\nSpotlightAction.displayName = '@mantine/spotlight/SpotlightAction';\n"],"mappings":";;;;;;;AA+DA,MAAM,eAAe;CACnB,gBAAgB;CAChB,gBAAgB;CACjB;AAED,MAAa,mBAAA,GAAA,cAAA,UAAmD,WAAW;CAEzE,MAAM,EACJ,WACA,OACA,YACA,QACA,IACA,aACA,OACA,aACA,cACA,UACA,gBACA,gBACA,gBACA,yBACA,SACA,aACA,UACA,MACA,GAAG,YAAA,GAAA,cAAA,UApBkB,mBAAmB,cAAc,OAAO;CAuB/D,MAAM,MAAMA,0BAAAA,qBAAqB;CAEjC,MAAM,YAAY;EAAE;EAAY;EAAQ;CAExC,MAAM,YACJ,kBAAkB,OAAO,UAAU,WACjC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,WAAD;EACE,WAAU;EACV,WAAW,IAAI;EACf,OAAO;EACP,GAAI,IAAI,UAAU,eAAe,UAAU;YAE1C;EACS,CAAA,GAEZ,iBAAA,GAAA,kBAAA,KAAC,QAAD;EAAM,GAAI,IAAI,UAAU,eAAe,UAAU;YAAG;EAAa,CAAA;AAGrE,QACE,iBAAA,GAAA,kBAAA,KAACC,cAAAA,gBAAD;EACE,eAAA;EACA,GAAI,IAAI,UAAU,UAAU;GAAE;GAAW;GAAO,GAAG;GAAW,CAAC;EAC/D,GAAI;EACJ,cAAc,UAAU;AACtB,SAAM,gBAAgB;AACtB,iBAAc,MAAM;;EAEtB,UAAU,UAAU;AAClB,aAAU,MAAM;AAChB,OAAI,2BAA2B,IAAI,qBACjC,yBAAA,iBAAiB,MAAM,IAAI,MAAM;;EAGrC,UAAU;YAET,YACC,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA;GACG,eACC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,KAAD;IACE,WAAU;IACV,KAAK;KAAE,UAAU;KAAQ,QAAQ;KAAgB;IACjD,GAAI,IAAI,UAAU,iBAAiB,UAAU;cAE5C;IACG,CAAA;GAGR,iBAAA,GAAA,kBAAA,MAAC,QAAD;IAAM,GAAI,IAAI,UAAU,cAAc,UAAU;cAAhD,CACG,WACD,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,GAAI,IAAI,UAAU,qBAAqB,UAAU;eAAG;KAAmB,CAAA,CACxE;;GAEN,gBACC,iBAAA,GAAA,kBAAA,KAACA,cAAAA,KAAD;IACE,WAAU;IACV,KAAK;KAAE,UAAU;KAAS,QAAQ;KAAgB;IAClD,GAAI,IAAI,UAAU,iBAAiB,UAAU;cAE5C;IACG,CAAA;GAEP,EAAA,CAAA;EAEU,CAAA;EAEnB;AAEF,gBAAgB,UAAUC,yBAAAA;AAC1B,gBAAgB,cAAc"}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
...others,
|
|
21
|
-
__vars: {
|
|
22
|
-
"--spotlight-label": `'${label?.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`
|
|
23
|
-
},
|
|
24
|
-
children
|
|
25
|
-
}
|
|
26
|
-
);
|
|
1
|
+
"use client";
|
|
2
|
+
const require_Spotlight_context = require("./Spotlight.context.cjs");
|
|
3
|
+
const require_Spotlight_module = require("./Spotlight.module.cjs");
|
|
4
|
+
let _mantine_core = require("@mantine/core");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
//#region packages/@mantine/spotlight/src/SpotlightActionsGroup.tsx
|
|
7
|
+
const SpotlightActionsGroup = (0, _mantine_core.factory)((props) => {
|
|
8
|
+
const { className, style, styles, classNames, label, children, ...others } = (0, _mantine_core.useProps)("SpotlightActionsGroup", null, props);
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
|
|
10
|
+
...require_Spotlight_context.useSpotlightContext().getStyles("actionsGroup", {
|
|
11
|
+
className,
|
|
12
|
+
style,
|
|
13
|
+
classNames,
|
|
14
|
+
styles
|
|
15
|
+
}),
|
|
16
|
+
...others,
|
|
17
|
+
__vars: { "--spotlight-label": `'${label?.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'` },
|
|
18
|
+
children
|
|
19
|
+
});
|
|
27
20
|
});
|
|
28
|
-
SpotlightActionsGroup.classes =
|
|
21
|
+
SpotlightActionsGroup.classes = require_Spotlight_module.default;
|
|
29
22
|
SpotlightActionsGroup.displayName = "@mantine/core/SpotlightActionsGroup";
|
|
30
|
-
|
|
23
|
+
//#endregion
|
|
31
24
|
exports.SpotlightActionsGroup = SpotlightActionsGroup;
|
|
32
|
-
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=SpotlightActionsGroup.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightActionsGroup.cjs","sources":["../src/SpotlightActionsGroup.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '@mantine/core';\nimport { useSpotlightContext } from './Spotlight.context';\nimport classes from './Spotlight.module.css';\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup';\n\nexport interface SpotlightActionsGroupProps\n extends BoxProps, CompoundStylesApiProps<SpotlightActionsGroupFactory>, ElementProps<'div'> {\n /** `Spotlight.Action` components */\n children?: React.ReactNode;\n\n /** Group label */\n label?: string;\n}\n\nexport type SpotlightActionsGroupFactory = Factory<{\n props: SpotlightActionsGroupProps;\n ref: HTMLDivElement;\n stylesNames: SpotlightActionsGroupStylesNames;\n compound: true;\n}>;\n\nexport const SpotlightActionsGroup = factory<SpotlightActionsGroupFactory>((props) => {\n const { className, style, styles, classNames, label, children, ...others } = useProps(\n 'SpotlightActionsGroup',\n null,\n props\n );\n\n const ctx = useSpotlightContext();\n\n return (\n <Box\n {...ctx.getStyles('actionsGroup', { className, style, classNames, styles })}\n {...others}\n __vars={{\n '--spotlight-label': `'${label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n }}\n >\n {children}\n </Box>\n );\n});\n\nSpotlightActionsGroup.classes = classes;\nSpotlightActionsGroup.displayName = '@mantine/core/SpotlightActionsGroup';\n"],"
|
|
1
|
+
{"version":3,"file":"SpotlightActionsGroup.cjs","names":["Box","useSpotlightContext","classes"],"sources":["../src/SpotlightActionsGroup.tsx"],"sourcesContent":["import {\n Box,\n BoxProps,\n CompoundStylesApiProps,\n ElementProps,\n factory,\n Factory,\n useProps,\n} from '@mantine/core';\nimport { useSpotlightContext } from './Spotlight.context';\nimport classes from './Spotlight.module.css';\n\nexport type SpotlightActionsGroupStylesNames = 'actionsGroup';\n\nexport interface SpotlightActionsGroupProps\n extends BoxProps, CompoundStylesApiProps<SpotlightActionsGroupFactory>, ElementProps<'div'> {\n /** `Spotlight.Action` components */\n children?: React.ReactNode;\n\n /** Group label */\n label?: string;\n}\n\nexport type SpotlightActionsGroupFactory = Factory<{\n props: SpotlightActionsGroupProps;\n ref: HTMLDivElement;\n stylesNames: SpotlightActionsGroupStylesNames;\n compound: true;\n}>;\n\nexport const SpotlightActionsGroup = factory<SpotlightActionsGroupFactory>((props) => {\n const { className, style, styles, classNames, label, children, ...others } = useProps(\n 'SpotlightActionsGroup',\n null,\n props\n );\n\n const ctx = useSpotlightContext();\n\n return (\n <Box\n {...ctx.getStyles('actionsGroup', { className, style, classNames, styles })}\n {...others}\n __vars={{\n '--spotlight-label': `'${label?.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`,\n }}\n >\n {children}\n </Box>\n );\n});\n\nSpotlightActionsGroup.classes = classes;\nSpotlightActionsGroup.displayName = '@mantine/core/SpotlightActionsGroup';\n"],"mappings":";;;;;;AA8BA,MAAa,yBAAA,GAAA,cAAA,UAA+D,UAAU;CACpF,MAAM,EAAE,WAAW,OAAO,QAAQ,YAAY,OAAO,UAAU,GAAG,YAAA,GAAA,cAAA,UAChE,yBACA,MACA,MACD;AAID,QACE,iBAAA,GAAA,kBAAA,KAACA,cAAAA,KAAD;EACE,GAJQC,0BAAAA,qBAAqB,CAIrB,UAAU,gBAAgB;GAAE;GAAW;GAAO;GAAY;GAAQ,CAAC;EAC3E,GAAI;EACJ,QAAQ,EACN,qBAAqB,IAAI,OAAO,QAAQ,OAAO,OAAO,CAAC,QAAQ,MAAM,MAAM,CAAC,IAC7E;EAEA;EACG,CAAA;EAER;AAEF,sBAAsB,UAAUC,yBAAAA;AAChC,sBAAsB,cAAc"}
|