From 68bbb38b8223f519d4e0c22445324b6fe067ce17 Mon Sep 17 00:00:00 2001 From: OfficialDakari Date: Thu, 3 Apr 2025 11:19:51 +0500 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=B1=D1=80=D0=B5=D1=8E=D1=81?= =?UTF-8?q?=D1=8C=20=D0=BD=D0=B0=D0=BB=D1=8B=D1=81=D0=BE=20=D0=B5=D1=81?= =?UTF-8?q?=D0=BB=D0=B8=20=D1=8D=D1=82=D0=BE=20=D0=BF=D0=BE=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D1=81=D0=B8=D0=BB=D0=BE=20=D0=B1=D0=B0=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/react-you-ui5.js | 2 +- dist/react-you-ui5.mjs | 26 ++++++++++------ dist/src/types/aria.d.ts | 64 +++++++++++++++++++------------------- src/components/Link.tsx | 9 +++++- src/types/aria.ts | 66 ++++++++++++++++++++-------------------- 5 files changed, 90 insertions(+), 77 deletions(-) diff --git a/dist/react-you-ui5.js b/dist/react-you-ui5.js index 4ad8fd2..d3bc675 100644 --- a/dist/react-you-ui5.js +++ b/dist/react-you-ui5.js @@ -1 +1 @@ -"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; +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),c=require("react"),i=require("./react-you-ui6.js"),a=require("./string_utils-Bad7L8P5.js"),l=require("./create-component-D9KTUrcf.js"),u=l.o({tagName:"a",elementClass:HTMLAnchorElement,react:c}),m=t=>{const r=i.usePalette(),{style:o,color:e=a.hexFromArgb(r.primary),...n}=t;return s.jsx(u,{style:{color:e,textDecorationColor:e,textDecoration:"underline",...o},...n})};exports.Link=m; diff --git a/dist/react-you-ui5.mjs b/dist/react-you-ui5.mjs index 7eb94ce..f3a41bc 100644 --- a/dist/react-you-ui5.mjs +++ b/dist/react-you-ui5.mjs @@ -1,21 +1,27 @@ -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", +import { jsx as n } from "react/jsx-runtime"; +import a from "react"; +import { usePalette as s } from "./react-you-ui6.mjs"; +import { h as c } from "./string_utils-B4bsIQ5w.mjs"; +import { o as l } from "./create-component-CVXl33PD.mjs"; +const i = l({ + tagName: "a", + elementClass: HTMLAnchorElement, + react: a +}), y = (o) => { + const e = s(), { style: r, color: t = c(e.primary), ...m } = o; + return /* @__PURE__ */ n( + i, { style: { color: t, textDecorationColor: t, textDecoration: "underline", - ...e + ...r }, - ...n + ...m } ); }; export { - p as Link + y as Link }; diff --git a/dist/src/types/aria.d.ts b/dist/src/types/aria.d.ts index afc481c..926aa79 100644 --- a/dist/src/types/aria.d.ts +++ b/dist/src/types/aria.d.ts @@ -1,35 +1,35 @@ export interface AriaProps { - 'aria-label'?: string; - 'aria-labelledby'?: string; - 'aria-describedby'?: string; - 'aria-controls'?: string; - 'aria-expanded'?: boolean; - 'aria-hidden'?: boolean; - 'aria-invalid'?: boolean; - 'aria-required'?: boolean; - 'aria-disabled'?: boolean; - 'aria-pressed'?: boolean; - 'aria-checked'?: boolean; - 'aria-selected'?: boolean; - 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'; - 'aria-live'?: 'off' | 'polite' | 'assertive'; - 'aria-atomic'?: boolean; - 'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all'; - 'aria-busy'?: boolean; - 'aria-dropeffect'?: 'copy' | 'move' | 'link' | 'execute' | 'popup' | 'none'; - 'aria-dragged'?: boolean; - 'aria-grabbed'?: boolean; - 'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; - 'aria-level'?: number; - 'aria-multiline'?: boolean; - 'aria-multiselectable'?: boolean; - 'aria-orientation'?: 'horizontal' | 'vertical'; - 'aria-placeholder'?: string; - 'aria-readonly'?: boolean; - 'aria-sort'?: 'ascending' | 'descending' | 'none' | 'other'; - 'aria-valuemax'?: number; - 'aria-valuemin'?: number; - 'aria-valuenow'?: number; - 'aria-valuetext'?: string; + ariaLabel?: string; + ariaLabelledby?: string; + ariaDescribedby?: string; + ariaControls?: string; + ariaExpanded?: boolean; + ariaHidden?: boolean; + ariaInvalid?: boolean; + ariaRequired?: boolean; + ariaDisabled?: boolean; + ariaPressed?: boolean; + ariaChecked?: boolean; + ariaSelected?: boolean; + ariaCurrent?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'; + ariaLive?: 'off' | 'polite' | 'assertive'; + ariaAtomic?: boolean; + ariaRelevant?: 'additions' | 'removals' | 'text' | 'all'; + ariaBusy?: boolean; + ariaDropeffect?: 'copy' | 'move' | 'link' | 'execute' | 'popup' | 'none'; + ariaDragged?: boolean; + ariaGrabbed?: boolean; + ariaHaspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; + ariaLevel?: number; + ariaMultiline?: boolean; + ariaMultiselectable?: boolean; + ariaOrientation?: 'horizontal' | 'vertical'; + ariaPlaceholder?: string; + ariaReadonly?: boolean; + ariaSort?: 'ascending' | 'descending' | 'none' | 'other'; + ariaValuemax?: number; + ariaValuemin?: number; + ariaValuenow?: number; + ariaValuetext?: string; role?: string; } diff --git a/src/components/Link.tsx b/src/components/Link.tsx index abc3adf..5e0026d 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -2,6 +2,13 @@ import React from "react"; import { AriaProps } from "../types/aria"; import { usePalette } from "../hooks/useTheme"; import { hexFromArgb } from "@material/material-color-utilities"; +import { createComponent } from '@lit/react'; + +const Anchor = createComponent({ + tagName: 'a', + elementClass: HTMLAnchorElement, + react: React, +}); type LinkProps = AriaProps & { href?: string; @@ -20,7 +27,7 @@ export const Link = (props: LinkProps) => { const { style, color = hexFromArgb(palette.primary), ...rest } = props; return ( -