@yuhuanowo/yunui 0.2.14 → 0.2.16
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.
- package/README.md +19 -1
- package/README.zh-CN.md +17 -1
- package/README.zh-TW.md +17 -1
- package/dist/adapters.js +1 -1
- package/dist/ai.js +142 -103
- package/dist/ai.js.map +1 -1
- package/dist/chat.d.ts +133 -0
- package/dist/chat.js +268 -0
- package/dist/chat.js.map +1 -0
- package/dist/{chunk-U2LNRVMI.js → chunk-3RT24MSH.js} +4 -3
- package/dist/chunk-3RT24MSH.js.map +1 -0
- package/dist/chunk-5E3O6ANF.js +1154 -0
- package/dist/chunk-5E3O6ANF.js.map +1 -0
- package/dist/{chunk-VXFEANVX.js → chunk-5TOGZTAO.js} +333 -875
- package/dist/chunk-5TOGZTAO.js.map +1 -0
- package/dist/chunk-AV5TGEJS.js +54 -0
- package/dist/chunk-AV5TGEJS.js.map +1 -0
- package/dist/{chunk-GHO4RCDR.js → chunk-GSPJ5YI6.js} +57 -28
- package/dist/chunk-GSPJ5YI6.js.map +1 -0
- package/dist/chunk-QEIBYOG2.js +188 -0
- package/dist/chunk-QEIBYOG2.js.map +1 -0
- package/dist/{chunk-N53PNMPJ.js → chunk-UYYG4XDW.js} +3 -3
- package/dist/{chunk-N53PNMPJ.js.map → chunk-UYYG4XDW.js.map} +1 -1
- package/dist/content.d.ts +144 -0
- package/dist/content.js +890 -0
- package/dist/content.js.map +1 -0
- package/dist/index.d.ts +273 -6
- package/dist/index.js +5 -3
- package/dist/patterns.d.ts +107 -1
- package/dist/patterns.js +463 -10
- package/dist/patterns.js.map +1 -1
- package/package.json +77 -5
- package/styles/content.css +129 -0
- package/styles/tokens.css +704 -352
- package/styles/yunui.css +126 -4
- package/dist/chunk-GHO4RCDR.js.map +0 -1
- package/dist/chunk-U2LNRVMI.js.map +0 -1
- package/dist/chunk-VXFEANVX.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/content/code-block.tsx","../src/content/mermaid-diagram.tsx","../src/content/callout-block.tsx","../src/content/content-image.tsx","../src/content/markdown-renderer.tsx","../src/content/math-renderer.tsx"],"names":["useState","useEffect","jsx","jsxs","Fragment","React","ContentImage","useRef","useMemo"],"mappings":";;;;;;;;;;;;;;;;;AA6BA,IAAM,aAAA,GAAwC;AAAA,EAC5C,EAAA,EAAI,YAAA;AAAA,EACJ,UAAA,EAAY,YAAA;AAAA,EACZ,EAAA,EAAI,YAAA;AAAA,EACJ,UAAA,EAAY,YAAA;AAAA,EACZ,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,KAAA;AAAA,EACL,EAAA,EAAI,QAAA;AAAA,EACJ,MAAA,EAAQ,QAAA;AAAA,EACR,EAAA,EAAI,MAAA;AAAA,EACJ,IAAA,EAAM,MAAA;AAAA,EACN,EAAA,EAAI,IAAA;AAAA,EACJ,IAAA,EAAM,MAAA;AAAA,EACN,EAAA,EAAI,MAAA;AAAA,EACJ,GAAA,EAAK,KAAA;AAAA,EACL,CAAA,EAAG,GAAA;AAAA,EACH,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,QAAA;AAAA,EACR,EAAA,EAAI,QAAA;AAAA,EACJ,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,MAAA;AAAA,EACL,GAAA,EAAK,KAAA;AAAA,EACL,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU,UAAA;AAAA,EACV,IAAA,EAAM,MAAA;AAAA,EACN,EAAA,EAAI,OAAA;AAAA,EACJ,KAAA,EAAO,OAAA;AAA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,KAAA,EAAO;AACT,IAAA,uBACEC,GAAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,EAAA;AAAA,UACT,uCAAA;AAAA,UACA,QAAQ,4BAAA,GAA+B,QAAA;AAAA,UACvC;AAAA,SACF;AAAA,QAEA,QAAA,kBAAAC,IAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EAAU,QAAA,EAAA;AAAA,UAAA,eAAA;AAAA,UAAI;AAAA,SAAA,EAAM;AAAA;AAAA,KACtC;AAAA,EAEJ;AAEA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBACED,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAW,EAAA;AAAA,UACT,uCAAA;AAAA,UACA,oBAAA;AAAA,UACA;AAAA,SACF;AAAA,QAEA,QAAA,kBAAAA,GAAAA,CAAC,MAAA,EAAA,EAAK,GAAA,EAAK,YAAA,EAAc;AAAA;AAAA,KAC3B;AAAA,EAEJ;AAEA,EAAA,uBACEA,IAAC,MAAA,EAAA,EAAK,GAAA,EAAK,cAAc,SAAA,EAAW,EAAA,CAAG,2BAAA,EAA6B,SAAS,CAAA,EAAG,CAAA;AAEpF;AAGO,SAAS,UAAA,CAAW,EAAE,KAAA,EAAM,EAAsB;AACvD,EAAA,uBAAOA,GAAAA,CAAC,YAAA,EAAA,EAAa,IAAA,EAAM,KAAA,EAAO,OAAO,KAAA,EAAO,CAAA;AAClD;AAGO,SAAS,SAAA,CAAU,EAAE,KAAA,EAAM,EAAsB;AACtD,EAAA,uBAAOA,GAAAA,CAAC,YAAA,EAAA,EAAa,IAAA,EAAM,KAAA,EAAO,OAAK,IAAA,EAAC,CAAA;AAC1C","file":"content.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useState, useEffect, useMemo, useCallback } from \"react\";\nimport { Check, Copy, Edit3 } from \"lucide-react\";\nimport type { BundledLanguage, BundledTheme } from \"shiki\";\nimport { cn } from \"../lib/cn\";\nimport { useContentT } from \"./use-content-t\";\n\nexport interface CodeBlockEditPayload {\n code: string;\n language: string;\n filename: string;\n}\n\nexport interface CodeBlockProps {\n children: string;\n language?: string;\n showLineNumbers?: boolean;\n highlightLines?: number[];\n filename?: string;\n className?: string;\n /**\n * When provided, an \"Edit\" button appears in the header and calls this with\n * the code payload (e.g. to open it in an editor/workspace). Hidden if unset.\n */\n onEdit?: (payload: CodeBlockEditPayload) => void;\n}\n\nconst languageNames: Record<string, string> = {\n js: \"JavaScript\",\n javascript: \"JavaScript\",\n ts: \"TypeScript\",\n typescript: \"TypeScript\",\n tsx: \"TSX\",\n jsx: \"JSX\",\n py: \"Python\",\n python: \"Python\",\n rb: \"Ruby\",\n ruby: \"Ruby\",\n go: \"Go\",\n rust: \"Rust\",\n rs: \"Rust\",\n cpp: \"C++\",\n c: \"C\",\n java: \"Java\",\n kotlin: \"Kotlin\",\n kt: \"Kotlin\",\n swift: \"Swift\",\n php: \"PHP\",\n sql: \"SQL\",\n html: \"HTML\",\n css: \"CSS\",\n scss: \"SCSS\",\n sass: \"Sass\",\n json: \"JSON\",\n yaml: \"YAML\",\n yml: \"YAML\",\n xml: \"XML\",\n md: \"Markdown\",\n markdown: \"Markdown\",\n bash: \"Bash\",\n sh: \"Shell\",\n shell: \"Shell\",\n zsh: \"Zsh\",\n powershell: \"PowerShell\",\n ps1: \"PowerShell\",\n dockerfile: \"Dockerfile\",\n docker: \"Docker\",\n graphql: \"GraphQL\",\n vue: \"Vue\",\n svelte: \"Svelte\",\n diff: \"Diff\",\n plaintext: \"Plain Text\",\n text: \"Plain Text\",\n};\n\nconst langExtMap: Record<string, string> = {\n typescript: \"ts\",\n javascript: \"js\",\n python: \"py\",\n bash: \"sh\",\n shell: \"sh\",\n markdown: \"md\",\n};\n\nfunction useIsDarkMode() {\n const [isDark, setIsDark] = useState(false);\n\n useEffect(() => {\n const check = () =>\n setIsDark(document.documentElement.classList.contains(\"dark\"));\n check();\n const observer = new MutationObserver(check);\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n return () => observer.disconnect();\n }, []);\n\n return isDark;\n}\n\n/**\n * Syntax-highlighted code block powered by Shiki (accurate, VS Code-grade\n * highlighting for 100+ languages). Shiki is loaded on demand the first time a\n * block renders, so it never ships in the initial bundle. Supports line numbers,\n * highlighted lines, a filename header, copy, and an optional edit action.\n */\nexport function CodeBlock({\n children,\n language = \"plaintext\",\n showLineNumbers = false,\n highlightLines = [],\n filename,\n className,\n onEdit,\n}: CodeBlockProps) {\n const [copied, setCopied] = useState(false);\n const [highlightedCode, setHighlightedCode] = useState<string>(\"\");\n const [isLoading, setIsLoading] = useState(true);\n const isDark = useIsDarkMode();\n const t = useContentT();\n\n const code = useMemo(\n () => (typeof children === \"string\" ? children.trim() : String(children).trim()),\n [children],\n );\n\n const displayLanguage =\n languageNames[language?.toLowerCase()] || language?.toUpperCase() || \"CODE\";\n\n const handleEdit = useCallback(() => {\n if (!onEdit) return;\n const ext = langExtMap[language?.toLowerCase()] || language || \"txt\";\n onEdit({ code, language, filename: filename || `snippet.${ext}` });\n }, [onEdit, code, language, filename]);\n\n useEffect(() => {\n let cancelled = false;\n\n async function highlight() {\n setIsLoading(true);\n try {\n const { codeToHtml } = await import(\"shiki\");\n const theme: BundledTheme = isDark ? \"github-dark\" : \"github-light\";\n const lang = (language?.toLowerCase() || \"plaintext\") as BundledLanguage;\n\n const html = await codeToHtml(code, {\n lang,\n theme,\n transformers: [\n {\n line(node, line) {\n if (showLineNumbers) node.properties[\"data-line\"] = line;\n if (highlightLines.includes(line)) {\n node.properties[\"class\"] =\n `${node.properties[\"class\"] || \"\"} highlighted-line`;\n }\n },\n },\n ],\n });\n\n if (!cancelled) {\n setHighlightedCode(html);\n setIsLoading(false);\n }\n } catch {\n if (!cancelled) {\n setHighlightedCode(\n `<pre class=\"shiki\"><code>${escapeHtml(code)}</code></pre>`,\n );\n setIsLoading(false);\n }\n }\n }\n\n highlight();\n return () => {\n cancelled = true;\n };\n }, [code, language, isDark, showLineNumbers, highlightLines]);\n\n const handleCopy = async () => {\n try {\n if (navigator.clipboard?.writeText) {\n await navigator.clipboard.writeText(code);\n } else {\n const textArea = document.createElement(\"textarea\");\n textArea.value = code;\n document.body.appendChild(textArea);\n textArea.select();\n document.execCommand(\"copy\");\n document.body.removeChild(textArea);\n }\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch {\n // ignore clipboard failures\n }\n };\n\n const btnBase =\n \"flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-all hover:bg-(--accent-subtle) outline-none focus-visible:ring-2 focus-visible:ring-ring\";\n\n return (\n <div\n className={cn(\n \"card group my-4 overflow-hidden max-w-full min-w-0\",\n className,\n )}\n >\n {/* Window-chrome header — matches YunUI's original patterns/CodeBlock:\n traffic-light dots + a language `.badge` (or filename) + copy/edit. */}\n <div className=\"flex items-center justify-between px-4 py-2.5 border-b border-(--border-hairline) bg-(--bg-elevated)\">\n <div className=\"flex items-center gap-2.5\">\n <div className=\"flex gap-1\">\n <div className=\"w-2 h-2 rounded-full bg-(--error) opacity-80\" />\n <div className=\"w-2 h-2 rounded-full bg-(--warning) opacity-80\" />\n <div className=\"w-2 h-2 rounded-full bg-(--success) opacity-80\" />\n </div>\n {filename ? (\n <span className=\"text-xs font-medium text-(--text-secondary) font-mono\">\n {filename}\n </span>\n ) : (\n <span className=\"badge text-xs\">{displayLanguage}</span>\n )}\n </div>\n <div className=\"flex items-center gap-1.5\">\n {onEdit && (\n <button onClick={handleEdit} className={cn(btnBase, \"text-(--text-tertiary)\")}>\n <Edit3 className=\"w-3.5 h-3.5\" />\n {t(\"edit\", \"Edit\")}\n </button>\n )}\n <button onClick={handleCopy} className={btnBase}>\n {copied ? (\n <>\n <Check className=\"w-3.5 h-3.5 text-(--success)\" />\n <span className=\"text-(--success)\">{t(\"copied\", \"Copied\")}</span>\n </>\n ) : (\n <>\n <Copy className=\"w-3.5 h-3.5 text-(--text-tertiary)\" />\n <span className=\"text-(--text-tertiary)\">{t(\"copy\", \"Copy\")}</span>\n </>\n )}\n </button>\n </div>\n </div>\n\n <div\n className={cn(\n \"overflow-x-auto overflow-y-auto p-4 max-h-100 bg-(--bg-base)\",\n showLineNumbers && \"code-with-line-numbers\",\n )}\n >\n {isLoading ? (\n <pre className=\"text-sm font-mono\">\n <code>{code}</code>\n </pre>\n ) : (\n <div\n className=\"shiki-wrapper text-sm [&_pre]:bg-transparent! [&_code]:bg-transparent!\"\n dangerouslySetInnerHTML={{ __html: highlightedCode }}\n />\n )}\n </div>\n </div>\n );\n}\n\n/** Inline code (`` `code` ``) — used by the markdown renderer. */\nexport function InlineCode({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) {\n return (\n <code\n className={cn(\n \"px-1.5 py-0.5 mx-0.5 rounded text-sm font-mono\",\n \"bg-(--accent-subtle) text-(--text-primary) border border-(--border-hairline)\",\n \"wrap-break-word\",\n className,\n )}\n >\n {children}\n </code>\n );\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { useContentT } from \"./use-content-t\";\nimport { ImageLightbox } from \"./image-lightbox\";\n\nexport interface MermaidDiagramProps {\n chart: string;\n className?: string;\n /** Click the diagram to open a full-screen zoomable view. @defaultValue true */\n enableZoom?: boolean;\n}\n\nlet mermaidSeq = 0;\n\n// Diagram types mermaid's `look: \"handDrawn\"` does NOT roughen — these render\n// perfectly straight, so we post-process them ourselves (roughenSvg). Everything\n// else (flowchart, state, class, ER, requirement, C4, block…) is left to native\n// handDrawn, which looks better and must NOT be filtered on top.\nconst NEEDS_MANUAL_ROUGHENING = new Set([\n \"sequenceDiagram\",\n \"gantt\",\n \"pie\",\n \"journey\",\n \"gitGraph\",\n \"timeline\",\n \"mindmap\",\n \"quadrantChart\",\n \"xychart-beta\",\n \"sankey-beta\",\n \"packet-beta\",\n]);\n\n/** First diagram-type keyword of a chart, skipping frontmatter and `%%` directives. */\nfunction diagramType(chart: string): string {\n const lines = chart.trim().split(\"\\n\");\n let i = 0;\n if (lines[0]?.trim() === \"---\") {\n i = 1;\n while (i < lines.length && lines[i].trim() !== \"---\") i++;\n i++;\n }\n for (; i < lines.length; i++) {\n const l = lines[i].trim();\n if (!l || l.startsWith(\"%%\")) continue;\n return l.split(/[\\s:({]/)[0];\n }\n return \"\";\n}\n\nfunction needsManualRoughening(chart: string): boolean {\n return NEEDS_MANUAL_ROUGHENING.has(diagramType(chart));\n}\n\n/**\n * Give EVERY diagram a hand-drawn (Excalidraw-like) feel. Mermaid's native\n * `look: \"handDrawn\"` only roughens some diagram types (flowchart, state, class,\n * ER) and leaves sequence / gantt / pie / journey perfectly straight. So we also\n * inject an SVG turbulence-displacement filter and apply it to the stroke/shape\n * elements only — never `<text>` — so lines and boxes wobble like a sketch while\n * labels stay crisp. Scoped to this diagram's id so filters never leak across\n * diagrams, and self-contained (ships in the SVG) so it works in any host.\n */\nfunction roughenSvg(svg: string, id: string): string {\n // The filter region must be in userSpaceOnUse: thin `<line>`/lifeline elements\n // have a zero-area bounding box, so an objectBoundingBox region collapses and\n // they render blank. Derive a tight whole-diagram region from the viewBox.\n const vb = svg.match(/viewBox=\"([-\\d.]+)\\s+([-\\d.]+)\\s+([-\\d.]+)\\s+([-\\d.]+)\"/);\n if (!vb) return svg;\n const [, mx, my, w, h] = vb.map(Number) as unknown as number[];\n const pad = 12;\n const fid = `${id}-rough`;\n const defs =\n `<defs><filter id=\"${fid}\" filterUnits=\"userSpaceOnUse\" primitiveUnits=\"userSpaceOnUse\" ` +\n `x=\"${mx - pad}\" y=\"${my - pad}\" width=\"${w + pad * 2}\" height=\"${h + pad * 2}\">` +\n `<feTurbulence type=\"fractalNoise\" baseFrequency=\"0.014\" numOctaves=\"2\" seed=\"7\" result=\"n\"/>` +\n `<feDisplacementMap in=\"SourceGraphic\" in2=\"n\" scale=\"2.4\" xChannelSelector=\"R\" yChannelSelector=\"G\"/>` +\n `</filter></defs>` +\n `<style>` +\n `#${id} path,#${id} rect,#${id} circle,#${id} ellipse,#${id} line,#${id} polygon,#${id} polyline{filter:url(#${fid})}` +\n `#${id} text,#${id} tspan{filter:none}` +\n `</style>`;\n // Insert right after the opening <svg …> tag.\n return svg.replace(/(<svg\\b[^>]*>)/, `$1${defs}`);\n}\n\n/**\n * Render a Mermaid diagram (flowchart, sequence, gantt, …). The `mermaid`\n * library is loaded on demand the first time a diagram renders, so it never\n * ships in the initial bundle. Re-themes automatically for light/dark.\n */\nexport function MermaidDiagram({\n chart,\n className,\n enableZoom = true,\n}: MermaidDiagramProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const [svg, setSvg] = useState<string>(\"\");\n const [error, setError] = useState<string>(\"\");\n const [isLoading, setIsLoading] = useState(true);\n const [themeTick, setThemeTick] = useState(0);\n const [zoomOpen, setZoomOpen] = useState(false);\n const t = useContentT();\n\n useEffect(() => {\n let cancelled = false;\n\n async function renderDiagram() {\n setIsLoading(true);\n setError(\"\");\n\n // Fresh id per attempt — reusing an id across re-renders (e.g. the\n // theme observer firing) can make mermaid v11's render() hang on the\n // stale temp element it left in the DOM.\n const diagramId = `yunui-mermaid-${(mermaidSeq += 1)}`;\n\n try {\n const mermaid = (await import(\"mermaid\")).default;\n const isDark =\n typeof document !== \"undefined\" &&\n document.documentElement.classList.contains(\"dark\");\n\n mermaid.initialize({\n startOnLoad: false,\n theme: isDark ? \"dark\" : \"default\",\n // Native rough.js hand-drawn look — clean output for the types it\n // supports (flowchart, state, class, ER, requirement, C4, block…).\n look: \"handDrawn\",\n handDrawnSeed: 1,\n securityLevel: \"loose\",\n fontFamily: '\"Comic Sans MS\", \"Segoe Print\", ui-rounded, system-ui, sans-serif',\n flowchart: { curve: \"basis\", padding: 20 },\n sequence: { diagramMarginX: 20, diagramMarginY: 20 },\n gantt: { barHeight: 20, barGap: 4 },\n });\n\n const { svg: renderedSvg } = await mermaid.render(diagramId, chart.trim());\n\n if (!cancelled) {\n // Native `handDrawn` already roughens the supported types cleanly;\n // applying our displacement filter on top would double-distort them\n // (tear fills off borders). Only roughen the types mermaid leaves\n // perfectly straight, so EVERY diagram ends up hand-drawn.\n setSvg(\n needsManualRoughening(chart)\n ? roughenSvg(renderedSvg, diagramId)\n : renderedSvg,\n );\n setIsLoading(false);\n }\n } catch (err) {\n if (!cancelled) {\n setError(\n err instanceof Error\n ? err.message\n : t(\"diagramRenderFailed\", \"Failed to render diagram\"),\n );\n setIsLoading(false);\n }\n }\n }\n\n renderDiagram();\n\n return () => {\n cancelled = true;\n };\n // `t` is intentionally omitted: it's only read in the catch fallback, and a\n // host adapter that returns a fresh translator each render would otherwise\n // retrigger this effect endlessly.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [chart, themeTick]);\n\n // Re-render when the light/dark class on <html> changes.\n useEffect(() => {\n if (typeof document === \"undefined\") return;\n const observer = new MutationObserver(() => setThemeTick((n) => n + 1));\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n return () => observer.disconnect();\n }, []);\n\n if (error) {\n return (\n <div\n className={cn(\n \"my-4 p-4 rounded-xl border bg-error-soft border-error-soft\",\n className,\n )}\n >\n <div className=\"flex items-start gap-2\">\n <span className=\"text-error\">⚠️</span>\n <div>\n <p className=\"text-sm font-medium text-error\">\n {t(\"mermaidError\", \"Diagram error\")}\n </p>\n <p className=\"text-xs text-(--text-tertiary) mt-1\">{error}</p>\n <details className=\"mt-2\">\n <summary className=\"text-xs text-(--text-tertiary) cursor-pointer hover:text-(--text-primary)\">\n {t(\"viewSource\", \"View source\")}\n </summary>\n <pre className=\"mt-2 p-2 bg-(--bg-elevated) rounded text-xs overflow-auto\">\n {chart}\n </pre>\n </details>\n </div>\n </div>\n </div>\n );\n }\n\n if (isLoading) {\n return (\n <div\n className={cn(\n \"card my-4 p-8 flex items-center justify-center\",\n className,\n )}\n >\n <div className=\"flex items-center gap-2 text-(--text-tertiary)\">\n <div className=\"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin\" />\n <span className=\"text-sm\">{t(\"renderingDiagram\", \"Rendering diagram…\")}</span>\n </div>\n </div>\n );\n }\n\n return (\n <>\n <div\n ref={containerRef}\n onClick={enableZoom ? () => setZoomOpen(true) : undefined}\n role={enableZoom ? \"button\" : undefined}\n aria-label={enableZoom ? t(\"zoomDiagram\", \"Zoom diagram\") : undefined}\n className={cn(\n \"card my-4 p-4 overflow-x-auto\",\n \"flex items-center justify-center\",\n \"[&_svg]:max-w-full [&_svg]:h-auto\",\n enableZoom && \"cursor-zoom-in\",\n className,\n )}\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n {enableZoom && (\n <ImageLightbox isOpen={zoomOpen} onClose={() => setZoomOpen(false)}>\n {/* Theme-matched panel so a light-theme diagram (dark strokes) stays\n readable on the lightbox's dark backdrop, and vice-versa. */}\n <div\n className=\"bg-(--bg-card) rounded-2xl p-6 shadow-2xl border border-white/10 w-[86vw] max-w-[1100px] [&_svg]:!max-w-none [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-h-[80vh]\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n </ImageLightbox>\n )}\n </>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n Info,\n Lightbulb,\n AlertTriangle,\n AlertCircle,\n XOctagon,\n CheckCircle2,\n} from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { Alert } from \"../primitives\";\nimport { useContentT } from \"./use-content-t\";\n\nexport type CalloutType =\n | \"note\"\n | \"tip\"\n | \"important\"\n | \"warning\"\n | \"caution\"\n | \"success\";\n\nexport interface CalloutBlockProps {\n type: CalloutType;\n title?: string;\n children: React.ReactNode;\n className?: string;\n}\n\n// Each callout tone maps onto a YunUI Alert variant + a tone-specific icon, so a\n// callout IS an Alert — same soft-tint box, border, icon and title treatment —\n// rather than a look-alike. \"important\" uses the accent tone.\nconst config: Record<\n CalloutType,\n {\n variant: \"info\" | \"success\" | \"warning\" | \"error\" | \"accent\";\n icon: React.ComponentType<{ className?: string }>;\n }\n> = {\n note: { variant: \"info\", icon: Info },\n tip: { variant: \"success\", icon: Lightbulb },\n important: { variant: \"accent\", icon: AlertCircle },\n warning: { variant: \"warning\", icon: AlertTriangle },\n caution: { variant: \"error\", icon: XOctagon },\n success: { variant: \"success\", icon: CheckCircle2 },\n};\n\nconst defaultTitles: Record<CalloutType, string> = {\n note: \"Note\",\n tip: \"Tip\",\n important: \"Important\",\n warning: \"Warning\",\n caution: \"Caution\",\n success: \"Success\",\n};\n\n/**\n * Callout box (note / tip / important / warning / caution / success). Composes\n * YunUI's `Alert` primitive, so it shares the exact soft-tint panel, all-side\n * soft border, leading semantic icon and title of every other Alert in the\n * system — the callout is literally an Alert, not a re-implementation.\n */\nexport function CalloutBlock({\n type,\n title,\n children,\n className,\n}: CalloutBlockProps) {\n const t = useContentT();\n const c = config[type] || config.note;\n const Icon = c.icon;\n const displayTitle = title || t(type, defaultTitles[type] || defaultTitles.note);\n\n return (\n <Alert\n variant={c.variant}\n title={displayTitle}\n icon={<Icon className=\"h-4 w-4\" />}\n // `not-prose` so the host MarkdownRenderer's prose styles don't inject\n // margins into the Alert's title/body paragraphs (which shoved the title\n // away from the icon). The callout owns its own spacing.\n className={cn(\"my-4 not-prose\", className)}\n >\n <div className=\"[&>p]:my-1 [&>p:first-child]:mt-0 [&>p:last-child]:mb-0\">\n {children}\n </div>\n </Alert>\n );\n}\n\n/**\n * Parse a GitHub-style callout marker (`[!NOTE] optional title`) from the first\n * line of a blockquote. Returns `{ type: null }` when the line isn't a callout.\n */\nexport function parseCalloutType(text: string): {\n type: CalloutType | null;\n title: string | null;\n} {\n const match = text.match(\n /^\\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION|SUCCESS)\\](?:\\s+(.+))?$/i,\n );\n if (match) {\n return {\n type: match[1].toLowerCase() as CalloutType,\n title: match[2] || null,\n };\n }\n return { type: null, title: null };\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useState, useRef, useEffect } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { useContentT } from \"./use-content-t\";\nimport { ImageLightbox } from \"./image-lightbox\";\n\nexport interface ContentImageProps\n extends React.ImgHTMLAttributes<HTMLImageElement> {\n /** Open a zoom/rotate/download lightbox on click. @defaultValue true */\n enableLightbox?: boolean;\n}\n\n/**\n * Lazy, flicker-free image for rendered content. Defers loading until the image\n * scrolls near the viewport (IntersectionObserver), fades in on load, shows a\n * spinner placeholder, and (by default) opens a full-screen lightbox on click.\n *\n * URLs are used as-is — resolve/rewrite them upstream (e.g. via the markdown\n * renderer's `urlTransform`).\n */\nexport const ContentImage = React.memo(function ContentImage({\n enableLightbox = true,\n className,\n alt = \"\",\n src,\n onError,\n onLoad,\n ...rest\n}: ContentImageProps) {\n const [loaded, setLoaded] = useState(false);\n const [failed, setFailed] = useState(false);\n const [lightboxOpen, setLightboxOpen] = useState(false);\n const imgRef = useRef<HTMLImageElement>(null);\n const wrapperRef = useRef<HTMLSpanElement>(null);\n const t = useContentT();\n\n const srcString = typeof src === \"string\" ? src : \"\";\n const valid = srcString && srcString !== \"#\" && srcString !== \"undefined\" && srcString !== \"null\";\n\n useEffect(() => {\n if (!wrapperRef.current || !valid) return;\n\n // Root the observer at the nearest scrollable content container, but only\n // if it actually contains this image. A page can have a `data-scroll-container`\n // (e.g. a ChatMessageList) that this image sits *outside* of — rooting to it\n // then means the image never intersects and stays stuck on the spinner.\n // Fall back to the viewport (`null`) in that case.\n const container = document.querySelector('[data-scroll-container=\"true\"]');\n const root = container && container.contains(wrapperRef.current) ? container : null;\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting && imgRef.current) {\n imgRef.current.src = srcString;\n observer.unobserve(entry.target);\n }\n });\n },\n {\n root,\n rootMargin: \"300px 0px\",\n threshold: 0.01,\n },\n );\n\n observer.observe(wrapperRef.current);\n return () => observer.disconnect();\n }, [srcString, valid]);\n\n if (!valid) return null;\n\n if (failed) {\n return (\n <span className=\"inline-block\">\n <span className=\"bg-error-soft px-3 py-2 rounded-xl border border-error-soft text-center\">\n <span className=\"text-error text-sm\">\n 🖼️ {t(\"imageLoadingFailed\", \"Image failed to load\")}\n </span>\n </span>\n </span>\n );\n }\n\n return (\n <span\n ref={wrapperRef}\n className=\"inline-block max-w-full overflow-hidden relative\"\n style={{\n minHeight: loaded ? \"auto\" : \"200px\",\n minWidth: loaded ? \"auto\" : \"200px\",\n }}\n >\n {!loaded && (\n <span className=\"absolute inset-0 flex items-center justify-center bg-(--bg-elevated) rounded-xl\">\n <span className=\"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin block\" />\n </span>\n )}\n {/* eslint-disable-next-line @next/next/no-img-element */}\n <img\n ref={imgRef}\n alt={alt}\n className={cn(\n \"max-w-full h-auto rounded-xl shadow-sm border border-(--border-hairline) transition-opacity duration-300\",\n loaded ? \"opacity-100\" : \"opacity-0\",\n enableLightbox && loaded && \"cursor-zoom-in\",\n className,\n )}\n style={{ maxHeight: \"80vh\" }}\n onLoad={(e) => {\n setLoaded(true);\n onLoad?.(e);\n }}\n onError={(e) => {\n setFailed(true);\n onError?.(e);\n }}\n onClick={enableLightbox ? () => setLightboxOpen(true) : undefined}\n {...rest}\n />\n {enableLightbox && (\n <ImageLightbox\n src={srcString}\n alt={alt}\n isOpen={lightboxOpen}\n onClose={() => setLightboxOpen(false)}\n />\n )}\n </span>\n );\n});\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useMemo, useState } from \"react\";\nimport ReactMarkdown, { type Components } from \"react-markdown\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkMath from \"remark-math\";\nimport rehypeRaw from \"rehype-raw\";\nimport rehypeKatex from \"rehype-katex\";\nimport rehypeSlug from \"rehype-slug\";\nimport { Link2, ExternalLink } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { useContentT } from \"./use-content-t\";\nimport { CodeBlock, InlineCode, type CodeBlockEditPayload } from \"./code-block\";\nimport { MermaidDiagram } from \"./mermaid-diagram\";\nimport { CalloutBlock, parseCalloutType } from \"./callout-block\";\nimport { ContentImage } from \"./content-image\";\n\nexport interface MarkdownRendererProps {\n content: string;\n className?: string;\n /**\n * Rewrite image/link URLs before rendering (e.g. prefix a backend host or\n * proxy). Defaults to identity.\n */\n urlTransform?: (url: string) => string;\n /**\n * When provided, code blocks show an \"Edit\" button that calls this with the\n * code payload (e.g. open it in an editor). Hidden if unset.\n */\n onCodeEdit?: (payload: CodeBlockEditPayload) => void;\n}\n\n/**\n * Full markdown renderer: GFM (tables, task lists, strikethrough), math (KaTeX),\n * Shiki code blocks, Mermaid diagrams, GitHub-style callouts, heading anchors,\n * and lazy, zoomable images. Requires `katex/dist/katex.min.css` and the YunUI\n * content styles to be imported by the host app.\n */\nexport function MarkdownRenderer({\n content,\n className,\n urlTransform,\n onCodeEdit,\n}: MarkdownRendererProps) {\n const components: Components = useMemo(\n () => ({\n p: ({ children }) => (\n <div className=\"mb-4 last:mb-0 leading-relaxed\">{children}</div>\n ),\n\n h1: ({ children, id }) => (\n <h1\n id={id}\n className=\"group flex items-center gap-2 text-2xl font-bold mt-8 mb-4 first:mt-0 scroll-mt-20\"\n >\n {children}\n {id && <HeadingAnchor id={id} />}\n </h1>\n ),\n h2: ({ children, id }) => (\n <h2\n id={id}\n className=\"group flex items-center gap-2 text-xl font-bold mt-6 mb-3 scroll-mt-20\"\n >\n {children}\n {id && <HeadingAnchor id={id} />}\n </h2>\n ),\n h3: ({ children, id }) => (\n <h3\n id={id}\n className=\"group flex items-center gap-2 text-lg font-semibold mt-5 mb-2 scroll-mt-20\"\n >\n {children}\n {id && <HeadingAnchor id={id} />}\n </h3>\n ),\n h4: ({ children, id }) => (\n <h4\n id={id}\n className=\"group flex items-center gap-2 text-base font-semibold mt-4 mb-2 scroll-mt-20\"\n >\n {children}\n {id && <HeadingAnchor id={id} />}\n </h4>\n ),\n h5: ({ children, id }) => (\n <h5\n id={id}\n className=\"group flex items-center gap-2 text-sm font-semibold mt-3 mb-1 scroll-mt-20\"\n >\n {children}\n {id && <HeadingAnchor id={id} />}\n </h5>\n ),\n h6: ({ children, id }) => (\n <h6\n id={id}\n className=\"group flex items-center gap-2 text-sm font-medium mt-3 mb-1 scroll-mt-20\"\n >\n {children}\n {id && <HeadingAnchor id={id} />}\n </h6>\n ),\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n code: ({ children, className: codeClass }: any) => {\n const match = /language-(\\w+)/.exec(codeClass || \"\");\n const language = match ? match[1] : \"\";\n const codeString = String(children).replace(/\\n$/, \"\");\n\n if (language === \"mermaid\") {\n return <MermaidDiagram chart={codeString} />;\n }\n\n if (codeClass || codeString.includes(\"\\n\")) {\n const showLineNumbers = codeClass?.includes(\"showLineNumbers\");\n const highlightMatch = codeClass?.match(/\\{([^}]+)\\}/);\n const highlightLines = highlightMatch\n ? parseLineHighlights(highlightMatch[1])\n : [];\n\n return (\n <CodeBlock\n language={language}\n showLineNumbers={showLineNumbers}\n highlightLines={highlightLines}\n onEdit={onCodeEdit}\n >\n {codeString}\n </CodeBlock>\n );\n }\n\n return <InlineCode>{children}</InlineCode>;\n },\n\n pre: ({ children }) => <>{children}</>,\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n img: ({ node, ...props }: any) => <ContentImage {...props} />,\n\n a: ({ href, children, ...props }) => {\n const host =\n typeof window !== \"undefined\" ? window.location.host : \"\";\n const isExternal = href?.startsWith(\"http\") && !href?.includes(host);\n\n return (\n <a\n href={href}\n target={isExternal ? \"_blank\" : undefined}\n rel={isExternal ? \"noopener noreferrer\" : undefined}\n className=\"text-(--text-primary) underline decoration-(--border-default) underline-offset-2 hover:decoration-(--text-primary) inline-flex items-center gap-0.5\"\n {...props}\n >\n {children}\n {isExternal && (\n <ExternalLink className=\"w-3 h-3 inline-block ml-0.5\" />\n )}\n </a>\n );\n },\n\n blockquote: ({ children }) => {\n const childArray = React.Children.toArray(children);\n // react-markdown emits whitespace (\"\\n\") text nodes between blocks, so the\n // first child is often NOT the paragraph — find the first real element.\n const firstEl = childArray.find((c) => React.isValidElement(c));\n\n if (React.isValidElement<{ children?: React.ReactNode }>(firstEl)) {\n const paraKids = React.Children.toArray(firstEl.props.children);\n // The callout marker lives in the leading text run, before the first\n // newline (GitHub puts `[!TYPE]` on its own line inside the quote).\n const leadStr = typeof paraKids[0] === \"string\" ? paraKids[0] : \"\";\n const { type: calloutType, title } = parseCalloutType(\n leadStr.split(\"\\n\")[0].trim(),\n );\n\n if (calloutType) {\n // Keep every non-marker node (inline code, emphasis, links…) intact:\n // strip only the marker's line from the leading string, preserve the rest.\n const rest = leadStr.includes(\"\\n\")\n ? leadStr.slice(leadStr.indexOf(\"\\n\") + 1)\n : \"\";\n const body = [rest, ...paraKids.slice(1)];\n const hasFirstPara = rest !== \"\" || paraKids.length > 1;\n // Any further paragraphs/blocks in the quote (marker-only first line case).\n const otherBlocks = childArray.filter(\n (c) => c !== firstEl && React.isValidElement(c),\n );\n\n return (\n <CalloutBlock type={calloutType} title={title || undefined}>\n {hasFirstPara && <p>{body}</p>}\n {otherBlocks}\n </CalloutBlock>\n );\n }\n }\n\n return (\n <blockquote className=\"border-l-4 border-(--border-default) pl-4 my-4 italic text-(--text-secondary)\">\n {children}\n </blockquote>\n );\n },\n\n table: ({ children }) => (\n <div className=\"card my-4 overflow-x-auto\">\n <table className=\"min-w-full divide-y divide-(--border-hairline)\">{children}</table>\n </div>\n ),\n thead: ({ children }) => <thead className=\"bg-(--bg-elevated)\">{children}</thead>,\n th: ({ children }) => (\n <th className=\"px-4 py-2 text-left text-sm font-semibold text-(--text-primary)\">\n {children}\n </th>\n ),\n td: ({ children }) => (\n <td className=\"px-4 py-2 text-sm border-t border-(--border-hairline)\">{children}</td>\n ),\n\n ul: ({ children }) => (\n <ul className=\"my-3 ml-6 list-disc space-y-1 [&>li]:pl-1\">{children}</ul>\n ),\n ol: ({ children }) => (\n <ol className=\"my-3 ml-6 list-decimal space-y-1 [&>li]:pl-1\">\n {children}\n </ol>\n ),\n li: ({ children, className: liClass }) => {\n const isTaskItem = liClass?.includes(\"task-list-item\");\n return (\n <li\n className={cn(\n \"leading-relaxed\",\n isTaskItem && \"list-none -ml-6 flex items-start gap-2\",\n )}\n >\n {children}\n </li>\n );\n },\n\n input: ({ type, checked, ...props }) => {\n if (type === \"checkbox\") {\n return (\n <input\n type=\"checkbox\"\n checked={checked}\n readOnly\n // `accent-*` colours the native checkbox tick (text-* does not).\n className=\"mt-1 h-4 w-4 rounded border-(--border-hairline) accent-(--accent) focus:ring-ring\"\n {...props}\n />\n );\n }\n return <input type={type} {...props} />;\n },\n\n hr: () => <hr className=\"my-6 border-t border-(--border-hairline)\" />,\n\n kbd: ({ children }) => (\n <kbd className=\"px-1.5 py-0.5 text-xs font-mono bg-(--bg-elevated) border border-(--border-default) rounded shadow-sm\">\n {children}\n </kbd>\n ),\n\n mark: ({ children }) => (\n <mark className=\"bg-warning-soft text-(--text-primary) px-0.5 rounded\">\n {children}\n </mark>\n ),\n\n details: ({ children }) => (\n <details className=\"card my-4 overflow-hidden group\">\n {children}\n </details>\n ),\n summary: ({ children }) => (\n <summary className=\"px-4 py-3 cursor-pointer select-none font-medium hover:bg-(--accent-subtle) transition-colors\">\n {children}\n </summary>\n ),\n\n abbr: ({ children, title }) => (\n <abbr\n title={title}\n className=\"border-b border-dotted border-(--text-tertiary) cursor-help\"\n >\n {children}\n </abbr>\n ),\n\n sub: ({ children }) => <sub className=\"text-xs\">{children}</sub>,\n sup: ({ children }) => <sup className=\"text-xs\">{children}</sup>,\n\n del: ({ children }) => (\n <del className=\"text-(--text-tertiary) line-through\">{children}</del>\n ),\n }),\n [onCodeEdit],\n );\n\n return (\n <div\n className={cn(\n // NOT prose. This renderer styles every element itself via the component\n // map below, so Tailwind Typography would double-style everything — the\n // table got a second frame + 28px dead-space margin, callout titles got\n // shoved off their icon, and code blocks looked different inside prose vs\n // out. `not-prose` makes our mappings the single source of truth, even\n // when a host app wraps the output in `.prose`.\n \"not-prose text-sm leading-relaxed text-(--text-primary)\",\n className,\n )}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm, remarkMath]}\n rehypePlugins={[rehypeRaw, rehypeKatex, rehypeSlug]}\n urlTransform={urlTransform}\n components={components}\n >\n {content}\n </ReactMarkdown>\n </div>\n );\n}\n\nfunction HeadingAnchor({ id }: { id: string }) {\n const [copied, setCopied] = useState(false);\n const t = useContentT();\n\n const handleClick = async (e: React.MouseEvent) => {\n e.preventDefault();\n const url = `${window.location.origin}${window.location.pathname}#${id}`;\n try {\n await navigator.clipboard.writeText(url);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n } catch {\n window.location.hash = id;\n }\n };\n\n return (\n <a\n href={`#${id}`}\n onClick={handleClick}\n className={cn(\n \"opacity-0 group-hover:opacity-100 transition-opacity\",\n \"text-(--text-tertiary) hover:text-(--text-primary)\",\n copied && \"text-success\",\n )}\n aria-label={t(\"linkToHeading\", \"Copy link to this heading\")}\n >\n <Link2 className=\"w-4 h-4\" />\n </a>\n );\n}\n\nfunction parseLineHighlights(input: string): number[] {\n const lines: number[] = [];\n for (const part of input.split(\",\")) {\n const trimmed = part.trim();\n if (trimmed.includes(\"-\")) {\n const [start, end] = trimmed.split(\"-\").map((n) => parseInt(n.trim(), 10));\n if (!isNaN(start) && !isNaN(end)) {\n for (let i = start; i <= end; i++) lines.push(i);\n }\n } else {\n const num = parseInt(trimmed, 10);\n if (!isNaN(num)) lines.push(num);\n }\n }\n return lines;\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport katex from \"katex\";\nimport { cn } from \"../lib/cn\";\nimport { useContentT } from \"./use-content-t\";\n\nexport interface MathRendererProps {\n math: string;\n block?: boolean;\n className?: string;\n}\n\n/**\n * Render a LaTeX expression with KaTeX. Requires `katex/dist/katex.min.css` to\n * be imported by the host app.\n */\nexport function MathRenderer({ math, block = false, className }: MathRendererProps) {\n const containerRef = useRef<HTMLSpanElement>(null);\n const [error, setError] = useState<string>(\"\");\n const t = useContentT();\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n try {\n katex.render(math, containerRef.current, {\n displayMode: block,\n throwOnError: false,\n errorColor: \"#cc0000\",\n strict: false,\n trust: true,\n macros: {\n \"\\\\RR\": \"\\\\mathbb{R}\",\n \"\\\\NN\": \"\\\\mathbb{N}\",\n \"\\\\ZZ\": \"\\\\mathbb{Z}\",\n \"\\\\QQ\": \"\\\\mathbb{Q}\",\n \"\\\\CC\": \"\\\\mathbb{C}\",\n },\n });\n setError(\"\");\n } catch (err) {\n setError(\n err instanceof Error\n ? err.message\n : t(\"formulaRenderFailed\", \"Formula render failed\"),\n );\n }\n // `t` omitted on purpose — only read in the catch fallback; an unstable\n // host translator would otherwise retrigger this effect every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [math, block]);\n\n if (error) {\n return (\n <span\n className={cn(\n \"text-error bg-error-soft px-1 rounded\",\n block ? \"block my-2 p-2 text-center\" : \"inline\",\n className,\n )}\n >\n <span className=\"text-xs\">⚠️ {error}</span>\n </span>\n );\n }\n\n if (block) {\n return (\n <div\n className={cn(\n \"my-4 py-4 overflow-x-auto text-center\",\n \"[&_.katex]:text-lg\",\n className,\n )}\n >\n <span ref={containerRef} />\n </div>\n );\n }\n\n return (\n <span ref={containerRef} className={cn(\"inline-block align-middle\", className)} />\n );\n}\n\n/** Inline math (`$…$`) — used by the markdown renderer's math plugin. */\nexport function InlineMath({ value }: { value: string }) {\n return <MathRenderer math={value} block={false} />;\n}\n\n/** Block/display math (`$$…$$`) — used by the markdown renderer's math plugin. */\nexport function BlockMath({ value }: { value: string }) {\n return <MathRenderer math={value} block />;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
|
12
12
|
import { LucideIcon } from 'lucide-react';
|
|
13
13
|
import * as Primitive from '@radix-ui/react-collapsible';
|
|
14
14
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
15
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
15
16
|
import { ClassValue } from 'clsx';
|
|
16
17
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
17
18
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
@@ -525,11 +526,25 @@ interface CardProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
525
526
|
}
|
|
526
527
|
/** Surface container rendering the canonical `.card` style. */
|
|
527
528
|
declare const Card: React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
529
|
+
/** Header region of a Card — title + description live here. */
|
|
530
|
+
declare const CardHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
531
|
+
/** Card title (renders an <h3>). */
|
|
532
|
+
declare const CardTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLHeadingElement> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
533
|
+
/** Muted supporting text under the title. */
|
|
534
|
+
declare const CardDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
535
|
+
/** Main content region of a Card. */
|
|
536
|
+
declare const CardContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
537
|
+
/** Footer region of a Card (actions, meta). */
|
|
538
|
+
declare const CardFooter: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
528
539
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
529
|
-
/**
|
|
530
|
-
|
|
540
|
+
/**
|
|
541
|
+
* Semantic colors: `default` (neutral), `success`, `warning`, `error`, `info`.
|
|
542
|
+
* Plus structural variants for shadcn-style call sites: `secondary`,
|
|
543
|
+
* `outline`, and `destructive` (alias of `error`).
|
|
544
|
+
*/
|
|
545
|
+
variant?: "default" | "success" | "warning" | "error" | "info" | "secondary" | "outline" | "destructive";
|
|
531
546
|
}
|
|
532
|
-
/** Small inline pill for status/labels, with semantic
|
|
547
|
+
/** Small inline pill for status/labels, with semantic + structural variants. */
|
|
533
548
|
declare function Badge({ className, variant, ...props }: BadgeProps): React$1.JSX.Element;
|
|
534
549
|
interface SeparatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
535
550
|
orientation?: "horizontal" | "vertical";
|
|
@@ -539,7 +554,7 @@ interface SeparatorProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
|
539
554
|
/** A thin divider line. Horizontal by default; set `orientation="vertical"` inside a flex row. */
|
|
540
555
|
declare function Separator({ className, orientation, decorative, ...props }: SeparatorProps): React$1.JSX.Element;
|
|
541
556
|
interface AlertProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
542
|
-
variant?: "info" | "success" | "warning" | "error";
|
|
557
|
+
variant?: "info" | "success" | "warning" | "error" | "accent";
|
|
543
558
|
/** Optional bold title above the body. */
|
|
544
559
|
title?: React$1.ReactNode;
|
|
545
560
|
/** Leading icon. Defaults to a variant-appropriate icon; pass `null` to hide. */
|
|
@@ -641,6 +656,14 @@ declare const SelectTrigger: React$1.ForwardRefExoticComponent<Omit<SelectPrimit
|
|
|
641
656
|
declare const SelectContent: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
642
657
|
/** A selectable option in the dropdown (shows a check when selected). */
|
|
643
658
|
declare const SelectItem: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
659
|
+
/** Non-selectable heading for a group of options. */
|
|
660
|
+
declare const SelectLabel: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
661
|
+
/** Divider between option groups. */
|
|
662
|
+
declare const SelectSeparator: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
663
|
+
/** Auto-scroll affordance shown at the top of a long, scrollable list. */
|
|
664
|
+
declare const SelectScrollUpButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
665
|
+
/** Auto-scroll affordance shown at the bottom of a long, scrollable list. */
|
|
666
|
+
declare const SelectScrollDownButton: React$1.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
644
667
|
/** Range slider with a track, filled range, and draggable thumb. */
|
|
645
668
|
declare const Slider: React$1.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React$1.RefAttributes<HTMLSpanElement>, "ref"> & React$1.RefAttributes<HTMLSpanElement>>;
|
|
646
669
|
/** Horizontal progress bar; `value` is the percent complete (0–100). */
|
|
@@ -931,6 +954,7 @@ declare const Popover: React$1.FC<PopoverPrimitive.PopoverProps>;
|
|
|
931
954
|
declare const PopoverTrigger: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
932
955
|
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
933
956
|
declare const PopoverClose: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
957
|
+
declare const PopoverAnchor: React$1.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
934
958
|
|
|
935
959
|
interface ThemeToggleProps {
|
|
936
960
|
/** Visual variant: `icon` (default, icon-only) or `pill`. */
|
|
@@ -943,6 +967,14 @@ interface ThemeToggleProps {
|
|
|
943
967
|
/** Theme switcher dropdown (light / dark / true-black / system) backed by next-themes. */
|
|
944
968
|
declare function ThemeToggle({ variant, align, className }: ThemeToggleProps): React$1.JSX.Element;
|
|
945
969
|
|
|
970
|
+
/**
|
|
971
|
+
* Styled, cross-browser custom scrollbar around any overflowing content.
|
|
972
|
+
* Wraps Radix ScrollArea; renders a vertical `ScrollBar` by default.
|
|
973
|
+
*/
|
|
974
|
+
declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
975
|
+
/** The draggable scrollbar thumb + track. Use `orientation="horizontal"` for an x-axis bar. */
|
|
976
|
+
declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
977
|
+
|
|
946
978
|
interface SwitchProps {
|
|
947
979
|
/** Whether the switch is on (controlled). */
|
|
948
980
|
checked: boolean;
|
|
@@ -973,6 +1005,152 @@ interface AnimatedNumberProps {
|
|
|
973
1005
|
*/
|
|
974
1006
|
declare function AnimatedNumber({ value, suffix, decimals }: AnimatedNumberProps): React$1.JSX.Element;
|
|
975
1007
|
|
|
1008
|
+
type SparklineTone = "accent" | "success" | "warning" | "error" | "info" | "neutral";
|
|
1009
|
+
interface SparklineProps extends Omit<React.SVGProps<SVGSVGElement>, "color"> {
|
|
1010
|
+
/** The series to plot, oldest → newest. Fewer than 2 points renders nothing. */
|
|
1011
|
+
data: number[];
|
|
1012
|
+
/** Intrinsic viewBox width; the SVG still scales to its container. */
|
|
1013
|
+
width?: number;
|
|
1014
|
+
/** Intrinsic viewBox height. */
|
|
1015
|
+
height?: number;
|
|
1016
|
+
/** Semantic stroke color. Ignored when `color` is set. */
|
|
1017
|
+
tone?: SparklineTone;
|
|
1018
|
+
/** Explicit CSS color for the stroke (and area fill), overriding `tone`. */
|
|
1019
|
+
color?: string;
|
|
1020
|
+
/** Stroke width in viewBox units. */
|
|
1021
|
+
strokeWidth?: number;
|
|
1022
|
+
/** Fill the area under the line with a vertical gradient of the stroke color. */
|
|
1023
|
+
area?: boolean;
|
|
1024
|
+
/** Lower bound of the value axis. Defaults to the data minimum. */
|
|
1025
|
+
min?: number;
|
|
1026
|
+
/** Upper bound of the value axis. Defaults to the data maximum. */
|
|
1027
|
+
max?: number;
|
|
1028
|
+
className?: string;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* A minimal inline line chart. Give it a rolling window of numbers and it draws
|
|
1032
|
+
* a smooth, container-width sparkline; set `area` for a gradient fill.
|
|
1033
|
+
*/
|
|
1034
|
+
declare function Sparkline({ data, width, height, tone, color, strokeWidth, area, min, max, className, ...props }: SparklineProps): React$1.JSX.Element;
|
|
1035
|
+
|
|
1036
|
+
type GaugeTone = "accent" | "success" | "warning" | "error" | "info" | "neutral";
|
|
1037
|
+
interface GaugeProps {
|
|
1038
|
+
/** Progress, 0–100 (clamped). */
|
|
1039
|
+
value: number;
|
|
1040
|
+
/** Diameter in px. */
|
|
1041
|
+
size?: number;
|
|
1042
|
+
/** Ring thickness in px. */
|
|
1043
|
+
thickness?: number;
|
|
1044
|
+
/** Semantic arc color. Ignored when `color` is set. */
|
|
1045
|
+
tone?: GaugeTone;
|
|
1046
|
+
/** Explicit CSS color for the arc, overriding `tone`. */
|
|
1047
|
+
color?: string;
|
|
1048
|
+
/** Center content. Defaults to the rounded percentage; pass `null` to hide. */
|
|
1049
|
+
label?: ReactNode;
|
|
1050
|
+
/** Start the arc from the top and sweep clockwise (default) or counter-clockwise. */
|
|
1051
|
+
counterClockwise?: boolean;
|
|
1052
|
+
className?: string;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* A circular percentage gauge. Feed it a `value` (0–100) and it fills the ring
|
|
1056
|
+
* proportionally; the center renders the value unless you pass a custom `label`.
|
|
1057
|
+
*/
|
|
1058
|
+
declare function Gauge({ value, size, thickness, tone, color, label, counterClockwise, className, }: GaugeProps): React$1.JSX.Element;
|
|
1059
|
+
|
|
1060
|
+
type SegmentTone = "accent" | "success" | "warning" | "error" | "info" | "neutral";
|
|
1061
|
+
interface BarSegment {
|
|
1062
|
+
/** Segment magnitude, in the same unit as `total`. */
|
|
1063
|
+
value: number;
|
|
1064
|
+
/** Semantic color. Ignored when `color` is set. */
|
|
1065
|
+
tone?: SegmentTone;
|
|
1066
|
+
/** Explicit CSS color, overriding `tone`. */
|
|
1067
|
+
color?: string;
|
|
1068
|
+
/** Legend label and segment title (tooltip). */
|
|
1069
|
+
label?: ReactNode;
|
|
1070
|
+
}
|
|
1071
|
+
interface SegmentedBarProps {
|
|
1072
|
+
/** The segments, drawn left → right. */
|
|
1073
|
+
segments: BarSegment[];
|
|
1074
|
+
/** Axis total. Defaults to the sum of segment values; the remainder shows as track. */
|
|
1075
|
+
total?: number;
|
|
1076
|
+
/** Bar thickness in px. */
|
|
1077
|
+
height?: number;
|
|
1078
|
+
/** Show a legend of segments with their values below the bar. */
|
|
1079
|
+
legend?: boolean;
|
|
1080
|
+
/** Format a segment value for the legend (e.g. bytes → "1.2 GB"). */
|
|
1081
|
+
formatValue?: (value: number) => ReactNode;
|
|
1082
|
+
className?: string;
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* A proportional multi-segment bar. Give it segments and (optionally) a `total`;
|
|
1086
|
+
* each segment takes a slice of the width, with any leftover shown as track.
|
|
1087
|
+
*/
|
|
1088
|
+
declare function SegmentedBar({ segments, total, height, legend, formatValue, className, }: SegmentedBarProps): React$1.JSX.Element;
|
|
1089
|
+
|
|
1090
|
+
interface FileDropzoneProps {
|
|
1091
|
+
/** Called with the selected/dropped files (already filtered to a File[]). */
|
|
1092
|
+
onFiles: (files: File[]) => void;
|
|
1093
|
+
/** `accept` attribute forwarded to the input (e.g. "image/*,.wav"). */
|
|
1094
|
+
accept?: string;
|
|
1095
|
+
/** Allow selecting more than one file. */
|
|
1096
|
+
multiple?: boolean;
|
|
1097
|
+
/** Disable interaction and dim the zone. */
|
|
1098
|
+
disabled?: boolean;
|
|
1099
|
+
/** Leading icon shown above the label (ignored when `children` is set). */
|
|
1100
|
+
icon?: ReactNode;
|
|
1101
|
+
/** Primary call-to-action text (ignored when `children` is set). */
|
|
1102
|
+
label?: ReactNode;
|
|
1103
|
+
/** Secondary hint under the label (e.g. "PNG, JPG up to 10MB"). */
|
|
1104
|
+
hint?: ReactNode;
|
|
1105
|
+
/** Replace the entire inner content. */
|
|
1106
|
+
children?: ReactNode;
|
|
1107
|
+
className?: string;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* A dashed drop target that accepts files by drag-and-drop or click. Reports
|
|
1111
|
+
* selections through `onFiles`; style it via `className` or replace its body
|
|
1112
|
+
* with `children`.
|
|
1113
|
+
*/
|
|
1114
|
+
declare function FileDropzone({ onFiles, accept, multiple, disabled, icon, label, hint, children, className, }: FileDropzoneProps): React$1.JSX.Element;
|
|
1115
|
+
|
|
1116
|
+
type AreaChartTone = "accent" | "success" | "warning" | "error" | "info" | "neutral";
|
|
1117
|
+
interface AreaChartPoint {
|
|
1118
|
+
/** The plotted value. */
|
|
1119
|
+
value: number;
|
|
1120
|
+
/** X-axis + tooltip label for this point (e.g. a formatted time). */
|
|
1121
|
+
label?: ReactNode;
|
|
1122
|
+
}
|
|
1123
|
+
interface AreaChartProps {
|
|
1124
|
+
/** The series, oldest → newest. Accepts plain numbers or `{ value, label }`. */
|
|
1125
|
+
data: Array<AreaChartPoint | number>;
|
|
1126
|
+
/** Semantic stroke/fill color. Ignored when `color` is set. */
|
|
1127
|
+
tone?: AreaChartTone;
|
|
1128
|
+
/** Explicit CSS color, overriding `tone`. */
|
|
1129
|
+
color?: string;
|
|
1130
|
+
/** Chart height in px (the width fills the container). */
|
|
1131
|
+
height?: number;
|
|
1132
|
+
/** Format a value for the tooltip (e.g. `(v) => "$" + v.toFixed(2)`). */
|
|
1133
|
+
formatValue?: (value: number) => ReactNode;
|
|
1134
|
+
/** Draw the dashed horizontal grid. */
|
|
1135
|
+
showGrid?: boolean;
|
|
1136
|
+
/** Enable the hover guide line + value tooltip. */
|
|
1137
|
+
showTooltip?: boolean;
|
|
1138
|
+
/** Render the x-axis labels below the chart (needs point `label`s). */
|
|
1139
|
+
showXAxis?: boolean;
|
|
1140
|
+
/** Line thickness. */
|
|
1141
|
+
strokeWidth?: number;
|
|
1142
|
+
/** Accessible name for the chart. */
|
|
1143
|
+
ariaLabel?: string;
|
|
1144
|
+
/** Text shown when there are fewer than two points. @defaultValue "No data" */
|
|
1145
|
+
noDataLabel?: string;
|
|
1146
|
+
className?: string;
|
|
1147
|
+
}
|
|
1148
|
+
/**
|
|
1149
|
+
* A container-width interactive area chart. Hover to reveal a guide line and a
|
|
1150
|
+
* tooltip with the point's label + formatted value.
|
|
1151
|
+
*/
|
|
1152
|
+
declare function AreaChart({ data, tone, color, height, formatValue, showGrid, showTooltip, showXAxis, strokeWidth, ariaLabel, noDataLabel, className, }: AreaChartProps): React$1.JSX.Element;
|
|
1153
|
+
|
|
976
1154
|
declare function Toaster(): React$1.JSX.Element;
|
|
977
1155
|
declare const toast: {
|
|
978
1156
|
success: (message: string, description?: string) => void;
|
|
@@ -1049,7 +1227,7 @@ declare function useFocusTrap(containerRef: RefObject<HTMLElement | null>, enabl
|
|
|
1049
1227
|
* applyTheme({ brand: "emerald", accent: "violet" }); // imperative
|
|
1050
1228
|
* const [theme, setTheme] = useYunUITheme({ brand: "blue" }); // React, persisted
|
|
1051
1229
|
*/
|
|
1052
|
-
type YunUIPalette = "gray" | "sand" | "slate" | "mint" | "rose" | "dusk" | "red" | "orange" | "yellow" | "moss" | "green" | "emerald" | "aqua" | "cyan" | "blue" | "indigo" | "violet" | "magenta" | "pink";
|
|
1230
|
+
type YunUIPalette = "gray" | "sand" | "slate" | "mint" | "rose" | "dusk" | "red" | "orange" | "amber" | "yellow" | "lime" | "moss" | "green" | "emerald" | "teal" | "aqua" | "cyan" | "blue" | "indigo" | "violet" | "plum" | "magenta" | "fuchsia" | "pink";
|
|
1053
1231
|
/** How solid (filled) surfaces derive their color. */
|
|
1054
1232
|
type YunUISolid = "color" | "contrast" | "inverse";
|
|
1055
1233
|
/** Whether elevated surfaces are opaque or frosted. */
|
|
@@ -1077,6 +1255,95 @@ interface YunUITheme {
|
|
|
1077
1255
|
type YunUIAccentSource = "brand" | "mono";
|
|
1078
1256
|
/** All palettes available to the brand/accent/neutral roles (for building pickers). */
|
|
1079
1257
|
declare const YUNUI_PALETTES: YunUIPalette[];
|
|
1258
|
+
/**
|
|
1259
|
+
* Curated multi-color theme presets — beautiful {brand, accent, neutral}
|
|
1260
|
+
* combinations. Apply one with `applyTheme(YUNUI_THEME_PRESETS.aurora)` or feed
|
|
1261
|
+
* them into a theme picker. Each pairs a brand with a complementary accent and a
|
|
1262
|
+
* neutral tuned to the same temperature.
|
|
1263
|
+
*/
|
|
1264
|
+
interface YunUIThemePreset {
|
|
1265
|
+
/** Display name. */
|
|
1266
|
+
label: string;
|
|
1267
|
+
brand: YunUIPalette;
|
|
1268
|
+
accent: YunUIPalette;
|
|
1269
|
+
neutral: YunUIPalette;
|
|
1270
|
+
}
|
|
1271
|
+
declare const YUNUI_THEME_PRESETS: {
|
|
1272
|
+
aurora: {
|
|
1273
|
+
label: string;
|
|
1274
|
+
brand: "blue";
|
|
1275
|
+
accent: "violet";
|
|
1276
|
+
neutral: "slate";
|
|
1277
|
+
};
|
|
1278
|
+
sunset: {
|
|
1279
|
+
label: string;
|
|
1280
|
+
brand: "orange";
|
|
1281
|
+
accent: "pink";
|
|
1282
|
+
neutral: "sand";
|
|
1283
|
+
};
|
|
1284
|
+
forest: {
|
|
1285
|
+
label: string;
|
|
1286
|
+
brand: "green";
|
|
1287
|
+
accent: "lime";
|
|
1288
|
+
neutral: "gray";
|
|
1289
|
+
};
|
|
1290
|
+
ocean: {
|
|
1291
|
+
label: string;
|
|
1292
|
+
brand: "cyan";
|
|
1293
|
+
accent: "teal";
|
|
1294
|
+
neutral: "slate";
|
|
1295
|
+
};
|
|
1296
|
+
grape: {
|
|
1297
|
+
label: string;
|
|
1298
|
+
brand: "violet";
|
|
1299
|
+
accent: "magenta";
|
|
1300
|
+
neutral: "dusk";
|
|
1301
|
+
};
|
|
1302
|
+
ember: {
|
|
1303
|
+
label: string;
|
|
1304
|
+
brand: "red";
|
|
1305
|
+
accent: "amber";
|
|
1306
|
+
neutral: "sand";
|
|
1307
|
+
};
|
|
1308
|
+
lagoon: {
|
|
1309
|
+
label: string;
|
|
1310
|
+
brand: "teal";
|
|
1311
|
+
accent: "emerald";
|
|
1312
|
+
neutral: "mint";
|
|
1313
|
+
};
|
|
1314
|
+
blossom: {
|
|
1315
|
+
label: string;
|
|
1316
|
+
brand: "pink";
|
|
1317
|
+
accent: "fuchsia";
|
|
1318
|
+
neutral: "rose";
|
|
1319
|
+
};
|
|
1320
|
+
royal: {
|
|
1321
|
+
label: string;
|
|
1322
|
+
brand: "indigo";
|
|
1323
|
+
accent: "blue";
|
|
1324
|
+
neutral: "slate";
|
|
1325
|
+
};
|
|
1326
|
+
citrus: {
|
|
1327
|
+
label: string;
|
|
1328
|
+
brand: "lime";
|
|
1329
|
+
accent: "yellow";
|
|
1330
|
+
neutral: "sand";
|
|
1331
|
+
};
|
|
1332
|
+
orchid: {
|
|
1333
|
+
label: string;
|
|
1334
|
+
brand: "plum";
|
|
1335
|
+
accent: "violet";
|
|
1336
|
+
neutral: "dusk";
|
|
1337
|
+
};
|
|
1338
|
+
mono: {
|
|
1339
|
+
label: string;
|
|
1340
|
+
brand: "gray";
|
|
1341
|
+
accent: "gray";
|
|
1342
|
+
neutral: "gray";
|
|
1343
|
+
};
|
|
1344
|
+
};
|
|
1345
|
+
/** Preset keys, e.g. for iterating in a picker. */
|
|
1346
|
+
type YunUIThemePresetName = keyof typeof YUNUI_THEME_PRESETS;
|
|
1080
1347
|
/**
|
|
1081
1348
|
* Apply theme attributes to an element (defaults to <html>). Only the keys you
|
|
1082
1349
|
* pass are written; pass `null` for a key to clear it. Safe to call on the
|
|
@@ -1092,4 +1359,4 @@ declare function readTheme(el?: HTMLElement | null): YunUITheme;
|
|
|
1092
1359
|
*/
|
|
1093
1360
|
declare function useYunUITheme(defaults?: YunUITheme): [YunUITheme, (patch: YunUITheme) => void];
|
|
1094
1361
|
|
|
1095
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, type AnimatedNumberProps, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Column, Combobox, type ComboboxOption, ConfirmModal, type ConfirmModalVariant, 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, type FlexProps, Grid, type GridCount, type GridProps, IconButton, InlineCode, InlineStatus, type InlineStatusKind, Input, Kbd, Label, Marquee, Modal, MotionDiv, MotionSpan, type NavTab, NavTabs, NumberInput, PageLoader, Pagination, type PaginationProps, PasswordInput, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, type SegmentedOption, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, type SelectOption, SelectTrigger, SelectValue, Separator, Sheet, ShinyButton, Skeleton, Slider, type SpacingScale, Spinner, Stack, StatusIndicator, Steps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, type YunUIAccentSource, type YunUIColorScheme, type YunUIPalette, type YunUISolid, type YunUISurface, type YunUITheme, applyTheme, cn, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
|
|
1362
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AnimatedNumber, type AnimatedNumberProps, AreaChart, type AreaChartPoint, type AreaChartProps, type AreaChartTone, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, type BarSegment, BentoCard, BentoGrid, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Collapsible, CollapsibleContent, type CollapsibleContentProps, type CollapsibleProps, CollapsibleTrigger, type CollapsibleTriggerProps, Column, Combobox, type ComboboxOption, ConfirmModal, type ConfirmModalVariant, 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, FileDropzone, type FileDropzoneProps, Flex, type FlexProps, Gauge, type GaugeProps, type GaugeTone, Grid, type GridCount, type GridProps, IconButton, InlineCode, InlineStatus, type InlineStatusKind, Input, Kbd, Label, Marquee, Modal, MotionDiv, MotionSpan, type NavTab, NavTabs, NumberInput, PageLoader, Pagination, type PaginationProps, PasswordInput, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, ScrollArea, ScrollBar, SearchInput, type SegmentTone, SegmentedBar, type SegmentedBarProps, type SegmentedOption, SegmentedSelect, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, ShinyButton, Skeleton, Slider, type SpacingScale, Sparkline, type SparklineProps, type SparklineTone, Spinner, Stack, StatusIndicator, Steps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, YUNUI_PALETTES, YUNUI_THEME_PRESETS, type YunUIAccentSource, type YunUIColorScheme, type YunUIPalette, type YunUISolid, type YunUISurface, type YunUITheme, type YunUIThemePreset, type YunUIThemePresetName, applyTheme, cn, fadeIn, readTheme, staggerContainer, staggerItem, toast, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior, useYunUITheme };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export {
|
|
3
|
-
export { ThemeToggle
|
|
4
|
-
|
|
2
|
+
export { AnimatedNumber, AreaChart, BentoCard, BentoGrid, Collapsible, CollapsibleContent, CollapsibleTrigger, CustomSelect, FileDropzone, Gauge, Marquee, NavTabs, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, SegmentedBar, SegmentedSelect, ShinyButton, Sparkline, Switch, Toaster, YUNUI_PALETTES, YUNUI_THEME_PRESETS, applyTheme, readTheme, toast, useYunUITheme } from './chunk-5E3O6ANF.js';
|
|
3
|
+
export { ThemeToggle } from './chunk-GSPJ5YI6.js';
|
|
4
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Column, Combobox, ConfirmModal, 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, InlineCode, InlineStatus, Input, Kbd, Label, Modal, MotionDiv, MotionSpan, NumberInput, PageLoader, Pagination, PasswordInput, Progress, RadioGroup, RadioGroupItem, RegenerateConfirmModal, Row, SearchInput, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, Skeleton, Slider, Spinner, Stack, StatusIndicator, Steps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TableBody as Tbody, TableCell as Td, Textarea, TableFooter as Tfoot, TableHead as Th, TableHeader as Thead, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TableRow as Tr, fadeIn, staggerContainer, staggerItem, useBodyScrollLock, useEscapeKey, useFocusTrap, useModalBehavior } from './chunk-5TOGZTAO.js';
|
|
5
|
+
export { cn } from './chunk-AV5TGEJS.js';
|
|
6
|
+
import './chunk-3RT24MSH.js';
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
|
6
8
|
//# sourceMappingURL=index.js.map
|