@harpercollins/harpercollins-design-system 1.15.1 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +4 -12
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/overlay/Drawer/Drawer.d.ts +0 -1
- package/dist/esm/index.js +5 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/overlay/Drawer/Drawer.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/package.json +19 -18
package/dist/esm/index.js
CHANGED
|
@@ -157,15 +157,7 @@ const pw={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M222.7 3
|
|
|
157
157
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
158
158
|
* Copyright 2024 Fonticons, Inc.
|
|
159
159
|
*/const vC={prefix:"far",iconName:"user",icon:[448,512,[128100,62144],"f007","M304 128a80 80 0 1 0 -160 0 80 80 0 1 0 160 0zM96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM49.3 464l349.5 0c-8.9-63.3-63.3-112-129-112l-91.4 0c-65.7 0-120.1 48.7-129 112zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3z"]},bC={prefix:"far",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},yC={prefix:"far",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]};function wC(t){return e(wi,{...t})}const xC=cw.div`
|
|
160
|
-
|
|
161
|
-
padding-left: ${({$disableGutters:e})=>e?"0":"60px"};
|
|
162
|
-
padding-right: ${({$disableGutters:e})=>e?"0":"60px"};
|
|
163
|
-
padding-top: ${({$disableGutters:e})=>e?"0":"40px"};
|
|
164
|
-
|
|
165
|
-
@media only screen and (max-width: 600px) {
|
|
166
|
-
padding-left: ${({$disableGutters:e})=>e?"0":"30px"};
|
|
167
|
-
padding-right: ${({$disableGutters:e})=>e?"0":"30px"};
|
|
168
|
-
}
|
|
160
|
+
height: 100vh;
|
|
169
161
|
|
|
170
162
|
h2 {
|
|
171
163
|
font-size: var(--font-size--xlarge);
|
|
@@ -330,7 +322,7 @@ const pw={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M222.7 3
|
|
|
330
322
|
}
|
|
331
323
|
`,MC=cw.div`
|
|
332
324
|
position: relative;
|
|
333
|
-
`;let zC=1;const $C=a((({children:n,side:r,size:a="md",open:i=!1,closeBlocked:l,onClose:d=()=>{},onCloseCompleted:u=()=>{},closeRequested:p=!1,
|
|
325
|
+
`;let zC=1;const $C=a((({children:n,side:r,size:a="md",open:i=!1,closeBlocked:l,onClose:d=()=>{},onCloseCompleted:u=()=>{},closeRequested:p=!1,showCloseButton:f=!1,...m},h)=>{const g=c(null);g.current||(g.current=`overlay-${zC}`,zC+=1);const v=c(null),[b,y]=o.useState(!1);o.useEffect((()=>{if(b){const e=setTimeout(u,200);return()=>{clearTimeout(e)}}return()=>{}})),s((()=>{p&&y(!0)}),[p]),g.current||(g.current=`modal-${zC}`,zC+=1),s((()=>{document.body.style.overflow=i?"hidden":"auto"}),[i]),s((()=>{const e=e=>{"Escape"===e.key&&(e.preventDefault(),d())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[d]);return e(Th,{open:i&&!b,anchor:r,className:`${r} ${i?"open":"closing"}`,size:a,...m,children:e(IC,{children:t(PC,{ref:v,children:[l&&t(NC,{role:"alert","aria-live":"assertive",children:[e(dC,{icon:Dw}),t("p",{children:[e("strong",{children:"You have unsaved changes."})," Please save or cancel before closing."]})]}),e(MC,{ref:h,children:t(xC,{children:[f&&e(tm,{sx:{display:"flex",justifyContent:"flex-end",padding:"1rem"},children:e(hp,{onClick:()=>d(),color:"neutral",children:e(dC,{icon:kw,size:"lg"})})}),n]})})]})})})})),AC=cw(Ld)`
|
|
334
326
|
text-transform: uppercase;
|
|
335
327
|
font-size: var(--font-size--xsmall);
|
|
336
328
|
font-weight: var(--font-weight--bold);
|
|
@@ -422,7 +414,7 @@ const pw={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M222.7 3
|
|
|
422
414
|
opacity: 1;
|
|
423
415
|
}
|
|
424
416
|
}
|
|
425
|
-
`;function QC({apps:a,currentApp:i,leftSide:l,rightSide:s,myAccountMenu:c,workspaces:d,workspacesMenu:u,currentWorkspace:p,helpButton:f,mobileMenuPrimary:m,mobileMenuSecondary:h,user:g,logoUrl:v}){const[b,y]=o.useState([{isOpen:!1,id:"primary"},{isOpen:!1,id:"secondary"}]),x=(e,t)=>{y(b?.map((n=>n.id===e?{...n,isOpen:t}:n)))},k=e=>b.find((t=>t.id===e))?.isOpen,S=m?t(n,{children:[e(XC,{onClick:()=>x("primary",!0),children:e(dC,{icon:fw,size:"md"})}),e($C,{open:k("primary"),onClose:()=>{x("primary",!1)},side:"left",
|
|
417
|
+
`;function QC({apps:a,currentApp:i,leftSide:l,rightSide:s,myAccountMenu:c,workspaces:d,workspacesMenu:u,currentWorkspace:p,helpButton:f,mobileMenuPrimary:m,mobileMenuSecondary:h,user:g,logoUrl:v}){const[b,y]=o.useState([{isOpen:!1,id:"primary"},{isOpen:!1,id:"secondary"}]),x=(e,t)=>{y(b?.map((n=>n.id===e?{...n,isOpen:t}:n)))},k=e=>b.find((t=>t.id===e))?.isOpen,S=m?t(n,{children:[e(XC,{onClick:()=>x("primary",!0),children:e(dC,{icon:fw,size:"md"})}),e($C,{open:k("primary"),onClose:()=>{x("primary",!1)},side:"left",size:"lg",showCloseButton:!0,children:e(tm,{role:"presentation",onClick:()=>x("primary",!1),onKeyDown:()=>x("primary",!1),children:m})})]}):null,C=Array.isArray(d)&&d.length>0?e("div",{style:d.length<=1?{pointerEvents:"none"}:void 0,children:t(wC,{children:[e(GC,{size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:p}),t(FC,{placement:"bottom-start",children:[e(AC,{sticky:!0,children:"Workspaces"}),u]})]})}):null,O=t(YC,{children:[s,C,f?e(wC,{children:e(GC,{size:"sm",href:f.href,component:f.as,"aria-label":f.text,startDecorator:e(dC,{icon:bC,size:"sm"}),children:f.text||"Help"})}):null,g&&c?t(wC,{children:[e(GC,{size:"sm",startDecorator:e(dC,{icon:vC,size:"sm"}),children:g?.displayName?g.displayName:"My Account"}),c]}):null]}),D=t(tm,{sx:{display:{xs:"flex",md:"none"}},children:[e(XC,{onClick:()=>x("secondary",!0),color:"neutral",children:e(dC,{icon:bw,size:"md"})}),e($C,{open:k("secondary"),onClose:()=>{x("secondary",!1)},side:"right",size:"lg",showCloseButton:!0,children:e(tm,{role:"presentation",onClick:()=>x("secondary",!1),onKeyDown:()=>x("secondary",!1),children:h})})]}),_=(()=>{const e=ar(Ya);return"production"!==process.env.NODE_ENV&&r.useDebugValue(e),e[w]||e})(),{logoFillColour:T}=_.palette.appbar;return t(HC,{children:[t(tm,{sx:{display:"flex",alignItems:"center",gap:"1rem"},children:[e(tm,{sx:{display:{xs:"flex",md:"none"}},children:S}),t(WC,{href:v||"/",children:[e(tm,{sx:{display:{xs:"none",md:"flex"}},children:e(BC,{fillColour:T})}),e(tm,{sx:{display:{xs:"flex",md:"none"}},children:e(VC,{fillColour:T})})]}),e(JC,{apps:a,currentApp:i})]}),t(tm,{sx:{display:"flex"},children:[e(KC,{children:l}),e(tm,{sx:{display:{xs:"none",md:"flex"}},children:O}),h&&D]})]})}function ZC({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(zf,{...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(Gp,{name:l,value:u,type:"hidden",sx:{display:"none"}})]})}function eO(t){return e(au,{...t})}const tO=cw.button`
|
|
426
418
|
float: right;
|
|
427
419
|
border: none;
|
|
428
420
|
background: none;
|
|
@@ -722,7 +714,7 @@ const pw={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M222.7 3
|
|
|
722
714
|
`;function iE(){return e(rE,{children:e(oE,{children:t(aE,{children:[e(dC,{icon:Dw,size:"xl",colour:"danger"}),e(Tw,{as:"h1",children:"Something went wrong"}),e("p",{children:"There was a problem with that request. Please try again, if the problem persists, please contact support."}),e(CO,{type:"link",href:"/",children:"Back to homepage"})]})})})}function lE(t){return e(jh,{...t})}HI('/* http://meyerweb.com/eric/tools/css/reset/\n v2.0 | 20110126\n License: none (public domain)\n*/\n\nhtml,\nbody,\ndiv,\nspan,\napplet,\nobject,\niframe,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nblockquote,\npre,\na,\nabbr,\nacronym,\naddress,\nbig,\ncite,\ncode,\ndel,\ndfn,\nem,\nimg,\nins,\nkbd,\nq,\ns,\nsamp,\nsmall,\nstrike,\nstrong,\nsub,\nsup,\ntt,\nvar,\nb,\nu,\ni,\ncenter,\ndl,\ndt,\ndd,\nol,\nul,\nli,\nfieldset,\nform,\nlabel,\nlegend,\ntable,\ncaption,\ntbody,\ntfoot,\nthead,\ntr,\nth,\ntd,\narticle,\naside,\ncanvas,\ndetails,\nembed,\nfigure,\nfigcaption,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\noutput,\nruby,\nsection,\nsummary,\ntime,\nmark,\naudio,\nvideo {\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font: inherit;\n vertical-align: baseline;\n}\n/* HTML5 display-role reset for older browsers */\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmenu,\nnav,\nsection {\n display: block;\n}\nbody {\n line-height: 1;\n}\nol,\nul {\n list-style: none;\n}\nblockquote,\nq {\n quotes: none;\n}\nblockquote:before,\nblockquote:after,\nq:before,\nq:after {\n content: "";\n content: none;\n}\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n');function sE(t){return e(um,{sx:{"--Input-minHeight":"2.6rem","--joy-fontSize-xl4":"2rem"},...t})}HI(':root {\n --color--black: #000000;\n --color--grey-dark: #262626;\n --color--grey: #5c5c5c;\n --color--grey-light: #a8aab7;\n --color--grey-lighter: #f5f5f5;\n --color--grey-lightest: #f3f6fa;\n --color--grey-borders: #d7d7d7;\n --color--grey-line: #e0e0e0;\n --color--grey-hover: #f9f9f9;\n --color--white: #fff;\n\n --color--teal: #007d7e;\n --color--teal-light: #00b0b1;\n --color--teal-tint: #f2fcfc;\n\n --color--red: #d9303e;\n --color--red-dark: #c02330;\n --color--red-light: #f7dbdd;\n --color--red-tint: #ffdddf;\n\n --color--amber: #e9b04d;\n --color--amber-tint: #faecd5;\n --color--orange: #f5a623;\n --color--orange-dark: #eb6f00;\n --color--orange-light: #f2c06f;\n\n --color--green: #29c889;\n --color--green-dark: #1c874c;\n --color--green-light: #afe7d0;\n --color--indigo: #2e1f5e;\n --color--lemon: #ffe60b;\n --color--focus-outline: #fcc726;\n\n --color--danger: var(--color--red);\n --color--danger-light: var(--color--red-light);\n --color--warning: var(--color--orange);\n --color--warning-light: var(--color--orange-light);\n --color--success: var(--color--green);\n\n --color--dark-blue: #192a3c;\n --color--blue-light: #d6e3fa;\n\n --color--debug: #663399;\n --color--debug-light: #663399db;\n --color--debug-very-light: #6633991a;\n\n /* Fonts */\n --font-family--sans-serif: system-ui, -apple-system, BlinkMacSystemFont,\n "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;\n\n --font-family--monospace: source-code-pro, Menlo, Monaco, Consolas,\n "Courier New", monospace;\n\n /* Spacing */\n --spacing--xxxsmall: 0.1rem;\n --spacing--xxsmall: 0.2rem;\n --spacing--xsmall: 0.3rem;\n --spacing--small: 0.5rem;\n --spacing--medium: 1rem;\n --spacing--large: 2rem;\n --spacing--xlarge: 4rem;\n\n /* Font sizes */\n --font-size--xxsmall: 0.6rem;\n --font-size--xsmall: 0.75rem;\n --font-size--small: 0.875rem;\n --font-size--medium: 1rem;\n --font-size--large: 1.25rem;\n --font-size--xlarge: 1.5rem;\n --font-size--xxlarge: 2rem;\n --font-size--xxxlarge: 3rem;\n\n /* Line heights */\n --line-height--small: 1.2rem;\n --line-height--medium: 1.4rem;\n --line-height--large: 1.4rem;\n\n /* Font weights */\n --font-weight--thin: 200;\n --font-weight--light: 300;\n --font-weight--regular: 400;\n --font-weight--medium: 500;\n --font-weight--bold: 700;\n\n /* Border radius */\n --border-radius--small: 0.25rem;\n --border-radius--medium: 0.5rem;\n --border-radius--large: 1rem;\n --border-radius--xlarge: 2rem;\n\n /* Box shadows */\n --box-shadow--medium: 0px 2px 6px 0px rgba(0, 0, 0, 0.1);\n\n /* Breakpoints */\n --breakpoint--small: 480px;\n --breakpoint--medium: 768px;\n --breakpoint--large: 1024px;\n --breakpoint--xlarge: 1200px;\n --breakpoint--xxlarge: 1440px;\n --breakpoint--xxxlarge: 1920px;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n* {\n margin: 0;\n}\n\na {\n color: var(--color--primary);\n text-decoration: none;\n\n &:hover,\n &:focus {\n text-decoration: underline;\n }\n}\n\nbody,\nbutton {\n font-family: var(--font-family--sans-serif);\n font-weight: var(--font-weight--regular);\n font-style: normal;\n}\n\nbody {\n background-color: var(--color--grey-lightest);\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n color: var(--color--grey-dark);\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}\n\nb {\n font-weight: var(--font-weight--bold);\n}\n\n*:focus-visible {\n outline: 3px solid var(--color--focus-outline);\n}\n\ninput,\nbutton,\ntextarea,\nselect {\n font: inherit;\n}\n\ntextarea {\n border: 1px solid var(--color--grey-borders);\n border-radius: var(--border-radius--small);\n background-color: var(--color--grey-lighter);\n padding: var(--spacing--medium);\n}\n\np,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n overflow-wrap: break-word;\n}\n\np {\n font-size: var(--font-size--medium);\n margin-bottom: var(--spacing--medium);\n}\n\nul {\n list-style-type: disc;\n}\n\nol {\n list-style-type: decimal;\n}\n\n#root,\n#__next {\n isolation: isolate;\n}\n\nsmall {\n font-size: 80%;\n color: var(--color--grey);\n}\n');const cE=cw.footer`
|
|
723
715
|
flex-shrink: 0;
|
|
724
716
|
padding: 2rem;
|
|
725
|
-
`;function dE({copyright:n,children:r}){return e(cE,{children:t(tm,{children:[r,e(sE,{sx:{fontSize:"xs",my:.5,textAlign:"center"},children:n||"Copyright © 2025 HarperCollins Publishers Ltd. All rights\n reserved. HarperCollins Publishers Ltd, Registered in Scotland, Company\n No. 27389 Registered Address:
|
|
717
|
+
`;function dE({copyright:n,children:r}){return e(cE,{children:t(tm,{children:[r,e(sE,{sx:{fontSize:"xs",my:.5,textAlign:"center"},children:n||"Copyright © 2025 HarperCollins Publishers Ltd. All rights\n reserved. HarperCollins Publishers Ltd, Registered in Scotland, Company\n No. 27389 Registered Address: 1 Robroyston Gate, Robroyston, Glasgow, G33 1JN"})]})})}const uE=cw.div`
|
|
726
718
|
display: flex;
|
|
727
719
|
flex-direction: column;
|
|
728
720
|
position: absolute;
|
|
@@ -1150,7 +1142,7 @@ function MR(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=
|
|
|
1150
1142
|
page-break-after: avoid;
|
|
1151
1143
|
}
|
|
1152
1144
|
}
|
|
1153
|
-
`;function UR({tabsConfig:
|
|
1145
|
+
`;function UR({tabsConfig:r=[],defaultId:o}){const a=new URLSearchParams(window.location.search).get("tab")||o,i=r.findIndex((e=>e.id===a)),[d,u]=p(i>=0?i:0),f=c(null),m=c({}),[h,g]=p(!1),[v,b]=p({right:!1,left:!0}),y=e=>{if(!f.current)return;const t=m.current[e];t&&t.scrollIntoView({behavior:"smooth",block:"nearest"})},w=e=>{const t=new URL(window.location.href);t.searchParams.set("tab",e),window.history.replaceState({},"",t.toString())},x=e=>{const t=r[e].id,n=m.current[t];n&&n.focus(),y(t),w(t)},k=e=>{const t=r.length,n={ArrowRight:()=>x((d+1)%t),ArrowLeft:()=>x((d-1+t)%t),Home:()=>x(0),End:()=>x(t-1)}[e.key];n&&(e.preventDefault(),n())},S=(e,t)=>{if(!e)return;let n=0;const r=setInterval((()=>{e.scrollLeft+=t,n+=Math.abs(t),n>=100&&clearInterval(r)}),20);b({left:e.scrollLeft<=0,right:e.scrollLeft+e.offsetWidth>=e.scrollWidth})};return s((()=>{f.current&&g(f.current.offsetWidth<f.current.scrollWidth)}),[]),s((()=>{y(r[d].id),w(r[d].id)}),[r,d]),l((()=>{const e=()=>{if(!f.current)return;const{offsetWidth:e,scrollWidth:t}=f.current;g(e<t)};return window.addEventListener("resize",e,!1),()=>{window.removeEventListener("resize",e)}}),[]),t(VR,{children:[t(HR,{role:"tablist","aria-orientation":"horizontal",children:[h&&t(qR,{onClick:()=>f.current&&S(f.current,-30),className:"left-arrow","aria-label":"Left arrow",disabled:v.left,children:[e(dC,{icon:Cw,size:"lg"})," "]}),e(WR,{ref:f,children:r.length>0?r.map((t=>e(YR,{type:"button",onClick:()=>(e=>{const t=r.findIndex((t=>t.id===e));y(e),u(t),w(e)})(t.id),role:"tab",ref:e=>{m.current[t.id]=e},"aria-controls":`panel-${t.id}`,"aria-selected":r[d].id===t.id,id:`tab-${t.id}`,onKeyDown:k,onFocus:()=>u(r.findIndex((e=>e.id===t.id))),tabIndex:r[d].id===t.id?0:-1,children:t.label},`tab-${t.id}`))):e("div",{children:"No tab content to display"})}),h&&e(qR,{onClick:()=>f.current&&S(f.current,30),className:"right-arrow","aria-label":"Right arrow",disabled:v.right,children:e(dC,{icon:Ow,size:"lg"})})]}),e(GR,{children:r.map((o=>{const a=r[d].id===o.id;return e(KR,{role:"tabpanel","aria-labelledby":`tab-${o.id}`,id:`panel-${o.id}`,$show:a,tabIndex:0,children:a&&t(n,{children:[o.label?e(Tw,{as:"h2",children:o.label}):null,o.content]})},`tabpanel-${o.id}`)}))})]})}function JR(t){return e(av,{sx:{"--Textarea-minHeight":"2.6rem"},...t})}const XR={small:iw`
|
|
1154
1146
|
font-size: var(--font-size--small);
|
|
1155
1147
|
line-height: var(--line-height--small);
|
|
1156
1148
|
`,medium:iw`
|