@bedrock-layout/solid 0.6.0 → 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/center.d.ts +11 -0
- package/lib/column-drop.d.ts +11 -0
- package/lib/frame.d.ts +10 -0
- package/lib/grid.d.ts +10 -0
- package/lib/index.cjs.js +51 -30
- package/lib/index.d.ts +10 -122
- package/lib/index.m.js +45 -910
- package/lib/index.umd.js +46 -25
- package/lib/inline-cluster.d.ts +21 -0
- package/lib/inline.d.ts +11 -0
- package/lib/padbox.d.ts +26 -0
- package/lib/reel.d.ts +8 -0
- package/lib/spacing-constants.d.ts +31 -0
- package/lib/stack.d.ts +7 -0
- package/package.json +2 -2
package/lib/index.umd.js
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnPropertyDescriptors;var me=Object.getOwnPropertySymbols;var At=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable;var be=(a,g,p)=>g in a?wt(a,g,{enumerable:!0,configurable:!0,writable:!0,value:p}):a[g]=p,K=(a,g)=>{for(var p in g||(g={}))At.call(g,p)&&be(a,p,g[p]);if(me)for(var p of me(g))Ct.call(g,p)&&be(a,p,g[p]);return a},G=(a,g)=>St(a,$t(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:""},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,xe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,we=/\/\*[^]*?\*\/|\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},Se=(e,t,n,i,r)=>{let s=H(e),l=k[s]||(k[s]=(o=>{let c=0,u=11;for(;c<o.length;)u=101*u+o.charCodeAt(c++)>>>0;return"go"+u})(s));if(!k[l]){let o=s!==e?e:(c=>{let u,f=[{}];for(;u=xe.exec(c.replace(we,""));)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);k[l]=$(r?{["@keyframes "+l]:o}:o,n?"":"."+l)}return((o,c,u)=>{c.data.indexOf(o)==-1&&(c.data=u?o+c.data:c.data+o)})(k[l],t,i),l},$e=(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 Se(n.unshift?n.raw?$e(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 Ae=(e,t)=>e===t,Ce=Symbol("solid-proxy"),Q={equals:Ae};let ve=te;const O={},b=1,M=2,ke={owned:null,cleanups:null,context:null,owner:null};var m=null;let E=null,d=null,N=null,h=null,x=null,B=0;function Ee(e,t,n){const i=R(e,t,!0,b);T(i)}function j(e,t,n){const i=R(e,t,!1,b);T(i)}function Y(e,t,n){n=n?Object.assign({},Q,n):Q;const i=R(e,t,!0,0);return i.pending=O,i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,T(i),Oe.bind(i)}function Ne(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 F(e){let t,n=d;return d=null,t=e(),d=n,t}function je(e){const t=Symbol("context");return{id:t,Provider:De(t),defaultValue:e}}function Te(e){return re(m,e.id)||e.defaultValue}function Pe(e){const t=Y(e);return Y(()=>V(t()))}function Oe(){const e=E;if(this.sources&&(this.state||e)){const t=h;h=null,this.state===b||e?T(this):z(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):x.push(s),s.observers&&(i&&!s.tState||!i&&!s.state)&&ne(s),i||(s.state=b)}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,Le(e,e.value,i),d=n,m=t}function Le(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 R(e,t,n,i=b,r){const s={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:null,pure:n};return m===null||m!==ke&&(m.owned?m.owned.push(s):m.owned=[s]),s}function J(e){const t=E;if(e.state!==b)return e.state=0;if(e.suspense&&F(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<B);)(e.state||t)&&n.push(e);for(let i=n.length-1;i>=0;i--)if(e=n[i],e.state===b||t)T(e);else if(e.state===M||t){const r=h;h=null,z(e,n[0]),h=r}}function ee(e,t){if(h)return e();let n=!1;t||(h=[]),x?n=!0:x=[],B++;try{return e()}catch(i){se(i)}finally{Ie(n)}}function Ie(e){h&&(te(h),h=null),!e&&(x.length?Ne(()=>{ve(x),x=null}):x=null)}function te(e){for(let t=0;t<e.length;t++)J(e[t])}function z(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===b||n?r!==t&&J(r):(r.state===M||n)&&z(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):x.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 De(e){return function(n){let i;return Ee(()=>i=F(()=>(m.context={[e]:n.value},Pe(()=>n.children)))),i}}function L(){return!0}const le={get(e,t,n){return t===Ce?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 Me=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Be=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Me]),Fe=new Set(["innerHTML","textContent","innerText","children"]),Re={className:"class",htmlFor:"for"},ue={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},ze=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Ve={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function We(e,t,n){let i=n.length,r=t.length,s=i,l=0,o=0,c=t[r-1].nextSibling,u=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;)(!u||!u.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(!u){u=new Map;let y=o;for(;y<s;)u.set(n[y],y++)}const f=u.get(t[l]);if(f!=null)if(o<f&&f<s){let y=l,S=1,P;for(;++y<r&&y<s&&!((P=u.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 ae="_$DX_DELEGATE";function _e(e,t=window.document){const n=t[ae]||(t[ae]=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,Ze))}}function qe(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Ue(e,t,n,i){i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i)}function Xe(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 Ke(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 Ge(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 He(e,t,n,i){typeof t=="function"?j(r=>de(e,t(),r,n,i)):de(e,t,void 0,n,i)}function Qe(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 Ye(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 Ge(e,n,i);if(t==="classList")return Ke(e,n,i);if(n===i)return i;if(t==="ref")n(e);else if(t.slice(0,3)==="on:")e.addEventListener(t.slice(3),n);else if(t.slice(0,10)==="oncapture:")e.addEventListener(t.slice(10),n,!0);else if(t.slice(0,2)==="on"){const c=t.slice(2).toLowerCase(),u=ze.has(c);Xe(e,c,n,u),u&&_e([c])}else if((o=Fe.has(t))||!r&&(ue[t]||(l=Be.has(t)))||(s=e.nodeName.includes("-")))s&&!l&&!o?e[Ye(t)]=n:e[ue[t]||t]=n;else{const c=r&&t.indexOf(":")>-1&&Ve[t.split(":")[0]];c?Ue(e,c,t,n):qe(e,Re[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 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(()=>Qe(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):We(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 Je(e,...t){}function vt(e){}const et=!1,tt=je();function nt(e){let t=this||{};return(...n)=>{const i=r=>{const s=Te(tt),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,u]=ce(o,["as"]),f=c.as||e;let y;if(typeof f=="function")y=f(u);else if(et){const[S,P]=ce(u,["children"]);y=Je([`<${f} `,">",`</${f}>`],void 0,S.children||"")}else y=document.createElement(f),He(y,u);return y};return i.className=r=>F(()=>A.apply({target:t.target,p:r,g:t.g},n)),i}}const w=new Proxy(nt,{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 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"};function it(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:q,r=it(Object.entries(n).map(([c,u])=>[c,typeof u=="number"?`${u}px`:u]))[e];return ye(r)?r:void 0};function st(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const rt=w("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=>
|
|
8
|
+
--maxWidth: ${e=>w(e.maxWidth)};
|
|
9
9
|
|
|
10
10
|
box-sizing: content-box;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
&& {
|
|
13
|
+
margin-inline-start: auto;
|
|
14
|
+
margin-inline-end: auto;
|
|
15
|
+
margin-inline: auto;
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
max-inline-size: var(--maxWidth, 100%);
|
|
17
19
|
|
|
18
|
-
${e=>e.centerChildren?
|
|
20
|
+
${e=>e.centerChildren?i.css`
|
|
19
21
|
display: flex;
|
|
20
22
|
flex-direction: column;
|
|
21
23
|
align-items: center;
|
|
22
24
|
`:""}
|
|
23
25
|
|
|
24
|
-
${e=>e.centerText?
|
|
26
|
+
${e=>e.centerText?i.css`
|
|
25
27
|
text-align: center;
|
|
26
28
|
`:""}
|
|
27
|
-
`;function
|
|
29
|
+
`;function j(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const z=i.styled("div")`
|
|
28
30
|
@property --basis {
|
|
29
31
|
syntax: "<length-percentage>";
|
|
30
32
|
inherits: true;
|
|
@@ -37,8 +39,8 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
37
39
|
initial-value: 0px;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
--basis: ${e=>
|
|
41
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
42
|
+
--basis: ${e=>j(e.basis)};
|
|
43
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
|
|
42
44
|
|
|
43
45
|
box-sizing: border-box;
|
|
44
46
|
> * {
|
|
@@ -51,14 +53,14 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
51
53
|
display: flex;
|
|
52
54
|
flex-wrap: wrap;
|
|
53
55
|
gap: var(--gutter, 0px);
|
|
54
|
-
`;function
|
|
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`
|
|
55
57
|
box-sizing: border-box;
|
|
56
58
|
display: block;
|
|
57
59
|
inline-size: 100%;
|
|
58
60
|
position: relative;
|
|
59
61
|
overflow: hidden;
|
|
60
62
|
|
|
61
|
-
${e=>{const t=
|
|
63
|
+
${e=>{const t=R(e.ratio);return t?i.css`
|
|
62
64
|
aspect-ratio: ${t};
|
|
63
65
|
`:""}};
|
|
64
66
|
|
|
@@ -86,7 +88,7 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
86
88
|
object-fit: cover;
|
|
87
89
|
object-position: ${e=>typeof e.position=="string"?e.position:"50%"};
|
|
88
90
|
}
|
|
89
|
-
`,
|
|
91
|
+
`,M=i.styled("div")`
|
|
90
92
|
@property --gutter {
|
|
91
93
|
syntax: "<length-percentage>";
|
|
92
94
|
inherits: false;
|
|
@@ -99,7 +101,7 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
99
101
|
initial-value: 639px;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
104
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
|
|
103
105
|
--minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
|
|
104
106
|
|
|
105
107
|
box-sizing: border-box;
|
|
@@ -114,8 +116,8 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
114
116
|
auto-fit,
|
|
115
117
|
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
116
118
|
);
|
|
117
|
-
`,
|
|
118
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
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"}};
|
|
119
121
|
|
|
120
122
|
box-sizing: border-box;
|
|
121
123
|
> * {
|
|
@@ -126,20 +128,39 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
126
128
|
flex-wrap: wrap;
|
|
127
129
|
gap: var(--gutter, 0px);
|
|
128
130
|
|
|
129
|
-
justify-content: ${e=>typeof e.justify!="undefined"&&
|
|
131
|
+
justify-content: ${e=>typeof e.justify!="undefined"&&u[e.justify]?u[e.justify]:u.start};
|
|
130
132
|
|
|
131
|
-
align-items: ${e=>typeof e.align!="undefined"&&
|
|
132
|
-
|
|
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
|
+
@property --switchAt {
|
|
136
|
+
syntax: "<length-percentage>";
|
|
137
|
+
inherits: true;
|
|
138
|
+
initial-value: 0;
|
|
139
|
+
}
|
|
140
|
+
flex-wrap: nowrap;
|
|
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
|
+
|
|
143
|
+
${e=>T(e.switchAt)?`
|
|
144
|
+
--switchAt: ${typeof e.switchAt=="string"?e.switchAt:`${e.switchAt}px`};
|
|
145
|
+
flex-wrap: wrap;
|
|
146
|
+
> * {
|
|
147
|
+
min-inline-size: fit-content;
|
|
148
|
+
flex-basis: calc(
|
|
149
|
+
(var(--switchAt) - (100% - var(--gutter, 0px))) * 999
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
`:""}
|
|
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`
|
|
133
154
|
box-sizing: border-box;
|
|
134
|
-
${e=>
|
|
135
|
-
`,
|
|
155
|
+
${e=>D(e.theme,e.padding)}
|
|
156
|
+
`,V=i.styled.div`
|
|
136
157
|
box-sizing: border-box;
|
|
137
158
|
> * {
|
|
138
159
|
margin: 0;
|
|
139
160
|
scroll-snap-align: start;
|
|
140
161
|
}
|
|
141
162
|
|
|
142
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
163
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
|
|
143
164
|
|
|
144
165
|
display: flex;
|
|
145
166
|
gap: var(--gutter, 0px);
|
|
@@ -147,14 +168,14 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
147
168
|
overflow-x: scroll;
|
|
148
169
|
|
|
149
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"}}};
|
|
150
|
-
`,
|
|
171
|
+
`,B=i.styled("div")`
|
|
151
172
|
@property --gutter {
|
|
152
173
|
syntax: "<length-percentage>";
|
|
153
174
|
inherits: false;
|
|
154
175
|
initial-value: 0;
|
|
155
176
|
}
|
|
156
177
|
|
|
157
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
178
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=l(e.gutter,e.theme))!=null?t:"0px"}};
|
|
158
179
|
box-sizing: border-box;
|
|
159
180
|
> * {
|
|
160
181
|
margin: 0;
|
|
@@ -168,4 +189,4 @@ var wt=Object.defineProperty,St=Object.defineProperties;var $t=Object.getOwnProp
|
|
|
168
189
|
& > [data-bedrock-column] {
|
|
169
190
|
grid-column: span 1 / auto;
|
|
170
191
|
}
|
|
171
|
-
`;
|
|
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 {};
|
package/lib/inline.d.ts
ADDED
|
@@ -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 {};
|
package/lib/padbox.d.ts
ADDED
|
@@ -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.
|
|
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": "
|
|
62
|
+
"gitHead": "f383b93fdab7e65c717821aaec9fc4903cd61b80"
|
|
63
63
|
}
|