@laerdal/life-react-components 1.5.1 → 1.6.0-dev.10

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 (164) hide show
  1. package/dist/Banners/Banner.cjs +21 -5
  2. package/dist/Banners/Banner.cjs.map +1 -1
  3. package/dist/Banners/Banner.js +20 -5
  4. package/dist/Banners/Banner.js.map +1 -1
  5. package/dist/Button/Iconbutton.cjs +16 -14
  6. package/dist/Button/Iconbutton.cjs.map +1 -1
  7. package/dist/Button/Iconbutton.d.ts +2 -0
  8. package/dist/Button/Iconbutton.js +16 -14
  9. package/dist/Button/Iconbutton.js.map +1 -1
  10. package/dist/Card/Card.cjs +101 -0
  11. package/dist/Card/Card.cjs.map +1 -0
  12. package/dist/Card/Card.d.ts +23 -0
  13. package/dist/Card/Card.js +74 -0
  14. package/dist/Card/Card.js.map +1 -0
  15. package/dist/Card/CardBottomSection.cjs +133 -0
  16. package/dist/Card/CardBottomSection.cjs.map +1 -0
  17. package/dist/Card/CardBottomSection.d.ts +22 -0
  18. package/dist/Card/CardBottomSection.js +105 -0
  19. package/dist/Card/CardBottomSection.js.map +1 -0
  20. package/dist/Card/CardMiddleSection.cjs +94 -0
  21. package/dist/Card/CardMiddleSection.cjs.map +1 -0
  22. package/dist/Card/CardMiddleSection.d.ts +14 -0
  23. package/dist/Card/CardMiddleSection.js +71 -0
  24. package/dist/Card/CardMiddleSection.js.map +1 -0
  25. package/dist/Card/CardTopSection.cjs +112 -0
  26. package/dist/Card/CardTopSection.cjs.map +1 -0
  27. package/dist/Card/CardTopSection.d.ts +19 -0
  28. package/dist/Card/CardTopSection.js +85 -0
  29. package/dist/Card/CardTopSection.js.map +1 -0
  30. package/dist/Card/index.cjs +52 -0
  31. package/dist/Card/index.cjs.map +1 -0
  32. package/dist/Card/index.d.ts +5 -0
  33. package/dist/Card/index.js +6 -0
  34. package/dist/Card/index.js.map +1 -0
  35. package/dist/Dropdown/BasicDropdown.cjs +38 -55
  36. package/dist/Dropdown/BasicDropdown.cjs.map +1 -1
  37. package/dist/Dropdown/BasicDropdown.js +36 -53
  38. package/dist/Dropdown/BasicDropdown.js.map +1 -1
  39. package/dist/Dropdown/CommonStyling.cjs +9 -17
  40. package/dist/Dropdown/CommonStyling.cjs.map +1 -1
  41. package/dist/Dropdown/CommonStyling.d.ts +0 -3
  42. package/dist/Dropdown/CommonStyling.js +8 -12
  43. package/dist/Dropdown/CommonStyling.js.map +1 -1
  44. package/dist/Dropdown/DropdownButton.cjs +11 -24
  45. package/dist/Dropdown/DropdownButton.cjs.map +1 -1
  46. package/dist/Dropdown/DropdownButton.js +11 -24
  47. package/dist/Dropdown/DropdownButton.js.map +1 -1
  48. package/dist/Dropdown/DropdownContent.cjs +21 -12
  49. package/dist/Dropdown/DropdownContent.cjs.map +1 -1
  50. package/dist/Dropdown/DropdownContent.js +21 -12
  51. package/dist/Dropdown/DropdownContent.js.map +1 -1
  52. package/dist/Dropdown/DropdownFilter.cjs +43 -46
  53. package/dist/Dropdown/DropdownFilter.cjs.map +1 -1
  54. package/dist/Dropdown/DropdownFilter.js +41 -45
  55. package/dist/Dropdown/DropdownFilter.js.map +1 -1
  56. package/dist/HyperLink/HyperLink.cjs +3 -1
  57. package/dist/HyperLink/HyperLink.cjs.map +1 -1
  58. package/dist/HyperLink/HyperLink.d.ts +4 -0
  59. package/dist/HyperLink/HyperLink.js +1 -1
  60. package/dist/HyperLink/HyperLink.js.map +1 -1
  61. package/dist/HyperLink/styling.cjs +1 -1
  62. package/dist/HyperLink/styling.cjs.map +1 -1
  63. package/dist/HyperLink/styling.js +1 -1
  64. package/dist/HyperLink/styling.js.map +1 -1
  65. package/dist/Image/ImageWithFallbacks.cjs +122 -0
  66. package/dist/Image/ImageWithFallbacks.cjs.map +1 -0
  67. package/dist/Image/ImageWithFallbacks.d.ts +21 -0
  68. package/dist/Image/ImageWithFallbacks.js +109 -0
  69. package/dist/Image/ImageWithFallbacks.js.map +1 -0
  70. package/dist/Image/index.cjs +16 -0
  71. package/dist/Image/index.cjs.map +1 -0
  72. package/dist/Image/index.d.ts +2 -0
  73. package/dist/Image/index.js +3 -0
  74. package/dist/Image/index.js.map +1 -0
  75. package/dist/InputFields/DatepickerField.cjs +53 -17
  76. package/dist/InputFields/DatepickerField.cjs.map +1 -1
  77. package/dist/InputFields/DatepickerField.js +52 -16
  78. package/dist/InputFields/DatepickerField.js.map +1 -1
  79. package/dist/InputFields/styling.cjs +2 -2
  80. package/dist/InputFields/styling.cjs.map +1 -1
  81. package/dist/InputFields/styling.js +2 -2
  82. package/dist/InputFields/styling.js.map +1 -1
  83. package/dist/LinearProgress/LinearProgress.cjs +142 -0
  84. package/dist/LinearProgress/LinearProgress.cjs.map +1 -0
  85. package/dist/LinearProgress/LinearProgress.d.ts +25 -0
  86. package/dist/LinearProgress/LinearProgress.js +111 -0
  87. package/dist/LinearProgress/LinearProgress.js.map +1 -0
  88. package/dist/LinearProgress/index.cjs +32 -0
  89. package/dist/LinearProgress/index.cjs.map +1 -0
  90. package/dist/LinearProgress/index.d.ts +3 -0
  91. package/dist/LinearProgress/index.js +4 -0
  92. package/dist/LinearProgress/index.js.map +1 -0
  93. package/dist/Modals/ModalContainer.cjs +10 -4
  94. package/dist/Modals/ModalContainer.cjs.map +1 -1
  95. package/dist/Modals/ModalContainer.d.ts +1 -0
  96. package/dist/Modals/ModalContainer.js +10 -4
  97. package/dist/Modals/ModalContainer.js.map +1 -1
  98. package/dist/Modals/ModalContent.cjs +235 -0
  99. package/dist/Modals/ModalContent.cjs.map +1 -0
  100. package/dist/Modals/ModalContent.d.ts +18 -0
  101. package/dist/Modals/ModalContent.js +204 -0
  102. package/dist/Modals/ModalContent.js.map +1 -0
  103. package/dist/Modals/ModalDialog.cjs +71 -8
  104. package/dist/Modals/ModalDialog.cjs.map +1 -1
  105. package/dist/Modals/ModalDialog.d.ts +8 -1
  106. package/dist/Modals/ModalDialog.js +74 -11
  107. package/dist/Modals/ModalDialog.js.map +1 -1
  108. package/dist/Modals/ModalStyles.cjs +3 -3
  109. package/dist/Modals/ModalStyles.cjs.map +1 -1
  110. package/dist/Modals/ModalStyles.js +3 -3
  111. package/dist/Modals/ModalStyles.js.map +1 -1
  112. package/dist/Modals/ModalTypes.d.ts +5 -0
  113. package/dist/Modals/index.cjs +8 -0
  114. package/dist/Modals/index.cjs.map +1 -1
  115. package/dist/Modals/index.d.ts +3 -2
  116. package/dist/Modals/index.js +2 -1
  117. package/dist/Modals/index.js.map +1 -1
  118. package/dist/SegmentControl/SegmentControl.cjs +99 -0
  119. package/dist/SegmentControl/SegmentControl.cjs.map +1 -0
  120. package/dist/SegmentControl/SegmentControl.d.ts +19 -0
  121. package/dist/SegmentControl/SegmentControl.js +71 -0
  122. package/dist/SegmentControl/SegmentControl.js.map +1 -0
  123. package/dist/SegmentControl/index.cjs +16 -0
  124. package/dist/SegmentControl/index.cjs.map +1 -0
  125. package/dist/SegmentControl/index.d.ts +3 -0
  126. package/dist/SegmentControl/index.js +3 -0
  127. package/dist/SegmentControl/index.js.map +1 -0
  128. package/dist/SkipToContent/SkipToContent.cjs +2 -2
  129. package/dist/SkipToContent/SkipToContent.cjs.map +1 -1
  130. package/dist/SkipToContent/SkipToContent.js +2 -2
  131. package/dist/SkipToContent/SkipToContent.js.map +1 -1
  132. package/dist/Table/TableFooter.cjs +1 -1
  133. package/dist/Table/TableFooter.cjs.map +1 -1
  134. package/dist/Table/TableFooter.js +1 -1
  135. package/dist/Table/TableFooter.js.map +1 -1
  136. package/dist/Table/TableStyles.cjs +1 -1
  137. package/dist/Table/TableStyles.cjs.map +1 -1
  138. package/dist/Table/TableStyles.js +1 -1
  139. package/dist/Table/TableStyles.js.map +1 -1
  140. package/dist/Tag/Tag.cjs +95 -0
  141. package/dist/Tag/Tag.cjs.map +1 -0
  142. package/dist/Tag/Tag.d.ts +9 -0
  143. package/dist/Tag/Tag.js +73 -0
  144. package/dist/Tag/Tag.js.map +1 -0
  145. package/dist/Tag/index.cjs +16 -0
  146. package/dist/Tag/index.cjs.map +1 -0
  147. package/dist/Tag/index.d.ts +2 -0
  148. package/dist/Tag/index.js +2 -0
  149. package/dist/Tag/index.js.map +1 -0
  150. package/dist/common/InputStyling.cjs +1 -1
  151. package/dist/common/InputStyling.cjs.map +1 -1
  152. package/dist/common/InputStyling.js +1 -1
  153. package/dist/common/InputStyling.js.map +1 -1
  154. package/dist/index.cjs +113 -0
  155. package/dist/index.cjs.map +1 -1
  156. package/dist/index.d.ts +6 -0
  157. package/dist/index.js +6 -0
  158. package/dist/index.js.map +1 -1
  159. package/dist/types.cjs +9 -1
  160. package/dist/types.cjs.map +1 -1
  161. package/dist/types.d.ts +4 -0
  162. package/dist/types.js +7 -0
  163. package/dist/types.js.map +1 -1
  164. package/package.json +4 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/InputFields/styling.ts"],"names":["styled","css","BREAKPOINTS","COLORS","ComponentXXSStyling","ComponentTextStyle","ComponentSStyling","ComponentMStyling","Z_INDEXES","InputWrapper","div","props","locked","disabled","margin","lockedState","neutral_100","neutral_300","neutral_600","activeValidationMessageState","warning_400","activeErrorMessageState","critical_400","activeCorrectInput","correct_500","InputFieldStyling","input","withoutBorder","neutral_400","Italic","MEDIUM","black","activeValidationMessage","activeErrorMessage","correctInput","primary_800","focus","primary_700","ValidationStyling","Regular","RequiredStar","span","critical_500","Warning","WarningMessage","warning_500","ErrorMessage","AutofilledMessage","StyledIcon","SearchIconWrapper"],"mappings":";;;;AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,WAApC;AACA,SAASC,mBAAT,EAA8BC,kBAA9B,EAAkDC,iBAAlD,EAAqEC,iBAArE,QAA8F,sBAA9F;AACA,SAAQC,SAAR,QAAwB,qBAAxB;AAEA,OAAO,IAAMC,YAAY,GAAGT,MAAM,CAACU,GAAV,2GAErB,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,MAAN,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,4FACnBxC,MAAM,CAACe,WADY,CAAvB;AAIP,SAASoB,iBAAT,EAA4Bb,iBAA5B;AAEA,OAAO,IAAMuB,UAAU,GAAGhD,MAAM,CAACU,GAAV,kGAAhB;AAIP,OAAO,IAAMuC,iBAAiB,GAAGjD,MAAM,CAACgD,UAAD,CAAT,yHAAvB","sourcesContent":["import styled, { css } from 'styled-components';\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { ComponentXXSStyling, ComponentTextStyle, ComponentSStyling, ComponentMStyling } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nexport const InputWrapper = styled.div<{ locked?: boolean; disabled?: boolean; margin?: string }>`\n outline: none;\n ${(props) => (props.locked || props.disabled ? 'cursor: not-allowed;' : '')};\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nconst lockedState = css`\n background-color: ${COLORS.neutral_100};\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_300} !important;\n color: ${COLORS.neutral_600} !important;\n pointer-events: none;\n outline: none;\n cursor: not-allowed;\n`;\nexport const activeValidationMessageState = css`\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n`;\nconst activeErrorMessageState = css`\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n`;\nconst activeCorrectInput = css`\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.correct_500};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.correct_500};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.correct_500};\n`;\n\nconst InputFieldStyling = styled.input<{\n locked?: boolean;\n activeValidationMessage?: boolean;\n activeErrorMessage?: boolean;\n correctInput?: boolean;\n active?: boolean;\n withoutBorder?: boolean;\n size?: string;\n}>`\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ${(props) =>\n props.withoutBorder\n ? `-webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n `\n : `-webkit-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n -moz-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};`}\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n\n font-size: 16px;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ${COLORS.black} !important;\n\n ${(props) => (props.locked ? lockedState : '')}\n ${(props) => (props.activeValidationMessage ? activeValidationMessageState : '')}\n ${(props) => (props.activeErrorMessage ? activeErrorMessageState : '')}\n ${(props) => (props.correctInput ? activeCorrectInput : '')}\n\n &:disabled {\n border: 1px solid ${COLORS.neutral_100};\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ${COLORS.neutral_300} !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n \n &.focus-visible{\n outline: none;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n z-index: ${Z_INDEXES.focus};\n }\n\n &.error {\n border-radius: 4px;\n border-style: solid;\n border-width: 2px;\n border-color: #e97116;\n padding: 0 15px !important;\n }\n\n &:not(.placeholder) {\n line-height: 40px;\n }\n\n &.error {\n margin-bottom: 0 !important;\n }\n\n &:hover {\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n }\n\n &.active {\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n\n &.show-checkmark.valid {\n background-image: none;\n }\n\n &.show-checkmark.pending {\n background-image: none;\n }\n \n`;\n\nconst ValidationStyling = css`\n &.error-msg {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n text-align: center;\n font-weight: 400;\n box-sizing: border-box;\n }\n\n &.error-msg {\n padding-top: 8px;\n padding-bottom: 0;\n ${ComponentXXSStyling(ComponentTextStyle.Regular, '#e76468')}\n font-weight: 700;\n line-height: 15px;\n }\n`;\n\nexport const RequiredStar = styled.span`\n color: ${COLORS.critical_500};\n font-size: 28px;\n line-height: 12px;\n font-weight: 700;\n position: relative;\n top: 10px;\n`;\nexport const Warning = styled.div`\n font-size: 12px;\n line-height: 140%;\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 14px;\n }\n\n &.small {\n font-size: 12px;\n }\n &.medium {\n font-size: 14px;\n }\n\n & * {\n vertical-align: middle;\n display: inline-block;\n }\n\n svg {\n margin-right: 4px;\n }\n`;\nexport const WarningMessage = styled(Warning)`\n color: ${COLORS.warning_500};\n`;\nexport const ErrorMessage = styled(Warning)`\n color: ${COLORS.critical_500};\n`;\nexport const AutofilledMessage = styled(Warning)`\n color: ${COLORS.neutral_600};\n`;\n\nexport { ValidationStyling, InputFieldStyling };\n\nexport const StyledIcon = styled.div`\n border-radius: 50%;\n`;\n\nexport const SearchIconWrapper = styled(StyledIcon)`\n position: absolute;\n border-radius: 50%;\n`;\n"],"file":"styling.js"}
1
+ {"version":3,"sources":["../../src/InputFields/styling.ts"],"names":["styled","css","BREAKPOINTS","COLORS","ComponentXXSStyling","ComponentTextStyle","ComponentSStyling","ComponentMStyling","Z_INDEXES","InputWrapper","div","props","locked","disabled","margin","lockedState","neutral_100","neutral_300","neutral_600","activeValidationMessageState","warning_400","activeErrorMessageState","critical_400","activeCorrectInput","correct_500","InputFieldStyling","input","withoutBorder","neutral_400","Italic","MEDIUM","black","activeValidationMessage","activeErrorMessage","correctInput","primary_800","focus","primary_700","ValidationStyling","Regular","RequiredStar","span","critical_500","Warning","WarningMessage","warning_500","ErrorMessage","AutofilledMessage","StyledIcon","SearchIconWrapper"],"mappings":";;;;AAAA,OAAOA,MAAP,IAAiBC,GAAjB,QAA4B,mBAA5B;AACA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,WAApC;AACA,SAASC,mBAAT,EAA8BC,kBAA9B,EAAkDC,iBAAlD,EAAqEC,iBAArE,QAA8F,sBAA9F;AACA,SAAQC,SAAR,QAAwB,qBAAxB;AAEA,OAAO,IAAMC,YAAY,GAAGT,MAAM,CAACU,GAAV,2GAErB,UAACC,KAAD;AAAA,SAAYA,KAAK,CAACC,MAAN,IAAgBD,KAAK,CAACE,QAAtB,GAAiC,sBAAjC,GAA0D,EAAtE;AAAA,CAFqB,EAGrB,UAACF,KAAD;AAAA,SAAYA,KAAK,CAACG,MAAN,qBAA0BH,KAAK,CAACG,MAAhC,SAA4C,EAAxD;AAAA,CAHqB,CAAlB;AAMP,IAAMC,WAAW,GAAGd,GAAH,yPACKE,MAAM,CAACa,WADZ,EAEqBb,MAAM,CAACc,WAF5B,EAGNd,MAAM,CAACe,WAHD,CAAjB;AAQA,OAAO,IAAMC,4BAA4B,GAAGlB,GAAH,wNACKE,MAAM,CAACiB,WADZ,EAEEjB,MAAM,CAACiB,WAFT,EAGHjB,MAAM,CAACiB,WAHJ,CAAlC;AAKP,IAAMC,u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BlC,MAAM,CAACgC,WA5GxB,CAAvB;AAyHA,IAAMG,iBAAiB,GAAGrC,GAAH,uTAEjBG,mBAAmB,CAACC,kBAAkB,CAACkC,OAApB,EAA6BpC,MAAM,CAAC4B,KAApC,CAFF,EAWjB3B,mBAAmB,CAACC,kBAAkB,CAACkC,OAApB,EAA6B,SAA7B,CAXF,CAAvB;AAiBA,OAAO,IAAMC,YAAY,GAAGxC,MAAM,CAACyC,IAAV,8LACdtC,MAAM,CAACuC,YADO,CAAlB;AAQP,OAAO,IAAMC,OAAO,GAAG3C,MAAM,CAACU,GAAV,+VAIhBR,WAAW,CAAC4B,MAJI,CAAb;AAwBP,OAAO,IAAMc,cAAc,GAAG5C,MAAM,CAAC2C,OAAD,CAAT,4FAChBxC,MAAM,CAAC0C,WADS,CAApB;AAGP,OAAO,IAAMC,YAAY,GAAG9C,MAAM,CAAC2C,OAAD,CAAT,4FACdxC,MAAM,CAACuC,YADO,CAAlB;AAGP,OAAO,IAAMK,iBAAiB,GAAG/C,MAAM,CAAC2C,OAAD,CAAT,4FACnBxC,MAAM,CAACe,WADY,CAAvB;AAIP,SAASoB,iBAAT,EAA4Bb,iBAA5B;AAEA,OAAO,IAAMuB,UAAU,GAAGhD,MAAM,CAACU,GAAV,kGAAhB;AAIP,OAAO,IAAMuC,iBAAiB,GAAGjD,MAAM,CAACgD,UAAD,CAAT,yHAAvB","sourcesContent":["import styled, { css } from 'styled-components';\nimport { BREAKPOINTS, COLORS } from '../styles';\nimport { ComponentXXSStyling, ComponentTextStyle, ComponentSStyling, ComponentMStyling } from '../styles/typography';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nexport const InputWrapper = styled.div<{ locked?: boolean; disabled?: boolean; margin?: string }>`\n outline: none;\n ${(props) => (props.locked || props.disabled ? 'cursor: not-allowed;' : '')};\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n`;\n\nconst lockedState = css`\n background-color: ${COLORS.neutral_100};\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_300} !important;\n color: ${COLORS.neutral_600} !important;\n pointer-events: none;\n outline: none;\n cursor: not-allowed;\n`;\nexport const activeValidationMessageState = css`\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.warning_400};\n`;\nconst activeErrorMessageState = css`\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.critical_400};\n`;\nconst activeCorrectInput = css`\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.correct_500};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.correct_500};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.correct_500};\n`;\n\nconst InputFieldStyling = styled.input<{\n locked?: boolean;\n activeValidationMessage?: boolean;\n activeErrorMessage?: boolean;\n correctInput?: boolean;\n active?: boolean;\n withoutBorder?: boolean;\n size?: string;\n}>`\n height: 48px;\n width: 100%;\n border-radius: 4px;\n\n border: 0;\n -webkit-appearance: none;\n ${(props) =>\n props.withoutBorder\n ? `-webkit-box-shadow: none;\n -moz-box-shadow: none;\n box-shadow: none;\n `\n : `-webkit-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n -moz-box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_400};`}\n background-color: #fff;\n box-sizing: border-box;\n padding: 0 16px !important;\n\n outline: none;\n\n font-size: 16px;\n\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 18px;\n line-height: 18px;\n height: 56px;\n padding: 0 16px !important;\n\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n\n &.small {\n font-size: 16px;\n height: 48px;\n &::placeholder {\n font-size: 16px;\n }\n }\n &.medium {\n font-size: 18px;\n height: 56px;\n &::placeholder {\n font-size: 18px;\n }\n }\n\n color: ${COLORS.black} !important;\n\n ${(props) => (props.locked ? lockedState : '')}\n ${(props) => (props.activeValidationMessage ? activeValidationMessageState : '')}\n ${(props) => (props.activeErrorMessage ? activeErrorMessageState : '')}\n ${(props) => (props.correctInput ? activeCorrectInput : '')}\n\n &:disabled {\n border: 1px solid ${COLORS.neutral_100};\n pointer-events: none;\n box-shadow: none !important;\n outline: none;\n cursor: not-allowed;\n color: ${COLORS.neutral_300} !important;\n }\n &:focus:not(.focus-visible) {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n \n &.focus-visible{\n outline: none;\n box-shadow: 0px 4px 12px rgba(46, 127, 161, 0.25), 0px 0px 8px #2e7fa1;\n z-index: ${Z_INDEXES.focus};\n }\n\n &.error {\n border-radius: 4px;\n border-style: solid;\n border-width: 2px;\n border-color: #e97116;\n padding: 0 15px !important;\n }\n\n &:not(.placeholder) {\n line-height: 40px;\n }\n\n &.error {\n margin-bottom: 0 !important;\n }\n\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n }\n\n &.active {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n\n &.show-checkmark.valid {\n background-image: none;\n }\n\n &.show-checkmark.pending {\n background-image: none;\n }\n \n`;\n\nconst ValidationStyling = css`\n &.error-msg {\n ${ComponentXXSStyling(ComponentTextStyle.Regular, COLORS.black)}\n text-align: center;\n font-weight: 400;\n box-sizing: border-box;\n }\n\n &.error-msg {\n padding-top: 8px;\n padding-bottom: 0;\n ${ComponentXXSStyling(ComponentTextStyle.Regular, '#e76468')}\n font-weight: 700;\n line-height: 15px;\n }\n`;\n\nexport const RequiredStar = styled.span`\n color: ${COLORS.critical_500};\n font-size: 28px;\n line-height: 12px;\n font-weight: 700;\n position: relative;\n top: 10px;\n`;\nexport const Warning = styled.div`\n font-size: 12px;\n line-height: 140%;\n\n ${BREAKPOINTS.MEDIUM} {\n font-size: 14px;\n }\n\n &.small {\n font-size: 12px;\n }\n &.medium {\n font-size: 14px;\n }\n\n & * {\n vertical-align: middle;\n display: inline-block;\n }\n\n svg {\n margin-right: 4px;\n }\n`;\nexport const WarningMessage = styled(Warning)`\n color: ${COLORS.warning_500};\n`;\nexport const ErrorMessage = styled(Warning)`\n color: ${COLORS.critical_500};\n`;\nexport const AutofilledMessage = styled(Warning)`\n color: ${COLORS.neutral_600};\n`;\n\nexport { ValidationStyling, InputFieldStyling };\n\nexport const StyledIcon = styled.div`\n border-radius: 50%;\n`;\n\nexport const SearchIconWrapper = styled(StyledIcon)`\n position: absolute;\n border-radius: 50%;\n`;\n"],"file":"styling.js"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = exports.LinearProgressVariant = exports.LinearProgressType = exports.LineFill = exports.Line = exports.Dot = exports.Bar = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _react = _interopRequireDefault(require("react"));
15
+
16
+ var _types = require("../types");
17
+
18
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
19
+
20
+ var _styles = require("../styles");
21
+
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
+
24
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
25
+
26
+ var Bar = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n height: 6px;\n\n &.small {\n height: 6px;\n }\n\n &.medium {\n height: 8px;\n }\n\n &.large {\n height: 12px;\n }\n\n background-color: ", ";\n\n &.active {\n background-color: ", ";\n }\n\n &.current {\n background-color: ", ";\n }\n\n &.inverted {\n background-color: ", ";\n }\n\n &.inverted.active {\n background-color: ", ";\n }\n\n &.inverted.current {\n background-color: ", ";\n }\n\n"])), _styles.COLORS.neutral_100, _styles.COLORS.accent1_400, _styles.COLORS.accent1_800, _styles.COLORS.neutral_600, _styles.COLORS.accent1_400, _styles.COLORS.white);
27
+
28
+ exports.Bar = Bar;
29
+
30
+ var Dot = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n\n &:after {\n content: '';\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ", ";\n }\n\n &.small {\n &:after {\n width: 6px;\n height: 6px;\n }\n\n &.current:after {\n width: 10px;\n height: 10px;\n }\n }\n\n &.medium {\n &:after {\n width: 8px;\n height: 8px;\n }\n\n &.current:after {\n width: 12px;\n height: 12px;\n }\n }\n\n &.large {\n &:after {\n width: 12px;\n height: 12px;\n }\n\n &.current:after {\n width: 16px;\n height: 16px;\n }\n }\n\n\n &.active:after {\n background-color: ", ";\n }\n\n &.current:after {\n background-color: ", ";\n }\n\n &.inverted:after {\n background-color: ", ";\n }\n\n &.inverted.active:after {\n background-color: ", ";\n }\n\n &.inverted.current:after {\n background-color: ", ";\n }\n"])), _styles.COLORS.neutral_400, _styles.COLORS.accent1_600, _styles.COLORS.accent1_800, _styles.COLORS.neutral_400, _styles.COLORS.accent1_400, _styles.COLORS.white);
31
+
32
+ exports.Dot = Dot;
33
+
34
+ var LineFill = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n max-width: 100%;\n position: absolute;\n z-index: 1;\n"])));
35
+
36
+ exports.LineFill = LineFill;
37
+
38
+ var Line = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n height: 100%;\n background-color: ", ";\n position: absolute;\n right: 0;\n }\n\n &:before {\n content: '';\n display: block;\n height: 100%;\n background-color: ", ";\n position: absolute;\n left: 0;\n }\n\n &.small {\n height: 6px;\n border-radius: 4px;\n\n ", " {\n border-radius: 4px;\n }\n\n &:after {\n width: 3px;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n\n &:before {\n width: 3px;\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n &.medium {\n height: 8px;\n border-radius: 4px;\n\n ", " {\n border-radius: 4px;\n }\n\n &:after {\n width: 4px;\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n\n &:before {\n width: 4px;\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n }\n\n &.large {\n height: 12px;\n border-radius: 6px;\n\n ", " {\n border-radius: 6px;\n }\n\n &:after {\n width: 6px;\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n\n &:before {\n width: 6px;\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n }\n\n background-color: ", ";\n\n ", " {\n background-color: ", ";\n }\n\n &.inverted {\n background-color: ", ";\n\n &:after,\n &:before {\n background-color: ", ";\n }\n\n ", " {\n background-color: ", ";\n }\n }\n"])), _styles.COLORS.neutral_500, _styles.COLORS.neutral_500, LineFill, LineFill, LineFill, _styles.COLORS.neutral_100, LineFill, _styles.COLORS.accent1_500, _styles.COLORS.neutral_700, _styles.COLORS.neutral_400, LineFill, _styles.COLORS.accent1_400);
39
+
40
+ exports.Line = Line;
41
+
42
+ var Label = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n"])), _styles.COLORS.black);
43
+
44
+ var Content = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n flex-direction: row;\n height: 16px;\n"])));
45
+
46
+ var Wrapper = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n &.inverted {\n ", " {\n color: ", ";\n }\n }\n\n &.small {\n gap: 4px;\n\n ", " {\n ", "\n }\n\n ", " {\n gap: 4px;\n\n ", ":first-of-type {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n ", ":last-of-type {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n }\n }\n\n &.medium {\n ", " {\n ", "\n }\n\n ", " {\n gap: 6px;\n\n ", ":first-of-type {\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n\n ", ":last-of-type {\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n }\n }\n\n &.large {\n ", " {\n ", "\n }\n\n ", " {\n gap: 8px;\n\n ", ":first-of-type {\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n\n ", ":last-of-type {\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n }\n }\n\n &.dots.small,\n &.dots.medium {\n ", " {\n padding: 0 2px;\n }\n }\n\n &.dots.large {\n ", " {\n padding: 0 3px;\n }\n }\n"])), Label, _styles.COLORS.white, Label, (0, _styles.ComponentSStyling)(_styles.ComponentTextStyle.Regular, null), Content, Bar, Bar, Label, (0, _styles.ComponentMStyling)(_styles.ComponentTextStyle.Regular, null), Content, Bar, Bar, Label, (0, _styles.ComponentLStyling)(_styles.ComponentTextStyle.Regular, null), Content, Bar, Bar, Content, Content);
47
+
48
+ var LinearProgressType;
49
+ exports.LinearProgressType = LinearProgressType;
50
+
51
+ (function (LinearProgressType) {
52
+ LinearProgressType["Dots"] = "dots";
53
+ LinearProgressType["Line"] = "line";
54
+ LinearProgressType["Bars"] = "bars";
55
+ })(LinearProgressType || (exports.LinearProgressType = LinearProgressType = {}));
56
+
57
+ var LinearProgressVariant;
58
+ exports.LinearProgressVariant = LinearProgressVariant;
59
+
60
+ (function (LinearProgressVariant) {
61
+ LinearProgressVariant["Normal"] = "normal";
62
+ LinearProgressVariant["Inverted"] = "inverted";
63
+ })(LinearProgressVariant || (exports.LinearProgressVariant = LinearProgressVariant = {}));
64
+
65
+ var LinearProgress = function LinearProgress(_ref) {
66
+ var _ref$size = _ref.size,
67
+ size = _ref$size === void 0 ? _types.Size.Medium : _ref$size,
68
+ _ref$type = _ref.type,
69
+ type = _ref$type === void 0 ? LinearProgressType.Line : _ref$type,
70
+ _ref$variant = _ref.variant,
71
+ variant = _ref$variant === void 0 ? LinearProgressVariant.Normal : _ref$variant,
72
+ label = _ref.label,
73
+ value = _ref.value,
74
+ max = _ref.max;
75
+
76
+ var renderBars = function renderBars() {
77
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
78
+ children: Array.from(Array(max).keys()).map(function (i) {
79
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Bar, {
80
+ className: "".concat(Math.ceil(value) >= i + 1 ? 'active' : '', " ").concat(Math.ceil(value) === i + 1 ? 'current' : '', " ").concat(variant, " ").concat(size)
81
+ }, i);
82
+ })
83
+ });
84
+ };
85
+
86
+ var renderDots = function renderDots() {
87
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
88
+ children: Array.from(Array(max).keys()).map(function (i) {
89
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Dot, {
90
+ className: "".concat(Math.ceil(value) >= i + 1 ? 'active' : '', " ").concat(Math.ceil(value) === i + 1 ? 'current' : '', " ").concat(variant, " ").concat(size)
91
+ }, i);
92
+ })
93
+ });
94
+ };
95
+
96
+ var renderLine = function renderLine() {
97
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
98
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Line, {
99
+ className: "".concat(variant, " ").concat(size),
100
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(LineFill, {
101
+ style: {
102
+ width: "".concat(value / max * 100, "%")
103
+ }
104
+ })
105
+ })
106
+ });
107
+ };
108
+
109
+ var render = function render() {
110
+ switch (type) {
111
+ case LinearProgressType.Bars:
112
+ return renderBars();
113
+
114
+ case LinearProgressType.Dots:
115
+ return renderDots();
116
+
117
+ case LinearProgressType.Line:
118
+ default:
119
+ return renderLine();
120
+ }
121
+ };
122
+
123
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
124
+ className: "".concat(size, " ").concat(type, " ").concat(variant),
125
+ children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, {
126
+ children: label
127
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, {
128
+ children: render()
129
+ })]
130
+ });
131
+ };
132
+
133
+ LinearProgress.propTypes = {
134
+ type: _propTypes.default.oneOf(["dots", "line", "bars"]),
135
+ variant: _propTypes.default.oneOf(["normal", "inverted"]),
136
+ label: _propTypes.default.string,
137
+ value: _propTypes.default.number.isRequired,
138
+ max: _propTypes.default.number.isRequired
139
+ };
140
+ var _default = LinearProgress;
141
+ exports.default = _default;
142
+ //# sourceMappingURL=LinearProgress.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/LinearProgress/LinearProgress.tsx"],"names":["Bar","styled","div","COLORS","neutral_100","accent1_400","accent1_800","neutral_600","white","Dot","neutral_400","accent1_600","LineFill","Line","neutral_500","accent1_500","neutral_700","Label","black","Content","Wrapper","ComponentTextStyle","Regular","LinearProgressType","LinearProgressVariant","LinearProgress","size","Size","Medium","type","variant","Normal","label","value","max","renderBars","Array","from","keys","map","i","Math","ceil","renderDots","renderLine","width","render","Bars","Dots"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAEO,IAAMA,GAAG,GAAGC,0BAAOC,GAAV,qhBAgBMC,eAAOC,WAhBb,EAmBQD,eAA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styled-components';\nimport {COLORS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle} from '../styles';\n\nexport const Bar = styled.div`\n flex: 1;\n height: 6px;\n\n &.small {\n height: 6px;\n }\n\n &.medium {\n height: 8px;\n }\n\n &.large {\n height: 12px;\n }\n\n background-color: ${COLORS.neutral_100};\n\n &.active {\n background-color: ${COLORS.accent1_400};\n }\n\n &.current {\n background-color: ${COLORS.accent1_800};\n }\n\n &.inverted {\n background-color: ${COLORS.neutral_600};\n }\n\n &.inverted.active {\n background-color: ${COLORS.accent1_400};\n }\n\n &.inverted.current {\n background-color: ${COLORS.white};\n }\n\n`;\n\nexport const Dot = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n\n &:after {\n content: '';\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ${COLORS.neutral_400};\n }\n\n &.small {\n &:after {\n width: 6px;\n height: 6px;\n }\n\n &.current:after {\n width: 10px;\n height: 10px;\n }\n }\n\n &.medium {\n &:after {\n width: 8px;\n height: 8px;\n }\n\n &.current:after {\n width: 12px;\n height: 12px;\n }\n }\n\n &.large {\n &:after {\n width: 12px;\n height: 12px;\n }\n\n &.current:after {\n width: 16px;\n height: 16px;\n }\n }\n\n\n &.active:after {\n background-color: ${COLORS.accent1_600};\n }\n\n &.current:after {\n background-color: ${COLORS.accent1_800};\n }\n\n &.inverted:after {\n background-color: ${COLORS.neutral_400};\n }\n\n &.inverted.active:after {\n background-color: ${COLORS.accent1_400};\n }\n\n &.inverted.current:after {\n background-color: ${COLORS.white};\n }\n`;\n\nexport const LineFill = styled.div`\n height: 100%;\n max-width: 100%;\n position: absolute;\n z-index: 1;\n`;\n\nexport const Line = styled.div`\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n height: 100%;\n background-color: ${COLORS.neutral_500};\n position: absolute;\n right: 0;\n }\n\n &:before {\n content: '';\n display: block;\n height: 100%;\n background-color: ${COLORS.neutral_500};\n position: absolute;\n left: 0;\n }\n\n &.small {\n height: 6px;\n border-radius: 4px;\n\n ${LineFill} {\n border-radius: 4px;\n }\n\n &:after {\n width: 3px;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n\n &:before {\n width: 3px;\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n &.medium {\n height: 8px;\n border-radius: 4px;\n\n ${LineFill} {\n border-radius: 4px;\n }\n\n &:after {\n width: 4px;\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n\n &:before {\n width: 4px;\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n }\n\n &.large {\n height: 12px;\n border-radius: 6px;\n\n ${LineFill} {\n border-radius: 6px;\n }\n\n &:after {\n width: 6px;\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n\n &:before {\n width: 6px;\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n }\n\n background-color: ${COLORS.neutral_100};\n\n ${LineFill} {\n background-color: ${COLORS.accent1_500};\n }\n\n &.inverted {\n background-color: ${COLORS.neutral_700};\n\n &:after,\n &:before {\n background-color: ${COLORS.neutral_400};\n }\n\n ${LineFill} {\n background-color: ${COLORS.accent1_400};\n }\n }\n`;\n\nconst Label = styled.div`\n color: ${COLORS.black};\n`;\n\nconst Content = styled.div`\n display: flex;\n align-items: center;\n flex-direction: row;\n height: 16px;\n`;\n\nconst Wrapper = styled.div`\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n &.inverted {\n ${Label} {\n color: ${COLORS.white};\n }\n }\n\n &.small {\n gap: 4px;\n\n ${Label} {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n }\n\n ${Content} {\n gap: 4px;\n\n ${Bar}:first-of-type {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n ${Bar}:last-of-type {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n }\n }\n\n &.medium {\n ${Label} {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n }\n\n ${Content} {\n gap: 6px;\n\n ${Bar}:first-of-type {\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n\n ${Bar}:last-of-type {\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n }\n }\n\n &.large {\n ${Label} {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n }\n\n ${Content} {\n gap: 8px;\n\n ${Bar}:first-of-type {\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n\n ${Bar}:last-of-type {\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n }\n }\n\n &.dots.small,\n &.dots.medium {\n ${Content} {\n padding: 0 2px;\n }\n }\n\n &.dots.large {\n ${Content} {\n padding: 0 3px;\n }\n }\n`;\n\nexport enum LinearProgressType {\n Dots = 'dots',\n Line = 'line',\n Bars = 'bars',\n}\n\nexport enum LinearProgressVariant {\n Normal = 'normal',\n Inverted = 'inverted',\n}\n\nexport interface LinearProgressProps {\n size?: Size.Small | Size.Medium | Size.Large;\n type?: LinearProgressType;\n variant?: LinearProgressVariant;\n\n label?: string;\n\n value: number;\n max: number;\n}\n\nconst LinearProgress: React.FunctionComponent<LinearProgressProps> = ({\n size = Size.Medium,\n type = LinearProgressType.Line,\n variant = LinearProgressVariant.Normal,\n label,\n value,\n max\n }) => {\n\n const renderBars = () =>\n <>\n {Array.from(Array(max).keys()).map(i => (\n <Bar key={i}\n className={`${Math.ceil(value) >= i + 1 ? 'active' : ''} ${Math.ceil(value) === i + 1 ? 'current' : ''} ${variant} ${size}`}/>\n ))}\n </>\n\n const renderDots = () =>\n <>\n {Array.from(Array(max).keys()).map(i => (\n <Dot key={i}\n className={`${Math.ceil(value) >= i + 1 ? 'active' : ''} ${Math.ceil(value) === i + 1 ? 'current' : ''} ${variant} ${size}`}/>\n ))}\n </>\n\n const renderLine = () =>\n <>\n <Line className={`${variant} ${size}`}>\n <LineFill style={{width: `${value / max * 100}%`}}/>\n </Line>\n </>\n\n\n const render = () => {\n switch (type) {\n case LinearProgressType.Bars:\n return renderBars();\n case LinearProgressType.Dots:\n return renderDots();\n case LinearProgressType.Line:\n default:\n return renderLine();\n }\n }\n\n return (\n <Wrapper className={`${size} ${type} ${variant}`}>\n {label && <Label>{label}</Label>}\n <Content>\n {render()}\n </Content>\n </Wrapper>\n )\n};\n\nexport default LinearProgress;\n"],"file":"LinearProgress.cjs"}
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { Size } from '../types';
3
+ export declare const Bar: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export declare const Dot: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export declare const LineFill: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export declare const Line: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare enum LinearProgressType {
8
+ Dots = "dots",
9
+ Line = "line",
10
+ Bars = "bars"
11
+ }
12
+ export declare enum LinearProgressVariant {
13
+ Normal = "normal",
14
+ Inverted = "inverted"
15
+ }
16
+ export interface LinearProgressProps {
17
+ size?: Size.Small | Size.Medium | Size.Large;
18
+ type?: LinearProgressType;
19
+ variant?: LinearProgressVariant;
20
+ label?: string;
21
+ value: number;
22
+ max: number;
23
+ }
24
+ declare const LinearProgress: React.FunctionComponent<LinearProgressProps>;
25
+ export default LinearProgress;
@@ -0,0 +1,111 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ import _pt from "prop-types";
3
+
4
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
5
+
6
+ import React from 'react';
7
+ import { Size } from '../types';
8
+ import styled from 'styled-components';
9
+ import { COLORS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle } from '../styles';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ export var Bar = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n height: 6px;\n\n &.small {\n height: 6px;\n }\n\n &.medium {\n height: 8px;\n }\n\n &.large {\n height: 12px;\n }\n\n background-color: ", ";\n\n &.active {\n background-color: ", ";\n }\n\n &.current {\n background-color: ", ";\n }\n\n &.inverted {\n background-color: ", ";\n }\n\n &.inverted.active {\n background-color: ", ";\n }\n\n &.inverted.current {\n background-color: ", ";\n }\n\n"])), COLORS.neutral_100, COLORS.accent1_400, COLORS.accent1_800, COLORS.neutral_600, COLORS.accent1_400, COLORS.white);
14
+ export var Dot = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n\n &:after {\n content: '';\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ", ";\n }\n\n &.small {\n &:after {\n width: 6px;\n height: 6px;\n }\n\n &.current:after {\n width: 10px;\n height: 10px;\n }\n }\n\n &.medium {\n &:after {\n width: 8px;\n height: 8px;\n }\n\n &.current:after {\n width: 12px;\n height: 12px;\n }\n }\n\n &.large {\n &:after {\n width: 12px;\n height: 12px;\n }\n\n &.current:after {\n width: 16px;\n height: 16px;\n }\n }\n\n\n &.active:after {\n background-color: ", ";\n }\n\n &.current:after {\n background-color: ", ";\n }\n\n &.inverted:after {\n background-color: ", ";\n }\n\n &.inverted.active:after {\n background-color: ", ";\n }\n\n &.inverted.current:after {\n background-color: ", ";\n }\n"])), COLORS.neutral_400, COLORS.accent1_600, COLORS.accent1_800, COLORS.neutral_400, COLORS.accent1_400, COLORS.white);
15
+ export var LineFill = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n height: 100%;\n max-width: 100%;\n position: absolute;\n z-index: 1;\n"])));
16
+ export var Line = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n height: 100%;\n background-color: ", ";\n position: absolute;\n right: 0;\n }\n\n &:before {\n content: '';\n display: block;\n height: 100%;\n background-color: ", ";\n position: absolute;\n left: 0;\n }\n\n &.small {\n height: 6px;\n border-radius: 4px;\n\n ", " {\n border-radius: 4px;\n }\n\n &:after {\n width: 3px;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n\n &:before {\n width: 3px;\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n &.medium {\n height: 8px;\n border-radius: 4px;\n\n ", " {\n border-radius: 4px;\n }\n\n &:after {\n width: 4px;\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n\n &:before {\n width: 4px;\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n }\n\n &.large {\n height: 12px;\n border-radius: 6px;\n\n ", " {\n border-radius: 6px;\n }\n\n &:after {\n width: 6px;\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n\n &:before {\n width: 6px;\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n }\n\n background-color: ", ";\n\n ", " {\n background-color: ", ";\n }\n\n &.inverted {\n background-color: ", ";\n\n &:after,\n &:before {\n background-color: ", ";\n }\n\n ", " {\n background-color: ", ";\n }\n }\n"])), COLORS.neutral_500, COLORS.neutral_500, LineFill, LineFill, LineFill, COLORS.neutral_100, LineFill, COLORS.accent1_500, COLORS.neutral_700, COLORS.neutral_400, LineFill, COLORS.accent1_400);
17
+ var Label = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n"])), COLORS.black);
18
+ var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-direction: row;\n height: 16px;\n"])));
19
+ var Wrapper = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n &.inverted {\n ", " {\n color: ", ";\n }\n }\n\n &.small {\n gap: 4px;\n\n ", " {\n ", "\n }\n\n ", " {\n gap: 4px;\n\n ", ":first-of-type {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n ", ":last-of-type {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n }\n }\n\n &.medium {\n ", " {\n ", "\n }\n\n ", " {\n gap: 6px;\n\n ", ":first-of-type {\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n\n ", ":last-of-type {\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n }\n }\n\n &.large {\n ", " {\n ", "\n }\n\n ", " {\n gap: 8px;\n\n ", ":first-of-type {\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n\n ", ":last-of-type {\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n }\n }\n\n &.dots.small,\n &.dots.medium {\n ", " {\n padding: 0 2px;\n }\n }\n\n &.dots.large {\n ", " {\n padding: 0 3px;\n }\n }\n"])), Label, COLORS.white, Label, ComponentSStyling(ComponentTextStyle.Regular, null), Content, Bar, Bar, Label, ComponentMStyling(ComponentTextStyle.Regular, null), Content, Bar, Bar, Label, ComponentLStyling(ComponentTextStyle.Regular, null), Content, Bar, Bar, Content, Content);
20
+ export var LinearProgressType;
21
+
22
+ (function (LinearProgressType) {
23
+ LinearProgressType["Dots"] = "dots";
24
+ LinearProgressType["Line"] = "line";
25
+ LinearProgressType["Bars"] = "bars";
26
+ })(LinearProgressType || (LinearProgressType = {}));
27
+
28
+ export var LinearProgressVariant;
29
+
30
+ (function (LinearProgressVariant) {
31
+ LinearProgressVariant["Normal"] = "normal";
32
+ LinearProgressVariant["Inverted"] = "inverted";
33
+ })(LinearProgressVariant || (LinearProgressVariant = {}));
34
+
35
+ var LinearProgress = function LinearProgress(_ref) {
36
+ var _ref$size = _ref.size,
37
+ size = _ref$size === void 0 ? Size.Medium : _ref$size,
38
+ _ref$type = _ref.type,
39
+ type = _ref$type === void 0 ? LinearProgressType.Line : _ref$type,
40
+ _ref$variant = _ref.variant,
41
+ variant = _ref$variant === void 0 ? LinearProgressVariant.Normal : _ref$variant,
42
+ label = _ref.label,
43
+ value = _ref.value,
44
+ max = _ref.max;
45
+
46
+ var renderBars = function renderBars() {
47
+ return /*#__PURE__*/_jsx(_Fragment, {
48
+ children: Array.from(Array(max).keys()).map(function (i) {
49
+ return /*#__PURE__*/_jsx(Bar, {
50
+ className: "".concat(Math.ceil(value) >= i + 1 ? 'active' : '', " ").concat(Math.ceil(value) === i + 1 ? 'current' : '', " ").concat(variant, " ").concat(size)
51
+ }, i);
52
+ })
53
+ });
54
+ };
55
+
56
+ var renderDots = function renderDots() {
57
+ return /*#__PURE__*/_jsx(_Fragment, {
58
+ children: Array.from(Array(max).keys()).map(function (i) {
59
+ return /*#__PURE__*/_jsx(Dot, {
60
+ className: "".concat(Math.ceil(value) >= i + 1 ? 'active' : '', " ").concat(Math.ceil(value) === i + 1 ? 'current' : '', " ").concat(variant, " ").concat(size)
61
+ }, i);
62
+ })
63
+ });
64
+ };
65
+
66
+ var renderLine = function renderLine() {
67
+ return /*#__PURE__*/_jsx(_Fragment, {
68
+ children: /*#__PURE__*/_jsx(Line, {
69
+ className: "".concat(variant, " ").concat(size),
70
+ children: /*#__PURE__*/_jsx(LineFill, {
71
+ style: {
72
+ width: "".concat(value / max * 100, "%")
73
+ }
74
+ })
75
+ })
76
+ });
77
+ };
78
+
79
+ var render = function render() {
80
+ switch (type) {
81
+ case LinearProgressType.Bars:
82
+ return renderBars();
83
+
84
+ case LinearProgressType.Dots:
85
+ return renderDots();
86
+
87
+ case LinearProgressType.Line:
88
+ default:
89
+ return renderLine();
90
+ }
91
+ };
92
+
93
+ return /*#__PURE__*/_jsxs(Wrapper, {
94
+ className: "".concat(size, " ").concat(type, " ").concat(variant),
95
+ children: [label && /*#__PURE__*/_jsx(Label, {
96
+ children: label
97
+ }), /*#__PURE__*/_jsx(Content, {
98
+ children: render()
99
+ })]
100
+ });
101
+ };
102
+
103
+ LinearProgress.propTypes = {
104
+ type: _pt.oneOf(["dots", "line", "bars"]),
105
+ variant: _pt.oneOf(["normal", "inverted"]),
106
+ label: _pt.string,
107
+ value: _pt.number.isRequired,
108
+ max: _pt.number.isRequired
109
+ };
110
+ export default LinearProgress;
111
+ //# sourceMappingURL=LinearProgress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/LinearProgress/LinearProgress.tsx"],"names":["React","Size","styled","COLORS","ComponentLStyling","ComponentMStyling","ComponentSStyling","ComponentTextStyle","Bar","div","neutral_100","accent1_400","accent1_800","neutral_600","white","Dot","neutral_400","accent1_600","LineFill","Line","neutral_500","accent1_500","neutral_700","Label","black","Content","Wrapper","Regular","LinearProgressType","LinearProgressVariant","LinearProgress","size","Medium","type","variant","Normal","label","value","max","renderBars","Array","from","keys","map","i","Math","ceil","renderDots","renderLine","width","render","Bars","Dots"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,IAAR,QAAmB,UAAnB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,SAAQC,MAAR,EAAgBC,iBAAhB,EAAmCC,iBAAnC,EAAsDC,iBAAtD,EAAyEC,kBAAzE,QAAkG,WAAlG;;;;AAEA,OAAO,IAAMC,GAAG,GAAGN,MAAM,CAACO,GAAV,ugBAgBMN,MAAM,CAACO,WAhBb,EAmBQP,MAAM,CAACQ,WAnBf,EAuBQR,MAAM,CAACS,WAvBf,EA2BQT,MAAM,CAACU,WA3Bf,EA+BQV,MAAM,CAACQ,WA/Bf,EAmCQR,MAAM,CAACW,KAnCf,CAAT;AAwCP,OAAO,IAAMC,GAAG,GAAGb,MAAM,CAACO,GAAV,wkCAcQN,MAAM,CAACa,WAdf,EAuDQb,MAAM,CAACc,WAvDf,EA2DQd,MAAM,CAACS,W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G,CAAxB,GAA4B,QAA5B,GAAuC,EAA5C,cAAkDC,IAAI,CAACC,IAAL,CAAUT,KAAV,MAAqBO,CAAC,GAAG,CAAzB,GAA6B,SAA7B,GAAyC,EAA3F,cAAiGV,OAAjG,cAA4GH,IAA5G;AADd,WAAUa,CAAV,CADkC;AAAA,OAAnC;AADH,MADiB;AAAA,GAAnB;;AAQA,MAAMI,UAAU,GAAG,SAAbA,UAAa;AAAA,wBACjB;AAAA,6BACE,KAAC,IAAD;AAAM,QAAA,SAAS,YAAKd,OAAL,cAAgBH,IAAhB,CAAf;AAAA,+BACE,KAAC,QAAD;AAAU,UAAA,KAAK,EAAE;AAACkB,YAAAA,KAAK,YAAKZ,KAAK,GAAGC,GAAR,GAAc,GAAnB;AAAN;AAAjB;AADF;AADF,MADiB;AAAA,GAAnB;;AAQA,MAAMY,MAAM,GAAG,SAATA,MAAS,GAAM;AACnB,YAAQjB,IAAR;AACE,WAAKL,kBAAkB,CAACuB,IAAxB;AACE,eAAOZ,UAAU,EAAjB;;AACF,WAAKX,kBAAkB,CAACwB,IAAxB;AACE,eAAOL,UAAU,EAAjB;;AACF,WAAKnB,kBAAkB,CAACT,IAAxB;AACA;AACE,eAAO6B,UAAU,EAAjB;AAPJ;AASD,GAVD;;AAYA,sBACE,MAAC,OAAD;AAAS,IAAA,SAAS,YAAKjB,IAAL,cAAaE,IAAb,cAAqBC,OAArB,CAAlB;AAAA,eACGE,KAAK,iBAAI,KAAC,KAAD;AAAA,gBAAQA;AAAR,MADZ,eAEE,KAAC,OAAD;AAAA,gBACGc,MAAM;AADT,MAFF;AAAA,IADF;AAQD,CArDD;;;AATEjB,EAAAA,I;AACAC,EAAAA,O;AAEAE,EAAAA,K;AAEAC,EAAAA,K;AACAC,EAAAA,G;;AA0DF,eAAeR,cAAf","sourcesContent":["import React from 'react';\nimport {Size} from '../types';\nimport styled from 'styled-components';\nimport {COLORS, ComponentLStyling, ComponentMStyling, ComponentSStyling, ComponentTextStyle} from '../styles';\n\nexport const Bar = styled.div`\n flex: 1;\n height: 6px;\n\n &.small {\n height: 6px;\n }\n\n &.medium {\n height: 8px;\n }\n\n &.large {\n height: 12px;\n }\n\n background-color: ${COLORS.neutral_100};\n\n &.active {\n background-color: ${COLORS.accent1_400};\n }\n\n &.current {\n background-color: ${COLORS.accent1_800};\n }\n\n &.inverted {\n background-color: ${COLORS.neutral_600};\n }\n\n &.inverted.active {\n background-color: ${COLORS.accent1_400};\n }\n\n &.inverted.current {\n background-color: ${COLORS.white};\n }\n\n`;\n\nexport const Dot = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n\n\n &:after {\n content: '';\n display: block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: ${COLORS.neutral_400};\n }\n\n &.small {\n &:after {\n width: 6px;\n height: 6px;\n }\n\n &.current:after {\n width: 10px;\n height: 10px;\n }\n }\n\n &.medium {\n &:after {\n width: 8px;\n height: 8px;\n }\n\n &.current:after {\n width: 12px;\n height: 12px;\n }\n }\n\n &.large {\n &:after {\n width: 12px;\n height: 12px;\n }\n\n &.current:after {\n width: 16px;\n height: 16px;\n }\n }\n\n\n &.active:after {\n background-color: ${COLORS.accent1_600};\n }\n\n &.current:after {\n background-color: ${COLORS.accent1_800};\n }\n\n &.inverted:after {\n background-color: ${COLORS.neutral_400};\n }\n\n &.inverted.active:after {\n background-color: ${COLORS.accent1_400};\n }\n\n &.inverted.current:after {\n background-color: ${COLORS.white};\n }\n`;\n\nexport const LineFill = styled.div`\n height: 100%;\n max-width: 100%;\n position: absolute;\n z-index: 1;\n`;\n\nexport const Line = styled.div`\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n position: relative;\n\n &:after {\n content: '';\n display: block;\n height: 100%;\n background-color: ${COLORS.neutral_500};\n position: absolute;\n right: 0;\n }\n\n &:before {\n content: '';\n display: block;\n height: 100%;\n background-color: ${COLORS.neutral_500};\n position: absolute;\n left: 0;\n }\n\n &.small {\n height: 6px;\n border-radius: 4px;\n\n ${LineFill} {\n border-radius: 4px;\n }\n\n &:after {\n width: 3px;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n\n &:before {\n width: 3px;\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n &.medium {\n height: 8px;\n border-radius: 4px;\n\n ${LineFill} {\n border-radius: 4px;\n }\n\n &:after {\n width: 4px;\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n\n &:before {\n width: 4px;\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n }\n\n &.large {\n height: 12px;\n border-radius: 6px;\n\n ${LineFill} {\n border-radius: 6px;\n }\n\n &:after {\n width: 6px;\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n\n &:before {\n width: 6px;\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n }\n\n background-color: ${COLORS.neutral_100};\n\n ${LineFill} {\n background-color: ${COLORS.accent1_500};\n }\n\n &.inverted {\n background-color: ${COLORS.neutral_700};\n\n &:after,\n &:before {\n background-color: ${COLORS.neutral_400};\n }\n\n ${LineFill} {\n background-color: ${COLORS.accent1_400};\n }\n }\n`;\n\nconst Label = styled.div`\n color: ${COLORS.black};\n`;\n\nconst Content = styled.div`\n display: flex;\n align-items: center;\n flex-direction: row;\n height: 16px;\n`;\n\nconst Wrapper = styled.div`\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n &.inverted {\n ${Label} {\n color: ${COLORS.white};\n }\n }\n\n &.small {\n gap: 4px;\n\n ${Label} {\n ${ComponentSStyling(ComponentTextStyle.Regular, null)}\n }\n\n ${Content} {\n gap: 4px;\n\n ${Bar}:first-of-type {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n ${Bar}:last-of-type {\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n }\n }\n }\n\n &.medium {\n ${Label} {\n ${ComponentMStyling(ComponentTextStyle.Regular, null)}\n }\n\n ${Content} {\n gap: 6px;\n\n ${Bar}:first-of-type {\n border-top-left-radius: 8px;\n border-bottom-left-radius: 8px;\n }\n\n ${Bar}:last-of-type {\n border-top-right-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n }\n }\n\n &.large {\n ${Label} {\n ${ComponentLStyling(ComponentTextStyle.Regular, null)}\n }\n\n ${Content} {\n gap: 8px;\n\n ${Bar}:first-of-type {\n border-top-left-radius: 12px;\n border-bottom-left-radius: 12px;\n }\n\n ${Bar}:last-of-type {\n border-top-right-radius: 12px;\n border-bottom-right-radius: 12px;\n }\n }\n }\n\n &.dots.small,\n &.dots.medium {\n ${Content} {\n padding: 0 2px;\n }\n }\n\n &.dots.large {\n ${Content} {\n padding: 0 3px;\n }\n }\n`;\n\nexport enum LinearProgressType {\n Dots = 'dots',\n Line = 'line',\n Bars = 'bars',\n}\n\nexport enum LinearProgressVariant {\n Normal = 'normal',\n Inverted = 'inverted',\n}\n\nexport interface LinearProgressProps {\n size?: Size.Small | Size.Medium | Size.Large;\n type?: LinearProgressType;\n variant?: LinearProgressVariant;\n\n label?: string;\n\n value: number;\n max: number;\n}\n\nconst LinearProgress: React.FunctionComponent<LinearProgressProps> = ({\n size = Size.Medium,\n type = LinearProgressType.Line,\n variant = LinearProgressVariant.Normal,\n label,\n value,\n max\n }) => {\n\n const renderBars = () =>\n <>\n {Array.from(Array(max).keys()).map(i => (\n <Bar key={i}\n className={`${Math.ceil(value) >= i + 1 ? 'active' : ''} ${Math.ceil(value) === i + 1 ? 'current' : ''} ${variant} ${size}`}/>\n ))}\n </>\n\n const renderDots = () =>\n <>\n {Array.from(Array(max).keys()).map(i => (\n <Dot key={i}\n className={`${Math.ceil(value) >= i + 1 ? 'active' : ''} ${Math.ceil(value) === i + 1 ? 'current' : ''} ${variant} ${size}`}/>\n ))}\n </>\n\n const renderLine = () =>\n <>\n <Line className={`${variant} ${size}`}>\n <LineFill style={{width: `${value / max * 100}%`}}/>\n </Line>\n </>\n\n\n const render = () => {\n switch (type) {\n case LinearProgressType.Bars:\n return renderBars();\n case LinearProgressType.Dots:\n return renderDots();\n case LinearProgressType.Line:\n default:\n return renderLine();\n }\n }\n\n return (\n <Wrapper className={`${size} ${type} ${variant}`}>\n {label && <Label>{label}</Label>}\n <Content>\n {render()}\n </Content>\n </Wrapper>\n )\n};\n\nexport default LinearProgress;\n"],"file":"LinearProgress.js"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "LinearProgress", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _LinearProgress.default;
12
+ }
13
+ });
14
+ Object.defineProperty(exports, "LinearProgressType", {
15
+ enumerable: true,
16
+ get: function get() {
17
+ return _LinearProgress.LinearProgressType;
18
+ }
19
+ });
20
+ Object.defineProperty(exports, "LinearProgressVariant", {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _LinearProgress.LinearProgressVariant;
24
+ }
25
+ });
26
+
27
+ var _LinearProgress = _interopRequireWildcard(require("./LinearProgress"));
28
+
29
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
30
+
31
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/LinearProgress/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["import LinearProgress, {LinearProgressType, LinearProgressVariant} from './LinearProgress';\n\nexport {LinearProgressType, LinearProgressVariant};\nexport {LinearProgress}\n"],"file":"index.cjs"}
@@ -0,0 +1,3 @@
1
+ import LinearProgress, { LinearProgressType, LinearProgressVariant } from './LinearProgress';
2
+ export { LinearProgressType, LinearProgressVariant };
3
+ export { LinearProgress };
@@ -0,0 +1,4 @@
1
+ import LinearProgress, { LinearProgressType, LinearProgressVariant } from './LinearProgress';
2
+ export { LinearProgressType, LinearProgressVariant };
3
+ export { LinearProgress };
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/LinearProgress/index.ts"],"names":["LinearProgress","LinearProgressType","LinearProgressVariant"],"mappings":"AAAA,OAAOA,cAAP,IAAwBC,kBAAxB,EAA4CC,qBAA5C,QAAwE,kBAAxE;AAEA,SAAQD,kBAAR,EAA4BC,qBAA5B;AACA,SAAQF,cAAR","sourcesContent":["import LinearProgress, {LinearProgressType, LinearProgressVariant} from './LinearProgress';\n\nexport {LinearProgressType, LinearProgressVariant};\nexport {LinearProgress}\n"],"file":"index.js"}
@@ -127,18 +127,23 @@ var ModalContainer = /*#__PURE__*/function (_React$Component) {
127
127
  _this$props$minWidth = _this$props.minWidth,
128
128
  minWidth = _this$props$minWidth === void 0 ? '' : _this$props$minWidth,
129
129
  _this$props$maxWidth = _this$props.maxWidth,
130
- maxWidth = _this$props$maxWidth === void 0 ? '' : _this$props$maxWidth;
130
+ maxWidth = _this$props$maxWidth === void 0 ? '' : _this$props$maxWidth,
131
+ _this$props$zIndex = _this$props.zIndex,
132
+ zIndex = _this$props$zIndex === void 0 ? parseInt(_zIndexes.Z_INDEXES.modal) : _this$props$zIndex;
131
133
  var sizes = this.GetSize(modalHeight, modalWidth);
132
134
  var height = sizes.height,
133
135
  width = sizes.width;
134
- var overflow = this.GetOverflow(modalOverflow);
136
+ var overflow = this.GetOverflow(modalOverflow); // should be at least z-index of modal and below z-index of toast
137
+
138
+ var zIndexValue = Math.min(Math.max(zIndex, +_zIndexes.Z_INDEXES.modal), +_zIndexes.Z_INDEXES.toast - 1);
135
139
  var stylesConfiguration = Object.assign(_objectSpread({}, ModalContainerStyles.content), {
136
140
  height: height,
137
141
  width: width,
138
142
  padding: padding,
139
143
  overflow: overflow,
140
144
  minWidth: minWidth,
141
- maxWidth: maxWidth
145
+ maxWidth: maxWidth,
146
+ zIndex: zIndexValue
142
147
  });
143
148
  var styles = {
144
149
  content: stylesConfiguration
@@ -169,7 +174,8 @@ var ModalContainer = /*#__PURE__*/function (_React$Component) {
169
174
  modalOverflow: _propTypes.default.string,
170
175
  padding: _propTypes.default.string,
171
176
  minWidth: _propTypes.default.string,
172
- maxWidth: _propTypes.default.string
177
+ maxWidth: _propTypes.default.string,
178
+ zIndex: _propTypes.default.number
173
179
  });
174
180
  var _default = ModalContainer;
175
181
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Modals/ModalContainer.tsx"],"names":["ModalContainerStyles","content","top","left","right","bottom","marginRight","width","height","borderRadius","boxSizing","margin","overflow","boxShadow","BOXSHADOWS","BOXSHADOW_L3","modalTransitions","Z_INDEXES","backdrop","modal","ModalContainer","modalHeight","modalWidth","modalOverflow","ReactModal","defaultStyles","overlay","backgroundColor","document","querySelector","head","getElementsByTagName","style","createElement","setAttribute","appendChild","createTextNode","props","id","showModal","closeModal","children","padding","minWidth","maxWidth","sizes","GetSize","GetOverflow","stylesConfiguration","Object","assign","styles","getElementById","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;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EAARA;AAA9C,OAAnD,CAA5B;AACA,UAAMO,MAAM,GAAG;AAAElD,QAAAA,OAAO,EAAE+C;AAAX,OAAf;AAEA,0BACE,qBAAC,mBAAD;AAAY,QAAA,EAAE,EAAEV,EAAhB;AAAoB,QAAA,MAAM,EAAEC,SAA5B;AAAuC,QAAA,cAAc,EAAE,GAAvD;AAA4D,QAAA,cAAc,EAAE;AAAA,iBAAMC,UAAU,EAAhB;AAAA,SAA5E;AAAgG,QAAA,KAAK,EAAEW,MAAvG;AAA+G,QAAA,UAAU,EAAEvB,QAAQ,CAACwB,cAAT,CAAwB,MAAxB,KAAmC,EAA9J;AAAA,kBACGX;AADH,QADF;AAKD;;;EA/B0BY,KAAK,CAACC,S;;8BAA7BlC,c;AAdJkB,EAAAA,E;AACAC,EAAAA,S;AACAC,EAAAA,U;AACAC,EAAAA,Q;AACApB,EAAAA,W;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAmB,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,Q;;eAuCaxB,c","sourcesContent":["import * as React from 'react';\nimport ReactModal from 'react-modal';\nimport { BOXSHADOWS } from '../styles';\nimport {Z_INDEXES} from '../styles/z-indexes';\n\nconst ModalContainerStyles = {\n content: {\n top: '50%',\n left: '50%',\n right: 'auto',\n bottom: 'auto',\n marginRight: '-50%',\n width: '640px',\n height: '320px',\n borderRadius: '8px',\n boxSizing: 'border-box' as any,\n margin: 0,\n overflow: 'auto',\n boxShadow: BOXSHADOWS.BOXSHADOW_L3,\n },\n};\n\n//override modal classes to define the animations\nconst modalTransitions = `\n.ReactModal__Overlay {\n opacity: 0;\n z-index: ${Z_INDEXES.backdrop};\n}\n\n.ReactModal__Overlay--after-open {\n opacity: 1;\n transition: opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Content{\n z-index: ${Z_INDEXES.modal};\n opacity:0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n}\n\n.ReactModal__Content--after-open{\n opacity: 1;\n transform: translate(-50%, -50%) scale(1.0, 1.0);\n transition: transform 150ms ease-in-out, opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Overlay--before-close {\n opacity: 0;\n transition: opacity 120ms linear;\n}\n\n.ReactModal__Content--before-close{\n opacity: 0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n transition: transform 120ms ease-in-out, opacity 120ms cubic-bezier(0.55, 0.05, 0.67, 0.19);\n}\n`;\n\ntype ModalContainerProps = {\n id?: string;\n showModal: boolean;\n closeModal: () => void;\n children: any;\n modalHeight?: any;\n modalWidth?: any;\n modalOverflow?: string;\n padding?: string;\n minWidth?: string;\n maxWidth?: string;\n};\n\ntype ModalContainerState = {};\n\nclass ModalContainer extends React.Component<ModalContainerProps, ModalContainerState> {\n componentDidMount() {\n if (ReactModal.defaultStyles.overlay) {\n ReactModal.defaultStyles.overlay.backgroundColor = 'rgba(0,0,0,0.5)';\n }\n\n //append style node to override modal transition classes\n if (!document.querySelector('[modal-custom-styling=\"active\"]')) {\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.setAttribute('modal-custom-styling', 'active');\n head.appendChild(style);\n style.appendChild(document.createTextNode(modalTransitions));\n }\n }\n\n GetSize = (modalHeight: string = 'auto', modalWidth: string = 'auto') => ({ height: modalHeight, width: modalWidth });\n GetOverflow = (modalOverflow: string = 'visible') => modalOverflow;\n render() {\n const { id, showModal, closeModal, children, modalHeight, modalWidth, modalOverflow, padding, minWidth = '', maxWidth = '' } = this.props;\n const sizes = this.GetSize(modalHeight, modalWidth);\n const { height, width } = sizes;\n const overflow = this.GetOverflow(modalOverflow);\n const stylesConfiguration = Object.assign({ ...ModalContainerStyles.content }, { height, width, padding, overflow, minWidth, maxWidth });\n const styles = { content: stylesConfiguration };\n\n return (\n <ReactModal id={id} isOpen={showModal} closeTimeoutMS={120} onRequestClose={() => closeModal()} style={styles} appElement={document.getElementById('root') || ''}>\n {children}\n </ReactModal>\n );\n }\n}\n\nexport default ModalContainer;\n"],"file":"ModalContainer.cjs"}
1
+ {"version":3,"sources":["../../src/Modals/ModalContainer.tsx"],"names":["ModalContainerStyles","content","top","left","right","bottom","marginRight","width","height","borderRadius","boxSizing","margin","overflow","boxShadow","BOXSHADOWS","BOXSHADOW_L3","modalTransitions","Z_INDEXES","backdrop","modal","ModalContainer","modalHeight","modalWidth","modalOverflow","ReactModal","defaultStyles","overlay","backgroundColor","document","querySelector","head","getElementsByTagName","style","createElement","setAttribute","appendChild","createTextNode","props","id","showModal","closeModal","children","padding","minWidth","maxWidth","zIndex","parseInt","sizes","GetSize","GetOverflow","zIndexValue","Math","min","max","toast","stylesConfiguration","Object","assign","styles","getElementById","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;AAEA,IAAMA,oBAAoB,GAAG;AAC3BC,EAAAA,OAAO,EAAE;AACPC,IAAAA,GAAG,EAAE,KADE;AAEPC,IAAAA,IAAI,EAAE,KAFC;AAGPC,IAAAA,KAAK,EAAE,MAHA;AAIPC,IAAAA,MAAM,EAAE,MAJD;AAKPC,IAAAA,WAAW,EAAE,MALN;AAMPC,IAAAA,KAAK,EAAE,OANA;AAOPC,IAAAA,MAAM,EAAE,OAPD;AAQPC,IAAAA,YAAY,EAAE,KARP;AASPC,IAAAA,SAAS,EAAE,YATJ;AAUPC,IAAAA,MAAM,EAAE,CAVD;AAWPC,IAAAA,QAAQ,EAAE,MAXH;AAYPC,IAAAA,SAAS,EAAEC,mBAAWC;AAZf;AADkB,CAA7B,C,CAiBA;;AACA,IAAMC,gBAAgB,iEAGTC,oBAAUC,QAHD,+KAYTD,oBAAUE,KAZD,okBAAtB;;IAmDMC,c;;;;;;;;;;;;;;;0FAgBM;AAAA,UAACC,WAAD,uEAAuB,MAAvB;AAAA,UAA+BC,UAA/B,uEAAoD,MAApD;AAAA,aAAgE;AAAEd,QAAAA,MAAM,EAAEa,WAA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mB,KAAK,CAACC,S;;8BAA7BzC,c;AAfJkB,EAAAA,E;AACAC,EAAAA,S;AACAC,EAAAA,U;AACAC,EAAAA,Q;AACApB,EAAAA,W;AACAC,EAAAA,U;AACAC,EAAAA,a;AACAmB,EAAAA,O;AACAC,EAAAA,Q;AACAC,EAAAA,Q;AACAC,EAAAA,M;;eAyCazB,c","sourcesContent":["import * as React from 'react';\nimport ReactModal from 'react-modal';\nimport { BOXSHADOWS } from '../styles';\nimport { Z_INDEXES } from '../styles/z-indexes';\n\nconst ModalContainerStyles = {\n content: {\n top: '50%',\n left: '50%',\n right: 'auto',\n bottom: 'auto',\n marginRight: '-50%',\n width: '640px',\n height: '320px',\n borderRadius: '8px',\n boxSizing: 'border-box' as any,\n margin: 0,\n overflow: 'auto',\n boxShadow: BOXSHADOWS.BOXSHADOW_L3,\n },\n};\n\n//override modal classes to define the animations\nconst modalTransitions = `\n.ReactModal__Overlay {\n opacity: 0;\n z-index: ${Z_INDEXES.backdrop};\n}\n\n.ReactModal__Overlay--after-open {\n opacity: 1;\n transition: opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Content{\n z-index: ${Z_INDEXES.modal};\n opacity:0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n}\n\n.ReactModal__Content--after-open{\n opacity: 1;\n transform: translate(-50%, -50%) scale(1.0, 1.0);\n transition: transform 150ms ease-in-out, opacity 150ms cubic-bezier(0.22, 0.61, 0.35, 1);\n}\n\n.ReactModal__Overlay--before-close {\n opacity: 0;\n transition: opacity 120ms linear;\n}\n\n.ReactModal__Content--before-close{\n opacity: 0;\n transform: translate(-50%, -50%) scale(1.1, 1.1);\n transition: transform 120ms ease-in-out, opacity 120ms cubic-bezier(0.55, 0.05, 0.67, 0.19);\n}\n`;\n\ntype ModalContainerProps = {\n id?: string;\n showModal: boolean;\n closeModal: () => void;\n children: any;\n modalHeight?: any;\n modalWidth?: any;\n modalOverflow?: string;\n padding?: string;\n minWidth?: string;\n maxWidth?: string;\n zIndex?: number;\n};\n\ntype ModalContainerState = {};\n\nclass ModalContainer extends React.Component<ModalContainerProps, ModalContainerState> {\n componentDidMount() {\n if (ReactModal.defaultStyles.overlay) {\n ReactModal.defaultStyles.overlay.backgroundColor = 'rgba(0,0,0,0.5)';\n }\n\n //append style node to override modal transition classes\n if (!document.querySelector('[modal-custom-styling=\"active\"]')) {\n const head = document.head || document.getElementsByTagName('head')[0];\n const style = document.createElement('style');\n style.setAttribute('modal-custom-styling', 'active');\n head.appendChild(style);\n style.appendChild(document.createTextNode(modalTransitions));\n }\n }\n\n GetSize = (modalHeight: string = 'auto', modalWidth: string = 'auto') => ({ height: modalHeight, width: modalWidth });\n GetOverflow = (modalOverflow: string = 'visible') => modalOverflow;\n render() {\n const { id, showModal, closeModal, children, modalHeight, modalWidth, modalOverflow, padding, minWidth = '', maxWidth = '', zIndex = parseInt(Z_INDEXES.modal) } = this.props;\n const sizes = this.GetSize(modalHeight, modalWidth);\n const { height, width } = sizes;\n const overflow = this.GetOverflow(modalOverflow);\n // should be at least z-index of modal and below z-index of toast\n const zIndexValue = Math.min(Math.max(zIndex, +Z_INDEXES.modal), +Z_INDEXES.toast - 1);\n const stylesConfiguration = Object.assign({ ...ModalContainerStyles.content }, { height, width, padding, overflow, minWidth, maxWidth, zIndex: zIndexValue });\n const styles = { content: stylesConfiguration };\n\n return (\n <ReactModal id={id} isOpen={showModal} closeTimeoutMS={120} onRequestClose={() => closeModal()} style={styles} appElement={document.getElementById('root') || ''}>\n {children}\n </ReactModal>\n );\n }\n}\n\nexport default ModalContainer;\n"],"file":"ModalContainer.cjs"}
@@ -10,6 +10,7 @@ declare type ModalContainerProps = {
10
10
  padding?: string;
11
11
  minWidth?: string;
12
12
  maxWidth?: string;
13
+ zIndex?: number;
13
14
  };
14
15
  declare type ModalContainerState = {};
15
16
  declare class ModalContainer extends React.Component<ModalContainerProps, ModalContainerState> {
@@ -103,18 +103,23 @@ var ModalContainer = /*#__PURE__*/function (_React$Component) {
103
103
  _this$props$minWidth = _this$props.minWidth,
104
104
  minWidth = _this$props$minWidth === void 0 ? '' : _this$props$minWidth,
105
105
  _this$props$maxWidth = _this$props.maxWidth,
106
- maxWidth = _this$props$maxWidth === void 0 ? '' : _this$props$maxWidth;
106
+ maxWidth = _this$props$maxWidth === void 0 ? '' : _this$props$maxWidth,
107
+ _this$props$zIndex = _this$props.zIndex,
108
+ zIndex = _this$props$zIndex === void 0 ? parseInt(Z_INDEXES.modal) : _this$props$zIndex;
107
109
  var sizes = this.GetSize(modalHeight, modalWidth);
108
110
  var height = sizes.height,
109
111
  width = sizes.width;
110
- var overflow = this.GetOverflow(modalOverflow);
112
+ var overflow = this.GetOverflow(modalOverflow); // should be at least z-index of modal and below z-index of toast
113
+
114
+ var zIndexValue = Math.min(Math.max(zIndex, +Z_INDEXES.modal), +Z_INDEXES.toast - 1);
111
115
  var stylesConfiguration = Object.assign(_objectSpread({}, ModalContainerStyles.content), {
112
116
  height: height,
113
117
  width: width,
114
118
  padding: padding,
115
119
  overflow: overflow,
116
120
  minWidth: minWidth,
117
- maxWidth: maxWidth
121
+ maxWidth: maxWidth,
122
+ zIndex: zIndexValue
118
123
  });
119
124
  var styles = {
120
125
  content: stylesConfiguration
@@ -146,7 +151,8 @@ _defineProperty(ModalContainer, "propTypes", {
146
151
  modalOverflow: _pt.string,
147
152
  padding: _pt.string,
148
153
  minWidth: _pt.string,
149
- maxWidth: _pt.string
154
+ maxWidth: _pt.string,
155
+ zIndex: _pt.number
150
156
  });
151
157
 
152
158
  export default ModalContainer;