UNPKG

@spark-ui/components

Version:

Spark (Leboncoin design system) components.

66 lines (64 loc) 1.75 kB
import { Slot } from "./chunk-4F5DOL57.mjs"; // src/text-link/TextLink.tsx import { cva } from "class-variance-authority"; import { jsx } from "react/jsx-runtime"; var textLinkStyles = cva(["inline-flex items-center focus-visible:u-outline"], { variants: { intent: { current: "text-current hover:opacity-dim-1", main: "text-main hover:text-main-hovered", support: "text-support hover:text-support-hovered", accent: "text-accent hover:text-accent-hovered", basic: "text-basic hover:text-basic-hovered", success: "text-success hover:text-success-hovered", alert: "text-alert hover:text-alert-hovered", danger: "text-error hover:text-error-hovered", info: "text-info hover:text-info-hovered", neutral: "text-neutral hover:text-neutral-hovered" }, /** By default, TextLink inherits the current font weight. Use `bold` to highlight it. */ bold: { true: "font-bold" }, /** * Underline is enabled by default. * You can remove it, but be careful about a11y, as you should make obvious to users what is a link or not. */ underline: { true: "underline", false: "hover:underline focus:underline" } }, defaultVariants: { intent: "current", bold: false, underline: true } }); var TextLink = ({ asChild = false, bold = false, children, className, intent = "current", underline = true, ref, ...props }) => { const Component = asChild ? Slot : "a"; return /* @__PURE__ */ jsx( Component, { ref, className: textLinkStyles({ className, bold, intent, underline }), ...props, children } ); }; export { TextLink }; //# sourceMappingURL=chunk-STJ7NDWM.mjs.map