@chaibuilder/sdk 2.2.1 → 2.2.3
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/{chai-theme-helpers-FO9vdd-R.js → chai-theme-helpers-CfZwxV6S.js} +90 -63
- package/dist/chai-theme-helpers-utzv3TbX.cjs +22 -0
- package/dist/core.cjs +4 -12
- package/dist/core.d.ts +85 -7
- package/dist/core.js +884 -887
- package/dist/{plugin-B09c0d5S.js → plugin-DW1HhfzA.js} +1 -1
- package/dist/{plugin-BiiuylVf.cjs → plugin-kqWzHDpF.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.d.ts +29 -3
- package/dist/render.js +3 -3
- package/dist/tailwind.cjs +1 -1
- package/dist/tailwind.js +1 -1
- package/dist/ui.d.ts +3 -3
- package/package.json +3 -3
- package/dist/chai-theme-helpers-BjWE6otR.cjs +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./chai-theme-helpers-
|
|
1
|
+
"use strict";const o=require("./chai-theme-helpers-utzv3TbX.cjs"),n=(i=o.defaultThemeOptions)=>({container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},...o.getChaiThemeOptions(i)}),r=o.plugin(function({addBase:i,theme:e}){i({"h1,h2,h3,h4,h5,h6":{fontFamily:e("fontFamily.heading")},body:{fontFamily:e("fontFamily.body"),color:e("colors.foreground"),backgroundColor:e("colors.background")}})});exports.chaiBuilderPlugin=r;exports.getChaiBuilderTheme=n;
|
package/dist/render.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./chai-theme-helpers-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./chai-theme-helpers-utzv3TbX.cjs"),n=require("lodash-es"),$=require("@mhsdesign/jit-browser-tailwindcss"),R=require("@tailwindcss/aspect-ratio"),O=require("@tailwindcss/container-queries"),F=require("@tailwindcss/forms"),L=require("@tailwindcss/typography"),C=require("./plugin-kqWzHDpF.cjs"),u=require("react/jsx-runtime"),E=require("@chaibuilder/runtime"),f=require("react"),M=require("tailwind-merge"),m=require("./getSplitClasses-DodqA_KW.cjs"),N=e=>{if(!e)return[];try{return JSON.parse(A(e)).filter(t=>!t._type.startsWith("@chai"))}catch{return[{_type:"Paragraph",_id:"error",content:"Invalid JSON. Please check the JSON string."}]}};function A(e){const i=/(asset:\/\/|https:\/\/asset\.localhost\/)(?:localhost\/)?[^"']+/g;return e.replace(i,t=>{const s=decodeURIComponent(t),a=s.indexOf("public");return a!==-1?s.substring(a+6):s})}async function I(e,i,t=[],s="",a){return await $.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:t,theme:{extend:C.getChaiBuilderTheme(e)},plugins:[F,L,R,O,C.chaiBuilderPlugin],corePlugins:{preflight:a},...s?{prefix:`${s}`}:{}}}).generateStylesFromContent(` ${a?"@tailwind base;":""}
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;`,i)}const J=(e,i,t)=>{const s=JSON.stringify(e).replace(/#styles:([^"]*)/g,(a,c)=>`#styles:${c.replace(/,/g," ")}`.replace(/#styles:/g,""));return I(i,[s],[],"",t)},V=async(e,i=p.defaultThemeOptions,t=!1)=>await J(e,i,t);async function Y(e){const i=await e.dataProvider({pageProps:e.pageProps,block:e.block,lang:e.lang,draft:e.draft,inBuilder:e.inBuilder});return n.has(i,"$metadata")&&e.dataProviderMetadataCallback(e.block,i.$metadata),u.jsx(f.Suspense,{children:f.createElement(e.component,{...n.omit(e.props,["dataProvider","dataProviderMetadataCallback"]),...n.omit(i,"$metadata"),key:`${e.block._id}-async`})})}const K=n.memoize(e=>{const{baseClasses:i,classes:t}=m.getSplitChaiClasses(e);return M.twMerge(i,t).replace(m.STYLES_KEY,"").trim()}),P=(e,i)=>{const t=n.cloneDeep(e);return n.forEach(n.keys(t),s=>{if(n.isString(t[s])){let a=t[s];const c=/\{\{(.*?)\}\}/g,l=a.match(c);l&&l.forEach(o=>{const d=o.slice(2,-2),h=n.get(i,d,o);a=a.replace(o,h)}),t[s]=a}n.isObject(t[s])&&(t[s]=P(t[s],i))}),t};function z(e,i){const t=n.get(e,`${i}_attrs`,{}),s=n.keys(t).join(" ");return n.includes(s,"x-show")&&!n.includes(s,"x-transition")&&(t["x-transition"]=""),t}function U(e){const i={};return Object.keys(e).forEach(t=>{if(n.isString(e[t])&&e[t].startsWith(m.STYLES_KEY)){const s=K(e[t]);i[t]={className:s,...z(e,t)}}}),i}function W(e,i,t){if(n.isEmpty(i))return e;const s=n.cloneDeep(e),a=n.get(t,"i18nProps",[]);return n.forEach(n.keys(s),c=>{a.includes(c)&&!n.isEmpty(i)&&(s[c]=n.get(s,`${c}-${i}`,s[c]))}),s}const D=n.memoize(e=>{const i=E.getRegisteredChaiBlock(e),t=n.get(i,"schema.properties",{});return Object.fromEntries(Object.entries(t).filter(([,s])=>n.get(s,"runtime",!1)))}),H=(e,i,t)=>n.isEmpty(t)?{}:Object.entries(t).reduce((s,[a,c])=>{const l=[];let o=n.find(e,{_id:i});for(;o;)l.push(o),o=n.find(e,{_id:o._parent});const d=n.find(l,{_type:c.block});return d&&(s[a]=n.get(d,n.get(c,"prop"),null)),s},{}),G=()=>u.jsx("span",{children:"Loading..."});function Q(e){if(n.has(e,"metadata")&&console.warn(" metadata is deprecated and will be removed in upcoming version, use forwardProps instead"),n.isEmpty(e.lang)&&!n.isEmpty(e.fallbackLang))throw new Error("lang prop is required when fallbackLang is provided");const i=e.lang??"en",t=e.fallbackLang??i;return u.jsx(T,{...e,lang:i,fallbackLang:t})}function T({blocks:e,parent:i,externalData:t={},lang:s="en",fallbackLang:a="en",pageProps:c={},dataProviderMetadataCallback:l=()=>{},draft:o=!1}){const d=e,h=r=>U(r),b=i?n.filter(e,{_parent:i}):n.filter(e,r=>n.isEmpty(r._parent));return n.uniqBy(b,"_id").map((r,k)=>{const S={},j=n.filter(d,{_parent:r._id});S.children=j.length>0?u.jsx(T,{externalData:t,parent:r._id,blocks:d,lang:s,fallbackLang:a,pageProps:c,dataProviderMetadataCallback:l,draft:o},`${r._id}-children`):null;const g=E.getRegisteredChaiBlock(r._type);if(g!==null){let y=r;const w=g.component;y={...g.defaults,...r};const x=s===a?"":s,v=H(d,r._id,D(r._type)),_=P(W(r,x,g),t),B=n.omit({...y,..._,...h(_),...S,...v,index:k,lang:s,key:r._id,draft:o,pageProps:c,blockProps:{},inBuilder:!1},["_parent"]);if(n.has(g,"dataProvider")){const q=n.get(g,"suspenseFallback",G);return u.jsx(f.Suspense,{fallback:f.createElement(q),children:u.jsx(Y,{inBuilder:!1,dataProviderMetadataCallback:l,lang:s,pageProps:c,dataProvider:g.dataProvider,block:r,component:w,props:B,draft:o},`${r._id}-async`)},`${r._id}-suspense`)}return u.jsx(f.Suspense,{children:f.createElement(w,B)},`${r._id}-suspense`)}return u.jsxs("noscript",{children:[r._type," not found"]},`${r._id}-noscript`)})}exports.getChaiThemeCssVariables=p.getChaiThemeCssVariables;exports.getThemeFontsCSSImport=p.getThemeFontsCSSImport;exports.getThemeFontsLinkMarkup=p.getThemeFontsLinkMarkup;exports.RenderChaiBlocks=Q;exports.convertToBlocks=N;exports.getStylesForBlocks=V;
|
package/dist/render.d.ts
CHANGED
|
@@ -23,9 +23,33 @@ declare type ChaiBuilderThemeOptions = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
declare type ChaiBuilderThemeValues = {
|
|
26
|
-
fontFamily:
|
|
26
|
+
fontFamily: {
|
|
27
|
+
heading: string;
|
|
28
|
+
body: string;
|
|
29
|
+
};
|
|
27
30
|
borderRadius: string;
|
|
28
|
-
colors:
|
|
31
|
+
colors: {
|
|
32
|
+
background: [HexColor, HexColor];
|
|
33
|
+
foreground: [HexColor, HexColor];
|
|
34
|
+
primary: [HexColor, HexColor];
|
|
35
|
+
"primary-foreground": [HexColor, HexColor];
|
|
36
|
+
secondary: [HexColor, HexColor];
|
|
37
|
+
"secondary-foreground": [HexColor, HexColor];
|
|
38
|
+
muted: [HexColor, HexColor];
|
|
39
|
+
"muted-foreground": [HSLColor, HSLColor];
|
|
40
|
+
accent: [HSLColor, HSLColor];
|
|
41
|
+
"accent-foreground": [HSLColor, HSLColor];
|
|
42
|
+
destructive: [HSLColor, HSLColor];
|
|
43
|
+
"destructive-foreground": [HSLColor, HSLColor];
|
|
44
|
+
border: [HSLColor, HSLColor];
|
|
45
|
+
input: [HSLColor, HSLColor];
|
|
46
|
+
ring: [HexColor, HexColor];
|
|
47
|
+
card: [HexColor, HexColor];
|
|
48
|
+
"card-foreground": [HexColor, HexColor];
|
|
49
|
+
popover: [HexColor, HexColor];
|
|
50
|
+
"popover-foreground": [HexColor, HexColor];
|
|
51
|
+
[key: string]: [HexColor, HexColor];
|
|
52
|
+
};
|
|
29
53
|
};
|
|
30
54
|
|
|
31
55
|
/**
|
|
@@ -34,7 +58,7 @@ declare type ChaiBuilderThemeValues = {
|
|
|
34
58
|
*/
|
|
35
59
|
export declare const convertToBlocks: (chaiFormatContent: string) => ChaiBlock[];
|
|
36
60
|
|
|
37
|
-
export declare const getChaiThemeCssVariables: (chaiTheme:
|
|
61
|
+
export declare const getChaiThemeCssVariables: (chaiTheme: ChaiBuilderThemeValues) => string;
|
|
38
62
|
|
|
39
63
|
/**
|
|
40
64
|
* Get the tailwind css for the blocks
|
|
@@ -49,6 +73,8 @@ export declare const getThemeFontsCSSImport: (fonts: ChaiFontViaUrl[]) => any;
|
|
|
49
73
|
|
|
50
74
|
export declare const getThemeFontsLinkMarkup: (fonts: ChaiFontViaUrl[]) => any;
|
|
51
75
|
|
|
76
|
+
declare type HexColor = string;
|
|
77
|
+
|
|
52
78
|
declare type HSLColor = string;
|
|
53
79
|
|
|
54
80
|
export declare function RenderChaiBlocks(props: RenderChaiBlocksProps): JSX_2.Element;
|
package/dist/render.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { d as q } from "./chai-theme-helpers-
|
|
2
|
-
import { a as Re, b as je, c as Fe } from "./chai-theme-helpers-
|
|
1
|
+
import { d as q } from "./chai-theme-helpers-CfZwxV6S.js";
|
|
2
|
+
import { a as Re, b as je, c as Fe } from "./chai-theme-helpers-CfZwxV6S.js";
|
|
3
3
|
import { has as S, omit as _, memoize as x, get as c, isEmpty as m, filter as g, uniqBy as K, cloneDeep as E, forEach as O, keys as y, isString as T, isObject as U, find as h, includes as v } from "lodash-es";
|
|
4
4
|
import { createTailwindcss as W } from "@mhsdesign/jit-browser-tailwindcss";
|
|
5
5
|
import Y from "@tailwindcss/aspect-ratio";
|
|
6
6
|
import z from "@tailwindcss/container-queries";
|
|
7
7
|
import D from "@tailwindcss/forms";
|
|
8
8
|
import G from "@tailwindcss/typography";
|
|
9
|
-
import { g as H, c as Q } from "./plugin-
|
|
9
|
+
import { g as H, c as Q } from "./plugin-DW1HhfzA.js";
|
|
10
10
|
import { jsx as f, jsxs as X } from "react/jsx-runtime";
|
|
11
11
|
import { getRegisteredChaiBlock as k } from "@chaibuilder/runtime";
|
|
12
12
|
import R, { Suspense as w, createElement as Z } from "react";
|
package/dist/tailwind.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tailwindcss/aspect-ratio"),a=require("@tailwindcss/forms"),i=require("@tailwindcss/typography"),n=require("tailwindcss-animate"),r=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@tailwindcss/aspect-ratio"),a=require("@tailwindcss/forms"),i=require("@tailwindcss/typography"),n=require("tailwindcss-animate"),r=require("./plugin-kqWzHDpF.cjs");function d(){return{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))"},secondary:{DEFAULT:"hsl(var(--secondary))",foreground:"hsl(var(--secondary-foreground))"},destructive:{DEFAULT:"hsl(var(--destructive))",foreground:"hsl(var(--destructive-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))"}},borderRadius:{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"},keyframes:{"accordion-down":{from:{height:"0"},to:{height:"var(--radix-accordion-content-height)"}},"accordion-up":{from:{height:"var(--radix-accordion-content-height)"},to:{height:"0"}}},animation:{"accordion-down":"accordion-down 0.2s ease-out","accordion-up":"accordion-up 0.2s ease-out"}}}const t=e=>({darkMode:"class",content:[...e,"node_modules/@chaibuilder/sdk/dist/*.{js,cjs}"],theme:{extend:d()},plugins:[n,i,a,o]});exports.chaiBuilderPlugin=r.chaiBuilderPlugin;exports.getChaiBuilderTheme=r.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=t;
|
package/dist/tailwind.js
CHANGED
|
@@ -2,7 +2,7 @@ import o from "@tailwindcss/aspect-ratio";
|
|
|
2
2
|
import a from "@tailwindcss/forms";
|
|
3
3
|
import e from "@tailwindcss/typography";
|
|
4
4
|
import d from "tailwindcss-animate";
|
|
5
|
-
import { c as g, g as v } from "./plugin-
|
|
5
|
+
import { c as g, g as v } from "./plugin-DW1HhfzA.js";
|
|
6
6
|
function n() {
|
|
7
7
|
return {
|
|
8
8
|
colors: {
|
package/dist/ui.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare const AccordionItem: React_2.ForwardRefExoticComponent<Omit<Accor
|
|
|
32
32
|
export declare const AccordionTrigger: React_2.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
33
33
|
|
|
34
34
|
export declare const Alert: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: {
|
|
35
|
-
variant?: "
|
|
35
|
+
variant?: "destructive" | "default";
|
|
36
36
|
} & ClassProp) => string> & React_2.RefAttributes<HTMLDivElement>>;
|
|
37
37
|
|
|
38
38
|
export declare const AlertDescription: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLParagraphElement> & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -75,7 +75,7 @@ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export declare const badgeVariants: (props?: {
|
|
78
|
-
variant?: "
|
|
78
|
+
variant?: "secondary" | "destructive" | "default" | "outline";
|
|
79
79
|
} & ClassProp) => string;
|
|
80
80
|
|
|
81
81
|
export declare const Button: React_2.ForwardRefExoticComponent<ButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
@@ -85,7 +85,7 @@ export declare interface ButtonProps extends React_2.ButtonHTMLAttributes<HTMLBu
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export declare const buttonVariants: (props?: {
|
|
88
|
-
variant?: "
|
|
88
|
+
variant?: "secondary" | "destructive" | "link" | "default" | "outline" | "ghost";
|
|
89
89
|
size?: "sm" | "lg" | "default" | "icon";
|
|
90
90
|
} & ClassProp) => string;
|
|
91
91
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"author": "Suraj Air",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"homepage": "https://chaibuilder.com",
|
|
8
|
-
"version": "2.2.
|
|
8
|
+
"version": "2.2.3",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@chaibuilder/runtime": "2.1.
|
|
56
|
+
"@chaibuilder/runtime": "2.1.2",
|
|
57
57
|
"@types/react": "*",
|
|
58
58
|
"@types/react-dom": "*",
|
|
59
59
|
"jotai": "2.12.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@ai-sdk/react": "^1.2.2",
|
|
73
|
-
"@chaibuilder/runtime": "2.1.
|
|
73
|
+
"@chaibuilder/runtime": "2.1.2",
|
|
74
74
|
"@floating-ui/dom": "1.6.13",
|
|
75
75
|
"@floating-ui/react-dom": "2.1.2",
|
|
76
76
|
"@mhsdesign/jit-browser-tailwindcss": "0.4.2",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("@chaibuilder/runtime"),F=require("lodash-es"),_={fontFamily:{"font-heading":"Inter","font-body":"Inter"},borderRadius:"10px",colors:[{group:"Body",items:{background:["#FFFFFF","#121212"],foreground:["#121212","#FFFFFF"]}},{group:"Primary",items:{primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"]}},{group:"Secondary",items:{secondary:["#F3F4F6","#374151"],"secondary-foreground":["#1F2937","#F9FAFB"]}},{group:"Border, Input & Ring",items:{border:["#E5E7EB","#374151"],input:["#E5E7EB","#374151"],ring:["#2563EB","#3B82F6"]}},{group:"Card",items:{card:["#FFFFFF","#1F2937"],"card-foreground":["#121212","#FFFFFF"]}},{group:"Popover",items:{popover:["#FFFFFF","#1F2937"],"popover-foreground":["#121212","#FFFFFF"]}},{group:"Muted",items:{muted:["#F3F4F6","#374151"],"muted-foreground":["#6B7280","#9CA3AF"]}},{group:"Accent",items:{accent:["#F3F4F6","#374151"],"accent-foreground":["#1F2937","#FFFFFF"]}},{group:"Destructive",items:{destructive:["#DC2626","#EF4444"],"destructive-foreground":["#FFFFFF","#FFFFFF"]}}]};function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={},c={},p;function v(){return p||(p=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});function r(n,o){return{handler:n,config:o}}r.withOptions=function(n,o=()=>({})){const u=function(i){return{__options:i,handler:n(i),config:o(i)}};return u.__isOptionsFunction=!0,u.__pluginFunction=n,u.__configFunction=o,u};const t=r}(c)),c}var y;function C(){return y||(y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});const r=t(v());function t(o){return o&&o.__esModule?o:{default:o}}const n=r.default}(d)),d}var f,$;function P(){if($)return f;$=1;let e=C();return f=(e.__esModule?e:{default:e}).default,f}var j=P();const B=b(j),M=e=>({fontFamily:e.fontFamily?F.keys(e.fontFamily).reduce((t,n)=>({...t,[n.replace("font-","")]:`var(--${n})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?F.flatten(e.colors.map(t=>Object.entries(t.items))).reduce((t,[n])=>({...t,[n]:`hsl(var(--${n}))`}),{}):{}});function g(e){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let t=parseInt(r[1],16),n=parseInt(r[2],16),o=parseInt(r[3],16);t/=255,n/=255,o/=255;const u=Math.max(t,n,o),i=Math.min(t,n,o);let a,s;const m=(u+i)/2;if(u==i)a=s=0;else{const l=u-i;switch(s=m>.5?l/(2-u-i):l/(u+i),u){case t:a=(n-o)/l+(n<o?6:0);break;case n:a=(o-t)/l+2;break;case o:a=(t-n)/l+4;break}a/=6}return`${Math.round(a*360)} ${Math.round(s*100)}% ${Math.round(m*100)}%`}const q=e=>{const t=h.getAllRegisteredFonts().find(n=>n.family===e);return`"${e}", ${F.get(t,"fallback","")}`},E=e=>`:root {
|
|
2
|
-
${e.fontFamily&&Object.entries(e.fontFamily).map(([r,t])=>`--font-${r}: ${q(t)};`).join(`
|
|
3
|
-
`)}
|
|
4
|
-
${e.borderRadius&&`--radius: ${e.borderRadius};`}
|
|
5
|
-
${e.colors&&Object.entries(e.colors).map(([r,t])=>`--${r}: ${g(t[0])};`).join(`
|
|
6
|
-
`)}
|
|
7
|
-
}
|
|
8
|
-
.dark {
|
|
9
|
-
${e.colors&&Object.entries(e.colors).map(([r,t])=>`--${r}: ${g(t[1])};`).join(`
|
|
10
|
-
`)}
|
|
11
|
-
}`,O=e=>!e||e.length===0?"":F.uniqBy(e,"family").map(r=>`<link rel="stylesheet" href="${r.url}" />`).join(`
|
|
12
|
-
`),S=e=>!e||e.length===0?"":F.uniqBy(e,"family").map(r=>`@import url("${r.url}");`).join(`
|
|
13
|
-
`),k=e=>!e||e.length===0?"":F.uniqBy(e,"family").map(r=>r.src.map(t=>`@font-face {
|
|
14
|
-
font-family: "${r.family}";
|
|
15
|
-
src: url("${t.url}") format("${t.format}");
|
|
16
|
-
font-display: swap;
|
|
17
|
-
${t.fontWeight?`font-weight: ${t.fontWeight};`:""}
|
|
18
|
-
${t.fontStyle?`font-style: ${t.fontStyle};`:""}
|
|
19
|
-
${t.fontStretch?`font-stretch: ${t.fontStretch};`:""}
|
|
20
|
-
}`).join(`
|
|
21
|
-
`)).join(`
|
|
22
|
-
`);exports.defaultThemeOptions=_;exports.getChaiThemeCssVariables=E;exports.getChaiThemeOptions=M;exports.getThemeCustomFontFace=k;exports.getThemeFontsCSSImport=S;exports.getThemeFontsLinkMarkup=O;exports.hexToHSL=g;exports.plugin=B;
|