@bedrock-layout/solid 0.7.1 → 0.7.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/lib/center.d.ts +11 -0
- package/lib/column-drop.d.ts +11 -0
- package/lib/frame.d.ts +10 -0
- package/lib/grid.d.ts +10 -0
- package/lib/index.cjs.js +31 -31
- package/lib/index.d.ts +10 -131
- package/lib/index.m.js +10 -906
- package/lib/index.umd.js +24 -24
- package/lib/inline-cluster.d.ts +21 -0
- package/lib/inline.d.ts +11 -0
- package/lib/padbox.d.ts +26 -0
- package/lib/reel.d.ts +8 -0
- package/lib/spacing-constants.d.ts +31 -0
- package/lib/stack.d.ts +7 -0
- package/package.json +2 -2
package/lib/center.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSLength } from "./spacing-constants";
|
|
2
|
+
declare type MaxWidth = number | CSSLength;
|
|
3
|
+
export interface CenterProps {
|
|
4
|
+
maxWidth?: MaxWidth;
|
|
5
|
+
centerText?: boolean;
|
|
6
|
+
centerChildren?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const Center: ((props: CenterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
9
|
+
className: (props: CenterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
2
|
+
declare type Basis = CSSLength | number;
|
|
3
|
+
export interface ColumnDropProps {
|
|
4
|
+
gutter?: SpacingOptions;
|
|
5
|
+
basis?: Basis;
|
|
6
|
+
noStretchedColumns?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ColumnDrop: ((props: ColumnDropProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
9
|
+
className: (props: ColumnDropProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
package/lib/frame.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare type RatioString = `${number}/${number}` | `${number} / ${number}`;
|
|
2
|
+
declare type Ratio = [number, number] | RatioString;
|
|
3
|
+
export interface FrameProps {
|
|
4
|
+
ratio?: Ratio;
|
|
5
|
+
position?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Frame: ((props: FrameProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
8
|
+
className: (props: FrameProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
package/lib/grid.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
2
|
+
declare type MinItemWidth = number | CSSLength;
|
|
3
|
+
export interface GridProps {
|
|
4
|
+
gutter?: SpacingOptions;
|
|
5
|
+
minItemWidth?: MinItemWidth;
|
|
6
|
+
}
|
|
7
|
+
export declare const Grid: ((props: GridProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
8
|
+
className: (props: GridProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
package/lib/index.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var me=Object.defineProperty,xe=Object.defineProperties;var be=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var we=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var K=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t)=>{for(var n in t||(t={}))we.call(t,n)&&K(e,n,t[n]);if(X)for(var n of X(t))Se.call(t,n)&&K(e,n,t[n]);return e},D=(e,t)=>xe(e,be(t));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";let $e={data:""},Ae=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||$e,Ce=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ve=/\/\*[^]*?\*\/|\s\s+|\n/g,b=(e,t)=>{let n="",i="",r="";for(let s in e){let l=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+l+";":i+=s[1]=="f"?b(l,s):s+"{"+b(l,s[1]=="k"?"":t)+"}":typeof l=="object"?i+=b(l,t?t.replace(/([^,])+/g,o=>s.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,o):o?o+" "+c:c)):s):l!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=b.p?b.p(s,l):s+":"+l+";")}return n+(t&&r?t+"{"+r+"}":r)+i},C={},re=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+re(e[n]);return t}return e},ke=(e,t,n,i,r)=>{let s=re(e),l=C[s]||(C[s]=(o=>{let c=0,a=11;for(;c<o.length;)a=101*a+o.charCodeAt(c++)>>>0;return"go"+a})(s));if(!C[l]){let o=s!==e?e:(c=>{let a,u=[{}];for(;a=Ce.exec(c.replace(ve,""));)a[4]?u.shift():a[3]?u.unshift(u[0][a[3]]=u[0][a[3]]||{}):u[0][a[1]]=a[2];return u[0]})(e);C[l]=b(r?{["@keyframes "+l]:o}:o,n?"":"."+l)}return((o,c,a)=>{c.data.indexOf(o)==-1&&(c.data=a?o+c.data:c.data+o)})(C[l],t,i),l},Ee=(e,t,n)=>e.reduce((i,r,s)=>{let l=t[s];if(l&&l.call){let o=l(n),c=o&&o.props&&o.props.className||/^go/.test(o)&&o;l=c?"."+c:o&&typeof o=="object"?o.props?"":b(o,""):o===!1?"":o}return i+r+(l==null?"":l)},"");function w(e){let t=this||{},n=e.call?e(t.p):e;return ke(n.unshift?n.raw?Ee(n,[].slice.call(arguments,1),t.p):n.reduce((i,r)=>Object.assign(i,r&&r.call?r(t.p):r),{}):n,Ae(t.target),t.g,t.o,t.k)}w.bind({g:1});w.bind({k:1});const Ne=(e,t)=>e===t,je=Symbol("solid-proxy"),G={equals:Ne};let Pe=ae;const O={},x=1,R=2,Oe={owned:null,cleanups:null,context:null,owner:null};var h=null;let E=null,f=null,v=null,g=null,m=null,V=0;function Te(e,t,n){const i=_(e,t,!0,x);N(i)}function k(e,t,n){const i=_(e,t,!1,x);N(i)}function H(e,t,n){n=n?Object.assign({},G,n):G;const i=_(e,t,!0,0);return i.pending=O,i.observers=null,i.observerSlots=null,i.comparator=n.equals||void 0,N(i),Be.bind(i)}function Le(e){if(v)return e();let t;const n=v=[];try{t=e()}finally{v=null}return ce(()=>{for(let i=0;i<n.length;i+=1){const r=n[i];if(r.pending!==O){const s=r.pending;r.pending=O,le(r,s)}}},!1),t}function W(e){let t,n=f;return f=null,t=e(),f=n,t}function Ie(e){const t=Symbol("context");return{id:t,Provider:Re(t),defaultValue:e}}function De(e){return de(h,e.id)||e.defaultValue}function Me(e){const t=H(e);return H(()=>z(t()))}function Be(){const e=E;if(this.sources&&(this.state||e)){const t=g;g=null,this.state===x||e?N(this):U(this),g=t}if(f){const t=this.observers?this.observers.length:0;f.sources?(f.sources.push(this),f.sourceSlots.push(t)):(f.sources=[this],f.sourceSlots=[t]),this.observers?(this.observers.push(f),this.observerSlots.push(f.sources.length-1)):(this.observers=[f],this.observerSlots=[f.sources.length-1])}return this.value}function le(e,t,n){if(e.comparator&&e.comparator(e.value,t))return t;if(v)return e.pending===O&&v.push(e),e.pending=t,t;let i=!1;return e.value=t,e.observers&&e.observers.length&&ce(()=>{for(let r=0;r<e.observers.length;r+=1){const s=e.observers[r];i&&E.disposed.has(s),s.pure?g.push(s):m.push(s),s.observers&&(i&&!s.tState||!i&&!s.state)&&ue(s),i||(s.state=x)}if(g.length>1e6)throw g=[],new Error},!1),t}function N(e){if(!e.fn)return;fe(e);const t=h,n=f,i=V;f=h=e,ze(e,e.value,i),f=n,h=t}function ze(e,t,n){let i;try{i=e.fn(t)}catch(r){ge(r)}(!e.updatedAt||e.updatedAt<=n)&&(e.observers&&e.observers.length?le(e,i):e.value=i,e.updatedAt=n)}function _(e,t,n,i=x,r){const s={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:h,context:null,pure:n};return h===null||h!==Oe&&(h.owned?h.owned.push(s):h.owned=[s]),s}function oe(e){const t=E;if(e.state!==x)return e.state=0;if(e.suspense&&W(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<V);)(e.state||t)&&n.push(e);for(let i=n.length-1;i>=0;i--)if(e=n[i],e.state===x||t)N(e);else if(e.state===R||t){const r=g;g=null,U(e,n[0]),g=r}}function ce(e,t){if(g)return e();let n=!1;t||(g=[]),m?n=!0:m=[],V++;try{return e()}catch(i){ge(i)}finally{Fe(n)}}function Fe(e){g&&(ae(g),g=null),!e&&(m.length?Le(()=>{Pe(m),m=null}):m=null)}function ae(e){for(let t=0;t<e.length;t++)oe(e[t])}function U(e,t){e.state=0;const n=E;for(let i=0;i<e.sources.length;i+=1){const r=e.sources[i];r.sources&&(r.state===x||n?r!==t&&oe(r):(r.state===R||n)&&U(r,t))}}function ue(e){const t=E;for(let n=0;n<e.observers.length;n+=1){const i=e.observers[n];(!i.state||t)&&(i.state=R,i.pure?g.push(i):m.push(i),i.observers&&ue(i))}}function fe(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),i=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){const s=r.pop(),l=n.observerSlots.pop();i<r.length&&(s.sourceSlots[l]=i,r[i]=s,n.observerSlots[i]=l)}}if(e.owned){for(t=0;t<e.owned.length;t++)fe(e.owned[t]);e.owned=null}if(e.cleanups){for(t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function ge(e){throw e}function de(e,t){return e&&(e.context&&e.context[t]!==void 0?e.context[t]:e.owner&&de(e.owner,t))}function z(e){if(typeof e=="function"&&!e.length)return z(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const i=z(e[n]);Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}return e}function Re(e){return function(n){let i;return Te(()=>i=W(()=>(h.context={[e]:n.value},Me(()=>n.children)))),i}}function j(){return!0}const he={get(e,t,n){return t===je?n:e.get(t)},has(e,t){return e.has(t)},set:j,deleteProperty:j,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:j,deleteProperty:j}},ownKeys(e){return e.keys()}};function M(e){return typeof e=="function"?e():e}function Q(...e){return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const i=M(e[n])[t];if(i!==void 0)return i}},has(t){for(let n=e.length-1;n>=0;n--)if(t in M(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(M(e[n])));return[...new Set(t)]}},he)}function Y(e,...t){const n=new Set(t.flat()),i=Object.getOwnPropertyDescriptors(e),r=t.map(s=>{const l={};for(let o=0;o<s.length;o++){const c=s[o];Object.defineProperty(l,c,i[c]?i[c]:{get(){return e[c]},set(){return!0}})}return l});return r.push(new Proxy({get(s){return n.has(s)?void 0:e[s]},has(s){return n.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!n.has(s))}},he)),r}const Ve=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],We=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ve]),_e=new Set(["innerHTML","textContent","innerText","children"]),Ue={className:"class",htmlFor:"for"},Z={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},qe=new Set(["beforeinput","click","dblclick","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Xe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Ke(e,t,n){let i=n.length,r=t.length,s=i,l=0,o=0,c=t[r-1].nextSibling,a=null;for(;l<r||o<s;){if(t[l]===n[o]){l++,o++;continue}for(;t[r-1]===n[s-1];)r--,s--;if(r===l){const u=s<i?o?n[o-1].nextSibling:n[s-o]:c;for(;o<s;)e.insertBefore(n[o++],u)}else if(s===o)for(;l<r;)(!a||!a.has(t[l]))&&t[l].remove(),l++;else if(t[l]===n[s-1]&&n[o]===t[r-1]){const u=t[--r].nextSibling;e.insertBefore(n[o++],t[l++].nextSibling),e.insertBefore(n[--s],u),t[r]=n[s]}else{if(!a){a=new Map;let d=o;for(;d<s;)a.set(n[d],d++)}const u=a.get(t[l]);if(u!=null)if(o<u&&u<s){let d=l,p=1,A;for(;++d<r&&d<s&&!((A=a.get(t[d]))==null||A!==u+p);)p++;if(p>u-o){const L=t[l];for(;o<u;)e.insertBefore(n[o++],L)}else e.replaceChild(n[o++],t[l++])}else l++;else t[l++].remove()}}}const J="_$DX_DELEGATE";function Ge(e,t=window.document){const n=t[J]||(t[J]=new Set);for(let i=0,r=e.length;i<r;i++){const s=e[i];n.has(s)||(n.add(s),t.addEventListener(s,it))}}function He(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function Qe(e,t,n,i){i==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,i)}function Ye(e,t,n,i){i?Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n:Array.isArray(n)?e.addEventListener(t,r=>n[0](n[1],r)):e.addEventListener(t,n)}function Ze(e,t,n={}){const i=Object.keys(t||{}),r=Object.keys(n);let s,l;for(s=0,l=r.length;s<l;s++){const o=r[s];!o||o==="undefined"||t[o]||(ee(e,o,!1),delete n[o])}for(s=0,l=i.length;s<l;s++){const o=i[s],c=!!t[o];!o||o==="undefined"||n[o]===c||!c||(ee(e,o,!0),n[o]=c)}return n}function Je(e,t,n={}){const i=e.style;if(t==null||typeof t=="string")return i.cssText=t;typeof n=="string"&&(n={});let r,s;for(s in n)t[s]==null&&i.removeProperty(s),delete n[s];for(s in t)r=t[s],r!==n[s]&&(i.setProperty(s,r),n[s]=r);return n}function et(e,t,n,i){typeof t=="function"?k(r=>ne(e,t(),r,n,i)):ne(e,t,void 0,n,i)}function tt(e,t,n,i,r={}){for(const s in r)if(!(s in t)){if(s==="children")continue;te(e,s,null,r[s],n)}for(const s in t){if(s==="children"){i||T(e,t.children);continue}const l=t[s];r[s]=te(e,s,l,r[s],n)}}function nt(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function ee(e,t,n){const i=t.trim().split(/\s+/);for(let r=0,s=i.length;r<s;r++)e.classList.toggle(i[r],n)}function te(e,t,n,i,r){let s,l,o;if(t==="style")return Je(e,n,i);if(t==="classList")return Ze(e,n,i);if(n===i)return i;if(t==="ref")n(e);else if(t.slice(0,3)==="on:")e.addEventListener(t.slice(3),n);else if(t.slice(0,10)==="oncapture:")e.addEventListener(t.slice(10),n,!0);else if(t.slice(0,2)==="on"){const c=t.slice(2).toLowerCase(),a=qe.has(c);Ye(e,c,n,a),a&&Ge([c])}else if((o=_e.has(t))||!r&&(Z[t]||(l=We.has(t)))||(s=e.nodeName.includes("-")))s&&!l&&!o?e[nt(t)]=n:e[Z[t]||t]=n;else{const c=r&&t.indexOf(":")>-1&&Xe[t.split(":")[0]];c?Qe(e,c,t,n):He(e,Ue[t]||t,n)}return n}function it(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}});n!==null;){const i=n[t];if(i&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?i(r,e):i(e),e.cancelBubble)return}n=n.host&&n.host!==n&&n.host instanceof Node?n.host:n.parentNode}}function ne(e,t,n={},i,r){return!r&&"children"in t&&k(()=>n.children=T(e,t.children,n.children)),k(()=>tt(e,t,i,!0,n)),n}function T(e,t,n,i,r){for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,l=i!==void 0;if(e=l&&n[0]&&n[0].parentNode||e,s==="string"||s==="number")if(s==="number"&&(t=t.toString()),l){let o=n[0];o&&o.nodeType===3?o.data=t:o=document.createTextNode(t),n=$(e,n,i,o)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;else if(t==null||s==="boolean")n=$(e,n,i);else{if(s==="function")return k(()=>{let o=t();for(;typeof o=="function";)o=o();n=T(e,o,n,i)}),()=>n;if(Array.isArray(t)){const o=[];if(F(o,t,r))return k(()=>n=T(e,o,n,i,!0)),()=>n;if(o.length===0){if(n=$(e,n,i),l)return n}else Array.isArray(n)?n.length===0?ie(e,o,i):Ke(e,n,o):(n&&$(e),ie(e,o));n=o}else if(t instanceof Node){if(Array.isArray(n)){if(l)return n=$(e,n,i,t);$(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function F(e,t,n){let i=!1;for(let r=0,s=t.length;r<s;r++){let l=t[r],o;if(l instanceof Node)e.push(l);else if(!(l==null||l===!0||l===!1))if(Array.isArray(l))i=F(e,l)||i;else if((o=typeof l)=="string")e.push(document.createTextNode(l));else if(o==="function")if(n){for(;typeof l=="function";)l=l();i=F(e,Array.isArray(l)?l:[l])||i}else e.push(l),i=!0;else e.push(document.createTextNode(l.toString()))}return i}function ie(e,t,n){for(let i=0,r=t.length;i<r;i++)e.insertBefore(t[i],n)}function $(e,t,n,i){if(n===void 0)return e.textContent="";const r=i||document.createTextNode("");if(t.length){let s=!1;for(let l=t.length-1;l>=0;l--){const o=t[l];if(r!==o){const c=o.parentNode===e;!s&&!l?c?e.replaceChild(r,o):e.insertBefore(r,n):c&&o.remove()}else s=!0}}else e.insertBefore(r,n);return[r]}function st(e,...t){}const rt=!1,lt=Ie();function ot(e){let t=this||{};return(...n)=>{const i=r=>{const s=De(lt),l=Q(r,{theme:s}),o=Q(l,{get className(){const p=l.className,A="className"in l&&/^go[0-9]+/.test(p);let L=w.apply({target:t.target,o:A,p:l,g:t.g},n);return[p,L].filter(Boolean).join(" ")}}),[c,a]=Y(o,["as"]),u=c.as||e;let d;if(typeof u=="function")d=u(a);else if(rt){const[p,A]=Y(a,["children"]);d=st([`<${u} `,">",`</${u}>`],void 0,p.children||"")}else d=document.createElement(u),et(d,a);return d};return i.className=r=>W(()=>w.apply({target:t.target,p:r,g:t.g},n)),i}}const y=new Proxy(ot,{get(e,t){return e(t)}});function ye(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 q={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 ct(e){return e.reduce((t,[n,i])=>D(I({},t),{[n]:i}),{})}const S=(e,t)=>{var l,o;const n=(o=(l=t==null?void 0:t.space)!=null?l:t==null?void 0:t.spacing)!=null?o:q,r=ct(Object.entries(n).map(([c,a])=>[c,typeof a=="number"?`${a}px`:a]))[e];return ye(r)?r:void 0};function at(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const ut=y("div")`
|
|
1
|
+
"use strict";var S=Object.defineProperty,k=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var b=(t,e,n)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,f=(t,e)=>{for(var n in e||(e={}))A.call(e,n)&&b(t,n,e[n]);if(m)for(var n of m(e))j.call(e,n)&&b(t,n,e[n]);return t},x=(t,e)=>k(t,w(e));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var r=require("solid-styled-components");function v(t){return typeof t!="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(e=>e.test(t))}const p={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 C(t){return t.reduce((e,[n,c])=>x(f({},e),{[n]:c}),{})}const s=(t,e)=>{var i,o;const n=(o=(i=e==null?void 0:e.space)!=null?i:e==null?void 0:e.spacing)!=null?o:p,a=C(Object.entries(n).map(([g,d])=>[g,typeof d=="number"?`${d}px`:d]))[t];return v(a)?a:void 0};function z(t){return t===void 0?"100%":typeof t=="number"?`${t}px`:t}const I=r.styled.div`
|
|
2
2
|
@property --maxWidth {
|
|
3
3
|
syntax: "<length-percentage>";
|
|
4
4
|
inherits: false;
|
|
5
5
|
initial-value: 100%;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
--maxWidth: ${
|
|
8
|
+
--maxWidth: ${t=>z(t.maxWidth)};
|
|
9
9
|
|
|
10
10
|
box-sizing: content-box;
|
|
11
11
|
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
|
|
18
18
|
max-inline-size: var(--maxWidth, 100%);
|
|
19
19
|
|
|
20
|
-
${
|
|
20
|
+
${t=>t.centerChildren?r.css`
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
`:""}
|
|
25
25
|
|
|
26
|
-
${
|
|
26
|
+
${t=>t.centerText?r.css`
|
|
27
27
|
text-align: center;
|
|
28
28
|
`:""}
|
|
29
|
-
`;function
|
|
29
|
+
`;function O(t){return t===void 0?"100%":typeof t=="number"?`${t}px`:t}const R=r.styled("div")`
|
|
30
30
|
@property --basis {
|
|
31
31
|
syntax: "<length-percentage>";
|
|
32
32
|
inherits: true;
|
|
@@ -39,29 +39,29 @@
|
|
|
39
39
|
initial-value: 0px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
--basis: ${
|
|
43
|
-
--gutter: ${
|
|
42
|
+
--basis: ${t=>O(t.basis)};
|
|
43
|
+
--gutter: ${t=>{var e;return t.gutter&&(e=s(t.gutter,t.theme))!=null?e:"0px"}};
|
|
44
44
|
|
|
45
45
|
box-sizing: border-box;
|
|
46
46
|
> * {
|
|
47
47
|
margin: 0;
|
|
48
48
|
flex-basis: var(--basis, 100%);
|
|
49
|
-
flex-grow: ${
|
|
49
|
+
flex-grow: ${t=>t.noStretchedColumns?"0":"1"};
|
|
50
50
|
flex-shrink: 1;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
display: flex;
|
|
54
54
|
flex-wrap: wrap;
|
|
55
55
|
gap: var(--gutter, 0px);
|
|
56
|
-
`;function
|
|
56
|
+
`;function W(t){return Array.isArray(t)&&t.length===2&&t.every(Number.isFinite)||typeof t=="string"&&/^\d{1,1000} {0,1}\/ {0,1}\d{1,1000}$/.test(t)}function M(t){return Array.isArray(t)?t.join("/"):t}function E(t){return W(t)?M(t):void 0}const P=r.styled.div`
|
|
57
57
|
box-sizing: border-box;
|
|
58
58
|
display: block;
|
|
59
59
|
inline-size: 100%;
|
|
60
60
|
position: relative;
|
|
61
61
|
overflow: hidden;
|
|
62
62
|
|
|
63
|
-
${
|
|
64
|
-
aspect-ratio: ${
|
|
63
|
+
${t=>{const e=E(t.ratio);return e?r.css`
|
|
64
|
+
aspect-ratio: ${e};
|
|
65
65
|
`:""}};
|
|
66
66
|
|
|
67
67
|
> * {
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
size: 100%;
|
|
87
87
|
|
|
88
88
|
object-fit: cover;
|
|
89
|
-
object-position: ${
|
|
89
|
+
object-position: ${t=>typeof t.position=="string"?t.position:"50%"};
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
91
|
+
`,D=r.styled("div")`
|
|
92
92
|
@property --gutter {
|
|
93
93
|
syntax: "<length-percentage>";
|
|
94
94
|
inherits: false;
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
initial-value: 639px;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
--gutter: ${
|
|
105
|
-
--minItemWidth: ${
|
|
104
|
+
--gutter: ${t=>{var e;return t.gutter&&(e=s(t.gutter,t.theme))!=null?e:"0px"}};
|
|
105
|
+
--minItemWidth: ${t=>{var e;return typeof t.minItemWidth=="string"?t.minItemWidth:`${(e=t.minItemWidth)!=null?e:0}px`}};
|
|
106
106
|
|
|
107
107
|
box-sizing: border-box;
|
|
108
108
|
> * {
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
auto-fit,
|
|
117
117
|
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
118
118
|
);
|
|
119
|
-
`,
|
|
120
|
-
--gutter: ${
|
|
119
|
+
`,l={start:"flex-start",end:"flex-end",center:"center"},y=x(f({},l),{stretch:"stretch"}),$=r.styled.div`
|
|
120
|
+
--gutter: ${t=>{var e;return t.gutter&&(e=s(t.gutter,t.theme))!=null?e:"0px"}};
|
|
121
121
|
|
|
122
122
|
box-sizing: border-box;
|
|
123
123
|
> * {
|
|
@@ -128,20 +128,20 @@
|
|
|
128
128
|
flex-wrap: wrap;
|
|
129
129
|
gap: var(--gutter, 0px);
|
|
130
130
|
|
|
131
|
-
justify-content: ${
|
|
131
|
+
justify-content: ${t=>typeof t.justify!="undefined"&&l[t.justify]?l[t.justify]:l.start};
|
|
132
132
|
|
|
133
|
-
align-items: ${
|
|
134
|
-
`;function
|
|
133
|
+
align-items: ${t=>typeof t.align!="undefined"&&y[t.align]?y[t.align]:y.start};
|
|
134
|
+
`;function L(t){return typeof t=="number"&&t>-1?!0:typeof t=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${t}`):!1}const T=r.styled($)`
|
|
135
135
|
@property --switchAt {
|
|
136
136
|
syntax: "<length-percentage>";
|
|
137
137
|
inherits: true;
|
|
138
138
|
initial-value: 0;
|
|
139
139
|
}
|
|
140
140
|
flex-wrap: nowrap;
|
|
141
|
-
${
|
|
141
|
+
${t=>t.stretch==="all"?"> * { flex: 1 }":t.stretch==="start"?"> :first-child { flex: 1 }":t.stretch==="end"?"> :last-child { flex: 1 }":typeof t.stretch=="number"?`> :nth-child(${t.stretch+1}) { flex: 1 }`:""}
|
|
142
142
|
|
|
143
|
-
${
|
|
144
|
-
--switchAt: ${typeof
|
|
143
|
+
${t=>L(t.switchAt)?`
|
|
144
|
+
--switchAt: ${typeof t.switchAt=="string"?t.switchAt:`${t.switchAt}px`};
|
|
145
145
|
flex-wrap: wrap;
|
|
146
146
|
> * {
|
|
147
147
|
min-inline-size: fit-content;
|
|
@@ -150,32 +150,32 @@
|
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
152
|
`:""}
|
|
153
|
-
`,
|
|
153
|
+
`,h=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),V=(t,e)=>({left:`padding-inline-start:${e};`,right:`padding-inline-end:${e};`,top:`padding-block-start:${e};`,bottom:`padding-block-end:${e};`,inlineStart:`padding-inline-start:${e};`,inlineEnd:`padding-inline-end:${e};`,blockStart:`padding-block-start:${e};`,blockEnd:`padding-block-end:${e};`})[t];function B(t){return e=>{const n=s(e,t);return n!=null?n:"0px"}}function F(t,e){var u;if(Array.isArray(e)&&e.length>4)throw new Error("padding arrays can only be 4 or less in length");const n=new Set(Object.keys((u=t==null?void 0:t.spacing)!=null?u:p));(()=>typeof e=="string"?!0:Array.isArray(e)?e.every(i=>n.has(i)):e&&Object.keys(e).every(i=>h.has(i))&&Object.values(e).every(i=>n.has(i)))()||console.error("Invalid padding Type");const a=B(t);return typeof e=="object"&&!Array.isArray(e)?Object.entries(e).reduce((i,[o,g])=>h.has(o)?i+V(o,a(g)):i,""):e?`padding: ${Array.from(Array.isArray(e)?e:[e]).map(i=>a(i)).join(" ")}`:""}const X=r.styled.div`
|
|
154
154
|
box-sizing: border-box;
|
|
155
|
-
${
|
|
156
|
-
`,
|
|
155
|
+
${t=>F(t.theme,t.padding)}
|
|
156
|
+
`,G=r.styled.div`
|
|
157
157
|
box-sizing: border-box;
|
|
158
158
|
> * {
|
|
159
159
|
margin: 0;
|
|
160
160
|
scroll-snap-align: start;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
--gutter: ${
|
|
163
|
+
--gutter: ${t=>{var e;return t.gutter&&(e=s(t.gutter,t.theme))!=null?e:"0px"}};
|
|
164
164
|
|
|
165
165
|
display: flex;
|
|
166
166
|
gap: var(--gutter, 0px);
|
|
167
167
|
|
|
168
168
|
overflow-x: scroll;
|
|
169
169
|
|
|
170
|
-
scroll-snap-type: ${({snapType:
|
|
171
|
-
`,
|
|
170
|
+
scroll-snap-type: ${({snapType:t="none"})=>{switch(t){case"none":return"none";case"proximity":return"x proximity";case"mandatory":return"x mandatory";default:return"none"}}};
|
|
171
|
+
`,_=r.styled("div")`
|
|
172
172
|
@property --gutter {
|
|
173
173
|
syntax: "<length-percentage>";
|
|
174
174
|
inherits: false;
|
|
175
175
|
initial-value: 0;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
--gutter: ${
|
|
178
|
+
--gutter: ${t=>{var e;return t.gutter&&(e=s(t.gutter,t.theme))!=null?e:"0px"}};
|
|
179
179
|
box-sizing: border-box;
|
|
180
180
|
> * {
|
|
181
181
|
margin: 0;
|
|
@@ -189,4 +189,4 @@
|
|
|
189
189
|
& > [data-bedrock-column] {
|
|
190
190
|
grid-column: span 1 / auto;
|
|
191
191
|
}
|
|
192
|
-
`;exports.Center=
|
|
192
|
+
`;exports.Center=I;exports.ColumnDrop=R;exports.Frame=P;exports.Grid=D;exports.Inline=T;exports.InlineCluster=$;exports.PadBox=X;exports.Reel=G;exports.Stack=_;exports.checkIsCSSLength=v;exports.getSpacingValue=s;exports.spacing=p;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,131 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
xxs: CSSLength;
|
|
12
|
-
xs: CSSLength;
|
|
13
|
-
sm: CSSLength;
|
|
14
|
-
md: CSSLength;
|
|
15
|
-
mdLg: CSSLength;
|
|
16
|
-
lg: CSSLength;
|
|
17
|
-
lgXl: CSSLength;
|
|
18
|
-
xl: CSSLength;
|
|
19
|
-
xlXXl: CSSLength;
|
|
20
|
-
xxl: CSSLength;
|
|
21
|
-
}
|
|
22
|
-
export declare const spacing: Spacing;
|
|
23
|
-
export declare type BaseTheme = Record<string, CSSLength | string | number>;
|
|
24
|
-
declare type ThemeOrDefaultSpace<T> = T extends {
|
|
25
|
-
space: BaseTheme;
|
|
26
|
-
} ? T["space"] : keyof Spacing;
|
|
27
|
-
declare type SpacingOptions = ThemeOrDefaultSpace<DefaultTheme>;
|
|
28
|
-
declare type MaybeValue = CSSLength | undefined;
|
|
29
|
-
declare type GetSpacingValue = (spacingKey: SpacingOptions, theme?: Partial<BaseTheme>) => MaybeValue;
|
|
30
|
-
export declare const getSpacingValue: GetSpacingValue;
|
|
31
|
-
declare type MaxWidth = number | CSSLength;
|
|
32
|
-
export interface CenterProps {
|
|
33
|
-
maxWidth?: MaxWidth;
|
|
34
|
-
centerText?: boolean;
|
|
35
|
-
centerChildren?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export declare const Center: ((props: CenterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
38
|
-
className: (props: CenterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
39
|
-
};
|
|
40
|
-
declare type Basis = CSSLength | number;
|
|
41
|
-
export interface ColumnDropProps {
|
|
42
|
-
gutter?: SpacingOptions;
|
|
43
|
-
basis?: Basis;
|
|
44
|
-
noStretchedColumns?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export declare const ColumnDrop: ((props: ColumnDropProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
47
|
-
className: (props: ColumnDropProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
48
|
-
};
|
|
49
|
-
declare type RatioString = `${number}/${number}` | `${number} / ${number}`;
|
|
50
|
-
declare type Ratio = [number, number] | RatioString;
|
|
51
|
-
export interface FrameProps {
|
|
52
|
-
ratio?: Ratio;
|
|
53
|
-
position?: string;
|
|
54
|
-
}
|
|
55
|
-
export declare const Frame: ((props: FrameProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
56
|
-
className: (props: FrameProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
57
|
-
};
|
|
58
|
-
declare type MinItemWidth = number | CSSLength;
|
|
59
|
-
export interface GridProps {
|
|
60
|
-
gutter?: SpacingOptions;
|
|
61
|
-
minItemWidth?: MinItemWidth;
|
|
62
|
-
}
|
|
63
|
-
export declare const Grid: ((props: GridProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
64
|
-
className: (props: GridProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
65
|
-
};
|
|
66
|
-
declare const justifyMap: {
|
|
67
|
-
readonly start: "flex-start";
|
|
68
|
-
readonly end: "flex-end";
|
|
69
|
-
readonly center: "center";
|
|
70
|
-
};
|
|
71
|
-
declare const alignMap: {
|
|
72
|
-
readonly stretch: "stretch";
|
|
73
|
-
readonly start: "flex-start";
|
|
74
|
-
readonly end: "flex-end";
|
|
75
|
-
readonly center: "center";
|
|
76
|
-
};
|
|
77
|
-
export interface InlineClusterProps {
|
|
78
|
-
justify?: keyof typeof justifyMap;
|
|
79
|
-
align?: keyof typeof alignMap;
|
|
80
|
-
gutter: SpacingOptions;
|
|
81
|
-
}
|
|
82
|
-
export declare const InlineCluster: ((props: InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
83
|
-
className: (props: InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
84
|
-
};
|
|
85
|
-
declare type Stretch = "all" | "start" | "end" | number;
|
|
86
|
-
declare type SwitchAt = string | number;
|
|
87
|
-
export interface InlineProps extends InlineClusterProps {
|
|
88
|
-
stretch?: Stretch;
|
|
89
|
-
switchAt?: SwitchAt;
|
|
90
|
-
}
|
|
91
|
-
export declare const Inline: ((props: InlineProps & InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
92
|
-
className: (props: InlineProps & InlineClusterProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
93
|
-
};
|
|
94
|
-
declare type PaddingObj = {
|
|
95
|
-
left: SpacingOptions;
|
|
96
|
-
} | {
|
|
97
|
-
right: SpacingOptions;
|
|
98
|
-
} | {
|
|
99
|
-
top: SpacingOptions;
|
|
100
|
-
} | {
|
|
101
|
-
bottom: SpacingOptions;
|
|
102
|
-
} | {
|
|
103
|
-
inlineStart: SpacingOptions;
|
|
104
|
-
} | {
|
|
105
|
-
inlineEnd: SpacingOptions;
|
|
106
|
-
} | {
|
|
107
|
-
blockStart: SpacingOptions;
|
|
108
|
-
} | {
|
|
109
|
-
blockEnd: SpacingOptions;
|
|
110
|
-
};
|
|
111
|
-
declare type PaddingTypes = SpacingOptions | PaddingObj | [SpacingOptions] | [SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions] | [SpacingOptions, SpacingOptions, SpacingOptions, SpacingOptions];
|
|
112
|
-
export interface PadBoxProps {
|
|
113
|
-
padding: PaddingTypes;
|
|
114
|
-
}
|
|
115
|
-
export declare const PadBox: ((props: PadBoxProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
116
|
-
className: (props: PadBoxProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
117
|
-
};
|
|
118
|
-
export interface ReelProps {
|
|
119
|
-
snapType?: "none" | "proximity" | "mandatory";
|
|
120
|
-
gutter: SpacingOptions;
|
|
121
|
-
}
|
|
122
|
-
export declare const Reel: ((props: ReelProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
123
|
-
className: (props: ReelProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
124
|
-
};
|
|
125
|
-
export interface StackProps {
|
|
126
|
-
gutter?: SpacingOptions;
|
|
127
|
-
}
|
|
128
|
-
export declare const Stack: ((props: StackProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => import("solid-js").JSX.Element) & {
|
|
129
|
-
className: (props: StackProps & import("solid-js").JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
130
|
-
};
|
|
131
|
-
export {};
|
|
1
|
+
export * from "./spacing-constants";
|
|
2
|
+
export * from "./center";
|
|
3
|
+
export * from "./column-drop";
|
|
4
|
+
export * from "./frame";
|
|
5
|
+
export * from "./grid";
|
|
6
|
+
export * from "./inline-cluster";
|
|
7
|
+
export * from "./inline";
|
|
8
|
+
export * from "./padbox";
|
|
9
|
+
export * from "./reel";
|
|
10
|
+
export * from "./stack";
|