@mantine/spotlight
Version:
Command center components for react and Mantine
38 lines (37 loc) • 1.58 kB
JavaScript
"use client";
const require_spotlight_store = require("./spotlight.store.cjs");
const require_Spotlight_context = require("./Spotlight.context.cjs");
const require_Spotlight_module = require("./Spotlight.module.cjs");
let _mantine_core = require("@mantine/core");
let react_jsx_runtime = require("react/jsx-runtime");
let react = require("react");
//#region packages/@mantine/spotlight/src/SpotlightActionsList.tsx
const SpotlightActionsList = (0, _mantine_core.factory)((props) => {
const { className, style, id, children, vars, classNames, styles, ...others } = (0, _mantine_core.useProps)("SpotlightActionsList", null, props);
const ctx = require_Spotlight_context.useSpotlightContext();
const generatedId = `mantine-${(0, react.useId)().replace(/:/g, "")}`;
const listId = id || generatedId;
(0, react.useEffect)(() => {
require_spotlight_store.spotlightActions.setListId(listId, ctx.store);
return () => require_spotlight_store.spotlightActions.setListId("", ctx.store);
}, []);
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ScrollArea.Autosize, {
...ctx.getStyles("actionsList", {
className,
style,
classNames,
styles
}),
type: "scroll",
scrollbarSize: "var(--spotlight-actions-list-padding)",
offsetScrollbars: "y",
id: listId,
...others,
children
});
});
SpotlightActionsList.classes = require_Spotlight_module.default;
SpotlightActionsList.displayName = "@mantine/spotlight/SpotlightActionsList";
//#endregion
exports.SpotlightActionsList = SpotlightActionsList;
//# sourceMappingURL=SpotlightActionsList.cjs.map