@bedrock-layout/solid 1.1.12 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/grid.d.ts CHANGED
@@ -2,10 +2,11 @@ import { JSX } from "solid-js";
2
2
  import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
5
- export interface GridBaseProps {
5
+ export type GridBaseProps = {
6
6
  gutter?: SpacingOptions;
7
7
  minItemWidth?: MinItemWidth;
8
- }
8
+ variant?: "grid" | "masonry";
9
+ };
9
10
  export type GridProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, GridBaseProps>;
10
11
  export declare function Grid<T extends ValidConstructor = "div">(props: Readonly<GridProps<T>>): JSX.Element;
11
12
  export {};
package/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("open-props"),l=require("solid-js"),P=require("@bedrock-layout/register-resize-callback"),Z=["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"],K=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Z]),p=new Set(["innerHTML","textContent","innerText","children"]),ee=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),te=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 ne(e,t){const n=te[e];return typeof n=="object"?n[t]?n.$:void 0:n}const ie=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),se=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","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"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function re(e,t,n){let i=n.length,s=t.length,r=i,c=0,o=0,a=t[s-1].nextSibling,f=null;for(;c<s||o<r;){if(t[c]===n[o]){c++,o++;continue}for(;t[s-1]===n[r-1];)s--,r--;if(s===c){const d=r<i?o?n[o-1].nextSibling:n[r-o]:a;for(;o<r;)e.insertBefore(n[o++],d)}else if(r===o)for(;c<s;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[r-1]&&n[o]===t[s-1]){const d=t[--s].nextSibling;e.insertBefore(n[o++],t[c++].nextSibling),e.insertBefore(n[--r],d),t[s]=n[r]}else{if(!f){f=new Map;let u=o;for(;u<r;)f.set(n[u],u++)}const d=f.get(t[c]);if(d!=null)if(o<d&&d<r){let u=c,h=1,C;for(;++u<s&&u<r&&!((C=f.get(t[u]))==null||C!==d+h);)h++;if(h>d-o){const I=t[c];for(;o<d;)e.insertBefore(n[o++],I)}else e.replaceChild(n[o++],t[c++])}else c++;else t[c++].remove()}}}const N="_$DX_DELEGATE";function D(e,t,n){let i;const s=()=>{const c=document.createElement("template");return c.innerHTML=e,n?c.content.firstChild.firstChild:c.content.firstChild},r=t?()=>l.untrack(()=>document.importNode(i||(i=s()),!0)):()=>(i||(i=s())).cloneNode(!0);return r.cloneNode=r,r}function ce(e,t=window.document){const n=t[N]||(t[N]=new Set);for(let i=0,s=e.length;i<s;i++){const r=e[i];n.has(r)||(n.add(r),t.addEventListener(r,be))}}function M(e,t,n){l.sharedConfig.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function le(e,t,n,i){l.sharedConfig.context||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function ae(e,t){l.sharedConfig.context||(t==null?e.removeAttribute("class"):e.className=t)}function fe(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 s=n[0];e.addEventListener(t,n[0]=r=>s.call(e,n[1],r))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),s=Object.keys(n);let r,c;for(r=0,c=s.length;r<c;r++){const o=s[r];!o||o==="undefined"||t[o]||(L(e,o,!1),delete n[o])}for(r=0,c=i.length;r<c;r++){const o=i[r],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(L(e,o,!0),n[o]=a)}return n}function G(e,t,n){if(!t)return n?M(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 s,r;for(r in n)t[r]==null&&i.removeProperty(r),delete n[r];for(r in t)s=t[r],s!==n[r]&&(i.setProperty(r,s),n[r]=s);return n}function ue(e,t={},n,i){const s={};return i||l.createRenderEffect(()=>s.children=x(e,t.children,s.children)),l.createRenderEffect(()=>t.ref&&t.ref(e)),l.createRenderEffect(()=>ge(e,t,n,!0,s,!0)),s}function me(e,t,n){return l.untrack(()=>e(t,n))}function H(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return x(e,t,i,n);l.createRenderEffect(s=>x(e,t(),s,n),i)}function ge(e,t,n,i,s={},r=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=R(e,c,null,s[c],n,r)}for(const c in t){if(c==="children"){i||x(e,t.children);continue}const o=t[c];s[c]=R(e,c,o,s[c],n,r)}}function ye(e){let t,n;return!l.sharedConfig.context||!(t=l.sharedConfig.registry.get(n=$e()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function he(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function L(e,t,n){const i=t.trim().split(/\s+/);for(let s=0,r=i.length;s<r;s++)e.classList.toggle(i[s],n)}function R(e,t,n,i,s,r){let c,o,a,f,d;if(t==="style")return G(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const u=t.slice(3);i&&e.removeEventListener(u,i),n&&e.addEventListener(u,n)}else if(t.slice(0,10)==="oncapture:"){const u=t.slice(10);i&&e.removeEventListener(u,i,!0),n&&e.addEventListener(u,n,!0)}else if(t.slice(0,2)==="on"){const u=t.slice(2).toLowerCase(),h=ie.has(u);if(!h&&i){const C=Array.isArray(i)?i[0]:i;e.removeEventListener(u,C)}(h||n)&&(fe(e,u,n,h),h&&ce([u]))}else if(t.slice(0,5)==="attr:")M(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(a=p.has(t))||!s&&((f=ne(t,e.tagName))||(o=K.has(t)))||(c=e.nodeName.includes("-"))){if(d)t=t.slice(5),o=!0;else if(l.sharedConfig.context)return n;t==="class"||t==="className"?ae(e,n):c&&!o&&!a?e[he(t)]=n:e[f||t]=n}else{const u=s&&t.indexOf(":")>-1&&oe[t.split(":")[0]];u?le(e,u,t,n):M(e,ee[t]||t,n)}return n}function be(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const s=n[`${t}Data`];if(s!==void 0?i.call(n,s,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function x(e,t,n,i,s){if(l.sharedConfig.context){!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 r=typeof t,c=i!==void 0;if(e=c&&n[0]&&n[0].parentNode||e,r==="string"||r==="number"){if(l.sharedConfig.context)return n;if(r==="number"&&(t=t.toString()),c){let o=n[0];o&&o.nodeType===3?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=S(e,n,i,o)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||r==="boolean"){if(l.sharedConfig.context)return n;n=S(e,n,i)}else{if(r==="function")return l.createRenderEffect(()=>{let o=t();for(;typeof o=="function";)o=o();n=x(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[],a=n&&Array.isArray(n);if(z(o,t,n,s))return l.createRenderEffect(()=>n=x(e,o,n,i,!0)),()=>n;if(l.sharedConfig.context){if(!o.length)return n;if(i===void 0)return[...e.childNodes];let f=o[0],d=[f];for(;(f=f.nextSibling)!==i;)d.push(f);return n=d}if(o.length===0){if(n=S(e,n,i),c)return n}else a?n.length===0?W(e,o,i):re(e,n,o):(n&&S(e),W(e,o));n=o}else if(t.nodeType){if(l.sharedConfig.context&&t.parentNode)return n=c?[t]:t;if(Array.isArray(n)){if(c)return n=S(e,n,i,t);S(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function z(e,t,n,i){let s=!1;for(let r=0,c=t.length;r<c;r++){let o=t[r],a=n&&n[r],f;if(!(o==null||o===!0||o===!1))if((f=typeof o)=="object"&&o.nodeType)e.push(o);else if(Array.isArray(o))s=z(e,o,a)||s;else if(f==="function")if(i){for(;typeof o=="function";)o=o();s=z(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||s}else e.push(o),s=!0;else{const d=String(o);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return s}function W(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function S(e,t,n,i){if(n===void 0)return e.textContent="";const s=i||document.createTextNode("");if(t.length){let r=!1;for(let c=t.length-1;c>=0;c--){const o=t[c];if(s!==o){const a=o.parentNode===e;!r&&!c?a?e.replaceChild(s,o):e.insertBefore(s,n):a&&o.remove()}else r=!0}}else e.insertBefore(s,n);return[s]}function $e(){const e=l.sharedConfig.context;return`${e.id}${e.count++}`}const Ce="http://www.w3.org/2000/svg";function Se(e,t=!1){return t?document.createElementNS(Ce,e):document.createElement(e)}function xe(e){const[t,n]=l.splitProps(e,["component"]),i=l.createMemo(()=>t.component);return l.createMemo(()=>{const s=i();switch(typeof s){case"function":return l.untrack(()=>s(n));case"string":const r=se.has(s),c=l.sharedConfig.context?ye():Se(s,r);return ue(c,n,r),c}})}function j(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 g(e,t){return l.createComponent(xe,l.mergeProps({get component(){return e()}},t))}function y(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 _=/^--\D{1}.{0,100}$/;function F(e){return _.test(e)}function E(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}\)$/,_].some(t=>t.test(e))}const{sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Te,sizeContent1:Me,sizeContent2:ze,sizeContent3:Oe,sizeHeader1:ve,sizeHeader2:ke,sizeHeader3:Ne,size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze}=Y,Ke={size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze},pe={sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Te,sizeContent1:Me,sizeContent2:ze,sizeContent3:Oe,sizeHeader1:ve,sizeHeader2:ke,sizeHeader3:Ne},V=Ke,X=pe;function q(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&E(t)?F(t)?`var(${t})`:t:j(b(e,t))}function b(e,t){const n=e.space??V,i=q(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return j(i[t])}function A(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&E(t))return F(t)?`var(${t})`:t;const n=e.sizes??X,i=q(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return j(i[t])}function et(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function tt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),n=()=>`--maxWidth: ${et(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",r=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","maxWidth","centerText","centerChildren"]),y({style:c,"data-bedrock-center":r})))}const U=l.createContext({});function nt(e){return l.createComponent(U.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return l.useContext(U)}catch{return{}}}function it(e,t){return A(e,t)}function st(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${it(t,e.minItemWidth)}`,r=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","minItemWidth","noStretchedColumns"]),y({style:c,"data-bedrock-column-drop":r})))}function ot(e,t){const[n,i]=l.createSignal(!1),[s,r]=l.createSignal();return l.onMount(()=>(P.init(),0)),l.createEffect(()=>{if(j(s())===void 0)return 0;t&&t(s());const c=P.registerCallback(s(),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)}return 0});return l.onCleanup(c),0}),[n,r]}function rt(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 ct(e){return Array.isArray(e)?e.join("/"):e}function lt(e){return rt(e)?ct(e):void 0}function at(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>lt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",r=()=>[t(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","ratio","position"]),y({style:r,"data-bedrock-frame":()=>""})))}function Q(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,r=()=>[n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","minItemWidth"]),y({style:r,"data-bedrock-grid":()=>""})))}const w=96;function J(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function k(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 ft(i,n);case"em":return v(n,"font-size");case"rem":return v(document.body,"font-size");case"in":return w;case"cm":return w/2.54;case"mm":return w/25.4;case"pt":return w/72;case"pc":return w/6;case"px":return 1;default:{const[s,r]=J(i);if(isNaN(s))return;if(!r)return s;const c=k(r,t);return typeof c=="number"?s*c:void 0}}}function v(e,t){const[n,i]=J(getComputedStyle(e).getPropertyValue(t));return n*(k(i,e)??1)}function ft(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=v(n,"height")/128;return t.removeChild(n),i}var dt=D("<div>");const T=1,ut=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,mt=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),r=$();return l.onMount(()=>(P.init(),0)),l.createEffect(()=>{const c=j(i());if(c===void 0)return;const o=P.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(r,e.gutter)??"1px":"1px",d=ut?k(f,a):void 0,u=Math.max(d??T,T),[h]=Array.from(a.children),C=1+Math.min(a.scrollHeight,h.scrollHeight),I=Math.max(Math.ceil(C/u),T);return n(I),0});return l.onCleanup(o),0}),(()=>{var c=dt();return me(s,c),H(c,()=>e.children),l.createRenderEffect(o=>G(c,`grid-row: span ${t()};`,o)),c})()},gt=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(mt,{get gutter(){return e.gutter},children:s}));return l.createComponent(Q,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},yt={start:"justify:start",end:"justify:end",center:"justify:center"},ht={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function bt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>e.justify!==void 0?yt[e.justify]:void 0,r=()=>e.align!==void 0?ht[e.align]:void 0,c=()=>[n(),i()].join("; "),o=()=>[s(),r()].filter(Boolean).join(" ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","justify","align"]),y({style:c,"data-bedrock-inline-cluster":o})))}const $t={start:"justify:start",end:"justify:end",center:"justify:center"},Ct={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((u,[h,C])=>u+`${h}:${C};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?$t[e.justify]:void 0,o=()=>e.align!==void 0?Ct[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),r(),s()].join("; "),d=()=>[c(),o(),a()].filter(Boolean).join(" ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","justify","align","stretch","switchAt"]),y({style:f,"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],wt=(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,[s,r])=>({...i,[xt(s)]:O(e,r)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,r])=>i+`${s}:${r};`,"")};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>wt(t,e.padding),s=()=>[n(),i()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","padding"]),y({style:s,"data-bedrock-padbox":()=>""})))}function At(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,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"}},r=()=>[n(),i()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter"]),y({style:r,"data-bedrock-reel":s})))}const B={"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 Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>B[e.fraction??"1/2"]??B["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),s(),i(),c()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","fraction"]),y({style:o,"data-bedrock-split":r})))}function Et(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>[n(),i()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter"]),y({style:s,"data-bedrock-stack":()=>""})))}var It=D("<div data-bedrock-cover-centered>");function Tt(e){return typeof e=="number"?`${e}px`:e&&E(e)?e:"100vh"}function Mt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>`--minHeight: ${Tt(e.minHeight)};`,r=()=>e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","minHeight","stretchContent"]),y({style:c,"data-bedrock-cover":r})))}function zt(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(Mt,l.mergeProps(n,{get children(){return[l.createMemo(()=>t.top),(()=>{var i=It();return H(i,()=>t.children),i})(),l.createMemo(()=>t.bottom)]}}))}function Ot(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,r=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),r()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","columns","switchAt"]),y({style:c,"data-bedrock-columns":()=>""})))}const vt=e=>typeof e=="number"?e:1;function kt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>`--span: ${vt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",s=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",r=()=>[t(),n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","span","offsetStart","offsetEnd"]),y({style:r,"data-bedrock-column":()=>""})))}exports.Center=tt;exports.Column=kt;exports.ColumnDrop=st;exports.Columns=Ot;exports.Cover=zt;exports.Frame=at;exports.Grid=Q;exports.Inline=St;exports.InlineCluster=bt;exports.MasonryGrid=gt;exports.PadBox=jt;exports.Reel=At;exports.Split=Pt;exports.Stack=Et;exports.ThemeProvider=nt;exports.checkIsCSSLength=E;exports.createContainerQuery=ot;exports.getSafeGutter=O;exports.getSizeValue=A;exports.getSpacingValue=b;exports.sizes=X;exports.spacing=V;exports.useTheme=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("open-props"),l=require("solid-js"),P=require("@bedrock-layout/register-resize-callback"),Z=["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"],K=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Z]),p=new Set(["innerHTML","textContent","innerText","children"]),ee=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),te=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 ne(e,t){const n=te[e];return typeof n=="object"?n[t]?n.$:void 0:n}const ie=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),se=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","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"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function re(e,t,n){let i=n.length,s=t.length,r=i,c=0,o=0,a=t[s-1].nextSibling,f=null;for(;c<s||o<r;){if(t[c]===n[o]){c++,o++;continue}for(;t[s-1]===n[r-1];)s--,r--;if(s===c){const d=r<i?o?n[o-1].nextSibling:n[r-o]:a;for(;o<r;)e.insertBefore(n[o++],d)}else if(r===o)for(;c<s;)(!f||!f.has(t[c]))&&t[c].remove(),c++;else if(t[c]===n[r-1]&&n[o]===t[s-1]){const d=t[--s].nextSibling;e.insertBefore(n[o++],t[c++].nextSibling),e.insertBefore(n[--r],d),t[s]=n[r]}else{if(!f){f=new Map;let u=o;for(;u<r;)f.set(n[u],u++)}const d=f.get(t[c]);if(d!=null)if(o<d&&d<r){let u=c,h=1,C;for(;++u<s&&u<r&&!((C=f.get(t[u]))==null||C!==d+h);)h++;if(h>d-o){const I=t[c];for(;o<d;)e.insertBefore(n[o++],I)}else e.replaceChild(n[o++],t[c++])}else c++;else t[c++].remove()}}}const N="_$DX_DELEGATE";function D(e,t,n){let i;const s=()=>{const c=document.createElement("template");return c.innerHTML=e,n?c.content.firstChild.firstChild:c.content.firstChild},r=t?()=>l.untrack(()=>document.importNode(i||(i=s()),!0)):()=>(i||(i=s())).cloneNode(!0);return r.cloneNode=r,r}function ce(e,t=window.document){const n=t[N]||(t[N]=new Set);for(let i=0,s=e.length;i<s;i++){const r=e[i];n.has(r)||(n.add(r),t.addEventListener(r,be))}}function M(e,t,n){l.sharedConfig.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function le(e,t,n,i){l.sharedConfig.context||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function ae(e,t){l.sharedConfig.context||(t==null?e.removeAttribute("class"):e.className=t)}function fe(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 s=n[0];e.addEventListener(t,n[0]=r=>s.call(e,n[1],r))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),s=Object.keys(n);let r,c;for(r=0,c=s.length;r<c;r++){const o=s[r];!o||o==="undefined"||t[o]||(L(e,o,!1),delete n[o])}for(r=0,c=i.length;r<c;r++){const o=i[r],a=!!t[o];!o||o==="undefined"||n[o]===a||!a||(L(e,o,!0),n[o]=a)}return n}function G(e,t,n){if(!t)return n?M(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 s,r;for(r in n)t[r]==null&&i.removeProperty(r),delete n[r];for(r in t)s=t[r],s!==n[r]&&(i.setProperty(r,s),n[r]=s);return n}function ue(e,t={},n,i){const s={};return i||l.createRenderEffect(()=>s.children=x(e,t.children,s.children)),l.createRenderEffect(()=>t.ref&&t.ref(e)),l.createRenderEffect(()=>ge(e,t,n,!0,s,!0)),s}function me(e,t,n){return l.untrack(()=>e(t,n))}function H(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return x(e,t,i,n);l.createRenderEffect(s=>x(e,t(),s,n),i)}function ge(e,t,n,i,s={},r=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=R(e,c,null,s[c],n,r)}for(const c in t){if(c==="children"){i||x(e,t.children);continue}const o=t[c];s[c]=R(e,c,o,s[c],n,r)}}function ye(e){let t,n;return!l.sharedConfig.context||!(t=l.sharedConfig.registry.get(n=$e()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function he(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function L(e,t,n){const i=t.trim().split(/\s+/);for(let s=0,r=i.length;s<r;s++)e.classList.toggle(i[s],n)}function R(e,t,n,i,s,r){let c,o,a,f,d;if(t==="style")return G(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const u=t.slice(3);i&&e.removeEventListener(u,i),n&&e.addEventListener(u,n)}else if(t.slice(0,10)==="oncapture:"){const u=t.slice(10);i&&e.removeEventListener(u,i,!0),n&&e.addEventListener(u,n,!0)}else if(t.slice(0,2)==="on"){const u=t.slice(2).toLowerCase(),h=ie.has(u);if(!h&&i){const C=Array.isArray(i)?i[0]:i;e.removeEventListener(u,C)}(h||n)&&(fe(e,u,n,h),h&&ce([u]))}else if(t.slice(0,5)==="attr:")M(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(a=p.has(t))||!s&&((f=ne(t,e.tagName))||(o=K.has(t)))||(c=e.nodeName.includes("-"))){if(d)t=t.slice(5),o=!0;else if(l.sharedConfig.context)return n;t==="class"||t==="className"?ae(e,n):c&&!o&&!a?e[he(t)]=n:e[f||t]=n}else{const u=s&&t.indexOf(":")>-1&&oe[t.split(":")[0]];u?le(e,u,t,n):M(e,ee[t]||t,n)}return n}function be(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const s=n[`${t}Data`];if(s!==void 0?i.call(n,s,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function x(e,t,n,i,s){if(l.sharedConfig.context){!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 r=typeof t,c=i!==void 0;if(e=c&&n[0]&&n[0].parentNode||e,r==="string"||r==="number"){if(l.sharedConfig.context)return n;if(r==="number"&&(t=t.toString()),c){let o=n[0];o&&o.nodeType===3?o.data!==t&&(o.data=t):o=document.createTextNode(t),n=S(e,n,i,o)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||r==="boolean"){if(l.sharedConfig.context)return n;n=S(e,n,i)}else{if(r==="function")return l.createRenderEffect(()=>{let o=t();for(;typeof o=="function";)o=o();n=x(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[],a=n&&Array.isArray(n);if(v(o,t,n,s))return l.createRenderEffect(()=>n=x(e,o,n,i,!0)),()=>n;if(l.sharedConfig.context){if(!o.length)return n;if(i===void 0)return[...e.childNodes];let f=o[0],d=[f];for(;(f=f.nextSibling)!==i;)d.push(f);return n=d}if(o.length===0){if(n=S(e,n,i),c)return n}else a?n.length===0?W(e,o,i):re(e,n,o):(n&&S(e),W(e,o));n=o}else if(t.nodeType){if(l.sharedConfig.context&&t.parentNode)return n=c?[t]:t;if(Array.isArray(n)){if(c)return n=S(e,n,i,t);S(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n,i){let s=!1;for(let r=0,c=t.length;r<c;r++){let o=t[r],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))s=v(e,o,a)||s;else if(f==="function")if(i){for(;typeof o=="function";)o=o();s=v(e,Array.isArray(o)?o:[o],Array.isArray(a)?a:[a])||s}else e.push(o),s=!0;else{const d=String(o);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return s}function W(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function S(e,t,n,i){if(n===void 0)return e.textContent="";const s=i||document.createTextNode("");if(t.length){let r=!1;for(let c=t.length-1;c>=0;c--){const o=t[c];if(s!==o){const a=o.parentNode===e;!r&&!c?a?e.replaceChild(s,o):e.insertBefore(s,n):a&&o.remove()}else r=!0}}else e.insertBefore(s,n);return[s]}function $e(){const e=l.sharedConfig.context;return`${e.id}${e.count++}`}const Ce="http://www.w3.org/2000/svg";function Se(e,t=!1){return t?document.createElementNS(Ce,e):document.createElement(e)}function xe(e){const[t,n]=l.splitProps(e,["component"]),i=l.createMemo(()=>t.component);return l.createMemo(()=>{const s=i();switch(typeof s){case"function":return l.untrack(()=>s(n));case"string":const r=se.has(s),c=l.sharedConfig.context?ye():Se(s,r);return ue(c,n,r),c}})}function j(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 g(e,t){return l.createComponent(xe,l.mergeProps({get component(){return e()}},t))}function y(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 _=/^--\D{1}.{0,100}$/;function F(e){return _.test(e)}function E(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}\)$/,_].some(t=>t.test(e))}const{sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Te,sizeContent1:Me,sizeContent2:ve,sizeContent3:Oe,sizeHeader1:ze,sizeHeader2:ke,sizeHeader3:Ne,size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze}=Y,Ke={size000:Le,size00:Re,size1:We,size2:Be,size3:De,size4:Ge,size5:He,size6:_e,size7:Fe,size8:Ve,size9:Xe,size10:qe,size11:Ue,size12:Qe,size13:Je,size14:Ye,size15:Ze},pe={sizeXxs:we,sizeXs:je,sizeSm:Ae,sizeMd:Pe,sizeLg:Ee,sizeXl:Ie,sizeXxl:Te,sizeContent1:Me,sizeContent2:ve,sizeContent3:Oe,sizeHeader1:ze,sizeHeader2:ke,sizeHeader3:Ne},V=Ke,X=pe;function q(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&E(t)?F(t)?`var(${t})`:t:j(b(e,t))}function b(e,t){const n=e.space??V,i=q(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return j(i[t])}function A(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&E(t))return F(t)?`var(${t})`:t;const n=e.sizes??X,i=q(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return j(i[t])}function et(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function tt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),n=()=>`--maxWidth: ${et(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",r=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","maxWidth","centerText","centerChildren"]),y({style:c,"data-bedrock-center":r})))}const U=l.createContext({});function nt(e){return l.createComponent(U.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return l.useContext(U)}catch{return{}}}function it(e,t){return A(e,t)}function st(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${it(t,e.minItemWidth)}`,r=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","minItemWidth","noStretchedColumns"]),y({style:c,"data-bedrock-column-drop":r})))}function ot(e,t){const[n,i]=l.createSignal(!1),[s,r]=l.createSignal();return l.onMount(()=>(P.init(),0)),l.createEffect(()=>{if(j(s())===void 0)return 0;t&&t(s());const c=P.registerCallback(s(),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)}return 0});return l.onCleanup(c),0}),[n,r]}function rt(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 ct(e){return Array.isArray(e)?e.join("/"):e}function lt(e){return rt(e)?ct(e):void 0}function at(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>lt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",r=()=>[t(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","ratio","position"]),y({style:r,"data-bedrock-frame":()=>""})))}function Q(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,r=()=>[n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","minItemWidth"]),y({style:r,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const w=96;function J(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function k(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 ft(i,n);case"em":return z(n,"font-size");case"rem":return z(document.body,"font-size");case"in":return w;case"cm":return w/2.54;case"mm":return w/25.4;case"pt":return w/72;case"pc":return w/6;case"px":return 1;default:{const[s,r]=J(i);if(isNaN(s))return;if(!r)return s;const c=k(r,t);return typeof c=="number"?s*c:void 0}}}function z(e,t){const[n,i]=J(getComputedStyle(e).getPropertyValue(t));return n*(k(i,e)??1)}function ft(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=z(n,"height")/128;return t.removeChild(n),i}var dt=D("<div>");const T=1,ut=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,mt=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),r=$();return l.onMount(()=>(P.init(),0)),l.createEffect(()=>{const c=j(i());if(c===void 0)return;const o=P.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(r,e.gutter)??"1px":"1px",d=ut?k(f,a):void 0,u=Math.max(d??T,T),[h]=Array.from(a.children),C=1+Math.min(a.scrollHeight,h.scrollHeight),I=Math.max(Math.ceil(C/u),T);return n(I),0});return l.onCleanup(o),0}),(()=>{var c=dt();return me(s,c),H(c,()=>e.children),l.createRenderEffect(o=>G(c,`grid-row: span ${t()};`,o)),c})()},gt=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(mt,{get gutter(){return e.gutter},children:s}));return l.createComponent(Q,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},yt={start:"justify:start",end:"justify:end",center:"justify:center"},ht={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function bt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>e.justify!==void 0?yt[e.justify]:void 0,r=()=>e.align!==void 0?ht[e.align]:void 0,c=()=>[n(),i()].join("; "),o=()=>[s(),r()].filter(Boolean).join(" ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","justify","align"]),y({style:c,"data-bedrock-inline-cluster":o})))}const $t={start:"justify:start",end:"justify:end",center:"justify:center"},Ct={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function St(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((u,[h,C])=>u+`${h}:${C};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?$t[e.justify]:void 0,o=()=>e.align!==void 0?Ct[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),r(),s()].join("; "),d=()=>[c(),o(),a()].filter(Boolean).join(" ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","justify","align","stretch","switchAt"]),y({style:f,"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],wt=(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,[s,r])=>({...i,[xt(s)]:O(e,r)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,r])=>i+`${s}:${r};`,"")};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>wt(t,e.padding),s=()=>[n(),i()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","padding"]),y({style:s,"data-bedrock-padbox":()=>""})))}function At(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),i=()=>`--gutter: ${b(t,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"}},r=()=>[n(),i()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter"]),y({style:r,"data-bedrock-reel":s})))}const B={"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 Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,d])=>a+`${f}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>B[e.fraction??"1/2"]??B["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),s(),i(),c()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","fraction"]),y({style:o,"data-bedrock-split":r})))}function Et(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>[n(),i()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter"]),y({style:s,"data-bedrock-stack":()=>""})))}var It=D("<div data-bedrock-cover-centered>");function Tt(e){return typeof e=="number"?`${e}px`:e&&E(e)?e:"100vh"}function Mt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>`--minHeight: ${Tt(e.minHeight)};`,r=()=>e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","minHeight","stretchContent"]),y({style:c,"data-bedrock-cover":r})))}function vt(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(Mt,l.mergeProps(n,{get children(){return[l.createMemo(()=>t.top),(()=>{var i=It();return H(i,()=>t.children),i})(),l.createMemo(()=>t.bottom)]}}))}function Ot(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,s=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,r=()=>e.switchAt?`--switchAt: ${A(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),r()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","gutter","columns","switchAt"]),y({style:c,"data-bedrock-columns":()=>""})))}const zt=e=>typeof e=="number"?e:1;function kt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>`--span: ${zt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",s=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",r=()=>[t(),n(),i(),s()].join("; ");return g(()=>e.as??"div",l.mergeProps(m(e,["as","span","offsetStart","offsetEnd"]),y({style:r,"data-bedrock-column":()=>""})))}exports.Center=tt;exports.Column=kt;exports.ColumnDrop=st;exports.Columns=Ot;exports.Cover=vt;exports.Frame=at;exports.Grid=Q;exports.Inline=St;exports.InlineCluster=bt;exports.MasonryGrid=gt;exports.PadBox=jt;exports.Reel=At;exports.Split=Pt;exports.Stack=Et;exports.ThemeProvider=nt;exports.checkIsCSSLength=E;exports.createContainerQuery=ot;exports.getSafeGutter=O;exports.getSizeValue=A;exports.getSpacingValue=b;exports.sizes=X;exports.spacing=V;exports.useTheme=$;
package/lib/index.m.js CHANGED
@@ -1,7 +1,47 @@
1
1
  import st from "open-props";
