@bedrock-layout/solid 1.7.5 → 2.0.1

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,j){typeof exports=="object"&&typeof module<"u"?j(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"],j):(u=typeof globalThis<"u"?globalThis:u||self,j(u.solid={},u.OpenProps,u.solidJs,u.registerResizeCallback))})(this,(function(u,j,l,T){"use strict";const te=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],ne=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...te]),ie=new Set(["innerHTML","textContent","innerText","children"]),re=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),se=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function oe(e,t){const n=se[e];return typeof n=="object"?n[t]?n.$:void 0:n}const ce=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ae=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"]),le={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},D=e=>l.createMemo(()=>e());function fe(e,t,n){let i=n.length,r=t.length,s=i,c=0,o=0,a=t[r-1].nextSibling,f=null;for(;c<r||o<s;){if(t[c]===n[o]){c++,o++;continue}for(;t[r-1]===n[s-1];)r--,s--;if(r===c){const d=s<i?o?n[o-1].nextSibling:n[s-o]:a;for(;o<s;)e.insertBefore(n[o++],d)}else if(s===o)for(;c<r;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[s-1]&&n[o]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[o++],t[c++].nextSibling),e.insertBefore(n[--s],d),t[r]=n[s]}else{if(!f){f=new Map;let h=o;for(;h<s;)f.set(n[h],h++)}const d=f.get(t[c]);if(d!=null)if(o<d&&d<s){let h=c,g=1,C;for(;++h<r&&h<s&&!((C=f.get(t[h]))==null||C!==d+g);)g++;if(g>d-o){const x=t[c];for(;o<d;)e.insertBefore(n[o++],x)}else e.replaceChild(n[o++],t[c++])}else c++;else t[c++].remove()}}}const W="_$DX_DELEGATE";function B(e,t,n,i){let r;const s=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},c=t?()=>l.untrack(()=>document.importNode(r||(r=s()),!0)):()=>(r||(r=s())).cloneNode(!0);return c.cloneNode=c,c}function ue(e,t=window.document){const n=t[W]||(t[W]=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,Se))}}function v(e,t,n){S(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function de(e,t,n,i){S(e)||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function ge(e,t,n){S(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function he(e,t){S(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]=s=>r.call(e,n[1],s))}else e.addEventListener(t,n,typeof n!="function"&&n)}function me(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let s,c;for(s=0,c=r.length;s<c;s++){const o=r[s];!o||o==="undefined"||t[o]||(H(e,o,!1),delete n[o])}for(s=0,c=i.length;s<c;s++){const o=i[s],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(H(e,o,!0),n[o]=a)}return n}function G(e,t,n){if(!t)return n?v(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,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 be(e,t={},n,i){const r={};return l.createRenderEffect(()=>r.children=P(e,t.children,r.children)),l.createRenderEffect(()=>typeof t.ref=="function"&&F(t.ref,e)),l.createRenderEffect(()=>$e(e,t,n,!0,r,!0)),r}function F(e,t,n){return l.untrack(()=>e(t,n))}function V(e,t,n,i){if(typeof t!="function")return P(e,t,i,n);l.createRenderEffect(r=>P(e,t(),r,n),i)}function $e(e,t,n,i,r={},s=!1){t||(t={});for(const c in r)if(!(c in t)){if(c==="children")continue;r[c]=_(e,c,null,r[c],n,s,t)}for(const c in t){if(c==="children")continue;const o=t[c];r[c]=_(e,c,o,r[c],n,s,t)}}function we(e){let t,n;return!S()||!(t=l.sharedConfig.registry.get(n=Ae()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function S(e){return!!l.sharedConfig.context&&!l.sharedConfig.done&&(!e||e.isConnected)}function Ce(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function H(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 _(e,t,n,i,r,s,c){let o,a,f,d,h;if(t==="style")return G(e,n,i);if(t==="classList")return me(e,n,i);if(n===i)return i;if(t==="ref")s||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(),C=ce.has(g);if(!C&&i){const x=Array.isArray(i)?i[0]:i;e.removeEventListener(g,x)}(C||n)&&(ye(e,g,n,C),C&&ue([g]))}else if(t.slice(0,5)==="attr:")v(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")ge(e,t.slice(5),n);else if((h=t.slice(0,5)==="prop:")||(f=ie.has(t))||!r&&((d=oe(t,e.tagName))||(a=ne.has(t)))||(o=e.nodeName.includes("-")||"is"in c)){if(h)t=t.slice(5),a=!0;else if(S(e))return n;t==="class"||t==="className"?he(e,n):o&&!a&&!f?e[Ce(t)]=n:e[d||t]=n}else{const g=r&&t.indexOf(":")>-1&&le[t.split(":")[0]];g?de(e,g,t,n):v(e,re[t]||t,n)}return n}function Se(e){if(l.sharedConfig.registry&&l.sharedConfig.events&&l.sharedConfig.events.find(([a,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,i=e.target,r=e.currentTarget,s=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),c=()=>{const a=t[n];if(a&&!t.disabled){const f=t[`${n}Data`];if(f!==void 0?a.call(t,f,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},o=()=>{for(;c()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();s(a[0]);for(let f=0;f<a.length-2&&(t=a[f],!!c());f++){if(t._$host){t=t._$host,o();break}if(t.parentNode===r)break}}else o();s(i)}function P(e,t,n,i,r){const s=S(e);if(s){!n&&(n=[...e.childNodes]);let o=[];for(let a=0;a<n.length;a++){const f=n[a];f.nodeType===8&&f.data.slice(0,2)==="!$"?f.remove():o.push(f)}n=o}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t;if(e=e,c==="string"||c==="number"){if(s||c==="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||c==="boolean"){if(s)return n;n=M(e,n,i)}else{if(c==="function")return l.createRenderEffect(()=>{let o=t();for(;typeof o=="function";)o=o();n=P(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[],a=n&&Array.isArray(n);if(k(o,t,n,r))return l.createRenderEffect(()=>n=P(e,o,n,i,!0)),()=>n;if(s)return o.length?n=[...e.childNodes]:n;o.length===0?n=M(e,n,i):a?n.length===0?U(e,o,i):fe(e,n,o):(n&&M(e),U(e,o)),n=o}else if(t.nodeType){if(s&&t.parentNode)return n=t;Array.isArray(n)?M(e,n,null,t):n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild),n=t}}return n}function k(e,t,n,i){let r=!1;for(let s=0,c=t.length;s<c;s++){let o=t[s],a=n&&n[e.length],f;if(!(o==null||o===!0||o===!1))if((f=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))r=k(e,o,a)||r;else if(f==="function")if(i){for(;typeof o=="function";)o=o();r=k(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||r}else e.push(o),r=!0;else{const d=String(o);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return r}function U(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function M(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let s=!1;for(let c=t.length-1;c>=0;c--){const o=t[c];if(r!==o){const a=o.parentNode===e;!s&&!c?a?e.replaceChild(r,o):e.insertBefore(r,n):a&&o.remove()}else s=!0}}else e.insertBefore(r,n);return[r]}function Ae(){return l.sharedConfig.getNextContextId()}const je="http://www.w3.org/2000/svg";function Pe(e,t=!1,n=void 0){return t?document.createElementNS(je,e):document.createElement(e,{is:n})}function Ee(e,t){const n=l.createMemo(e);return l.createMemo(()=>{const i=n();switch(typeof i){case"function":return l.untrack(()=>i(t));case"string":const r=ae.has(i),s=l.sharedConfig.context?we():Pe(i,r,l.untrack(()=>t.is));return be(s,t,r),s}})}function Ie(e){const[,t]=l.splitProps(e,["component"]);return Ee(()=>e.component,t)}function A(e){return e??void 0}function y(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 m(e,t){return l.createComponent(Ie,l.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 q(e){return X.test(e)}function O(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:xe,sizeXs:Te,sizeSm:Me,sizeMd:Oe,sizeLg:ve,sizeXl:ke,sizeXxl:ze,sizeContent1:Ne,sizeContent2:Re,sizeContent3:Le,sizeHeader1:De,sizeHeader2:We,sizeHeader3:Be,size000:Ge,size00:Fe,size1:Ve,size2:He,size3:_e,size4:Ue,size5:Xe,size6:qe,size7:Qe,size8:Ye,size9:Ze,size10:Ke,size11:pe,size12:Je,size13:et,size14:tt,size15:nt}=j,it={size000:Ge,size00:Fe,size1:Ve,size2:He,size3:_e,size4:Ue,size5:Xe,size6:qe,size7:Qe,size8:Ye,size9:Ze,size10:Ke,size11:pe,size12:Je,size13:et,size14:tt,size15:nt},rt={sizeXxs:xe,sizeXs:Te,sizeSm:Me,sizeMd:Oe,sizeLg:ve,sizeXl:ke,sizeXxl:ze,sizeContent1:Ne,sizeContent2:Re,sizeContent3:Le,sizeHeader1:De,sizeHeader2:We,sizeHeader3:Be},Q=it,Y=rt;function Z(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function z(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&O(t)?q(t)?`var(${t})`:t:A($(e,t))}function $(e,t){const n=e.space??Q,i=Z(Object.entries(n).map(([r,s])=>[r,typeof s=="number"?`${s}px`:s]));return A(i[t])}function E(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&O(t))return q(t)?`var(${t})`:t;const n=e.sizes??Y,i=Z(Object.entries(n).map(([r,s])=>[r,typeof s=="number"?`${s}px`:s]));return A(i[t])}function st(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function ot(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),n=()=>`--maxWidth: ${st(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",s=()=>[i(),r()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),b({style:c,"data-br-center":s})))}const K=l.createContext({});function ct(e){return l.createComponent(K.Provider,{get value(){return e.theme},get children(){return e.children}})}function w(){try{return l.useContext(K)}catch{return{}}}function at(e,t){return E(e,t)}function lt(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${at(t,e.minItemWidth)}`,s=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),b({style:c,"data-br-column-drop":s})))}function ft(e,t){const[n,i]=l.createSignal(!1),[r,s]=l.createSignal();return l.onMount(()=>{T.init()}),l.createEffect(()=>{if(A(r())===void 0)return;t&&t(r());const c=T.registerCallback(r(),o=>{var f;const a=((f=o.borderBoxSize)==null?void 0:f.inlineSize)??o.contentRect.width;if(a>0){const d=a<=e;i(d)}});l.onCleanup(c)}),[n,s]}function ut(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 dt(e){return Array.isArray(e)?e.join("/"):e}function gt(e){return ut(e)?dt(e):void 0}function ht(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>gt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",s=()=>[t(),i(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","ratio","position"]),b({style:s,"data-br-frame":()=>""})))}function p(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","minItemWidth"]),b({style:s,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const I=96;function J(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 R(n,"font-size");case"rem":return R(document.body,"font-size");case"in":return I;case"cm":return I/2.54;case"mm":return I/25.4;case"pt":return I/72;case"pc":return I/6;case"px":return 1;default:{const[r,s]=J(i);if(isNaN(r))return;if(!s)return r;const c=N(s,t);return typeof c=="number"?r*c:void 0}}}function R(e,t){const[n,i]=J(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=R(n,"height")/128;return t.removeChild(n),i}var mt=B("<div>");const L=1,bt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,$t=e=>{const[t,n]=l.createSignal(1),[i,r]=l.createSignal(),s=w();return l.onMount(()=>(T.init(),0)),l.createEffect(()=>{const c=A(i());if(c===void 0)return;const o=T.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?$(s,e.gutter)??"1px":"1px",d=bt?N(f,a):void 0,h=Math.max(d??L,L),[g]=Array.from(a.children),C=1+Math.min(a.scrollHeight,g.scrollHeight),x=Math.max(Math.ceil(C/h),L);return n(x),0});return l.onCleanup(o),0}),(()=>{var c=mt();return F(r,c),V(c,()=>e.children),l.createRenderEffect(o=>G(c,`grid-row: span ${t()};`,o)),c})()},wt=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>l.createComponent($t,{get gutter(){return e.gutter},children:r}));return l.createComponent(p,l.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 At(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.justify!==void 0?Ct[e.justify]:void 0,s=()=>e.align!==void 0?St[e.align]:void 0,c=()=>[n(),i()].join("; "),o=()=>[r(),s()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","justify","align"]),b({style:c,"data-br-inline-cluster":o})))}const jt={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},Pt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Et(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((h,[g,C])=>h+`${g}:${C};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,s=()=>e.switchAt?`--switchAt: ${E(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?jt[e.justify]:void 0,o=()=>e.align!==void 0?Pt[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),s(),r()].join("; "),d=()=>[c(),o(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),b({style:f,"data-br-inline":d})))}const It=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],xt=(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,s])=>({...i,[It(r)]:z(e,s)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>z(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,s])=>i+`${r}:${s};`,"")};function Tt(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,o])=>s+`${c}:${o};`,""),i=()=>xt(t,e.padding),r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","padding"]),b({style:r,"data-br-padbox":()=>""})))}function Mt(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${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"}},s=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter"]),b({style:s,"data-br-reel":r})))}const ee={"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 Ot(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${E(t,e.switchAt)??"0px"};`:"",r=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>ee[e.fraction??"1/2"]??ee["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),r(),i(),c()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","fraction"]),b({style:o,"data-br-split":s})))}const vt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function kt(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>[n(),i()].join("; "),s=()=>e.align!==void 0?vt[e.align]:void 0,c=()=>[s()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter"]),b({style:r,"data-br-stack":c})))}var zt=B("<div data-br-cover-centered>");function Nt(e){return typeof e=="number"?`${e}px`:e&&O(e)?e:"100vh"}function Rt(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--minHeight: ${Nt(e.minHeight)};`,s=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","minHeight","stretchContent"]),b({style:c,"data-br-cover":s})))}function Lt(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(Rt,l.mergeProps(n,{get children(){return[D(()=>t.top),(()=>{var i=zt();return V(i,()=>t.children),i})(),D(()=>t.bottom)]}}))}function Dt(e){const t=w(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${$(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>`--columns: ${A(Math.max(e.colCount??e.columns??1,1))??1};`,s=()=>e.switchAt?`--switchAt: ${E(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),r(),s()].filter(Boolean).join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","gutter","columns","colCount","switchAt"]),b({style:c,"data-br-columns":()=>""})))}const Wt=e=>typeof e=="number"?e:1;function Bt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>`--span: ${Wt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",s=()=>[t(),n(),i(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),b({style:s,"data-br-column":()=>""})))}u.Center=ot,u.Column=Bt,u.ColumnDrop=lt,u.Columns=Dt,u.Cover=Lt,u.Frame=ht,u.Grid=p,u.Inline=Et,u.InlineCluster=At,u.MasonryGrid=wt,u.PadBox=Tt,u.Reel=Mt,u.Split=Ot,u.Stack=kt,u.ThemeProvider=ct,u.checkIsCSSLength=O,u.createContainerQuery=ft,u.getSafeGutter=z,u.getSizeValue=E,u.getSpacingValue=$,u.sizes=Y,u.spacing=Q,u.useTheme=w,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(u,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@bedrock-layout/spacing-constants"),require("solid-js")):typeof define=="function"&&define.amd?define(["exports","@bedrock-layout/spacing-constants","solid-js"],d):(u=typeof globalThis<"u"?globalThis:u||self,d(u.solid={},u.spacingConstants,u.solidJs))})(this,(function(u,d,l){"use strict";const R=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],L=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...R]),D=new Set(["innerHTML","textContent","innerText","children"]),W=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),z=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function F(e,t){const n=z[e];return typeof n=="object"?n[t]?n.$:void 0:n}const B=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),G=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"]),v={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function H(e,t,n){let s=n.length,o=t.length,r=s,c=0,i=0,a=t[o-1].nextSibling,f=null;for(;c<o||i<r;){if(t[c]===n[i]){c++,i++;continue}for(;t[o-1]===n[r-1];)o--,r--;if(o===c){const y=r<s?i?n[i-1].nextSibling:n[r-i]:a;for(;i<r;)e.insertBefore(n[i++],y)}else if(r===i)for(;c<o;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[r-1]&&n[i]===t[o-1]){const y=t[--o].nextSibling;e.insertBefore(n[i++],t[c++].nextSibling),e.insertBefore(n[--r],y),t[o]=n[r]}else{if(!f){f=new Map;let h=i;for(;h<r;)f.set(n[h],h++)}const y=f.get(t[c]);if(y!=null)if(i<y&&y<r){let h=c,g=1,w;for(;++h<o&&h<r&&!((w=f.get(t[h]))==null||w!==y+g);)g++;if(g>y-i){const E=t[c];for(;i<y;)e.insertBefore(n[i++],E)}else e.replaceChild(n[i++],t[c++])}else c++;else t[c++].remove()}}}const I="_$DX_DELEGATE";function U(e,t=window.document){const n=t[I]||(t[I]=new Set);for(let s=0,o=e.length;s<o;s++){const r=e[s];n.has(r)||(n.add(r),t.addEventListener(r,ne))}}function j(e,t,n){S(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function _(e,t,n,s){S(e)||(s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s))}function q(e,t,n){S(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function K(e,t){S(e)||(t==null?e.removeAttribute("class"):e.className=t)}function X(e,t,n,s){if(s)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=r=>o.call(e,n[1],r))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Y(e,t,n={}){const s=Object.keys(t||{}),o=Object.keys(n);let r,c;for(r=0,c=o.length;r<c;r++){const i=o[r];!i||i==="undefined"||t[i]||(T(e,i,!1),delete n[i])}for(r=0,c=s.length;r<c;r++){const i=s[r],a=!!t[i];!i||i==="undefined"||n[i]===a||!a||(T(e,i,!0),n[i]=a)}return n}function Q(e,t,n){if(!t)return n?j(e,"style"):t;const s=e.style;if(typeof t=="string")return s.cssText=t;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),t||(t={});let o,r;for(r in n)t[r]==null&&s.removeProperty(r),delete n[r];for(r in t)o=t[r],o!==n[r]&&(s.setProperty(r,o),n[r]=o);return n}function Z(e,t={},n,s){const o={};return l.createRenderEffect(()=>o.children=C(e,t.children,o.children)),l.createRenderEffect(()=>typeof t.ref=="function"&&J(t.ref,e)),l.createRenderEffect(()=>p(e,t,n,!0,o,!0)),o}function J(e,t,n){return l.untrack(()=>e(t,n))}function p(e,t,n,s,o={},r=!1){t||(t={});for(const c in o)if(!(c in t)){if(c==="children")continue;o[c]=O(e,c,null,o[c],n,r,t)}for(const c in t){if(c==="children")continue;const i=t[c];o[c]=O(e,c,i,o[c],n,r,t)}}function ee(e){let t,n;return!S()||!(t=l.sharedConfig.registry.get(n=ie()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function S(e){return!!l.sharedConfig.context&&!l.sharedConfig.done&&(!e||e.isConnected)}function te(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function T(e,t,n){const s=t.trim().split(/\s+/);for(let o=0,r=s.length;o<r;o++)e.classList.toggle(s[o],n)}function O(e,t,n,s,o,r,c){let i,a,f,y,h;if(t==="style")return Q(e,n,s);if(t==="classList")return Y(e,n,s);if(n===s)return s;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const g=t.slice(3);s&&e.removeEventListener(g,s,typeof s!="function"&&s),n&&e.addEventListener(g,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const g=t.slice(10);s&&e.removeEventListener(g,s,!0),n&&e.addEventListener(g,n,!0)}else if(t.slice(0,2)==="on"){const g=t.slice(2).toLowerCase(),w=B.has(g);if(!w&&s){const E=Array.isArray(s)?s[0]:s;e.removeEventListener(g,E)}(w||n)&&(X(e,g,n,w),w&&U([g]))}else if(t.slice(0,5)==="attr:")j(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")q(e,t.slice(5),n);else if((h=t.slice(0,5)==="prop:")||(f=D.has(t))||!o&&((y=F(t,e.tagName))||(a=L.has(t)))||(i=e.nodeName.includes("-")||"is"in c)){if(h)t=t.slice(5),a=!0;else if(S(e))return n;t==="class"||t==="className"?K(e,n):i&&!a&&!f?e[te(t)]=n:e[y||t]=n}else{const g=o&&t.indexOf(":")>-1&&v[t.split(":")[0]];g?_(e,g,t,n):j(e,W[t]||t,n)}return n}function ne(e){if(l.sharedConfig.registry&&l.sharedConfig.events&&l.sharedConfig.events.find(([a,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,s=e.target,o=e.currentTarget,r=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),c=()=>{const a=t[n];if(a&&!t.disabled){const f=t[`${n}Data`];if(f!==void 0?a.call(t,f,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&r(t.host),!0},i=()=>{for(;c()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();r(a[0]);for(let f=0;f<a.length-2&&(t=a[f],!!c());f++){if(t._$host){t=t._$host,i();break}if(t.parentNode===o)break}}else i();r(s)}function C(e,t,n,s,o){const r=S(e);if(r){!n&&(n=[...e.childNodes]);let i=[];for(let a=0;a<n.length;a++){const f=n[a];f.nodeType===8&&f.data.slice(0,2)==="!$"?f.remove():i.push(f)}n=i}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t;if(e=e,c==="string"||c==="number"){if(r||c==="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||c==="boolean"){if(r)return n;n=A(e,n,s)}else{if(c==="function")return l.createRenderEffect(()=>{let i=t();for(;typeof i=="function";)i=i();n=C(e,i,n,s)}),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(P(i,t,n,o))return l.createRenderEffect(()=>n=C(e,i,n,s,!0)),()=>n;if(r)return i.length?n=[...e.childNodes]:n;i.length===0?n=A(e,n,s):a?n.length===0?M(e,i,s):H(e,n,i):(n&&A(e),M(e,i)),n=i}else if(t.nodeType){if(r&&t.parentNode)return n=t;Array.isArray(n)?A(e,n,null,t):n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild),n=t}}return n}function P(e,t,n,s){let o=!1;for(let r=0,c=t.length;r<c;r++){let i=t[r],a=n&&n[e.length],f;if(!(i==null||i===!0||i===!1))if((f=typeof i)=="object"&&i.nodeType)e.push(i);else if(Array.isArray(i))o=P(e,i,a)||o;else if(f==="function")if(s){for(;typeof i=="function";)i=i();o=P(e,Array.isArray(i)?i:[i],Array.isArray(a)?a:[a])||o}else e.push(i),o=!0;else{const y=String(i);a&&a.nodeType===3&&a.data===y?e.push(a):e.push(document.createTextNode(y))}}return o}function M(e,t,n=null){for(let s=0,o=t.length;s<o;s++)e.insertBefore(t[s],n)}function A(e,t,n,s){if(n===void 0)return e.textContent="";const o=s||document.createTextNode("");if(t.length){let r=!1;for(let c=t.length-1;c>=0;c--){const i=t[c];if(o!==i){const a=i.parentNode===e;!r&&!c?a?e.replaceChild(o,i):e.insertBefore(o,n):a&&i.remove()}else r=!0}}else e.insertBefore(o,n);return[o]}function ie(){return l.sharedConfig.getNextContextId()}const se="http://www.w3.org/2000/svg";function re(e,t=!1,n=void 0){return t?document.createElementNS(se,e):document.createElement(e,{is:n})}function oe(e,t){const n=l.createMemo(e);return l.createMemo(()=>{const s=n();switch(typeof s){case"function":return l.untrack(()=>s(t));case"string":const o=G.has(s),r=l.sharedConfig.context?ee():re(s,o,l.untrack(()=>t.is));return Z(r,t,o),r}})}function ce(e){const[,t]=l.splitProps(e,["component"]);return oe(()=>e.component,t)}function ae(e){return e??void 0}function m(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,s)=>Object.defineProperty({...n},s,{get(){return e[s]},configurable:!0,enumerable:!0}),{})}function b(e,t){return l.createComponent(ce,l.mergeProps({get component(){return e()}},t))}function $(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const s=e[n];return Object.defineProperty(t,n,{get(){return s()},configurable:!0,enumerable:!0})},{}):new Error("Please provide an object with accessor values only.")}function le(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:d.getSizeValue(e)??e}function fe(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,i])=>r+`${c}:${i};`,""),n=()=>`--max-width: ${le(e.maxWidth)};`,s=()=>"",o=()=>[t(),n()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","maxWidth"]),$({style:o,"data-br-center":s})))}function ue(e){return d.getSizeValue(e)}function de(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[i,a])=>c+`${i}:${a};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>`--min-item-width: ${ue(e.minItemWidth)}`,o=()=>e.variant==="centered"?"variant:centered":"",r=()=>[t(),n(),s()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","minItemWidth","variant"]),$({style:r,"data-br-column-drop":o})))}function ge(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} ?\/ ?\d{1,1000}$/.test(e)}function ye(e){return Array.isArray(e)?e.join("/"):e}function he(e){return ge(e)?ye(e):void 0}function me(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[i,a])=>c+`${i}:${a};`,""),n=()=>he(e.ratio),s=()=>n()?`--ratio: ${n()}`:"",o=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",r=()=>[t(),s(),o()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","ratio","position"]),$({style:r,"data-br-frame":()=>""})))}function be(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,i])=>r+`${c}:${i};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>`--min-item-width: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,o=()=>[t(),n(),s()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","minItemWidth"]),$({style:o,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const $e={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},x={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function we(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((i,[a,f])=>i+`${a}:${f};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>e.justify?$e[e.justify]:void 0,o=()=>e.align?x[e.align]:x.center,r=()=>[t(),n()].join("; "),c=()=>[s(),o()].filter(Boolean).join(" ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","justify","align","gap"]),$({style:r,"data-br-inline-cluster":c})))}const Se={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},k={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Ae(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((h,[g,w])=>h+`${g}:${w};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,s=h=>typeof h=="string"?d.getSizeValue(h)??h:`${h}px`,o=()=>e.minItemWidth?`--min-item-width: ${s(e.minItemWidth)};`:void 0,r=()=>e.switchAt?`--switch-at: ${d.getSizeValue(e.switchAt)??"0px"};`:"",c=()=>e.justify?Se[e.justify]:void 0,i=()=>e.align===void 0?k.center:k[e.align],a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[t(),n(),r(),o()].join("; "),y=()=>[c(),i(),a()].filter(Boolean).join(" ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","justify","align","stretch","switchAt"]),$({style:f,"data-br-inline":y})))}function je(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,i])=>r+`${c}:${i};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??e.gutter??"size00")??"0px"}`,s=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},o=()=>[t(),n()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","gutter"]),$({style:o,"data-br-reel":s})))}const N={"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 Ce(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((i,[a,f])=>i+`${a}:${f};`,""),n=()=>e.switchAt?`--switch-at: ${d.getSizeValue(e.switchAt)??"0px"};`:"",s=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,o=()=>N[e.fraction??"1/2"]??N["1/2"],r=()=>e.minItemWidth?`--min-item-width: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>[t(),s(),n(),r()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","fraction"]),$({style:c,"data-br-split":o})))}const Pe={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Ee(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[i,a])=>c+`${i}:${a};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>[t(),n()].join("; "),o=()=>e.align?Pe[e.align]:void 0,r=()=>[o()].filter(Boolean).join(" ");return b(()=>e.as??"div",l.mergeProps(m(e,["as"]),$({style:s,"data-br-stack":r})))}function Ie(e){return typeof e=="number"?`${e}px`:d.getSizeValue(e)??"100%"}function Te(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[i,a])=>c+`${i}:${a};`,""),n=()=>`--gap: ${d.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>`--min-height: ${Ie(e.minHeight)};`,o=()=>e.variant==="stretch-content"?"stretch-content":"",r=()=>[t(),n(),s()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","minHeight"]),$({style:r,"data-br-cover":o})))}function Oe(e){return b(()=>e.as??"div",l.mergeProps(m(e,["as"]),{"data-br-cover-centered":""}))}function Me(e){return l.createComponent(Te,l.mergeProps(e,{get children(){return e.children}}))}const V=e=>typeof e=="string"?e:Object.entries(e??{}).reduce((t,[n,s])=>t+`${n}:${s};`,"");function xe(e){const t=()=>V(e.style),n=()=>{const c=d.getSafeGutter(e.gap);return c?`--gap: ${c};`:""},s=()=>`--col-count: ${ae(Math.max(e.colCount??1,1))??1};`,o=()=>e.switchAt?`--switch-at: ${d.getSizeValue(e.switchAt)??"0px"};`:"",r=()=>[t(),n(),s(),o()].filter(Boolean).join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","colCount","switchAt"]),$({style:r,"data-br-columns":()=>""})))}const ke=e=>typeof e=="number"?e:1;function Ne(e){const t=()=>V(e.style),n=()=>`--col-span: ${ke(e.span)};`,s=()=>e.offsetStart&&e.offsetStart>0?`--offset-start: ${e.offsetStart};`:"",o=()=>e.offsetEnd&&e.offsetEnd>0?`--offset-end: ${e.offsetEnd};`:"",r=()=>[t(),n(),s(),o()].join("; ");return b(()=>e.as??"div",l.mergeProps(m(e,["as","span","offsetStart","offsetEnd"]),$({style:r,"data-br-column":()=>""})))}u.Center=fe,u.Column=Ne,u.ColumnDrop=de,u.Columns=xe,u.Cover=Me,u.CoverCentered=Oe,u.Frame=me,u.Grid=be,u.Inline=Ae,u.InlineCluster=we,u.Reel=je,u.Split=Ce,u.Stack=Ee,Object.keys(d).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(u,e)&&Object.defineProperty(u,e,{enumerable:!0,get:()=>d[e]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
@@ -1,5 +1,5 @@
1
1
  import { JSX } from "solid-js";
2
- import { SpacingOptions } from "./spacing-constants";
2
+ import { SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  declare const justifyMap: {
5
5
  readonly start: "justify:start";
@@ -17,10 +17,6 @@ declare const alignMap: {
17
17
  export interface InlineClusterBaseProps {
18
18
  justify?: keyof typeof justifyMap;
19
19
  align?: keyof typeof alignMap;
20
- /**
21
- * @deprecated Use `gap` instead
22
- */
23
- gutter?: SpacingOptions;
24
20
  gap?: SpacingOptions;
25
21
  }
26
22
  export type InlineClusterProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, InlineClusterBaseProps>;
package/lib/inline.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSX } from "solid-js";
2
- import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
2
+ import { CSSLength, SizesOptions, SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  type Stretch = "all" | "start" | "end" | 0 | 1 | 2 | 3 | 4;
5
5
  type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
@@ -21,10 +21,6 @@ export interface InlineBaseProps {
21
21
  switchAt?: number | CSSLength | SizesOptions;
22
22
  justify?: keyof typeof justifyMap;
23
23
  align?: keyof typeof alignMap;
24
- /**
25
- * @deprecated Use `gap` instead
26
- */
27
- gutter?: SpacingOptions;
28
24
  gap?: SpacingOptions;
29
25
  minItemWidth?: MinItemWidth;
30
26
  }
package/lib/reel.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSX } from "solid-js";
2
- import { SpacingOptions } from "./spacing-constants";
2
+ import { SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  export interface ReelBaseProps {
5
5
  snapType?: "none" | "proximity" | "mandatory";
package/lib/split.d.ts CHANGED
@@ -1,13 +1,9 @@
1
1
  import { JSX } from "solid-js";
2
- import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
2
+ import { CSSLength, SizesOptions, SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  type FractionTypes = "auto-start" | "auto-end" | "1/4" | "1/3" | "1/2" | "2/3" | "3/4";
5
5
  type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
6
6
  interface SplitBase {
7
- /**
8
- * @deprecated Use `gap` instead
9
- */
10
- gutter?: SpacingOptions;
11
7
  gap?: SpacingOptions;
12
8
  minItemWidth?: MinItemWidth;
13
9
  fraction?: FractionTypes;
package/lib/stack.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSX } from "solid-js";
2
- import { SpacingOptions } from "./spacing-constants";
2
+ import { SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  declare const alignMap: {
5
5
  readonly start: "align:start";
@@ -8,10 +8,6 @@ declare const alignMap: {
8
8
  readonly stretch: "align:stretch";
9
9
  };
10
10
  export interface StackPropsBase {
11
- /**
12
- * @deprecated Use `gap` instead
13
- */
14
- gutter?: SpacingOptions;
15
11
  gap?: SpacingOptions;
16
12
  align?: keyof typeof alignMap;
17
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock-layout/solid",
3
- "version": "1.7.5",
3
+ "version": "2.0.1",
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,
@@ -56,7 +56,7 @@
56
56
  "solid-js": "^1.3.7"
57
57
  },
58
58
  "dependencies": {
59
- "@bedrock-layout/register-resize-callback": "^2.0.14"
59
+ "@bedrock-layout/spacing-constants": "^4.0.1"
60
60
  },
61
61
  "scripts": {
62
62
  "test": "echo \"Error: run tests from root\" && exit 1",
@@ -71,6 +71,6 @@
71
71
  "bugs": {
72
72
  "url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
73
73
  },
74
- "gitHead": "f2b962e2efe049f621663f8e784b61d94ec07447",
74
+ "gitHead": "2f6a48b8bd337c48c17b3a7302623eeeb31cb7bf",
75
75
  "nx": {}
76
76
  }
@@ -1,5 +0,0 @@
1
- import { Accessor, Setter } from "solid-js";
2
- /**
3
- * @deprecated this function is deprecated and will be removed in the next major version
4
- */
5
- export declare function createContainerQuery<T extends Element>(width: number, maybeRef?: (ref: T) => unknown): [Accessor<boolean>, Setter<T | undefined>];
@@ -1,6 +0,0 @@
1
- import { Component } from "solid-js";
2
- import { GridProps } from "./grid";
3
- /**
4
- * @deprecated Use the `Grid` component with the `variant` prop set to "masonry" instead.
5
- */
6
- export declare const MasonryGrid: Component<GridProps>;
package/lib/padbox.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import { JSX } from "solid-js";
2
- import { SpacingOptions } from "./spacing-constants";
3
- import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
- type PaddingObj = {
5
- left: SpacingOptions;
6
- } | {
7
- right: SpacingOptions;
8
- } | {
9
- top: SpacingOptions;
10
- } | {
11
- bottom: SpacingOptions;
12
- } | {
13
- inlineStart: SpacingOptions;
14
- } | {
15
- inlineEnd: SpacingOptions;
16
- } | {
17
- blockStart: SpacingOptions;
18
- } | {
19
- blockEnd: SpacingOptions;
20
- };
21
- type PaddingTypes = SpacingOptions | PaddingObj | [SpacingOptions] | [SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions, SpacingOptions];
22
- export interface PadBoxBaseProps {
23
- padding?: PaddingTypes;
24
- }
25
- export type PadBoxProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, PadBoxBaseProps>;
26
- export declare function PadBox<T extends ValidConstructor = "div">(props: PadBoxProps<T>): JSX.Element;
27
- export {};
@@ -1,65 +0,0 @@
1
- import type { DefaultTheme } from "./theme-provider";
2
- import { Maybe } from "./typeUtils";
3
- 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";
4
- type AllCharacter = LowercaseCharacter | Uppercase<LowercaseCharacter>;
5
- type NonEmptyString = `${AllCharacter}${string}`;
6
- type CSSLengthUnit = `${number}${LengthUnit}`;
7
- type CSSCustomProperties = `--${NonEmptyString}`;
8
- type CSSCustomPropertiesWithVar = `var(${CSSCustomProperties})`;
9
- type LengthUnit = "vmin" | "vmax" | "vh" | "vw" | "%" | "ch" | "ex" | "em" | "rem" | "in" | "cm" | "mm" | "pt" | "pc" | "px";
10
- export type CSSLength = CSSLengthUnit | CSSCustomPropertiesWithVar | CSSCustomProperties;
11
- export declare function checkIsCSSLength(str: string): str is CSSLength;
12
- declare const space: {
13
- size000: string;
14
- size00: string;
15
- size1: string;
16
- size2: string;
17
- size3: string;
18
- size4: string;
19
- size5: string;
20
- size6: string;
21
- size7: string;
22
- size8: string;
23
- size9: string;
24
- size10: string;
25
- size11: string;
26
- size12: string;
27
- size13: string;
28
- size14: string;
29
- size15: string;
30
- };
31
- declare const size: {
32
- sizeXxs: string;
33
- sizeXs: string;
34
- sizeSm: string;
35
- sizeMd: string;
36
- sizeLg: string;
37
- sizeXl: string;
38
- sizeXxl: string;
39
- sizeContent1: string;
40
- sizeContent2: string;
41
- sizeContent3: string;
42
- sizeHeader1: string;
43
- sizeHeader2: string;
44
- sizeHeader3: string;
45
- };
46
- export declare const spacing: Record<keyof typeof space, CSSLength>;
47
- export declare const sizes: Record<keyof typeof size, CSSLength>;
48
- export type BaseTheme = Record<string, CSSLength | string | number>;
49
- type ThemeOrDefaultSpace<T> = T extends {
50
- space: BaseTheme;
51
- } ? keyof T["space"] : keyof typeof spacing;
52
- export type SpacingOptions = ThemeOrDefaultSpace<DefaultTheme>;
53
- export type SizesOptions = ThemeOrDefaultSizes<DefaultTheme>;
54
- type ThemeOrDefaultSizes<T> = T extends {
55
- sizes: BaseTheme;
56
- } ? T["sizes"] : keyof typeof sizes;
57
- export type Gutter = CSSLength | number | SpacingOptions;
58
- export declare function getSafeGutter<T extends DefaultTheme>(theme: T, gutter?: Gutter): Maybe<CSSLength>;
59
- export declare function getSpacingValue<T extends DefaultTheme>(theme: Readonly<T & {
60
- space?: BaseTheme;
61
- }>, spacingKey: SpacingOptions): Maybe<CSSLength>;
62
- export declare function getSizeValue<T extends DefaultTheme>(theme: Readonly<T & {
63
- sizes?: BaseTheme;
64
- }>, sizeKey?: CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto"): Maybe<CSSLength>;
65
- export {};
@@ -1,9 +0,0 @@
1
- import { JSXElement } from "solid-js";
2
- export interface DefaultTheme {
3
- }
4
- export interface ThemeProviderProps {
5
- theme: DefaultTheme;
6
- children: JSXElement;
7
- }
8
- export declare function ThemeProvider(props: Readonly<ThemeProviderProps>): JSXElement;
9
- export declare function useTheme(): DefaultTheme;
package/lib/toPx.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * This module is adapted from https://github.com/mikolalysenko/to-px/blob/master/browser.js
3
- */
4
- import type { Maybe } from "./typeUtils";
5
- export declare function toPX(str: string, element?: Readonly<Element>): Maybe<number>;