UNPKG

@stratakit/bricks

Version:

Small, modular components for StrataKit

31 lines (30 loc) 938 B
import { jsx } from "react/jsx-runtime"; import * as React from "react"; import { Role } from "@ariakit/react/role"; import { forwardRef } from "@stratakit/foundations/secret-internals"; import cx from "classnames"; import { useGhostAlignment } from "./~utils.GhostAligner.js"; const IconButtonContext = React.createContext({ iconSize: "regular" }); const IconButtonPresentation = forwardRef((props, forwardedRef) => { const { variant, ...rest } = props; const ghostAlignment = useGhostAlignment(); return /* @__PURE__ */ jsx(Role.span, { ...rest, className: cx("\u{1F95D}IconButton", "\u{1F95D}Button", { "\u{1F95D}GhostAligner": variant === "ghost" }, props.className), "data-_sk-tone": "neutral", "data-_sk-variant": variant, "data-_sk-ghost-align": variant === "ghost" ? ghostAlignment : void 0, ref: forwardedRef }); }); export { IconButtonContext, IconButtonPresentation };