@vokril/ui-solid 0.25.0 → 0.26.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/CHANGELOG.md +11 -0
- package/README.md +16 -6
- package/dist/_internal/platform/settings/settingsTypes.d.cts +7 -0
- package/dist/_internal/platform/settings/settingsTypes.d.ts +7 -0
- package/dist/appThemeDerivation-Be_oKljl.cjs +1 -0
- package/dist/{appThemeDerivation-B7-DjMIM.js → appThemeDerivation-CKoSe4KP.js} +334 -252
- package/dist/fonts/manrope.css +10 -0
- package/dist/fonts.css +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +476 -472
- package/dist/server/appThemeDerivation-Be_oKljl.cjs +1 -0
- package/dist/server/{appThemeDerivation-B7-DjMIM.js → appThemeDerivation-CKoSe4KP.js} +334 -252
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +468 -464
- package/dist/server/tokens/index.cjs +1 -1
- package/dist/server/tokens/index.js +33 -29
- package/dist/solid/tokens/index.js +1 -1
- package/dist/solid/tokens/palette/palettes.js +62 -4
- package/dist/solid/tokens/palette/themeRegistry.js +30 -7
- package/dist/solid/tokens/theme.jsx +12 -5
- package/dist/style.css +288 -9
- package/dist/theme.css +287 -8
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.d.cts +2 -2
- package/dist/tokens/index.d.ts +2 -2
- package/dist/tokens/index.js +33 -29
- package/dist/tokens/palette/palettes.d.cts +13 -13
- package/dist/tokens/palette/palettes.d.ts +13 -13
- package/dist/tokens/palette/themeRegistry.d.cts +27 -6
- package/dist/tokens/palette/themeRegistry.d.ts +27 -6
- package/dist/tokens/theme.d.cts +11 -8
- package/dist/tokens/theme.d.ts +11 -8
- package/dist/tokens/tokens.css +287 -8
- package/dist/ui.css +1 -1
- package/package.json +3 -2
- package/dist/appThemeDerivation-NS3Vws8q.cjs +0 -1
- package/dist/server/appThemeDerivation-NS3Vws8q.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vokril/ui-solid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Vokril UI for SolidJS: accessible components, design tokens and the Vokril palette",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -374,6 +374,7 @@
|
|
|
374
374
|
"./fonts.css": "./dist/fonts.css",
|
|
375
375
|
"./fonts/inter.css": "./dist/fonts/inter.css",
|
|
376
376
|
"./fonts/jetbrains-mono.css": "./dist/fonts/jetbrains-mono.css",
|
|
377
|
+
"./fonts/manrope.css": "./dist/fonts/manrope.css",
|
|
377
378
|
"./desktop/app-shell.css": "./dist/desktop/app-shell.css",
|
|
378
379
|
"./package.json": "./package.json"
|
|
379
380
|
},
|
|
@@ -456,7 +457,7 @@
|
|
|
456
457
|
"entries": "node scripts/entries.mjs --write",
|
|
457
458
|
"entries:check": "node scripts/entries.mjs --check",
|
|
458
459
|
"palette:check": "node scripts/palette/vokril.mjs --check",
|
|
459
|
-
"lint:package": "publint --strict && attw --pack --exclude-entrypoints style.css theme.css base.css ui.css tokens/tokens.css tokens/breakpoints.css fonts.css fonts/inter.css fonts/jetbrains-mono.css desktop/app-shell.css",
|
|
460
|
+
"lint:package": "publint --strict && attw --pack --exclude-entrypoints style.css theme.css base.css ui.css tokens/tokens.css tokens/breakpoints.css fonts.css fonts/inter.css fonts/jetbrains-mono.css fonts/manrope.css desktop/app-shell.css",
|
|
460
461
|
"smoke": "node scripts/smoke.mjs",
|
|
461
462
|
"size": "node scripts/size-report.mjs",
|
|
462
463
|
"changeset": "changeset",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const J=require("solid-js/web"),y=require("solid-js"),z=require("./bugIndicatingError-D2X5Hfgg.cjs"),x=[{id:"vokril-dark",label:"Vokril Dark",type:"dark",palette:{surface:"#212329",surfaceAlt:"#181A1F",surfaceElevated:"#2D2F35",brand:"#808AE5",brandHover:"#707AD0",content:"#EBEDF0",contentSecondary:"#C7C9CE",border:"#2D2F35",input:"#181A1F",inputBorder:"#2D2F35",success:"#4FB772",error:"#E05D5A",warning:"#F0A945",info:"#55A8DB",syntaxKeyword:"#BC97E8",syntaxString:"#92C487",syntaxFunction:"#F0C77C",syntaxNumber:"#6FBCE3",syntaxType:"#76CDC5",syntaxComment:"#8F939F"}},{id:"light",label:"Vokril Light",type:"light",palette:{surface:"#FFFFFF",surfaceAlt:"#F3F4F8",surfaceElevated:"#FFFFFF",brand:"#5355D0",brandHover:"#4545B6",content:"#1C1E24",contentSecondary:"#5F636F",border:"#DFE1E7",input:"#FFFFFF",inputBorder:"#D0D2D9",success:"#048A45",error:"#C72C34",warning:"#C27400",info:"#007AB0",syntaxKeyword:"#7D3AB7",syntaxString:"#357426",syntaxFunction:"#895709",syntaxNumber:"#006A9D",syntaxType:"#007973",syntaxComment:"#696D79"}},{id:"high-contrast-dark",label:"High Contrast Dark",type:"dark",palette:{surface:"#000000",surfaceAlt:"#000000",surfaceElevated:"#121212",brand:"#66B2FF",brandHover:"#99CCFF",content:"#FFFFFF",contentSecondary:"#E6E6E6",border:"#FFFFFF",input:"#000000",inputBorder:"#FFFFFF",success:"#57E389",error:"#FF7B72",warning:"#F0B429",info:"#66B2FF",syntaxKeyword:"#FF9999",syntaxString:"#99E699",syntaxFunction:"#FFE066",syntaxNumber:"#99CCFF",syntaxType:"#FFCC80",syntaxComment:"#B0B0B0"}},{id:"high-contrast-light",label:"High Contrast Light",type:"light",palette:{surface:"#FFFFFF",surfaceAlt:"#FFFFFF",surfaceElevated:"#FFFFFF",brand:"#0047BA",brandHover:"#003080",content:"#000000",contentSecondary:"#262626",border:"#000000",input:"#FFFFFF",inputBorder:"#000000",success:"#006622",error:"#B30000",warning:"#8C4600",info:"#0047BA",syntaxKeyword:"#8C0000",syntaxString:"#005C1F",syntaxFunction:"#4D2600",syntaxNumber:"#0047BA",syntaxType:"#0047BA",syntaxComment:"#404040"}}],S="vokril-dark",Q={darcula:"vokril-dark"},Z=e=>Q[e]??e,A=[];function he(e){return A.push(e),{dispose:()=>{const n=A.indexOf(e);n!==-1&&A.splice(n,1)}}}function ee(e){for(const n of A){const r=n.byId(e);if(r!==null)return r}return null}function w(e){const n=Z(e);return x.find(r=>r.id===n)??ee(n)??x[0]}function ne(){return[...x,...A.flatMap(e=>e.options())]}function Fe(e){const n=Z(e);return x.some(r=>r.id===n)||ee(n)!==null}const I=4.5,xe=3;function ke(e){const n=e.trim().replace(/^#/,""),r=n.length===3?n.split("").map(t=>t+t).join(""):n;return r.length!==6||/[^0-9a-fA-F]/.test(r)?null:{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function pe({r:e,g:n,b:r}){const t=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return`#${t(e)}${t(n)}${t(r)}`}function N(e){const n=ke(e);if(!n)throw new z.BugIndicatingError(`contrast: expected #rgb/#rrggbb, got ${JSON.stringify(e)}. Resolve var()/transparent/color-mix to a literal hex before measuring.`);return n}function M(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function v(e){const{r:n,g:r,b:t}=N(e);return .2126*M(n)+.7152*M(r)+.0722*M(t)}function b(e,n){const r=v(e),t=v(n),[o,c]=r>t?[r,t]:[t,r];return(o+.05)/(c+.05)}function Te(e,n,r){const t=N(e),o=N(n),c=Math.max(0,Math.min(1,r));return pe({r:t.r+(o.r-t.r)*(1-c),g:t.g+(o.g-t.g)*(1-c),b:t.b+(o.b-t.b)*(1-c)})}function p(e,n){return e+1e-9>=n}function Ee(e){const n=v(e);return 116*(n>(6/29)**3?Math.cbrt(n):n/(3*(6/29)**2)+4/29)-16}const L=e=>{const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)},Ae=e=>(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)*255;function Se(e){const n=e.trim().replace(/^#/,""),r=n.length===3?n.split("").map(t=>t+t).join(""):n;if(r.length!==6||/[^0-9a-fA-F]/.test(r))throw new z.BugIndicatingError(`oklch: expected #rgb/#rrggbb, got ${JSON.stringify(e)}`);return{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function ve(e){const{r:n,g:r,b:t}=Se(e),o=L(n),c=L(r),s=L(t),u=Math.cbrt(.4122214708*o+.5363325363*c+.0514459929*s),i=Math.cbrt(.2119034982*o+.6806995451*c+.1073969566*s),d=Math.cbrt(.0883024619*o+.2817188376*c+.6299787005*s),l=.2104542553*u+.793617785*i-.0040720468*d,m=1.9779984951*u-2.428592205*i+.4505937099*d,f=.0259040371*u+.7827717662*i-.808675766*d,g=Math.atan2(f,m)*180/Math.PI;return{l,c:Math.hypot(m,f),h:g<0?g+360:g}}function D({l:e,c:n,h:r}){const t=r*Math.PI/180,o=n*Math.cos(t),c=n*Math.sin(t),s=(e+.3963377774*o+.2158037573*c)**3,u=(e-.1055613458*o-.0638541728*c)**3,i=(e-.0894841775*o-1.291485548*c)**3;return{r:4.0767416621*s-3.3077115913*u+.2309699292*i,g:-1.2684380046*s+2.6097574011*u-.3413193965*i,b:-.0041960863*s-.7034186147*u+1.707614701*i}}const k=1e-4,W=({r:e,g:n,b:r})=>e>=-k&&e<=1+k&&n>=-k&&n<=1+k&&r>=-k&&r<=1+k;function Ce({l:e,c:n,h:r}){if(W(D({l:e,c:n,h:r})))return n;let t=0,o=n;for(let c=0;c<24;c++){const s=(t+o)/2;W(D({l:e,c:s,h:r}))?t=s:o=s}return t}function O(e){const n=Ce(e),r=D({...e,c:n}),t=o=>Math.max(0,Math.min(255,Math.round(Ae(o)))).toString(16).padStart(2,"0");return`#${t(r.r)}${t(r.g)}${t(r.b)}`}function q(e,n,r,t){const o=ve(e),c=t==="lighter"?1:0,s=O({...o,l:c});if(!p(b(s,n),r))return s;let u=o.l,i=c;for(let d=0;d<24;d++){const l=(u+i)/2;p(b(O({...o,l}),n),r)?i=l:u=l}return O({...o,l:i})}function R(e,n,r){if(p(b(e,n),r))return e;const t=v(e)<v(n),o=q(e,n,r,t?"darker":"lighter");if(p(b(o,n),r))return o;const c=q(e,n,r,t?"lighter":"darker");return b(c,n)>b(o,n)?c:o}function we(e,n,r){let t=e;for(let o=0;o<8;o++){let c=!1;for(const s of n){const u=R(t,s,r);u!==t&&(t=u,c=!0)}if(!c)break}return t}function Be(e,n,r){let t=n[0]??"#ffffff",o=-1;for(const c of n){const s=b(c,e);if(p(s,r))return c;s>o&&(o=s,t=c)}return t}const re="#2A2C31",te="#1C1E23",oe=.25,Ie=oe;function ce(e){return R(e.inputBorder,e.input,xe)}function se(e,n,r){const t=[n.surface,n.surfaceAlt,n.surfaceElevated];return r==="dark"&&t.push(re,te),t.flatMap(o=>[o,Te(e,o,oe)])}function ie(e,n,r){return we(e,se(e,n,r),I)}const _e=["error","brand","success","warning","info"],Me=60;function E(e){return p(b("#ffffff",e),I)||Ee(e)>=Me?e:R(e,"#ffffff",I)}function ae(e,n){return Be(e,["#ffffff",n.surfaceAlt,"#000000"],I)}const Le=["brand","error","success","warning"],ue="#D76CB7",Oe="data-colorblind-safe",P={success:"#009e73",error:"#d55e00",warning:"#e69f00",info:"#56b4e9"},H={added:P.success,deleted:P.error};function de(e){return{...e,...P}}function Ne(){return typeof document>"u"?!1:document.documentElement.hasAttribute(Oe)}function fe(e,n,r){const t=d=>ie(d,e,n),o=E(e.brand),c=E(e.error),s=E(e.success),u=E(e.warning),i=d=>ae(d,e);return{"--color-surface":e.surface,"--color-surface-alt":e.surfaceAlt,"--color-surface-elevated":e.surfaceElevated,"--color-brand":e.brand,"--color-brand-hover":e.brandHover,"--color-content":e.content,"--color-content-secondary":e.contentSecondary,"--color-border":e.border,"--color-input":e.input,"--color-input-border":ce(e),"--color-success":e.success,"--color-error":e.error,"--color-warning":e.warning,"--color-info":e.info,"--color-success-text":t(e.success),"--color-error-text":t(e.error),"--color-warning-text":t(e.warning),"--color-info-text":t(e.info),"--color-brand-text":t(e.brand),"--color-unique-text":t(ue),"--color-brand-surface":o,"--color-error-surface":c,"--color-success-surface":s,"--color-warning-surface":u,"--color-on-brand":i(o),"--color-on-error":i(c),"--color-on-success":i(s),"--color-on-warning":i(u),"--color-diff-added":r?H.added:"","--color-diff-deleted":r?H.deleted:"","--color-syntax-keyword":e.syntaxKeyword,"--color-syntax-string":e.syntaxString,"--color-syntax-function":e.syntaxFunction,"--color-syntax-comment":e.syntaxComment,"--color-syntax-number":e.syntaxNumber,"--color-syntax-type":e.syntaxType}}const U="data-colorblind-safe";function V(e,n=!1){return w(e==="system"?n?"light":S:e==="dark"?S:e)}function le(e,n={}){var u,i;const r=typeof e=="string"?V(e):e,t=n.document??(typeof document<"u"?document:void 0);if(!t)return r;const o=t.documentElement,c=n.colorVisionSafe??!1;c?o.setAttribute(U,""):o.removeAttribute(U);const s=c?de(r.palette):r.palette;for(const[d,l]of Object.entries(fe(s,r.type,c)))o.style.setProperty(d,l);return(u=t.body)==null||u.classList.remove("light","dark"),(i=t.body)==null||i.classList.add(r.type),o.classList.remove("light","dark"),o.classList.add(r.type),o.style.colorScheme=r.type,o.setAttribute("data-app-theme",r.id),r}function De(){return ne()}const Pe="vokril-ui-theme",He="(prefers-color-scheme: light)";function Ke(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}const ge=y.createContext(),Re=e=>{var $,G;const n=e.storageKey===void 0?Pe:e.storageKey,r=e.storage===void 0?Ke():e.storage,t=()=>{if(!r||!n)return null;try{return r.getItem(n)}catch{return null}},o=(($=e.document)==null?void 0:$.defaultView)??(typeof window>"u"?void 0:window),c=(G=o==null?void 0:o.matchMedia)==null?void 0:G.call(o,He),[s,u]=y.createSignal(t()??e.defaultTheme??"dark"),[i,d]=y.createSignal((c==null?void 0:c.matches)??!1),[l,m]=y.createSignal(e.colorVisionSafe??!1);if(c){const T=be=>d(be.matches);c.addEventListener("change",T),y.onCleanup(()=>c.removeEventListener("change",T))}const f=y.createMemo(()=>V(s(),i())),g=y.createMemo(()=>f().type),h=T=>{if(u(T),!(!r||!n))try{r.setItem(n,T)}catch{}},_=()=>h(g()==="dark"?"light":"dark");y.createEffect(()=>{le(f(),{colorVisionSafe:l(),document:e.document})});const ye={theme:s,resolvedTheme:g,themeId:()=>f().id,setTheme:h,toggleTheme:_,colorVisionSafe:l,setColorVisionSafe:m};return J.createComponent(ge.Provider,{value:ye,get children(){return e.children}})};let X=!1;function Ve(){const e=y.useContext(ge);return e||(J.isDev&&!X&&(X=!0,console.warn("@vokril/ui-solid: useTheme() was called outside <ThemeProvider>; it reports Vokril Dark and ignores setTheme.")),{theme:()=>"dark",resolvedTheme:()=>"dark",themeId:()=>S,setTheme:()=>{},toggleTheme:()=>{},colorVisionSafe:()=>!1,setColorVisionSafe:()=>{}})}var j;const Y=((j=x.find(e=>e.id===S))==null?void 0:j.palette)??x[0].palette;function $e(e){return Math.max(0,Math.min(255,Math.round(e)))}function K(e){const n=e.trim().replace(/^#/,""),r=n.length===3?n.split("").map(t=>t+t).join(""):n;return r.length!==6||/[^0-9a-fA-F]/.test(r)?null:{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function B({r:e,g:n,b:r}){const t=o=>$e(o).toString(16).padStart(2,"0");return`#${t(e)}${t(n)}${t(r)}`}function a(e,n="#000000"){const r=K(e);return r?B(r):n}function F(e,n,r){const t=K(e),o=K(n);if(!t&&!o)return"#000000";if(!t)return B(o);if(!o)return B(t);const c=Math.max(0,Math.min(1,r));return B({r:t.r+(o.r-t.r)*c,g:t.g+(o.g-t.g)*c,b:t.b+(o.b-t.b)*c})}const Ge="#ffffff",We="#000000";function me(e,n){return F(e,Ge,n)}function qe(e,n){return F(e,We,n)}function Ue(e,n,r){return n==="dark"?me(e,r):qe(e,r)}function C(e,n){return`${a(e)}${n}`}function Xe(){if(typeof document>"u")return Y;const e=getComputedStyle(document.documentElement),n=(t,o)=>e.getPropertyValue(t).trim()||o,r=Y;return{surface:n("--color-surface",r.surface),surfaceAlt:n("--color-surface-alt",r.surfaceAlt),surfaceElevated:n("--color-surface-elevated",r.surfaceElevated),brand:n("--color-brand",r.brand),brandHover:n("--color-brand-hover",r.brandHover),content:n("--color-content",r.content),contentSecondary:n("--color-content-secondary",r.contentSecondary),border:n("--color-border",r.border),input:n("--color-input",r.input),inputBorder:n("--color-input-border",r.inputBorder),success:n("--color-success",r.success),error:n("--color-error",r.error),warning:n("--color-warning",r.warning),info:n("--color-info",r.info),syntaxKeyword:n("--color-syntax-keyword",r.syntaxKeyword),syntaxString:n("--color-syntax-string",r.syntaxString),syntaxFunction:n("--color-syntax-function",r.syntaxFunction),syntaxComment:n("--color-syntax-comment",r.syntaxComment),syntaxNumber:n("--color-syntax-number",r.syntaxNumber),syntaxType:n("--color-syntax-type",r.syntaxType)}}function Ye(){return typeof document>"u"?"dark":document.body.classList.contains("light")?"light":"dark"}function je(){return typeof document>"u"?"":document.documentElement.getAttribute("data-app-theme")??""}function Je(e,n){const r=a(e.syntaxKeyword),t=a(e.syntaxString),o=a(e.syntaxFunction),c=a(e.syntaxComment),s=a(e.syntaxNumber),u=a(e.syntaxType),i=a(e.content),d=a(e.brand),l=a(e.error),m=[{token:"",foreground:i.slice(1)},{token:"comment",foreground:c.slice(1),fontStyle:"italic"},{token:"comment.quote",foreground:c.slice(1),fontStyle:"italic"},{token:"keyword",foreground:r.slice(1)},{token:"keyword.sql",foreground:r.slice(1)},{token:"operator",foreground:r.slice(1)},{token:"operator.sql",foreground:r.slice(1)},{token:"string",foreground:t.slice(1)},{token:"string.sql",foreground:t.slice(1)},{token:"string.escape",foreground:r.slice(1)},{token:"number",foreground:s.slice(1)},{token:"number.float",foreground:s.slice(1)},{token:"number.hex",foreground:s.slice(1)},{token:"constant",foreground:s.slice(1)},{token:"type",foreground:u.slice(1)},{token:"type.identifier",foreground:u.slice(1)},{token:"predefined",foreground:o.slice(1)},{token:"predefined.sql",foreground:o.slice(1)},{token:"function",foreground:o.slice(1)},{token:"identifier",foreground:i.slice(1)},{token:"identifier.quote",foreground:t.slice(1)},{token:"variable",foreground:i.slice(1)},{token:"delimiter",foreground:i.slice(1)},{token:"tag",foreground:r.slice(1)},{token:"attribute.name",foreground:o.slice(1)},{token:"attribute.value",foreground:t.slice(1)},{token:"annotation",foreground:e.warning.replace(/^#/,"")},{token:"regexp",foreground:l.slice(1)}],f=a(e.surfaceAlt),g=a(e.surface),h=a(e.surfaceElevated),_={"editor.background":f,"editor.foreground":i,"editorLineNumber.foreground":a(e.contentSecondary),"editorLineNumber.activeForeground":i,"editorCursor.foreground":d,"editor.selectionBackground":F(g,d,.32),"editor.inactiveSelectionBackground":F(g,d,.18),"editor.lineHighlightBackground":F(f,g,.55),"editorWidget.background":h,"editorWidget.foreground":i,"editorWidget.border":a(e.border),"editorWidget.resizeBorder":d,"input.background":a(e.input),"input.foreground":i,"input.border":a(e.inputBorder),"input.placeholderForeground":a(e.contentSecondary),"inputOption.activeBackground":C(d,"40"),"inputOption.activeBorder":d,"inputOption.activeForeground":i,focusBorder:d,"editor.findMatchBackground":C(a(e.warning),"80"),"editor.findMatchHighlightBackground":C(a(e.warning),"40"),"editor.findRangeHighlightBackground":C(h,"60")};return{base:n==="dark"?"vs-dark":"vs",inherit:!0,rules:m,colors:_}}function ze(e,n){const r=a(e.surface),t=a(e.surfaceElevated),o=a(e.content),c=a(e.contentSecondary),s=a(e.brand),u=a(e.error),i=a(e.success),d=a(e.warning),l=a(e.info),m=a(e.syntaxKeyword),f=h=>Ue(h,n,.22),g={black:t,red:u,green:i,yellow:d,blue:s,magenta:m,cyan:l,white:c,brightBlack:F(t,o,.4),brightRed:f(u),brightGreen:f(i),brightYellow:f(d),brightBlue:f(s),brightMagenta:f(m),brightCyan:f(l),brightWhite:n==="dark"?me(o,.25):o};return{background:r,foreground:o,cursor:s,selectionBackground:F(t,s,.2),...g}}exports.DEFAULT_THEME_ID=S;exports.INK_ROLE_KEYS=Le;exports.LEGACY_THEME_IDS=Q;exports.MAX_TEXT_TINT_ALPHA=Ie;exports.OKABE_ITO_DIFF=H;exports.TEXT_ROLE_KEYS=_e;exports.ThemeProvider=Re;exports.UNIQUE_ACCENT=ue;exports.WELD_BG=te;exports.WELD_SURFACE=re;exports.accessibleFillSurface=E;exports.accessibleInputBorder=ce;exports.accessibleOnFillInk=ae;exports.accessibleTextColor=ie;exports.applyAppTheme=le;exports.derivePaletteProperties=fe;exports.generateMonacoThemeFromPalette=Je;exports.generateTerminalPaletteFromPalette=ze;exports.getThemeById=w;exports.getThemeOptions=ne;exports.getThemes=De;exports.isColorVisionSafeActive=Ne;exports.isKnownThemeId=Fe;exports.readActiveAppPalette=Xe;exports.readActiveAppThemeId=je;exports.readActiveAppThemeType=Ye;exports.registerThemeSource=he;exports.resolveThemeOption=V;exports.textGroundsFor=se;exports.themeOptions=x;exports.toColorVisionSafePalette=de;exports.useTheme=Ve;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const J=require("solid-js/web"),y=require("solid-js"),z=require("./bugIndicatingError-D2X5Hfgg.cjs"),x=[{id:"vokril-dark",label:"Vokril Dark",type:"dark",palette:{surface:"#212329",surfaceAlt:"#181A1F",surfaceElevated:"#2D2F35",brand:"#808AE5",brandHover:"#707AD0",content:"#EBEDF0",contentSecondary:"#C7C9CE",border:"#2D2F35",input:"#181A1F",inputBorder:"#2D2F35",success:"#4FB772",error:"#E05D5A",warning:"#F0A945",info:"#55A8DB",syntaxKeyword:"#BC97E8",syntaxString:"#92C487",syntaxFunction:"#F0C77C",syntaxNumber:"#6FBCE3",syntaxType:"#76CDC5",syntaxComment:"#8F939F"}},{id:"light",label:"Vokril Light",type:"light",palette:{surface:"#FFFFFF",surfaceAlt:"#F3F4F8",surfaceElevated:"#FFFFFF",brand:"#5355D0",brandHover:"#4545B6",content:"#1C1E24",contentSecondary:"#5F636F",border:"#DFE1E7",input:"#FFFFFF",inputBorder:"#D0D2D9",success:"#048A45",error:"#C72C34",warning:"#C27400",info:"#007AB0",syntaxKeyword:"#7D3AB7",syntaxString:"#357426",syntaxFunction:"#895709",syntaxNumber:"#006A9D",syntaxType:"#007973",syntaxComment:"#696D79"}},{id:"high-contrast-dark",label:"High Contrast Dark",type:"dark",palette:{surface:"#000000",surfaceAlt:"#000000",surfaceElevated:"#121212",brand:"#66B2FF",brandHover:"#99CCFF",content:"#FFFFFF",contentSecondary:"#E6E6E6",border:"#FFFFFF",input:"#000000",inputBorder:"#FFFFFF",success:"#57E389",error:"#FF7B72",warning:"#F0B429",info:"#66B2FF",syntaxKeyword:"#FF9999",syntaxString:"#99E699",syntaxFunction:"#FFE066",syntaxNumber:"#99CCFF",syntaxType:"#FFCC80",syntaxComment:"#B0B0B0"}},{id:"high-contrast-light",label:"High Contrast Light",type:"light",palette:{surface:"#FFFFFF",surfaceAlt:"#FFFFFF",surfaceElevated:"#FFFFFF",brand:"#0047BA",brandHover:"#003080",content:"#000000",contentSecondary:"#262626",border:"#000000",input:"#FFFFFF",inputBorder:"#000000",success:"#006622",error:"#B30000",warning:"#8C4600",info:"#0047BA",syntaxKeyword:"#8C0000",syntaxString:"#005C1F",syntaxFunction:"#4D2600",syntaxNumber:"#0047BA",syntaxType:"#0047BA",syntaxComment:"#404040"}}],S="vokril-dark",Q={darcula:"vokril-dark"},Z=e=>Q[e]??e,A=[];function he(e){return A.push(e),{dispose:()=>{const n=A.indexOf(e);n!==-1&&A.splice(n,1)}}}function ee(e){for(const n of A){const r=n.byId(e);if(r!==null)return r}return null}function w(e){const n=Z(e);return x.find(r=>r.id===n)??ee(n)??x[0]}function ne(){return[...x,...A.flatMap(e=>e.options())]}function Fe(e){const n=Z(e);return x.some(r=>r.id===n)||ee(n)!==null}const I=4.5,xe=3;function ke(e){const n=e.trim().replace(/^#/,""),r=n.length===3?n.split("").map(t=>t+t).join(""):n;return r.length!==6||/[^0-9a-fA-F]/.test(r)?null:{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function pe({r:e,g:n,b:r}){const t=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return`#${t(e)}${t(n)}${t(r)}`}function N(e){const n=ke(e);if(!n)throw new z.BugIndicatingError(`contrast: expected #rgb/#rrggbb, got ${JSON.stringify(e)}. Resolve var()/transparent/color-mix to a literal hex before measuring.`);return n}function M(e){const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function v(e){const{r:n,g:r,b:t}=N(e);return .2126*M(n)+.7152*M(r)+.0722*M(t)}function b(e,n){const r=v(e),t=v(n),[o,c]=r>t?[r,t]:[t,r];return(o+.05)/(c+.05)}function Te(e,n,r){const t=N(e),o=N(n),c=Math.max(0,Math.min(1,r));return pe({r:t.r+(o.r-t.r)*(1-c),g:t.g+(o.g-t.g)*(1-c),b:t.b+(o.b-t.b)*(1-c)})}function p(e,n){return e+1e-9>=n}function Ee(e){const n=v(e);return 116*(n>(6/29)**3?Math.cbrt(n):n/(3*(6/29)**2)+4/29)-16}const L=e=>{const n=e/255;return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)},Ae=e=>(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)*255;function Se(e){const n=e.trim().replace(/^#/,""),r=n.length===3?n.split("").map(t=>t+t).join(""):n;if(r.length!==6||/[^0-9a-fA-F]/.test(r))throw new z.BugIndicatingError(`oklch: expected #rgb/#rrggbb, got ${JSON.stringify(e)}`);return{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function ve(e){const{r:n,g:r,b:t}=Se(e),o=L(n),c=L(r),s=L(t),u=Math.cbrt(.4122214708*o+.5363325363*c+.0514459929*s),i=Math.cbrt(.2119034982*o+.6806995451*c+.1073969566*s),d=Math.cbrt(.0883024619*o+.2817188376*c+.6299787005*s),l=.2104542553*u+.793617785*i-.0040720468*d,m=1.9779984951*u-2.428592205*i+.4505937099*d,f=.0259040371*u+.7827717662*i-.808675766*d,g=Math.atan2(f,m)*180/Math.PI;return{l,c:Math.hypot(m,f),h:g<0?g+360:g}}function D({l:e,c:n,h:r}){const t=r*Math.PI/180,o=n*Math.cos(t),c=n*Math.sin(t),s=(e+.3963377774*o+.2158037573*c)**3,u=(e-.1055613458*o-.0638541728*c)**3,i=(e-.0894841775*o-1.291485548*c)**3;return{r:4.0767416621*s-3.3077115913*u+.2309699292*i,g:-1.2684380046*s+2.6097574011*u-.3413193965*i,b:-.0041960863*s-.7034186147*u+1.707614701*i}}const k=1e-4,W=({r:e,g:n,b:r})=>e>=-k&&e<=1+k&&n>=-k&&n<=1+k&&r>=-k&&r<=1+k;function Ce({l:e,c:n,h:r}){if(W(D({l:e,c:n,h:r})))return n;let t=0,o=n;for(let c=0;c<24;c++){const s=(t+o)/2;W(D({l:e,c:s,h:r}))?t=s:o=s}return t}function O(e){const n=Ce(e),r=D({...e,c:n}),t=o=>Math.max(0,Math.min(255,Math.round(Ae(o)))).toString(16).padStart(2,"0");return`#${t(r.r)}${t(r.g)}${t(r.b)}`}function q(e,n,r,t){const o=ve(e),c=t==="lighter"?1:0,s=O({...o,l:c});if(!p(b(s,n),r))return s;let u=o.l,i=c;for(let d=0;d<24;d++){const l=(u+i)/2;p(b(O({...o,l}),n),r)?i=l:u=l}return O({...o,l:i})}function R(e,n,r){if(p(b(e,n),r))return e;const t=v(e)<v(n),o=q(e,n,r,t?"darker":"lighter");if(p(b(o,n),r))return o;const c=q(e,n,r,t?"lighter":"darker");return b(c,n)>b(o,n)?c:o}function we(e,n,r){let t=e;for(let o=0;o<8;o++){let c=!1;for(const s of n){const u=R(t,s,r);u!==t&&(t=u,c=!0)}if(!c)break}return t}function Be(e,n,r){let t=n[0]??"#ffffff",o=-1;for(const c of n){const s=b(c,e);if(p(s,r))return c;s>o&&(o=s,t=c)}return t}const re="#2A2C31",te="#1C1E23",oe=.25,Ie=oe;function ce(e){return R(e.inputBorder,e.input,xe)}function se(e,n,r){const t=[n.surface,n.surfaceAlt,n.surfaceElevated];return r==="dark"&&t.push(re,te),t.flatMap(o=>[o,Te(e,o,oe)])}function ie(e,n,r){return we(e,se(e,n,r),I)}const _e=["error","brand","success","warning","info"],Me=60;function E(e){return p(b("#ffffff",e),I)||Ee(e)>=Me?e:R(e,"#ffffff",I)}function ae(e,n){return Be(e,["#ffffff",n.surfaceAlt,"#000000"],I)}const Le=["brand","error","success","warning"],ue="#D76CB7",Oe="data-colorblind-safe",P={success:"#009e73",error:"#d55e00",warning:"#e69f00",info:"#56b4e9"},H={added:P.success,deleted:P.error};function de(e){return{...e,...P}}function Ne(){return typeof document>"u"?!1:document.documentElement.hasAttribute(Oe)}function fe(e,n,r){const t=d=>ie(d,e,n),o=E(e.brand),c=E(e.error),s=E(e.success),u=E(e.warning),i=d=>ae(d,e);return{"--color-surface":e.surface,"--color-surface-alt":e.surfaceAlt,"--color-surface-elevated":e.surfaceElevated,"--color-brand":e.brand,"--color-brand-hover":e.brandHover,"--color-content":e.content,"--color-content-secondary":e.contentSecondary,"--color-border":e.border,"--color-input":e.input,"--color-input-border":ce(e),"--color-success":e.success,"--color-error":e.error,"--color-warning":e.warning,"--color-info":e.info,"--color-success-text":t(e.success),"--color-error-text":t(e.error),"--color-warning-text":t(e.warning),"--color-info-text":t(e.info),"--color-brand-text":t(e.brand),"--color-unique-text":t(ue),"--color-brand-surface":o,"--color-error-surface":c,"--color-success-surface":s,"--color-warning-surface":u,"--color-on-brand":i(o),"--color-on-error":i(c),"--color-on-success":i(s),"--color-on-warning":i(u),"--color-diff-added":r?H.added:"","--color-diff-deleted":r?H.deleted:"","--color-syntax-keyword":e.syntaxKeyword,"--color-syntax-string":e.syntaxString,"--color-syntax-function":e.syntaxFunction,"--color-syntax-comment":e.syntaxComment,"--color-syntax-number":e.syntaxNumber,"--color-syntax-type":e.syntaxType}}const U="data-colorblind-safe";function V(e,n=!1){return w(e==="system"?n?"light":S:e==="dark"?S:e)}function le(e,n={}){var u,i;const r=typeof e=="string"?V(e):e,t=n.document??(typeof document<"u"?document:void 0);if(!t)return r;const o=t.documentElement,c=n.colorVisionSafe??!1;c?o.setAttribute(U,""):o.removeAttribute(U);const s=c?de(r.palette):r.palette;for(const[d,l]of Object.entries(fe(s,r.type,c)))o.style.setProperty(d,l);return(u=t.body)==null||u.classList.remove("light","dark"),(i=t.body)==null||i.classList.add(r.type),o.classList.remove("light","dark"),o.classList.add(r.type),o.style.colorScheme=r.type,o.setAttribute("data-app-theme",r.id),r}function De(){return ne()}const Pe="vokril-ui-theme",He="(prefers-color-scheme: light)";function Ke(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}const ge=y.createContext(),Re=e=>{var $,G;const n=e.storageKey===void 0?Pe:e.storageKey,r=e.storage===void 0?Ke():e.storage,t=()=>{if(!r||!n)return null;try{return r.getItem(n)}catch{return null}},o=(($=e.document)==null?void 0:$.defaultView)??(typeof window>"u"?void 0:window),c=(G=o==null?void 0:o.matchMedia)==null?void 0:G.call(o,He),[s,u]=y.createSignal(t()??e.defaultTheme??"dark"),[i,d]=y.createSignal((c==null?void 0:c.matches)??!1),[l,m]=y.createSignal(e.colorVisionSafe??!1);if(c){const T=be=>d(be.matches);c.addEventListener("change",T),y.onCleanup(()=>c.removeEventListener("change",T))}const f=y.createMemo(()=>V(s(),i())),g=y.createMemo(()=>f().type),h=T=>{if(u(T),!(!r||!n))try{r.setItem(n,T)}catch{}},_=()=>h(g()==="dark"?"light":"dark");y.createEffect(()=>{le(f(),{colorVisionSafe:l(),document:e.document})});const ye={theme:s,resolvedTheme:g,themeId:()=>f().id,setTheme:h,toggleTheme:_,colorVisionSafe:l,setColorVisionSafe:m};return J.createComponent(ge.Provider,{value:ye,get children(){return e.children}})};let X=!1;function Ve(){const e=y.useContext(ge);return e||(J.isDev&&!X&&(X=!0,console.warn("@vokril/ui-solid: useTheme() was called outside <ThemeProvider>; it reports Vokril Dark and ignores setTheme.")),{theme:()=>"dark",resolvedTheme:()=>"dark",themeId:()=>S,setTheme:()=>{},toggleTheme:()=>{},colorVisionSafe:()=>!1,setColorVisionSafe:()=>{}})}var j;const Y=((j=x.find(e=>e.id===S))==null?void 0:j.palette)??x[0].palette;function $e(e){return Math.max(0,Math.min(255,Math.round(e)))}function K(e){const n=e.trim().replace(/^#/,""),r=n.length===3?n.split("").map(t=>t+t).join(""):n;return r.length!==6||/[^0-9a-fA-F]/.test(r)?null:{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function B({r:e,g:n,b:r}){const t=o=>$e(o).toString(16).padStart(2,"0");return`#${t(e)}${t(n)}${t(r)}`}function a(e,n="#000000"){const r=K(e);return r?B(r):n}function F(e,n,r){const t=K(e),o=K(n);if(!t&&!o)return"#000000";if(!t)return B(o);if(!o)return B(t);const c=Math.max(0,Math.min(1,r));return B({r:t.r+(o.r-t.r)*c,g:t.g+(o.g-t.g)*c,b:t.b+(o.b-t.b)*c})}const Ge="#ffffff",We="#000000";function me(e,n){return F(e,Ge,n)}function qe(e,n){return F(e,We,n)}function Ue(e,n,r){return n==="dark"?me(e,r):qe(e,r)}function C(e,n){return`${a(e)}${n}`}function Xe(){if(typeof document>"u")return Y;const e=getComputedStyle(document.documentElement),n=(t,o)=>e.getPropertyValue(t).trim()||o,r=Y;return{surface:n("--color-surface",r.surface),surfaceAlt:n("--color-surface-alt",r.surfaceAlt),surfaceElevated:n("--color-surface-elevated",r.surfaceElevated),brand:n("--color-brand",r.brand),brandHover:n("--color-brand-hover",r.brandHover),content:n("--color-content",r.content),contentSecondary:n("--color-content-secondary",r.contentSecondary),border:n("--color-border",r.border),input:n("--color-input",r.input),inputBorder:n("--color-input-border",r.inputBorder),success:n("--color-success",r.success),error:n("--color-error",r.error),warning:n("--color-warning",r.warning),info:n("--color-info",r.info),syntaxKeyword:n("--color-syntax-keyword",r.syntaxKeyword),syntaxString:n("--color-syntax-string",r.syntaxString),syntaxFunction:n("--color-syntax-function",r.syntaxFunction),syntaxComment:n("--color-syntax-comment",r.syntaxComment),syntaxNumber:n("--color-syntax-number",r.syntaxNumber),syntaxType:n("--color-syntax-type",r.syntaxType)}}function Ye(){return typeof document>"u"?"dark":document.body.classList.contains("light")?"light":"dark"}function je(){return typeof document>"u"?"":document.documentElement.getAttribute("data-app-theme")??""}function Je(e,n){const r=a(e.syntaxKeyword),t=a(e.syntaxString),o=a(e.syntaxFunction),c=a(e.syntaxComment),s=a(e.syntaxNumber),u=a(e.syntaxType),i=a(e.content),d=a(e.brand),l=a(e.error),m=[{token:"",foreground:i.slice(1)},{token:"comment",foreground:c.slice(1),fontStyle:"italic"},{token:"comment.quote",foreground:c.slice(1),fontStyle:"italic"},{token:"keyword",foreground:r.slice(1)},{token:"keyword.sql",foreground:r.slice(1)},{token:"operator",foreground:r.slice(1)},{token:"operator.sql",foreground:r.slice(1)},{token:"string",foreground:t.slice(1)},{token:"string.sql",foreground:t.slice(1)},{token:"string.escape",foreground:r.slice(1)},{token:"number",foreground:s.slice(1)},{token:"number.float",foreground:s.slice(1)},{token:"number.hex",foreground:s.slice(1)},{token:"constant",foreground:s.slice(1)},{token:"type",foreground:u.slice(1)},{token:"type.identifier",foreground:u.slice(1)},{token:"predefined",foreground:o.slice(1)},{token:"predefined.sql",foreground:o.slice(1)},{token:"function",foreground:o.slice(1)},{token:"identifier",foreground:i.slice(1)},{token:"identifier.quote",foreground:t.slice(1)},{token:"variable",foreground:i.slice(1)},{token:"delimiter",foreground:i.slice(1)},{token:"tag",foreground:r.slice(1)},{token:"attribute.name",foreground:o.slice(1)},{token:"attribute.value",foreground:t.slice(1)},{token:"annotation",foreground:e.warning.replace(/^#/,"")},{token:"regexp",foreground:l.slice(1)}],f=a(e.surfaceAlt),g=a(e.surface),h=a(e.surfaceElevated),_={"editor.background":f,"editor.foreground":i,"editorLineNumber.foreground":a(e.contentSecondary),"editorLineNumber.activeForeground":i,"editorCursor.foreground":d,"editor.selectionBackground":F(g,d,.32),"editor.inactiveSelectionBackground":F(g,d,.18),"editor.lineHighlightBackground":F(f,g,.55),"editorWidget.background":h,"editorWidget.foreground":i,"editorWidget.border":a(e.border),"editorWidget.resizeBorder":d,"input.background":a(e.input),"input.foreground":i,"input.border":a(e.inputBorder),"input.placeholderForeground":a(e.contentSecondary),"inputOption.activeBackground":C(d,"40"),"inputOption.activeBorder":d,"inputOption.activeForeground":i,focusBorder:d,"editor.findMatchBackground":C(a(e.warning),"80"),"editor.findMatchHighlightBackground":C(a(e.warning),"40"),"editor.findRangeHighlightBackground":C(h,"60")};return{base:n==="dark"?"vs-dark":"vs",inherit:!0,rules:m,colors:_}}function ze(e,n){const r=a(e.surface),t=a(e.surfaceElevated),o=a(e.content),c=a(e.contentSecondary),s=a(e.brand),u=a(e.error),i=a(e.success),d=a(e.warning),l=a(e.info),m=a(e.syntaxKeyword),f=h=>Ue(h,n,.22),g={black:t,red:u,green:i,yellow:d,blue:s,magenta:m,cyan:l,white:c,brightBlack:F(t,o,.4),brightRed:f(u),brightGreen:f(i),brightYellow:f(d),brightBlue:f(s),brightMagenta:f(m),brightCyan:f(l),brightWhite:n==="dark"?me(o,.25):o};return{background:r,foreground:o,cursor:s,selectionBackground:F(t,s,.2),...g}}exports.DEFAULT_THEME_ID=S;exports.INK_ROLE_KEYS=Le;exports.LEGACY_THEME_IDS=Q;exports.MAX_TEXT_TINT_ALPHA=Ie;exports.OKABE_ITO_DIFF=H;exports.TEXT_ROLE_KEYS=_e;exports.ThemeProvider=Re;exports.UNIQUE_ACCENT=ue;exports.WELD_BG=te;exports.WELD_SURFACE=re;exports.accessibleFillSurface=E;exports.accessibleInputBorder=ce;exports.accessibleOnFillInk=ae;exports.accessibleTextColor=ie;exports.applyAppTheme=le;exports.derivePaletteProperties=fe;exports.generateMonacoThemeFromPalette=Je;exports.generateTerminalPaletteFromPalette=ze;exports.getThemeById=w;exports.getThemeOptions=ne;exports.getThemes=De;exports.isColorVisionSafeActive=Ne;exports.isKnownThemeId=Fe;exports.readActiveAppPalette=Xe;exports.readActiveAppThemeId=je;exports.readActiveAppThemeType=Ye;exports.registerThemeSource=he;exports.resolveThemeOption=V;exports.textGroundsFor=se;exports.themeOptions=x;exports.toColorVisionSafePalette=de;exports.useTheme=Ve;
|