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