UNPKG

@stratakit/bricks

Version:

Small, modular components for StrataKit

33 lines (32 loc) 1.06 kB
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}-icon-button", "\u{1F95D}-button", { "\u{1F95D}-ghost-aligner": variant === "ghost" }, props.className ), "data-kiwi-tone": "neutral", "data-kiwi-variant": variant, "data-kiwi-ghost-align": variant === "ghost" ? ghostAlignment : void 0, ref: forwardedRef } ); }); DEV: IconButtonPresentation.displayName = "IconButtonPresentation"; export { IconButtonContext, IconButtonPresentation };