@mantine/spotlight
Version:
Command center components for react and Mantine
38 lines (37 loc) • 1.38 kB
JavaScript
"use client";
import { spotlightActions } from "./spotlight.store.mjs";
import { useSpotlightContext } from "./Spotlight.context.mjs";
import Spotlight_module_default from "./Spotlight.module.mjs";
import { ScrollArea, factory, useProps } from "@mantine/core";
import { jsx } from "react/jsx-runtime";
import { useEffect, useId } from "react";
//#region packages/@mantine/spotlight/src/SpotlightActionsList.tsx
const SpotlightActionsList = factory((props) => {
const { className, style, id, children, vars, classNames, styles, ...others } = useProps("SpotlightActionsList", null, props);
const ctx = useSpotlightContext();
const generatedId = `mantine-${useId().replace(/:/g, "")}`;
const listId = id || generatedId;
useEffect(() => {
spotlightActions.setListId(listId, ctx.store);
return () => spotlightActions.setListId("", ctx.store);
}, []);
return /* @__PURE__ */ jsx(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 = Spotlight_module_default;
SpotlightActionsList.displayName = "@mantine/spotlight/SpotlightActionsList";
//#endregion
export { SpotlightActionsList };
//# sourceMappingURL=SpotlightActionsList.mjs.map