@soybeanjs/unocss-shadcn 0.1.2 → 0.2.0
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/generate-DuJ16ACb.js +23 -0
- package/dist/index.d.ts +2 -124
- package/dist/index.js +4 -26
- package/dist/shared.d.ts +11 -0
- package/dist/shared.js +1 -0
- package/dist/types-Im720LAV.d.ts +119 -0
- package/package.json +6 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import{mergeDeep as e}from"@unocss/core";import{generateTailwindPalette as t}from"@soybeanjs/color-palette";import{colord as n}from"colord";const r=[{name:`default`,label:`Default`,cssVars:{light:{background:`0 0% 100%`,foreground:`224 71.4% 4.1%`,card:`0 0% 100%`,"card-foreground":`224 71.4% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`224 71.4% 4.1%`,primary:`236.9 100% 69.61%`,"primary-foreground":`0 0% 100%`,secondary:`229 20% 90%`,"secondary-foreground":`229 20% 30%`,muted:`220 14.3% 95.9%`,"muted-foreground":`220 8.9% 46.1%`,accent:`220 14.3% 95.9%`,"accent-foreground":`220.9 39.3% 11%`,destructive:`0 92.99% 56.11%`,"destructive-foreground":`0 0% 100%`,border:`220 13% 91%`,input:`220 13% 91%`,ring:`262.1 83.3% 57.8%`},dark:{background:`224 71.4% 4.1%`,foreground:`210 20% 98%`,card:`224 71.4% 4.1%`,"card-foreground":`210 20% 98%`,popover:`224 71.4% 4.1%`,"popover-foreground":`210 20% 98%`,primary:`236.9 100% 69.61%`,"primary-foreground":`0 0% 100%`,secondary:`229 14% 8%`,"secondary-foreground":`229 14% 68%`,muted:`215 27.9% 16.9%`,"muted-foreground":`217.9 10.6% 64.9%`,accent:`215 27.9% 16.9%`,"accent-foreground":`210 20% 98%`,destructive:`0 92.99% 56.11%`,"destructive-foreground":`0 0% 100%`,border:`215 27.9% 16.9%`,input:`215 27.9% 16.9%`,ring:`263.4 70% 50.4%`}}},{name:`zinc`,label:`Zinc`,cssVars:{light:{background:`0 0% 100%`,foreground:`240 10% 3.9%`,card:`0 0% 100%`,"card-foreground":`240 10% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`240 10% 3.9%`,primary:`240 5.9% 10%`,"primary-foreground":`0 0% 98%`,secondary:`240 4.8% 95.9%`,"secondary-foreground":`240 5.9% 10%`,muted:`240 4.8% 95.9%`,"muted-foreground":`240 3.8% 46.1%`,accent:`240 4.8% 95.9%`,"accent-foreground":`240 5.9% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`240 5.9% 90%`,input:`240 5.9% 90%`,ring:`240 5.9% 10%`,radius:`0.5rem`},dark:{background:`240 10% 3.9%`,foreground:`0 0% 98%`,card:`240 10% 3.9%`,"card-foreground":`0 0% 98%`,popover:`240 10% 3.9%`,"popover-foreground":`0 0% 98%`,primary:`0 0% 98%`,"primary-foreground":`240 5.9% 10%`,secondary:`240 3.7% 15.9%`,"secondary-foreground":`0 0% 98%`,muted:`240 3.7% 15.9%`,"muted-foreground":`240 5% 64.9%`,accent:`240 3.7% 15.9%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 0% 98%`,border:`240 3.7% 15.9%`,input:`240 3.7% 15.9%`,ring:`240 4.9% 83.9%`}}},{name:`slate`,label:`Slate`,cssVars:{light:{background:`0 0% 100%`,foreground:`222.2 84% 4.9%`,card:`0 0% 100%`,"card-foreground":`222.2 84% 4.9%`,popover:`0 0% 100%`,"popover-foreground":`222.2 84% 4.9%`,primary:`222.2 47.4% 11.2%`,"primary-foreground":`210 40% 98%`,secondary:`210 40% 96.1%`,"secondary-foreground":`222.2 47.4% 11.2%`,muted:`210 40% 96.1%`,"muted-foreground":`215.4 16.3% 46.9%`,accent:`210 40% 96.1%`,"accent-foreground":`222.2 47.4% 11.2%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 40% 98%`,border:`214.3 31.8% 91.4%`,input:`214.3 31.8% 91.4%`,ring:`222.2 84% 4.9%`,radius:`0.5rem`},dark:{background:`222.2 84% 4.9%`,foreground:`210 40% 98%`,card:`222.2 84% 4.9%`,"card-foreground":`210 40% 98%`,popover:`222.2 84% 4.9%`,"popover-foreground":`210 40% 98%`,primary:`210 40% 98%`,"primary-foreground":`222.2 47.4% 11.2%`,secondary:`217.2 32.6% 17.5%`,"secondary-foreground":`210 40% 98%`,muted:`217.2 32.6% 17.5%`,"muted-foreground":`215 20.2% 65.1%`,accent:`217.2 32.6% 17.5%`,"accent-foreground":`210 40% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 40% 98%`,border:`217.2 32.6% 17.5%`,input:`217.2 32.6% 17.5%`,ring:`212.7 26.8% 83.9%`}}},{name:`stone`,label:`Stone`,cssVars:{light:{background:`0 0% 100%`,foreground:`20 14.3% 4.1%`,card:`0 0% 100%`,"card-foreground":`20 14.3% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`20 14.3% 4.1%`,primary:`24 9.8% 10%`,"primary-foreground":`60 9.1% 97.8%`,secondary:`60 4.8% 95.9%`,"secondary-foreground":`24 9.8% 10%`,muted:`60 4.8% 95.9%`,"muted-foreground":`25 5.3% 44.7%`,accent:`60 4.8% 95.9%`,"accent-foreground":`24 9.8% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`60 9.1% 97.8%`,border:`20 5.9% 90%`,input:`20 5.9% 90%`,ring:`20 14.3% 4.1%`,radius:`0.95rem`},dark:{background:`20 14.3% 4.1%`,foreground:`60 9.1% 97.8%`,card:`20 14.3% 4.1%`,"card-foreground":`60 9.1% 97.8%`,popover:`20 14.3% 4.1%`,"popover-foreground":`60 9.1% 97.8%`,primary:`60 9.1% 97.8%`,"primary-foreground":`24 9.8% 10%`,secondary:`12 6.5% 15.1%`,"secondary-foreground":`60 9.1% 97.8%`,muted:`12 6.5% 15.1%`,"muted-foreground":`24 5.4% 63.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`60 9.1% 97.8%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`60 9.1% 97.8%`,border:`12 6.5% 15.1%`,input:`12 6.5% 15.1%`,ring:`24 5.7% 82.9%`}}},{name:`gray`,label:`Gray`,cssVars:{light:{background:`0 0% 100%`,foreground:`224 71.4% 4.1%`,card:`0 0% 100%`,"card-foreground":`224 71.4% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`224 71.4% 4.1%`,primary:`220.9 39.3% 11%`,"primary-foreground":`210 20% 98%`,secondary:`220 14.3% 95.9%`,"secondary-foreground":`220.9 39.3% 11%`,muted:`220 14.3% 95.9%`,"muted-foreground":`220 8.9% 46.1%`,accent:`220 14.3% 95.9%`,"accent-foreground":`220.9 39.3% 11%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 20% 98%`,border:`220 13% 91%`,input:`220 13% 91%`,ring:`224 71.4% 4.1%`,radius:`0.35rem`},dark:{background:`224 71.4% 4.1%`,foreground:`210 20% 98%`,card:`224 71.4% 4.1%`,"card-foreground":`210 20% 98%`,popover:`224 71.4% 4.1%`,"popover-foreground":`210 20% 98%`,primary:`210 20% 98%`,"primary-foreground":`220.9 39.3% 11%`,secondary:`215 27.9% 16.9%`,"secondary-foreground":`210 20% 98%`,muted:`215 27.9% 16.9%`,"muted-foreground":`217.9 10.6% 64.9%`,accent:`215 27.9% 16.9%`,"accent-foreground":`210 20% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 20% 98%`,border:`215 27.9% 16.9%`,input:`215 27.9% 16.9%`,ring:`216 12.2% 83.9%`}}},{name:`neutral`,label:`Neutral`,cssVars:{light:{background:`0 0% 100%`,foreground:`0 0% 3.9%`,card:`0 0% 100%`,"card-foreground":`0 0% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`0 0% 3.9%`,primary:`0 0% 9%`,"primary-foreground":`0 0% 98%`,secondary:`0 0% 96.1%`,"secondary-foreground":`0 0% 9%`,muted:`0 0% 96.1%`,"muted-foreground":`0 0% 45.1%`,accent:`0 0% 96.1%`,"accent-foreground":`0 0% 9%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 89.8%`,input:`0 0% 89.8%`,ring:`0 0% 3.9%`},dark:{background:`0 0% 3.9%`,foreground:`0 0% 98%`,card:`0 0% 3.9%`,"card-foreground":`0 0% 98%`,popover:`0 0% 3.9%`,"popover-foreground":`0 0% 98%`,primary:`0 0% 98%`,"primary-foreground":`0 0% 9%`,secondary:`0 0% 14.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 14.9%`,"muted-foreground":`0 0% 63.9%`,accent:`0 0% 14.9%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 14.9%`,input:`0 0% 14.9%`,ring:`0 0% 83.1%`}}},{name:`red`,label:`Red`,cssVars:{light:{background:`0 0% 100%`,foreground:`0 0% 3.9%`,card:`0 0% 100%`,"card-foreground":`0 0% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`0 0% 3.9%`,primary:`0 72.2% 50.6%`,"primary-foreground":`0 85.7% 97.3%`,secondary:`0 0% 96.1%`,"secondary-foreground":`0 0% 9%`,muted:`0 0% 96.1%`,"muted-foreground":`0 0% 45.1%`,accent:`0 0% 96.1%`,"accent-foreground":`0 0% 9%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 89.8%`,input:`0 0% 89.8%`,ring:`0 72.2% 50.6%`,radius:`0.4rem`},dark:{background:`0 0% 3.9%`,foreground:`0 0% 98%`,card:`0 0% 3.9%`,"card-foreground":`0 0% 98%`,popover:`0 0% 3.9%`,"popover-foreground":`0 0% 98%`,primary:`0 72.2% 50.6%`,"primary-foreground":`0 85.7% 97.3%`,secondary:`0 0% 14.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 14.9%`,"muted-foreground":`0 0% 63.9%`,accent:`0 0% 14.9%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 14.9%`,input:`0 0% 14.9%`,ring:`0 72.2% 50.6%`}}},{name:`rose`,label:`Rose`,cssVars:{light:{background:`0 0% 100%`,foreground:`240 10% 3.9%`,card:`0 0% 100%`,"card-foreground":`240 10% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`240 10% 3.9%`,primary:`346.8 77.2% 49.8%`,"primary-foreground":`355.7 100% 97.3%`,secondary:`240 4.8% 95.9%`,"secondary-foreground":`240 5.9% 10%`,muted:`240 4.8% 95.9%`,"muted-foreground":`240 3.8% 46.1%`,accent:`240 4.8% 95.9%`,"accent-foreground":`240 5.9% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`240 5.9% 90%`,input:`240 5.9% 90%`,ring:`346.8 77.2% 49.8%`,radius:`0.5rem`},dark:{background:`20 14.3% 4.1%`,foreground:`0 0% 95%`,popover:`0 0% 9%`,"popover-foreground":`0 0% 95%`,card:`24 9.8% 10%`,"card-foreground":`0 0% 95%`,primary:`346.8 77.2% 49.8%`,"primary-foreground":`355.7 100% 97.3%`,secondary:`240 3.7% 15.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 15%`,"muted-foreground":`240 5% 64.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 85.7% 97.3%`,border:`240 3.7% 15.9%`,input:`240 3.7% 15.9%`,ring:`346.8 77.2% 49.8%`}}},{name:`orange`,label:`Orange`,cssVars:{light:{background:`0 0% 100%`,foreground:`20 14.3% 4.1%`,card:`0 0% 100%`,"card-foreground":`20 14.3% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`20 14.3% 4.1%`,primary:`24.6 95% 53.1%`,"primary-foreground":`60 9.1% 97.8%`,secondary:`60 4.8% 95.9%`,"secondary-foreground":`24 9.8% 10%`,muted:`60 4.8% 95.9%`,"muted-foreground":`25 5.3% 44.7%`,accent:`60 4.8% 95.9%`,"accent-foreground":`24 9.8% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`60 9.1% 97.8%`,border:`20 5.9% 90%`,input:`20 5.9% 90%`,ring:`24.6 95% 53.1%`,radius:`0.95rem`},dark:{background:`20 14.3% 4.1%`,foreground:`60 9.1% 97.8%`,card:`20 14.3% 4.1%`,"card-foreground":`60 9.1% 97.8%`,popover:`20 14.3% 4.1%`,"popover-foreground":`60 9.1% 97.8%`,primary:`20.5 90.2% 48.2%`,"primary-foreground":`60 9.1% 97.8%`,secondary:`12 6.5% 15.1%`,"secondary-foreground":`60 9.1% 97.8%`,muted:`12 6.5% 15.1%`,"muted-foreground":`24 5.4% 63.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`60 9.1% 97.8%`,destructive:`0 72.2% 50.6%`,"destructive-foreground":`60 9.1% 97.8%`,border:`12 6.5% 15.1%`,input:`12 6.5% 15.1%`,ring:`20.5 90.2% 48.2%`}}},{name:`green`,label:`Green`,cssVars:{light:{background:`0 0% 100%`,foreground:`240 10% 3.9%`,card:`0 0% 100%`,"card-foreground":`240 10% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`240 10% 3.9%`,primary:`142.1 76.2% 36.3%`,"primary-foreground":`355.7 100% 97.3%`,secondary:`240 4.8% 95.9%`,"secondary-foreground":`240 5.9% 10%`,muted:`240 4.8% 95.9%`,"muted-foreground":`240 3.8% 46.1%`,accent:`240 4.8% 95.9%`,"accent-foreground":`240 5.9% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`240 5.9% 90%`,input:`240 5.9% 90%`,ring:`142.1 76.2% 36.3%`},dark:{background:`20 14.3% 4.1%`,foreground:`0 0% 95%`,popover:`0 0% 9%`,"popover-foreground":`0 0% 95%`,card:`24 9.8% 10%`,"card-foreground":`0 0% 95%`,primary:`142.1 70.6% 45.3%`,"primary-foreground":`144.9 80.4% 10%`,secondary:`240 3.7% 15.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 15%`,"muted-foreground":`240 5% 64.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 85.7% 97.3%`,border:`240 3.7% 15.9%`,input:`240 3.7% 15.9%`,ring:`142.4 71.8% 29.2%`}}},{name:`blue`,label:`Blue`,cssVars:{light:{background:`0 0% 100%`,foreground:`222.2 84% 4.9%`,card:`0 0% 100%`,"card-foreground":`222.2 84% 4.9%`,popover:`0 0% 100%`,"popover-foreground":`222.2 84% 4.9%`,primary:`221.2 83.2% 53.3%`,"primary-foreground":`210 40% 98%`,secondary:`210 40% 96.1%`,"secondary-foreground":`222.2 47.4% 11.2%`,muted:`210 40% 96.1%`,"muted-foreground":`215.4 16.3% 46.9%`,accent:`210 40% 96.1%`,"accent-foreground":`222.2 47.4% 11.2%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 40% 98%`,border:`214.3 31.8% 91.4%`,input:`214.3 31.8% 91.4%`,ring:`221.2 83.2% 53.3%`},dark:{background:`222.2 84% 4.9%`,foreground:`210 40% 98%`,card:`222.2 84% 4.9%`,"card-foreground":`210 40% 98%`,popover:`222.2 84% 4.9%`,"popover-foreground":`210 40% 98%`,primary:`217.2 91.2% 59.8%`,"primary-foreground":`222.2 47.4% 11.2%`,secondary:`217.2 32.6% 17.5%`,"secondary-foreground":`210 40% 98%`,muted:`217.2 32.6% 17.5%`,"muted-foreground":`215 20.2% 65.1%`,accent:`217.2 32.6% 17.5%`,"accent-foreground":`210 40% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 40% 98%`,border:`217.2 32.6% 17.5%`,input:`217.2 32.6% 17.5%`,ring:`224.3 76.3% 48%`}}},{name:`yellow`,label:`Yellow`,cssVars:{light:{background:`0 0% 100%`,foreground:`20 14.3% 4.1%`,card:`0 0% 100%`,"card-foreground":`20 14.3% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`20 14.3% 4.1%`,primary:`47.9 95.8% 53.1%`,"primary-foreground":`26 83.3% 14.1%`,secondary:`60 4.8% 95.9%`,"secondary-foreground":`24 9.8% 10%`,muted:`60 4.8% 95.9%`,"muted-foreground":`25 5.3% 44.7%`,accent:`60 4.8% 95.9%`,"accent-foreground":`24 9.8% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`60 9.1% 97.8%`,border:`20 5.9% 90%`,input:`20 5.9% 90%`,ring:`20 14.3% 4.1%`,radius:`0.95rem`},dark:{background:`20 14.3% 4.1%`,foreground:`60 9.1% 97.8%`,card:`20 14.3% 4.1%`,"card-foreground":`60 9.1% 97.8%`,popover:`20 14.3% 4.1%`,"popover-foreground":`60 9.1% 97.8%`,primary:`47.9 95.8% 53.1%`,"primary-foreground":`26 83.3% 14.1%`,secondary:`12 6.5% 15.1%`,"secondary-foreground":`60 9.1% 97.8%`,muted:`12 6.5% 15.1%`,"muted-foreground":`24 5.4% 63.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`60 9.1% 97.8%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`60 9.1% 97.8%`,border:`12 6.5% 15.1%`,input:`12 6.5% 15.1%`,ring:`35.5 91.7% 32.9%`}}},{name:`violet`,label:`Violet`,cssVars:{light:{background:`0 0% 100%`,foreground:`224 71.4% 4.1%`,card:`0 0% 100%`,"card-foreground":`224 71.4% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`224 71.4% 4.1%`,primary:`262.1 83.3% 57.8%`,"primary-foreground":`210 20% 98%`,secondary:`220 14.3% 95.9%`,"secondary-foreground":`220.9 39.3% 11%`,muted:`220 14.3% 95.9%`,"muted-foreground":`220 8.9% 46.1%`,accent:`220 14.3% 95.9%`,"accent-foreground":`220.9 39.3% 11%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 20% 98%`,border:`220 13% 91%`,input:`220 13% 91%`,ring:`262.1 83.3% 57.8%`},dark:{background:`224 71.4% 4.1%`,foreground:`210 20% 98%`,card:`224 71.4% 4.1%`,"card-foreground":`210 20% 98%`,popover:`224 71.4% 4.1%`,"popover-foreground":`210 20% 98%`,primary:`263.4 70% 50.4%`,"primary-foreground":`210 20% 98%`,secondary:`215 27.9% 16.9%`,"secondary-foreground":`210 20% 98%`,muted:`215 27.9% 16.9%`,"muted-foreground":`217.9 10.6% 64.9%`,accent:`215 27.9% 16.9%`,"accent-foreground":`210 20% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 20% 98%`,border:`215 27.9% 16.9%`,input:`215 27.9% 16.9%`,ring:`263.4 70% 50.4%`}}}],i=`background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.destructive.destructive-foreground.success.success-foreground.warning.warning-foreground.info.info-foreground.secondary.secondary-foreground.carbon.carbon-foreground.muted.muted-foreground.accent.accent-foreground.border.input.ring.sidebar-background.sidebar-foreground.sidebar-border.sidebar-ring.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground`.split(`.`),a=[`primary`,`destructive`,`success`,`warning`,`info`,`carbon`];function o(e){return Object.entries(e).map(([e,r])=>{let o=e;if(!i.includes(o))return``;let s=` --${o}: ${r};`;if(a.includes(o)){let e=t(`hsl(${r.split(` `).join(`, `)})`);for(let[t,r]of Object.entries(e)){let{h:e,s:i,l:a}=n(r).toHsl();s+=`\n --${o}-${t}: ${e} ${i}% ${a}%;`}}return s}).filter(Boolean).join(`
|
|
2
|
+
`)}function s(e,t,n){let{darkSelector:r,radius:i,themeName:a}=n,o=a&&a!==`default`;return`
|
|
3
|
+
${o?`.theme-${a}`:`:root`} {
|
|
4
|
+
${e}
|
|
5
|
+
${i||i===0?c(i):``}
|
|
6
|
+
}
|
|
7
|
+
${o?`.theme-${a}${r}`:r} {
|
|
8
|
+
${t}
|
|
9
|
+
}`}function c(e){return` --radius: ${e}rem;`}function l(e){return`
|
|
10
|
+
:root {
|
|
11
|
+
${c(e)}
|
|
12
|
+
}
|
|
13
|
+
`}function u(){return`
|
|
14
|
+
* {
|
|
15
|
+
border-color: hsl(var(--border));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
body {
|
|
19
|
+
color: hsl(var(--foreground));
|
|
20
|
+
background: hsl(var(--background));
|
|
21
|
+
}
|
|
22
|
+
`}function d(e){let t=r.find(t=>t.name===e);if(!t)throw Error(`Unknown color: ${e}`);return{name:e,...t.cssVars}}function f(t){let n,r,i;return typeof t==`string`?(i=t,{light:n,dark:r}=d(t)):`base`in t?(i=t.base,{light:n,dark:r}=e(d(t.base),t)):(i=t.name,{light:n,dark:r}=t),{light:n,dark:r,name:i}}function p(){return{light:{success:`140 79% 45%`,"success-foreground":`0 0% 100%`,warning:`37 91% 55%`,"warning-foreground":`0 0% 100%`,info:`215 100% 54%`,"info-foreground":`0 0% 100%`,carbon:`240 4% 16%`,"carbon-foreground":`0 0% 98%`},dark:{success:`140 79% 45%`,"success-foreground":`0 0% 100%`,warning:`37 91% 55%`,"warning-foreground":`0 0% 100%`,info:`215 100% 54%`,"info-foreground":`0 0% 100%`,carbon:`220 14.3% 95.9%`,"carbon-foreground":`220.9 39.3% 11%`}}}function m(){return{light:{"sidebar-background":`0 0% 98%`,"sidebar-foreground":`240 5.3% 26.1%`,"sidebar-primary":`236.9 100% 69.61%`,"sidebar-primary-foreground":`0 0% 98%`,"sidebar-accent":`240 4.8% 95.9%`,"sidebar-accent-foreground":`240 5.9% 10%`,"sidebar-border":`220 13% 91%`,"sidebar-ring":`217.2 91.2% 59.8%`},dark:{"sidebar-background":`240 5.9% 10%`,"sidebar-foreground":`240 4.8% 95.9%`,"sidebar-primary":`236.9 100% 69.61%`,"sidebar-primary-foreground":`0 0% 100%`,"sidebar-accent":`240 3.7% 15.9%`,"sidebar-accent-foreground":`240 4.8% 95.9%`,"sidebar-border":`240 3.7% 15.9%`,"sidebar-ring":`217.2 91.2% 59.8%`}}}function h(e={},t=!0){if(Array.isArray(e))return e.map(e=>h(e,!1)).join(`
|
|
23
|
+
`);let{color:n=`default`,radius:r=.5,darkSelector:i=`.dark`,feedbackColor:a=p(),sidebar:c=m()}=e,u=``;if(!n)r&&(u+=l(r));else{let{light:e,dark:l,name:d}=f(n),p=o({...e,...a.light,...c.light}),m=o({...l,...a.dark,...c.dark});u+=s(p,m,{radius:r,themeName:!t&&d,darkSelector:i})}return u}export{u as n,r,h as t};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,130 +1,8 @@
|
|
|
1
|
+
import { a as ThemeOptions, i as ThemeConfigColor, n as ThemeColorKey, r as ThemeConfig, t as PresetShadcnOptions } from "./types-Im720LAV.js";
|
|
1
2
|
import * as unocss0 from "unocss";
|
|
2
3
|
import { Theme } from "unocss/preset-mini";
|
|
3
|
-
import { DeepPartial } from "@unocss/core";
|
|
4
4
|
|
|
5
|
-
//#region src/types.d.ts
|
|
6
|
-
type HslColorString = `${number} ${number}% ${number}%`;
|
|
7
|
-
type ThemeCSSVars = {
|
|
8
|
-
background: HslColorString;
|
|
9
|
-
foreground: HslColorString;
|
|
10
|
-
card: HslColorString;
|
|
11
|
-
'card-foreground': HslColorString;
|
|
12
|
-
popover: HslColorString;
|
|
13
|
-
'popover-foreground': HslColorString;
|
|
14
|
-
primary: HslColorString;
|
|
15
|
-
'primary-foreground': HslColorString;
|
|
16
|
-
secondary: HslColorString;
|
|
17
|
-
'secondary-foreground': HslColorString;
|
|
18
|
-
muted: HslColorString;
|
|
19
|
-
'muted-foreground': HslColorString;
|
|
20
|
-
accent: HslColorString;
|
|
21
|
-
'accent-foreground': HslColorString;
|
|
22
|
-
destructive: HslColorString;
|
|
23
|
-
'destructive-foreground': HslColorString;
|
|
24
|
-
border: HslColorString;
|
|
25
|
-
input: HslColorString;
|
|
26
|
-
ring: HslColorString;
|
|
27
|
-
radius?: string;
|
|
28
|
-
};
|
|
29
|
-
type ThemeCSSVarKey = keyof ThemeCSSVars;
|
|
30
|
-
type FeedbackColorOfThemeCssVars = {
|
|
31
|
-
success: HslColorString;
|
|
32
|
-
'success-foreground': HslColorString;
|
|
33
|
-
warning: HslColorString;
|
|
34
|
-
'warning-foreground': HslColorString;
|
|
35
|
-
info: HslColorString;
|
|
36
|
-
'info-foreground': HslColorString;
|
|
37
|
-
carbon: HslColorString;
|
|
38
|
-
'carbon-foreground': HslColorString;
|
|
39
|
-
};
|
|
40
|
-
type FeedbackColorOfThemeCssVarKey = keyof FeedbackColorOfThemeCssVars;
|
|
41
|
-
type SidebarColorOfThemeCssVars = {
|
|
42
|
-
'sidebar-background': HslColorString;
|
|
43
|
-
'sidebar-foreground': HslColorString;
|
|
44
|
-
'sidebar-border': HslColorString;
|
|
45
|
-
'sidebar-ring': HslColorString;
|
|
46
|
-
'sidebar-primary': HslColorString;
|
|
47
|
-
'sidebar-primary-foreground': HslColorString;
|
|
48
|
-
'sidebar-accent': HslColorString;
|
|
49
|
-
'sidebar-accent-foreground': HslColorString;
|
|
50
|
-
};
|
|
51
|
-
interface ThemeCSSVarsVariant {
|
|
52
|
-
name: string;
|
|
53
|
-
light: ThemeCSSVars;
|
|
54
|
-
dark: ThemeCSSVars;
|
|
55
|
-
}
|
|
56
|
-
interface FeedbackColorOfThemeCssVarsVariant {
|
|
57
|
-
light: FeedbackColorOfThemeCssVars;
|
|
58
|
-
dark: FeedbackColorOfThemeCssVars;
|
|
59
|
-
}
|
|
60
|
-
interface SidebarColorOfThemeCssVarsVariant {
|
|
61
|
-
light: SidebarColorOfThemeCssVars;
|
|
62
|
-
dark: SidebarColorOfThemeCssVars;
|
|
63
|
-
}
|
|
64
|
-
type ThemeConfigColor = 'default' | 'zinc' | 'slate' | 'stone' | 'gray' | 'neutral' | 'red' | 'rose' | 'orange' | 'green' | 'blue' | 'yellow' | 'violet';
|
|
65
|
-
type ThemeConfig<T = ThemeConfigColor> = {
|
|
66
|
-
name: T;
|
|
67
|
-
label: string;
|
|
68
|
-
cssVars: {
|
|
69
|
-
light: ThemeCSSVars;
|
|
70
|
-
dark: ThemeCSSVars;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
type ColorOptions = ThemeConfigColor | ThemeCSSVarsVariant | ({
|
|
74
|
-
base: ThemeConfigColor;
|
|
75
|
-
} & DeepPartial<ThemeCSSVarsVariant>);
|
|
76
|
-
interface ThemeOptions {
|
|
77
|
-
/**
|
|
78
|
-
* theme color options
|
|
79
|
-
*
|
|
80
|
-
* @default 'default'
|
|
81
|
-
*/
|
|
82
|
-
color?: ColorOptions | false;
|
|
83
|
-
/** feedback color */
|
|
84
|
-
feedbackColor?: FeedbackColorOfThemeCssVarsVariant;
|
|
85
|
-
/** sidebar color */
|
|
86
|
-
sidebar?: SidebarColorOfThemeCssVarsVariant;
|
|
87
|
-
/**
|
|
88
|
-
* theme radius
|
|
89
|
-
*
|
|
90
|
-
* @default 0.5
|
|
91
|
-
*/
|
|
92
|
-
radius?: number | false;
|
|
93
|
-
/**
|
|
94
|
-
* dark theme selector
|
|
95
|
-
*
|
|
96
|
-
* @default '.dark'
|
|
97
|
-
*/
|
|
98
|
-
darkSelector?: string;
|
|
99
|
-
}
|
|
100
|
-
interface PresetShadcnOptions {
|
|
101
|
-
/**
|
|
102
|
-
* theme options
|
|
103
|
-
*/
|
|
104
|
-
theme?: ThemeOptions | ThemeOptions[];
|
|
105
|
-
/**
|
|
106
|
-
* Whether to generate global variables, like *.border-color, body.color, body.background.
|
|
107
|
-
* @default true
|
|
108
|
-
*/
|
|
109
|
-
globals?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Whether to generate preflights.
|
|
112
|
-
*
|
|
113
|
-
* Add css variables to html tag, like --background, --foreground, etc.
|
|
114
|
-
*
|
|
115
|
-
* @default true
|
|
116
|
-
*/
|
|
117
|
-
generatePreflights?: boolean;
|
|
118
|
-
}
|
|
119
|
-
type ThemeColorKey = Extract<ThemeCSSVarKey, 'primary' | 'secondary' | 'destructive'> | Extract<FeedbackColorOfThemeCssVarKey, 'success' | 'warning' | 'info' | 'carbon'>;
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/generate.d.ts
|
|
122
|
-
declare function generateCSSVars(theme?: ThemeOptions | ThemeOptions[], onlyOne?: boolean): string;
|
|
123
|
-
//#endregion
|
|
124
5
|
//#region src/index.d.ts
|
|
125
|
-
declare const builtinColors: ThemeConfigColor[];
|
|
126
|
-
declare const builtinColorMap: Record<ThemeConfigColor, string>;
|
|
127
|
-
declare const builtinRadiuses: readonly [0, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1];
|
|
128
6
|
declare const presetShadcn: unocss0.PresetFactory<Theme, PresetShadcnOptions>;
|
|
129
7
|
//#endregion
|
|
130
|
-
export { type PresetShadcnOptions, type ThemeColorKey, type ThemeConfig, type ThemeConfigColor, type ThemeOptions,
|
|
8
|
+
export { type PresetShadcnOptions, type ThemeColorKey, type ThemeConfig, type ThemeConfigColor, type ThemeOptions, presetShadcn };
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,12 @@
|
|
|
1
|
-
import{definePreset as e,mergeDeep as t}from"unocss";import{generateTailwindPalette as n}from"@soybeanjs/color-palette";import{colord as r}from"colord";const i=[{name:`default`,label:`Default`,cssVars:{light:{background:`0 0% 100%`,foreground:`224 71.4% 4.1%`,card:`0 0% 100%`,"card-foreground":`224 71.4% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`224 71.4% 4.1%`,primary:`236.9 100% 69.61%`,"primary-foreground":`0 0% 100%`,secondary:`229 20% 90%`,"secondary-foreground":`229 20% 30%`,muted:`220 14.3% 95.9%`,"muted-foreground":`220 8.9% 46.1%`,accent:`220 14.3% 95.9%`,"accent-foreground":`220.9 39.3% 11%`,destructive:`0 92.99% 56.11%`,"destructive-foreground":`0 0% 100%`,border:`220 13% 91%`,input:`220 13% 91%`,ring:`262.1 83.3% 57.8%`},dark:{background:`224 71.4% 4.1%`,foreground:`210 20% 98%`,card:`224 71.4% 4.1%`,"card-foreground":`210 20% 98%`,popover:`224 71.4% 4.1%`,"popover-foreground":`210 20% 98%`,primary:`236.9 100% 69.61%`,"primary-foreground":`0 0% 100%`,secondary:`229 14% 8%`,"secondary-foreground":`229 14% 68%`,muted:`215 27.9% 16.9%`,"muted-foreground":`217.9 10.6% 64.9%`,accent:`215 27.9% 16.9%`,"accent-foreground":`210 20% 98%`,destructive:`0 92.99% 56.11%`,"destructive-foreground":`0 0% 100%`,border:`215 27.9% 16.9%`,input:`215 27.9% 16.9%`,ring:`263.4 70% 50.4%`}}},{name:`zinc`,label:`Zinc`,cssVars:{light:{background:`0 0% 100%`,foreground:`240 10% 3.9%`,card:`0 0% 100%`,"card-foreground":`240 10% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`240 10% 3.9%`,primary:`240 5.9% 10%`,"primary-foreground":`0 0% 98%`,secondary:`240 4.8% 95.9%`,"secondary-foreground":`240 5.9% 10%`,muted:`240 4.8% 95.9%`,"muted-foreground":`240 3.8% 46.1%`,accent:`240 4.8% 95.9%`,"accent-foreground":`240 5.9% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`240 5.9% 90%`,input:`240 5.9% 90%`,ring:`240 5.9% 10%`,radius:`0.5rem`},dark:{background:`240 10% 3.9%`,foreground:`0 0% 98%`,card:`240 10% 3.9%`,"card-foreground":`0 0% 98%`,popover:`240 10% 3.9%`,"popover-foreground":`0 0% 98%`,primary:`0 0% 98%`,"primary-foreground":`240 5.9% 10%`,secondary:`240 3.7% 15.9%`,"secondary-foreground":`0 0% 98%`,muted:`240 3.7% 15.9%`,"muted-foreground":`240 5% 64.9%`,accent:`240 3.7% 15.9%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 0% 98%`,border:`240 3.7% 15.9%`,input:`240 3.7% 15.9%`,ring:`240 4.9% 83.9%`}}},{name:`slate`,label:`Slate`,cssVars:{light:{background:`0 0% 100%`,foreground:`222.2 84% 4.9%`,card:`0 0% 100%`,"card-foreground":`222.2 84% 4.9%`,popover:`0 0% 100%`,"popover-foreground":`222.2 84% 4.9%`,primary:`222.2 47.4% 11.2%`,"primary-foreground":`210 40% 98%`,secondary:`210 40% 96.1%`,"secondary-foreground":`222.2 47.4% 11.2%`,muted:`210 40% 96.1%`,"muted-foreground":`215.4 16.3% 46.9%`,accent:`210 40% 96.1%`,"accent-foreground":`222.2 47.4% 11.2%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 40% 98%`,border:`214.3 31.8% 91.4%`,input:`214.3 31.8% 91.4%`,ring:`222.2 84% 4.9%`,radius:`0.5rem`},dark:{background:`222.2 84% 4.9%`,foreground:`210 40% 98%`,card:`222.2 84% 4.9%`,"card-foreground":`210 40% 98%`,popover:`222.2 84% 4.9%`,"popover-foreground":`210 40% 98%`,primary:`210 40% 98%`,"primary-foreground":`222.2 47.4% 11.2%`,secondary:`217.2 32.6% 17.5%`,"secondary-foreground":`210 40% 98%`,muted:`217.2 32.6% 17.5%`,"muted-foreground":`215 20.2% 65.1%`,accent:`217.2 32.6% 17.5%`,"accent-foreground":`210 40% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 40% 98%`,border:`217.2 32.6% 17.5%`,input:`217.2 32.6% 17.5%`,ring:`212.7 26.8% 83.9%`}}},{name:`stone`,label:`Stone`,cssVars:{light:{background:`0 0% 100%`,foreground:`20 14.3% 4.1%`,card:`0 0% 100%`,"card-foreground":`20 14.3% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`20 14.3% 4.1%`,primary:`24 9.8% 10%`,"primary-foreground":`60 9.1% 97.8%`,secondary:`60 4.8% 95.9%`,"secondary-foreground":`24 9.8% 10%`,muted:`60 4.8% 95.9%`,"muted-foreground":`25 5.3% 44.7%`,accent:`60 4.8% 95.9%`,"accent-foreground":`24 9.8% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`60 9.1% 97.8%`,border:`20 5.9% 90%`,input:`20 5.9% 90%`,ring:`20 14.3% 4.1%`,radius:`0.95rem`},dark:{background:`20 14.3% 4.1%`,foreground:`60 9.1% 97.8%`,card:`20 14.3% 4.1%`,"card-foreground":`60 9.1% 97.8%`,popover:`20 14.3% 4.1%`,"popover-foreground":`60 9.1% 97.8%`,primary:`60 9.1% 97.8%`,"primary-foreground":`24 9.8% 10%`,secondary:`12 6.5% 15.1%`,"secondary-foreground":`60 9.1% 97.8%`,muted:`12 6.5% 15.1%`,"muted-foreground":`24 5.4% 63.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`60 9.1% 97.8%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`60 9.1% 97.8%`,border:`12 6.5% 15.1%`,input:`12 6.5% 15.1%`,ring:`24 5.7% 82.9%`}}},{name:`gray`,label:`Gray`,cssVars:{light:{background:`0 0% 100%`,foreground:`224 71.4% 4.1%`,card:`0 0% 100%`,"card-foreground":`224 71.4% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`224 71.4% 4.1%`,primary:`220.9 39.3% 11%`,"primary-foreground":`210 20% 98%`,secondary:`220 14.3% 95.9%`,"secondary-foreground":`220.9 39.3% 11%`,muted:`220 14.3% 95.9%`,"muted-foreground":`220 8.9% 46.1%`,accent:`220 14.3% 95.9%`,"accent-foreground":`220.9 39.3% 11%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 20% 98%`,border:`220 13% 91%`,input:`220 13% 91%`,ring:`224 71.4% 4.1%`,radius:`0.35rem`},dark:{background:`224 71.4% 4.1%`,foreground:`210 20% 98%`,card:`224 71.4% 4.1%`,"card-foreground":`210 20% 98%`,popover:`224 71.4% 4.1%`,"popover-foreground":`210 20% 98%`,primary:`210 20% 98%`,"primary-foreground":`220.9 39.3% 11%`,secondary:`215 27.9% 16.9%`,"secondary-foreground":`210 20% 98%`,muted:`215 27.9% 16.9%`,"muted-foreground":`217.9 10.6% 64.9%`,accent:`215 27.9% 16.9%`,"accent-foreground":`210 20% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 20% 98%`,border:`215 27.9% 16.9%`,input:`215 27.9% 16.9%`,ring:`216 12.2% 83.9%`}}},{name:`neutral`,label:`Neutral`,cssVars:{light:{background:`0 0% 100%`,foreground:`0 0% 3.9%`,card:`0 0% 100%`,"card-foreground":`0 0% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`0 0% 3.9%`,primary:`0 0% 9%`,"primary-foreground":`0 0% 98%`,secondary:`0 0% 96.1%`,"secondary-foreground":`0 0% 9%`,muted:`0 0% 96.1%`,"muted-foreground":`0 0% 45.1%`,accent:`0 0% 96.1%`,"accent-foreground":`0 0% 9%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 89.8%`,input:`0 0% 89.8%`,ring:`0 0% 3.9%`},dark:{background:`0 0% 3.9%`,foreground:`0 0% 98%`,card:`0 0% 3.9%`,"card-foreground":`0 0% 98%`,popover:`0 0% 3.9%`,"popover-foreground":`0 0% 98%`,primary:`0 0% 98%`,"primary-foreground":`0 0% 9%`,secondary:`0 0% 14.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 14.9%`,"muted-foreground":`0 0% 63.9%`,accent:`0 0% 14.9%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 14.9%`,input:`0 0% 14.9%`,ring:`0 0% 83.1%`}}},{name:`red`,label:`Red`,cssVars:{light:{background:`0 0% 100%`,foreground:`0 0% 3.9%`,card:`0 0% 100%`,"card-foreground":`0 0% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`0 0% 3.9%`,primary:`0 72.2% 50.6%`,"primary-foreground":`0 85.7% 97.3%`,secondary:`0 0% 96.1%`,"secondary-foreground":`0 0% 9%`,muted:`0 0% 96.1%`,"muted-foreground":`0 0% 45.1%`,accent:`0 0% 96.1%`,"accent-foreground":`0 0% 9%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 89.8%`,input:`0 0% 89.8%`,ring:`0 72.2% 50.6%`,radius:`0.4rem`},dark:{background:`0 0% 3.9%`,foreground:`0 0% 98%`,card:`0 0% 3.9%`,"card-foreground":`0 0% 98%`,popover:`0 0% 3.9%`,"popover-foreground":`0 0% 98%`,primary:`0 72.2% 50.6%`,"primary-foreground":`0 85.7% 97.3%`,secondary:`0 0% 14.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 14.9%`,"muted-foreground":`0 0% 63.9%`,accent:`0 0% 14.9%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 0% 98%`,border:`0 0% 14.9%`,input:`0 0% 14.9%`,ring:`0 72.2% 50.6%`}}},{name:`rose`,label:`Rose`,cssVars:{light:{background:`0 0% 100%`,foreground:`240 10% 3.9%`,card:`0 0% 100%`,"card-foreground":`240 10% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`240 10% 3.9%`,primary:`346.8 77.2% 49.8%`,"primary-foreground":`355.7 100% 97.3%`,secondary:`240 4.8% 95.9%`,"secondary-foreground":`240 5.9% 10%`,muted:`240 4.8% 95.9%`,"muted-foreground":`240 3.8% 46.1%`,accent:`240 4.8% 95.9%`,"accent-foreground":`240 5.9% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`240 5.9% 90%`,input:`240 5.9% 90%`,ring:`346.8 77.2% 49.8%`,radius:`0.5rem`},dark:{background:`20 14.3% 4.1%`,foreground:`0 0% 95%`,popover:`0 0% 9%`,"popover-foreground":`0 0% 95%`,card:`24 9.8% 10%`,"card-foreground":`0 0% 95%`,primary:`346.8 77.2% 49.8%`,"primary-foreground":`355.7 100% 97.3%`,secondary:`240 3.7% 15.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 15%`,"muted-foreground":`240 5% 64.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 85.7% 97.3%`,border:`240 3.7% 15.9%`,input:`240 3.7% 15.9%`,ring:`346.8 77.2% 49.8%`}}},{name:`orange`,label:`Orange`,cssVars:{light:{background:`0 0% 100%`,foreground:`20 14.3% 4.1%`,card:`0 0% 100%`,"card-foreground":`20 14.3% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`20 14.3% 4.1%`,primary:`24.6 95% 53.1%`,"primary-foreground":`60 9.1% 97.8%`,secondary:`60 4.8% 95.9%`,"secondary-foreground":`24 9.8% 10%`,muted:`60 4.8% 95.9%`,"muted-foreground":`25 5.3% 44.7%`,accent:`60 4.8% 95.9%`,"accent-foreground":`24 9.8% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`60 9.1% 97.8%`,border:`20 5.9% 90%`,input:`20 5.9% 90%`,ring:`24.6 95% 53.1%`,radius:`0.95rem`},dark:{background:`20 14.3% 4.1%`,foreground:`60 9.1% 97.8%`,card:`20 14.3% 4.1%`,"card-foreground":`60 9.1% 97.8%`,popover:`20 14.3% 4.1%`,"popover-foreground":`60 9.1% 97.8%`,primary:`20.5 90.2% 48.2%`,"primary-foreground":`60 9.1% 97.8%`,secondary:`12 6.5% 15.1%`,"secondary-foreground":`60 9.1% 97.8%`,muted:`12 6.5% 15.1%`,"muted-foreground":`24 5.4% 63.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`60 9.1% 97.8%`,destructive:`0 72.2% 50.6%`,"destructive-foreground":`60 9.1% 97.8%`,border:`12 6.5% 15.1%`,input:`12 6.5% 15.1%`,ring:`20.5 90.2% 48.2%`}}},{name:`green`,label:`Green`,cssVars:{light:{background:`0 0% 100%`,foreground:`240 10% 3.9%`,card:`0 0% 100%`,"card-foreground":`240 10% 3.9%`,popover:`0 0% 100%`,"popover-foreground":`240 10% 3.9%`,primary:`142.1 76.2% 36.3%`,"primary-foreground":`355.7 100% 97.3%`,secondary:`240 4.8% 95.9%`,"secondary-foreground":`240 5.9% 10%`,muted:`240 4.8% 95.9%`,"muted-foreground":`240 3.8% 46.1%`,accent:`240 4.8% 95.9%`,"accent-foreground":`240 5.9% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`0 0% 98%`,border:`240 5.9% 90%`,input:`240 5.9% 90%`,ring:`142.1 76.2% 36.3%`},dark:{background:`20 14.3% 4.1%`,foreground:`0 0% 95%`,popover:`0 0% 9%`,"popover-foreground":`0 0% 95%`,card:`24 9.8% 10%`,"card-foreground":`0 0% 95%`,primary:`142.1 70.6% 45.3%`,"primary-foreground":`144.9 80.4% 10%`,secondary:`240 3.7% 15.9%`,"secondary-foreground":`0 0% 98%`,muted:`0 0% 15%`,"muted-foreground":`240 5% 64.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`0 0% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`0 85.7% 97.3%`,border:`240 3.7% 15.9%`,input:`240 3.7% 15.9%`,ring:`142.4 71.8% 29.2%`}}},{name:`blue`,label:`Blue`,cssVars:{light:{background:`0 0% 100%`,foreground:`222.2 84% 4.9%`,card:`0 0% 100%`,"card-foreground":`222.2 84% 4.9%`,popover:`0 0% 100%`,"popover-foreground":`222.2 84% 4.9%`,primary:`221.2 83.2% 53.3%`,"primary-foreground":`210 40% 98%`,secondary:`210 40% 96.1%`,"secondary-foreground":`222.2 47.4% 11.2%`,muted:`210 40% 96.1%`,"muted-foreground":`215.4 16.3% 46.9%`,accent:`210 40% 96.1%`,"accent-foreground":`222.2 47.4% 11.2%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 40% 98%`,border:`214.3 31.8% 91.4%`,input:`214.3 31.8% 91.4%`,ring:`221.2 83.2% 53.3%`},dark:{background:`222.2 84% 4.9%`,foreground:`210 40% 98%`,card:`222.2 84% 4.9%`,"card-foreground":`210 40% 98%`,popover:`222.2 84% 4.9%`,"popover-foreground":`210 40% 98%`,primary:`217.2 91.2% 59.8%`,"primary-foreground":`222.2 47.4% 11.2%`,secondary:`217.2 32.6% 17.5%`,"secondary-foreground":`210 40% 98%`,muted:`217.2 32.6% 17.5%`,"muted-foreground":`215 20.2% 65.1%`,accent:`217.2 32.6% 17.5%`,"accent-foreground":`210 40% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 40% 98%`,border:`217.2 32.6% 17.5%`,input:`217.2 32.6% 17.5%`,ring:`224.3 76.3% 48%`}}},{name:`yellow`,label:`Yellow`,cssVars:{light:{background:`0 0% 100%`,foreground:`20 14.3% 4.1%`,card:`0 0% 100%`,"card-foreground":`20 14.3% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`20 14.3% 4.1%`,primary:`47.9 95.8% 53.1%`,"primary-foreground":`26 83.3% 14.1%`,secondary:`60 4.8% 95.9%`,"secondary-foreground":`24 9.8% 10%`,muted:`60 4.8% 95.9%`,"muted-foreground":`25 5.3% 44.7%`,accent:`60 4.8% 95.9%`,"accent-foreground":`24 9.8% 10%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`60 9.1% 97.8%`,border:`20 5.9% 90%`,input:`20 5.9% 90%`,ring:`20 14.3% 4.1%`,radius:`0.95rem`},dark:{background:`20 14.3% 4.1%`,foreground:`60 9.1% 97.8%`,card:`20 14.3% 4.1%`,"card-foreground":`60 9.1% 97.8%`,popover:`20 14.3% 4.1%`,"popover-foreground":`60 9.1% 97.8%`,primary:`47.9 95.8% 53.1%`,"primary-foreground":`26 83.3% 14.1%`,secondary:`12 6.5% 15.1%`,"secondary-foreground":`60 9.1% 97.8%`,muted:`12 6.5% 15.1%`,"muted-foreground":`24 5.4% 63.9%`,accent:`12 6.5% 15.1%`,"accent-foreground":`60 9.1% 97.8%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`60 9.1% 97.8%`,border:`12 6.5% 15.1%`,input:`12 6.5% 15.1%`,ring:`35.5 91.7% 32.9%`}}},{name:`violet`,label:`Violet`,cssVars:{light:{background:`0 0% 100%`,foreground:`224 71.4% 4.1%`,card:`0 0% 100%`,"card-foreground":`224 71.4% 4.1%`,popover:`0 0% 100%`,"popover-foreground":`224 71.4% 4.1%`,primary:`262.1 83.3% 57.8%`,"primary-foreground":`210 20% 98%`,secondary:`220 14.3% 95.9%`,"secondary-foreground":`220.9 39.3% 11%`,muted:`220 14.3% 95.9%`,"muted-foreground":`220 8.9% 46.1%`,accent:`220 14.3% 95.9%`,"accent-foreground":`220.9 39.3% 11%`,destructive:`0 84.2% 60.2%`,"destructive-foreground":`210 20% 98%`,border:`220 13% 91%`,input:`220 13% 91%`,ring:`262.1 83.3% 57.8%`},dark:{background:`224 71.4% 4.1%`,foreground:`210 20% 98%`,card:`224 71.4% 4.1%`,"card-foreground":`210 20% 98%`,popover:`224 71.4% 4.1%`,"popover-foreground":`210 20% 98%`,primary:`263.4 70% 50.4%`,"primary-foreground":`210 20% 98%`,secondary:`215 27.9% 16.9%`,"secondary-foreground":`210 20% 98%`,muted:`215 27.9% 16.9%`,"muted-foreground":`217.9 10.6% 64.9%`,accent:`215 27.9% 16.9%`,"accent-foreground":`210 20% 98%`,destructive:`0 62.8% 30.6%`,"destructive-foreground":`210 20% 98%`,border:`215 27.9% 16.9%`,input:`215 27.9% 16.9%`,ring:`263.4 70% 50.4%`}}}],a=`background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.destructive.destructive-foreground.success.success-foreground.warning.warning-foreground.info.info-foreground.secondary.secondary-foreground.carbon.carbon-foreground.muted.muted-foreground.accent.accent-foreground.border.input.ring.sidebar-background.sidebar-foreground.sidebar-border.sidebar-ring.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground`.split(`.`),o=[`primary`,`destructive`,`success`,`warning`,`info`,`carbon`];function s(e){return Object.entries(e).map(([e,t])=>{let i=e;if(!a.includes(i))return``;let s=` --${i}: ${t};`;if(o.includes(i)){let e=n(`hsl(${t.split(` `).join(`, `)})`);for(let[t,n]of Object.entries(e)){let{h:e,s:a,l:o}=r(n).toHsl();s+=`\n --${i}-${t}: ${e} ${a}% ${o}%;`}}return s}).filter(Boolean).join(`
|
|
2
|
-
`)}function c(e,t,n){let{darkSelector:r,radius:i,themeName:a}=n,o=a&&a!==`default`;return`
|
|
3
|
-
${o?`.theme-${a}`:`:root`} {
|
|
4
|
-
${e}
|
|
5
|
-
${i||i===0?l(i):``}
|
|
6
|
-
}
|
|
7
|
-
${o?`.theme-${a}${r}`:r} {
|
|
8
|
-
${t}
|
|
9
|
-
}`}function l(e){return` --radius: ${e}rem;`}function u(e){return`
|
|
10
|
-
:root {
|
|
11
|
-
${l(e)}
|
|
12
|
-
}
|
|
13
|
-
`}function d(){return`
|
|
14
|
-
* {
|
|
15
|
-
border-color: hsl(var(--border));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
body {
|
|
19
|
-
color: hsl(var(--foreground));
|
|
20
|
-
background: hsl(var(--background));
|
|
21
|
-
}
|
|
22
|
-
`}function f(e){let t=i.find(t=>t.name===e);if(!t)throw Error(`Unknown color: ${e}`);return{name:e,...t.cssVars}}function p(e){let n,r,i;return typeof e==`string`?(i=e,{light:n,dark:r}=f(e)):`base`in e?(i=e.base,{light:n,dark:r}=t(f(e.base),e)):(i=e.name,{light:n,dark:r}=e),{light:n,dark:r,name:i}}function m(){return{light:{success:`140 79% 45%`,"success-foreground":`0 0% 100%`,warning:`37 91% 55%`,"warning-foreground":`0 0% 100%`,info:`215 100% 54%`,"info-foreground":`0 0% 100%`,carbon:`240 4% 16%`,"carbon-foreground":`0 0% 98%`},dark:{success:`140 79% 45%`,"success-foreground":`0 0% 100%`,warning:`37 91% 55%`,"warning-foreground":`0 0% 100%`,info:`215 100% 54%`,"info-foreground":`0 0% 100%`,carbon:`220 14.3% 95.9%`,"carbon-foreground":`220.9 39.3% 11%`}}}function h(){return{light:{"sidebar-background":`0 0% 98%`,"sidebar-foreground":`240 5.3% 26.1%`,"sidebar-primary":`236.9 100% 69.61%`,"sidebar-primary-foreground":`0 0% 98%`,"sidebar-accent":`240 4.8% 95.9%`,"sidebar-accent-foreground":`240 5.9% 10%`,"sidebar-border":`220 13% 91%`,"sidebar-ring":`217.2 91.2% 59.8%`},dark:{"sidebar-background":`240 5.9% 10%`,"sidebar-foreground":`240 4.8% 95.9%`,"sidebar-primary":`236.9 100% 69.61%`,"sidebar-primary-foreground":`0 0% 100%`,"sidebar-accent":`240 3.7% 15.9%`,"sidebar-accent-foreground":`240 4.8% 95.9%`,"sidebar-border":`240 3.7% 15.9%`,"sidebar-ring":`217.2 91.2% 59.8%`}}}function g(e={},t=!0){if(Array.isArray(e))return e.map(e=>g(e,!1)).join(`
|
|
23
|
-
`);let{color:n=`default`,radius:r=.5,darkSelector:i=`.dark`,feedbackColor:a=m(),sidebar:o=h()}=e,l=``;if(!n)r&&(l+=u(r));else{let{light:e,dark:u,name:d}=p(n),f=s({...e,...a.light,...o.light}),m=s({...u,...a.dark,...o.dark});l+=c(f,m,{radius:r,themeName:!t&&d,darkSelector:i})}return l}const _=i.map(e=>e.name),v=i.reduce((e,t)=>(e[t.name]=t.cssVars.light.primary,e),{}),y=[0,.25,.375,.5,.625,.75,.875,1],b=e((e={})=>{let{theme:t,globals:n=!0,generatePreflights:r=!0}=e;return{name:`unocss-preset-soybean-ui`,preflights:r?[{getCSS:()=>`
|
|
1
|
+
import{n as e,t}from"./generate-DuJ16ACb.js";import{definePreset as n}from"unocss";const r=n((n={})=>{let{theme:r,globals:i=!0,generatePreflights:a=!0}=n;return{name:`unocss-preset-soybean-ui`,preflights:a?[{getCSS:()=>`
|
|
24
2
|
@keyframes shadcn-down { from{ height: 0 } to { height: var(--soybean-accordion-content-height)} }
|
|
25
3
|
@keyframes shadcn-up { from{ height: var(--soybean-accordion-content-height)} to { height: 0 } }
|
|
26
4
|
@keyframes shadcn-collapsible-down { from{ height: 0 } to { height: var(--soybean-collapsible-content-height)} }
|
|
27
5
|
@keyframes shadcn-collapsible-up { from{ height: var(--soybean-collapsible-content-height)} to { height: 0 } }
|
|
28
6
|
|
|
29
|
-
${
|
|
7
|
+
${t(r)}
|
|
30
8
|
|
|
31
|
-
${
|
|
9
|
+
${i?e():``}
|
|
32
10
|
`},{getCSS:()=>`
|
|
33
11
|
html.size-xs {
|
|
34
12
|
font-size: 12px;
|
|
@@ -48,4 +26,4 @@ body {
|
|
|
48
26
|
html.size-2xl {
|
|
49
27
|
font-size: 24px;
|
|
50
28
|
}
|
|
51
|
-
`}]:[],rules:[[`animate-accordion-down`,{animation:`shadcn-down 0.2s ease-out`}],[`animate-accordion-up`,{animation:`shadcn-up 0.2s ease-out`}],[`animate-collapsible-down`,{animation:`shadcn-collapsible-down 0.2s ease-out`}],[`animate-collapsible-up`,{animation:`shadcn-collapsible-up 0.2s ease-out`}]],theme:{colors:{border:`hsl(var(--border))`,input:`hsl(var(--input))`,ring:`hsl(var(--ring))`,background:`hsl(var(--background))`,foreground:`hsl(var(--foreground))`,primary:{DEFAULT:`hsl(var(--primary))`,foreground:`hsl(var(--primary-foreground))`,50:`hsl(var(--primary-50))`,100:`hsl(var(--primary-100))`,200:`hsl(var(--primary-200))`,300:`hsl(var(--primary-300))`,400:`hsl(var(--primary-400))`,500:`hsl(var(--primary-500))`,600:`hsl(var(--primary-600))`,700:`hsl(var(--primary-700))`,800:`hsl(var(--primary-800))`,900:`hsl(var(--primary-900))`,950:`hsl(var(--primary-950))`},destructive:{DEFAULT:`hsl(var(--destructive))`,foreground:`hsl(var(--destructive-foreground))`,50:`hsl(var(--destructive-50))`,100:`hsl(var(--destructive-100))`,200:`hsl(var(--destructive-200))`,300:`hsl(var(--destructive-300))`,400:`hsl(var(--destructive-400))`,500:`hsl(var(--destructive-500))`,600:`hsl(var(--destructive-600))`,700:`hsl(var(--destructive-700))`,800:`hsl(var(--destructive-800))`,900:`hsl(var(--destructive-900))`,950:`hsl(var(--destructive-950))`},success:{DEFAULT:`hsl(var(--success))`,foreground:`hsl(var(--success-foreground))`,50:`hsl(var(--success-50))`,100:`hsl(var(--success-100))`,200:`hsl(var(--success-200))`,300:`hsl(var(--success-300))`,400:`hsl(var(--success-400))`,500:`hsl(var(--success-500))`,600:`hsl(var(--success-600))`,700:`hsl(var(--success-700))`,800:`hsl(var(--success-800))`,900:`hsl(var(--success-900))`,950:`hsl(var(--success-950))`},warning:{DEFAULT:`hsl(var(--warning))`,foreground:`hsl(var(--warning-foreground))`,50:`hsl(var(--warning-50))`,100:`hsl(var(--warning-100))`,200:`hsl(var(--warning-200))`,300:`hsl(var(--warning-300))`,400:`hsl(var(--warning-400))`,500:`hsl(var(--warning-500))`,600:`hsl(var(--warning-600))`,700:`hsl(var(--warning-700))`,800:`hsl(var(--warning-800))`,900:`hsl(var(--warning-900))`,950:`hsl(var(--warning-950))`},info:{DEFAULT:`hsl(var(--info))`,foreground:`hsl(var(--info-foreground))`,50:`hsl(var(--info-50))`,100:`hsl(var(--info-100))`,200:`hsl(var(--info-200))`,300:`hsl(var(--info-300))`,400:`hsl(var(--info-400))`,500:`hsl(var(--info-500))`,600:`hsl(var(--info-600))`,700:`hsl(var(--info-700))`,800:`hsl(var(--info-800))`,900:`hsl(var(--info-900))`,950:`hsl(var(--info-950))`},carbon:{DEFAULT:`hsl(var(--carbon))`,foreground:`hsl(var(--carbon-foreground))`,50:`hsl(var(--carbon-50))`,100:`hsl(var(--carbon-100))`,200:`hsl(var(--carbon-200))`,300:`hsl(var(--carbon-300))`,400:`hsl(var(--carbon-400))`,500:`hsl(var(--carbon-500))`,600:`hsl(var(--carbon-600))`,700:`hsl(var(--carbon-700))`,800:`hsl(var(--carbon-800))`,900:`hsl(var(--carbon-900))`,950:`hsl(var(--carbon-950))`},secondary:{DEFAULT:`hsl(var(--secondary))`,foreground:`hsl(var(--secondary-foreground))`},muted:{DEFAULT:`hsl(var(--muted))`,foreground:`hsl(var(--muted-foreground))`},accent:{DEFAULT:`hsl(var(--accent))`,foreground:`hsl(var(--accent-foreground))`},popover:{DEFAULT:`hsl(var(--popover))`,foreground:`hsl(var(--popover-foreground))`},card:{DEFAULT:`hsl(var(--card))`,foreground:`hsl(var(--card-foreground))`},"sidebar-background":`hsl(var(--sidebar-background))`,"sidebar-foreground":`hsl(var(--sidebar-foreground))`,"sidebar-border":`hsl(var(--sidebar-border))`,"sidebar-ring":`hsl(var(--sidebar-ring))`,"sidebar-primary":`hsl(var(--sidebar-primary))`,"sidebar-primary-foreground":`hsl(var(--sidebar-primary-foreground))`,"sidebar-accent":`hsl(var(--sidebar-accent))`,"sidebar-accent-foreground":`hsl(var(--sidebar-accent-foreground))`},borderRadius:{xl:`calc(var(--radius) + 4px)`,lg:`var(--radius)`,md:`calc(var(--radius) - 2px)`,sm:`calc(var(--radius) - 4px)`},fontSize:{"4xs":[`0.375rem`,`0.5rem`],"3xs":[`0.5rem`,`0.625rem`],"2xs":[`0.625rem`,`0.75rem`]}}}});export{
|
|
29
|
+
`}]:[],rules:[[`animate-accordion-down`,{animation:`shadcn-down 0.2s ease-out`}],[`animate-accordion-up`,{animation:`shadcn-up 0.2s ease-out`}],[`animate-collapsible-down`,{animation:`shadcn-collapsible-down 0.2s ease-out`}],[`animate-collapsible-up`,{animation:`shadcn-collapsible-up 0.2s ease-out`}]],theme:{colors:{border:`hsl(var(--border))`,input:`hsl(var(--input))`,ring:`hsl(var(--ring))`,background:`hsl(var(--background))`,foreground:`hsl(var(--foreground))`,primary:{DEFAULT:`hsl(var(--primary))`,foreground:`hsl(var(--primary-foreground))`,50:`hsl(var(--primary-50))`,100:`hsl(var(--primary-100))`,200:`hsl(var(--primary-200))`,300:`hsl(var(--primary-300))`,400:`hsl(var(--primary-400))`,500:`hsl(var(--primary-500))`,600:`hsl(var(--primary-600))`,700:`hsl(var(--primary-700))`,800:`hsl(var(--primary-800))`,900:`hsl(var(--primary-900))`,950:`hsl(var(--primary-950))`},destructive:{DEFAULT:`hsl(var(--destructive))`,foreground:`hsl(var(--destructive-foreground))`,50:`hsl(var(--destructive-50))`,100:`hsl(var(--destructive-100))`,200:`hsl(var(--destructive-200))`,300:`hsl(var(--destructive-300))`,400:`hsl(var(--destructive-400))`,500:`hsl(var(--destructive-500))`,600:`hsl(var(--destructive-600))`,700:`hsl(var(--destructive-700))`,800:`hsl(var(--destructive-800))`,900:`hsl(var(--destructive-900))`,950:`hsl(var(--destructive-950))`},success:{DEFAULT:`hsl(var(--success))`,foreground:`hsl(var(--success-foreground))`,50:`hsl(var(--success-50))`,100:`hsl(var(--success-100))`,200:`hsl(var(--success-200))`,300:`hsl(var(--success-300))`,400:`hsl(var(--success-400))`,500:`hsl(var(--success-500))`,600:`hsl(var(--success-600))`,700:`hsl(var(--success-700))`,800:`hsl(var(--success-800))`,900:`hsl(var(--success-900))`,950:`hsl(var(--success-950))`},warning:{DEFAULT:`hsl(var(--warning))`,foreground:`hsl(var(--warning-foreground))`,50:`hsl(var(--warning-50))`,100:`hsl(var(--warning-100))`,200:`hsl(var(--warning-200))`,300:`hsl(var(--warning-300))`,400:`hsl(var(--warning-400))`,500:`hsl(var(--warning-500))`,600:`hsl(var(--warning-600))`,700:`hsl(var(--warning-700))`,800:`hsl(var(--warning-800))`,900:`hsl(var(--warning-900))`,950:`hsl(var(--warning-950))`},info:{DEFAULT:`hsl(var(--info))`,foreground:`hsl(var(--info-foreground))`,50:`hsl(var(--info-50))`,100:`hsl(var(--info-100))`,200:`hsl(var(--info-200))`,300:`hsl(var(--info-300))`,400:`hsl(var(--info-400))`,500:`hsl(var(--info-500))`,600:`hsl(var(--info-600))`,700:`hsl(var(--info-700))`,800:`hsl(var(--info-800))`,900:`hsl(var(--info-900))`,950:`hsl(var(--info-950))`},carbon:{DEFAULT:`hsl(var(--carbon))`,foreground:`hsl(var(--carbon-foreground))`,50:`hsl(var(--carbon-50))`,100:`hsl(var(--carbon-100))`,200:`hsl(var(--carbon-200))`,300:`hsl(var(--carbon-300))`,400:`hsl(var(--carbon-400))`,500:`hsl(var(--carbon-500))`,600:`hsl(var(--carbon-600))`,700:`hsl(var(--carbon-700))`,800:`hsl(var(--carbon-800))`,900:`hsl(var(--carbon-900))`,950:`hsl(var(--carbon-950))`},secondary:{DEFAULT:`hsl(var(--secondary))`,foreground:`hsl(var(--secondary-foreground))`},muted:{DEFAULT:`hsl(var(--muted))`,foreground:`hsl(var(--muted-foreground))`},accent:{DEFAULT:`hsl(var(--accent))`,foreground:`hsl(var(--accent-foreground))`},popover:{DEFAULT:`hsl(var(--popover))`,foreground:`hsl(var(--popover-foreground))`},card:{DEFAULT:`hsl(var(--card))`,foreground:`hsl(var(--card-foreground))`},"sidebar-background":`hsl(var(--sidebar-background))`,"sidebar-foreground":`hsl(var(--sidebar-foreground))`,"sidebar-border":`hsl(var(--sidebar-border))`,"sidebar-ring":`hsl(var(--sidebar-ring))`,"sidebar-primary":`hsl(var(--sidebar-primary))`,"sidebar-primary-foreground":`hsl(var(--sidebar-primary-foreground))`,"sidebar-accent":`hsl(var(--sidebar-accent))`,"sidebar-accent-foreground":`hsl(var(--sidebar-accent-foreground))`},borderRadius:{xl:`calc(var(--radius) + 4px)`,lg:`var(--radius)`,md:`calc(var(--radius) - 2px)`,sm:`calc(var(--radius) - 4px)`},fontSize:{"4xs":[`0.375rem`,`0.5rem`],"3xs":[`0.5rem`,`0.625rem`],"2xs":[`0.625rem`,`0.75rem`]}}}});export{r as presetShadcn};
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { a as ThemeOptions, i as ThemeConfigColor } from "./types-Im720LAV.js";
|
|
2
|
+
|
|
3
|
+
//#region src/generate.d.ts
|
|
4
|
+
declare function generateCSSVars(theme?: ThemeOptions | ThemeOptions[], onlyOne?: boolean): string;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/shared.d.ts
|
|
7
|
+
declare const builtinColors: ThemeConfigColor[];
|
|
8
|
+
declare const builtinColorMap: Record<ThemeConfigColor, string>;
|
|
9
|
+
declare const builtinRadiuses: readonly [0, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { builtinColorMap, builtinColors, builtinRadiuses, generateCSSVars };
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./generate-DuJ16ACb.js";const n=e.map(e=>e.name),r=e.reduce((e,t)=>(e[t.name]=t.cssVars.light.primary,e),{}),i=[0,.25,.375,.5,.625,.75,.875,1];export{r as builtinColorMap,n as builtinColors,i as builtinRadiuses,t as generateCSSVars};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { DeepPartial } from "@unocss/core";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
type HslColorString = `${number} ${number}% ${number}%`;
|
|
5
|
+
type ThemeCSSVars = {
|
|
6
|
+
background: HslColorString;
|
|
7
|
+
foreground: HslColorString;
|
|
8
|
+
card: HslColorString;
|
|
9
|
+
'card-foreground': HslColorString;
|
|
10
|
+
popover: HslColorString;
|
|
11
|
+
'popover-foreground': HslColorString;
|
|
12
|
+
primary: HslColorString;
|
|
13
|
+
'primary-foreground': HslColorString;
|
|
14
|
+
secondary: HslColorString;
|
|
15
|
+
'secondary-foreground': HslColorString;
|
|
16
|
+
muted: HslColorString;
|
|
17
|
+
'muted-foreground': HslColorString;
|
|
18
|
+
accent: HslColorString;
|
|
19
|
+
'accent-foreground': HslColorString;
|
|
20
|
+
destructive: HslColorString;
|
|
21
|
+
'destructive-foreground': HslColorString;
|
|
22
|
+
border: HslColorString;
|
|
23
|
+
input: HslColorString;
|
|
24
|
+
ring: HslColorString;
|
|
25
|
+
radius?: string;
|
|
26
|
+
};
|
|
27
|
+
type ThemeCSSVarKey = keyof ThemeCSSVars;
|
|
28
|
+
type FeedbackColorOfThemeCssVars = {
|
|
29
|
+
success: HslColorString;
|
|
30
|
+
'success-foreground': HslColorString;
|
|
31
|
+
warning: HslColorString;
|
|
32
|
+
'warning-foreground': HslColorString;
|
|
33
|
+
info: HslColorString;
|
|
34
|
+
'info-foreground': HslColorString;
|
|
35
|
+
carbon: HslColorString;
|
|
36
|
+
'carbon-foreground': HslColorString;
|
|
37
|
+
};
|
|
38
|
+
type FeedbackColorOfThemeCssVarKey = keyof FeedbackColorOfThemeCssVars;
|
|
39
|
+
type SidebarColorOfThemeCssVars = {
|
|
40
|
+
'sidebar-background': HslColorString;
|
|
41
|
+
'sidebar-foreground': HslColorString;
|
|
42
|
+
'sidebar-border': HslColorString;
|
|
43
|
+
'sidebar-ring': HslColorString;
|
|
44
|
+
'sidebar-primary': HslColorString;
|
|
45
|
+
'sidebar-primary-foreground': HslColorString;
|
|
46
|
+
'sidebar-accent': HslColorString;
|
|
47
|
+
'sidebar-accent-foreground': HslColorString;
|
|
48
|
+
};
|
|
49
|
+
interface ThemeCSSVarsVariant {
|
|
50
|
+
name: string;
|
|
51
|
+
light: ThemeCSSVars;
|
|
52
|
+
dark: ThemeCSSVars;
|
|
53
|
+
}
|
|
54
|
+
interface FeedbackColorOfThemeCssVarsVariant {
|
|
55
|
+
light: FeedbackColorOfThemeCssVars;
|
|
56
|
+
dark: FeedbackColorOfThemeCssVars;
|
|
57
|
+
}
|
|
58
|
+
interface SidebarColorOfThemeCssVarsVariant {
|
|
59
|
+
light: SidebarColorOfThemeCssVars;
|
|
60
|
+
dark: SidebarColorOfThemeCssVars;
|
|
61
|
+
}
|
|
62
|
+
type ThemeConfigColor = 'default' | 'zinc' | 'slate' | 'stone' | 'gray' | 'neutral' | 'red' | 'rose' | 'orange' | 'green' | 'blue' | 'yellow' | 'violet';
|
|
63
|
+
type ThemeConfig<T = ThemeConfigColor> = {
|
|
64
|
+
name: T;
|
|
65
|
+
label: string;
|
|
66
|
+
cssVars: {
|
|
67
|
+
light: ThemeCSSVars;
|
|
68
|
+
dark: ThemeCSSVars;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
type ColorOptions = ThemeConfigColor | ThemeCSSVarsVariant | ({
|
|
72
|
+
base: ThemeConfigColor;
|
|
73
|
+
} & DeepPartial<ThemeCSSVarsVariant>);
|
|
74
|
+
interface ThemeOptions {
|
|
75
|
+
/**
|
|
76
|
+
* theme color options
|
|
77
|
+
*
|
|
78
|
+
* @default 'default'
|
|
79
|
+
*/
|
|
80
|
+
color?: ColorOptions | false;
|
|
81
|
+
/** feedback color */
|
|
82
|
+
feedbackColor?: FeedbackColorOfThemeCssVarsVariant;
|
|
83
|
+
/** sidebar color */
|
|
84
|
+
sidebar?: SidebarColorOfThemeCssVarsVariant;
|
|
85
|
+
/**
|
|
86
|
+
* theme radius
|
|
87
|
+
*
|
|
88
|
+
* @default 0.5
|
|
89
|
+
*/
|
|
90
|
+
radius?: number | false;
|
|
91
|
+
/**
|
|
92
|
+
* dark theme selector
|
|
93
|
+
*
|
|
94
|
+
* @default '.dark'
|
|
95
|
+
*/
|
|
96
|
+
darkSelector?: string;
|
|
97
|
+
}
|
|
98
|
+
interface PresetShadcnOptions {
|
|
99
|
+
/**
|
|
100
|
+
* theme options
|
|
101
|
+
*/
|
|
102
|
+
theme?: ThemeOptions | ThemeOptions[];
|
|
103
|
+
/**
|
|
104
|
+
* Whether to generate global variables, like *.border-color, body.color, body.background.
|
|
105
|
+
* @default true
|
|
106
|
+
*/
|
|
107
|
+
globals?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Whether to generate preflights.
|
|
110
|
+
*
|
|
111
|
+
* Add css variables to html tag, like --background, --foreground, etc.
|
|
112
|
+
*
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
generatePreflights?: boolean;
|
|
116
|
+
}
|
|
117
|
+
type ThemeColorKey = Extract<ThemeCSSVarKey, 'primary' | 'secondary' | 'destructive'> | Extract<FeedbackColorOfThemeCssVarKey, 'success' | 'warning' | 'info' | 'carbon'>;
|
|
118
|
+
//#endregion
|
|
119
|
+
export { ThemeOptions as a, ThemeConfigColor as i, ThemeColorKey as n, ThemeConfig as r, PresetShadcnOptions as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soybeanjs/unocss-shadcn",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"description": "unocss preset for Soybean UI",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Soybean",
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"import": "./dist/index.js",
|
|
26
26
|
"require": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./shared": {
|
|
29
|
+
"types": "./dist/shared.d.ts",
|
|
30
|
+
"import": "./dist/shared.js",
|
|
31
|
+
"require": "./dist/shared.js"
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
34
|
"main": "dist/index.js",
|