@soybeanjs/unocss-shadcn 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { a as ThemeOptions, i as ThemeConfigColor, n as ThemeColorKey, r as ThemeConfig, t as PresetShadcnOptions } from "./types-Im720LAV.js";
2
1
  import * as unocss0 from "unocss";
3
2
  import { Theme } from "unocss/preset-mini";
4
3
 
5
4
  //#region src/index.d.ts
6
- declare const presetShadcn: unocss0.PresetFactory<Theme, PresetShadcnOptions>;
5
+ declare const presetShadcn: unocss0.PresetFactory<object, Theme>;
7
6
  //#endregion
8
- export { type PresetShadcnOptions, type ThemeColorKey, type ThemeConfig, type ThemeConfigColor, type ThemeOptions, presetShadcn };
7
+ export { presetShadcn };
package/dist/index.js CHANGED
@@ -1,29 +1,31 @@
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:()=>`
2
- @keyframes shadcn-down { from{ height: 0 } to { height: var(--soybean-accordion-content-height)} }
3
- @keyframes shadcn-up { from{ height: var(--soybean-accordion-content-height)} to { height: 0 } }
4
- @keyframes shadcn-collapsible-down { from{ height: 0 } to { height: var(--soybean-collapsible-content-height)} }
5
- @keyframes shadcn-collapsible-up { from{ height: var(--soybean-collapsible-content-height)} to { height: 0 } }
1
+ import{definePreset as e}from"unocss";const t=e(()=>({name:`unocss-preset-shadcn`,preflights:[{getCSS:()=>`
2
+ * {
3
+ border-color: hsl(var(--border));
4
+ }
6
5
 
7
- ${t(r)}
8
-
9
- ${i?e():``}
10
- `},{getCSS:()=>`
11
- html.size-xs {
12
- font-size: 12px;
13
- }
14
- html.size-sm {
15
- font-size: 14px;
16
- }
17
- html.size-md {
18
- font-size: 16px;
19
- }
20
- html.size-lg {
21
- font-size: 18px;
22
- }
23
- html.size-xl {
24
- font-size: 20px;
25
- }
26
- html.size-2xl {
27
- font-size: 24px;
28
- }
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};
6
+ body {
7
+ color: hsl(var(--foreground));
8
+ background: hsl(var(--background));
9
+ }`},{getCSS:()=>`
10
+ html.size-xs {
11
+ font-size: 12px;
12
+ }
13
+ html.size-sm {
14
+ font-size: 14px;
15
+ }
16
+ html.size-md {
17
+ font-size: 16px;
18
+ }
19
+ html.size-lg {
20
+ font-size: 18px;
21
+ }
22
+ html.size-xl {
23
+ font-size: 20px;
24
+ }
25
+ html.size-2xl {
26
+ font-size: 24px;
27
+ }`},{getCSS:()=>`
28
+ @keyframes shadcn-down { from{ height: 0 } to { height: var(--soybean-accordion-content-height)} }
29
+ @keyframes shadcn-up { from{ height: var(--soybean-accordion-content-height)} to { height: 0 } }
30
+ @keyframes shadcn-collapsible-down { from{ height: 0 } to { height: var(--soybean-collapsible-content-height)} }
31
+ @keyframes shadcn-collapsible-up { from{ height: var(--soybean-collapsible-content-height)} to { height: 0 } }`}],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:{background:`hsl(var(--background))`,foreground:`hsl(var(--foreground))`,card:{DEFAULT:`hsl(var(--card))`,foreground:`hsl(var(--card-foreground))`},popover:{DEFAULT:`hsl(var(--popover))`,foreground:`hsl(var(--popover-foreground))`},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))`},border:`hsl(var(--border))`,input:`hsl(var(--input))`,ring:`hsl(var(--ring))`,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))`},sidebar:`hsl(var(--sidebar-background))`,"sidebar-foreground":`hsl(var(--sidebar-foreground))`,"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))`,"sidebar-border":`hsl(var(--sidebar-border))`,"sidebar-ring":`hsl(var(--sidebar-ring))`,"chart-1":`hsl(var(--chart-1))`,"chart-2":`hsl(var(--chart-2))`,"chart-3":`hsl(var(--chart-3))`,"chart-4":`hsl(var(--chart-4))`,"chart-5":`hsl(var(--chart-5))`},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{t as presetShadcn};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@soybeanjs/unocss-shadcn",
3
3
  "type": "module",
4
- "version": "0.2.0",
5
- "description": "unocss preset for Soybean UI",
4
+ "version": "0.3.1",
5
+ "description": "unocss preset shadcn for Soybean UI",
6
6
  "author": {
7
7
  "name": "Soybean",
8
8
  "email": "soybeanjs@outlook.com",
@@ -24,11 +24,6 @@
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"
32
27
  }
33
28
  },
34
29
  "main": "dist/index.js",
@@ -38,8 +33,6 @@
38
33
  "dist"
39
34
  ],
40
35
  "dependencies": {
41
- "@soybeanjs/color-palette": "^0.2.1",
42
- "colord": "^2.9.3",
43
36
  "unocss": "^66.5.12"
44
37
  },
45
38
  "devDependencies": {
@@ -1,23 +0,0 @@
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/shared.d.ts DELETED
@@ -1,11 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
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};
@@ -1,119 +0,0 @@
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 };