love-ui 1.2.9 → 1.2.11
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.js +13 -7
- package/dist/mcp-server.js +1 -1
- package/package.json +1 -1
- package/packages/gooey-toast/src/toast.tsx +2 -2
- package/packages/gooey-toast/src/types.ts +2 -2
- package/packages/love-ui/src/styles/globals.css +2 -0
- package/packages/love-ui/src/ui/alert-dialog.tsx +3 -2
- package/packages/love-ui/src/ui/alert.tsx +5 -4
- package/packages/love-ui/src/ui/breadcrumb.tsx +7 -6
- package/packages/love-ui/src/ui/card.tsx +7 -6
- package/packages/love-ui/src/ui/chart.tsx +19 -5
- package/packages/love-ui/src/ui/checkbox.tsx +42 -35
- package/packages/love-ui/src/ui/command.tsx +2 -1
- package/packages/love-ui/src/ui/dialog.tsx +5 -4
- package/packages/love-ui/src/ui/empty.tsx +7 -6
- package/packages/love-ui/src/ui/frame.tsx +7 -6
- package/packages/love-ui/src/ui/kbd.tsx +4 -3
- package/packages/love-ui/src/ui/label.tsx +2 -1
- package/packages/love-ui/src/ui/menu.tsx +2 -1
- package/packages/love-ui/src/ui/number-field.tsx +2 -1
- package/packages/love-ui/src/ui/pagination.tsx +5 -4
- package/packages/love-ui/src/ui/popover.tsx +4 -1
- package/packages/love-ui/src/ui/select.tsx +11 -2
- package/packages/love-ui/src/ui/sheet.tsx +5 -4
- package/packages/love-ui/src/ui/skeleton.tsx +3 -1
- package/packages/love-ui/src/ui/table.tsx +9 -8
- package/packages/love-ui/src/ui/textarea.tsx +2 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawnSync as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import{spawnSync as Y}from"child_process";import{existsSync as p}from"fs";import{mkdir as O,readdir as q,readFile as j,writeFile as A}from"fs/promises";import a from"path";import{pathToFileURL as K,fileURLToPath as Q}from"url";var Z=a.dirname(Q(import.meta.url)),tt=a.resolve(Z,".."),E=a.join(tt,"packages"),et=new Set([".ts",".tsx",".cts",".mts",".js",".jsx",".css",".scss",".sass",".mdx",".md"]),nt=new Set(["node_modules","dist",".turbo",".next","build",".cache"]),B=new Set(["accordion","alert","alert-dialog","autocomplete","avatar","badge","breadcrumb","button","card","checkbox","checkbox-group","collapsible","combobox","command","dialog","empty","field","fieldset","form","frame","group","input","label","menu","meter","number-field","pagination","popover","preview-card","progress","radio-group","scroll-area","select","separator","sheet","skeleton","slider","switch","table","tabs","textarea","toast","toggle","toggle-group","toolbar","tooltip"]),st=[".ts",".tsx",".js",".jsx"],J=/(^|\/)lib\/utils(?:\.[a-z]+)?$/i,it=/@loveui\/ui\/lib\/utils|@loveui\/shadcn-ui\/lib\/utils|@love-ui\/shadcn-ui\/lib\/utils|@\/lib\/utils|~\/lib\/utils|(?:\.\.\/)+ui\/src\/lib\/utils/,rt=`import { clsx, type ClassValue } from "clsx"
|
|
3
|
+
import { twMerge } from "tailwind-merge"
|
|
4
|
+
|
|
5
|
+
export function cn(...inputs: ClassValue[]) {
|
|
6
|
+
return twMerge(clsx(inputs))
|
|
7
|
+
}
|
|
8
|
+
`;function V(t){if(!t)return t;let e=t.split("/");return e[e.length-1]||t}function X(t){let e=t.trim();return e&&((e.startsWith("@/")||e.startsWith("~/"))&&(e=`src/${e.slice(2)}`),e.startsWith("/")&&(e=e.slice(1)),e=e.replace(/^\.\//,""),e=e.replace(/\/+$/,""),e)}function ot(t){return t.trim().replace(/\/+$/,"")}function k(t){return t.replace(/\.(?:ts|tsx|js|jsx)$/i,"")}function z(t){let e=k(t);return st.map(s=>`${e}${s}`)}function at(t){let e=t.replace(/\/+$/,"");return e==="src"||e.startsWith("src/")?"src":e==="app"||e.startsWith("app/")?"app":null}function G(t){let e=V(t);return e==="ui"?"love-ui":e}function ct(t){let e=t.loveui??{},s=typeof e.target=="string"?e.target.trim():"",n=e.category;if(s){let r=typeof e.includePackageName=="boolean"?e.includePackageName:!1;return{base:s.replace(/\/+$/,""),includePackageName:r}}return n==="feature"?{base:"components",includePackageName:!0}:n==="block"?{base:"components/blocks",includePackageName:!0}:{base:"components/ui",includePackageName:!0}}function lt(t,e,s){let n=t.startsWith("src/")?t.slice(4):t;if(!e.includePackageName){let d=e.base.split("/").filter(Boolean),u=d[d.length-1];u&&n.startsWith(`${u}/`)&&(n=n.slice(u.length+1))}let c=`${(e.includePackageName?`${e.base}/${s}`:e.base).replace(/\/+/g,"/")}/${n}`.replace(/\/+/g,"/");return{cleanedPath:n,target:c}}async function ut(t){let e=a.join(t,"components.json");try{let s=await j(e,"utf8");return JSON.parse(s).aliases??null}catch{return null}}async function gt(t){let e=["tsconfig.json","jsconfig.json"].map(s=>a.join(t,s)).find(s=>p(s));if(!e)return null;try{let s=await j(e,"utf8"),r=JSON.parse(s).compilerOptions?.paths;return!r||typeof r!="object"?null:r}catch{return null}}function pt(t,e){if(typeof t=="string"){if(t.trim().startsWith("~/"))return"~/";if(t.trim().startsWith("@/"))return"@/"}if(e){if(Object.prototype.hasOwnProperty.call(e,"~/*"))return"~/";if(Object.prototype.hasOwnProperty.call(e,"@/*"))return"@/"}return"@/"}async function ft(t,e,s){if(e&&e.length>0)return e;let n=["src/components/ui","app/components/ui","components/ui"];for(let i of n)if(p(a.join(t,i)))return i.replace(/\/ui$/,"");let r=["src/components","app/components","components"];for(let i of r)if(p(a.join(t,i)))return i;if(s){let i=s["@/*"]??s["~/*"]??[];if(Array.isArray(i)&&i.some(c=>/^\.?\/?src\//.test(c)))return"src/components";if(Array.isArray(i)&&i.some(c=>/^\.?\/?app\//.test(c)))return"app/components"}return p(a.join(t,"src"))?"src/components":p(a.join(t,"app"))?"app/components":"components"}async function dt(t,e,s,n){let r=n?.utils??(n?.lib?`${n.lib.replace(/\/+$/,"")}/utils`:void 0);if(r&&r.trim().length>0){let u=k(ot(r)),f=k(X(r));for(let w of z(f))if(p(a.join(t,w)))return{utilsImportPath:u,utilsFilePath:w};return{utilsImportPath:u,utilsFilePath:`${f}.ts`}}let i=at(e),c=i?`${i}/lib/utils`:"lib/utils",d=Array.from(new Set([c,"src/lib/utils","app/lib/utils","lib/utils"]));for(let u of d)for(let f of z(u))if(p(a.join(t,f)))return{utilsImportPath:`${s}lib/utils`,utilsFilePath:f};return{utilsImportPath:`${s}lib/utils`,utilsFilePath:`${c}.ts`}}function M(t,e,s){let n=c=>{let d=c.startsWith("/"),u=c.endsWith("/"),f=c.split("/").filter(Boolean),w=[];for(let $ of f)w[w.length-1]!==$&&w.push($);let x=w.join("/");return`${d?"/":""}${x}${u?"/":""}`},r=e.replace(/\/+$/,""),i=t.replace(/^\.?\//,"");if(J.test(i))return n(s);if(i.startsWith("components/")){let c=i.slice(10);return n(`${r}${c}`.replace(/^\//,""))}if(i.startsWith("lib/")){if(r.startsWith("src/"))return n(`src/${i}`);if(r.startsWith("app/"))return n(`app/${i}`)}if(i.startsWith("hooks/")){if(r.startsWith("src/"))return n(`src/${i}`);if(r.startsWith("app/"))return n(`app/${i}`)}return i.startsWith("ui/")?n(`${r}/${i}`):n(i)}function _(t,e){let s=e.startsWith("~/")?"~/":"@/",n=t;return n=n.replace(/@\/registry\/building-blocks\/default\/components\//g,`${s}components/`),n=n.replace(/@\/registry\/building-blocks\/default\/ui\//g,`${s}components/ui/`),n=n.replace(/@\/registry\/building-blocks\/default\/lib\//g,`${s}lib/`),n=n.replace(/@\/registry\/building-blocks\/default\/hooks\//g,`${s}hooks/`),n=n.replace(/@\/registry\/default\/components\//g,`${s}components/`),n=n.replace(/@\/registry\/default\/ui\//g,`${s}components/ui/`),n=n.replace(/@\/registry\/default\/lib\//g,`${s}lib/`),n=n.replace(/@\/registry\/default\/hooks\//g,`${s}hooks/`),n=n.replace(/from\s+["']@loveui\/ui\/lib\/utils["']/g,`from "${e}"`),n=n.replace(/from\s+["']@loveui\/shadcn-ui\/lib\/utils["']/g,`from "${e}"`),n=n.replace(/from\s+["']@love-ui\/shadcn-ui\/lib\/utils["']/g,`from "${e}"`),n=n.replace(/from\s+["']@\/lib\/utils["']/g,`from "${e}"`),n=n.replace(/from\s+["']~\/lib\/utils["']/g,`from "${e}"`),n=n.replace(/from\s+["'](?:\.\.\/)+ui\/src\/lib\/utils["']/g,`from "${e}"`),n}async function mt(t,e){if(p(a.join(t,e)))return!1;let s=rt,n=a.join(E,"love-ui","src","lib","utils.ts");if(p(n))try{s=await j(n,"utf8")}catch{}return await L(e,t),await A(a.join(t,e),s,"utf8"),!0}async function L(t,e){let s=a.dirname(a.join(e,t));await O(s,{recursive:!0})}async function ht(t,e){let s=a.join(t,"package.json"),n={};try{let u=await j(s,"utf8");n=JSON.parse(u)}catch{}let r=ct(n),i=V(e),c=[];async function d(u,f){let w=await q(u,{withFileTypes:!0});for(let x of w){if(nt.has(x.name))continue;let $=a.join(u,x.name);if(x.isDirectory()){await d($,f);continue}let P=a.extname(x.name);if(!et.has(P)||x.name==="package.json")continue;let g=a.relative(f,$).split(a.sep).join("/"),{target:v}=lt(g,r,i),R=await j($,"utf8");c.push({path:g,target:v,content:R})}}return await d(t,t),c}async function yt(t,e){let s=a.join(E,"love-ui"),n=a.join(s,"src","ui",`${t}.tsx`);if(!p(n))return null;try{let r=[],i=await j(n,"utf8");i=_(i,e),r.push({path:`src/ui/${t}.tsx`,target:`components/ui/${t}.tsx`,content:i});let c=a.join(s,"src","lib","utils.ts");if(p(c)){let d=await j(c,"utf8");r.push({path:"src/lib/utils.ts",target:"lib/utils.ts",content:d})}return r}catch(r){return console.warn(`Warning: unable to read ${t} component`,r),null}}async function bt(t,e){if(B.has(t))return await yt(t,e);let s=G(t),n=a.join(E,s);if(!p(n))return null;try{return await ht(n,t)}catch(r){return console.warn(`Warning: unable to read bundled sources for ${t}`,r),null}}var $t={"@base-ui-components/react":"1.0.0-beta.4","class-variance-authority":"^0.7.1",clsx:"^2.1.1","tailwind-merge":"^3.3.1"};async function wt(t){if(B.has(t))return{...$t};let e=G(t),s=a.join(E,e,"package.json");try{let n=await j(s,"utf8");return JSON.parse(n).dependencies??{}}catch{return{}}}async function Pt(t){return p(a.join(t,"bun.lockb"))?"bun":p(a.join(t,"pnpm-lock.yaml"))?"pnpm":p(a.join(t,"yarn.lock"))?"yarn":"npm"}async function jt(t,e,s){let n=Object.entries(t);if(n.length===0)return!0;console.log(`
|
|
9
|
+
Installing dependencies...`);let r=n.map(([d,u])=>`${d}@${u}`),i;switch(e){case"bun":i=`bun add ${r.join(" ")}`;break;case"pnpm":i=`pnpm add ${r.join(" ")}`;break;case"yarn":i=`yarn add ${r.join(" ")}`;break;default:i=`npm install ${r.join(" ")}`}let c=Y(i,{stdio:"inherit",shell:!0,cwd:s});return c.error||c.status!==0?(console.warn(`
|
|
10
|
+
Failed to install dependencies. You may need to install them manually:`),console.warn(` ${r.join(`
|
|
5
11
|
`)}`),!1):(console.log(`Dependencies installed successfully!
|
|
6
|
-
`),!0)}async function
|
|
7
|
-
Adding ${
|
|
8
|
-
Installing ${
|
|
9
|
-
\u2713 Done! You can now import and use the components in your app.`)}var
|
|
12
|
+
`),!0)}async function xt(t=process.argv.slice(2)){(t.length===0||t.length===1&&(t[0]==="--version"||t[0]==="-v"))&&(console.log("love-ui version 1.1.9"),process.exit(0)),(t.length<2||t[0]!=="add")&&(console.log("Usage: npx love-ui add [...packages]"),console.log(" npx love-ui --version"),process.exit(1));let e=t.slice(1),s=process.cwd(),n=await ut(s),r=await gt(s),i=n?.components?X(n.components):null,c=await ft(s,i,r),d=pt(n?.components,r),{utilsImportPath:u,utilsFilePath:f}=await dt(s,c,d,n),w=await Pt(s),x=c.endsWith("/ui")?c:`${c}/ui`;await O(a.join(s,c),{recursive:!0}),await O(a.join(s,x),{recursive:!0});let $={};for(let P of e){if(!P.trim())continue;console.log(`
|
|
13
|
+
Adding ${P}...`);let g=null,v=null;if(P.startsWith("http://")||P.startsWith("https://")){let o=P;o.includes("/building-blocks/r/")&&(o=o.replace("/building-blocks/r/","/building-blocks/"),console.log(`Auto-corrected URL to: ${o}`));try{let l=await fetch(o);l.ok?g=await l.json():console.warn(`Failed to fetch ${o}: HTTP ${l.status}`)}catch(l){console.warn(`Failed to fetch from ${o}:`,l)}}else{let o=new URL(`r/${P}.json`,"https://www.loveui.dev/");try{let l=await fetch(o);l.ok&&(g=await l.json())}catch{}v=await bt(P,u)}let R=v??g?.files??[];R=R.map(o=>{let l=o.target||o.path;return l.startsWith("registry/default/")&&(l=l.replace("registry/default/","")),{...o,target:l}});let F=R.find(o=>o.target.match(/^components\/comp-\d+\.tsx$/));if(F){let o=R.filter(l=>l.target.match(/^components\/[^/]+\//)&&l.target!==F.target);if(o.length>0&&o[0]){let l=o[0].target.match(/^components\/([^/]+)\//);if(l&&l[1]){let m=l[1];F.target=`components/${m}-demo.tsx`}}else if(g?.meta?.tags&&Array.isArray(g.meta.tags)&&g.meta.tags.length>0){let m=g.meta.tags.slice(0,2).filter(y=>y.length>0);if(m.length>0){let y=m.join("-").toLowerCase().replace(/\s+/g,"-");F.target=`components/${y}.tsx`}}}if(!R.length){console.warn(`Component "${P}" not found. Available components can be found at https://loveui.dev`);continue}R.some(o=>J.test(o.target)||typeof o.content=="string"&&it.test(o.content))&&await mt(s,f);let T=0,C=0;for(let o of R){if(!o.content)continue;let l=M(o.target,c,f),m=a.join(s,l),y=p(m);if(k(l)===k(f)&&y)continue;let D=_(o.content,u);if(y)try{if(await j(m,"utf8")===D)continue}catch{}await L(l,s),await A(m,D,"utf8"),y?C++:T++}if(T>0&&console.log(`\u2713 Created ${T} file${T>1?"s":""}`),C>0&&console.log(`\u2713 Updated ${C} file${C>1?"s":""}`),g?.registryDependencies&&g.registryDependencies.length>0){console.log(`
|
|
14
|
+
Installing ${g.registryDependencies.length} required component${g.registryDependencies.length>1?"s":""}...`);for(let o of g.registryDependencies){let l=o;o.startsWith("https://loveui.dev/building-blocks/r/")&&(l=`https://ui.loveui.dev/ui/r/${o.split("/").pop()}`);try{let m=await fetch(l);if(m.ok){let y=await m.json(),D=(y?.files??[]).map(h=>{let b=h.target||h.path;return b.startsWith("registry/default/")&&(b=b.replace("registry/default/","")),{...h,target:b}});for(let h of D){if(!h.content)continue;let b=M(h.target,c,f),W=a.join(s,b),N=p(W);if(k(b)===k(f)&&N)continue;let I=_(h.content,u);if(N)try{if(await j(W,"utf8")===I)continue}catch{}await L(b,s),await A(W,I,"utf8")}let S=["@loveui/shadcn-ui","jotai","lucide-react","react","react-dom"];if(y?.dependencies)if(Array.isArray(y.dependencies))y.dependencies.forEach(h=>{S.includes(h)||($[h]="latest")});else{let h=y.dependencies;Object.keys(h).forEach(b=>{!S.includes(b)&&h[b]&&($[b]=h[b])})}}else console.warn(` \u2717 Failed to fetch ${l}: HTTP ${m.status}`)}catch(m){console.warn(` \u2717 Failed to install ${l}:`,m.message)}}console.log("\u2713 Installed registry dependencies")}let U={};g?.dependencies?Array.isArray(g.dependencies)?g.dependencies.forEach(o=>{U[o]="latest"}):U=g.dependencies:U=await wt(P),Object.assign($,U)}Object.keys($).length>0&&await jt($,w,s),console.log(`
|
|
15
|
+
\u2713 Done! You can now import and use the components in your app.`)}var Rt=process.argv[1]&&(import.meta.url===K(process.argv[1]).href||process.argv[1].includes("love-ui")||process.argv[1].includes("loveui"));Rt&&xt().catch(t=>{console.error(t),process.exit(1)});export{xt as run};
|
package/dist/mcp-server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Server as
|
|
2
|
+
import{constants as xe}from"fs";import{access as Te,readFile as Q}from"fs/promises";import l from"path";import{fileURLToPath as _e}from"url";import{Server as Ne}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as Oe}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as Ae,ErrorCode as u,ListResourceTemplatesRequestSchema as Ce,ListResourcesRequestSchema as Le,ListToolsRequestSchema as $e,McpError as p,ReadResourceRequestSchema as Fe}from"@modelcontextprotocol/sdk/types.js";var F={name:"love-ui",version:"1.2.10",private:!1,license:"AGPL-3.0-or-later",type:"module",bin:{loveui:"dist/index.js","love-ui":"dist/index.js","loveui-mcp":"dist/mcp-server.js"},files:["dist","packages","*.ts","*.tsx","*.css","*.mdx"],main:"packages/love-ui/index.ts",types:"packages/love-ui/index.ts",exports:{".":{import:"./packages/love-ui/index.ts",require:"./packages/love-ui/index.ts"},"./lib/*":"./packages/love-ui/*","./components/*":"./packages/love-ui/components/*","./shadcn-ui/*":"./packages/shadcn-ui/*","./package.json":"./package.json"},dependencies:{"@modelcontextprotocol/sdk":"^1.18.1",postcss:"^8.5.6","postcss-nested":"^7.0.2"},scripts:{build:"tsup",postbuild:"node ./scripts/copy-packages.mjs",clean:"rimraf dist packages"},devDependencies:{"@types/node":"^20.14.10",rimraf:"^6.0.1",tsup:"^8.5.0"}};import{constants as me}from"fs";import{access as ue,readFile as U,readdir as q}from"fs/promises";import x,{extname as W,join as j,relative as ge}from"path";import{fileURLToPath as ye}from"url";import z from"postcss";import fe from"postcss-nested";var he=x.dirname(ye(import.meta.url)),ve=x.resolve(he,".."),G=x.join(ve,"packages"),we=new Set([".turbo",".next",".git","dist","build","storybook-static","node_modules","__tests__","__mocks__","coverage"]),Re=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".json",".css",".scss",".sass",".mdx"]),ke=new Set(["package.json","tsconfig.json","tsconfig.build.json","tsconfig.test.json","README.md",".DS_Store"]),Se=new Set(["shadcn-ui","typescript-config","patterns","loveui","love-ui"]),Ee=e=>e.replace(/\\/g,"/"),H=async(e,t,n)=>{let s=await q(e,{withFileTypes:!0});for(let i of s){let o=j(e,i.name);if(i.isDirectory()){if(we.has(i.name))continue;await H(o,t,n);continue}let a=W(i.name);!Re.has(a)||ke.has(i.name)||i.name.endsWith(".d.ts")||i.name.endsWith(".test.ts")||i.name.endsWith(".test.tsx")||i.name.endsWith(".stories.tsx")||n.push({absolute:o,relative:Ee(ge(t,o))})}},Ie=(e,t)=>{let n=e.loveui??{},s=typeof n.target=="string"?n.target.trim():"",i=n.category;if(s.length>0){let o=typeof n.includePackageName=="boolean"?n.includePackageName:!1;return{base:s.replace(/\/+$/,""),includePackageName:o}}return i==="feature"?{base:"components",includePackageName:!0}:i==="block"?{base:"components/blocks",includePackageName:!0}:{base:"components/ui",includePackageName:!0}},De=e=>{let n=(e.loveui??{}).type;return typeof n=="string"&&n.trim().length>0?n:"registry:ui"},Pe=async e=>{try{return await ue(e,me.F_OK),!0}catch{return!1}},b=e=>e.startsWith("@loveui/")||e.startsWith("@love-ui/")||e.startsWith("@repo/"),be=e=>e.replace(/^@repo\//,"").replace(/^@loveui\//,"").replace(/^@love-ui\//,""),je=new Set(["@loveui/shadcn-ui","@love-ui/shadcn-ui"]),J=async()=>(await q(G,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).filter(t=>!Se.has(t)).sort((t,n)=>t.localeCompare(n)),K=async e=>{let t=j(G,e),n=j(t,"package.json");if(!await Pe(n))throw new Error(`Missing package.json for ${e}`);let s=JSON.parse(await U(n,"utf8")),i=De(s),o=Object.keys(s.dependencies??{}),a=Object.keys(s.peerDependencies??{}),N=Object.keys(s.devDependencies??{}),oe=new Set([...o,...a,...N].filter(b).filter(r=>!je.has(r))),O=[...new Set([...o,...a].filter(r=>!b(r)))],A=[...new Set(N.filter(r=>!b(r)&&!["@loveui/typescript-config","@types/react","@types/react-dom","typescript"].includes(r)))],S=[];for(let r of oe){let h=be(r);S.push(`https://www.loveui.dev/r/${h}.json`)}let C=[];await H(t,t,C);let f=[],d={},g=Ie(s,e);for(let r of C){let h=await U(r.absolute,"utf8"),E=W(r.absolute);if(E===".css"||E===".scss"||E===".sass"){let v=await z([fe]).process(h,{from:void 0});z.parse(v.css).walkAtRules("layer",I=>{let D=`@layer ${I.params}`;d[D]??={},I.walkRules(c=>{if(c.parent&&c.parent.type==="atrule"&&c.parent.name==="media")return;let R=c.selector,m={};c.walkDecls(k=>{m[k.prop]=k.value}),Object.keys(m).length>0&&(d[D][R]=m)}),I.walkAtRules("media",c=>{let R=`@media ${c.params}`,m=d[D];m[R]??={};let k=m[R];c.walkRules(L=>{let pe=L.selector,P={};L.walkDecls($=>{P[$.prop]=$.value}),Object.keys(P).length>0&&(k[pe]=P)})})});continue}let y=r.relative.startsWith("src/")?r.relative.slice(4):r.relative;if(!g.includePackageName){let v=g.base.split("/").filter(Boolean),w=v[v.length-1];w&&y.startsWith(`${w}/`)&&(y=y.slice(w.length+1))}let ce=e.includes("/")?e.split("/").pop()??e:e,le=(g.includePackageName?`${g.base}/${ce}`:g.base).replace(/\/+$/,"");f.push({type:i,path:y,target:`${le}/${y}`.replace(/\/+/g,"/"),content:h})}let ae=!f.length&&Object.keys(d).length>0?"registry:style":i;return{$schema:"https://ui.shadcn.com/schema/registry-item.json",name:e,type:ae,title:s.title??e,description:s.description,author:s.author??"Connor Love <hello@loveconnor.com>",dependencies:O.length?O:void 0,devDependencies:A.length?A:void 0,registryDependencies:S.length?Array.from(new Set(S)):void 0,files:f.length?f:void 0,css:Object.keys(d).length?d:void 0}};var _="loveui://registry/",Ue="loveui://registry/{package}",M="get-loveui-package",Z=new Set(["shadcn-ui","typescript-config","eslint-config","patterns","loveui","love-ui"]),ze=["@loveui/","@love-ui/","@repo/"],ee=new Set(["@loveui/shadcn-ui","@love-ui/shadcn-ui"]),qe=e=>`${_}${e}`,We=l.dirname(_e(import.meta.url)),X=l.resolve(We,".."),Ge=[l.join(X,"public","r"),l.resolve(X,"..","..","apps","ui","public","r"),l.resolve(process.cwd(),"apps","ui","public","r")],te=async e=>{try{return await Te(e,xe.R_OK),!0}catch{return!1}},ne=e=>ze.some(t=>e.startsWith(t)),He=e=>e.replace(/^@repo\//,"").replace(/^@loveui\//,"").replace(/^@love-ui\//,""),se=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):e&&typeof e=="object"?Object.keys(e):[],B=e=>{let t=Array.from(new Set(se(e).filter(n=>!ne(n)&&!ee.has(n))));return t.length>0?t:void 0},Je=e=>{let t=Array.from(new Set(se(e).map(n=>n.trim()).filter(Boolean).filter(n=>!ee.has(n)).map(n=>ne(n)?`https://www.loveui.dev/r/${He(n)}.json`:n)));return t.length>0?t:void 0},ie=e=>e.trim().replace(/^@repo\//,"").replace(/^@loveui\//,"").replace(/^@love-ui\//,""),Ke=e=>{let t=ie(e);if(Z.has(t))throw new p(u.InvalidParams,`${t} is an internal package and should not be used directly. Use \`npx love-ui add <component>\` with a public component name.`);return t},Y=e=>{if(!e||typeof e!="object")return{mcpHints:{installPattern:"npx love-ui add <component>",neverInstall:["@loveui/*","@love-ui/*","@repo/*"]}};let t={...e},n=B(t.dependencies),s=B(t.devDependencies),i=Je(t.registryDependencies),o=typeof t.name=="string"&&t.name.trim().length>0?t.name.trim():"<component>",a={...t,mcpHints:{installPattern:"npx love-ui add <component>",installCommand:`npx love-ui add ${o}`,neverInstall:["@loveui/*","@love-ui/*","@repo/*","@loveui/shadcn-ui"]}};return n?a.dependencies=n:delete a.dependencies,s?a.devDependencies=s:delete a.devDependencies,i?a.registryDependencies=i:delete a.registryDependencies,a},T=null,re=async()=>(T||(T=(async()=>{for(let e of Ge){let t=l.join(e,"registry.json");if(await te(t))try{let n=JSON.parse(await Q(t,"utf8")),s=Array.from(new Set((n.items??[]).map(i=>i.name?.trim()).filter(i=>!!i))).sort((i,o)=>i.localeCompare(o));if(s.length===0)continue;return{dir:e,names:s,nameSet:new Set(s)}}catch{continue}}return null})()),T),Me=async()=>{let[e,t]=await Promise.all([re(),J()]),n=new Set(t);for(let s of e?.names??[])n.add(s);return Array.from(n).map(s=>ie(s)).filter(s=>!Z.has(s)).sort((s,i)=>s.localeCompare(i))},Xe=async e=>{let t=await re();if(!t||!t.nameSet.has(e))return null;let n=l.join(t.dir,`${e}.json`);return await te(n)?JSON.parse(await Q(n,"utf8")):null},Be=e=>{if(!e.startsWith(_))throw new p(u.InvalidParams,`Unsupported resource URI: ${e}`);let t=decodeURIComponent(e.slice(_.length)).trim();if(!t)throw new p(u.InvalidParams,"Package name is required.");return t},V=async e=>{try{let t=Ke(e),n=await Xe(t);return Y(n||await K(t))}catch(t){throw t instanceof p?t:new p(u.InvalidParams,t instanceof Error?t.message:String(t))}};async function Ye(){let e=new Ne({name:"loveui-mcp",version:F.version??"0.0.0"},{capabilities:{resources:{listChanged:!0},tools:{listChanged:!0}}});e.setRequestHandler(Le,async()=>({resources:(await Me()).map(s=>({uri:qe(s),name:s,description:`loveui registry definition for ${s}`,mimeType:"application/json"}))})),e.setRequestHandler(Ce,async()=>({resourceTemplates:[{name:"loveui-registry",uriTemplate:Ue,description:"loveui registry definitions by package name",mimeType:"application/json"}]})),e.setRequestHandler(Fe,async n=>{let s=Be(n.params.uri),i=await V(s);return{contents:[{uri:n.params.uri,mimeType:"application/json",text:JSON.stringify(i,null,2)}]}}),e.setRequestHandler($e,async()=>({tools:[{name:M,description:"Fetch a loveui registry definition by package name. Always install with `npx love-ui add <component>` and never install @loveui/* packages directly.",inputSchema:{type:"object",additionalProperties:!1,properties:{name:{type:"string",description:"Package name, e.g. badge"}},required:["name"]}}]})),e.setRequestHandler(Ae,async n=>{if(n.params.name!==M)throw new p(u.InvalidParams,`Tool ${n.params.name} not found`);let s=n.params.arguments?.name;if(typeof s!="string"||s.trim()==="")throw new p(u.InvalidParams,"Package name is required.");let i=await V(s.trim());return{content:[{type:"text",text:JSON.stringify(i,null,2)}]}});let t=new Oe;await e.connect(t)}Ye().catch(e=>{console.error(e),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { Gooey } from "./gooey";
|
|
12
12
|
import "./styles.css";
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
GOOEY_POSITIONS,
|
|
15
15
|
type GooeyOptions,
|
|
16
16
|
type GooeyPosition,
|
|
17
17
|
type GooeyState,
|
|
@@ -394,7 +394,7 @@ export function Toaster({
|
|
|
394
394
|
return (
|
|
395
395
|
<>
|
|
396
396
|
{children}
|
|
397
|
-
{
|
|
397
|
+
{GOOEY_POSITIONS.map((pos) => {
|
|
398
398
|
const items = byPosition[pos];
|
|
399
399
|
if (!items?.length) return null;
|
|
400
400
|
|
|
@@ -20,7 +20,7 @@ export interface GooeyButton {
|
|
|
20
20
|
onClick: () => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export const
|
|
23
|
+
export const GOOEY_POSITIONS = [
|
|
24
24
|
"top-left",
|
|
25
25
|
"top-center",
|
|
26
26
|
"top-right",
|
|
@@ -29,7 +29,7 @@ export const SILEO_POSITIONS = [
|
|
|
29
29
|
"bottom-right",
|
|
30
30
|
] as const;
|
|
31
31
|
|
|
32
|
-
export type GooeyPosition = (typeof
|
|
32
|
+
export type GooeyPosition = (typeof GOOEY_POSITIONS)[number];
|
|
33
33
|
|
|
34
34
|
export interface GooeyOptions {
|
|
35
35
|
title?: string;
|
|
@@ -68,6 +68,8 @@
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
:root {
|
|
71
|
+
--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
72
|
+
--font-heading: var(--font-sans);
|
|
71
73
|
--radius: 0.625rem;
|
|
72
74
|
--background: oklch(1 0 0);
|
|
73
75
|
--foreground: oklch(0.21 0.006 285.885);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
1
2
|
"use client"
|
|
2
3
|
|
|
3
4
|
import { AlertDialog as AlertDialogPrimitive } from "@base-ui-components/react/alert-dialog"
|
|
@@ -61,7 +62,7 @@ function AlertDialogPopup({
|
|
|
61
62
|
function AlertDialogHeader({
|
|
62
63
|
className,
|
|
63
64
|
...props
|
|
64
|
-
}:
|
|
65
|
+
}: ComponentPropsWithoutRef<"div">) {
|
|
65
66
|
return (
|
|
66
67
|
<div
|
|
67
68
|
data-slot="alert-dialog-header"
|
|
@@ -74,7 +75,7 @@ function AlertDialogHeader({
|
|
|
74
75
|
function AlertDialogFooter({
|
|
75
76
|
className,
|
|
76
77
|
...props
|
|
77
|
-
}:
|
|
78
|
+
}: ComponentPropsWithoutRef<"div">) {
|
|
78
79
|
return (
|
|
79
80
|
<div
|
|
80
81
|
data-slot="alert-dialog-footer"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@loveui/ui/lib/utils"
|
|
@@ -27,7 +28,7 @@ function Alert({
|
|
|
27
28
|
className,
|
|
28
29
|
variant,
|
|
29
30
|
...props
|
|
30
|
-
}:
|
|
31
|
+
}: ComponentPropsWithoutRef<"div"> & VariantProps<typeof alertVariants>) {
|
|
31
32
|
return (
|
|
32
33
|
<div
|
|
33
34
|
data-slot="alert"
|
|
@@ -38,7 +39,7 @@ function Alert({
|
|
|
38
39
|
)
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
function AlertTitle({ className, ...props }:
|
|
42
|
+
function AlertTitle({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
42
43
|
return (
|
|
43
44
|
<div
|
|
44
45
|
data-slot="alert-title"
|
|
@@ -51,7 +52,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
51
52
|
function AlertDescription({
|
|
52
53
|
className,
|
|
53
54
|
...props
|
|
54
|
-
}:
|
|
55
|
+
}: ComponentPropsWithoutRef<"div">) {
|
|
55
56
|
return (
|
|
56
57
|
<div
|
|
57
58
|
data-slot="alert-description"
|
|
@@ -64,7 +65,7 @@ function AlertDescription({
|
|
|
64
65
|
)
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
function AlertAction({ className, ...props }:
|
|
68
|
+
function AlertAction({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
68
69
|
return (
|
|
69
70
|
<div
|
|
70
71
|
data-slot="alert-action"
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
import { mergeProps } from "@base-ui-components/react/merge-props"
|
|
3
4
|
import { useRender } from "@base-ui-components/react/use-render"
|
|
4
5
|
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
5
6
|
|
|
6
7
|
import { cn } from "@loveui/ui/lib/utils"
|
|
7
8
|
|
|
8
|
-
function Breadcrumb({ ...props }:
|
|
9
|
+
function Breadcrumb({ ...props }: ComponentPropsWithoutRef<"nav">) {
|
|
9
10
|
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
function BreadcrumbList({ className, ...props }:
|
|
13
|
+
function BreadcrumbList({ className, ...props }: ComponentPropsWithoutRef<"ol">) {
|
|
13
14
|
return (
|
|
14
15
|
<ol
|
|
15
16
|
data-slot="breadcrumb-list"
|
|
@@ -22,7 +23,7 @@ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
|
22
23
|
)
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
function BreadcrumbItem({ className, ...props }:
|
|
26
|
+
function BreadcrumbItem({ className, ...props }: ComponentPropsWithoutRef<"li">) {
|
|
26
27
|
return (
|
|
27
28
|
<li
|
|
28
29
|
data-slot="breadcrumb-item"
|
|
@@ -49,7 +50,7 @@ function BreadcrumbLink({
|
|
|
49
50
|
})
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
function BreadcrumbPage({ className, ...props }:
|
|
53
|
+
function BreadcrumbPage({ className, ...props }: ComponentPropsWithoutRef<"span">) {
|
|
53
54
|
return (
|
|
54
55
|
<span
|
|
55
56
|
data-slot="breadcrumb-page"
|
|
@@ -66,7 +67,7 @@ function BreadcrumbSeparator({
|
|
|
66
67
|
children,
|
|
67
68
|
className,
|
|
68
69
|
...props
|
|
69
|
-
}:
|
|
70
|
+
}: ComponentPropsWithoutRef<"li">) {
|
|
70
71
|
return (
|
|
71
72
|
<li
|
|
72
73
|
data-slot="breadcrumb-separator"
|
|
@@ -83,7 +84,7 @@ function BreadcrumbSeparator({
|
|
|
83
84
|
function BreadcrumbEllipsis({
|
|
84
85
|
className,
|
|
85
86
|
...props
|
|
86
|
-
}:
|
|
87
|
+
}: ComponentPropsWithoutRef<"span">) {
|
|
87
88
|
return (
|
|
88
89
|
<span
|
|
89
90
|
data-slot="breadcrumb-ellipsis"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
4
|
|
|
4
5
|
import { cn } from "@loveui/ui/lib/utils"
|
|
@@ -35,7 +36,7 @@ function Card({ className, variant, ...props }: CardProps) {
|
|
|
35
36
|
)
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
function CardHeader({ className, ...props }:
|
|
39
|
+
function CardHeader({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
39
40
|
return (
|
|
40
41
|
<div
|
|
41
42
|
data-slot="card-header"
|
|
@@ -48,7 +49,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
48
49
|
)
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
function CardTitle({ className, ...props }:
|
|
52
|
+
function CardTitle({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
52
53
|
return (
|
|
53
54
|
<div
|
|
54
55
|
data-slot="card-title"
|
|
@@ -58,7 +59,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
58
59
|
)
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
function CardDescription({ className, ...props }:
|
|
62
|
+
function CardDescription({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
62
63
|
return (
|
|
63
64
|
<div
|
|
64
65
|
data-slot="card-description"
|
|
@@ -68,7 +69,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
68
69
|
)
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
function CardAction({ className, ...props }:
|
|
72
|
+
function CardAction({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
72
73
|
return (
|
|
73
74
|
<div
|
|
74
75
|
data-slot="card-action"
|
|
@@ -81,7 +82,7 @@ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
81
82
|
)
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
function CardPanel({ className, ...props }:
|
|
85
|
+
function CardPanel({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
85
86
|
return (
|
|
86
87
|
<div
|
|
87
88
|
data-slot="card-content"
|
|
@@ -91,7 +92,7 @@ function CardPanel({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
91
92
|
)
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
function CardFooter({ className, ...props }:
|
|
95
|
+
function CardFooter({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
95
96
|
return (
|
|
96
97
|
<div
|
|
97
98
|
data-slot="card-footer"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
4
5
|
import * as RechartsPrimitive from "recharts"
|
|
5
6
|
|
|
6
7
|
import { cn } from "@loveui/ui/lib/utils"
|
|
@@ -40,7 +41,7 @@ function ChartContainer({
|
|
|
40
41
|
children,
|
|
41
42
|
config,
|
|
42
43
|
...props
|
|
43
|
-
}:
|
|
44
|
+
}: ComponentPropsWithoutRef<"div"> & {
|
|
44
45
|
config: ChartConfig
|
|
45
46
|
children: React.ComponentProps<
|
|
46
47
|
typeof RechartsPrimitive.ResponsiveContainer
|
|
@@ -118,11 +119,21 @@ function ChartTooltipContent({
|
|
|
118
119
|
color,
|
|
119
120
|
nameKey,
|
|
120
121
|
labelKey,
|
|
121
|
-
}:
|
|
122
|
-
|
|
122
|
+
}: ComponentPropsWithoutRef<"div"> &
|
|
123
|
+
Partial<
|
|
124
|
+
Pick<
|
|
125
|
+
RechartsPrimitive.TooltipContentProps<any, any>,
|
|
126
|
+
"active" | "payload" | "label"
|
|
127
|
+
>
|
|
128
|
+
> &
|
|
129
|
+
Pick<
|
|
130
|
+
RechartsPrimitive.TooltipProps<any, any>,
|
|
131
|
+
"formatter" | "labelFormatter"
|
|
132
|
+
> & {
|
|
123
133
|
hideLabel?: boolean
|
|
124
134
|
hideIndicator?: boolean
|
|
125
135
|
indicator?: "line" | "dot" | "dashed"
|
|
136
|
+
labelClassName?: string
|
|
126
137
|
nameKey?: string
|
|
127
138
|
labelKey?: string
|
|
128
139
|
}) {
|
|
@@ -255,8 +266,11 @@ function ChartLegendContent({
|
|
|
255
266
|
payload,
|
|
256
267
|
verticalAlign = "bottom",
|
|
257
268
|
nameKey,
|
|
258
|
-
}:
|
|
259
|
-
Pick<
|
|
269
|
+
}: ComponentPropsWithoutRef<"div"> &
|
|
270
|
+
Pick<
|
|
271
|
+
RechartsPrimitive.DefaultLegendContentProps,
|
|
272
|
+
"payload" | "verticalAlign"
|
|
273
|
+
> & {
|
|
260
274
|
hideIcon?: boolean
|
|
261
275
|
nameKey?: string
|
|
262
276
|
}) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { Checkbox as CheckboxPrimitive } from "@base-ui-components/react/checkbox"
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
4
5
|
|
|
5
6
|
import { cn } from "@loveui/ui/lib/utils"
|
|
6
7
|
|
|
@@ -17,41 +18,47 @@ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
|
17
18
|
<CheckboxPrimitive.Indicator
|
|
18
19
|
data-slot="checkbox-indicator"
|
|
19
20
|
className="absolute -inset-px flex items-center justify-center rounded-[0.25rem] text-primary-foreground data-checked:bg-primary data-indeterminate:text-foreground data-unchecked:hidden"
|
|
20
|
-
render={(props, state) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
21
|
+
render={(props, state) => {
|
|
22
|
+
const { ref: _ref, ...spanProps } = props as {
|
|
23
|
+
ref?: unknown
|
|
24
|
+
} & ComponentPropsWithoutRef<"span">
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<span {...spanProps}>
|
|
28
|
+
{state.indeterminate ? (
|
|
29
|
+
<svg
|
|
30
|
+
className="size-3"
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
width="24"
|
|
33
|
+
height="24"
|
|
34
|
+
viewBox="0 0 24 24"
|
|
35
|
+
fill="none"
|
|
36
|
+
stroke="currentColor"
|
|
37
|
+
strokeWidth="3"
|
|
38
|
+
strokeLinecap="round"
|
|
39
|
+
strokeLinejoin="round"
|
|
40
|
+
>
|
|
41
|
+
<path d="M5.252 12h13.496" />
|
|
42
|
+
</svg>
|
|
43
|
+
) : (
|
|
44
|
+
<svg
|
|
45
|
+
className="size-3"
|
|
46
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
47
|
+
width="24"
|
|
48
|
+
height="24"
|
|
49
|
+
viewBox="0 0 24 24"
|
|
50
|
+
fill="none"
|
|
51
|
+
stroke="currentColor"
|
|
52
|
+
strokeWidth="3"
|
|
53
|
+
strokeLinecap="round"
|
|
54
|
+
strokeLinejoin="round"
|
|
55
|
+
>
|
|
56
|
+
<path d="M5.252 12.7 10.2 18.63 18.748 5.37" />
|
|
57
|
+
</svg>
|
|
58
|
+
)}
|
|
59
|
+
</span>
|
|
60
|
+
)
|
|
61
|
+
}}
|
|
55
62
|
/>
|
|
56
63
|
</CheckboxPrimitive.Root>
|
|
57
64
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
4
5
|
import { Command as CommandPrimitive } from "cmdk"
|
|
5
6
|
import { SearchIcon } from "lucide-react"
|
|
6
7
|
|
|
@@ -158,7 +159,7 @@ function CommandItem({
|
|
|
158
159
|
function CommandShortcut({
|
|
159
160
|
className,
|
|
160
161
|
...props
|
|
161
|
-
}:
|
|
162
|
+
}: ComponentPropsWithoutRef<"span">) {
|
|
162
163
|
return (
|
|
163
164
|
<span
|
|
164
165
|
data-slot="command-shortcut"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
3
4
|
import { Dialog as DialogPrimitive } from "@base-ui-components/react/dialog"
|
|
4
5
|
import { XIcon } from "lucide-react"
|
|
5
6
|
|
|
@@ -72,17 +73,17 @@ function DialogPopup({
|
|
|
72
73
|
)
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
function DialogHeader({ className, ...props }:
|
|
76
|
+
function DialogHeader({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
76
77
|
return (
|
|
77
78
|
<div
|
|
78
79
|
data-slot="dialog-header"
|
|
79
80
|
className={cn("flex flex-col gap-1 text-center sm:text-left", className)}
|
|
80
|
-
{...props}
|
|
81
|
+
{...(props as any)}
|
|
81
82
|
/>
|
|
82
83
|
)
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
function DialogFooter({ className, ...props }:
|
|
86
|
+
function DialogFooter({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
86
87
|
return (
|
|
87
88
|
<div
|
|
88
89
|
data-slot="dialog-footer"
|
|
@@ -90,7 +91,7 @@ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
90
91
|
"flex flex-col-reverse gap-2 sm:-mx-6 sm:mt-2 sm:-mb-6 sm:flex-row sm:justify-end sm:rounded-b-xl sm:border-t sm:bg-muted/50 sm:px-6 sm:py-4",
|
|
91
92
|
className
|
|
92
93
|
)}
|
|
93
|
-
{...props}
|
|
94
|
+
{...(props as any)}
|
|
94
95
|
/>
|
|
95
96
|
)
|
|
96
97
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
1
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@loveui/ui/lib/utils"
|
|
4
5
|
|
|
5
|
-
function Empty({ className, ...props }:
|
|
6
|
+
function Empty({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
6
7
|
return (
|
|
7
8
|
<div
|
|
8
9
|
data-slot="empty"
|
|
@@ -15,7 +16,7 @@ function Empty({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
15
16
|
)
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
function EmptyHeader({ className, ...props }:
|
|
19
|
+
function EmptyHeader({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
19
20
|
return (
|
|
20
21
|
<div
|
|
21
22
|
data-slot="empty-header"
|
|
@@ -47,7 +48,7 @@ function EmptyMedia({
|
|
|
47
48
|
className,
|
|
48
49
|
variant = "default",
|
|
49
50
|
...props
|
|
50
|
-
}:
|
|
51
|
+
}: ComponentPropsWithoutRef<"div"> & VariantProps<typeof emptyMediaVariants>) {
|
|
51
52
|
return (
|
|
52
53
|
<div
|
|
53
54
|
data-slot="empty-media"
|
|
@@ -81,7 +82,7 @@ function EmptyMedia({
|
|
|
81
82
|
)
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
function EmptyTitle({ className, ...props }:
|
|
85
|
+
function EmptyTitle({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
85
86
|
return (
|
|
86
87
|
<div
|
|
87
88
|
data-slot="empty-title"
|
|
@@ -91,7 +92,7 @@ function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
91
92
|
)
|
|
92
93
|
}
|
|
93
94
|
|
|
94
|
-
function EmptyDescription({ className, ...props }:
|
|
95
|
+
function EmptyDescription({ className, ...props }: ComponentPropsWithoutRef<"p">) {
|
|
95
96
|
return (
|
|
96
97
|
<div
|
|
97
98
|
data-slot="empty-description"
|
|
@@ -104,7 +105,7 @@ function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
|
104
105
|
)
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
function EmptyContent({ className, ...props }:
|
|
108
|
+
function EmptyContent({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
108
109
|
return (
|
|
109
110
|
<div
|
|
110
111
|
data-slot="empty-content"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@loveui/ui/lib/utils"
|
|
4
5
|
|
|
5
|
-
function Frame({ className, ...props }:
|
|
6
|
+
function Frame({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
6
7
|
return (
|
|
7
8
|
<div
|
|
8
9
|
data-slot="frame"
|
|
@@ -15,7 +16,7 @@ function Frame({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
15
16
|
)
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
function FramePanel({ className, ...props }:
|
|
19
|
+
function FramePanel({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
19
20
|
return (
|
|
20
21
|
<div
|
|
21
22
|
data-slot="frame-panel"
|
|
@@ -28,7 +29,7 @@ function FramePanel({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
28
29
|
)
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
function FrameHeader({ className, ...props }:
|
|
32
|
+
function FrameHeader({ className, ...props }: ComponentPropsWithoutRef<"header">) {
|
|
32
33
|
return (
|
|
33
34
|
<header
|
|
34
35
|
data-slot="frame-panel-header"
|
|
@@ -38,7 +39,7 @@ function FrameHeader({ className, ...props }: React.ComponentProps<"header">) {
|
|
|
38
39
|
)
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
function FrameTitle({ className, ...props }:
|
|
42
|
+
function FrameTitle({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
42
43
|
return (
|
|
43
44
|
<div
|
|
44
45
|
data-slot="frame-panel-title"
|
|
@@ -51,7 +52,7 @@ function FrameTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
51
52
|
function FrameDescription({
|
|
52
53
|
className,
|
|
53
54
|
...props
|
|
54
|
-
}:
|
|
55
|
+
}: ComponentPropsWithoutRef<"div">) {
|
|
55
56
|
return (
|
|
56
57
|
<div
|
|
57
58
|
data-slot="frame-panel-description"
|
|
@@ -61,7 +62,7 @@ function FrameDescription({
|
|
|
61
62
|
)
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
function FrameFooter({ className, ...props }:
|
|
65
|
+
function FrameFooter({ className, ...props }: ComponentPropsWithoutRef<"footer">) {
|
|
65
66
|
return (
|
|
66
67
|
<footer
|
|
67
68
|
data-slot="frame-panel-footer"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
|
+
import { cn } from "@loveui/ui/lib/utils"
|
|
2
3
|
|
|
3
|
-
function Kbd({ className, ...props }:
|
|
4
|
+
function Kbd({ className, ...props }: ComponentPropsWithoutRef<"kbd">) {
|
|
4
5
|
return (
|
|
5
6
|
<kbd
|
|
6
7
|
data-slot="kbd"
|
|
@@ -13,7 +14,7 @@ function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
|
|
|
13
14
|
)
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
function KbdGroup({ className, ...props }:
|
|
17
|
+
function KbdGroup({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
17
18
|
return (
|
|
18
19
|
<kbd
|
|
19
20
|
data-slot="kbd-group"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@loveui/ui/lib/utils"
|
|
4
5
|
|
|
5
|
-
function Label({ className, ...props }:
|
|
6
|
+
function Label({ className, ...props }: ComponentPropsWithoutRef<"label">) {
|
|
6
7
|
return (
|
|
7
8
|
<label
|
|
8
9
|
data-slot="label"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
4
5
|
import { Menu as MenuPrimitive } from "@base-ui-components/react/menu"
|
|
5
6
|
import { CheckIcon, ChevronRightIcon } from "lucide-react"
|
|
6
7
|
|
|
@@ -156,7 +157,7 @@ function MenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
|
|
|
156
157
|
)
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
function MenuShortcut({ className, ...props }:
|
|
160
|
+
function MenuShortcut({ className, ...props }: ComponentPropsWithoutRef<"span">) {
|
|
160
161
|
return (
|
|
161
162
|
<span
|
|
162
163
|
data-slot="menu-shortcut"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
4
5
|
import { NumberField as NumberFieldPrimitive } from "@base-ui-components/react/number-field"
|
|
5
6
|
import { MinusIcon, PlusIcon } from "lucide-react"
|
|
6
7
|
|
|
@@ -134,7 +135,7 @@ function NumberFieldScrubArea({
|
|
|
134
135
|
)
|
|
135
136
|
}
|
|
136
137
|
|
|
137
|
-
function CursorGrowIcon(props:
|
|
138
|
+
function CursorGrowIcon(props: ComponentPropsWithoutRef<"svg">) {
|
|
138
139
|
return (
|
|
139
140
|
<svg
|
|
140
141
|
width="26"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
import { mergeProps } from "@base-ui-components/react/merge-props"
|
|
3
4
|
import { useRender } from "@base-ui-components/react/use-render"
|
|
4
5
|
import {
|
|
@@ -10,7 +11,7 @@ import {
|
|
|
10
11
|
import { cn } from "@loveui/ui/lib/utils"
|
|
11
12
|
import { Button, buttonVariants } from "@loveui/ui/ui/button"
|
|
12
13
|
|
|
13
|
-
function Pagination({ className, ...props }:
|
|
14
|
+
function Pagination({ className, ...props }: ComponentPropsWithoutRef<"nav">) {
|
|
14
15
|
return (
|
|
15
16
|
<nav
|
|
16
17
|
role="navigation"
|
|
@@ -25,7 +26,7 @@ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
|
25
26
|
function PaginationContent({
|
|
26
27
|
className,
|
|
27
28
|
...props
|
|
28
|
-
}:
|
|
29
|
+
}: ComponentPropsWithoutRef<"ul">) {
|
|
29
30
|
return (
|
|
30
31
|
<ul
|
|
31
32
|
data-slot="pagination-content"
|
|
@@ -35,7 +36,7 @@ function PaginationContent({
|
|
|
35
36
|
)
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
function PaginationItem({ ...props }:
|
|
39
|
+
function PaginationItem({ ...props }: ComponentPropsWithoutRef<"li">) {
|
|
39
40
|
return <li data-slot="pagination-item" {...props} />
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -110,7 +111,7 @@ function PaginationNext({
|
|
|
110
111
|
function PaginationEllipsis({
|
|
111
112
|
className,
|
|
112
113
|
...props
|
|
113
|
-
}:
|
|
114
|
+
}: ComponentPropsWithoutRef<"span">) {
|
|
114
115
|
return (
|
|
115
116
|
<span
|
|
116
117
|
aria-hidden
|
|
@@ -38,7 +38,10 @@ function PopoverTrigger({
|
|
|
38
38
|
const { asChild: _childAsChild, ...restChildProps } =
|
|
39
39
|
(child.props ?? {}) as Record<string, unknown>
|
|
40
40
|
|
|
41
|
-
const childRef = child
|
|
41
|
+
const childRef = (child as any).ref as
|
|
42
|
+
| React.Ref<HTMLElement>
|
|
43
|
+
| null
|
|
44
|
+
| undefined
|
|
42
45
|
|
|
43
46
|
const mergedProps = mergeProps(restTriggerProps, restChildProps)
|
|
44
47
|
|
|
@@ -39,13 +39,22 @@ function SelectTrigger({
|
|
|
39
39
|
)
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
function SelectValue({
|
|
42
|
+
function SelectValue({
|
|
43
|
+
className,
|
|
44
|
+
placeholder,
|
|
45
|
+
children,
|
|
46
|
+
...props
|
|
47
|
+
}: SelectPrimitive.Value.Props & { placeholder?: string }) {
|
|
48
|
+
const resolvedChildren = children ?? ((value: unknown) => value ?? placeholder)
|
|
49
|
+
|
|
43
50
|
return (
|
|
44
51
|
<SelectPrimitive.Value
|
|
45
52
|
data-slot="select-value"
|
|
46
53
|
className={cn("truncate", className)}
|
|
47
54
|
{...props}
|
|
48
|
-
|
|
55
|
+
>
|
|
56
|
+
{resolvedChildren as any}
|
|
57
|
+
</SelectPrimitive.Value>
|
|
49
58
|
)
|
|
50
59
|
}
|
|
51
60
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
3
4
|
import { Dialog as SheetPrimitive } from "@base-ui-components/react/dialog"
|
|
4
5
|
import { XIcon } from "lucide-react"
|
|
5
6
|
|
|
@@ -75,22 +76,22 @@ function SheetPopup({
|
|
|
75
76
|
)
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
function SheetHeader({ className, ...props }:
|
|
79
|
+
function SheetHeader({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
79
80
|
return (
|
|
80
81
|
<div
|
|
81
82
|
data-slot="sheet-header"
|
|
82
83
|
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
83
|
-
{...props}
|
|
84
|
+
{...(props as any)}
|
|
84
85
|
/>
|
|
85
86
|
)
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
function SheetFooter({ className, ...props }:
|
|
89
|
+
function SheetFooter({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
89
90
|
return (
|
|
90
91
|
<div
|
|
91
92
|
data-slot="sheet-footer"
|
|
92
93
|
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
93
|
-
{...props}
|
|
94
|
+
{...(props as any)}
|
|
94
95
|
/>
|
|
95
96
|
)
|
|
96
97
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
1
3
|
import { cn } from "@loveui/ui/lib/utils"
|
|
2
4
|
|
|
3
|
-
function Skeleton({ className, ...props }:
|
|
5
|
+
function Skeleton({ className, ...props }: ComponentPropsWithoutRef<"div">) {
|
|
4
6
|
return (
|
|
5
7
|
<div
|
|
6
8
|
data-slot="skeleton"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@loveui/ui/lib/utils"
|
|
4
5
|
|
|
5
|
-
function Table({ className, ...props }:
|
|
6
|
+
function Table({ className, ...props }: ComponentPropsWithoutRef<"table">) {
|
|
6
7
|
return (
|
|
7
8
|
<div
|
|
8
9
|
data-slot="table-container"
|
|
@@ -20,7 +21,7 @@ function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
|
20
21
|
)
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
function TableHeader({ className, ...props }:
|
|
24
|
+
function TableHeader({ className, ...props }: ComponentPropsWithoutRef<"thead">) {
|
|
24
25
|
return (
|
|
25
26
|
<thead
|
|
26
27
|
data-slot="table-header"
|
|
@@ -33,7 +34,7 @@ function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
|
33
34
|
)
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
function TableBody({ className, ...props }:
|
|
37
|
+
function TableBody({ className, ...props }: ComponentPropsWithoutRef<"tbody">) {
|
|
37
38
|
return (
|
|
38
39
|
<tbody
|
|
39
40
|
data-slot="table-body"
|
|
@@ -46,7 +47,7 @@ function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
|
46
47
|
)
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
function TableFooter({ className, ...props }:
|
|
50
|
+
function TableFooter({ className, ...props }: ComponentPropsWithoutRef<"tfoot">) {
|
|
50
51
|
return (
|
|
51
52
|
<tfoot
|
|
52
53
|
data-slot="table-footer"
|
|
@@ -59,7 +60,7 @@ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
|
59
60
|
)
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
function TableRow({ className, ...props }:
|
|
63
|
+
function TableRow({ className, ...props }: ComponentPropsWithoutRef<"tr">) {
|
|
63
64
|
return (
|
|
64
65
|
<tr
|
|
65
66
|
data-slot="table-row"
|
|
@@ -72,7 +73,7 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
|
72
73
|
)
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
function TableHead({ className, ...props }:
|
|
76
|
+
function TableHead({ className, ...props }: ComponentPropsWithoutRef<"th">) {
|
|
76
77
|
return (
|
|
77
78
|
<th
|
|
78
79
|
data-slot="table-head"
|
|
@@ -85,7 +86,7 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
|
85
86
|
)
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
function TableCell({ className, ...props }:
|
|
89
|
+
function TableCell({ className, ...props }: ComponentPropsWithoutRef<"td">) {
|
|
89
90
|
return (
|
|
90
91
|
<td
|
|
91
92
|
data-slot="table-cell"
|
|
@@ -101,7 +102,7 @@ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
|
101
102
|
function TableCaption({
|
|
102
103
|
className,
|
|
103
104
|
...props
|
|
104
|
-
}:
|
|
105
|
+
}: ComponentPropsWithoutRef<"caption">) {
|
|
105
106
|
return (
|
|
106
107
|
<caption
|
|
107
108
|
data-slot="table-caption"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import type { ComponentPropsWithoutRef } from "react"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@loveui/ui/lib/utils"
|
|
4
5
|
|
|
@@ -6,7 +7,7 @@ function Textarea({
|
|
|
6
7
|
className,
|
|
7
8
|
size = "default",
|
|
8
9
|
...props
|
|
9
|
-
}:
|
|
10
|
+
}: ComponentPropsWithoutRef<"textarea"> & {
|
|
10
11
|
size?: "sm" | "default" | "lg" | number
|
|
11
12
|
}) {
|
|
12
13
|
return (
|