@bedrock-layout/solid 0.7.1 → 0.7.2

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.umd.js CHANGED
@@ -1,11 +1,11 @@
1
- var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnPropertyDescriptors;var be=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable;var xe=(u,g,p)=>g in u?$t(u,g,{enumerable:!0,configurable:!0,writable:!0,value:p}):u[g]=p,K=(u,g)=>{for(var p in g||(g={}))vt.call(g,p)&&xe(u,p,g[p]);if(be)for(var p of be(g))kt.call(g,p)&&xe(u,p,g[p]);return u},G=(u,g)=>At(u,Ct(g));(function(u,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(u=typeof globalThis!="undefined"?globalThis:u||self,g(u.solid={}))})(this,function(u){"use strict";let g={data:""},p=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,we=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Se=/\/\*[^]*?\*\/|\s\s+|\n/g,$=(e,t)=>{let n="",i="",r="";for(let s in e){let l=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+l+";":i+=s[1]=="f"?$(l,s):s+"{"+$(l,s[1]=="k"?"":t)+"}":typeof l=="object"?i+=$(l,t?t.replace(/([^,])+/g,o=>s.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,o):o?o+" "+c:c)):s):l!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=$.p?$.p(s,l):s+":"+l+";")}return n+(t&&r?t+"{"+r+"}":r)+i},k={},H=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+H(e[n]);return t}return e},$e=(e,t,n,i,r)=>{let s=H(e),l=k[s]||(k[s]=(o=>{let c=0,a=11;for(;c<o.length;)a=101*a+o.charCodeAt(c++)>>>0;return"go"+a})(s));if(!k[l]){let o=s!==e?e:(c=>{let a,f=[{}];for(;a=we.exec(c.replace(Se,""));)a[4]?f.shift():a[3]?f.unshift(f[0][a[3]]=f[0][a[3]]||{}):f[0][a[1]]=a[2];return f[0]})(e);k[l]=$(r?{["@keyframes "+l]:o}:o,n?"":"."+l)}return((o,c,a)=>{c.data.indexOf(o)==-1&&(c.data=a?o+c.data:c.data+o)})(k[l],t,i),l},Ae=(e,t,n)=>e.reduce((i,r,s)=>{let l=t[s];if(l&&l.call){let o=l(n),c=o&&o.props&&o.props.className||/^go/.test(o)&&o;l=c?"."+c:o&&typeof o=="object"?o.props?"":$(o,""):o===!1?"":o}return i+r+(l==null?"":l)},"");function A(e){let t=this||{},n=e.call?e(t.p):e;return $e(n.unshift?n.raw?Ae(n,[].slice.call(arguments,1),t.p):n.reduce((i,r)=>Object.assign(i,r&&r.call?r(t.p):r),{}):n,p(t.target),t.g,t.o,t.k)}A.bind({g:1}),A.bind({k:1});const Ce=(e,t)=>e===t,ve=Symbol("solid-proxy"),Q={equals:Ce};let ke=te;const O={},x=1,M=2,Ee={owned:null,cleanups:null,context:null,owner:null};var m=null;let E=null,d=null,N=null,h=null,w=null,B=0;function Ne(e,t,n){const i=F(e,t,!0,x);T(i)}function j(e,t,n){const i=F(e,t,!1,x);T(i)}function Y(e,t,n){n=n?Object.assign({},Q,n):Q;const i=F(e,t,!0,0);return i.pending=O,i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,T(i),Le.bind(i)}function je(e){if(N)return e();let t;const n=N=[];try{t=e()}finally{N=null}return ee(()=>{for(let i=0;i<n.length;i+=1){const r=n[i];if(r.pending!==O){const s=r.pending;r.pending=O,Z(r,s)}}},!1),t}function z(e){let t,n=d;return d=null,t=e(),d=n,t}function Te(e){const t=Symbol("context");return{id:t,Provider:Me(t),defaultValue:e}}function Pe(e){return re(m,e.id)||e.defaultValue}function Oe(e){const t=Y(e);return Y(()=>V(t()))}function Le(){const e=E;if(this.sources&&(this.state||e)){const t=h;h=null,this.state===x||e?T(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 Z(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 i=!1;return e.value=t,e.observers&&e.observers.length&&ee(()=>{for(let r=0;r<e.observers.length;r+=1){const s=e.observers[r];i&&E.disposed.has(s),s.pure?h.push(s):w.push(s),s.observers&&(i&&!s.tState||!i&&!s.state)&&ne(s),i||(s.state=x)}if(h.length>1e6)throw h=[],new Error},!1),t}function T(e){if(!e.fn)return;ie(e);const t=m,n=d,i=B;d=m=e,Ie(e,e.value,i),d=n,m=t}function Ie(e,t,n){let i;try{i=e.fn(t)}catch(r){se(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?Z(e,i):e.value=i,e.updatedAt=n)}function F(e,t,n,i=x,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!==Ee&&(m.owned?m.owned.push(s):m.owned=[s]),s}function J(e){const t=E;if(e.state!==x)return e.state=0;if(e.suspense&&z(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 i=n.length-1;i>=0;i--)if(e=n[i],e.state===x||t)T(e);else if(e.state===M||t){const r=h;h=null,R(e,n[0]),h=r}}function ee(e,t){if(h)return e();let n=!1;t||(h=[]),w?n=!0:w=[],B++;try{return e()}catch(i){se(i)}finally{De(n)}}function De(e){h&&(te(h),h=null),!e&&(w.length?je(()=>{ke(w),w=null}):w=null)}function te(e){for(let t=0;t<e.length;t++)J(e[t])}function R(e,t){e.state=0;const n=E;for(let i=0;i<e.sources.length;i+=1){const r=e.sources[i];r.sources&&(r.state===x||n?r!==t&&J(r):(r.state===M||n)&&R(r,t))}}function ne(e){const t=E;for(let n=0;n<e.observers.length;n+=1){const i=e.observers[n];(!i.state||t)&&(i.state=M,i.pure?h.push(i):w.push(i),i.observers&&ne(i))}}function ie(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(),l=n.observerSlots.pop();i<r.length&&(s.sourceSlots[l]=i,r[i]=s,n.observerSlots[i]=l)}}if(e.owned){for(t=0;t<e.owned.length;t++)ie(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 re(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&re(e.owner,t))}function V(e){if(typeof e=="function"&&!e.length)return V(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const i=V(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 Ne(()=>i=z(()=>(m.context={[e]:n.value},Oe(()=>n.children)))),i}}function L(){return!0}const le={get(e,t,n){return t===ve?n:e.get(t)},has(e,t){return e.has(t)},set:L,deleteProperty:L,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:L,deleteProperty:L}},ownKeys(e){return e.keys()}};function W(e){return typeof e=="function"?e():e}function oe(...e){return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const i=W(e[n])[t];if(i!==void 0)return i}},has(t){for(let n=e.length-1;n>=0;n--)if(t in W(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(W(e[n])));return[...new Set(t)]}},le)}function ce(e,...t){const n=new Set(t.flat()),i=Object.getOwnPropertyDescriptors(e),r=t.map(s=>{const l={};for(let o=0;o<s.length;o++){const c=s[o];Object.defineProperty(l,c,i[c]?i[c]:{get(){return e[c]},set(){return!0}})}return l});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))}},le)),r}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"],ze=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Be]),Fe=new Set(["innerHTML","textContent","innerText","children"]),Re={className:"class",htmlFor:"for"},ae={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},Ve=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),We={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function _e(e,t,n){let i=n.length,r=t.length,s=i,l=0,o=0,c=t[r-1].nextSibling,a=null;for(;l<r||o<s;){if(t[l]===n[o]){l++,o++;continue}for(;t[r-1]===n[s-1];)r--,s--;if(r===l){const f=s<i?o?n[o-1].nextSibling:n[s-o]:c;for(;o<s;)e.insertBefore(n[o++],f)}else if(s===o)for(;l<r;)(!a||!a.has(t[l]))&&t[l].remove(),l++;else if(t[l]===n[s-1]&&n[o]===t[r-1]){const f=t[--r].nextSibling;e.insertBefore(n[o++],t[l++].nextSibling),e.insertBefore(n[--s],f),t[r]=n[s]}else{if(!a){a=new Map;let y=o;for(;y<s;)a.set(n[y],y++)}const f=a.get(t[l]);if(f!=null)if(o<f&&f<s){let y=l,S=1,P;for(;++y<r&&y<s&&!((P=a.get(t[y]))==null||P!==f+S);)S++;if(S>f-o){const X=t[l];for(;o<f;)e.insertBefore(n[o++],X)}else e.replaceChild(n[o++],t[l++])}else l++;else t[l++].remove()}}}const ue="_$DX_DELEGATE";function Ue(e,t=window.document){const n=t[ue]||(t[ue]=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 qe(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,l;for(s=0,l=r.length;s<l;s++){const o=r[s];!o||o==="undefined"||t[o]||(fe(e,o,!1),delete n[o])}for(s=0,l=i.length;s<l;s++){const o=i[s],c=!!t[o];!o||o==="undefined"||n[o]===c||!c||(fe(e,o,!0),n[o]=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"?j(r=>de(e,t(),r,n,i)):de(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;ge(e,s,null,r[s],n)}for(const s in t){if(s==="children"){i||I(e,t.children);continue}const l=t[s];r[s]=ge(e,s,l,r[s],n)}}function Ze(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function fe(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 ge(e,t,n,i,r){let s,l,o;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(),a=Ve.has(c);Ke(e,c,n,a),a&&Ue([c])}else if((o=Fe.has(t))||!r&&(ae[t]||(l=ze.has(t)))||(s=e.nodeName.includes("-")))s&&!l&&!o?e[Ze(t)]=n:e[ae[t]||t]=n;else{const c=r&&t.indexOf(":")>-1&&We[t.split(":")[0]];c?Xe(e,c,t,n):qe(e,Re[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 de(e,t,n={},i,r){return!r&&"children"in t&&j(()=>n.children=I(e,t.children,n.children)),j(()=>Ye(e,t,i,!0,n)),n}function I(e,t,n,i,r){for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,l=i!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,s==="string"||s==="number")if(s==="number"&&(t=t.toString()),l){let o=n[0];o&&o.nodeType===3?o.data=t:o=document.createTextNode(t),n=v(e,n,i,o)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||s==="boolean")n=v(e,n,i);else{if(s==="function")return j(()=>{let o=t();for(;typeof o=="function";)o=o();n=I(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[];if(_(o,t,r))return j(()=>n=I(e,o,n,i,!0)),()=>n;if(o.length===0){if(n=v(e,n,i),l)return n}else Array.isArray(n)?n.length===0?he(e,o,i):_e(e,n,o):(n&&v(e),he(e,o));n=o}else if(t instanceof Node){if(Array.isArray(n)){if(l)return n=v(e,n,i,t);v(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _(e,t,n){let i=!1;for(let r=0,s=t.length;r<s;r++){let l=t[r],o;if(l instanceof Node)e.push(l);else if(!(l==null||l===!0||l===!1))if(Array.isArray(l))i=_(e,l)||i;else if((o=typeof l)=="string")e.push(document.createTextNode(l));else if(o==="function")if(n){for(;typeof l=="function";)l=l();i=_(e,Array.isArray(l)?l:[l])||i}else e.push(l),i=!0;else e.push(document.createTextNode(l.toString()))}return i}function he(e,t,n){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function v(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let s=!1;for(let l=t.length-1;l>=0;l--){const o=t[l];if(r!==o){const c=o.parentNode===e;!s&&!l?c?e.replaceChild(r,o):e.insertBefore(r,n):c&&o.remove()}else s=!0}}else e.insertBefore(r,n);return[r]}function et(e,...t){}function Et(e){}const tt=!1,nt=Te();function it(e){let t=this||{};return(...n)=>{const i=r=>{const s=Pe(nt),l=oe(r,{theme:s}),o=oe(l,{get className(){const S=l.className,P="className"in l&&/^go[0-9]+/.test(S);let X=A.apply({target:t.target,o:P,p:l,g:t.g},n);return[S,X].filter(Boolean).join(" ")}}),[c,a]=ce(o,["as"]),f=c.as||e;let y;if(typeof f=="function")y=f(a);else if(tt){const[S,P]=ce(a,["children"]);y=et([`<${f} `,">",`</${f}>`],void 0,S.children||"")}else y=document.createElement(f),Qe(y,a);return y};return i.className=r=>z(()=>A.apply({target:t.target,p:r,g:t.g},n)),i}}const b=new Proxy(it,{get(e,t){return e(t)}});function ye(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 U={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])=>G(K({},t),{[n]:i}),{})}const C=(e,t)=>{var l,o;const n=(o=(l=t==null?void 0:t.space)!=null?l:t==null?void 0:t.spacing)!=null?o:U,r=st(Object.entries(n).map(([c,a])=>[c,typeof a=="number"?`${a}px`:a]))[e];return ye(r)?r:void 0};function rt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const lt=b("div")`
1
+ var F=Object.defineProperty,X=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var S=(n,i,r)=>i in n?F(n,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[i]=r,p=(n,i)=>{for(var r in i||(i={}))_.call(i,r)&&S(n,r,i[r]);if($)for(var r of $(i))q.call(i,r)&&S(n,r,i[r]);return n},b=(n,i)=>X(n,G(i));(function(n,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("solid-styled-components")):typeof define=="function"&&define.amd?define(["exports","solid-styled-components"],i):(n=typeof globalThis!="undefined"?globalThis:n||self,i(n.solid={},n.solidStyledComponents))})(this,function(n,i){"use strict";function r(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 g={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 k(e){return e.reduce((t,[s,d])=>b(p({},t),{[s]:d}),{})}const l=(e,t)=>{var a,o;const s=(o=(a=t==null?void 0:t.space)!=null?a:t==null?void 0:t.spacing)!=null?o:g,c=k(Object.entries(s).map(([y,m])=>[y,typeof m=="number"?`${m}px`:m]))[e];return r(c)?c:void 0};function w(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const A=i.styled.div`
2
2
  @property --maxWidth {
3
3
  syntax: "<length-percentage>";
4
4
  inherits: false;
5
5
  initial-value: 100%;
6
6
  }
7
7
 
8
- --maxWidth: ${e=>rt(e.maxWidth)};
8
+ --maxWidth: ${e=>w(e.maxWidth)};
9
9
 
10
10
  box-sizing: content-box;
11
11
 
@@ -17,16 +17,16 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
17
17
 
18
18
  max-inline-size: var(--maxWidth, 100%);
19
19
 
20
- ${e=>e.centerChildren?A`
20
+ ${e=>e.centerChildren?i.css`
21
21
  display: flex;
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  `:""}
25
25
 
26
- ${e=>e.centerText?A`
26
+ ${e=>e.centerText?i.css`
27
27
  text-align: center;
28
28
  `:""}
29
- `;function ot(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const ct=b("div")`
29
+ `;function j(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const z=i.styled("div")`
30
30
  @property --basis {
31
31
  syntax: "<length-percentage>";
32
32
  inherits: true;
@@ -39,8 +39,8 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
39
39
  initial-value: 0px;
40
40
  }
41
41
 
42
- --basis: ${e=>ot(e.basis)};
43
- --gutter: ${e=>{var t;return e.gutter&&(t=C(e.gutter,e.theme))!=null?t:"0px"}};
42
+ --basis: ${e=>j(e.basis)};
43
+ --gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
44
44
 
45
45
  box-sizing: border-box;
46
46
  > * {
@@ -53,14 +53,14 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
53
53
  display: flex;
54
54
  flex-wrap: wrap;
55
55
  gap: var(--gutter, 0px);
56
- `;function at(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function ut(e){return Array.isArray(e)?e.join("/"):e}function ft(e){return at(e)?ut(e):void 0}const gt=b.div`
56
+ `;function I(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function O(e){return Array.isArray(e)?e.join("/"):e}function R(e){return I(e)?O(e):void 0}const W=i.styled.div`
57
57
  box-sizing: border-box;
58
58
  display: block;
59
59
  inline-size: 100%;
60
60
  position: relative;
61
61
  overflow: hidden;
62
62
 
63
- ${e=>{const t=ft(e.ratio);return t?A`
63
+ ${e=>{const t=R(e.ratio);return t?i.css`
64
64
  aspect-ratio: ${t};
65
65
  `:""}};
66
66
 
@@ -88,7 +88,7 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
88
88
  object-fit: cover;
89
89
  object-position: ${e=>typeof e.position=="string"?e.position:"50%"};
90
90
  }
91
- `,dt=b("div")`
91
+ `,M=i.styled("div")`
92
92
  @property --gutter {
93
93
  syntax: "<length-percentage>";
94
94
  inherits: false;
@@ -101,7 +101,7 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
101
101
  initial-value: 639px;
102
102
  }
103
103
 
104
- --gutter: ${e=>{var t;return e.gutter&&(t=C(e.gutter,e.theme))!=null?t:"0px"}};
104
+ --gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
105
105
  --minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
106
106
 
107
107
  box-sizing: border-box;
@@ -116,8 +116,8 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
116
116
  auto-fit,
117
117
  minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
118
118
  );
119
- `,D={start:"flex-start",end:"flex-end",center:"center"},q=G(K({},D),{stretch:"stretch"}),pe=b.div`
120
- --gutter: ${e=>{var t;return e.gutter&&(t=C(e.gutter,e.theme))!=null?t:"0px"}};
119
+ `,u={start:"flex-start",end:"flex-end",center:"center"},f=b(p({},u),{stretch:"stretch"}),h=i.styled.div`
120
+ --gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
121
121
 
122
122
  box-sizing: border-box;
123
123
  > * {
@@ -128,10 +128,10 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
128
128
  flex-wrap: wrap;
129
129
  gap: var(--gutter, 0px);
130
130
 
131
- justify-content: ${e=>typeof e.justify!="undefined"&&D[e.justify]?D[e.justify]:D.start};
131
+ justify-content: ${e=>typeof e.justify!="undefined"&&u[e.justify]?u[e.justify]:u.start};
132
132
 
133
- align-items: ${e=>typeof e.align!="undefined"&&q[e.align]?q[e.align]:q.start};
134
- `;function ht(e){return typeof e=="number"&&e>-1?!0:typeof e=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${e}`):!1}const yt=b(pe)`
133
+ align-items: ${e=>typeof e.align!="undefined"&&f[e.align]?f[e.align]:f.start};
134
+ `;function T(e){return typeof e=="number"&&e>-1?!0:typeof e=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${e}`):!1}const C=i.styled(h)`
135
135
  @property --switchAt {
136
136
  syntax: "<length-percentage>";
137
137
  inherits: true;
@@ -140,7 +140,7 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
140
140
  flex-wrap: nowrap;
141
141
  ${e=>e.stretch==="all"?"> * { flex: 1 }":e.stretch==="start"?"> :first-child { flex: 1 }":e.stretch==="end"?"> :last-child { flex: 1 }":typeof e.stretch=="number"?`> :nth-child(${e.stretch+1}) { flex: 1 }`:""}
142
142
 
143
- ${e=>ht(e.switchAt)?`
143
+ ${e=>T(e.switchAt)?`
144
144
  --switchAt: ${typeof e.switchAt=="string"?e.switchAt:`${e.switchAt}px`};
145
145
  flex-wrap: wrap;
146
146
  > * {
@@ -150,17 +150,17 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
150
150
  );
151
151
  }
152
152
  `:""}
153
- `,me=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),pt=(e,t)=>({left:`padding-inline-start:${t};`,right:`padding-inline-end:${t};`,top:`padding-block-start:${t};`,bottom:`padding-block-end:${t};`,inlineStart:`padding-inline-start:${t};`,inlineEnd:`padding-inline-end:${t};`,blockStart:`padding-block-start:${t};`,blockEnd:`padding-block-end:${t};`})[e];function mt(e){return t=>{const n=C(t,e);return n!=null?n:"0px"}}function bt(e,t){var s;if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=new Set(Object.keys((s=e==null?void 0:e.spacing)!=null?s:U));(()=>typeof t=="string"?!0:Array.isArray(t)?t.every(l=>n.has(l)):t&&Object.keys(t).every(l=>me.has(l))&&Object.values(t).every(l=>n.has(l)))()||console.error("Invalid padding Type");const r=mt(e);return typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((l,[o,c])=>me.has(o)?l+pt(o,r(c)):l,""):t?`padding: ${Array.from(Array.isArray(t)?t:[t]).map(l=>r(l)).join(" ")}`:""}const xt=b.div`
153
+ `,v=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),E=(e,t)=>({left:`padding-inline-start:${t};`,right:`padding-inline-end:${t};`,top:`padding-block-start:${t};`,bottom:`padding-block-end:${t};`,inlineStart:`padding-inline-start:${t};`,inlineEnd:`padding-inline-end:${t};`,blockStart:`padding-block-start:${t};`,blockEnd:`padding-block-end:${t};`})[e];function P(e){return t=>{const s=l(t,e);return s!=null?s:"0px"}}function D(e,t){var x;if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const s=new Set(Object.keys((x=e==null?void 0:e.spacing)!=null?x:g));(()=>typeof t=="string"?!0:Array.isArray(t)?t.every(a=>s.has(a)):t&&Object.keys(t).every(a=>v.has(a))&&Object.values(t).every(a=>s.has(a)))()||console.error("Invalid padding Type");const c=P(e);return typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((a,[o,y])=>v.has(o)?a+E(o,c(y)):a,""):t?`padding: ${Array.from(Array.isArray(t)?t:[t]).map(a=>c(a)).join(" ")}`:""}const L=i.styled.div`
154
154
  box-sizing: border-box;
155
- ${e=>bt(e.theme,e.padding)}
156
- `,wt=b.div`
155
+ ${e=>D(e.theme,e.padding)}
156
+ `,V=i.styled.div`
157
157
  box-sizing: border-box;
158
158
  > * {
159
159
  margin: 0;
160
160
  scroll-snap-align: start;
161
161
  }
162
162
 
163
- --gutter: ${e=>{var t;return e.gutter&&(t=C(e.gutter,e.theme))!=null?t:"0px"}};
163
+ --gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
164
164
 
165
165
  display: flex;
166
166
  gap: var(--gutter, 0px);
@@ -168,14 +168,14 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
168
168
  overflow-x: scroll;
169
169
 
170
170
  scroll-snap-type: ${({snapType:e="none"})=>{switch(e){case"none":return"none";case"proximity":return"x proximity";case"mandatory":return"x mandatory";default:return"none"}}};
171
- `,St=b("div")`
171
+ `,B=i.styled("div")`
172
172
  @property --gutter {
173
173
  syntax: "<length-percentage>";
174
174
  inherits: false;
175
175
  initial-value: 0;
176
176
  }
177
177
 
178
- --gutter: ${e=>{var t;return e.gutter&&(t=C(e.gutter,e.theme))!=null?t:"0px"}};
178
+ --gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
179
179
  box-sizing: border-box;
180
180
  > * {
181
181
  margin: 0;
@@ -189,4 +189,4 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
189
189
  & > [data-bedrock-column] {
190
190
  grid-column: span 1 / auto;
191
191
  }
192
- `;u.Center=lt,u.ColumnDrop=ct,u.Frame=gt,u.Grid=dt,u.Inline=yt,u.InlineCluster=pe,u.PadBox=xt,u.Reel=wt,u.Stack=St,u.checkIsCSSLength=ye,u.getSpacingValue=C,u.spacing=U,Object.defineProperty(u,"__esModule",{value:!0}),u[Symbol.toStringTag]="Module"});
192
+ `;n.Center=A,n.ColumnDrop=z,n.Frame=W,n.Grid=M,n.Inline=C,n.InlineCluster=h,n.PadBox=L,n.Reel=V,n.Stack=B,n.checkIsCSSLength=r,n.getSpacingValue=l,n.spacing=g,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
@@ -0,0 +1,21 @@
1
+ import { SpacingOptions } from "./spacing-constants";
2
+ declare const justifyMap: {
3
+ readonly start: "flex-start";
4
+ readonly end: "flex-end";
5
+ readonly center: "center";
6
+ };
7
+ declare const alignMap: {
8
+ readonly stretch: "stretch";
9
+ readonly start: "flex-start";
10
+ readonly end: "flex-end";
11
+ readonly center: "center";
12
+ };
13
+ export interface InlineClusterProps {
14
+ justify?: keyof typeof justifyMap;
15
+ align?: keyof typeof alignMap;
16
+ gutter: SpacingOptions;
17
+ }
18
+ export declare const InlineCluster: ((props: InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
19
+ className: (props: InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
20
+ };
21
+ export {};
@@ -0,0 +1,11 @@
1
+ import { InlineClusterProps } from "./inline-cluster";
2
+ declare type Stretch = "all" | "start" | "end" | number;
3
+ declare type SwitchAt = string | number;
4
+ export interface InlineProps extends InlineClusterProps {
5
+ stretch?: Stretch;
6
+ switchAt?: SwitchAt;
7
+ }
8
+ export declare const Inline: ((props: InlineProps & InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
9
+ className: (props: InlineProps & InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
10
+ };
11
+ export {};
@@ -0,0 +1,26 @@
1
+ import { SpacingOptions } from "./spacing-constants";
2
+ declare type PaddingObj = {
3
+ left: SpacingOptions;
4
+ } | {
5
+ right: SpacingOptions;
6
+ } | {
7
+ top: SpacingOptions;
8
+ } | {
9
+ bottom: SpacingOptions;
10
+ } | {
11
+ inlineStart: SpacingOptions;
12
+ } | {
13
+ inlineEnd: SpacingOptions;
14
+ } | {
15
+ blockStart: SpacingOptions;
16
+ } | {
17
+ blockEnd: SpacingOptions;
18
+ };
19
+ declare type PaddingTypes = SpacingOptions | PaddingObj | [SpacingOptions] | [SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions, SpacingOptions];
20
+ export interface PadBoxProps {
21
+ padding: PaddingTypes;
22
+ }
23
+ export declare const PadBox: ((props: PadBoxProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
24
+ className: (props: PadBoxProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
25
+ };
26
+ export {};
package/lib/reel.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { SpacingOptions } from "./spacing-constants";
2
+ export interface ReelProps {
3
+ snapType?: "none" | "proximity" | "mandatory";
4
+ gutter: SpacingOptions;
5
+ }
6
+ export declare const Reel: ((props: ReelProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
7
+ className: (props: ReelProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
8
+ };
@@ -0,0 +1,31 @@
1
+ import { DefaultTheme } from "solid-styled-components";
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";
3
+ declare type AllCharacter = LowercaseCharacter | Uppercase<LowercaseCharacter>;
4
+ declare type NonEmptyString = `${AllCharacter}${string}`;
5
+ declare type CSSCustomProperties = `var(--${NonEmptyString})`;
6
+ declare type LengthUnit = "vmin" | "vmax" | "vh" | "vw" | "%" | "ch" | "ex" | "em" | "rem" | "in" | "cm" | "mm" | "pt" | "pc" | "px";
7
+ export declare type CSSLength = `${number}${LengthUnit}` | CSSCustomProperties;
8
+ export declare function checkIsCSSLength(str: string): str is CSSLength;
9
+ export interface Spacing {
10
+ none: CSSLength;
11
+ xxs: CSSLength;
12
+ xs: CSSLength;
13
+ sm: CSSLength;
14
+ md: CSSLength;
15
+ mdLg: CSSLength;
16
+ lg: CSSLength;
17
+ lgXl: CSSLength;
18
+ xl: CSSLength;
19
+ xlXXl: CSSLength;
20
+ xxl: CSSLength;
21
+ }
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
+ export 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;
31
+ export {};
package/lib/stack.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { SpacingOptions } from "./spacing-constants";
2
+ export interface StackProps {
3
+ gutter?: SpacingOptions;
4
+ }
5
+ export declare const Stack: ((props: StackProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
6
+ className: (props: StackProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock-layout/solid",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
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": "5b501b447077862c75ed1efd35c87bcde525ba97"
62
+ "gitHead": "f383b93fdab7e65c717821aaec9fc4903cd61b80"
63
63
  }