@laerdal/life-react-components 2.3.1-dev.1.full → 2.3.1-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/Accordion/ContentAccordion.cjs +3 -5
  2. package/dist/Accordion/ContentAccordion.cjs.map +1 -1
  3. package/dist/Accordion/ContentAccordion.d.ts +1 -1
  4. package/dist/Accordion/ContentAccordion.js +3 -5
  5. package/dist/Accordion/ContentAccordion.js.map +1 -1
  6. package/dist/AuthPage/AuthPage.cjs +21 -43
  7. package/dist/AuthPage/AuthPage.cjs.map +1 -1
  8. package/dist/AuthPage/AuthPage.d.ts +4 -28
  9. package/dist/AuthPage/AuthPage.js +21 -44
  10. package/dist/AuthPage/AuthPage.js.map +1 -1
  11. package/dist/AuthPage/ScreenSetsContainer.cjs +2 -3
  12. package/dist/AuthPage/ScreenSetsContainer.cjs.map +1 -1
  13. package/dist/AuthPage/ScreenSetsContainer.js +2 -3
  14. package/dist/AuthPage/ScreenSetsContainer.js.map +1 -1
  15. package/dist/AuthPage/index.cjs +0 -38
  16. package/dist/AuthPage/index.cjs.map +1 -1
  17. package/dist/AuthPage/index.d.ts +1 -3
  18. package/dist/AuthPage/index.js +1 -3
  19. package/dist/AuthPage/index.js.map +1 -1
  20. package/dist/Banners/Banner.cjs +1 -1
  21. package/dist/Banners/Banner.cjs.map +1 -1
  22. package/dist/Banners/Banner.js +1 -1
  23. package/dist/Banners/Banner.js.map +1 -1
  24. package/dist/Banners/OverviewBanner.cjs +1 -2
  25. package/dist/Banners/OverviewBanner.cjs.map +1 -1
  26. package/dist/Banners/OverviewBanner.js +1 -2
  27. package/dist/Banners/OverviewBanner.js.map +1 -1
  28. package/dist/Footer/Components/FooterNavSection.cjs +1 -1
  29. package/dist/Footer/Components/FooterNavSection.cjs.map +1 -1
  30. package/dist/Footer/Components/FooterNavSection.js +1 -1
  31. package/dist/Footer/Components/FooterNavSection.js.map +1 -1
  32. package/dist/Footer/SiteFooter.cjs +1 -1
  33. package/dist/Footer/SiteFooter.cjs.map +1 -1
  34. package/dist/Footer/SiteFooter.js +1 -1
  35. package/dist/Footer/SiteFooter.js.map +1 -1
  36. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs +12 -7
  37. package/dist/GlobalNavigationBar/GlobalNavigationBar.cjs.map +1 -1
  38. package/dist/GlobalNavigationBar/GlobalNavigationBar.d.ts +2 -1
  39. package/dist/GlobalNavigationBar/GlobalNavigationBar.js +12 -7
  40. package/dist/GlobalNavigationBar/GlobalNavigationBar.js.map +1 -1
  41. package/dist/GlobalNavigationBar/Logo.cjs +3 -3
  42. package/dist/GlobalNavigationBar/Logo.cjs.map +1 -1
  43. package/dist/GlobalNavigationBar/Logo.js +3 -3
  44. package/dist/GlobalNavigationBar/Logo.js.map +1 -1
  45. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs +1 -1
  46. package/dist/GlobalNavigationBar/desktop/DesktopActions.cjs.map +1 -1
  47. package/dist/GlobalNavigationBar/desktop/DesktopActions.js +1 -1
  48. package/dist/GlobalNavigationBar/desktop/DesktopActions.js.map +1 -1
  49. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs +1 -1
  50. package/dist/GlobalNavigationBar/desktop/MainMenu.cjs.map +1 -1
  51. package/dist/GlobalNavigationBar/desktop/MainMenu.js +1 -1
  52. package/dist/GlobalNavigationBar/desktop/MainMenu.js.map +1 -1
  53. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs +1 -1
  54. package/dist/GlobalNavigationBar/desktop/RightSideNav.cjs.map +1 -1
  55. package/dist/GlobalNavigationBar/desktop/RightSideNav.js +1 -1
  56. package/dist/GlobalNavigationBar/desktop/RightSideNav.js.map +1 -1
  57. package/dist/GlobalNavigationBar/desktop/UserMenu.cjs.map +1 -1
  58. package/dist/GlobalNavigationBar/desktop/UserMenu.js.map +1 -1
  59. package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs +2 -2
  60. package/dist/GlobalNavigationBar/mobile/CommonStyles.cjs.map +1 -1
  61. package/dist/GlobalNavigationBar/mobile/CommonStyles.js +3 -5
  62. package/dist/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
  63. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs +1 -1
  64. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.cjs.map +1 -1
  65. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js +2 -2
  66. package/dist/GlobalNavigationBar/mobile/MobileMenuContent.js.map +1 -1
  67. package/dist/InputFields/DatepickerField.d.ts +1 -1
  68. package/dist/InputFields/NumberField.d.ts +1 -1
  69. package/dist/InputFields/PasswordField.d.ts +1 -1
  70. package/dist/InputFields/TextField.d.ts +1 -1
  71. package/dist/Layouts/index.cjs +17 -9
  72. package/dist/Layouts/index.cjs.map +1 -1
  73. package/dist/Layouts/index.d.ts +1 -0
  74. package/dist/Layouts/index.js +17 -9
  75. package/dist/Layouts/index.js.map +1 -1
  76. package/dist/NavItem/NavItem.cjs +2 -6
  77. package/dist/NavItem/NavItem.cjs.map +1 -1
  78. package/dist/NavItem/NavItem.js +3 -7
  79. package/dist/NavItem/NavItem.js.map +1 -1
  80. package/dist/Panel/Panel.cjs +138 -0
  81. package/dist/Panel/Panel.cjs.map +1 -0
  82. package/dist/Panel/Panel.d.ts +29 -0
  83. package/dist/Panel/Panel.js +131 -0
  84. package/dist/Panel/Panel.js.map +1 -0
  85. package/dist/Panel/index.cjs +17 -0
  86. package/dist/Panel/index.cjs.map +1 -0
  87. package/dist/Panel/index.d.ts +1 -0
  88. package/dist/Panel/index.js +2 -0
  89. package/dist/Panel/index.js.map +1 -0
  90. package/dist/Tabs/TabLink.cjs.map +1 -1
  91. package/dist/Tabs/TabLink.js.map +1 -1
  92. package/dist/common/NavigationHelper.cjs +2 -3
  93. package/dist/common/NavigationHelper.cjs.map +1 -1
  94. package/dist/common/NavigationHelper.js +1 -2
  95. package/dist/common/NavigationHelper.js.map +1 -1
  96. package/dist/index.cjs +12 -0
  97. package/dist/index.cjs.map +1 -1
  98. package/dist/index.d.ts +1 -0
  99. package/dist/index.js +1 -0
  100. package/dist/index.js.map +1 -1
  101. package/dist/styles/breakpoints.cjs +2 -4
  102. package/dist/styles/breakpoints.cjs.map +1 -1
  103. package/dist/styles/breakpoints.d.ts +0 -2
  104. package/dist/styles/breakpoints.js +2 -4
  105. package/dist/styles/breakpoints.js.map +1 -1
  106. package/dist/styles/global.cjs +2 -1
  107. package/dist/styles/global.cjs.map +1 -1
  108. package/dist/styles/global.js +2 -1
  109. package/dist/styles/global.js.map +1 -1
  110. package/dist/styles/index.cjs +11 -259
  111. package/dist/styles/index.cjs.map +1 -1
  112. package/dist/styles/index.d.ts +1 -12
  113. package/dist/styles/index.js +1 -12
  114. package/dist/styles/index.js.map +1 -1
  115. package/dist/styles/typography.cjs +53 -301
  116. package/dist/styles/typography.cjs.map +1 -1
  117. package/dist/styles/typography.d.ts +7 -45
  118. package/dist/styles/typography.js +45 -281
  119. package/dist/styles/typography.js.map +1 -1
  120. package/package.json +2 -1
  121. package/dist/AuthPage/Information.cjs +0 -26
  122. package/dist/AuthPage/Information.cjs.map +0 -1
  123. package/dist/AuthPage/Information.d.ts +0 -7
  124. package/dist/AuthPage/Information.js +0 -14
  125. package/dist/AuthPage/Information.js.map +0 -1
  126. package/dist/AuthPage/_AuthPageSection.cjs +0 -15
  127. package/dist/AuthPage/_AuthPageSection.cjs.map +0 -1
  128. package/dist/AuthPage/_AuthPageSection.d.ts +0 -2
  129. package/dist/AuthPage/_AuthPageSection.js +0 -7
  130. package/dist/AuthPage/_AuthPageSection.js.map +0 -1
  131. package/dist/AuthPage/screenSetsErrorMessages.cjs +0 -13
  132. package/dist/AuthPage/screenSetsErrorMessages.cjs.map +0 -1
  133. package/dist/AuthPage/screenSetsErrorMessages.d.ts +0 -5
  134. package/dist/AuthPage/screenSetsErrorMessages.js +0 -6
  135. package/dist/AuthPage/screenSetsErrorMessages.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Size, States, Testable } from '../types';
3
3
  import { TextFieldNote } from './types';
4
- declare const TextField: React.ForwardRefExoticComponent<Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, "pattern" | "type" | "id" | "onChange" | "disabled" | "value" | "autoComplete" | "maxLength" | "readOnly" | "size"> & {
4
+ declare const TextField: React.ForwardRefExoticComponent<Testable & Omit<React.InputHTMLAttributes<HTMLInputElement>, "pattern" | "type" | "id" | "onChange" | "size" | "disabled" | "value" | "autoComplete" | "maxLength" | "readOnly"> & {
5
5
  id?: string | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  readOnly?: boolean | undefined;
@@ -11,18 +11,26 @@ var _styles = require("../styles");
11
11
  var _templateObject, _templateObject2, _templateObject3;
12
12
  var GRID = {
13
13
  GAP: {
14
- SMALL: '24px',
15
- MEDIUM: '32px',
16
- LARGE: '40px'
14
+ SMALL: '16px',
15
+ MEDIUM: '24px',
16
+ LARGE: '32px'
17
17
  },
18
18
  GUTTER: {
19
- SMALL: '16px',
20
- MEDIUM: '32px',
21
- LARGE: '56px'
19
+ SMALL: '16px 16px 32px',
20
+ MEDIUM: '24px 32px 64px',
21
+ LARGE: '32px 64px 128px'
22
22
  }
23
23
  };
24
- var PageWidth = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin: 0 ", ";\n\n ", " {\n margin: 0 ", ";\n }\n ", " {\n margin: 0 ", ";\n }\n\n ", " {\n max-width: ", ";\n margin: 0 auto;\n }\n"])), GRID.GUTTER.SMALL, _styles.BREAKPOINTS.MEDIUM, GRID.GUTTER.MEDIUM, _styles.BREAKPOINTS.LARGE, GRID.GUTTER.LARGE, _styles.BREAKPOINTS.XLARGE, function (props) {
25
- return props.useMaxWidth ? props.maxWidth ? 'min(100% - 112px,' + props.maxWidth + 'px)' : 'calc(100% - 112px)' : '1088px';
24
+ var PageWidth = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin: ", ";\n\n ", "\n ", " {\n margin: ", ";\n ", "\n }\n\n ", " {\n margin: ", ";\n ", "\n }\n\n ", " {\n max-width: ", ";\n\n margin: 32px auto 128px;\n ", "\n\n }\n"])), GRID.GUTTER.SMALL, function (props) {
25
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
26
+ }, _styles.BREAKPOINTS.MEDIUM, GRID.GUTTER.MEDIUM, function (props) {
27
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
28
+ }, _styles.BREAKPOINTS.LARGE, GRID.GUTTER.LARGE, function (props) {
29
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
30
+ }, _styles.BREAKPOINTS.LARGE, function (props) {
31
+ return props.useMaxWidth ? props.maxWidth ? 'min(100% - 128px,' + props.maxWidth + 'px)' : 'calc(100% - 128px)' : 'calc(1600 - 128px)';
32
+ }, function (props) {
33
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
26
34
  });
