UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

71 lines (70 loc) 2.3 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var Anchor_exports = {}; __export(Anchor_exports, { Anchor: () => Anchor, anchorStyles: () => anchorStyles }); module.exports = __toCommonJS(Anchor_exports); var import_jsx_runtime = require("react/jsx-runtime"); var import_styled = require("@crossed/styled"); var import_Text = require("./Text"); var import_react = require("react"); const anchorStyles = (0, import_styled.createStyles)(({ colors }) => ({ text: { web: { base: { cursor: "pointer" } } }, underline: { ":hover": { textDecorationLine: "underline" }, ":active": { textDecorationLine: "underline" }, ":focus": { textDecorationLine: "underline" } }, primary: { base: { color: colors.text.brand, textDecorationColor: colors.text.brand } }, default: { base: { color: colors.text.primary, textDecorationColor: colors.text.primary } } })); const Anchor = (0, import_react.forwardRef)( ({ primary = true, style, ...props }, ref) => { return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_Text.Text, { role: "link", weight: "lg", ...props, style: (0, import_styled.composeStyles)( anchorStyles.text, anchorStyles.underline, primary ? anchorStyles.primary : anchorStyles.default, style ), ref } ); } ); Anchor.displayName = "Anchor"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Anchor, anchorStyles }); //# sourceMappingURL=Anchor.js.map