@yuhuanowo/yunui 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { useYunUI } from './chunk-T37N6OZA.js';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+
5
+ var GithubIcon = () => /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z" }) });
6
+ var InstagramIcon = () => /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z" }) });
7
+ var DiscordIcon = () => /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z" }) });
8
+ function Footer({
9
+ appName,
10
+ logoSrc = "/favicon.ico",
11
+ homeHref = "/",
12
+ tagline,
13
+ sections = [],
14
+ social = [],
15
+ copyright
16
+ }) {
17
+ const { Link, Image } = useYunUI();
18
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
19
+ const copyrightText = copyright ?? `\xA9 ${year} ${appName}. All rights reserved.`;
20
+ return /* @__PURE__ */ jsx("footer", { className: "mt-auto py-6 px-6", children: /* @__PURE__ */ jsx("div", { className: "max-w-6xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "card p-6", children: [
21
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-6", children: [
22
+ /* @__PURE__ */ jsxs("div", { children: [
23
+ /* @__PURE__ */ jsxs(Link, { href: homeHref, className: "flex items-center gap-2 mb-2", children: [
24
+ /* @__PURE__ */ jsx(Image, { src: logoSrc, alt: appName, width: 24, height: 24 }),
25
+ /* @__PURE__ */ jsx("span", { className: "font-semibold", children: appName })
26
+ ] }),
27
+ tagline && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: tagline })
28
+ ] }),
29
+ sections.map((section) => /* @__PURE__ */ jsxs("div", { children: [
30
+ /* @__PURE__ */ jsx("h4", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2", children: section.title }),
31
+ /* @__PURE__ */ jsx("ul", { className: "space-y-1.5 text-sm", children: section.links.map((link) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link, { href: link.href, className: "text-muted-foreground hover:text-foreground transition-colors", children: link.label }) }, link.href)) })
32
+ ] }, section.title))
33
+ ] }),
34
+ /* @__PURE__ */ jsxs("div", { className: "mt-5 pt-4 border-t border-border flex flex-col sm:flex-row items-center justify-between gap-3 text-xs text-muted-foreground", children: [
35
+ /* @__PURE__ */ jsx("span", { children: copyrightText }),
36
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: social.map((link) => /* @__PURE__ */ jsx(
37
+ "a",
38
+ {
39
+ href: link.href,
40
+ target: link.href.startsWith("/") || link.href.startsWith("mailto:") ? void 0 : "_blank",
41
+ rel: link.href.startsWith("/") || link.href.startsWith("mailto:") ? void 0 : "noopener noreferrer",
42
+ className: "text-muted-foreground hover:text-foreground transition-colors",
43
+ "aria-label": link.label,
44
+ children: link.icon
45
+ },
46
+ link.label
47
+ )) })
48
+ ] })
49
+ ] }) }) });
50
+ }
51
+
52
+ // src/lib/clipboard.ts
53
+ async function copyToClipboard(text) {
54
+ try {
55
+ if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
56
+ await navigator.clipboard.writeText(text);
57
+ return true;
58
+ }
59
+ } catch {
60
+ }
61
+ try {
62
+ const textarea = document.createElement("textarea");
63
+ textarea.value = text;
64
+ textarea.setAttribute("readonly", "");
65
+ textarea.style.position = "fixed";
66
+ textarea.style.left = "-9999px";
67
+ document.body.appendChild(textarea);
68
+ textarea.select();
69
+ const ok = document.execCommand("copy");
70
+ document.body.removeChild(textarea);
71
+ return ok;
72
+ } catch {
73
+ return false;
74
+ }
75
+ }
76
+
77
+ export { DiscordIcon, Footer, GithubIcon, InstagramIcon, copyToClipboard };
78
+ //# sourceMappingURL=chunk-FOP7I6N3.js.map
79
+ //# sourceMappingURL=chunk-FOP7I6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AA,EAER;AAEA,EAAA,IAAI;AACA,IAAA,MAAM,QAAA,GAAW,QAAA,CAAS,aAAA,CAAc,UAAU,CAAA;AAClD,IAAA,QAAA,CAAS,KAAA,GAAQ,IAAA;AACjB,IAAA,QAAA,CAAS,YAAA,CAAa,YAAY,EAAE,CAAA;AACpC,IAAA,QAAA,CAAS,MAAM,QAAA,GAAW,OAAA;AAC1B,IAAA,QAAA,CAAS,MAAM,IAAA,GAAO,SAAA;AACtB,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,QAAQ,CAAA;AAClC,IAAA,QAAA,CAAS,MAAA,EAAO;AAChB,IAAA,MAAM,EAAA,GAAK,QAAA,CAAS,WAAA,CAAY,MAAM,CAAA;AACtC,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,QAAQ,CAAA;AAClC,IAAA,OAAO,EAAA;AAAA,EACX,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,KAAA;AAAA,EACX;AACJ","file":"chunk-FOP7I6N3.js","sourcesContent":["\"use client\";\n\nimport { type ReactNode } from \"react\";\nimport { useYunUI } from \"../adapters/context\";\n\n// Dependency-free brand icons for common platforms (exported for convenience).\nexport const GithubIcon = () => (\n <svg className=\"w-4 h-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z\"/>\n </svg>\n);\n\nexport const InstagramIcon = () => (\n <svg className=\"w-4 h-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z\"/>\n </svg>\n);\n\nexport const DiscordIcon = () => (\n <svg className=\"w-4 h-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z\"/>\n </svg>\n);\n\nexport interface FooterLink {\n /** Link text. */\n label: string;\n /** Destination href. */\n href: string;\n}\n\nexport interface FooterSection {\n /** Column heading. */\n title: string;\n /** Links in this column. */\n links: FooterLink[];\n}\n\nexport interface FooterSocial {\n /** Icon to render (e.g. {@link GithubIcon}). */\n icon: ReactNode;\n /** Destination href (external links open in a new tab). */\n href: string;\n /** Accessible label for the link. */\n label: string;\n}\n\nexport interface FooterProps {\n /** Brand name shown next to the logo. */\n appName: string;\n /** Logo image src. @defaultValue \"/favicon.ico\" */\n logoSrc?: string;\n /** Where the logo links to. @defaultValue \"/\" */\n homeHref?: string;\n /** Short brand tagline under the logo. */\n tagline?: string;\n /** Link columns. */\n sections?: FooterSection[];\n /** Social/icon links shown in the bottom bar. */\n social?: FooterSocial[];\n /** Defaults to `© <year> <appName>. All rights reserved.` */\n copyright?: string;\n}\n\n/** Site footer: brand block, link columns, copyright line, and social icons. */\nexport function Footer({\n appName,\n logoSrc = \"/favicon.ico\",\n homeHref = \"/\",\n tagline,\n sections = [],\n social = [],\n copyright,\n}: FooterProps) {\n const { Link, Image } = useYunUI();\n const year = new Date().getFullYear();\n const copyrightText = copyright ?? `© ${year} ${appName}. All rights reserved.`;\n\n return (\n <footer className=\"mt-auto py-6 px-6\">\n <div className=\"max-w-6xl mx-auto\">\n <div className=\"card p-6\">\n <div className=\"grid grid-cols-2 md:grid-cols-4 gap-6\">\n {/* Brand */}\n <div>\n <Link href={homeHref} className=\"flex items-center gap-2 mb-2\">\n <Image src={logoSrc} alt={appName} width={24} height={24} />\n <span className=\"font-semibold\">{appName}</span>\n </Link>\n {tagline && <p className=\"text-sm text-muted-foreground\">{tagline}</p>}\n </div>\n\n {/* Sections */}\n {sections.map((section) => (\n <div key={section.title}>\n <h4 className=\"text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2\">{section.title}</h4>\n <ul className=\"space-y-1.5 text-sm\">\n {section.links.map((link) => (\n <li key={link.href}>\n <Link href={link.href} className=\"text-muted-foreground hover:text-foreground transition-colors\">\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n\n {/* Bottom: Copyright + Social Icons */}\n <div className=\"mt-5 pt-4 border-t border-border flex flex-col sm:flex-row items-center justify-between gap-3 text-xs text-muted-foreground\">\n <span>{copyrightText}</span>\n <div className=\"flex items-center gap-4\">\n {social.map((link) => (\n <a\n key={link.label}\n href={link.href}\n target={link.href.startsWith(\"/\") || link.href.startsWith(\"mailto:\") ? undefined : \"_blank\"}\n rel={link.href.startsWith(\"/\") || link.href.startsWith(\"mailto:\") ? undefined : \"noopener noreferrer\"}\n className=\"text-muted-foreground hover:text-foreground transition-colors\"\n aria-label={link.label}\n >\n {link.icon}\n </a>\n ))}\n </div>\n </div>\n </div>\n </div>\n </footer>\n );\n}\n\nexport default Footer;\n","/**\n * Copy text to the clipboard and report whether it actually succeeded.\n *\n * The native `navigator.clipboard` API is only available in secure contexts\n * (HTTPS / localhost). On plain-HTTP origins — common when an admin opens the\n * dashboard over a LAN IP — it is `undefined` and `writeText` throws. Callers\n * that fired a \"Copied!\" toast unconditionally would lie to the user. This\n * helper falls back to the legacy `execCommand(\"copy\")` path and returns a\n * boolean so the caller can show an accurate toast.\n */\nexport async function copyToClipboard(text: string): Promise<boolean> {\n try {\n if (typeof navigator !== \"undefined\" && navigator.clipboard?.writeText) {\n // Throws/rejects in non-secure contexts (plain HTTP) — caught below\n // so we fall back to the legacy path rather than failing the copy.\n await navigator.clipboard.writeText(text);\n return true;\n }\n } catch {\n /* fall through to the legacy path below */\n }\n\n try {\n const textarea = document.createElement(\"textarea\");\n textarea.value = text;\n textarea.setAttribute(\"readonly\", \"\");\n textarea.style.position = \"fixed\";\n textarea.style.left = \"-9999px\";\n document.body.appendChild(textarea);\n textarea.select();\n const ok = document.execCommand(\"copy\");\n document.body.removeChild(textarea);\n return ok;\n } catch {\n return false;\n }\n}\n"]}
@@ -575,6 +575,7 @@ var Checkbox = forwardRef(
575
575
  className: `
576
576
  w-4 h-4 rounded border-2 flex items-center justify-center
577
577
  transition-all duration-200 ease-in-out
578
+ outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
578
579
  ${checked ? "bg-primary border-primary text-primary-foreground" : "border-slate-300 dark:border-slate-600 bg-transparent hover:border-primary/50"}
579
580
  ${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
580
581
  ${className}
@@ -1278,6 +1279,7 @@ var Button = React7.forwardRef(
1278
1279
  secondary: "btn-secondary",
1279
1280
  ghost: "btn-ghost",
1280
1281
  accent: "btn-accent",
1282
+ brand: "btn-brand",
1281
1283
  outline: "btn-outline",
1282
1284
  amber: "btn-amber",
1283
1285
  red: "btn-red",
@@ -1313,17 +1315,25 @@ var Button = React7.forwardRef(
1313
1315
  );
1314
1316
  Button.displayName = "Button";
1315
1317
  var Input = React7.forwardRef(
1316
- ({ className, icon, error, ...props }, ref) => {
1318
+ ({ className, icon, error, id, "aria-describedby": describedBy, ...props }, ref) => {
1319
+ const reactId = React7.useId();
1320
+ const fieldId = id ?? reactId;
1321
+ const errorId = error ? `${fieldId}-error` : void 0;
1322
+ const describedByIds = [describedBy, errorId].filter(Boolean).join(" ") || void 0;
1317
1323
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
1318
- icon && /* @__PURE__ */ jsx("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }),
1324
+ icon && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }),
1319
1325
  /* @__PURE__ */ jsx(
1320
1326
  "input",
1321
1327
  {
1322
1328
  ref,
1329
+ id: fieldId,
1330
+ "aria-invalid": error ? true : void 0,
1331
+ "aria-describedby": describedByIds,
1323
1332
  className: cn(
1324
1333
  "w-full h-10 px-4 bg-background border rounded-xl text-sm outline-none transition-colors",
1325
1334
  "placeholder:text-muted-foreground",
1326
1335
  "focus:border-ring focus:ring-2 focus:ring-ring/20",
1336
+ "disabled:opacity-50 disabled:cursor-not-allowed",
1327
1337
  icon && "pl-10",
1328
1338
  error ? "border-red-300 focus:border-red-400 dark:border-red-700" : "border-border",
1329
1339
  className
@@ -1331,8 +1341,8 @@ var Input = React7.forwardRef(
1331
1341
  ...props
1332
1342
  }
1333
1343
  ),
1334
- error && /* @__PURE__ */ jsxs("p", { className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
1335
- /* @__PURE__ */ jsx(AlertCircle, { className: "w-3 h-3" }),
1344
+ error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
1345
+ /* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
1336
1346
  error
1337
1347
  ] })
1338
1348
  ] });
@@ -1340,24 +1350,32 @@ var Input = React7.forwardRef(
1340
1350
  );
1341
1351
  Input.displayName = "Input";
1342
1352
  var Textarea = React7.forwardRef(
1343
- ({ className, error, ...props }, ref) => {
1353
+ ({ className, error, id, "aria-describedby": describedBy, ...props }, ref) => {
1354
+ const reactId = React7.useId();
1355
+ const fieldId = id ?? reactId;
1356
+ const errorId = error ? `${fieldId}-error` : void 0;
1357
+ const describedByIds = [describedBy, errorId].filter(Boolean).join(" ") || void 0;
1344
1358
  return /* @__PURE__ */ jsxs("div", { children: [
1345
1359
  /* @__PURE__ */ jsx(
1346
1360
  "textarea",
1347
1361
  {
1348
1362
  ref,
1363
+ id: fieldId,
1364
+ "aria-invalid": error ? true : void 0,
1365
+ "aria-describedby": describedByIds,
1349
1366
  className: cn(
1350
1367
  "w-full px-4 py-3 bg-background border rounded-xl text-sm outline-none transition-colors resize-none",
1351
1368
  "placeholder:text-muted-foreground",
1352
1369
  "focus:border-ring focus:ring-2 focus:ring-ring/20",
1370
+ "disabled:opacity-50 disabled:cursor-not-allowed",
1353
1371
  error ? "border-red-300 dark:border-red-700" : "border-border",
1354
1372
  className
1355
1373
  ),
1356
1374
  ...props
1357
1375
  }
1358
1376
  ),
1359
- error && /* @__PURE__ */ jsxs("p", { className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
1360
- /* @__PURE__ */ jsx(AlertCircle, { className: "w-3 h-3" }),
1377
+ error && /* @__PURE__ */ jsxs("p", { id: errorId, className: "mt-1.5 text-xs text-red-500 flex items-center gap-1", children: [
1378
+ /* @__PURE__ */ jsx(AlertCircle, { "aria-hidden": "true", className: "w-3 h-3" }),
1361
1379
  error
1362
1380
  ] })
1363
1381
  ] });
@@ -1726,13 +1744,15 @@ var IconButton = React7.forwardRef(
1726
1744
  "button",
1727
1745
  {
1728
1746
  ref,
1747
+ type: props.type ?? "button",
1748
+ "aria-label": label,
1729
1749
  className: cn(
1730
1750
  "p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
1731
1751
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1732
1752
  className
1733
1753
  ),
1734
1754
  ...props,
1735
- children: icon
1755
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: icon })
1736
1756
  }
1737
1757
  ) }),
1738
1758
  /* @__PURE__ */ jsx(TooltipContent, { children: label })
@@ -2118,8 +2138,10 @@ function SegmentedSelect({
2118
2138
  return /* @__PURE__ */ jsxs(
2119
2139
  "button",
2120
2140
  {
2141
+ type: "button",
2121
2142
  onClick: () => !disabled && onChange(opt.value),
2122
2143
  disabled,
2144
+ "aria-pressed": value === opt.value,
2123
2145
  title: opt.desc,
2124
2146
  className: cn(
2125
2147
  "inline-flex items-center justify-center gap-2 px-3 py-1.5 text-xs font-medium border rounded-lg whitespace-nowrap transition-all duration-150 ease cursor-pointer outline-none",
@@ -2353,6 +2375,7 @@ var Switch = forwardRef(
2353
2375
  className: `
2354
2376
  ${sizeClass.track} rounded-full border-2 flex items-center px-0.5
2355
2377
  transition-all duration-200 ease-in-out
2378
+ outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
2356
2379
  ${checked ? variantClass.checkedTrack : variantClass.uncheckedTrack}
2357
2380
  ${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
2358
2381
  ${className}
@@ -2441,7 +2464,87 @@ var toast = {
2441
2464
  });
2442
2465
  }
