@bedrock-layout/solid 0.11.10 → 0.12.1
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 +5 -4
- package/lib/column-drop.d.ts +7 -6
- package/lib/columns.d.ts +8 -16
- package/lib/cover.d.ts +4 -3
- package/lib/frame.d.ts +5 -4
- package/lib/grid.d.ts +5 -4
- package/lib/index.cjs.js +1 -318
- package/lib/index.d.ts +1 -0
- package/lib/index.m.js +1074 -459
- package/lib/index.umd.js +1 -318
- package/lib/inline-cluster.d.ts +12 -11
- package/lib/inline.d.ts +23 -6
- package/lib/masonry-grid.d.ts +2 -4
- package/lib/padbox.d.ts +5 -9
- package/lib/reel.d.ts +5 -4
- package/lib/spacing-constants.d.ts +4 -4
- package/lib/split.d.ts +4 -4
- package/lib/stack.d.ts +5 -4
- package/lib/theme-provider.d.ts +9 -0
- package/lib/toPx.d.ts +2 -1
- package/lib/typeUtils.d.ts +36 -0
- package/package.json +5 -5
package/lib/center.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
1
2
|
import { CSSLength } from "./spacing-constants";
|
|
3
|
+
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
2
4
|
declare type MaxWidth = number | CSSLength;
|
|
3
|
-
export interface
|
|
5
|
+
export interface CenterBaseProps {
|
|
4
6
|
maxWidth?: MaxWidth;
|
|
5
7
|
centerText?: boolean;
|
|
6
8
|
centerChildren?: boolean;
|
|
7
9
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
};
|
|
10
|
+
export declare type CenterProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, CenterBaseProps>;
|
|
11
|
+
export declare function Center<T extends ValidConstructor = "div">(props: CenterProps<T>): JSX.Element;
|
|
11
12
|
export {};
|
package/lib/column-drop.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
1
2
|
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
4
|
+
declare type MinItemWidth = CSSLength | number;
|
|
5
|
+
export interface ColumnDropBaseProps {
|
|
4
6
|
gutter?: SpacingOptions;
|
|
5
|
-
|
|
7
|
+
minItemWidth?: MinItemWidth;
|
|
6
8
|
noStretchedColumns?: boolean;
|
|
7
9
|
}
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
};
|
|
10
|
+
export declare type ColumnDropProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, ColumnDropBaseProps>;
|
|
11
|
+
export declare function ColumnDrop<T extends ValidConstructor = "div">(props: ColumnDropProps<T>): JSX.Element;
|
|
11
12
|
export {};
|
package/lib/columns.d.ts
CHANGED
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import { Component, JSX } from "solid-js";
|
|
2
2
|
import { SpacingOptions } from "./spacing-constants";
|
|
3
3
|
import { StackProps } from "./stack";
|
|
4
|
-
|
|
4
|
+
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
5
|
+
interface ColumnsBase {
|
|
5
6
|
gutter?: SpacingOptions;
|
|
6
7
|
columns?: number;
|
|
7
8
|
dense?: boolean;
|
|
8
9
|
}
|
|
10
|
+
export declare type ColumnsBaseProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, ColumnsBase>;
|
|
11
|
+
export declare function ColumnsBase<T extends ValidConstructor = "div">(props: ColumnsBaseProps<T>): JSX.Element;
|
|
9
12
|
export interface ColumnsProps extends StackProps, ColumnsBaseProps {
|
|
10
13
|
switchAt?: number | string;
|
|
11
|
-
as?: Component | keyof JSX.IntrinsicElements;
|
|
12
|
-
ref?: (ref: HTMLElement) => void;
|
|
13
14
|
}
|
|
14
15
|
export declare const Columns: Component<ColumnsProps>;
|
|
15
|
-
export interface
|
|
16
|
-
|
|
16
|
+
export interface ColumnBaseProps {
|
|
17
|
+
span?: number;
|
|
17
18
|
offsetStart?: number;
|
|
18
19
|
offsetEnd?: number;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
* span is remaped to colSpan due to span being an attribute that gets
|
|
24
|
-
* passed to the underlying element. This can cause issues with Grid layout.
|
|
25
|
-
*
|
|
26
|
-
* In a future breaking change, colSpan should be the public API.
|
|
27
|
-
* */
|
|
28
|
-
export declare const Column: ((props: ColumnProps & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
29
|
-
className: (props: ColumnProps & JSX.HTMLAttributes<HTMLDivElement>) => string;
|
|
30
|
-
};
|
|
21
|
+
export declare type ColumnProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, ColumnBaseProps>;
|
|
22
|
+
export declare function Column<T extends ValidConstructor = "div">(props: ColumnProps<T>): JSX.Element;
|
|
31
23
|
export {};
|
package/lib/cover.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, JSXElement } from "solid-js";
|
|
2
2
|
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
3
|
+
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
3
4
|
declare type MinHeight = CSSLength | number;
|
|
4
|
-
interface
|
|
5
|
+
interface CoverWrapperBaseProps {
|
|
5
6
|
gutter?: SpacingOptions;
|
|
6
7
|
minHeight?: MinHeight;
|
|
7
8
|
stretchContent?: boolean;
|
|
8
9
|
}
|
|
10
|
+
export declare type CoverWrapperProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, CoverWrapperBaseProps>;
|
|
9
11
|
export interface CoverProps extends CoverWrapperProps {
|
|
10
12
|
top?: JSXElement;
|
|
11
13
|
bottom?: JSXElement;
|
|
12
|
-
as?: Component | keyof JSX.IntrinsicElements;
|
|
13
14
|
}
|
|
14
15
|
export declare const Cover: Component<CoverProps & {
|
|
15
16
|
children?: JSXElement;
|
package/lib/frame.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
1
3
|
declare type RatioString = `${number}/${number}` | `${number} / ${number}`;
|
|
2
4
|
declare type Ratio = [number, number] | RatioString;
|
|
3
|
-
export interface
|
|
5
|
+
export interface FrameBaseProps {
|
|
4
6
|
ratio?: Ratio;
|
|
5
7
|
position?: string;
|
|
6
8
|
}
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
};
|
|
9
|
+
export declare type FrameProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, FrameBaseProps>;
|
|
10
|
+
export declare function Frame<T extends ValidConstructor = "div">(props: FrameProps<T>): JSX.Element;
|
|
10
11
|
export {};
|
package/lib/grid.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
1
2
|
import { CSSLength, SpacingOptions } from "./spacing-constants";
|
|
3
|
+
import { HeadlessPropsWithRef, ValidConstructor } from "./typeUtils";
|
|
2
4
|
declare type MinItemWidth = number | CSSLength;
|
|
3
|
-
export interface
|
|
5
|
+
export interface GridBaseProps {
|
|
4
6
|
gutter?: SpacingOptions;
|
|
5
7
|
minItemWidth?: MinItemWidth;
|
|
6
8
|
}
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
};
|
|
9
|
+
export declare type GridProps<T extends ValidConstructor = "div"> = HeadlessPropsWithRef<T, GridBaseProps>;
|
|
10
|
+
export declare function Grid<T extends ValidConstructor = "div">(props: GridProps<T>): JSX.Element;
|
|
10
11
|
export {};
|
package/lib/index.cjs.js
CHANGED
|
@@ -1,318 +1 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty,D=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var M=(e,t,n)=>t in e?L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t)=>{for(var n in t||(t={}))H.call(t,n)&&M(e,n,t[n]);if(z)for(var n of z(t))F.call(t,n)&&M(e,n,t[n]);return e},m=(e,t)=>D(e,X(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var s=require("solid-styled-components"),b=require("@bedrock-layout/register-resize-callback"),o=require("solid-js");function C(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 A={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 G(e){return e.reduce((t,[n,r])=>m(f({},t),{[n]:r}),{})}const d=(e,t)=>{var a,l;const n=(l=(a=t==null?void 0:t.space)!=null?a:t==null?void 0:t.spacing)!=null?l:A,i=G(Object.entries(n).map(([u,g])=>[u,typeof g=="number"?`${g}px`:g]))[e];return C(i)?i:void 0};function N(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}const _=s.styled.div`
|
|
2
|
-
@property --maxWidth {
|
|
3
|
-
syntax: "<length-percentage>";
|
|
4
|
-
inherits: false;
|
|
5
|
-
initial-value: 100%;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
--maxWidth: ${e=>N(e.maxWidth)};
|
|
9
|
-
|
|
10
|
-
box-sizing: content-box;
|
|
11
|
-
|
|
12
|
-
&& {
|
|
13
|
-
margin-inline-start: auto;
|
|
14
|
-
margin-inline-end: auto;
|
|
15
|
-
margin-inline: auto;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
max-inline-size: var(--maxWidth, 100%);
|
|
19
|
-
|
|
20
|
-
${e=>e.centerChildren?`
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
`:""}
|
|
25
|
-
|
|
26
|
-
${e=>e.centerText?`
|
|
27
|
-
text-align: center;
|
|
28
|
-
`:""}
|
|
29
|
-
`;function q(e){return e===void 0?"159px":typeof e=="number"?`${e}px`:e}const Q=s.styled("div")`
|
|
30
|
-
@property --basis {
|
|
31
|
-
syntax: "<length-percentage>";
|
|
32
|
-
inherits: true;
|
|
33
|
-
initial-value: 159px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@property --gutter {
|
|
37
|
-
syntax: "<length-percentage>";
|
|
38
|
-
inherits: false;
|
|
39
|
-
initial-value: 0px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
--basis: ${e=>q(e.basis)};
|
|
43
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
44
|
-
|
|
45
|
-
box-sizing: border-box;
|
|
46
|
-
> * {
|
|
47
|
-
margin: 0;
|
|
48
|
-
flex-basis: var(--basis, 159px);
|
|
49
|
-
flex-grow: ${e=>e.noStretchedColumns?"0":"1"};
|
|
50
|
-
flex-shrink: 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
display: flex;
|
|
54
|
-
flex-wrap: wrap;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
gap: var(--gutter, 0px);
|
|
57
|
-
`;function S(e){throw new Error(e)}function U(e){typeof e!="number"&&!Array.isArray(e)&&S("width must be a number or an array of two numbers"),Array().concat(e).some(n=>n<0)&&S("width value(s) must be 0 or greater"),Array.isArray(e)&&(e.length!==2||e[0]>e[1])&&S(`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){U(e);const[n,r]=o.createSignal(!1),[i,c]=o.createSignal();return o.onMount(()=>{b.init()}),o.createEffect(()=>{if(i()===void 0||i()===null)return;t&&t(i());const a=b.registerCallback(i(),l=>{var g,y;const u=(y=(g=l.borderBoxSize)==null?void 0:g.inlineSize)!=null?y:l.contentRect.width;if(u>0){const v=Array.isArray(e)?u>=e[0]&&u<=e[1]:u<=e;r(v)}});o.onCleanup(a)}),[n,c]}function J(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 K(e){return Array.isArray(e)?e.join("/"):e}function Y(e){return J(e)?K(e):void 0}const Z=s.styled.div`
|
|
58
|
-
box-sizing: border-box;
|
|
59
|
-
display: block;
|
|
60
|
-
inline-size: 100%;
|
|
61
|
-
position: relative;
|
|
62
|
-
overflow: hidden;
|
|
63
|
-
|
|
64
|
-
${e=>{const t=Y(e.ratio);return t?`
|
|
65
|
-
aspect-ratio: ${t};
|
|
66
|
-
`:""}};
|
|
67
|
-
|
|
68
|
-
> * {
|
|
69
|
-
position: absolute;
|
|
70
|
-
|
|
71
|
-
inset-block-start: 0;
|
|
72
|
-
inset-block-end: 0;
|
|
73
|
-
inset-inline-start: 0;
|
|
74
|
-
inset-inline-end: 0;
|
|
75
|
-
|
|
76
|
-
inset-block: 0;
|
|
77
|
-
inset-inline: 0;
|
|
78
|
-
|
|
79
|
-
display: flex;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
align-items: center;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
> :is(img, video) {
|
|
85
|
-
inline-size: 100%;
|
|
86
|
-
block-size: 100%;
|
|
87
|
-
size: 100%;
|
|
88
|
-
|
|
89
|
-
object-fit: cover;
|
|
90
|
-
object-position: ${e=>typeof e.position=="string"?e.position:"50%"};
|
|
91
|
-
}
|
|
92
|
-
`,P=s.styled("div")`
|
|
93
|
-
@property --gutter {
|
|
94
|
-
syntax: "<length-percentage>";
|
|
95
|
-
inherits: false;
|
|
96
|
-
initial-value: 0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
@property --minItemWidth {
|
|
100
|
-
syntax: "<length-percentage>";
|
|
101
|
-
inherits: false;
|
|
102
|
-
initial-value: 639px;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
106
|
-
--minItemWidth: ${e=>{var t;return typeof e.minItemWidth=="string"?e.minItemWidth:`${(t=e.minItemWidth)!=null?t:0}px`}};
|
|
107
|
-
|
|
108
|
-
box-sizing: border-box;
|
|
109
|
-
> * {
|
|
110
|
-
margin: 0;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
display: grid;
|
|
114
|
-
gap: var(--gutter, 0px);
|
|
115
|
-
|
|
116
|
-
grid-template-columns: repeat(
|
|
117
|
-
auto-fit,
|
|
118
|
-
minmax(min(var(--minItemWidth, 639px), 100%), 1fr)
|
|
119
|
-
);
|
|
120
|
-
`,x=96;function W(e){var r;e=String(e);const t=parseFloat(e),[,n]=(r=e.match(/[\d.\-+]*\s*(.*)/))!=null?r:["",""];return[t,n]}function h(e,t){if(!e)return null;const n=t!=null?t:document.body,r=(e!=null?e:"px").trim().toLowerCase();switch(r){case"vmin":case"vmax":case"vh":case"vw":case"%":return null;case"ch":case"ex":return ee(r,n);case"em":return w(n,"font-size");case"rem":return w(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[i,c]=W(r);if(isNaN(i))return null;if(!c)return i;const a=h(c,t);return typeof a=="number"?i*a:null}}}function w(e,t){var i;const[n,r]=W(getComputedStyle(e).getPropertyValue(t));return n*((i=h(r,e))!=null?i:1)}function ee(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const r=w(n,"height")/128;return t.removeChild(n),r}const te=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,ne=s.styled.div`
|
|
121
|
-
grid-row: span var(--rows, 1);
|
|
122
|
-
|
|
123
|
-
> * {
|
|
124
|
-
display: block;
|
|
125
|
-
height: 100%;
|
|
126
|
-
}
|
|
127
|
-
`,re=e=>{const[t,n]=o.createSignal(1),[r,i]=o.createSignal(),c=s.useTheme();return o.onMount(()=>{b.init()}),o.createEffect(()=>{const a=r();if(a==null)return;const l=b.registerCallback(a,({target:u})=>{var E;n(1);const g=e.gutter&&(E=d(e.gutter,c))!=null?E:"1px",y=te?h(g,u):null,v=Math.max(y!=null?y:1,1),[B]=Array.from(u.children),O=1+Math.min(u.scrollHeight,B.scrollHeight),V=Math.ceil(O/v);n(V)});o.onCleanup(l)}),React.createElement(ne,{style:`--rows: ${t()}`,ref:i},e.children)},ie=s.styled(P)`
|
|
128
|
-
grid-template-rows: 1px;
|
|
129
|
-
`,ae=e=>{const t=o.children(()=>e.children),r=[].concat(t()).filter(Boolean).map(i=>React.createElement(re,{gutter:e.gutter},i));return React.createElement(ie,f({},e),r)},p={start:"flex-start",end:"flex-end",center:"center"},$=m(f({},p),{stretch:"stretch"}),T=s.styled.div`
|
|
130
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
131
|
-
|
|
132
|
-
box-sizing: border-box;
|
|
133
|
-
> * {
|
|
134
|
-
margin: 0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
display: flex;
|
|
138
|
-
flex-wrap: wrap;
|
|
139
|
-
gap: var(--gutter, 0px);
|
|
140
|
-
|
|
141
|
-
justify-content: ${e=>typeof e.justify!="undefined"&&p[e.justify]?p[e.justify]:p.start};
|
|
142
|
-
|
|
143
|
-
align-items: ${e=>typeof e.align!="undefined"&&$[e.align]?$[e.align]:$.start};
|
|
144
|
-
`;function oe(e){return typeof e=="number"&&e>-1?!0:typeof e=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${e}`):!1}const se=s.styled(T)`
|
|
145
|
-
@property --switchAt {
|
|
146
|
-
syntax: "<length-percentage>";
|
|
147
|
-
inherits: true;
|
|
148
|
-
initial-value: 0;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
flex-wrap: nowrap;
|
|
152
|
-
${e=>e.stretch==="all"?`& > * {
|
|
153
|
-
flex: 1;
|
|
154
|
-
}`:e.stretch==="start"?`& > :first-child {
|
|
155
|
-
flex: 1;
|
|
156
|
-
}`:e.stretch==="end"?`& > :last-child {
|
|
157
|
-
flex: 1;
|
|
158
|
-
}`:typeof e.stretch=="number"?`& > :nth-child(${e.stretch+1}) {
|
|
159
|
-
flex: 1;
|
|
160
|
-
}`:""}
|
|
161
|
-
|
|
162
|
-
${e=>oe(e.switchAt)?`
|
|
163
|
-
--switchAt: ${typeof e.switchAt=="string"?e.switchAt:`${e.switchAt}px`};
|
|
164
|
-
flex-wrap: wrap;
|
|
165
|
-
> * {
|
|
166
|
-
min-inline-size: fit-content;
|
|
167
|
-
flex-basis: calc(
|
|
168
|
-
(var(--switchAt) - (100% - var(--gutter, 0px))) * 999
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
`:""}
|
|
172
|
-
`,j=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),ce=(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 le(e){return t=>{const n=d(t,e);return n!=null?n:"0px"}}function ue(e,t){var c;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((c=e==null?void 0:e.spacing)!=null?c:A));(()=>typeof t=="string"?!0:Array.isArray(t)?t.every(a=>n.has(a)):t&&Object.keys(t).every(a=>j.has(a))&&Object.values(t).every(a=>n.has(a)))()||console.error("Invalid padding Type");const i=le(e);return typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((a,[l,u])=>j.has(l)?a+ce(l,i(u)):a,""):t!==void 0?`padding: ${Array.from(Array.isArray(t)?t:[t]).map(a=>i(a)).join(" ")};`:""}const de=s.styled.div`
|
|
173
|
-
box-sizing: border-box;
|
|
174
|
-
${e=>ue(e.theme,e.padding)}
|
|
175
|
-
`,fe=s.styled.div`
|
|
176
|
-
box-sizing: border-box;
|
|
177
|
-
> * {
|
|
178
|
-
margin: 0;
|
|
179
|
-
scroll-snap-align: start;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
183
|
-
|
|
184
|
-
display: flex;
|
|
185
|
-
gap: var(--gutter, 0px);
|
|
186
|
-
|
|
187
|
-
overflow-x: scroll;
|
|
188
|
-
|
|
189
|
-
scroll-snap-type: ${e=>{switch(e.snapType){case"none":return"none";case"proximity":return"x proximity";case"mandatory":return"x mandatory";default:return"none"}}};
|
|
190
|
-
`,k=s.styled("div")`
|
|
191
|
-
@property --gutter {
|
|
192
|
-
syntax: "<length-percentage>";
|
|
193
|
-
inherits: false;
|
|
194
|
-
initial-value: 0;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
--gutter: ${e=>{var t,n;return(n=d((t=e.gutter)!=null?t:"none",e.theme))!=null?n:"0px"}};
|
|
198
|
-
box-sizing: border-box;
|
|
199
|
-
> * {
|
|
200
|
-
margin: 0;
|
|
201
|
-
}
|
|
202
|
-
display: flex;
|
|
203
|
-
flex-direction: column;
|
|
204
|
-
|
|
205
|
-
gap: var(--gutter, 0px);
|
|
206
|
-
align-content: start;
|
|
207
|
-
|
|
208
|
-
& > [data-bedrock-column] {
|
|
209
|
-
grid-column: span 1 / auto;
|
|
210
|
-
}
|
|
211
|
-
`,I={"1/4":"1fr 3fr","1/3":"1fr 2fr","1/2":"1fr 1fr","2/3":"2fr 1fr","3/4":"3fr 1fr","auto-start":"auto 1fr","auto-end":"1fr auto"},ge=s.styled.div`
|
|
212
|
-
box-sizing: border-box;
|
|
213
|
-
> * {
|
|
214
|
-
margin: 0;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
218
|
-
|
|
219
|
-
display: grid;
|
|
220
|
-
gap: var(--gutter, 0px);
|
|
221
|
-
grid-template-columns: ${({fraction:e="1/2"})=>{var t;return(t=I[e])!=null?t:I["1/2"]}}};
|
|
222
|
-
`,me=e=>{const t=typeof e.switchAt=="string"?h(e.switchAt):e.switchAt,n=t&&t>-1?t:0,[r,i]=R(n,e.ref);return React.createElement(o.Switch,null,React.createElement(o.Match,{when:r()===!1},React.createElement(ge,m(f({fraction:e.fraction},e),{ref:i}))),React.createElement(o.Match,{when:r()===!0},React.createElement(k,m(f({},e),{ref:i}))))};function ye(e){return typeof e=="number"?`${e}px`:e&&C(e)?e:"100vh"}const xe=s.styled.div`
|
|
223
|
-
@property --gutter {
|
|
224
|
-
syntax: "<length-percentage>";
|
|
225
|
-
inherits: false;
|
|
226
|
-
initial-value: 0;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
@property --minHeight {
|
|
230
|
-
syntax: "<length-percentage>";
|
|
231
|
-
inherits: false;
|
|
232
|
-
initial-value: 100vh;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
236
|
-
|
|
237
|
-
--minHeight: ${e=>ye(e.minHeight)};
|
|
238
|
-
|
|
239
|
-
> * {
|
|
240
|
-
margin: 0;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
display: flex;
|
|
244
|
-
flex-direction: column;
|
|
245
|
-
gap: var(--gutter, 0px);
|
|
246
|
-
|
|
247
|
-
min-block-size: var(--minHeight, 100vh);
|
|
248
|
-
|
|
249
|
-
> [data-bedrock-cover-centered] {
|
|
250
|
-
margin-block-start: auto;
|
|
251
|
-
margin-block-end: auto;
|
|
252
|
-
|
|
253
|
-
${({stretchContent:e})=>e===!0?`
|
|
254
|
-
flex: 1;
|
|
255
|
-
display: flex;
|
|
256
|
-
flex-direction: column;
|
|
257
|
-
> * {
|
|
258
|
-
flex: 1;
|
|
259
|
-
}
|
|
260
|
-
`:""};
|
|
261
|
-
}
|
|
262
|
-
`,he=e=>React.createElement(xe,f({},e),e.top,React.createElement("div",{"data-bedrock-cover-centered":!0},e.children),e.bottom),pe=s.styled.div`
|
|
263
|
-
@property --gutter {
|
|
264
|
-
syntax: "<length-percentage>";
|
|
265
|
-
inherits: false;
|
|
266
|
-
initial-value: 0;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
@property --columns {
|
|
270
|
-
syntax: "<number>";
|
|
271
|
-
inherits: true;
|
|
272
|
-
initial-value: 1;
|
|
273
|
-
}
|
|
274
|
-
--gutter: ${e=>{var t;return e.gutter&&(t=d(e.gutter,e.theme))!=null?t:"0px"}};
|
|
275
|
-
|
|
276
|
-
--columns: ${e=>e.columns&&e.columns>0?e.columns:1};
|
|
277
|
-
|
|
278
|
-
box-sizing: border-box;
|
|
279
|
-
> * {
|
|
280
|
-
margin: 0;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
display: grid;
|
|
284
|
-
grid-template-columns: repeat(var(--columns, 1), 1fr);
|
|
285
|
-
gap: var(--gutter, 0px);
|
|
286
|
-
grid-auto-flow: row ${({dense:e=!1})=>e===!0?"dense":""};
|
|
287
|
-
`,be=e=>{const t=typeof e.switchAt=="string"?h(e.switchAt):e.switchAt,n=t&&t>-1?t:0,[r,i]=R(n),c=a=>{var l;i(a),(l=e.ref)==null||l.call(e,a)};return React.createElement(o.Switch,null,React.createElement(o.Match,{when:r()===!1},React.createElement(pe,m(f({},e),{ref:c}))),React.createElement(o.Match,{when:r()===!0},React.createElement(k,m(f({},e),{ref:c}))))},ve=e=>typeof e=="number"?e:1,Se=s.styled.div`
|
|
288
|
-
@property --span {
|
|
289
|
-
syntax: "<number>";
|
|
290
|
-
inherits: true;
|
|
291
|
-
initial-value: 1;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
--span: ${e=>ve(e.colSpan)};
|
|
295
|
-
|
|
296
|
-
grid-column: span min(var(--span, 1), var(--columns, 1));
|
|
297
|
-
|
|
298
|
-
${e=>e.offsetStart||e.offsetEnd?`
|
|
299
|
-
display: contents;
|
|
300
|
-
> * {
|
|
301
|
-
grid-column: span min(var(--span, 1), var(--columns, 1));
|
|
302
|
-
}
|
|
303
|
-
`:""}
|
|
304
|
-
|
|
305
|
-
${e=>e.offsetStart&&e.offsetStart>0?`
|
|
306
|
-
&::before {
|
|
307
|
-
content: "";
|
|
308
|
-
grid-column: span min(${e.offsetStart}, var(--columns, 1));
|
|
309
|
-
}
|
|
310
|
-
`:""}
|
|
311
|
-
|
|
312
|
-
${e=>e.offsetEnd&&e.offsetEnd>0?`
|
|
313
|
-
&::after {
|
|
314
|
-
content: "";
|
|
315
|
-
grid-column: span min(${e.offsetEnd}, var(--columns, 1));
|
|
316
|
-
}
|
|
317
|
-
`:""}
|
|
318
|
-
`;exports.Center=_;exports.Column=Se;exports.ColumnDrop=Q;exports.Columns=be;exports.Cover=he;exports.Frame=Z;exports.Grid=P;exports.Inline=se;exports.InlineCluster=T;exports.MasonryGrid=ae;exports.PadBox=de;exports.Reel=fe;exports.Split=me;exports.Stack=k;exports.checkIsCSSLength=C;exports.createContainerQuery=R;exports.getSpacingValue=d;exports.spacing=A;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var f=require("solid-js"),E=require("@bedrock-layout/register-resize-callback");function R(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 T={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 U(e){return e.reduce((t,[n,o])=>({...t,[n]:o}),{})}const h=(e,t)=>{var s,i;const n=(i=(s=t==null?void 0:t.space)!=null?s:t==null?void 0:t.spacing)!=null?i:T,r=U(Object.entries(n).map(([l,a])=>[l,typeof a=="number"?`${a}px`:a]))[e];return R(r)?r:void 0},Q=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],J=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Q]),Y=new Set(["innerHTML","textContent","innerText","children"]),Z={className:"class",htmlFor:"for"},L={class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"},p=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),ee=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"]),te={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function ne(e,t,n){let o=n.length,r=t.length,c=o,s=0,i=0,l=t[r-1].nextSibling,a=null;for(;s<r||i<c;){if(t[s]===n[i]){s++,i++;continue}for(;t[r-1]===n[c-1];)r--,c--;if(r===s){const u=c<o?i?n[i-1].nextSibling:n[c-i]:l;for(;i<c;)e.insertBefore(n[i++],u)}else if(c===i)for(;s<r;)(!a||!a.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[c-1]&&n[i]===t[r-1]){const u=t[--r].nextSibling;e.insertBefore(n[i++],t[s++].nextSibling),e.insertBefore(n[--c],u),t[r]=n[c]}else{if(!a){a=new Map;let d=i;for(;d<c;)a.set(n[d],d++)}const u=a.get(t[s]);if(u!=null)if(i<u&&u<c){let d=s,b=1,$;for(;++d<r&&d<c&&!(($=a.get(t[d]))==null||$!==u+b);)b++;if(b>u-i){const x=t[s];for(;i<u;)e.insertBefore(n[i++],x)}else e.replaceChild(n[i++],t[s++])}else s++;else t[s++].remove()}}}const B="_$DX_DELEGATE";function ie(e,t=window.document){const n=t[B]||(t[B]=new Set);for(let o=0,r=e.length;o<r;o++){const c=e[o];n.has(c)||(n.add(c),t.addEventListener(c,ge))}}function se(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function oe(e,t,n,o){o==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,o)}function re(e,t){t==null?e.removeAttribute("class"):e.className=t}function ce(e,t,n,o){if(o)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=c=>r.call(e,n[1],c))}else e.addEventListener(t,n)}function le(e,t,n={}){const o=Object.keys(t||{}),r=Object.keys(n);let c,s;for(c=0,s=r.length;c<s;c++){const i=r[c];!i||i==="undefined"||t[i]||(W(e,i,!1),delete n[i])}for(c=0,s=o.length;c<s;c++){const i=o[c],l=!!t[i];!i||i==="undefined"||n[i]===l||!l||(W(e,i,!0),n[i]=l)}return n}function ae(e,t,n={}){const o=e.style,r=typeof n=="string";if(t==null&&r||typeof t=="string")return o.cssText=t;r&&(o.cssText=void 0,n={}),t||(t={});let c,s;for(s in n)t[s]==null&&o.removeProperty(s),delete n[s];for(s in t)c=t[s],c!==n[s]&&(o.setProperty(s,c),n[s]=c);return n}function fe(e,t,n,o){typeof t=="function"?f.createRenderEffect(r=>F(e,t(),r,n,o)):F(e,t,void 0,n,o)}function ue(e,t,n,o,r={},c=!1){t||(t={});for(const s in r)if(!(s in t)){if(s==="children")continue;D(e,s,null,r[s],n,c)}for(const s in t){if(s==="children"){o||j(e,t.children);continue}const i=t[s];r[s]=D(e,s,i,r[s],n,c)}}function de(e){let t,n;return!f.sharedConfig.context||!(t=f.sharedConfig.registry.get(n=me()))?e.cloneNode(!0):(f.sharedConfig.completed&&f.sharedConfig.completed.add(t),f.sharedConfig.registry.delete(n),t)}function ye(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function W(e,t,n){const o=t.trim().split(/\s+/);for(let r=0,c=o.length;r<c;r++)e.classList.toggle(o[r],n)}function D(e,t,n,o,r,c){let s,i,l;if(t==="style")return ae(e,n,o);if(t==="classList")return le(e,n,o);if(n===o)return o;if(t==="ref")c||n(e);else if(t.slice(0,3)==="on:"){const a=t.slice(3);o&&e.removeEventListener(a,o),n&&e.addEventListener(a,n)}else if(t.slice(0,10)==="oncapture:"){const a=t.slice(10);o&&e.removeEventListener(a,o,!0),n&&e.addEventListener(a,n,!0)}else if(t.slice(0,2)==="on"){const a=t.slice(2).toLowerCase(),u=p.has(a);if(!u&&o){const d=Array.isArray(o)?o[0]:o;e.removeEventListener(a,d)}(u||n)&&(ce(e,a,n,u),u&&ie([a]))}else if((l=Y.has(t))||!r&&(L[t]||(i=J.has(t)))||(s=e.nodeName.includes("-")))t==="class"||t==="className"?re(e,n):s&&!i&&!l?e[ye(t)]=n:e[L[t]||t]=n;else{const a=r&&t.indexOf(":")>-1&&te[t.split(":")[0]];a?oe(e,a,t,n):se(e,Z[t]||t,n)}return n}function ge(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(o=>o.remove()));n!==null;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(r!==void 0?o.call(n,r,e):o.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={},o,r){return t||(t={}),!r&&"children"in t&&f.createRenderEffect(()=>n.children=j(e,t.children,n.children)),t.ref&&t.ref(e),f.createRenderEffect(()=>ue(e,t,o,!0,n,!0)),n}function j(e,t,n,o,r){for(f.sharedConfig.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const c=typeof t,s=o!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,c==="string"||c==="number"){if(f.sharedConfig.context)return n;if(c==="number"&&(t=t.toString()),s){let i=n[0];i&&i.nodeType===3?i.data=t:i=document.createTextNode(t),n=C(e,n,o,i)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||c==="boolean"){if(f.sharedConfig.context)return n;n=C(e,n,o)}else{if(c==="function")return f.createRenderEffect(()=>{let i=t();for(;typeof i=="function";)i=i();n=j(e,i,n,o)}),()=>n;if(Array.isArray(t)){const i=[],l=n&&Array.isArray(n);if(M(i,t,n,r))return f.createRenderEffect(()=>n=j(e,i,n,o,!0)),()=>n;if(f.sharedConfig.context){if(!i.length)return n;for(let a=0;a<i.length;a++)if(i[a].parentNode)return n=i}if(i.length===0){if(n=C(e,n,o),s)return n}else l?n.length===0?G(e,i,o):ne(e,n,i):(n&&C(e),G(e,i));n=i}else if(t instanceof Node){if(f.sharedConfig.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=C(e,n,o,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 M(e,t,n,o){let r=!1;for(let c=0,s=t.length;c<s;c++){let i=t[c],l=n&&n[c];if(i instanceof Node)e.push(i);else if(!(i==null||i===!0||i===!1))if(Array.isArray(i))r=M(e,i,l)||r;else if(typeof i=="function")if(o){for(;typeof i=="function";)i=i();r=M(e,Array.isArray(i)?i:[i],Array.isArray(l)?l:[l])||r}else e.push(i),r=!0;else{const a=String(i);l&&l.nodeType===3&&l.data===a?e.push(l):e.push(document.createTextNode(a))}}return r}function G(e,t,n){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n)}function C(e,t,n,o){if(n===void 0)return e.textContent="";const r=o||document.createTextNode("");if(t.length){let c=!1;for(let s=t.length-1;s>=0;s--){const i=t[s];if(r!==i){const l=i.parentNode===e;!c&&!s?l?e.replaceChild(r,i):e.insertBefore(r,n):l&&i.remove()}else c=!0}}else e.insertBefore(r,n);return[r]}function me(){const e=f.sharedConfig.context;return`${e.id}${e.count++}`}const he="http://www.w3.org/2000/svg";function Se(e,t=!1){return t?document.createElementNS(he,e):document.createElement(e)}function be(e){const[t,n]=f.splitProps(e,["component"]),o=f.createMemo(()=>t.component);return f.createMemo(()=>{const r=o();switch(typeof r){case"function":return f.untrack(()=>r(n));case"string":const c=ee.has(r),s=f.sharedConfig.context?de():Se(r,c);return fe(s,n,c),s}})}function $e(e){return e!=null?e:void 0}function y(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,o)=>(Object.defineProperty(n,o,{get(){return e[o]},configurable:!0,enumerable:!0}),n),{})}function g(e,t){return f.createComponent(be,f.mergeProps({get component(){return e()}},t))}function m(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 o=e[n];return Object.defineProperty(t,n,{get(){return o()},configurable:!0,enumerable:!0}),t},{})}function Ce(e){return e===void 0?"100%":typeof e=="number"?`${e}px`:e}function xe(e){const t=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((l,[a,u])=>l+`${a}:${u};`,"")},n=()=>`--maxWidth: ${Ce(e.maxWidth)};`,o=()=>e.centerText?"center-text":"",r=()=>e.centerChildren?"center-children":"",c=()=>[o(),r()].filter(Boolean).join(" "),s=()=>[t(),n()].join("; ");return g(()=>{var i;return(i=e.as)!=null?i:"div"},f.mergeProps(y(e,["as","maxWidth","centerText","centerChildren"]),m({style:s,"data-bedrock-center":c})))}const _=f.createContext({});function we(e){return React.createElement(_.Provider,{value:e.theme},e.children)}function S(){try{return f.useContext(_)}catch{return{}}}function Ae(e){return e===void 0?"159px":typeof e=="number"?`${e}px`:e}function Ee(e){const t=S(),n=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((l,[a,u])=>l+`${a}:${u};`,"")},o=()=>{var i,l;return`--gutter: ${(l=h((i=e.gutter)!=null?i:"none",t))!=null?l:"0px"}`},r=()=>`--minItemWidth: ${Ae(e.minItemWidth)}`,c=()=>e.noStretchedColumns===!0?"no-stretched-columns":"",s=()=>[n(),o(),r()].join("; ");return g(()=>{var i;return(i=e.as)!=null?i:"div"},f.mergeProps(y(e,["as","gutter","minItemWidth","noStretchedColumns"]),m({style:s,"data-bedrock-column-drop":c})))}function v(e){throw new Error(e)}function je(e){typeof e!="number"&&!Array.isArray(e)&&v("width must be a number or an array of two numbers"),Array().concat(e).some(n=>n<0)&&v("width value(s) must be 0 or greater"),Array.isArray(e)&&(e.length!==2||e[0]>e[1])&&v(`The second width value, ${e[1]}, is not larger than ${e[0]}. Please provide a value greater than first width value`)}function I(e,t){je(e);const[n,o]=f.createSignal(!1),[r,c]=f.createSignal();return f.onMount(()=>{E.init()}),f.createEffect(()=>{if(r()===void 0||r()===null)return;t&&t(r());const s=E.registerCallback(r(),i=>{var a,u;const l=(u=(a=i.borderBoxSize)==null?void 0:a.inlineSize)!=null?u:i.contentRect.width;if(l>0){const d=Array.isArray(e)?l>=e[0]&&l<=e[1]:l<=e;o(d)}});f.onCleanup(s)}),[n,c]}function ve(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 Pe(e){return Array.isArray(e)?e.join("/"):e}function Me(e){return ve(e)?Pe(e):void 0}function ke(e){const t=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((i,[l,a])=>i+`${l}:${a};`,"")},n=()=>Me(e.ratio),o=()=>n()?`--ratio: ${n()}`:"",r=()=>typeof e.position=="string"?`--position: ${e.position}`:"50%",c=()=>[t(),o(),r()].join("; ");return g(()=>{var s;return(s=e.as)!=null?s:"div"},f.mergeProps(y(e,["as","ratio","position"]),m({style:c,"data-bedrock-frame":()=>""})))}function X(e){const t=S(),n=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((i,[l,a])=>i+`${l}:${a};`,"")},o=()=>{var s,i;return`--gutter: ${(i=h((s=e.gutter)!=null?s:"none",t))!=null?i:"0px"};`},r=()=>{var s;return`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${(s=e.minItemWidth)!=null?s:0}px`};`},c=()=>[n(),o(),r()].join("; ");return g(()=>{var s;return(s=e.as)!=null?s:"div"},f.mergeProps(y(e,["as","gutter","minItemWidth"]),m({style:c,"data-bedrock-grid":()=>""})))}const w=96;function z(e){var o;e=String(e);const t=parseFloat(e),[,n]=(o=e.match(/[\d.\-+]*\s*(.*)/))!=null?o:["",""];return[t,n]}function A(e,t){if(!e)return;const n=t!=null?t:document.body,o=(e!=null?e:"px").trim().toLowerCase();switch(o){case"vmin":case"vmax":case"vh":case"vw":case"%":return;case"ch":case"ex":return Re(o,n);case"em":return k(n,"font-size");case"rem":return k(document.body,"font-size");case"in":return w;case"cm":return w/2.54;case"mm":return w/25.4;case"pt":return w/72;case"pc":return w/6;case"px":return 1;default:{const[r,c]=z(o);if(isNaN(r))return;if(!c)return r;const s=A(c,t);return typeof s=="number"?r*s:void 0}}}function k(e,t){var r;const[n,o]=z(getComputedStyle(e).getPropertyValue(t));return n*((r=A(o,e))!=null?r:1)}function Re(e,t){const n=document.createElement("div");n.style.height="128"+e,t.appendChild(n);const o=k(n,"height")/128;return t.removeChild(n),o}const P=1,Te=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,Ie=e=>{const[t,n]=f.createSignal(1),[o,r]=f.createSignal(),c=S();return f.onMount(()=>{E.init()}),f.createEffect(()=>{const s=$e(o());if(s===void 0)return;const i=E.registerCallback(s,({target:l})=>{var N;n(1);const a=e.gutter&&(N=h(e.gutter,c))!=null?N:"1px",u=Te?A(a,l):void 0,d=Math.max(u!=null?u:P,P),[b]=Array.from(l.children),$=1+Math.min(l.scrollHeight,b.scrollHeight),x=Math.max(Math.ceil($/d),P);n(x)});f.onCleanup(i)}),React.createElement("div",{style:`grid-row: span ${t()};`,ref:r},e.children)},Oe=e=>{const t=f.children(()=>e.children),o=[].concat(t()).filter(Boolean).map(r=>React.createElement(Ie,{gutter:e.gutter},r));return React.createElement(X,{style:"grid-template-rows: 1px;",...e},o)},Ne={start:"justify:start",end:"justify:end",center:"justify:center"},Le={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Be(e){const t=S(),n=()=>{var l;return typeof e.style=="string"?e.style:Object.entries((l=e.style)!=null?l:{}).reduce((a,[u,d])=>a+`${u}:${d};`,"")},o=()=>{var l,a;return`--gutter: ${(a=h((l=e.gutter)!=null?l:"none",t))!=null?a:"0px"};`},r=()=>e.justify!==void 0?Ne[e.justify]:void 0,c=()=>e.align!==void 0?Le[e.align]:void 0,s=()=>[n(),o()].join("; "),i=()=>[r(),c()].filter(Boolean).join(" ");return g(()=>{var l;return(l=e.as)!=null?l:"div"},f.mergeProps(y(e,["as","gutter","justify","align"]),m({style:s,"data-bedrock-inline-cluster":i})))}const We={start:"justify:start",end:"justify:end",center:"justify:center"},De={start:"align:start",end:"align:end",center:"align:center",stretch:"align:stretch"};function Fe(e){return typeof e=="number"&&e>-1?!0:typeof e=="string"&&typeof CSS!==void 0?CSS.supports(`height: ${e}`):!1}function Ge(e){const t=S(),n=()=>{var d;return typeof e.style=="string"?e.style:Object.entries((d=e.style)!=null?d:{}).reduce((b,[$,x])=>b+`${$}:${x};`,"")},o=()=>{var d,b;return`--gutter: ${(b=h((d=e.gutter)!=null?d:"none",t))!=null?b:"0px"};`},r=()=>e.minItemWidth?`--minItemWidth: ${typeof e.minItemWidth=="string"?e.minItemWidth:`${e.minItemWidth}px`};`:void 0,c=()=>Fe(e.switchAt)?`--switchAt: ${typeof e.switchAt=="string"?e.switchAt:`${e.switchAt}px`};`:void 0,s=()=>e.justify!==void 0?We[e.justify]:void 0,i=()=>e.align!==void 0?De[e.align]:void 0,l=()=>e.stretch?`stretch:${e.stretch}`:void 0,a=()=>[n(),o(),c(),r()].join("; "),u=()=>[s(),i(),l()].filter(Boolean).join(" ");return g(()=>{var d;return(d=e.as)!=null?d:"div"},f.mergeProps(y(e,["as","gutter","justify","align","stretch","switchAt"]),m({style:a,"data-bedrock-inline":u})))}const V=new Set(["left","right","top","bottom","inlineStart","inlineEnd","blockStart","blockEnd"]),Ve=(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 He(e){return t=>{const n=h(t,e);return n!=null?n:"0px"}}function _e(e,t){var c;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((c=e==null?void 0:e.spacing)!=null?c:T));(()=>typeof t=="string"?!0:Array.isArray(t)?t.every(s=>n.has(s)):t&&Object.keys(t).every(s=>V.has(s))&&Object.values(t).every(s=>n.has(s)))()||console.error("Invalid padding Type");const r=He(e);return typeof t=="object"&&!Array.isArray(t)?Object.entries(t).reduce((s,[i,l])=>V.has(i)?s+Ve(i,r(l)):s,""):t!==void 0?`padding: ${Array.from(Array.isArray(t)?t:[t]).map(s=>r(s)).join(" ")};`:""}function Xe(e){const t=S(),n=()=>{var c;return typeof e.style=="string"?e.style:Object.entries((c=e.style)!=null?c:{}).reduce((s,[i,l])=>s+`${i}:${l};`,"")},o=()=>_e(t,e.padding),r=()=>[n(),o()].join("; ");return g(()=>{var c;return(c=e.as)!=null?c:"div"},f.mergeProps(y(e,["as","padding"]),m({style:r,"data-bedrock-padbox":()=>""})))}function ze(e){const t=S(),n=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((i,[l,a])=>i+`${l}:${a};`,"")},o=()=>{var s,i;return`--gutter: ${(i=h((s=e.gutter)!=null?s:"none",t))!=null?i:"0px"};`},r=()=>{switch(e.snapType){case"none":return"snapType:none";case"proximity":return"snapType:proximity";case"mandatory":return"snapType:mandatory";default:return"snapType:none"}},c=()=>[n(),o()].join("; ");return g(()=>{var s;return(s=e.as)!=null?s:"div"},f.mergeProps(y(e,["as","gutter"]),m({style:c,"data-bedrock-reel":r})))}function O(e){const t=S(),n=()=>{var c;return typeof e.style=="string"?e.style:Object.entries((c=e.style)!=null?c:{}).reduce((s,[i,l])=>s+`${i}:${l};`,"")},o=()=>{var c,s;return`--gutter: ${(s=h((c=e.gutter)!=null?c:"none",t))!=null?s:"0px"};`},r=()=>[n(),o()].join("; ");return g(()=>{var c;return(c=e.as)!=null?c:"div"},f.mergeProps(y(e,["as","gutter"]),m({style:r,"data-bedrock-stack":()=>""})))}const H={"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 q(e){const t=S(),n=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((i,[l,a])=>i+`${l}:${a};`,"")},o=()=>{var s,i;return`--gutter: ${(i=h((s=e.gutter)!=null?s:"none",t))!=null?i:"0px"};`},r=()=>{var s,i;return(i=H[(s=e.fraction)!=null?s:"1/2"])!=null?i:H["1/2"]},c=()=>[n(),o()].join("; ");return g(()=>{var s;return(s=e.as)!=null?s:"div"},f.mergeProps(y(e,["as","gutter","fraction"]),m({style:c,"data-bedrock-split":r})))}const qe=e=>{const[t,n]=f.splitProps(e,["switchAt","fraction"]),o=typeof t.switchAt=="string"?A(t.switchAt):t.switchAt,r=Math.max(o!=null?o:0,0),[c,s]=I(r,e.ref);return React.createElement(f.Switch,null,React.createElement(f.Match,{when:c()===!1},React.createElement(q,{fraction:t.fraction,...n,ref:s})),React.createElement(f.Match,{when:c()===!0},React.createElement(O,{...n,ref:s})))};function Ke(e){return typeof e=="number"?`${e}px`:e&&R(e)?e:"100vh"}function Ue(e){const t=S(),n=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((l,[a,u])=>l+`${a}:${u};`,"")},o=()=>{var i,l;return`--gutter: ${(l=h((i=e.gutter)!=null?i:"none",t))!=null?l:"0px"};`},r=()=>`--minHeight: ${Ke(e.minHeight)};`,c=()=>e.stretchContent===!0?"stretch-content":"",s=()=>[n(),o(),r()].join("; ");return g(()=>{var i;return(i=e.as)!=null?i:"div"},f.mergeProps(y(e,["as","minHeight","stretchContent"]),m({style:s,"data-bedrock-cover":c})))}const Qe=e=>React.createElement(Ue,{...e},e.top,React.createElement("div",{"data-bedrock-cover-centered":!0},e.children),e.bottom);function K(e){const t=S(),n=()=>{var i;return typeof e.style=="string"?e.style:Object.entries((i=e.style)!=null?i:{}).reduce((l,[a,u])=>l+`${a}:${u};`,"")},o=()=>{var i,l;return`--gutter: ${(l=h((i=e.gutter)!=null?i:"none",t))!=null?l:"0px"};`},r=()=>`--columns: ${e.columns&&e.columns>0?e.columns:1};`,c=()=>e.dense?"dense":"",s=()=>[n(),o(),r()].join("; ");return g(()=>{var i;return(i=e.as)!=null?i:"div"},f.mergeProps(y(e,["as","gutter","columns","dense"]),m({style:s,"data-bedrock-columns":c})))}const Je=e=>{const[t,n]=f.splitProps(e,["switchAt","columns","dense"]),o=typeof t.switchAt=="string"?A(t.switchAt):t.switchAt,r=Math.max(o!=null?o:0,0),[c,s]=I(r),i=l=>{var a;s(l),(a=n.ref)==null||a.call(n,l)};return React.createElement(f.Switch,null,React.createElement(f.Match,{when:c()===!1},React.createElement(K,{columns:t.columns,dense:t.dense,...n,ref:i})),React.createElement(f.Match,{when:c()===!0},React.createElement(O,{...n,ref:i})))},Ye=e=>typeof e=="number"?e:1;function Ze(e){const t=()=>{var s;return typeof e.style=="string"?e.style:Object.entries((s=e.style)!=null?s:{}).reduce((i,[l,a])=>i+`${l}:${a};`,"")},n=()=>`--span: ${Ye(e.span)};`,o=()=>e.offsetStart&&e.offsetStart>0?`--offsetStart: ${e.offsetStart};`:"",r=()=>e.offsetEnd&&e.offsetEnd>0?`--offsetEnd: ${e.offsetEnd};`:"",c=()=>[t(),n(),o(),r()].join("; ");return g(()=>{var s;return(s=e.as)!=null?s:"div"},f.mergeProps(y(e,["as","span","offsetStart","offsetEnd"]),m({style:c,"data-bedrock-column":()=>""})))}exports.Center=xe;exports.Column=Ze;exports.ColumnDrop=Ee;exports.Columns=Je;exports.ColumnsBase=K;exports.Cover=Qe;exports.Frame=ke;exports.Grid=X;exports.Inline=Ge;exports.InlineCluster=Be;exports.MasonryGrid=Oe;exports.PadBox=Xe;exports.Reel=ze;exports.Split=qe;exports.SplitBase=q;exports.Stack=O;exports.ThemeProvider=we;exports.checkIsCSSLength=R;exports.createContainerQuery=I;exports.getSpacingValue=h;exports.spacing=T;exports.useTheme=S;
|
package/lib/index.d.ts
CHANGED