@bedrock-layout/solid 1.7.3 → 1.7.4

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 +1 @@
1
- (function(u,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("open-props"),require("solid-js"),require("@bedrock-layout/register-resize-callback")):typeof define=="function"&&define.amd?define(["exports","open-props","solid-js","@bedrock-layout/register-resize-callback"],A):(u=typeof globalThis<"u"?globalThis:u||self,A(u.solid={},u.OpenProps,u.solidJs,u.registerResizeCallback))})(this,function(u,A,f,T){"use strict";const ee=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],te=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ee]),ne=new Set(["innerHTML","textContent","innerText","children"]),ie=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),re=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ce(e,t){const n=re[e];return typeof n=="object"?n[t]?n.$:void 0:n}const se=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),oe=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ae={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function fe(e,t,n){let i=n.length,r=t.length,c=i,o=0,s=0,a=t[r-1].nextSibling,l=null;for(;o<r||s<c;){if(t[o]===n[s]){o++,s++;continue}for(;t[r-1]===n[c-1];)r--,c--;if(r===o){const d=c<i?s?n[s-1].nextSibling:n[c-s]:a;for(;s<c;)e.insertBefore(n[s++],d)}else if(c===s)for(;o<r;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[c-1]&&n[s]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--c],d),t[r]=n[c]}else{if(!l){l=new Map;let y=s;for(;y<c;)l.set(n[y],y++)}const d=l.get(t[o]);if(d!=null)if(s<d&&d<c){let y=o,g=1,S;for(;++y<r&&y<c&&!((S=l.get(t[y]))==null||S!==d+g);)g++;if(g>d-s){const k=t[o];for(;s<d;)e.insertBefore(n[s++],k)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const R="_$DX_DELEGATE";function v(e,t,n){let i;const r=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},c=t?()=>f.untrack(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return c.cloneNode=c,c}function le(e,t=window.document){const n=t[R]||(t[R]=new Set);for(let i=0,r=e.length;i<r;i++){const c=e[i];n.has(c)||(n.add(c),t.addEventListener(c,Se))}}function O(e,t,n){j(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ue(e,t,n,i){j(e)||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function de(e,t,n){j(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ge(e,t){j(e)||(t==null?e.removeAttribute("class"):e.className=t)}function ye(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=c=>r.call(e,n[1],c))}else e.addEventListener(t,n,typeof n!="function"&&n)}function me(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let c,o;for(c=0,o=r.length;c<o;c++){const s=r[c];!s||s==="undefined"||t[s]||(_(e,s,!1),delete n[s])}for(c=0,o=i.length;c<o;c++){const s=i[c],a=!!t[s];!s||s==="undefined"||n[s]===a||!a||(_(e,s,!0),n[s]=a)}return n}function D(e,t,n){if(!t)return n?O(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,c;for(c in n)t[c]==null&&i.removeProperty(c),delete n[c];for(c in t)r=t[c],r!==n[c]&&(i.setProperty(c,r),n[c]=r);return n}function he(e,t={},n,i){const r={};return f.createRenderEffect(()=>r.children=x(e,t.children,r.children)),f.createRenderEffect(()=>typeof t.ref=="function"&&G(t.ref,e)),f.createRenderEffect(()=>be(e,t,n,!0,r,!0)),r}function G(e,t,n){return f.untrack(()=>e(t,n))}function H(e,t,n,i){if(typeof t!="function")return x(e,t,i,n);f.createRenderEffect(r=>x(e,t(),r,n),i)}function be(e,t,n,i,r={},c=!1){t||(t={});for(const o in r)if(!(o in t)){if(o==="children")continue;r[o]=V(e,o,null,r[o],n,c,t)}for(const o in t){if(o==="children")continue;const s=t[o];r[o]=V(e,o,s,r[o],n,c,t)}}function $e(e){let t,n;return!j()||!(t=f.sharedConfig.registry.get(n=je()))?e():(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function j(e){return!!f.sharedConfig.context&&!f.sharedConfig.done&&(!e||e.isConnected)}function Ce(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,c=i.length;r<c;r++)e.classList.toggle(i[r],n)}function V(e,t,n,i,r,c,o){let s,a,l,d,y;if(t==="style")return D(e,n,i);if(t==="classList")return me(e,n,i);if(n===i)return i;if(t==="ref")c||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);i&&e.removeEventListener(g,i,typeof i!="function"&&i),n&&e.addEventListener(g,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);i&&e.removeEventListener(g,i,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),S=se.has(g);if(!S&&i){const k=Array.isArray(i)?i[0]:i;e.removeEventListener(g,k)}(S||n)&&(ye(e,g,n,S),S&&le([g]))}else if(t.slice(0,5)==="attr:")O(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")de(e,t.slice(5),n);else if((y=t.slice(0,5)==="prop:")||(l=ne.has(t))||!r&&((d=ce(t,e.tagName))||(a=te.has(t)))||(s=e.nodeName.includes("-")||"is"in o)){if(y)t=t.slice(5),a=!0;else if(j(e))return n;t==="class"||t==="className"?ge(e,n):s&&!a&&!l?e[Ce(t)]=n:e[d||t]=n}else{const g=r&&t.indexOf(":")>-1&&ae[t.split(":")[0]];g?ue(e,g,t,n):O(e,ie[t]||t,n)}return n}function Se(e){if(f.sharedConfig.registry&&f.sharedConfig.events&&f.sharedConfig.events.find(([a,l])=>l===e))return;let t=e.target;const n=`$$${e.type}`,i=e.target,r=e.currentTarget,c=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),o=()=>{const a=t[n];if(a&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?a.call(t,l,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&c(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();c(a[0]);for(let l=0;l<a.length-2&&(t=a[l],!!o());l++){if(t._$host){t=t._$host,s();break}if(t.parentNode===r)break}}else s();c(i)}function x(e,t,n,i,r){const c=j(e);if(c){!n&&(n=[...e.childNodes]);let s=[];for(let a=0;a<n.length;a++){const l=n[a];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():s.push(l)}n=s}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t;if(e=e,o==="string"||o==="number"){if(c||o==="number"&&(t=t.toString(),t===n))return n;n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(c)return n;n=I(e,n,i)}else{if(o==="function")return f.createRenderEffect(()=>{let s=t();for(;typeof s=="function";)s=s();n=x(e,s,n,i)}),()=>n;if(Array.isArray(t)){const s=[],a=n&&Array.isArray(n);if(z(s,t,n,r))return f.createRenderEffect(()=>n=x(e,s,n,i,!0)),()=>n;if(c)return s.length?n=[...e.childNodes]:n;s.length===0?n=I(e,n,i):a?n.length===0?F(e,s,i):fe(e,n,s):(n&&I(e),F(e,s)),n=s}else if(t.nodeType){if(c&&t.parentNode)return n=t;Array.isArray(n)?I(e,n,null,t):n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild),n=t}}return n}function z(e,t,n,i){let r=!1;for(let c=0,o=t.length;c<o;c++){let s=t[c],a=n&&n[e.length],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))r=z(e,s,a)||r;else if(l==="function")if(i){for(;typeof s=="function";)s=s();r=z(e,Array.isArray(s)?s:[s],Array.isArray(a)?a:[a])||r}else e.push(s),r=!0;else{const d=String(s);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return r}function F(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function I(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let c=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(r!==s){const a=s.parentNode===e;!c&&!o?a?e.replaceChild(r,s):e.insertBefore(r,n):a&&s.remove()}else c=!0}}else e.insertBefore(r,n);return[r]}function je(){return f.sharedConfig.getNextContextId()}const we="http://www.w3.org/2000/svg";function Ae(e,t=!1){return t?document.createElementNS(we,e):document.createElement(e)}function xe(e){const[t,n]=f.splitProps(e,["component"]),i=f.createMemo(()=>t.component);return f.createMemo(()=>{const r=i();switch(typeof r){case"function":return f.untrack(()=>r(n));case"string":const c=oe.has(r),o=f.sharedConfig.context?$e():Ae(r,c);return he(o,n,c),o}})}function w(e){return e??void 0}function m(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function h(e,t){return f.createComponent(xe,f.mergeProps({get component(){return e()}},t))}function b(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const X=/^--\D{1}.{0,100}$/;function U(e){return X.test(e)}function M(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}.{0,100}\)$/,X].some(t=>t.test(e))}const{sizeXxs:Pe,sizeXs:Ee,sizeSm:ke,sizeMd:Te,sizeLg:Ie,sizeXl:Me,sizeXxl:Oe,sizeContent1:ze,sizeContent2:Ne,sizeContent3:Le,sizeHeader1:We,sizeHeader2:Be,sizeHeader3:Re,size000:ve,size00:De,size1:Ge,size2:He,size3:_e,size4:Ve,size5:Fe,size6:Xe,size7:Ue,size8:qe,size9:Qe,size10:Ye,size11:Ze,size12:Ke,size13:pe,size14:Je,size15:et}=A,tt={size000:ve,size00:De,size1:Ge,size2:He,size3:_e,size4:Ve,size5:Fe,size6:Xe,size7:Ue,size8:qe,size9:Qe,size10:Ye,size11:Ze,size12:Ke,size13:pe,size14:Je,size15:et},nt={sizeXxs:Pe,sizeXs:Ee,sizeSm:ke,sizeMd:Te,sizeLg:Ie,sizeXl:Me,sizeXxl:Oe,sizeContent1:ze,sizeContent2:Ne,sizeContent3:Le,sizeHeader1:We,sizeHeader2:Be,sizeHeader3:Re},q=tt,Q=nt;function Y(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function N(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&M(t)?U(t)?`var(${t})`:t:w($(e,t))}function $(e,t){const n=e.space??q,i=Y(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return w(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&M(t))return U(t)?`var(${t})`:t;const n=e.sizes??Q,i=Y(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return w(i[t])}function it(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function rt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),n=()=>`--maxWidth: ${it(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",c=()=>[i(),r()].filter(Boolean).join(" "),o=()=>[t(),n()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","maxWidth","centerText","centerChildren"]),b({style:o,"data-bedrock-center":c})))}const Z=f.createContext({});function ct(e){return f.createComponent(Z.Provider,{get value(){return e.theme},get children(){return e.children}})}function C(){try{return f.useContext(Z)}catch{return{}}}function st(e,t){return P(e,t)}function ot(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${st(t,e.minItemWidth)}`,c=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",o=()=>[n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","minItemWidth","noStretchedColumns"]),b({style:o,"data-bedrock-column-drop":c})))}function at(e,t){const[n,i]=f.createSignal(!1),[r,c]=f.createSignal();return f.onMount(()=>{T.init()}),f.createEffect(()=>{if(w(r())===void 0)return;t&&t(r());const o=T.registerCallback(r(),s=>{var l;const a=((l=s.borderBoxSize)==null?void 0:l.inlineSize)??s.contentRect.width;if(a>0){const d=a<=e;i(d)}});f.onCleanup(o)}),[n,c]}function ft(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 lt(e){return Array.isArray(e)?e.join("/"):e}function ut(e){return ft(e)?lt(e):void 0}function dt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),n=()=>ut(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",c=()=>[t(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","ratio","position"]),b({style:c,"data-bedrock-frame":()=>""})))}function K(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,c=()=>[n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","minItemWidth"]),b({style:c,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const E=96;function p(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function L(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return gt(i,n);case"em":return W(n,"font-size");case"rem":return W(document.body,"font-size");case"in":return E;case"cm":return E/2.54;case"mm":return E/25.4;case"pt":return E/72;case"pc":return E/6;case"px":return 1;default:{const[r,c]=p(i);if(isNaN(r))return;if(!c)return r;const o=L(c,t);return typeof o=="number"?r*o:void 0}}}function W(e,t){const[n,i]=p(getComputedStyle(e).getPropertyValue(t));return n*(L(i,e)??1)}function gt(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=W(n,"height")/128;return t.removeChild(n),i}var yt=v("<div>");const B=1,mt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,ht=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),c=C();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{const o=w(i());if(o===void 0)return;const s=T.registerCallback(o,({target:a})=>{n(1);const l=e.gutter?$(c,e.gutter)??"1px":"1px",d=mt?L(l,a):void 0,y=Math.max(d??B,B),[g]=Array.from(a.children),S=1+Math.min(a.scrollHeight,g.scrollHeight),k=Math.max(Math.ceil(S/y),B);return n(k),0});return f.onCleanup(s),0}),(()=>{var o=yt();return G(r,o),H(o,()=>e.children),f.createRenderEffect(s=>D(o,`grid-row: span ${t()};`,s)),o})()},bt=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(ht,{get gutter(){return e.gutter},children:r}));return f.createComponent(K,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},$t={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},Ct={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.justify!==void 0?$t[e.justify]:void 0,c=()=>e.align!==void 0?Ct[e.align]:void 0,o=()=>[n(),i()].join("; "),s=()=>[r(),c()].filter(Boolean).join(" ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","justify","align"]),b({style:o,"data-bedrock-inline-cluster":s})))}const jt={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},wt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function At(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((y,[g,S])=>y+`${g}:${S};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",o=()=>e.justify!==void 0?jt[e.justify]:void 0,s=()=>e.align!==void 0?wt[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),c(),r()].join("; "),d=()=>[o(),s(),a()].filter(Boolean).join(" ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","justify","align","stretch","switchAt"]),b({style:l,"data-bedrock-inline":d})))}const xt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],Pt=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[r,c])=>({...i,[xt(r)]:N(e,c)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>N(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,c])=>i+`${r}:${c};`,"")};function Et(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,s])=>c+`${o}:${s};`,""),i=()=>Pt(t,e.padding),r=()=>[n(),i()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","padding"]),b({style:r,"data-bedrock-padbox":()=>""})))}function kt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},c=()=>[n(),i()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter"]),b({style:c,"data-bedrock-reel":r})))}const J={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Tt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",r=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,c=()=>J[e.fraction??"1/2"]??J["1/2"],o=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,s=()=>[n(),r(),i(),o()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","fraction"]),b({style:s,"data-bedrock-split":c})))}const It={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Mt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>[n(),i()].join("; "),c=()=>e.align!==void 0?It[e.align]:void 0,o=()=>[c()].filter(Boolean).join(" ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter"]),b({style:r,"data-bedrock-stack":o})))}var Ot=v("<div data-bedrock-cover-centered>");function zt(e){return typeof e=="number"?`${e}px`:e&&M(e)?e:"100vh"}function Nt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minHeight: ${zt(e.minHeight)};`,c=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",o=()=>[n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","minHeight","stretchContent"]),b({style:o,"data-bedrock-cover":c})))}function Lt(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(Nt,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{var i=Ot();return H(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function Wt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--columns: ${w(Math.max(e.colCount??e.columns??1,1))??1};`,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",o=()=>[n(),i(),r(),c()].filter(Boolean).join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","columns","colCount","switchAt"]),b({style:o,"data-bedrock-columns":()=>""})))}const Bt=e=>typeof e=="number"?e:1;function Rt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),n=()=>`--span: ${Bt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",c=()=>[t(),n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","span","offsetStart","offsetEnd"]),b({style:c,"data-bedrock-column":()=>""})))}u.Center=rt,u.Column=Rt,u.ColumnDrop=ot,u.Columns=Wt,u.Cover=Lt,u.Frame=dt,u.Grid=K,u.Inline=At,u.InlineCluster=St,u.MasonryGrid=bt,u.PadBox=Et,u.Reel=kt,u.Split=Tt,u.Stack=Mt,u.ThemeProvider=ct,u.checkIsCSSLength=M,u.createContainerQuery=at,u.getSafeGutter=N,u.getSizeValue=P,u.getSpacingValue=$,u.sizes=Q,u.spacing=q,u.useTheme=C,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
1
+ (function(u,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("open-props"),require("solid-js"),require("@bedrock-layout/register-resize-callback")):typeof define=="function"&&define.amd?define(["exports","open-props","solid-js","@bedrock-layout/register-resize-callback"],A):(u=typeof globalThis<"u"?globalThis:u||self,A(u.solid={},u.OpenProps,u.solidJs,u.registerResizeCallback))})(this,function(u,A,f,M){"use strict";const ee=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],te=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ee]),ne=new Set(["innerHTML","textContent","innerText","children"]),ie=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),re=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function ce(e,t){const n=re[e];return typeof n=="object"?n[t]?n.$:void 0:n}const se=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),oe=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ae={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function fe(e,t,n){let i=n.length,r=t.length,c=i,o=0,s=0,a=t[r-1].nextSibling,l=null;for(;o<r||s<c;){if(t[o]===n[s]){o++,s++;continue}for(;t[r-1]===n[c-1];)r--,c--;if(r===o){const d=c<i?s?n[s-1].nextSibling:n[c-s]:a;for(;s<c;)e.insertBefore(n[s++],d)}else if(c===s)for(;o<r;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[c-1]&&n[s]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--c],d),t[r]=n[c]}else{if(!l){l=new Map;let y=s;for(;y<c;)l.set(n[y],y++)}const d=l.get(t[o]);if(d!=null)if(s<d&&d<c){let y=o,g=1,S;for(;++y<r&&y<c&&!((S=l.get(t[y]))==null||S!==d+g);)g++;if(g>d-s){const T=t[o];for(;s<d;)e.insertBefore(n[s++],T)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const B="_$DX_DELEGATE";function R(e,t,n,i){let r;const c=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},o=t?()=>f.untrack(()=>document.importNode(r||(r=c()),!0)):()=>(r||(r=c())).cloneNode(!0);return o.cloneNode=o,o}function le(e,t=window.document){const n=t[B]||(t[B]=new Set);for(let i=0,r=e.length;i<r;i++){const c=e[i];n.has(c)||(n.add(c),t.addEventListener(c,Se))}}function O(e,t,n){j(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ue(e,t,n,i){j(e)||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function de(e,t,n){j(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ge(e,t){j(e)||(t==null?e.removeAttribute("class"):e.className=t)}function ye(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=c=>r.call(e,n[1],c))}else e.addEventListener(t,n,typeof n!="function"&&n)}function me(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let c,o;for(c=0,o=r.length;c<o;c++){const s=r[c];!s||s==="undefined"||t[s]||(_(e,s,!1),delete n[s])}for(c=0,o=i.length;c<o;c++){const s=i[c],a=!!t[s];!s||s==="undefined"||n[s]===a||!a||(_(e,s,!0),n[s]=a)}return n}function D(e,t,n){if(!t)return n?O(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,c;for(c in n)t[c]==null&&i.removeProperty(c),delete n[c];for(c in t)r=t[c],r!==n[c]&&(i.setProperty(c,r),n[c]=r);return n}function he(e,t={},n,i){const r={};return f.createRenderEffect(()=>r.children=x(e,t.children,r.children)),f.createRenderEffect(()=>typeof t.ref=="function"&&G(t.ref,e)),f.createRenderEffect(()=>be(e,t,n,!0,r,!0)),r}function G(e,t,n){return f.untrack(()=>e(t,n))}function H(e,t,n,i){if(typeof t!="function")return x(e,t,i,n);f.createRenderEffect(r=>x(e,t(),r,n),i)}function be(e,t,n,i,r={},c=!1){t||(t={});for(const o in r)if(!(o in t)){if(o==="children")continue;r[o]=V(e,o,null,r[o],n,c,t)}for(const o in t){if(o==="children")continue;const s=t[o];r[o]=V(e,o,s,r[o],n,c,t)}}function $e(e){let t,n;return!j()||!(t=f.sharedConfig.registry.get(n=je()))?e():(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function j(e){return!!f.sharedConfig.context&&!f.sharedConfig.done&&(!e||e.isConnected)}function Ce(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,c=i.length;r<c;r++)e.classList.toggle(i[r],n)}function V(e,t,n,i,r,c,o){let s,a,l,d,y;if(t==="style")return D(e,n,i);if(t==="classList")return me(e,n,i);if(n===i)return i;if(t==="ref")c||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);i&&e.removeEventListener(g,i,typeof i!="function"&&i),n&&e.addEventListener(g,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);i&&e.removeEventListener(g,i,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),S=se.has(g);if(!S&&i){const T=Array.isArray(i)?i[0]:i;e.removeEventListener(g,T)}(S||n)&&(ye(e,g,n,S),S&&le([g]))}else if(t.slice(0,5)==="attr:")O(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")de(e,t.slice(5),n);else if((y=t.slice(0,5)==="prop:")||(l=ne.has(t))||!r&&((d=ce(t,e.tagName))||(a=te.has(t)))||(s=e.nodeName.includes("-")||"is"in o)){if(y)t=t.slice(5),a=!0;else if(j(e))return n;t==="class"||t==="className"?ge(e,n):s&&!a&&!l?e[Ce(t)]=n:e[d||t]=n}else{const g=r&&t.indexOf(":")>-1&&ae[t.split(":")[0]];g?ue(e,g,t,n):O(e,ie[t]||t,n)}return n}function Se(e){if(f.sharedConfig.registry&&f.sharedConfig.events&&f.sharedConfig.events.find(([a,l])=>l===e))return;let t=e.target;const n=`$$${e.type}`,i=e.target,r=e.currentTarget,c=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),o=()=>{const a=t[n];if(a&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?a.call(t,l,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&c(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();c(a[0]);for(let l=0;l<a.length-2&&(t=a[l],!!o());l++){if(t._$host){t=t._$host,s();break}if(t.parentNode===r)break}}else s();c(i)}function x(e,t,n,i,r){const c=j(e);if(c){!n&&(n=[...e.childNodes]);let s=[];for(let a=0;a<n.length;a++){const l=n[a];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():s.push(l)}n=s}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t;if(e=e,o==="string"||o==="number"){if(c||o==="number"&&(t=t.toString(),t===n))return n;n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(c)return n;n=I(e,n,i)}else{if(o==="function")return f.createRenderEffect(()=>{let s=t();for(;typeof s=="function";)s=s();n=x(e,s,n,i)}),()=>n;if(Array.isArray(t)){const s=[],a=n&&Array.isArray(n);if(z(s,t,n,r))return f.createRenderEffect(()=>n=x(e,s,n,i,!0)),()=>n;if(c)return s.length?n=[...e.childNodes]:n;s.length===0?n=I(e,n,i):a?n.length===0?F(e,s,i):fe(e,n,s):(n&&I(e),F(e,s)),n=s}else if(t.nodeType){if(c&&t.parentNode)return n=t;Array.isArray(n)?I(e,n,null,t):n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild),n=t}}return n}function z(e,t,n,i){let r=!1;for(let c=0,o=t.length;c<o;c++){let s=t[c],a=n&&n[e.length],l;if(!(s==null||s===!0||s===!1))if((l=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))r=z(e,s,a)||r;else if(l==="function")if(i){for(;typeof s=="function";)s=s();r=z(e,Array.isArray(s)?s:[s],Array.isArray(a)?a:[a])||r}else e.push(s),r=!0;else{const d=String(s);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return r}function F(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function I(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let c=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(r!==s){const a=s.parentNode===e;!c&&!o?a?e.replaceChild(r,s):e.insertBefore(r,n):a&&s.remove()}else c=!0}}else e.insertBefore(r,n);return[r]}function je(){return f.sharedConfig.getNextContextId()}const we="http://www.w3.org/2000/svg";function Ae(e,t=!1){return t?document.createElementNS(we,e):document.createElement(e)}function xe(e,t){const n=f.createMemo(e);return f.createMemo(()=>{const i=n();switch(typeof i){case"function":return f.untrack(()=>i(t));case"string":const r=oe.has(i),c=f.sharedConfig.context?$e():Ae(i,r);return he(c,t,r),c}})}function Pe(e){const[,t]=f.splitProps(e,["component"]);return xe(()=>e.component,t)}function w(e){return e??void 0}function m(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function h(e,t){return f.createComponent(Pe,f.mergeProps({get component(){return e()}},t))}function b(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}const X=/^--\D{1}.{0,100}$/;function U(e){return X.test(e)}function v(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}.{0,100}\)$/,X].some(t=>t.test(e))}const{sizeXxs:Ee,sizeXs:Te,sizeSm:Me,sizeMd:Ie,sizeLg:ve,sizeXl:Oe,sizeXxl:ze,sizeContent1:ke,sizeContent2:Ne,sizeContent3:Le,sizeHeader1:We,sizeHeader2:Be,sizeHeader3:Re,size000:De,size00:Ge,size1:He,size2:_e,size3:Ve,size4:Fe,size5:Xe,size6:Ue,size7:qe,size8:Qe,size9:Ye,size10:Ze,size11:Ke,size12:pe,size13:Je,size14:et,size15:tt}=A,nt={size000:De,size00:Ge,size1:He,size2:_e,size3:Ve,size4:Fe,size5:Xe,size6:Ue,size7:qe,size8:Qe,size9:Ye,size10:Ze,size11:Ke,size12:pe,size13:Je,size14:et,size15:tt},it={sizeXxs:Ee,sizeXs:Te,sizeSm:Me,sizeMd:Ie,sizeLg:ve,sizeXl:Oe,sizeXxl:ze,sizeContent1:ke,sizeContent2:Ne,sizeContent3:Le,sizeHeader1:We,sizeHeader2:Be,sizeHeader3:Re},q=nt,Q=it;function Y(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function k(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&v(t)?U(t)?`var(${t})`:t:w($(e,t))}function $(e,t){const n=e.space??q,i=Y(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return w(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&v(t))return U(t)?`var(${t})`:t;const n=e.sizes??Q,i=Y(Object.entries(n).map(([r,c])=>[r,typeof c=="number"?`${c}px`:c]));return w(i[t])}function rt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function ct(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),n=()=>`--maxWidth: ${rt(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",c=()=>[i(),r()].filter(Boolean).join(" "),o=()=>[t(),n()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","maxWidth","centerText","centerChildren"]),b({style:o,"data-br-center":c})))}const Z=f.createContext({});function st(e){return f.createComponent(Z.Provider,{get value(){return e.theme},get children(){return e.children}})}function C(){try{return f.useContext(Z)}catch{return{}}}function ot(e,t){return P(e,t)}function at(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${ot(t,e.minItemWidth)}`,c=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",o=()=>[n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","minItemWidth","noStretchedColumns"]),b({style:o,"data-br-column-drop":c})))}function ft(e,t){const[n,i]=f.createSignal(!1),[r,c]=f.createSignal();return f.onMount(()=>{M.init()}),f.createEffect(()=>{if(w(r())===void 0)return;t&&t(r());const o=M.registerCallback(r(),s=>{var l;const a=((l=s.borderBoxSize)==null?void 0:l.inlineSize)??s.contentRect.width;if(a>0){const d=a<=e;i(d)}});f.onCleanup(o)}),[n,c]}function lt(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 dt(e){return lt(e)?ut(e):void 0}function gt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),n=()=>dt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",c=()=>[t(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","ratio","position"]),b({style:c,"data-br-frame":()=>""})))}function K(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,c=()=>[n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","minItemWidth"]),b({style:c,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const E=96;function p(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function N(e,t){if(!e)return;const n=t??document.body,i=(e??"px").trim().toLowerCase();switch(i){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return yt(i,n);case"em":return L(n,"font-size");case"rem":return L(document.body,"font-size");case"in":return E;case"cm":return E/2.54;case"mm":return E/25.4;case"pt":return E/72;case"pc":return E/6;case"px":return 1;default:{const[r,c]=p(i);if(isNaN(r))return;if(!c)return r;const o=N(c,t);return typeof o=="number"?r*o:void 0}}}function L(e,t){const[n,i]=p(getComputedStyle(e).getPropertyValue(t));return n*(N(i,e)??1)}function yt(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=L(n,"height")/128;return t.removeChild(n),i}var mt=R("<div>");const W=1,ht=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,bt=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),c=C();return f.onMount(()=>(M.init(),0)),f.createEffect(()=>{const o=w(i());if(o===void 0)return;const s=M.registerCallback(o,({target:a})=>{n(1);const l=e.gutter?$(c,e.gutter)??"1px":"1px",d=ht?N(l,a):void 0,y=Math.max(d??W,W),[g]=Array.from(a.children),S=1+Math.min(a.scrollHeight,g.scrollHeight),T=Math.max(Math.ceil(S/y),W);return n(T),0});return f.onCleanup(s),0}),(()=>{var o=mt();return G(r,o),H(o,()=>e.children),f.createRenderEffect(s=>D(o,`grid-row: span ${t()};`,s)),o})()},$t=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(bt,{get gutter(){return e.gutter},children:r}));return f.createComponent(K,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},St={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.justify!==void 0?Ct[e.justify]:void 0,c=()=>e.align!==void 0?St[e.align]:void 0,o=()=>[n(),i()].join("; "),s=()=>[r(),c()].filter(Boolean).join(" ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","justify","align"]),b({style:o,"data-br-inline-cluster":s})))}const wt={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},At={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function xt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((y,[g,S])=>y+`${g}:${S};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",o=()=>e.justify!==void 0?wt[e.justify]:void 0,s=()=>e.align!==void 0?At[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),c(),r()].join("; "),d=()=>[o(),s(),a()].filter(Boolean).join(" ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","justify","align","stretch","switchAt"]),b({style:l,"data-br-inline":d})))}const Pt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],Et=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[r,c])=>({...i,[Pt(r)]:k(e,c)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>k(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,c])=>i+`${r}:${c};`,"")};function Tt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,s])=>c+`${o}:${s};`,""),i=()=>Et(t,e.padding),r=()=>[n(),i()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","padding"]),b({style:r,"data-br-padbox":()=>""})))}function Mt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},c=()=>[n(),i()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter"]),b({style:c,"data-br-reel":r})))}const J={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function It(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",r=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,c=()=>J[e.fraction??"1/2"]??J["1/2"],o=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,s=()=>[n(),r(),i(),o()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","fraction"]),b({style:s,"data-br-split":c})))}const vt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Ot(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>[n(),i()].join("; "),c=()=>e.align!==void 0?vt[e.align]:void 0,o=()=>[c()].filter(Boolean).join(" ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter"]),b({style:r,"data-br-stack":o})))}var zt=R("<div data-br-cover-centered>");function kt(e){return typeof e=="number"?`${e}px`:e&&v(e)?e:"100vh"}function Nt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minHeight: ${kt(e.minHeight)};`,c=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",o=()=>[n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","minHeight","stretchContent"]),b({style:o,"data-br-cover":c})))}function Lt(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(Nt,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{var i=zt();return H(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function Wt(e){const t=C(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[a,l])=>s+`${a}:${l};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--columns: ${w(Math.max(e.colCount??e.columns??1,1))??1};`,c=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",o=()=>[n(),i(),r(),c()].filter(Boolean).join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","gutter","columns","colCount","switchAt"]),b({style:o,"data-br-columns":()=>""})))}const Bt=e=>typeof e=="number"?e:1;function Rt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,a])=>o+`${s}:${a};`,""),n=()=>`--span: ${Bt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",c=()=>[t(),n(),i(),r()].join("; ");return h(()=>e.as??"div",f.mergeProps(m(e,["as","span","offsetStart","offsetEnd"]),b({style:c,"data-br-column":()=>""})))}u.Center=ct,u.Column=Rt,u.ColumnDrop=at,u.Columns=Wt,u.Cover=Lt,u.Frame=gt,u.Grid=K,u.Inline=xt,u.InlineCluster=jt,u.MasonryGrid=$t,u.PadBox=Tt,u.Reel=Mt,u.Split=It,u.Stack=Ot,u.ThemeProvider=st,u.checkIsCSSLength=v,u.createContainerQuery=ft,u.getSafeGutter=k,u.getSizeValue=P,u.getSpacingValue=$,u.sizes=Q,u.spacing=q,u.useTheme=C,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock-layout/solid",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Solid Foundational Layout Primitives for your Solid-js App",
5
5
  "info": "Solid Bedrock Layout is a Solid.js port of the Bedrock Layout primitives written for react. Bedrock primitives are built to allow you to compose them together to create your own custom layouts. Many 'complex' layouts can be created by composing Bedrock Layout Primitives",
6
6
  "sideEffects": false,
@@ -71,6 +71,6 @@
71
71
  "bugs": {
72
72
  "url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
73
73
  },
74
- "gitHead": "a0d7a64a1b89370559c68eb51777011753b8b200",
74
+ "gitHead": "563dbbb847f2f76432f7e25930a336193258db4c",
75
75
  "nx": {}
76
76
  }