@bedrock-layout/solid 0.12.1 → 1.1.2
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/LICENSE +1 -1
- package/lib/center.d.ts +2 -2
- package/lib/column-drop.d.ts +3 -3
- package/lib/columns.d.ts +7 -12
- package/lib/cover.d.ts +6 -7
- package/lib/frame.d.ts +3 -3
- package/lib/grid.d.ts +3 -3
- package/lib/index.cjs.js +1 -1
- package/lib/index.m.js +681 -1136
- package/lib/index.umd.js +1 -1
- package/lib/inline-cluster.d.ts +1 -1
- package/lib/inline.d.ts +5 -6
- package/lib/padbox.d.ts +4 -4
- package/lib/reel.d.ts +1 -1
- package/lib/spacing-constants.d.ts +26 -26
- package/lib/split.d.ts +7 -9
- package/lib/stack.d.ts +1 -1
- package/lib/typeUtils.d.ts +13 -13
- package/package.json +3 -5
package/lib/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("solid-js"),require("@bedrock-layout/register-resize-callback")):typeof define=="function"&&define.amd?define(["exports","solid-js","@bedrock-layout/register-resize-callback"],l):(d=typeof globalThis!="undefined"?globalThis:d||self,l(d.solid={},d.solidJs,d.registerResizeCallback))})(this,function(d,l,j){"use strict";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,100}\)$/].some(t=>t.test(e))}const v={none:"0px",xxs:"0.0625rem",xs:"0.125rem",sm:"0.25rem",md:"0.5rem",mdLg:"0.75rem",lg:"1rem",lgXl:"1.5rem",xl:"2rem",xlXXl:"3rem",xxl:"4rem"};function Q(e){return e.reduce((t,[n,c])=>({...t,[n]:c}),{})}const S=(e,t)=>{var r,i;const n=(i=(r=t==null?void 0:t.space)!=null?r:t==null?void 0:t.spacing)!=null?i:v,o=Q(Object.entries(n).map(([a,f])=>[a,typeof f=="number"?`${f}px`:f]))[e];return M(o)?o:void 0},Y=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Z=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Y]),p=new Set(["innerHTML","textContent","innerText","children"]),J={className:"class",htmlFor:"for"},L={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},ee=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),te=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ne={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ie(e,t,n){let c=n.length,o=t.length,s=c,r=0,i=0,a=t[o-1].nextSibling,f=null;for(;r<o||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===r){const u=s<c?i?n[i-1].nextSibling:n[s-i]:a;for(;i<s;)e.insertBefore(n[i++],u)}else if(s===i)for(;r<o;)(!f||!f.has(t[r]))&&t[r].remove(),r++;else if(t[r]===n[s-1]&&n[i]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[i++],t[r++].nextSibling),e.insertBefore(n[--s],u),t[o]=n[s]}else{if(!f){f=new Map;let y=i;for(;y<s;)f.set(n[y],y++)}const u=f.get(t[r]);if(u!=null)if(i<u&&u<s){let y=r,$=1,w;for(;++y<o&&y<s&&!((w=f.get(t[y]))==null||w!==u+$);)$++;if($>u-i){const x=t[r];for(;i<u;)e.insertBefore(n[i++],x)}else e.replaceChild(n[i++],t[r++])}else r++;else t[r++].remove()}}}const B="_$DX_DELEGATE";function re(e,t=window.document){const n=t[B]||(t[B]=new Set);for(let c=0,o=e.length;c<o;c++){const s=e[c];n.has(s)||(n.add(s),t.addEventListener(s,me))}}function ce(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function oe(e,t,n,c){c==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,c)}function se(e,t){t==null?e.removeAttribute("class"):e.className=t}function ae(e,t,n,c){if(c)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]=s=>o.call(e,n[1],s))}else e.addEventListener(t,n)}function fe(e,t,n={}){const c=Object.keys(t||{}),o=Object.keys(n);let s,r;for(s=0,r=o.length;s<r;s++){const i=o[s];!i||i==="undefined"||t[i]||(W(e,i,!1),delete n[i])}for(s=0,r=c.length;s<r;s++){const i=c[s],a=!!t[i];!i||i==="undefined"||n[i]===a||!a||(W(e,i,!0),n[i]=a)}return n}function le(e,t,n={}){const c=e.style,o=typeof n=="string";if(t==null&&o||typeof t=="string")return c.cssText=t;o&&(c.cssText=void 0,n={}),t||(t={});let s,r;for(r in n)t[r]==null&&c.removeProperty(r),delete n[r];for(r in t)s=t[r],s!==n[r]&&(c.setProperty(r,s),n[r]=s);return n}function ue(e,t,n,c){typeof t=="function"?l.createRenderEffect(o=>F(e,t(),o,n,c)):F(e,t,void 0,n,c)}function de(e,t,n,c,o={},s=!1){t||(t={});for(const r in o)if(!(r in t)){if(r==="children")continue;D(e,r,null,o[r],n,s)}for(const r in t){if(r==="children"){c||P(e,t.children);continue}const i=t[r];o[r]=D(e,r,i,o[r],n,s)}}function ye(e){let t,n;return!l.sharedConfig.context||!(t=l.sharedConfig.registry.get(n=he()))?e.cloneNode(!0):(l.sharedConfig.completed&&l.sharedConfig.completed.add(t),l.sharedConfig.registry.delete(n),t)}function ge(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function W(e,t,n){const c=t.trim().split(/\s+/);for(let o=0,s=c.length;o<s;o++)e.classList.toggle(c[o],n)}function D(e,t,n,c,o,s){let r,i,a;if(t==="style")return le(e,n,c);if(t==="classList")return fe(e,n,c);if(n===c)return c;if(t==="ref")s||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);c&&e.removeEventListener(f,c),n&&e.addEventListener(f,n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);c&&e.removeEventListener(f,c,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),u=ee.has(f);if(!u&&c){const y=Array.isArray(c)?c[0]:c;e.removeEventListener(f,y)}(u||n)&&(ae(e,f,n,u),u&&re([f]))}else if((a=p.has(t))||!o&&(L[t]||(i=Z.has(t)))||(r=e.nodeName.includes("-")))t==="class"||t==="className"?se(e,n):r&&!i&&!a?e[ge(t)]=n:e[L[t]||t]=n;else{const f=o&&t.indexOf(":")>-1&&ne[t.split(":")[0]];f?oe(e,f,t,n):ce(e,J[t]||t,n)}return n}function me(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),l.sharedConfig.registry&&!l.sharedConfig.done&&(l.sharedConfig.done=!0,document.querySelectorAll("[id^=pl-]").forEach(c=>c.remove()));n!==null;){const c=n[t];if(c&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?c.call(n,o,e):c.call(n,e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function F(e,t,n={},c,o){return t||(t={}),!o&&"children"in t&&l.createRenderEffect(()=>n.children=P(e,t.children,n.children)),t.ref&&t.ref(e),l.createRenderEffect(()=>de(e,t,c,!0,n,!0)),n}function P(e,t,n,c,o){for(l.sharedConfig.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,r=c!==void 0;if(e=r&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(l.sharedConfig.context)return n;if(s==="number"&&(t=t.toString()),r){let i=n[0];i&&i.nodeType===3?i.data=t:i=document.createTextNode(t),n=C(e,n,c,i)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(l.sharedConfig.context)return n;n=C(e,n,c)}else{if(s==="function")return l.createRenderEffect(()=>{let i=t();for(;typeof i=="function";)i=i();n=P(e,i,n,c)}),()=>n;if(Array.isArray(t)){const i=[],a=n&&Array.isArray(n);if(k(i,t,n,o))return l.createRenderEffect(()=>n=P(e,i,n,c,!0)),()=>n;if(l.sharedConfig.context){if(!i.length)return n;for(let f=0;f<i.length;f++)if(i[f].parentNode)return n=i}if(i.length===0){if(n=C(e,n,c),r)return n}else a?n.length===0?G(e,i,c):ie(e,n,i):(n&&C(e),G(e,i));n=i}else if(t instanceof Node){if(l.sharedConfig.context&&t.parentNode)return n=r?[t]:t;if(Array.isArray(n)){if(r)return n=C(e,n,c,t);C(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function k(e,t,n,c){let o=!1;for(let s=0,r=t.length;s<r;s++){let i=t[s],a=n&&n[s];if(i instanceof Node)e.push(i);else if(!(i==null||i===!0||i===!1))if(Array.isArray(i))o=k(e,i,a)||o;else if(typeof i=="function")if(c){for(;typeof i=="function";)i=i();o=k(e,Array.isArray(i)?i:[i],Array.isArray(a)?a:[a])||o}else e.push(i),o=!0;else{const f=String(i);a&&a.nodeType===3&&a.data===f?e.push(a):e.push(document.createTextNode(f))}}return o}function G(e,t,n){for(let c=0,o=t.length;c<o;c++)e.insertBefore(t[c],n)}function C(e,t,n,c){if(n===void 0)return e.textContent="";const o=c||document.createTextNode("");if(t.length){let s=!1;for(let r=t.length-1;r>=0;r--){const i=t[r];if(o!==i){const a=i.parentNode===e;!s&&!r?a?e.replaceChild(o,i):e.insertBefore(o,n):a&&i.remove()}else s=!0}}else e.insertBefore(o,n);return[o]}function he(){const e=l.sharedConfig.context;return`${e.id}${e.count++}`}const Se="http://www.w3.org/2000/svg";function be(e,t=!1){return t?document.createElementNS(Se,e):document.createElement(e)}function $e(e){const[t,n]=l.splitProps(e,["component"]),c=l.createMemo(()=>t.component);return l.createMemo(()=>{const o=c();switch(typeof o){case"function":return l.untrack(()=>o(n));case"string":const s=te.has(o),r=l.sharedConfig.context?ye():be(o,s);return ue(r,n,s),r}})}function Ce(e){return e!=null?e:void 0}function g(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,c)=>(Object.defineProperty(n,c,{get(){return e[c]},configurable:!0,enumerable:!0}),n),{})}function m(e,t){return l.createComponent($e,l.mergeProps({get component(){return e()}},t))}function h(e){if(!Object.values(e).every(t=>typeof t=="function"))throw new Error("Please provide an object with accessor values only.");return Object.keys(e).reduce((t,n)=>{const c=e[n];return Object.defineProperty(t,n,{get(){return c()},configurable:!0,enumerable:!0}),t},{})}function we(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function Ae(e){const t=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((a,[f,u])=>a+`${f}:${u};`,"")},n=()=>`--maxWidth: ${we(e.maxWidth)};`,c=()=>e.centerText?"center-text":"",o=()=>e.centerChildren?"center-children":"",s=()=>[c(),o()].filter(Boolean).join(" "),r=()=>[t(),n()].join("; ");return m(()=>{var i;return(i=e.as)!=null?i:"div"},l.mergeProps(g(e,["as","maxWidth","centerText","centerChildren"]),h({style:r,"data-bedrock-center":s})))}const V=l.createContext({});function Ee(e){return React.createElement(V.Provider,{value:e.theme},e.children)}function b(){try{return l.useContext(V)}catch{return{}}}function xe(e){return e===void 0?"159px":typeof e=="number"?`${e}px`:e}function je(e){const t=b(),n=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((a,[f,u])=>a+`${f}:${u};`,"")},c=()=>{var i,a;return`--gutter: ${(a=S((i=e.gutter)!=null?i:"none",t))!=null?a:"0px"}`},o=()=>`--minItemWidth: ${xe(e.minItemWidth)}`,s=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",r=()=>[n(),c(),o()].join("; ");return m(()=>{var i;return(i=e.as)!=null?i:"div"},l.mergeProps(g(e,["as","gutter","minItemWidth","noStretchedColumns"]),h({style:r,"data-bedrock-column-drop":s})))}function T(e){throw new Error(e)}function Pe(e){typeof e!="number"&&!Array.isArray(e)&&T("width must be a number or an array of two numbers"),Array().concat(e).some(n=>n<0)&&T("width value(s) must be 0 or greater"),Array.isArray(e)&&(e.length!==2||e[0]>e[1])&&T(`The second width value, ${e[1]}, is not larger than ${e[0]}. Please provide a value greater than first width value`)}function R(e,t){Pe(e);const[n,c]=l.createSignal(!1),[o,s]=l.createSignal();return l.onMount(()=>{j.init()}),l.createEffect(()=>{if(o()===void 0||o()===null)return;t&&t(o());const r=j.registerCallback(o(),i=>{var f,u;const a=(u=(f=i.borderBoxSize)==null?void 0:f.inlineSize)!=null?u:i.contentRect.width;if(a>0){const y=Array.isArray(e)?a>=e[0]&&a<=e[1]:a<=e;c(y)}});l.onCleanup(r)}),[n,s]}function Me(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 ve(e){return Array.isArray(e)?e.join("/"):e}function ke(e){return Me(e)?ve(e):void 0}function Te(e){const t=()=>{var r;return typeof e.style=="string"?e.style:Object.entries((r=e.style)!=null?r:{}).reduce((i,[a,f])=>i+`${a}:${f};`,"")},n=()=>ke(e.ratio),c=()=>n()?`--ratio: ${n()}`:"",o=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",s=()=>[t(),c(),o()].join("; ");return m(()=>{var r;return(r=e.as)!=null?r:"div"},l.mergeProps(g(e,["as","ratio","position"]),h({style:s,"data-bedrock-frame":()=>""})))}function H(e){const t=b(),n=()=>{var r;return typeof e.style=="string"?e.style:Object.entries((r=e.style)!=null?r:{}).reduce((i,[a,f])=>i+`${a}:${f};`,"")},c=()=>{var r,i;return`--gutter: ${(i=S((r=e.gutter)!=null?r:"none",t))!=null?i:"0px"};`},o=()=>{var r;return`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${(r=e.minItemWidth)!=null?r:0}px`};`},s=()=>[n(),c(),o()].join("; ");return m(()=>{var r;return(r=e.as)!=null?r:"div"},l.mergeProps(g(e,["as","gutter","minItemWidth"]),h({style:s,"data-bedrock-grid":()=>""})))}const A=96;function _(e){var c;e=String(e);const t=parseFloat(e),[,n]=(c=e.match(/[\d.\-+]*\s*(.*)/))!=null?c:["",""];return[t,n]}function E(e,t){if(!e)return;const n=t!=null?t:document.body,c=(e!=null?e:"px").trim().toLowerCase();switch(c){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return Re(c,n);case"em":return I(n,"font-size");case"rem":return I(document.body,"font-size");case"in":return A;case"cm":return A/2.54;case"mm":return A/25.4;case"pt":return A/72;case"pc":return A/6;case"px":return 1;default:{const[o,s]=_(c);if(isNaN(o))return;if(!s)return o;const r=E(s,t);return typeof r=="number"?o*r:void 0}}}function I(e,t){var o;const[n,c]=_(getComputedStyle(e).getPropertyValue(t));return n*((o=E(c,e))!=null?o:1)}function Re(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const c=I(n,"height")/128;return t.removeChild(n),c}const O=1,Ie=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,Oe=e=>{const[t,n]=l.createSignal(1),[c,o]=l.createSignal(),s=b();return l.onMount(()=>{j.init()}),l.createEffect(()=>{const r=Ce(c());if(r===void 0)return;const i=j.registerCallback(r,({target:a})=>{var U;n(1);const f=e.gutter&&(U=S(e.gutter,s))!=null?U:"1px",u=Ie?E(f,a):void 0,y=Math.max(u!=null?u:O,O),[$]=Array.from(a.children),w=1+Math.min(a.scrollHeight,$.scrollHeight),x=Math.max(Math.ceil(w/y),O);n(x)});l.onCleanup(i)}),React.createElement("div",{style:`grid-row: span ${t()};`,ref:o},e.children)},Ne=e=>{const t=l.children(()=>e.children),c=[].concat(t()).filter(Boolean).map(o=>React.createElement(Oe,{gutter:e.gutter},o));return React.createElement(H,{style:"grid-template-rows: 1px;",...e},c)},Le={start:"justify:start",end:"justify:end",center:"justify:center"},Be={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function We(e){const t=b(),n=()=>{var a;return typeof e.style=="string"?e.style:Object.entries((a=e.style)!=null?a:{}).reduce((f,[u,y])=>f+`${u}:${y};`,"")},c=()=>{var a,f;return`--gutter: ${(f=S((a=e.gutter)!=null?a:"none",t))!=null?f:"0px"};`},o=()=>e.justify!==void 0?Le[e.justify]:void 0,s=()=>e.align!==void 0?Be[e.align]:void 0,r=()=>[n(),c()].join("; "),i=()=>[o(),s()].filter(Boolean).join(" ");return m(()=>{var a;return(a=e.as)!=null?a:"div"},l.mergeProps(g(e,["as","gutter","justify","align"]),h({style:r,"data-bedrock-inline-cluster":i})))}const De={start:"justify:start",end:"justify:end",center:"justify:center"},Fe={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Ge(e){return typeof e=="number"&&e>-1?!0:typeof e=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${e}`):!1}function Ve(e){const t=b(),n=()=>{var y;return typeof e.style=="string"?e.style:Object.entries((y=e.style)!=null?y:{}).reduce(($,[w,x])=>$+`${w}:${x};`,"")},c=()=>{var y,$;return`--gutter: ${($=S((y=e.gutter)!=null?y:"none",t))!=null?$:"0px"};`},o=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,s=()=>Ge(e.switchAt)?`--switchAt: ${typeof e.switchAt=="string"?e.switchAt:`${e.switchAt}px`};`:void 0,r=()=>e.justify!==void 0?De[e.justify]:void 0,i=()=>e.align!==void 0?Fe[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,f=()=>[n(),c(),s(),o()].join("; "),u=()=>[r(),i(),a()].filter(Boolean).join(" ");return m(()=>{var y;return(y=e.as)!=null?y:"div"},l.mergeProps(g(e,["as","gutter","justify","align","stretch","switchAt"]),h({style:f,"data-bedrock-inline":u})))}const X=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),He=(e,t)=>({left:`padding-inline-start:${t};`,right:`padding-inline-end:${t};`,top:`padding-block-start:${t};`,bottom:`padding-block-end:${t};`,inlineStart:`padding-inline-start:${t};`,inlineEnd:`padding-inline-end:${t};`,blockStart:`padding-block-start:${t};`,blockEnd:`padding-block-end:${t};`})[e];function _e(e){return t=>{const n=S(t,e);return n!=null?n:"0px"}}function Xe(e,t){var s;if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=new Set(Object.keys((s=e==null?void 0:e.spacing)!=null?s:v));(()=>typeof t=="string"?!0:Array.isArray(t)?t.every(r=>n.has(r)):t&&Object.keys(t).every(r=>X.has(r))&&Object.values(t).every(r=>n.has(r)))()||console.error("Invalid padding Type");const o=_e(e);return typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((r,[i,a])=>X.has(i)?r+He(i,o(a)):r,""):t!==void 0?`padding: ${Array.from(Array.isArray(t)?t:[t]).map(r=>o(r)).join(" ")};`:""}function qe(e){const t=b(),n=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((r,[i,a])=>r+`${i}:${a};`,"")},c=()=>Xe(t,e.padding),o=()=>[n(),c()].join("; ");return m(()=>{var s;return(s=e.as)!=null?s:"div"},l.mergeProps(g(e,["as","padding"]),h({style:o,"data-bedrock-padbox":()=>""})))}function Ke(e){const t=b(),n=()=>{var r;return typeof e.style=="string"?e.style:Object.entries((r=e.style)!=null?r:{}).reduce((i,[a,f])=>i+`${a}:${f};`,"")},c=()=>{var r,i;return`--gutter: ${(i=S((r=e.gutter)!=null?r:"none",t))!=null?i:"0px"};`},o=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},s=()=>[n(),c()].join("; ");return m(()=>{var r;return(r=e.as)!=null?r:"div"},l.mergeProps(g(e,["as","gutter"]),h({style:s,"data-bedrock-reel":o})))}function N(e){const t=b(),n=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((r,[i,a])=>r+`${i}:${a};`,"")},c=()=>{var s,r;return`--gutter: ${(r=S((s=e.gutter)!=null?s:"none",t))!=null?r:"0px"};`},o=()=>[n(),c()].join("; ");return m(()=>{var s;return(s=e.as)!=null?s:"div"},l.mergeProps(g(e,["as","gutter"]),h({style:o,"data-bedrock-stack":()=>""})))}const q={"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 K(e){const t=b(),n=()=>{var r;return typeof e.style=="string"?e.style:Object.entries((r=e.style)!=null?r:{}).reduce((i,[a,f])=>i+`${a}:${f};`,"")},c=()=>{var r,i;return`--gutter: ${(i=S((r=e.gutter)!=null?r:"none",t))!=null?i:"0px"};`},o=()=>{var r,i;return(i=q[(r=e.fraction)!=null?r:"1/2"])!=null?i:q["1/2"]},s=()=>[n(),c()].join("; ");return m(()=>{var r;return(r=e.as)!=null?r:"div"},l.mergeProps(g(e,["as","gutter","fraction"]),h({style:s,"data-bedrock-split":o})))}const ze=e=>{const[t,n]=l.splitProps(e,["switchAt","fraction"]),c=typeof t.switchAt=="string"?E(t.switchAt):t.switchAt,o=Math.max(c!=null?c:0,0),[s,r]=R(o,e.ref);return React.createElement(l.Switch,null,React.createElement(l.Match,{when:s()===!1},React.createElement(K,{fraction:t.fraction,...n,ref:r})),React.createElement(l.Match,{when:s()===!0},React.createElement(N,{...n,ref:r})))};function Ue(e){return typeof e=="number"?`${e}px`:e&&M(e)?e:"100vh"}function Qe(e){const t=b(),n=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((a,[f,u])=>a+`${f}:${u};`,"")},c=()=>{var i,a;return`--gutter: ${(a=S((i=e.gutter)!=null?i:"none",t))!=null?a:"0px"};`},o=()=>`--minHeight: ${Ue(e.minHeight)};`,s=()=>e.stretchContent===!0?"stretch-content":"",r=()=>[n(),c(),o()].join("; ");return m(()=>{var i;return(i=e.as)!=null?i:"div"},l.mergeProps(g(e,["as","minHeight","stretchContent"]),h({style:r,"data-bedrock-cover":s})))}const Ye=e=>React.createElement(Qe,{...e},e.top,React.createElement("div",{"data-bedrock-cover-centered":!0},e.children),e.bottom);function z(e){const t=b(),n=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((a,[f,u])=>a+`${f}:${u};`,"")},c=()=>{var i,a;return`--gutter: ${(a=S((i=e.gutter)!=null?i:"none",t))!=null?a:"0px"};`},o=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,s=()=>e.dense?"dense":"",r=()=>[n(),c(),o()].join("; ");return m(()=>{var i;return(i=e.as)!=null?i:"div"},l.mergeProps(g(e,["as","gutter","columns","dense"]),h({style:r,"data-bedrock-columns":s})))}const Ze=e=>{const[t,n]=l.splitProps(e,["switchAt","columns","dense"]),c=typeof t.switchAt=="string"?E(t.switchAt):t.switchAt,o=Math.max(c!=null?c:0,0),[s,r]=R(o),i=a=>{var f;r(a),(f=n.ref)==null||f.call(n,a)};return React.createElement(l.Switch,null,React.createElement(l.Match,{when:s()===!1},React.createElement(z,{columns:t.columns,dense:t.dense,...n,ref:i})),React.createElement(l.Match,{when:s()===!0},React.createElement(N,{...n,ref:i})))},pe=e=>typeof e=="number"?e:1;function Je(e){const t=()=>{var r;return typeof e.style=="string"?e.style:Object.entries((r=e.style)!=null?r:{}).reduce((i,[a,f])=>i+`${a}:${f};`,"")},n=()=>`--span: ${pe(e.span)};`,c=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",o=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",s=()=>[t(),n(),c(),o()].join("; ");return m(()=>{var r;return(r=e.as)!=null?r:"div"},l.mergeProps(g(e,["as","span","offsetStart","offsetEnd"]),h({style:s,"data-bedrock-column":()=>""})))}d.Center=Ae,d.Column=Je,d.ColumnDrop=je,d.Columns=Ze,d.ColumnsBase=z,d.Cover=Ye,d.Frame=Te,d.Grid=H,d.Inline=Ve,d.InlineCluster=We,d.MasonryGrid=Ne,d.PadBox=qe,d.Reel=Ke,d.Split=ze,d.SplitBase=K,d.Stack=N,d.ThemeProvider=Ee,d.checkIsCSSLength=M,d.createContainerQuery=R,d.getSpacingValue=S,d.spacing=v,d.useTheme=b,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(u,w){typeof exports=="object"&&typeof module<"u"?w(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"],w):(u=typeof globalThis<"u"?globalThis:u||self,w(u.solid={},u.OpenProps,u.solidJs,u.registerResizeCallback))})(this,function(u,w,f,E){"use strict";const ee=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","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"}),W=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),re=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ce=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function se(e,t,n){let i=n.length,r=t.length,o=i,s=0,c=0,a=t[r-1].nextSibling,l=null;for(;s<r||c<o;){if(t[s]===n[c]){s++,c++;continue}for(;t[r-1]===n[o-1];)r--,o--;if(r===s){const d=o<i?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)e.insertBefore(n[c++],d)}else if(o===c)for(;s<r;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[o-1]&&n[c]===t[r-1]){const d=t[--r].nextSibling;e.insertBefore(n[c++],t[s++].nextSibling),e.insertBefore(n[--o],d),t[r]=n[o]}else{if(!l){l=new Map;let h=c;for(;h<o;)l.set(n[h],h++)}const d=l.get(t[s]);if(d!=null)if(c<d&&d<o){let h=s,S=1,j;for(;++h<r&&h<o&&!((j=l.get(t[h]))==null||j!==d+S);)S++;if(S>d-c){const v=t[s];for(;c<d;)e.insertBefore(n[c++],v)}else e.replaceChild(n[c++],t[s++])}else s++;else t[s++].remove()}}}const R="_$DX_DELEGATE";function B(e,t,n){const i=document.createElement("template");i.innerHTML=e;let r=i.content.firstChild;return n&&(r=r.firstChild),r}function fe(e,t=window.document){const n=t[R]||(t[R]=new Set);for(let i=0,r=e.length;i<r;i++){const o=e[i];n.has(o)||(n.add(o),t.addEventListener(o,$e))}}function D(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function ae(e,t,n,i){i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i)}function le(e,t){t==null?e.removeAttribute("class"):e.className=t}function ue(e,t,n,i){if(i)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=o=>r.call(e,n[1],o))}else e.addEventListener(t,n)}function de(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let o,s;for(o=0,s=r.length;o<s;o++){const c=r[o];!c||c==="undefined"||t[c]||(V(e,c,!1),delete n[c])}for(o=0,s=i.length;o<s;o++){const c=i[o],a=!!t[c];!c||c==="undefined"||n[c]===a||!a||(V(e,c,!0),n[c]=a)}return n}function G(e,t,n){if(!t)return n?D(e,"style"):t;const i=e.style;if(typeof t=="string")return i.cssText=t;typeof n=="string"&&(i.cssText=n=void 0),n||(n={}),t||(t={});let r,o;for(o in n)t[o]==null&&i.removeProperty(o),delete n[o];for(o in t)r=t[o],r!==n[o]&&(i.setProperty(o,r),n[o]=r);return n}function ye(e,t={},n,i){const r={};return i||f.createRenderEffect(()=>r.children=C(e,t.children,r.children)),f.createRenderEffect(()=>t.ref&&t.ref(e)),f.createRenderEffect(()=>ge(e,t,n,!0,r,!0)),r}function me(e,t,n){return f.untrack(()=>e(t,n))}function H(e,t,n,i){if(n!==void 0&&!i&&(i=[]),typeof t!="function")return C(e,t,i,n);f.createRenderEffect(r=>C(e,t(),r,n),i)}function ge(e,t,n,i,r={},o=!1){t||(t={});for(const s in r)if(!(s in t)){if(s==="children")continue;r[s]=F(e,s,null,r[s],n,o)}for(const s in t){if(s==="children"){i||C(e,t.children);continue}const c=t[s];r[s]=F(e,s,c,r[s],n,o)}}function he(e){let t,n;return!f.sharedConfig.context||!(t=f.sharedConfig.registry.get(n=Se()))?e.cloneNode(!0):(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function be(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function V(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,o=i.length;r<o;r++)e.classList.toggle(i[r],n)}function F(e,t,n,i,r,o){let s,c,a;if(t==="style")return G(e,n,i);if(t==="classList")return de(e,n,i);if(n===i)return i;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const l=t.slice(3);i&&e.removeEventListener(l,i),n&&e.addEventListener(l,n)}else if(t.slice(0,10)==="oncapture:"){const l=t.slice(10);i&&e.removeEventListener(l,i,!0),n&&e.addEventListener(l,n,!0)}else if(t.slice(0,2)==="on"){const l=t.slice(2).toLowerCase(),d=re.has(l);if(!d&&i){const h=Array.isArray(i)?i[0]:i;e.removeEventListener(l,h)}(d||n)&&(ue(e,l,n,d),d&&fe([l]))}else if((a=ne.has(t))||!r&&(W[t]||(c=te.has(t)))||(s=e.nodeName.includes("-")))t==="class"||t==="className"?le(e,n):s&&!c&&!a?e[be(t)]=n:e[W[t]||t]=n;else{const l=r&&t.indexOf(":")>-1&&oe[t.split(":")[0]];l?ae(e,l,t,n):D(e,ie[t]||t,n)}return n}function $e(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),f.sharedConfig.registry&&!f.sharedConfig.done&&(f.sharedConfig.done=!0,document.querySelectorAll("[id^=pl-]").forEach(i=>{for(;i&&i.nodeType!==8&&i.nodeValue!=="pl-"+e;){let r=i.nextSibling;i.remove(),i=r}i&&i.remove()}));n;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i.call(n,r,e):i.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function C(e,t,n,i,r){for(f.sharedConfig.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=i!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(f.sharedConfig.context)return n;if(o==="number"&&(t=t.toString()),s){let c=n[0];c&&c.nodeType===3?c.data=t:c=document.createTextNode(t),n=A(e,n,i,c)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(f.sharedConfig.context)return n;n=A(e,n,i)}else{if(o==="function")return f.createRenderEffect(()=>{let c=t();for(;typeof c=="function";)c=c();n=C(e,c,n,i)}),()=>n;if(Array.isArray(t)){const c=[],a=n&&Array.isArray(n);if(z(c,t,n,r))return f.createRenderEffect(()=>n=C(e,c,n,i,!0)),()=>n;if(f.sharedConfig.context){if(!c.length)return n;for(let l=0;l<c.length;l++)if(c[l].parentNode)return n=c}if(c.length===0){if(n=A(e,n,i),s)return n}else a?n.length===0?_(e,c,i):se(e,n,c):(n&&A(e),_(e,c));n=c}else if(t instanceof Node){if(f.sharedConfig.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=A(e,n,i,t);A(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function z(e,t,n,i){let r=!1;for(let o=0,s=t.length;o<s;o++){let c=t[o],a=n&&n[o];if(c instanceof Node)e.push(c);else if(!(c==null||c===!0||c===!1))if(Array.isArray(c))r=z(e,c,a)||r;else if(typeof c=="function")if(i){for(;typeof c=="function";)c=c();r=z(e,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||r}else e.push(c),r=!0;else{const l=String(c);a&&a.nodeType===3&&a.data===l?e.push(a):e.push(document.createTextNode(l))}}return r}function _(e,t,n=null){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function A(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let o=!1;for(let s=t.length-1;s>=0;s--){const c=t[s];if(r!==c){const a=c.parentNode===e;!o&&!s?a?e.replaceChild(r,c):e.insertBefore(r,n):a&&c.remove()}else o=!0}}else e.insertBefore(r,n);return[r]}function Se(){const e=f.sharedConfig.context;return`${e.id}${e.count++}`}const Ce="http://www.w3.org/2000/svg";function Ae(e,t=!1){return t?document.createElementNS(Ce,e):document.createElement(e)}function je(e){const[t,n]=f.splitProps(e,["component"]),i=f.createMemo(()=>t.component);return f.createMemo(()=>{const r=i();switch(typeof r){case"function":return f.untrack(()=>r(n));case"string":const o=ce.has(r),s=f.sharedConfig.context?he():Ae(r,o);return ye(s,n,o),s}})}function I(e){return e??void 0}function y(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>(Object.defineProperty(n,i,{get(){return e[i]},configurable:!0,enumerable:!0}),n),{})}function m(e,t){return f.createComponent(je,f.mergeProps({get component(){return e()}},t))}function g(e){if(!Object.values(e).every(t=>typeof t=="function"))throw new Error("Please provide an object with accessor values only.");return Object.keys(e).reduce((t,n)=>{const i=e[n];return Object.defineProperty(t,n,{get(){return i()},configurable:!0,enumerable:!0}),t},{})}const X=/^--\D{1}.{0,100}$/;function q(e){return X.test(e)}function M(e){return typeof e!="string"?!1:[/^[0-9]{0,10000}\.?[0-9]{1,10000}(vmin|vmax|vh|vw|%|ch|ex|em|rem|in|cm|mm|pt|pc|px)$/,/^var\(--\D{1}.{0,100}\)$/,X].some(t=>t.test(e))}const{sizeXxs:we,sizeXs:xe,sizeSm:Pe,sizeMd:Ee,sizeLg:Ie,sizeXl:Me,sizeXxl:ze,sizeContent1:ke,sizeContent2:Te,sizeContent3:Oe,sizeHeader1:Ne,sizeHeader2:Le,sizeHeader3:ve,size000:We,size00:Re,size1:Be,size2:De,size3:Ge,size4:He,size5:Ve,size6:Fe,size7:_e,size8:Xe,size9:qe,size10:Qe,size11:Ue,size12:Ye,size13:Ze,size14:Ke,size15:pe}=w,Je={size000:We,size00:Re,size1:Be,size2:De,size3:Ge,size4:He,size5:Ve,size6:Fe,size7:_e,size8:Xe,size9:qe,size10:Qe,size11:Ue,size12:Ye,size13:Ze,size14:Ke,size15:pe},et={sizeXxs:we,sizeXs:xe,sizeSm:Pe,sizeMd:Ee,sizeLg:Ie,sizeXl:Me,sizeXxl:ze,sizeContent1:ke,sizeContent2:Te,sizeContent3:Oe,sizeHeader1:Ne,sizeHeader2:Le,sizeHeader3:ve},Q=Je,U=et;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"&&M(t)?q(t)?`var(${t})`:t:I(b(e,t))}function b(e,t){const n=e.space??Q,i=Y(Object.entries(n).map(([r,o])=>[r,typeof o=="number"?`${o}px`:o]));return I(i[t])}function x(e,t){if(t===void 0)return;if(typeof t=="number"&&t>=0)return`${t}px`;if(typeof t=="string"&&M(t))return q(t)?`var(${t})`:t;const n=e.sizes??U,i=Y(Object.entries(n).map(([r,o])=>[r,typeof o=="number"?`${o}px`:o]));return I(i[t])}function tt(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function nt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),n=()=>`--maxWidth: ${tt(e.maxWidth)};`,i=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",o=()=>[i(),r()].filter(Boolean).join(" "),s=()=>[t(),n()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),g({style:s,"data-bedrock-center":o})))}const Z=f.createContext({});function it(e){return f.createComponent(Z.Provider,{get value(){return e.theme},get children(){return e.children}})}function $(){try{return f.useContext(Z)}catch{return{}}}function rt(e,t){return x(e,t)}function ct(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"}`,r=()=>`--minItemWidth: ${rt(t,e.minItemWidth)}`,o=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),g({style:s,"data-bedrock-column-drop":o})))}function T(e){throw new Error(e)}function ot(e){typeof e!="number"&&!Array.isArray(e)&&T("width must be a number or an array of two numbers"),Array().concat(e).some(n=>n<0)&&T("width value(s) must be 0 or greater"),Array.isArray(e)&&(e.length!==2||e[0]>e[1])&&T(`The second width value, ${e[1]}, is not larger than ${e[0]}. Please provide a value greater than first width value`)}function st(e,t){ot(e);const[n,i]=f.createSignal(!1),[r,o]=f.createSignal();return f.onMount(()=>{E.init()}),f.createEffect(()=>{if(r()===void 0||r()===null)return;t&&t(r());const s=E.registerCallback(r(),c=>{var l;const a=((l=c.borderBoxSize)==null?void 0:l.inlineSize)??c.contentRect.width;if(a>0){const d=Array.isArray(e)?a>=e[0]&&a<=e[1]:a<=e;i(d)}});f.onCleanup(s)}),[n,o]}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 at(e){return Array.isArray(e)?e.join("/"):e}function lt(e){return ft(e)?at(e):void 0}function ut(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),n=()=>lt(e.ratio),i=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",o=()=>[t(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","ratio","position"]),g({style:o,"data-bedrock-frame":()=>""})))}function K(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth??0}px`};`,o=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","minItemWidth"]),g({style:o,"data-bedrock-grid":()=>""})))}const P=96;function p(e){e=String(e);const t=parseFloat(e),[,n]=e.match(/[\d.\-+]*\s*(.*)/)??["",""];return[t,n]}function O(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 dt(i,n);case"em":return N(n,"font-size");case"rem":return N(document.body,"font-size");case"in":return P;case"cm":return P/2.54;case"mm":return P/25.4;case"pt":return P/72;case"pc":return P/6;case"px":return 1;default:{const[r,o]=p(i);if(isNaN(r))return;if(!o)return r;const s=O(o,t);return typeof s=="number"?r*s:void 0}}}function N(e,t){const[n,i]=p(getComputedStyle(e).getPropertyValue(t));return n*(O(i,e)??1)}function dt(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const i=N(n,"height")/128;return t.removeChild(n),i}const yt=B("<div></div>"),L=1,mt=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,gt=e=>{const[t,n]=f.createSignal(1),[i,r]=f.createSignal(),o=$();return f.onMount(()=>{E.init()}),f.createEffect(()=>{const s=I(i());if(s===void 0)return;const c=E.registerCallback(s,({target:a})=>{n(1);const l=e.gutter?b(o,e.gutter)??"1px":"1px",d=mt?O(l,a):void 0,h=Math.max(d??L,L),[S]=Array.from(a.children),j=1+Math.min(a.scrollHeight,S.scrollHeight),v=Math.max(Math.ceil(j/h),L);n(v)});f.onCleanup(c)}),(()=>{const s=yt.cloneNode(!0);return me(r,s),H(s,()=>e.children),f.createRenderEffect(c=>G(s,`grid-row: span ${t()};`,c)),s})()},ht=e=>{const t=f.children(()=>e.children),i=[].concat(t()).filter(Boolean).map(r=>f.createComponent(gt,{get gutter(){return e.gutter},children:r}));return f.createComponent(K,f.mergeProps({style:"grid-template-rows: 1px;"},e,{children:i}))},bt={start:"justify:start",end:"justify:end",center:"justify:center"},$t={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,[l,d])=>a+`${l}:${d};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>e.justify!==void 0?bt[e.justify]:void 0,o=()=>e.align!==void 0?$t[e.align]:void 0,s=()=>[n(),i()].join("; "),c=()=>[r(),o()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align"]),g({style:s,"data-bedrock-inline-cluster":c})))}const Ct={start:"justify:start",end:"justify:end",center:"justify:center"},At={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((h,[S,j])=>h+`${S}:${j};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,o=()=>e.switchAt?`--switchAt: ${x(t,e.switchAt)??"0px"};`:"",s=()=>e.justify!==void 0?Ct[e.justify]:void 0,c=()=>e.align!==void 0?At[e.align]:void 0,a=()=>e.stretch?`stretch:${e.stretch}`:void 0,l=()=>[n(),i(),o(),r()].join("; "),d=()=>[s(),c(),a()].filter(Boolean).join(" ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),g({style:l,"data-bedrock-inline":d})))}const wt=e=>({left:"padding-inline-start",right:"padding-inline-end",top:"padding-block-start",bottom:"padding-block-end",inlineStart:"padding-inline-start",inlineEnd:"padding-inline-end",blockStart:"padding-block-start",blockEnd:"padding-block-end"})[e],xt=(e,t)=>{if(!t)return"";if(Array.isArray(t)&&t.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((i,[r,o])=>({...i,[wt(r)]:k(e,o)??"0px"}),{}):{padding:Array.from(Array.isArray(t)?t:[t]).map(i=>k(e,i)??"0px").join(" ")};return Object.entries(n).reduce((i,[r,o])=>i+`${r}:${o};`,"")};function Pt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,c])=>o+`${s}:${c};`,""),i=()=>xt(t,e.padding),r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","padding"]),g({style:r,"data-bedrock-padbox":()=>""})))}function Et(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},o=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),g({style:o,"data-bedrock-reel":r})))}const J={"1/4":"fraction:1/4","1/3":"fraction:1/3","1/2":"fraction:1/2","2/3":"fraction:2/3","3/4":"fraction:3/4","auto-start":"fraction:auto-start","auto-end":"fraction:auto-end"};function It(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((a,[l,d])=>a+`${l}:${d};`,""),i=()=>e.switchAt?`--switchAt: ${x(t,e.switchAt)??"0px"};`:"",r=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,o=()=>J[e.fraction??"1/2"]??J["1/2"],s=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>[n(),r(),i(),s()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","fraction"]),g({style:c,"data-bedrock-split":o})))}function Mt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((o,[s,c])=>o+`${s}:${c};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>[n(),i()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter"]),g({style:r,"data-bedrock-stack":()=>""})))}const zt=B("<div data-bedrock-cover-centered></div>");function kt(e){return typeof e=="number"?`${e}px`:e&&M(e)?e:"100vh"}function Tt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--minHeight: ${kt(e.minHeight)};`,o=()=>e.stretchContent===!0?"stretch-content":"",s=()=>[n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","minHeight","stretchContent"]),g({style:s,"data-bedrock-cover":o})))}function Ot(e){const[t,n]=f.splitProps(e,["children","top","bottom"]);return f.createComponent(Tt,f.mergeProps(n,{get children(){return[f.createMemo(()=>t.top),(()=>{const i=zt.cloneNode(!0);return H(i,()=>t.children),i})(),f.createMemo(()=>t.bottom)]}}))}function Nt(e){const t=$(),n=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((c,[a,l])=>c+`${a}:${l};`,""),i=()=>`--gutter: ${b(t,e.gutter??"size00")??"0px"};`,r=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,o=()=>e.switchAt?`--switchAt: ${x(t,e.switchAt)??"0px"};`:"",s=()=>[n(),i(),r(),o()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","gutter","columns","switchAt"]),g({style:s,"data-bedrock-columns":()=>""})))}const Lt=e=>typeof e=="number"?e:1;function vt(e){const t=()=>typeof e.style=="string"?e.style:Object.entries(e.style??{}).reduce((s,[c,a])=>s+`${c}:${a};`,""),n=()=>`--span: ${Lt(e.span)};`,i=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",o=()=>[t(),n(),i(),r()].join("; ");return m(()=>e.as??"div",f.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),g({style:o,"data-bedrock-column":()=>""})))}u.Center=nt,u.Column=vt,u.ColumnDrop=ct,u.Columns=Nt,u.Cover=Ot,u.Frame=ut,u.Grid=K,u.Inline=jt,u.InlineCluster=St,u.MasonryGrid=ht,u.PadBox=Pt,u.Reel=Et,u.Split=It,u.Stack=Mt,u.ThemeProvider=it,u.checkIsCSSLength=M,u.createContainerQuery=st,u.getSafeGutter=k,u.getSizeValue=x,u.getSpacingValue=b,u.sizes=U,u.spacing=Q,u.useTheme=$,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/lib/inline-cluster.d.ts
CHANGED
|
@@ -17,6 +17,6 @@ export interface InlineClusterBaseProps {
|
|
|
17
17
|
align?: keyof typeof alignMap;
|
|
18
18
|
gutter: SpacingOptions;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type InlineClusterProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, InlineClusterBaseProps>;
|
|
21
21
|
export declare function InlineCluster<T extends ValidConstructor = "div">(props: InlineClusterProps<T>): JSX.Element;
|
|
22
22
|
export {};
|
package/lib/inline.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JSX } from "solid-js";
|
|
2
|
-
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
2
|
+
import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
|
|
3
3
|
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare type MinItemWidth = number | CSSLength;
|
|
4
|
+
type Stretch = "all" | "start" | "end" | 0 | 1 | 2 | 3 | 4;
|
|
5
|
+
type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
|
|
7
6
|
declare const justifyMap: {
|
|
8
7
|
readonly start: "justify:start";
|
|
9
8
|
readonly end: "justify:end";
|
|
@@ -17,12 +16,12 @@ declare const alignMap: {
|
|
|
17
16
|
};
|
|
18
17
|
export interface InlineBaseProps {
|
|
19
18
|
stretch?: Stretch;
|
|
20
|
-
switchAt?:
|
|
19
|
+
switchAt?: number | CSSLength | SizesOptions;
|
|
21
20
|
justify?: keyof typeof justifyMap;
|
|
22
21
|
align?: keyof typeof alignMap;
|
|
23
22
|
gutter?: SpacingOptions;
|
|
24
23
|
minItemWidth?: MinItemWidth;
|
|
25
24
|
}
|
|
26
|
-
export
|
|
25
|
+
export type InlineProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, InlineBaseProps>;
|
|
27
26
|
export declare function Inline<T extends ValidConstructor = "div">(props: InlineProps<T>): JSX.Element;
|
|
28
27
|
export {};
|
package/lib/padbox.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from "solid-js";
|
|
2
2
|
import { SpacingOptions } from "./spacing-constants";
|
|
3
3
|
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
4
|
-
|
|
4
|
+
type PaddingObj = {
|
|
5
5
|
left: SpacingOptions;
|
|
6
6
|
} | {
|
|
7
7
|
right: SpacingOptions;
|
|
@@ -18,10 +18,10 @@ declare type PaddingObj = {
|
|
|
18
18
|
} | {
|
|
19
19
|
blockEnd: SpacingOptions;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
type PaddingTypes = SpacingOptions | PaddingObj | [SpacingOptions] | [SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions, SpacingOptions];
|
|
22
22
|
export interface PadBoxBaseProps {
|
|
23
|
-
padding
|
|
23
|
+
padding?: PaddingTypes;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
25
|
+
export type PadBoxProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, PadBoxBaseProps>;
|
|
26
26
|
export declare function PadBox<T extends ValidConstructor = "div">(props: PadBoxProps<T>): JSX.Element;
|
|
27
27
|
export {};
|
package/lib/reel.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export interface ReelBaseProps {
|
|
|
5
5
|
snapType?: "none" | "proximity" | "mandatory";
|
|
6
6
|
gutter?: SpacingOptions;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export type ReelProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, ReelBaseProps>;
|
|
9
9
|
export declare function Reel<T extends ValidConstructor = "div">(props: ReelProps<T>): JSX.Element;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import type { DefaultTheme } from "./theme-provider";
|
|
2
2
|
import { Maybe } from "./typeUtils";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
9
11
|
export declare function checkIsCSSLength(str: string): str is CSSLength;
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
sm: CSSLength;
|
|
15
|
-
md: CSSLength;
|
|
16
|
-
mdLg: CSSLength;
|
|
17
|
-
lg: CSSLength;
|
|
18
|
-
lgXl: CSSLength;
|
|
19
|
-
xl: CSSLength;
|
|
20
|
-
xlXXl: CSSLength;
|
|
21
|
-
xxl: CSSLength;
|
|
22
|
-
}
|
|
23
|
-
export declare const spacing: Spacing;
|
|
24
|
-
export declare type BaseTheme = Record<string, CSSLength | string | number>;
|
|
25
|
-
declare type ThemeOrDefaultSpace<T> = T extends {
|
|
12
|
+
export declare const spacing: Record<"size000" | "size00" | "size1" | "size2" | "size3" | "size4" | "size5" | "size6" | "size7" | "size8" | "size9" | "size10" | "size11" | "size12" | "size13" | "size14" | "size15", CSSLength>;
|
|
13
|
+
export declare const sizes: Record<"sizeXxs" | "sizeXs" | "sizeSm" | "sizeMd" | "sizeLg" | "sizeXl" | "sizeXxl" | "sizeContent1" | "sizeContent2" | "sizeContent3" | "sizeHeader1" | "sizeHeader2" | "sizeHeader3", CSSLength>;
|
|
14
|
+
export type BaseTheme = Record<string, CSSLength | string | number>;
|
|
15
|
+
type ThemeOrDefaultSpace<T> = T extends {
|
|
26
16
|
space: BaseTheme;
|
|
27
|
-
} ? keyof T["space"] : keyof
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
} ? keyof T["space"] : keyof typeof spacing;
|
|
18
|
+
export type SpacingOptions = ThemeOrDefaultSpace<DefaultTheme>;
|
|
19
|
+
export type SizesOptions = ThemeOrDefaultSizes<DefaultTheme>;
|
|
20
|
+
type ThemeOrDefaultSizes<T> = T extends {
|
|
21
|
+
sizes: BaseTheme;
|
|
22
|
+
} ? T["sizes"] : keyof typeof sizes;
|
|
23
|
+
export type Gutter = CSSLength | number | SpacingOptions;
|
|
24
|
+
export declare function getSafeGutter<T extends DefaultTheme>(theme: T, gutter?: Gutter): Maybe<CSSLength>;
|
|
25
|
+
export declare function getSpacingValue<T extends DefaultTheme>(theme: T & {
|
|
26
|
+
space?: BaseTheme;
|
|
27
|
+
}, spacingKey: SpacingOptions): Maybe<CSSLength>;
|
|
28
|
+
export declare function getSizeValue<T extends DefaultTheme>(theme: T & {
|
|
29
|
+
sizes?: BaseTheme;
|
|
30
|
+
}, sizeKey?: CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto"): Maybe<CSSLength>;
|
|
31
31
|
export {};
|
package/lib/split.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
3
|
-
import { StackProps } from "./stack";
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
import { CSSLength, SizesOptions, SpacingOptions } from "./spacing-constants";
|
|
4
3
|
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
5
|
-
|
|
4
|
+
type FractionTypes = "auto-start" | "auto-end" | "1/4" | "1/3" | "1/2" | "2/3" | "3/4";
|
|
5
|
+
type MinItemWidth = CSSLength | number | SizesOptions | "fit-content" | "max-content" | "min-content" | "auto";
|
|
6
6
|
interface SplitBase {
|
|
7
7
|
gutter?: SpacingOptions;
|
|
8
|
+
minItemWidth?: MinItemWidth;
|
|
8
9
|
fraction?: FractionTypes;
|
|
9
|
-
}
|
|
10
|
-
export declare type SplitBaseProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, SplitBase>;
|
|
11
|
-
export declare function SplitBase<T extends ValidConstructor = "div">(props: SplitBaseProps<T>): JSX.Element;
|
|
12
|
-
export interface SplitProps extends StackProps, SplitBaseProps {
|
|
13
10
|
switchAt?: number | CSSLength;
|
|
14
11
|
}
|
|
15
|
-
export
|
|
12
|
+
export type SplitProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, SplitBase>;
|
|
13
|
+
export declare function Split<T extends ValidConstructor = "div">(props: SplitProps<T>): JSX.Element;
|
|
16
14
|
export {};
|
package/lib/stack.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
|
4
4
|
export interface StackPropsBase {
|
|
5
5
|
gutter?: SpacingOptions;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type StackProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, StackPropsBase>;
|
|
8
8
|
export declare function Stack<T extends ValidConstructor = "div">(props: StackProps<T>): JSX.Element;
|
package/lib/typeUtils.d.ts
CHANGED
|
@@ -6,27 +6,27 @@
|
|
|
6
6
|
* attribute where its appropriate.
|
|
7
7
|
*/
|
|
8
8
|
import { JSX } from "solid-js";
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
export type OmitAndMerge<A, B> = A & Omit<B, keyof A>;
|
|
10
|
+
export type Accessor<T = unknown> = () => T;
|
|
11
|
+
export type Maybe<T> = NonNullable<T> | undefined;
|
|
12
|
+
export type ValidElements = keyof JSX.IntrinsicElements;
|
|
13
|
+
export type ValidComponent<P> = (props: P) => JSX.Element;
|
|
14
|
+
export type ValidConstructor = ValidElements | ValidComponent<any> | (string & {});
|
|
15
|
+
export type DynamicProps<T extends ValidConstructor> = T extends ValidElements ? JSX.IntrinsicElements[T] : T extends ValidComponent<infer U> ? U : Record<string, unknown>;
|
|
16
|
+
type UnboxIntrinsicElements<T> = T extends JSX.HTMLAttributes<infer U> ? U : never;
|
|
17
|
+
type RefCallback<T> = (el: T) => void;
|
|
18
|
+
type RefField<T> = T | RefCallback<T>;
|
|
19
|
+
type UnboxComponentProp<U> = U extends {
|
|
20
20
|
ref: infer X;
|
|
21
21
|
} ? X : never;
|
|
22
|
-
export
|
|
22
|
+
export type DynamicNode<T extends ValidConstructor> = T extends ValidElements ? UnboxIntrinsicElements<JSX.IntrinsicElements[T]> : T extends ValidComponent<infer U> ? UnboxComponentProp<U> : never;
|
|
23
23
|
export interface WithRef<T extends ValidConstructor> {
|
|
24
24
|
ref?: RefField<DynamicNode<T>>;
|
|
25
25
|
}
|
|
26
26
|
export interface DynamicComponentWithRef<T extends ValidConstructor> extends WithRef<T> {
|
|
27
27
|
as?: T;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type HeadlessPropsWithRef<T extends ValidConstructor, V = {}> = OmitAndMerge<V & DynamicComponentWithRef<T>, DynamicProps<T>>;
|
|
30
30
|
export declare function convertToMaybe<T extends unknown>(value: T): Maybe<T>;
|
|
31
31
|
export declare function omitProps<T extends Record<string, any>, K extends keyof T>(value: T, keys: K[]): Omit<T, K>;
|
|
32
32
|
export default function createDynamic<T extends ValidConstructor>(source: () => T, props: DynamicProps<T>): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock-layout/solid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.2",
|
|
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,
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
|
-
"solidhack",
|
|
13
|
-
"best_ecosystem",
|
|
14
12
|
"primitives",
|
|
15
13
|
"layout",
|
|
16
14
|
"bedrock",
|
|
@@ -53,10 +51,10 @@
|
|
|
53
51
|
"url": "git+https://github.com/Bedrock-Layouts/Solid-Bedrock.git"
|
|
54
52
|
},
|
|
55
53
|
"peerDependencies": {
|
|
54
|
+
"@bedrock-layout/css": "^2.1.0",
|
|
56
55
|
"solid-js": "^1.3.7"
|
|
57
56
|
},
|
|
58
57
|
"dependencies": {
|
|
59
|
-
"@bedrock-layout/bedrock-layout-css": "^2.0.3",
|
|
60
58
|
"@bedrock-layout/register-resize-callback": "^2.0.0"
|
|
61
59
|
},
|
|
62
60
|
"scripts": {
|
|
@@ -72,5 +70,5 @@
|
|
|
72
70
|
"bugs": {
|
|
73
71
|
"url": "https://github.com/Bedrock-Layouts/Solid-Bedrock/issues"
|
|
74
72
|
},
|
|
75
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "493961f50f7c7257c2d2844952e8f7beaaf8c96f"
|
|
76
74
|
}
|