soltana-ui 0.1.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/README.md +158 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +7 -0
- package/dist/config/register.d.ts +27 -0
- package/dist/config/stylesheet.d.ts +13 -0
- package/dist/config/types.d.ts +177 -0
- package/dist/config/types.js +7 -0
- package/dist/config/validation.d.ts +29 -0
- package/dist/config/validation.js +59 -0
- package/dist/enhancers/accordion.d.ts +19 -0
- package/dist/enhancers/carousel.d.ts +21 -0
- package/dist/enhancers/collapsible.d.ts +14 -0
- package/dist/enhancers/color-picker.d.ts +20 -0
- package/dist/enhancers/combobox.d.ts +17 -0
- package/dist/enhancers/context-menu.d.ts +19 -0
- package/dist/enhancers/date-picker.d.ts +8 -0
- package/dist/enhancers/drawer.d.ts +11 -0
- package/dist/enhancers/dropdown.d.ts +17 -0
- package/dist/enhancers/hover-card.d.ts +15 -0
- package/dist/enhancers/index.d.ts +42 -0
- package/dist/enhancers/modal.d.ts +16 -0
- package/dist/enhancers/scroll-area.d.ts +14 -0
- package/dist/enhancers/tabs.d.ts +26 -0
- package/dist/enhancers/test-helpers.d.ts +20 -0
- package/dist/enhancers/test-utils.d.ts +10 -0
- package/dist/enhancers/toast.d.ts +24 -0
- package/dist/enhancers/tooltip.d.ts +15 -0
- package/dist/enhancers/tree.d.ts +24 -0
- package/dist/enhancers/utils/click-away.d.ts +7 -0
- package/dist/enhancers/utils/create-overlay-enhancer.d.ts +14 -0
- package/dist/enhancers/utils/focus-trap.d.ts +9 -0
- package/dist/enhancers/utils/generate-id.d.ts +6 -0
- package/dist/enhancers/utils/keyboard-nav.d.ts +21 -0
- package/dist/enhancers/utils/position.d.ts +30 -0
- package/dist/fonts/index.d.ts +20 -0
- package/dist/index.d.ts +9 -0
- package/dist/init.d.ts +16 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/postcss-soltana-treeshake.d.ts +10 -0
- package/dist/plugins/postcss-soltana-treeshake.js +149 -0
- package/dist/plugins/types.d.ts +9 -0
- package/dist/plugins/types.js +4 -0
- package/dist/soltana-ui.css +1 -0
- package/dist/soltana-ui.js +1702 -0
- package/dist/soltana-ui.umd.cjs +1 -0
- package/package.json +90 -0
- package/src/styles/_variables.scss +348 -0
- package/src/styles/base/_accessibility.scss +146 -0
- package/src/styles/base/_index.scss +12 -0
- package/src/styles/base/_register.scss +84 -0
- package/src/styles/base/_relief-system.scss +53 -0
- package/src/styles/base/_scrollbar.scss +40 -0
- package/src/styles/base/_transitions.scss +75 -0
- package/src/styles/base/_typography.scss +442 -0
- package/src/styles/components/_alert-dialogs.scss +75 -0
- package/src/styles/components/_badges.scss +215 -0
- package/src/styles/components/_buttons.scss +293 -0
- package/src/styles/components/_callouts.scss +99 -0
- package/src/styles/components/_cards.scss +97 -0
- package/src/styles/components/_carousels.scss +108 -0
- package/src/styles/components/_closes.scss +63 -0
- package/src/styles/components/_code.scss +75 -0
- package/src/styles/components/_collapsibles.scss +61 -0
- package/src/styles/components/_color-pickers.scss +211 -0
- package/src/styles/components/_comboboxes.scss +88 -0
- package/src/styles/components/_context-menus.scss +82 -0
- package/src/styles/components/_date-pickers.scss +165 -0
- package/src/styles/components/_feedback.scss +354 -0
- package/src/styles/components/_figures.scss +52 -0
- package/src/styles/components/_heros.scss +83 -0
- package/src/styles/components/_hover-cards.scss +55 -0
- package/src/styles/components/_images.scss +71 -0
- package/src/styles/components/_index.scss +41 -0
- package/src/styles/components/_indicators.scss +403 -0
- package/src/styles/components/_inputs.scss +409 -0
- package/src/styles/components/_layouts.scss +139 -0
- package/src/styles/components/_lists.scss +135 -0
- package/src/styles/components/_menus.scss +195 -0
- package/src/styles/components/_navigation.scss +325 -0
- package/src/styles/components/_overlays.scss +233 -0
- package/src/styles/components/_scroll-areas.scss +53 -0
- package/src/styles/components/_segmented-controls.scss +75 -0
- package/src/styles/components/_tables.scss +137 -0
- package/src/styles/components/_toasts.scss +111 -0
- package/src/styles/components/_toggles.scss +57 -0
- package/src/styles/components/_trees.scss +123 -0
- package/src/styles/decorative/_classical.scss +196 -0
- package/src/styles/decorative/_index.scss +7 -0
- package/src/styles/finishes/_index.scss +55 -0
- package/src/styles/index.scss +30 -0
- package/src/styles/reliefs/_index.scss +66 -0
- package/src/styles/reliefs/_neumorphic-tables.scss +92 -0
- package/src/styles/themes/_dark.scss +130 -0
- package/src/styles/themes/_index.scss +3 -0
- package/src/styles/themes/_light.scss +122 -0
- package/src/styles/themes/_sepia.scss +121 -0
- package/src/styles/utilities/_index.scss +13 -0
- package/src/styles/utilities/_layout.scss +100 -0
- package/src/styles/utilities/_mixins.scss +410 -0
- package/src/styles/utilities/_responsive.scss +46 -0
- package/src/styles/utilities/_sizing.scss +62 -0
- package/src/styles/utilities/_spacing.scss +12 -0
- package/src/styles/utilities/_visual.scss +436 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(b,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(b=typeof globalThis<"u"?globalThis:b||self,_(b.SoltanaUI={}))})(this,(function(b){"use strict";const _=["dark","light","sepia"],pe=["flat","glassmorphic","skeuomorphic","neumorphic"],ge=["matte","frosted","tinted","glossy"],Ee=[..._,"auto"],ye=[...pe],Ae=[...ge],Se={theme:Ee,relief:ye,finish:Ae};function Le(e,t){const s=Se[e];s.includes(t)||s.push(t)}function ke(e,t){const s=Se[e],r=s.indexOf(t);r!==-1&&s.splice(r,1)}const oe=Ee,ie=ye,se=Ae,we='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ce(e,t){const s=Array.from(new Set(e.querySelectorAll(we)));if(s.length===0)return;const r=s[0],n=s[s.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),n.focus()):!t.shiftKey&&document.activeElement===n&&(t.preventDefault(),r.focus())}function Te(e){let t=null,s=0;function r(o){o.classList.contains("active")||(o.classList.add("active"),e.childElementsToActivate.forEach(i=>{o.querySelector(i)?.classList.add("active")}),o.setAttribute("aria-hidden","false"),s++,document.body.classList.add(e.bodyOpenClass),requestAnimationFrame(()=>{const i=o.querySelector(e.contentSelector);(i?.querySelector(we)??i)?.focus()}))}function n(o){o.classList.remove("active"),e.childElementsToActivate.forEach(i=>{o.querySelector(i)?.classList.remove("active")}),o.setAttribute("aria-hidden","true"),s=Math.max(0,s-1),s===0&&document.body.classList.remove(e.bodyOpenClass)}return function(i){t?.abort(),t=new AbortController,s=0,document.body.classList.remove(e.bodyOpenClass);const{signal:c}=t,l=i?.root??document,d=`[${e.openTriggerAttr}]`,a=`[${e.closeTriggerAttr}]`;return l.querySelectorAll(i?.selector??d).forEach(u=>{u.addEventListener("click",()=>{const f=u.getAttribute(e.openTriggerAttr);if(!f)return;const m=document.getElementById(f);m?.hasAttribute(e.overlaySelector.slice(1,-1))&&r(m)},{signal:c})}),l.querySelectorAll(e.overlaySelector).forEach(u=>{e.setupAria?.(u),u.querySelectorAll(a).forEach(m=>{m.addEventListener("click",()=>{n(u)},{signal:c})});const f=e.checkOverlayAsBackdrop&&u.matches(e.backdropSelector)?u:u.querySelector(e.backdropSelector);f?.addEventListener("click",m=>{m.target===f&&n(u)},{signal:c}),u.addEventListener("keydown",m=>{if(m.key==="Escape"){n(u);return}if(m.key==="Tab"){const h=u.querySelector(e.contentSelector);h&&Ce(h,m)}},{signal:c})}),{destroy(){t?.abort(),t=null,s=0,document.body.classList.remove(e.bodyOpenClass)}}}}const Oe="[data-sol-modal]",$t="[data-modal-open]",_e=Te({overlaySelector:Oe,openTriggerAttr:"data-modal-open",closeTriggerAttr:"data-modal-close",bodyOpenClass:"sol-modal-open",contentSelector:".modal__content, .modal",childElementsToActivate:[".modal"],checkOverlayAsBackdrop:!0,backdropSelector:".modal-backdrop"});function D(){return Math.random().toString(36).slice(2,7)}const Re="[data-sol-tabs]";let $=null;function ce(e,t){const s=e.querySelectorAll('[role="tab"]'),r=e.querySelectorAll('[role="tabpanel"]');s.forEach((n,o)=>{const i=o===t;n.setAttribute("aria-selected",String(i)),n.setAttribute("tabindex",i?"0":"-1"),n.classList.toggle("active",i)}),r.forEach((n,o)=>{const i=o===t;n.hidden=!i,n.classList.toggle("active",i)})}function De(e){const t=e.querySelectorAll('[role="tab"]');for(let s=0;s<t.length;s++)if(t[s].getAttribute("aria-selected")==="true")return s;return 0}function $e(e){$?.abort(),$=new AbortController;const{signal:t}=$;return(e?.root??document).querySelectorAll(e?.selector??Re).forEach(r=>{const n=r.querySelectorAll('[role="tab"]'),o=n.length;if(o===0)return;const i=r.id||`sol-tabs-${D()}`,c=r.querySelectorAll('[role="tabpanel"]');n.forEach((d,a)=>{const u=`${i}-tab-${String(a)}`,f=`${i}-panel-${String(a)}`;d.id=u,d.setAttribute("aria-controls",f);const m=c[a];m&&(m.id=f,m.setAttribute("aria-labelledby",u))}),ce(r,De(r)),n.forEach((d,a)=>{d.addEventListener("click",()=>{ce(r,a),d.focus()},{signal:t})}),r.querySelector('[role="tablist"]')?.addEventListener("keydown",d=>{const a=De(r);let u=a;switch(d.key){case"ArrowRight":case"ArrowDown":d.preventDefault(),u=(a+1)%o;break;case"ArrowLeft":case"ArrowUp":d.preventDefault(),u=(a-1+o)%o;break;case"Home":d.preventDefault(),u=0;break;case"End":d.preventDefault(),u=o-1;break;default:return}ce(r,u),n[u].focus()},{signal:t})}),{destroy(){$?.abort(),$=null}}}const qe={top:"bottom",bottom:"top",left:"right",right:"left"};function qt(e){return e instanceof HTMLElement?e.getBoundingClientRect():{top:e.y,bottom:e.y,left:e.x,right:e.x,width:0,height:0}}function xe(e,t,s,r){let n=0,o=0;switch(s){case"top":n=e.top-t.height-r,o=e.left+e.width/2-t.width/2;break;case"bottom":n=e.bottom+r,o=e.left+e.width/2-t.width/2;break;case"left":n=e.top+e.height/2-t.height/2,o=e.left-t.width-r;break;case"right":n=e.top+e.height/2-t.height/2,o=e.right+r;break}return{top:n,left:o}}function Ie(e,t,s,r){switch(s){case"top":return e.top<r;case"bottom":return e.top+t.height>window.innerHeight-r;case"left":return e.left<r;case"right":return e.left+t.width>window.innerWidth-r}}function le(e){const{anchor:t,floating:s,placement:r,gap:n=8,viewportPadding:o=4,flip:i=!0}=e,c=qt(t),l=s.getBoundingClientRect();let d=xe(c,l,r,n);if(i&&Ie(d,l,r,o)){const a=xe(c,l,qe[r],n);Ie(a,l,qe[r],o)||(d=a)}return d.left=Math.max(o,Math.min(d.left,window.innerWidth-l.width-o)),d.top=Math.max(o,Math.min(d.top,window.innerHeight-l.height-o)),d}const Me="[data-sol-tooltip]";let q=null,k=null,w=null;function xt(){return k?.isConnected||(k=document.createElement("div"),k.className="tooltip",k.setAttribute("role","tooltip"),document.body.appendChild(k)),k}function Ne(e){const t=e.getAttribute("data-sol-tooltip");if(!t)return;w&&w!==e&&w.removeAttribute("aria-describedby");const s=xt();s.textContent=t,s.classList.add("active"),w=e,s.id||(s.id=`sol-tooltip-${D()}`),e.setAttribute("aria-describedby",s.id),requestAnimationFrame(()=>{It(e,s)})}function ae(){k&&k.classList.remove("active"),w&&(w.removeAttribute("aria-describedby"),w=null)}function It(e,t){const s=e.getAttribute("data-tooltip-position")??"top",{top:r,left:n}=le({anchor:e,floating:t,placement:s});t.style.setProperty("--tooltip-top",`${String(r)}px`),t.style.setProperty("--tooltip-left",`${String(n)}px`)}function Pe(e){q?.abort(),q=new AbortController;const{signal:t}=q;return(e?.root??document).querySelectorAll(e?.selector??Me).forEach(r=>{r.addEventListener("mouseenter",()=>{Ne(r)},{signal:t}),r.addEventListener("focus",()=>{Ne(r)},{signal:t}),r.addEventListener("mouseleave",ae,{signal:t}),r.addEventListener("blur",ae,{signal:t}),r.addEventListener("keydown",n=>{n.key==="Escape"&&ae()},{signal:t})}),{destroy(){q?.abort(),q=null,k?.isConnected&&k.remove(),k=null,w&&(w.removeAttribute("aria-describedby"),w=null)}}}function Z(e,t){const{container:s,itemSelector:r,orientation:n,wrap:o=!0,onActivate:i}=e,c=Array.from(s.querySelectorAll(r));if(c.length===0)return!1;const l=c.indexOf(document.activeElement);let d=l;const a=n==="vertical"||n==="both",u=n==="horizontal"||n==="both";switch(t.key){case"ArrowDown":if(!a)return!1;t.preventDefault(),d=l+1;break;case"ArrowUp":if(!a)return!1;t.preventDefault(),d=l-1;break;case"ArrowRight":if(!u)return!1;t.preventDefault(),d=l+1;break;case"ArrowLeft":if(!u)return!1;t.preventDefault(),d=l-1;break;case"Home":t.preventDefault(),d=0;break;case"End":t.preventDefault(),d=c.length-1;break;case"Enter":case" ":return l>=0&&i&&(t.preventDefault(),i(c[l])),l>=0;default:return!1}return o?d=(d+c.length)%c.length:d=Math.max(0,Math.min(d,c.length-1)),c[d]?.focus(),!0}const Fe="[data-sol-accordion]";let x=null;function Be(e,t){e.classList.toggle("active",t);const s=e.querySelector(".accordion-header"),r=e.querySelector(".accordion-body");s?.setAttribute("aria-expanded",String(t)),r&&(t?(r.style.setProperty("--accordion-height",`${String(r.scrollHeight)}px`),r.hidden=!1):(r.style.setProperty("--accordion-height","0"),r.addEventListener("transitionend",()=>{r.hidden=!0},{once:!0})))}function He(e){x?.abort(),x=new AbortController;const{signal:t}=x;return(e?.root??document).querySelectorAll(e?.selector??Fe).forEach(r=>{const n=r.hasAttribute("data-accordion-exclusive"),o=r.querySelectorAll(".accordion-item");o.forEach((i,c)=>{const l=i.querySelector(".accordion-header"),d=i.querySelector(".accordion-body");if(!l||!d)return;const a=r.id||`sol-accordion-${D()}`,u=`${a}-header-${String(c)}`,f=`${a}-panel-${String(c)}`;l.id=u,l.setAttribute("role","button"),l.setAttribute("tabindex","0"),l.setAttribute("aria-controls",f),d.id=f,d.setAttribute("role","region"),d.setAttribute("aria-labelledby",u);const m=i.classList.contains("active");l.setAttribute("aria-expanded",String(m)),m?d.style.setProperty("--accordion-height",`${String(d.scrollHeight)}px`):(d.style.setProperty("--accordion-height","0"),d.hidden=!0),l.addEventListener("click",()=>{const h=!i.classList.contains("active");n&&h&&o.forEach(E=>{E!==i&&E.classList.contains("active")&&Be(E,!1)}),Be(i,h)},{signal:t}),l.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l.click())},{signal:t})}),r.addEventListener("keydown",i=>{Z({container:r,itemSelector:".accordion-header",orientation:"vertical"},i)},{signal:t})}),{destroy(){x?.abort(),x=null}}}function I(e,t,s){document.addEventListener("mousedown",r=>{e.contains(r.target)||t()},{signal:s})}const Ue="[data-sol-dropdown]";let M=null;function Ye(e,t){t.classList.add("active"),e.setAttribute("aria-expanded","true"),e.focus(),requestAnimationFrame(()=>{t.querySelector('[role="menuitem"]')?.focus()})}function N(e,t){t.classList.remove("active"),e.setAttribute("aria-expanded","false")}function je(e){M?.abort(),M=new AbortController;const{signal:t}=M;return(e?.root??document).querySelectorAll(e?.selector??Ue).forEach(r=>{const n=r.querySelector(".dropdown-toggle"),o=r.querySelector(".dropdown-menu");!n||!o||(n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded","false"),o.getAttribute("role")||o.setAttribute("role","menu"),o.querySelectorAll(".dropdown-item").forEach(i=>{i.getAttribute("role")||i.setAttribute("role","menuitem"),i.setAttribute("tabindex","-1")}),n.addEventListener("click",()=>{o.classList.contains("active")?N(n,o):Ye(n,o)},{signal:t}),I(r,()=>{o.classList.contains("active")&&N(n,o)},t),r.addEventListener("keydown",i=>{const c=o.classList.contains("active");if(i.key==="Escape"&&c){i.preventDefault(),N(n,o),requestAnimationFrame(()=>{n.focus()});return}if(i.key==="Tab"&&c){N(n,o);return}if((i.key==="ArrowDown"||i.key==="Enter"||i.key===" ")&&document.activeElement===n&&!c){i.preventDefault(),Ye(n,o);return}c&&Z({container:o,itemSelector:'[role="menuitem"]',orientation:"vertical",onActivate:l=>{l.click(),N(n,o),n.focus()}},i)},{signal:t}))}),{destroy(){M?.abort(),M=null}}}const Ke="[data-sol-drawer]",Mt="[data-drawer-open]",Ve=Te({overlaySelector:Ke,openTriggerAttr:"data-drawer-open",closeTriggerAttr:"data-drawer-close",bodyOpenClass:"sol-drawer-open",contentSelector:".drawer",childElementsToActivate:[".drawer-backdrop",".drawer"],checkOverlayAsBackdrop:!1,backdropSelector:".drawer-backdrop",setupAria:e=>{e.getAttribute("role")||e.querySelector(".drawer")?.setAttribute("role","dialog")}}),We="[data-sol-toast-container]";let P=null,T=null;function Nt(e){const t=document.querySelector(`.toast-container-${e}[data-sol-toast-container]`);if(t)return t;if(T?.isConnected&&T.classList.contains(`toast-container-${e}`))return T;const s=document.createElement("div");return s.className=`toast-container toast-container-${e}`,s.setAttribute("data-sol-toast-container",""),s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),document.body.appendChild(s),T=s,s}function Pt(e){const t=document.createElement("div"),s=e.type?` toast-${e.type}`:"";t.className=`toast${s}`;const r=document.createElement("div");r.className="toast-header";const n=document.createElement("strong");n.className="text-sm",n.textContent=e.type?e.type.charAt(0).toUpperCase()+e.type.slice(1):"Notice";const o=document.createElement("button");o.className="close close-sm",o.setAttribute("aria-label","Dismiss"),r.appendChild(n),r.appendChild(o);const i=document.createElement("div");return i.className="toast-body text-sm",i.textContent=e.message,t.appendChild(r),t.appendChild(i),t}function Ft(e){const{duration:t=5e3,position:s="top-right"}=e,r=Nt(s),n=Pt(e);r.appendChild(n),requestAnimationFrame(()=>{n.classList.add("active")});const o=n.querySelector(".close"),i=()=>{n.classList.remove("active"),n.addEventListener("transitionend",()=>{n.remove()},{once:!0}),setTimeout(()=>{n.isConnected&&n.remove()},500)};return o?.addEventListener("click",i),t>0&&setTimeout(i,t),n}function ze(e){e.classList.remove("active"),e.addEventListener("transitionend",()=>{e.remove()},{once:!0}),setTimeout(()=>{e.isConnected&&e.remove()},500)}function Xe(e){P?.abort(),P=new AbortController;const{signal:t}=P;return(e?.root??document).querySelectorAll(e?.selector??We).forEach(r=>{r.getAttribute("role")||r.setAttribute("role","status"),r.getAttribute("aria-live")||r.setAttribute("aria-live","polite"),r.querySelectorAll(".toast .close").forEach(n=>{n.addEventListener("click",()=>{const o=n.closest(".toast");o&&ze(o)},{signal:t})})}),{destroy(){P?.abort(),P=null,T?.isConnected&&T.remove(),T=null}}}const Ge="[data-sol-collapsible]";let F=null;function Je(e){F?.abort(),F=new AbortController;const{signal:t}=F;return(e?.root??document).querySelectorAll(e?.selector??Ge).forEach(r=>{const n=r.querySelector(".collapsible-trigger"),o=r.querySelector(".collapsible-content");if(!n||!o)return;const i=r.hasAttribute("data-collapsible-open");n.setAttribute("aria-expanded",String(i)),o.setAttribute("aria-hidden",String(!i)),i?o.style.setProperty("--collapsible-height",`${String(o.scrollHeight)}px`):o.style.setProperty("--collapsible-height","0"),o.id||(o.id=`sol-collapsible-${D()}`),n.setAttribute("aria-controls",o.id),n.addEventListener("click",()=>{const l=!(n.getAttribute("aria-expanded")==="true");n.setAttribute("aria-expanded",String(l)),o.setAttribute("aria-hidden",String(!l)),l?(o.style.setProperty("--collapsible-height",`${String(o.scrollHeight)}px`),r.setAttribute("data-collapsible-open","")):(o.style.setProperty("--collapsible-height","0"),r.removeAttribute("data-collapsible-open"))},{signal:t})}),{destroy(){F?.abort(),F=null}}}const Qe="[data-sol-combobox]";let B=null;function Bt(e){return(e.getAttribute("data-value")??e.textContent??"").toLowerCase()}function Ze(e){B?.abort(),B=new AbortController;const{signal:t}=B;return(e?.root??document).querySelectorAll(e?.selector??Qe).forEach(r=>{const n=r.querySelector(".combobox-input"),o=r.querySelector(".combobox-listbox");if(!n||!o)return;const i=n,c=o,l=Array.from(c.querySelectorAll(".combobox-option")),d=c.querySelector(".combobox-empty");i.setAttribute("role","combobox"),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-autocomplete","list"),c.id||(c.id=`sol-combobox-list-${D()}`),i.setAttribute("aria-controls",c.id),c.setAttribute("role","listbox"),l.forEach(h=>{h.setAttribute("role","option"),h.setAttribute("tabindex","-1")});function a(){c.classList.add("active"),i.setAttribute("aria-expanded","true")}function u(){c.classList.remove("active"),i.setAttribute("aria-expanded","false"),i.removeAttribute("aria-activedescendant"),l.forEach(h=>{h.classList.remove("active")})}function f(h){const E=h.toLowerCase();let A=0;l.forEach(v=>{const p=Bt(v),g=E===""||p.includes(E);v.hidden=!g,v.classList.remove("active"),g&&A++}),d&&(d.hidden=A>0||E==="")}function m(h){const A=h.getAttribute("data-value")??(h.textContent||"").trim();i.value=A,l.forEach(v=>{v.classList.remove("selected")}),h.classList.add("selected"),h.setAttribute("aria-selected","true"),u(),i.focus()}i.addEventListener("input",()=>{f(i.value),c.classList.contains("active")||a()},{signal:t}),i.addEventListener("focus",()=>{f(i.value),a()},{signal:t}),l.forEach(h=>{h.addEventListener("click",()=>{m(h)},{signal:t})}),I(r,()=>{c.classList.contains("active")&&u()},t),r.addEventListener("keydown",h=>{const E=c.classList.contains("active");if(h.key==="Escape"&&E){h.preventDefault(),u(),i.focus();return}if(h.key==="ArrowDown"&&!E){h.preventDefault(),a();return}E&&Z({container:c,itemSelector:".combobox-option:not([hidden])",orientation:"vertical",onActivate:m},h)},{signal:t})}),{destroy(){B?.abort(),B=null}}}const et="[data-sol-hover-card]";let H=null;function tt(e){H?.abort(),H=new AbortController;const{signal:t}=H;return(e?.root??document).querySelectorAll(e?.selector??et).forEach(r=>{const n=r.querySelector(".hover-card-trigger"),o=r.querySelector(".hover-card-content");if(!n||!o)return;const i=n,c=o,l=Number(r.getAttribute("data-hover-show-delay")??"200"),d=Number(r.getAttribute("data-hover-hide-delay")??"300"),a=r.getAttribute("data-hover-placement")??"bottom";let u=null,f=null;function m(){f&&(clearTimeout(f),f=null),u=setTimeout(()=>{const E=le({anchor:i,floating:c,placement:a});c.style.setProperty("--hover-card-top",`${String(E.top-r.getBoundingClientRect().top)}px`),c.style.setProperty("--hover-card-left",`${String(E.left-r.getBoundingClientRect().left)}px`),c.classList.add("active")},l)}function h(){u&&(clearTimeout(u),u=null),f=setTimeout(()=>{c.classList.remove("active")},d)}i.addEventListener("mouseenter",m,{signal:t}),i.addEventListener("mouseleave",h,{signal:t}),c.addEventListener("mouseenter",()=>{f&&(clearTimeout(f),f=null)},{signal:t}),c.addEventListener("mouseleave",h,{signal:t}),i.addEventListener("focus",m,{signal:t}),i.addEventListener("blur",h,{signal:t})}),{destroy(){H?.abort(),H=null}}}const rt="[data-sol-context-menu]";let U=null;function nt(e){U?.abort(),U=new AbortController;const{signal:t}=U;return(e?.root??document).querySelectorAll(e?.selector??rt).forEach(r=>{const n=r.querySelector(".context-menu");if(!n)return;const o=n;o.getAttribute("role")||o.setAttribute("role","menu"),o.querySelectorAll(".context-menu-item").forEach(c=>{c.getAttribute("role")||c.setAttribute("role","menuitem"),c.setAttribute("tabindex","-1")});function i(){o.classList.remove("active")}r.addEventListener("contextmenu",c=>{c.preventDefault();const l=le({anchor:{x:c.clientX,y:c.clientY},floating:o,placement:"right",gap:0});o.style.setProperty("--context-menu-top",`${String(l.top)}px`),o.style.setProperty("--context-menu-left",`${String(l.left)}px`),o.classList.add("active"),requestAnimationFrame(()=>{o.querySelector('[role="menuitem"]')?.focus()})},{signal:t}),I(o,i,t),o.addEventListener("keydown",c=>{if(c.key==="Escape"){c.preventDefault(),i();return}Z({container:o,itemSelector:'[role="menuitem"]',orientation:"vertical",onActivate:l=>{l.click(),i()}},c)},{signal:t})}),{destroy(){U?.abort(),U=null}}}const ot="[data-sol-carousel]";let Y=null;function it(e){Y?.abort(),Y=new AbortController;const{signal:t}=Y,s=[];return(e?.root??document).querySelectorAll(e?.selector??ot).forEach(n=>{const o=n.querySelector(".carousel-track"),i=Array.from(n.querySelectorAll(".carousel-slide")),c=n.querySelector(".carousel-prev"),l=n.querySelector(".carousel-next"),d=n.querySelector(".carousel-dots");if(!o||i.length===0)return;const a=o,u=n.hasAttribute("data-carousel-loop"),f=n.hasAttribute("data-carousel-autoplay"),m=Number(n.getAttribute("data-carousel-interval")??"5000");let h=0;n.setAttribute("role","region"),n.setAttribute("aria-roledescription","carousel"),i.forEach((v,p)=>{v.setAttribute("role","group"),v.setAttribute("aria-roledescription","slide"),v.setAttribute("aria-label",`Slide ${String(p+1)} of ${String(i.length)}`)});const E=[];d&&i.forEach((v,p)=>{const g=document.createElement("button");g.className=p===0?"carousel-dot active":"carousel-dot",g.setAttribute("aria-label",`Go to slide ${String(p+1)}`),d.appendChild(g),E.push(g)});function A(v){u?h=(v+i.length)%i.length:h=Math.max(0,Math.min(v,i.length-1)),a.style.setProperty("--carousel-offset",`-${String(h*100)}%`),E.forEach((p,g)=>p.classList.toggle("active",g===h)),u||(c?.toggleAttribute("disabled",h===0),l?.toggleAttribute("disabled",h===i.length-1))}if(A(0),c?.addEventListener("click",()=>{A(h-1)},{signal:t}),l?.addEventListener("click",()=>{A(h+1)},{signal:t}),E.forEach((v,p)=>{v.addEventListener("click",()=>{A(p)},{signal:t})}),n.addEventListener("keydown",v=>{v.key==="ArrowLeft"?(v.preventDefault(),A(h-1)):v.key==="ArrowRight"&&(v.preventDefault(),A(h+1))},{signal:t}),f){const v=setInterval(()=>{A(h+1)},m);s.push(v),n.addEventListener("mouseenter",()=>{clearInterval(v)},{signal:t}),n.addEventListener("mouseleave",()=>{const p=setInterval(()=>{A(h+1)},m);s.push(p)},{signal:t})}}),{destroy(){Y?.abort(),Y=null,s.forEach(clearInterval)}}}const st="[data-sol-scroll-area]";let j=null;function ct(e){j?.abort(),j=new AbortController;const{signal:t}=j;return(e?.root??document).querySelectorAll(e?.selector??st).forEach(r=>{let n=null;r.addEventListener("scroll",()=>{r.classList.add("scrolling"),n&&clearTimeout(n),n=setTimeout(()=>{r.classList.remove("scrolling")},1200)},{signal:t,passive:!0}),r.setAttribute("tabindex","0"),r.setAttribute("role","region"),r.getAttribute("aria-label")||r.setAttribute("aria-label","Scrollable content")}),{destroy(){j?.abort(),j=null}}}const lt="[data-sol-date-picker]";let K=null;const Ht=["Su","Mo","Tu","We","Th","Fr","Sa"],at=["January","February","March","April","May","June","July","August","September","October","November","December"];function dt(e,t){return new Date(e,t+1,0).getDate()}function Ut(e,t){return new Date(e,t,1).getDay()}function ut(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Yt(e){const t=String(e.getFullYear()),s=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${s}-${r}`}function jt(e,t,s,r){let n=e.querySelector(".date-picker-grid");n||(n=document.createElement("div"),n.className="date-picker-grid",n.setAttribute("role","grid"),e.appendChild(n)),n.innerHTML="";for(const a of Ht){const u=document.createElement("div");u.className="date-picker-weekday",u.textContent=a,n.appendChild(u)}const o=dt(t.viewYear,t.viewMonth),i=Ut(t.viewYear,t.viewMonth),c=dt(t.viewMonth===0?t.viewYear-1:t.viewYear,t.viewMonth===0?11:t.viewMonth-1);for(let a=i-1;a>=0;a--){const u=document.createElement("button");u.className="date-picker-cell date-picker-cell-other",u.textContent=String(c-a),u.setAttribute("tabindex","-1"),u.setAttribute("role","gridcell"),u.disabled=!0,n.appendChild(u)}for(let a=1;a<=o;a++){const u=new Date(t.viewYear,t.viewMonth,a),f=document.createElement("button");f.className="date-picker-cell",f.textContent=String(a),f.setAttribute("tabindex","-1"),f.setAttribute("role","gridcell"),ut(u,s)&&f.classList.add("today"),t.selected&&ut(u,t.selected)&&(f.classList.add("selected"),f.setAttribute("aria-selected","true"),f.setAttribute("tabindex","0")),f.addEventListener("click",()=>{r(u)}),n.appendChild(f)}const l=i+o,d=l%7===0?0:7-l%7;for(let a=1;a<=d;a++){const u=document.createElement("button");u.className="date-picker-cell date-picker-cell-other",u.textContent=String(a),u.setAttribute("tabindex","-1"),u.setAttribute("role","gridcell"),u.disabled=!0,n.appendChild(u)}}function Kt(e,t){const s=e.querySelector(".date-picker-title");s&&(s.textContent=`${at[t.viewMonth]} ${String(t.viewYear)}`),e.setAttribute("aria-label",`${at[t.viewMonth]} ${String(t.viewYear)}`)}function ft(e){K?.abort(),K=new AbortController;const{signal:t}=K;return(e?.root??document).querySelectorAll(e?.selector??lt).forEach(r=>{if(r.hasAttribute("data-sol-date-native"))return;const n=r.querySelector(".date-picker-input");if(!n)return;const o=n,i=new Date,c={viewYear:i.getFullYear(),viewMonth:i.getMonth(),selected:null},l=document.createElement("div");l.className="date-picker-popup",l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true");const d=document.createElement("div");d.className="date-picker-header";const a=document.createElement("button");a.className="date-picker-nav",a.setAttribute("aria-label","Previous month"),a.innerHTML="‹";const u=document.createElement("span");u.className="date-picker-title";const f=document.createElement("button");f.className="date-picker-nav",f.setAttribute("aria-label","Next month"),f.innerHTML="›",d.appendChild(a),d.appendChild(u),d.appendChild(f),l.appendChild(d),r.appendChild(l);function m(){Kt(l,c),jt(l,c,i,A)}function h(){l.classList.add("active"),m(),requestAnimationFrame(()=>{(l.querySelector(".date-picker-cell.selected")??l.querySelector(".date-picker-cell.today")??l.querySelector(".date-picker-cell:not(.date-picker-cell-other)"))?.focus()})}function E(){l.classList.remove("active"),o.focus()}function A(v){c.selected=v,o.value=Yt(v),o.dispatchEvent(new Event("change",{bubbles:!0})),E()}a.addEventListener("click",()=>{c.viewMonth--,c.viewMonth<0&&(c.viewMonth=11,c.viewYear--),m()},{signal:t}),f.addEventListener("click",()=>{c.viewMonth++,c.viewMonth>11&&(c.viewMonth=0,c.viewYear++),m()},{signal:t}),o.addEventListener("click",()=>{l.classList.contains("active")?E():h()},{signal:t}),I(r,()=>{l.classList.contains("active")&&E()},t),l.addEventListener("keydown",v=>{if(v.key==="Escape"){v.preventDefault(),E();return}if(v.key==="Tab"){Ce(l,v);return}const p=Array.from(l.querySelectorAll(".date-picker-cell:not(.date-picker-cell-other)")),g=p.indexOf(document.activeElement);let y=g;switch(v.key){case"ArrowRight":v.preventDefault(),y=g+1;break;case"ArrowLeft":v.preventDefault(),y=g-1;break;case"ArrowDown":v.preventDefault(),y=g+7;break;case"ArrowUp":v.preventDefault(),y=g-7;break;case"Home":v.preventDefault(),y=g-g%7;break;case"End":v.preventDefault(),y=g+(6-g%7);break;case"PageDown":v.preventDefault(),f.click();return;case"PageUp":v.preventDefault(),a.click();return;case"Enter":case" ":g>=0&&(v.preventDefault(),p[g].click());return;default:return}y>=0&&y<p.length&&p[y].focus()},{signal:t}),m()}),{destroy(){K?.abort(),K=null}}}const ht="[data-sol-color-picker]";let V=null;function bt(e){const{h:t,s,v:r}=e,n=r*s,o=n*(1-Math.abs(t/60%2-1)),i=r-n;let c=0,l=0,d=0;return t<60?(c=n,l=o):t<120?(c=o,l=n):t<180?(l=n,d=o):t<240?(l=o,d=n):t<300?(c=o,d=n):(c=n,d=o),[Math.round((c+i)*255),Math.round((l+i)*255),Math.round((d+i)*255)]}function mt(e,t,s){return"#"+[e,t,s].map(r=>r.toString(16).padStart(2,"0")).join("")}function de(e){const t=e.replace("#","").match(/.{2}/g);if(!t)return{h:0,s:0,v:0};const[s,r,n]=t.map(d=>parseInt(d,16)/255),o=Math.max(s,r,n),i=Math.min(s,r,n),c=o-i;let l=0;return c>0&&(o===s?l=((r-n)/c+6)%6:o===r?l=(n-s)/c+2:l=(s-r)/c+4,l*=60),{h:l,s:o===0?0:c/o,v:o}}function vt(e){const[t,s,r]=bt(e);return mt(t,s,r)}function pt(e){V?.abort(),V=new AbortController;const{signal:t}=V;return(e?.root??document).querySelectorAll(e?.selector??ht).forEach(r=>{const n=r.querySelector(".color-picker-trigger"),o=r.querySelector(".color-picker-popup"),i=r.querySelector(".color-picker-area"),c=r.querySelector(".color-picker-hue"),l=r.querySelector(".color-picker-input");if(!n||!o)return;const d=n,a=o,u=l?.value??"#d4a843";let f=de(u),m=i?.querySelector(".color-picker-area-thumb");i&&!m&&(m=document.createElement("div"),m.className="color-picker-area-thumb",i.appendChild(m));let h=c?.querySelector(".color-picker-slider-thumb");c&&!h&&(h=document.createElement("div"),h.className="color-picker-slider-thumb",c.appendChild(h));function E(){const p=vt(f),[g,y,L]=bt({h:f.h,s:1,v:1}),Q=mt(g,y,L);d.style.setProperty("--cp-trigger-bg",p),l&&(l.value=p),i&&i.style.setProperty("--cp-area-bg",Q),m&&(m.style.setProperty("--cp-thumb-x",`${String(f.s*100)}%`),m.style.setProperty("--cp-thumb-y",`${String((1-f.v)*100)}%`),m.style.setProperty("--cp-thumb-bg",p)),h&&h.style.setProperty("--cp-hue-x",`${String(f.h/360*100)}%`)}function A(){r.dispatchEvent(new CustomEvent("color-change",{bubbles:!0,detail:{hex:vt(f),hsv:{...f}}}))}if(d.addEventListener("click",()=>{a.classList.toggle("active"),a.classList.contains("active")&&E()},{signal:t}),I(r,()=>{a.classList.remove("active")},t),i){let p=function(g){if(!i)return;const y=i.getBoundingClientRect();f.s=Math.max(0,Math.min(1,(g.clientX-y.left)/y.width)),f.v=Math.max(0,Math.min(1,1-(g.clientY-y.top)/y.height)),E(),A()};i.addEventListener("pointerdown",g=>{p(g);const y=Q=>{p(Q)},L=()=>{document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",L)};document.addEventListener("pointermove",y),document.addEventListener("pointerup",L)},{signal:t})}if(c){let p=function(g){if(!c)return;const y=c.getBoundingClientRect();f.h=Math.max(0,Math.min(360,(g.clientX-y.left)/y.width*360)),E(),A()};c.addEventListener("pointerdown",g=>{p(g);const y=Q=>{p(Q)},L=()=>{document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",L)};document.addEventListener("pointermove",y),document.addEventListener("pointerup",L)},{signal:t})}l?.addEventListener("change",()=>{const p=l.value.trim();/^#[0-9a-fA-F]{6}$/.test(p)&&(f=de(p),E(),A())},{signal:t});const v=r.querySelector(".color-picker-swatches");if(v){const p=v.getAttribute("data-swatches");let g=[];if(p)try{g=JSON.parse(p)}catch{console.warn("[soltana] Invalid JSON in data-swatches attribute:",p)}g.forEach(y=>{const L=document.createElement("button");L.className="color-picker-swatch",L.style.setProperty("--cp-swatch-bg",y),L.setAttribute("aria-label",y),L.addEventListener("click",()=>{f=de(y),E(),A()},{signal:t}),v.appendChild(L)})}a.addEventListener("keydown",p=>{p.key==="Escape"&&(a.classList.remove("active"),d.focus())},{signal:t}),E()}),{destroy(){V?.abort(),V=null}}}const gt="[data-sol-tree]";let W=null;function Vt(e){return Array.from(e.querySelectorAll(".tree-node-content")).filter(t=>!t.closest(".tree-branch:not(.active) > .tree-children"))}function ue(e,t){e.classList.toggle("active",t),e.querySelector(":scope > .tree-node-content")?.setAttribute("aria-expanded",String(t))}function Et(e){W?.abort(),W=new AbortController;const{signal:t}=W;return(e?.root??document).querySelectorAll(e?.selector??gt).forEach(r=>{r.getAttribute("role")||r.setAttribute("role","tree"),r.querySelectorAll(".tree-node").forEach(o=>{o.getAttribute("role")||o.setAttribute("role","treeitem")}),r.querySelectorAll(".tree-branch").forEach(o=>{const i=o.querySelector(":scope > .tree-node-content"),c=o.classList.contains("active");i?.setAttribute("aria-expanded",String(c)),i?.setAttribute("tabindex","-1");const l=o.querySelector(":scope > .tree-node-content .tree-toggle"),d=()=>{ue(o,!o.classList.contains("active"))};l&&l.addEventListener("click",a=>{a.stopPropagation(),d()},{signal:t}),i?.addEventListener("click",d,{signal:t})}),r.querySelectorAll(".tree-leaf .tree-node-content").forEach(o=>{o.setAttribute("tabindex","-1"),o.addEventListener("click",()=>{r.querySelectorAll(".tree-node-content.selected").forEach(i=>{i.classList.remove("selected")}),o.classList.add("selected")},{signal:t})});const n=r.querySelector(".tree-node-content");n&&n.setAttribute("tabindex","0"),r.addEventListener("keydown",o=>{const i=document.activeElement;if(!i.classList.contains("tree-node-content"))return;const c=Vt(r),l=c.indexOf(i);if(l===-1)return;const d=i.closest(".tree-branch");switch(o.key){case"ArrowDown":o.preventDefault(),l<c.length-1&&c[l+1].focus();break;case"ArrowUp":o.preventDefault(),l>0&&c[l-1].focus();break;case"ArrowRight":o.preventDefault(),d&&!d.classList.contains("active")?ue(d,!0):d?.classList.contains("active")&&d.querySelector(":scope > .tree-children > .tree-node > .tree-node-content")?.focus();break;case"ArrowLeft":o.preventDefault(),d?.classList.contains("active")?ue(d,!1):i.closest(".tree-children")?.closest(".tree-branch")?.querySelector(":scope > .tree-node-content")?.focus();break;case"Home":o.preventDefault(),c[0]?.focus();break;case"End":o.preventDefault(),c[c.length-1]?.focus();break;case"Enter":case" ":o.preventDefault(),i.click();break}},{signal:t})}),{destroy(){W?.abort(),W=null}}}function yt(e){const t=_e(e),s=$e(e),r=Pe(e),n=He(e),o=je(e),i=Ve(e),c=Xe(e),l=Je(e),d=Ze(e),a=tt(e),u=nt(e),f=it(e),m=ct(e),h=ft(e),E=pt(e),A=Et(e);return{destroy(){t.destroy(),s.destroy(),r.destroy(),n.destroy(),o.destroy(),i.destroy(),c.destroy(),l.destroy(),d.destroy(),a.destroy(),u.destroy(),f.destroy(),m.destroy(),h.destroy(),E.destroy(),A.destroy()}}}let S=null,C=null;function Wt(){try{return new CSSStyleSheet,typeof document.adoptedStyleSheets<"u"}catch{return!1}}function zt(){if(S)return S;if(Wt())S=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,S];else{if(C=document.createElement("style"),C.id="soltana-custom",document.head.appendChild(C),!C.sheet)throw new Error("[soltana] Failed to create stylesheet — styleElement.sheet is null");S=C.sheet}return S}function At(e){const t=zt(),s=t.insertRule(e,t.cssRules.length);return t.cssRules[s]}function St(e){if(!S)return;const t=[];for(let s=0;s<S.cssRules.length;s++)e.includes(S.cssRules[s])&&t.push(s);for(let s=t.length-1;s>=0;s--)S.deleteRule(t[s])}function Lt(){S&&C?C.remove():S&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==S)),S=null,C=null}function ee(e,t,s){const{isDark:r,mix:n,mixSrgb:o,fallbacks:i}=s,[c,l,d]=r?i.dark:i.light;return{[`--color-${e}`]:t??c,[`--color-${e}-subtle`]:t?o(t,r?12:8):l,[`--color-${e}-text`]:t?r?n(t,"white",25):n(t,"black",25):d}}function Xt(e){const t=e.surfaceBg,s=e.textPrimary,r=e.accentPrimary,n=e.accentDecorative??r,i=(e.colorScheme??"dark")==="dark",c=(u,f,m)=>`color-mix(in oklch, ${u}, ${f} ${String(m)}%)`,l=(u,f)=>`color-mix(in srgb, ${u} ${String(f)}%, transparent)`,d=i?"white":"black";return{"--surface-bg":t,"--surface-1":i?c(t,"white",5):c(t,"white",50),"--surface-2":i?c(t,"white",10):c(t,"black",5),"--surface-3":i?c(t,"white",15):c(t,"black",10),"--surface-4":i?c(t,"white",20):c(t,"black",15),"--text-primary":s,"--text-secondary":c(s,t,25),"--text-tertiary":c(s,t,45),"--text-muted":c(s,t,55),"--text-inverse":t,"--border-default":l(s,i?6:12),"--border-subtle":l(s,i?3:7),"--border-strong":l(s,i?10:20),"--accent-primary":r,"--accent-primary-hover":c(r,d,15),"--accent-primary-active":c(r,"black",25),"--accent-secondary":`oklch(from ${r} l c calc(h + 120))`,"--accent-secondary-hover":`oklch(from ${c(r,d,15)} l c calc(h + 120))`,"--accent-secondary-active":`oklch(from ${c(r,"black",25)} l c calc(h + 120))`,"--accent-decorative":n,"--accent-decorative-hover":c(n,d,15),"--accent-decorative-subtle":l(n,10),"--border-decorative":l(n,i?20:25),"--border-decorative-strong":l(n,i?35:40),...ee("success",e.colorSuccess,{isDark:i,mix:c,mixSrgb:l,fallbacks:{dark:["#10b981","rgb(16 185 129 / 12%)","#34d399"],light:["#0d6b4e","rgb(13 107 78 / 8%)","#065f46"]}}),...ee("warning",e.colorWarning,{isDark:i,mix:c,mixSrgb:l,fallbacks:{dark:["#fcd34d","rgb(252 211 77 / 12%)","#fde68a"],light:["#855c0a","rgb(133 92 10 / 8%)","#6b4a08"]}}),...ee("error",e.colorError,{isDark:i,mix:c,mixSrgb:l,fallbacks:{dark:["#ef4444","rgb(239 68 68 / 12%)","#f87171"],light:["#991b1b","rgb(153 27 27 / 8%)","#7f1d1d"]}}),...ee("info",e.colorInfo,{isDark:i,mix:c,mixSrgb:l,fallbacks:{dark:["#3b82f6","rgb(59 130 246 / 12%)","#60a5fa"],light:["#1e40af","rgb(30 64 175 / 8%)","#1e3a8a"]}}),"--state-hover":l(r,i?8:6),"--state-active":l(r,i?14:12),"--state-focus-ring":l(r,i?40:35),"--state-disabled-bg":i?c(t,"white",10):c(t,"black",10),"--state-disabled-text":c(s,t,55),"--shadow-color":"0 0 0","--highlight-color":e.highlightColor??"255 255 255","--accent-glow":l(r,i?15:10),"--channel-sheen-color":i?"255 255 255":"0 0 0","--channel-tint-color":Jt(r),"--glass-opacity":i?"0.5":"0.35","--mesh-color-1":"var(--accent-primary)","--mesh-color-2":"var(--accent-secondary)","--mesh-color-3":"var(--accent-decorative)","--surface-deep":"var(--surface-2)","--neu-shadow":i?"rgb(var(--shadow-color) / 65%)":"rgb(var(--shadow-color) / 35%)","--neu-light":i?"rgb(var(--highlight-color) / 12%)":"rgb(var(--highlight-color) / 88%)","--input-bg":i?l("white",4):"white","--input-border":l(s,i?8:14),"--input-border-focus":"var(--accent-primary)","--input-placeholder":c(s,t,55),"--card-bg":i?`color-mix(in srgb, ${c(t,"white",5)} 60%, transparent)`:"color-mix(in srgb, white 78%, transparent)","--card-border":l(s,i?6:10),"--badge-bg":l(r,i?10:8),"--tooltip-bg":i?t:s,"--tooltip-text":i?s:c(t,"white",50),"--scrollbar-thumb":l(s,i?12:15),"--scrollbar-track":l(s,3),"--code-bg":i?"rgb(0 0 0 / 35%)":c(t,"black",5),"--toast-bg":"var(--surface-1)","--toast-text":"var(--text-primary)","--drawer-bg":"var(--surface-1)","--popover-bg":"var(--surface-1)","--popover-border":"var(--border-default)","--kbd-bg":"var(--surface-2)","--kbd-border":"var(--border-strong)","--modal-bg":"var(--surface-1)","--overlay-backdrop-bg":"rgb(var(--shadow-color) / 60%)"}}const Gt=/^#?[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/;function Jt(e){if(!Gt.test(e)){const o=/^rgb\(\s*(\d+)[, ]\s*(\d+)[, ]\s*(\d+)\s*\)$/.exec(e);if(o)return`${o[1]} ${o[2]} ${o[3]}`;throw new Error(`[soltana] Invalid color "${e}". Expected hex format (#RGB or #RRGGBB) or rgb(r, g, b).`)}let t=e.replace("#","");t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const s=String(parseInt(t.slice(0,2),16)),r=String(parseInt(t.slice(2,4),16)),n=String(parseInt(t.slice(4,6),16));return`${s} ${r} ${n}`}const Qt=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function kt(e){if(!e||!Qt.test(e))throw new Error(`[soltana] Invalid tier name "${e}". Must be a non-empty CSS identifier (letters, digits, hyphens, underscores; starting with a letter).`)}function wt(e){return Object.entries(e).map(([t,s])=>`${t}: ${s}`).join("; ")}function Zt(e,t){kt(e);const s=Xt(t.seed),r=t.tokens?{...s,...t.tokens}:s,n=wt(r),o=[];return o.push(At(`[data-theme='${e}'], .theme-${e} { color-scheme: ${t.seed.colorScheme??"dark"}; ${n} }`)),Le("theme",e),{name:e,tier:"theme",unregister(){St(o),ke("theme",e)}}}const er={relief:["--relief-bg","--relief-shadow-sm","--relief-shadow","--relief-shadow-lg","--relief-shadow-inset-sm","--relief-shadow-inset","--relief-shadow-inset-lg","--relief-border"],finish:["--finish-blur","--finish-saturation","--finish-opacity","--finish-overlay","--finish-sheen"]};function tr(e,t,s){const n=er[e].filter(o=>!(o in s));if(n.length>0)throw new Error(`[soltana] register${e[0].toUpperCase()}${e.slice(1)}("${t}") missing required tokens: ${n.join(", ")}`)}function Ct(e,t,s){kt(t),tr(e,t,s);const r=wt(s),n=[];return n.push(At(`[data-${e}='${t}'], .${e}-${t} { ${r} }`)),Le(e,t),{name:t,tier:e,unregister(){St(n),ke(e,t)}}}function rr(e,t){return Ct("relief",e,t.tokens)}function nr(e,t){return Ct("finish",e,t.tokens)}const Tt="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Cinzel+Decorative:wght@400;700;900&family=Raleway:ital,wght@0,100..900;1,400;1,500&family=JetBrains+Mono:wght@400;500;600&display=swap";let fe=!1;const z=[];function or(e){if(fe||typeof document>"u")return;fe=!0;const t=e??Tt,s=document.head;if(t.startsWith("https://fonts.googleapis.com")){const n=document.createElement("link");n.rel="preconnect",n.href="https://fonts.googleapis.com",s.appendChild(n),z.push(n);const o=document.createElement("link");o.rel="preconnect",o.href="https://fonts.gstatic.com",o.crossOrigin="",s.appendChild(o),z.push(o)}const r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onerror=()=>{console.warn("[soltana] Failed to load fonts from Google Fonts CDN")},s.appendChild(r),z.push(r)}function ir(){for(const e of z)e.remove();z.length=0,fe=!1}const X=Object.freeze({theme:"auto",relief:"flat",finish:"matte",overrides:{}}),Ot={enhancers:!1,strict:!1};let G=null,J=null,te=null;const re=new Set,sr=/^--[a-zA-Z][-_a-zA-Z0-9]*$/;function he(e,t){if(sr.test(e))return!0;const s=`[soltana] Override key "${e}" is not a valid CSS custom property (must match --<ident>)`;if(t)throw new Error(s);return console.error(s),!1}function be(e){return e!=="auto"?e:typeof window>"u"||typeof window.matchMedia!="function"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function _t(e){const t=document.documentElement;for(const[s,r]of Object.entries(e))t.style.setProperty(s,r),re.add(s)}function Rt(){const e=document.documentElement;for(const t of re)e.style.removeProperty(t);re.clear()}function Dt(e){const t=document.documentElement;t.setAttribute("data-theme",be(e.theme)),t.setAttribute("data-relief",e.relief),t.setAttribute("data-finish",e.finish),_t(e.overrides)}function me(){G&&J&&G.removeEventListener("change",J),G=null,J=null}function ve(e){me(),!(typeof window>"u"||typeof window.matchMedia!="function"||e.theme!=="auto")&&(G=window.matchMedia("(prefers-color-scheme: light)"),J=()=>{e.theme==="auto"&&document.documentElement.setAttribute("data-theme",be("auto"))},G.addEventListener("change",J))}function R(e,t,s,r){if(!s.includes(t)){const n=`[soltana] Unknown ${e} "${t}". Built-in options: ${s.join(", ")}`;if(r)throw new Error(n);console.warn(n)}}function ne(e){if(te)try{te.destroy()}finally{te=null}e&&(te=yt())}function O(e,t){document.documentElement.dispatchEvent(new CustomEvent("soltana:change",{detail:{type:e,value:t}}))}function cr(e={}){const{enhancers:t,strict:s,...r}=e,n={...X,...r},o={enhancers:t??Ot.enhancers,strict:s??Ot.strict};n.overrides=Object.fromEntries(Object.entries(n.overrides).filter(([a])=>he(a,o.strict))),R("theme",n.theme,oe,o.strict),R("relief",n.relief,ie,o.strict),R("finish",n.finish,se,o.strict),Dt(n),ve(n),ne(o.enhancers);const i=[];function c(a){R("theme",a,oe,o.strict),n.theme=a,document.documentElement.setAttribute("data-theme",be(a)),ve(n),O("theme",a)}function l(a){R("relief",a,ie,o.strict),n.relief=a,document.documentElement.setAttribute("data-relief",a),O("relief",a)}function d(a){R("finish",a,se,o.strict),n.finish=a,document.documentElement.setAttribute("data-finish",a),O("finish",a)}return{getState(){return{...n,overrides:{...n.overrides}}},setTheme:c,setRelief:l,setFinish:d,setOverrides(a){const u={};for(const[f,m]of Object.entries(a))he(f,o.strict)&&(u[f]=m);n.overrides={...n.overrides,...u},_t(u),O("overrides",u)},removeOverrides(a){const u=a.filter(m=>he(m,o.strict)),f=document.documentElement;for(const m of u)f.style.removeProperty(m),re.delete(m);n.overrides=Object.fromEntries(Object.entries(n.overrides).filter(([m])=>!u.includes(m))),O("overrides",null)},registerTheme(a,u){const f=Zt(a,u);return i.push(f),f},registerRelief(a,u){const f=rr(a,u);return i.push(f),f},registerFinish(a,u){const f=nr(a,u);return i.push(f),f},reinitEnhancers(){ne(o.enhancers)},reset(){for(const a of i.splice(0))a.unregister();Lt(),n.theme=X.theme,n.relief=X.relief,n.finish=X.finish,n.overrides={},me(),Rt(),Dt(n),ve(n),ne(o.enhancers),O("reset",null)},destroy(){O("destroy",null);for(const u of i.splice(0))u.unregister();Lt(),me(),ne(!1),ir();const a=document.documentElement;a.removeAttribute("data-theme"),a.removeAttribute("data-relief"),a.removeAttribute("data-finish"),Rt()}}}const lr="0.1.0";b.ACCORDION_SELECTOR=Fe,b.BUILT_IN_FINISHES=ge,b.BUILT_IN_RELIEFS=pe,b.BUILT_IN_THEMES=_,b.CAROUSEL_SELECTOR=ot,b.COLLAPSIBLE_SELECTOR=Ge,b.COLOR_PICKER_SELECTOR=ht,b.COMBOBOX_SELECTOR=Qe,b.CONTEXT_MENU_SELECTOR=rt,b.DATE_PICKER_SELECTOR=lt,b.DEFAULT_FONT_URL=Tt,b.DEFAULT_STATE=X,b.DRAWER_OPEN_SELECTOR=Mt,b.DRAWER_SELECTOR=Ke,b.DROPDOWN_SELECTOR=Ue,b.HOVER_CARD_SELECTOR=et,b.MODAL_OPEN_SELECTOR=$t,b.MODAL_SELECTOR=Oe,b.SCROLL_AREA_SELECTOR=st,b.TABS_SELECTOR=Re,b.TOAST_CONTAINER_SELECTOR=We,b.TOOLTIP_SELECTOR=Me,b.TREE_SELECTOR=gt,b.VALID_FINISHES=se,b.VALID_RELIEFS=ie,b.VALID_THEMES=oe,b.dismissToast=ze,b.initAccordions=He,b.initAll=yt,b.initCarousels=it,b.initCollapsibles=Je,b.initColorPickers=pt,b.initComboboxes=Ze,b.initContextMenus=nt,b.initDatePickers=ft,b.initDrawers=Ve,b.initDropdowns=je,b.initHoverCards=tt,b.initModals=_e,b.initScrollAreas=ct,b.initSoltana=cr,b.initTabs=$e,b.initToasts=Xe,b.initTooltips=Pe,b.initTrees=Et,b.loadSoltanaFonts=or,b.showToast=Ft,b.version=lr,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "soltana-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A CSS-first design system inspired by classical architecture and precious materials. Features neumorphic, glassmorphic, and hybrid relief systems with a 3-tier configuration model.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"private": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Soltana",
|
|
9
|
+
"homepage": "https://github.com/soltana-tech/soltana-ui",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/soltana-tech/soltana-ui.git",
|
|
13
|
+
"directory": "packages/soltana-ui"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"design-system",
|
|
17
|
+
"css",
|
|
18
|
+
"scss",
|
|
19
|
+
"neumorphic",
|
|
20
|
+
"glassmorphic",
|
|
21
|
+
"ui-library",
|
|
22
|
+
"design-tokens",
|
|
23
|
+
"theming"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"src/styles"
|
|
28
|
+
],
|
|
29
|
+
"main": "./dist/soltana-ui.umd.cjs",
|
|
30
|
+
"module": "./dist/soltana-ui.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"unpkg": "./dist/soltana-ui.umd.cjs",
|
|
33
|
+
"jsdelivr": "./dist/soltana-ui.umd.cjs",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/soltana-ui.js",
|
|
38
|
+
"require": "./dist/soltana-ui.umd.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./css": "./dist/soltana-ui.css",
|
|
41
|
+
"./style.css": "./dist/soltana-ui.css",
|
|
42
|
+
"./scss": "./src/styles/index.scss",
|
|
43
|
+
"./scss/*": "./src/styles/*",
|
|
44
|
+
"./plugins": {
|
|
45
|
+
"types": "./dist/plugins/index.d.ts",
|
|
46
|
+
"import": "./dist/plugins/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./postcss": {
|
|
49
|
+
"types": "./dist/plugins/postcss-soltana-treeshake.d.ts",
|
|
50
|
+
"import": "./dist/plugins/postcss-soltana-treeshake.js"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"sideEffects": [
|
|
54
|
+
"*.css",
|
|
55
|
+
"*.scss"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc --noEmit && vite build && tsc -p tsconfig.plugins.json",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest",
|
|
61
|
+
"lint": "pnpm run lint:ts && pnpm run lint:style",
|
|
62
|
+
"lint:ts": "eslint .",
|
|
63
|
+
"lint:style": "stylelint \"src/**/*.{css,scss}\" --allow-empty-input",
|
|
64
|
+
"type-check": "tsc --noEmit",
|
|
65
|
+
"prepublishOnly": "pnpm run build"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^25.2.3",
|
|
69
|
+
"fast-check": "^4.5.3",
|
|
70
|
+
"jsdom": "^26.1.0",
|
|
71
|
+
"postcss": "^8.5.6",
|
|
72
|
+
"postcss-scss": "^4.0.9",
|
|
73
|
+
"sass": "^1.97.3",
|
|
74
|
+
"vite": "^7.3.1",
|
|
75
|
+
"vite-plugin-dts": "^4.5.4",
|
|
76
|
+
"vitest": "^3.2.4"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"postcss": "^8.0.0",
|
|
80
|
+
"sass": "^1.50.0"
|
|
81
|
+
},
|
|
82
|
+
"peerDependenciesMeta": {
|
|
83
|
+
"postcss": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"sass": {
|
|
87
|
+
"optional": true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Design Tokens & CSS Custom Properties
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Design tokens: spacing, type, shadow, easing, and icon URI generators.
|
|
5
|
+
// Cinzel (serif) + Raleway (sans) + JetBrains Mono (mono).
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
@use 'sass:list';
|
|
9
|
+
@use 'sass:string';
|
|
10
|
+
|
|
11
|
+
// ---- Spacing scale (4px base) ----
|
|
12
|
+
$spacing-steps: (
|
|
13
|
+
0: 0,
|
|
14
|
+
px: 1px,
|
|
15
|
+
0\.5: 0.125rem,
|
|
16
|
+
1: 0.25rem,
|
|
17
|
+
1\.5: 0.375rem,
|
|
18
|
+
2: 0.5rem,
|
|
19
|
+
2\.5: 0.625rem,
|
|
20
|
+
3: 0.75rem,
|
|
21
|
+
3\.5: 0.875rem,
|
|
22
|
+
4: 1rem,
|
|
23
|
+
5: 1.25rem,
|
|
24
|
+
6: 1.5rem,
|
|
25
|
+
7: 1.75rem,
|
|
26
|
+
8: 2rem,
|
|
27
|
+
9: 2.25rem,
|
|
28
|
+
10: 2.5rem,
|
|
29
|
+
11: 2.75rem,
|
|
30
|
+
12: 3rem,
|
|
31
|
+
14: 3.5rem,
|
|
32
|
+
16: 4rem,
|
|
33
|
+
20: 5rem,
|
|
34
|
+
24: 6rem,
|
|
35
|
+
28: 7rem,
|
|
36
|
+
32: 8rem,
|
|
37
|
+
36: 9rem,
|
|
38
|
+
40: 10rem,
|
|
39
|
+
44: 11rem,
|
|
40
|
+
48: 12rem,
|
|
41
|
+
52: 13rem,
|
|
42
|
+
56: 14rem,
|
|
43
|
+
60: 15rem,
|
|
44
|
+
64: 16rem,
|
|
45
|
+
72: 18rem,
|
|
46
|
+
80: 20rem,
|
|
47
|
+
96: 24rem,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// ---- Font size scale ----
|
|
51
|
+
$font-sizes: (
|
|
52
|
+
2xs: (
|
|
53
|
+
0.625rem,
|
|
54
|
+
0.875rem,
|
|
55
|
+
),
|
|
56
|
+
xs: (
|
|
57
|
+
0.75rem,
|
|
58
|
+
1rem,
|
|
59
|
+
),
|
|
60
|
+
sm: (
|
|
61
|
+
0.875rem,
|
|
62
|
+
1.25rem,
|
|
63
|
+
),
|
|
64
|
+
base: (
|
|
65
|
+
1rem,
|
|
66
|
+
1.65,
|
|
67
|
+
),
|
|
68
|
+
lg: (
|
|
69
|
+
1.125rem,
|
|
70
|
+
1.75rem,
|
|
71
|
+
),
|
|
72
|
+
xl: (
|
|
73
|
+
1.25rem,
|
|
74
|
+
1.75rem,
|
|
75
|
+
),
|
|
76
|
+
2xl: (
|
|
77
|
+
1.5rem,
|
|
78
|
+
2rem,
|
|
79
|
+
),
|
|
80
|
+
3xl: (
|
|
81
|
+
1.875rem,
|
|
82
|
+
2.25rem,
|
|
83
|
+
),
|
|
84
|
+
4xl: (
|
|
85
|
+
2.25rem,
|
|
86
|
+
2.5rem,
|
|
87
|
+
),
|
|
88
|
+
5xl: (
|
|
89
|
+
3rem,
|
|
90
|
+
1.15,
|
|
91
|
+
),
|
|
92
|
+
6xl: (
|
|
93
|
+
3.75rem,
|
|
94
|
+
1.1,
|
|
95
|
+
),
|
|
96
|
+
7xl: (
|
|
97
|
+
4.5rem,
|
|
98
|
+
1.05,
|
|
99
|
+
),
|
|
100
|
+
8xl: (
|
|
101
|
+
6rem,
|
|
102
|
+
1,
|
|
103
|
+
),
|
|
104
|
+
9xl: (
|
|
105
|
+
8rem,
|
|
106
|
+
1,
|
|
107
|
+
),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// ---- Font weight scale ----
|
|
111
|
+
$font-weights: (
|
|
112
|
+
light: 300,
|
|
113
|
+
regular: 400,
|
|
114
|
+
medium: 500,
|
|
115
|
+
semibold: 600,
|
|
116
|
+
bold: 700,
|
|
117
|
+
extrabold: 800,
|
|
118
|
+
'black': 900,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// ---- Border radius scale ----
|
|
122
|
+
$radii: (
|
|
123
|
+
none: 0,
|
|
124
|
+
sm: 0.25rem,
|
|
125
|
+
md: 0.5rem,
|
|
126
|
+
default: 0.625rem,
|
|
127
|
+
lg: 0.875rem,
|
|
128
|
+
xl: 1.125rem,
|
|
129
|
+
2xl: 1.25rem,
|
|
130
|
+
3xl: 1.5rem,
|
|
131
|
+
full: 9999px,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
// ---- Z-index scale ----
|
|
135
|
+
$z-indices: (
|
|
136
|
+
0: 0,
|
|
137
|
+
10: 10,
|
|
138
|
+
20: 20,
|
|
139
|
+
30: 30,
|
|
140
|
+
40: 40,
|
|
141
|
+
50: 50,
|
|
142
|
+
dropdown: 100,
|
|
143
|
+
popover: 150,
|
|
144
|
+
drawer: 200,
|
|
145
|
+
modal: 210,
|
|
146
|
+
toast: 250,
|
|
147
|
+
tooltip: 300,
|
|
148
|
+
skip-link: 9999,
|
|
149
|
+
auto: auto,
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
// ---- Shadow scale ----
|
|
153
|
+
// Static, theme-unaware box-shadow tokens. These produce --shadow-* custom
|
|
154
|
+
// properties with fixed rgb(0 0 0 / ...) values. Theme-aware shadow tokens
|
|
155
|
+
// (--relief-shadow-*) are defined by relief selectors and use the per-theme
|
|
156
|
+
// --shadow-color channel for contextual shadow rendering.
|
|
157
|
+
$shadows: (
|
|
158
|
+
sm: '0 1px 2px 0 rgb(0 0 0 / 8%)',
|
|
159
|
+
default: '0 1px 3px 0 rgb(0 0 0 / 12%), 0 1px 2px -1px rgb(0 0 0 / 8%)',
|
|
160
|
+
md: '0 4px 6px -1px rgb(0 0 0 / 12%), 0 2px 4px -2px rgb(0 0 0 / 8%)',
|
|
161
|
+
lg: '0 10px 15px -3px rgb(0 0 0 / 12%), 0 4px 6px -4px rgb(0 0 0 / 8%)',
|
|
162
|
+
xl: '0 20px 25px -5px rgb(0 0 0 / 14%), 0 8px 10px -6px rgb(0 0 0 / 10%)',
|
|
163
|
+
2xl: '0 25px 50px -12px rgb(0 0 0 / 30%)',
|
|
164
|
+
inner: 'inset 0 2px 4px 0 rgb(0 0 0 / 6%)',
|
|
165
|
+
none: 'none',
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
// ---- Transition durations ----
|
|
169
|
+
$transitions: (
|
|
170
|
+
fast: 75ms,
|
|
171
|
+
normal: 150ms,
|
|
172
|
+
slow: 300ms,
|
|
173
|
+
slower: 500ms,
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
// ---- Easing functions ----
|
|
177
|
+
$easings: (
|
|
178
|
+
in: cubic-bezier(0.4, 0, 1, 1),
|
|
179
|
+
out: cubic-bezier(0, 0, 0.2, 1),
|
|
180
|
+
in-out: cubic-bezier(0.4, 0, 0.2, 1),
|
|
181
|
+
in-out-soft: cubic-bezier(0.4, 0, 0.6, 1),
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
// ---- Breakpoints ----
|
|
185
|
+
$breakpoints: (
|
|
186
|
+
sm: 640px,
|
|
187
|
+
md: 768px,
|
|
188
|
+
lg: 1024px,
|
|
189
|
+
xl: 1280px,
|
|
190
|
+
2xl: 1536px,
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
// ---- Utility scales (shared with responsive) ----
|
|
194
|
+
$gap-steps: (0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24);
|
|
195
|
+
|
|
196
|
+
$space-keys: (0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64);
|
|
197
|
+
|
|
198
|
+
$overflow-values: (auto, hidden, visible, scroll, clip);
|
|
199
|
+
|
|
200
|
+
$size-fractions: (
|
|
201
|
+
'1\\/2': 50%,
|
|
202
|
+
'1\\/3': 33.333%,
|
|
203
|
+
'2\\/3': 66.667%,
|
|
204
|
+
'1\\/4': 25%,
|
|
205
|
+
'3\\/4': 75%,
|
|
206
|
+
full: 100%,
|
|
207
|
+
screen: 100vw,
|
|
208
|
+
min: min-content,
|
|
209
|
+
max: max-content,
|
|
210
|
+
fit: fit-content,
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
$max-widths: (
|
|
214
|
+
xs: 20rem,
|
|
215
|
+
sm: 24rem,
|
|
216
|
+
md: 28rem,
|
|
217
|
+
lg: 32rem,
|
|
218
|
+
xl: 36rem,
|
|
219
|
+
2xl: 42rem,
|
|
220
|
+
3xl: 48rem,
|
|
221
|
+
4xl: 56rem,
|
|
222
|
+
5xl: 64rem,
|
|
223
|
+
6xl: 72rem,
|
|
224
|
+
7xl: 80rem,
|
|
225
|
+
full: 100%,
|
|
226
|
+
prose: 65ch,
|
|
227
|
+
);
|
|
228
|
+
|
|
229
|
+
// ---- Icon data-URI generators ----
|
|
230
|
+
// Each function embeds a single SVG shape with a parameterized fill/stroke color,
|
|
231
|
+
// so theme files can call each function with the appropriate contrast color.
|
|
232
|
+
|
|
233
|
+
@function icon-chevron($color) {
|
|
234
|
+
$c: '%23' + string.slice('#{$color}', 2);
|
|
235
|
+
@return url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='#{$c}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// ---- Component token schema ----
|
|
239
|
+
// Centralizes component token names and provides defaults for derivable tokens.
|
|
240
|
+
// Each theme @includes this inside its selector for correct per-element resolution.
|
|
241
|
+
@mixin component-tokens(
|
|
242
|
+
// Required — differ per theme
|
|
243
|
+
$input-bg,
|
|
244
|
+
$card-bg,
|
|
245
|
+
$tooltip-bg,
|
|
246
|
+
$tooltip-text,
|
|
247
|
+
$code-bg,
|
|
248
|
+
// Defaulted — derivable from semantic tokens
|
|
249
|
+
$input-border: var(--border-default),
|
|
250
|
+
$input-border-focus: var(--accent-primary),
|
|
251
|
+
$input-placeholder: var(--text-muted),
|
|
252
|
+
$card-border: var(--border-default),
|
|
253
|
+
$badge-bg: color-mix(in srgb, var(--accent-primary) 10%, transparent),
|
|
254
|
+
$scrollbar-thumb: color-mix(in srgb, var(--text-primary) 12%, transparent),
|
|
255
|
+
$scrollbar-track: color-mix(in srgb, var(--text-primary) 3%, transparent),
|
|
256
|
+
$toast-bg: var(--surface-1),
|
|
257
|
+
$toast-text: var(--text-primary),
|
|
258
|
+
$drawer-bg: var(--surface-1),
|
|
259
|
+
$popover-bg: var(--surface-1),
|
|
260
|
+
$popover-border: var(--border-default),
|
|
261
|
+
$kbd-bg: var(--surface-2),
|
|
262
|
+
$kbd-border: var(--border-strong),
|
|
263
|
+
$modal-bg: var(--surface-1),
|
|
264
|
+
$overlay-backdrop-bg: rgb(var(--shadow-color) / 60%)
|
|
265
|
+
) {
|
|
266
|
+
--input-bg: #{$input-bg};
|
|
267
|
+
--input-border: #{$input-border};
|
|
268
|
+
--input-border-focus: #{$input-border-focus};
|
|
269
|
+
--input-placeholder: #{$input-placeholder};
|
|
270
|
+
--card-bg: #{$card-bg};
|
|
271
|
+
--card-border: #{$card-border};
|
|
272
|
+
--badge-bg: #{$badge-bg};
|
|
273
|
+
--tooltip-bg: #{$tooltip-bg};
|
|
274
|
+
--tooltip-text: #{$tooltip-text};
|
|
275
|
+
--scrollbar-thumb: #{$scrollbar-thumb};
|
|
276
|
+
--scrollbar-track: #{$scrollbar-track};
|
|
277
|
+
--code-bg: #{$code-bg};
|
|
278
|
+
--toast-bg: #{$toast-bg};
|
|
279
|
+
--toast-text: #{$toast-text};
|
|
280
|
+
--drawer-bg: #{$drawer-bg};
|
|
281
|
+
--popover-bg: #{$popover-bg};
|
|
282
|
+
--popover-border: #{$popover-border};
|
|
283
|
+
--kbd-bg: #{$kbd-bg};
|
|
284
|
+
--kbd-border: #{$kbd-border};
|
|
285
|
+
--modal-bg: #{$modal-bg};
|
|
286
|
+
--overlay-backdrop-bg: #{$overlay-backdrop-bg};
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// ---- CSS custom properties ----
|
|
290
|
+
:root {
|
|
291
|
+
// Radius tokens
|
|
292
|
+
@each $key, $val in $radii {
|
|
293
|
+
--radius-#{$key}: #{$val};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Shadow tokens
|
|
297
|
+
@each $key, $val in $shadows {
|
|
298
|
+
--shadow-#{$key}: #{$val};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Transition tokens
|
|
302
|
+
@each $key, $val in $transitions {
|
|
303
|
+
--transition-#{$key}: #{$val};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Easing tokens
|
|
307
|
+
@each $key, $val in $easings {
|
|
308
|
+
--easing-#{$key}: #{$val};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Z-index tokens
|
|
312
|
+
@each $key, $val in $z-indices {
|
|
313
|
+
@if $val != auto {
|
|
314
|
+
--z-#{$key}: #{$val};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Font families
|
|
319
|
+
--font-sans: 'Raleway', ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
320
|
+
--font-serif: 'Cinzel', 'Georgia', 'Times New Roman', serif;
|
|
321
|
+
--font-display: 'Cinzel Decorative', 'Cinzel', serif;
|
|
322
|
+
--font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
|
|
323
|
+
|
|
324
|
+
// Font sizes
|
|
325
|
+
@each $key, $pair in $font-sizes {
|
|
326
|
+
--text-#{$key}: #{list.nth($pair, 1)};
|
|
327
|
+
--leading-#{$key}: #{list.nth($pair, 2)};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Font weights
|
|
331
|
+
@each $key, $val in $font-weights {
|
|
332
|
+
--font-#{$key}: #{$val};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Letter spacing tokens
|
|
336
|
+
--tracking-refined: 0.02em;
|
|
337
|
+
--tracking-elegant: 0.04em;
|
|
338
|
+
--tracking-display: 0.08em;
|
|
339
|
+
--tracking-inscriptional: 0.12em;
|
|
340
|
+
|
|
341
|
+
// Static palette
|
|
342
|
+
--color-white: #fff;
|
|
343
|
+
--color-black: #000;
|
|
344
|
+
|
|
345
|
+
// Icon masks (colorless SVGs for mask-image usage)
|
|
346
|
+
--icon-checkbox-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
|
347
|
+
--icon-radio-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.5' fill='white'/%3E%3C/svg%3E");
|
|
348
|
+
}
|