UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

37 lines (36 loc) 1.35 kB
"use client"; import { useProps } from "../../../core/MantineProvider/use-props/use-props.mjs"; import { useResolvedStylesApi } from "../../../core/styles-api/use-resolved-styles-api/use-resolved-styles-api.mjs"; import { factory } from "../../../core/factory/factory.mjs"; import { CloseButton } from "../../CloseButton/CloseButton.mjs"; import { InputContext } from "../Input.context.mjs"; import { use } from "react"; import { jsx } from "react/jsx-runtime"; //#region packages/@mantine/core/src/components/Input/InputClearButton/InputClearButton.tsx const InputClearButton = factory((_props) => { const props = useProps("InputClearButton", null, _props); const { size, variant, vars, classNames, styles, ...others } = props; const ctx = use(InputContext); const { resolvedClassNames, resolvedStyles } = useResolvedStylesApi({ classNames, styles, props }); return /* @__PURE__ */ jsx(CloseButton, { variant: variant || "transparent", size: size || ctx?.size || "sm", classNames: resolvedClassNames, styles: resolvedStyles, __staticSelector: "InputClearButton", style: { pointerEvents: "all", background: "var(--input-bg)", ...others.style }, ...others }); }); InputClearButton.displayName = "@mantine/core/InputClearButton"; //#endregion export { InputClearButton }; //# sourceMappingURL=InputClearButton.mjs.map