побреюсь налысо если это пофиксило баг

This commit is contained in:
OfficialDakari 2025-04-03 11:19:51 +05:00
parent a4d42e67e0
commit 68bbb38b82
5 changed files with 90 additions and 77 deletions

View File

@ -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;

View File

@ -1,21 +1,27 @@
import { jsx as s } from "react/jsx-runtime"; import { jsx as n } from "react/jsx-runtime";
import { usePalette as i } from "./react-you-ui6.mjs"; import a from "react";
import { h as m } from "./string_utils-B4bsIQ5w.mjs"; import { usePalette as s } from "./react-you-ui6.mjs";
const p = (o) => { import { h as c } from "./string_utils-B4bsIQ5w.mjs";
const r = i(), { style: e, color: t = m(r.primary), ...n } = o; import { o as l } from "./create-component-CVXl33PD.mjs";
return /* @__PURE__ */ s( const i = l({
"a", 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: { style: {
color: t, color: t,
textDecorationColor: t, textDecorationColor: t,
textDecoration: "underline", textDecoration: "underline",
...e ...r
}, },
...n ...m
} }
); );
}; };
export { export {
p as Link y as Link
}; };

View File

@ -1,35 +1,35 @@
export interface AriaProps { export interface AriaProps {
'aria-label'?: string; ariaLabel?: string;
'aria-labelledby'?: string; ariaLabelledby?: string;
'aria-describedby'?: string; ariaDescribedby?: string;
'aria-controls'?: string; ariaControls?: string;
'aria-expanded'?: boolean; ariaExpanded?: boolean;
'aria-hidden'?: boolean; ariaHidden?: boolean;
'aria-invalid'?: boolean; ariaInvalid?: boolean;
'aria-required'?: boolean; ariaRequired?: boolean;
'aria-disabled'?: boolean; ariaDisabled?: boolean;
'aria-pressed'?: boolean; ariaPressed?: boolean;
'aria-checked'?: boolean; ariaChecked?: boolean;
'aria-selected'?: boolean; ariaSelected?: boolean;
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'; ariaCurrent?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
'aria-live'?: 'off' | 'polite' | 'assertive'; ariaLive?: 'off' | 'polite' | 'assertive';
'aria-atomic'?: boolean; ariaAtomic?: boolean;
'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all'; ariaRelevant?: 'additions' | 'removals' | 'text' | 'all';
'aria-busy'?: boolean; ariaBusy?: boolean;
'aria-dropeffect'?: 'copy' | 'move' | 'link' | 'execute' | 'popup' | 'none'; ariaDropeffect?: 'copy' | 'move' | 'link' | 'execute' | 'popup' | 'none';
'aria-dragged'?: boolean; ariaDragged?: boolean;
'aria-grabbed'?: boolean; ariaGrabbed?: boolean;
'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; ariaHaspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
'aria-level'?: number; ariaLevel?: number;
'aria-multiline'?: boolean; ariaMultiline?: boolean;
'aria-multiselectable'?: boolean; ariaMultiselectable?: boolean;
'aria-orientation'?: 'horizontal' | 'vertical'; ariaOrientation?: 'horizontal' | 'vertical';
'aria-placeholder'?: string; ariaPlaceholder?: string;
'aria-readonly'?: boolean; ariaReadonly?: boolean;
'aria-sort'?: 'ascending' | 'descending' | 'none' | 'other'; ariaSort?: 'ascending' | 'descending' | 'none' | 'other';
'aria-valuemax'?: number; ariaValuemax?: number;
'aria-valuemin'?: number; ariaValuemin?: number;
'aria-valuenow'?: number; ariaValuenow?: number;
'aria-valuetext'?: string; ariaValuetext?: string;
role?: string; role?: string;
} }

View File

@ -2,6 +2,13 @@ import React from "react";
import { AriaProps } from "../types/aria"; import { AriaProps } from "../types/aria";
import { usePalette } from "../hooks/useTheme"; import { usePalette } from "../hooks/useTheme";
import { hexFromArgb } from "@material/material-color-utilities"; import { hexFromArgb } from "@material/material-color-utilities";
import { createComponent } from '@lit/react';
const Anchor = createComponent({
tagName: 'a',
elementClass: HTMLAnchorElement,
react: React,
});
type LinkProps = AriaProps & { type LinkProps = AriaProps & {
href?: string; href?: string;
@ -20,7 +27,7 @@ export const Link = (props: LinkProps) => {
const { style, color = hexFromArgb(palette.primary), ...rest } = props; const { style, color = hexFromArgb(palette.primary), ...rest } = props;
return ( return (
<a <Anchor
style={{ style={{
color, color,
textDecorationColor: color, textDecorationColor: color,

View File

@ -1,35 +1,35 @@
export interface AriaProps { export interface AriaProps {
'aria-label'?: string; ariaLabel?: string;
'aria-labelledby'?: string; ariaLabelledby?: string;
'aria-describedby'?: string; ariaDescribedby?: string;
'aria-controls'?: string; ariaControls?: string;
'aria-expanded'?: boolean; ariaExpanded?: boolean;
'aria-hidden'?: boolean; ariaHidden?: boolean;
'aria-invalid'?: boolean; ariaInvalid?: boolean;
'aria-required'?: boolean; ariaRequired?: boolean;
'aria-disabled'?: boolean; ariaDisabled?: boolean;
'aria-pressed'?: boolean; ariaPressed?: boolean;
'aria-checked'?: boolean; ariaChecked?: boolean;
'aria-selected'?: boolean; ariaSelected?: boolean;
'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'; ariaCurrent?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
'aria-live'?: 'off' | 'polite' | 'assertive'; ariaLive?: 'off' | 'polite' | 'assertive';
'aria-atomic'?: boolean; ariaAtomic?: boolean;
'aria-relevant'?: 'additions' | 'removals' | 'text' | 'all'; ariaRelevant?: 'additions' | 'removals' | 'text' | 'all';
'aria-busy'?: boolean; ariaBusy?: boolean;
'aria-dropeffect'?: 'copy' | 'move' | 'link' | 'execute' | 'popup' | 'none'; ariaDropeffect?: 'copy' | 'move' | 'link' | 'execute' | 'popup' | 'none';
'aria-dragged'?: boolean; ariaDragged?: boolean;
'aria-grabbed'?: boolean; ariaGrabbed?: boolean;
'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'; ariaHaspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
'aria-level'?: number; ariaLevel?: number;
'aria-multiline'?: boolean; ariaMultiline?: boolean;
'aria-multiselectable'?: boolean; ariaMultiselectable?: boolean;
'aria-orientation'?: 'horizontal' | 'vertical'; ariaOrientation?: 'horizontal' | 'vertical';
'aria-placeholder'?: string; ariaPlaceholder?: string;
'aria-readonly'?: boolean; ariaReadonly?: boolean;
'aria-sort'?: 'ascending' | 'descending' | 'none' | 'other'; ariaSort?: 'ascending' | 'descending' | 'none' | 'other';
'aria-valuemax'?: number; ariaValuemax?: number;
'aria-valuemin'?: number; ariaValuemin?: number;
'aria-valuenow'?: number; ariaValuenow?: number;
'aria-valuetext'?: string; ariaValuetext?: string;
role?: string; role?: string;
} }