@bedrock-layout/solid 0.4.0 → 0.5.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/lib/index.cjs.js +93 -5
- package/lib/index.d.ts +31 -4
- package/lib/index.m.js +126 -1
- package/lib/index.umd.js +93 -5
- package/package.json +2 -2
package/lib/index.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var he=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable;var W=(e,t,n)=>t in e?he(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&W(e,n,t[n]);if(V)for(var n of V(t))ye.call(t,n)&&W(e,n,t[n]);return e},U=(e,t)=>de(e,pe(t));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";let be={data:""},xe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||be,we=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Se=/\/\*[^]*?\*\/|\s\s+|\n/g,b=(e,t)=>{let n="",s="",l="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+o+";":s+=i[1]=="f"?b(o,i):i+"{"+b(o,i[1]=="k"?"":t)+"}":typeof o=="object"?s+=b(o,t?t.replace(/([^,])+/g,r=>i.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,r):r?r+" "+c:c)):i):o!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),l+=b.p?b.p(i,o):i+":"+o+";")}return n+(t&&l?t+"{"+l+"}":l)+s},S={},ee=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+ee(e[n]);return t}return e},Ae=(e,t,n,s,l)=>{let i=ee(e),o=S[i]||(S[i]=(r=>{let c=0,u=11;for(;c<r.length;)u=101*u+r.charCodeAt(c++)>>>0;return"go"+u})(i));if(!S[o]){let r=i!==e?e:(c=>{let u,f=[{}];for(;u=we.exec(c.replace(Se,""));)u[4]?f.shift():u[3]?f.unshift(f[0][u[3]]=f[0][u[3]]||{}):f[0][u[1]]=u[2];return f[0]})(e);S[o]=b(l?{["@keyframes "+o]:r}:r,n?"":"."+o)}return((r,c,u)=>{c.data.indexOf(r)==-1&&(c.data=u?r+c.data:c.data+r)})(S[o],t,s),o},Ce=(e,t,n)=>e.reduce((s,l,i)=>{let o=t[i];if(o&&o.call){let r=o(n),c=r&&r.props&&r.props.className||/^go/.test(r)&&r;o=c?"."+c:r&&typeof r=="object"?r.props?"":b(r,""):r===!1?"":r}return s+l+(o==null?"":o)},"");function P(e){let t=this||{},n=e.call?e(t.p):e;return Ae(n.unshift?n.raw?Ce(n,[].slice.call(arguments,1),t.p):n.reduce((s,l)=>Object.assign(s,l&&l.call?l(t.p):l),{}):n,xe(t.target),t.g,t.o,t.k)}P.bind({g:1});P.bind({k:1});const Ne=(e,t)=>e===t,Ee=Symbol("solid-proxy"),X={equals:Ne};let $e=ie;const T={},y=1,D=2,Pe={owned:null,cleanups:null,context:null,owner:null};var d=null;let N=null,a=null,A=null,g=null,m=null,I=0;function Te(e,t,n){const s=B(e,t,!0,y);E(s)}function C(e,t,n){const s=B(e,t,!1,y);E(s)}function K(e,t,n){n=n?Object.assign({},X,n):X;const s=B(e,t,!0,0);return s.pending=T,s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,E(s),ve.bind(s)}function Le(e){if(A)return e();let t;const n=A=[];try{t=e()}finally{A=null}return se(()=>{for(let s=0;s<n.length;s+=1){const l=n[s];if(l.pending!==T){const i=l.pending;l.pending=T,te(l,i)}}},!1),t}function M(e){let t,n=a;return a=null,t=e(),a=n,t}function Oe(e){const t=Symbol("context");return{id:t,Provider:Me(t),defaultValue:e}}function ke(e){return ce(d,e.id)||e.defaultValue}function je(e){const t=K(e);return K(()=>j(t()))}function ve(){const e=N;if(this.sources&&(this.state||e)){const t=g;g=null,this.state===y||e?E(this):_(this),g=t}if(a){const t=this.observers?this.observers.length:0;a.sources?(a.sources.push(this),a.sourceSlots.push(t)):(a.sources=[this],a.sourceSlots=[t]),this.observers?(this.observers.push(a),this.observerSlots.push(a.sources.length-1)):(this.observers=[a],this.observerSlots=[a.sources.length-1])}return this.value}function te(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(A)return e.pending===T&&A.push(e),e.pending=t,t;let s=!1;return e.value=t,e.observers&&e.observers.length&&se(()=>{for(let l=0;l<e.observers.length;l+=1){const i=e.observers[l];s&&N.disposed.has(i),i.pure?g.push(i):m.push(i),i.observers&&(s&&!i.tState||!s&&!i.state)&&le(i),s||(i.state=y)}if(g.length>1e6)throw g=[],new Error},!1),t}function E(e){if(!e.fn)return;re(e);const t=d,n=a,s=I;a=d=e,De(e,e.value,s),a=n,d=t}function De(e,t,n){let s;try{s=e.fn(t)}catch(l){oe(l)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?te(e,s):e.value=s,e.updatedAt=n)}function B(e,t,n,s=y,l){const i={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:d,context:null,pure:n};return d===null||d!==Pe&&(d.owned?d.owned.push(i):d.owned=[i]),i}function ne(e){const t=N;if(e.state!==y)return e.state=0;if(e.suspense&&M(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<I);)(e.state||t)&&n.push(e);for(let s=n.length-1;s>=0;s--)if(e=n[s],e.state===y||t)E(e);else if(e.state===D||t){const l=g;g=null,_(e,n[0]),g=l}}function se(e,t){if(g)return e();let n=!1;t||(g=[]),m?n=!0:m=[],I++;try{return e()}catch(s){oe(s)}finally{Ie(n)}}function Ie(e){g&&(ie(g),g=null),!e&&(m.length?Le(()=>{$e(m),m=null}):m=null)}function ie(e){for(let t=0;t<e.length;t++)ne(e[t])}function _(e,t){e.state=0;const n=N;for(let s=0;s<e.sources.length;s+=1){const l=e.sources[s];l.sources&&(l.state===y||n?l!==t&&ne(l):(l.state===D||n)&&_(l,t))}}function le(e){const t=N;for(let n=0;n<e.observers.length;n+=1){const s=e.observers[n];(!s.state||t)&&(s.state=D,s.pure?g.push(s):m.push(s),s.observers&&le(s))}}function re(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),s=e.sourceSlots.pop(),l=n.observers;if(l&&l.length){const i=l.pop(),o=n.observerSlots.pop();s<l.length&&(i.sourceSlots[o]=s,l[s]=i,n.observerSlots[s]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)re(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function oe(e){throw e}function ce(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&ce(e.owner,t))}function j(e){if(typeof e=="function"&&!e.length)return j(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const s=j(e[n]);Array.isArray(s)?t.push.apply(t,s):t.push(s)}return t}return e}function Me(e){return function(n){let s;return Te(()=>s=M(()=>(d.context={[e]:n.value},je(()=>n.children)))),s}}function $(){return!0}const ue={get(e,t,n){return t===Ee?n:e.get(t)},has(e,t){return e.has(t)},set:$,deleteProperty:$,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:$,deleteProperty:$}},ownKeys(e){return e.keys()}};function k(e){return typeof e=="function"?e():e}function G(...e){return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const s=k(e[n])[t];if(s!==void 0)return s}},has(t){for(let n=e.length-1;n>=0;n--)if(t in k(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(k(e[n])));return[...new Set(t)]}},ue)}function H(e,...t){const n=new Set(t.flat()),s=Object.getOwnPropertyDescriptors(e),l=t.map(i=>{const o={};for(let r=0;r<i.length;r++){const c=i[r];Object.defineProperty(o,c,s[c]?s[c]:{get(){return e[c]},set(){return!0}})}return o});return l.push(new Proxy({get(i){return n.has(i)?void 0:e[i]},has(i){return n.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!n.has(i))}},ue)),l}const Be=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],_e=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Be]),Fe=new Set(["innerHTML","textContent","innerText","children"]),Ve={className:"class",htmlFor:"for"},R={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},We=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),qe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Ue(e,t,n){let s=n.length,l=t.length,i=s,o=0,r=0,c=t[l-1].nextSibling,u=null;for(;o<l||r<i;){if(t[o]===n[r]){o++,r++;continue}for(;t[l-1]===n[i-1];)l--,i--;if(l===o){const f=i<s?r?n[r-1].nextSibling:n[i-r]:c;for(;r<i;)e.insertBefore(n[r++],f)}else if(i===r)for(;o<l;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[i-1]&&n[r]===t[l-1]){const f=t[--l].nextSibling;e.insertBefore(n[r++],t[o++].nextSibling),e.insertBefore(n[--i],f),t[l]=n[i]}else{if(!u){u=new Map;let h=r;for(;h<i;)u.set(n[h],h++)}const f=u.get(t[o]);if(f!=null)if(r<f&&f<i){let h=o,p=1,w;for(;++h<l&&h<i&&!((w=u.get(t[h]))==null||w!==f+p);)p++;if(p>f-r){const O=t[o];for(;r<f;)e.insertBefore(n[r++],O)}else e.replaceChild(n[r++],t[o++])}else o++;else t[o++].remove()}}}const Q="_$DX_DELEGATE";function Xe(e,t=window.document){const n=t[Q]||(t[Q]=new Set);for(let s=0,l=e.length;s<l;s++){const i=e[s];n.has(i)||(n.add(i),t.addEventListener(i,ze))}}function Ke(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Ge(e,t,n,s){s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s)}function He(e,t,n,s){s?Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n:Array.isArray(n)?e.addEventListener(t,l=>n[0](n[1],l)):e.addEventListener(t,n)}function Re(e,t,n={}){const s=Object.keys(t||{}),l=Object.keys(n);let i,o;for(i=0,o=l.length;i<o;i++){const r=l[i];!r||r==="undefined"||t[r]||(Y(e,r,!1),delete n[r])}for(i=0,o=s.length;i<o;i++){const r=s[i],c=!!t[r];!r||r==="undefined"||n[r]===c||!c||(Y(e,r,!0),n[r]=c)}return n}function Qe(e,t,n={}){const s=e.style;if(t==null||typeof t=="string")return s.cssText=t;typeof n=="string"&&(n={});let l,i;for(i in n)t[i]==null&&s.removeProperty(i),delete n[i];for(i in t)l=t[i],l!==n[i]&&(s.setProperty(i,l),n[i]=l);return n}function Ye(e,t,n,s){typeof t=="function"?C(l=>J(e,t(),l,n,s)):J(e,t,void 0,n,s)}function Ze(e,t,n,s,l={}){for(const i in l)if(!(i in t)){if(i==="children")continue;Z(e,i,null,l[i],n)}for(const i in t){if(i==="children"){s||L(e,t.children);continue}const o=t[i];l[i]=Z(e,i,o,l[i],n)}}function Je(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Y(e,t,n){const s=t.trim().split(/\s+/);for(let l=0,i=s.length;l<i;l++)e.classList.toggle(s[l],n)}function Z(e,t,n,s,l){let i,o,r;if(t==="style")return Qe(e,n,s);if(t==="classList")return Re(e,n,s);if(n===s)return s;if(t==="ref")n(e);else if(t.slice(0,3)==="on:")e.addEventListener(t.slice(3),n);else if(t.slice(0,10)==="oncapture:")e.addEventListener(t.slice(10),n,!0);else if(t.slice(0,2)==="on"){const c=t.slice(2).toLowerCase(),u=We.has(c);He(e,c,n,u),u&&Xe([c])}else if((r=Fe.has(t))||!l&&(R[t]||(o=_e.has(t)))||(i=e.nodeName.includes("-")))i&&!o&&!r?e[Je(t)]=n:e[R[t]||t]=n;else{const c=l&&t.indexOf(":")>-1&&qe[t.split(":")[0]];c?Ge(e,c,t,n):Ke(e,Ve[t]||t,n)}return n}function ze(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n!==null;){const s=n[t];if(s&&!n.disabled){const l=n[`${t}Data`];if(l!==void 0?s(l,e):s(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function J(e,t,n={},s,l){return!l&&"children"in t&&C(()=>n.children=L(e,t.children,n.children)),C(()=>Ze(e,t,s,!0,n)),n}function L(e,t,n,s,l){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,o=s!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),o){let r=n[0];r&&r.nodeType===3?r.data=t:r=document.createTextNode(t),n=x(e,n,s,r)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=x(e,n,s);else{if(i==="function")return C(()=>{let r=t();for(;typeof r=="function";)r=r();n=L(e,r,n,s)}),()=>n;if(Array.isArray(t)){const r=[];if(v(r,t,l))return C(()=>n=L(e,r,n,s,!0)),()=>n;if(r.length===0){if(n=x(e,n,s),o)return n}else Array.isArray(n)?n.length===0?z(e,r,s):Ue(e,n,r):(n&&x(e),z(e,r));n=r}else if(t instanceof Node){if(Array.isArray(n)){if(o)return n=x(e,n,s,t);x(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n){let s=!1;for(let l=0,i=t.length;l<i;l++){let o=t[l],r;if(o instanceof Node)e.push(o);else if(!(o==null||o===!0||o===!1))if(Array.isArray(o))s=v(e,o)||s;else if((r=typeof o)=="string")e.push(document.createTextNode(o));else if(r==="function")if(n){for(;typeof o=="function";)o=o();s=v(e,Array.isArray(o)?o:[o])||s}else e.push(o),s=!0;else e.push(document.createTextNode(o.toString()))}return s}function z(e,t,n){for(let s=0,l=t.length;s<l;s++)e.insertBefore(t[s],n)}function x(e,t,n,s){if(n===void 0)return e.textContent="";const l=s||document.createTextNode("");if(t.length){let i=!1;for(let o=t.length-1;o>=0;o--){const r=t[o];if(l!==r){const c=r.parentNode===e;!i&&!o?c?e.replaceChild(l,r):e.insertBefore(l,n):c&&r.remove()}else i=!0}}else e.insertBefore(l,n);return[l]}function et(e,...t){}const tt=!1,nt=Oe();function st(e){let t=this||{};return(...n)=>{const s=l=>{const i=ke(nt),o=G(l,{theme:i}),r=G(o,{get className(){const p=o.className,w="className"in o&&/^go[0-9]+/.test(p);let O=P.apply({target:t.target,o:w,p:o,g:t.g},n);return[p,O].filter(Boolean).join(" ")}}),[c,u]=H(r,["as"]),f=c.as||e;let h;if(typeof f=="function")h=f(u);else if(tt){const[p,w]=H(u,["children"]);h=et([`<${f} `,">",`</${f}>`],void 0,p.children||"")}else h=document.createElement(f),Ye(h,u);return h};return s.className=l=>M(()=>P.apply({target:t.target,p:l,g:t.g},n)),s}}const fe=new Proxy(st,{get(e,t){return e(t)}});function ae(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1,100}\)$/].some(t=>t.test(e))}const ge={none:"0px",xxs:"0.0625rem",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",mdLg:"0.75rem",lg:"1rem",lgXl:"1.5rem",xl:"2rem",xlXXl:"3rem",xxl:"4rem"};function it(e){return e.reduce((t,[n,s])=>U(q({},t),{[n]:s}),{})}const F=(e,t)=>{var o,r;const n=(r=(o=t==null?void 0:t.space)!=null?o:t==null?void 0:t.spacing)!=null?r:ge,l=it(Object.entries(n).map(([c,u])=>[c,typeof u=="number"?`${u}px`:u]))[e];return ae(l)?l:void 0},lt=fe("div")`
|
|
1
|
+
"use strict";var de=Object.defineProperty,he=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var ye=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var z=(e,t,n)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t)=>{for(var n in t||(t={}))ye.call(t,n)&&z(e,n,t[n]);if(_)for(var n of _(t))me.call(t,n)&&z(e,n,t[n]);return e},q=(e,t)=>he(e,pe(t));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";let xe={data:""},be=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||xe,we=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Se=/\/\*[^]*?\*\/|\s\s+|\n/g,x=(e,t)=>{let n="",i="",r="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":i+=s[1]=="f"?x(o,s):s+"{"+x(o,s[1]=="k"?"":t)+"}":typeof o=="object"?i+=x(o,t?t.replace(/([^,])+/g,l=>s.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=x.p?x.p(s,o):s+":"+o+";")}return n+(t&&r?t+"{"+r+"}":r)+i},A={},te=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+te(e[n]);return t}return e},Ae=(e,t,n,i,r)=>{let s=te(e),o=A[s]||(A[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!A[o]){let l=s!==e?e:(c=>{let u,f=[{}];for(;u=we.exec(c.replace(Se,""));)u[4]?f.shift():u[3]?f.unshift(f[0][u[3]]=f[0][u[3]]||{}):f[0][u[1]]=u[2];return f[0]})(e);A[o]=x(r?{["@keyframes "+o]:l}:l,n?"":"."+o)}return((l,c,u)=>{c.data.indexOf(l)==-1&&(c.data=u?l+c.data:c.data+l)})(A[o],t,i),o},Ce=(e,t,n)=>e.reduce((i,r,s)=>{let o=t[s];if(o&&o.call){let l=o(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;o=c?"."+c:l&&typeof l=="object"?l.props?"":x(l,""):l===!1?"":l}return i+r+(o==null?"":o)},"");function b(e){let t=this||{},n=e.call?e(t.p):e;return Ae(n.unshift?n.raw?Ce(n,[].slice.call(arguments,1),t.p):n.reduce((i,r)=>Object.assign(i,r&&r.call?r(t.p):r),{}):n,be(t.target),t.g,t.o,t.k)}b.bind({g:1});b.bind({k:1});const $e=(e,t)=>e===t,ve=Symbol("solid-proxy"),U={equals:$e};let Ne=re;const T={},m=1,M=2,Ee={owned:null,cleanups:null,context:null,owner:null};var h=null;let v=null,a=null,C=null,g=null,y=null,F=0;function ke(e,t,n){const i=R(e,t,!0,m);N(i)}function $(e,t,n){const i=R(e,t,!1,m);N(i)}function X(e,t,n){n=n?Object.assign({},U,n):U;const i=R(e,t,!0,0);return i.pending=T,i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,N(i),je.bind(i)}function Te(e){if(C)return e();let t;const n=C=[];try{t=e()}finally{C=null}return se(()=>{for(let i=0;i<n.length;i+=1){const r=n[i];if(r.pending!==T){const s=r.pending;r.pending=T,ne(r,s)}}},!1),t}function B(e){let t,n=a;return a=null,t=e(),a=n,t}function Pe(e){const t=Symbol("context");return{id:t,Provider:Me(t),defaultValue:e}}function Le(e){return ue(h,e.id)||e.defaultValue}function Oe(e){const t=X(e);return X(()=>D(t()))}function je(){const e=v;if(this.sources&&(this.state||e)){const t=g;g=null,this.state===m||e?N(this):W(this),g=t}if(a){const t=this.observers?this.observers.length:0;a.sources?(a.sources.push(this),a.sourceSlots.push(t)):(a.sources=[this],a.sourceSlots=[t]),this.observers?(this.observers.push(a),this.observerSlots.push(a.sources.length-1)):(this.observers=[a],this.observerSlots=[a.sources.length-1])}return this.value}function ne(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(C)return e.pending===T&&C.push(e),e.pending=t,t;let i=!1;return e.value=t,e.observers&&e.observers.length&&se(()=>{for(let r=0;r<e.observers.length;r+=1){const s=e.observers[r];i&&v.disposed.has(s),s.pure?g.push(s):y.push(s),s.observers&&(i&&!s.tState||!i&&!s.state)&&le(s),i||(s.state=m)}if(g.length>1e6)throw g=[],new Error},!1),t}function N(e){if(!e.fn)return;oe(e);const t=h,n=a,i=F;a=h=e,De(e,e.value,i),a=n,h=t}function De(e,t,n){let i;try{i=e.fn(t)}catch(r){ce(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?ne(e,i):e.value=i,e.updatedAt=n)}function R(e,t,n,i=m,r){const s={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:h,context:null,pure:n};return h===null||h!==Ee&&(h.owned?h.owned.push(s):h.owned=[s]),s}function ie(e){const t=v;if(e.state!==m)return e.state=0;if(e.suspense&&B(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<F);)(e.state||t)&&n.push(e);for(let i=n.length-1;i>=0;i--)if(e=n[i],e.state===m||t)N(e);else if(e.state===M||t){const r=g;g=null,W(e,n[0]),g=r}}function se(e,t){if(g)return e();let n=!1;t||(g=[]),y?n=!0:y=[],F++;try{return e()}catch(i){ce(i)}finally{Ie(n)}}function Ie(e){g&&(re(g),g=null),!e&&(y.length?Te(()=>{Ne(y),y=null}):y=null)}function re(e){for(let t=0;t<e.length;t++)ie(e[t])}function W(e,t){e.state=0;const n=v;for(let i=0;i<e.sources.length;i+=1){const r=e.sources[i];r.sources&&(r.state===m||n?r!==t&&ie(r):(r.state===M||n)&&W(r,t))}}function le(e){const t=v;for(let n=0;n<e.observers.length;n+=1){const i=e.observers[n];(!i.state||t)&&(i.state=M,i.pure?g.push(i):y.push(i),i.observers&&le(i))}}function oe(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),i=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){const s=r.pop(),o=n.observerSlots.pop();i<r.length&&(s.sourceSlots[o]=i,r[i]=s,n.observerSlots[i]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)oe(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function ce(e){throw e}function ue(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&ue(e.owner,t))}function D(e){if(typeof e=="function"&&!e.length)return D(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const i=D(e[n]);Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}return e}function Me(e){return function(n){let i;return ke(()=>i=B(()=>(h.context={[e]:n.value},Oe(()=>n.children)))),i}}function k(){return!0}const fe={get(e,t,n){return t===ve?n:e.get(t)},has(e,t){return e.has(t)},set:k,deleteProperty:k,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:k,deleteProperty:k}},ownKeys(e){return e.keys()}};function j(e){return typeof e=="function"?e():e}function K(...e){return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const i=j(e[n])[t];if(i!==void 0)return i}},has(t){for(let n=e.length-1;n>=0;n--)if(t in j(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(j(e[n])));return[...new Set(t)]}},fe)}function G(e,...t){const n=new Set(t.flat()),i=Object.getOwnPropertyDescriptors(e),r=t.map(s=>{const o={};for(let l=0;l<s.length;l++){const c=s[l];Object.defineProperty(o,c,i[c]?i[c]:{get(){return e[c]},set(){return!0}})}return o});return r.push(new Proxy({get(s){return n.has(s)?void 0:e[s]},has(s){return n.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!n.has(s))}},fe)),r}const Fe=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Be=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Fe]),Re=new Set(["innerHTML","textContent","innerText","children"]),We={className:"class",htmlFor:"for"},H={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},_e=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ze={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Ve(e,t,n){let i=n.length,r=t.length,s=i,o=0,l=0,c=t[r-1].nextSibling,u=null;for(;o<r||l<s;){if(t[o]===n[l]){o++,l++;continue}for(;t[r-1]===n[s-1];)r--,s--;if(r===o){const f=s<i?l?n[l-1].nextSibling:n[s-l]:c;for(;l<s;)e.insertBefore(n[l++],f)}else if(s===l)for(;o<r;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[l]===t[r-1]){const f=t[--r].nextSibling;e.insertBefore(n[l++],t[o++].nextSibling),e.insertBefore(n[--s],f),t[r]=n[s]}else{if(!u){u=new Map;let d=l;for(;d<s;)u.set(n[d],d++)}const f=u.get(t[o]);if(f!=null)if(l<f&&f<s){let d=o,p=1,S;for(;++d<r&&d<s&&!((S=u.get(t[d]))==null||S!==f+p);)p++;if(p>f-l){const O=t[o];for(;l<f;)e.insertBefore(n[l++],O)}else e.replaceChild(n[l++],t[o++])}else o++;else t[o++].remove()}}}const Q="_$DX_DELEGATE";function qe(e,t=window.document){const n=t[Q]||(t[Q]=new Set);for(let i=0,r=e.length;i<r;i++){const s=e[i];n.has(s)||(n.add(s),t.addEventListener(s,Je))}}function Ue(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Xe(e,t,n,i){i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i)}function Ke(e,t,n,i){i?Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n:Array.isArray(n)?e.addEventListener(t,r=>n[0](n[1],r)):e.addEventListener(t,n)}function Ge(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let s,o;for(s=0,o=r.length;s<o;s++){const l=r[s];!l||l==="undefined"||t[l]||(Y(e,l,!1),delete n[l])}for(s=0,o=i.length;s<o;s++){const l=i[s],c=!!t[l];!l||l==="undefined"||n[l]===c||!c||(Y(e,l,!0),n[l]=c)}return n}function He(e,t,n={}){const i=e.style;if(t==null||typeof t=="string")return i.cssText=t;typeof n=="string"&&(n={});let r,s;for(s in n)t[s]==null&&i.removeProperty(s),delete n[s];for(s in t)r=t[s],r!==n[s]&&(i.setProperty(s,r),n[s]=r);return n}function Qe(e,t,n,i){typeof t=="function"?$(r=>J(e,t(),r,n,i)):J(e,t,void 0,n,i)}function Ye(e,t,n,i,r={}){for(const s in r)if(!(s in t)){if(s==="children")continue;Z(e,s,null,r[s],n)}for(const s in t){if(s==="children"){i||P(e,t.children);continue}const o=t[s];r[s]=Z(e,s,o,r[s],n)}}function Ze(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Y(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,s=i.length;r<s;r++)e.classList.toggle(i[r],n)}function Z(e,t,n,i,r){let s,o,l;if(t==="style")return He(e,n,i);if(t==="classList")return Ge(e,n,i);if(n===i)return i;if(t==="ref")n(e);else if(t.slice(0,3)==="on:")e.addEventListener(t.slice(3),n);else if(t.slice(0,10)==="oncapture:")e.addEventListener(t.slice(10),n,!0);else if(t.slice(0,2)==="on"){const c=t.slice(2).toLowerCase(),u=_e.has(c);Ke(e,c,n,u),u&&qe([c])}else if((l=Re.has(t))||!r&&(H[t]||(o=Be.has(t)))||(s=e.nodeName.includes("-")))s&&!o&&!l?e[Ze(t)]=n:e[H[t]||t]=n;else{const c=r&&t.indexOf(":")>-1&&ze[t.split(":")[0]];c?Xe(e,c,t,n):Ue(e,We[t]||t,n)}return n}function Je(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n!==null;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i(r,e):i(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function J(e,t,n={},i,r){return!r&&"children"in t&&$(()=>n.children=P(e,t.children,n.children)),$(()=>Ye(e,t,i,!0,n)),n}function P(e,t,n,i,r){for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,o=i!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,s==="string"||s==="number")if(s==="number"&&(t=t.toString()),o){let l=n[0];l&&l.nodeType===3?l.data=t:l=document.createTextNode(t),n=w(e,n,i,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||s==="boolean")n=w(e,n,i);else{if(s==="function")return $(()=>{let l=t();for(;typeof l=="function";)l=l();n=P(e,l,n,i)}),()=>n;if(Array.isArray(t)){const l=[];if(I(l,t,r))return $(()=>n=P(e,l,n,i,!0)),()=>n;if(l.length===0){if(n=w(e,n,i),o)return n}else Array.isArray(n)?n.length===0?ee(e,l,i):Ve(e,n,l):(n&&w(e),ee(e,l));n=l}else if(t instanceof Node){if(Array.isArray(n)){if(o)return n=w(e,n,i,t);w(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function I(e,t,n){let i=!1;for(let r=0,s=t.length;r<s;r++){let o=t[r],l;if(o instanceof Node)e.push(o);else if(!(o==null||o===!0||o===!1))if(Array.isArray(o))i=I(e,o)||i;else if((l=typeof o)=="string")e.push(document.createTextNode(o));else if(l==="function")if(n){for(;typeof o=="function";)o=o();i=I(e,Array.isArray(o)?o:[o])||i}else e.push(o),i=!0;else e.push(document.createTextNode(o.toString()))}return i}function ee(e,t,n){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function w(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const l=t[o];if(r!==l){const c=l.parentNode===e;!s&&!o?c?e.replaceChild(r,l):e.insertBefore(r,n):c&&l.remove()}else s=!0}}else e.insertBefore(r,n);return[r]}function et(e,...t){}const tt=!1,nt=Pe();function it(e){let t=this||{};return(...n)=>{const i=r=>{const s=Le(nt),o=K(r,{theme:s}),l=K(o,{get className(){const p=o.className,S="className"in o&&/^go[0-9]+/.test(p);let O=b.apply({target:t.target,o:S,p:o,g:t.g},n);return[p,O].filter(Boolean).join(" ")}}),[c,u]=G(l,["as"]),f=c.as||e;let d;if(typeof f=="function")d=f(u);else if(tt){const[p,S]=G(u,["children"]);d=et([`<${f} `,">",`</${f}>`],void 0,p.children||"")}else d=document.createElement(f),Qe(d,u);return d};return i.className=r=>B(()=>b.apply({target:t.target,p:r,g:t.g},n)),i}}const E=new Proxy(it,{get(e,t){return e(t)}});function ae(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1,100}\)$/].some(t=>t.test(e))}const ge={none:"0px",xxs:"0.0625rem",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",mdLg:"0.75rem",lg:"1rem",lgXl:"1.5rem",xl:"2rem",xlXXl:"3rem",xxl:"4rem"};function st(e){return e.reduce((t,[n,i])=>q(V({},t),{[n]:i}),{})}const L=(e,t)=>{var o,l;const n=(l=(o=t==null?void 0:t.space)!=null?o:t==null?void 0:t.spacing)!=null?l:ge,r=st(Object.entries(n).map(([c,u])=>[c,typeof u=="number"?`${u}px`:u]))[e];return ae(r)?r:void 0},rt=E("div")`
|
|
2
2
|
@property --gutter {
|
|
3
3
|
syntax: "<length-percentage>";
|
|
4
4
|
inherits: false;
|
|
5
5
|
initial-value: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
8
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=L(e.gutter,e.theme))!=null?t:"0px"}};
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
> * {
|
|
11
11
|
margin: 0;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
& > [data-bedrock-column] {
|
|
20
20
|
grid-column: span 1 / auto;
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,lt=E("div")`
|
|
23
23
|
@property --gutter {
|
|
24
24
|
syntax: "<length-percentage>";
|
|
25
25
|
inherits: false;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
initial-value: 639px;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
35
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=L(e.gutter,e.theme))!=null?t:"0px"}};
|
|
36
36
|
--minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
|
|
37
37
|
|
|
38
38
|
box-sizing: border-box;
|
|
@@ -47,4 +47,92 @@
|
|
|
47
47
|
auto-fit,
|
|
48
48
|
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
49
49
|
);
|
|
50
|
-
`;
|
|
50
|
+
`;function ot(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const ct=E("div")`
|
|
51
|
+
@property --maxWidth {
|
|
52
|
+
syntax: "<length-percentage>";
|
|
53
|
+
inherits: false;
|
|
54
|
+
initial-value: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
--maxWidth: ${e=>ot(e.maxWidth)};
|
|
58
|
+
|
|
59
|
+
box-sizing: content-box;
|
|
60
|
+
|
|
61
|
+
margin-inline-start: auto;
|
|
62
|
+
margin-inline-end: auto;
|
|
63
|
+
margin-inline: auto;
|
|
64
|
+
|
|
65
|
+
max-inline-size: var(--maxWidth, 100%);
|
|
66
|
+
|
|
67
|
+
${e=>e.centerChildren?b`
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-items: center;
|
|
71
|
+
`:""}
|
|
72
|
+
|
|
73
|
+
${e=>e.centerText?b`
|
|
74
|
+
text-align: center;
|
|
75
|
+
`:""}
|
|
76
|
+
`;function ut(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const ft=E("div")`
|
|
77
|
+
@property --basis {
|
|
78
|
+
syntax: "<length-percentage>";
|
|
79
|
+
inherits: true;
|
|
80
|
+
initial-value: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@property --gutter {
|
|
84
|
+
syntax: "<length-percentage>";
|
|
85
|
+
inherits: false;
|
|
86
|
+
initial-value: 0px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
--basis: ${e=>ut(e.basis)};
|
|
90
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=L(e.gutter,e.theme))!=null?t:"0px"}};
|
|
91
|
+
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
> * {
|
|
94
|
+
margin: 0;
|
|
95
|
+
flex-basis: var(--basis, 100%);
|
|
96
|
+
flex-grow: ${e=>e.noStretchedColumns?"0":"1"};
|
|
97
|
+
flex-shrink: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
gap: var(--gutter, 0px);
|
|
103
|
+
`;function at(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000}\/\d{1,1000}$/.test(e)}function gt(e){return Array.isArray(e)?e.join("/"):e}function dt(e){return at(e)?gt(e):void 0}const ht=E.div`
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
display: block;
|
|
106
|
+
inline-size: 100%;
|
|
107
|
+
position: relative;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
|
|
110
|
+
${e=>{const t=dt(e.ratio);return t?b`
|
|
111
|
+
aspect-ratio: ${t};
|
|
112
|
+
`:""}};
|
|
113
|
+
|
|
114
|
+
> * {
|
|
115
|
+
position: absolute;
|
|
116
|
+
|
|
117
|
+
inset-block-start: 0;
|
|
118
|
+
inset-block-end: 0;
|
|
119
|
+
inset-inline-start: 0;
|
|
120
|
+
inset-inline-end: 0;
|
|
121
|
+
|
|
122
|
+
inset-block: 0;
|
|
123
|
+
inset-inline: 0;
|
|
124
|
+
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
align-items: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
> :is(img, video) {
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
block-size: 100%;
|
|
133
|
+
size: 100%;
|
|
134
|
+
|
|
135
|
+
object-fit: cover;
|
|
136
|
+
object-position: ${e=>typeof e.position=="string"?e.position:"50%"};
|
|
137
|
+
}
|
|
138
|
+
`;exports.Center=ct;exports.ColumnDrop=ft;exports.Frame=ht;exports.Grid=lt;exports.Stack=rt;exports.checkIsCSSLength=ae;exports.getSpacingValue=L;exports.spacing=ge;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from "solid-js/jsx-runtime";
|
|
1
2
|
import { DefaultTheme } from "solid-styled-components";
|
|
2
3
|
declare type LowercaseCharacter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
|
|
3
4
|
declare type AllCharacter = LowercaseCharacter | Uppercase<LowercaseCharacter>;
|
|
@@ -31,15 +32,41 @@ export declare const getSpacingValue: GetSpacingValue;
|
|
|
31
32
|
export interface StackProps {
|
|
32
33
|
gutter?: SpacingOptions;
|
|
33
34
|
}
|
|
34
|
-
export declare const Stack: ((props: StackProps &
|
|
35
|
-
className: (props: StackProps &
|
|
35
|
+
export declare const Stack: ((props: StackProps & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
36
|
+
className: (props: StackProps & JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
36
37
|
};
|
|
37
38
|
declare type MinItemWidth = number | CSSLength;
|
|
38
39
|
export interface GridProps {
|
|
39
40
|
gutter?: SpacingOptions;
|
|
40
41
|
minItemWidth?: MinItemWidth;
|
|
41
42
|
}
|
|
42
|
-
export declare const Grid: ((props: GridProps &
|
|
43
|
-
className: (props: GridProps &
|
|
43
|
+
export declare const Grid: ((props: GridProps & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
44
|
+
className: (props: GridProps & JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
45
|
+
};
|
|
46
|
+
declare type MaxWidth = number | CSSLength;
|
|
47
|
+
export interface CenterProps {
|
|
48
|
+
maxWidth?: MaxWidth;
|
|
49
|
+
centerText?: boolean;
|
|
50
|
+
centerChildren?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare const Center: ((props: CenterProps & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
53
|
+
className: (props: CenterProps & JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
54
|
+
};
|
|
55
|
+
declare type Basis = CSSLength | number;
|
|
56
|
+
export interface ColumnDropProps {
|
|
57
|
+
gutter?: SpacingOptions;
|
|
58
|
+
basis?: Basis;
|
|
59
|
+
noStretchedColumns?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare const ColumnDrop: ((props: ColumnDropProps & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
62
|
+
className: (props: ColumnDropProps & JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
63
|
+
};
|
|
64
|
+
declare type Ratio = [number, number] | `${number}/${number}`;
|
|
65
|
+
export interface FrameProps {
|
|
66
|
+
ratio?: Ratio;
|
|
67
|
+
position?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare const Frame: ((props: FrameProps & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
70
|
+
className: (props: FrameProps & JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
44
71
|
};
|
|
45
72
|
export {};
|
package/lib/index.m.js
CHANGED
|
@@ -1011,4 +1011,129 @@ const Grid = styled("div")`
|
|
|
1011
1011
|
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
1012
1012
|
);
|
|
1013
1013
|
`;
|
|
1014
|
-
|
|
1014
|
+
function getSafeMaxWidth(maxWidth) {
|
|
1015
|
+
if (maxWidth === void 0)
|
|
1016
|
+
return "100%";
|
|
1017
|
+
if (typeof maxWidth === "number")
|
|
1018
|
+
return `${maxWidth}px`;
|
|
1019
|
+
return maxWidth;
|
|
1020
|
+
}
|
|
1021
|
+
const Center = styled("div")`
|
|
1022
|
+
@property --maxWidth {
|
|
1023
|
+
syntax: "<length-percentage>";
|
|
1024
|
+
inherits: false;
|
|
1025
|
+
initial-value: 100%;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
--maxWidth: ${(props) => getSafeMaxWidth(props.maxWidth)};
|
|
1029
|
+
|
|
1030
|
+
box-sizing: content-box;
|
|
1031
|
+
|
|
1032
|
+
margin-inline-start: auto;
|
|
1033
|
+
margin-inline-end: auto;
|
|
1034
|
+
margin-inline: auto;
|
|
1035
|
+
|
|
1036
|
+
max-inline-size: var(--maxWidth, 100%);
|
|
1037
|
+
|
|
1038
|
+
${(props) => props.centerChildren ? u`
|
|
1039
|
+
display: flex;
|
|
1040
|
+
flex-direction: column;
|
|
1041
|
+
align-items: center;
|
|
1042
|
+
` : ""}
|
|
1043
|
+
|
|
1044
|
+
${(props) => props.centerText ? u`
|
|
1045
|
+
text-align: center;
|
|
1046
|
+
` : ""}
|
|
1047
|
+
`;
|
|
1048
|
+
function getSafeBasis(basis) {
|
|
1049
|
+
if (basis === void 0)
|
|
1050
|
+
return "100%";
|
|
1051
|
+
if (typeof basis === "number")
|
|
1052
|
+
return `${basis}px`;
|
|
1053
|
+
return basis;
|
|
1054
|
+
}
|
|
1055
|
+
const ColumnDrop = styled("div")`
|
|
1056
|
+
@property --basis {
|
|
1057
|
+
syntax: "<length-percentage>";
|
|
1058
|
+
inherits: true;
|
|
1059
|
+
initial-value: 100%;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
@property --gutter {
|
|
1063
|
+
syntax: "<length-percentage>";
|
|
1064
|
+
inherits: false;
|
|
1065
|
+
initial-value: 0px;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
--basis: ${(props) => getSafeBasis(props.basis)};
|
|
1069
|
+
--gutter: ${(props) => {
|
|
1070
|
+
var _a;
|
|
1071
|
+
return props.gutter ? (_a = getSpacingValue(props.gutter, props.theme)) != null ? _a : "0px" : "0px";
|
|
1072
|
+
}};
|
|
1073
|
+
|
|
1074
|
+
box-sizing: border-box;
|
|
1075
|
+
> * {
|
|
1076
|
+
margin: 0;
|
|
1077
|
+
flex-basis: var(--basis, 100%);
|
|
1078
|
+
flex-grow: ${(props) => props.noStretchedColumns ? "0" : "1"};
|
|
1079
|
+
flex-shrink: 1;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
display: flex;
|
|
1083
|
+
flex-wrap: wrap;
|
|
1084
|
+
gap: var(--gutter, 0px);
|
|
1085
|
+
`;
|
|
1086
|
+
function checkIsRatio(ratio) {
|
|
1087
|
+
const isCorrectArray = Array.isArray(ratio) && ratio.length === 2 && ratio.every(Number.isFinite);
|
|
1088
|
+
return isCorrectArray || typeof ratio === "string" && /^\d{1,1000}\/\d{1,1000}$/.test(ratio);
|
|
1089
|
+
}
|
|
1090
|
+
function getRatioString(ratio) {
|
|
1091
|
+
return Array.isArray(ratio) ? ratio.join("/") : ratio;
|
|
1092
|
+
}
|
|
1093
|
+
function getSafeRatio(ratio) {
|
|
1094
|
+
const isRatio = checkIsRatio(ratio);
|
|
1095
|
+
return isRatio ? getRatioString(ratio) : void 0;
|
|
1096
|
+
}
|
|
1097
|
+
const Frame = styled.div`
|
|
1098
|
+
box-sizing: border-box;
|
|
1099
|
+
display: block;
|
|
1100
|
+
inline-size: 100%;
|
|
1101
|
+
position: relative;
|
|
1102
|
+
overflow: hidden;
|
|
1103
|
+
|
|
1104
|
+
${(props) => {
|
|
1105
|
+
const maybeRatio = getSafeRatio(props.ratio);
|
|
1106
|
+
if (maybeRatio) {
|
|
1107
|
+
return u`
|
|
1108
|
+
aspect-ratio: ${maybeRatio};
|
|
1109
|
+
`;
|
|
1110
|
+
}
|
|
1111
|
+
return "";
|
|
1112
|
+
}};
|
|
1113
|
+
|
|
1114
|
+
> * {
|
|
1115
|
+
position: absolute;
|
|
1116
|
+
|
|
1117
|
+
inset-block-start: 0;
|
|
1118
|
+
inset-block-end: 0;
|
|
1119
|
+
inset-inline-start: 0;
|
|
1120
|
+
inset-inline-end: 0;
|
|
1121
|
+
|
|
1122
|
+
inset-block: 0;
|
|
1123
|
+
inset-inline: 0;
|
|
1124
|
+
|
|
1125
|
+
display: flex;
|
|
1126
|
+
justify-content: center;
|
|
1127
|
+
align-items: center;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
> :is(img, video) {
|
|
1131
|
+
inline-size: 100%;
|
|
1132
|
+
block-size: 100%;
|
|
1133
|
+
size: 100%;
|
|
1134
|
+
|
|
1135
|
+
object-fit: cover;
|
|
1136
|
+
object-position: ${(props) => typeof props.position === "string" ? props.position : "50%"};
|
|
1137
|
+
}
|
|
1138
|
+
`;
|
|
1139
|
+
export { Center, ColumnDrop, Frame, Grid, Stack, checkIsCSSLength, getSpacingValue, spacing };
|
package/lib/index.umd.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var st=Object.defineProperty,it=Object.defineProperties;var lt=Object.getOwnPropertyDescriptors;var ge=Object.getOwnPropertySymbols;var rt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable;var de=(a,g,m)=>g in a?st(a,g,{enumerable:!0,configurable:!0,writable:!0,value:m}):a[g]=m,he=(a,g)=>{for(var m in g||(g={}))rt.call(g,m)&&de(a,m,g[m]);if(ge)for(var m of ge(g))ot.call(g,m)&&de(a,m,g[m]);return a},pe=(a,g)=>it(a,lt(g));(function(a,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(a=typeof globalThis!="undefined"?globalThis:a||self,g(a.solid={}))})(this,function(a){"use strict";let g={data:""},m=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||g,me=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ye=/\/\*[^]*?\*\/|\s\s+|\n/g,S=(e,t)=>{let n="",s="",l="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+o+";":s+=i[1]=="f"?S(o,i):i+"{"+S(o,i[1]=="k"?"":t)+"}":typeof o=="object"?s+=S(o,t?t.replace(/([^,])+/g,r=>i.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,r):r?r+" "+u:u)):i):o!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),l+=S.p?S.p(i,o):i+":"+o+";")}return n+(t&&l?t+"{"+l+"}":l)+s},C={},U=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+U(e[n]);return t}return e},be=(e,t,n,s,l)=>{let i=U(e),o=C[i]||(C[i]=(r=>{let u=0,c=11;for(;u<r.length;)c=101*c+r.charCodeAt(u++)>>>0;return"go"+c})(i));if(!C[o]){let r=i!==e?e:(u=>{let c,f=[{}];for(;c=me.exec(u.replace(ye,""));)c[4]?f.shift():c[3]?f.unshift(f[0][c[3]]=f[0][c[3]]||{}):f[0][c[1]]=c[2];return f[0]})(e);C[o]=S(l?{["@keyframes "+o]:r}:r,n?"":"."+o)}return((r,u,c)=>{u.data.indexOf(r)==-1&&(u.data=c?r+u.data:u.data+r)})(C[o],t,s),o},we=(e,t,n)=>e.reduce((s,l,i)=>{let o=t[i];if(o&&o.call){let r=o(n),u=r&&r.props&&r.props.className||/^go/.test(r)&&r;o=u?"."+u:r&&typeof r=="object"?r.props?"":S(r,""):r===!1?"":r}return s+l+(o==null?"":o)},"");function L(e){let t=this||{},n=e.call?e(t.p):e;return be(n.unshift?n.raw?we(n,[].slice.call(arguments,1),t.p):n.reduce((s,l)=>Object.assign(s,l&&l.call?l(t.p):l),{}):n,m(t.target),t.g,t.o,t.k)}L.bind({g:1}),L.bind({k:1});const xe=(e,t)=>e===t,Se=Symbol("solid-proxy"),X={equals:xe};let Ae=Q;const O={},b=1,v=2,Ce={owned:null,cleanups:null,context:null,owner:null};var y=null;let N=null,d=null,E=null,h=null,w=null,D=0;function Ne(e,t,n){const s=M(e,t,!0,b);$(s)}function T(e,t,n){const s=M(e,t,!1,b);$(s)}function K(e,t,n){n=n?Object.assign({},X,n):X;const s=M(e,t,!0,0);return s.pending=O,s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,$(s),Le.bind(s)}function Ee(e){if(E)return e();let t;const n=E=[];try{t=e()}finally{E=null}return R(()=>{for(let s=0;s<n.length;s+=1){const l=n[s];if(l.pending!==O){const i=l.pending;l.pending=O,G(l,i)}}},!1),t}function I(e){let t,n=d;return d=null,t=e(),d=n,t}function Te(e){const t=Symbol("context");return{id:t,Provider:je(t),defaultValue:e}}function $e(e){return z(y,e.id)||e.defaultValue}function Pe(e){const t=K(e);return K(()=>_(t()))}function Le(){const e=N;if(this.sources&&(this.state||e)){const t=h;h=null,this.state===b||e?$(this):B(this),h=t}if(d){const t=this.observers?this.observers.length:0;d.sources?(d.sources.push(this),d.sourceSlots.push(t)):(d.sources=[this],d.sourceSlots=[t]),this.observers?(this.observers.push(d),this.observerSlots.push(d.sources.length-1)):(this.observers=[d],this.observerSlots=[d.sources.length-1])}return this.value}function G(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(E)return e.pending===O&&E.push(e),e.pending=t,t;let s=!1;return e.value=t,e.observers&&e.observers.length&&R(()=>{for(let l=0;l<e.observers.length;l+=1){const i=e.observers[l];s&&N.disposed.has(i),i.pure?h.push(i):w.push(i),i.observers&&(s&&!i.tState||!s&&!i.state)&&Y(i),s||(i.state=b)}if(h.length>1e6)throw h=[],new Error},!1),t}function $(e){if(!e.fn)return;Z(e);const t=y,n=d,s=D;d=y=e,Oe(e,e.value,s),d=n,y=t}function Oe(e,t,n){let s;try{s=e.fn(t)}catch(l){J(l)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?G(e,s):e.value=s,e.updatedAt=n)}function M(e,t,n,s=b,l){const i={fn:e,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:y,context:null,pure:n};return y===null||y!==Ce&&(y.owned?y.owned.push(i):y.owned=[i]),i}function H(e){const t=N;if(e.state!==b)return e.state=0;if(e.suspense&&I(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<D);)(e.state||t)&&n.push(e);for(let s=n.length-1;s>=0;s--)if(e=n[s],e.state===b||t)$(e);else if(e.state===v||t){const l=h;h=null,B(e,n[0]),h=l}}function R(e,t){if(h)return e();let n=!1;t||(h=[]),w?n=!0:w=[],D++;try{return e()}catch(s){J(s)}finally{ke(n)}}function ke(e){h&&(Q(h),h=null),!e&&(w.length?Ee(()=>{Ae(w),w=null}):w=null)}function Q(e){for(let t=0;t<e.length;t++)H(e[t])}function B(e,t){e.state=0;const n=N;for(let s=0;s<e.sources.length;s+=1){const l=e.sources[s];l.sources&&(l.state===b||n?l!==t&&H(l):(l.state===v||n)&&B(l,t))}}function Y(e){const t=N;for(let n=0;n<e.observers.length;n+=1){const s=e.observers[n];(!s.state||t)&&(s.state=v,s.pure?h.push(s):w.push(s),s.observers&&Y(s))}}function Z(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),s=e.sourceSlots.pop(),l=n.observers;if(l&&l.length){const i=l.pop(),o=n.observerSlots.pop();s<l.length&&(i.sourceSlots[o]=s,l[s]=i,n.observerSlots[s]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)Z(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function J(e){throw e}function z(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&z(e.owner,t))}function _(e){if(typeof e=="function"&&!e.length)return _(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const s=_(e[n]);Array.isArray(s)?t.push.apply(t,s):t.push(s)}return t}return e}function je(e){return function(n){let s;return Ne(()=>s=I(()=>(y.context={[e]:n.value},Pe(()=>n.children)))),s}}function k(){return!0}const ee={get(e,t,n){return t===Se?n:e.get(t)},has(e,t){return e.has(t)},set:k,deleteProperty:k,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:k,deleteProperty:k}},ownKeys(e){return e.keys()}};function F(e){return typeof e=="function"?e():e}function te(...e){return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const s=F(e[n])[t];if(s!==void 0)return s}},has(t){for(let n=e.length-1;n>=0;n--)if(t in F(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(F(e[n])));return[...new Set(t)]}},ee)}function ne(e,...t){const n=new Set(t.flat()),s=Object.getOwnPropertyDescriptors(e),l=t.map(i=>{const o={};for(let r=0;r<i.length;r++){const u=i[r];Object.defineProperty(o,u,s[u]?s[u]:{get(){return e[u]},set(){return!0}})}return o});return l.push(new Proxy({get(i){return n.has(i)?void 0:e[i]},has(i){return n.has(i)?!1:i in e},keys(){return Object.keys(e).filter(i=>!n.has(i))}},ee)),l}const ve=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],De=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ve]),Ie=new Set(["innerHTML","textContent","innerText","children"]),Me={className:"class",htmlFor:"for"},se={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},Be=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),_e={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Fe(e,t,n){let s=n.length,l=t.length,i=s,o=0,r=0,u=t[l-1].nextSibling,c=null;for(;o<l||r<i;){if(t[o]===n[r]){o++,r++;continue}for(;t[l-1]===n[i-1];)l--,i--;if(l===o){const f=i<s?r?n[r-1].nextSibling:n[i-r]:u;for(;r<i;)e.insertBefore(n[r++],f)}else if(i===r)for(;o<l;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[i-1]&&n[r]===t[l-1]){const f=t[--l].nextSibling;e.insertBefore(n[r++],t[o++].nextSibling),e.insertBefore(n[--i],f),t[l]=n[i]}else{if(!c){c=new Map;let p=r;for(;p<i;)c.set(n[p],p++)}const f=c.get(t[o]);if(f!=null)if(r<f&&f<i){let p=o,x=1,P;for(;++p<l&&p<i&&!((P=c.get(t[p]))==null||P!==f+x);)x++;if(x>f-r){const q=t[o];for(;r<f;)e.insertBefore(n[r++],q)}else e.replaceChild(n[r++],t[o++])}else o++;else t[o++].remove()}}}const ie="_$DX_DELEGATE";function Ve(e,t=window.document){const n=t[ie]||(t[ie]=new Set);for(let s=0,l=e.length;s<l;s++){const i=e[s];n.has(i)||(n.add(i),t.addEventListener(i,Qe))}}function We(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function qe(e,t,n,s){s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s)}function Ue(e,t,n,s){s?Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n:Array.isArray(n)?e.addEventListener(t,l=>n[0](n[1],l)):e.addEventListener(t,n)}function Xe(e,t,n={}){const s=Object.keys(t||{}),l=Object.keys(n);let i,o;for(i=0,o=l.length;i<o;i++){const r=l[i];!r||r==="undefined"||t[r]||(le(e,r,!1),delete n[r])}for(i=0,o=s.length;i<o;i++){const r=s[i],u=!!t[r];!r||r==="undefined"||n[r]===u||!u||(le(e,r,!0),n[r]=u)}return n}function Ke(e,t,n={}){const s=e.style;if(t==null||typeof t=="string")return s.cssText=t;typeof n=="string"&&(n={});let l,i;for(i in n)t[i]==null&&s.removeProperty(i),delete n[i];for(i in t)l=t[i],l!==n[i]&&(s.setProperty(i,l),n[i]=l);return n}function Ge(e,t,n,s){typeof t=="function"?T(l=>oe(e,t(),l,n,s)):oe(e,t,void 0,n,s)}function He(e,t,n,s,l={}){for(const i in l)if(!(i in t)){if(i==="children")continue;re(e,i,null,l[i],n)}for(const i in t){if(i==="children"){s||j(e,t.children);continue}const o=t[i];l[i]=re(e,i,o,l[i],n)}}function Re(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function le(e,t,n){const s=t.trim().split(/\s+/);for(let l=0,i=s.length;l<i;l++)e.classList.toggle(s[l],n)}function re(e,t,n,s,l){let i,o,r;if(t==="style")return Ke(e,n,s);if(t==="classList")return Xe(e,n,s);if(n===s)return s;if(t==="ref")n(e);else if(t.slice(0,3)==="on:")e.addEventListener(t.slice(3),n);else if(t.slice(0,10)==="oncapture:")e.addEventListener(t.slice(10),n,!0);else if(t.slice(0,2)==="on"){const u=t.slice(2).toLowerCase(),c=Be.has(u);Ue(e,u,n,c),c&&Ve([u])}else if((r=Ie.has(t))||!l&&(se[t]||(o=De.has(t)))||(i=e.nodeName.includes("-")))i&&!o&&!r?e[Re(t)]=n:e[se[t]||t]=n;else{const u=l&&t.indexOf(":")>-1&&_e[t.split(":")[0]];u?qe(e,u,t,n):We(e,Me[t]||t,n)}return n}function Qe(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n!==null;){const s=n[t];if(s&&!n.disabled){const l=n[`${t}Data`];if(l!==void 0?s(l,e):s(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function oe(e,t,n={},s,l){return!l&&"children"in t&&T(()=>n.children=j(e,t.children,n.children)),T(()=>He(e,t,s,!0,n)),n}function j(e,t,n,s,l){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,o=s!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),o){let r=n[0];r&&r.nodeType===3?r.data=t:r=document.createTextNode(t),n=A(e,n,s,r)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||i==="boolean")n=A(e,n,s);else{if(i==="function")return T(()=>{let r=t();for(;typeof r=="function";)r=r();n=j(e,r,n,s)}),()=>n;if(Array.isArray(t)){const r=[];if(V(r,t,l))return T(()=>n=j(e,r,n,s,!0)),()=>n;if(r.length===0){if(n=A(e,n,s),o)return n}else Array.isArray(n)?n.length===0?ue(e,r,s):Fe(e,n,r):(n&&A(e),ue(e,r));n=r}else if(t instanceof Node){if(Array.isArray(n)){if(o)return n=A(e,n,s,t);A(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function V(e,t,n){let s=!1;for(let l=0,i=t.length;l<i;l++){let o=t[l],r;if(o instanceof Node)e.push(o);else if(!(o==null||o===!0||o===!1))if(Array.isArray(o))s=V(e,o)||s;else if((r=typeof o)=="string")e.push(document.createTextNode(o));else if(r==="function")if(n){for(;typeof o=="function";)o=o();s=V(e,Array.isArray(o)?o:[o])||s}else e.push(o),s=!0;else e.push(document.createTextNode(o.toString()))}return s}function ue(e,t,n){for(let s=0,l=t.length;s<l;s++)e.insertBefore(t[s],n)}function A(e,t,n,s){if(n===void 0)return e.textContent="";const l=s||document.createTextNode("");if(t.length){let i=!1;for(let o=t.length-1;o>=0;o--){const r=t[o];if(l!==r){const u=r.parentNode===e;!i&&!o?u?e.replaceChild(l,r):e.insertBefore(l,n):u&&r.remove()}else i=!0}}else e.insertBefore(l,n);return[l]}function Ye(e,...t){}function ut(e){}const Ze=!1,Je=Te();function ze(e){let t=this||{};return(...n)=>{const s=l=>{const i=$e(Je),o=te(l,{theme:i}),r=te(o,{get className(){const x=o.className,P="className"in o&&/^go[0-9]+/.test(x);let q=L.apply({target:t.target,o:P,p:o,g:t.g},n);return[x,q].filter(Boolean).join(" ")}}),[u,c]=ne(r,["as"]),f=u.as||e;let p;if(typeof f=="function")p=f(c);else if(Ze){const[x,P]=ne(c,["children"]);p=Ye([`<${f} `,">",`</${f}>`],void 0,x.children||"")}else p=document.createElement(f),Ge(p,c);return p};return s.className=l=>I(()=>L.apply({target:t.target,p:l,g:t.g},n)),s}}const ce=new Proxy(ze,{get(e,t){return e(t)}});function fe(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1,100}\)$/].some(t=>t.test(e))}const ae={none:"0px",xxs:"0.0625rem",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",mdLg:"0.75rem",lg:"1rem",lgXl:"1.5rem",xl:"2rem",xlXXl:"3rem",xxl:"4rem"};function et(e){return e.reduce((t,[n,s])=>pe(he({},t),{[n]:s}),{})}const W=(e,t)=>{var o,r;const n=(r=(o=t==null?void 0:t.space)!=null?o:t==null?void 0:t.spacing)!=null?r:ae,l=et(Object.entries(n).map(([u,c])=>[u,typeof c=="number"?`${c}px`:c]))[e];return fe(l)?l:void 0},tt=ce("div")`
|
|
1
|
+
var at=Object.defineProperty,gt=Object.defineProperties;var dt=Object.getOwnPropertyDescriptors;var ge=Object.getOwnPropertySymbols;var ht=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable;var de=(f,g,y)=>g in f?at(f,g,{enumerable:!0,configurable:!0,writable:!0,value:y}):f[g]=y,he=(f,g)=>{for(var y in g||(g={}))ht.call(g,y)&&de(f,y,g[y]);if(ge)for(var y of ge(g))pt.call(g,y)&&de(f,y,g[y]);return f},pe=(f,g)=>gt(f,dt(g));(function(f,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(f=typeof globalThis!="undefined"?globalThis:f||self,g(f.solid={}))})(this,function(f){"use strict";let g={data:""},y=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||g,ye=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,me=/\/\*[^]*?\*\/|\s\s+|\n/g,S=(e,t)=>{let n="",i="",r="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":i+=s[1]=="f"?S(o,s):s+"{"+S(o,s[1]=="k"?"":t)+"}":typeof o=="object"?i+=S(o,t?t.replace(/([^,])+/g,l=>s.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,l):l?l+" "+c:c)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=S.p?S.p(s,o):s+":"+o+";")}return n+(t&&r?t+"{"+r+"}":r)+i},$={},q=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+q(e[n]);return t}return e},be=(e,t,n,i,r)=>{let s=q(e),o=$[s]||($[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!$[o]){let l=s!==e?e:(c=>{let u,a=[{}];for(;u=ye.exec(c.replace(me,""));)u[4]?a.shift():u[3]?a.unshift(a[0][u[3]]=a[0][u[3]]||{}):a[0][u[1]]=u[2];return a[0]})(e);$[o]=S(r?{["@keyframes "+o]:l}:l,n?"":"."+o)}return((l,c,u)=>{c.data.indexOf(l)==-1&&(c.data=u?l+c.data:c.data+l)})($[o],t,i),o},xe=(e,t,n)=>e.reduce((i,r,s)=>{let o=t[s];if(o&&o.call){let l=o(n),c=l&&l.props&&l.props.className||/^go/.test(l)&&l;o=c?"."+c:l&&typeof l=="object"?l.props?"":S(l,""):l===!1?"":l}return i+r+(o==null?"":o)},"");function A(e){let t=this||{},n=e.call?e(t.p):e;return be(n.unshift?n.raw?xe(n,[].slice.call(arguments,1),t.p):n.reduce((i,r)=>Object.assign(i,r&&r.call?r(t.p):r),{}):n,y(t.target),t.g,t.o,t.k)}A.bind({g:1}),A.bind({k:1});const we=(e,t)=>e===t,Se=Symbol("solid-proxy"),U={equals:we};let Ae=Q;const L={},b=1,I=2,Ce={owned:null,cleanups:null,context:null,owner:null};var m=null;let v=null,d=null,N=null,h=null,x=null,M=0;function $e(e,t,n){const i=B(e,t,!0,b);k(i)}function E(e,t,n){const i=B(e,t,!1,b);k(i)}function X(e,t,n){n=n?Object.assign({},U,n):U;const i=B(e,t,!0,0);return i.pending=L,i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,k(i),Te.bind(i)}function ve(e){if(N)return e();let t;const n=N=[];try{t=e()}finally{N=null}return H(()=>{for(let i=0;i<n.length;i+=1){const r=n[i];if(r.pending!==L){const s=r.pending;r.pending=L,K(r,s)}}},!1),t}function F(e){let t,n=d;return d=null,t=e(),d=n,t}function Ne(e){const t=Symbol("context");return{id:t,Provider:Oe(t),defaultValue:e}}function Ee(e){return ee(m,e.id)||e.defaultValue}function ke(e){const t=X(e);return X(()=>W(t()))}function Te(){const e=v;if(this.sources&&(this.state||e)){const t=h;h=null,this.state===b||e?k(this):R(this),h=t}if(d){const t=this.observers?this.observers.length:0;d.sources?(d.sources.push(this),d.sourceSlots.push(t)):(d.sources=[this],d.sourceSlots=[t]),this.observers?(this.observers.push(d),this.observerSlots.push(d.sources.length-1)):(this.observers=[d],this.observerSlots=[d.sources.length-1])}return this.value}function K(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(N)return e.pending===L&&N.push(e),e.pending=t,t;let i=!1;return e.value=t,e.observers&&e.observers.length&&H(()=>{for(let r=0;r<e.observers.length;r+=1){const s=e.observers[r];i&&v.disposed.has(s),s.pure?h.push(s):x.push(s),s.observers&&(i&&!s.tState||!i&&!s.state)&&Y(s),i||(s.state=b)}if(h.length>1e6)throw h=[],new Error},!1),t}function k(e){if(!e.fn)return;Z(e);const t=m,n=d,i=M;d=m=e,Pe(e,e.value,i),d=n,m=t}function Pe(e,t,n){let i;try{i=e.fn(t)}catch(r){J(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?K(e,i):e.value=i,e.updatedAt=n)}function B(e,t,n,i=b,r){const s={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:null,pure:n};return m===null||m!==Ce&&(m.owned?m.owned.push(s):m.owned=[s]),s}function G(e){const t=v;if(e.state!==b)return e.state=0;if(e.suspense&&F(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<M);)(e.state||t)&&n.push(e);for(let i=n.length-1;i>=0;i--)if(e=n[i],e.state===b||t)k(e);else if(e.state===I||t){const r=h;h=null,R(e,n[0]),h=r}}function H(e,t){if(h)return e();let n=!1;t||(h=[]),x?n=!0:x=[],M++;try{return e()}catch(i){J(i)}finally{Le(n)}}function Le(e){h&&(Q(h),h=null),!e&&(x.length?ve(()=>{Ae(x),x=null}):x=null)}function Q(e){for(let t=0;t<e.length;t++)G(e[t])}function R(e,t){e.state=0;const n=v;for(let i=0;i<e.sources.length;i+=1){const r=e.sources[i];r.sources&&(r.state===b||n?r!==t&&G(r):(r.state===I||n)&&R(r,t))}}function Y(e){const t=v;for(let n=0;n<e.observers.length;n+=1){const i=e.observers[n];(!i.state||t)&&(i.state=I,i.pure?h.push(i):x.push(i),i.observers&&Y(i))}}function Z(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),i=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){const s=r.pop(),o=n.observerSlots.pop();i<r.length&&(s.sourceSlots[o]=i,r[i]=s,n.observerSlots[i]=o)}}if(e.owned){for(t=0;t<e.owned.length;t++)Z(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function J(e){throw e}function ee(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&ee(e.owner,t))}function W(e){if(typeof e=="function"&&!e.length)return W(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const i=W(e[n]);Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}return e}function Oe(e){return function(n){let i;return $e(()=>i=F(()=>(m.context={[e]:n.value},ke(()=>n.children)))),i}}function O(){return!0}const te={get(e,t,n){return t===Se?n:e.get(t)},has(e,t){return e.has(t)},set:O,deleteProperty:O,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:O,deleteProperty:O}},ownKeys(e){return e.keys()}};function _(e){return typeof e=="function"?e():e}function ne(...e){return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const i=_(e[n])[t];if(i!==void 0)return i}},has(t){for(let n=e.length-1;n>=0;n--)if(t in _(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(_(e[n])));return[...new Set(t)]}},te)}function ie(e,...t){const n=new Set(t.flat()),i=Object.getOwnPropertyDescriptors(e),r=t.map(s=>{const o={};for(let l=0;l<s.length;l++){const c=s[l];Object.defineProperty(o,c,i[c]?i[c]:{get(){return e[c]},set(){return!0}})}return o});return r.push(new Proxy({get(s){return n.has(s)?void 0:e[s]},has(s){return n.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!n.has(s))}},te)),r}const je=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],De=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...je]),Ie=new Set(["innerHTML","textContent","innerText","children"]),Me={className:"class",htmlFor:"for"},se={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},Fe=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Be={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Re(e,t,n){let i=n.length,r=t.length,s=i,o=0,l=0,c=t[r-1].nextSibling,u=null;for(;o<r||l<s;){if(t[o]===n[l]){o++,l++;continue}for(;t[r-1]===n[s-1];)r--,s--;if(r===o){const a=s<i?l?n[l-1].nextSibling:n[s-l]:c;for(;l<s;)e.insertBefore(n[l++],a)}else if(s===l)for(;o<r;)(!u||!u.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[s-1]&&n[l]===t[r-1]){const a=t[--r].nextSibling;e.insertBefore(n[l++],t[o++].nextSibling),e.insertBefore(n[--s],a),t[r]=n[s]}else{if(!u){u=new Map;let p=l;for(;p<s;)u.set(n[p],p++)}const a=u.get(t[o]);if(a!=null)if(l<a&&a<s){let p=o,w=1,P;for(;++p<r&&p<s&&!((P=u.get(t[p]))==null||P!==a+w);)w++;if(w>a-l){const V=t[o];for(;l<a;)e.insertBefore(n[l++],V)}else e.replaceChild(n[l++],t[o++])}else o++;else t[o++].remove()}}}const re="_$DX_DELEGATE";function We(e,t=window.document){const n=t[re]||(t[re]=new Set);for(let i=0,r=e.length;i<r;i++){const s=e[i];n.has(s)||(n.add(s),t.addEventListener(s,He))}}function _e(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function ze(e,t,n,i){i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i)}function Ve(e,t,n,i){i?Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n:Array.isArray(n)?e.addEventListener(t,r=>n[0](n[1],r)):e.addEventListener(t,n)}function qe(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let s,o;for(s=0,o=r.length;s<o;s++){const l=r[s];!l||l==="undefined"||t[l]||(le(e,l,!1),delete n[l])}for(s=0,o=i.length;s<o;s++){const l=i[s],c=!!t[l];!l||l==="undefined"||n[l]===c||!c||(le(e,l,!0),n[l]=c)}return n}function Ue(e,t,n={}){const i=e.style;if(t==null||typeof t=="string")return i.cssText=t;typeof n=="string"&&(n={});let r,s;for(s in n)t[s]==null&&i.removeProperty(s),delete n[s];for(s in t)r=t[s],r!==n[s]&&(i.setProperty(s,r),n[s]=r);return n}function Xe(e,t,n,i){typeof t=="function"?E(r=>ce(e,t(),r,n,i)):ce(e,t,void 0,n,i)}function Ke(e,t,n,i,r={}){for(const s in r)if(!(s in t)){if(s==="children")continue;oe(e,s,null,r[s],n)}for(const s in t){if(s==="children"){i||j(e,t.children);continue}const o=t[s];r[s]=oe(e,s,o,r[s],n)}}function Ge(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function le(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,s=i.length;r<s;r++)e.classList.toggle(i[r],n)}function oe(e,t,n,i,r){let s,o,l;if(t==="style")return Ue(e,n,i);if(t==="classList")return qe(e,n,i);if(n===i)return i;if(t==="ref")n(e);else if(t.slice(0,3)==="on:")e.addEventListener(t.slice(3),n);else if(t.slice(0,10)==="oncapture:")e.addEventListener(t.slice(10),n,!0);else if(t.slice(0,2)==="on"){const c=t.slice(2).toLowerCase(),u=Fe.has(c);Ve(e,c,n,u),u&&We([c])}else if((l=Ie.has(t))||!r&&(se[t]||(o=De.has(t)))||(s=e.nodeName.includes("-")))s&&!o&&!l?e[Ge(t)]=n:e[se[t]||t]=n;else{const c=r&&t.indexOf(":")>-1&&Be[t.split(":")[0]];c?ze(e,c,t,n):_e(e,Me[t]||t,n)}return n}function He(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}});n!==null;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i(r,e):i(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function ce(e,t,n={},i,r){return!r&&"children"in t&&E(()=>n.children=j(e,t.children,n.children)),E(()=>Ke(e,t,i,!0,n)),n}function j(e,t,n,i,r){for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,o=i!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,s==="string"||s==="number")if(s==="number"&&(t=t.toString()),o){let l=n[0];l&&l.nodeType===3?l.data=t:l=document.createTextNode(t),n=C(e,n,i,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||s==="boolean")n=C(e,n,i);else{if(s==="function")return E(()=>{let l=t();for(;typeof l=="function";)l=l();n=j(e,l,n,i)}),()=>n;if(Array.isArray(t)){const l=[];if(z(l,t,r))return E(()=>n=j(e,l,n,i,!0)),()=>n;if(l.length===0){if(n=C(e,n,i),o)return n}else Array.isArray(n)?n.length===0?ue(e,l,i):Re(e,n,l):(n&&C(e),ue(e,l));n=l}else if(t instanceof Node){if(Array.isArray(n)){if(o)return n=C(e,n,i,t);C(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function z(e,t,n){let i=!1;for(let r=0,s=t.length;r<s;r++){let o=t[r],l;if(o instanceof Node)e.push(o);else if(!(o==null||o===!0||o===!1))if(Array.isArray(o))i=z(e,o)||i;else if((l=typeof o)=="string")e.push(document.createTextNode(o));else if(l==="function")if(n){for(;typeof o=="function";)o=o();i=z(e,Array.isArray(o)?o:[o])||i}else e.push(o),i=!0;else e.push(document.createTextNode(o.toString()))}return i}function ue(e,t,n){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function C(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let s=!1;for(let o=t.length-1;o>=0;o--){const l=t[o];if(r!==l){const c=l.parentNode===e;!s&&!o?c?e.replaceChild(r,l):e.insertBefore(r,n):c&&l.remove()}else s=!0}}else e.insertBefore(r,n);return[r]}function Qe(e,...t){}function yt(e){}const Ye=!1,Ze=Ne();function Je(e){let t=this||{};return(...n)=>{const i=r=>{const s=Ee(Ze),o=ne(r,{theme:s}),l=ne(o,{get className(){const w=o.className,P="className"in o&&/^go[0-9]+/.test(w);let V=A.apply({target:t.target,o:P,p:o,g:t.g},n);return[w,V].filter(Boolean).join(" ")}}),[c,u]=ie(l,["as"]),a=c.as||e;let p;if(typeof a=="function")p=a(u);else if(Ye){const[w,P]=ie(u,["children"]);p=Qe([`<${a} `,">",`</${a}>`],void 0,w.children||"")}else p=document.createElement(a),Xe(p,u);return p};return i.className=r=>F(()=>A.apply({target:t.target,p:r,g:t.g},n)),i}}const T=new Proxy(Je,{get(e,t){return e(t)}});function fe(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1,100}\)$/].some(t=>t.test(e))}const ae={none:"0px",xxs:"0.0625rem",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",mdLg:"0.75rem",lg:"1rem",lgXl:"1.5rem",xl:"2rem",xlXXl:"3rem",xxl:"4rem"};function et(e){return e.reduce((t,[n,i])=>pe(he({},t),{[n]:i}),{})}const D=(e,t)=>{var o,l;const n=(l=(o=t==null?void 0:t.space)!=null?o:t==null?void 0:t.spacing)!=null?l:ae,r=et(Object.entries(n).map(([c,u])=>[c,typeof u=="number"?`${u}px`:u]))[e];return fe(r)?r:void 0},tt=T("div")`
|
|
2
2
|
@property --gutter {
|
|
3
3
|
syntax: "<length-percentage>";
|
|
4
4
|
inherits: false;
|
|
5
5
|
initial-value: 0;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
8
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=D(e.gutter,e.theme))!=null?t:"0px"}};
|
|
9
9
|
box-sizing: border-box;
|
|
10
10
|
> * {
|
|
11
11
|
margin: 0;
|
|
@@ -19,7 +19,7 @@ var st=Object.defineProperty,it=Object.defineProperties;var lt=Object.getOwnProp
|
|
|
19
19
|
& > [data-bedrock-column] {
|
|
20
20
|
grid-column: span 1 / auto;
|
|
21
21
|
}
|
|
22
|
-
`,nt=
|
|
22
|
+
`,nt=T("div")`
|
|
23
23
|
@property --gutter {
|
|
24
24
|
syntax: "<length-percentage>";
|
|
25
25
|
inherits: false;
|
|
@@ -32,7 +32,7 @@ var st=Object.defineProperty,it=Object.defineProperties;var lt=Object.getOwnProp
|
|
|
32
32
|
initial-value: 639px;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
35
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=D(e.gutter,e.theme))!=null?t:"0px"}};
|
|
36
36
|
--minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
|
|
37
37
|
|
|
38
38
|
box-sizing: border-box;
|
|
@@ -47,4 +47,92 @@ var st=Object.defineProperty,it=Object.defineProperties;var lt=Object.getOwnProp
|
|
|
47
47
|
auto-fit,
|
|
48
48
|
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
49
49
|
);
|
|
50
|
-
`;
|
|
50
|
+
`;function it(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const st=T("div")`
|
|
51
|
+
@property --maxWidth {
|
|
52
|
+
syntax: "<length-percentage>";
|
|
53
|
+
inherits: false;
|
|
54
|
+
initial-value: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
--maxWidth: ${e=>it(e.maxWidth)};
|
|
58
|
+
|
|
59
|
+
box-sizing: content-box;
|
|
60
|
+
|
|
61
|
+
margin-inline-start: auto;
|
|
62
|
+
margin-inline-end: auto;
|
|
63
|
+
margin-inline: auto;
|
|
64
|
+
|
|
65
|
+
max-inline-size: var(--maxWidth, 100%);
|
|
66
|
+
|
|
67
|
+
${e=>e.centerChildren?A`
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-items: center;
|
|
71
|
+
`:""}
|
|
72
|
+
|
|
73
|
+
${e=>e.centerText?A`
|
|
74
|
+
text-align: center;
|
|
75
|
+
`:""}
|
|
76
|
+
`;function rt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const lt=T("div")`
|
|
77
|
+
@property --basis {
|
|
78
|
+
syntax: "<length-percentage>";
|
|
79
|
+
inherits: true;
|
|
80
|
+
initial-value: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@property --gutter {
|
|
84
|
+
syntax: "<length-percentage>";
|
|
85
|
+
inherits: false;
|
|
86
|
+
initial-value: 0px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
--basis: ${e=>rt(e.basis)};
|
|
90
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=D(e.gutter,e.theme))!=null?t:"0px"}};
|
|
91
|
+
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
> * {
|
|
94
|
+
margin: 0;
|
|
95
|
+
flex-basis: var(--basis, 100%);
|
|
96
|
+
flex-grow: ${e=>e.noStretchedColumns?"0":"1"};
|
|
97
|
+
flex-shrink: 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
gap: var(--gutter, 0px);
|
|
103
|
+
`;function ot(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000}\/\d{1,1000}$/.test(e)}function ct(e){return Array.isArray(e)?e.join("/"):e}function ut(e){return ot(e)?ct(e):void 0}const ft=T.div`
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
display: block;
|
|
106
|
+
inline-size: 100%;
|
|
107
|
+
position: relative;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
|
|
110
|
+
${e=>{const t=ut(e.ratio);return t?A`
|
|
111
|
+
aspect-ratio: ${t};
|
|
112
|
+
`:""}};
|
|
113
|
+
|
|
114
|
+
> * {
|
|
115
|
+
position: absolute;
|
|
116
|
+
|
|
117
|
+
inset-block-start: 0;
|
|
118
|
+
inset-block-end: 0;
|
|
119
|
+
inset-inline-start: 0;
|
|
120
|
+
inset-inline-end: 0;
|
|
121
|
+
|
|
122
|
+
inset-block: 0;
|
|
123
|
+
inset-inline: 0;
|
|
124
|
+
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
align-items: center;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
> :is(img, video) {
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
block-size: 100%;
|
|
133
|
+
size: 100%;
|
|
134
|
+
|
|
135
|
+
object-fit: cover;
|
|
136
|
+
object-position: ${e=>typeof e.position=="string"?e.position:"50%"};
|
|
137
|
+
}
|
|
138
|
+
`;f.Center=st,f.ColumnDrop=lt,f.Frame=ft,f.Grid=nt,f.Stack=tt,f.checkIsCSSLength=fe,f.getSpacingValue=D,f.spacing=ae,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock-layout/solid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "solid.js port of bedrock-layout primitives",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"private": false,
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"bugs": {
|
|
60
60
|
"url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "2efc649690c8357f71b5648faa71c14b14714d97"
|
|
63
63
|
}
|