2
2
  import { createRenderEffect as w, sharedConfig as d, splitProps as V, createMemo as T, untrack as L, createComponent as E, mergeProps as y, createContext as ot, useContext as ct, createSignal as O, onMount as X, createEffect as U, onCleanup as q, children as rt } from "solid-js";
3
3
  import { init as Q, registerCallback as Y } from "@bedrock-layout/register-resize-callback";
4
- const lt = ["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"], ft = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...lt]), at = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]), ut = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
4
+ const lt = [
5
+ "allowfullscreen",
6
+ "async",
7
+ "autofocus",
8
+ "autoplay",
9
+ "checked",
10
+ "controls",
11
+ "default",
12
+ "disabled",
13
+ "formnovalidate",
14
+ "hidden",
15
+ "indeterminate",
16
+ "inert",
17
+ "ismap",
18
+ "loop",
19
+ "multiple",
20
+ "muted",
21
+ "nomodule",
22
+ "novalidate",
23
+ "open",
24
+ "playsinline",
25
+ "readonly",
26
+ "required",
27
+ "reversed",
28
+ "seamless",
29
+ "selected"
30
+ ], ft = /* @__PURE__ */ new Set([
31
+ "className",
32
+ "value",
33
+ "readOnly",
34
+ "formNoValidate",
35
+ "isMap",
36
+ "noModule",
37
+ "playsInline",
38
+ ...lt
39
+ ]), at = /* @__PURE__ */ new Set([
40
+ "innerHTML",
41
+ "textContent",
42
+ "innerText",
43
+ "children"
44
+ ]), ut = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
5
45
  className: "class",