2443
2466
  };
2467
+ var YUNUI_PALETTES = [
2468
+ "gray",
2469
+ "sand",
2470
+ "slate",
2471
+ "mint",
2472
+ "rose",
2473
+ "dusk",
2474
+ "red",
2475
+ "orange",
2476
+ "yellow",
2477
+ "moss",
2478
+ "green",
2479
+ "emerald",
2480
+ "aqua",
2481
+ "cyan",
2482
+ "blue",
2483
+ "indigo",
2484
+ "violet",
2485
+ "magenta",
2486
+ "pink"
2487
+ ];
2488
+ var ATTR = {
2489
+ brand: "data-brand",
2490
+ accent: "data-accent",
2491
+ neutral: "data-neutral",
2492
+ solid: "data-solid",
2493
+ surface: "data-surface",
2494
+ theme: "data-theme"
2495
+ };
2496
+ function resolveTarget(el) {
2497
+ if (el) return el;
2498
+ return typeof document !== "undefined" ? document.documentElement : null;
2499
+ }
2500
+ function applyTheme(theme, el) {
2501
+ const target = resolveTarget(el);
2502
+ if (!target) return;
2503
+ for (const key of Object.keys(theme)) {
2504
+ const value = theme[key];
2505
+ const attr = ATTR[key];
2506
+ if (!attr) continue;
2507
+ if (value == null) target.removeAttribute(attr);
2508
+ else target.setAttribute(attr, value);
2509
+ }
2510
+ }
2511
+ function readTheme(el) {
2512
+ const target = resolveTarget(el);
2513
+ const out = {};
2514
+ if (!target) return out;
2515
+ for (const key of Object.keys(ATTR)) {
2516
+ const v = target.getAttribute(ATTR[key]);
2517
+ if (v != null) out[key] = v;
2518
+ }
2519
+ return out;
2520
+ }
2521
+ var STORAGE_KEY = "yunui-theme";
2522
+ function useYunUITheme(defaults = {}) {
2523
+ const [theme, setTheme] = React7.useState(defaults);
2524
+ React7.useEffect(() => {
2525
+ let stored = {};
2526
+ try {
2527
+ stored = JSON.parse(localStorage.getItem(STORAGE_KEY) || "{}");
2528
+ } catch {
2529
+ }
2530
+ const merged = { ...defaults, ...stored };
2531
+ setTheme(merged);
2532
+ applyTheme(merged);
2533
+ }, []);
2534
+ const update = React7.useCallback((patch) => {
2535
+ setTheme((prev) => {
2536
+ const next = { ...prev, ...patch };
2537
+ applyTheme(next);
2538
+ try {
2539
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(next));
2540
+ } catch {
2541
+ }
2542
+ return next;
2543
+ });
2544
+ }, []);
2545
+ return [theme, update];
2546
+ }
2444
2547
 
2445
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, Input, Label2 as Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose2 as PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, fadeIn, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior };
2446
- //# sourceMappingURL=chunk-YRITK7CC.js.map
2447
- //# sourceMappingURL=chunk-YRITK7CC.js.map
2548
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Column, Combobox, ConfirmModal, CustomSelect, DeleteConfirmModal, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Flex, Grid, IconButton, Input, Label2 as Label, Marquee, Modal, MotionDiv, MotionSpan, NavTabs, PageLoader, Pagination, Popover, PopoverClose2 as PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue, Sheet, ShinyButton, Skeleton, Slider, Spinner, Stack, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, YUNUI_PALETTES, applyTheme, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useModalBehavior, useYunUITheme };
2549
+ //# sourceMappingURL=chunk-KTA7HC4V.js.map
2550
+ //# sourceMappingURL=chunk-KTA7HC4V.js.map