@bedrock-layout/solid 1.7.5 → 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 CHANGED
@@ -10,14 +10,14 @@ Full docs at: [solid.bedrock-layout.dev](https://solid.bedrock-layout.dev/)
10
10
 
11
11
  or
12
12
 
13
- `yarn add @bedrock-laylock/solid`
13
+ `yarn add @bedrock-layout/solid`
14
14
 
15
15
  ---
16
16
 
17
17
  ## Usage
18
18
 
19
19
  ```javascript
20
- import { Stack, Inline, Split, Cover, Frame } from '@bedrock-layout/solid';
20
+ import { Stack, Inline, Split, Cover, Frame } from "@bedrock-layout/solid";
21
21
 
22
22
  export function Hero() {
23
23
  return (
package/lib/center.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  import { JSX } from "solid-js";
2
- import { CSSLength } from "./spacing-constants";
2
+ import type { CSSLength, SizesOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
- type MaxWidth = number | CSSLength;
4
+ type MaxWidth = number | CSSLength | SizesOptions;
5
5
  export interface CenterBaseProps {
6
6
  maxWidth?: MaxWidth;
7
- centerText?: boolean;
8
- centerChildren?: boolean;
9
7
  }
10
8
  export type CenterProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, CenterBaseProps>;
11
9
  export declare function Center<T extends ValidConstructor = "div">(props: Readonly<CenterProps<T>>): JSX.Element;
@@ -1,15 +1,11 @@
1
1
  import { JSX } from "solid-js";
2
- import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
2
+ import { CSSLength, SizesOptions, SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
5
5
  export interface ColumnDropBaseProps {
6
- /**
7
- * @deprecated Use `gap` instead
8
- */
9
- gutter?: SpacingOptions;
10
6
  gap?: SpacingOptions;
11
7
  minItemWidth?: MinItemWidth;
12
- noStretchedColumns?: boolean;
8
+ variant?: "default" | "centered";
13
9
  }
14
10
  export type ColumnDropProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, ColumnDropBaseProps>;
15
11
  export declare function ColumnDrop<T extends ValidConstructor = "div">(props: Readonly<ColumnDropProps<T>>): JSX.Element;
package/lib/columns.d.ts CHANGED
@@ -1,16 +1,8 @@
1
1
  import { JSX } from "solid-js";
2
- import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
2
+ import { CSSLength, SizesOptions, Gutter } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  interface ColumnsBaseProps {
5
- /**
6
- * @deprecated Use `gap` instead
7
- */
8
- gutter?: SpacingOptions;
9
- gap?: SpacingOptions;
10
- /**
11
- * @deprecated Use `colCount` instead.
12
- */
13
- columns?: number;
5
+ gap?: Gutter;
14
6
  colCount?: number;
15
7
  switchAt?: number | CSSLength | SizesOptions;
16
8
  }
package/lib/cover.d.ts CHANGED
@@ -1,26 +1,22 @@
1
1
  import { JSX, JSXElement } from "solid-js";
2
- import { CSSLength, SpacingOptions } from "./spacing-constants";
2
+ import { CSSLength, SizesOptions, SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
- type MinHeight = CSSLength | number;
4
+ type MinHeight = CSSLength | number | SizesOptions;
5
5
  interface CoverWrapperBaseProps {
6
- /**
7
- * @deprecated Use `gap` instead
8
- */
9
- gutter?: SpacingOptions;
10
6
  gap?: SpacingOptions;
11
7
  minHeight?: MinHeight;
12
- /**
13
- * Sets the content to stretch to the full height of the cover component minus the top and bottom slots.
14
- * @deprecated Use `variant` set to `stretch-content` instead.
15
- */
16
- stretchContent?: boolean;
17
8
  variant?: "default" | "stretch-content";
18
9
  }
19
10
  export type CoverWrapperProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, CoverWrapperBaseProps>;
11
+ /**
12
+ * The `CoverCentered` component is used to mark the centered child in a Cover layout.
13
+ */
14
+ export declare function CoverCentered<T extends ValidConstructor = "div">(props: Readonly<HeadlessPropsWithRef<T>>): JSX.Element;
20
15
  export interface CoverProps {
21
- top?: JSXElement;
22
- bottom?: JSXElement;
23
16
  children?: JSXElement;
24
17
  }
18
+ /**
19
+ * The `Cover` component is designed to vertically cover a predefined area, `100%` by default, and vertically center its children.
20
+ */
25
21
  export declare function Cover<T extends ValidConstructor = "div">(props: Readonly<CoverWrapperProps<T> & CoverProps>): JSX.Element;
26
22
  export {};
package/lib/grid.d.ts CHANGED
@@ -1,12 +1,8 @@
1
1
  import { JSX } from "solid-js";
2
- import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
2
+ import { CSSLength, SizesOptions, SpacingOptions } from "@bedrock-layout/spacing-constants";
3
3
  import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
4
4
  type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
5
5
  export type GridBaseProps = {
6
- /**
7
- * @deprecated Use `gap` instead
8
- */
9
- gutter?: SpacingOptions;
10
6
  gap?: SpacingOptions;
11
7
  minItemWidth?: MinItemWidth;
12
8
  variant?: "grid" | "masonry";
package/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("open-props"),l=require("solid-js"),I=require("@bedrock-layout/register-resize-callback"),ee=["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"],te=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...ee]),ne=new Set(["innerHTML","textContent","innerText","children"]),ie=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),se=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function re(e,t){const n=se[e];return typeof n=="object"?n[t]?n.$:void 0:n}const oe=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","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"},N=e=>l.createMemo(()=>e());function le(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 u=r<i?o?n[o-1].nextSibling:n[r-o]:a;for(;o<r;)e.insertBefore(n[o++],u)}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 u=t[--s].nextSibling;e.insertBefore(n[o++],t[c++].nextSibling),e.insertBefore(n[--r],u),t[s]=n[r]}else{if(!f){f=new Map;let g=o;for(;g<r;)f.set(n[g],g++)}const u=f.get(t[c]);if(u!=null)if(o<u&&u<r){let g=c,d=1,C;for(;++g<s&&g<r&&!((C=f.get(t[g]))==null||C!==u+d);)d++;if(d>u-o){const A=t[c];for(;o<u;)e.insertBefore(n[o++],A)}else e.replaceChild(n[o++],t[c++])}else c++;else t[c++].remove()}}}const L="_$DX_DELEGATE";function F(e,t,n,i){let s;const r=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},c=t?()=>l.untrack(()=>document.importNode(s||(s=r()),!0)):()=>(s||(s=r())).cloneNode(!0);return c.cloneNode=c,c}function fe(e,t=window.document){const n=t[L]||(t[L]=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,we))}}function O(e,t,n){w(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function ue(e,t,n,i){w(e)||(i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i))}function de(e,t,n){w(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function ge(e,t){w(e)||(t==null?e.removeAttribute("class"):e.className=t)}function he(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,typeof n!="function"&&n)}function me(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]||(D(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||(D(e,o,!0),n[o]=a)}return n}function V(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 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 ye(e,t={},n,i){const s={};return l.createRenderEffect(()=>s.children=j(e,t.children,s.children)),l.createRenderEffect(()=>typeof t.ref=="function"&&H(t.ref,e)),l.createRenderEffect(()=>be(e,t,n,!0,s,!0)),s}function H(e,t,n){return l.untrack(()=>e(t,n))}function _(e,t,n,i){if(typeof t!="function")return j(e,t,i,n);l.createRenderEffect(s=>j(e,t(),s,n),i)}function be(e,t,n,i,s={},r=!1){t||(t={});for(const c in s)if(!(c in t)){if(c==="children")continue;s[c]=W(e,c,null,s[c],n,r,t)}for(const c in t){if(c==="children")continue;const o=t[c];s[c]=W(e,c,o,s[c],n,r,t)}}function $e(e){let t,n;return!w()||!(t=l.sharedConfig.registry.get(n=Se()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function w(e){return!!l.sharedConfig.context&&!l.sharedConfig.done&&(!e||e.isConnected)}function Ce(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function D(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 W(e,t,n,i,s,r,c){let o,a,f,u,g;if(t==="style")return V(e,n,i);if(t==="classList")return me(e,n,i);if(n===i)return i;if(t==="ref")r||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);i&&e.removeEventListener(d,i,typeof i!="function"&&i),n&&e.addEventListener(d,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);i&&e.removeEventListener(d,i,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),C=oe.has(d);if(!C&&i){const A=Array.isArray(i)?i[0]:i;e.removeEventListener(d,A)}(C||n)&&(he(e,d,n,C),C&&fe([d]))}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((g=t.slice(0,5)==="prop:")||(f=ne.has(t))||!s&&((u=re(t,e.tagName))||(a=te.has(t)))||(o=e.nodeName.includes("-")||"is"in c)){if(g)t=t.slice(5),a=!0;else if(w(e))return n;t==="class"||t==="className"?ge(e,n):o&&!a&&!f?e[Ce(t)]=n:e[u||t]=n}else{const d=s&&t.indexOf(":")>-1&&ae[t.split(":")[0]];d?ue(e,d,t,n):O(e,ie[t]||t,n)}return n}function we(e){if(l.sharedConfig.registry&&l.sharedConfig.events&&l.sharedConfig.events.find(([a,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,i=e.target,s=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},o=()=>{for(;c()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();r(a[0]);for(let f=0;f<a.length-2&&(t=a[f],!!c());f++){if(t._$host){t=t._$host,o();break}if(t.parentNode===s)break}}else o();r(i)}function j(e,t,n,i,s){const r=w(e);if(r){!n&&(n=[...e.childNodes]);let o=[];for(let a=0;a<n.length;a++){const f=n[a];f.nodeType===8&&f.data.slice(0,2)==="!$"?f.remove():o.push(f)}n=o}for(;typeof n=="function";)n=n();if(t===n)return n;const c=typeof t;if(e=e,c==="string"||c==="number"){if(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=E(e,n,i)}else{if(c==="function")return l.createRenderEffect(()=>{let o=t();for(;typeof o=="function";)o=o();n=j(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=j(e,o,n,i,!0)),()=>n;if(r)return o.length?n=[...e.childNodes]:n;o.length===0?n=E(e,n,i):a?n.length===0?B(e,o,i):le(e,n,o):(n&&E(e),B(e,o)),n=o}else if(t.nodeType){if(r&&t.parentNode)return n=t;Array.isArray(n)?E(e,n,null,t):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 u=String(o);a&&a.nodeType===3&&a.data===u?e.push(a):e.push(document.createTextNode(u))}}return s}function B(e,t,n=null){for(let i=0,s=t.length;i<s;i++)e.insertBefore(t[i],n)}function E(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 Se(){return l.sharedConfig.getNextContextId()}const Ae="http://www.w3.org/2000/svg";function xe(e,t=!1,n=void 0){return t?document.createElementNS(Ae,e):document.createElement(e,{is:n})}function je(e,t){const n=l.createMemo(e);return l.createMemo(()=>{const i=n();switch(typeof i){case"function":return l.untrack(()=>i(t));case"string":const s=ce.has(i),r=l.sharedConfig.context?$e():xe(i,s,l.untrack(()=>t.is));return ye(r,t,s),r}})}function Pe(e){const[,t]=l.splitProps(e,["component"]);return je(()=>e.component,t)}function S(e){return e??void 0}function h(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>Object.defineProperty({...n},i,{get(){return e[i]},configurable:!0,enumerable:!0}),{})}function m(e,t){return l.createComponent(Pe,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 U=/^--\D{1}.{0,100}$/;function X(e){return U.test(e)}function M(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,U].some(t=>t.test(e))}const{sizeXxs:Ee,sizeXs:Ie,sizeSm:Me,sizeMd:Te,sizeLg:Oe,sizeXl:ve,sizeXxl:ze,sizeContent1:ke,sizeContent2:Re,sizeContent3:Ne,sizeHeader1:Le,sizeHeader2:De,sizeHeader3:We,size000:Be,size00:Ge,size1:Fe,size2:Ve,size3:He,size4:_e,size5:Ue,size6:Xe,size7:qe,size8:Qe,size9:Je,size10:Ye,size11:Ze,size12:Ke,size13:pe,size14:et,size15:tt}=p,nt={size000:Be,size00:Ge,size1:Fe,size2:Ve,size3:He,size4:_e,size5:Ue,size6:Xe,size7:qe,size8:Qe,size9:Je,size10:Ye,size11:Ze,size12:Ke,size13:pe,size14:et,size15:tt},it={sizeXxs:Ee,sizeXs:Ie,sizeSm:Me,sizeMd:Te,sizeLg:Oe,sizeXl:ve,sizeXxl:ze,sizeContent1:ke,sizeContent2:Re,sizeContent3:Ne,sizeHeader1:Le,sizeHeader2:De,sizeHeader3:We},q=nt,Q=it;function J(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"&&M(t)?X(t)?`var(${t})`:t:S(b(e,t))}function b(e,t){const n=e.space??q,i=J(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return S(i[t])}function P(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&M(t))return X(t)?`var(${t})`:t;const n=e.sizes??Q,i=J(Object.entries(n).map(([s,r])=>[s,typeof r=="number"?`${r}px`:r]));return S(i[t])}function st(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function rt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,f])=>o+`${a}:${f};`,""),n=()=>`--maxWidth: ${st(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",s=()=>e.centerChildren?"center-children":"",r=()=>[i(),s()].filter(Boolean).join(" "),c=()=>[t(),n()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","maxWidth","centerText","centerChildren"]),y({style:c,"data-br-center":r})))}const Y=l.createContext({});function ot(e){return l.createComponent(Y.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return l.useContext(Y)}catch{return{}}}function ct(e,t){return P(e,t)}function at(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.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${ct(t,e.minItemWidth)}`,r=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",c=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","minItemWidth","noStretchedColumns"]),y({style:c,"data-br-column-drop":r})))}function lt(e,t){const[n,i]=l.createSignal(!1),[s,r]=l.createSignal();return l.onMount(()=>{I.init()}),l.createEffect(()=>{if(S(s())===void 0)return;t&&t(s());const c=I.registerCallback(s(),o=>{var f;const a=((f=o.borderBoxSize)==null?void 0:f.inlineSize)??o.contentRect.width;if(a>0){const u=a<=e;i(u)}});l.onCleanup(c)}),[n,r]}function ft(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(e)}function ut(e){return Array.isArray(e)?e.join("/"):e}function dt(e){return ft(e)?ut(e):void 0}function gt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>dt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",s=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",r=()=>[t(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","ratio","position"]),y({style:r,"data-br-frame":()=>""})))}function Z(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.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,r=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","minItemWidth"]),y({style:r,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const x=96;function K(e){const t=String(e),n=parseFloat(t),[,i]=t.match(/[\d.\-+]*\s*(.*)/)??["",""];return[n,i]}function R(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 ht(i,n);case"em":return k(n,"font-size");case"rem":return k(document.body,"font-size");case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6;case"px":return 1;default:{const[s,r]=K(i);if(isNaN(s))return;if(!r)return s;const c=R(r,t);return typeof c=="number"?s*c:void 0}}}function k(e,t){const[n,i]=K(getComputedStyle(e).getPropertyValue(t));return n*(R(i,e)??1)}function ht(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 mt=F("<div>");const T=1,yt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,bt=e=>{const[t,n]=l.createSignal(1),[i,s]=l.createSignal(),r=$();return l.onMount(()=>(I.init(),0)),l.createEffect(()=>{const c=S(i());if(c===void 0)return;const o=I.registerCallback(c,({target:a})=>{n(1);const f=e.gutter?b(r,e.gutter)??"1px":"1px",u=yt?R(f,a):void 0,g=Math.max(u??T,T),[d]=Array.from(a.children),C=1+Math.min(a.scrollHeight,d.scrollHeight),A=Math.max(Math.ceil(C/g),T);return n(A),0});return l.onCleanup(o),0}),(()=>{var c=mt();return H(s,c),_(c,()=>e.children),l.createRenderEffect(o=>V(c,`grid-row: span ${t()};`,o)),c})()},$t=e=>{const t=l.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(s=>l.createComponent(bt,{get gutter(){return e.gutter},children:s}));return l.createComponent(Z,l.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},Ct={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},wt={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((a,[f,u])=>a+`${f}:${u};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.justify!==void 0?Ct[e.justify]:void 0,r=()=>e.align!==void 0?wt[e.align]:void 0,c=()=>[n(),i()].join("; "),o=()=>[s(),r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","justify","align"]),y({style:c,"data-br-inline-cluster":o})))}const At={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},xt={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((g,[d,C])=>g+`${d}:${C};`,""),i=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,r=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",c=()=>e.justify!==void 0?At[e.justify]:void 0,o=()=>e.align!==void 0?xt[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),i(),r(),s()].join("; "),u=()=>[c(),o(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","justify","align","stretch","switchAt"]),y({style:f,"data-br-inline":u})))}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,[s,r])=>({...i,[Pt(s)]:z(e,r)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>z(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[s,r])=>i+`${s}:${r};`,"")};function It(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((r,[c,o])=>r+`${c}:${o};`,""),i=()=>Et(t,e.padding),s=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","padding"]),y({style:s,"data-br-padbox":()=>""})))}function Mt(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.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"}},r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter"]),y({style:r,"data-br-reel":s})))}const G={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function Tt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[f,u])=>a+`${f}:${u};`,""),i=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",s=()=>`--gutter: ${b(t,e.gap??e.gutter??"size00")??"0px"}`,r=()=>G[e.fraction??"1/2"]??G["1/2"],c=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>[n(),s(),i(),c()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","fraction"]),y({style:o,"data-br-split":r})))}const Ot={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function vt(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.gap??e.gutter??"size00")??"0px"}`,s=()=>[n(),i()].join("; "),r=()=>e.align!==void 0?Ot[e.align]:void 0,c=()=>[r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter"]),y({style:s,"data-br-stack":c})))}var zt=F("<div data-br-cover-centered>");function kt(e){return typeof e=="number"?`${e}px`:e&&M(e)?e:"100vh"}function Rt(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.gap??e.gutter??"size00")??"0px"}`,s=()=>`--minHeight: ${kt(e.minHeight)};`,r=()=>e.variant==="stretch-content"||e.stretchContent===!0?"stretch-content":"",c=()=>[n(),i(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","minHeight","stretchContent"]),y({style:c,"data-br-cover":r})))}function Nt(e){const[t,n]=l.splitProps(e,["children","top","bottom"]);return l.createComponent(Rt,l.mergeProps(n,{get children(){return[N(()=>t.top),(()=>{var i=zt();return _(i,()=>t.children),i})(),N(()=>t.bottom)]}}))}function Lt(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.gap??e.gutter??"size00")??"0px"}`,s=()=>`--columns: ${S(Math.max(e.colCount??e.columns??1,1))??1};`,r=()=>e.switchAt?`--switchAt: ${P(t,e.switchAt)??"0px"};`:"",c=()=>[n(),i(),s(),r()].filter(Boolean).join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter","columns","colCount","switchAt"]),y({style:c,"data-br-columns":()=>""})))}const Dt=e=>typeof e=="number"?e:1;function Wt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[o,a])=>c+`${o}:${a};`,""),n=()=>`--span: ${Dt(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 m(()=>e.as??"div",l.mergeProps(h(e,["as","span","offsetStart","offsetEnd"]),y({style:r,"data-br-column":()=>""})))}exports.Center=rt;exports.Column=Wt;exports.ColumnDrop=at;exports.Columns=Lt;exports.Cover=Nt;exports.Frame=gt;exports.Grid=Z;exports.Inline=jt;exports.InlineCluster=St;exports.MasonryGrid=$t;exports.PadBox=It;exports.Reel=Mt;exports.Split=Tt;exports.Stack=vt;exports.ThemeProvider=ot;exports.checkIsCSSLength=M;exports.createContainerQuery=lt;exports.getSafeGutter=z;exports.getSizeValue=P;exports.getSpacingValue=b;exports.sizes=Q;exports.spacing=q;exports.useTheme=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@bedrock-layout/spacing-constants"),l=require("solid-js"),k=["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"],R=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...k]),L=new Set(["innerHTML","textContent","innerText","children"]),D=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),W=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 z(e,t){const n=W[e];return typeof n=="object"?n[t]?n.$:void 0:n}const F=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),B=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"]),G={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function v(e,t,n){let s=n.length,r=t.length,o=s,a=0,i=0,c=t[r-1].nextSibling,f=null;for(;a<r||i<o;){if(t[a]===n[i]){a++,i++;continue}for(;t[r-1]===n[o-1];)r--,o--;if(r===a){const d=o<s?i?n[i-1].nextSibling:n[o-i]:c;for(;i<o;)e.insertBefore(n[i++],d)}else if(o===i)for(;a<r;)(!f||!f.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[o-1]&&n[i]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[i++],t[a++].nextSibling),e.insertBefore(n[--o],d),t[r]=n[o]}else{if(!f){f=new Map;let y=i;for(;y<o;)f.set(n[y],y++)}const d=f.get(t[a]);if(d!=null)if(i<d&&d<o){let y=a,u=1,$;for(;++y<r&&y<o&&!(($=f.get(t[y]))==null||$!==d+u);)u++;if(u>d-i){const C=t[a];for(;i<d;)e.insertBefore(n[i++],C)}else e.replaceChild(n[i++],t[a++])}else a++;else t[a++].remove()}}}const E="_$DX_DELEGATE";function H(e,t=window.document){const n=t[E]||(t[E]=new Set);for(let s=0,r=e.length;s<r;s++){const o=e[s];n.has(o)||(n.add(o),t.addEventListener(o,te))}}function A(e,t,n){w(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function U(e,t,n,s){w(e)||(s==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,s))}function _(e,t,n){w(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function q(e,t){w(e)||(t==null?e.removeAttribute("class"):e.className=t)}function K(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 r=n[0];e.addEventListener(t,n[0]=o=>r.call(e,n[1],o))}else e.addEventListener(t,n,typeof n!="function"&&n)}function X(e,t,n={}){const s=Object.keys(t||{}),r=Object.keys(n);let o,a;for(o=0,a=r.length;o<a;o++){const i=r[o];!i||i==="undefined"||t[i]||(I(e,i,!1),delete n[i])}for(o=0,a=s.length;o<a;o++){const i=s[o],c=!!t[i];!i||i==="undefined"||n[i]===c||!c||(I(e,i,!0),n[i]=c)}return n}function J(e,t,n){if(!t)return n?A(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 r,o;for(o in n)t[o]==null&&s.removeProperty(o),delete n[o];for(o in t)r=t[o],r!==n[o]&&(s.setProperty(o,r),n[o]=r);return n}function Y(e,t={},n,s){const r={};return l.createRenderEffect(()=>r.children=j(e,t.children,r.children)),l.createRenderEffect(()=>typeof t.ref=="function"&&Q(t.ref,e)),l.createRenderEffect(()=>Z(e,t,n,!0,r,!0)),r}function Q(e,t,n){return l.untrack(()=>e(t,n))}function Z(e,t,n,s,r={},o=!1){t||(t={});for(const a in r)if(!(a in t)){if(a==="children")continue;r[a]=x(e,a,null,r[a],n,o,t)}for(const a in t){if(a==="children")continue;const i=t[a];r[a]=x(e,a,i,r[a],n,o,t)}}function p(e){let t,n;return!w()||!(t=l.sharedConfig.registry.get(n=ne()))?e():(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function w(e){return!!l.sharedConfig.context&&!l.sharedConfig.done&&(!e||e.isConnected)}function ee(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function I(e,t,n){const s=t.trim().split(/\s+/);for(let r=0,o=s.length;r<o;r++)e.classList.toggle(s[r],n)}function x(e,t,n,s,r,o,a){let i,c,f,d,y;if(t==="style")return J(e,n,s);if(t==="classList")return X(e,n,s);if(n===s)return s;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const u=t.slice(3);s&&e.removeEventListener(u,s,typeof s!="function"&&s),n&&e.addEventListener(u,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const u=t.slice(10);s&&e.removeEventListener(u,s,!0),n&&e.addEventListener(u,n,!0)}else if(t.slice(0,2)==="on"){const u=t.slice(2).toLowerCase(),$=F.has(u);if(!$&&s){const C=Array.isArray(s)?s[0]:s;e.removeEventListener(u,C)}($||n)&&(K(e,u,n,$),$&&H([u]))}else if(t.slice(0,5)==="attr:")A(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")_(e,t.slice(5),n);else if((y=t.slice(0,5)==="prop:")||(f=L.has(t))||!r&&((d=z(t,e.tagName))||(c=R.has(t)))||(i=e.nodeName.includes("-")||"is"in a)){if(y)t=t.slice(5),c=!0;else if(w(e))return n;t==="class"||t==="className"?q(e,n):i&&!c&&!f?e[ee(t)]=n:e[d||t]=n}else{const u=r&&t.indexOf(":")>-1&&G[t.split(":")[0]];u?U(e,u,t,n):A(e,D[t]||t,n)}return n}function te(e){if(l.sharedConfig.registry&&l.sharedConfig.events&&l.sharedConfig.events.find(([c,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,s=e.target,r=e.currentTarget,o=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),a=()=>{const c=t[n];if(c&&!t.disabled){const f=t[`${n}Data`];if(f!==void 0?c.call(t,f,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},i=()=>{for(;a()&&(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 c=e.composedPath();o(c[0]);for(let f=0;f<c.length-2&&(t=c[f],!!a());f++){if(t._$host){t=t._$host,i();break}if(t.parentNode===r)break}}else i();o(s)}function j(e,t,n,s,r){const o=w(e);if(o){!n&&(n=[...e.childNodes]);let i=[];for(let c=0;c<n.length;c++){const f=n[c];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 a=typeof t;if(e=e,a==="string"||a==="number"){if(o||a==="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||a==="boolean"){if(o)return n;n=S(e,n,s)}else{if(a==="function")return l.createRenderEffect(()=>{let i=t();for(;typeof i=="function";)i=i();n=j(e,i,n,s)}),()=>n;if(Array.isArray(t)){const i=[],c=n&&Array.isArray(n);if(P(i,t,n,r))return l.createRenderEffect(()=>n=j(e,i,n,s,!0)),()=>n;if(o)return i.length?n=[...e.childNodes]:n;i.length===0?n=S(e,n,s):c?n.length===0?O(e,i,s):v(e,n,i):(n&&S(e),O(e,i)),n=i}else if(t.nodeType){if(o&&t.parentNode)return n=t;Array.isArray(n)?S(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 r=!1;for(let o=0,a=t.length;o<a;o++){let i=t[o],c=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))r=P(e,i,c)||r;else if(f==="function")if(s){for(;typeof i=="function";)i=i();r=P(e,Array.isArray(i)?i:[i],Array.isArray(c)?c:[c])||r}else e.push(i),r=!0;else{const d=String(i);c&&c.nodeType===3&&c.data===d?e.push(c):e.push(document.createTextNode(d))}}return r}function O(e,t,n=null){for(let s=0,r=t.length;s<r;s++)e.insertBefore(t[s],n)}function S(e,t,n,s){if(n===void 0)return e.textContent="";const r=s||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const i=t[a];if(r!==i){const c=i.parentNode===e;!o&&!a?c?e.replaceChild(r,i):e.insertBefore(r,n):c&&i.remove()}else o=!0}}else e.insertBefore(r,n);return[r]}function ne(){return l.sharedConfig.getNextContextId()}const ie="http://www.w3.org/2000/svg";function se(e,t=!1,n=void 0){return t?document.createElementNS(ie,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 r=B.has(s),o=l.sharedConfig.context?p():se(s,r,l.untrack(()=>t.is));return Y(o,t,r),o}})}function re(e){const[,t]=l.splitProps(e,["component"]);return oe(()=>e.component,t)}function ae(e){return e??void 0}function h(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 m(e,t){return l.createComponent(re,l.mergeProps({get component(){return e()}},t))}function b(e){return Object.values(e).every(t=>typeof t=="function")?Object.keys(e).reduce((t,n)=>{const 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 ce(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:g.getSizeValue(e)??e}function le(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,i])=>o+`${a}:${i};`,""),n=()=>`--max-width: ${ce(e.maxWidth)};`,s=()=>"",r=()=>[t(),n()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","maxWidth"]),b({style:r,"data-br-center":s})))}function fe(e){return g.getSizeValue(e)}function ue(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[i,c])=>a+`${i}:${c};`,""),n=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>`--min-item-width: ${fe(e.minItemWidth)}`,r=()=>e.variant==="centered"?"variant:centered":"",o=()=>[t(),n(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","minItemWidth","variant"]),b({style:o,"data-br-column-drop":r})))}function de(e){return Array.isArray(e)&&e.length===2&&e.every(Number.isFinite)||typeof e=="string"&&/^\d{1,1000} ?\/ ?\d{1,1000}$/.test(e)}function ge(e){return Array.isArray(e)?e.join("/"):e}function ye(e){return de(e)?ge(e):void 0}function he(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[i,c])=>a+`${i}:${c};`,""),n=()=>ye(e.ratio),s=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",o=()=>[t(),s(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","ratio","position"]),b({style:o,"data-br-frame":()=>""})))}function me(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,i])=>o+`${a}:${i};`,""),n=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>`--min-item-width: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,r=()=>[t(),n(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","minItemWidth"]),b({style:r,"data-br-grid":()=>e.variant==="masonry"?"variant:masonry":""})))}const be={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},T={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function $e(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((i,[c,f])=>i+`${c}:${f};`,""),n=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>e.justify?be[e.justify]:void 0,r=()=>e.align?T[e.align]:T.center,o=()=>[t(),n()].join("; "),a=()=>[s(),r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","justify","align","gap"]),b({style:o,"data-br-inline-cluster":a})))}const we={start:"justify:start",end:"justify:end",center:"justify:center","space-between":"justify:space-between","space-around":"justify:space-around"},M={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Se(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((y,[u,$])=>y+`${u}:${$};`,""),n=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,s=y=>typeof y=="string"?g.getSizeValue(y)??y:`${y}px`,r=()=>e.minItemWidth?`--min-item-width: ${s(e.minItemWidth)};`:void 0,o=()=>e.switchAt?`--switch-at: ${g.getSizeValue(e.switchAt)??"0px"};`:"",a=()=>e.justify?we[e.justify]:void 0,i=()=>e.align===void 0?M.center:M[e.align],c=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[t(),n(),o(),r()].join("; "),d=()=>[a(),i(),c()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","justify","align","stretch","switchAt"]),b({style:f,"data-br-inline":d})))}function Ce(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[a,i])=>o+`${a}:${i};`,""),n=()=>`--gap: ${g.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"}},r=()=>[t(),n()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","gutter"]),b({style:r,"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 Ae(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((i,[c,f])=>i+`${c}:${f};`,""),n=()=>e.switchAt?`--switch-at: ${g.getSizeValue(e.switchAt)??"0px"};`:"",s=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,r=()=>N[e.fraction??"1/2"]??N["1/2"],o=()=>e.minItemWidth?`--min-item-width: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,a=()=>[t(),s(),n(),o()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","fraction"]),b({style:a,"data-br-split":r})))}const je={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Pe(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[i,c])=>a+`${i}:${c};`,""),n=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>[t(),n()].join("; "),r=()=>e.align?je[e.align]:void 0,o=()=>[r()].filter(Boolean).join(" ");return m(()=>e.as??"div",l.mergeProps(h(e,["as"]),b({style:s,"data-br-stack":o})))}function Ee(e){return typeof e=="number"?`${e}px`:g.getSizeValue(e)??"100%"}function Ie(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[i,c])=>a+`${i}:${c};`,""),n=()=>`--gap: ${g.getSpacingValue(e.gap??"size00")??"0px"}`,s=()=>`--min-height: ${Ee(e.minHeight)};`,r=()=>e.variant==="stretch-content"?"stretch-content":"",o=()=>[t(),n(),s()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","minHeight"]),b({style:o,"data-br-cover":r})))}function xe(e){return m(()=>e.as??"div",l.mergeProps(h(e,["as"]),{"data-br-cover-centered":""}))}function Oe(e){return l.createComponent(Ie,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 Te(e){const t=()=>V(e.style),n=()=>{const a=g.getSafeGutter(e.gap);return a?`--gap: ${a};`:""},s=()=>`--col-count: ${ae(Math.max(e.colCount??1,1))??1};`,r=()=>e.switchAt?`--switch-at: ${g.getSizeValue(e.switchAt)??"0px"};`:"",o=()=>[t(),n(),s(),r()].filter(Boolean).join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","colCount","switchAt"]),b({style:o,"data-br-columns":()=>""})))}const Me=e=>typeof e=="number"?e:1;function Ne(e){const t=()=>V(e.style),n=()=>`--col-span: ${Me(e.span)};`,s=()=>e.offsetStart&&e.offsetStart>0?`--offset-start: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offset-end: ${e.offsetEnd};`:"",o=()=>[t(),n(),s(),r()].join("; ");return m(()=>e.as??"div",l.mergeProps(h(e,["as","span","offsetStart","offsetEnd"]),b({style:o,"data-br-column":()=>""})))}exports.Center=le;exports.Column=Ne;exports.ColumnDrop=ue;exports.Columns=Te;exports.Cover=Oe;exports.CoverCentered=xe;exports.Frame=he;exports.Grid=me;exports.Inline=Se;exports.InlineCluster=$e;exports.Reel=Ce;exports.Split=Ae;exports.Stack=Pe;Object.keys(g).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>g[e]})});
package/lib/index.d.ts CHANGED
@@ -1,16 +1,12 @@
1
- export * from "./spacing-constants";
1
+ export * from "@bedrock-layout/spacing-constants";
2
2
  export * from "./center";
3
3
  export * from "./column-drop";
4
- export * from "./create-container-query";
5
4
  export * from "./frame";
6
5
  export * from "./grid";
7
- export * from "./masonry-grid";
8
6
  export * from "./inline-cluster";
9
7
  export * from "./inline";
10
- export * from "./padbox";
11
8
  export * from "./reel";
12
9
  export * from "./split";
13
10
  export * from "./stack";
14
11
  export * from "./cover";
15
12
  export * from "./columns";
16
- export * from "./theme-provider";