@harpercollins/harpercollins-design-system 1.18.0 → 1.19.0

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.
@@ -26,6 +26,8 @@ interface AppBarProps {
26
26
  avatarUrl: string;
27
27
  } | null;
28
28
  logoUrl?: string;
29
+ logo?: JSX.Element;
30
+ logoMini?: JSX.Element;
29
31
  }
30
- declare function AppBar({ currentApp, isNavigating, navigatingProgressDelay, leftSide, rightSide, myAccountMenu, workspaces, workspacesMenu, currentWorkspace, helpButton, mobileMenuPrimaryContent, mobileMenuSecondaryContent, user, logoUrl, }: AppBarProps): import("react/jsx-runtime").JSX.Element;
32
+ declare function AppBar({ currentApp, isNavigating, navigatingProgressDelay, leftSide, rightSide, myAccountMenu, workspaces, workspacesMenu, currentWorkspace, helpButton, mobileMenuPrimaryContent, mobileMenuSecondaryContent, user, logoUrl, logo, logoMini, }: AppBarProps): import("react/jsx-runtime").JSX.Element;
31
33
  export default AppBar;
package/dist/esm/index.js CHANGED
@@ -281,7 +281,7 @@ function Jt(e,t){const n=Pt(e,t);return"production"!==process.env.NODE_ENV?(...t
281
281
  svg {
282
282
  width: 1rem;
283
283
  }
284
- `;function MO({currentApp:a,isNavigating:i,navigatingProgressDelay:l,leftSide:s,rightSide:c,myAccountMenu:d,workspaces:u,workspacesMenu:p,currentWorkspace:f,helpButton:m,mobileMenuPrimaryContent:h,mobileMenuSecondaryContent:g,user:v,logoUrl:b}){const[y,w]=o.useState([{isOpen:!1,id:"primary"},{isOpen:!1,id:"secondary"}]),k=(e,t)=>{w(y?.map(n=>n.id===e?{...n,isOpen:t}:n))},S=e=>y.find(t=>t.id===e)?.isOpen,C=h?t(n,{children:[e(RO,{onClick:()=>k("primary",!0),children:e(QC,{icon:Jw,size:"md"})}),t(eg,{open:S("primary"),onClose:()=>{k("primary",!1)},anchor:"left",size:"lg",children:[e(Gg,{}),e(Ah,{children:"Main menu"}),e(km,{role:"presentation",children:h})]})]}):null,O=Array.isArray(u)&&u.length>0?e(km,{sx:{display:{xs:"none",sm:"flex"},pointerEvents:u.length<=1?"none":void 0},children:t(cO,{children:[e(TO,{size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:f}),t(dO,{placement:"bottom-start",children:[e(uO,{sticky:!0,children:"Workspaces"}),p]})]})}):null,D=t(DO,{children:[c,O,m?t(NO,{as:m.as,href:m.href,to:m.href,"aria-label":m.text,children:[e(QC,{icon:iO,size:"sm"}),e(km,{sx:{padding:0,display:{xs:"none",md:"flex"}},children:m.text||"Help"})]}):null,v&&d?t(cO,{children:[e(TO,{size:"sm",slots:{root:$p},slotProps:{root:{variant:"outlined",color:"neutral"}},startDecorator:e(QC,{icon:aO,size:"sm"}),children:e(km,{sx:{padding:0,display:{xs:"none",md:"flex"},textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100px"},children:v?.displayName?v.displayName:"My Account"})}),d]}):null]}),_=t(km,{sx:{display:{xs:"flex",md:"none"}},children:[e(RO,{onClick:()=>k("secondary",!0),color:"neutral",children:e(QC,{icon:nx,size:"md"})}),t(eg,{open:S("secondary"),onClose:()=>{k("secondary",!1)},anchor:"right",size:"lg",children:[" ",e(Gg,{}),e(km,{role:"presentation",onClick:()=>k("secondary",!1),onKeyDown:()=>k("secondary",!1),children:g})]})]}),T=(()=>{const e=ur(ei);return"production"!==process.env.NODE_ENV&&r.useDebugValue(e),e[x]||e})(),{logoFillColour:P}=T.palette.appbar;return t(n,{children:[e(SO,{isNavigating:i,delay:l}),t(CO,{children:[t(km,{sx:{display:"flex",alignItems:"center",gap:"1rem"},children:[e(km,{sx:{display:{xs:"flex",md:"none"}},children:C}),e(km,{sx:{display:{xs:"none",md:"flex"}},children:e(OO,{href:b||"/","aria-label":"Home",children:e(fO,{fillColour:P})})}),e(km,{sx:{display:{xs:"none",sm:"flex",md:"none"}},children:e(OO,{href:b||"/","aria-label":"Home",children:e(hO,{fillColour:P})})}),e(EO,{currentApp:a})]}),t(km,{sx:{display:"flex"},children:[e(PO,{children:s}),e(km,{children:D}),g&&_]})]})]})}function zO({id:r,options:a,onChange:i,name:l,...s}){const[c,d]=o.useState(s.defaultValue),[u,p]=o.useState(s.defaultValue?.value);return t(n,{children:[e(nm,{...s,sx:{"--Input-minHeight":"2.6rem"},id:r,options:a,onChange:(e,t,n)=>{d(t),p(t?t?.value:""),i&&i(e,t,n)},getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t.value,value:c,renderOption:s.renderOption,name:""}),e(hf,{name:l,value:u,type:"hidden",sx:{display:"none"}})]})}function $O(t){return e(Du,{...t})}const AO=jw.button`
284
+ `;function MO({currentApp:a,isNavigating:i,navigatingProgressDelay:l,leftSide:s,rightSide:c,myAccountMenu:d,workspaces:u,workspacesMenu:p,currentWorkspace:f,helpButton:m,mobileMenuPrimaryContent:h,mobileMenuSecondaryContent:g,user:v,logoUrl:b,logo:y,logoMini:w}){const[k,S]=o.useState([{isOpen:!1,id:"primary"},{isOpen:!1,id:"secondary"}]),C=(e,t)=>{S(k?.map(n=>n.id===e?{...n,isOpen:t}:n))},O=e=>k.find(t=>t.id===e)?.isOpen,D=h?t(n,{children:[e(RO,{onClick:()=>C("primary",!0),children:e(QC,{icon:Jw,size:"md"})}),t(eg,{open:O("primary"),onClose:()=>{C("primary",!1)},anchor:"left",size:"lg",children:[e(Gg,{}),e(Ah,{children:"Main menu"}),e(km,{role:"presentation",children:h})]})]}):null,_=Array.isArray(u)&&u.length>0?e(km,{sx:{display:{xs:"none",sm:"flex"},pointerEvents:u.length<=1?"none":void 0},children:t(cO,{children:[e(TO,{size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:f}),t(dO,{placement:"bottom-start",children:[e(uO,{sticky:!0,children:"Workspaces"}),p]})]})}):null,T=t(DO,{children:[c,_,m?t(NO,{as:m.as,href:m.href,to:m.href,"aria-label":m.text,children:[e(QC,{icon:iO,size:"sm"}),e(km,{sx:{padding:0,display:{xs:"none",md:"flex"}},children:m.text||"Help"})]}):null,v&&d?t(cO,{children:[e(TO,{size:"sm",slots:{root:$p},slotProps:{root:{variant:"outlined",color:"neutral"}},startDecorator:e(QC,{icon:aO,size:"sm"}),children:e(km,{sx:{padding:0,display:{xs:"none",md:"flex"},textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",maxWidth:"100px"},children:v?.displayName?v.displayName:"My Account"})}),d]}):null]}),P=t(km,{sx:{display:{xs:"flex",md:"none"}},children:[e(RO,{onClick:()=>C("secondary",!0),color:"neutral",children:e(QC,{icon:nx,size:"md"})}),t(eg,{open:O("secondary"),onClose:()=>{C("secondary",!1)},anchor:"right",size:"lg",children:[" ",e(Gg,{}),e(km,{role:"presentation",onClick:()=>C("secondary",!1),onKeyDown:()=>C("secondary",!1),children:g})]})]}),I=(()=>{const e=ur(ei);return"production"!==process.env.NODE_ENV&&r.useDebugValue(e),e[x]||e})(),{logoFillColour:E}=I.palette.appbar;return t(n,{children:[e(SO,{isNavigating:i,delay:l}),t(CO,{children:[t(km,{sx:{display:"flex",alignItems:"center",gap:"1rem"},children:[e(km,{sx:{display:{xs:"flex",md:"none"}},children:D}),e(km,{sx:{display:{xs:"none",md:"flex"}},children:e(OO,{href:b||"/","aria-label":"Home",children:y||e(fO,{fillColour:E})})}),e(km,{sx:{display:{xs:"none",sm:"flex",md:"none"}},children:e(OO,{href:b||"/","aria-label":"Home",children:w||e(hO,{fillColour:E})})}),e(EO,{currentApp:a})]}),t(km,{sx:{display:"flex"},children:[e(PO,{children:s}),e(km,{children:T}),g&&P]})]})]})}function zO({id:r,options:a,onChange:i,name:l,...s}){const[c,d]=o.useState(s.defaultValue),[u,p]=o.useState(s.defaultValue?.value);return t(n,{children:[e(nm,{...s,sx:{"--Input-minHeight":"2.6rem"},id:r,options:a,onChange:(e,t,n)=>{d(t),p(t?t?.value:""),i&&i(e,t,n)},getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t.value,value:c,renderOption:s.renderOption,name:""}),e(hf,{name:l,value:u,type:"hidden",sx:{display:"none"}})]})}function $O(t){return e(Du,{...t})}const AO=jw.button`
285
285
  float: right;
286
286
  border: none;
287
287
  background: none;
@@ -720,7 +720,7 @@ function Jt(e,t){const n=Pt(e,t);return"production"!==process.env.NODE_ENV?(...t
720
720
  }
721
721
  `,XE=jw.div`
722
722
  position: relative;
723
- `;let QE=1;const ZE=a(({children:n,side:r,size:a="md",open:i=!1,closeBlocked:l,onClose:s=()=>{},onCloseCompleted:c=()=>{},closeRequested:u=!1,showCloseButton:f=!1,...m},h)=>{const g=d(null);g.current||(g.current=`overlay-${QE}`,QE+=1);const v=d(null),[b,y]=o.useState(!1);o.useEffect(()=>{if(b){const e=setTimeout(c,200);return()=>{clearTimeout(e)}}return()=>{}}),p(()=>{u&&y(!0)},[u]),g.current||(g.current=`modal-${QE}`,QE+=1),p(()=>{document.body.style.overflow=i?"hidden":"auto"},[i]),p(()=>{const e=e=>{"Escape"===e.key&&(e.preventDefault(),s())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[s]);return e(eg,{open:i&&!b,anchor:r,className:`${r} ${i?"open":"closing"}`,size:a,...m,children:e(GE,{children:t(qE,{ref:v,children:[l&&t(UE,{role:"alert","aria-live":"assertive",children:[e(QC,{icon:dx}),t("p",{children:[e("strong",{children:"You have unsaved changes."})," Please save or cancel before closing."]})]}),e(XE,{ref:h,children:t(FE,{children:[f&&e(km,{sx:{display:"flex",justifyContent:"flex-end",padding:"1rem"},children:e($p,{onClick:()=>s(),color:"neutral",children:e(QC,{icon:ix,size:"lg"})})}),n]})})]})})})});function eR(t){return e(lg,{...t})}function tR(t){return e(pg,{...t})}const nR={light_internal:Za({cssVarPrefix:"",colorSchemes:{light:{color:{"":{primary:"var(--palette-primary-500)"}},palette:{mode:"light",primary:{50:"#f3f6ff",100:"#e7eeff",200:"#a69fee",300:"#8279e7",400:"#7065e4",500:"#4c3fdd",600:"#3d32b1",700:"#2e2685",800:"#1e1958",900:"#0f0d2c"},neutral:{50:"#fafbfd",100:"#f4f7fb",200:"#dbdde1",300:"#ced2d7",400:"#929496",500:"#7a7b7d",600:"#616264",700:"#494a4b",800:"#313132",900:"#181919"},background:{body:"var(--color--white)",surface:"var(--palette-primary-50)"},appbar:{background:"var(--color--primary)",text:"var(--color--white)",logoFillColour:"var(--color--white)"}}}}}),light_external:Za({cssVarPrefix:"",colorSchemes:{light:{color:{"":{primary:"var(--palette-primary-500)"}},palette:{mode:"light",primary:{50:"#eaf1f7",100:"#c2d5e7",200:"#9ab9d8",300:"#719dc8",400:"#4981b8",500:"#3573B1",600:"#2f679f",700:"#25507b",800:"#1a3958",900:"#0f2235"},neutral:{50:"#fafbfd",100:"#f4f7fb",200:"#dbdde1",300:"#ced2d7",400:"#929496",500:"#7a7b7d",600:"#616264",700:"#494a4b",800:"#313132",900:"#181919"},appbar:{background:"var(--color--white)",text:"var(--color--grey)",logoFillColour:void 0}}}}})};function rR({children:t,theme:n="light_internal"}){return e(ii,{theme:nR[n],children:t})}const oR=jw.div`
723
+ `;let QE=1;const ZE=a(({children:n,side:r,size:a="md",open:i=!1,closeBlocked:l,onClose:s=()=>{},onCloseCompleted:c=()=>{},closeRequested:u=!1,showCloseButton:f=!1,...m},h)=>{const g=d(null);g.current||(g.current=`overlay-${QE}`,QE+=1);const v=d(null),[b,y]=o.useState(!1);o.useEffect(()=>{if(b){const e=setTimeout(c,200);return()=>{clearTimeout(e)}}return()=>{}}),p(()=>{u&&y(!0)},[u]),g.current||(g.current=`modal-${QE}`,QE+=1),p(()=>{document.body.style.overflow=i?"hidden":"auto"},[i]),p(()=>{const e=e=>{"Escape"===e.key&&(e.preventDefault(),s())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[s]);return e(eg,{open:i&&!b,anchor:r,className:`${r} ${i?"open":"closing"}`,size:a,...m,children:e(GE,{children:t(qE,{ref:v,children:[l&&t(UE,{role:"alert","aria-live":"assertive",children:[e(QC,{icon:dx}),t("p",{children:[e("strong",{children:"You have unsaved changes."})," Please save or cancel before closing."]})]}),e(XE,{ref:h,children:t(FE,{children:[f&&e(km,{sx:{display:"flex",justifyContent:"flex-end",padding:"1rem"},children:e($p,{onClick:()=>s(),color:"neutral",children:e(QC,{icon:ix,size:"lg"})})}),n]})})]})})})});function eR(t){return e(lg,{...t})}function tR(t){return e(pg,{...t})}const nR={light_internal:Za({cssVarPrefix:"",colorSchemes:{light:{color:{"":{primary:"var(--palette-primary-500)"}},palette:{mode:"light",primary:{50:"#e8f0f6",100:"#d2e1ed",200:"#a6c3db",300:"#7aa5ca",400:"#4e87b8",500:"#2269a7",600:"#1b5485",700:"#143f64",800:"#0d2a42",900:"#061521"},neutral:{50:"#fafbfd",100:"#f4f7fb",200:"#dbdde1",300:"#ced2d7",400:"#929496",500:"#7a7b7d",600:"#616264",700:"#494a4b",800:"#313132",900:"#181919"},background:{body:"var(--color--white)",surface:"var(--palette-primary-50)"},appbar:{background:"var(--color--primary)",text:"var(--color--white)",logoFillColour:"var(--color--white)"}}}}}),light_external:Za({cssVarPrefix:"",colorSchemes:{light:{color:{"":{primary:"var(--palette-primary-500)"}},palette:{mode:"light",primary:{50:"#eaf1f7",100:"#c2d5e7",200:"#9ab9d8",300:"#719dc8",400:"#4981b8",500:"#3573B1",600:"#2f679f",700:"#25507b",800:"#1a3958",900:"#0f2235"},neutral:{50:"#fafbfd",100:"#f4f7fb",200:"#dbdde1",300:"#ced2d7",400:"#929496",500:"#7a7b7d",600:"#616264",700:"#494a4b",800:"#313132",900:"#181919"},appbar:{background:"var(--color--white)",text:"var(--color--grey)",logoFillColour:void 0}}}}})};function rR({children:t,theme:n="light_internal"}){return e(ii,{theme:nR[n],children:t})}const oR=jw.div`
724
724
  background: var(--color--grey-lightest);
725
725
  text-align: center;
726
726
  display: flex;