UNPKG

@kelvininc/ui-components

Version:
1 lines 969 B
import{S as o}from"./p-COrzvkrr.js";import{D as n}from"./p-B4OowdnI.js";const d=(o={})=>{var d,e;const{window:t}=window;if(void 0===t)return;const i=t.KvUiComponents=null!==(d=t.KvUiComponents)&&void 0!==d?d:{},r=i.config=null!==(e=i.config)&&void 0!==e?e:{};t.KvUiComponents.config=Object.assign(Object.assign(Object.assign({},n),r),o)},e=n=>{var d;Object.values(o).includes(n)?(document.body.setAttribute("mode",n),"undefined"!=typeof window&&(null===(d=window.KvUiComponents)||void 0===d?void 0:d.config)&&(window.KvUiComponents.config.styleMode=n)):console.warn(`Invalid theme mode: ${n}, expected: ${Object.values(o).join(",")}`)},t=()=>{var n,d,e;const t=document.body.getAttribute("mode");return t&&Object.values(o).includes(t)?t:null!==(e=null===(d=null===(n=window.KvUiComponents)||void 0===n?void 0:n.config)||void 0===d?void 0:d.styleMode)&&void 0!==e?e:o.Night},i=()=>{const n=t()===o.Night?o.Light:o.Night;return e(n),n};export{t as g,d as i,e as s,i as t}