This commit is contained in:
OfficialDakari 2025-04-03 11:08:30 +05:00
parent f7ce559e31
commit a4d42e67e0
4 changed files with 19 additions and 27 deletions

View File

@ -1 +1 @@
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),g=require("./react-you-ui6.js"),r=require("./string_utils-Bad7L8P5.js"),h=t=>{const e=g.usePalette(),{href:o,target:s,rel:i,children:n,className:l,id:c,style:a,...u}=t;return m.jsx("a",{href:o,target:s,rel:i,className:l,id:c,style:{color:r.hexFromArgb(e.primary),textDecorationColor:r.hexFromArgb(e.primary),textDecoration:"underline",...a},...u,children:n})};exports.Link=h;
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./react-you-ui6.js"),u=require("./string_utils-Bad7L8P5.js"),c=t=>{const r=i.usePalette(),{style:o,color:e=u.hexFromArgb(r.primary),...s}=t;return n.jsx("a",{style:{color:e,textDecorationColor:e,textDecoration:"underline",...o},...s})};exports.Link=c;

View File

@ -1,27 +1,21 @@
import { jsx as p } from "react/jsx-runtime";
import { usePalette as x } from "./react-you-ui6.mjs";
import { h as t } from "./string_utils-B4bsIQ5w.mjs";
const d = (e) => {
const r = x(), { href: o, target: a, rel: i, children: s, className: l, id: m, style: n, ...c } = e;
return /* @__PURE__ */ p(
import { jsx as s } from "react/jsx-runtime";
import { usePalette as i } from "./react-you-ui6.mjs";
import { h as m } from "./string_utils-B4bsIQ5w.mjs";
const p = (o) => {
const r = i(), { style: e, color: t = m(r.primary), ...n } = o;
return /* @__PURE__ */ s(
"a",
{
href: o,
target: a,
rel: i,
className: l,
id: m,
style: {
color: t(r.primary),
textDecorationColor: t(r.primary),
color: t,
textDecorationColor: t,
textDecoration: "underline",
...n
...e
},
...c,
children: s
...n
}
);
};
export {
d as Link
p as Link
};

View File

@ -9,6 +9,7 @@ type LinkProps = AriaProps & {
className?: string;
id?: string;
style?: React.CSSProperties;
color?: string;
};
export declare const Link: (props: LinkProps) => React.JSX.Element;
export {};

View File

@ -11,26 +11,23 @@ type LinkProps = AriaProps & {
className?: string;
id?: string;
style?: React.CSSProperties;
color?: string;
};
export const Link = (props: LinkProps) => {
const palette = usePalette();
const { href, target, rel, children, className, id, style, ...rest } = props;
const { style, color = hexFromArgb(palette.primary), ...rest } = props;
return (
<a
href={href}
target={target}
rel={rel}
className={className}
id={id}
style={{
color: hexFromArgb(palette.primary),
textDecorationColor: hexFromArgb(palette.primary),
color,
textDecorationColor: color,
textDecoration: 'underline',
...style,
}}
{...rest}
>{children}</a>
/>
);
};