@previewcn/devtools 0.1.10 → 0.1.12

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/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var we=Object.defineProperty;var c=(e,r)=>()=>(e&&(r=e(e=0)),r);var Pe=(e,r)=>{for(var o in r)we(e,o,{get:r[o],enumerable:true});};function k(e){return Se.get(e)}var R,Se,P=c(()=>{R=[{name:"vercel",label:"Vercel",colors:{light:{background:"oklch(0.99 0 0)",foreground:"oklch(0 0 0)",card:"oklch(1.00 0 0)","card-foreground":"oklch(0 0 0)",popover:"oklch(0.99 0 0)","popover-foreground":"oklch(0 0 0)",primary:"oklch(0 0 0)","primary-foreground":"oklch(1.00 0 0)",secondary:"oklch(0.94 0 0)","secondary-foreground":"oklch(0 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.44 0 0)",accent:"oklch(0.94 0 0)","accent-foreground":"oklch(0 0 0)",destructive:"oklch(0.63 0.19 23.03)","destructive-foreground":"oklch(1.00 0 0)",border:"oklch(0.92 0 0)",input:"oklch(0.94 0 0)",ring:"oklch(0 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.55 0.22 264.53)","chart-3":"oklch(0.72 0 0)","chart-4":"oklch(0.92 0 0)","chart-5":"oklch(0.56 0 0)",sidebar:"oklch(0.99 0 0)","sidebar-foreground":"oklch(0 0 0)","sidebar-primary":"oklch(0 0 0)","sidebar-primary-foreground":"oklch(1.00 0 0)","sidebar-accent":"oklch(0.94 0 0)","sidebar-accent-foreground":"oklch(0 0 0)","sidebar-border":"oklch(0.94 0 0)","sidebar-ring":"oklch(0 0 0)"},dark:{background:"oklch(0 0 0)",foreground:"oklch(1.00 0 0)",card:"oklch(0.14 0 0)","card-foreground":"oklch(1.00 0 0)",popover:"oklch(0.18 0 0)","popover-foreground":"oklch(1.00 0 0)",primary:"oklch(1.00 0 0)","primary-foreground":"oklch(0 0 0)",secondary:"oklch(0.25 0 0)","secondary-foreground":"oklch(1.00 0 0)",muted:"oklch(0.23 0 0)","muted-foreground":"oklch(0.72 0 0)",accent:"oklch(0.32 0 0)","accent-foreground":"oklch(1.00 0 0)",destructive:"oklch(0.69 0.20 23.91)","destructive-foreground":"oklch(0 0 0)",border:"oklch(0.26 0 0)",input:"oklch(0.32 0 0)",ring:"oklch(0.72 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.58 0.21 260.84)","chart-3":"oklch(0.56 0 0)","chart-4":"oklch(0.44 0 0)","chart-5":"oklch(0.92 0 0)",sidebar:"oklch(0.18 0 0)","sidebar-foreground":"oklch(1.00 0 0)","sidebar-primary":"oklch(1.00 0 0)","sidebar-primary-foreground":"oklch(0 0 0)","sidebar-accent":"oklch(0.32 0 0)","sidebar-accent-foreground":"oklch(1.00 0 0)","sidebar-border":"oklch(0.32 0 0)","sidebar-ring":"oklch(0.72 0 0)"}},radius:"0.5rem",font:{value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"}},{name:"supabase",label:"Supabase",colors:{light:{background:"#fcfcfc",foreground:"#171717",card:"#fcfcfc","card-foreground":"#171717",popover:"#fcfcfc","popover-foreground":"#525252",primary:"#72e3ad","primary-foreground":"#1e2723",secondary:"#fdfdfd","secondary-foreground":"#171717",muted:"#ededed","muted-foreground":"#202020",accent:"#ededed","accent-foreground":"#202020",destructive:"#ca3214","destructive-foreground":"#fffcfc",border:"#dfdfdf",input:"#f6f6f6",ring:"#72e3ad","chart-1":"#72e3ad","chart-2":"#3b82f6","chart-3":"#8b5cf6","chart-4":"#f59e0b","chart-5":"#10b981",sidebar:"#fcfcfc","sidebar-foreground":"#707070","sidebar-primary":"#72e3ad","sidebar-primary-foreground":"#1e2723","sidebar-accent":"#ededed","sidebar-accent-foreground":"#202020","sidebar-border":"#dfdfdf","sidebar-ring":"#72e3ad"},dark:{background:"#121212",foreground:"#e2e8f0",card:"#171717","card-foreground":"#e2e8f0",popover:"#242424","popover-foreground":"#a9a9a9",primary:"#006239","primary-foreground":"#dde8e3",secondary:"#242424","secondary-foreground":"#fafafa",muted:"#1f1f1f","muted-foreground":"#a2a2a2",accent:"#313131","accent-foreground":"#fafafa",destructive:"#541c15","destructive-foreground":"#ede9e8",border:"#292929",input:"#242424",ring:"#4ade80","chart-1":"#4ade80","chart-2":"#60a5fa","chart-3":"#a78bfa","chart-4":"#fbbf24","chart-5":"#2dd4bf",sidebar:"#121212","sidebar-foreground":"#898989","sidebar-primary":"#006239","sidebar-primary-foreground":"#dde8e3","sidebar-accent":"#313131","sidebar-accent-foreground":"#fafafa","sidebar-border":"#292929","sidebar-ring":"#4ade80"}},radius:"0.5rem",font:{value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"}},{name:"claude",label:"Claude",colors:{light:{background:"#faf9f5",foreground:"#3d3929",card:"#faf9f5","card-foreground":"#141413",popover:"#ffffff","popover-foreground":"#28261b",primary:"#c96442","primary-foreground":"#ffffff",secondary:"#e9e6dc","secondary-foreground":"#535146",muted:"#ede9de","muted-foreground":"#83827d",accent:"#e9e6dc","accent-foreground":"#28261b",destructive:"#141413","destructive-foreground":"#ffffff",border:"#dad9d4",input:"#b4b2a7",ring:"#c96442","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#ded8c4","chart-4":"#dbd3f0","chart-5":"#b4552d",sidebar:"#f5f4ee","sidebar-foreground":"#3d3d3a","sidebar-primary":"#c96442","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#e9e6dc","sidebar-accent-foreground":"#343434","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"},dark:{background:"#262624",foreground:"#c3c0b6",card:"#262624","card-foreground":"#faf9f5",popover:"#30302e","popover-foreground":"#e5e5e2",primary:"#d97757","primary-foreground":"#ffffff",secondary:"#faf9f5","secondary-foreground":"#30302e",muted:"#1b1b19","muted-foreground":"#b7b5a9",accent:"#1a1915","accent-foreground":"#f5f4ee",destructive:"#ef4444","destructive-foreground":"#ffffff",border:"#3e3e38",input:"#52514a",ring:"#d97757","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#1a1915","chart-4":"#2f2b48","chart-5":"#b4552d",sidebar:"#1f1e1d","sidebar-foreground":"#c3c0b6","sidebar-primary":"#343434","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#0f0f0e","sidebar-accent-foreground":"#c3c0b6","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"}},radius:"0.5rem"}],Se=new Map(R.map(e=>[e.name,e]));});var Y,z=c(()=>{Y=[{name:"neutral",label:"Neutral",primary:{light:"oklch(0.556 0 0)",dark:"oklch(0.708 0 0)"},primaryForeground:{light:"oklch(0.985 0 0)",dark:"oklch(0.205 0 0)"}},{name:"red",label:"Red",primary:{light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.637 0.237 25.331)"},primaryForeground:{light:"oklch(0.971 0.013 17.38)",dark:"oklch(0.971 0.013 17.38)"},destructive:{light:"oklch(0.505 0.213 27.518)"}},{name:"orange",label:"Orange",primary:{light:"oklch(0.646 0.222 41.116)",dark:"oklch(0.705 0.213 47.604)"},primaryForeground:{light:"oklch(0.98 0.016 73.684)",dark:"oklch(0.98 0.016 73.684)"}},{name:"amber",label:"Amber",primary:{light:"oklch(0.67 0.16 58)",dark:"oklch(0.77 0.16 70)"},primaryForeground:{light:"oklch(0.99 0.02 95)",dark:"oklch(0.28 0.07 46)"}},{name:"yellow",label:"Yellow",primary:{light:"oklch(0.852 0.199 91.936)",dark:"oklch(0.795 0.184 86.047)"},primaryForeground:{light:"oklch(0.421 0.095 57.708)",dark:"oklch(0.421 0.095 57.708)"}},{name:"lime",label:"Lime",primary:{light:"oklch(0.65 0.18 132)",dark:"oklch(0.77 0.20 131)"},primaryForeground:{light:"oklch(0.99 0.03 121)",dark:"oklch(0.27 0.07 132)"}},{name:"green",label:"Green",primary:{light:"oklch(0.648 0.2 131.684)",dark:"oklch(0.648 0.2 131.684)"},primaryForeground:{light:"oklch(0.986 0.031 120.757)",dark:"oklch(0.986 0.031 120.757)"}},{name:"emerald",label:"Emerald",primary:{light:"oklch(0.60 0.13 163)",dark:"oklch(0.70 0.15 162)"},primaryForeground:{light:"oklch(0.98 0.02 166)",dark:"oklch(0.26 0.05 173)"}},{name:"teal",label:"Teal",primary:{light:"oklch(0.60 0.10 185)",dark:"oklch(0.70 0.12 183)"},primaryForeground:{light:"oklch(0.98 0.01 181)",dark:"oklch(0.28 0.04 193)"}},{name:"cyan",label:"Cyan",primary:{light:"oklch(0.61 0.11 222)",dark:"oklch(0.71 0.13 215)"},primaryForeground:{light:"oklch(0.98 0.02 201)",dark:"oklch(0.30 0.05 230)"}},{name:"sky",label:"Sky",primary:{light:"oklch(0.59 0.14 242)",dark:"oklch(0.68 0.15 237)"},primaryForeground:{light:"oklch(0.98 0.01 237)",dark:"oklch(0.29 0.06 243)"}},{name:"blue",label:"Blue",primary:{light:"oklch(0.488 0.243 264.376)",dark:"oklch(0.42 0.18 266)"},primaryForeground:{light:"oklch(0.97 0.014 254.604)",dark:"oklch(0.97 0.014 254.604)"}},{name:"indigo",label:"Indigo",primary:{light:"oklch(0.51 0.23 277)",dark:"oklch(0.59 0.20 277)"},primaryForeground:{light:"oklch(0.96 0.02 272)",dark:"oklch(0.96 0.02 272)"}},{name:"violet",label:"Violet",primary:{light:"oklch(0.541 0.281 293.009)",dark:"oklch(0.606 0.25 292.717)"},primaryForeground:{light:"oklch(0.969 0.016 293.756)",dark:"oklch(0.969 0.016 293.756)"}},{name:"purple",label:"Purple",primary:{light:"oklch(0.56 0.25 302)",dark:"oklch(0.63 0.23 304)"},primaryForeground:{light:"oklch(0.98 0.01 308)",dark:"oklch(0.98 0.01 308)"}},{name:"fuchsia",label:"Fuchsia",primary:{light:"oklch(0.59 0.26 323)",dark:"oklch(0.67 0.26 322)"},primaryForeground:{light:"oklch(0.98 0.02 320)",dark:"oklch(0.98 0.02 320)"}},{name:"pink",label:"Pink",primary:{light:"oklch(0.59 0.22 1)",dark:"oklch(0.66 0.21 354)"},primaryForeground:{light:"oklch(0.97 0.01 343)",dark:"oklch(0.97 0.01 343)"}},{name:"rose",label:"Rose",primary:{light:"oklch(0.586 0.253 17.585)",dark:"oklch(0.645 0.246 16.439)"},primaryForeground:{light:"oklch(0.969 0.015 12.422)",dark:"oklch(0.969 0.015 12.422)"}}];});function Te(e){return {name:e.name,label:e.label,colors:{light:{...A.light,primary:e.primary.light,"primary-foreground":e.primaryForeground?.light??j.light,destructive:e.destructive?.light??G.light},dark:{...A.dark,primary:e.primary.dark,"primary-foreground":e.primaryForeground?.dark??j.dark,destructive:e.destructive?.dark??G.dark}}}}function K(e){return L.find(r=>r.name===e)}var A,G,j,L,I=c(()=>{z();A={light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.708 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.205 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.205 0 0)","popover-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",border:"oklch(1 0 0 / 10%)",input:"oklch(1 0 0 / 15%)",ring:"oklch(0.556 0 0)"}},G={light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.704 0.191 22.216)"},j={light:"oklch(0.985 0 0)",dark:"oklch(0.985 0 0)"};L=Y.map(Te);});function X(e){return C.find(r=>r.value===e)}var C,O=c(()=>{C=[{label:"Inter",value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"},{label:"Noto Sans",value:"noto-sans",fontFamily:'"Noto Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},{label:"Nunito Sans",value:"nunito-sans",fontFamily:'"Nunito Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700&display=swap"},{label:"Figtree",value:"figtree",fontFamily:'"Figtree", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap"},{label:"Roboto",value:"roboto",fontFamily:'"Roboto", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"},{label:"Raleway",value:"raleway",fontFamily:'"Raleway", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap"},{label:"DM Sans",value:"dm-sans",fontFamily:'"DM Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"},{label:"Public Sans",value:"public-sans",fontFamily:'"Public Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap"},{label:"Outfit",value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"},{label:"JetBrains Mono",value:"jetbrains-mono",fontFamily:'"JetBrains Mono", monospace',googleFontsUrl:"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"}];});function Ne(){let e=document.getElementById(D);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=D,document.head.appendChild(r),r}function Z(e){return Object.entries(e).map(([r,o])=>`--${r}: ${o};`).join(" ")}function q(e){let r=Ne(),o=Z(e.light),t=Z(e.dark);r.textContent=`:root { ${o} } .dark { ${t} }`;}function F(e){let r=document.documentElement;e?(r.classList.remove("light"),r.classList.add("dark")):(r.classList.remove("dark"),r.classList.add("light")),r.style.colorScheme=e?"dark":"light";}function v(e){document.documentElement.style.setProperty("--radius",e);}function S(e){let r=K(e);r&&q(r.colors);}function Q(e){q(e.colors);}function xe(){let e=document.getElementById(B);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=B,document.head.appendChild(r),r}function U(e){let{fontFamily:r,googleFontsUrl:o,value:t}=e;if(!o.startsWith("https://fonts.googleapis.com/")){console.warn("[PreviewCN] Invalid font URL");return}let d=`previewcn-font-${t}`;if(!document.getElementById(d)){let i=document.createElement("link");i.id=d,i.rel="stylesheet",i.href=o,document.head.appendChild(i);}let p=xe();p.textContent=`
2
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var Ee=Object.defineProperty;var c=(e,r)=>()=>(e&&(r=e(e=0)),r);var Re=(e,r)=>{for(var o in r)Ee(e,o,{get:r[o],enumerable:true});};function g(e){return Ie.get(e)}var $,Ie,y=c(()=>{$=[{name:"vercel",label:"Vercel",colors:{light:{background:"oklch(0.99 0 0)",foreground:"oklch(0 0 0)",card:"oklch(1.00 0 0)","card-foreground":"oklch(0 0 0)",popover:"oklch(0.99 0 0)","popover-foreground":"oklch(0 0 0)",primary:"oklch(0 0 0)","primary-foreground":"oklch(1.00 0 0)",secondary:"oklch(0.94 0 0)","secondary-foreground":"oklch(0 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.44 0 0)",accent:"oklch(0.94 0 0)","accent-foreground":"oklch(0 0 0)",destructive:"oklch(0.63 0.19 23.03)","destructive-foreground":"oklch(1.00 0 0)",border:"oklch(0.92 0 0)",input:"oklch(0.94 0 0)",ring:"oklch(0 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.55 0.22 264.53)","chart-3":"oklch(0.72 0 0)","chart-4":"oklch(0.92 0 0)","chart-5":"oklch(0.56 0 0)",sidebar:"oklch(0.99 0 0)","sidebar-foreground":"oklch(0 0 0)","sidebar-primary":"oklch(0 0 0)","sidebar-primary-foreground":"oklch(1.00 0 0)","sidebar-accent":"oklch(0.94 0 0)","sidebar-accent-foreground":"oklch(0 0 0)","sidebar-border":"oklch(0.94 0 0)","sidebar-ring":"oklch(0 0 0)"},dark:{background:"oklch(0 0 0)",foreground:"oklch(1.00 0 0)",card:"oklch(0.14 0 0)","card-foreground":"oklch(1.00 0 0)",popover:"oklch(0.18 0 0)","popover-foreground":"oklch(1.00 0 0)",primary:"oklch(1.00 0 0)","primary-foreground":"oklch(0 0 0)",secondary:"oklch(0.25 0 0)","secondary-foreground":"oklch(1.00 0 0)",muted:"oklch(0.23 0 0)","muted-foreground":"oklch(0.72 0 0)",accent:"oklch(0.32 0 0)","accent-foreground":"oklch(1.00 0 0)",destructive:"oklch(0.69 0.20 23.91)","destructive-foreground":"oklch(0 0 0)",border:"oklch(0.26 0 0)",input:"oklch(0.32 0 0)",ring:"oklch(0.72 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.58 0.21 260.84)","chart-3":"oklch(0.56 0 0)","chart-4":"oklch(0.44 0 0)","chart-5":"oklch(0.92 0 0)",sidebar:"oklch(0.18 0 0)","sidebar-foreground":"oklch(1.00 0 0)","sidebar-primary":"oklch(1.00 0 0)","sidebar-primary-foreground":"oklch(0 0 0)","sidebar-accent":"oklch(0.32 0 0)","sidebar-accent-foreground":"oklch(1.00 0 0)","sidebar-border":"oklch(0.32 0 0)","sidebar-ring":"oklch(0.72 0 0)"}},radius:"0.5rem",font:{value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"}},{name:"supabase",label:"Supabase",colors:{light:{background:"#fcfcfc",foreground:"#171717",card:"#fcfcfc","card-foreground":"#171717",popover:"#fcfcfc","popover-foreground":"#525252",primary:"#72e3ad","primary-foreground":"#1e2723",secondary:"#fdfdfd","secondary-foreground":"#171717",muted:"#ededed","muted-foreground":"#202020",accent:"#ededed","accent-foreground":"#202020",destructive:"#ca3214","destructive-foreground":"#fffcfc",border:"#dfdfdf",input:"#f6f6f6",ring:"#72e3ad","chart-1":"#72e3ad","chart-2":"#3b82f6","chart-3":"#8b5cf6","chart-4":"#f59e0b","chart-5":"#10b981",sidebar:"#fcfcfc","sidebar-foreground":"#707070","sidebar-primary":"#72e3ad","sidebar-primary-foreground":"#1e2723","sidebar-accent":"#ededed","sidebar-accent-foreground":"#202020","sidebar-border":"#dfdfdf","sidebar-ring":"#72e3ad"},dark:{background:"#121212",foreground:"#e2e8f0",card:"#171717","card-foreground":"#e2e8f0",popover:"#242424","popover-foreground":"#a9a9a9",primary:"#006239","primary-foreground":"#dde8e3",secondary:"#242424","secondary-foreground":"#fafafa",muted:"#1f1f1f","muted-foreground":"#a2a2a2",accent:"#313131","accent-foreground":"#fafafa",destructive:"#541c15","destructive-foreground":"#ede9e8",border:"#292929",input:"#242424",ring:"#4ade80","chart-1":"#4ade80","chart-2":"#60a5fa","chart-3":"#a78bfa","chart-4":"#fbbf24","chart-5":"#2dd4bf",sidebar:"#121212","sidebar-foreground":"#898989","sidebar-primary":"#006239","sidebar-primary-foreground":"#dde8e3","sidebar-accent":"#313131","sidebar-accent-foreground":"#fafafa","sidebar-border":"#292929","sidebar-ring":"#4ade80"}},radius:"0.5rem",font:{value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"}},{name:"claude",label:"Claude",colors:{light:{background:"#faf9f5",foreground:"#3d3929",card:"#faf9f5","card-foreground":"#141413",popover:"#ffffff","popover-foreground":"#28261b",primary:"#c96442","primary-foreground":"#ffffff",secondary:"#e9e6dc","secondary-foreground":"#535146",muted:"#ede9de","muted-foreground":"#83827d",accent:"#e9e6dc","accent-foreground":"#28261b",destructive:"#141413","destructive-foreground":"#ffffff",border:"#dad9d4",input:"#b4b2a7",ring:"#c96442","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#ded8c4","chart-4":"#dbd3f0","chart-5":"#b4552d",sidebar:"#f5f4ee","sidebar-foreground":"#3d3d3a","sidebar-primary":"#c96442","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#e9e6dc","sidebar-accent-foreground":"#343434","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"},dark:{background:"#262624",foreground:"#c3c0b6",card:"#262624","card-foreground":"#faf9f5",popover:"#30302e","popover-foreground":"#e5e5e2",primary:"#d97757","primary-foreground":"#ffffff",secondary:"#faf9f5","secondary-foreground":"#30302e",muted:"#1b1b19","muted-foreground":"#b7b5a9",accent:"#1a1915","accent-foreground":"#f5f4ee",destructive:"#ef4444","destructive-foreground":"#ffffff",border:"#3e3e38",input:"#52514a",ring:"#d97757","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#1a1915","chart-4":"#2f2b48","chart-5":"#b4552d",sidebar:"#1f1e1d","sidebar-foreground":"#c3c0b6","sidebar-primary":"#343434","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#0f0f0e","sidebar-accent-foreground":"#c3c0b6","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"}},radius:"0.5rem"}],Ie=new Map($.map(e=>[e.name,e]));});var Y,z=c(()=>{Y=[{name:"neutral",label:"Neutral",primary:{light:"oklch(0.556 0 0)",dark:"oklch(0.708 0 0)"},primaryForeground:{light:"oklch(0.985 0 0)",dark:"oklch(0.205 0 0)"}},{name:"red",label:"Red",primary:{light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.637 0.237 25.331)"},primaryForeground:{light:"oklch(0.971 0.013 17.38)",dark:"oklch(0.971 0.013 17.38)"},destructive:{light:"oklch(0.505 0.213 27.518)"}},{name:"orange",label:"Orange",primary:{light:"oklch(0.646 0.222 41.116)",dark:"oklch(0.705 0.213 47.604)"},primaryForeground:{light:"oklch(0.98 0.016 73.684)",dark:"oklch(0.98 0.016 73.684)"}},{name:"amber",label:"Amber",primary:{light:"oklch(0.67 0.16 58)",dark:"oklch(0.77 0.16 70)"},primaryForeground:{light:"oklch(0.99 0.02 95)",dark:"oklch(0.28 0.07 46)"}},{name:"yellow",label:"Yellow",primary:{light:"oklch(0.852 0.199 91.936)",dark:"oklch(0.795 0.184 86.047)"},primaryForeground:{light:"oklch(0.421 0.095 57.708)",dark:"oklch(0.421 0.095 57.708)"}},{name:"lime",label:"Lime",primary:{light:"oklch(0.65 0.18 132)",dark:"oklch(0.77 0.20 131)"},primaryForeground:{light:"oklch(0.99 0.03 121)",dark:"oklch(0.27 0.07 132)"}},{name:"green",label:"Green",primary:{light:"oklch(0.648 0.2 131.684)",dark:"oklch(0.648 0.2 131.684)"},primaryForeground:{light:"oklch(0.986 0.031 120.757)",dark:"oklch(0.986 0.031 120.757)"}},{name:"emerald",label:"Emerald",primary:{light:"oklch(0.60 0.13 163)",dark:"oklch(0.70 0.15 162)"},primaryForeground:{light:"oklch(0.98 0.02 166)",dark:"oklch(0.26 0.05 173)"}},{name:"teal",label:"Teal",primary:{light:"oklch(0.60 0.10 185)",dark:"oklch(0.70 0.12 183)"},primaryForeground:{light:"oklch(0.98 0.01 181)",dark:"oklch(0.28 0.04 193)"}},{name:"cyan",label:"Cyan",primary:{light:"oklch(0.61 0.11 222)",dark:"oklch(0.71 0.13 215)"},primaryForeground:{light:"oklch(0.98 0.02 201)",dark:"oklch(0.30 0.05 230)"}},{name:"sky",label:"Sky",primary:{light:"oklch(0.59 0.14 242)",dark:"oklch(0.68 0.15 237)"},primaryForeground:{light:"oklch(0.98 0.01 237)",dark:"oklch(0.29 0.06 243)"}},{name:"blue",label:"Blue",primary:{light:"oklch(0.488 0.243 264.376)",dark:"oklch(0.42 0.18 266)"},primaryForeground:{light:"oklch(0.97 0.014 254.604)",dark:"oklch(0.97 0.014 254.604)"}},{name:"indigo",label:"Indigo",primary:{light:"oklch(0.51 0.23 277)",dark:"oklch(0.59 0.20 277)"},primaryForeground:{light:"oklch(0.96 0.02 272)",dark:"oklch(0.96 0.02 272)"}},{name:"violet",label:"Violet",primary:{light:"oklch(0.541 0.281 293.009)",dark:"oklch(0.606 0.25 292.717)"},primaryForeground:{light:"oklch(0.969 0.016 293.756)",dark:"oklch(0.969 0.016 293.756)"}},{name:"purple",label:"Purple",primary:{light:"oklch(0.56 0.25 302)",dark:"oklch(0.63 0.23 304)"},primaryForeground:{light:"oklch(0.98 0.01 308)",dark:"oklch(0.98 0.01 308)"}},{name:"fuchsia",label:"Fuchsia",primary:{light:"oklch(0.59 0.26 323)",dark:"oklch(0.67 0.26 322)"},primaryForeground:{light:"oklch(0.98 0.02 320)",dark:"oklch(0.98 0.02 320)"}},{name:"pink",label:"Pink",primary:{light:"oklch(0.59 0.22 1)",dark:"oklch(0.66 0.21 354)"},primaryForeground:{light:"oklch(0.97 0.01 343)",dark:"oklch(0.97 0.01 343)"}},{name:"rose",label:"Rose",primary:{light:"oklch(0.586 0.253 17.585)",dark:"oklch(0.645 0.246 16.439)"},primaryForeground:{light:"oklch(0.969 0.015 12.422)",dark:"oklch(0.969 0.015 12.422)"}}];});function $e(e){return {name:e.name,label:e.label,colors:{light:{...G.light,primary:e.primary.light,"primary-foreground":e.primaryForeground?.light??X.light,destructive:e.destructive?.light??K.light},dark:{...G.dark,primary:e.primary.dark,"primary-foreground":e.primaryForeground?.dark??X.dark,destructive:e.destructive?.dark??K.dark}}}}function x(e){return B.find(r=>r.name===e)}var G,K,X,B,T=c(()=>{z();G={light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.708 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.205 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.205 0 0)","popover-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",border:"oklch(1 0 0 / 10%)",input:"oklch(1 0 0 / 15%)",ring:"oklch(0.556 0 0)"}},K={light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.704 0.191 22.216)"},X={light:"oklch(0.985 0 0)",dark:"oklch(0.985 0 0)"};B=Y.map($e);});function Z(e){return S.find(r=>r.value===e)}var S,O=c(()=>{S=[{label:"Inter",value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"},{label:"Noto Sans",value:"noto-sans",fontFamily:'"Noto Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},{label:"Nunito Sans",value:"nunito-sans",fontFamily:'"Nunito Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700&display=swap"},{label:"Figtree",value:"figtree",fontFamily:'"Figtree", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap"},{label:"Roboto",value:"roboto",fontFamily:'"Roboto", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"},{label:"Raleway",value:"raleway",fontFamily:'"Raleway", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap"},{label:"DM Sans",value:"dm-sans",fontFamily:'"DM Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"},{label:"Public Sans",value:"public-sans",fontFamily:'"Public Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap"},{label:"Outfit",value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"},{label:"JetBrains Mono",value:"jetbrains-mono",fontFamily:'"JetBrains Mono", monospace',googleFontsUrl:"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"}];});function Be(){let e=document.getElementById(D);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=D,document.head.appendChild(r),r}function q(e){return Object.entries(e).map(([r,o])=>`--${r}: ${o};`).join(" ")}function Q(e){let r=Be(),o=q(e.light),t=q(e.dark);r.textContent=`:root { ${o} } .dark { ${t} }`;}function N(e){let r=document.documentElement;e?(r.classList.remove("light"),r.classList.add("dark")):(r.classList.remove("dark"),r.classList.add("light")),r.style.colorScheme=e?"dark":"light";}function w(e){document.documentElement.style.setProperty("--radius",e);}function E(e){let r=x(e);r&&Q(r.colors);}function ee(e){Q(e.colors);}function Oe(){let e=document.getElementById(U);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=U,document.head.appendChild(r),r}function W(e){let{fontFamily:r,googleFontsUrl:o,value:t}=e;if(!o.startsWith("https://fonts.googleapis.com/")){console.warn("[PreviewCN] Invalid font URL");return}let n=`previewcn-font-${t}`;if(!document.getElementById(n)){let a=document.createElement("link");a.id=n,a.rel="stylesheet",a.href=o,document.head.appendChild(a);}let p=Oe();p.textContent=`
3
3
  :root {
4
4
  --font-sans: ${r} !important;
5
5
  --font-sans-override: ${r} !important;
@@ -8,5 +8,10 @@
8
8
  html, body, .font-sans {
9
9
  font-family: ${r} !important;
10
10
  }
11
- `;}function T(e){let r=X(e);r&&U(r);}function ee(e){let r=k(e);r&&(Q(r),v(r.radius),r.font&&U(r.font));}function $(e){let r=e.preset?k(e.preset):null;e.colorPreset!==null?S(e.colorPreset):r&&Q(r);let o=e.radius??r?.radius;o!=null&&v(o),e.darkMode!==null&&F(e.darkMode),e.font!==null?T(e.font):r?.font&&U(r.font);}function re(){let e=document.getElementById(D);e&&e.remove();let r=document.getElementById(B);r&&r.remove();let o=document.documentElement;o.style.removeProperty("--radius"),o.style.removeProperty("color-scheme"),o.classList.remove("light","dark");}var D,B,N=c(()=>{I();O();P();D="previewcn-devtools-theme-colors",B="previewcn-devtools-theme-font";});function Ee(){if(typeof window>"u")return {};try{let e=localStorage.getItem(_);if(e)return JSON.parse(e)}catch{}return {}}function Re(e){if(!(typeof window>"u"))try{localStorage.setItem(_,JSON.stringify(e));}catch{}}function te(){let[e,r]=react.useState(()=>({...oe,...Ee()})),o=react.useCallback(n=>{r(s=>{let m=n(s);return Re(m),m});},[]),t=react.useCallback(n=>{o(s=>({...s,colorPreset:n})),S(n);},[o]),d=react.useCallback(n=>{o(s=>({...s,radius:n})),v(n);},[o]),p=react.useCallback(n=>{o(s=>({...s,darkMode:n})),F(n);},[o]),i=react.useCallback(n=>{o(s=>({...s,font:n})),T(n);},[o]),E=react.useCallback(n=>{let s=k(n);s&&(o(m=>({...m,preset:n,radius:s.radius,font:s.font?.value??m.font,colorPreset:null})),ee(n));},[o]),w=react.useCallback(()=>{typeof window<"u"&&localStorage.removeItem(_),re(),r(oe);},[]);return {config:e,setColorPreset:t,setRadius:d,setDarkMode:p,setFont:i,setPresetTheme:E,resetTheme:w}}var _,oe,ne=c(()=>{"use client";P();N();_="previewcn-devtools-theme";oe={colorPreset:null,radius:null,darkMode:null,font:null,preset:null};});function le({value:e,onChange:r}){return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Theme"}),jsxRuntime.jsx("div",{className:"previewcn-color-grid",children:L.map(o=>{let t=e===o.name,d=o.colors.light.primary;return jsxRuntime.jsx("button",{onClick:()=>r(o.name),className:`previewcn-color-swatch ${t?"previewcn-color-swatch--selected":""}`,style:{backgroundColor:d},"aria-label":o.label,title:o.label},o.name)})})]})}var ae=c(()=>{"use client";I();});function Oe(){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}function ie({value:e,onChange:r}){let[o,t]=react.useState(false),p=C.find(i=>i.value===e)?.label??"Select font...";return jsxRuntime.jsxs("div",{className:`previewcn-section previewcn-surface ${o?"previewcn-section--overlay":""}`,children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Font"}),jsxRuntime.jsxs("div",{className:"previewcn-select-wrapper",children:[jsxRuntime.jsxs("button",{onClick:()=>t(!o),className:"previewcn-select-trigger previewcn-control","aria-expanded":o,children:[jsxRuntime.jsx("span",{children:p}),jsxRuntime.jsx(Oe,{})]}),o&&jsxRuntime.jsx("div",{className:"previewcn-select-dropdown",children:C.map(i=>jsxRuntime.jsx("button",{onClick:()=>{r(i.value),t(false);},className:`previewcn-select-option previewcn-option ${e===i.value?"previewcn-option--selected":""}`,children:i.label},i.value))})]})]})}var se=c(()=>{"use client";O();});function De(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M12 2v2"}),jsxRuntime.jsx("path",{d:"M12 20v2"}),jsxRuntime.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),jsxRuntime.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),jsxRuntime.jsx("path",{d:"M2 12h2"}),jsxRuntime.jsx("path",{d:"M20 12h2"}),jsxRuntime.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),jsxRuntime.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function Be(){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function ce({value:e,onChange:r}){let o=e??false;return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Mode"}),jsxRuntime.jsxs("div",{className:"previewcn-mode-toggle",children:[jsxRuntime.jsxs("button",{onClick:()=>r(false),className:`previewcn-mode-btn previewcn-control ${o?"":"previewcn-control--selected"}`,"aria-label":"Light mode",children:[jsxRuntime.jsx(De,{}),jsxRuntime.jsx("span",{children:"Light"})]}),jsxRuntime.jsxs("button",{onClick:()=>r(true),className:`previewcn-mode-btn previewcn-control ${o?"previewcn-control--selected":""}`,"aria-label":"Dark mode",children:[jsxRuntime.jsx(Be,{}),jsxRuntime.jsx("span",{children:"Dark"})]})]})]})}var de=c(()=>{"use client";});function pe({value:e,onChange:r}){return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("span",{className:"previewcn-label",children:"Presets"}),jsxRuntime.jsx("div",{className:"previewcn-preset-grid",children:R.map(o=>{let t=e===o.name,d=o.colors.light.primary,p=o.colors.light.background;return jsxRuntime.jsxs("button",{onClick:()=>r(o.name),className:`previewcn-preset-card ${t?"previewcn-preset-card--selected":""}`,"aria-label":o.label,"aria-pressed":t,children:[jsxRuntime.jsxs("div",{className:"previewcn-preset-preview",children:[jsxRuntime.jsx("div",{className:"previewcn-preset-color previewcn-preset-color--bg",style:{backgroundColor:p}}),jsxRuntime.jsx("div",{className:"previewcn-preset-color previewcn-preset-color--primary",style:{backgroundColor:d}})]}),jsxRuntime.jsx("span",{className:"previewcn-preset-label",children:o.label})]},o.name)})})]})}var ue=c(()=>{"use client";P();});var ge,fe=c(()=>{ge=[{name:"none",label:"None",value:"0rem"},{name:"sm",label:"SM",value:"0.3rem"},{name:"md",label:"MD",value:"0.5rem"},{name:"lg",label:"LG",value:"0.625rem"},{name:"xl",label:"XL",value:"0.75rem"},{name:"full",label:"Full",value:"1rem"}];});function me({value:e,onChange:r}){return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Radius"}),jsxRuntime.jsx("div",{className:"previewcn-radius-grid",children:ge.map(o=>{let t=e===o.value;return jsxRuntime.jsxs("button",{onClick:()=>r(o.value),className:`previewcn-radius-btn previewcn-control ${t?"previewcn-control--selected":""}`,title:o.label,children:[jsxRuntime.jsx("span",{className:"previewcn-radius-preview",style:{borderRadius:o.value}}),jsxRuntime.jsx("span",{className:"previewcn-radius-label",children:o.label})]},o.name)})})]})}var ke=c(()=>{"use client";fe();});var be={};Pe(be,{default:()=>ve});function _e(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]})}function We(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),jsxRuntime.jsx("path",{d:"M3 3v5h5"})]})}function ve({onClose:e}){let{config:r,setColorPreset:o,setRadius:t,setDarkMode:d,setFont:p,setPresetTheme:i,resetTheme:E}=te(),w=react.useRef(false);return react.useEffect(()=>{w.current||(w.current=true,$(r));},[r]),jsxRuntime.jsxs("div",{className:"previewcn-panel",children:[jsxRuntime.jsxs("div",{className:"previewcn-header",children:[jsxRuntime.jsx("div",{className:"previewcn-title",children:jsxRuntime.jsx("span",{className:"previewcn-logo",children:"previewcn"})}),jsxRuntime.jsx("button",{onClick:e,className:"previewcn-control previewcn-control--ghost previewcn-icon-btn previewcn-close-btn","aria-label":"Close",children:jsxRuntime.jsx(_e,{})})]}),jsxRuntime.jsxs("div",{className:"previewcn-content",children:[jsxRuntime.jsx(pe,{value:r.preset,onChange:i}),jsxRuntime.jsx(le,{value:r.colorPreset,onChange:o}),jsxRuntime.jsx(me,{value:r.radius,onChange:t}),jsxRuntime.jsx(ie,{value:r.font,onChange:p}),jsxRuntime.jsx(ce,{value:r.darkMode,onChange:d})]}),jsxRuntime.jsx("div",{className:"previewcn-footer",children:jsxRuntime.jsxs("button",{onClick:E,className:"previewcn-control previewcn-control--ghost previewcn-reset-btn",children:[jsxRuntime.jsx(We,{}),jsxRuntime.jsx("span",{children:"Reset"})]})})]})}var ye=c(()=>{"use client";ne();N();ae();se();de();ue();ke();});function Ce(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"})]})}function V({onClick:e}){return jsxRuntime.jsx("button",{onClick:e,className:"previewcn-trigger","aria-label":"Open PreviewCN theme editor",title:"PreviewCN Theme Editor",children:jsxRuntime.jsx(Ce,{})})}var Ye=react.lazy(()=>Promise.resolve().then(()=>(ye(),be))),ze=process.env.NODE_ENV==="development";function Ae(){let[e,r]=react.useState(false);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx(V,{onClick:()=>r(true)}),e&&jsxRuntime.jsx(react.Suspense,{fallback:null,children:jsxRuntime.jsx(Ye,{onClose:()=>r(false)})})]})}function Ge(){return ze?jsxRuntime.jsx(Ae,{}):null}N();
12
- exports.PreviewcnDevtools=Ge;exports.applyColors=S;exports.applyDarkMode=F;exports.applyFont=T;exports.applyRadius=v;exports.applyTheme=$;
11
+ `;}function R(e){let r=Z(e);r&&W(r);}function re(e){let r=g(e);r&&(ee(r),w(r.radius),r.font&&W(r.font));}function _(e){let r=e.preset?g(e.preset):null;e.colorPreset!==null?E(e.colorPreset):r&&ee(r);let o=e.radius??r?.radius;o!=null&&w(o),e.darkMode!==null&&N(e.darkMode),e.font!==null?R(e.font):r?.font&&W(r.font);}function oe(){let e=document.getElementById(D);e&&e.remove();let r=document.getElementById(U);r&&r.remove();let o=document.documentElement;o.style.removeProperty("--radius"),o.style.removeProperty("color-scheme"),o.classList.remove("light","dark");}var D,U,M=c(()=>{T();O();y();D="previewcn-devtools-theme-colors",U="previewcn-devtools-theme-font";});function Ue(){if(typeof window>"u")return {};try{let e=localStorage.getItem(V);if(e)return JSON.parse(e)}catch{}return {}}function We(e){if(!(typeof window>"u"))try{localStorage.setItem(V,JSON.stringify(e));}catch{}}function ne(){let[e,r]=react.useState(()=>({...te,...Ue()})),o=react.useCallback(l=>{r(d=>{let v=l(d);return We(v),v});},[]),t=react.useCallback(l=>{o(d=>({...d,colorPreset:l})),E(l);},[o]),n=react.useCallback(l=>{o(d=>({...d,radius:l})),w(l);},[o]),p=react.useCallback(l=>{o(d=>({...d,darkMode:l})),N(l);},[o]),a=react.useCallback(l=>{o(d=>({...d,font:l})),R(l);},[o]),F=react.useCallback(l=>{let d=g(l);d&&(o(v=>({...v,preset:l,radius:d.radius,font:d.font?.value??v.font,colorPreset:null})),re(l));},[o]),b=react.useCallback(()=>{typeof window<"u"&&localStorage.removeItem(V),oe(),r(te);},[]);return {config:e,setColorPreset:t,setRadius:n,setDarkMode:p,setFont:a,setPresetTheme:F,resetTheme:b}}var V,te,le=c(()=>{"use client";y();M();V="previewcn-devtools-theme";te={colorPreset:null,radius:null,darkMode:null,font:null,preset:null};});function ae({value:e,onChange:r}){return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Theme"}),jsxRuntime.jsx("div",{className:"previewcn-color-grid",children:B.map(o=>{let t=e===o.name,n=o.colors.light.primary;return jsxRuntime.jsx("button",{onClick:()=>r(o.name),className:`previewcn-color-swatch ${t?"previewcn-color-swatch--selected":""}`,style:{backgroundColor:n},"aria-label":o.label,title:o.label},o.name)})})]})}var se=c(()=>{"use client";T();});function Ve(e){let r=e.preset!==null?g(e.preset):null,t=(e.colorPreset!==null?x(e.colorPreset):null)?.colors??r?.colors??null;if(!t)return null;let n=e.radius??r?.radius??"0.5rem";return {colors:t,radius:n}}function He(e,r=" "){return Object.entries(e).map(([o,t])=>`${r}--${o}: ${t};`).join(`
12
+ `)}function ie(e,r){return `${e} {
13
+ ${He(r)}
14
+ }`}function ce(e){let r=Ve(e);if(!r)return null;let o={radius:r.radius,...r.colors.light};return `${ie(":root",o)}
15
+
16
+ ${ie(".dark",r.colors.dark)}`}async function de(e){try{return await navigator.clipboard.writeText(e),!0}catch{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",document.body.appendChild(r),r.focus(),r.select();let o=document.execCommand("copy");return document.body.removeChild(r),o}catch{return false}}}var pe=c(()=>{T();y();});function je(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),jsxRuntime.jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}function Ae(){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M20 6 9 17l-5-5"})})}function ue({config:e}){let[r,o]=react.useState(false),t=ce(e),n=!t,p=r?"Copied!":"Copy CSS";return jsxRuntime.jsxs("button",{onClick:async()=>{if(!t)return;await de(t)&&(o(true),setTimeout(()=>o(false),2e3));},className:`previewcn-control previewcn-copy-btn${r?" previewcn-copy-btn--success":""}${n?" previewcn-copy-btn--disabled":""}`,disabled:n,"aria-label":p,title:n?"Select a theme first":"Copy CSS to clipboard",children:[r?jsxRuntime.jsx(Ae,{}):jsxRuntime.jsx(je,{}),jsxRuntime.jsx("span",{children:p})]})}var he=c(()=>{"use client";pe();});function ze(){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"m6 9 6 6 6-6"})})}function fe({value:e,onChange:r}){let[o,t]=react.useState(false),p=S.find(a=>a.value===e)?.label??"Select font...";return jsxRuntime.jsxs("div",{className:`previewcn-section previewcn-surface ${o?"previewcn-section--overlay":""}`,children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Font"}),jsxRuntime.jsxs("div",{className:"previewcn-select-wrapper",children:[jsxRuntime.jsxs("button",{onClick:()=>t(!o),className:"previewcn-select-trigger previewcn-control","aria-expanded":o,children:[jsxRuntime.jsx("span",{children:p}),jsxRuntime.jsx(ze,{})]}),o&&jsxRuntime.jsx("div",{className:"previewcn-select-dropdown",children:S.map(a=>jsxRuntime.jsx("button",{onClick:()=>{r(a.value),t(false);},className:`previewcn-select-option previewcn-option ${e===a.value?"previewcn-option--selected":""}`,children:a.label},a.value))})]})]})}var me=c(()=>{"use client";O();});function Ge(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M12 2v2"}),jsxRuntime.jsx("path",{d:"M12 20v2"}),jsxRuntime.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),jsxRuntime.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),jsxRuntime.jsx("path",{d:"M2 12h2"}),jsxRuntime.jsx("path",{d:"M20 12h2"}),jsxRuntime.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),jsxRuntime.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function Ke(){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function ke({value:e,onChange:r}){let o=e??false;return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Mode"}),jsxRuntime.jsxs("div",{className:"previewcn-mode-toggle",children:[jsxRuntime.jsxs("button",{onClick:()=>r(false),className:`previewcn-mode-btn previewcn-control ${o?"":"previewcn-control--selected"}`,"aria-label":"Light mode",children:[jsxRuntime.jsx(Ge,{}),jsxRuntime.jsx("span",{children:"Light"})]}),jsxRuntime.jsxs("button",{onClick:()=>r(true),className:`previewcn-mode-btn previewcn-control ${o?"previewcn-control--selected":""}`,"aria-label":"Dark mode",children:[jsxRuntime.jsx(Ke,{}),jsxRuntime.jsx("span",{children:"Dark"})]})]})]})}var be=c(()=>{"use client";});function ve({value:e,onChange:r}){return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("span",{className:"previewcn-label",children:"Presets"}),jsxRuntime.jsx("div",{className:"previewcn-preset-grid",children:$.map(o=>{let t=e===o.name,n=o.colors.light.primary,p=o.colors.light.background;return jsxRuntime.jsxs("button",{onClick:()=>r(o.name),className:`previewcn-preset-card ${t?"previewcn-preset-card--selected":""}`,"aria-label":o.label,"aria-pressed":t,children:[jsxRuntime.jsxs("div",{className:"previewcn-preset-preview",children:[jsxRuntime.jsx("div",{className:"previewcn-preset-color previewcn-preset-color--bg",style:{backgroundColor:p}}),jsxRuntime.jsx("div",{className:"previewcn-preset-color previewcn-preset-color--primary",style:{backgroundColor:n}})]}),jsxRuntime.jsx("span",{className:"previewcn-preset-label",children:o.label})]},o.name)})})]})}var ye=c(()=>{"use client";y();});var we,Ce=c(()=>{we=[{name:"none",label:"None",value:"0rem"},{name:"sm",label:"SM",value:"0.3rem"},{name:"md",label:"MD",value:"0.5rem"},{name:"lg",label:"LG",value:"0.625rem"},{name:"xl",label:"XL",value:"0.75rem"},{name:"full",label:"Full",value:"1rem"}];});function Fe({value:e,onChange:r}){return jsxRuntime.jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsxRuntime.jsx("label",{className:"previewcn-label",children:"Radius"}),jsxRuntime.jsx("div",{className:"previewcn-radius-grid",children:we.map(o=>{let t=e===o.value;return jsxRuntime.jsxs("button",{onClick:()=>r(o.value),className:`previewcn-radius-btn previewcn-control ${t?"previewcn-control--selected":""}`,title:o.label,children:[jsxRuntime.jsx("span",{className:"previewcn-radius-preview",style:{borderRadius:o.value}}),jsxRuntime.jsx("span",{className:"previewcn-radius-label",children:o.label})]},o.name)})})]})}var xe=c(()=>{"use client";Ce();});var Se={};Re(Se,{default:()=>Te});function qe(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]})}function Qe(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),jsxRuntime.jsx("path",{d:"M3 3v5h5"})]})}function Te({onClose:e}){let{config:r,setColorPreset:o,setRadius:t,setDarkMode:n,setFont:p,setPresetTheme:a,resetTheme:F}=ne(),b=react.useRef(false);return react.useEffect(()=>{b.current||(b.current=true,_(r));},[r]),jsxRuntime.jsxs("div",{className:"previewcn-panel",children:[jsxRuntime.jsxs("div",{className:"previewcn-header",children:[jsxRuntime.jsx("div",{className:"previewcn-title",children:jsxRuntime.jsx("span",{className:"previewcn-logo",children:"previewcn"})}),jsxRuntime.jsx("button",{onClick:e,className:"previewcn-control previewcn-control--ghost previewcn-icon-btn previewcn-close-btn","aria-label":"Close",children:jsxRuntime.jsx(qe,{})})]}),jsxRuntime.jsxs("div",{className:"previewcn-content",children:[jsxRuntime.jsx(ve,{value:r.preset,onChange:a}),jsxRuntime.jsx(ae,{value:r.colorPreset,onChange:o}),jsxRuntime.jsx(Fe,{value:r.radius,onChange:t}),jsxRuntime.jsx(fe,{value:r.font,onChange:p}),jsxRuntime.jsx(ke,{value:r.darkMode,onChange:n})]}),jsxRuntime.jsxs("div",{className:"previewcn-footer",children:[jsxRuntime.jsx(ue,{config:r}),jsxRuntime.jsxs("button",{onClick:F,className:"previewcn-control previewcn-control--ghost previewcn-reset-btn",children:[jsxRuntime.jsx(Qe,{}),jsxRuntime.jsx("span",{children:"Reset"})]})]})]})}var Ne=c(()=>{"use client";le();M();se();he();me();be();ye();xe();});function Me(){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"})]})}function A({onClick:e}){return jsxRuntime.jsx("button",{onClick:e,className:"previewcn-trigger","aria-label":"Open PreviewCN theme editor",title:"PreviewCN Theme Editor",children:jsxRuntime.jsx(Me,{})})}var tr=react.lazy(()=>Promise.resolve().then(()=>(Ne(),Se))),nr=process.env.NODE_ENV==="development";function lr(){let[e,r]=react.useState(false);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx(A,{onClick:()=>r(true)}),e&&jsxRuntime.jsx(react.Suspense,{fallback:null,children:jsxRuntime.jsx(tr,{onClose:()=>r(false)})})]})}function ar(){return nr?jsxRuntime.jsx(lr,{}):null}M();
17
+ exports.PreviewcnDevtools=ar;exports.applyColors=E;exports.applyDarkMode=N;exports.applyFont=R;exports.applyRadius=w;exports.applyTheme=_;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import {lazy,useRef,useEffect,useState,useCallback,Suspense}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var we=Object.defineProperty;var c=(e,r)=>()=>(e&&(r=e(e=0)),r);var Pe=(e,r)=>{for(var o in r)we(e,o,{get:r[o],enumerable:true});};function k(e){return Se.get(e)}var R,Se,P=c(()=>{R=[{name:"vercel",label:"Vercel",colors:{light:{background:"oklch(0.99 0 0)",foreground:"oklch(0 0 0)",card:"oklch(1.00 0 0)","card-foreground":"oklch(0 0 0)",popover:"oklch(0.99 0 0)","popover-foreground":"oklch(0 0 0)",primary:"oklch(0 0 0)","primary-foreground":"oklch(1.00 0 0)",secondary:"oklch(0.94 0 0)","secondary-foreground":"oklch(0 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.44 0 0)",accent:"oklch(0.94 0 0)","accent-foreground":"oklch(0 0 0)",destructive:"oklch(0.63 0.19 23.03)","destructive-foreground":"oklch(1.00 0 0)",border:"oklch(0.92 0 0)",input:"oklch(0.94 0 0)",ring:"oklch(0 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.55 0.22 264.53)","chart-3":"oklch(0.72 0 0)","chart-4":"oklch(0.92 0 0)","chart-5":"oklch(0.56 0 0)",sidebar:"oklch(0.99 0 0)","sidebar-foreground":"oklch(0 0 0)","sidebar-primary":"oklch(0 0 0)","sidebar-primary-foreground":"oklch(1.00 0 0)","sidebar-accent":"oklch(0.94 0 0)","sidebar-accent-foreground":"oklch(0 0 0)","sidebar-border":"oklch(0.94 0 0)","sidebar-ring":"oklch(0 0 0)"},dark:{background:"oklch(0 0 0)",foreground:"oklch(1.00 0 0)",card:"oklch(0.14 0 0)","card-foreground":"oklch(1.00 0 0)",popover:"oklch(0.18 0 0)","popover-foreground":"oklch(1.00 0 0)",primary:"oklch(1.00 0 0)","primary-foreground":"oklch(0 0 0)",secondary:"oklch(0.25 0 0)","secondary-foreground":"oklch(1.00 0 0)",muted:"oklch(0.23 0 0)","muted-foreground":"oklch(0.72 0 0)",accent:"oklch(0.32 0 0)","accent-foreground":"oklch(1.00 0 0)",destructive:"oklch(0.69 0.20 23.91)","destructive-foreground":"oklch(0 0 0)",border:"oklch(0.26 0 0)",input:"oklch(0.32 0 0)",ring:"oklch(0.72 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.58 0.21 260.84)","chart-3":"oklch(0.56 0 0)","chart-4":"oklch(0.44 0 0)","chart-5":"oklch(0.92 0 0)",sidebar:"oklch(0.18 0 0)","sidebar-foreground":"oklch(1.00 0 0)","sidebar-primary":"oklch(1.00 0 0)","sidebar-primary-foreground":"oklch(0 0 0)","sidebar-accent":"oklch(0.32 0 0)","sidebar-accent-foreground":"oklch(1.00 0 0)","sidebar-border":"oklch(0.32 0 0)","sidebar-ring":"oklch(0.72 0 0)"}},radius:"0.5rem",font:{value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"}},{name:"supabase",label:"Supabase",colors:{light:{background:"#fcfcfc",foreground:"#171717",card:"#fcfcfc","card-foreground":"#171717",popover:"#fcfcfc","popover-foreground":"#525252",primary:"#72e3ad","primary-foreground":"#1e2723",secondary:"#fdfdfd","secondary-foreground":"#171717",muted:"#ededed","muted-foreground":"#202020",accent:"#ededed","accent-foreground":"#202020",destructive:"#ca3214","destructive-foreground":"#fffcfc",border:"#dfdfdf",input:"#f6f6f6",ring:"#72e3ad","chart-1":"#72e3ad","chart-2":"#3b82f6","chart-3":"#8b5cf6","chart-4":"#f59e0b","chart-5":"#10b981",sidebar:"#fcfcfc","sidebar-foreground":"#707070","sidebar-primary":"#72e3ad","sidebar-primary-foreground":"#1e2723","sidebar-accent":"#ededed","sidebar-accent-foreground":"#202020","sidebar-border":"#dfdfdf","sidebar-ring":"#72e3ad"},dark:{background:"#121212",foreground:"#e2e8f0",card:"#171717","card-foreground":"#e2e8f0",popover:"#242424","popover-foreground":"#a9a9a9",primary:"#006239","primary-foreground":"#dde8e3",secondary:"#242424","secondary-foreground":"#fafafa",muted:"#1f1f1f","muted-foreground":"#a2a2a2",accent:"#313131","accent-foreground":"#fafafa",destructive:"#541c15","destructive-foreground":"#ede9e8",border:"#292929",input:"#242424",ring:"#4ade80","chart-1":"#4ade80","chart-2":"#60a5fa","chart-3":"#a78bfa","chart-4":"#fbbf24","chart-5":"#2dd4bf",sidebar:"#121212","sidebar-foreground":"#898989","sidebar-primary":"#006239","sidebar-primary-foreground":"#dde8e3","sidebar-accent":"#313131","sidebar-accent-foreground":"#fafafa","sidebar-border":"#292929","sidebar-ring":"#4ade80"}},radius:"0.5rem",font:{value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"}},{name:"claude",label:"Claude",colors:{light:{background:"#faf9f5",foreground:"#3d3929",card:"#faf9f5","card-foreground":"#141413",popover:"#ffffff","popover-foreground":"#28261b",primary:"#c96442","primary-foreground":"#ffffff",secondary:"#e9e6dc","secondary-foreground":"#535146",muted:"#ede9de","muted-foreground":"#83827d",accent:"#e9e6dc","accent-foreground":"#28261b",destructive:"#141413","destructive-foreground":"#ffffff",border:"#dad9d4",input:"#b4b2a7",ring:"#c96442","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#ded8c4","chart-4":"#dbd3f0","chart-5":"#b4552d",sidebar:"#f5f4ee","sidebar-foreground":"#3d3d3a","sidebar-primary":"#c96442","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#e9e6dc","sidebar-accent-foreground":"#343434","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"},dark:{background:"#262624",foreground:"#c3c0b6",card:"#262624","card-foreground":"#faf9f5",popover:"#30302e","popover-foreground":"#e5e5e2",primary:"#d97757","primary-foreground":"#ffffff",secondary:"#faf9f5","secondary-foreground":"#30302e",muted:"#1b1b19","muted-foreground":"#b7b5a9",accent:"#1a1915","accent-foreground":"#f5f4ee",destructive:"#ef4444","destructive-foreground":"#ffffff",border:"#3e3e38",input:"#52514a",ring:"#d97757","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#1a1915","chart-4":"#2f2b48","chart-5":"#b4552d",sidebar:"#1f1e1d","sidebar-foreground":"#c3c0b6","sidebar-primary":"#343434","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#0f0f0e","sidebar-accent-foreground":"#c3c0b6","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"}},radius:"0.5rem"}],Se=new Map(R.map(e=>[e.name,e]));});var Y,z=c(()=>{Y=[{name:"neutral",label:"Neutral",primary:{light:"oklch(0.556 0 0)",dark:"oklch(0.708 0 0)"},primaryForeground:{light:"oklch(0.985 0 0)",dark:"oklch(0.205 0 0)"}},{name:"red",label:"Red",primary:{light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.637 0.237 25.331)"},primaryForeground:{light:"oklch(0.971 0.013 17.38)",dark:"oklch(0.971 0.013 17.38)"},destructive:{light:"oklch(0.505 0.213 27.518)"}},{name:"orange",label:"Orange",primary:{light:"oklch(0.646 0.222 41.116)",dark:"oklch(0.705 0.213 47.604)"},primaryForeground:{light:"oklch(0.98 0.016 73.684)",dark:"oklch(0.98 0.016 73.684)"}},{name:"amber",label:"Amber",primary:{light:"oklch(0.67 0.16 58)",dark:"oklch(0.77 0.16 70)"},primaryForeground:{light:"oklch(0.99 0.02 95)",dark:"oklch(0.28 0.07 46)"}},{name:"yellow",label:"Yellow",primary:{light:"oklch(0.852 0.199 91.936)",dark:"oklch(0.795 0.184 86.047)"},primaryForeground:{light:"oklch(0.421 0.095 57.708)",dark:"oklch(0.421 0.095 57.708)"}},{name:"lime",label:"Lime",primary:{light:"oklch(0.65 0.18 132)",dark:"oklch(0.77 0.20 131)"},primaryForeground:{light:"oklch(0.99 0.03 121)",dark:"oklch(0.27 0.07 132)"}},{name:"green",label:"Green",primary:{light:"oklch(0.648 0.2 131.684)",dark:"oklch(0.648 0.2 131.684)"},primaryForeground:{light:"oklch(0.986 0.031 120.757)",dark:"oklch(0.986 0.031 120.757)"}},{name:"emerald",label:"Emerald",primary:{light:"oklch(0.60 0.13 163)",dark:"oklch(0.70 0.15 162)"},primaryForeground:{light:"oklch(0.98 0.02 166)",dark:"oklch(0.26 0.05 173)"}},{name:"teal",label:"Teal",primary:{light:"oklch(0.60 0.10 185)",dark:"oklch(0.70 0.12 183)"},primaryForeground:{light:"oklch(0.98 0.01 181)",dark:"oklch(0.28 0.04 193)"}},{name:"cyan",label:"Cyan",primary:{light:"oklch(0.61 0.11 222)",dark:"oklch(0.71 0.13 215)"},primaryForeground:{light:"oklch(0.98 0.02 201)",dark:"oklch(0.30 0.05 230)"}},{name:"sky",label:"Sky",primary:{light:"oklch(0.59 0.14 242)",dark:"oklch(0.68 0.15 237)"},primaryForeground:{light:"oklch(0.98 0.01 237)",dark:"oklch(0.29 0.06 243)"}},{name:"blue",label:"Blue",primary:{light:"oklch(0.488 0.243 264.376)",dark:"oklch(0.42 0.18 266)"},primaryForeground:{light:"oklch(0.97 0.014 254.604)",dark:"oklch(0.97 0.014 254.604)"}},{name:"indigo",label:"Indigo",primary:{light:"oklch(0.51 0.23 277)",dark:"oklch(0.59 0.20 277)"},primaryForeground:{light:"oklch(0.96 0.02 272)",dark:"oklch(0.96 0.02 272)"}},{name:"violet",label:"Violet",primary:{light:"oklch(0.541 0.281 293.009)",dark:"oklch(0.606 0.25 292.717)"},primaryForeground:{light:"oklch(0.969 0.016 293.756)",dark:"oklch(0.969 0.016 293.756)"}},{name:"purple",label:"Purple",primary:{light:"oklch(0.56 0.25 302)",dark:"oklch(0.63 0.23 304)"},primaryForeground:{light:"oklch(0.98 0.01 308)",dark:"oklch(0.98 0.01 308)"}},{name:"fuchsia",label:"Fuchsia",primary:{light:"oklch(0.59 0.26 323)",dark:"oklch(0.67 0.26 322)"},primaryForeground:{light:"oklch(0.98 0.02 320)",dark:"oklch(0.98 0.02 320)"}},{name:"pink",label:"Pink",primary:{light:"oklch(0.59 0.22 1)",dark:"oklch(0.66 0.21 354)"},primaryForeground:{light:"oklch(0.97 0.01 343)",dark:"oklch(0.97 0.01 343)"}},{name:"rose",label:"Rose",primary:{light:"oklch(0.586 0.253 17.585)",dark:"oklch(0.645 0.246 16.439)"},primaryForeground:{light:"oklch(0.969 0.015 12.422)",dark:"oklch(0.969 0.015 12.422)"}}];});function Te(e){return {name:e.name,label:e.label,colors:{light:{...A.light,primary:e.primary.light,"primary-foreground":e.primaryForeground?.light??j.light,destructive:e.destructive?.light??G.light},dark:{...A.dark,primary:e.primary.dark,"primary-foreground":e.primaryForeground?.dark??j.dark,destructive:e.destructive?.dark??G.dark}}}}function K(e){return L.find(r=>r.name===e)}var A,G,j,L,I=c(()=>{z();A={light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.708 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.205 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.205 0 0)","popover-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",border:"oklch(1 0 0 / 10%)",input:"oklch(1 0 0 / 15%)",ring:"oklch(0.556 0 0)"}},G={light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.704 0.191 22.216)"},j={light:"oklch(0.985 0 0)",dark:"oklch(0.985 0 0)"};L=Y.map(Te);});function X(e){return C.find(r=>r.value===e)}var C,O=c(()=>{C=[{label:"Inter",value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"},{label:"Noto Sans",value:"noto-sans",fontFamily:'"Noto Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},{label:"Nunito Sans",value:"nunito-sans",fontFamily:'"Nunito Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700&display=swap"},{label:"Figtree",value:"figtree",fontFamily:'"Figtree", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap"},{label:"Roboto",value:"roboto",fontFamily:'"Roboto", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"},{label:"Raleway",value:"raleway",fontFamily:'"Raleway", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap"},{label:"DM Sans",value:"dm-sans",fontFamily:'"DM Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"},{label:"Public Sans",value:"public-sans",fontFamily:'"Public Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap"},{label:"Outfit",value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"},{label:"JetBrains Mono",value:"jetbrains-mono",fontFamily:'"JetBrains Mono", monospace',googleFontsUrl:"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"}];});function Ne(){let e=document.getElementById(D);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=D,document.head.appendChild(r),r}function Z(e){return Object.entries(e).map(([r,o])=>`--${r}: ${o};`).join(" ")}function q(e){let r=Ne(),o=Z(e.light),t=Z(e.dark);r.textContent=`:root { ${o} } .dark { ${t} }`;}function F(e){let r=document.documentElement;e?(r.classList.remove("light"),r.classList.add("dark")):(r.classList.remove("dark"),r.classList.add("light")),r.style.colorScheme=e?"dark":"light";}function v(e){document.documentElement.style.setProperty("--radius",e);}function S(e){let r=K(e);r&&q(r.colors);}function Q(e){q(e.colors);}function xe(){let e=document.getElementById(B);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=B,document.head.appendChild(r),r}function U(e){let{fontFamily:r,googleFontsUrl:o,value:t}=e;if(!o.startsWith("https://fonts.googleapis.com/")){console.warn("[PreviewCN] Invalid font URL");return}let d=`previewcn-font-${t}`;if(!document.getElementById(d)){let i=document.createElement("link");i.id=d,i.rel="stylesheet",i.href=o,document.head.appendChild(i);}let p=xe();p.textContent=`
2
+ import {lazy,useRef,useEffect,useState,useCallback,Suspense}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var Ee=Object.defineProperty;var c=(e,r)=>()=>(e&&(r=e(e=0)),r);var Re=(e,r)=>{for(var o in r)Ee(e,o,{get:r[o],enumerable:true});};function g(e){return Ie.get(e)}var $,Ie,y=c(()=>{$=[{name:"vercel",label:"Vercel",colors:{light:{background:"oklch(0.99 0 0)",foreground:"oklch(0 0 0)",card:"oklch(1.00 0 0)","card-foreground":"oklch(0 0 0)",popover:"oklch(0.99 0 0)","popover-foreground":"oklch(0 0 0)",primary:"oklch(0 0 0)","primary-foreground":"oklch(1.00 0 0)",secondary:"oklch(0.94 0 0)","secondary-foreground":"oklch(0 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.44 0 0)",accent:"oklch(0.94 0 0)","accent-foreground":"oklch(0 0 0)",destructive:"oklch(0.63 0.19 23.03)","destructive-foreground":"oklch(1.00 0 0)",border:"oklch(0.92 0 0)",input:"oklch(0.94 0 0)",ring:"oklch(0 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.55 0.22 264.53)","chart-3":"oklch(0.72 0 0)","chart-4":"oklch(0.92 0 0)","chart-5":"oklch(0.56 0 0)",sidebar:"oklch(0.99 0 0)","sidebar-foreground":"oklch(0 0 0)","sidebar-primary":"oklch(0 0 0)","sidebar-primary-foreground":"oklch(1.00 0 0)","sidebar-accent":"oklch(0.94 0 0)","sidebar-accent-foreground":"oklch(0 0 0)","sidebar-border":"oklch(0.94 0 0)","sidebar-ring":"oklch(0 0 0)"},dark:{background:"oklch(0 0 0)",foreground:"oklch(1.00 0 0)",card:"oklch(0.14 0 0)","card-foreground":"oklch(1.00 0 0)",popover:"oklch(0.18 0 0)","popover-foreground":"oklch(1.00 0 0)",primary:"oklch(1.00 0 0)","primary-foreground":"oklch(0 0 0)",secondary:"oklch(0.25 0 0)","secondary-foreground":"oklch(1.00 0 0)",muted:"oklch(0.23 0 0)","muted-foreground":"oklch(0.72 0 0)",accent:"oklch(0.32 0 0)","accent-foreground":"oklch(1.00 0 0)",destructive:"oklch(0.69 0.20 23.91)","destructive-foreground":"oklch(0 0 0)",border:"oklch(0.26 0 0)",input:"oklch(0.32 0 0)",ring:"oklch(0.72 0 0)","chart-1":"oklch(0.81 0.17 75.35)","chart-2":"oklch(0.58 0.21 260.84)","chart-3":"oklch(0.56 0 0)","chart-4":"oklch(0.44 0 0)","chart-5":"oklch(0.92 0 0)",sidebar:"oklch(0.18 0 0)","sidebar-foreground":"oklch(1.00 0 0)","sidebar-primary":"oklch(1.00 0 0)","sidebar-primary-foreground":"oklch(0 0 0)","sidebar-accent":"oklch(0.32 0 0)","sidebar-accent-foreground":"oklch(1.00 0 0)","sidebar-border":"oklch(0.32 0 0)","sidebar-ring":"oklch(0.72 0 0)"}},radius:"0.5rem",font:{value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"}},{name:"supabase",label:"Supabase",colors:{light:{background:"#fcfcfc",foreground:"#171717",card:"#fcfcfc","card-foreground":"#171717",popover:"#fcfcfc","popover-foreground":"#525252",primary:"#72e3ad","primary-foreground":"#1e2723",secondary:"#fdfdfd","secondary-foreground":"#171717",muted:"#ededed","muted-foreground":"#202020",accent:"#ededed","accent-foreground":"#202020",destructive:"#ca3214","destructive-foreground":"#fffcfc",border:"#dfdfdf",input:"#f6f6f6",ring:"#72e3ad","chart-1":"#72e3ad","chart-2":"#3b82f6","chart-3":"#8b5cf6","chart-4":"#f59e0b","chart-5":"#10b981",sidebar:"#fcfcfc","sidebar-foreground":"#707070","sidebar-primary":"#72e3ad","sidebar-primary-foreground":"#1e2723","sidebar-accent":"#ededed","sidebar-accent-foreground":"#202020","sidebar-border":"#dfdfdf","sidebar-ring":"#72e3ad"},dark:{background:"#121212",foreground:"#e2e8f0",card:"#171717","card-foreground":"#e2e8f0",popover:"#242424","popover-foreground":"#a9a9a9",primary:"#006239","primary-foreground":"#dde8e3",secondary:"#242424","secondary-foreground":"#fafafa",muted:"#1f1f1f","muted-foreground":"#a2a2a2",accent:"#313131","accent-foreground":"#fafafa",destructive:"#541c15","destructive-foreground":"#ede9e8",border:"#292929",input:"#242424",ring:"#4ade80","chart-1":"#4ade80","chart-2":"#60a5fa","chart-3":"#a78bfa","chart-4":"#fbbf24","chart-5":"#2dd4bf",sidebar:"#121212","sidebar-foreground":"#898989","sidebar-primary":"#006239","sidebar-primary-foreground":"#dde8e3","sidebar-accent":"#313131","sidebar-accent-foreground":"#fafafa","sidebar-border":"#292929","sidebar-ring":"#4ade80"}},radius:"0.5rem",font:{value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"}},{name:"claude",label:"Claude",colors:{light:{background:"#faf9f5",foreground:"#3d3929",card:"#faf9f5","card-foreground":"#141413",popover:"#ffffff","popover-foreground":"#28261b",primary:"#c96442","primary-foreground":"#ffffff",secondary:"#e9e6dc","secondary-foreground":"#535146",muted:"#ede9de","muted-foreground":"#83827d",accent:"#e9e6dc","accent-foreground":"#28261b",destructive:"#141413","destructive-foreground":"#ffffff",border:"#dad9d4",input:"#b4b2a7",ring:"#c96442","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#ded8c4","chart-4":"#dbd3f0","chart-5":"#b4552d",sidebar:"#f5f4ee","sidebar-foreground":"#3d3d3a","sidebar-primary":"#c96442","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#e9e6dc","sidebar-accent-foreground":"#343434","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"},dark:{background:"#262624",foreground:"#c3c0b6",card:"#262624","card-foreground":"#faf9f5",popover:"#30302e","popover-foreground":"#e5e5e2",primary:"#d97757","primary-foreground":"#ffffff",secondary:"#faf9f5","secondary-foreground":"#30302e",muted:"#1b1b19","muted-foreground":"#b7b5a9",accent:"#1a1915","accent-foreground":"#f5f4ee",destructive:"#ef4444","destructive-foreground":"#ffffff",border:"#3e3e38",input:"#52514a",ring:"#d97757","chart-1":"#b05730","chart-2":"#9c87f5","chart-3":"#1a1915","chart-4":"#2f2b48","chart-5":"#b4552d",sidebar:"#1f1e1d","sidebar-foreground":"#c3c0b6","sidebar-primary":"#343434","sidebar-primary-foreground":"#fbfbfb","sidebar-accent":"#0f0f0e","sidebar-accent-foreground":"#c3c0b6","sidebar-border":"#ebebeb","sidebar-ring":"#b5b5b5"}},radius:"0.5rem"}],Ie=new Map($.map(e=>[e.name,e]));});var Y,z=c(()=>{Y=[{name:"neutral",label:"Neutral",primary:{light:"oklch(0.556 0 0)",dark:"oklch(0.708 0 0)"},primaryForeground:{light:"oklch(0.985 0 0)",dark:"oklch(0.205 0 0)"}},{name:"red",label:"Red",primary:{light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.637 0.237 25.331)"},primaryForeground:{light:"oklch(0.971 0.013 17.38)",dark:"oklch(0.971 0.013 17.38)"},destructive:{light:"oklch(0.505 0.213 27.518)"}},{name:"orange",label:"Orange",primary:{light:"oklch(0.646 0.222 41.116)",dark:"oklch(0.705 0.213 47.604)"},primaryForeground:{light:"oklch(0.98 0.016 73.684)",dark:"oklch(0.98 0.016 73.684)"}},{name:"amber",label:"Amber",primary:{light:"oklch(0.67 0.16 58)",dark:"oklch(0.77 0.16 70)"},primaryForeground:{light:"oklch(0.99 0.02 95)",dark:"oklch(0.28 0.07 46)"}},{name:"yellow",label:"Yellow",primary:{light:"oklch(0.852 0.199 91.936)",dark:"oklch(0.795 0.184 86.047)"},primaryForeground:{light:"oklch(0.421 0.095 57.708)",dark:"oklch(0.421 0.095 57.708)"}},{name:"lime",label:"Lime",primary:{light:"oklch(0.65 0.18 132)",dark:"oklch(0.77 0.20 131)"},primaryForeground:{light:"oklch(0.99 0.03 121)",dark:"oklch(0.27 0.07 132)"}},{name:"green",label:"Green",primary:{light:"oklch(0.648 0.2 131.684)",dark:"oklch(0.648 0.2 131.684)"},primaryForeground:{light:"oklch(0.986 0.031 120.757)",dark:"oklch(0.986 0.031 120.757)"}},{name:"emerald",label:"Emerald",primary:{light:"oklch(0.60 0.13 163)",dark:"oklch(0.70 0.15 162)"},primaryForeground:{light:"oklch(0.98 0.02 166)",dark:"oklch(0.26 0.05 173)"}},{name:"teal",label:"Teal",primary:{light:"oklch(0.60 0.10 185)",dark:"oklch(0.70 0.12 183)"},primaryForeground:{light:"oklch(0.98 0.01 181)",dark:"oklch(0.28 0.04 193)"}},{name:"cyan",label:"Cyan",primary:{light:"oklch(0.61 0.11 222)",dark:"oklch(0.71 0.13 215)"},primaryForeground:{light:"oklch(0.98 0.02 201)",dark:"oklch(0.30 0.05 230)"}},{name:"sky",label:"Sky",primary:{light:"oklch(0.59 0.14 242)",dark:"oklch(0.68 0.15 237)"},primaryForeground:{light:"oklch(0.98 0.01 237)",dark:"oklch(0.29 0.06 243)"}},{name:"blue",label:"Blue",primary:{light:"oklch(0.488 0.243 264.376)",dark:"oklch(0.42 0.18 266)"},primaryForeground:{light:"oklch(0.97 0.014 254.604)",dark:"oklch(0.97 0.014 254.604)"}},{name:"indigo",label:"Indigo",primary:{light:"oklch(0.51 0.23 277)",dark:"oklch(0.59 0.20 277)"},primaryForeground:{light:"oklch(0.96 0.02 272)",dark:"oklch(0.96 0.02 272)"}},{name:"violet",label:"Violet",primary:{light:"oklch(0.541 0.281 293.009)",dark:"oklch(0.606 0.25 292.717)"},primaryForeground:{light:"oklch(0.969 0.016 293.756)",dark:"oklch(0.969 0.016 293.756)"}},{name:"purple",label:"Purple",primary:{light:"oklch(0.56 0.25 302)",dark:"oklch(0.63 0.23 304)"},primaryForeground:{light:"oklch(0.98 0.01 308)",dark:"oklch(0.98 0.01 308)"}},{name:"fuchsia",label:"Fuchsia",primary:{light:"oklch(0.59 0.26 323)",dark:"oklch(0.67 0.26 322)"},primaryForeground:{light:"oklch(0.98 0.02 320)",dark:"oklch(0.98 0.02 320)"}},{name:"pink",label:"Pink",primary:{light:"oklch(0.59 0.22 1)",dark:"oklch(0.66 0.21 354)"},primaryForeground:{light:"oklch(0.97 0.01 343)",dark:"oklch(0.97 0.01 343)"}},{name:"rose",label:"Rose",primary:{light:"oklch(0.586 0.253 17.585)",dark:"oklch(0.645 0.246 16.439)"},primaryForeground:{light:"oklch(0.969 0.015 12.422)",dark:"oklch(0.969 0.015 12.422)"}}];});function $e(e){return {name:e.name,label:e.label,colors:{light:{...G.light,primary:e.primary.light,"primary-foreground":e.primaryForeground?.light??X.light,destructive:e.destructive?.light??K.light},dark:{...G.dark,primary:e.primary.dark,"primary-foreground":e.primaryForeground?.dark??X.dark,destructive:e.destructive?.dark??K.dark}}}}function x(e){return B.find(r=>r.name===e)}var G,K,X,B,T=c(()=>{z();G={light:{background:"oklch(1 0 0)",foreground:"oklch(0.145 0 0)",card:"oklch(1 0 0)","card-foreground":"oklch(0.145 0 0)",popover:"oklch(1 0 0)","popover-foreground":"oklch(0.145 0 0)",secondary:"oklch(0.97 0 0)","secondary-foreground":"oklch(0.205 0 0)",muted:"oklch(0.97 0 0)","muted-foreground":"oklch(0.556 0 0)",accent:"oklch(0.97 0 0)","accent-foreground":"oklch(0.205 0 0)",border:"oklch(0.922 0 0)",input:"oklch(0.922 0 0)",ring:"oklch(0.708 0 0)"},dark:{background:"oklch(0.145 0 0)",foreground:"oklch(0.985 0 0)",card:"oklch(0.205 0 0)","card-foreground":"oklch(0.985 0 0)",popover:"oklch(0.205 0 0)","popover-foreground":"oklch(0.985 0 0)",secondary:"oklch(0.269 0 0)","secondary-foreground":"oklch(0.985 0 0)",muted:"oklch(0.269 0 0)","muted-foreground":"oklch(0.708 0 0)",accent:"oklch(0.269 0 0)","accent-foreground":"oklch(0.985 0 0)",border:"oklch(1 0 0 / 10%)",input:"oklch(1 0 0 / 15%)",ring:"oklch(0.556 0 0)"}},K={light:"oklch(0.577 0.245 27.325)",dark:"oklch(0.704 0.191 22.216)"},X={light:"oklch(0.985 0 0)",dark:"oklch(0.985 0 0)"};B=Y.map($e);});function Z(e){return S.find(r=>r.value===e)}var S,O=c(()=>{S=[{label:"Inter",value:"inter",fontFamily:'"Inter", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"},{label:"Noto Sans",value:"noto-sans",fontFamily:'"Noto Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700&display=swap"},{label:"Nunito Sans",value:"nunito-sans",fontFamily:'"Nunito Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700&display=swap"},{label:"Figtree",value:"figtree",fontFamily:'"Figtree", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap"},{label:"Roboto",value:"roboto",fontFamily:'"Roboto", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"},{label:"Raleway",value:"raleway",fontFamily:'"Raleway", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap"},{label:"DM Sans",value:"dm-sans",fontFamily:'"DM Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap"},{label:"Public Sans",value:"public-sans",fontFamily:'"Public Sans", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap"},{label:"Outfit",value:"outfit",fontFamily:'"Outfit", sans-serif',googleFontsUrl:"https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap"},{label:"JetBrains Mono",value:"jetbrains-mono",fontFamily:'"JetBrains Mono", monospace',googleFontsUrl:"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"}];});function Be(){let e=document.getElementById(D);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=D,document.head.appendChild(r),r}function q(e){return Object.entries(e).map(([r,o])=>`--${r}: ${o};`).join(" ")}function Q(e){let r=Be(),o=q(e.light),t=q(e.dark);r.textContent=`:root { ${o} } .dark { ${t} }`;}function N(e){let r=document.documentElement;e?(r.classList.remove("light"),r.classList.add("dark")):(r.classList.remove("dark"),r.classList.add("light")),r.style.colorScheme=e?"dark":"light";}function w(e){document.documentElement.style.setProperty("--radius",e);}function E(e){let r=x(e);r&&Q(r.colors);}function ee(e){Q(e.colors);}function Oe(){let e=document.getElementById(U);if(e instanceof HTMLStyleElement)return e;e&&e.remove();let r=document.createElement("style");return r.id=U,document.head.appendChild(r),r}function W(e){let{fontFamily:r,googleFontsUrl:o,value:t}=e;if(!o.startsWith("https://fonts.googleapis.com/")){console.warn("[PreviewCN] Invalid font URL");return}let n=`previewcn-font-${t}`;if(!document.getElementById(n)){let a=document.createElement("link");a.id=n,a.rel="stylesheet",a.href=o,document.head.appendChild(a);}let p=Oe();p.textContent=`
3
3
  :root {
4
4
  --font-sans: ${r} !important;
5
5
  --font-sans-override: ${r} !important;
@@ -8,5 +8,10 @@ import {lazy,useRef,useEffect,useState,useCallback,Suspense}from'react';import {
8
8
  html, body, .font-sans {
9
9
  font-family: ${r} !important;
10
10
  }
11
- `;}function T(e){let r=X(e);r&&U(r);}function ee(e){let r=k(e);r&&(Q(r),v(r.radius),r.font&&U(r.font));}function $(e){let r=e.preset?k(e.preset):null;e.colorPreset!==null?S(e.colorPreset):r&&Q(r);let o=e.radius??r?.radius;o!=null&&v(o),e.darkMode!==null&&F(e.darkMode),e.font!==null?T(e.font):r?.font&&U(r.font);}function re(){let e=document.getElementById(D);e&&e.remove();let r=document.getElementById(B);r&&r.remove();let o=document.documentElement;o.style.removeProperty("--radius"),o.style.removeProperty("color-scheme"),o.classList.remove("light","dark");}var D,B,N=c(()=>{I();O();P();D="previewcn-devtools-theme-colors",B="previewcn-devtools-theme-font";});function Ee(){if(typeof window>"u")return {};try{let e=localStorage.getItem(_);if(e)return JSON.parse(e)}catch{}return {}}function Re(e){if(!(typeof window>"u"))try{localStorage.setItem(_,JSON.stringify(e));}catch{}}function te(){let[e,r]=useState(()=>({...oe,...Ee()})),o=useCallback(n=>{r(s=>{let m=n(s);return Re(m),m});},[]),t=useCallback(n=>{o(s=>({...s,colorPreset:n})),S(n);},[o]),d=useCallback(n=>{o(s=>({...s,radius:n})),v(n);},[o]),p=useCallback(n=>{o(s=>({...s,darkMode:n})),F(n);},[o]),i=useCallback(n=>{o(s=>({...s,font:n})),T(n);},[o]),E=useCallback(n=>{let s=k(n);s&&(o(m=>({...m,preset:n,radius:s.radius,font:s.font?.value??m.font,colorPreset:null})),ee(n));},[o]),w=useCallback(()=>{typeof window<"u"&&localStorage.removeItem(_),re(),r(oe);},[]);return {config:e,setColorPreset:t,setRadius:d,setDarkMode:p,setFont:i,setPresetTheme:E,resetTheme:w}}var _,oe,ne=c(()=>{"use client";P();N();_="previewcn-devtools-theme";oe={colorPreset:null,radius:null,darkMode:null,font:null,preset:null};});function le({value:e,onChange:r}){return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("label",{className:"previewcn-label",children:"Theme"}),jsx("div",{className:"previewcn-color-grid",children:L.map(o=>{let t=e===o.name,d=o.colors.light.primary;return jsx("button",{onClick:()=>r(o.name),className:`previewcn-color-swatch ${t?"previewcn-color-swatch--selected":""}`,style:{backgroundColor:d},"aria-label":o.label,title:o.label},o.name)})})]})}var ae=c(()=>{"use client";I();});function Oe(){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"m6 9 6 6 6-6"})})}function ie({value:e,onChange:r}){let[o,t]=useState(false),p=C.find(i=>i.value===e)?.label??"Select font...";return jsxs("div",{className:`previewcn-section previewcn-surface ${o?"previewcn-section--overlay":""}`,children:[jsx("label",{className:"previewcn-label",children:"Font"}),jsxs("div",{className:"previewcn-select-wrapper",children:[jsxs("button",{onClick:()=>t(!o),className:"previewcn-select-trigger previewcn-control","aria-expanded":o,children:[jsx("span",{children:p}),jsx(Oe,{})]}),o&&jsx("div",{className:"previewcn-select-dropdown",children:C.map(i=>jsx("button",{onClick:()=>{r(i.value),t(false);},className:`previewcn-select-option previewcn-option ${e===i.value?"previewcn-option--selected":""}`,children:i.label},i.value))})]})]})}var se=c(()=>{"use client";O();});function De(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"12",cy:"12",r:"4"}),jsx("path",{d:"M12 2v2"}),jsx("path",{d:"M12 20v2"}),jsx("path",{d:"m4.93 4.93 1.41 1.41"}),jsx("path",{d:"m17.66 17.66 1.41 1.41"}),jsx("path",{d:"M2 12h2"}),jsx("path",{d:"M20 12h2"}),jsx("path",{d:"m6.34 17.66-1.41 1.41"}),jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function Be(){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function ce({value:e,onChange:r}){let o=e??false;return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("label",{className:"previewcn-label",children:"Mode"}),jsxs("div",{className:"previewcn-mode-toggle",children:[jsxs("button",{onClick:()=>r(false),className:`previewcn-mode-btn previewcn-control ${o?"":"previewcn-control--selected"}`,"aria-label":"Light mode",children:[jsx(De,{}),jsx("span",{children:"Light"})]}),jsxs("button",{onClick:()=>r(true),className:`previewcn-mode-btn previewcn-control ${o?"previewcn-control--selected":""}`,"aria-label":"Dark mode",children:[jsx(Be,{}),jsx("span",{children:"Dark"})]})]})]})}var de=c(()=>{"use client";});function pe({value:e,onChange:r}){return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("span",{className:"previewcn-label",children:"Presets"}),jsx("div",{className:"previewcn-preset-grid",children:R.map(o=>{let t=e===o.name,d=o.colors.light.primary,p=o.colors.light.background;return jsxs("button",{onClick:()=>r(o.name),className:`previewcn-preset-card ${t?"previewcn-preset-card--selected":""}`,"aria-label":o.label,"aria-pressed":t,children:[jsxs("div",{className:"previewcn-preset-preview",children:[jsx("div",{className:"previewcn-preset-color previewcn-preset-color--bg",style:{backgroundColor:p}}),jsx("div",{className:"previewcn-preset-color previewcn-preset-color--primary",style:{backgroundColor:d}})]}),jsx("span",{className:"previewcn-preset-label",children:o.label})]},o.name)})})]})}var ue=c(()=>{"use client";P();});var ge,fe=c(()=>{ge=[{name:"none",label:"None",value:"0rem"},{name:"sm",label:"SM",value:"0.3rem"},{name:"md",label:"MD",value:"0.5rem"},{name:"lg",label:"LG",value:"0.625rem"},{name:"xl",label:"XL",value:"0.75rem"},{name:"full",label:"Full",value:"1rem"}];});function me({value:e,onChange:r}){return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("label",{className:"previewcn-label",children:"Radius"}),jsx("div",{className:"previewcn-radius-grid",children:ge.map(o=>{let t=e===o.value;return jsxs("button",{onClick:()=>r(o.value),className:`previewcn-radius-btn previewcn-control ${t?"previewcn-control--selected":""}`,title:o.label,children:[jsx("span",{className:"previewcn-radius-preview",style:{borderRadius:o.value}}),jsx("span",{className:"previewcn-radius-label",children:o.label})]},o.name)})})]})}var ke=c(()=>{"use client";fe();});var be={};Pe(be,{default:()=>ve});function _e(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})}function We(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),jsx("path",{d:"M3 3v5h5"})]})}function ve({onClose:e}){let{config:r,setColorPreset:o,setRadius:t,setDarkMode:d,setFont:p,setPresetTheme:i,resetTheme:E}=te(),w=useRef(false);return useEffect(()=>{w.current||(w.current=true,$(r));},[r]),jsxs("div",{className:"previewcn-panel",children:[jsxs("div",{className:"previewcn-header",children:[jsx("div",{className:"previewcn-title",children:jsx("span",{className:"previewcn-logo",children:"previewcn"})}),jsx("button",{onClick:e,className:"previewcn-control previewcn-control--ghost previewcn-icon-btn previewcn-close-btn","aria-label":"Close",children:jsx(_e,{})})]}),jsxs("div",{className:"previewcn-content",children:[jsx(pe,{value:r.preset,onChange:i}),jsx(le,{value:r.colorPreset,onChange:o}),jsx(me,{value:r.radius,onChange:t}),jsx(ie,{value:r.font,onChange:p}),jsx(ce,{value:r.darkMode,onChange:d})]}),jsx("div",{className:"previewcn-footer",children:jsxs("button",{onClick:E,className:"previewcn-control previewcn-control--ghost previewcn-reset-btn",children:[jsx(We,{}),jsx("span",{children:"Reset"})]})})]})}var ye=c(()=>{"use client";ne();N();ae();se();de();ue();ke();});function Ce(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),jsx("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),jsx("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"}),jsx("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"})]})}function V({onClick:e}){return jsx("button",{onClick:e,className:"previewcn-trigger","aria-label":"Open PreviewCN theme editor",title:"PreviewCN Theme Editor",children:jsx(Ce,{})})}var Ye=lazy(()=>Promise.resolve().then(()=>(ye(),be))),ze=process.env.NODE_ENV==="development";function Ae(){let[e,r]=useState(false);return jsxs(Fragment,{children:[!e&&jsx(V,{onClick:()=>r(true)}),e&&jsx(Suspense,{fallback:null,children:jsx(Ye,{onClose:()=>r(false)})})]})}function Ge(){return ze?jsx(Ae,{}):null}N();
12
- export{Ge as PreviewcnDevtools,S as applyColors,F as applyDarkMode,T as applyFont,v as applyRadius,$ as applyTheme};
11
+ `;}function R(e){let r=Z(e);r&&W(r);}function re(e){let r=g(e);r&&(ee(r),w(r.radius),r.font&&W(r.font));}function _(e){let r=e.preset?g(e.preset):null;e.colorPreset!==null?E(e.colorPreset):r&&ee(r);let o=e.radius??r?.radius;o!=null&&w(o),e.darkMode!==null&&N(e.darkMode),e.font!==null?R(e.font):r?.font&&W(r.font);}function oe(){let e=document.getElementById(D);e&&e.remove();let r=document.getElementById(U);r&&r.remove();let o=document.documentElement;o.style.removeProperty("--radius"),o.style.removeProperty("color-scheme"),o.classList.remove("light","dark");}var D,U,M=c(()=>{T();O();y();D="previewcn-devtools-theme-colors",U="previewcn-devtools-theme-font";});function Ue(){if(typeof window>"u")return {};try{let e=localStorage.getItem(V);if(e)return JSON.parse(e)}catch{}return {}}function We(e){if(!(typeof window>"u"))try{localStorage.setItem(V,JSON.stringify(e));}catch{}}function ne(){let[e,r]=useState(()=>({...te,...Ue()})),o=useCallback(l=>{r(d=>{let v=l(d);return We(v),v});},[]),t=useCallback(l=>{o(d=>({...d,colorPreset:l})),E(l);},[o]),n=useCallback(l=>{o(d=>({...d,radius:l})),w(l);},[o]),p=useCallback(l=>{o(d=>({...d,darkMode:l})),N(l);},[o]),a=useCallback(l=>{o(d=>({...d,font:l})),R(l);},[o]),F=useCallback(l=>{let d=g(l);d&&(o(v=>({...v,preset:l,radius:d.radius,font:d.font?.value??v.font,colorPreset:null})),re(l));},[o]),b=useCallback(()=>{typeof window<"u"&&localStorage.removeItem(V),oe(),r(te);},[]);return {config:e,setColorPreset:t,setRadius:n,setDarkMode:p,setFont:a,setPresetTheme:F,resetTheme:b}}var V,te,le=c(()=>{"use client";y();M();V="previewcn-devtools-theme";te={colorPreset:null,radius:null,darkMode:null,font:null,preset:null};});function ae({value:e,onChange:r}){return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("label",{className:"previewcn-label",children:"Theme"}),jsx("div",{className:"previewcn-color-grid",children:B.map(o=>{let t=e===o.name,n=o.colors.light.primary;return jsx("button",{onClick:()=>r(o.name),className:`previewcn-color-swatch ${t?"previewcn-color-swatch--selected":""}`,style:{backgroundColor:n},"aria-label":o.label,title:o.label},o.name)})})]})}var se=c(()=>{"use client";T();});function Ve(e){let r=e.preset!==null?g(e.preset):null,t=(e.colorPreset!==null?x(e.colorPreset):null)?.colors??r?.colors??null;if(!t)return null;let n=e.radius??r?.radius??"0.5rem";return {colors:t,radius:n}}function He(e,r=" "){return Object.entries(e).map(([o,t])=>`${r}--${o}: ${t};`).join(`
12
+ `)}function ie(e,r){return `${e} {
13
+ ${He(r)}
14
+ }`}function ce(e){let r=Ve(e);if(!r)return null;let o={radius:r.radius,...r.colors.light};return `${ie(":root",o)}
15
+
16
+ ${ie(".dark",r.colors.dark)}`}async function de(e){try{return await navigator.clipboard.writeText(e),!0}catch{try{let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-999999px",r.style.top="-999999px",document.body.appendChild(r),r.focus(),r.select();let o=document.execCommand("copy");return document.body.removeChild(r),o}catch{return false}}}var pe=c(()=>{T();y();});function je(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),jsx("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})}function Ae(){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M20 6 9 17l-5-5"})})}function ue({config:e}){let[r,o]=useState(false),t=ce(e),n=!t,p=r?"Copied!":"Copy CSS";return jsxs("button",{onClick:async()=>{if(!t)return;await de(t)&&(o(true),setTimeout(()=>o(false),2e3));},className:`previewcn-control previewcn-copy-btn${r?" previewcn-copy-btn--success":""}${n?" previewcn-copy-btn--disabled":""}`,disabled:n,"aria-label":p,title:n?"Select a theme first":"Copy CSS to clipboard",children:[r?jsx(Ae,{}):jsx(je,{}),jsx("span",{children:p})]})}var he=c(()=>{"use client";pe();});function ze(){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"m6 9 6 6 6-6"})})}function fe({value:e,onChange:r}){let[o,t]=useState(false),p=S.find(a=>a.value===e)?.label??"Select font...";return jsxs("div",{className:`previewcn-section previewcn-surface ${o?"previewcn-section--overlay":""}`,children:[jsx("label",{className:"previewcn-label",children:"Font"}),jsxs("div",{className:"previewcn-select-wrapper",children:[jsxs("button",{onClick:()=>t(!o),className:"previewcn-select-trigger previewcn-control","aria-expanded":o,children:[jsx("span",{children:p}),jsx(ze,{})]}),o&&jsx("div",{className:"previewcn-select-dropdown",children:S.map(a=>jsx("button",{onClick:()=>{r(a.value),t(false);},className:`previewcn-select-option previewcn-option ${e===a.value?"previewcn-option--selected":""}`,children:a.label},a.value))})]})]})}var me=c(()=>{"use client";O();});function Ge(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"12",cy:"12",r:"4"}),jsx("path",{d:"M12 2v2"}),jsx("path",{d:"M12 20v2"}),jsx("path",{d:"m4.93 4.93 1.41 1.41"}),jsx("path",{d:"m17.66 17.66 1.41 1.41"}),jsx("path",{d:"M2 12h2"}),jsx("path",{d:"M20 12h2"}),jsx("path",{d:"m6.34 17.66-1.41 1.41"}),jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function Ke(){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function ke({value:e,onChange:r}){let o=e??false;return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("label",{className:"previewcn-label",children:"Mode"}),jsxs("div",{className:"previewcn-mode-toggle",children:[jsxs("button",{onClick:()=>r(false),className:`previewcn-mode-btn previewcn-control ${o?"":"previewcn-control--selected"}`,"aria-label":"Light mode",children:[jsx(Ge,{}),jsx("span",{children:"Light"})]}),jsxs("button",{onClick:()=>r(true),className:`previewcn-mode-btn previewcn-control ${o?"previewcn-control--selected":""}`,"aria-label":"Dark mode",children:[jsx(Ke,{}),jsx("span",{children:"Dark"})]})]})]})}var be=c(()=>{"use client";});function ve({value:e,onChange:r}){return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("span",{className:"previewcn-label",children:"Presets"}),jsx("div",{className:"previewcn-preset-grid",children:$.map(o=>{let t=e===o.name,n=o.colors.light.primary,p=o.colors.light.background;return jsxs("button",{onClick:()=>r(o.name),className:`previewcn-preset-card ${t?"previewcn-preset-card--selected":""}`,"aria-label":o.label,"aria-pressed":t,children:[jsxs("div",{className:"previewcn-preset-preview",children:[jsx("div",{className:"previewcn-preset-color previewcn-preset-color--bg",style:{backgroundColor:p}}),jsx("div",{className:"previewcn-preset-color previewcn-preset-color--primary",style:{backgroundColor:n}})]}),jsx("span",{className:"previewcn-preset-label",children:o.label})]},o.name)})})]})}var ye=c(()=>{"use client";y();});var we,Ce=c(()=>{we=[{name:"none",label:"None",value:"0rem"},{name:"sm",label:"SM",value:"0.3rem"},{name:"md",label:"MD",value:"0.5rem"},{name:"lg",label:"LG",value:"0.625rem"},{name:"xl",label:"XL",value:"0.75rem"},{name:"full",label:"Full",value:"1rem"}];});function Fe({value:e,onChange:r}){return jsxs("div",{className:"previewcn-section previewcn-surface",children:[jsx("label",{className:"previewcn-label",children:"Radius"}),jsx("div",{className:"previewcn-radius-grid",children:we.map(o=>{let t=e===o.value;return jsxs("button",{onClick:()=>r(o.value),className:`previewcn-radius-btn previewcn-control ${t?"previewcn-control--selected":""}`,title:o.label,children:[jsx("span",{className:"previewcn-radius-preview",style:{borderRadius:o.value}}),jsx("span",{className:"previewcn-radius-label",children:o.label})]},o.name)})})]})}var xe=c(()=>{"use client";Ce();});var Se={};Re(Se,{default:()=>Te});function qe(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})}function Qe(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),jsx("path",{d:"M3 3v5h5"})]})}function Te({onClose:e}){let{config:r,setColorPreset:o,setRadius:t,setDarkMode:n,setFont:p,setPresetTheme:a,resetTheme:F}=ne(),b=useRef(false);return useEffect(()=>{b.current||(b.current=true,_(r));},[r]),jsxs("div",{className:"previewcn-panel",children:[jsxs("div",{className:"previewcn-header",children:[jsx("div",{className:"previewcn-title",children:jsx("span",{className:"previewcn-logo",children:"previewcn"})}),jsx("button",{onClick:e,className:"previewcn-control previewcn-control--ghost previewcn-icon-btn previewcn-close-btn","aria-label":"Close",children:jsx(qe,{})})]}),jsxs("div",{className:"previewcn-content",children:[jsx(ve,{value:r.preset,onChange:a}),jsx(ae,{value:r.colorPreset,onChange:o}),jsx(Fe,{value:r.radius,onChange:t}),jsx(fe,{value:r.font,onChange:p}),jsx(ke,{value:r.darkMode,onChange:n})]}),jsxs("div",{className:"previewcn-footer",children:[jsx(ue,{config:r}),jsxs("button",{onClick:F,className:"previewcn-control previewcn-control--ghost previewcn-reset-btn",children:[jsx(Qe,{}),jsx("span",{children:"Reset"})]})]})]})}var Ne=c(()=>{"use client";le();M();se();he();me();be();ye();xe();});function Me(){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),jsx("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),jsx("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"}),jsx("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.555C21.965 6.012 17.461 2 12 2z"})]})}function A({onClick:e}){return jsx("button",{onClick:e,className:"previewcn-trigger","aria-label":"Open PreviewCN theme editor",title:"PreviewCN Theme Editor",children:jsx(Me,{})})}var tr=lazy(()=>Promise.resolve().then(()=>(Ne(),Se))),nr=process.env.NODE_ENV==="development";function lr(){let[e,r]=useState(false);return jsxs(Fragment,{children:[!e&&jsx(A,{onClick:()=>r(true)}),e&&jsx(Suspense,{fallback:null,children:jsx(tr,{onClose:()=>r(false)})})]})}function ar(){return nr?jsx(lr,{}):null}M();
17
+ export{ar as PreviewcnDevtools,E as applyColors,N as applyDarkMode,R as applyFont,w as applyRadius,_ as applyTheme};
package/dist/styles.css CHANGED
@@ -173,6 +173,9 @@
173
173
  }
174
174
  }
175
175
  @layer utilities {
176
+ .fixed {
177
+ position: fixed;
178
+ }
176
179
  .border {
177
180
  border-style: var(--tw-border-style);
178
181
  border-width: 1px;
@@ -600,6 +603,23 @@
600
603
  gap: 6px;
601
604
  font-size: 12px;
602
605
  }
606
+ .previewcn-copy-btn {
607
+ gap: 6px;
608
+ font-size: 12px;
609
+ margin-right: auto;
610
+ }
611
+ .previewcn-copy-btn--success {
612
+ border-color: oklch(0.72 0.17 142);
613
+ color: oklch(0.72 0.17 142);
614
+ }
615
+ .previewcn-copy-btn--disabled {
616
+ opacity: 0.5;
617
+ cursor: not-allowed;
618
+ }
619
+ .previewcn-copy-btn--disabled:hover {
620
+ background: var(--pcn-surface);
621
+ border-color: var(--pcn-border);
622
+ }
603
623
  @keyframes previewcn-rise {
604
624
  from {
605
625
  opacity: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@previewcn/devtools",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Embedded devtools for PreviewCN - real-time shadcn/ui theme preview inside your app",
5
5
  "keywords": ["shadcn", "shadcn-ui", "theme", "preview", "devtools", "react", "tailwind"],
6
6
  "license": "MIT",