@bedrock-layout/solid 0.7.0 → 0.8.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/center.d.ts +11 -0
- package/lib/column-drop.d.ts +11 -0
- package/lib/cover.d.ts +15 -0
- package/lib/frame.d.ts +10 -0
- package/lib/grid.d.ts +10 -0
- package/lib/index.cjs.js +69 -35
- package/lib/index.d.ts +11 -131
- package/lib/index.m.js +86 -921
- package/lib/index.umd.js +69 -35
- 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 $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnPropertyDescriptors;var xe=Object.getOwnPropertySymbols;var vt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable;var be=(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)&&be(u,p,g[p]);if(xe)for(var p of xe(g))kt.call(g,p)&&be(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,A=(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"?A(l,s):s+"{"+A(l,s[1]=="k"?"":t)+"}":typeof l=="object"?i+=A(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+=A.p?A.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]=A(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?"":A(o,""):o===!1?"":o}return i+r+(l==null?"":l)},"");function b(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)}b.bind({g:1}),b.bind({k:1});const Ce=(e,t)=>e===t,ve=Symbol("solid-proxy"),Q={equals:Ce};let ke=te;const O={},w=1,M=2,Ee={owned:null,cleanups:null,context:null,owner:null};var m=null;let E=null,d=null,N=null,h=null,S=null,z=0;function Ne(e,t,n){const i=F(e,t,!0,w);T(i)}function j(e,t,n){const i=F(e,t,!1,w);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 B(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===w||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):S.push(s),s.observers&&(i&&!s.tState||!i&&!s.state)&&ne(s),i||(s.state=w)}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=z;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=w,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!==w)return e.state=0;if(e.suspense&&B(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<z);)(e.state||t)&&n.push(e);for(let i=n.length-1;i>=0;i--)if(e=n[i],e.state===w||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=[]),S?n=!0:S=[],z++;try{return e()}catch(i){se(i)}finally{De(n)}}function De(e){h&&(te(h),h=null),!e&&(S.length?je(()=>{ke(S),S=null}):S=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===w||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):S.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=B(()=>(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 ze=["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",...ze]),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,$=1,P;for(;++y<r&&y<s&&!((P=a.get(t[y]))==null||P!==f+$);)$++;if($>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=Be.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 $=l.className,P="className"in l&&/^go[0-9]+/.test($);let X=b.apply({target:t.target,o:P,p:l,g:t.g},n);return[$,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[$,P]=ce(a,["children"]);y=et([`<${f} `,">",`</${f}>`],void 0,$.children||"")}else y=document.createElement(f),Qe(y,a);return y};return i.className=r=>B(()=>b.apply({target:t.target,p:r,g:t.g},n)),i}}const x=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=x("div")`
|
|
1
|
+
var K=Object.defineProperty,N=Object.defineProperties;var U=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var S=(n,i,r)=>i in n?K(n,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[i]=r,y=(n,i)=>{for(var r in i||(i={}))w.call(i,r)&&S(n,r,i[r]);if(x)for(var r of x(i))A.call(i,r)&&S(n,r,i[r]);return n},p=(n,i)=>N(n,U(i));var j=(n,i)=>{var r={};for(var a in n)w.call(n,a)&&i.indexOf(a)<0&&(r[a]=n[a]);if(n!=null&&x)for(var a of x(n))i.indexOf(a)<0&&A.call(n,a)&&(r[a]=n[a]);return r};(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 a={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 z(e){return e.reduce((t,[l,d])=>p(y({},t),{[l]:d}),{})}const c=(e,t)=>{var s,g;const l=(g=(s=t==null?void 0:t.space)!=null?s:t==null?void 0:t.spacing)!=null?g:a,o=z(Object.entries(l).map(([h,b])=>[h,typeof b=="number"?`${b}px`:b]))[e];return r(o)?o:void 0};function I(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const R=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=>I(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 W(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const C=i.styled("div")`
|
|
28
30
|
@property --basis {
|
|
29
31
|
syntax: "<length-percentage>";
|
|
30
32
|
inherits: true;
|
|
@@ -37,8 +39,8 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=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=>W(e.basis)};
|
|
43
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=c(e.gutter,e.theme))!=null?t:"0px"}};
|
|
42
44
|
|
|
43
45
|
box-sizing: border-box;
|
|
44
46
|
> * {
|
|
@@ -51,14 +53,14 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
|
|
|
51
53
|
display: flex;
|
|
52
54
|
flex-wrap: wrap;
|
|
53
55
|
gap: var(--gutter, 0px);
|
|
54
|
-
`;function
|
|
56
|
+
`;function E(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 M(e){return Array.isArray(e)?e.join("/"):e}function O(e){return E(e)?M(e):void 0}const T=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=O(e.ratio);return t?i.css`
|
|
62
64
|
aspect-ratio: ${t};
|
|
63
65
|
`:""}};
|
|
64
66
|
|
|
@@ -86,7 +88,7 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
|
|
|
86
88
|
object-fit: cover;
|
|
87
89
|
object-position: ${e=>typeof e.position=="string"?e.position:"50%"};
|
|
88
90
|
}
|
|
89
|
-
`,
|
|
91
|
+
`,P=i.styled("div")`
|
|
90
92
|
@property --gutter {
|
|
91
93
|
syntax: "<length-percentage>";
|
|
92
94
|
inherits: false;
|
|
@@ -99,7 +101,7 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=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=c(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 $t=Object.defineProperty,At=Object.defineProperties;var Ct=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
|
+
`,f={start:"flex-start",end:"flex-end",center:"center"},m=p(y({},f),{stretch:"stretch"}),v=i.styled.div`
|
|
120
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=c(e.gutter,e.theme))!=null?t:"0px"}};
|
|
119
121
|
|
|
120
122
|
box-sizing: border-box;
|
|
121
123
|
> * {
|
|
@@ -126,10 +128,10 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=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"&&f[e.justify]?f[e.justify]:f.start};
|
|
130
132
|
|
|
131
|
-
align-items: ${e=>typeof e.align!="undefined"&&
|
|
132
|
-
`;function
|
|
133
|
+
align-items: ${e=>typeof e.align!="undefined"&&m[e.align]?m[e.align]:m.start};
|
|
134
|
+
`;function D(e){return typeof e=="number"&&e>-1?!0:typeof e=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${e}`):!1}const L=i.styled(v)`
|
|
133
135
|
@property --switchAt {
|
|
134
136
|
syntax: "<length-percentage>";
|
|
135
137
|
inherits: true;
|
|
@@ -138,7 +140,7 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
|
|
|
138
140
|
flex-wrap: nowrap;
|
|
139
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 }`:""}
|
|
140
142
|
|
|
141
|
-
${e=>
|
|
143
|
+
${e=>D(e.switchAt)?`
|
|
142
144
|
--switchAt: ${typeof e.switchAt=="string"?e.switchAt:`${e.switchAt}px`};
|
|
143
145
|
flex-wrap: wrap;
|
|
144
146
|
> * {
|
|
@@ -148,25 +150,17 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
|
|
|
148
150
|
);
|
|
149
151
|
}
|
|
150
152
|
`:""}
|
|
151
|
-
|
|
152
|
-
&[style*="--switchAt"] {
|
|
153
|
-
flex-wrap: wrap;
|
|
154
|
-
> * {
|
|
155
|
-
min-inline-size: fit-content;
|
|
156
|
-
flex-basis: calc((var(--switchAt) - (100% - var(--gutter, 0px))) * 999);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
`,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 xt(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 bt=x.div`
|
|
153
|
+
`,$=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),V=(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 B(e){return t=>{const l=c(t,e);return l!=null?l:"0px"}}function k(e,t){var u;if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const l=new Set(Object.keys((u=e==null?void 0:e.spacing)!=null?u:a));(()=>typeof t=="string"?!0:Array.isArray(t)?t.every(s=>l.has(s)):t&&Object.keys(t).every(s=>$.has(s))&&Object.values(t).every(s=>l.has(s)))()||console.error("Invalid padding Type");const o=B(e);return typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((s,[g,h])=>$.has(g)?s+V(g,o(h)):s,""):t!==void 0?`padding: ${Array.from(Array.isArray(t)?t:[t]).map(s=>o(s)).join(" ")};`:""}const F=i.styled.div`
|
|
160
154
|
box-sizing: border-box;
|
|
161
|
-
${e=>
|
|
162
|
-
`,
|
|
155
|
+
${e=>(console.log(k(e.theme,e.padding)),k(e.theme,e.padding))}
|
|
156
|
+
`,X=i.styled.div`
|
|
163
157
|
box-sizing: border-box;
|
|
164
158
|
> * {
|
|
165
159
|
margin: 0;
|
|
166
160
|
scroll-snap-align: start;
|
|
167
161
|
}
|
|
168
162
|
|
|
169
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
163
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=c(e.gutter,e.theme))!=null?t:"0px"}};
|
|
170
164
|
|
|
171
165
|
display: flex;
|
|
172
166
|
gap: var(--gutter, 0px);
|
|
@@ -174,14 +168,14 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
|
|
|
174
168
|
overflow-x: scroll;
|
|
175
169
|
|
|
176
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"}}};
|
|
177
|
-
`,
|
|
171
|
+
`,G=i.styled("div")`
|
|
178
172
|
@property --gutter {
|
|
179
173
|
syntax: "<length-percentage>";
|
|
180
174
|
inherits: false;
|
|
181
175
|
initial-value: 0;
|
|
182
176
|
}
|
|
183
177
|
|
|
184
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=
|
|
178
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=c(e.gutter,e.theme))!=null?t:"0px"}};
|
|
185
179
|
box-sizing: border-box;
|
|
186
180
|
> * {
|
|
187
181
|
margin: 0;
|
|
@@ -195,4 +189,44 @@ var $t=Object.defineProperty,At=Object.defineProperties;var Ct=Object.getOwnProp
|
|
|
195
189
|
& > [data-bedrock-column] {
|
|
196
190
|
grid-column: span 1 / auto;
|
|
197
191
|
}
|
|
198
|
-
`;
|
|
192
|
+
`;function _(e){return typeof e=="number"?`${e}px`:e&&r(e)?e:"100vh"}const q=i.styled.div`
|
|
193
|
+
@property --gutter {
|
|
194
|
+
syntax: "<length-percentage>";
|
|
195
|
+
inherits: false;
|
|
196
|
+
initial-value: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@property --minHeight {
|
|
200
|
+
syntax: "<length-percentage>";
|
|
201
|
+
inherits: false;
|
|
202
|
+
initial-value: 100vh;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
--gutter: ${e=>{var t;return e.gutter&&(t=c(e.gutter,e.theme))!=null?t:"0px"}};
|
|
206
|
+
|
|
207
|
+
--minHeight: ${e=>_(e.minHeight)};
|
|
208
|
+
|
|
209
|
+
> * {
|
|
210
|
+
margin: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: var(--gutter, 0px);
|
|
216
|
+
|
|
217
|
+
min-block-size: var(--minHeight, 100vh);
|
|
218
|
+
|
|
219
|
+
> [data-bedrock-cover-centered] {
|
|
220
|
+
margin-block-start: auto;
|
|
221
|
+
margin-block-end: auto;
|
|
222
|
+
|
|
223
|
+
${({stretchContent:e})=>e===!0?`
|
|
224
|
+
flex: 1;
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
> * {
|
|
228
|
+
flex: 1;
|
|
229
|
+
}
|
|
230
|
+
`:""};
|
|
231
|
+
}
|
|
232
|
+
`,H=e=>{const u=e,{top:t,bottom:l,children:d}=u,o=j(u,["top","bottom","children"]);return React.createElement(q,y({},o),e.top,React.createElement("div",{"data-bedrock-cover-centered":!0},e.children),e.bottom)};n.Center=R,n.ColumnDrop=C,n.Cover=H,n.Frame=T,n.Grid=P,n.Inline=L,n.InlineCluster=v,n.PadBox=F,n.Reel=X,n.Stack=G,n.checkIsCSSLength=r,n.getSpacingValue=c,n.spacing=a,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.8.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": "6a87cc2d65eb589c4b6b2583e437f7d107033e51"
|
|
63
63
|
}
|