digital-rabbit-cl 1.3.6 → 1.3.7
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.
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { HeaderProps } from '../Header';
|
|
3
|
+
import { FooterProps } from '../Footer';
|
|
2
4
|
import { BaseComponentProps, ElementSpecificProps } from '../../types/component-props.d.ts';
|
|
3
5
|
export interface PageLayoutProps extends BaseComponentProps {
|
|
4
6
|
header?: React.ReactNode;
|
|
5
7
|
footer?: React.ReactNode;
|
|
8
|
+
headerProps?: Omit<HeaderProps, 'children'>;
|
|
9
|
+
footerProps?: Omit<FooterProps, 'children'>;
|
|
6
10
|
divProps?: Omit<ElementSpecificProps<HTMLDivElement>, 'className' | 'style'>;
|
|
7
11
|
mainProps?: Omit<React.HTMLAttributes<HTMLElement>, 'className'>;
|
|
8
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayout/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayout/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEjG,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC;IAC7E,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;CAClE;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6BzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -2907,16 +2907,18 @@ const Ys = "Hamburger-module__hamburger___Tf4-t", eo = "Hamburger-module__line__
|
|
|
2907
2907
|
className: s,
|
|
2908
2908
|
style: o,
|
|
2909
2909
|
// Element-specific props
|
|
2910
|
-
|
|
2911
|
-
|
|
2910
|
+
headerProps: n,
|
|
2911
|
+
footerProps: i,
|
|
2912
|
+
divProps: l,
|
|
2913
|
+
mainProps: d
|
|
2912
2914
|
}) => {
|
|
2913
|
-
const
|
|
2914
|
-
return /* @__PURE__ */ K("div", { ...
|
|
2915
|
+
const y = [Ze.layoutContainer, s].filter(Boolean).join(" ");
|
|
2916
|
+
return /* @__PURE__ */ K("div", { ...l, className: y, style: o, children: [
|
|
2915
2917
|
/* @__PURE__ */ K("div", { className: Ze.content, children: [
|
|
2916
|
-
e && /* @__PURE__ */ V(ao, { children: e }),
|
|
2917
|
-
/* @__PURE__ */ V("main", { ...
|
|
2918
|
+
e && /* @__PURE__ */ V(ao, { ...n, children: e }),
|
|
2919
|
+
/* @__PURE__ */ V("main", { ...d, className: Ze.main, children: t })
|
|
2918
2920
|
] }),
|
|
2919
|
-
r && /* @__PURE__ */ V(ko, { children: r })
|
|
2921
|
+
r && /* @__PURE__ */ V(ko, { ...i, children: r })
|
|
2920
2922
|
] });
|
|
2921
2923
|
};
|
|
2922
2924
|
export {
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
0% { transform: rotate(0deg); }
|
|
20
20
|
100% { transform: rotate(360deg); }
|
|
21
21
|
}
|
|
22
|
-
`})]});return t?p.jsx("div",{...n,className:s,style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw",...o},children:f}):f},Vs=({children:e,loadingComponent:r})=>{const[t,s]=V.useState(!1);return V.useEffect(()=>{requestAnimationFrame(()=>{s(!0)})},[]),t?p.jsx(p.Fragment,{children:e}):r||p.jsx(ir,{})},tt={stack:"Stack-module__stack___yUU-B",vertical:"Stack-module__vertical___sKTyQ",horizontal:"Stack-module__horizontal___YsvtV"},ws=({direction:e="column",children:r,className:t,style:s,divProps:o})=>{const n=[tt.stack,e==="row"?tt.horizontal:tt.vertical,t].filter(Boolean).join(" ");return p.jsx("div",{...o,className:n,style:s,children:r})},ar={section:"ResponsiveSection-module__section___gBESK",innerDiv:"ResponsiveSection-module__innerDiv___r1bky"},rt=({backgroundColor:e,color:r,maxWidth:t,minWidth:s,width:o,height:n,padding:i,paddingSm:l,margin:d,gap:y,verticalRhythm:f=3,children:m,className:h,style:w,sectionProps:k})=>{const _=T(),z=ne(`(min-width: ${_.breakpoints.sm})`),A={backgroundColor:e,color:r||_.fonts.color,margin:d,...w},F=`calc(${_.fonts.rhythm} * ${f})`,$=z?i||_.layout.padding:l||_.layout.paddingSm,C={"--max-width":t||_.layout.maxWidth,"--min-width":s,"--width":o,"--height":n,"--section-padding":`${F} ${$}`,"--gap":y},E=[ar.section,h].filter(Boolean).join(" ");return p.jsx("section",{...k,className:E,style:A,children:p.jsx("div",{className:ar.innerDiv,style:C,children:m})})},lr={hero:"Hero-module__hero___IB2tg",content:"Hero-module__content___rkkfQ"},ks=({isMd:e=!1,isLg:r=!1,theme:t})=>V.useMemo(()=>{const{rhythm:s}=t.fonts;let o=`calc(${s} * 2) 0`,n="2rem",i="1.125rem";return r?(o=`calc(${s} * 4) 0`,n="3.5rem",i="1.5rem"):e&&(o=`calc(${s} * 3.5) 0`,n="3rem",i="1.25rem"),{"--hero-padding":o,"--hero-h1-font-size":n,"--hero-p-font-size":i,"--hero-h1-margin-bottom":`calc(${s} * 0.7)`}},[e,r,t.fonts]),xs=({color:e,breakpoints:r,children:t,className:s,style:o,...n})=>{const i=T(),l=[lr.hero,s].filter(Boolean).join(" "),d=(r==null?void 0:r.md)||i.breakpoints.md,y=(r==null?void 0:r.lg)||i.breakpoints.lg,f=ne(`(min-width: ${d})`),m=ne(`(min-width: ${y})`),h=ks({isMd:f,isLg:m,theme:i});return p.jsx(rt,{className:l,color:e||i.fonts.color,style:{...h,...o},...n,children:p.jsx("div",{className:lr.content,children:t})})},cr={footer:"Footer-module__footer___A76NF",container:"Footer-module__container___QneNs"},Cs=({isSmallScreen:e=!1,maxWidth:r,minWidth:t,width:s,height:o,paddingSm:n,padding:i,margin:l,gap:d,backgroundColor:y,color:f}={})=>{const m=T();return{maxWidth:r||m.layout.maxWidth,minWidth:t,width:s,height:o,padding:e?n||m.layout.paddingSm:i||m.layout.padding,margin:l,gap:d,backgroundColor:y,color:f||m.fonts.color}},ur=({backgroundColor:e,color:r,maxWidth:t,minWidth:s,width:o,height:n,padding:i,paddingSm:l,margin:d,gap:y,breakPoint:f,children:m,className:h,style:w,footerProps:k})=>{const _=T(),z=f||_.breakpoints.sm,{maxWidth:A,unit:F}=ge(z),$=ne(`(max-width: ${A}${F})`),C=Cs({isSmallScreen:$,maxWidth:t,minWidth:s,width:o,height:n,paddingSm:l,padding:i,margin:d,gap:y,backgroundColor:e,color:r}),E=[cr.container,h].filter(Boolean).join(" ");return p.jsx("footer",{...k,className:cr.footer,children:p.jsx("div",{className:E,style:{...C,...w},children:m})})},De={card:"FeatureCard-module__card___XQt66",icon:"FeatureCard-module__icon___dXJ92",title:"FeatureCard-module__title___KxXyA",content:"FeatureCard-module__content___68xkw"},zs=({isMd:e=!1,theme:r})=>V.useMemo(()=>{const{rhythm:t}=r.fonts;return{"--feature-icon-font-size":e?"3rem":"2.5rem","--feature-title-font-size":e?"1.5rem":"1.25rem","--feature-card-padding":`calc(${t} * 1)`,"--feature-icon-margin-bottom":`calc(${t} * 0.7)`,"--feature-title-margin-bottom":`calc(${t} * 0.5)`}},[e,r.fonts]),$s=({breakpoint:e,icon:r,title:t,children:s,className:o,style:n,divProps:i})=>{const l=T(),d=[De.card,o].filter(Boolean).join(" "),y=e||l.breakpoints.md,f=ne(`(min-width: ${y})`),m=zs({isMd:f,theme:l});return p.jsxs("div",{...i,className:d,style:{...m,...n},children:[r&&p.jsx("div",{className:De.icon,children:r}),p.jsx("h3",{className:De.title,children:t}),p.jsx("div",{className:De.content,children:s})]})},dr={section:"FeatureGridSection-module__section___wZrbC",grid:"FeatureGridSection-module__grid___iwPJv"},Es=({columns:e,isMd:r=!1,isLg:t=!1})=>V.useMemo(()=>r?r&&!t&&(e===3||e===4)?{"--grid-template-columns":"repeat(2, 1fr)"}:{"--grid-template-columns":{1:"1fr",2:"repeat(2, 1fr)",3:"repeat(3, 1fr)",4:"repeat(4, 1fr)"}[e]}:{"--grid-template-columns":"1fr"},[e,r,t]),As=({columns:e=3,breakpoints:r,gap:t,children:s,className:o,style:n,...i})=>{const l=T(),d=[dr.section,o].filter(Boolean).join(" "),y=(r==null?void 0:r.md)||l.breakpoints.md,f=(r==null?void 0:r.lg)||l.breakpoints.lg,m=ne(`(min-width: ${y})`),h=ne(`(min-width: ${f})`),w=Es({columns:e,isMd:m,isLg:h}),k={"--section-padding-vertical":`calc(${l.fonts.rhythm} * 2)`},_={...w,gap:t,...n};return p.jsx(rt,{className:d,style:k,...i,children:p.jsx("div",{className:dr.grid,style:_,children:s})})},st={layoutContainer:"PageLayout-module__layoutContainer___diLdT",content:"PageLayout-module__content___h2mBr",main:"PageLayout-module__main___Sw7Pv"},Ns=({header:e,footer:r,children:t,className:s,style:o,
|
|
22
|
+
`})]});return t?p.jsx("div",{...n,className:s,style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw",...o},children:f}):f},Vs=({children:e,loadingComponent:r})=>{const[t,s]=V.useState(!1);return V.useEffect(()=>{requestAnimationFrame(()=>{s(!0)})},[]),t?p.jsx(p.Fragment,{children:e}):r||p.jsx(ir,{})},tt={stack:"Stack-module__stack___yUU-B",vertical:"Stack-module__vertical___sKTyQ",horizontal:"Stack-module__horizontal___YsvtV"},ws=({direction:e="column",children:r,className:t,style:s,divProps:o})=>{const n=[tt.stack,e==="row"?tt.horizontal:tt.vertical,t].filter(Boolean).join(" ");return p.jsx("div",{...o,className:n,style:s,children:r})},ar={section:"ResponsiveSection-module__section___gBESK",innerDiv:"ResponsiveSection-module__innerDiv___r1bky"},rt=({backgroundColor:e,color:r,maxWidth:t,minWidth:s,width:o,height:n,padding:i,paddingSm:l,margin:d,gap:y,verticalRhythm:f=3,children:m,className:h,style:w,sectionProps:k})=>{const _=T(),z=ne(`(min-width: ${_.breakpoints.sm})`),A={backgroundColor:e,color:r||_.fonts.color,margin:d,...w},F=`calc(${_.fonts.rhythm} * ${f})`,$=z?i||_.layout.padding:l||_.layout.paddingSm,C={"--max-width":t||_.layout.maxWidth,"--min-width":s,"--width":o,"--height":n,"--section-padding":`${F} ${$}`,"--gap":y},E=[ar.section,h].filter(Boolean).join(" ");return p.jsx("section",{...k,className:E,style:A,children:p.jsx("div",{className:ar.innerDiv,style:C,children:m})})},lr={hero:"Hero-module__hero___IB2tg",content:"Hero-module__content___rkkfQ"},ks=({isMd:e=!1,isLg:r=!1,theme:t})=>V.useMemo(()=>{const{rhythm:s}=t.fonts;let o=`calc(${s} * 2) 0`,n="2rem",i="1.125rem";return r?(o=`calc(${s} * 4) 0`,n="3.5rem",i="1.5rem"):e&&(o=`calc(${s} * 3.5) 0`,n="3rem",i="1.25rem"),{"--hero-padding":o,"--hero-h1-font-size":n,"--hero-p-font-size":i,"--hero-h1-margin-bottom":`calc(${s} * 0.7)`}},[e,r,t.fonts]),xs=({color:e,breakpoints:r,children:t,className:s,style:o,...n})=>{const i=T(),l=[lr.hero,s].filter(Boolean).join(" "),d=(r==null?void 0:r.md)||i.breakpoints.md,y=(r==null?void 0:r.lg)||i.breakpoints.lg,f=ne(`(min-width: ${d})`),m=ne(`(min-width: ${y})`),h=ks({isMd:f,isLg:m,theme:i});return p.jsx(rt,{className:l,color:e||i.fonts.color,style:{...h,...o},...n,children:p.jsx("div",{className:lr.content,children:t})})},cr={footer:"Footer-module__footer___A76NF",container:"Footer-module__container___QneNs"},Cs=({isSmallScreen:e=!1,maxWidth:r,minWidth:t,width:s,height:o,paddingSm:n,padding:i,margin:l,gap:d,backgroundColor:y,color:f}={})=>{const m=T();return{maxWidth:r||m.layout.maxWidth,minWidth:t,width:s,height:o,padding:e?n||m.layout.paddingSm:i||m.layout.padding,margin:l,gap:d,backgroundColor:y,color:f||m.fonts.color}},ur=({backgroundColor:e,color:r,maxWidth:t,minWidth:s,width:o,height:n,padding:i,paddingSm:l,margin:d,gap:y,breakPoint:f,children:m,className:h,style:w,footerProps:k})=>{const _=T(),z=f||_.breakpoints.sm,{maxWidth:A,unit:F}=ge(z),$=ne(`(max-width: ${A}${F})`),C=Cs({isSmallScreen:$,maxWidth:t,minWidth:s,width:o,height:n,paddingSm:l,padding:i,margin:d,gap:y,backgroundColor:e,color:r}),E=[cr.container,h].filter(Boolean).join(" ");return p.jsx("footer",{...k,className:cr.footer,children:p.jsx("div",{className:E,style:{...C,...w},children:m})})},De={card:"FeatureCard-module__card___XQt66",icon:"FeatureCard-module__icon___dXJ92",title:"FeatureCard-module__title___KxXyA",content:"FeatureCard-module__content___68xkw"},zs=({isMd:e=!1,theme:r})=>V.useMemo(()=>{const{rhythm:t}=r.fonts;return{"--feature-icon-font-size":e?"3rem":"2.5rem","--feature-title-font-size":e?"1.5rem":"1.25rem","--feature-card-padding":`calc(${t} * 1)`,"--feature-icon-margin-bottom":`calc(${t} * 0.7)`,"--feature-title-margin-bottom":`calc(${t} * 0.5)`}},[e,r.fonts]),$s=({breakpoint:e,icon:r,title:t,children:s,className:o,style:n,divProps:i})=>{const l=T(),d=[De.card,o].filter(Boolean).join(" "),y=e||l.breakpoints.md,f=ne(`(min-width: ${y})`),m=zs({isMd:f,theme:l});return p.jsxs("div",{...i,className:d,style:{...m,...n},children:[r&&p.jsx("div",{className:De.icon,children:r}),p.jsx("h3",{className:De.title,children:t}),p.jsx("div",{className:De.content,children:s})]})},dr={section:"FeatureGridSection-module__section___wZrbC",grid:"FeatureGridSection-module__grid___iwPJv"},Es=({columns:e,isMd:r=!1,isLg:t=!1})=>V.useMemo(()=>r?r&&!t&&(e===3||e===4)?{"--grid-template-columns":"repeat(2, 1fr)"}:{"--grid-template-columns":{1:"1fr",2:"repeat(2, 1fr)",3:"repeat(3, 1fr)",4:"repeat(4, 1fr)"}[e]}:{"--grid-template-columns":"1fr"},[e,r,t]),As=({columns:e=3,breakpoints:r,gap:t,children:s,className:o,style:n,...i})=>{const l=T(),d=[dr.section,o].filter(Boolean).join(" "),y=(r==null?void 0:r.md)||l.breakpoints.md,f=(r==null?void 0:r.lg)||l.breakpoints.lg,m=ne(`(min-width: ${y})`),h=ne(`(min-width: ${f})`),w=Es({columns:e,isMd:m,isLg:h}),k={"--section-padding-vertical":`calc(${l.fonts.rhythm} * 2)`},_={...w,gap:t,...n};return p.jsx(rt,{className:d,style:k,...i,children:p.jsx("div",{className:dr.grid,style:_,children:s})})},st={layoutContainer:"PageLayout-module__layoutContainer___diLdT",content:"PageLayout-module__content___h2mBr",main:"PageLayout-module__main___Sw7Pv"},Ns=({header:e,footer:r,children:t,className:s,style:o,headerProps:n,footerProps:i,divProps:l,mainProps:d})=>{const y=[st.layoutContainer,s].filter(Boolean).join(" ");return p.jsxs("div",{...l,className:y,style:o,children:[p.jsxs("div",{className:st.content,children:[e&&p.jsx(nr,{...n,children:e}),p.jsx("main",{...d,className:st.main,children:t})]}),r&&p.jsx(ur,{...i,children:r})]})};N.Button=wr,N.CSSReset=Er,N.Checkbox=gt,N.FeatureCard=$s,N.FeatureGridSection=As,N.Footer=ur,N.Form=ls,N.FormCheckbox=gs,N.FormError=Xt,N.FormField=me,N.FormGroup=Yt,N.FormInput=ds,N.FormLabel=xe,N.FormRadio=ps,N.FormSelect=hs,N.FormTextarea=ys,N.Hamburger=sr,N.Header=nr,N.Hero=xs,N.Input=Rt,N.LoadingSpinner=ir,N.PageLayout=Ns,N.Radio=rr,N.ResponsiveNav=Fs,N.ResponsiveSection=rt,N.Select=tr,N.Stack=ws,N.StyleLoader=Vs,N.Textarea=er,N.ThemeProvider=Vr,N.parseBreakpoint=ge,N.useFormContext=Jt,N.useTheme=T,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
|