@cruk/chakra-components 4.0.0-dev.32 → 4.0.0-dev.34

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,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),n=require("@chakra-ui/react"),t=require("react"),i=require("../Button/index.js"),r=require("../Button/IconButton.js");require("../Flex/index.js");var s=require("../Heading/index.js");require("../Icon/index.js");var o=require("../List/index.js"),a=require("@chakra-ui/icons");const d=n.forwardRef((d,l)=>{const{children:c,...x}=d,[u,h]=t.useState(!1),[g,j]=t.useState(!1),[p,m]=t.useState(!1),b=t.Children.toArray(c),f=n.useBreakpointValue({base:5,lg:8},{fallback:"md"}),v=b.slice(0,u?b.length:f),w="OnThisPage-container";return t.useEffect(()=>{const e=()=>{const e=document.getElementById(w);e&&j(window.scrollY>e.offsetTop+e.offsetHeight)};e(),window.addEventListener("scroll",e);const n=()=>{const e=document.querySelector('[data-testid="survey-root"]');m(!!e)};n();const t=new MutationObserver(n);return t.observe(document.body,{childList:!0,subtree:!0}),()=>{window.removeEventListener("scroll",e),t.disconnect()}},[]),c?e.jsx(n.Box,{paddingTop:{base:4,md:8,lg:10},ref:l,"data-testid":w,id:w,children:e.jsxs(n.Box,{backgroundColor:"onThisPagePrimaryBg",padding:{base:4,md:6,lg:8},...x,children:[e.jsxs("nav",{children:[e.jsx(s.Heading,{fontSize:{base:"headings.sm",lg:"headings.lg"},lineHeight:{base:"headings.sm",lg:"headings.lg"},display:"flex",pb:4,children:"On this page"}),e.jsx(n.UnorderedList,{marginInlineStart:0,paddingInlineStart:0,sx:{li:{display:"flex",paddingBottom:2,alignItems:"center"}},styleType:"none",children:v.map((n,t)=>e.jsx(o.ArrowDownListItem,{children:n},t))})]}),f&&b.length>f&&e.jsx(n.Flex,{justifyContent:"flex-end",children:e.jsx(i.Button,{mt:4,variant:"linkNoDecoration",rightIcon:u?e.jsx(a.ChevronUpIcon,{boxSize:6}):e.jsx(a.ChevronDownIcon,{boxSize:6}),onClick:()=>h(!u),children:u?"Show less":"Show all"})}),g&&e.jsx(n.Portal,{children:e.jsx(n.Flex,{justifyContent:"center",pointerEvents:"none",children:e.jsx(n.Container,{position:"fixed",bottom:{base:p?20:4,md:20},children:e.jsx(n.Flex,{justifyContent:"end",paddingRight:{base:4,md:8},children:e.jsx(n.Box,{pointerEvents:"auto",zIndex:"sticky",position:"relative",children:e.jsx(n.Link,{href:`#${w}`,children:e.jsx(r.IconButton,{icon:e.jsx(a.ArrowUpIcon,{}),variant:"backToTop","aria-label":"Back to top"})})})})})})})]})}):e.jsx(e.Fragment,{})});exports.OnThisPageHeadings=d;
1
+ "use strict";var e=require("react/jsx-runtime"),n=require("@chakra-ui/react"),t=require("react"),i=require("../Button/index.js"),r=require("../Button/IconButton.js");require("../Flex/index.js");var s=require("../Heading/index.js");require("../Icon/index.js");var o=require("../List/index.js"),a=require("@chakra-ui/icons");const d=n.forwardRef((d,l)=>{const{children:c,...x}=d,[u,h]=t.useState(!1),[g,j]=t.useState(!1),[p,m]=t.useState(!1),b=t.Children.toArray(c),f=n.useBreakpointValue({base:5,lg:8},{fallback:"md"}),v=b.slice(0,u?b.length:f),w="OnThisPage-container";return t.useEffect(()=>{const e=()=>{const e=document.getElementById(w);e&&j(window.scrollY>e.offsetTop+e.offsetHeight)};e(),window.addEventListener("scroll",e);const n=()=>{const e=document.querySelector('[data-testid="survey-root"]');m(!!e)};n();const t=new MutationObserver(n);return t.observe(document.body,{childList:!0,subtree:!0}),()=>{window.removeEventListener("scroll",e),t.disconnect()}},[]),c?e.jsx(n.Box,{paddingTop:{base:4,md:8,lg:10},ref:l,"data-testid":w,id:w,children:e.jsxs(n.Box,{backgroundColor:"onThisPagePrimaryBg",padding:{base:4,md:6,lg:8},...x,children:[e.jsxs("nav",{children:[e.jsx(s.Heading,{fontSize:{base:"headings.sm",lg:"headings.lg"},lineHeight:{base:"headings.sm",lg:"headings.lg"},display:"flex",pb:4,children:"On this page"}),e.jsx(n.UnorderedList,{marginInlineStart:0,paddingInlineStart:0,sx:{li:{display:"flex",paddingBottom:2,alignItems:"center"}},styleType:"none",children:v.map((n,t)=>e.jsx(o.ArrowDownListItem,{children:n},t))})]}),f&&b.length>f&&e.jsx(n.Flex,{justifyContent:"flex-end",children:e.jsx(i.Button,{mt:4,variant:"linkNoDecoration",rightIcon:u?e.jsx(a.ChevronUpIcon,{boxSize:6}):e.jsx(a.ChevronDownIcon,{boxSize:6}),onClick:()=>h(!u),children:u?"Show less":"Show all"})}),g&&e.jsx(n.Portal,{children:e.jsx(n.Flex,{justifyContent:"center",pointerEvents:"none",children:e.jsx(n.Container,{position:"fixed",bottom:{base:p?16:4,md:20},children:e.jsx(n.Flex,{justifyContent:"end",paddingRight:{base:4,md:8},children:e.jsx(n.Box,{pointerEvents:"auto",zIndex:"sticky",position:"relative",children:e.jsx(n.Link,{href:`#${w}`,children:e.jsx(r.IconButton,{icon:e.jsx(a.ArrowUpIcon,{}),variant:"backToTop","aria-label":"Back to top"})})})})})})})]})}):e.jsx(e.Fragment,{})});exports.OnThisPageHeadings=d;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@chakra-ui/react"),n=require("react"),i=require("../Heading/index.js"),s=require("../Video/index.js");const t=r.forwardRef((t,l)=>{const o=n.useRef(null);if(t.icon){const{icon:s,children:o,tags:d,preHeading:c,share:a,...x}=t;return e.jsxs(r.Flex,{ref:l,...x,flexDirection:"column",width:"100%",as:"header",children:[e.jsxs(r.Box,{children:[e.jsxs(r.Flex,{flexDirection:{base:"column-reverse",lg:"row"},justifyContent:"space-between",marginBottom:8,gap:{base:4,lg:10},children:[n.cloneElement(s,{w:{base:24,lg:36},h:{base:24,lg:36}}),d&&d.length>0&&e.jsx(r.List,{style:{display:"flex",gap:"0.5rem",justifyContent:"flex-end",flexWrap:"wrap"},children:d.map((n,i)=>e.jsx(r.ListItem,{children:e.jsx(r.Tag,{children:n})},`${n}-${i}`))})]}),c&&e.jsx(i.Heading5,{as:"span",fontFamily:"body",children:c})]}),e.jsx(r.Box,{justifySelf:"center",zIndex:1,children:o}),a&&e.jsx(r.Flex,{width:"100%",justifyContent:"flex-end",children:a})]})}const{media:d,children:c,controlsContainerProps:a,mediaContainerProps:x,share:h,...f}=t;if(!d)return c;const{videoProps:j,videoControls:u}=s.VideoControls(d,o),{key:m}=d;return e.jsxs(r.Flex,{ref:l,...f,flexDirection:"column",width:"100%",as:"header",children:[e.jsxs(r.Box,{...x,children:["video"===m?n.cloneElement(d,j):d,e.jsx(r.Box,{...a,children:"video"===m&&u})]}),e.jsx(r.Box,{justifySelf:"center",zIndex:1,children:c}),h&&e.jsx(r.Flex,{width:"100%",justifyContent:"flex-end",children:h})]})});t.displayName="RichHeader",exports.RichHeader=t;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@chakra-ui/react"),n=require("react"),i=require("../Heading/index.js"),s=require("../Video/index.js");const t=r.forwardRef((i,t)=>{const{media:l,children:o,controlsContainerProps:d,mediaContainerProps:a,share:c,...x}=i,h=n.useRef(null),{videoProps:f,videoControls:j}=s.VideoControls(l,h);return e.jsxs(r.Flex,{ref:t,...x,flexDirection:"column",width:"100%",as:"header",children:[e.jsxs(r.Box,{...a,children:[n.cloneElement(l,f),e.jsx(r.Box,{...d,children:j})]}),e.jsx(r.Box,{justifySelf:"center",zIndex:1,children:o}),c&&e.jsx(r.Flex,{width:"100%",justifyContent:"flex-end",children:c})]})});t.displayName="RichHeaderVideoMedia";const l=r.forwardRef((s,l)=>{if(s.icon){const{icon:t,children:o,tags:d,preHeading:a,share:c,...x}=s;return e.jsxs(r.Flex,{ref:l,...x,flexDirection:"column",width:"100%",as:"header",children:[e.jsxs(r.Box,{children:[e.jsxs(r.Flex,{flexDirection:{base:"column-reverse",lg:"row"},justifyContent:"space-between",marginBottom:8,gap:{base:4,lg:10},children:[n.cloneElement(t,{w:{base:24,lg:36},h:{base:24,lg:36}}),d&&d.length>0&&e.jsx(r.List,{style:{display:"flex",gap:"0.5rem",justifyContent:"flex-end",flexWrap:"wrap"},children:d.map((n,i)=>e.jsx(r.ListItem,{children:e.jsx(r.Tag,{children:n})},`${n}-${i}`))})]}),a&&e.jsx(i.Heading5,{as:"span",fontFamily:"body",children:a})]}),e.jsx(r.Box,{justifySelf:"center",zIndex:1,children:o}),c&&e.jsx(r.Flex,{width:"100%",justifyContent:"flex-end",children:c})]})}const{media:o,children:d,controlsContainerProps:a,mediaContainerProps:c,share:x,...h}=s;if(!o)return d;const{key:f}=o;return"video"===f?e.jsx(t,{ref:l,media:o,controlsContainerProps:a,mediaContainerProps:c,share:x,...h,children:d}):e.jsxs(r.Flex,{ref:l,...h,flexDirection:"column",width:"100%",as:"header",children:[e.jsx(r.Box,{...c,children:o}),e.jsx(r.Box,{justifySelf:"center",zIndex:1,children:d}),x&&e.jsx(r.Flex,{width:"100%",justifyContent:"flex-end",children:x})]})});l.displayName="RichHeader",exports.RichHeader=l;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/RichHeader/index.tsx"],"sourcesContent":[null],"names":["RichHeader","forwardRef","props","ref","videoRef","useRef","icon","children","tags","preHeading","share","rest","_jsxs","Flex","flexDirection","width","as","Box","base","lg","justifyContent","marginBottom","gap","cloneElement","w","h","length","_jsx","List","style","display","flexWrap","map","tag","i","ListItem","Tag","Heading5","fontFamily","justifySelf","zIndex","media","controlsContainerProps","mediaContainerProps","videoProps","videoControls","VideoControls","key","mediaType","displayName"],"mappings":"iKA4BA,MAAMA,EAAaC,EAAAA,WAAmC,CAACC,EAAOC,KAC5D,MAAMC,EAAWC,EAAAA,OAAgC,MAEjD,GAAIH,EAAMI,KAAM,CACd,MAAMA,KAAEA,EAAIC,SAAEA,EAAQC,KAAEA,EAAIC,WAAEA,EAAUC,MAAEA,KAAUC,GAAST,EAE7D,OACEU,EAAAA,KAACC,EAAAA,KAAI,CAACV,I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C,EAAwBzB,EAAAA,aAAakB,EAAOG,GAAcH,EAC3Dd,EAAAA,IAACV,EAAAA,IAAG,IAAKyB,EAAsBnC,SACd,UAAdyC,GAAyBH,OAG9BlB,EAAAA,IAACV,EAAAA,KAAIsB,YAAY,SAASC,OAAQ,EAACjC,SAChCA,IAEFG,GACCiB,EAAAA,IAACd,EAAAA,KAAI,CAACE,MAAM,OAAOK,eAAe,WAAUb,SACzCG,SAOXV,EAAWiD,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/RichHeader/index.tsx"],"sourcesContent":[null],"names":["RichHeaderVideoMedia","forwardRef","props","ref","media","children","controlsContainerProps","mediaContainerProps","share","rest","videoRef","useRef","videoProps","videoControls","VideoControls","_jsxs","Flex","flexDirection","width","as","Box","cloneElement","_jsx","justifySelf","zIndex","justifyContent","displayName","RichHeader","icon","tags","preHeading","base","lg","marginBottom","gap","w","h","length","List","style","display","flexWrap","map","tag","i","ListItem","Tag","Heading5","fontFamily","key","mediaType"],"mappings":"iKAoCA,MAAMA,EAAuBC,EAAAA,WAC3B,CAACC,EAAOC,KACN,MAAMC,MACJA,EAAKC,SACLA,EAAQC,uBACRA,EAAsBC,oBACtBA,EAAmBC,MACnBA,KACGC,GACDP,EAEEQ,EAAWC,EAAAA,OAAgC,OAC3CC,WAAEA,EAAUC,cAAEA,GAAkBC,EAAAA,cAAcV,EAAOM,GAE3D,OACEK,OAACC,EAAAA,KAAI,CAACb,IAAKA,KAASM,EAAMQ,cAAc,SAASC,MAAM,OAAOC,GAAG,SAAQd,SAAA,CACvEU,OAACK,EAAAA,IAAG,IAAKb,EAAmBF,SAAA,CACzBgB,EAAAA,aAAajB,EAAOQ,GACrBU,EAAAA,IAACF,EAAAA,IAAG,IAAKd,EAAsBD,SAAGQ,OAEpCS,EAAAA,IAACF,OAAIG,YAAY,SAASC,OAAQ,EAACnB,SAChCA,IAEFG,GACCc,EAAAA,IAACN,OAAI,CAACE,MAAM,OAAOO,eAAe,oBAC/Bj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MAAQ4C,IAAKC,GAAc9C,EAE3B,MAAkB,UAAd8C,EAEA5B,EAAAA,IAACtB,EAAoB,CACnBG,IAAKA,EACLC,MAAOA,EACPE,uBAAwBA,EACxBC,oBAAqBA,EACrBC,MAAOA,KACHC,EAAIJ,SAEPA,IAMLU,EAAAA,KAACC,OAAI,CAACb,IAAKA,KAASM,EAAMQ,cAAc,SAASC,MAAM,OAAOC,GAAG,SAAQd,SAAA,CACvEiB,MAACF,EAAAA,IAAG,IAAKb,EAAmBF,SAAGD,IAC/BkB,EAAAA,IAACF,MAAG,CAACG,YAAY,SAASC,OAAQ,EAACnB,SAChCA,IAEFG,GACCc,EAAAA,IAACN,EAAAA,KAAI,CAACE,MAAM,OAAOO,eAAe,WAAUpB,SACzCG,SAOXmB,EAAWD,YAAc"}
@@ -1,2 +1,2 @@
1
- import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{forwardRef as i,useBreakpointValue as o,Box as r,UnorderedList as s,Flex as d,Portal as a,Container as l,Link as c}from"@chakra-ui/react";import m,{useEffect as h}from"react";import{Button as g}from"../Button/index.js";import{IconButton as p}from"../Button/IconButton.js";import"../Flex/index.js";import{Heading as f}from"../Heading/index.js";import"../Icon/index.js";import{ArrowDownListItem as u}from"../List/index.js";import{ChevronUpIcon as b,ChevronDownIcon as x,ArrowUpIcon as y}from"@chakra-ui/icons";const v=i((i,v)=>{const{children:j,...S}=i,[k,w]=m.useState(!1),[I,B]=m.useState(!1),[T,C]=m.useState(!1),E=m.Children.toArray(j),L=o({base:5,lg:8},{fallback:"md"}),z=E.slice(0,k?E.length:L),H="OnThisPage-container";return h(()=>{const e=()=>{const e=document.getElementById(H);e&&B(window.scrollY>e.offsetTop+e.offsetHeight)};e(),window.addEventListener("scroll",e);const n=()=>{const e=document.querySelector('[data-testid="survey-root"]');C(!!e)};n();const t=new MutationObserver(n);return t.observe(document.body,{childList:!0,subtree:!0}),()=>{window.removeEventListener("scroll",e),t.disconnect()}},[]),j?e(r,{paddingTop:{base:4,md:8,lg:10},ref:v,"data-testid":H,id:H,children:t(r,{backgroundColor:"onThisPagePrimaryBg",padding:{base:4,md:6,lg:8},...S,children:[t("nav",{children:[e(f,{fontSize:{base:"headings.sm",lg:"headings.lg"},lineHeight:{base:"headings.sm",lg:"headings.lg"},display:"flex",pb:4,children:"On this page"}),e(s,{marginInlineStart:0,paddingInlineStart:0,sx:{li:{display:"flex",paddingBottom:2,alignItems:"center"}},styleType:"none",children:z.map((n,t)=>e(u,{children:n},t))})]}),L&&E.length>L&&e(d,{justifyContent:"flex-end",children:e(g,{mt:4,variant:"linkNoDecoration",rightIcon:e(k?b:x,{boxSize:6}),onClick:()=>w(!k),children:k?"Show less":"Show all"})}),I&&e(a,{children:e(d,{justifyContent:"center",pointerEvents:"none",children:e(l,{position:"fixed",bottom:{base:T?20:4,md:20},children:e(d,{justifyContent:"end",paddingRight:{base:4,md:8},children:e(r,{pointerEvents:"auto",zIndex:"sticky",position:"relative",children:e(c,{href:`#${H}`,children:e(p,{icon:e(y,{}),variant:"backToTop","aria-label":"Back to top"})})})})})})})]})}):e(n,{})});export{v as OnThisPageHeadings};
1
+ import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{forwardRef as i,useBreakpointValue as o,Box as r,UnorderedList as s,Flex as d,Portal as a,Container as l,Link as c}from"@chakra-ui/react";import m,{useEffect as h}from"react";import{Button as g}from"../Button/index.js";import{IconButton as p}from"../Button/IconButton.js";import"../Flex/index.js";import{Heading as f}from"../Heading/index.js";import"../Icon/index.js";import{ArrowDownListItem as u}from"../List/index.js";import{ChevronUpIcon as b,ChevronDownIcon as x,ArrowUpIcon as y}from"@chakra-ui/icons";const v=i((i,v)=>{const{children:j,...S}=i,[k,w]=m.useState(!1),[I,B]=m.useState(!1),[T,C]=m.useState(!1),E=m.Children.toArray(j),L=o({base:5,lg:8},{fallback:"md"}),z=E.slice(0,k?E.length:L),H="OnThisPage-container";return h(()=>{const e=()=>{const e=document.getElementById(H);e&&B(window.scrollY>e.offsetTop+e.offsetHeight)};e(),window.addEventListener("scroll",e);const n=()=>{const e=document.querySelector('[data-testid="survey-root"]');C(!!e)};n();const t=new MutationObserver(n);return t.observe(document.body,{childList:!0,subtree:!0}),()=>{window.removeEventListener("scroll",e),t.disconnect()}},[]),j?e(r,{paddingTop:{base:4,md:8,lg:10},ref:v,"data-testid":H,id:H,children:t(r,{backgroundColor:"onThisPagePrimaryBg",padding:{base:4,md:6,lg:8},...S,children:[t("nav",{children:[e(f,{fontSize:{base:"headings.sm",lg:"headings.lg"},lineHeight:{base:"headings.sm",lg:"headings.lg"},display:"flex",pb:4,children:"On this page"}),e(s,{marginInlineStart:0,paddingInlineStart:0,sx:{li:{display:"flex",paddingBottom:2,alignItems:"center"}},styleType:"none",children:z.map((n,t)=>e(u,{children:n},t))})]}),L&&E.length>L&&e(d,{justifyContent:"flex-end",children:e(g,{mt:4,variant:"linkNoDecoration",rightIcon:e(k?b:x,{boxSize:6}),onClick:()=>w(!k),children:k?"Show less":"Show all"})}),I&&e(a,{children:e(d,{justifyContent:"center",pointerEvents:"none",children:e(l,{position:"fixed",bottom:{base:T?16:4,md:20},children:e(d,{justifyContent:"end",paddingRight:{base:4,md:8},children:e(r,{pointerEvents:"auto",zIndex:"sticky",position:"relative",children:e(c,{href:`#${H}`,children:e(p,{icon:e(y,{}),variant:"backToTop","aria-label":"Back to top"})})})})})})})]})}):e(n,{})});export{v as OnThisPageHeadings};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import{forwardRef as n,Flex as i,Box as t,List as o,ListItem as d,Tag as l}from"@chakra-ui/react";import{useRef as c,cloneElement as a}from"react";import{Heading5 as s}from"../Heading/index.js";import{VideoControls as h}from"../Video/index.js";const f=n((n,f)=>{const m=c(null);if(n.icon){const{icon:c,children:h,tags:m,preHeading:p,share:u,...x}=n;return e(i,{ref:f,...x,flexDirection:"column",width:"100%",as:"header",children:[e(t,{children:[e(i,{flexDirection:{base:"column-reverse",lg:"row"},justifyContent:"space-between",marginBottom:8,gap:{base:4,lg:10},children:[a(c,{w:{base:24,lg:36},h:{base:24,lg:36}}),m&&m.length>0&&r(o,{style:{display:"flex",gap:"0.5rem",justifyContent:"flex-end",flexWrap:"wrap"},children:m.map((e,n)=>r(d,{children:r(l,{children:e})},`${e}-${n}`))})]}),p&&r(s,{as:"span",fontFamily:"body",children:p})]}),r(t,{justifySelf:"center",zIndex:1,children:h}),u&&r(i,{width:"100%",justifyContent:"flex-end",children:u})]})}const{media:p,children:u,controlsContainerProps:x,mediaContainerProps:y,share:g,...j}=n;if(!p)return u;const{videoProps:w,videoControls:C}=h(p,m),{key:b}=p;return e(i,{ref:f,...j,flexDirection:"column",width:"100%",as:"header",children:[e(t,{...y,children:["video"===b?a(p,w):p,r(t,{...x,children:"video"===b&&C})]}),r(t,{justifySelf:"center",zIndex:1,children:u}),g&&r(i,{width:"100%",justifyContent:"flex-end",children:g})]})});f.displayName="RichHeader";export{f as RichHeader};
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{forwardRef as n,Flex as i,Box as t,List as o,ListItem as d,Tag as l}from"@chakra-ui/react";import{useRef as a,cloneElement as c}from"react";import{Heading5 as s}from"../Heading/index.js";import{VideoControls as h}from"../Video/index.js";const f=n((n,o)=>{const{media:d,children:l,controlsContainerProps:s,mediaContainerProps:f,share:m,...p}=n,u=a(null),{videoProps:x,videoControls:y}=h(d,u);return e(i,{ref:o,...p,flexDirection:"column",width:"100%",as:"header",children:[e(t,{...f,children:[c(d,x),r(t,{...s,children:y})]}),r(t,{justifySelf:"center",zIndex:1,children:l}),m&&r(i,{width:"100%",justifyContent:"flex-end",children:m})]})});f.displayName="RichHeaderVideoMedia";const m=n((n,a)=>{if(n.icon){const{icon:h,children:f,tags:m,preHeading:p,share:u,...x}=n;return e(i,{ref:a,...x,flexDirection:"column",width:"100%",as:"header",children:[e(t,{children:[e(i,{flexDirection:{base:"column-reverse",lg:"row"},justifyContent:"space-between",marginBottom:8,gap:{base:4,lg:10},children:[c(h,{w:{base:24,lg:36},h:{base:24,lg:36}}),m&&m.length>0&&r(o,{style:{display:"flex",gap:"0.5rem",justifyContent:"flex-end",flexWrap:"wrap"},children:m.map((e,n)=>r(d,{children:r(l,{children:e})},`${e}-${n}`))})]}),p&&r(s,{as:"span",fontFamily:"body",children:p})]}),r(t,{justifySelf:"center",zIndex:1,children:f}),u&&r(i,{width:"100%",justifyContent:"flex-end",children:u})]})}const{media:h,children:m,controlsContainerProps:p,mediaContainerProps:u,share:x,...y}=n;if(!h)return m;const{key:C}=h;return"video"===C?r(f,{ref:a,media:h,controlsContainerProps:p,mediaContainerProps:u,share:x,...y,children:m}):e(i,{ref:a,...y,flexDirection:"column",width:"100%",as:"header",children:[r(t,{...u,children:h}),r(t,{justifySelf:"center",zIndex:1,children:m}),x&&r(i,{width:"100%",justifyContent:"flex-end",children:x})]})});m.displayName="RichHeader";export{m as RichHeader};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/RichHeader/index.tsx"],"sourcesContent":[null],"names":["RichHeader","forwardRef","props","ref","videoRef","useRef","icon","children","tags","preHeading","share","rest","_jsxs","Flex","flexDirection","width","as","Box","base","lg","justifyContent","marginBottom","gap","cloneElement","w","h","length","_jsx","List","style","display","flexWrap","map","tag","i","ListItem","Tag","Heading5","fontFamily","justifySelf","zIndex","media","controlsContainerProps","mediaContainerProps","videoProps","videoControls","VideoControls","key","mediaType","displayName"],"mappings":"sSA4BA,MAAMA,EAAaC,EAAmC,CAACC,EAAOC,KAC5D,MAAMC,EAAWC,EAAgC,MAEjD,GAAIH,EAAMI,KAAM,CACd,MAAMA,KAAEA,EAAIC,SAAEA,EAAQC,KAAEA,EAAIC,WAAEA,EAAUC,MAAEA,KAAUC,GAAST,EAE7D,OACEU,EAACC,EAAI,CAACV,IAAKA,KAASQ,EAAMG,cAAc,SAASC,MAAM,OAAO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ACE,MAAM,OAAOK,eAAe,WAAUb,SACzCG,SAOXV,EAAWiD,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/RichHeader/index.tsx"],"sourcesContent":[null],"names":["RichHeaderVideoMedia","forwardRef","props","ref","media","children","controlsContainerProps","mediaContainerProps","share","rest","videoRef","useRef","videoProps","videoControls","VideoControls","_jsxs","Flex","flexDirection","width","as","Box","cloneElement","_jsx","justifySelf","zIndex","justifyContent","displayName","RichHeader","icon","tags","preHeading","base","lg","marginBottom","gap","w","h","length","List","style","display","flexWrap","map","tag","i","ListItem","Tag","Heading5","fontFamily","key","mediaType"],"mappings":"sSAoCA,MAAMA,EAAuBC,EAC3B,CAACC,EAAOC,KACN,MAAMC,MACJA,EAAKC,SACLA,EAAQC,uBACRA,EAAsBC,oBACtBA,EAAmBC,MACnBA,KACGC,GACDP,EAEEQ,EAAWC,EAAgC,OAC3CC,WAAEA,EAAUC,cAAEA,GAAkBC,EAAcV,EAAOM,GAE3D,OACEK,EAACC,EAAI,CAACb,IAAKA,KAASM,EAAMQ,cAAc,SAASC,MAAM,OAAOC,GAAG,SAAQd,SAAA,CACvEU,EAACK,EAAG,IAAKb,EAAmBF,SAAA,CACzBgB,EAAajB,EAAOQ,GACrBU,EAACF,EAAG,IAAKd,EAAsBD,SAAGQ,OAEpCS,EAACF,GAAIG,YAAY,SAASC,OAAQ,EAACnB,SAChCA,IAEFG,GACCc,EAACN,EAAI,CAACE,MAAM,OAAOO,eAAe,oBAC/BjB,SAQbR,EAAqB0B,YAAc,uBAEnC,MAAMC,EAAa1B,EAAmC,CAACC,EAAOC,KAC5D,GAAID,EAAM0B,KAAM,CACd,MAAMA,KAAEA,EAAIvB,SAAEA,EAAQwB,KAAEA,EAAIC,WAAEA,EAAUtB,MAAEA,KAAUC,GAASP,EAE7D,OACEa,EAACC,EAAI,CAACb,IAAKA,KAASM,EAAMQ,cAAc,SAASC,MAAM,OAAOC,GAAG,SAAQd,SAAA,CACvEU,EAACK,EA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,SAOXmB,EAAWD,YAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cruk/chakra-components",
3
- "version": "4.0.0-dev.32",
3
+ "version": "4.0.0-dev.34",
4
4
  "description": "Chakra UI v2 based components for CRUK applications",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,