@bedrock-layout/solid 0.3.0 → 0.4.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 +48 -3
- package/lib/index.d.ts +17 -1
- package/lib/index.m.js +97 -5
- package/lib/index.umd.js +48 -3
- package/package.json +2 -2
package/lib/index.cjs.js
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";let re={data:""},oe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||re,fe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ce=/\/\*[^]*?\*\/|\s\s+|\n/g,w=(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"?w(o,i):i+"{"+w(o,i[1]=="k"?"":t)+"}":typeof o=="object"?s+=w(o,t?t.replace(/([^,])+/g,r=>i.replace(/(^:.*)|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,r):r?r+" "+f:f)):i):o!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),l+=w.p?w.p(i,o):i+":"+o+";")}return n+(t&&l?t+"{"+l+"}":l)+s},S={},Y=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Y(e[n]);return t}return e},ue=(e,t,n,s,l)=>{let i=Y(e),o=S[i]||(S[i]=(r=>{let f=0,c=11;for(;f<r.length;)c=101*c+r.charCodeAt(f++)>>>0;return"go"+c})(i));if(!S[o]){let r=i!==e?e:(f=>{let c,u=[{}];for(;c=fe.exec(f.replace(ce,""));)c[4]?u.shift():c[3]?u.unshift(u[0][c[3]]=u[0][c[3]]||{}):u[0][c[1]]=c[2];return u[0]})(e);S[o]=w(l?{["@keyframes "+o]:r}:r,n?"":"."+o)}return((r,f,c)=>{f.data.indexOf(r)==-1&&(f.data=c?r+f.data:f.data+r)})(S[o],t,s),o},ae=(e,t,n)=>e.reduce((s,l,i)=>{let o=t[i];if(o&&o.call){let r=o(n),f=r&&r.props&&r.props.className||/^go/.test(r)&&r;o=f?"."+f:r&&typeof r=="object"?r.props?"":w(r,""):r===!1?"":r}return s+l+(o==null?"":o)},"");function P(e){let t=this||{},n=e.call?e(t.p):e;return ue(n.unshift?n.raw?ae(n,[].slice.call(arguments,1),t.p):n.reduce((s,l)=>Object.assign(s,l&&l.call?l(t.p):l),{}):n,oe(t.target),t.g,t.o,t.k)}P.bind({g:1});P.bind({k:1});const he=(e,t)=>e===t,ge=Symbol("solid-proxy"),q={equals:he};let de=ee;const L={},m=1,M=2,pe={owned:null,cleanups:null,context:null,owner:null};var d=null;let N=null,a=null,A=null,h=null,y=null,B=0;function ye(e,t,n){const s=F(e,t,!0,m);E(s)}function C(e,t,n){const s=F(e,t,!1,m);E(s)}function U(e,t,n){n=n?Object.assign({},q,n):q;const s=F(e,t,!0,0);return s.pending=L,s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,E(s),Se.bind(s)}function me(e){if(A)return e();let t;const n=A=[];try{t=e()}finally{A=null}return z(()=>{for(let s=0;s<n.length;s+=1){const l=n[s];if(l.pending!==L){const i=l.pending;l.pending=L,Z(l,i)}}},!1),t}function _(e){let t,n=a;return a=null,t=e(),a=n,t}function we(e){const t=Symbol("context");return{id:t,Provider:Ne(t),defaultValue:e}}function be(e){return ie(d,e.id)||e.defaultValue}function xe(e){const t=U(e);return U(()=>j(t()))}function Se(){const e=N;if(this.sources&&(this.state||e)){const t=h;h=null,this.state===m||e?E(this):I(this),h=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 Z(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(A)return e.pending===L&&A.push(e),e.pending=t,t;let s=!1;return e.value=t,e.observers&&e.observers.length&&z(()=>{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):y.push(i),i.observers&&(s&&!i.tState||!s&&!i.state)&&te(i),s||(i.state=m)}if(h.length>1e6)throw h=[],new Error},!1),t}function E(e){if(!e.fn)return;ne(e);const t=d,n=a,s=B;a=d=e,Ae(e,e.value,s),a=n,d=t}function Ae(e,t,n){let s;try{s=e.fn(t)}catch(l){se(l)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?Z(e,s):e.value=s,e.updatedAt=n)}function F(e,t,n,s=m,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 J(e){const t=N;if(e.state!==m)return e.state=0;if(e.suspense&&_(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<B);)(e.state||t)&&n.push(e);for(let s=n.length-1;s>=0;s--)if(e=n[s],e.state===m||t)E(e);else if(e.state===M||t){const l=h;h=null,I(e,n[0]),h=l}}function z(e,t){if(h)return e();let n=!1;t||(h=[]),y?n=!0:y=[],B++;try{return e()}catch(s){se(s)}finally{Ce(n)}}function Ce(e){h&&(ee(h),h=null),!e&&(y.length?me(()=>{de(y),y=null}):y=null)}function ee(e){for(let t=0;t<e.length;t++)J(e[t])}function I(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===m||n?l!==t&&J(l):(l.state===M||n)&&I(l,t))}}function te(e){const t=N;for(let n=0;n<e.observers.length;n+=1){const s=e.observers[n];(!s.state||t)&&(s.state=M,s.pure?h.push(s):y.push(s),s.observers&&te(s))}}function ne(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++)ne(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 se(e){throw e}function ie(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&ie(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 Ne(e){return function(n){let s;return ye(()=>s=_(()=>(d.context={[e]:n.value},xe(()=>n.children)))),s}}function T(){return!0}const le={get(e,t,n){return t===ge?n:e.get(t)},has(e,t){return e.has(t)},set:T,deleteProperty:T,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:T,deleteProperty:T}},ownKeys(e){return e.keys()}};function k(e){return typeof e=="function"?e():e}function X(...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)]}},le)}function K(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 f=i[r];Object.defineProperty(o,f,s[f]?s[f]:{get(){return e[f]},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))}},le)),l}const Ee=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Te=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ee]),Pe=new Set(["innerHTML","textContent","innerText","children"]),Le={className:"class",htmlFor:"for"},V={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},Oe=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 ke(e,t,n){let s=n.length,l=t.length,i=s,o=0,r=0,f=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 u=i<s?r?n[r-1].nextSibling:n[i-r]:f;for(;r<i;)e.insertBefore(n[r++],u)}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 u=t[--l].nextSibling;e.insertBefore(n[r++],t[o++].nextSibling),e.insertBefore(n[--i],u),t[l]=n[i]}else{if(!c){c=new Map;let g=r;for(;g<i;)c.set(n[g],g++)}const u=c.get(t[o]);if(u!=null)if(r<u&&u<i){let g=o,p=1,x;for(;++g<l&&g<i&&!((x=c.get(t[g]))==null||x!==u+p);)p++;if(p>u-r){const $=t[o];for(;r<u;)e.insertBefore(n[r++],$)}else e.replaceChild(n[r++],t[o++])}else o++;else t[o++].remove()}}}const H="_$DX_DELEGATE";function je(e,t=window.document){const n=t[H]||(t[H]=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,Ue))}}function ve(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function De(e,t,n,s){s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s)}function Me(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 Be(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]||(R(e,r,!1),delete n[r])}for(i=0,o=s.length;i<o;i++){const r=s[i],f=!!t[r];!r||r==="undefined"||n[r]===f||!f||(R(e,r,!0),n[r]=f)}return n}function _e(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 Fe(e,t,n,s){typeof t=="function"?C(l=>Q(e,t(),l,n,s)):Q(e,t,void 0,n,s)}function Ie(e,t,n,s,l={}){for(const i in l)if(!(i in t)){if(i==="children")continue;G(e,i,null,l[i],n)}for(const i in t){if(i==="children"){s||O(e,t.children);continue}const o=t[i];l[i]=G(e,i,o,l[i],n)}}function qe(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function R(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 G(e,t,n,s,l){let i,o,r;if(t==="style")return _e(e,n,s);if(t==="classList")return Be(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 f=t.slice(2).toLowerCase(),c=Oe.has(f);Me(e,f,n,c),c&&je([f])}else if((r=Pe.has(t))||!l&&(V[t]||(o=Te.has(t)))||(i=e.nodeName.includes("-")))i&&!o&&!r?e[qe(t)]=n:e[V[t]||t]=n;else{const f=l&&t.indexOf(":")>-1&&$e[t.split(":")[0]];f?De(e,f,t,n):ve(e,Le[t]||t,n)}return n}function Ue(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 Q(e,t,n={},s,l){return!l&&"children"in t&&C(()=>n.children=O(e,t.children,n.children)),C(()=>Ie(e,t,s,!0,n)),n}function O(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=b(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=b(e,n,s);else{if(i==="function")return C(()=>{let r=t();for(;typeof r=="function";)r=r();n=O(e,r,n,s)}),()=>n;if(Array.isArray(t)){const r=[];if(v(r,t,l))return C(()=>n=O(e,r,n,s,!0)),()=>n;if(r.length===0){if(n=b(e,n,s),o)return n}else Array.isArray(n)?n.length===0?W(e,r,s):ke(e,n,r):(n&&b(e),W(e,r));n=r}else if(t instanceof Node){if(Array.isArray(n)){if(o)return n=b(e,n,s,t);b(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 W(e,t,n){for(let s=0,l=t.length;s<l;s++)e.insertBefore(t[s],n)}function b(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 f=r.parentNode===e;!i&&!o?f?e.replaceChild(l,r):e.insertBefore(l,n):f&&r.remove()}else i=!0}}else e.insertBefore(l,n);return[l]}function Xe(e,...t){}const Ke=!1,Ve=we();function He(e){let t=this||{};return(...n)=>{const s=l=>{const i=be(Ve),o=X(l,{theme:i}),r=X(o,{get className(){const p=o.className,x="className"in o&&/^go[0-9]+/.test(p);let $=P.apply({target:t.target,o:x,p:o,g:t.g},n);return[p,$].filter(Boolean).join(" ")}}),[f,c]=K(r,["as"]),u=f.as||e;let g;if(typeof u=="function")g=u(c);else if(Ke){const[p,x]=K(c,["children"]);g=Xe([`<${u} `,">",`</${u}>`],void 0,p.children||"")}else g=document.createElement(u),Fe(g,c);return g};return s.className=l=>_(()=>P.apply({target:t.target,p:l,g:t.g},n)),s}}function Re(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 D={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"},Ge=He("div")`
|
|
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")`
|
|
2
|
+
@property --gutter {
|
|
3
|
+
syntax: "<length-percentage>";
|
|
4
|
+
inherits: false;
|
|
5
|
+
initial-value: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=F(e.gutter,e.theme))!=null?t:"0px"}};
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
> * {
|
|
11
|
+
margin: 0;
|
|
12
|
+
}
|
|
2
13
|
display: flex;
|
|
3
14
|
flex-direction: column;
|
|
4
|
-
|
|
5
|
-
|
|
15
|
+
|
|
16
|
+
gap: var(--gutter, 0px);
|
|
17
|
+
align-content: start;
|
|
18
|
+
|
|
19
|
+
& > [data-bedrock-column] {
|
|
20
|
+
grid-column: span 1 / auto;
|
|
21
|
+
}
|
|
22
|
+
`,rt=fe("div")`
|
|
23
|
+
@property --gutter {
|
|
24
|
+
syntax: "<length-percentage>";
|
|
25
|
+
inherits: false;
|
|
26
|
+
initial-value: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@property --minItemWidth {
|
|
30
|
+
syntax: "<length-percentage>";
|
|
31
|
+
inherits: false;
|
|
32
|
+
initial-value: 639px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=F(e.gutter,e.theme))!=null?t:"0px"}};
|
|
36
|
+
--minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
|
|
37
|
+
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
> * {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
display: grid;
|
|
44
|
+
gap: var(--gutter, 0px);
|
|
45
|
+
|
|
46
|
+
grid-template-columns: repeat(
|
|
47
|
+
auto-fit,
|
|
48
|
+
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
49
|
+
);
|
|
50
|
+
`;exports.Grid=rt;exports.Stack=lt;exports.checkIsCSSLength=ae;exports.getSpacingValue=F;exports.spacing=ge;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DefaultTheme } from "solid-styled-components";
|
|
1
2
|
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";
|
|
2
3
|
declare type AllCharacter = LowercaseCharacter | Uppercase<LowercaseCharacter>;
|
|
3
4
|
declare type NonEmptyString = `${AllCharacter}${string}`;
|
|
@@ -18,12 +19,27 @@ export interface Spacing {
|
|
|
18
19
|
xlXXl: CSSLength;
|
|
19
20
|
xxl: CSSLength;
|
|
20
21
|
}
|
|
21
|
-
declare type SpacingOptions = keyof Spacing;
|
|
22
22
|
export declare const spacing: Spacing;
|
|
23
|
+
export declare type BaseTheme = Record<string, CSSLength | string | number>;
|
|
24
|
+
declare type ThemeOrDefaultSpace<T> = T extends {
|
|
25
|
+
space: BaseTheme;
|
|
26
|
+
} ? T["space"] : keyof Spacing;
|
|
27
|
+
declare type SpacingOptions = ThemeOrDefaultSpace<DefaultTheme>;
|
|
28
|
+
declare type MaybeValue = CSSLength | undefined;
|
|
29
|
+
declare type GetSpacingValue = (spacingKey: SpacingOptions, theme?: Partial<BaseTheme>) => MaybeValue;
|
|
30
|
+
export declare const getSpacingValue: GetSpacingValue;
|
|
23
31
|
export interface StackProps {
|
|
24
32
|
gutter?: SpacingOptions;
|
|
25
33
|
}
|
|
26
34
|
export declare const Stack: ((props: StackProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
27
35
|
className: (props: StackProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
28
36
|
};
|
|
37
|
+
declare type MinItemWidth = number | CSSLength;
|
|
38
|
+
export interface GridProps {
|
|
39
|
+
gutter?: SpacingOptions;
|
|
40
|
+
minItemWidth?: MinItemWidth;
|
|
41
|
+
}
|
|
42
|
+
export declare const Grid: ((props: GridProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
43
|
+
className: (props: GridProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
44
|
+
};
|
|
29
45
|
export {};
|
package/lib/index.m.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a2, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a2, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a2;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a2, b) => __defProps(a2, __getOwnPropDescs(b));
|
|
1
20
|
let e = { data: "" }, t = (t2) => typeof window == "object" ? ((t2 ? t2.querySelector("#_goober") : window._goober) || Object.assign((t2 || document.head).appendChild(document.createElement("style")), { innerHTML: " ", id: "_goober" })).firstChild : t2 || e, l = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g, a = /\/\*[^]*?\*\/|\s\s+|\n/g, n = (e2, t2) => {
|
|
2
21
|
let r = "", l2 = "", a2 = "";
|
|
3
22
|
for (let o2 in e2) {
|
|
@@ -855,7 +874,7 @@ function ssrSpread(accessor) {
|
|
|
855
874
|
}
|
|
856
875
|
const isServer = false;
|
|
857
876
|
const ThemeContext = createContext();
|
|
858
|
-
function
|
|
877
|
+
function makeStyled(tag) {
|
|
859
878
|
let _ctx = this || {};
|
|
860
879
|
return (...args) => {
|
|
861
880
|
const Styled = (props) => {
|
|
@@ -890,6 +909,11 @@ function styled(tag) {
|
|
|
890
909
|
return Styled;
|
|
891
910
|
};
|
|
892
911
|
}
|
|
912
|
+
const styled = new Proxy(makeStyled, {
|
|
913
|
+
get(target, tag) {
|
|
914
|
+
return target(tag);
|
|
915
|
+
}
|
|
916
|
+
});
|
|
893
917
|
function checkIsCSSLength(str) {
|
|
894
918
|
if (typeof str !== "string")
|
|
895
919
|
return false;
|
|
@@ -911,12 +935,80 @@ const spacing = {
|
|
|
911
935
|
xlXXl: "3rem",
|
|
912
936
|
xxl: "4rem"
|
|
913
937
|
};
|
|
938
|
+
function fromEntries(entries) {
|
|
939
|
+
return entries.reduce((acc, [key, value]) => {
|
|
940
|
+
return __spreadProps(__spreadValues({}, acc), { [key]: value });
|
|
941
|
+
}, {});
|
|
942
|
+
}
|
|
943
|
+
const getSpacingValue = (spacingKey, theme) => {
|
|
944
|
+
var _a, _b;
|
|
945
|
+
const maybeSpaceingOrDefault = (_b = (_a = theme == null ? void 0 : theme.space) != null ? _a : theme == null ? void 0 : theme.spacing) != null ? _b : spacing;
|
|
946
|
+
const safeSpacings = fromEntries(Object.entries(maybeSpaceingOrDefault).map(([spaceKey, value]) => [
|
|
947
|
+
spaceKey,
|
|
948
|
+
typeof value === "number" ? `${value}px` : value
|
|
949
|
+
]));
|
|
950
|
+
const spacingVal = safeSpacings[spacingKey];
|
|
951
|
+
const isCSSLength = checkIsCSSLength(spacingVal);
|
|
952
|
+
return isCSSLength ? spacingVal : void 0;
|
|
953
|
+
};
|
|
914
954
|
const Stack = styled("div")`
|
|
955
|
+
@property --gutter {
|
|
956
|
+
syntax: "<length-percentage>";
|
|
957
|
+
inherits: false;
|
|
958
|
+
initial-value: 0;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
--gutter: ${(props) => {
|
|
962
|
+
var _a;
|
|
963
|
+
return props.gutter ? (_a = getSpacingValue(props.gutter, props.theme)) != null ? _a : "0px" : "0px";
|
|
964
|
+
}};
|
|
965
|
+
box-sizing: border-box;
|
|
966
|
+
> * {
|
|
967
|
+
margin: 0;
|
|
968
|
+
}
|
|
915
969
|
display: flex;
|
|
916
970
|
flex-direction: column;
|
|
917
|
-
|
|
918
|
-
var
|
|
919
|
-
|
|
971
|
+
|
|
972
|
+
gap: var(--gutter, 0px);
|
|
973
|
+
align-content: start;
|
|
974
|
+
|
|
975
|
+
& > [data-bedrock-column] {
|
|
976
|
+
grid-column: span 1 / auto;
|
|
977
|
+
}
|
|
978
|
+
`;
|
|
979
|
+
const Grid = styled("div")`
|
|
980
|
+
@property --gutter {
|
|
981
|
+
syntax: "<length-percentage>";
|
|
982
|
+
inherits: false;
|
|
983
|
+
initial-value: 0;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
@property --minItemWidth {
|
|
987
|
+
syntax: "<length-percentage>";
|
|
988
|
+
inherits: false;
|
|
989
|
+
initial-value: 639px;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
--gutter: ${(props) => {
|
|
993
|
+
var _a;
|
|
994
|
+
return props.gutter ? (_a = getSpacingValue(props.gutter, props.theme)) != null ? _a : "0px" : "0px";
|
|
995
|
+
}};
|
|
996
|
+
--minItemWidth: ${(props) => {
|
|
997
|
+
var _a;
|
|
998
|
+
return typeof props.minItemWidth === "string" ? props.minItemWidth : `${(_a = props.minItemWidth) != null ? _a : 0}px`;
|
|
920
999
|
}};
|
|
1000
|
+
|
|
1001
|
+
box-sizing: border-box;
|
|
1002
|
+
> * {
|
|
1003
|
+
margin: 0;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
display: grid;
|
|
1007
|
+
gap: var(--gutter, 0px);
|
|
1008
|
+
|
|
1009
|
+
grid-template-columns: repeat(
|
|
1010
|
+
auto-fit,
|
|
1011
|
+
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
1012
|
+
);
|
|
921
1013
|
`;
|
|
922
|
-
export { Stack, checkIsCSSLength, spacing };
|
|
1014
|
+
export { Grid, Stack, checkIsCSSLength, getSpacingValue, spacing };
|
package/lib/index.umd.js
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
(function(p,S){typeof exports=="object"&&typeof module!="undefined"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(p=typeof globalThis!="undefined"?globalThis:p||self,S(p.solid={}))})(this,function(p){"use strict";let S={data:""},fe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||S,ue=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ce=/\/\*[^]*?\*\/|\s\s+|\n/g,b=(e,t)=>{let n="",s="",l="";for(let i in e){let r=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+r+";":s+=i[1]=="f"?b(r,i):i+"{"+b(r,i[1]=="k"?"":t)+"}":typeof r=="object"?s+=b(r,t?t.replace(/([^,])+/g,o=>i.replace(/(^:.*)|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,o):o?o+" "+f:f)):i):r!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),l+=b.p?b.p(i,r):i+":"+r+";")}return n+(t&&l?t+"{"+l+"}":l)+s},A={},X=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+X(e[n]);return t}return e},ae=(e,t,n,s,l)=>{let i=X(e),r=A[i]||(A[i]=(o=>{let f=0,u=11;for(;f<o.length;)u=101*u+o.charCodeAt(f++)>>>0;return"go"+u})(i));if(!A[r]){let o=i!==e?e:(f=>{let u,c=[{}];for(;u=ue.exec(f.replace(ce,""));)u[4]?c.shift():u[3]?c.unshift(c[0][u[3]]=c[0][u[3]]||{}):c[0][u[1]]=u[2];return c[0]})(e);A[r]=b(l?{["@keyframes "+r]:o}:o,n?"":"."+r)}return((o,f,u)=>{f.data.indexOf(o)==-1&&(f.data=u?o+f.data:f.data+o)})(A[r],t,s),r},he=(e,t,n)=>e.reduce((s,l,i)=>{let r=t[i];if(r&&r.call){let o=r(n),f=o&&o.props&&o.props.className||/^go/.test(o)&&o;r=f?"."+f:o&&typeof o=="object"?o.props?"":b(o,""):o===!1?"":o}return s+l+(r==null?"":r)},"");function L(e){let t=this||{},n=e.call?e(t.p):e;return ae(n.unshift?n.raw?he(n,[].slice.call(arguments,1),t.p):n.reduce((s,l)=>Object.assign(s,l&&l.call?l(t.p):l),{}):n,fe(t.target),t.g,t.o,t.k)}L.bind({g:1}),L.bind({k:1});const de=(e,t)=>e===t,ge=Symbol("solid-proxy"),K={equals:de};let pe=Q;const O={},y=1,j=2,ye={owned:null,cleanups:null,context:null,owner:null};var g=null;let C=null,a=null,N=null,h=null,m=null,v=0;function me(e,t,n){const s=M(e,t,!0,y);T(s)}function E(e,t,n){const s=M(e,t,!1,y);T(s)}function V(e,t,n){n=n?Object.assign({},K,n):K;const s=M(e,t,!0,0);return s.pending=O,s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,T(s),Ae.bind(s)}function we(e){if(N)return e();let t;const n=N=[];try{t=e()}finally{N=null}return G(()=>{for(let s=0;s<n.length;s+=1){const l=n[s];if(l.pending!==O){const i=l.pending;l.pending=O,H(l,i)}}},!1),t}function D(e){let t,n=a;return a=null,t=e(),a=n,t}function be(e){const t=Symbol("context");return{id:t,Provider:Ee(t),defaultValue:e}}function xe(e){return J(g,e.id)||e.defaultValue}function Se(e){const t=V(e);return V(()=>_(t()))}function Ae(){const e=C;if(this.sources&&(this.state||e)){const t=h;h=null,this.state===y||e?T(this):B(this),h=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 H(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(N)return e.pending===O&&N.push(e),e.pending=t,t;let s=!1;return e.value=t,e.observers&&e.observers.length&&G(()=>{for(let l=0;l<e.observers.length;l+=1){const i=e.observers[l];s&&C.disposed.has(i),i.pure?h.push(i):m.push(i),i.observers&&(s&&!i.tState||!s&&!i.state)&&W(i),s||(i.state=y)}if(h.length>1e6)throw h=[],new Error},!1),t}function T(e){if(!e.fn)return;Y(e);const t=g,n=a,s=v;a=g=e,Ce(e,e.value,s),a=n,g=t}function Ce(e,t,n){let s;try{s=e.fn(t)}catch(l){Z(l)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?H(e,s):e.value=s,e.updatedAt=n)}function M(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:g,context:null,pure:n};return g===null||g!==ye&&(g.owned?g.owned.push(i):g.owned=[i]),i}function R(e){const t=C;if(e.state!==y)return e.state=0;if(e.suspense&&D(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<v);)(e.state||t)&&n.push(e);for(let s=n.length-1;s>=0;s--)if(e=n[s],e.state===y||t)T(e);else if(e.state===j||t){const l=h;h=null,B(e,n[0]),h=l}}function G(e,t){if(h)return e();let n=!1;t||(h=[]),m?n=!0:m=[],v++;try{return e()}catch(s){Z(s)}finally{Ne(n)}}function Ne(e){h&&(Q(h),h=null),!e&&(m.length?we(()=>{pe(m),m=null}):m=null)}function Q(e){for(let t=0;t<e.length;t++)R(e[t])}function B(e,t){e.state=0;const n=C;for(let s=0;s<e.sources.length;s+=1){const l=e.sources[s];l.sources&&(l.state===y||n?l!==t&&R(l):(l.state===j||n)&&B(l,t))}}function W(e){const t=C;for(let n=0;n<e.observers.length;n+=1){const s=e.observers[n];(!s.state||t)&&(s.state=j,s.pure?h.push(s):m.push(s),s.observers&&W(s))}}function Y(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(),r=n.observerSlots.pop();s<l.length&&(i.sourceSlots[r]=s,l[s]=i,n.observerSlots[s]=r)}}if(e.owned){for(t=0;t<e.owned.length;t++)Y(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 Z(e){throw e}function J(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&J(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 Ee(e){return function(n){let s;return me(()=>s=D(()=>(g.context={[e]:n.value},Se(()=>n.children)))),s}}function $(){return!0}const z={get(e,t,n){return t===ge?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 F(e){return typeof e=="function"?e():e}function ee(...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)]}},z)}function te(e,...t){const n=new Set(t.flat()),s=Object.getOwnPropertyDescriptors(e),l=t.map(i=>{const r={};for(let o=0;o<i.length;o++){const f=i[o];Object.defineProperty(r,f,s[f]?s[f]:{get(){return e[f]},set(){return!0}})}return r});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))}},z)),l}const Te=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Pe=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Te]),Le=new Set(["innerHTML","textContent","innerText","children"]),Oe={className:"class",htmlFor:"for"},ne={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"]),ke={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function je(e,t,n){let s=n.length,l=t.length,i=s,r=0,o=0,f=t[l-1].nextSibling,u=null;for(;r<l||o<i;){if(t[r]===n[o]){r++,o++;continue}for(;t[l-1]===n[i-1];)l--,i--;if(l===r){const c=i<s?o?n[o-1].nextSibling:n[i-o]:f;for(;o<i;)e.insertBefore(n[o++],c)}else if(i===o)for(;r<l;)(!u||!u.has(t[r]))&&t[r].remove(),r++;else if(t[r]===n[i-1]&&n[o]===t[l-1]){const c=t[--l].nextSibling;e.insertBefore(n[o++],t[r++].nextSibling),e.insertBefore(n[--i],c),t[l]=n[i]}else{if(!u){u=new Map;let d=o;for(;d<i;)u.set(n[d],d++)}const c=u.get(t[r]);if(c!=null)if(o<c&&c<i){let d=r,w=1,P;for(;++d<l&&d<i&&!((P=u.get(t[d]))==null||P!==c+w);)w++;if(w>c-o){const U=t[r];for(;o<c;)e.insertBefore(n[o++],U)}else e.replaceChild(n[o++],t[r++])}else r++;else t[r++].remove()}}}const se="_$DX_DELEGATE";function ve(e,t=window.document){const n=t[se]||(t[se]=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,Xe))}}function De(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Me(e,t,n,s){s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s)}function Be(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 _e(e,t,n={}){const s=Object.keys(t||{}),l=Object.keys(n);let i,r;for(i=0,r=l.length;i<r;i++){const o=l[i];!o||o==="undefined"||t[o]||(ie(e,o,!1),delete n[o])}for(i=0,r=s.length;i<r;i++){const o=s[i],f=!!t[o];!o||o==="undefined"||n[o]===f||!f||(ie(e,o,!0),n[o]=f)}return n}function Fe(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 Ie(e,t,n,s){typeof t=="function"?E(l=>oe(e,t(),l,n,s)):oe(e,t,void 0,n,s)}function qe(e,t,n,s,l={}){for(const i in l)if(!(i in t)){if(i==="children")continue;le(e,i,null,l[i],n)}for(const i in t){if(i==="children"){s||k(e,t.children);continue}const r=t[i];l[i]=le(e,i,r,l[i],n)}}function Ue(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function ie(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 le(e,t,n,s,l){let i,r,o;if(t==="style")return Fe(e,n,s);if(t==="classList")return _e(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 f=t.slice(2).toLowerCase(),u=$e.has(f);Be(e,f,n,u),u&&ve([f])}else if((o=Le.has(t))||!l&&(ne[t]||(r=Pe.has(t)))||(i=e.nodeName.includes("-")))i&&!r&&!o?e[Ue(t)]=n:e[ne[t]||t]=n;else{const f=l&&t.indexOf(":")>-1&&ke[t.split(":")[0]];f?Me(e,f,t,n):De(e,Oe[t]||t,n)}return n}function Xe(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&&E(()=>n.children=k(e,t.children,n.children)),E(()=>qe(e,t,s,!0,n)),n}function k(e,t,n,s,l){for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,r=s!==void 0;if(e=r&&n[0]&&n[0].parentNode||e,i==="string"||i==="number")if(i==="number"&&(t=t.toString()),r){let o=n[0];o&&o.nodeType===3?o.data=t:o=document.createTextNode(t),n=x(e,n,s,o)}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 E(()=>{let o=t();for(;typeof o=="function";)o=o();n=k(e,o,n,s)}),()=>n;if(Array.isArray(t)){const o=[];if(I(o,t,l))return E(()=>n=k(e,o,n,s,!0)),()=>n;if(o.length===0){if(n=x(e,n,s),r)return n}else Array.isArray(n)?n.length===0?re(e,o,s):je(e,n,o):(n&&x(e),re(e,o));n=o}else if(t instanceof Node){if(Array.isArray(n)){if(r)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 I(e,t,n){let s=!1;for(let l=0,i=t.length;l<i;l++){let r=t[l],o;if(r instanceof Node)e.push(r);else if(!(r==null||r===!0||r===!1))if(Array.isArray(r))s=I(e,r)||s;else if((o=typeof r)=="string")e.push(document.createTextNode(r));else if(o==="function")if(n){for(;typeof r=="function";)r=r();s=I(e,Array.isArray(r)?r:[r])||s}else e.push(r),s=!0;else e.push(document.createTextNode(r.toString()))}return s}function re(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 r=t.length-1;r>=0;r--){const o=t[r];if(l!==o){const f=o.parentNode===e;!i&&!r?f?e.replaceChild(l,o):e.insertBefore(l,n):f&&o.remove()}else i=!0}}else e.insertBefore(l,n);return[l]}function Ke(e,...t){}function We(e){}const Ve=!1,He=be();function Re(e){let t=this||{};return(...n)=>{const s=l=>{const i=xe(He),r=ee(l,{theme:i}),o=ee(r,{get className(){const w=r.className,P="className"in r&&/^go[0-9]+/.test(w);let U=L.apply({target:t.target,o:P,p:r,g:t.g},n);return[w,U].filter(Boolean).join(" ")}}),[f,u]=te(o,["as"]),c=f.as||e;let d;if(typeof c=="function")d=c(u);else if(Ve){const[w,P]=te(u,["children"]);d=Ke([`<${c} `,">",`</${c}>`],void 0,w.children||"")}else d=document.createElement(c),Ie(d,u);return d};return s.className=l=>D(()=>L.apply({target:t.target,p:l,g:t.g},n)),s}}function Ge(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 q={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"},Qe=Re("div")`
|
|
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")`
|
|
2
|
+
@property --gutter {
|
|
3
|
+
syntax: "<length-percentage>";
|
|
4
|
+
inherits: false;
|
|
5
|
+
initial-value: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=W(e.gutter,e.theme))!=null?t:"0px"}};
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
> * {
|
|
11
|
+
margin: 0;
|
|
12
|
+
}
|
|
2
13
|
display: flex;
|
|
3
14
|
flex-direction: column;
|
|
4
|
-
|
|
5
|
-
|
|
15
|
+
|
|
16
|
+
gap: var(--gutter, 0px);
|
|
17
|
+
align-content: start;
|
|
18
|
+
|
|
19
|
+
& > [data-bedrock-column] {
|
|
20
|
+
grid-column: span 1 / auto;
|
|
21
|
+
}
|
|
22
|
+
`,nt=ce("div")`
|
|
23
|
+
@property --gutter {
|
|
24
|
+
syntax: "<length-percentage>";
|
|
25
|
+
inherits: false;
|
|
26
|
+
initial-value: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@property --minItemWidth {
|
|
30
|
+
syntax: "<length-percentage>";
|
|
31
|
+
inherits: false;
|
|
32
|
+
initial-value: 639px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=W(e.gutter,e.theme))!=null?t:"0px"}};
|
|
36
|
+
--minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
|
|
37
|
+
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
> * {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
display: grid;
|
|
44
|
+
gap: var(--gutter, 0px);
|
|
45
|
+
|
|
46
|
+
grid-template-columns: repeat(
|
|
47
|
+
auto-fit,
|
|
48
|
+
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
49
|
+
);
|
|
50
|
+
`;a.Grid=nt,a.Stack=tt,a.checkIsCSSLength=fe,a.getSpacingValue=W,a.spacing=ae,Object.defineProperty(a,"__esModule",{value:!0}),a[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.4.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": "c3fd4b54d681acfcda7dec3535c8586959cc6f37"
|
|
63
63
|
}
|