@cruk/cruk-react-components 1.0.4 → 1.0.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +1 -1
  3. package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js +1 -1
  4. package/lib/cjs/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
  5. package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
  6. package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  7. package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
  8. package/lib/cjs/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  9. package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js +2 -0
  10. package/lib/cjs/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -0
  11. package/lib/cjs/src/components/Button/index.js +1 -1
  12. package/lib/cjs/src/components/Button/styles.js +1 -1
  13. package/lib/cjs/src/components/Carousel/Dots.js +2 -0
  14. package/lib/cjs/src/components/Carousel/Dots.js.map +1 -0
  15. package/lib/cjs/src/components/Carousel/index.js +2 -0
  16. package/lib/cjs/src/components/Carousel/index.js.map +1 -0
  17. package/lib/cjs/src/components/Carousel/styles.js +2 -0
  18. package/lib/cjs/src/components/Carousel/styles.js.map +1 -0
  19. package/lib/cjs/src/components/Link/styles.js +1 -1
  20. package/lib/cjs/src/components/Pagination/styles.js +1 -1
  21. package/lib/cjs/src/components/ProgressBar/index.js +1 -1
  22. package/lib/cjs/src/components/ProgressBar/styles.js +1 -1
  23. package/lib/cjs/src/components/Totaliser/index.js +1 -1
  24. package/lib/cjs/src/components/Totaliser/styles.js +1 -1
  25. package/lib/cjs/src/components/index.js +1 -1
  26. package/lib/cjs/src/themes/cruk.js +1 -1
  27. package/lib/cjs/src/themes/su2c.js +1 -1
  28. package/lib/components/Carousel/Carousel.stories.d.ts +6 -0
  29. package/lib/components/Carousel/Dots.d.ts +12 -0
  30. package/lib/components/Carousel/index.d.ts +13 -0
  31. package/lib/components/Carousel/styles.d.ts +30 -0
  32. package/lib/components/Carousel/test.cypress.d.ts +1 -0
  33. package/lib/components/ProgressBar/index.d.ts +5 -1
  34. package/lib/components/ProgressBar/styles.d.ts +20 -10
  35. package/lib/components/Totaliser/index.d.ts +2 -0
  36. package/lib/components/index.d.ts +1 -0
  37. package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js +1 -1
  38. package/lib/es/node_modules/focus-lock/dist/es2015/setFocus.js.map +1 -1
  39. package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
  40. package/lib/es/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  41. package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
  42. package/lib/es/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  43. package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js +2 -0
  44. package/lib/es/node_modules/react-intersection-observer/react-intersection-observer.m.js.map +1 -0
  45. package/lib/es/src/components/Button/index.js +1 -1
  46. package/lib/es/src/components/Button/styles.js +1 -1
  47. package/lib/es/src/components/Carousel/Dots.js +2 -0
  48. package/lib/es/src/components/Carousel/Dots.js.map +1 -0
  49. package/lib/es/src/components/Carousel/index.js +2 -0
  50. package/lib/es/src/components/Carousel/index.js.map +1 -0
  51. package/lib/es/src/components/Carousel/styles.js +2 -0
  52. package/lib/es/src/components/Carousel/styles.js.map +1 -0
  53. package/lib/es/src/components/Link/styles.js +1 -1
  54. package/lib/es/src/components/Pagination/styles.js +1 -1
  55. package/lib/es/src/components/ProgressBar/index.js +1 -1
  56. package/lib/es/src/components/ProgressBar/styles.js +1 -1
  57. package/lib/es/src/components/Totaliser/index.js +1 -1
  58. package/lib/es/src/components/Totaliser/styles.js +1 -1
  59. package/lib/es/src/components/index.js +1 -1
  60. package/lib/es/src/themes/cruk.js +1 -1
  61. package/lib/es/src/themes/su2c.js +1 -1
  62. package/lib/types.d.ts +2 -0
  63. package/package.json +25 -25
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./AddressLookup/index.js"),r=require("./Avatar/index.js"),d=require("./Badge/index.js"),t=require("./Box/index.js"),s=require("./Button/index.js"),a=require("./Checkbox/index.js"),o=require("./Collapse/index.js"),i=require("./DateField/index.js"),u=require("./Divider.js"),x=require("./ErrorText/index.js"),l=require("./Flex.js"),p=require("./Footer/index.js"),n=require("./GlobalStyle.js"),R=require("./Header/index.js"),j=require("./Heading/index.js"),q=require("./Icon/index.js"),m=require("./LabelWrapper/index.js"),E=require("./LegendWrapper/index.js"),f=require("./Link/index.js"),A=require("./Loader/index.js"),D=require("./Modal/index.js"),M=require("./Pagination/index.js"),T=require("./PopOver/index.js"),c=require("./ProgressBar/index.js"),g=require("./Radio/index.js"),B=require("./RadioConsent/index.js"),L=require("./Select/index.js"),k=require("./Step/index.js"),F=require("./Text/index.js"),v=require("./TextAreaField/index.js"),P=require("./TextField/index.js"),C=require("./Totaliser/index.js"),b=require("./UserBlock/index.js"),S=require("../themes/cruk.js"),H=require("../themes/su2c.js"),h=require("./AddressLookup/README.md.js"),W=require("./Avatar/README.md.js"),O=require("./Badge/README.md.js"),I=require("./Box/README.md.js"),U=require("./Button/README.md.js"),y=require("./Checkbox/README.md.js"),G=require("./Collapse/README.md.js"),_=require("./DateField/README.md.js"),w=require("./ErrorText/README.md.js"),z=require("./Footer/README.md.js"),J=require("./Heading/README.md.js"),K=require("./Header/README.md.js"),N=require("./Icon/README.md.js"),Q=require("./Link/README.md.js"),V=require("./LegendWrapper/README.md.js"),X=require("./Loader/README.md.js"),Y=require("./Modal/README.md.js"),Z=require("./Pagination/README.md.js"),$=require("./PopOver/README.md.js"),ee=require("./ProgressBar/README.md.js"),re=require("./Radio/README.md.js"),de=require("./RadioConsent/README.md.js"),te=require("./Select/README.md.js"),se=require("./Step/README.md.js"),ae=require("./Text/README.md.js"),oe=require("./TextAreaField/README.md.js"),ie=require("./TextField/README.md.js"),ue=require("./Totaliser/README.md.js"),xe=require("./UserBlock/README.md.js");exports.AddressLookup=e.default,exports.Avatar=r.default,exports.Badge=d.default,exports.Box=t.default,exports.Button=s.Button,exports.Checkbox=a.default,exports.Collapse=o.default,exports.DateField=i.default,exports.Divider=u.Divider,exports.ErrorText=x.default,exports.Flex=l.default,exports.Footer=p.Footer,exports.GlobalStyle=n.default,exports.Header=R.Header,exports.Heading=j.default,exports.Icon=q.default,exports.LabelWrapper=m.LabelWrapper,exports.LegendWrapper=E.LegendWrapper,exports.Link=f.Link,exports.Loader=A.default,exports.Modal=D.default,exports.Pagination=M.default,exports.PopOver=T.default,exports.ProgressBar=c.default,exports.Radio=g.default,exports.RadioConsent=B.default,exports.Select=L.default,exports.Step=k.default,exports.Text=F.Text,exports.TextAreaField=v.default,exports.TextField=P.default,exports.Totaliser=C.default,exports.UserBlock=b.default,exports.crukTheme=S.default,exports.su2cTheme=H.default,exports.AddressLookupReadme=h.default,exports.AvatarReadme=W.default,exports.BadgeReadme=O.default,exports.BoxReadme=I.default,exports.ButtonReadme=U.default,exports.CheckboxReadme=y.default,exports.CollapseReadme=G.default,exports.DateFieldReadme=_.default,exports.ErrorTextReadme=w.default,exports.FooterReadme=z.default,exports.HeadingReadme=J.default,exports.HeaderReadme=K.default,exports.IconReadme=N.default,exports.LinkReadme=Q.default,exports.LegendWrapperReadme=V.default,exports.LoaderReadme=X.default,exports.ModalReadme=Y.default,exports.PaginationReadme=Z.default,exports.PopOverReadme=$.default,exports.ProgressBarReadme=ee.default,exports.RadioReadme=re.default,exports.RadioConsentReadme=de.default,exports.SelectReadme=te.default,exports.StepReadme=se.default,exports.TextReadme=ae.default,exports.TextAreaFieldReadme=oe.default,exports.TextFieldReadme=ie.default,exports.TotaliserReadme=ue.default,exports.UserBlockReadme=xe.default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./AddressLookup/index.js"),r=require("./Avatar/index.js"),d=require("./Badge/index.js"),t=require("./Box/index.js"),s=require("./Button/index.js"),a=require("./Carousel/index.js"),o=require("./Checkbox/index.js"),i=require("./Collapse/index.js"),u=require("./DateField/index.js"),x=require("./Divider.js"),l=require("./ErrorText/index.js"),p=require("./Flex.js"),n=require("./Footer/index.js"),j=require("./GlobalStyle.js"),R=require("./Header/index.js"),q=require("./Heading/index.js"),m=require("./Icon/index.js"),E=require("./LabelWrapper/index.js"),f=require("./LegendWrapper/index.js"),A=require("./Link/index.js"),D=require("./Loader/index.js"),M=require("./Modal/index.js"),T=require("./Pagination/index.js"),c=require("./PopOver/index.js"),g=require("./ProgressBar/index.js"),B=require("./Radio/index.js"),L=require("./RadioConsent/index.js"),k=require("./Select/index.js"),F=require("./Step/index.js"),C=require("./Text/index.js"),v=require("./TextAreaField/index.js"),P=require("./TextField/index.js"),b=require("./Totaliser/index.js"),S=require("./UserBlock/index.js"),H=require("../themes/cruk.js"),h=require("../themes/su2c.js"),W=require("./AddressLookup/README.md.js"),O=require("./Avatar/README.md.js"),I=require("./Badge/README.md.js"),U=require("./Box/README.md.js"),y=require("./Button/README.md.js"),G=require("./Checkbox/README.md.js"),_=require("./Collapse/README.md.js"),w=require("./DateField/README.md.js"),z=require("./ErrorText/README.md.js"),J=require("./Footer/README.md.js"),K=require("./Heading/README.md.js"),N=require("./Header/README.md.js"),Q=require("./Icon/README.md.js"),V=require("./Link/README.md.js"),X=require("./LegendWrapper/README.md.js"),Y=require("./Loader/README.md.js"),Z=require("./Modal/README.md.js"),$=require("./Pagination/README.md.js"),ee=require("./PopOver/README.md.js"),re=require("./ProgressBar/README.md.js"),de=require("./Radio/README.md.js"),te=require("./RadioConsent/README.md.js"),se=require("./Select/README.md.js"),ae=require("./Step/README.md.js"),oe=require("./Text/README.md.js"),ie=require("./TextAreaField/README.md.js"),ue=require("./TextField/README.md.js"),xe=require("./Totaliser/README.md.js"),le=require("./UserBlock/README.md.js");exports.AddressLookup=e.default,exports.Avatar=r.default,exports.Badge=d.default,exports.Box=t.default,exports.Button=s.Button,exports.Carousel=a.default,exports.Checkbox=o.default,exports.Collapse=i.default,exports.DateField=u.default,exports.Divider=x.Divider,exports.ErrorText=l.default,exports.Flex=p.default,exports.Footer=n.Footer,exports.GlobalStyle=j.default,exports.Header=R.Header,exports.Heading=q.default,exports.Icon=m.default,exports.LabelWrapper=E.LabelWrapper,exports.LegendWrapper=f.LegendWrapper,exports.Link=A.Link,exports.Loader=D.default,exports.Modal=M.default,exports.Pagination=T.default,exports.PopOver=c.default,exports.ProgressBar=g.default,exports.Radio=B.default,exports.RadioConsent=L.default,exports.Select=k.default,exports.Step=F.default,exports.Text=C.Text,exports.TextAreaField=v.default,exports.TextField=P.default,exports.Totaliser=b.default,exports.UserBlock=S.default,exports.crukTheme=H.default,exports.su2cTheme=h.default,exports.AddressLookupReadme=W.default,exports.AvatarReadme=O.default,exports.BadgeReadme=I.default,exports.BoxReadme=U.default,exports.ButtonReadme=y.default,exports.CheckboxReadme=G.default,exports.CollapseReadme=_.default,exports.DateFieldReadme=w.default,exports.ErrorTextReadme=z.default,exports.FooterReadme=J.default,exports.HeadingReadme=K.default,exports.HeaderReadme=N.default,exports.IconReadme=Q.default,exports.LinkReadme=V.default,exports.LegendWrapperReadme=X.default,exports.LoaderReadme=Y.default,exports.ModalReadme=Z.default,exports.PaginationReadme=$.default,exports.PopOverReadme=ee.default,exports.ProgressBarReadme=re.default,exports.RadioReadme=de.default,exports.RadioConsentReadme=te.default,exports.SelectReadme=se.default,exports.StepReadme=ae.default,exports.TextReadme=oe.default,exports.TextAreaFieldReadme=ie.default,exports.TextFieldReadme=ue.default,exports.TotaliserReadme=xe.default,exports.UserBlockReadme=le.default;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={contentMaxWidth:"1020px",useDefaultFocusRect:!0,useDefaultFromControls:!1,useBackgroundStyleLinks:!1,inputBorderWidth:"1px"},r={cdnPath:"https://ccp-s3.int.cruk.org/",assetPath:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/",logoUrl:"/",logoAlt:"Cancer Research UK Giving Page",logoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/logo.png",footerCopyText:"Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales(4325234) and the Isle of Man (5713F).",footerLogoAlt:"Registered with Fundraising Regulator",footerLogoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/fundreg.png"},t={s:"35px",m:"50px",l:"60px",xl:"90px",path:"".concat(r.assetPath,"images/icon-avatars/")},a={borderRadius:"4px",borderRadiusLarge:"4px",buttonBorderThickness:"2px",textDecoration:"none",textTransform:"none"},o={mobile:"576px",tablet:"768px",desktop:"992px",desktopLarge:"1200px"},n={darkBlue_100:"#edeaf5",darkBlue_200:"#dad2ea",darkBlue_300:"#a896cf",darkBlue_500:"#2e008b",magenta_100:"#fdeaf5",magenta_500:"#e40074",magenta_800:"#BB0071",magenta_900:"#710044",cyan_500:"#00b6ed",cyan_900:"#005870",grey_100:"#f5f5f5",grey_200:"#ededed",grey_300:"#c6c6c6",grey_500:"#9A9A9A",grey_800:"#575757",grey_900:"#2e2d2c",white:"#fff",black:"#000",red:"#D51311",yellow:"#fdc02f",green:"#3d854d"},s={primary:n.darkBlue_500,secondary:n.magenta_500,tertiary:n.cyan_500,textOnPrimary:n.white,textOnSecondary:n.white,textOnTertiary:n.white,disabled:n.grey_300,danger:n.red,warning:n.yellow,success:n.green,info:n.cyan_500,textError:n.red,linkColor:n.darkBlue_500,linkColorHover:n.magenta_800,textDark:n.grey_900,textLight:n.white,progressBar:n.darkBlue_500,progressBarBackground:n.grey_200,circularProgress:n.cyan_500,circularProgressBackground:n.grey_300,buttonPrimaryBackground:n.magenta_500,buttonPrimaryText:n.white,buttonPrimaryBorder:n.magenta_500,buttonPrimaryBackgroundHover:n.magenta_800,buttonPrimaryTextHover:n.white,buttonPrimaryBorderHover:n.magenta_800,buttonPrimaryDisabledBackground:n.grey_100,buttonPrimaryDisabledText:n.grey_500,buttonPrimaryDisabledBorder:n.grey_100,buttonSecondaryBackground:n.white,buttonSecondaryText:n.magenta_500,buttonSecondaryBorder:n.magenta_500,buttonSecondaryBackgroundHover:n.magenta_100,buttonSecondaryTextHover:n.magenta_800,buttonSecondaryBorderHover:n.magenta_800,buttonSecondaryDisabledBackground:n.grey_100,buttonSecondaryDisabledText:n.grey_500,buttonSecondaryDisabledBorder:n.grey_100,buttonTertiaryText:n.magenta_500,buttonTertiaryTextHover:n.magenta_800,buttonTertiaryDisabledText:n.grey_500,selectionBorder:n.grey_500,textInputBorder:n.grey_900,inputBorder:n.grey_900,headerBackground:n.white,backgroundLight:n.white,backgroundLightColor:n.darkBlue_200,backgroundMid:n.grey_100,loaderColor1:n.darkBlue_500,loaderColor2:n.magenta_500,loaderColor3:n.cyan_500,paginationText:n.darkBlue_500,paginationActive:n.grey_300,paginationBackground:n.darkBlue_500,footerBackground:n.grey_200,headerBorder:n.grey_300,stepBorder:n.grey_300,stepBackground:n.white,popoverBackground:n.white,textInputExtraInfo:n.grey_200,totaliserBubbleColor:n.grey_200,totaliserBubbleTextColor:n.grey_900,totaliserBubbleTotalColor:n.darkBlue_500,selectBackground:n.grey_900,modalBackdrop:n.grey_900,userBlockExtraText:n.grey_800},i={none:"0",auto:"auto",xxs:"0.5rem",xs:"1rem",s:"1.5rem",m:"2rem",l:"2.5rem",xl:"3rem",xxl:"3.5rem"},d={xs:"0.75rem",s:"0.857rem",m:"1rem",l:"1.25rem",xl:"1.5625rem",xxl:"2rem",xxxl:"2.5rem",xxxxl:"3.125rem"},g={customFonts:[{family:"MuseoSans-500",url:"https://ccp-s3.int.cruk.org/fonts/MuseoSansRounded-500"}],fontUrl:"".concat(r.cdnPath,"fonts"),fontFamilyBase:"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif",fontFamilyHeadings:"MuseoSans-500,Calibri,Arial,sans-serif",fontSizeBase:"16px",fontWeightHeavy:"700",fontWeightMedium:"500",fontWeightLight:"300",fontWeightVLight:"100",linkTextDecoration:"underline",lineHeight:"1.5em",headerLineHeight:"1.25em",headerTextTransform:"none"},u={name:"cruk",avatar:t,breakpoint:o,button:a,tokenColors:n,colors:s,spacing:i,fontSizes:d,siteConfig:r,typography:g,utilities:e};exports.AVATAR=t,exports.BREAKPOINT=o,exports.BUTTON=a,exports.COLORS=s,exports.FONT_SIZES=d,exports.SITE_CONFIG=r,exports.SPACING=i,exports.TOKEN_COLORS=n,exports.TYPOGRAPHY=g,exports.UTILITIES=e,exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={contentMaxWidth:"1020px",useDefaultFocusRect:!0,useDefaultFromControls:!1,useBackgroundStyleLinks:!1,inputBorderWidth:"1px"},r={cdnPath:"https://ccp-s3.int.cruk.org/",assetPath:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/",logoUrl:"/",logoAlt:"Cancer Research UK Giving Page",logoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/logo.png",footerCopyText:"Cancer Research UK is a registered charity in England and Wales (1089464), Scotland (SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales(4325234) and the Isle of Man (5713F).",footerLogoAlt:"Registered with Fundraising Regulator",footerLogoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/fundreg.png"},t={s:"35px",m:"50px",l:"60px",xl:"90px",path:"".concat(r.assetPath,"images/icon-avatars/")},a={borderRadius:"4px",borderRadiusLarge:"4px",buttonBorderThickness:"2px",textDecoration:"none",textTransform:"none"},o={mobile:"576px",tablet:"768px",desktop:"992px",desktopLarge:"1200px"},n={darkBlue_100:"#edeaf5",darkBlue_200:"#dad2ea",darkBlue_300:"#a896cf",darkBlue_500:"#2e008b",magenta_100:"#fdeaf5",magenta_500:"#e40074",magenta_800:"#BB0071",magenta_900:"#710044",cyan_500:"#00b6ed",cyan_900:"#005870",grey_100:"#f5f5f5",grey_200:"#ededed",grey_300:"#c6c6c6",grey_500:"#9A9A9A",grey_800:"#575757",grey_900:"#2e2d2c",white:"#fff",black:"#000",red:"#D51311",yellow:"#fdc02f",green:"#3d854d"},s={primary:n.darkBlue_500,secondary:n.magenta_500,tertiary:n.cyan_500,textOnPrimary:n.white,textOnSecondary:n.white,textOnTertiary:n.white,disabled:n.grey_300,danger:n.red,warning:n.yellow,success:n.green,info:n.cyan_500,textError:n.red,linkColor:n.darkBlue_500,linkColorHover:n.magenta_800,textDark:n.grey_900,textLight:n.white,progressBar:n.darkBlue_500,progressBarSecondary:n.magenta_500,progressBarBackground:n.grey_200,circularProgress:n.cyan_500,circularProgressSecondary:n.magenta_500,circularProgressBackground:n.grey_300,buttonPrimaryBackground:n.magenta_500,buttonPrimaryText:n.white,buttonPrimaryBorder:n.magenta_500,buttonPrimaryBackgroundHover:n.magenta_800,buttonPrimaryTextHover:n.white,buttonPrimaryBorderHover:n.magenta_800,buttonPrimaryDisabledBackground:n.grey_100,buttonPrimaryDisabledText:n.grey_500,buttonPrimaryDisabledBorder:n.grey_100,buttonSecondaryBackground:n.white,buttonSecondaryText:n.magenta_500,buttonSecondaryBorder:n.magenta_500,buttonSecondaryBackgroundHover:n.magenta_100,buttonSecondaryTextHover:n.magenta_800,buttonSecondaryBorderHover:n.magenta_800,buttonSecondaryDisabledBackground:n.grey_100,buttonSecondaryDisabledText:n.grey_500,buttonSecondaryDisabledBorder:n.grey_100,buttonTertiaryText:n.magenta_500,buttonTertiaryTextHover:n.magenta_800,buttonTertiaryDisabledText:n.grey_500,selectionBorder:n.grey_500,textInputBorder:n.grey_900,inputBorder:n.grey_900,headerBackground:n.white,backgroundLight:n.white,backgroundLightColor:n.darkBlue_200,backgroundMid:n.grey_100,loaderColor1:n.darkBlue_500,loaderColor2:n.magenta_500,loaderColor3:n.cyan_500,paginationText:n.darkBlue_500,paginationActive:n.grey_300,paginationBackground:n.darkBlue_500,footerBackground:n.grey_200,headerBorder:n.grey_300,stepBorder:n.grey_300,stepBackground:n.white,popoverBackground:n.white,textInputExtraInfo:n.grey_200,totaliserBubbleColor:n.grey_200,totaliserBubbleTextColor:n.grey_900,totaliserBubbleTotalColor:n.darkBlue_500,selectBackground:n.grey_900,modalBackdrop:n.grey_900,userBlockExtraText:n.grey_800},i={none:"0",auto:"auto",xxs:"0.5rem",xs:"1rem",s:"1.5rem",m:"2rem",l:"2.5rem",xl:"3rem",xxl:"3.5rem"},d={xs:"0.75rem",s:"0.857rem",m:"1rem",l:"1.25rem",xl:"1.5625rem",xxl:"2rem",xxxl:"2.5rem",xxxxl:"3.125rem"},g={customFonts:[{family:"MuseoSans-500",url:"https://ccp-s3.int.cruk.org/fonts/MuseoSansRounded-500"}],fontUrl:"".concat(r.cdnPath,"fonts"),fontFamilyBase:"Arial, Calibri, nimbussansl, liberationsans, freesans, clean, sans-serif",fontFamilyHeadings:"MuseoSans-500,Calibri,Arial,sans-serif",fontSizeBase:"16px",fontWeightHeavy:"700",fontWeightMedium:"500",fontWeightLight:"300",fontWeightVLight:"100",linkTextDecoration:"underline",lineHeight:"1.5em",headerLineHeight:"1.25em",headerTextTransform:"none"},u={name:"cruk",avatar:t,breakpoint:o,button:a,tokenColors:n,colors:s,spacing:i,fontSizes:d,siteConfig:r,typography:g,utilities:e};exports.AVATAR=t,exports.BREAKPOINT=o,exports.BUTTON=a,exports.COLORS=s,exports.FONT_SIZES=d,exports.SITE_CONFIG=r,exports.SPACING=i,exports.TOKEN_COLORS=n,exports.TYPOGRAPHY=g,exports.UTILITIES=e,exports.default=u;
2
2
  //# sourceMappingURL=cruk.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.js"),r=require("./cruk.js"),a=e.__assign(e.__assign({},r.default.utilities),{useBackgroundStyleLinks:!0}),t=e.__assign(e.__assign({},r.default.siteConfig),{logoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/su2c-logo.png",footerCopyText:"Stand Up To Cancer and Stand Up To Cancer Brand Marks are registered trademarks of the Entertainment Industry Foundation. Cancer Research UK is a registered charity in England and Wales (1089464), Scotland(SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales (4325234) and the Isle of Man (5713F). Registered address: 2 Redman Place, London, E20 1JQ. Donations will be made to Cancer Research UK in support of the Stand Up To Cancer campaign."}),s=e.__assign(e.__assign({},r.default.avatar),{path:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/icon-avatars/su2c/"}),o=e.__assign(e.__assign({},r.default.button),{borderRadius:"1.5rem",borderRadiusLarge:"2rem",textTransform:"uppercase"}),n=e.__assign({},r.default.breakpoint),i=e.__assign(e.__assign({},r.default.tokenColors),{su2cOrange5:"#FF8E00",su2cOrange3:"#FFB04D",su2cOrange2:"#FFDAAD",su2cOrange1:"#FFF6EB",su2cBlack:"#231F20",su2cGrey1:"#555759",su2cGrey2:"#A5A5A9",su2cRed:"#EF4135",su2cYellow:"#FFC325"}),u=e.__assign(e.__assign({},r.default.colors),{primary:i.su2cOrange5,secondary:i.su2cOrange5,tertiary:i.su2cBlack,textOnPrimary:i.su2cBlack,progressBar:i.su2cOrange5,circularProgress:i.su2cOrange3,linkColor:i.su2cOrange5,linkColorHover:i.su2cRed,backgroundLightColor:i.su2cOrange2,loaderColor1:i.su2cOrange5,loaderColor2:i.su2cRed,loaderColor3:i.su2cBlack,paginationText:i.su2cBlack,paginationBackground:i.su2cBlack,totaliserBubbleColor:i.su2cBlack,totaliserBubbleTextColor:i.white,totaliserBubbleTotalColor:i.white,buttonPrimaryBackground:i.su2cOrange5,buttonPrimaryText:i.su2cBlack,buttonPrimaryBorder:i.su2cOrange5,buttonPrimaryBackgroundHover:i.su2cOrange3,buttonPrimaryTextHover:i.su2cBlack,buttonPrimaryBorderHover:i.su2cOrange3,buttonPrimaryDisabledBackground:i.grey_300,buttonPrimaryDisabledText:i.white,buttonPrimaryDisabledBorder:i.grey_300,buttonSecondaryBackground:i.white,buttonSecondaryText:i.su2cOrange5,buttonSecondaryBorder:i.su2cOrange5,buttonSecondaryBackgroundHover:i.su2cOrange1,buttonSecondaryTextHover:i.su2cOrange5,buttonSecondaryBorderHover:i.su2cOrange5,buttonSecondaryDisabledBackground:i.white,buttonSecondaryDisabledText:i.grey_300,buttonSecondaryDisabledBorder:i.grey_300,buttonTertiaryText:i.su2cOrange5,buttonTertiaryTextHover:i.su2cOrange5,buttonTertiaryDisabledText:i.grey_300}),c=e.__assign({},r.default.spacing),d=e.__assign({},r.default.fontSizes),g=e.__assign(e.__assign({},r.default.typography),{customFonts:[{family:"itc_avant_garde_pro_mdbold",url:"https://crukorg.github.io/SU2C-drupal/assets/fonts/su2c/itc_-_itcavantgardepro-bold-webfont"}],fontFamilyHeadings:"itc_avant_garde_pro_mdbold,Arial,sans-serif",linkTextDecoration:"none",headerLineHeight:"1.5em",headerTextTransform:"uppercase"}),l={name:"su2c",avatar:s,breakpoint:n,button:o,tokenColors:i,colors:u,spacing:c,fontSizes:d,siteConfig:t,typography:g,utilities:a};exports.AVATAR=s,exports.BREAKPOINT=n,exports.BUTTON=o,exports.COLORS=u,exports.FONT_SIZES=d,exports.SITE_CONFIG=t,exports.SPACING=c,exports.TOKEN_COLORS=i,exports.TYPOGRAPHY=g,exports.UTILITIES=a,exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.js"),r=require("./cruk.js"),a=e.__assign(e.__assign({},r.default.utilities),{useBackgroundStyleLinks:!0}),t=e.__assign(e.__assign({},r.default.siteConfig),{logoSrc:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/su2c-logo.png",footerCopyText:"Stand Up To Cancer and Stand Up To Cancer Brand Marks are registered trademarks of the Entertainment Industry Foundation. Cancer Research UK is a registered charity in England and Wales (1089464), Scotland(SC041666), the Isle of Man (1103) and Jersey (247). A company limited by guarantee. Registered company in England and Wales (4325234) and the Isle of Man (5713F). Registered address: 2 Redman Place, London, E20 1JQ. Donations will be made to Cancer Research UK in support of the Stand Up To Cancer campaign."}),s=e.__assign(e.__assign({},r.default.avatar),{path:"https://fundraise.cancerresearchuk.org/profiles/cruk_fundraising/themes/cruk_of_bootstrap/images/icon-avatars/su2c/"}),o=e.__assign(e.__assign({},r.default.button),{borderRadius:"1.5rem",borderRadiusLarge:"2rem",textTransform:"uppercase"}),n=e.__assign({},r.default.breakpoint),u=e.__assign(e.__assign({},r.default.tokenColors),{su2cOrange5:"#FF8E00",su2cOrange3:"#FFB04D",su2cOrange2:"#FFDAAD",su2cOrange1:"#FFF6EB",su2cBlack:"#231F20",su2cGrey1:"#555759",su2cGrey2:"#A5A5A9",su2cRed:"#EF4135",su2cYellow:"#FFC325"}),i=e.__assign(e.__assign({},r.default.colors),{primary:u.su2cOrange5,secondary:u.su2cOrange5,tertiary:u.su2cBlack,textOnPrimary:u.su2cBlack,progressBar:u.su2cOrange5,progressBarSecondary:u.su2cRed,circularProgress:u.su2cOrange3,circularProgressSecondary:u.su2cRed,linkColor:u.su2cOrange5,linkColorHover:u.su2cRed,backgroundLightColor:u.su2cOrange2,loaderColor1:u.su2cOrange5,loaderColor2:u.su2cRed,loaderColor3:u.su2cBlack,paginationText:u.su2cBlack,paginationBackground:u.su2cBlack,totaliserBubbleColor:u.su2cBlack,totaliserBubbleTextColor:u.white,totaliserBubbleTotalColor:u.white,buttonPrimaryBackground:u.su2cOrange5,buttonPrimaryText:u.su2cBlack,buttonPrimaryBorder:u.su2cOrange5,buttonPrimaryBackgroundHover:u.su2cOrange3,buttonPrimaryTextHover:u.su2cBlack,buttonPrimaryBorderHover:u.su2cOrange3,buttonPrimaryDisabledBackground:u.grey_300,buttonPrimaryDisabledText:u.white,buttonPrimaryDisabledBorder:u.grey_300,buttonSecondaryBackground:u.white,buttonSecondaryText:u.su2cOrange5,buttonSecondaryBorder:u.su2cOrange5,buttonSecondaryBackgroundHover:u.su2cOrange1,buttonSecondaryTextHover:u.su2cOrange5,buttonSecondaryBorderHover:u.su2cOrange5,buttonSecondaryDisabledBackground:u.white,buttonSecondaryDisabledText:u.grey_300,buttonSecondaryDisabledBorder:u.grey_300,buttonTertiaryText:u.su2cOrange5,buttonTertiaryTextHover:u.su2cOrange5,buttonTertiaryDisabledText:u.grey_300}),c=e.__assign({},r.default.spacing),d=e.__assign({},r.default.fontSizes),g=e.__assign(e.__assign({},r.default.typography),{customFonts:[{family:"itc_avant_garde_pro_mdbold",url:"https://crukorg.github.io/SU2C-drupal/assets/fonts/su2c/itc_-_itcavantgardepro-bold-webfont"}],fontFamilyHeadings:"itc_avant_garde_pro_mdbold,Arial,sans-serif",linkTextDecoration:"none",headerLineHeight:"1.5em",headerTextTransform:"uppercase"}),l={name:"su2c",avatar:s,breakpoint:n,button:o,tokenColors:u,colors:i,spacing:c,fontSizes:d,siteConfig:t,typography:g,utilities:a};exports.AVATAR=s,exports.BREAKPOINT=n,exports.BUTTON=o,exports.COLORS=i,exports.FONT_SIZES=d,exports.SITE_CONFIG=t,exports.SPACING=c,exports.TOKEN_COLORS=u,exports.TYPOGRAPHY=g,exports.UTILITIES=a,exports.default=l;
2
2
  //# sourceMappingURL=su2c.js.map
@@ -0,0 +1,6 @@
1
+ import { Story, Meta } from "@storybook/react";
2
+ import { CarouselProps } from ".";
3
+ declare const _default: Meta<CarouselProps>;
4
+ export default _default;
5
+ export declare const CarouselDefault: Story;
6
+ export declare const SU2CCarousel: Story;
@@ -0,0 +1,12 @@
1
+ import { FC, ButtonHTMLAttributes } from "react";
2
+ declare type DotProps = {
3
+ count: number;
4
+ currentPosition: number;
5
+ scrollToPosition: (to: number) => void;
6
+ next: () => void;
7
+ previous: () => void;
8
+ };
9
+ export declare const CarouselLeftButton: FC<ButtonHTMLAttributes<HTMLElement>>;
10
+ export declare const CarouselRightButton: FC<ButtonHTMLAttributes<HTMLElement>>;
11
+ export declare const Dots: FC<DotProps>;
12
+ export default Dots;
@@ -0,0 +1,13 @@
1
+ import React, { FC } from "react";
2
+ export declare type CarouselProps = {
3
+ startPosition?: number;
4
+ onPositionChanged?: (position: number) => void;
5
+ shrinkUnselectedPages?: boolean;
6
+ };
7
+ /**
8
+ *
9
+ * Light weight carousel component that works with mouse and touch events, will work with divs and much anything you chuck in children
10
+ */
11
+ export declare const Carousel: FC<CarouselProps>;
12
+ declare const _default: React.MemoExoticComponent<React.FC<CarouselProps>>;
13
+ export default _default;
@@ -0,0 +1,30 @@
1
+ import { ThemeType } from "../../types";
2
+ export declare const CarouselWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ declare type ThemeProps = {
4
+ theme: ThemeType;
5
+ };
6
+ declare type CarouselScrollAreaProps = {
7
+ smoothScrolling: boolean;
8
+ };
9
+ export declare const CarouselScrollArea: import("styled-components").StyledComponent<"ul", any, CarouselScrollAreaProps, never>;
10
+ export declare const CarouselCard: import("styled-components").StyledComponent<"li", any, {
11
+ onlyChild: boolean;
12
+ }, never>;
13
+ declare type CarouselCardInnerProps = {
14
+ isSelected: boolean;
15
+ shrinkUnselectedPages: boolean;
16
+ onlyChild: boolean;
17
+ };
18
+ export declare const CarouselCardInner: import("styled-components").StyledComponent<"div", any, CarouselCardInnerProps, never>;
19
+ export declare const ButtonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export declare const VerticalAlign: import("styled-components").StyledComponent<"span", any, {}, never>;
21
+ export declare const CarouselButton: import("styled-components").StyledComponent<"button", any, {}, never>;
22
+ export declare const DotContainer: import("styled-components").StyledComponent<"div", any, ThemeProps & {
23
+ count: number;
24
+ }, never>;
25
+ export declare const Dot: import("styled-components").StyledComponent<"button", any, {
26
+ theme: ThemeType;
27
+ selected: boolean;
28
+ }, never>;
29
+ export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"span", any, {}, never>;
30
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -2,14 +2,18 @@ import { FC, ReactNode } from "react";
2
2
  export declare type ProgressBarProps = {
3
3
  /** percentage value of the progressbar */
4
4
  percentage: number;
5
+ /** percentage value of a secondary (highter) amount of the progressbar */
6
+ secondaryPercentage?: number;
5
7
  /** flag which converts line bar to donut chart */
6
8
  isCircular?: boolean;
7
9
  /** contents inside the donut chart */
8
10
  circleContents?: ReactNode;
9
11
  /** diameter of the donut chart */
10
12
  circleSize?: string;
11
- /** foreground colour of chart */
13
+ /** foreground colour of chart bar */
12
14
  barColor?: string;
15
+ /** foreground colour of chart secondary bar */
16
+ secondaryBarColor?: string;
13
17
  };
14
18
  /**
15
19
  * Provide up-to-date feedback on the progress of a workflow or action with
@@ -1,20 +1,30 @@
1
- export declare const ProgressBarWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const LineProgressBarWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ import { ThemeType } from "../../types";
2
+ declare type ThemeProp = {
3
+ theme: ThemeType;
4
+ };
3
5
  declare type LineProgressBarProps = {
4
6
  percentage: number;
5
7
  barColor?: string;
8
+ isSecondary?: boolean;
6
9
  };
7
- declare type CircularColorFillProps = {
8
- barColor?: string;
10
+ declare type LineProgressWrapperProps = {
11
+ percentage: number;
12
+ secondaryPercentage: number;
9
13
  };
14
+ declare type CircleWrapperProps = {
15
+ circleSize: string;
16
+ };
17
+ export declare const ProgressBarWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export declare const LineProgressBarWrapper: import("styled-components").StyledComponent<"div", any, LineProgressWrapperProps, never>;
10
19
  export declare const LineProgressBar: import("styled-components").StyledComponent<"div", any, LineProgressBarProps, never>;
11
20
  export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"span", any, {}, never>;
12
- export declare const CircularColorFill: import("styled-components").StyledComponent<"span", any, CircularColorFillProps, never>;
13
- export declare const CircularLeft: import("styled-components").StyledComponent<"span", any, {}, never>;
14
- export declare const CircularRight: import("styled-components").StyledComponent<"span", any, {}, never>;
15
- export declare const CircularWrapper: import("styled-components").StyledComponent<"div", any, {
16
- percentage: number;
17
- circleSize: string;
21
+ export declare const CircularWrapper: import("styled-components").StyledComponent<"div", any, CircleWrapperProps, never>;
22
+ export declare const CircleSvg: import("styled-components").StyledComponent<"svg", any, {}, never>;
23
+ export declare const EmptyCircle: import("styled-components").StyledComponent<"circle", any, {}, never>;
24
+ export declare const FullCircle: import("styled-components").StyledComponent<"circle", any, ThemeProp & {
25
+ strokeDashoffsetInit: number;
26
+ barColor?: string | undefined;
27
+ isSecondary?: boolean | undefined;
18
28
  }, never>;
19
29
  export declare const CircularValue: import("styled-components").StyledComponent<"div", any, {}, never>;
20
30
  export {};
@@ -2,6 +2,8 @@ import { FunctionComponent, ReactChild } from "react";
2
2
  export declare type TotaliserProps = {
3
3
  /** financial total as a number */
4
4
  total: number;
5
+ /** additional donation amount as a number */
6
+ additionalAmount?: number;
5
7
  /** git aid total as a number */
6
8
  giftAid?: number;
7
9
  /** money target as a number */
@@ -3,6 +3,7 @@ export { default as Avatar } from "./Avatar";
3
3
  export { default as Badge } from "./Badge";
4
4
  export { default as Box } from "./Box";
5
5
  export { default as Button } from "./Button";
6
+ export { default as Carousel } from "./Carousel";
6
7
  export { default as Checkbox } from "./Checkbox";
7
8
  export { default as Collapse } from "./Collapse";
8
9
  export { default as DateField } from "./DateField";
@@ -1,2 +1,2 @@
1
- import{getFocusMerge as o}from"./focusMerge.js";var e=function(o){o.focus(),"contentWindow"in o&&o.contentWindow&&o.contentWindow.focus()},n=0,t=!1,c=function(c,i){var f=o(c,i);if(!t&&f){if(n>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),t=!0,void setTimeout((function(){t=!1}),1);n++,e(f.node),n--}};export{e as focusOn,c as setFocus};
1
+ import{getFocusMerge as o}from"./focusMerge.js";var n=function(o,n){o.focus(n),"contentWindow"in o&&o.contentWindow&&o.contentWindow.focus()},t=0,e=!1,c=function(c,i,s){void 0===s&&(s={});var f=o(c,i);if(!e&&f){if(t>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),e=!0,void setTimeout((function(){e=!1}),1);t++,n(f.node,s.focusOptions),t--}};export{n as focusOn,c as setFocus};
2
2
  //# sourceMappingURL=setFocus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target) {\n target.focus();\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode) {\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focus","contentWindow","guardCount","lockDisabled","setFocus","topNode","lastNode","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"gDACU,IAACA,EAAU,SAAUC,GAC3BA,EAAOC,QACH,kBAAmBD,GAAUA,EAAOE,eACpCF,EAAOE,cAAcD,SAGzBE,EAAa,EACbC,GAAe,EACRC,EAAW,SAAUC,EAASC,GACrC,IAAIC,EAAYC,EAAcH,EAASC,GACvC,IAAIH,GAGAI,EAAW,CACX,GAAIL,EAAa,EAOb,OANAO,QAAQC,MAAM,qJAEdP,GAAe,OACfQ,YAAW,WACPR,GAAe,IAChB,GAGPD,IACAJ,EAAQS,EAAUK,MAClBV"}
1
+ {"version":3,"file":"setFocus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/setFocus.js"],"sourcesContent":["import { getFocusMerge } from './focusMerge';\nexport var focusOn = function (target, focusOptions) {\n target.focus(focusOptions);\n if ('contentWindow' in target && target.contentWindow) {\n target.contentWindow.focus();\n }\n};\nvar guardCount = 0;\nvar lockDisabled = false;\nexport var setFocus = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = getFocusMerge(topNode, lastNode);\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n if (guardCount > 2) {\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["focusOn","target","focusOptions","focus","contentWindow","guardCount","lockDisabled","setFocus","topNode","lastNode","options","focusable","getFocusMerge","console","error","setTimeout","node"],"mappings":"gDACU,IAACA,EAAU,SAAUC,EAAQC,GACnCD,EAAOE,MAAMD,GACT,kBAAmBD,GAAUA,EAAOG,eACpCH,EAAOG,cAAcD,SAGzBE,EAAa,EACbC,GAAe,EACRC,EAAW,SAAUC,EAASC,EAAUC,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAIC,EAAYC,EAAcJ,EAASC,GACvC,IAAIH,GAGAK,EAAW,CACX,GAAIN,EAAa,EAOb,OANAQ,QAAQC,MAAM,qJAEdR,GAAe,OACfS,YAAW,WACPT,GAAe,IAChB,GAGPD,IACAL,EAAQW,EAAUK,KAAMN,EAAQR,cAChCG"}
@@ -1,2 +1,2 @@
1
- import e from"../../../@babel/runtime/helpers/esm/extends.js";import*as o from"react";import{useEffect as t}from"react";import{node as r,bool as s,oneOfType as a,object as n,string as c,func as u,arrayOf as i,any as d}from"prop-types";import{FOCUS_DISABLED as l,FOCUS_GROUP as f}from"../../../focus-lock/dist/es2015/constants.js";import{hiddenGuard as m}from"./FocusGuard.js";import{mediumFocus as v,mediumBlur as p,mediumSidecar as F}from"./medium.js";import{useMergeRefs as b}from"../../../use-callback-ref/dist/es2015/useMergeRef.js";var k=[],h=o.forwardRef((function(r,s){var a,n=o.useState(),c=n[0],u=n[1],i=o.useRef(),d=o.useRef(!1),h=o.useRef(null),E=r.children,g=r.disabled,w=r.noFocusGuards,y=r.persistentFocus,x=r.crossFrame,C=r.autoFocus,N=r.allowTextSelection,R=r.group,j=r.className,D=r.whiteList,L=r.shards,S=void 0===L?k:L,P=r.as,T=void 0===P?"div":P,A=r.lockProps,G=void 0===A?{}:A,I=r.sideCar,M=r.returnFocus,B=r.onActivation,O=r.onDeactivation,V=o.useState({})[0],_=o.useCallback((function(){h.current=h.current||document&&document.activeElement,i.current&&B&&B(i.current),d.current=!0}),[B]),q=o.useCallback((function(){d.current=!1,O&&O(i.current)}),[O]);t((function(){g||(h.current=null)}),[]);var z=o.useCallback((function(e){var o=h.current;if(o&&o.focus){var t="function"==typeof M?M(o):M;if(Boolean(t)){var r="object"==typeof t?t:void 0;h.current=null,e?Promise.resolve().then((function(){return o.focus(r)})):o.focus(r)}}}),[M]),H=o.useCallback((function(e){d.current&&v.useMedium(e)}),[]),J=p.useMedium,K=o.useCallback((function(e){i.current!==e&&(i.current=e,u(e))}),[]);"production"!==process.env.NODE_ENV&&(void 0!==N&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),o.useEffect((function(){i.current||console.error("FocusLock: could not obtain ref to internal node")}),[]));var Q=e(((a={})[l]=g&&"disabled",a[f]=R,a),G),U=!0!==w,W=U&&"tail"!==w,X=b([s,K]);return o.createElement(o.Fragment,null,U&&[o.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:g?-1:0,style:m}),o.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:g?-1:1,style:m})],!g&&o.createElement(I,{id:V,sideCar:F,observed:c,disabled:g,persistentFocus:y,crossFrame:x,autoFocus:C,whiteList:D,shards:S,onActivation:_,onDeactivation:q,returnFocus:z}),o.createElement(T,e({ref:X},Q,{className:j,onBlur:J,onFocus:H}),E),W&&o.createElement("div",{"data-focus-guard":!0,tabIndex:g?-1:0,style:m}))}));h.propTypes="production"!==process.env.NODE_ENV?{children:r,disabled:s,returnFocus:a([s,n]),noFocusGuards:s,allowTextSelection:s,autoFocus:s,persistentFocus:s,crossFrame:s,group:c,className:c,whiteList:u,shards:i(d),as:a([c,u,n]),lockProps:n,onActivation:u,onDeactivation:u,sideCar:d.isRequired}:{},h.defaultProps={children:void 0,disabled:!1,returnFocus:!1,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var E=h;export{E as default};
1
+ import e from"../../../@babel/runtime/helpers/esm/extends.js";import*as o from"react";import{useEffect as t}from"react";import{node as r,bool as s,oneOfType as a,object as n,func as c,string as u,arrayOf as i,any as d}from"prop-types";import{FOCUS_DISABLED as l,FOCUS_GROUP as f}from"../../../focus-lock/dist/es2015/constants.js";import{hiddenGuard as m}from"./FocusGuard.js";import{mediumFocus as v,mediumBlur as p,mediumSidecar as F}from"./medium.js";import{useMergeRefs as b}from"../../../use-callback-ref/dist/es2015/useMergeRef.js";var k=[],h=o.forwardRef((function(r,s){var a,n=o.useState(),c=n[0],u=n[1],i=o.useRef(),d=o.useRef(!1),h=o.useRef(null),E=r.children,g=r.disabled,w=r.noFocusGuards,y=r.persistentFocus,x=r.crossFrame,C=r.autoFocus,N=r.allowTextSelection,R=r.group,j=r.className,D=r.whiteList,L=r.shards,O=void 0===L?k:L,S=r.as,P=void 0===S?"div":S,T=r.lockProps,A=void 0===T?{}:T,G=r.sideCar,I=r.returnFocus,M=r.focusOptions,B=r.onActivation,V=r.onDeactivation,_=o.useState({})[0],q=o.useCallback((function(){h.current=h.current||document&&document.activeElement,i.current&&B&&B(i.current),d.current=!0}),[B]),z=o.useCallback((function(){d.current=!1,V&&V(i.current)}),[V]);t((function(){g||(h.current=null)}),[]);var H=o.useCallback((function(e){var o=h.current;if(o&&o.focus){var t="function"==typeof I?I(o):I;if(Boolean(t)){var r="object"==typeof t?t:void 0;h.current=null,e?Promise.resolve().then((function(){return o.focus(r)})):o.focus(r)}}}),[I]),J=o.useCallback((function(e){d.current&&v.useMedium(e)}),[]),K=p.useMedium,Q=o.useCallback((function(e){i.current!==e&&(i.current=e,u(e))}),[]);"production"!==process.env.NODE_ENV&&(void 0!==N&&console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"),o.useEffect((function(){i.current||console.error("FocusLock: could not obtain ref to internal node")}),[]));var U=e(((a={})[l]=g&&"disabled",a[f]=R,a),A),W=!0!==w,X=W&&"tail"!==w,Y=b([s,Q]);return o.createElement(o.Fragment,null,W&&[o.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:g?-1:0,style:m}),o.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:g?-1:1,style:m})],!g&&o.createElement(G,{id:_,sideCar:F,observed:c,disabled:g,persistentFocus:y,crossFrame:x,autoFocus:C,whiteList:D,shards:O,onActivation:q,onDeactivation:z,returnFocus:H,focusOptions:M}),o.createElement(P,e({ref:Y},U,{className:j,onBlur:K,onFocus:J}),E),X&&o.createElement("div",{"data-focus-guard":!0,tabIndex:g?-1:0,style:m}))}));h.propTypes="production"!==process.env.NODE_ENV?{children:r,disabled:s,returnFocus:a([s,n,c]),focusOptions:n,noFocusGuards:s,allowTextSelection:s,autoFocus:s,persistentFocus:s,crossFrame:s,group:u,className:u,whiteList:c,shards:i(d),as:a([u,c,n]),lockProps:n,onActivation:c,onDeactivation:c,sideCar:d.isRequired}:{},h.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};var E=h;export{E as default};
2
2
  //# sourceMappingURL=Lock.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Lock.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { useEffect } from \"react\";\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var children = props.children,\n disabled = props.disabled,\n noFocusGuards = props.noFocusGuards,\n persistentFocus = props.persistentFocus,\n crossFrame = props.crossFrame,\n autoFocus = props.autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n shouldReturnFocus = props.returnFocus,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n\n var _React$useState2 = React.useState({}),\n id = _React$useState2[0]; // SIDE EFFECT CALLBACKS\n\n\n var onActivation = React.useCallback(function () {\n originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement;\n\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n\n isActive.current = true;\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n }, [onDeactivationCallback]);\n useEffect(function () {\n if (!disabled) {\n // cleanup return focus on trap deactivation\n // sideEffect/returnFocus should happen by this time\n originalFocusedElement.current = null;\n }\n }, []);\n var returnFocus = React.useCallback(function (allowDefer) {\n var returnFocusTo = originalFocusedElement.current;\n\n if (returnFocusTo && returnFocusTo.focus) {\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n\n if (Boolean(howToReturnFocus)) {\n var focusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n\n if (allowDefer) {\n // React might return focus after update\n // it's safer to defer the action\n Promise.resolve().then(function () {\n return returnFocusTo.focus(focusOptions);\n });\n } else {\n returnFocusTo.focus(focusOptions);\n }\n }\n }\n }, [shouldReturnFocus]); // MEDIUM CALLBACKS\n\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium; // REF PROPAGATION\n // not using real refs due to race conditions\n\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n\n React.useEffect(function () {\n if (!observed.current) {\n // eslint-disable-next-line no-console\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }),\n /*#__PURE__*/\n // nearest focus guard\n React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) // first tabbed element guard\n ], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), children), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object]),\n noFocusGuards: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nFocusLock.defaultProps = {\n children: undefined,\n disabled: false,\n returnFocus: false,\n noFocusGuards: false,\n autoFocus: true,\n persistentFocus: false,\n crossFrame: true,\n allowTextSelection: undefined,\n group: undefined,\n className: undefined,\n whiteList: undefined,\n shards: undefined,\n as: 'div',\n lockProps: {},\n onActivation: undefined,\n onDeactivation: undefined\n};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","children","disabled","noFocusGuards","persistentFocus","crossFrame","autoFocus","allowTextSelection","group","className","whiteList","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","shouldReturnFocus","returnFocus","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","current","document","activeElement","useEffect","allowDefer","returnFocusTo","focus","howToReturnFocus","Boolean","focusOptions","undefined","Promise","resolve","then","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","propTypes","node","bool","oneOfType","object","string","func","arrayOf","any","isRequired","defaultProps"],"mappings":"yhBAQA,IAAIA,EAAa,GACbC,EAAyBC,EAAMC,YAAW,SAAqBC,EAAOC,GACxE,IAAIC,EAEAC,EAAkBL,EAAMM,WACxBC,EAAeF,EAAgB,GAC/BG,EAAcH,EAAgB,GAE9BI,EAAWT,EAAMU,SACjBC,EAAWX,EAAMU,QAAO,GACxBE,EAAyBZ,EAAMU,OAAO,MACtCG,EAAWX,EAAMW,SACjBC,EAAWZ,EAAMY,SACjBC,EAAgBb,EAAMa,cACtBC,EAAkBd,EAAMc,gBACxBC,EAAaf,EAAMe,WACnBC,EAAYhB,EAAMgB,UAClBC,EAAqBjB,EAAMiB,mBAC3BC,EAAQlB,EAAMkB,MACdC,EAAYnB,EAAMmB,UAClBC,EAAYpB,EAAMoB,UAClBC,EAAgBrB,EAAMsB,OACtBA,OAA2B,IAAlBD,EAA2BzB,EAAayB,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AChBlE,GAAI6D,EAAU,CAACE,EAAQC,EAAMF,IAC7B3D,UAAW2D,EACXpD,aAAcsD,EACdpD,eAAgBoD,EAChB1D,QAAS4D,EAAIC,YACX,GACJ9F,EAAU+F,aAAe,CACvBjF,cAAUsC,EACVrC,UAAU,EACVoB,aAAa,EACbnB,eAAe,EACfG,WAAW,EACXF,iBAAiB,EACjBC,YAAY,EACZE,wBAAoBgC,EACpB/B,WAAO+B,EACP9B,eAAW8B,EACX7B,eAAW6B,EACX3B,YAAQ2B,EACRzB,GAAI,MACJG,UAAW,GACXO,kBAAce,EACdb,oBAAgBa,GAElB,MAAepD"}
1
+ {"version":3,"file":"Lock.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { useEffect } from \"react\";\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var children = props.children,\n disabled = props.disabled,\n noFocusGuards = props.noFocusGuards,\n persistentFocus = props.persistentFocus,\n crossFrame = props.crossFrame,\n autoFocus = props.autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n shouldReturnFocus = props.returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n\n var _React$useState2 = React.useState({}),\n id = _React$useState2[0]; // SIDE EFFECT CALLBACKS\n\n\n var onActivation = React.useCallback(function () {\n originalFocusedElement.current = originalFocusedElement.current || document && document.activeElement;\n\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n\n isActive.current = true;\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n }, [onDeactivationCallback]);\n useEffect(function () {\n if (!disabled) {\n // cleanup return focus on trap deactivation\n // sideEffect/returnFocus should happen by this time\n originalFocusedElement.current = null;\n }\n }, []);\n var returnFocus = React.useCallback(function (allowDefer) {\n var returnFocusTo = originalFocusedElement.current;\n\n if (returnFocusTo && returnFocusTo.focus) {\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n\n if (Boolean(howToReturnFocus)) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n\n if (allowDefer) {\n // React might return focus after update\n // it's safer to defer the action\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]); // MEDIUM CALLBACKS\n\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium; // REF PROPAGATION\n // not using real refs due to race conditions\n\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n\n React.useEffect(function () {\n if (!observed.current) {\n // eslint-disable-next-line no-console\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }),\n /*#__PURE__*/\n // nearest focus guard\n React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) // first tabbed element guard\n ], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), children), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nFocusLock.defaultProps = {\n children: undefined,\n disabled: false,\n returnFocus: false,\n focusOptions: undefined,\n noFocusGuards: false,\n autoFocus: true,\n persistentFocus: false,\n crossFrame: true,\n allowTextSelection: undefined,\n group: undefined,\n className: undefined,\n whiteList: undefined,\n shards: undefined,\n as: 'div',\n lockProps: {},\n onActivation: undefined,\n onDeactivation: undefined\n};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","React","forwardRef","props","parentRef","_extends2","_React$useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","children","disabled","noFocusGuards","persistentFocus","crossFrame","autoFocus","allowTextSelection","group","className","whiteList","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","shouldReturnFocus","returnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","current","document","activeElement","useEffect","allowDefer","returnFocusTo","focus","howToReturnFocus","Boolean","returnFocusOptions","undefined","Promise","resolve","then","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","error","_extends","constants.FOCUS_DISABLED","constants.FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired","defaultProps"],"mappings":"yhBAQA,IAAIA,EAAa,GACbC,EAAyBC,EAAMC,YAAW,SAAqBC,EAAOC,GACxE,IAAIC,EAEAC,EAAkBL,EAAMM,WACxBC,EAAeF,EAAgB,GAC/BG,EAAcH,EAAgB,GAE9BI,EAAWT,EAAMU,SACjBC,EAAWX,EAAMU,QAAO,GACxBE,EAAyBZ,EAAMU,OAAO,MACtCG,EAAWX,EAAMW,SACjBC,EAAWZ,EAAMY,SACj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AOC,QAGXnF,EAAUsF,UAAqC,eAAzBrB,QAAQC,IAAIC,SAA4B,CAC5DrD,SAAUyE,EACVxE,SAAUyE,EACVrD,YAAasD,EAAU,CAACD,EAAME,EAAQC,IACtCvD,aAAcsD,EACd1E,cAAewE,EACfpE,mBAAoBoE,EACpBrE,UAAWqE,EACXvE,gBAAiBuE,EACjBtE,WAAYsE,EACZnE,MAAOuE,EACPtE,UAAWsE,EACXrE,UAAWoE,EACXlE,OAAQoE,EAAQC,GAChBnE,GAAI8D,EAAU,CAACG,EAAQD,EAAMD,IAC7B5D,UAAW4D,EACXpD,aAAcqD,EACdnD,eAAgBmD,EAChB1D,QAAS6D,EAAIC,YACX,GACJ/F,EAAUgG,aAAe,CACvBlF,cAAUuC,EACVtC,UAAU,EACVoB,aAAa,EACbC,kBAAciB,EACdrC,eAAe,EACfG,WAAW,EACXF,iBAAiB,EACjBC,YAAY,EACZE,wBAAoBiC,EACpBhC,WAAOgC,EACP/B,eAAW+B,EACX9B,eAAW8B,EACX5B,YAAQ4B,EACR1B,GAAI,MACJG,UAAW,GACXQ,kBAAce,EACdb,oBAAgBa,GAElB,MAAerD"}
@@ -1,2 +1,2 @@
1
- import"react";import e from"prop-types";import n from"../../../react-clientside-effect/lib/index.es.js";import t from"../../../focus-lock/dist/es2015/index.js";import{deferAction as o}from"./util.js";import{mediumFocus as r,mediumBlur as u,mediumEffect as i}from"./medium.js";import{focusInside as c}from"../../../focus-lock/dist/es2015/focusInside.js";import{focusIsHidden as s}from"../../../focus-lock/dist/es2015/focusIsHidden.js";import{getFocusabledIn as d}from"../../../focus-lock/dist/es2015/focusables.js";var a=function(){return document&&document.activeElement===document.body||s()},f=null,m=null,l=null,v=!1,p=function(){return!0};function b(e,n,t,o){var r=null,u=e;do{var i=o[u];if(i.guard)i.node.dataset.focusAutoGuard&&(r=i);else{if(!i.lockItem)break;if(u!==e)return;r=null}}while((u+=t)!==n);r&&(r.node.tabIndex=0)}var E=function(e){return e&&"current"in e?e.current:e},g=function(){var e,n=!1;if(f){var o=f,r=o.observed,u=o.persistentFocus,i=o.autoFocus,s=o.shards,g=o.crossFrame,h=r||l&&l.portaledElement,j=document&&document.activeElement;if(h){var w=[h].concat(s.map(E).filter(Boolean));if(j&&!function(e){return(f.whiteList||p)(e)}(j)||(u||(g?Boolean(v):"meanwhile"===v)||!a()||!m&&i)&&(!h||c(w)||(e=j,l&&l.portaledElement===e)||(document&&!m&&j&&!i?(j.blur&&j.blur(),document.body.focus()):(n=t(w,m),l={})),v=!1,m=document&&document.activeElement),document){var I=document&&document.activeElement,L=d(w),k=L.map((function(e){return e.node})).indexOf(I);k>-1&&(L.filter((function(e){var n=e.guard,t=e.node;return n&&t.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),b(k,L.length,1,L),b(k,-1,-1,L))}}}return n},h=function(e){g()&&e&&(e.stopPropagation(),e.preventDefault())},j=function(){return o(g)};"production"===process.env.NODE_ENV||e.node.isRequired;var w=function(){v="just",setTimeout((function(){v="meanwhile"}),0)};r.assignSyncMedium((function(e){var n=e.target,t=e.currentTarget;t.contains(n)||(l={observerNode:t,portaledElement:n})})),u.assignMedium(j),i.assignMedium((function(e){return e({moveFocusInside:t,focusInside:c})}));var I=n((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var n=e.slice(-1)[0];n&&!f&&(document.addEventListener("focusin",h),document.addEventListener("focusout",j),window.addEventListener("blur",w));var t=f,r=t&&n&&n.id===t.id;f=n,t&&!r&&(t.onDeactivation(),e.filter((function(e){return e.id===t.id})).length||t.returnFocus(!n)),n?(m=null,r&&t.observed===n.observed||n.onActivation(),g(),o(g)):(document.removeEventListener("focusin",h),document.removeEventListener("focusout",j),window.removeEventListener("blur",w),m=null)}))((function(){return null}));export{I as default};
1
+ import"react";import e from"prop-types";import n from"../../../react-clientside-effect/lib/index.es.js";import t from"../../../focus-lock/dist/es2015/index.js";import{deferAction as o}from"./util.js";import{mediumFocus as r,mediumBlur as u,mediumEffect as i}from"./medium.js";import{focusInside as c}from"../../../focus-lock/dist/es2015/focusInside.js";import{focusIsHidden as s}from"../../../focus-lock/dist/es2015/focusIsHidden.js";import{getFocusabledIn as d}from"../../../focus-lock/dist/es2015/focusables.js";var a=function(){return document&&document.activeElement===document.body||s()},f=null,m=null,l=null,v=!1,p=function(){return!0};function b(e,n,t,o){var r=null,u=e;do{var i=o[u];if(i.guard)i.node.dataset.focusAutoGuard&&(r=i);else{if(!i.lockItem)break;if(u!==e)return;r=null}}while((u+=t)!==n);r&&(r.node.tabIndex=0)}var E=function(e){return e&&"current"in e?e.current:e},g=function(){var e,n=!1;if(f){var o=f,r=o.observed,u=o.persistentFocus,i=o.autoFocus,s=o.shards,g=o.crossFrame,h=o.focusOptions,j=r||l&&l.portaledElement,w=document&&document.activeElement;if(j){var I=[j].concat(s.map(E).filter(Boolean));if(w&&!function(e){return(f.whiteList||p)(e)}(w)||(u||(g?Boolean(v):"meanwhile"===v)||!a()||!m&&i)&&(!j||c(I)||(e=w,l&&l.portaledElement===e)||(document&&!m&&w&&!i?(w.blur&&w.blur(),document.body.focus()):(n=t(I,m,{focusOptions:h}),l={})),v=!1,m=document&&document.activeElement),document){var L=document&&document.activeElement,k=d(I),x=k.map((function(e){return e.node})).indexOf(L);x>-1&&(k.filter((function(e){var n=e.guard,t=e.node;return n&&t.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),b(x,k.length,1,k),b(x,-1,-1,k))}}}return n},h=function(e){g()&&e&&(e.stopPropagation(),e.preventDefault())},j=function(){return o(g)};"production"===process.env.NODE_ENV||e.node.isRequired;var w=function(){v="just",setTimeout((function(){v="meanwhile"}),0)};r.assignSyncMedium((function(e){var n=e.target,t=e.currentTarget;t.contains(n)||(l={observerNode:t,portaledElement:n})})),u.assignMedium(j),i.assignMedium((function(e){return e({moveFocusInside:t,focusInside:c})}));var I=n((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var n=e.slice(-1)[0];n&&!f&&(document.addEventListener("focusin",h),document.addEventListener("focusout",j),window.addEventListener("blur",w));var t=f,r=t&&n&&n.id===t.id;f=n,t&&!r&&(t.onDeactivation(),e.filter((function(e){return e.id===t.id})).length||t.returnFocus(!n)),n?(m=null,r&&t.observed===n.observed||n.onActivation(),g(),o(g)):(document.removeEventListener("focusin",h),document.removeEventListener("focusout",j),window.removeEventListener("blur",w),m=null)}))((function(){return null}));export{I as default};
2
2
  //# sourceMappingURL=Trap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Trap.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport moveFocusInside, { focusInside, focusIsHidden, getFocusabledIn } from 'focus-lock';\nimport { deferAction } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\n\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\n\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\n\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\n\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\n\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\n\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\n\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\n\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n\n do {\n var item = allNodes[i];\n\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n // we will tab to the next element\n return;\n }\n\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\n\nvar extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\n\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n // with cross frame return true for any value\n return Boolean(focusWasOutsideWindow);\n } // in other case return only of focus went a while aho\n\n\n return focusWasOutsideWindow === 'meanwhile';\n};\n\nvar activateTrap = function activateTrap() {\n var result = false;\n\n if (lastActiveTrap) {\n var _lastActiveTrap = lastActiveTrap,\n observed = _lastActiveTrap.observed,\n persistentFocus = _lastActiveTrap.persistentFocus,\n autoFocus = _lastActiveTrap.autoFocus,\n shards = _lastActiveTrap.shards,\n crossFrame = _lastActiveTrap.crossFrame;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n var activeElement = document && document.activeElement;\n\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !(focusInside(workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n // Check if blur() exists, which is missing on certain elements on IE\n if (activeElement.blur) {\n activeElement.blur();\n }\n\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus);\n lastPortaledElement = {};\n }\n }\n\n focusWasOutsideWindow = false;\n lastActiveFocus = document && document.activeElement;\n }\n }\n\n if (document) {\n var newActiveElement = document && document.activeElement;\n var allNodes = getFocusabledIn(workingArea);\n var focusedIndex = allNodes.map(function (_ref) {\n var node = _ref.node;\n return node;\n }).indexOf(newActiveElement);\n\n if (focusedIndex > -1) {\n // remove old focus\n allNodes.filter(function (_ref2) {\n var guard = _ref2.guard,\n node = _ref2.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref3) {\n var node = _ref3.node;\n return node.removeAttribute('tabIndex');\n });\n autoGuard(focusedIndex, allNodes.length, +1, allNodes);\n autoGuard(focusedIndex, -1, -1, allNodes);\n }\n }\n }\n }\n\n return result;\n};\n\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n // prevent scroll jump\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\n\nvar onFocus = function onFocus(event) {\n // detect portal\n var source = event.target;\n var currentNode = event.currentTarget;\n\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\n\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\n\nvar FocusTrap = function FocusTrap(_ref4) {\n var children = _ref4.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\n\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\n\nvar onWindowBlur = function onWindowBlur() {\n focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction\n\n setTimeout(function () {\n focusWasOutsideWindow = 'meanwhile';\n }, 0);\n};\n\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('blur', onWindowBlur);\n};\n\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('blur', onWindowBlur);\n};\n\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref5) {\n var disabled = _ref5.disabled;\n return !disabled;\n });\n}\n\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation(); // return focus only of last trap was removed\n\n if (!traps.filter(function (_ref6) {\n var id = _ref6.id;\n return id === lastTrap.id;\n }).length) {\n // allow defer is no other trap is awaiting restore\n lastTrap.returnFocus(!trap);\n }\n }\n\n if (trap) {\n lastActiveFocus = null;\n\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation();\n }\n\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n} // bind medium\n\n\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb({\n moveFocusInside: moveFocusInside,\n focusInside: focusInside\n });\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["isFreeFocus","document","activeElement","body","focusIsHidden","lastActiveTrap","lastActiveFocus","lastPortaledElement","focusWasOutsideWindow","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","extractRef","ref","current","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","workingNode","portaledElement","workingArea","concat","map","filter","Boolean","whiteList","focusWhitelisted","focusInside","blur","focus","moveFocusInside","newActiveElement","getFocusabledIn","focusedIndex","_ref","indexOf","_ref2","forEach","_ref3","removeAttribute","length","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowBlur","setTimeout","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","contains","observerNode","mediumBlur","assignMedium","mediumEffect","cb","withSideEffect","propsList","_ref5","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref6","returnFocus","onActivation","removeEventListener"],"mappings":"kgBAOA,IAIIA,EAAc,WAChB,OAJOC,UAAYA,SAASC,gBAAkBD,SAASE,MAI/BC,KAGtBC,EAAiB,KACjBC,EAAkB,KAClBC,EAAsB,KACtBC,GAAwB,EAExBC,EAAmB,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KAAOF,EAASE,GACxD1F,EAAiBoF,EAEbI,IAAaC,IACfD,EAASG,iBAEJR,EAAM/C,QAAO,SAAUwD,GAE1B,OADSA,EAAMF,KACDF,EAASE,MACtBrC,QAEDmC,EAASK,aAAaT,IAItBA,GACFnF,EAAkB,KAEbwF,GAAYD,EAAS9D,WAAa0D,EAAK1D,UAC1C0D,EAAKU,eAGPxE,IACAqC,EAAYrC,KA3Cd1B,SAASmG,oBAAoB,UAAWzC,GACxC1D,SAASmG,oBAAoB,WAAYrC,GACzC6B,OAAOQ,oBAAoB,OAAQ9B,GA4CjChE,EAAkB,QAaP8E,EA1FI,WACjB,OAAO"}
1
+ {"version":3,"file":"Trap.js","sources":["../../../../../../node_modules/react-focus-lock/dist/es2015/Trap.js"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport withSideEffect from 'react-clientside-effect';\nimport moveFocusInside, { focusInside, focusIsHidden, getFocusabledIn } from 'focus-lock';\nimport { deferAction } from './util';\nimport { mediumFocus, mediumBlur, mediumEffect } from './medium';\n\nvar focusOnBody = function focusOnBody() {\n return document && document.activeElement === document.body;\n};\n\nvar isFreeFocus = function isFreeFocus() {\n return focusOnBody() || focusIsHidden();\n};\n\nvar lastActiveTrap = null;\nvar lastActiveFocus = null;\nvar lastPortaledElement = null;\nvar focusWasOutsideWindow = false;\n\nvar defaultWhitelist = function defaultWhitelist() {\n return true;\n};\n\nvar focusWhitelisted = function focusWhitelisted(activeElement) {\n return (lastActiveTrap.whiteList || defaultWhitelist)(activeElement);\n};\n\nvar recordPortal = function recordPortal(observerNode, portaledElement) {\n lastPortaledElement = {\n observerNode: observerNode,\n portaledElement: portaledElement\n };\n};\n\nvar focusIsPortaledPair = function focusIsPortaledPair(element) {\n return lastPortaledElement && lastPortaledElement.portaledElement === element;\n};\n\nfunction autoGuard(startIndex, end, step, allNodes) {\n var lastGuard = null;\n var i = startIndex;\n\n do {\n var item = allNodes[i];\n\n if (item.guard) {\n if (item.node.dataset.focusAutoGuard) {\n lastGuard = item;\n }\n } else if (item.lockItem) {\n if (i !== startIndex) {\n // we will tab to the next element\n return;\n }\n\n lastGuard = null;\n } else {\n break;\n }\n } while ((i += step) !== end);\n\n if (lastGuard) {\n lastGuard.node.tabIndex = 0;\n }\n}\n\nvar extractRef = function extractRef(ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\n\nvar focusWasOutside = function focusWasOutside(crossFrameOption) {\n if (crossFrameOption) {\n // with cross frame return true for any value\n return Boolean(focusWasOutsideWindow);\n } // in other case return only of focus went a while aho\n\n\n return focusWasOutsideWindow === 'meanwhile';\n};\n\nvar activateTrap = function activateTrap() {\n var result = false;\n\n if (lastActiveTrap) {\n var _lastActiveTrap = lastActiveTrap,\n observed = _lastActiveTrap.observed,\n persistentFocus = _lastActiveTrap.persistentFocus,\n autoFocus = _lastActiveTrap.autoFocus,\n shards = _lastActiveTrap.shards,\n crossFrame = _lastActiveTrap.crossFrame,\n focusOptions = _lastActiveTrap.focusOptions;\n var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;\n var activeElement = document && document.activeElement;\n\n if (workingNode) {\n var workingArea = [workingNode].concat(shards.map(extractRef).filter(Boolean));\n\n if (!activeElement || focusWhitelisted(activeElement)) {\n if (persistentFocus || focusWasOutside(crossFrame) || !isFreeFocus() || !lastActiveFocus && autoFocus) {\n if (workingNode && !(focusInside(workingArea) || focusIsPortaledPair(activeElement, workingNode))) {\n if (document && !lastActiveFocus && activeElement && !autoFocus) {\n // Check if blur() exists, which is missing on certain elements on IE\n if (activeElement.blur) {\n activeElement.blur();\n }\n\n document.body.focus();\n } else {\n result = moveFocusInside(workingArea, lastActiveFocus, {\n focusOptions: focusOptions\n });\n lastPortaledElement = {};\n }\n }\n\n focusWasOutsideWindow = false;\n lastActiveFocus = document && document.activeElement;\n }\n }\n\n if (document) {\n var newActiveElement = document && document.activeElement;\n var allNodes = getFocusabledIn(workingArea);\n var focusedIndex = allNodes.map(function (_ref) {\n var node = _ref.node;\n return node;\n }).indexOf(newActiveElement);\n\n if (focusedIndex > -1) {\n // remove old focus\n allNodes.filter(function (_ref2) {\n var guard = _ref2.guard,\n node = _ref2.node;\n return guard && node.dataset.focusAutoGuard;\n }).forEach(function (_ref3) {\n var node = _ref3.node;\n return node.removeAttribute('tabIndex');\n });\n autoGuard(focusedIndex, allNodes.length, +1, allNodes);\n autoGuard(focusedIndex, -1, -1, allNodes);\n }\n }\n }\n }\n\n return result;\n};\n\nvar onTrap = function onTrap(event) {\n if (activateTrap() && event) {\n // prevent scroll jump\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nvar onBlur = function onBlur() {\n return deferAction(activateTrap);\n};\n\nvar onFocus = function onFocus(event) {\n // detect portal\n var source = event.target;\n var currentNode = event.currentTarget;\n\n if (!currentNode.contains(source)) {\n recordPortal(currentNode, source);\n }\n};\n\nvar FocusWatcher = function FocusWatcher() {\n return null;\n};\n\nvar FocusTrap = function FocusTrap(_ref4) {\n var children = _ref4.children;\n return /*#__PURE__*/React.createElement(\"div\", {\n onBlur: onBlur,\n onFocus: onFocus\n }, children);\n};\n\nFocusTrap.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node.isRequired\n} : {};\n\nvar onWindowBlur = function onWindowBlur() {\n focusWasOutsideWindow = 'just'; // using setTimeout to set this variable after React/sidecar reaction\n\n setTimeout(function () {\n focusWasOutsideWindow = 'meanwhile';\n }, 0);\n};\n\nvar attachHandler = function attachHandler() {\n document.addEventListener('focusin', onTrap);\n document.addEventListener('focusout', onBlur);\n window.addEventListener('blur', onWindowBlur);\n};\n\nvar detachHandler = function detachHandler() {\n document.removeEventListener('focusin', onTrap);\n document.removeEventListener('focusout', onBlur);\n window.removeEventListener('blur', onWindowBlur);\n};\n\nfunction reducePropsToState(propsList) {\n return propsList.filter(function (_ref5) {\n var disabled = _ref5.disabled;\n return !disabled;\n });\n}\n\nfunction handleStateChangeOnClient(traps) {\n var trap = traps.slice(-1)[0];\n\n if (trap && !lastActiveTrap) {\n attachHandler();\n }\n\n var lastTrap = lastActiveTrap;\n var sameTrap = lastTrap && trap && trap.id === lastTrap.id;\n lastActiveTrap = trap;\n\n if (lastTrap && !sameTrap) {\n lastTrap.onDeactivation(); // return focus only of last trap was removed\n\n if (!traps.filter(function (_ref6) {\n var id = _ref6.id;\n return id === lastTrap.id;\n }).length) {\n // allow defer is no other trap is awaiting restore\n lastTrap.returnFocus(!trap);\n }\n }\n\n if (trap) {\n lastActiveFocus = null;\n\n if (!sameTrap || lastTrap.observed !== trap.observed) {\n trap.onActivation();\n }\n\n activateTrap(true);\n deferAction(activateTrap);\n } else {\n detachHandler();\n lastActiveFocus = null;\n }\n} // bind medium\n\n\nmediumFocus.assignSyncMedium(onFocus);\nmediumBlur.assignMedium(onBlur);\nmediumEffect.assignMedium(function (cb) {\n return cb({\n moveFocusInside: moveFocusInside,\n focusInside: focusInside\n });\n});\nexport default withSideEffect(reducePropsToState, handleStateChangeOnClient)(FocusWatcher);"],"names":["isFreeFocus","document","activeElement","body","focusIsHidden","lastActiveTrap","lastActiveFocus","lastPortaledElement","focusWasOutsideWindow","defaultWhitelist","autoGuard","startIndex","end","step","allNodes","lastGuard","i","item","guard","node","dataset","focusAutoGuard","lockItem","tabIndex","extractRef","ref","current","activateTrap","element","result","_lastActiveTrap","observed","persistentFocus","autoFocus","shards","crossFrame","focusOptions","workingNode","portaledElement","workingArea","concat","map","filter","Boolean","whiteList","focusWhitelisted","focusInside","blur","focus","moveFocusInside","newActiveElement","getFocusabledIn","focusedIndex","_ref","indexOf","_ref2","forEach","_ref3","removeAttribute","length","onTrap","event","stopPropagation","preventDefault","onBlur","deferAction","process","env","NODE_ENV","PropTypes","isRequired","onWindowBlur","setTimeout","mediumFocus","assignSyncMedium","source","target","currentNode","currentTarget","contains","observerNode","mediumBlur","assignMedium","mediumEffect","cb","withSideEffect","propsList","_ref5","disabled","traps","trap","slice","addEventListener","window","lastTrap","sameTrap","id","onDeactivation","_ref6","returnFocus","onActivation","removeE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C,EAAOD,EAAME,OAAO,GAAG,GAEvBD,IAASrF,IArBbJ,SAAS2F,iBAAiB,UAAWhC,GACrC3D,SAAS2F,iBAAiB,WAAY5B,GACtC6B,OAAOD,iBAAiB,OAAQrB,IAuBhC,IAAIuB,EAAWzF,EACX0F,EAAWD,GAAYJ,GAAQA,EAAKM,KAAOF,EAASE,GACxD3F,EAAiBqF,EAEbI,IAAaC,IACfD,EAASG,iBAEJR,EAAM/C,QAAO,SAAUwD,GAE1B,OADSA,EAAMF,KACDF,EAASE,MACtBrC,QAEDmC,EAASK,aAAaT,IAItBA,GACFpF,EAAkB,KAEbyF,GAAYD,EAAS/D,WAAa2D,EAAK3D,UAC1C2D,EAAKU,eAGPzE,IACAsC,EAAYtC,KA3Cd1B,SAASoG,oBAAoB,UAAWzC,GACxC3D,SAASoG,oBAAoB,WAAYrC,GACzC6B,OAAOQ,oBAAoB,OAAQ9B,GA4CjCjE,EAAkB,QAaP+E,EA1FI,WACjB,OAAO"}
@@ -0,0 +1,2 @@
1
+ import*as e from"react";function t(){return t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}var r=new Map,i=new WeakMap,o=0;function s(e){return Object.keys(e).sort().filter((function(t){return void 0!==e[t]})).map((function(t){return t+"_"+("root"===t?(n=e.root)?(i.has(n)||(o+=1,i.set(n,o.toString())),i.get(n)):"0":e[t]);var n})).toString()}function a(e,t,n,i){if(void 0===n&&(n={}),void 0===i&&(i=undefined),void 0===window.IntersectionObserver&&void 0!==i){var o=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),function(){}}var a=function(e){var t=s(e),n=r.get(t);if(!n){var i,o=new Map,a=new IntersectionObserver((function(t){t.forEach((function(t){var n,r=t.isIntersecting&&i.some((function(e){return t.intersectionRatio>=e}));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null==(n=o.get(t.target))||n.forEach((function(e){e(r,t)}))}))}),e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:a,elements:o},r.set(t,n)}return n}(n),l=a.id,h=a.observer,c=a.elements,u=c.get(e)||[];return c.has(e)||c.set(e,u),u.push(t),h.observe(e),function(){u.splice(u.indexOf(t),1),0===u.length&&(c.delete(e),h.unobserve(e)),0===c.size&&(h.disconnect(),r.delete(l))}}var l=["children","as","tag","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function h(e){return"function"!=typeof e.children}var c=function(r){var i,o;function s(e){var t;return(t=r.call(this,e)||this).node=null,t._unobserveCb=null,t.handleNode=function(e){t.node&&(t.unobserve(),e||t.props.triggerOnce||t.props.skip||t.setState({inView:!!t.props.initialInView,entry:void 0})),t.node=e||null,t.observeNode()},t.handleChange=function(e,n){e&&t.props.triggerOnce&&t.unobserve(),h(t.props)||t.setState({inView:e,entry:n}),t.props.onChange&&t.props.onChange(e,n)},t.state={inView:!!e.initialInView,entry:void 0},t}o=r,(i=s).prototype=Object.create(o.prototype),i.prototype.constructor=i,n(i,o);var c=s.prototype;return c.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},c.componentWillUnmount=function(){this.unobserve(),this.node=null},c.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,i=e.trackVisibility,o=e.delay,s=e.fallbackInView;this._unobserveCb=a(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:i,delay:o},s)}},c.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},c.render=function(){if(!h(this.props)){var n=this.state,r=n.inView,i=n.entry;return this.props.children({inView:r,entry:i,ref:this.handleNode})}var o=this.props,s=o.children,a=o.as,c=o.tag,u=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(o,l);return e.createElement(a||c||"div",t({ref:this.handleNode},u),s)},s}(e.Component);c.displayName="InView",c.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1};export{c as InView,c as default,a as observe};
2
+ //# sourceMappingURL=react-intersection-observer.m.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-intersection-observer.m.js","sources":["../../../../node_modules/react-intersection-observer/react-intersection-observer.m.js"],"sourcesContent":["import * as React from 'react';\nimport { useEffect } from 'react';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar observerMap = new Map();\nvar RootIds = new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(function (key) {\n return options[key] !== undefined;\n }).map(function (key) {\n return key + \"_\" + (key === 'root' ? getRootId(options.root) : options[key]);\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n var id = optionsToId(options);\n var instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n var elements = new Map();\n var thresholds;\n var observer = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n var inView = entry.isIntersecting && thresholds.some(function (threshold) {\n return entry.intersectionRatio >= threshold;\n }); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(function (callback) {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id: id,\n observer: observer,\n elements: elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options, fallbackInView) {\n if (options === void 0) {\n options = {};\n }\n\n if (fallbackInView === void 0) {\n fallbackInView = unsupportedValue;\n }\n\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n var bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return function () {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n var _createObserver = createObserver(options),\n id = _createObserver.id,\n observer = _createObserver.observer,\n elements = _createObserver.elements; // Register the callback listener for this element\n\n\n var callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements[\"delete\"](element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap[\"delete\"](id);\n }\n };\n}\n\nvar _excluded = [\"children\", \"as\", \"tag\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `<InView>` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView>\r\n {({ inView, ref, entry }) => (\r\n <div ref={ref}>\r\n <h2>{`Header inside viewport ${inView}.`}</h2>\r\n </div>\r\n )}\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the `<InView />`, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `<InView>` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n <InView as=\"div\" onChange={(inView, entry) => console.log('Inview:', inView)}>\r\n <h2>Plain children are always rendered. Use onChange to monitor state.</h2>\r\n </InView>\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nvar InView = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(InView, _React$Component);\n\n function InView(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.node = null;\n _this._unobserveCb = null;\n\n _this.handleNode = function (node) {\n if (_this.node) {\n // Clear the old observer, before we start observing a new element\n _this.unobserve();\n\n if (!node && !_this.props.triggerOnce && !_this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n _this.setState({\n inView: !!_this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n _this.node = node ? node : null;\n\n _this.observeNode();\n };\n\n _this.handleChange = function (inView, entry) {\n if (inView && _this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n _this.unobserve();\n }\n\n if (!isPlainChildren(_this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n _this.setState({\n inView: inView,\n entry: entry\n });\n }\n\n if (_this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n _this.props.onChange(inView, entry);\n }\n };\n\n _this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n return _this;\n }\n\n var _proto = InView.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unobserve();\n this.node = null;\n };\n\n _proto.observeNode = function observeNode() {\n if (!this.node || this.props.skip) return;\n var _this$props = this.props,\n threshold = _this$props.threshold,\n root = _this$props.root,\n rootMargin = _this$props.rootMargin,\n trackVisibility = _this$props.trackVisibility,\n delay = _this$props.delay,\n fallbackInView = _this$props.fallbackInView;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold: threshold,\n root: root,\n rootMargin: rootMargin,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n };\n\n _proto.unobserve = function unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n };\n\n _proto.render = function render() {\n if (!isPlainChildren(this.props)) {\n var _this$state = this.state,\n inView = _this$state.inView,\n entry = _this$state.entry;\n return this.props.children({\n inView: inView,\n entry: entry,\n ref: this.handleNode\n });\n }\n\n var _this$props2 = this.props,\n children = _this$props2.children,\n as = _this$props2.as,\n tag = _this$props2.tag,\n props = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n\n return /*#__PURE__*/React.createElement(as || tag || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n };\n\n return InView;\n}(React.Component);\nInView.displayName = 'InView';\nInView.defaultProps = {\n threshold: 0,\n triggerOnce: false,\n initialInView: false\n};\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n * <div ref={ref}>\r\n * <h2>{`Header inside viewport ${inView}.`}</h2>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n threshold = _ref.threshold,\n delay = _ref.delay,\n trackVisibility = _ref.trackVisibility,\n rootMargin = _ref.rootMargin,\n root = _ref.root,\n triggerOnce = _ref.triggerOnce,\n skip = _ref.skip,\n initialInView = _ref.initialInView,\n fallbackInView = _ref.fallbackInView;\n\n var unobserve = React.useRef();\n\n var _React$useState = React.useState({\n inView: !!initialInView\n }),\n state = _React$useState[0],\n setState = _React$useState[1];\n\n var setRef = React.useCallback(function (node) {\n if (unobserve.current !== undefined) {\n unobserve.current();\n unobserve.current = undefined;\n } // Skip creating the observer\n\n\n if (skip) return;\n\n if (node) {\n unobserve.current = observe(node, function (inView, entry) {\n setState({\n inView: inView,\n entry: entry\n });\n\n if (entry.isIntersecting && triggerOnce && unobserve.current) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve.current();\n unobserve.current = undefined;\n }\n }, {\n root: root,\n rootMargin: rootMargin,\n threshold: threshold,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n }\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n /* eslint-disable-next-line */\n\n useEffect(function () {\n if (!unobserve.current && state.entry && !triggerOnce && !skip) {\n // If we don't have a ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n setState({\n inView: !!initialInView\n });\n }\n });\n var result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, InView as default, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.m.js.map\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","_createObserver","id","instance","thresholds","elements","observer","entries","forEach","entry","_elements$get","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","unobserve","size","disconnect","_excluded","isPlainChildren","props","children","InView","_React$Component","subClass","superClass","_this","node","_unobserveCb","handleNode","triggerOnce","skip","setState","initialInView","observeNode","handleChange","onChange","state","create","constructor","_proto","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_this$props","render","_this$state","ref","_this$props2","as","tag","excluded","sourceKeys","_objectWithoutPropertiesLoose","React","createElement","Component","displayName","defaultProps"],"mappings":"wBAGA,SAASA,IAeP,OAdAA,EAAWC,OAAOC,QAAU,SAAUC,GACpC,IAAK,IAAIC,EAAI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Ae"}
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import r,{forwardRef as t}from"react";import{useTheme as n}from"styled-components";import o from"../../themes/cruk.js";import i from"../Icon/index.js";import{StyledButton as a,Spacer as m}from"./styles.js";var l=t((function(t,l){var p=n(),s=e(e({},o),p),c=t.appearance,d=void 0===c?"primary":c,f=t.isIconButton,u=void 0!==f&&f,h=r.Children.toArray(t.children),y="string"==typeof h[0],v=h[0],j=!(!u&&(1===h.length&&!y&&(null==v?void 0:v.type))!==i);return r.createElement(a,e({as:t.href?"a":"button"},t,{appearance:d,isIconButton:j,theme:s,ref:l}),t.children&&h.length?r.Children.map(t.children,(function(e,t){return r.createElement(m,{theme:s,key:t},e)})):null)}));l.defaultProps={appearance:"primary",full:!1,size:"m"};export{l as Button,l as default};
1
+ import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import r,{forwardRef as t}from"react";import{useTheme as o}from"styled-components";import n from"../../themes/cruk.js";import i from"../Icon/index.js";import{StyledButton as a,Spacer as l}from"./styles.js";var m=t((function(t,m){var p=o(),s=e(e({},n),p),c=t.appearance,f=void 0===c?"primary":c,u=t.isIconButton,d=void 0!==u&&u,h=r.Children.toArray(t.children),y="string"==typeof h[0],v=h[0],b=!(!d&&(1===h.length&&!y&&(null==v?void 0:v.type))!==i);return r.createElement(a,e({as:t.href?"a":"button"},t.href?{role:"button"}:{},t,{appearance:f,isIconButton:b,theme:s,ref:m}),t.children&&h.length?r.Children.map(t.children,(function(e,t){return r.createElement(l,{theme:s,key:t},e)})):null)}));m.defaultProps={appearance:"primary",full:!1,size:"m"};export{m as Button,m as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{css as r}from"styled-components";var t,e,c,a,i,l,d,u,s=o.span(t||(t=n(["\n margin-left: ",";\n &:first-of-type {\n margin-left: 0;\n }\n"],["\n margin-left: ",";\n &:first-of-type {\n margin-left: 0;\n }\n"])),(function(n){return n.theme.spacing.xxs})),b=o.button(u||(u=n(["\n box-sizing: border-box;\n min-height: ",";\n display: inline-block;\n vertical-align: middle;\n padding: ",";\n width: ",";\n min-width: ",";\n\n border-radius: ",";\n border-style: solid;\n border-width: ",";\n\n transition: color 0.2s ease, background-color 0.2s ease,\n border-color 0.2s ease;\n\n cursor: pointer;\n font-size: ",";\n font-family: ",";\n font-weight: ",";\n text-align: center;\n text-transform: ",";\n text-decoration: ",";\n\n ","\n\n ","\n\n ","\n \n ","\n\n ","\n\n ","\n"],["\n box-sizing: border-box;\n min-height: ",";\n display: inline-block;\n vertical-align: middle;\n padding: ",";\n width: ",";\n min-width: ",";\n\n border-radius: ",";\n border-style: solid;\n border-width: ",";\n\n transition: color 0.2s ease, background-color 0.2s ease,\n border-color 0.2s ease;\n\n cursor: pointer;\n font-size: ",";\n font-family: ",";\n font-weight: ",";\n text-align: center;\n text-transform: ",";\n text-decoration: ",";\n\n ","\n\n ","\n\n ","\n \n ","\n\n ","\n\n ","\n"])),"3rem",(function(n){var o=n.theme;return n.isIconButton?"0":"calc( (".concat("3rem"," - ( ").concat(o.button.buttonBorderThickness," * 2) - ").concat(o.typography.lineHeight," ) / 2) ").concat(o.spacing.m)}),(function(n){return n.isIconButton?"".concat("3rem"):"auto"}),(function(n){return n.isIconButton?"".concat("3rem"):"auto"}),(function(n){return n.theme.button.borderRadius}),(function(n){return n.theme.button.buttonBorderThickness}),(function(n){return n.theme.fontSizes.m}),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightMedium}),(function(n){return n.theme.button.textTransform}),(function(n){return n.theme.button.textDecoration}),(function(o){return"primary"===o.appearance&&r(e||(e=n(["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "],["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "])),o.theme.colors.buttonPrimaryBackground,o.theme.colors.buttonPrimaryBorder,o.theme.colors.buttonPrimaryText,o.theme.colors.buttonPrimaryBackgroundHover,o.theme.colors.buttonPrimaryBorderHover,o.theme.colors.buttonPrimaryTextHover,o.theme.colors.buttonPrimaryDisabledBackground,o.theme.colors.buttonPrimaryDisabledText,o.theme.colors.buttonPrimaryDisabledBorder)}),(function(o){return"secondary"===o.appearance&&r(c||(c=n(["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "],["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "])),o.theme.colors.buttonSecondaryBackground,o.theme.colors.buttonSecondaryBorder,o.theme.colors.buttonSecondaryText,o.theme.colors.buttonSecondaryBackgroundHover,o.theme.colors.buttonSecondaryBorderHover,o.theme.colors.buttonSecondaryTextHover,o.theme.colors.buttonSecondaryDisabledBackground,o.theme.colors.buttonSecondaryDisabledText,o.theme.colors.buttonSecondaryDisabledBorder)}),(function(o){return"tertiary"===o.appearance&&r(a||(a=n(["\n display: inline-block;\n padding: 0;\n border: 0px;\n background-color: rgba(255, 255, 255, 0);\n transition: color 0.2s ease;\n color: ",";\n :focus,\n :hover {\n color: ",";\n }\n :disabled {\n cursor: not-allowed;\n background-color: transparent;\n color: "," !important;\n border-color: transparent;\n }\n "],["\n display: inline-block;\n padding: 0;\n border: 0px;\n background-color: rgba(255, 255, 255, 0);\n transition: color 0.2s ease;\n color: ",";\n :focus,\n :hover {\n color: ",";\n }\n :disabled {\n cursor: not-allowed;\n background-color: transparent;\n color: "," !important;\n border-color: transparent;\n }\n "])),o.theme.colors.buttonTertiaryText,o.theme.colors.buttonTertiaryTextHover,o.theme.colors.buttonTertiaryDisabledText)}),(function(o){return"l"===o.size&&r(i||(i=n(["\n min-height: ",";\n border-radius: ",";\n padding: ",";\n min-width: ",";\n height: ",";\n "],["\n min-height: ",";\n border-radius: ",";\n padding: ",";\n min-width: ",";\n height: ",";\n "])),"4rem",(function(n){return n.theme.button.borderRadiusLarge}),(function(n){var o=n.theme;return n.isIconButton?"0":"calc( (".concat("4rem"," - ( ").concat(o.button.buttonBorderThickness," * 2) - ").concat(o.typography.lineHeight," ) / 2) ").concat(o.spacing.m)}),(function(n){return n.isIconButton?"".concat("4rem"):"auto"}),(function(n){return n.isIconButton?"".concat("4rem"):"auto"}))}),(function(o){return o.full&&r(l||(l=n(["\n width: 100%;\n "],["\n width: 100%;\n "])))}),(function(o){return o.css&&r(d||(d=n(["\n ","\n "],["\n ","\n "])),o.css)}));export{s as Spacer,b as StyledButton};
1
+ import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import o,{css as r}from"styled-components";var t,e,c,i,a,l,d,u,s=o.span(t||(t=n(["\n margin-left: ",";\n &:first-of-type {\n margin-left: 0;\n }\n"],["\n margin-left: ",";\n &:first-of-type {\n margin-left: 0;\n }\n"])),(function(n){return n.theme.spacing.xxs})),b=o.button(u||(u=n(["\n box-sizing: border-box;\n min-height: ",";\n display: inline-block;\n vertical-align: middle;\n padding: ",";\n width: ",";\n min-width: ",";\n\n border-radius: ",";\n border-style: solid;\n border-width: ",";\n\n transition: color 0.2s ease, background-color 0.2s ease,\n border-color 0.2s ease;\n\n cursor: pointer;\n font-size: ",";\n font-family: ",";\n font-weight: ",";\n text-align: center;\n text-transform: ",";\n text-decoration: ",";\n\n &:focus-visible {\n outline: auto;\n }\n\n ","\n\n ","\n\n ","\n \n ","\n\n ","\n\n ","\n"],["\n box-sizing: border-box;\n min-height: ",";\n display: inline-block;\n vertical-align: middle;\n padding: ",";\n width: ",";\n min-width: ",";\n\n border-radius: ",";\n border-style: solid;\n border-width: ",";\n\n transition: color 0.2s ease, background-color 0.2s ease,\n border-color 0.2s ease;\n\n cursor: pointer;\n font-size: ",";\n font-family: ",";\n font-weight: ",";\n text-align: center;\n text-transform: ",";\n text-decoration: ",";\n\n &:focus-visible {\n outline: auto;\n }\n\n ","\n\n ","\n\n ","\n \n ","\n\n ","\n\n ","\n"])),"3rem",(function(n){var o=n.theme;return n.isIconButton?"0":"calc( (".concat("3rem"," - ( ").concat(o.button.buttonBorderThickness," * 2) - ").concat(o.typography.lineHeight," ) / 2) ").concat(o.spacing.m)}),(function(n){return n.isIconButton?"".concat("3rem"):"auto"}),(function(n){return n.isIconButton?"".concat("3rem"):"auto"}),(function(n){return n.theme.button.borderRadius}),(function(n){return n.theme.button.buttonBorderThickness}),(function(n){return n.theme.fontSizes.m}),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightMedium}),(function(n){return n.theme.button.textTransform}),(function(n){return n.theme.button.textDecoration}),(function(o){return"primary"===o.appearance&&r(e||(e=n(["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "],["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "])),o.theme.colors.buttonPrimaryBackground,o.theme.colors.buttonPrimaryBorder,o.theme.colors.buttonPrimaryText,o.theme.colors.buttonPrimaryBackgroundHover,o.theme.colors.buttonPrimaryBorderHover,o.theme.colors.buttonPrimaryTextHover,o.theme.colors.buttonPrimaryDisabledBackground,o.theme.colors.buttonPrimaryDisabledText,o.theme.colors.buttonPrimaryDisabledBorder)}),(function(o){return"secondary"===o.appearance&&r(c||(c=n(["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "],["\n background-color: ",";\n border-color: ",";\n color: "," !important;\n :focus,\n :hover {\n background-color: ",";\n border-color: ",";\n color: "," !important;\n }\n :disabled {\n cursor: not-allowed;\n background-color: ",";\n color: "," !important;\n border-color: ",";\n }\n "])),o.theme.colors.buttonSecondaryBackground,o.theme.colors.buttonSecondaryBorder,o.theme.colors.buttonSecondaryText,o.theme.colors.buttonSecondaryBackgroundHover,o.theme.colors.buttonSecondaryBorderHover,o.theme.colors.buttonSecondaryTextHover,o.theme.colors.buttonSecondaryDisabledBackground,o.theme.colors.buttonSecondaryDisabledText,o.theme.colors.buttonSecondaryDisabledBorder)}),(function(o){return"tertiary"===o.appearance&&r(i||(i=n(["\n display: inline-block;\n padding: 0;\n border: 0px;\n background-color: rgba(255, 255, 255, 0);\n transition: color 0.2s ease;\n color: ",";\n :focus,\n :hover {\n color: ",";\n }\n :disabled {\n cursor: not-allowed;\n background-color: transparent;\n color: "," !important;\n border-color: transparent;\n }\n "],["\n display: inline-block;\n padding: 0;\n border: 0px;\n background-color: rgba(255, 255, 255, 0);\n transition: color 0.2s ease;\n color: ",";\n :focus,\n :hover {\n color: ",";\n }\n :disabled {\n cursor: not-allowed;\n background-color: transparent;\n color: "," !important;\n border-color: transparent;\n }\n "])),o.theme.colors.buttonTertiaryText,o.theme.colors.buttonTertiaryTextHover,o.theme.colors.buttonTertiaryDisabledText)}),(function(o){return"l"===o.size&&r(a||(a=n(["\n min-height: ",";\n border-radius: ",";\n padding: ",";\n min-width: ",";\n height: ",";\n "],["\n min-height: ",";\n border-radius: ",";\n padding: ",";\n min-width: ",";\n height: ",";\n "])),"4rem",(function(n){return n.theme.button.borderRadiusLarge}),(function(n){var o=n.theme;return n.isIconButton?"0":"calc( (".concat("4rem"," - ( ").concat(o.button.buttonBorderThickness," * 2) - ").concat(o.typography.lineHeight," ) / 2) ").concat(o.spacing.m)}),(function(n){return n.isIconButton?"".concat("4rem"):"auto"}),(function(n){return n.isIconButton?"".concat("4rem"):"auto"}))}),(function(o){return o.full&&r(l||(l=n(["\n width: 100%;\n "],["\n width: 100%;\n "])))}),(function(o){return o.css&&r(d||(d=n(["\n ","\n "],["\n ","\n "])),o.css)}));export{s as Spacer,b as StyledButton};
2
2
  //# sourceMappingURL=styles.js.map
@@ -0,0 +1,2 @@
1
+ import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t from"react";import{ButtonWrapper as l,DotContainer as n,Dot as r,ScreenReaderOnly as o,CarouselButton as c,VerticalAlign as a}from"./styles.js";var i=function(l){return t.createElement("div",null,t.createElement(c,e({},l,{"aria-label":"previous"}),t.createElement(a,null,"◄",t.createElement(o,null,"Scroll carousel to previous index"))))},u=function(l){return t.createElement("div",null,t.createElement(c,e({},l,{"aria-label":"next"}),t.createElement(a,null,"►",t.createElement(o,null,"Scroll carousel to previous index"))))},m=function(e){var c=e.count,a=e.currentPosition,m=void 0===a?0:a,s=e.scrollToPosition,d=e.next,E=e.previous,f=m!==c-1,v=0!==m,p=Array.from({length:c},(function(e,t){return"arrayIndex".concat(t)}));return t.createElement(l,null,t.createElement(i,{disabled:!v,onClick:E}),t.createElement(n,{count:c},p.map((function(e,l){var n=l===m;return t.createElement(r,{key:e,selected:n,role:"switch","aria-checked":n,onClick:function(){s(l)}},t.createElement(o,null,"Scroll carousel to index ".concat(l)))}))),t.createElement(u,{disabled:!f,onClick:d}))};export{i as CarouselLeftButton,u as CarouselRightButton,m as Dots,m as default};
2
+ //# sourceMappingURL=Dots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dots.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import e,{memo as r,useState as t,useRef as n,useEffect as o}from"react";import{InView as l}from"../../../node_modules/react-intersection-observer/react-intersection-observer.m.js";import i from"../Box/index.js";import{Dots as c}from"./Dots.js";import{CarouselWrapper as s,CarouselScrollArea as a,CarouselCard as u,CarouselCardInner as m}from"./styles.js";var f=function(r){var f=r.startPosition,d=void 0===f?0:f,h=r.children,v=r.onPositionChanged,g=r.shrinkUnselectedPages,E=void 0!==g&&g,p=t(d),P=p[0],x=p[1],y=t(!0),C=y[0],j=y[1],T=n(null),b=e.Children.toArray(h).filter(Boolean),k=function(e){if(T&&T.current){var r=T.current.scrollWidth,t=0===e,n=e===T.current.children.length-1,o=T.current.children[e];if(!o)return;var l=o.offsetLeft;t?T.current.scrollTo(0,0):n?T.current.scrollTo(r,0):T.current.scrollTo(l,0),C||j(!0)}};o((function(){0!==d&&j(!1)}),[d]),o((function(){!1===C&&k(d)}),[C]);var B=1===b.length;return e.createElement(e.Fragment,null,e.createElement(i,null,e.createElement(s,null,e.createElement(a,{ref:T,"aria-live":"assertive",smoothScrolling:C,tabIndex:0},b.map((function(r,t){var n=t===P;return e.createElement(u,{key:t,onlyChild:B},e.createElement(l,{threshold:.5,as:"div",onChange:function(e){var r;e&&P!==(r=t)&&(x(r),v&&v(r))}},e.createElement(m,{onlyChild:B,isSelected:n,shrinkUnselectedPages:E},r)))}))))),b.length>1?e.createElement(i,null,e.createElement(c,{count:b.length,currentPosition:P,scrollToPosition:k,next:function(){k(P+1)},previous:function(){k(P-1)}})):null)},d=r(f);export{f as Carousel,d as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}