6
46
  htmlFor: "for"
7
47
  }), dt = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
@@ -33,7 +73,30 @@ function yt(t, e) {
33
73
  const n = dt[t];
34
74
  return typeof n == "object" ? n[e] ? n.$ : void 0 : n;
35
75
  }
36
- const mt = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]), ht = /* @__PURE__ */ new Set([
76
+ const mt = /* @__PURE__ */ new Set([
77
+ "beforeinput",
78
+ "click",
79
+ "dblclick",
80
+ "contextmenu",
81
+ "focusin",
82
+ "focusout",
83
+ "input",
84
+ "keydown",
85
+ "keyup",
86
+ "mousedown",
87
+ "mousemove",
88
+ "mouseout",
89
+ "mouseover",
90
+ "mouseup",
91
+ "pointerdown",
92
+ "pointermove",
93
+ "pointerout",
94
+ "pointerover",
95
+ "pointerup",
96
+ "touchend",
97
+ "touchmove",
98
+ "touchstart"
99
+ ]), ht = /* @__PURE__ */ new Set([
37
100
  "altGlyph",
38
101
  "altGlyphDef",
39
102
  "altGlyphItem",
@@ -147,9 +210,9 @@ function $t(t, e, n) {
147
210
  for (; ++u < s && u < c && !((S = f.get(e[u])) == null || S !== a + $); )
148
211
  $++;
149
212
  if ($ > a - o) {
150
- const z = e[r];
213
+ const v = e[r];
151
214
  for (; o < a; )
152
- t.insertBefore(n[o++], z);
215
+ t.insertBefore(n[o++], v);
153
216
  } else
154
217
  t.replaceChild(n[o++], e[r++]);
155
218
  } else
@@ -175,7 +238,7 @@ function bt(t, e = window.document) {
175
238
  n.has(c) || (n.add(c), e.addEventListener(c, Ot));
176
239
  }
177
240
  }
178
- function v(t, e, n) {
241
+ function M(t, e, n) {
179
242
  d.context || (n == null ? t.removeAttribute(e) : t.setAttribute(e, n));
180
243
  }
181
244
  function xt(t, e, n, i) {
@@ -208,7 +271,7 @@ function jt(t, e, n = {}) {
208
271
  }
209
272
  function Z(t, e, n) {
210
273
  if (!e)
211
- return n ? v(t, "style") : e;
274
+ return n ? M(t, "style") : e;
212
275
  const i = t.style;
213
276
  if (typeof e == "string")
214
277
  return i.cssText = e;
@@ -222,7 +285,9 @@ function Z(t, e, n) {
222
285
  }
223
286
  function At(t, e = {}, n, i) {
224
287
  const s = {};
225
- return i || w(() => s.children = A(t, e.children, s.children)), w(() => e.ref && e.ref(t)), w(() => Et(t, e, n, !0, s, !0)), s;
288
+ return i || w(
289
+ () => s.children = A(t, e.children, s.children)
290
+ ), w(() => e.ref && e.ref(t)), w(() => Et(t, e, n, !0, s, !0)), s;
226
291
  }
227
292
  function Ct(t, e, n) {
228
293
  return L(() => t(e, n));
@@ -285,7 +350,7 @@ function G(t, e, n, i, s, c) {
285
350
  }
286
351
  ($ || n) && (wt(t, u, n, $), $ && bt([u]));
287
352
  } else if (e.slice(0, 5) === "attr:")
288
- v(t, e.slice(5), n);
353
+ M(t, e.slice(5), n);
289
354
  else if ((a = e.slice(0, 5) === "prop:") || (l = at.has(e)) || !s && ((f = yt(e, t.tagName)) || (o = ft.has(e))) || (r = t.nodeName.includes("-"))) {
290
355
  if (a)
291
356
  e = e.slice(5), o = !0;
@@ -294,7 +359,7 @@ function G(t, e, n, i, s, c) {
294
359
  e === "class" || e === "className" ? St(t, n) : r && !o && !l ? t[Tt(e)] = n : t[f || e] = n;
295
360
  } else {
296
361
  const u = s && e.indexOf(":") > -1 && gt[e.split(":")[0]];
297
- u ? xt(t, u, e, n) : v(t, ut[e] || e, n);
362
+ u ? xt(t, u, e, n) : M(t, ut[e] || e, n);
298
363
  }
299
364
  return n;
300
365
  }
@@ -391,7 +456,7 @@ function A(t, e, n, i, s) {
391
456
  function N(t, e, n, i) {
392
457
  let s = !1;
393
458
  for (let c = 0, r = e.length; c < r; c++) {
394
- let o = e[c], l = n && n[c], f;
459
+ let o = e[c], l = n && n[t.length], f;
395
460
  if (!(o == null || o === !0 || o === !1))
396
461
  if ((f = typeof o) == "object" && o.nodeType)
397
462
  t.push(o);
@@ -401,7 +466,11 @@ function N(t, e, n, i) {
401
466
  if (i) {
402
467
  for (; typeof o == "function"; )
403
468
  o = o();
404
- s = N(t, Array.isArray(o) ? o : [o], Array.isArray(l) ? l : [l]) || s;
469
+ s = N(
470
+ t,
471
+ Array.isArray(o) ? o : [o],
472
+ Array.isArray(l) ? l : [l]
473
+ ) || s;
405
474
  } else
406
475
  t.push(o), s = !0;
407
476
  else {
@@ -437,11 +506,11 @@ function Pt() {
437
506
  const t = d.context;
438
507
  return `${t.id}${t.count++}`;
439
508
  }
440
- const zt = "http://www.w3.org/2000/svg";
441
- function Mt(t, e = !1) {
442
- return e ? document.createElementNS(zt, t) : document.createElement(t);
509
+ const vt = "http://www.w3.org/2000/svg";
510
+ function zt(t, e = !1) {
511
+ return e ? document.createElementNS(vt, t) : document.createElement(t);
443
512
  }
444
- function vt(t) {
513
+ function Mt(t) {
445
514
  const [e, n] = V(t, ["component"]), i = T(() => e.component);
446
515
  return T(() => {
447
516
  const s = i();
@@ -449,7 +518,7 @@ function vt(t) {
449
518
  case "function":
450
519
  return L(() => s(n));
451
520
  case "string":
452
- const c = ht.has(s), r = d.context ? It() : Mt(s, c);
521
+ const c = ht.has(s), r = d.context ? It() : zt(s, c);
453
522
  return At(r, n, c), r;
454
523
  }
455
524
  });
@@ -469,7 +538,7 @@ function m(t, e) {
469
538
  }), {});
470
539
  }
471
540
  function h(t, e) {
472
- return E(vt, y({
541
+ return E(Mt, y({
473
542
  get component() {
474
543
  return t();
475
544
  }
@@ -660,7 +729,7 @@ function be(t) {
660
729
  const e = x(), n = () => typeof t.style == "string" ? t.style : Object.entries(t.style ?? {}).reduce((r, [o, l]) => r + `${o}:${l};`, ""), i = () => `--gutter: ${b(e, t.gutter ?? "size00") ?? "0px"};`, s = () => `--minItemWidth: ${typeof t.minItemWidth == "string" ? t.minItemWidth : `${t.minItemWidth ?? 0}px`};`, c = () => [n(), i(), s()].join("; ");
661
730
  return h(() => t.as ?? "div", y(m(t, ["as", "gutter", "minItemWidth"]), g({
662
731
  style: c,
663
- "data-bedrock-grid": () => ""
732
+ "data-bedrock-grid": () => t.variant === "masonry" ? "variant:masonry" : ""
664
733
  })));
665
734
  }
666
735
  const C = 96;
@@ -722,7 +791,7 @@ function xe(t, e) {
722
791
  return e.removeChild(n), i;
723
792
  }
724
793
  var Se = /* @__PURE__ */ J("<div>");
725
- const M = 1, we = typeof window == "object" && typeof document == "object" && document.nodeType === 9, je = (t) => {
794
+ const z = 1, we = typeof window == "object" && typeof document == "object" && document.nodeType === 9, je = (t) => {
726
795
  const [e, n] = O(1), [i, s] = O(), c = x();
727
796
  return X(() => (Q(), 0)), U(() => {
728
797
  const r = I(i());
@@ -732,8 +801,8 @@ const M = 1, we = typeof window == "object" && typeof document == "object" && do
732
801
  target: l
733
802
  }) => {
734
803
  n(1);
735
- const f = t.gutter ? b(c, t.gutter) ?? "1px" : "1px", a = we ? B(f, l) : void 0, u = Math.max(a ?? M, M), [$] = Array.from(l.children), S = 1 + Math.min(l.scrollHeight, $.scrollHeight), z = Math.max(Math.ceil(S / u), M);
736
- return n(z), 0;
804
+ const f = t.gutter ? b(c, t.gutter) ?? "1px" : "1px", a = we ? B(f, l) : void 0, u = Math.max(a ?? z, z), [$] = Array.from(l.children), S = 1 + Math.min(l.scrollHeight, $.scrollHeight), v = Math.max(Math.ceil(S / u), z);
805
+ return n(v), 0;
737
806
  });
738
807
  return q(o), 0;
739
808
  }), (() => {
@@ -857,11 +926,11 @@ function qe(t) {
857
926
  })));
858
927
  }
859
928
  var Pe = /* @__PURE__ */ J("<div data-bedrock-cover-centered>");
860
- function ze(t) {
929
+ function ve(t) {
861
930
  return typeof t == "number" ? `${t}px` : t && W(t) ? t : "100vh";
862
931
  }
863
- function Me(t) {
864
- const e = x(), n = () => typeof t.style == "string" ? t.style : Object.entries(t.style ?? {}).reduce((o, [l, f]) => o + `${l}:${f};`, ""), i = () => `--gutter: ${b(e, t.gutter ?? "size00") ?? "0px"};`, s = () => `--minHeight: ${ze(t.minHeight)};`, c = () => t.stretchContent === !0 ? "stretch-content" : "", r = () => [n(), i(), s()].join("; ");
932
+ function ze(t) {
933
+ const e = x(), n = () => typeof t.style == "string" ? t.style : Object.entries(t.style ?? {}).reduce((o, [l, f]) => o + `${l}:${f};`, ""), i = () => `--gutter: ${b(e, t.gutter ?? "size00") ?? "0px"};`, s = () => `--minHeight: ${ve(t.minHeight)};`, c = () => t.stretchContent === !0 ? "stretch-content" : "", r = () => [n(), i(), s()].join("; ");
865
934
  return h(() => t.as ?? "div", y(m(t, ["as", "minHeight", "stretchContent"]), g({
866
935
  style: r,
867
936
  "data-bedrock-cover": c
@@ -869,7 +938,7 @@ function Me(t) {
869
938
  }
870
939
  function Qe(t) {
871
940
  const [e, n] = V(t, ["children", "top", "bottom"]);
872
- return E(Me, y(n, {
941
+ return E(ze, y(n, {
873
942
  get children() {
874
943
  return [T(() => e.top), (() => {
875
944
  var i = Pe();
@@ -885,9 +954,9 @@ function Ye(t) {
885
954
  "data-bedrock-columns": () => ""
886
955
  })));
887
956
  }
888
- const ve = (t) => typeof t == "number" ? t : 1;
957
+ const Me = (t) => typeof t == "number" ? t : 1;
889
958
  function Je(t) {
890
- const e = () => typeof t.style == "string" ? t.style : Object.entries(t.style ?? {}).reduce((r, [o, l]) => r + `${o}:${l};`, ""), n = () => `--span: ${ve(t.span)};`, i = () => t.offsetStart && t.offsetStart > 0 ? `--offsetStart: ${t.offsetStart};` : "", s = () => t.offsetEnd && t.offsetEnd > 0 ? `--offsetEnd: ${t.offsetEnd};` : "", c = () => [e(), n(), i(), s()].join("; ");
959
+ const e = () => typeof t.style == "string" ? t.style : Object.entries(t.style ?? {}).reduce((r, [o, l]) => r + `${o}:${l};`, ""), n = () => `--span: ${Me(t.span)};`, i = () => t.offsetStart && t.offsetStart > 0 ? `--offsetStart: ${t.offsetStart};` : "", s = () => t.offsetEnd && t.offsetEnd > 0 ? `--offsetEnd: ${t.offsetEnd};` : "", c = () => [e(), n(), i(), s()].join("; ");
891
960
  return h(() => t.as ?? "div", y(m(t, ["as", "span", "offsetStart", "offsetEnd"]), g({
892
961
  style: c,
893
962
  "data-bedrock-column": () => ""
package/lib/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(u,x){typeof exports=="object"&&typeof module<"u"?x(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"],x):(u=typeof globalThis<"u"?globalThis:u||self,x(u.solid={},u.OpenProps,u.solidJs,u.registerResizeCallback))})(this,function(u,x,f,T){"use strict";const p=["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"],J=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...p]),ee=new Set(["innerHTML","textContent","innerText","children"]),te=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ne=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 ie(e,t){const n=ne[e];return typeof n=="object"?n[t]?n.$:void 0:n}const re=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ce=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","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"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function se(e,t,n){let i=n.length,r=t.length,o=i,s=0,c=0,a=t[r-1].nextSibling,l=null;for(;s<r||c<o;){if(t[s]===n[c]){s++,c++;continue}for(;t[r-1]===n[o-1];)r--,o--;if(r===s){const d=o<i?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)e.insertBefore(n[c++],d)}else if(o===c)for(;s<r;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[o-1]&&n[c]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[c++],t[s++].nextSibling),e.insertBefore(n[--o],d),t[r]=n[o]}else{if(!l){l=new Map;let m=c;for(;m<o;)l.set(n[m],m++)}const d=l.get(t[s]);if(d!=null)if(c<d&&d<o){let m=s,C=1,S;for(;++m<r&&m<o&&!((S=l.get(t[m]))==null||S!==d+C);)C++;if(C>d-c){const L=t[s];for(;c<d;)e.insertBefore(n[c++],L)}else e.replaceChild(n[c++],t[s++])}else s++;else t[s++].remove()}}}const W="_$DX_DELEGATE";function R(e,t,n){let i;const r=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},o=t?()=>f.untrack(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return o.cloneNode=o,o}function fe(e,t=window.document){const n=t[W]||(t[W]=new Set);for(let i=0,r=e.length;i<r;i++){const o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,$e))}}function M(e,t,n){f.sharedConfig.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ae(e,t,n,i){f.sharedConfig.context||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function le(e,t){f.sharedConfig.context||(t==null?e.removeAttribute("class"):e.className=t)}function ue(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]=o=>r.call(e,n[1],o))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let o,s;for(o=0,s=r.length;o<s;o++){const c=r[o];!c||c==="undefined"||t[c]||(G(e,c,!1),delete n[c])}for(o=0,s=i.length;o<s;o++){const c=i[o],a=!!t[c];!c||c==="undefined"||n[c]===a||!a||(G(e,c,!0),n[c]=a)}return n}function B(e,t,n){if(!t)return n?M(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,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)r=t[o],r!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}function me(e,t={},n,i){const r={};return i||f.createRenderEffect(()=>r.children=j(e,t.children,r.children)),f.createRenderEffect(()=>t.ref&&t.ref(e)),f.createRenderEffect(()=>ge(e,t,n,!0,r,!0)),r}function ye(e,t,n){return f.untrack(()=>e(t,n))}function D(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return j(e,t,i,n);f.createRenderEffect(r=>j(e,t(),r,n),i)}function ge(e,t,n,i,r={},o=!1){t||(t={});for(const s in r)if(!(s in t)){if(s==="children")continue;r[s]=H(e,s,null,r[s],n,o)}for(const s in t){if(s==="children"){i||j(e,t.children);continue}const c=t[s];r[s]=H(e,s,c,r[s],n,o)}}function he(e){let t,n;return!f.sharedConfig.context||!(t=f.sharedConfig.registry.get(n=Ce()))?e():(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function be(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function G(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,o=i.length;r<o;r++)e.classList.toggle(i[r],n)}function H(e,t,n,i,r,o){let s,c,a,l,d;if(t==="style")return B(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const m=t.slice(3);i&&e.removeEventListener(m,i),n&&e.addEventListener(m,n)}else if(t.slice(0,10)==="oncapture:"){const m=t.slice(10);i&&e.removeEventListener(m,i,!0),n&&e.addEventListener(m,n,!0)}else if(t.slice(0,2)==="on"){const m=t.slice(2).toLowerCase(),C=re.has(m);if(!C&&i){const S=Array.isArray(i)?i[0]:i;e.removeEventListener(m,S)}(C||n)&&(ue(e,m,n,C),C&&fe([m]))}else if(t.slice(0,5)==="attr:")M(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(a=ee.has(t))||!r&&((l=ie(t,e.tagName))||(c=J.has(t)))||(s=e.nodeName.includes("-"))){if(d)t=t.slice(5),c=!0;else if(f.sharedConfig.context)return n;t==="class"||t==="className"?le(e,n):s&&!c&&!a?e[be(t)]=n:e[l||t]=n}else{const m=r&&t.indexOf(":")>-1&&oe[t.split(":")[0]];m?ae(e,m,t,n):M(e,te[t]||t,n)}return n}function $e(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i.call(n,r,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function j(e,t,n,i,r){if(f.sharedConfig.context){!n&&(n=[...e.childNodes]);let c=[];for(let a=0;a<n.length;a++){const l=n[a];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():c.push(l)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=i!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(f.sharedConfig.context)return n;if(o==="number"&&(t=t.toString()),s){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=w(e,n,i,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(f.sharedConfig.context)return n;n=w(e,n,i)}else{if(o==="function")return f.createRenderEffect(()=>{let c=t();for(;typeof c=="function";)c=c();n=j(e,c,n,i)}),()=>n;if(Array.isArray(t)){const c=[],a=n&&Array.isArray(n);if(O(c,t,n,r))return f.createRenderEffect(()=>n=j(e,c,n,i,!0)),()=>n;if(f.sharedConfig.context){if(!c.length)return n;if(i===void 0)return[...e.childNodes];let l=c[0],d=[l];for(;(l=l.nextSibling)!==i;)d.push(l);return n=d}if(c.length===0){if(n=w(e,n,i),s)return n}else a?n.length===0?_(e,c,i):se(e,n,c):(n&&w(e),_(e,c));n=c}else if(t.nodeType){if(f.sharedConfig.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=w(e,n,i,t);w(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function O(e,t,n,i){let r=!1;for(let o=0,s=t.length;o<s;o++){let c=t[o],a=n&&n[o],l;if(!(c==null||c===!0||c===!1))if((l=typeof c)=="object"&&c.nodeType)e.push(c);else if(Array.isArray(c))r=O(e,c,a)||r;else if(l==="function")if(i){for(;typeof c=="function";)c=c();r=O(e,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||r}else e.push(c),r=!0;else{const d=String(c);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return r}function _(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function w(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let o=!1;for(let s=t.length-1;s>=0;s--){const c=t[s];if(r!==c){const a=c.parentNode===e;!o&&!s?a?e.replaceChild(r,c):e.insertBefore(r,n):a&&c.remove()}else o=!0}}else e.insertBefore(r,n);return[r]}function Ce(){const e=f.sharedConfig.context;return`${e.id}${e.count++}`}const Se="http://www.w3.org/2000/svg";function je(e,t=!1){return t?document.createElementNS(Se,e):document.createElement(e)}function we(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 o=ce.has(r),s=f.sharedConfig.context?he():je(r,o);return me(s,n,o),s}})}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 g(e,t){return f.createComponent(we,f.mergeProps({get component(){return e()}},t))}function h(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 F=/^--\D{1}.{0,100}$/;function V(e){return F.test(e)}function I(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}\)$/,F].some(t=>t.test(e))}const{sizeXxs:xe,sizeXs:Ae,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:Oe,sizeContent2:ze,sizeContent3:ve,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le,size000:We,size00:Re,size1:Be,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe}=x,Je={size000:We,size00:Re,size1:Be,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe},et={sizeXxs:xe,sizeXs:Ae,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:Oe,sizeContent2:ze,sizeContent3:ve,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le},X=Je,q=et;function U(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"&&I(t)?V(t)?`var(${t})`:t:A(b(e,t))}function b(e,t){const n=e.space??X,i=U(Object.entries(n).map(([r,o])=>[r,typeof o=="number"?`${o}px`:o]));return A(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&I(t))return V(t)?`var(${t})`:t;const n=e.sizes??q,i=U(Object.entries(n).map(([r,o])=>[r,typeof o=="number"?`${o}px`:o]));return A(i[t])}function tt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),n=()=>`--maxWidth: ${tt(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",o=()=>[i(),r()].filter(Boolean).join(" "),s=()=>[t(),n()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),h({style:s,"data-bedrock-center":o})))}const Q=f.createContext({});function it(e){return f.createComponent(Q.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return f.useContext(Q)}catch{return{}}}function rt(e,t){return P(e,t)}function ct(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${rt(t,e.minItemWidth)}`,o=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",s=()=>[n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),h({style:s,"data-bedrock-column-drop":o})))}function ot(e,t){const[n,i]=f.createSignal(!1),[r,o]=f.createSignal();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{if(A(r())===void 0)return 0;t&&t(r());const s=T.registerCallback(r(),c=>{var l;const a=((l=c.borderBoxSize)==null?void 0:l.inlineSize)??c.contentRect.width;if(a>0){const d=a<=e;i(d)}return 0});return f.onCleanup(s),0}),[n,o]}function st(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 ft(e){return Array.isArray(e)?e.join("/"):e}function at(e){return st(e)?ft(e):void 0}function lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),n=()=>at(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",o=()=>[t(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","ratio","position"]),h({style:o,"data-bedrock-frame":()=>""})))}function Y(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,o=()=>[n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth"]),h({style:o,"data-bedrock-grid":()=>""})))}const E=96;function Z(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function v(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 ut(i,n);case"em":return k(n,"font-size");case"rem":return k(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,o]=Z(i);if(isNaN(r))return;if(!o)return r;const s=v(o,t);return typeof s=="number"?r*s:void 0}}}function k(e,t){const[n,i]=Z(getComputedStyle(e).getPropertyValue(t));return n*(v(i,e)??1)}function ut(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=k(n,"height")/128;return t.removeChild(n),i}var dt=R("<div>");const N=1,mt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,yt=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),o=$();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{const s=A(i());if(s===void 0)return;const c=T.registerCallback(s,({target:a})=>{n(1);const l=e.gutter?b(o,e.gutter)??"1px":"1px",d=mt?v(l,a):void 0,m=Math.max(d??N,N),[C]=Array.from(a.children),S=1+Math.min(a.scrollHeight,C.scrollHeight),L=Math.max(Math.ceil(S/m),N);return n(L),0});return f.onCleanup(c),0}),(()=>{var s=dt();return ye(r,s),D(s,()=>e.children),f.createRenderEffect(c=>B(s,`grid-row: span ${t()};`,c)),s})()},gt=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(yt,{get gutter(){return e.gutter},children:r}));return f.createComponent(Y,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},ht={start:"justify:start",end:"justify:end",center:"justify:center"},bt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function $t(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>e.justify!==void 0?ht[e.justify]:void 0,o=()=>e.align!==void 0?bt[e.align]:void 0,s=()=>[n(),i()].join("; "),c=()=>[r(),o()].filter(Boolean).join(" ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align"]),h({style:s,"data-bedrock-inline-cluster":c})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center"},St={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((m,[C,S])=>m+`${C}:${S};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>e.justify!==void 0?Ct[e.justify]:void 0,c=()=>e.align!==void 0?St[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),o(),r()].join("; "),d=()=>[s(),c(),a()].filter(Boolean).join(" ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),h({style:l,"data-bedrock-inline":d})))}const wt=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,o])=>({...i,[wt(r)]:z(e,o)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>z(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,o])=>i+`${r}:${o};`,"")};function At(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,c])=>o+`${s}:${c};`,""),i=()=>xt(t,e.padding),r=()=>[n(),i()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","padding"]),h({style:r,"data-bedrock-padbox":()=>""})))}function Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),i=()=>`--gutter: ${b(t,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"}},o=()=>[n(),i()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:o,"data-bedrock-reel":r})))}const K={"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 Et(e){const t=$(),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: ${b(t,e.gutter??"size00")??"0px"};`,o=()=>K[e.fraction??"1/2"]??K["1/2"],s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>[n(),r(),i(),s()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","fraction"]),h({style:c,"data-bedrock-split":o})))}function Tt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,c])=>o+`${s}:${c};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>[n(),i()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:r,"data-bedrock-stack":()=>""})))}var It=R("<div data-bedrock-cover-centered>");function Mt(e){return typeof e=="number"?`${e}px`:e&&I(e)?e:"100vh"}function Ot(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--minHeight: ${Mt(e.minHeight)};`,o=()=>e.stretchContent===!0?"stretch-content":"",s=()=>[n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","minHeight","stretchContent"]),h({style:s,"data-bedrock-cover":o})))}function zt(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(Ot,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{var i=It();return D(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function vt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,o=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>[n(),i(),r(),o()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","columns","switchAt"]),h({style:s,"data-bedrock-columns":()=>""})))}const kt=e=>typeof e=="number"?e:1;function Nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),n=()=>`--span: ${kt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",o=()=>[t(),n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),h({style:o,"data-bedrock-column":()=>""})))}u.Center=nt,u.Column=Nt,u.ColumnDrop=ct,u.Columns=vt,u.Cover=zt,u.Frame=lt,u.Grid=Y,u.Inline=jt,u.InlineCluster=$t,u.MasonryGrid=gt,u.PadBox=At,u.Reel=Pt,u.Split=Et,u.Stack=Tt,u.ThemeProvider=it,u.checkIsCSSLength=I,u.createContainerQuery=ot,u.getSafeGutter=z,u.getSizeValue=P,u.getSpacingValue=b,u.sizes=q,u.spacing=X,u.useTheme=$,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
1
+ (function(u,x){typeof exports=="object"&&typeof module<"u"?x(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"],x):(u=typeof globalThis<"u"?globalThis:u||self,x(u.solid={},u.OpenProps,u.solidJs,u.registerResizeCallback))})(this,function(u,x,f,T){"use strict";const p=["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"],J=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...p]),ee=new Set(["innerHTML","textContent","innerText","children"]),te=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),ne=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 ie(e,t){const n=ne[e];return typeof n=="object"?n[t]?n.$:void 0:n}const re=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ce=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","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"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function se(e,t,n){let i=n.length,r=t.length,o=i,s=0,c=0,a=t[r-1].nextSibling,l=null;for(;s<r||c<o;){if(t[s]===n[c]){s++,c++;continue}for(;t[r-1]===n[o-1];)r--,o--;if(r===s){const d=o<i?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)e.insertBefore(n[c++],d)}else if(o===c)for(;s<r;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[o-1]&&n[c]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[c++],t[s++].nextSibling),e.insertBefore(n[--o],d),t[r]=n[o]}else{if(!l){l=new Map;let m=c;for(;m<o;)l.set(n[m],m++)}const d=l.get(t[s]);if(d!=null)if(c<d&&d<o){let m=s,C=1,S;for(;++m<r&&m<o&&!((S=l.get(t[m]))==null||S!==d+C);)C++;if(C>d-c){const L=t[s];for(;c<d;)e.insertBefore(n[c++],L)}else e.replaceChild(n[c++],t[s++])}else s++;else t[s++].remove()}}}const W="_$DX_DELEGATE";function R(e,t,n){let i;const r=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},o=t?()=>f.untrack(()=>document.importNode(i||(i=r()),!0)):()=>(i||(i=r())).cloneNode(!0);return o.cloneNode=o,o}function fe(e,t=window.document){const n=t[W]||(t[W]=new Set);for(let i=0,r=e.length;i<r;i++){const o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,$e))}}function M(e,t,n){f.sharedConfig.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ae(e,t,n,i){f.sharedConfig.context||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function le(e,t){f.sharedConfig.context||(t==null?e.removeAttribute("class"):e.className=t)}function ue(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]=o=>r.call(e,n[1],o))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let o,s;for(o=0,s=r.length;o<s;o++){const c=r[o];!c||c==="undefined"||t[c]||(G(e,c,!1),delete n[c])}for(o=0,s=i.length;o<s;o++){const c=i[o],a=!!t[c];!c||c==="undefined"||n[c]===a||!a||(G(e,c,!0),n[c]=a)}return n}function B(e,t,n){if(!t)return n?M(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,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)r=t[o],r!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}function me(e,t={},n,i){const r={};return i||f.createRenderEffect(()=>r.children=j(e,t.children,r.children)),f.createRenderEffect(()=>t.ref&&t.ref(e)),f.createRenderEffect(()=>ge(e,t,n,!0,r,!0)),r}function ye(e,t,n){return f.untrack(()=>e(t,n))}function D(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return j(e,t,i,n);f.createRenderEffect(r=>j(e,t(),r,n),i)}function ge(e,t,n,i,r={},o=!1){t||(t={});for(const s in r)if(!(s in t)){if(s==="children")continue;r[s]=H(e,s,null,r[s],n,o)}for(const s in t){if(s==="children"){i||j(e,t.children);continue}const c=t[s];r[s]=H(e,s,c,r[s],n,o)}}function he(e){let t,n;return!f.sharedConfig.context||!(t=f.sharedConfig.registry.get(n=Ce()))?e():(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function be(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function G(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,o=i.length;r<o;r++)e.classList.toggle(i[r],n)}function H(e,t,n,i,r,o){let s,c,a,l,d;if(t==="style")return B(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const m=t.slice(3);i&&e.removeEventListener(m,i),n&&e.addEventListener(m,n)}else if(t.slice(0,10)==="oncapture:"){const m=t.slice(10);i&&e.removeEventListener(m,i,!0),n&&e.addEventListener(m,n,!0)}else if(t.slice(0,2)==="on"){const m=t.slice(2).toLowerCase(),C=re.has(m);if(!C&&i){const S=Array.isArray(i)?i[0]:i;e.removeEventListener(m,S)}(C||n)&&(ue(e,m,n,C),C&&fe([m]))}else if(t.slice(0,5)==="attr:")M(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(a=ee.has(t))||!r&&((l=ie(t,e.tagName))||(c=J.has(t)))||(s=e.nodeName.includes("-"))){if(d)t=t.slice(5),c=!0;else if(f.sharedConfig.context)return n;t==="class"||t==="className"?le(e,n):s&&!c&&!a?e[be(t)]=n:e[l||t]=n}else{const m=r&&t.indexOf(":")>-1&&oe[t.split(":")[0]];m?ae(e,m,t,n):M(e,te[t]||t,n)}return n}function $e(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=_$HY.done=!0);n;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i.call(n,r,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function j(e,t,n,i,r){if(f.sharedConfig.context){!n&&(n=[...e.childNodes]);let c=[];for(let a=0;a<n.length;a++){const l=n[a];l.nodeType===8&&l.data.slice(0,2)==="!$"?l.remove():c.push(l)}n=c}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=i!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(f.sharedConfig.context)return n;if(o==="number"&&(t=t.toString()),s){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=w(e,n,i,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(f.sharedConfig.context)return n;n=w(e,n,i)}else{if(o==="function")return f.createRenderEffect(()=>{let c=t();for(;typeof c=="function";)c=c();n=j(e,c,n,i)}),()=>n;if(Array.isArray(t)){const c=[],a=n&&Array.isArray(n);if(v(c,t,n,r))return f.createRenderEffect(()=>n=j(e,c,n,i,!0)),()=>n;if(f.sharedConfig.context){if(!c.length)return n;if(i===void 0)return[...e.childNodes];let l=c[0],d=[l];for(;(l=l.nextSibling)!==i;)d.push(l);return n=d}if(c.length===0){if(n=w(e,n,i),s)return n}else a?n.length===0?_(e,c,i):se(e,n,c):(n&&w(e),_(e,c));n=c}else if(t.nodeType){if(f.sharedConfig.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=w(e,n,i,t);w(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function v(e,t,n,i){let r=!1;for(let o=0,s=t.length;o<s;o++){let c=t[o],a=n&&n[e.length],l;if(!(c==null||c===!0||c===!1))if((l=typeof c)=="object"&&c.nodeType)e.push(c);else if(Array.isArray(c))r=v(e,c,a)||r;else if(l==="function")if(i){for(;typeof c=="function";)c=c();r=v(e,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||r}else e.push(c),r=!0;else{const d=String(c);a&&a.nodeType===3&&a.data===d?e.push(a):e.push(document.createTextNode(d))}}return r}function _(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function w(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let o=!1;for(let s=t.length-1;s>=0;s--){const c=t[s];if(r!==c){const a=c.parentNode===e;!o&&!s?a?e.replaceChild(r,c):e.insertBefore(r,n):a&&c.remove()}else o=!0}}else e.insertBefore(r,n);return[r]}function Ce(){const e=f.sharedConfig.context;return`${e.id}${e.count++}`}const Se="http://www.w3.org/2000/svg";function je(e,t=!1){return t?document.createElementNS(Se,e):document.createElement(e)}function we(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 o=ce.has(r),s=f.sharedConfig.context?he():je(r,o);return me(s,n,o),s}})}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 g(e,t){return f.createComponent(we,f.mergeProps({get component(){return e()}},t))}function h(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 F=/^--\D{1}.{0,100}$/;function V(e){return F.test(e)}function I(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}\)$/,F].some(t=>t.test(e))}const{sizeXxs:xe,sizeXs:Ae,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:ve,sizeContent2:Oe,sizeContent3:ze,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le,size000:We,size00:Re,size1:Be,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe}=x,Je={size000:We,size00:Re,size1:Be,size2:De,size3:Ge,size4:He,size5:_e,size6:Fe,size7:Ve,size8:Xe,size9:qe,size10:Ue,size11:Qe,size12:Ye,size13:Ze,size14:Ke,size15:pe},et={sizeXxs:xe,sizeXs:Ae,sizeSm:Pe,sizeMd:Ee,sizeLg:Te,sizeXl:Ie,sizeXxl:Me,sizeContent1:ve,sizeContent2:Oe,sizeContent3:ze,sizeHeader1:ke,sizeHeader2:Ne,sizeHeader3:Le},X=Je,q=et;function U(e){return e.reduce((t,[n,i])=>({...t,[n]:i}),{})}function O(e,t){if(t!==void 0)return typeof t=="number"&&t>=0?`${t}px`:typeof t=="string"&&I(t)?V(t)?`var(${t})`:t:A(b(e,t))}function b(e,t){const n=e.space??X,i=U(Object.entries(n).map(([r,o])=>[r,typeof o=="number"?`${o}px`:o]));return A(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&I(t))return V(t)?`var(${t})`:t;const n=e.sizes??q,i=U(Object.entries(n).map(([r,o])=>[r,typeof o=="number"?`${o}px`:o]));return A(i[t])}function tt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),n=()=>`--maxWidth: ${tt(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",o=()=>[i(),r()].filter(Boolean).join(" "),s=()=>[t(),n()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),h({style:s,"data-bedrock-center":o})))}const Q=f.createContext({});function it(e){return f.createComponent(Q.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return f.useContext(Q)}catch{return{}}}function rt(e,t){return P(e,t)}function ct(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${rt(t,e.minItemWidth)}`,o=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",s=()=>[n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),h({style:s,"data-bedrock-column-drop":o})))}function ot(e,t){const[n,i]=f.createSignal(!1),[r,o]=f.createSignal();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{if(A(r())===void 0)return 0;t&&t(r());const s=T.registerCallback(r(),c=>{var l;const a=((l=c.borderBoxSize)==null?void 0:l.inlineSize)??c.contentRect.width;if(a>0){const d=a<=e;i(d)}return 0});return f.onCleanup(s),0}),[n,o]}function st(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 ft(e){return Array.isArray(e)?e.join("/"):e}function at(e){return st(e)?ft(e):void 0}function lt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),n=()=>at(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",o=()=>[t(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","ratio","position"]),h({style:o,"data-bedrock-frame":()=>""})))}function Y(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,o=()=>[n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth"]),h({style:o,"data-bedrock-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const E=96;function Z(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function z(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 ut(i,n);case"em":return k(n,"font-size");case"rem":return k(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,o]=Z(i);if(isNaN(r))return;if(!o)return r;const s=z(o,t);return typeof s=="number"?r*s:void 0}}}function k(e,t){const[n,i]=Z(getComputedStyle(e).getPropertyValue(t));return n*(z(i,e)??1)}function ut(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=k(n,"height")/128;return t.removeChild(n),i}var dt=R("<div>");const N=1,mt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,yt=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),o=$();return f.onMount(()=>(T.init(),0)),f.createEffect(()=>{const s=A(i());if(s===void 0)return;const c=T.registerCallback(s,({target:a})=>{n(1);const l=e.gutter?b(o,e.gutter)??"1px":"1px",d=mt?z(l,a):void 0,m=Math.max(d??N,N),[C]=Array.from(a.children),S=1+Math.min(a.scrollHeight,C.scrollHeight),L=Math.max(Math.ceil(S/m),N);return n(L),0});return f.onCleanup(c),0}),(()=>{var s=dt();return ye(r,s),D(s,()=>e.children),f.createRenderEffect(c=>B(s,`grid-row: span ${t()};`,c)),s})()},gt=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(yt,{get gutter(){return e.gutter},children:r}));return f.createComponent(Y,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},ht={start:"justify:start",end:"justify:end",center:"justify:center"},bt={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function $t(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>e.justify!==void 0?ht[e.justify]:void 0,o=()=>e.align!==void 0?bt[e.align]:void 0,s=()=>[n(),i()].join("; "),c=()=>[r(),o()].filter(Boolean).join(" ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align"]),h({style:s,"data-bedrock-inline-cluster":c})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center"},St={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function jt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((m,[C,S])=>m+`${C}:${S};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>e.justify!==void 0?Ct[e.justify]:void 0,c=()=>e.align!==void 0?St[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),o(),r()].join("; "),d=()=>[s(),c(),a()].filter(Boolean).join(" ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),h({style:l,"data-bedrock-inline":d})))}const wt=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,o])=>({...i,[wt(r)]:O(e,o)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>O(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,o])=>i+`${r}:${o};`,"")};function At(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,c])=>o+`${s}:${c};`,""),i=()=>xt(t,e.padding),r=()=>[n(),i()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","padding"]),h({style:r,"data-bedrock-padbox":()=>""})))}function Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),i=()=>`--gutter: ${b(t,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"}},o=()=>[n(),i()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:o,"data-bedrock-reel":r})))}const K={"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 Et(e){const t=$(),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: ${b(t,e.gutter??"size00")??"0px"};`,o=()=>K[e.fraction??"1/2"]??K["1/2"],s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>[n(),r(),i(),s()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","fraction"]),h({style:c,"data-bedrock-split":o})))}function Tt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,c])=>o+`${s}:${c};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>[n(),i()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),h({style:r,"data-bedrock-stack":()=>""})))}var It=R("<div data-bedrock-cover-centered>");function Mt(e){return typeof e=="number"?`${e}px`:e&&I(e)?e:"100vh"}function vt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--minHeight: ${Mt(e.minHeight)};`,o=()=>e.stretchContent===!0?"stretch-content":"",s=()=>[n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","minHeight","stretchContent"]),h({style:s,"data-bedrock-cover":o})))}function Ot(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(vt,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{var i=It();return D(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function zt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,o=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>[n(),i(),r(),o()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","columns","switchAt"]),h({style:s,"data-bedrock-columns":()=>""})))}const kt=e=>typeof e=="number"?e:1;function Nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),n=()=>`--span: ${kt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",o=()=>[t(),n(),i(),r()].join("; ");return g(()=>e.as??"div",f.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),h({style:o,"data-bedrock-column":()=>""})))}u.Center=nt,u.Column=Nt,u.ColumnDrop=ct,u.Columns=zt,u.Cover=Ot,u.Frame=lt,u.Grid=Y,u.Inline=jt,u.InlineCluster=$t,u.MasonryGrid=gt,u.PadBox=At,u.Reel=Pt,u.Split=Et,u.Stack=Tt,u.ThemeProvider=it,u.checkIsCSSLength=I,u.createContainerQuery=ot,u.getSafeGutter=O,u.getSizeValue=P,u.getSpacingValue=b,u.sizes=q,u.spacing=X,u.useTheme=$,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
@@ -1,3 +1,6 @@
1
1
  import { Component } from "solid-js";
2
2
  import { GridProps } from "./grid";
3
+ /**
4
+ * @deprecated Use the `Grid` component with the `variant` prop set to "masonry" instead.
5
+ */
3
6
  export declare const MasonryGrid: Component<GridProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock-layout/solid",
3
- "version": "1.1.12",
3
+ "version": "1.2.0",
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,5 +71,5 @@
71
71
  "bugs": {
72
72
  "url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
73
73
  },
74
- "gitHead": "5101f782e82614ab75c6ad3ad7d7bb01f1726636"
74
+ "gitHead": "a5b48830325ca9dcef72e231f4d2e9eee7b6bee8"
75
75
  }