27
35
  exports.PageWidth = PageWidth;
28
36
  var Columns = _styledComponents.default.section(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: grid;\n grid-gap: ", ";\n word-break: break-word; /* Prevent long words from breaking the layout \u2013 consider making this rule global */\n\n ", " {\n grid-template-columns: ", ";\n -ms-grid-columns: ", ";\n grid-gap: ", ";\n }\n\n ", " {\n grid-gap: ", ";\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n display: -ms-grid;\n\n > *:not(:first-child) {\n margin-left: ", ";\n }\n }\n\n @media print {\n grid-gap: 0;\n grid-template-columns: ", ";\n }\n"])), function (props) {
@@ -39,6 +47,6 @@ var Columns = _styledComponents.default.section(_templateObject2 || (_templateOb
39
47
  return props.printColumns || 'none';
40
48
  });
41
49
  exports.Columns = Columns;
42
- var ContainerMargins = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Small devices (portrait tablets, 576px and up) */\n @media only screen and (min-width: 576px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* Large devices (laptops/desktops, 992px and up) */\n @media only screen and (min-width: 992px) {\n margin: 56px;\n column-gap: 24px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n"])));
50
+ var ContainerMargins = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n"])));
43
51
  exports.ContainerMargins = ContainerMargins;
44
52
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["GRID","GAP","SMALL","MEDIUM","LARGE","GUTTER","PageWidth","styled","div","BREAKPOINTS","XLARGE","props","useMaxWidth","maxWidth","Columns","section","gap","columns","printColumns","ContainerMargins"],"sources":["../../src/Layouts/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { BREAKPOINTS } from '../styles';\n\nconst GRID = {\n GAP: {\n SMALL: '24px',\n MEDIUM: '32px',\n LARGE: '40px',\n },\n GUTTER: {\n SMALL: '16px',\n MEDIUM: '32px',\n LARGE: '56px',\n },\n};\n\nexport const PageWidth = styled.div<{ useMaxWidth?: boolean; maxWidth?: number }>`\n display: block;\n margin: 0 ${GRID.GUTTER.SMALL};\n\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 ${GRID.GUTTER.MEDIUM};\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 ${GRID.GUTTER.LARGE};\n }\n\n ${BREAKPOINTS.XLARGE} {\n max-width: ${(props) => (props.useMaxWidth ? (props.maxWidth ? 'min(100% - 112px,' + props.maxWidth + 'px)' : 'calc(100% - 112px)') : '1088px')};\n margin: 0 auto;\n }\n`;\n\nexport const Columns = styled.section<{ gap?: string; columns?: string; printColumns?: string }>`\n width: 100%;\n display: grid;\n grid-gap: ${(props) => props.gap || GRID.GAP.SMALL};\n word-break: break-word; /* Prevent long words from breaking the layout – consider making this rule global */\n\n ${BREAKPOINTS.MEDIUM} {\n grid-template-columns: ${(props) => props.columns};\n -ms-grid-columns: ${(props) => props.columns};\n grid-gap: ${(props) => props.gap || GRID.GAP.MEDIUM};\n }\n\n ${BREAKPOINTS.LARGE} {\n grid-gap: ${(props) => props.gap || GRID.GAP.LARGE};\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n display: -ms-grid;\n\n > *:not(:first-child) {\n margin-left: ${GRID.GAP.MEDIUM};\n }\n }\n\n @media print {\n grid-gap: 0;\n grid-template-columns: ${(props) => props.printColumns || 'none'};\n }\n`;\n\nexport const ContainerMargins = styled.div`\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Small devices (portrait tablets, 576px and up) */\n @media only screen and (min-width: 576px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* Large devices (laptops/desktops, 992px and up) */\n @media only screen and (min-width: 992px) {\n margin: 56px;\n column-gap: 24px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n`;\n"],"mappings":";;;;;;;;AAAA;AAEA;AAAwC;AAExC,IAAMA,IAAI,GAAG;EACXC,GAAG,EAAE;IACHC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDC,MAAM,EAAE;IACNH,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT;AACF,CAAC;AAEM,IAAME,SAAS,GAAGC,yBAAM,CAACC,GAAG,kQAErBR,IAAI,CAACK,MAAM,CAACH,KAAK,EAE3BO,mBAAW,CAACN,MAAM,EACNH,IAAI,CAACK,MAAM,CAACF,MAAM,EAE9BM,mBAAW,CAACL,KAAK,EACLJ,IAAI,CAACK,MAAM,CAACD,KAAK,EAG7BK,mBAAW,CAACC,MAAM,EACL,UAACC,KAAK;EAAA,OAAMA,KAAK,CAACC,WAAW,GAAID,KAAK,CAACE,QAAQ,GAAG,mBAAmB,GAAGF,KAAK,CAACE,QAAQ,GAAG,KAAK,GAAG,oBAAoB,GAAI,QAAQ;AAAA,CAAC,CAGlJ;AAAC;AAEK,IAAMC,OAAO,GAAGP,yBAAM,CAACQ,OAAO,ooBAGvB,UAACJ,KAAK;EAAA,OAAKA,KAAK,CAACK,GAAG,IAAIhB,IAAI,CAACC,GAAG,CAACC,KAAK;AAAA,GAGhDO,mBAAW,CAACN,MAAM,EACO,UAACQ,KAAK;EAAA,OAAKA,KAAK,CAACM,OAAO;AAAA,GAC7B,UAACN,KAAK;EAAA,OAAKA,KAAK,CAACM,OAAO;AAAA,GAChC,UAACN,KAAK;EAAA,OAAKA,KAAK,CAACK,GAAG,IAAIhB,IAAI,CAACC,GAAG,CAACE,MAAM;AAAA,GAGnDM,mBAAW,CAACL,KAAK,EACL,UAACO,KAAK;EAAA,OAAKA,KAAK,CAACK,GAAG,IAAIhB,IAAI,CAACC,GAAG,CAACG,KAAK;AAAA,GAOjCJ,IAAI,CAACC,GAAG,CAACE,MAAM,EAMP,UAACQ,KAAK;EAAA,OAAKA,KAAK,CAACO,YAAY,IAAI,MAAM;AAAA,EAEnE;AAAC;AAEK,IAAMC,gBAAgB,GAAGZ,yBAAM,CAACC,GAAG,k1BA8BzC;AAAC"}
1
+ {"version":3,"file":"index.cjs","names":["GRID","GAP","SMALL","MEDIUM","LARGE","GUTTER","PageWidth","styled","div","props","unsetMargin","BREAKPOINTS","useMaxWidth","maxWidth","Columns","section","gap","columns","printColumns","ContainerMargins"],"sources":["../../src/Layouts/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport {BREAKPOINTS} from '../styles';\n\nconst GRID = {\n GAP: {\n SMALL: '16px',\n MEDIUM: '24px',\n LARGE: '32px',\n },\n GUTTER: {\n SMALL: '16px 16px 32px',\n MEDIUM: '24px 32px 64px',\n LARGE: '32px 64px 128px',\n },\n};\n\nexport const PageWidth = styled.div<{ useMaxWidth?: boolean; maxWidth?: number; unsetMargin?: boolean; }>`\n display: block;\n margin: ${GRID.GUTTER.SMALL};\n\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n ${BREAKPOINTS.MEDIUM} {\n margin: ${GRID.GUTTER.MEDIUM};\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n }\n\n ${BREAKPOINTS.LARGE} {\n margin: ${GRID.GUTTER.LARGE};\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n }\n\n ${BREAKPOINTS.LARGE} {\n max-width: ${(props) => (\n props.useMaxWidth\n ? (props.maxWidth\n ? 'min(100% - 128px,' + props.maxWidth + 'px)'\n : 'calc(100% - 128px)')\n : 'calc(1600 - 128px)')};\n\n margin: 32px auto 128px;\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n\n }\n`;\n\nexport const Columns = styled.section<{ gap?: string; columns?: string; printColumns?: string }>`\n width: 100%;\n display: grid;\n grid-gap: ${(props) => props.gap || GRID.GAP.SMALL};\n word-break: break-word; /* Prevent long words from breaking the layout – consider making this rule global */\n\n ${BREAKPOINTS.MEDIUM} {\n grid-template-columns: ${(props) => props.columns};\n -ms-grid-columns: ${(props) => props.columns};\n grid-gap: ${(props) => props.gap || GRID.GAP.MEDIUM};\n }\n\n ${BREAKPOINTS.LARGE} {\n grid-gap: ${(props) => props.gap || GRID.GAP.LARGE};\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n display: -ms-grid;\n\n > *:not(:first-child) {\n margin-left: ${GRID.GAP.MEDIUM};\n }\n }\n\n @media print {\n grid-gap: 0;\n grid-template-columns: ${(props) => props.printColumns || 'none'};\n }\n`;\n\nexport const ContainerMargins = styled.div`\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n`;\n"],"mappings":";;;;;;;;AAAA;AAEA;AAAsC;AAEtC,IAAMA,IAAI,GAAG;EACXC,GAAG,EAAE;IACHC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDC,MAAM,EAAE;IACNH,KAAK,EAAE,gBAAgB;IACvBC,MAAM,EAAE,gBAAgB;IACxBC,KAAK,EAAE;EACT;AACF,CAAC;AAEM,IAAME,SAAS,GAAGC,yBAAM,CAACC,GAAG,iTAEvBR,IAAI,CAACK,MAAM,CAACH,KAAK,EAEzB,UAAAO,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,GAChEC,mBAAW,CAACR,MAAM,EACRH,IAAI,CAACK,MAAM,CAACF,MAAM,EAC1B,UAAAM,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,GAGlEC,mBAAW,CAACP,KAAK,EACPJ,IAAI,CAACK,MAAM,CAACD,KAAK,EACzB,UAAAK,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,GAGlEC,mBAAW,CAACP,KAAK,EACJ,UAACK,KAAK;EAAA,OACXA,KAAK,CAACG,WAAW,GACNH,KAAK,CAACI,QAAQ,GACP,mBAAmB,GAAGJ,KAAK,CAACI,QAAQ,GAAG,KAAK,GAC5C,oBAAoB,GAC5B,oBAAoB;AAAA,CAAC,EAGrC,UAAAJ,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,EAGrE;AAAC;AAEK,IAAMI,OAAO,GAAGP,yBAAM,CAACQ,OAAO,ooBAGvB,UAACN,KAAK;EAAA,OAAKA,KAAK,CAACO,GAAG,IAAIhB,IAAI,CAACC,GAAG,CAACC,KAAK;AAAA,GAGhDS,mBAAW,CAACR,MAAM,EACO,UAACM,KAAK;EAAA,OAAKA,KAAK,CAACQ,OAAO;AAAA,GAC7B,UAACR,KAAK;EAAA,OAAKA,KAAK,CAACQ,OAAO;AAAA,GAChC,UAACR,KAAK;EAAA,OAAKA,KAAK,CAACO,GAAG,IAAIhB,IAAI,CAACC,GAAG,CAACE,MAAM;AAAA,GAGnDQ,mBAAW,CAACP,KAAK,EACL,UAACK,KAAK;EAAA,OAAKA,KAAK,CAACO,GAAG,IAAIhB,IAAI,CAACC,GAAG,CAACG,KAAK;AAAA,GAOjCJ,IAAI,CAACC,GAAG,CAACE,MAAM,EAMP,UAACM,KAAK;EAAA,OAAKA,KAAK,CAACS,YAAY,IAAI,MAAM;AAAA,EAEnE;AAAC;AAEK,IAAMC,gBAAgB,GAAGZ,yBAAM,CAACC,GAAG,kiBAkBzC;AAAC"}
@@ -1,6 +1,7 @@
1
1
  export declare const PageWidth: import("styled-components").StyledComponent<"div", any, {
2
2
  useMaxWidth?: boolean | undefined;
3
3
  maxWidth?: number | undefined;
4
+ unsetMargin?: boolean | undefined;
4
5
  }, never>;
5
6
  export declare const Columns: import("styled-components").StyledComponent<"section", any, {
6
7
  gap?: string | undefined;
@@ -4,18 +4,26 @@ import styled from 'styled-components';
4
4
  import { BREAKPOINTS } from '../styles';
5
5
  var GRID = {
6
6
  GAP: {
7
- SMALL: '24px',
8
- MEDIUM: '32px',
9
- LARGE: '40px'
7
+ SMALL: '16px',
8
+ MEDIUM: '24px',
9
+ LARGE: '32px'
10
10
  },
11
11
  GUTTER: {
12
- SMALL: '16px',
13
- MEDIUM: '32px',
14
- LARGE: '56px'
12
+ SMALL: '16px 16px 32px',
13
+ MEDIUM: '24px 32px 64px',
14
+ LARGE: '32px 64px 128px'
15
15
  }
16
16
  };
17
- export var PageWidth = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n margin: 0 ", ";\n\n ", " {\n margin: 0 ", ";\n }\n ", " {\n margin: 0 ", ";\n }\n\n ", " {\n max-width: ", ";\n margin: 0 auto;\n }\n"])), GRID.GUTTER.SMALL, BREAKPOINTS.MEDIUM, GRID.GUTTER.MEDIUM, BREAKPOINTS.LARGE, GRID.GUTTER.LARGE, BREAKPOINTS.XLARGE, function (props) {
18
- return props.useMaxWidth ? props.maxWidth ? 'min(100% - 112px,' + props.maxWidth + 'px)' : 'calc(100% - 112px)' : '1088px';
17
+ export var PageWidth = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n margin: ", ";\n\n ", "\n ", " {\n margin: ", ";\n ", "\n }\n\n ", " {\n margin: ", ";\n ", "\n }\n\n ", " {\n max-width: ", ";\n\n margin: 32px auto 128px;\n ", "\n\n }\n"])), GRID.GUTTER.SMALL, function (props) {
18
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
19
+ }, BREAKPOINTS.MEDIUM, GRID.GUTTER.MEDIUM, function (props) {
20
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
21
+ }, BREAKPOINTS.LARGE, GRID.GUTTER.LARGE, function (props) {
22
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
23
+ }, BREAKPOINTS.LARGE, function (props) {
24
+ return props.useMaxWidth ? props.maxWidth ? 'min(100% - 128px,' + props.maxWidth + 'px)' : 'calc(100% - 128px)' : 'calc(1600 - 128px)';
25
+ }, function (props) {
26
+ return props.unsetMargin && 'margin-top: 0; margin-bottom: 0;';
19
27
  });
20
28
  export var Columns = styled.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n display: grid;\n grid-gap: ", ";\n word-break: break-word; /* Prevent long words from breaking the layout \u2013 consider making this rule global */\n\n ", " {\n grid-template-columns: ", ";\n -ms-grid-columns: ", ";\n grid-gap: ", ";\n }\n\n ", " {\n grid-gap: ", ";\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n display: -ms-grid;\n\n > *:not(:first-child) {\n margin-left: ", ";\n }\n }\n\n @media print {\n grid-gap: 0;\n grid-template-columns: ", ";\n }\n"])), function (props) {
21
29
  return props.gap || GRID.GAP.SMALL;
@@ -30,5 +38,5 @@ export var Columns = styled.section(_templateObject2 || (_templateObject2 = _tag
30
38
  }, GRID.GAP.MEDIUM, function (props) {
31
39
  return props.printColumns || 'none';
32
40
  });
33
- export var ContainerMargins = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Small devices (portrait tablets, 576px and up) */\n @media only screen and (min-width: 576px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* Large devices (laptops/desktops, 992px and up) */\n @media only screen and (min-width: 992px) {\n margin: 56px;\n column-gap: 24px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n"])));
41
+ export var ContainerMargins = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n"])));
34
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["styled","BREAKPOINTS","GRID","GAP","SMALL","MEDIUM","LARGE","GUTTER","PageWidth","div","XLARGE","props","useMaxWidth","maxWidth","Columns","section","gap","columns","printColumns","ContainerMargins"],"sources":["../../src/Layouts/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport { BREAKPOINTS } from '../styles';\n\nconst GRID = {\n GAP: {\n SMALL: '24px',\n MEDIUM: '32px',\n LARGE: '40px',\n },\n GUTTER: {\n SMALL: '16px',\n MEDIUM: '32px',\n LARGE: '56px',\n },\n};\n\nexport const PageWidth = styled.div<{ useMaxWidth?: boolean; maxWidth?: number }>`\n display: block;\n margin: 0 ${GRID.GUTTER.SMALL};\n\n ${BREAKPOINTS.MEDIUM} {\n margin: 0 ${GRID.GUTTER.MEDIUM};\n }\n ${BREAKPOINTS.LARGE} {\n margin: 0 ${GRID.GUTTER.LARGE};\n }\n\n ${BREAKPOINTS.XLARGE} {\n max-width: ${(props) => (props.useMaxWidth ? (props.maxWidth ? 'min(100% - 112px,' + props.maxWidth + 'px)' : 'calc(100% - 112px)') : '1088px')};\n margin: 0 auto;\n }\n`;\n\nexport const Columns = styled.section<{ gap?: string; columns?: string; printColumns?: string }>`\n width: 100%;\n display: grid;\n grid-gap: ${(props) => props.gap || GRID.GAP.SMALL};\n word-break: break-word; /* Prevent long words from breaking the layout – consider making this rule global */\n\n ${BREAKPOINTS.MEDIUM} {\n grid-template-columns: ${(props) => props.columns};\n -ms-grid-columns: ${(props) => props.columns};\n grid-gap: ${(props) => props.gap || GRID.GAP.MEDIUM};\n }\n\n ${BREAKPOINTS.LARGE} {\n grid-gap: ${(props) => props.gap || GRID.GAP.LARGE};\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n display: -ms-grid;\n\n > *:not(:first-child) {\n margin-left: ${GRID.GAP.MEDIUM};\n }\n }\n\n @media print {\n grid-gap: 0;\n grid-template-columns: ${(props) => props.printColumns || 'none'};\n }\n`;\n\nexport const ContainerMargins = styled.div`\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Small devices (portrait tablets, 576px and up) */\n @media only screen and (min-width: 576px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* Large devices (laptops/desktops, 992px and up) */\n @media only screen and (min-width: 992px) {\n margin: 56px;\n column-gap: 24px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n`;\n"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,SAASC,WAAW,QAAQ,WAAW;AAEvC,IAAMC,IAAI,GAAG;EACXC,GAAG,EAAE;IACHC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDC,MAAM,EAAE;IACNH,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT;AACF,CAAC;AAED,OAAO,IAAME,SAAS,GAAGR,MAAM,CAACS,GAAG,oPAErBP,IAAI,CAACK,MAAM,CAACH,KAAK,EAE3BH,WAAW,CAACI,MAAM,EACNH,IAAI,CAACK,MAAM,CAACF,MAAM,EAE9BJ,WAAW,CAACK,KAAK,EACLJ,IAAI,CAACK,MAAM,CAACD,KAAK,EAG7BL,WAAW,CAACS,MAAM,EACL,UAACC,KAAK;EAAA,OAAMA,KAAK,CAACC,WAAW,GAAID,KAAK,CAACE,QAAQ,GAAG,mBAAmB,GAAGF,KAAK,CAACE,QAAQ,GAAG,KAAK,GAAG,oBAAoB,GAAI,QAAQ;AAAA,CAAC,CAGlJ;AAED,OAAO,IAAMC,OAAO,GAAGd,MAAM,CAACe,OAAO,snBAGvB,UAACJ,KAAK;EAAA,OAAKA,KAAK,CAACK,GAAG,IAAId,IAAI,CAACC,GAAG,CAACC,KAAK;AAAA,GAGhDH,WAAW,CAACI,MAAM,EACO,UAACM,KAAK;EAAA,OAAKA,KAAK,CAACM,OAAO;AAAA,GAC7B,UAACN,KAAK;EAAA,OAAKA,KAAK,CAACM,OAAO;AAAA,GAChC,UAACN,KAAK;EAAA,OAAKA,KAAK,CAACK,GAAG,IAAId,IAAI,CAACC,GAAG,CAACE,MAAM;AAAA,GAGnDJ,WAAW,CAACK,KAAK,EACL,UAACK,KAAK;EAAA,OAAKA,KAAK,CAACK,GAAG,IAAId,IAAI,CAACC,GAAG,CAACG,KAAK;AAAA,GAOjCJ,IAAI,CAACC,GAAG,CAACE,MAAM,EAMP,UAACM,KAAK;EAAA,OAAKA,KAAK,CAACO,YAAY,IAAI,MAAM;AAAA,EAEnE;AAED,OAAO,IAAMC,gBAAgB,GAAGnB,MAAM,CAACS,GAAG,o0BA8BzC"}
1
+ {"version":3,"file":"index.js","names":["styled","BREAKPOINTS","GRID","GAP","SMALL","MEDIUM","LARGE","GUTTER","PageWidth","div","props","unsetMargin","useMaxWidth","maxWidth","Columns","section","gap","columns","printColumns","ContainerMargins"],"sources":["../../src/Layouts/index.ts"],"sourcesContent":["import styled from 'styled-components';\n\nimport {BREAKPOINTS} from '../styles';\n\nconst GRID = {\n GAP: {\n SMALL: '16px',\n MEDIUM: '24px',\n LARGE: '32px',\n },\n GUTTER: {\n SMALL: '16px 16px 32px',\n MEDIUM: '24px 32px 64px',\n LARGE: '32px 64px 128px',\n },\n};\n\nexport const PageWidth = styled.div<{ useMaxWidth?: boolean; maxWidth?: number; unsetMargin?: boolean; }>`\n display: block;\n margin: ${GRID.GUTTER.SMALL};\n\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n ${BREAKPOINTS.MEDIUM} {\n margin: ${GRID.GUTTER.MEDIUM};\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n }\n\n ${BREAKPOINTS.LARGE} {\n margin: ${GRID.GUTTER.LARGE};\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n }\n\n ${BREAKPOINTS.LARGE} {\n max-width: ${(props) => (\n props.useMaxWidth\n ? (props.maxWidth\n ? 'min(100% - 128px,' + props.maxWidth + 'px)'\n : 'calc(100% - 128px)')\n : 'calc(1600 - 128px)')};\n\n margin: 32px auto 128px;\n ${props => props.unsetMargin && 'margin-top: 0; margin-bottom: 0;'}\n\n }\n`;\n\nexport const Columns = styled.section<{ gap?: string; columns?: string; printColumns?: string }>`\n width: 100%;\n display: grid;\n grid-gap: ${(props) => props.gap || GRID.GAP.SMALL};\n word-break: break-word; /* Prevent long words from breaking the layout – consider making this rule global */\n\n ${BREAKPOINTS.MEDIUM} {\n grid-template-columns: ${(props) => props.columns};\n -ms-grid-columns: ${(props) => props.columns};\n grid-gap: ${(props) => props.gap || GRID.GAP.MEDIUM};\n }\n\n ${BREAKPOINTS.LARGE} {\n grid-gap: ${(props) => props.gap || GRID.GAP.LARGE};\n }\n\n @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n display: -ms-grid;\n\n > *:not(:first-child) {\n margin-left: ${GRID.GAP.MEDIUM};\n }\n }\n\n @media print {\n grid-gap: 0;\n grid-template-columns: ${(props) => props.printColumns || 'none'};\n }\n`;\n\nexport const ContainerMargins = styled.div`\n /* X small devices (mobile phones, 320px and up) */\n @media only screen and (min-width: 320px) {\n margin: 16px;\n column-gap: 16px;\n }\n\n /* Medium devices (landscape tablets, 768px and up) */\n @media only screen and (min-width: 768px) {\n margin: 32px;\n column-gap: 32px;\n }\n\n /* X large devices (laptops/desktops, 1200px and up) */\n @media only screen and (min-width: 1200px) {\n margin: 56px;\n column-gap: 40px;\n }\n`;\n"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,SAAQC,WAAW,QAAO,WAAW;AAErC,IAAMC,IAAI,GAAG;EACXC,GAAG,EAAE;IACHC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE;EACT,CAAC;EACDC,MAAM,EAAE;IACNH,KAAK,EAAE,gBAAgB;IACvBC,MAAM,EAAE,gBAAgB;IACxBC,KAAK,EAAE;EACT;AACF,CAAC;AAED,OAAO,IAAME,SAAS,GAAGR,MAAM,CAACS,GAAG,mSAEvBP,IAAI,CAACK,MAAM,CAACH,KAAK,EAEzB,UAAAM,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,GAChEV,WAAW,CAACI,MAAM,EACRH,IAAI,CAACK,MAAM,CAACF,MAAM,EAC1B,UAAAK,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,GAGlEV,WAAW,CAACK,KAAK,EACPJ,IAAI,CAACK,MAAM,CAACD,KAAK,EACzB,UAAAI,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,GAGlEV,WAAW,CAACK,KAAK,EACJ,UAACI,KAAK;EAAA,OACXA,KAAK,CAACE,WAAW,GACNF,KAAK,CAACG,QAAQ,GACP,mBAAmB,GAAGH,KAAK,CAACG,QAAQ,GAAG,KAAK,GAC5C,oBAAoB,GAC5B,oBAAoB;AAAA,CAAC,EAGrC,UAAAH,KAAK;EAAA,OAAIA,KAAK,CAACC,WAAW,IAAI,kCAAkC;AAAA,EAGrE;AAED,OAAO,IAAMG,OAAO,GAAGd,MAAM,CAACe,OAAO,snBAGvB,UAACL,KAAK;EAAA,OAAKA,KAAK,CAACM,GAAG,IAAId,IAAI,CAACC,GAAG,CAACC,KAAK;AAAA,GAGhDH,WAAW,CAACI,MAAM,EACO,UAACK,KAAK;EAAA,OAAKA,KAAK,CAACO,OAAO;AAAA,GAC7B,UAACP,KAAK;EAAA,OAAKA,KAAK,CAACO,OAAO;AAAA,GAChC,UAACP,KAAK;EAAA,OAAKA,KAAK,CAACM,GAAG,IAAId,IAAI,CAACC,GAAG,CAACE,MAAM;AAAA,GAGnDJ,WAAW,CAACK,KAAK,EACL,UAACI,KAAK;EAAA,OAAKA,KAAK,CAACM,GAAG,IAAId,IAAI,CAACC,GAAG,CAACG,KAAK;AAAA,GAOjCJ,IAAI,CAACC,GAAG,CAACE,MAAM,EAMP,UAACK,KAAK;EAAA,OAAKA,KAAK,CAACQ,YAAY,IAAI,MAAM;AAAA,EAEnE;AAED,OAAO,IAAMC,gBAAgB,GAAGnB,MAAM,CAACS,GAAG,ohBAkBzC"}
@@ -13,17 +13,13 @@ var _react = _interopRequireDefault(require("react"));
13
13
  var _styles = require("../styles");
14
14
  var _typography = require("../styles/typography");
15
15
  var _zIndexes = require("../styles/z-indexes");
16
- var _common = require("../common");
17
16
  var _jsxRuntime = require("react/jsx-runtime");
18
17
  var _templateObject;
19
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
19
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
- var NavItemDiv = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 3px;\n background-color: transparent;\n }\n\n &.active:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n &:after {\n background-color: ", ";\n }\n }\n\n &.disabled {\n color: ", ";\n background-color: ", ";\n &:after {\n background-color: ", ";\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n &:after {\n background-color: ", ";\n }\n }\n\n &.focus-visible {\n ", "\n }\n"])), (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.neutral_600), _zIndexes.Z_INDEXES.active, _styles.COLORS.neutral_20, _styles.COLORS.neutral_800, _styles.COLORS.primary_600, _styles.COLORS.neutral_300, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_600, _styles.focusStyles);
20
+ var NavItemDiv = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n ", " {\n height: 80px;\n }\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n background-color: transparent;\n height: 3px;\n border-radius: 3px;\n left: 2px;\n right: 2px;\n bottom: 2px;\n }\n\n &.active:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n &.disabled {\n color: ", ";\n background-color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n &:active:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n\n &:focus:not(.disabled) {\n ", "\n outline-offset: -4px;\n }\n"])), (0, _typography.ComponentMStyling)(_typography.ComponentTextStyle.Regular, _styles.COLORS.neutral_600), _styles.BREAKPOINTS.LARGE, _zIndexes.Z_INDEXES.active, _styles.COLORS.neutral_20, _styles.COLORS.neutral_800, _styles.COLORS.primary_600, _styles.COLORS.neutral_300, _styles.COLORS.neutral_100, _styles.COLORS.neutral_100, _zIndexes.Z_INDEXES.hover, _styles.COLORS.primary_20, _styles.COLORS.primary_700, _styles.COLORS.primary_700, _zIndexes.Z_INDEXES.active, _styles.COLORS.primary_100, _styles.COLORS.primary_800, _styles.COLORS.primary_800, _styles.focusStyles);
22
21
  var NavItem = function NavItem(props) {
23
- var focusVisibleRef = (0, _common.useFocusVisibleRef)();
24
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(NavItemDiv, _objectSpread(_objectSpread({}, props), {}, {
25
- ref: focusVisibleRef
26
- }));
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(NavItemDiv, _objectSpread({}, props));
27
23
  };
28
24
  var _default = NavItem;
29
25
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"NavItem.cjs","names":["NavItemDiv","styled","div","ComponentMStyling","ComponentTextStyle","Regular","COLORS","neutral_600","Z_INDEXES","active","neutral_20","neutral_800","primary_600","neutral_300","neutral_100","hover","primary_20","primary_700","focusStyles","NavItem","props","focusVisibleRef","useFocusVisibleRef"],"sources":["../../src/NavItem/NavItem.tsx"],"sourcesContent":["import styled, { StyledComponentProps } from 'styled-components';\nimport React from 'react';\nimport {COLORS, focusStyles} from '../styles';\nimport { ComponentMStyling, ComponentTextStyle } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport { useFocusVisibleRef } from '../common';\n\nexport type StyledComponentPropsWithAs<\n C extends string | React.ComponentType<any>,\n T extends object,\n O extends object,\n A extends keyof any,\n AsC extends string | React.ComponentType<any> = C,\n FAsC extends string | React.ComponentType<any> = C\n> = StyledComponentProps<C, T, O, A, FAsC> & { as?: AsC | undefined; forwardedAs?: FAsC | undefined };\n\n\nconst NavItemDiv = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 3px;\n background-color: transparent;\n }\n\n &.active:not(.disabled) {\n z-index: ${Z_INDEXES.active};\n background-color: ${COLORS.neutral_20};\n color: ${COLORS.neutral_800};\n &:after {\n background-color: ${COLORS.primary_600};\n }\n }\n\n &.disabled {\n color: ${COLORS.neutral_300};\n background-color: ${COLORS.neutral_100};\n &:after {\n background-color: ${COLORS.neutral_100};\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ${Z_INDEXES.hover};\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n &:after {\n background-color: ${COLORS.primary_600};\n }\n }\n\n &.focus-visible {\n ${focusStyles}\n }\n`;\n\n\nconst NavItem = (props: StyledComponentPropsWithAs<string | React.ComponentType<any>, any, {}, never, string | React.ComponentType<any>, \"div\">) => {\n const focusVisibleRef = useFocusVisibleRef();\n return (\n <NavItemDiv {...props} ref={focusVisibleRef} />\n );\n};\n\nexport default NavItem;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAA+C;AAAA;AAAA;AAAA;AAY/C,IAAMA,UAAU,GAAGC,yBAAM,CAACC,GAAG,m4BACzB,IAAAC,6BAAiB,EAACC,8BAAkB,CAACC,OAAO,EAAEC,cAAM,CAACC,WAAW,CAAC,EAuBtDC,mBAAS,CAACC,MAAM,EACPH,cAAM,CAACI,UAAU,EAC5BJ,cAAM,CAACK,WAAW,EAELL,cAAM,CAACM,WAAW,EAK/BN,cAAM,CAACO,WAAW,EACPP,cAAM,CAACQ,WAAW,EAEhBR,cAAM,CAACQ,WAAW,EAK7BN,mBAAS,CAACO,KAAK,EACNT,cAAM,CAACU,UAAU,EAC5BV,cAAM,CAACW,WAAW,EAELX,cAAM,CAACM,WAAW,EAKtCM,mBAAW,CAEhB;AAGD,IAAMC,OAAO,GAAG,SAAVA,OAAO,CAAIC,KAA8H,EAAK;EAClJ,IAAMC,eAAe,GAAG,IAAAC,0BAAkB,GAAE;EAC5C,oBACE,qBAAC,UAAU,kCAAKF,KAAK;IAAE,GAAG,EAAEC;EAAgB,GAAG;AAEnD,CAAC;AAAC,eAEaF,OAAO;AAAA"}
1
+ {"version":3,"file":"NavItem.cjs","names":["NavItemDiv","styled","div","ComponentMStyling","ComponentTextStyle","Regular","COLORS","neutral_600","BREAKPOINTS","LARGE","Z_INDEXES","active","neutral_20","neutral_800","primary_600","neutral_300","neutral_100","hover","primary_20","primary_700","primary_100","primary_800","focusStyles","NavItem","props"],"sources":["../../src/NavItem/NavItem.tsx"],"sourcesContent":["import styled, {StyledComponentProps} from 'styled-components';\nimport React from 'react';\nimport {BREAKPOINTS, COLORS, focusStyles} from '../styles';\nimport {ComponentMStyling, ComponentTextStyle} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {useFocusVisibleRef} from '../common';\n\nexport type StyledComponentPropsWithAs<\n C extends string | React.ComponentType<any>,\n T extends object,\n O extends object,\n A extends keyof any,\n AsC extends string | React.ComponentType<any> = C,\n FAsC extends string | React.ComponentType<any> = C\n> = StyledComponentProps<C, T, O, A, FAsC> & { as?: AsC | undefined; forwardedAs?: FAsC | undefined };\n\n\nconst NavItemDiv = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n ${BREAKPOINTS.LARGE} {\n height: 80px;\n }\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n background-color: transparent;\n height: 3px;\n border-radius: 3px;\n left: 2px;\n right: 2px;\n bottom: 2px;\n }\n\n &.active:not(.disabled) {\n z-index: ${Z_INDEXES.active};\n background-color: ${COLORS.neutral_20};\n color: ${COLORS.neutral_800};\n\n &:after {\n background-color: ${COLORS.primary_600};\n }\n }\n\n &.disabled {\n color: ${COLORS.neutral_300};\n background-color: ${COLORS.neutral_100};\n\n &:after {\n background-color: ${COLORS.neutral_100};\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ${Z_INDEXES.hover};\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n\n &:after {\n background-color: ${COLORS.primary_700};\n }\n }\n\n &:active:not(.disabled) {\n z-index: ${Z_INDEXES.active};\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n\n &:after {\n background-color: ${COLORS.primary_800};\n }\n }\n\n\n &:focus:not(.disabled) {\n ${focusStyles}\n outline-offset: -4px;\n }\n`;\n\n\nconst NavItem = (props: StyledComponentPropsWithAs<string | React.ComponentType<any>, any, {}, never, string | React.ComponentType<any>, \"div\">) => {\n return (\n <NavItemDiv {...props} />\n );\n};\n\nexport default NavItem;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAAA;AAAA;AAa9C,IAAMA,UAAU,GAAGC,yBAAM,CAACC,GAAG,8oCACzB,IAAAC,6BAAiB,EAACC,8BAAkB,CAACC,OAAO,EAAEC,cAAM,CAACC,WAAW,CAAC,EAMjEC,mBAAW,CAACC,KAAK,EAsBNC,mBAAS,CAACC,MAAM,EACPL,cAAM,CAACM,UAAU,EAC5BN,cAAM,CAACO,WAAW,EAGLP,cAAM,CAACQ,WAAW,EAK/BR,cAAM,CAACS,WAAW,EACPT,cAAM,CAACU,WAAW,EAGhBV,cAAM,CAACU,WAAW,EAK7BN,mBAAS,CAACO,KAAK,EACNX,cAAM,CAACY,UAAU,EAC5BZ,cAAM,CAACa,WAAW,EAGLb,cAAM,CAACa,WAAW,EAK7BT,mBAAS,CAACC,MAAM,EACPL,cAAM,CAACc,WAAW,EAC7Bd,cAAM,CAACe,WAAW,EAGLf,cAAM,CAACe,WAAW,EAMtCC,mBAAW,CAGhB;AAGD,IAAMC,OAAO,GAAG,SAAVA,OAAO,CAAIC,KAA8H,EAAK;EAClJ,oBACE,qBAAC,UAAU,oBAAKA,KAAK,EAAI;AAE7B,CAAC;AAAC,eAEaD,OAAO;AAAA"}
@@ -6,17 +6,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  import styled from 'styled-components';
8
8
  import React from 'react';
9
- import { COLORS, focusStyles } from '../styles';
9
+ import { BREAKPOINTS, COLORS, focusStyles } from '../styles';
10
10
  import { ComponentMStyling, ComponentTextStyle } from '../styles/typography';
11
11
  import { Z_INDEXES } from '../styles/z-indexes';
12
- import { useFocusVisibleRef } from '../common';
13
12
  import { jsx as _jsx } from "react/jsx-runtime";
14
- var NavItemDiv = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 3px;\n background-color: transparent;\n }\n\n &.active:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n &:after {\n background-color: ", ";\n }\n }\n\n &.disabled {\n color: ", ";\n background-color: ", ";\n &:after {\n background-color: ", ";\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n &:after {\n background-color: ", ";\n }\n }\n\n &.focus-visible {\n ", "\n }\n"])), ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600), Z_INDEXES.active, COLORS.neutral_20, COLORS.neutral_800, COLORS.primary_600, COLORS.neutral_300, COLORS.neutral_100, COLORS.neutral_100, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, COLORS.primary_600, focusStyles);
13
+ var NavItemDiv = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n ", " {\n height: 80px;\n }\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n background-color: transparent;\n height: 3px;\n border-radius: 3px;\n left: 2px;\n right: 2px;\n bottom: 2px;\n }\n\n &.active:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n &.disabled {\n color: ", ";\n background-color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n &:active:not(.disabled) {\n z-index: ", ";\n background-color: ", ";\n color: ", ";\n\n &:after {\n background-color: ", ";\n }\n }\n\n\n &:focus:not(.disabled) {\n ", "\n outline-offset: -4px;\n }\n"])), ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600), BREAKPOINTS.LARGE, Z_INDEXES.active, COLORS.neutral_20, COLORS.neutral_800, COLORS.primary_600, COLORS.neutral_300, COLORS.neutral_100, COLORS.neutral_100, Z_INDEXES.hover, COLORS.primary_20, COLORS.primary_700, COLORS.primary_700, Z_INDEXES.active, COLORS.primary_100, COLORS.primary_800, COLORS.primary_800, focusStyles);
15
14
  var NavItem = function NavItem(props) {
16
- var focusVisibleRef = useFocusVisibleRef();
17
- return /*#__PURE__*/_jsx(NavItemDiv, _objectSpread(_objectSpread({}, props), {}, {
18
- ref: focusVisibleRef
19
- }));
15
+ return /*#__PURE__*/_jsx(NavItemDiv, _objectSpread({}, props));
20
16
  };
21
17
  export default NavItem;
22
18
  //# sourceMappingURL=NavItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavItem.js","names":["styled","React","COLORS","focusStyles","ComponentMStyling","ComponentTextStyle","Z_INDEXES","useFocusVisibleRef","NavItemDiv","div","Regular","neutral_600","active","neutral_20","neutral_800","primary_600","neutral_300","neutral_100","hover","primary_20","primary_700","NavItem","props","focusVisibleRef"],"sources":["../../src/NavItem/NavItem.tsx"],"sourcesContent":["import styled, { StyledComponentProps } from 'styled-components';\nimport React from 'react';\nimport {COLORS, focusStyles} from '../styles';\nimport { ComponentMStyling, ComponentTextStyle } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport { useFocusVisibleRef } from '../common';\n\nexport type StyledComponentPropsWithAs<\n C extends string | React.ComponentType<any>,\n T extends object,\n O extends object,\n A extends keyof any,\n AsC extends string | React.ComponentType<any> = C,\n FAsC extends string | React.ComponentType<any> = C\n> = StyledComponentProps<C, T, O, A, FAsC> & { as?: AsC | undefined; forwardedAs?: FAsC | undefined };\n\n\nconst NavItemDiv = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n height: 3px;\n background-color: transparent;\n }\n\n &.active:not(.disabled) {\n z-index: ${Z_INDEXES.active};\n background-color: ${COLORS.neutral_20};\n color: ${COLORS.neutral_800};\n &:after {\n background-color: ${COLORS.primary_600};\n }\n }\n\n &.disabled {\n color: ${COLORS.neutral_300};\n background-color: ${COLORS.neutral_100};\n &:after {\n background-color: ${COLORS.neutral_100};\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ${Z_INDEXES.hover};\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n &:after {\n background-color: ${COLORS.primary_600};\n }\n }\n\n &.focus-visible {\n ${focusStyles}\n }\n`;\n\n\nconst NavItem = (props: StyledComponentPropsWithAs<string | React.ComponentType<any>, any, {}, never, string | React.ComponentType<any>, \"div\">) => {\n const focusVisibleRef = useFocusVisibleRef();\n return (\n <NavItemDiv {...props} ref={focusVisibleRef} />\n );\n};\n\nexport default NavItem;\n"],"mappings":";;;;;;AAAA,OAAOA,MAAM,MAAgC,mBAAmB;AAChE,OAAOC,KAAK,MAAM,OAAO;AACzB,SAAQC,MAAM,EAAEC,WAAW,QAAO,WAAW;AAC7C,SAASC,iBAAiB,EAAEC,kBAAkB,QAAQ,sBAAsB;AAC5E,SAAQC,SAAS,QAAO,qBAAqB;AAC7C,SAASC,kBAAkB,QAAQ,WAAW;AAAC;AAY/C,IAAMC,UAAU,GAAGR,MAAM,CAACS,GAAG,q3BACzBL,iBAAiB,CAACC,kBAAkB,CAACK,OAAO,EAAER,MAAM,CAACS,WAAW,CAAC,EAuBtDL,SAAS,CAACM,MAAM,EACPV,MAAM,CAACW,UAAU,EAC5BX,MAAM,CAACY,WAAW,EAELZ,MAAM,CAACa,WAAW,EAK/Bb,MAAM,CAACc,WAAW,EACPd,MAAM,CAACe,WAAW,EAEhBf,MAAM,CAACe,WAAW,EAK7BX,SAAS,CAACY,KAAK,EACNhB,MAAM,CAACiB,UAAU,EAC5BjB,MAAM,CAACkB,WAAW,EAELlB,MAAM,CAACa,WAAW,EAKtCZ,WAAW,CAEhB;AAGD,IAAMkB,OAAO,GAAG,SAAVA,OAAO,CAAIC,KAA8H,EAAK;EAClJ,IAAMC,eAAe,GAAGhB,kBAAkB,EAAE;EAC5C,oBACE,KAAC,UAAU,kCAAKe,KAAK;IAAE,GAAG,EAAEC;EAAgB,GAAG;AAEnD,CAAC;AAED,eAAeF,OAAO"}
1
+ {"version":3,"file":"NavItem.js","names":["styled","React","BREAKPOINTS","COLORS","focusStyles","ComponentMStyling","ComponentTextStyle","Z_INDEXES","NavItemDiv","div","Regular","neutral_600","LARGE","active","neutral_20","neutral_800","primary_600","neutral_300","neutral_100","hover","primary_20","primary_700","primary_100","primary_800","NavItem","props"],"sources":["../../src/NavItem/NavItem.tsx"],"sourcesContent":["import styled, {StyledComponentProps} from 'styled-components';\nimport React from 'react';\nimport {BREAKPOINTS, COLORS, focusStyles} from '../styles';\nimport {ComponentMStyling, ComponentTextStyle} from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\nimport {useFocusVisibleRef} from '../common';\n\nexport type StyledComponentPropsWithAs<\n C extends string | React.ComponentType<any>,\n T extends object,\n O extends object,\n A extends keyof any,\n AsC extends string | React.ComponentType<any> = C,\n FAsC extends string | React.ComponentType<any> = C\n> = StyledComponentProps<C, T, O, A, FAsC> & { as?: AsC | undefined; forwardedAs?: FAsC | undefined };\n\n\nconst NavItemDiv = styled.div`\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n margin: 0;\n padding: 0 21px 0 21px;\n height: 64px;\n\n ${BREAKPOINTS.LARGE} {\n height: 80px;\n }\n\n display: flex;\n align-items: center;\n text-align: center;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n background-color: transparent;\n height: 3px;\n border-radius: 3px;\n left: 2px;\n right: 2px;\n bottom: 2px;\n }\n\n &.active:not(.disabled) {\n z-index: ${Z_INDEXES.active};\n background-color: ${COLORS.neutral_20};\n color: ${COLORS.neutral_800};\n\n &:after {\n background-color: ${COLORS.primary_600};\n }\n }\n\n &.disabled {\n color: ${COLORS.neutral_300};\n background-color: ${COLORS.neutral_100};\n\n &:after {\n background-color: ${COLORS.neutral_100};\n }\n }\n\n &:hover:not(.disabled) {\n z-index: ${Z_INDEXES.hover};\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_700};\n\n &:after {\n background-color: ${COLORS.primary_700};\n }\n }\n\n &:active:not(.disabled) {\n z-index: ${Z_INDEXES.active};\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n\n &:after {\n background-color: ${COLORS.primary_800};\n }\n }\n\n\n &:focus:not(.disabled) {\n ${focusStyles}\n outline-offset: -4px;\n }\n`;\n\n\nconst NavItem = (props: StyledComponentPropsWithAs<string | React.ComponentType<any>, any, {}, never, string | React.ComponentType<any>, \"div\">) => {\n return (\n <NavItemDiv {...props} />\n );\n};\n\nexport default NavItem;\n"],"mappings":";;;;;;AAAA,OAAOA,MAAM,MAA8B,mBAAmB;AAC9D,OAAOC,KAAK,MAAM,OAAO;AACzB,SAAQC,WAAW,EAAEC,MAAM,EAAEC,WAAW,QAAO,WAAW;AAC1D,SAAQC,iBAAiB,EAAEC,kBAAkB,QAAO,sBAAsB;AAC1E,SAAQC,SAAS,QAAO,qBAAqB;AAAC;AAa9C,IAAMC,UAAU,GAAGR,MAAM,CAACS,GAAG,goCACzBJ,iBAAiB,CAACC,kBAAkB,CAACI,OAAO,EAAEP,MAAM,CAACQ,WAAW,CAAC,EAMjET,WAAW,CAACU,KAAK,EAsBNL,SAAS,CAACM,MAAM,EACPV,MAAM,CAACW,UAAU,EAC5BX,MAAM,CAACY,WAAW,EAGLZ,MAAM,CAACa,WAAW,EAK/Bb,MAAM,CAACc,WAAW,EACPd,MAAM,CAACe,WAAW,EAGhBf,MAAM,CAACe,WAAW,EAK7BX,SAAS,CAACY,KAAK,EACNhB,MAAM,CAACiB,UAAU,EAC5BjB,MAAM,CAACkB,WAAW,EAGLlB,MAAM,CAACkB,WAAW,EAK7Bd,SAAS,CAACM,MAAM,EACPV,MAAM,CAACmB,WAAW,EAC7BnB,MAAM,CAACoB,WAAW,EAGLpB,MAAM,CAACoB,WAAW,EAMtCnB,WAAW,CAGhB;AAGD,IAAMoB,OAAO,GAAG,SAAVA,OAAO,CAAIC,KAA8H,EAAK;EAClJ,oBACE,KAAC,UAAU,oBAAKA,KAAK,EAAI;AAE7B,CAAC;AAED,eAAeD,OAAO"}
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Panel = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _react = _interopRequireDefault(require("react"));
14
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
+ var _styles = require("../styles");
16
+ var _Button = require("../Button");
17
+ var _icons = require("../icons");
18
+ var _LinearProgress = require("../LinearProgress");
19
+ var _rooks = require("rooks");
20
+ var _types = require("../types");
21
+ var _jsxRuntime = require("react/jsx-runtime");
22
+ var _excluded = ["items", "order"],
23
+ _excluded2 = ["media", "content", "title", "order"];
24
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _Panel$propTypes;
25
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
+ var Wrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n background: ", ";\n min-height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n overflow: hidden;\n\n gap: 24px;\n padding: 56px 32px 120px 32px;\n\n p {\n flex: 1;\n color: ", ";\n }\n\n ", " {\n gap: 32px;\n padding: 56px 64px 120px 64px;\n }\n\n &.reverse {\n align-items: flex-start;\n }\n"])), _styles.COLORS.neutral_20, _styles.COLORS.neutral_600, _styles.BREAKPOINTS.LARGE);
28
+ var Media = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n width: 320px;\n height: 200px;\n\n\n img {\n object-fit: contain;\n }\n\n img.fit {\n object-fit: contain;\n }\n\n img.fill {\n object-fit: cover;\n }\n\n max-width: 100%;\n\n img {\n max-width: 100%;\n width: 320px;\n height: 200px;\n }\n\n ", " {\n width: 488px;\n height: 280px;\n\n img {\n width: 488px;\n height: 280px;\n }\n }\n\n"])), _styles.BREAKPOINTS.LARGE);
29
+ var Body = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n\n"])), _styles.BREAKPOINTS.LARGE);
30
+ var Footer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n\n .progress {\n width: max-content;\n }\n"])), _styles.BREAKPOINTS.LARGE);
31
+ var Panel = function Panel(props) {
32
+ var _currentItem$media, _currentItem$media2;
33
+ var _React$useState = _react.default.useState(0),
34
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
35
+ currentImage = _React$useState2[0],
36
+ setCurrentImage = _React$useState2[1];
37
+ var isLargeScreen = (0, _rooks.useMediaMatch)(_styles.BREAKPOINTS.LARGE.replace('@media ', ''));
38
+ var rest = {};
39
+ var order = undefined;
40
+ var media = undefined;
41
+ var title = '';
42
+ var content = undefined;
43
+ var items = [];
44
+ switch (props.type) {
45
+ case 'carousel':
46
+ var _props = props;
47
+ var _props$items = _props.items;
48
+ items = _props$items === void 0 ? [] : _props$items;
49
+ order = _props.order;
50
+ rest = (0, _objectWithoutProperties2.default)(_props, _excluded);
51
+ _props;
52
+ break;
53
+ case 'default':
54
+ default:
55
+ var _props2 = props;
56
+ media = _props2.media;
57
+ content = _props2.content;
58
+ var _props2$title = _props2.title;
59
+ title = _props2$title === void 0 ? '' : _props2$title;
60
+ order = _props2.order;
61
+ rest = (0, _objectWithoutProperties2.default)(_props2, _excluded2);
62
+ _props2;
63
+ break;
64
+ }
65
+ var moveLeft = function moveLeft() {
66
+ props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);
67
+ };
68
+ var moveRight = function moveRight() {
69
+ props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);
70
+ };
71
+ var currentItem = props.type === 'carousel' ? items[currentImage] : {
72
+ media: media,
73
+ title: title,
74
+ content: content
75
+ };
76
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, _objectSpread(_objectSpread({}, rest), {}, {
77
+ className: "".concat(rest.className || '', " ").concat(order || '', " "),
78
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Media, {
79
+ children: [((_currentItem$media = currentItem.media) === null || _currentItem$media === void 0 ? void 0 : _currentItem$media.type) === 'image' && /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
80
+ className: currentItem.media.fit,
81
+ src: currentItem.media.src,
82
+ alt: currentItem.media.alt
83
+ }), ((_currentItem$media2 = currentItem.media) === null || _currentItem$media2 === void 0 ? void 0 : _currentItem$media2.type) === 'custom' && currentItem.media.content]
84
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Body, {
85
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
86
+ children: currentItem.title
87
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
88
+ children: currentItem.content
89
+ })]
90
+ }), props.type === 'carousel' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(Footer, {
91
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
92
+ action: moveLeft,
93
+ variant: 'secondary',
94
+ shape: 'circular',
95
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ChevronLeft, {})
96
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinearProgress.LinearProgress, {
97
+ size: isLargeScreen ? _types.Size.Medium : _types.Size.Small,
98
+ className: 'progress',
99
+ value: currentImage + 1,
100
+ max: props.items.length,
101
+ type: _LinearProgress.LinearProgressType.Dots
102
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.IconButton, {
103
+ action: moveRight,
104
+ variant: 'secondary',
105
+ shape: 'circular',
106
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SystemIcons.ChevronRight, {})
107
+ })]
108
+ })]
109
+ }));
110
+ };
111
+ exports.Panel = Panel;
112
+ Panel.propTypes = (_Panel$propTypes = {
113
+ type: _propTypes.default.oneOf(['default', 'carousel']),
114
+ media: _propTypes.default.oneOfType([_propTypes.default.shape({
115
+ type: _propTypes.default.oneOf(['image']).isRequired,
116
+ src: _propTypes.default.string.isRequired,
117
+ alt: _propTypes.default.string.isRequired,
118
+ fit: _propTypes.default.oneOf(['fill', 'fit'])
119
+ }), _propTypes.default.shape({
120
+ type: _propTypes.default.oneOf(['custom']).isRequired,
121
+ content: _propTypes.default.node.isRequired
122
+ })]),
123
+ title: _propTypes.default.string,
124
+ content: _propTypes.default.node
125
+ }, (0, _defineProperty2.default)(_Panel$propTypes, "type", _propTypes.default.oneOf(['default'])), (0, _defineProperty2.default)(_Panel$propTypes, "order", _propTypes.default.oneOf(['default', 'reverse'])), (0, _defineProperty2.default)(_Panel$propTypes, "type", _propTypes.default.oneOf(['default', 'carousel'])), (0, _defineProperty2.default)(_Panel$propTypes, "type", _propTypes.default.oneOf(['carousel']).isRequired), (0, _defineProperty2.default)(_Panel$propTypes, "order", _propTypes.default.oneOf(['default', 'reverse'])), (0, _defineProperty2.default)(_Panel$propTypes, "items", _propTypes.default.arrayOf(_propTypes.default.shape({
126
+ media: _propTypes.default.oneOfType([_propTypes.default.shape({
127
+ type: _propTypes.default.oneOf(['image']).isRequired,
128
+ src: _propTypes.default.string.isRequired,
129
+ alt: _propTypes.default.string.isRequired,
130
+ fit: _propTypes.default.oneOf(['fill', 'fit'])
131
+ }), _propTypes.default.shape({
132
+ type: _propTypes.default.oneOf(['custom']).isRequired,
133
+ content: _propTypes.default.node.isRequired
134
+ })]),
135
+ title: _propTypes.default.string,
136
+ content: _propTypes.default.node
137
+ }))), _Panel$propTypes);
138
+ //# sourceMappingURL=Panel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Panel.cjs","names":["Wrapper","styled","div","COLORS","neutral_20","neutral_600","BREAKPOINTS","LARGE","Media","Body","Footer","Panel","props","React","useState","currentImage","setCurrentImage","isLargeScreen","useMediaMatch","replace","rest","order","undefined","media","title","content","items","type","moveLeft","length","moveRight","currentItem","className","fit","src","alt","Size","Medium","Small","LinearProgressType","Dots"],"sources":["../../src/Panel/Panel.tsx"],"sourcesContent":["import React from 'react';\nimport styled from \"styled-components\";\nimport {BREAKPOINTS, COLORS} from \"../styles\";\nimport {IconButton} from \"../Button\";\nimport {SystemIcons} from \"../icons\";\nimport {LinearProgress, LinearProgressType} from \"../LinearProgress\";\nimport {useMediaMatch} from \"rooks\";\nimport {Size} from \"../types\";\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n background: ${COLORS.neutral_20};\n min-height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n overflow: hidden;\n\n gap: 24px;\n padding: 56px 32px 120px 32px;\n\n p {\n flex: 1;\n color: ${COLORS.neutral_600};\n }\n\n ${BREAKPOINTS.LARGE} {\n gap: 32px;\n padding: 56px 64px 120px 64px;\n }\n\n &.reverse {\n align-items: flex-start;\n }\n`;\n\nconst Media = styled.div`\n display: flex;\n width: 320px;\n height: 200px;\n\n\n img {\n object-fit: contain;\n }\n\n img.fit {\n object-fit: contain;\n }\n\n img.fill {\n object-fit: cover;\n }\n\n max-width: 100%;\n\n img {\n max-width: 100%;\n width: 320px;\n height: 200px;\n }\n\n ${BREAKPOINTS.LARGE} {\n width: 488px;\n height: 280px;\n\n img {\n width: 488px;\n height: 280px;\n }\n }\n\n`;\n\nconst Body = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n\n max-width: 320px;\n\n ${BREAKPOINTS.LARGE} {\n max-width: 488px;\n }\n\n`;\nconst Footer = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n\n max-width: 320px;\n\n ${BREAKPOINTS.LARGE} {\n max-width: 488px;\n }\n\n .progress {\n width: max-content;\n }\n`;\n\ninterface BasePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n type?: 'default' | 'carousel';\n}\n\ninterface PanelContent {\n media?: { type: 'image', src: string; alt: string, fit?: 'fill' | 'fit' } | { type: 'custom', content: React.ReactNode };\n title?: string;\n content?: React.ReactNode;\n}\n\ninterface DefaultPanelProps extends BasePanelProps, PanelContent {\n type?: 'default';\n order?: 'default' | 'reverse';\n}\n\ninterface CarouselPanelProps extends BasePanelProps {\n type: 'carousel';\n order?: 'default' | 'reverse';\n items?: PanelContent[];\n}\n\nexport type PanelProps = DefaultPanelProps | CarouselPanelProps;\n\nexport const Panel = (props: PanelProps) => {\n\n const [currentImage, setCurrentImage] = React.useState(0);\n const isLargeScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));\n\n let rest: React.HTMLAttributes<HTMLDivElement> = {};\n let order = undefined;\n let media = undefined;\n let title = '';\n let content = undefined;\n let items: PanelContent[] = [];\n\n\n switch (props.type) {\n case 'carousel':\n ({items = [], order, ...rest} = props);\n break;\n case 'default':\n default:\n ({media, content, title = '', order, ...rest} = props)\n break;\n }\n\n\n const moveLeft = () => {\n props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);\n }\n const moveRight = () => {\n props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);\n }\n\n const currentItem: PanelContent = props.type === 'carousel' ? items[currentImage] : {media, title, content};\n\n return (\n <Wrapper {...rest} className={`${rest.className || ''} ${order || ''} `}>\n <Media>\n {\n currentItem.media?.type === 'image' &&\n <img className={currentItem.media.fit} src={currentItem.media.src} alt={currentItem.media.alt}/>\n }\n {\n currentItem.media?.type === 'custom' && currentItem.media.content\n }\n </Media>\n <Body>\n <h1>{currentItem.title}</h1>\n <p>{currentItem.content}</p>\n </Body>\n {\n props.type === 'carousel' &&\n <Footer>\n <IconButton action={moveLeft} variant={'secondary'} shape={'circular'}>\n <SystemIcons.ChevronLeft/>\n </IconButton>\n <LinearProgress size={isLargeScreen ? Size.Medium : Size.Small}\n className={'progress'}\n value={currentImage + 1}\n max={props.items!.length }\n type={LinearProgressType.Dots}/>\n <IconButton action={moveRight} variant={'secondary'} shape={'circular'}>\n <SystemIcons.ChevronRight/>\n </IconButton>\n </Footer>\n }\n </Wrapper>\n )\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA8B;AAAA;EAAA;AAAA;AAAA;AAAA;AAE9B,IAAMA,OAAO,GAAGC,yBAAM,CAACC,GAAG,gdAGVC,cAAM,CAACC,UAAU,EAWpBD,cAAM,CAACE,WAAW,EAG3BC,mBAAW,CAACC,KAAK,CAQpB;AAED,IAAMC,KAAK,GAAGP,yBAAM,CAACC,GAAG,gfA0BpBI,mBAAW,CAACC,KAAK,CAUpB;AAED,IAAME,IAAI,GAAGR,yBAAM,CAACC,GAAG,iQASnBI,mBAAW,CAACC,KAAK,CAIpB;AACD,IAAMG,MAAM,GAAGT,yBAAM,CAACC,GAAG,4RAQrBI,mBAAW,CAACC,KAAK,CAOpB;AAyBM,IAAMI,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAiB,EAAK;EAAA;EAE1C,sBAAwCC,cAAK,CAACC,QAAQ,CAAC,CAAC,CAAC;IAAA;IAAlDC,YAAY;IAAEC,eAAe;EACpC,IAAMC,aAAa,GAAG,IAAAC,oBAAa,EAACZ,mBAAW,CAACC,KAAK,CAACY,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;EAE7E,IAAIC,IAA0C,GAAG,CAAC,CAAC;EACnD,IAAIC,KAAK,GAAGC,SAAS;EACrB,IAAIC,KAAK,GAAGD,SAAS;EACrB,IAAIE,KAAK,GAAG,EAAE;EACd,IAAIC,OAAO,GAAGH,SAAS;EACvB,IAAII,KAAqB,GAAG,EAAE;EAG9B,QAAQd,KAAK,CAACe,IAAI;IAChB,KAAK,UAAU;MAAA,aACmBf,KAAK;MAAA,0BAAnCc,KAAK;MAALA,KAAK,6BAAG,EAAE;MAAEL,KAAK,UAALA,KAAK;MAAKD,IAAI;MAAA;MAC5B;IACF,KAAK,SAAS;IACd;MAAA,cACkDR,KAAK;MAAnDW,KAAK,WAALA,KAAK;MAAEE,OAAO,WAAPA,OAAO;MAAA,4BAAED,KAAK;MAALA,KAAK,8BAAG,EAAE;MAAEH,KAAK,WAALA,KAAK;MAAKD,IAAI;MAAA;MAC5C;EAAM;EAIV,IAAMQ,QAAQ,GAAG,SAAXA,QAAQ,GAAS;IACrBhB,KAAK,CAACe,IAAI,KAAK,UAAU,IAAIX,eAAe,CAACD,YAAY,KAAK,CAAC,GAAGW,KAAK,CAACG,MAAM,GAAG,CAAC,GAAGd,YAAY,GAAG,CAAC,CAAC;EACxG,CAAC;EACD,IAAMe,SAAS,GAAG,SAAZA,SAAS,GAAS;IACtBlB,KAAK,CAACe,IAAI,KAAK,UAAU,IAAIX,eAAe,CAACD,YAAY,GAAG,CAAC,GAAGW,KAAK,CAACG,MAAM,GAAG,CAAC,GAAG,CAAC,GAAGd,YAAY,GAAG,CAAC,CAAC;EAC1G,CAAC;EAED,IAAMgB,WAAyB,GAAGnB,KAAK,CAACe,IAAI,KAAK,UAAU,GAAGD,KAAK,CAACX,YAAY,CAAC,GAAG;IAACQ,KAAK,EAALA,KAAK;IAAEC,KAAK,EAALA,KAAK;IAAEC,OAAO,EAAPA;EAAO,CAAC;EAE3G,oBACE,sBAAC,OAAO,kCAAKL,IAAI;IAAE,SAAS,YAAKA,IAAI,CAACY,SAAS,IAAI,EAAE,cAAIX,KAAK,IAAI,EAAE,MAAI;IAAA,wBACtE,sBAAC,KAAK;MAAA,WAEF,uBAAAU,WAAW,CAACR,KAAK,uDAAjB,mBAAmBI,IAAI,MAAK,OAAO,iBACjC;QAAK,SAAS,EAAEI,WAAW,CAACR,KAAK,CAACU,GAAI;QAAC,GAAG,EAAEF,WAAW,CAACR,KAAK,CAACW,GAAI;QAAC,GAAG,EAAEH,WAAW,CAACR,KAAK,CAACY;MAAI,EAAE,EAGlG,wBAAAJ,WAAW,CAACR,KAAK,wDAAjB,oBAAmBI,IAAI,MAAK,QAAQ,IAAII,WAAW,CAACR,KAAK,CAACE,OAAO;IAAA,EAE7D,eACR,sBAAC,IAAI;MAAA,wBACH;QAAA,UAAKM,WAAW,CAACP;MAAK,EAAM,eAC5B;QAAA,UAAIO,WAAW,CAACN;MAAO,EAAK;IAAA,EACvB,EAELb,KAAK,CAACe,IAAI,KAAK,UAAU,iBACvB,sBAAC,MAAM;MAAA,wBACH,qBAAC,kBAAU;QAAC,MAAM,EAAEC,QAAS;QAAC,OAAO,EAAE,WAAY;QAAC,KAAK,EAAE,UAAW;QAAA,uBAClE,qBAAC,kBAAW,CAAC,WAAW;MAAE,EACjB,eACb,qBAAC,8BAAc;QAAC,IAAI,EAAEX,aAAa,GAAGmB,WAAI,CAACC,MAAM,GAAGD,WAAI,CAACE,KAAM;QAC/C,SAAS,EAAE,UAAW;QACtB,KAAK,EAAEvB,YAAY,GAAG,CAAE;QACxB,GAAG,EAAEH,KAAK,CAACc,KAAK,CAAEG,MAAQ;QAC1B,IAAI,EAAEU,kCAAkB,CAACC;MAAK,EAAE,eAChD,qBAAC,kBAAU;QAAC,MAAM,EAAEV,SAAU;QAAC,OAAO,EAAE,WAAY;QAAC,KAAK,EAAE,UAAW;QAAA,uBACnE,qBAAC,kBAAW,CAAC,YAAY;MAAE,EAClB;IAAA,EACR;EAAA,GAEL;AAEd,CAAC;AAAC;AAAA;EAxFAH,IAAI,4BAAG,SAAS,EAAG,UAAU;EAI7BJ,KAAK;IAAKI,IAAI,4BAAE,OAAO;IAAEO,GAAG;IAAUC,GAAG;IAAUF,GAAG,4BAAG,MAAM,EAAG,KAAK;EAAA;IAAON,IAAI,4BAAE,QAAQ;IAAEF,OAAO;EAAA;EACrGD,KAAK;EACLC,OAAO;AAAA,qFAIA,SAAS,wFACR,SAAS,EAAG,SAAS,uFAXtB,SAAS,EAAG,UAAU,uFAevB,UAAU,mGACR,SAAS,EAAG,SAAS;EAZ7BF,KAAK;IAAKI,IAAI,4BAAE,OAAO;IAAEO,GAAG;IAAUC,GAAG;IAAUF,GAAG,4BAAG,MAAM,EAAG,KAAK;EAAA;IAAON,IAAI,4BAAE,QAAQ;IAAEF,OAAO;EAAA;EACrGD,KAAK;EACLC,OAAO;AAAA"}
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ interface BasePanelProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
3
+ type?: 'default' | 'carousel';
4
+ }
5
+ interface PanelContent {
6
+ media?: {
7
+ type: 'image';
8
+ src: string;
9
+ alt: string;
10
+ fit?: 'fill' | 'fit';
11
+ } | {
12
+ type: 'custom';
13
+ content: React.ReactNode;
14
+ };
15
+ title?: string;
16
+ content?: React.ReactNode;
17
+ }
18
+ interface DefaultPanelProps extends BasePanelProps, PanelContent {
19
+ type?: 'default';
20
+ order?: 'default' | 'reverse';
21
+ }
22
+ interface CarouselPanelProps extends BasePanelProps {
23
+ type: 'carousel';
24
+ order?: 'default' | 'reverse';
25
+ items?: PanelContent[];
26
+ }
27
+ export type PanelProps = DefaultPanelProps | CarouselPanelProps;
28
+ export declare const Panel: (props: PanelProps) => JSX.Element;
29
+ export {};
@@ -0,0 +1,131 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
5
+ import _pt from "prop-types";
6
+ var _excluded = ["items", "order"],
7
+ _excluded2 = ["media", "content", "title", "order"];
8
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _Panel$propTypes;
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
+ import React from 'react';
12
+ import styled from "styled-components";
13
+ import { BREAKPOINTS, COLORS } from "../styles";
14
+ import { IconButton } from "../Button";
15
+ import { SystemIcons } from "../icons";
16
+ import { LinearProgress, LinearProgressType } from "../LinearProgress";
17
+ import { useMediaMatch } from "rooks";
18
+ import { Size } from "../types";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n background: ", ";\n min-height: 100%;\n align-items: flex-end;\n box-sizing: border-box;\n overflow: hidden;\n\n gap: 24px;\n padding: 56px 32px 120px 32px;\n\n p {\n flex: 1;\n color: ", ";\n }\n\n ", " {\n gap: 32px;\n padding: 56px 64px 120px 64px;\n }\n\n &.reverse {\n align-items: flex-start;\n }\n"])), COLORS.neutral_20, COLORS.neutral_600, BREAKPOINTS.LARGE);
22
+ var Media = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n width: 320px;\n height: 200px;\n\n\n img {\n object-fit: contain;\n }\n\n img.fit {\n object-fit: contain;\n }\n\n img.fill {\n object-fit: cover;\n }\n\n max-width: 100%;\n\n img {\n max-width: 100%;\n width: 320px;\n height: 200px;\n }\n\n ", " {\n width: 488px;\n height: 280px;\n\n img {\n width: 488px;\n height: 280px;\n }\n }\n\n"])), BREAKPOINTS.LARGE);
23
+ var Body = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n\n"])), BREAKPOINTS.LARGE);
24
+ var Footer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n\n max-width: 320px;\n\n ", " {\n max-width: 488px;\n }\n\n .progress {\n width: max-content;\n }\n"])), BREAKPOINTS.LARGE);
25
+ export var Panel = function Panel(props) {
26
+ var _currentItem$media, _currentItem$media2;
27
+ var _React$useState = React.useState(0),
28
+ _React$useState2 = _slicedToArray(_React$useState, 2),
29
+ currentImage = _React$useState2[0],
30
+ setCurrentImage = _React$useState2[1];
31
+ var isLargeScreen = useMediaMatch(BREAKPOINTS.LARGE.replace('@media ', ''));
32
+ var rest = {};
33
+ var order = undefined;
34
+ var media = undefined;
35
+ var title = '';
36
+ var content = undefined;
37
+ var items = [];
38
+ switch (props.type) {
39
+ case 'carousel':
40
+ var _props = props;
41
+ var _props$items = _props.items;
42
+ items = _props$items === void 0 ? [] : _props$items;
43
+ order = _props.order;
44
+ rest = _objectWithoutProperties(_props, _excluded);
45
+ _props;
46
+ break;
47
+ case 'default':
48
+ default:
49
+ var _props2 = props;
50
+ media = _props2.media;
51
+ content = _props2.content;
52
+ var _props2$title = _props2.title;
53
+ title = _props2$title === void 0 ? '' : _props2$title;
54
+ order = _props2.order;
55
+ rest = _objectWithoutProperties(_props2, _excluded2);
56
+ _props2;
57
+ break;
58
+ }
59
+ var moveLeft = function moveLeft() {
60
+ props.type === 'carousel' && setCurrentImage(currentImage === 0 ? items.length - 1 : currentImage - 1);
61
+ };
62
+ var moveRight = function moveRight() {
63
+ props.type === 'carousel' && setCurrentImage(currentImage + 1 > items.length - 1 ? 0 : currentImage + 1);
64
+ };
65
+ var currentItem = props.type === 'carousel' ? items[currentImage] : {
66
+ media: media,
67
+ title: title,
68
+ content: content
69
+ };
70
+ return /*#__PURE__*/_jsxs(Wrapper, _objectSpread(_objectSpread({}, rest), {}, {
71
+ className: "".concat(rest.className || '', " ").concat(order || '', " "),
72
+ children: [/*#__PURE__*/_jsxs(Media, {
73
+ children: [((_currentItem$media = currentItem.media) === null || _currentItem$media === void 0 ? void 0 : _currentItem$media.type) === 'image' && /*#__PURE__*/_jsx("img", {
74
+ className: currentItem.media.fit,
75
+ src: currentItem.media.src,
76
+ alt: currentItem.media.alt
77
+ }), ((_currentItem$media2 = currentItem.media) === null || _currentItem$media2 === void 0 ? void 0 : _currentItem$media2.type) === 'custom' && currentItem.media.content]
78
+ }), /*#__PURE__*/_jsxs(Body, {
79
+ children: [/*#__PURE__*/_jsx("h1", {
80
+ children: currentItem.title
81
+ }), /*#__PURE__*/_jsx("p", {
82
+ children: currentItem.content
83
+ })]
84
+ }), props.type === 'carousel' && /*#__PURE__*/_jsxs(Footer, {
85
+ children: [/*#__PURE__*/_jsx(IconButton, {
86
+ action: moveLeft,
87
+ variant: 'secondary',
88
+ shape: 'circular',
89
+ children: /*#__PURE__*/_jsx(SystemIcons.ChevronLeft, {})
90
+ }), /*#__PURE__*/_jsx(LinearProgress, {
91
+ size: isLargeScreen ? Size.Medium : Size.Small,
92
+ className: 'progress',
93
+ value: currentImage + 1,
94
+ max: props.items.length,
95
+ type: LinearProgressType.Dots
96
+ }), /*#__PURE__*/_jsx(IconButton, {
97
+ action: moveRight,
98
+ variant: 'secondary',
99
+ shape: 'circular',
100
+ children: /*#__PURE__*/_jsx(SystemIcons.ChevronRight, {})
101
+ })]
102
+ })]
103
+ }));
104
+ };
105
+ Panel.propTypes = (_Panel$propTypes = {
106
+ type: _pt.oneOf(['default', 'carousel']),
107
+ media: _pt.oneOfType([_pt.shape({
108
+ type: _pt.oneOf(['image']).isRequired,
109
+ src: _pt.string.isRequired,
110
+ alt: _pt.string.isRequired,
111
+ fit: _pt.oneOf(['fill', 'fit'])
112
+ }), _pt.shape({
113
+ type: _pt.oneOf(['custom']).isRequired,
114
+ content: _pt.node.isRequired
115
+ })]),
116
+ title: _pt.string,
117
+ content: _pt.node
118
+ }, _defineProperty(_Panel$propTypes, "type", _pt.oneOf(['default'])), _defineProperty(_Panel$propTypes, "order", _pt.oneOf(['default', 'reverse'])), _defineProperty(_Panel$propTypes, "type", _pt.oneOf(['default', 'carousel'])), _defineProperty(_Panel$propTypes, "type", _pt.oneOf(['carousel']).isRequired), _defineProperty(_Panel$propTypes, "order", _pt.oneOf(['default', 'reverse'])), _defineProperty(_Panel$propTypes, "items", _pt.arrayOf(_pt.shape({
119
+ media: _pt.oneOfType([_pt.shape({
120
+ type: _pt.oneOf(['image']).isRequired,
121
+ src: _pt.string.isRequired,
122
+ alt: _pt.string.isRequired,
123
+ fit: _pt.oneOf(['fill', 'fit'])
124
+ }), _pt.shape({
125
+ type: _pt.oneOf(['custom']).isRequired,
126
+ content: _pt.node.isRequired
127
+ })]),
128
+ title: _pt.string,
129
+ content: _pt.node
130
+ }))), _Panel$propTypes);
131
+ //# sourceMappingURL=Panel.js.map