@cruk/cruk-react-components 5.0.7 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/README.md +20 -7
  2. package/lib/.storybook/main.d.ts +3 -0
  3. package/lib/.storybook/preview.d.ts +3 -0
  4. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
  5. package/lib/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
  6. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +1 -1
  7. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
  8. package/lib/node_modules/@fortawesome/free-solid-svg-icons/index.js +6 -1
  9. package/lib/node_modules/@fortawesome/free-solid-svg-icons/index.js.map +1 -1
  10. package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
  11. package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
  12. package/lib/node_modules/focus-lock/dist/es2015/focusSolver.js +1 -1
  13. package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
  14. package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
  15. package/lib/node_modules/focus-lock/dist/es2015/sibling.js +1 -1
  16. package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
  17. package/lib/node_modules/focus-lock/dist/es2015/solver.js +1 -1
  18. package/lib/node_modules/focus-lock/dist/es2015/solver.js.map +1 -1
  19. package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
  20. package/lib/node_modules/focus-lock/dist/es2015/utils/all-affected.js +1 -1
  21. package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
  22. package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
  23. package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
  24. package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
  25. package/lib/node_modules/focus-lock/dist/es2015/utils/tabOrder.js.map +1 -1
  26. package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
  27. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js +1 -1
  28. package/lib/node_modules/react-focus-lock/dist/es2015/Combination.js.map +1 -1
  29. package/lib/node_modules/react-focus-lock/dist/es2015/FocusGuard.js.map +1 -1
  30. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js +1 -1
  31. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  32. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js +1 -1
  33. package/lib/node_modules/react-focus-lock/dist/es2015/Trap.js.map +1 -1
  34. package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
  35. package/lib/node_modules/tslib/tslib.es6.js +1 -1
  36. package/lib/node_modules/tslib/tslib.es6.js.map +1 -1
  37. package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  38. package/lib/{components → src/components}/AddressLookup/AddressLookup.stories.d.ts +4 -4
  39. package/lib/{components → src/components}/AddressLookup/index.d.ts +2 -2
  40. package/lib/src/components/AddressLookup/index.js +1 -1
  41. package/lib/src/components/AddressLookup/index.js.map +1 -1
  42. package/lib/src/components/AddressLookup/styles.js +38 -1
  43. package/lib/src/components/AddressLookup/styles.js.map +1 -1
  44. package/lib/{components → src/components}/Avatar/Avatar.stories.d.ts +1 -1
  45. package/lib/src/components/Avatar/index.js +1 -1
  46. package/lib/src/components/Avatar/index.js.map +1 -1
  47. package/lib/src/components/Avatar/styles.js +10 -1
  48. package/lib/src/components/Avatar/styles.js.map +1 -1
  49. package/lib/{components → src/components}/Badge/Badge.stories.d.ts +1 -1
  50. package/lib/src/components/Badge/index.js +1 -1
  51. package/lib/src/components/Badge/index.js.map +1 -1
  52. package/lib/src/components/Badge/styles.js +17 -1
  53. package/lib/src/components/Badge/styles.js.map +1 -1
  54. package/lib/{components → src/components}/Box/Box.stories.d.ts +2 -2
  55. package/lib/{components → src/components}/Box/index.d.ts +1 -1
  56. package/lib/src/components/Box/index.js +1 -1
  57. package/lib/src/components/Box/index.js.map +1 -1
  58. package/lib/src/components/Box/styles.js +13 -1
  59. package/lib/src/components/Box/styles.js.map +1 -1
  60. package/lib/{components → src/components}/Button/Button.stories.d.ts +2 -2
  61. package/lib/{components → src/components}/Button/index.d.ts +1 -1
  62. package/lib/src/components/Button/index.js +1 -1
  63. package/lib/src/components/Button/index.js.map +1 -1
  64. package/lib/src/components/Button/styles.js +108 -1
  65. package/lib/src/components/Button/styles.js.map +1 -1
  66. package/lib/{components → src/components}/Carousel/Carousel.stories.d.ts +2 -2
  67. package/lib/src/components/Carousel/Dots.js +1 -1
  68. package/lib/src/components/Carousel/Dots.js.map +1 -1
  69. package/lib/src/components/Carousel/index.js +1 -1
  70. package/lib/src/components/Carousel/index.js.map +1 -1
  71. package/lib/src/components/Carousel/styles.js +96 -1
  72. package/lib/src/components/Carousel/styles.js.map +1 -1
  73. package/lib/{components → src/components}/Checkbox/Checkbox.stories.d.ts +3 -3
  74. package/lib/{components → src/components}/Checkbox/index.d.ts +3 -3
  75. package/lib/src/components/Checkbox/index.js +1 -1
  76. package/lib/src/components/Checkbox/index.js.map +1 -1
  77. package/lib/src/components/Checkbox/styles.js +105 -1
  78. package/lib/src/components/Checkbox/styles.js.map +1 -1
  79. package/lib/{components → src/components}/Collapse/Collapse.stories.d.ts +1 -1
  80. package/lib/src/components/Collapse/index.js +1 -1
  81. package/lib/src/components/Collapse/index.js.map +1 -1
  82. package/lib/{components → src/components}/Collapse/styles.d.ts +11 -3
  83. package/lib/src/components/Collapse/styles.js +31 -1
  84. package/lib/src/components/Collapse/styles.js.map +1 -1
  85. package/lib/{components → src/components}/DateField/DateField.stories.d.ts +1 -1
  86. package/lib/src/components/DateField/index.js +1 -1
  87. package/lib/src/components/DateField/index.js.map +1 -1
  88. package/lib/{components → src/components}/DateField/styles.d.ts +12 -6
  89. package/lib/src/components/DateField/styles.js +26 -1
  90. package/lib/src/components/DateField/styles.js.map +1 -1
  91. package/lib/src/components/Divider.js +17 -1
  92. package/lib/src/components/Divider.js.map +1 -1
  93. package/lib/{components → src/components}/ErrorText/ErrorText.stories.d.ts +1 -1
  94. package/lib/src/components/ErrorText/index.js +1 -1
  95. package/lib/src/components/ErrorText/index.js.map +1 -1
  96. package/lib/src/components/ErrorText/styles.d.ts +16 -0
  97. package/lib/src/components/ErrorText/styles.js +5 -1
  98. package/lib/src/components/ErrorText/styles.js.map +1 -1
  99. package/lib/src/components/Flex.js +7 -1
  100. package/lib/src/components/Flex.js.map +1 -1
  101. package/lib/src/components/Fontface.js +1 -1
  102. package/lib/src/components/Fontface.js.map +1 -1
  103. package/lib/{components → src/components}/Footer/Footer.stories.d.ts +2 -2
  104. package/lib/src/components/Footer/index.js +1 -1
  105. package/lib/src/components/Footer/index.js.map +1 -1
  106. package/lib/{components → src/components}/Footer/styles.d.ts +3 -9
  107. package/lib/src/components/Footer/styles.js +69 -1
  108. package/lib/src/components/Footer/styles.js.map +1 -1
  109. package/lib/src/components/GlobalStyle.d.ts +2 -0
  110. package/lib/src/components/GlobalStyle.js +37 -1
  111. package/lib/src/components/GlobalStyle.js.map +1 -1
  112. package/lib/src/components/GlobalStyleNoFontFace.d.ts +2 -0
  113. package/lib/src/components/GlobalStyleNoFontFace.js +37 -1
  114. package/lib/src/components/GlobalStyleNoFontFace.js.map +1 -1
  115. package/lib/{components → src/components}/Header/Header.stories.d.ts +1 -1
  116. package/lib/src/components/Header/index.js +1 -1
  117. package/lib/src/components/Header/index.js.map +1 -1
  118. package/lib/src/components/Header/styles.js +109 -1
  119. package/lib/src/components/Header/styles.js.map +1 -1
  120. package/lib/{components → src/components}/Heading/Heading.stories.d.ts +1 -1
  121. package/lib/src/components/Heading/index.js +1 -1
  122. package/lib/src/components/Heading/index.js.map +1 -1
  123. package/lib/src/components/Heading/styles.js +75 -1
  124. package/lib/src/components/Heading/styles.js.map +1 -1
  125. package/lib/{components → src/components}/IconFa/IconFa.stories.d.ts +1 -1
  126. package/lib/src/components/IconFa/index.js +1 -1
  127. package/lib/src/components/IconFa/index.js.map +1 -1
  128. package/lib/src/components/IconFa/styles.js +10 -1
  129. package/lib/src/components/IconFa/styles.js.map +1 -1
  130. package/lib/{components → src/components}/InfoBox/InfoBox.stories.d.ts +2 -2
  131. package/lib/{components → src/components}/InfoBox/index.d.ts +1 -1
  132. package/lib/src/components/InfoBox/index.js +1 -1
  133. package/lib/src/components/InfoBox/index.js.map +1 -1
  134. package/lib/src/components/InfoBox/styles.d.ts +13 -0
  135. package/lib/src/components/InfoBox/styles.js +12 -1
  136. package/lib/src/components/InfoBox/styles.js.map +1 -1
  137. package/lib/src/components/LabelWrapper/index.js +1 -1
  138. package/lib/src/components/LabelWrapper/index.js.map +1 -1
  139. package/lib/src/components/LabelWrapper/styles.js +15 -1
  140. package/lib/src/components/LabelWrapper/styles.js.map +1 -1
  141. package/lib/{components → src/components}/LegendWrapper/LegendWrapper.stories.d.ts +1 -1
  142. package/lib/src/components/LegendWrapper/index.js +1 -1
  143. package/lib/src/components/LegendWrapper/index.js.map +1 -1
  144. package/lib/src/components/LegendWrapper/styles.js +34 -1
  145. package/lib/src/components/LegendWrapper/styles.js.map +1 -1
  146. package/lib/{components → src/components}/Link/Link.stories.d.ts +5 -2
  147. package/lib/{components → src/components}/Link/index.d.ts +4 -1
  148. package/lib/src/components/Link/index.js +1 -1
  149. package/lib/src/components/Link/index.js.map +1 -1
  150. package/lib/src/components/Link/styles.d.ts +20 -0
  151. package/lib/src/components/Link/styles.js +29 -1
  152. package/lib/src/components/Link/styles.js.map +1 -1
  153. package/lib/{components → src/components}/Loader/Loader.stories.d.ts +1 -1
  154. package/lib/src/components/Loader/index.js +1 -1
  155. package/lib/src/components/Loader/index.js.map +1 -1
  156. package/lib/src/components/Loader/styles.js +45 -1
  157. package/lib/src/components/Loader/styles.js.map +1 -1
  158. package/lib/{components → src/components}/Modal/Modal.stories.d.ts +1 -1
  159. package/lib/src/components/Modal/index.js +1 -1
  160. package/lib/src/components/Modal/index.js.map +1 -1
  161. package/lib/src/components/Modal/styles.d.ts +32 -0
  162. package/lib/src/components/Modal/styles.js +59 -1
  163. package/lib/src/components/Modal/styles.js.map +1 -1
  164. package/lib/{components → src/components}/Pagination/Pagination.stories.d.ts +1 -1
  165. package/lib/src/components/Pagination/index.js +1 -1
  166. package/lib/src/components/Pagination/index.js.map +1 -1
  167. package/lib/src/components/Pagination/styles.js +92 -1
  168. package/lib/src/components/Pagination/styles.js.map +1 -1
  169. package/lib/{components → src/components}/PopOver/Popover.stories.d.ts +1 -1
  170. package/lib/src/components/PopOver/index.js +1 -1
  171. package/lib/src/components/PopOver/index.js.map +1 -1
  172. package/lib/src/components/PopOver/styles.js +81 -1
  173. package/lib/src/components/PopOver/styles.js.map +1 -1
  174. package/lib/{components → src/components}/ProgressBar/ProgressBar.stories.d.ts +1 -1
  175. package/lib/src/components/ProgressBar/index.js +1 -1
  176. package/lib/src/components/ProgressBar/index.js.map +1 -1
  177. package/lib/src/components/ProgressBar/styles.js +132 -1
  178. package/lib/src/components/ProgressBar/styles.js.map +1 -1
  179. package/lib/{components → src/components}/Radio/Radio.stories.d.ts +3 -3
  180. package/lib/{components → src/components}/Radio/index.d.ts +3 -3
  181. package/lib/src/components/Radio/index.js +1 -1
  182. package/lib/src/components/Radio/index.js.map +1 -1
  183. package/lib/src/components/Radio/styles.js +125 -1
  184. package/lib/src/components/Radio/styles.js.map +1 -1
  185. package/lib/{components → src/components}/RadioConsent/Radio.stories.d.ts +1 -1
  186. package/lib/src/components/RadioConsent/index.js +1 -1
  187. package/lib/src/components/RadioConsent/index.js.map +1 -1
  188. package/lib/{components → src/components}/RadioConsent/styles.d.ts +6 -3
  189. package/lib/src/components/RadioConsent/styles.js +26 -1
  190. package/lib/src/components/RadioConsent/styles.js.map +1 -1
  191. package/lib/{components → src/components}/Select/Selelct.stories.d.ts +3 -3
  192. package/lib/{components → src/components}/Select/index.d.ts +3 -3
  193. package/lib/src/components/Select/index.js +1 -1
  194. package/lib/src/components/Select/index.js.map +1 -1
  195. package/lib/src/components/Select/styles.js +41 -1
  196. package/lib/src/components/Select/styles.js.map +1 -1
  197. package/lib/src/components/Spacing/index.js +1 -1
  198. package/lib/src/components/Spacing/index.js.map +1 -1
  199. package/lib/{components → src/components}/Step/Step.stories.d.ts +1 -1
  200. package/lib/src/components/Step/index.js +1 -1
  201. package/lib/src/components/Step/index.js.map +1 -1
  202. package/lib/src/components/Step/styles.js +79 -1
  203. package/lib/src/components/Step/styles.js.map +1 -1
  204. package/lib/{components → src/components}/Text/Text.stories.d.ts +2 -2
  205. package/lib/{components → src/components}/Text/index.d.ts +1 -1
  206. package/lib/src/components/Text/index.js +1 -1
  207. package/lib/src/components/Text/index.js.map +1 -1
  208. package/lib/src/components/Text/styles.js +19 -1
  209. package/lib/src/components/Text/styles.js.map +1 -1
  210. package/lib/{components → src/components}/TextAreaField/TextAreaField.stories.d.ts +2 -2
  211. package/lib/{components → src/components}/TextAreaField/index.d.ts +1 -1
  212. package/lib/src/components/TextAreaField/index.js +1 -1
  213. package/lib/src/components/TextAreaField/index.js.map +1 -1
  214. package/lib/src/components/TextAreaField/styles.js +29 -1
  215. package/lib/src/components/TextAreaField/styles.js.map +1 -1
  216. package/lib/{components → src/components}/TextField/TextField.stories.d.ts +2 -2
  217. package/lib/{components → src/components}/TextField/index.d.ts +1 -1
  218. package/lib/src/components/TextField/index.js +1 -1
  219. package/lib/src/components/TextField/index.js.map +1 -1
  220. package/lib/{components → src/components}/TextField/styles.d.ts +2 -6
  221. package/lib/src/components/TextField/styles.js +110 -1
  222. package/lib/src/components/TextField/styles.js.map +1 -1
  223. package/lib/src/components/ThemeCheatSheet.d.ts +7 -0
  224. package/lib/{components → src/components}/Totaliser/Totaliser.stories.d.ts +1 -1
  225. package/lib/src/components/Totaliser/index.js +1 -1
  226. package/lib/src/components/Totaliser/index.js.map +1 -1
  227. package/lib/src/components/Totaliser/styles.js +59 -1
  228. package/lib/src/components/Totaliser/styles.js.map +1 -1
  229. package/lib/{components → src/components}/UserBlock/UserBlock.stories.d.ts +1 -1
  230. package/lib/src/components/UserBlock/index.js +1 -1
  231. package/lib/src/components/UserBlock/index.js.map +1 -1
  232. package/lib/src/components/UserBlock/styles.js +21 -1
  233. package/lib/src/components/UserBlock/styles.js.map +1 -1
  234. package/lib/{hooks → src/hooks}/useEffectBrowser.d.ts +1 -1
  235. package/lib/src/hooks/useEffectBrowser.js +1 -1
  236. package/lib/src/hooks/useEffectBrowser.js.map +1 -1
  237. package/lib/src/hooks/useKey.js +1 -1
  238. package/lib/src/hooks/useKey.js.map +1 -1
  239. package/lib/{hooks → src/hooks}/useLayoutEffectBrowser.d.ts +1 -1
  240. package/lib/src/hooks/useLayoutEffectBrowser.js +1 -1
  241. package/lib/src/hooks/useLayoutEffectBrowser.js.map +1 -1
  242. package/lib/{hooks → src/hooks}/useScrollPosition.d.ts +2 -2
  243. package/lib/src/hooks/useScrollPosition.js +1 -1
  244. package/lib/src/hooks/useScrollPosition.js.map +1 -1
  245. package/lib/src/themes/bowelbabe.js +1 -1
  246. package/lib/src/themes/bowelbabe.js.map +1 -1
  247. package/lib/src/themes/cruk.js +1 -1
  248. package/lib/src/themes/cruk.js.map +1 -1
  249. package/lib/src/themes/rfl.js +1 -1
  250. package/lib/src/themes/rfl.js.map +1 -1
  251. package/lib/src/themes/su2c.js +1 -1
  252. package/lib/src/themes/su2c.js.map +1 -1
  253. package/lib/{types.d.ts → src/types.d.ts} +1 -3
  254. package/lib/src/utils/Helper.js +1 -1
  255. package/lib/src/utils/Helper.js.map +1 -1
  256. package/lib/src/utils/debounce.d.ts +2 -0
  257. package/lib/src/utils/debounce.js +1 -1
  258. package/lib/src/utils/debounce.js.map +1 -1
  259. package/lib/src/utils/themeUtils.js +1 -1
  260. package/lib/src/utils/themeUtils.js.map +1 -1
  261. package/package.json +37 -44
  262. package/lib/components/ErrorText/styles.d.ts +0 -8
  263. package/lib/components/GlobalStyle.d.ts +0 -2
  264. package/lib/components/GlobalStyleNoFontFace.d.ts +0 -2
  265. package/lib/components/InfoBox/styles.d.ts +0 -10
  266. package/lib/components/Link/styles.d.ts +0 -12
  267. package/lib/components/Modal/styles.d.ts +0 -21
  268. package/lib/components/ThemeCheatSheet.d.ts +0 -7
  269. package/lib/utils/debounce.d.ts +0 -2
  270. /package/lib/{components → src/components}/AddressLookup/AddressLookUp.test.cypress.d.ts +0 -0
  271. /package/lib/{components → src/components}/AddressLookup/styles.d.ts +0 -0
  272. /package/lib/{components → src/components}/AllThemesWrapper.d.ts +0 -0
  273. /package/lib/{components → src/components}/Avatar/Avatar.test.cypress.d.ts +0 -0
  274. /package/lib/{components → src/components}/Avatar/index.d.ts +0 -0
  275. /package/lib/{components → src/components}/Avatar/styles.d.ts +0 -0
  276. /package/lib/{components → src/components}/Badge/Badge.test.cypress.d.ts +0 -0
  277. /package/lib/{components → src/components}/Badge/index.d.ts +0 -0
  278. /package/lib/{components → src/components}/Badge/styles.d.ts +0 -0
  279. /package/lib/{components → src/components}/Box/Box.test.cypress.d.ts +0 -0
  280. /package/lib/{components → src/components}/Box/styles.d.ts +0 -0
  281. /package/lib/{components → src/components}/Button/Button.test.cypress.d.ts +0 -0
  282. /package/lib/{components → src/components}/Button/styles.d.ts +0 -0
  283. /package/lib/{components → src/components}/Carousel/Carousel.test.cypress.d.ts +0 -0
  284. /package/lib/{components → src/components}/Carousel/Dots.d.ts +0 -0
  285. /package/lib/{components → src/components}/Carousel/index.d.ts +0 -0
  286. /package/lib/{components → src/components}/Carousel/styles.d.ts +0 -0
  287. /package/lib/{components → src/components}/Checkbox/CheckBox.test.cypress.d.ts +0 -0
  288. /package/lib/{components → src/components}/Checkbox/styles.d.ts +0 -0
  289. /package/lib/{components → src/components}/Collapse/Collapse.test.cypress.d.ts +0 -0
  290. /package/lib/{components → src/components}/Collapse/index.d.ts +0 -0
  291. /package/lib/{components → src/components}/DateField/DateField.test.cypress.d.ts +0 -0
  292. /package/lib/{components → src/components}/DateField/index.d.ts +0 -0
  293. /package/lib/{components → src/components}/Divider.d.ts +0 -0
  294. /package/lib/{components → src/components}/ErrorText/ErrorText.test.cypress.d.ts +0 -0
  295. /package/lib/{components → src/components}/ErrorText/index.d.ts +0 -0
  296. /package/lib/{components → src/components}/Flex.d.ts +0 -0
  297. /package/lib/{components → src/components}/Fontface.d.ts +0 -0
  298. /package/lib/{components → src/components}/Footer/Footer.test.cypress.d.ts +0 -0
  299. /package/lib/{components → src/components}/Footer/index.d.ts +0 -0
  300. /package/lib/{components → src/components}/Header/Header.test.cypress.d.ts +0 -0
  301. /package/lib/{components → src/components}/Header/index.d.ts +0 -0
  302. /package/lib/{components → src/components}/Header/styles.d.ts +0 -0
  303. /package/lib/{components → src/components}/Heading/Heading.test.cypress.d.ts +0 -0
  304. /package/lib/{components → src/components}/Heading/index.d.ts +0 -0
  305. /package/lib/{components → src/components}/Heading/styles.d.ts +0 -0
  306. /package/lib/{components → src/components}/IconFa/IconFa.test.cypress.d.ts +0 -0
  307. /package/lib/{components → src/components}/IconFa/index.d.ts +0 -0
  308. /package/lib/{components → src/components}/IconFa/styles.d.ts +0 -0
  309. /package/lib/{components → src/components}/InfoBox/InfoBox.test.cypress.d.ts +0 -0
  310. /package/lib/{components → src/components}/LabelWrapper/index.d.ts +0 -0
  311. /package/lib/{components → src/components}/LabelWrapper/styles.d.ts +0 -0
  312. /package/lib/{components → src/components}/LegendWrapper/LegendWrapper.test.cypress.d.ts +0 -0
  313. /package/lib/{components → src/components}/LegendWrapper/index.d.ts +0 -0
  314. /package/lib/{components → src/components}/LegendWrapper/styles.d.ts +0 -0
  315. /package/lib/{components → src/components}/Link/Link.test.cypress.d.ts +0 -0
  316. /package/lib/{components → src/components}/Loader/Loader.test.cypress.d.ts +0 -0
  317. /package/lib/{components → src/components}/Loader/index.d.ts +0 -0
  318. /package/lib/{components → src/components}/Loader/styles.d.ts +0 -0
  319. /package/lib/{components → src/components}/Modal/Modal.test.cypress.d.ts +0 -0
  320. /package/lib/{components → src/components}/Modal/index.d.ts +0 -0
  321. /package/lib/{components → src/components}/Pagination/Pagination.test.cypress.d.ts +0 -0
  322. /package/lib/{components → src/components}/Pagination/index.d.ts +0 -0
  323. /package/lib/{components → src/components}/Pagination/styles.d.ts +0 -0
  324. /package/lib/{components → src/components}/PopOver/PopOver.test.cypress.d.ts +0 -0
  325. /package/lib/{components → src/components}/PopOver/index.d.ts +0 -0
  326. /package/lib/{components → src/components}/PopOver/styles.d.ts +0 -0
  327. /package/lib/{components → src/components}/ProgressBar/ProgressBar.test.cypress.d.ts +0 -0
  328. /package/lib/{components → src/components}/ProgressBar/index.d.ts +0 -0
  329. /package/lib/{components → src/components}/ProgressBar/styles.d.ts +0 -0
  330. /package/lib/{components → src/components}/Radio/Radio.test.cypress.d.ts +0 -0
  331. /package/lib/{components → src/components}/Radio/styles.d.ts +0 -0
  332. /package/lib/{components → src/components}/RadioConsent/RadioConsent.test.cypress.d.ts +0 -0
  333. /package/lib/{components → src/components}/RadioConsent/index.d.ts +0 -0
  334. /package/lib/{components → src/components}/Select/Select.test.cypress.d.ts +0 -0
  335. /package/lib/{components → src/components}/Select/styles.d.ts +0 -0
  336. /package/lib/{components → src/components}/Spacing/index.d.ts +0 -0
  337. /package/lib/{components → src/components}/Step/Step.test.cypress.d.ts +0 -0
  338. /package/lib/{components → src/components}/Step/index.d.ts +0 -0
  339. /package/lib/{components → src/components}/Step/styles.d.ts +0 -0
  340. /package/lib/{components → src/components}/Text/Text.test.cypress.d.ts +0 -0
  341. /package/lib/{components → src/components}/Text/styles.d.ts +0 -0
  342. /package/lib/{components → src/components}/TextAreaField/TextAreaField.test.cypress.d.ts +0 -0
  343. /package/lib/{components → src/components}/TextAreaField/styles.d.ts +0 -0
  344. /package/lib/{components → src/components}/TextField/TextField.test.cypress.d.ts +0 -0
  345. /package/lib/{components → src/components}/Totaliser/Totaliser.test.cypress.d.ts +0 -0
  346. /package/lib/{components → src/components}/Totaliser/index.d.ts +0 -0
  347. /package/lib/{components → src/components}/Totaliser/styles.d.ts +0 -0
  348. /package/lib/{components → src/components}/UserBlock/UserBlock.test.cypress.d.ts +0 -0
  349. /package/lib/{components → src/components}/UserBlock/index.d.ts +0 -0
  350. /package/lib/{components → src/components}/UserBlock/styles.d.ts +0 -0
  351. /package/lib/{components → src/components}/index.d.ts +0 -0
  352. /package/lib/{hooks → src/hooks}/useKey.d.ts +0 -0
  353. /package/lib/{themes → src/themes}/bowelbabe.d.ts +0 -0
  354. /package/lib/{themes → src/themes}/cruk.d.ts +0 -0
  355. /package/lib/{themes → src/themes}/rfl.d.ts +0 -0
  356. /package/lib/{themes → src/themes}/su2c.d.ts +0 -0
  357. /package/lib/{utils → src/utils}/Helper.d.ts +0 -0
  358. /package/lib/{utils → src/utils}/__tests__/testHelpers.test.d.ts +0 -0
  359. /package/lib/{utils → src/utils}/themeUtils.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalStyleNoFontFace.js","sources":["../../../src/components/GlobalStyleNoFontFace.tsx"],"sourcesContent":["import { createGlobalStyle, withTheme } from \"styled-components\";\nimport { crukTheme as defaultTheme } from \"../themes/cruk\";\n\nexport const GlobalStyleNoFontFace = withTheme(createGlobalStyle`\n ${(props) => {\n const theme = {\n ...defaultTheme,\n ...props.theme,\n };\n return `\n html {\n font-size: ${theme.typography.fontSizeBase};\n font-family: ${theme.typography.fontFamilyBase};\n line-height: ${theme.typography.lineHeight};\n }\n body {\n background-color: ${theme.colors.backgroundMidLight};\n color: ${theme.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;\n }}\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n`);\n\nGlobalStyleNoFontFace.defaultProps = {\n theme: defaultTheme,\n};\n\nexport default GlobalStyleNoFontFace;\n"],"names":["GlobalStyleNoFontFace","withTheme","createGlobalStyle","templateObject_1","__makeTemplateObject","props","theme","defaultTheme","concat","typography","fontSizeBase","fontFamilyBase","lineHeight","colors","backgroundMidLight","textDark","defaultProps"],"mappings":"8MAGO,MAAMA,EAAwBC,EAAUC,EAAiBC,IAAAA,EAAAC,EAAA,CAAA,OAAA,4sBAAA,CAAA,OAuB7D,+sBAtBC,SAACC,GACD,IAAMC,SACDC,GACAF,EAAMC,OAEX,MAAO,sCAEUE,OAAAF,EAAMG,WAAWC,aACf,4BAAAF,OAAAF,EAAMG,WAAWE,kDACjBL,EAAMG,WAAWG,WAAU,wDAAAJ,OAGtBF,EAAMO,OAAOC,mBACxB,sBAAAN,OAAAF,EAAMO,OAAOE,sNAS5B,KAqCFf,EAAsBgB,aAAe,CACnCV,MAAOC"}
1
+ {"version":3,"file":"GlobalStyleNoFontFace.js","sources":["../../../src/components/GlobalStyleNoFontFace.tsx"],"sourcesContent":["import { createGlobalStyle, withTheme } from \"styled-components\";\nimport { crukTheme as defaultTheme } from \"../themes/cruk\";\n\nexport const GlobalStyleNoFontFace = withTheme(createGlobalStyle`\n ${(props) => {\n const theme = {\n ...defaultTheme,\n ...props.theme,\n };\n return `\n html {\n font-size: ${theme.typography.fontSizeBase};\n font-family: ${theme.typography.fontFamilyBase};\n line-height: ${theme.typography.lineHeight};\n }\n body {\n background-color: ${theme.colors.backgroundMidLight};\n color: ${theme.colors.textDark};\n margin: 0;\n padding: 0;\n overflow-x: hidden;\n -webkit-text-size-adjust: 100%;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: 100%;\n }\n `;\n }}\n *, *:after, *:before {\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n \n @media (prefers-reduced-motion: reduce) {\n *, *:after, *:before {\n animation-play-state: paused !important;\n animation-direction: reverse !important;\n transition: none !important;\n scroll-behavior: auto !important;\n }\n }\n\n table, td, th {\n border-spacing: 0;\n border: 1px solid #ccc;\n padding: 10px;\n }\n .no-focus-outline a:focus,\n .no-focus-outline button:focus {\n outline: none;\n }\n img {\n width: 100%;\n height: auto;\n }\n section {\n width: 100%;\n }\n button {\n font-size: 1em;\n }\n`);\n\nexport default GlobalStyleNoFontFace;\n"],"names":["GlobalStyleNoFontFace","withTheme","createGlobalStyle","props","theme","defaultTheme","typography","fontSizeBase","fontFamilyBase","lineHeight","colors","backgroundMidLight","textDark"],"mappings":"mHAGa,MAAAA,EAAwBC,EAAUC,CAAiB;IAC3DC,IACD,MAAMC,EAAQ,IACTC,KACAF,EAAMC,OAEX,MAAO,sCAEUA,EAAME,WAAWC,uCACfH,EAAME,WAAWE,yCACjBJ,EAAME,WAAWG,iEAGZL,EAAMM,OAAOC,uCACxBP,EAAMM,OAAOE,oNAQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { StoryObj } from "@storybook/react";
2
+ import { type StoryObj } from "@storybook/react";
3
3
  import Header from ".";
4
4
  declare const _default: {
5
5
  title: string;
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import t,{useState as l}from"react";import{useTheme as o,ThemeProvider as n}from"styled-components";import i from"../../hooks/useScrollPosition.js";import{crukTheme as r}from"../../themes/cruk.js";import{StyledHeader as m,HeaderStickyPlaceHolder as c,HeaderStickyContainer as s,SkipToMain as a,HeaderMainContent as u,StyledLink as f,LogoWrapper as g,Logo as d,Tagline as E,ChildWrapper as S,ChildInner as h}from"./styles.js";function k(k){var p=k.isSticky,y=k.siteSlogan,$=k.logoAltText,j=k.logoImageSrc,C=k.logoLinkTitle,b=k.logoLinkUrl,v=k.fullWidth,w=k.children,x=l(!1),A=x[0],L=x[1],P="undefined"!=typeof window,T=o(),U=e(e({},r),T);return i((function(e){var t=e.currPos,l=!!P&&t.y>240;l!==A&&L(l)}),[A],null,!0,50),t.createElement(n,{theme:U},t.createElement(m,null,t.createElement(c,null,t.createElement(s,{"data-cy":"header-sticky-container",$isSmall:A,$isSticky:p},t.createElement(a,{href:"#main"},"Skip to main content"),t.createElement(u,{$fullWidth:v},t.createElement(f,{href:null!=b?b:U.siteConfig.logoUrl,title:null!=C?C:"Home"},t.createElement(g,{$isSmall:A,$isSticky:p},t.createElement(d,{height:80,src:null!=j?j:U.siteConfig.logoSrc,alt:null!=$?$:U.siteConfig.logoAlt}))),y?t.createElement(E,{$isSmall:A,$isSticky:p},y):null,t.createElement(S,null,t.createElement(h,null,w)))))))}export{k as Header,k as default};
1
+ import e,{useState as t}from"react";import{useTheme as l,ThemeProvider as o}from"styled-components";import n from"../../hooks/useScrollPosition.js";import{crukTheme as i}from"../../themes/cruk.js";import{StyledHeader as r,HeaderStickyPlaceHolder as c,HeaderStickyContainer as m,SkipToMain as s,HeaderMainContent as a,StyledLink as f,LogoWrapper as u,Logo as g,Tagline as E,ChildWrapper as S,ChildInner as h}from"./styles.js";function d({isSticky:d,siteSlogan:k,logoAltText:y,logoImageSrc:p,logoLinkTitle:$,logoLinkUrl:j,fullWidth:C,children:w}){const[x,A]=t(!1),L="undefined"!=typeof window,P=l(),T={...i,...P};return n((({currPos:e})=>{const t=!!L&&e.y>240;t!==x&&A(t)}),[x],null,!0,50),e.createElement(o,{theme:T},e.createElement(r,null,e.createElement(c,null,e.createElement(m,{"data-cy":"header-sticky-container",$isSmall:x,$isSticky:d},e.createElement(s,{href:"#main"},"Skip to main content"),e.createElement(a,{$fullWidth:C},e.createElement(f,{href:j??T.siteConfig.logoUrl,title:$??"Home"},e.createElement(u,{$isSmall:x,$isSticky:d},e.createElement(g,{height:80,src:p??T.siteConfig.logoSrc,alt:y??T.siteConfig.logoAlt}))),k?e.createElement(E,{$isSmall:x,$isSticky:d},k):null,e.createElement(S,null,e.createElement(h,null,w)))))))}export{d as Header,d as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n StyledHeader,\n HeaderStickyContainer,\n HeaderStickyPlaceHolder,\n HeaderMainContent,\n SkipToMain,\n StyledLink,\n Logo,\n LogoWrapper,\n Tagline,\n ChildWrapper,\n ChildInner,\n} from \"./styles\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nexport type HeaderProps = HTMLAttributes<HTMLElement> & {\n /** flag which make header fixed to the top even when scrolling */\n isSticky?: boolean;\n /** text in the middle of the header */\n siteSlogan?: string;\n /** text to explain the content of the icon for a11y usually a description of where the link will take you */\n logoAltText?: string;\n /** header logo image url */\n logoImageSrc?: string;\n /** title of the header image component, this is mainly for the tooltip text on hover */\n logoLinkTitle?: string;\n /** the url of the logo link */\n logoLinkUrl?: string;\n /** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */\n fullWidth?: boolean;\n\n children?: ReactNode;\n};\n\n/**\n * There should be only one header component near or at the top of the body of each page.\n *\n * ### Logos\n * It is recommended that logo images are at least 80px high if they are not SVGs and that the logo is still clearly legible when reduced to 40px high for mobile.\n * It is also recommended that the logo width doesn't exceed 350px. If you need a wide logo that is shorter than 80px to keep the aspect ratio please make sure that the logo is centered with transparent space at the top and bottom and still 80px high.\n *\n * ### Site Slogan Text (optional)\n * This is a single line of text and the character limit depends on the theme, logo and children width. This is only visible on desktop at the top of the page\n *\n * ### Right section (optional)\n * This has been kept quite open you can place any child elements in here but ideally it is narrow and its height is 50px or smaller.\n *\n * ### Accessability\n * There is a hidden skip link in the header which will only reveals itself on the first tab and to screen readers. This link helps users skip to the main page content, however this will only work with there is an element with an id of 'main' which the developer should create for every page.\n *\n */\nexport function Header({\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HeaderProps) {\n const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n useScrollPosition(\n ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => {\n const shouldShrink = isBrowser\n ? currPos.y > HEADER_SCROLL_THRESHOLD\n : false;\n if (shouldShrink !== isSmall) {\n setIsSmall(shouldShrink);\n }\n },\n [isSmall],\n null,\n true,\n 50,\n );\n\n return (\n <ThemeProvider theme={theme}>\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-cy=\"header-sticky-container\"\n $isSmall={isSmall}\n $isSticky={isSticky}\n >\n <SkipToMain href=\"#main\">Skip to main content</SkipToMain>\n <HeaderMainContent $fullWidth={fullWidth}>\n <StyledLink\n href={logoLinkUrl ?? theme.siteConfig.logoUrl}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper $isSmall={isSmall} $isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? theme.siteConfig.logoSrc}\n alt={logoAltText ?? theme.siteConfig.logoAlt}\n />\n </LogoWrapper>\n </StyledLink>\n {siteSlogan ? (\n <Tagline $isSmall={isSmall} $isSticky={isSticky}>\n {siteSlogan}\n </Tagline>\n ) : null}\n <ChildWrapper>\n <ChildInner>{children}</ChildInner>\n </ChildWrapper>\n </HeaderMainContent>\n </HeaderStickyContainer>\n </HeaderStickyPlaceHolder>\n </StyledHeader>\n </ThemeProvider>\n );\n}\n\nexport default Header;\n"],"names":["Header","_a","isSticky","siteSlogan","logoAltText","logoImageSrc","logoLinkTitle","logoLinkUrl","fullWidth","children","_b","useState","isSmall","setIsSmall","isBrowser","window","foundTheme","useTheme","theme","__assign","defaultTheme","useScrollPosition","currPos","shouldShrink","y","React","createElement","ThemeProvider","StyledHeader","HeaderStickyPlaceHolder","HeaderStickyContainer","$isSmall","SkipToMain","href","HeaderMainContent","StyledLink","siteConfig","logoUrl","title","LogoWrapper","$isSticky","Logo","height","src","logoSrc","alt","logoAlt","Tagline","ChildWrapper","ChildInner"],"mappings":"6eA0DM,SAAUA,EAAOC,OACrBC,EAAQD,EAAAC,SACRC,EAAUF,EAAAE,WACVC,EAAWH,EAAAG,YACXC,EAAYJ,EAAAI,aACZC,EAAaL,EAAAK,cACbC,EAAWN,EAAAM,YACXC,EAASP,EAAAO,UACTC,EAAQR,EAAAQ,SAEFC,EAAwBC,GAAS,GAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GACpBI,EAA8B,oBAAXC,OACnBC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAuBL,OApBAK,GACE,SAACpB,GACC,IAAAqB,EAAOrB,EAAAqB,QAKDC,IAAeT,GACjBQ,EAAQE,EAhEc,IAkEtBD,IAAiBX,GACnBC,EAAWU,EAEd,GACD,CAACX,GACD,MACA,EACA,IAIAa,EAACC,cAAAC,EAAc,CAAAT,MAAOA,GACpBO,EAAAC,cAACE,EAAY,KACXH,EAAAC,cAACG,EAAuB,KACtBJ,EAAAC,cAACI,EACS,CAAA,UAAA,0BACEC,SAAAnB,YACCV,GAEXuB,EAAAC,cAACM,EAAU,CAACC,KAAK,SAAyC,wBAC1DR,EAACC,cAAAQ,cAA8B1B,GAC7BiB,EAACC,cAAAS,EACC,CAAAF,KAAM1B,QAAAA,EAAeW,EAAMkB,WAAWC,QACtCC,MAAOhC,QAAAA,EAAiB,QAExBmB,EAAAC,cAACa,EAAW,CAAAR,SAAWnB,EAAO4B,UAAatC,GACzCuB,EAAAC,cAACe,EAAI,CACHC,OAAQ,GACRC,IAAKtC,QAAAA,EAAgBa,EAAMkB,WAAWQ,QACtCC,IAAKzC,QAAAA,EAAec,EAAMkB,WAAWU,YAI1C3C,EACCsB,EAAAC,cAACqB,EAAkB,CAAAhB,SAAAnB,EAAoB4B,UAAAtC,GACpCC,GAED,KACJsB,EAAAC,cAACsB,EAAY,KACXvB,EAACC,cAAAuB,EAAY,KAAAxC,QAQ7B"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Header/index.tsx"],"sourcesContent":["import React, { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { useTheme, ThemeProvider } from \"styled-components\";\n\nimport { useScrollPosition } from \"../../hooks/useScrollPosition\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport {\n StyledHeader,\n HeaderStickyContainer,\n HeaderStickyPlaceHolder,\n HeaderMainContent,\n SkipToMain,\n StyledLink,\n Logo,\n LogoWrapper,\n Tagline,\n ChildWrapper,\n ChildInner,\n} from \"./styles\";\n\nconst HEADER_SCROLL_THRESHOLD = 240;\n\nexport type HeaderProps = HTMLAttributes<HTMLElement> & {\n /** flag which make header fixed to the top even when scrolling */\n isSticky?: boolean;\n /** text in the middle of the header */\n siteSlogan?: string;\n /** text to explain the content of the icon for a11y usually a description of where the link will take you */\n logoAltText?: string;\n /** header logo image url */\n logoImageSrc?: string;\n /** title of the header image component, this is mainly for the tooltip text on hover */\n logoLinkTitle?: string;\n /** the url of the logo link */\n logoLinkUrl?: string;\n /** instead of the contents of the header being centered to max width as defined in theme it is 100% width fo viewport */\n fullWidth?: boolean;\n\n children?: ReactNode;\n};\n\n/**\n * There should be only one header component near or at the top of the body of each page.\n *\n * ### Logos\n * It is recommended that logo images are at least 80px high if they are not SVGs and that the logo is still clearly legible when reduced to 40px high for mobile.\n * It is also recommended that the logo width doesn't exceed 350px. If you need a wide logo that is shorter than 80px to keep the aspect ratio please make sure that the logo is centered with transparent space at the top and bottom and still 80px high.\n *\n * ### Site Slogan Text (optional)\n * This is a single line of text and the character limit depends on the theme, logo and children width. This is only visible on desktop at the top of the page\n *\n * ### Right section (optional)\n * This has been kept quite open you can place any child elements in here but ideally it is narrow and its height is 50px or smaller.\n *\n * ### Accessability\n * There is a hidden skip link in the header which will only reveals itself on the first tab and to screen readers. This link helps users skip to the main page content, however this will only work with there is an element with an id of 'main' which the developer should create for every page.\n *\n */\nexport function Header({\n isSticky,\n siteSlogan,\n logoAltText,\n logoImageSrc,\n logoLinkTitle,\n logoLinkUrl,\n fullWidth,\n children,\n}: HeaderProps) {\n const [isSmall, setIsSmall] = useState(false);\n const isBrowser = typeof window !== `undefined`;\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n useScrollPosition(\n ({\n currPos,\n }: {\n prevPos: { x: number; y: number };\n currPos: { x: number; y: number };\n }) => {\n const shouldShrink = isBrowser\n ? currPos.y > HEADER_SCROLL_THRESHOLD\n : false;\n if (shouldShrink !== isSmall) {\n setIsSmall(shouldShrink);\n }\n },\n [isSmall],\n null,\n true,\n 50,\n );\n\n return (\n <ThemeProvider theme={theme}>\n <StyledHeader>\n <HeaderStickyPlaceHolder>\n <HeaderStickyContainer\n data-cy=\"header-sticky-container\"\n $isSmall={isSmall}\n $isSticky={isSticky}\n >\n <SkipToMain href=\"#main\">Skip to main content</SkipToMain>\n <HeaderMainContent $fullWidth={fullWidth}>\n <StyledLink\n href={logoLinkUrl ?? theme.siteConfig.logoUrl}\n title={logoLinkTitle ?? \"Home\"}\n >\n <LogoWrapper $isSmall={isSmall} $isSticky={isSticky}>\n <Logo\n height={80}\n src={logoImageSrc ?? theme.siteConfig.logoSrc}\n alt={logoAltText ?? theme.siteConfig.logoAlt}\n />\n </LogoWrapper>\n </StyledLink>\n {siteSlogan ? (\n <Tagline $isSmall={isSmall} $isSticky={isSticky}>\n {siteSlogan}\n </Tagline>\n ) : null}\n <ChildWrapper>\n <ChildInner>{children}</ChildInner>\n </ChildWrapper>\n </HeaderMainContent>\n </HeaderStickyContainer>\n </HeaderStickyPlaceHolder>\n </StyledHeader>\n </ThemeProvider>\n );\n}\n\nexport default Header;\n"],"names":["Header","isSticky","siteSlogan","logoAltText","logoImageSrc","logoLinkTitle","logoLinkUrl","fullWidth","children","isSmall","setIsSmall","useState","isBrowser","window","foundTheme","useTheme","theme","defaultTheme","useScrollPosition","currPos","shouldShrink","y","React","createElement","ThemeProvider","StyledHeader","HeaderStickyPlaceHolder","HeaderStickyContainer","$isSmall","SkipToMain","href","HeaderMainContent","StyledLink","siteConfig","logoUrl","title","LogoWrapper","$isSticky","Logo","height","src","logoSrc","alt","logoAlt","Tagline","ChildWrapper","ChildInner"],"mappings":"kbA0DgBA,GAAOC,SACrBA,EAAQC,WACRA,EAAUC,YACVA,EAAWC,aACXA,EAAYC,cACZA,EAAaC,YACbA,EAAWC,UACXA,EAASC,SACTA,IAEA,MAAOC,EAASC,GAAcC,GAAS,GACjCC,EAA8B,oBAAXC,OACnBC,EAAaC,IACbC,EAAQ,IACTC,KACAH,GAuBL,OApBAI,GACE,EACEC,cAKA,MAAMC,IAAeR,GACjBO,EAAQE,EAhEc,IAkEtBD,IAAiBX,GACnBC,EAAWU,KAGf,CAACX,GACD,MACA,EACA,IAIAa,EAACC,cAAAC,EAAc,CAAAR,MAAOA,GACpBM,EAAAC,cAACE,EAAY,KACXH,EAAAC,cAACG,EAAuB,KACtBJ,EAAAC,cAACI,EACS,CAAA,UAAA,0BACEC,SAAAnB,YACCR,GAEXqB,EAAAC,cAACM,EAAU,CAACC,KAAK,SAAyC,wBAC1DR,EAACC,cAAAQ,cAA8BxB,GAC7Be,EAAAC,cAACS,EACC,CAAAF,KAAMxB,GAAeU,EAAMiB,WAAWC,QACtCC,MAAO9B,GAAiB,QAExBiB,EAAAC,cAACa,EAAW,CAAAR,SAAWnB,EAAO4B,UAAapC,GACzCqB,EAACC,cAAAe,EACC,CAAAC,OAAQ,GACRC,IAAKpC,GAAgBY,EAAMiB,WAAWQ,QACtCC,IAAKvC,GAAea,EAAMiB,WAAWU,YAI1CzC,EACCoB,EAAAC,cAACqB,EAAkB,CAAAhB,SAAAnB,EAAoB4B,UAAApC,GACpCC,GAED,KACJoB,EAAAC,cAACsB,EAAY,KACXvB,EAACC,cAAAuB,EAAY,KAAAtC,QAQ7B"}
@@ -1,2 +1,110 @@
1
- import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";import{crukTheme as t}from"../../themes/cruk.js";var e,o,r,a,d,h,s,u,l,c,p,g="120px",x="72px",f=t.spacing.xs,m="40px",b="0.2s",w=i.header(e||(e=n(["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"],["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ",";\n z-index: 9998;\n"])),(function(n){return n.theme.colors.headerBackground})),y=i.div(o||(o=n(["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),x,(function(n){return n.theme.breakpoint.desktop}),g),v=i.div(r||(r=n(["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"],["\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ",";\n background-color: ",";\n position: relative;\n border-bottom: ",";\n height: ",";\n box-shadow: ",";\n top: ",";\n position: ",";\n transition: height "," ease;\n\n @media (min-width: ",") {\n position: ",";\n height: ",";\n }\n"])),f,(function(n){return n.theme.colors.headerBackground}),(function(n){var i=n.theme.colors.headerBorder;return"solid 1px ".concat(i)}),x,(function(n){var i=n.theme;return n.$isSticky?i.shadows.l:"none"}),(function(n){return n.$isSticky?0:"auto"}),(function(n){return n.$isSticky?"fixed":"relative"}),b,(function(n){return n.theme.breakpoint.desktop}),(function(n){return n.$isSticky?"fixed":"relative"}),(function(n){var i=n.$isSmall,t=n.$isSticky;return i&&t?x:g})),k=i.div(a||(a=n(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ",";\n"],["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ",";\n"])),(function(n){var i=n.$fullWidth,t=n.theme.utilities.contentMaxWidth;return i?"100%":t})),z=i.img(d||(d=n(["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"],["\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n"]))),S=i.div(h||(h=n(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"],["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height "," ease;\n\n height: ",";\n\n @media (min-width: ",") {\n height: ",";\n }\n"])),b,m,(function(n){return n.theme.breakpoint.desktop}),(function(n){var i=n.$isSmall,t=n.$isSticky;return i&&t?m:"80px"})),$=i.a(s||(s=n(["\n display: inline-block;\n"],["\n display: inline-block;\n"]))),j=i.a(u||(u=n(["\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"],["\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ",";\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n"])),(function(n){return n.theme.spacing.xs})),B=i.p(l||(l=n(["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"],["\n flex: 1 1 auto;\n font-family: ",";\n font-weight: ",";\n font-size: ",";\n color: ",";\n text-align: center;\n opacity: 0;\n transition: opacity "," ease;\n display: none;\n\n @media (min-width: ",") {\n display: block;\n opacity: ",";\n }\n"])),(function(n){return n.theme.typography.fontFamilyHeadings}),(function(n){return n.theme.typography.fontWeightHeadings}),(function(n){return n.theme.fontSizes.xl}),(function(n){return n.theme.colors.headerTaglineText}),b,(function(n){return n.theme.breakpoint.desktop}),(function(n){var i=n.$isSmall,t=n.$isSticky;return i&&t?0:1})),W=i.div(c||(c=n(["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"],["\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n"]))),H=i.div(p||(p=n(["\n height: auto;\n margin: auto 0;\n"],["\n height: auto;\n margin: auto 0;\n"])));export{H as ChildInner,W as ChildWrapper,k as HeaderMainContent,v as HeaderStickyContainer,y as HeaderStickyPlaceHolder,z as Logo,S as LogoWrapper,j as SkipToMain,w as StyledHeader,$ as StyledLink,B as Tagline};
1
+ import i from"styled-components";import{crukTheme as e}from"../../themes/cruk.js";const t="120px",o="72px",a=e.spacing.xs,n="40px",d="0.2s",h=i.header`
2
+ box-sizing: border-box;
3
+ position: relative;
4
+ width: 100%;
5
+ background-color: ${({theme:{colors:{headerBackground:i}}})=>i};
6
+ z-index: 9998;
7
+ `,s=i.div`
8
+ position: relative;
9
+ box-sizing: border-box;
10
+ width: 100%;
11
+ height: ${o};
12
+
13
+ @media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
14
+ height: ${t};
15
+ }
16
+ `,r=i.div`
17
+ box-sizing: border-box;
18
+ width: 100%;
19
+ height: 100%;
20
+ padding: 0 ${a};
21
+ background-color: ${({theme:{colors:{headerBackground:i}}})=>i};
22
+ position: relative;
23
+ border-bottom: ${({theme:{colors:{headerBorder:i}}})=>`solid 1px ${i}`};
24
+ height: ${o};
25
+ box-shadow: ${({theme:i,$isSticky:e})=>e?i.shadows.l:"none"};
26
+ top: ${({$isSticky:i})=>i?0:"auto"};
27
+ position: ${({$isSticky:i})=>i?"fixed":"relative"};
28
+ transition: height ${d} ease;
29
+
30
+ @media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
31
+ position: ${({$isSticky:i})=>i?"fixed":"relative"};
32
+ height: ${({$isSmall:i,$isSticky:e})=>i&&e?o:t};
33
+ }
34
+ `,l=i.div`
35
+ box-sizing: border-box;
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: space-between;
39
+ width: 100%;
40
+ height: 100%;
41
+ margin: 0 auto;
42
+ max-width: ${({$fullWidth:i,theme:{utilities:{contentMaxWidth:e}}})=>i?"100%":e};
43
+ `,p=i.img`
44
+ height: 100%;
45
+ width: auto;
46
+ max-width: 100%;
47
+ max-height: 100%;
48
+ `,c=i.div`
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: space-around;
52
+ width: auto;
53
+ transition: height ${d} ease;
54
+
55
+ height: ${n};
56
+
57
+ @media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
58
+ height: ${({$isSmall:i,$isSticky:e})=>i&&e?n:"80px"};
59
+ }
60
+ `,m=i.a`
61
+ display: inline-block;
62
+ `,g=i.a`
63
+ left: -999px;
64
+ position: absolute;
65
+ top: auto;
66
+ width: 1px;
67
+ height: 1px;
68
+ overflow: hidden;
69
+ z-index: -999;
70
+ &:focus,
71
+ &:active,
72
+ &:focus-within {
73
+ left: auto;
74
+ top: auto;
75
+ width: 30%;
76
+ height: auto;
77
+ overflow: auto;
78
+ margin: 10px 35%;
79
+ padding: ${({theme:{spacing:{xs:i}}})=>i};
80
+ border-radius: 15px;
81
+ border: 4px solid yellow;
82
+ text-align: center;
83
+ font-size: 1.2em;
84
+ z-index: 999;
85
+ }
86
+ `,x=i.p`
87
+ flex: 1 1 auto;
88
+ font-family: ${({theme:i})=>i.typography.fontFamilyHeadings};
89
+ font-weight: ${({theme:i})=>i.typography.fontWeightHeadings};
90
+ font-size: ${({theme:{fontSizes:{xl:i}}})=>i};
91
+ color: ${({theme:i})=>i.colors.headerTaglineText};
92
+ text-align: center;
93
+ opacity: 0;
94
+ transition: opacity ${d} ease;
95
+ display: none;
96
+
97
+ @media (min-width: ${({theme:i})=>i.breakpoint.desktop}) {
98
+ display: block;
99
+ opacity: ${({$isSmall:i,$isSticky:e})=>i&&e?0:1};
100
+ }
101
+ `,$=i.div`
102
+ height: 100%;
103
+ display: flex;
104
+ flex-direction: column;
105
+ justify-content: space-around;
106
+ `,u=i.div`
107
+ height: auto;
108
+ margin: auto 0;
109
+ `;export{u as ChildInner,$ as ChildWrapper,l as HeaderMainContent,r as HeaderStickyContainer,s as HeaderStickyPlaceHolder,p as Logo,c as LogoWrapper,g as SkipToMain,h as StyledHeader,m as StyledLink,x as Tagline};
2
110
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/Header/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { type ThemeType } from \"../../types\";\n\nconst HEADER_HEIGHT_LARGE = \"120px\";\nconst HEADER_HEIGHT_SMALL = \"72px\";\nconst HEADER_PADDING = defaultTheme.spacing.xs;\nconst HEADER_LOGO_HEIGHT_LARGE = \"80px\";\nconst HEADER_LOGO_HEIGHT_SMALL = \"40px\";\nconst ANIMATION_SPEED = \"0.2s\";\n\nexport const StyledHeader = styled.header<{ theme: ThemeType }>`\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n z-index: 9998;\n`;\n\nexport const HeaderStickyPlaceHolder = styled.div<{ theme: ThemeType }>`\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ${HEADER_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderStickyContainer = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ${HEADER_PADDING};\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n position: relative;\n border-bottom: ${({\n theme: {\n colors: { headerBorder },\n },\n }) => `solid 1px ${headerBorder}`};\n height: ${HEADER_HEIGHT_SMALL};\n box-shadow: ${({ theme, $isSticky }) =>\n $isSticky ? theme.shadows.l : \"none\"};\n top: ${({ $isSticky }) => ($isSticky ? 0 : \"auto\")};\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n transition: height ${ANIMATION_SPEED} ease;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky ? HEADER_HEIGHT_SMALL : HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderMainContent = styled.div<{\n $fullWidth?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ${({\n $fullWidth,\n theme: {\n utilities: { contentMaxWidth },\n },\n }) => ($fullWidth ? `100%` : contentMaxWidth)};\n`;\n\nexport const Logo = styled.img`\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n`;\n\nexport const LogoWrapper = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height ${ANIMATION_SPEED} ease;\n\n height: ${HEADER_LOGO_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? HEADER_LOGO_HEIGHT_SMALL\n : HEADER_LOGO_HEIGHT_LARGE};\n }\n`;\n\nexport const StyledLink = styled.a`\n display: inline-block;\n`;\n\nexport const SkipToMain = styled.a<{ theme: ThemeType }>`\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n`;\n\nexport const Tagline = styled.p<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n flex: 1 1 auto;\n font-family: ${({ theme }) => theme.typography.fontFamilyHeadings};\n font-weight: ${({ theme }) => theme.typography.fontWeightHeadings};\n font-size: ${({\n theme: {\n fontSizes: { xl },\n },\n }) => xl};\n color: ${({ theme }) => theme.colors.headerTaglineText};\n text-align: center;\n opacity: 0;\n transition: opacity ${ANIMATION_SPEED} ease;\n display: none;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: block;\n opacity: ${({ $isSmall, $isSticky }) => ($isSmall && $isSticky ? 0 : 1)};\n }\n`;\n\nexport const ChildWrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n`;\n\nexport const ChildInner = styled.div`\n height: auto;\n margin: auto 0;\n`;\n"],"names":["HEADER_HEIGHT_LARGE","HEADER_HEIGHT_SMALL","HEADER_PADDING","defaultTheme","spacing","xs","HEADER_LOGO_HEIGHT_SMALL","ANIMATION_SPEED","StyledHeader","styled","header","templateObject_1","__makeTemplateObject","_a","theme","colors","headerBackground","HeaderStickyPlaceHolder","div","templateObject_2","breakpoint","desktop","HeaderStickyContainer","templateObject_3","headerBorder","concat","$isSticky","shadows","l","$isSmall","HeaderMainContent","templateObject_4","$fullWidth","contentMaxWidth","utilities","Logo","img","templateObject_5","LogoWrapper","templateObject_6","StyledLink","a","templateObject_7","SkipToMain","templateObject_8","Tagline","p","templateObject_9","typography","fontFamilyHeadings","fontWeightHeadings","fontSizes","xl","headerTaglineText","ChildWrapper","templateObject_10","ChildInner","templateObject_11"],"mappings":"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"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/Header/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { type ThemeType } from \"../../types\";\n\nconst HEADER_HEIGHT_LARGE = \"120px\";\nconst HEADER_HEIGHT_SMALL = \"72px\";\nconst HEADER_PADDING = defaultTheme.spacing.xs;\nconst HEADER_LOGO_HEIGHT_LARGE = \"80px\";\nconst HEADER_LOGO_HEIGHT_SMALL = \"40px\";\nconst ANIMATION_SPEED = \"0.2s\";\n\nexport const StyledHeader = styled.header<{ theme: ThemeType }>`\n box-sizing: border-box;\n position: relative;\n width: 100%;\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n z-index: 9998;\n`;\n\nexport const HeaderStickyPlaceHolder = styled.div<{ theme: ThemeType }>`\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: ${HEADER_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderStickyContainer = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n padding: 0 ${HEADER_PADDING};\n background-color: ${({\n theme: {\n colors: { headerBackground },\n },\n }) => headerBackground};\n position: relative;\n border-bottom: ${({\n theme: {\n colors: { headerBorder },\n },\n }) => `solid 1px ${headerBorder}`};\n height: ${HEADER_HEIGHT_SMALL};\n box-shadow: ${({ theme, $isSticky }) =>\n $isSticky ? theme.shadows.l : \"none\"};\n top: ${({ $isSticky }) => ($isSticky ? 0 : \"auto\")};\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n transition: height ${ANIMATION_SPEED} ease;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n position: ${({ $isSticky }) => ($isSticky ? \"fixed\" : \"relative\")};\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky ? HEADER_HEIGHT_SMALL : HEADER_HEIGHT_LARGE};\n }\n`;\n\nexport const HeaderMainContent = styled.div<{\n $fullWidth?: boolean;\n theme: ThemeType;\n}>`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n margin: 0 auto;\n max-width: ${({\n $fullWidth,\n theme: {\n utilities: { contentMaxWidth },\n },\n }) => ($fullWidth ? `100%` : contentMaxWidth)};\n`;\n\nexport const Logo = styled.img`\n height: 100%;\n width: auto;\n max-width: 100%;\n max-height: 100%;\n`;\n\nexport const LogoWrapper = styled.div<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n width: auto;\n transition: height ${ANIMATION_SPEED} ease;\n\n height: ${HEADER_LOGO_HEIGHT_SMALL};\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n height: ${({ $isSmall, $isSticky }) =>\n $isSmall && $isSticky\n ? HEADER_LOGO_HEIGHT_SMALL\n : HEADER_LOGO_HEIGHT_LARGE};\n }\n`;\n\nexport const StyledLink = styled.a`\n display: inline-block;\n`;\n\nexport const SkipToMain = styled.a<{ theme: ThemeType }>`\n left: -999px;\n position: absolute;\n top: auto;\n width: 1px;\n height: 1px;\n overflow: hidden;\n z-index: -999;\n &:focus,\n &:active,\n &:focus-within {\n left: auto;\n top: auto;\n width: 30%;\n height: auto;\n overflow: auto;\n margin: 10px 35%;\n padding: ${({\n theme: {\n spacing: { xs },\n },\n }) => xs};\n border-radius: 15px;\n border: 4px solid yellow;\n text-align: center;\n font-size: 1.2em;\n z-index: 999;\n }\n`;\n\nexport const Tagline = styled.p<{\n $isSmall?: boolean;\n $isSticky?: boolean;\n theme: ThemeType;\n}>`\n flex: 1 1 auto;\n font-family: ${({ theme }) => theme.typography.fontFamilyHeadings};\n font-weight: ${({ theme }) => theme.typography.fontWeightHeadings};\n font-size: ${({\n theme: {\n fontSizes: { xl },\n },\n }) => xl};\n color: ${({ theme }) => theme.colors.headerTaglineText};\n text-align: center;\n opacity: 0;\n transition: opacity ${ANIMATION_SPEED} ease;\n display: none;\n\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n display: block;\n opacity: ${({ $isSmall, $isSticky }) => ($isSmall && $isSticky ? 0 : 1)};\n }\n`;\n\nexport const ChildWrapper = styled.div`\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n`;\n\nexport const ChildInner = styled.div`\n height: auto;\n margin: auto 0;\n`;\n"],"names":["HEADER_HEIGHT_LARGE","HEADER_HEIGHT_SMALL","HEADER_PADDING","defaultTheme","spacing","xs","HEADER_LOGO_HEIGHT_SMALL","ANIMATION_SPEED","StyledHeader","styled","header","theme","colors","headerBackground","HeaderStickyPlaceHolder","div","breakpoint","desktop","HeaderStickyContainer","headerBorder","$isSticky","shadows","l","$isSmall","HeaderMainContent","$fullWidth","utilities","contentMaxWidth","Logo","img","LogoWrapper","StyledLink","a","SkipToMain","Tagline","p","typography","fontFamilyHeadings","fontWeightHeadings","fontSizes","xl","headerTaglineText","ChildWrapper","ChildInner"],"mappings":"kFAKA,MAAMA,EAAsB,QACtBC,EAAsB,OACtBC,EAAiBC,EAAaC,QAAQC,GAEtCC,EAA2B,OAC3BC,EAAkB,OAEXC,EAAeC,EAAOC,MAA4B;;;;sBAIzC,EAClBC,OACEC,QAAUC,wBAERA;;EAIKC,EAA0BL,EAAOM,GAAyB;;;;YAI3Dd;;uBAEW,EAAGU,WAAYA,EAAMK,WAAWC;cACzCjB;;EAIDkB,EAAwBT,EAAOM,GAI1C;;;;eAIab;sBACO,EAClBS,OACEC,QAAUC,wBAERA;;mBAEW,EACfF,OACEC,QAAUO,oBAER,aAAaA;YACTlB;gBACI,EAAGU,QAAOS,eACtBA,EAAYT,EAAMU,QAAQC,EAAI;SACzB,EAAGF,eAAiBA,EAAY,EAAI;cAC/B,EAAGA,eAAiBA,EAAY,QAAU;uBACjCb;;uBAEA,EAAGI,WAAYA,EAAMK,WAAWC;gBACvC,EAAGG,eAAiBA,EAAY,QAAU;cAC5C,EAAGG,WAAUH,eACrBG,GAAYH,EAAYnB,EAAsBD;;EAIvCwB,EAAoBf,EAAOM,GAGtC;;;;;;;;eAQa,EACXU,aACAd,OACEe,WAAaC,uBAEVF,EAAa,OAASE;EAGlBC,EAAOnB,EAAOoB,GAAG;;;;;EAOjBC,EAAcrB,EAAOM,GAIhC;;;;;uBAKqBR;;YAEXD;;uBAEW,EAAGK,WAAYA,EAAMK,WAAWC;cACzC,EAAGM,WAAUH,eACrBG,GAAYH,EACRd,EAvGuB;;EA4GpByB,EAAatB,EAAOuB,CAAC;;EAIrBC,EAAaxB,EAAOuB,CAAuB;;;;;;;;;;;;;;;;;eAiBzC,EACTrB,OACEP,SAAWC,UAETA;;;;;;;EASG6B,EAAUzB,EAAO0B,CAI5B;;iBAEe,EAAGxB,WAAYA,EAAMyB,WAAWC;iBAChC,EAAG1B,WAAYA,EAAMyB,WAAWE;eAClC,EACX3B,OACE4B,WAAaC,UAEXA;WACG,EAAG7B,WAAYA,EAAMC,OAAO6B;;;wBAGflC;;;uBAGD,EAAGI,WAAYA,EAAMK,WAAWC;;eAExC,EAAGM,WAAUH,eAAiBG,GAAYH,EAAY,EAAI;;EAI5DsB,EAAejC,EAAOM,GAAG;;;;;EAOzB4B,EAAalC,EAAOM,GAAG;;;"}
@@ -1,4 +1,4 @@
1
- import { StoryObj } from "@storybook/react";
1
+ import { type StoryObj } from "@storybook/react";
2
2
  import Heading from ".";
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import r from"react";import{useTheme as o}from"styled-components";import{crukTheme as l}from"../../themes/cruk.js";import{spacingPropsToSpacingPropsInternal as $}from"../Spacing/index.js";import{H1 as a,H2 as i,H3 as m,H4 as x,H5 as n,H6 as h}from"./styles.js";function p(p){var w=p.textSize,f=p.textAlign,d=p.textColor,s=p.wordBreak,c=p.overflowWrap,g=p.h1,k=p.h2,v=p.h3,S=p.h4,z=p.h5,A=p.h6,B=e(p,["textSize","textAlign","textColor","wordBreak","overflowWrap","h1","h2","h3","h4","h5","h6"]),C=o(),W=t(t({},l),C),E=$(B);return g?r.createElement(a,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):k?r.createElement(i,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):v?r.createElement(m,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):S?r.createElement(x,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):z?r.createElement(n,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):A?r.createElement(h,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c})):r.createElement(i,t({},E,{theme:W,$textSize:w,$textAlign:f,$textColor:d,$wordBreak:s,$overflowWrap:c}))}export{p as Heading,p as default};
1
+ import e from"react";import{useTheme as t}from"styled-components";import{crukTheme as r}from"../../themes/cruk.js";import{spacingPropsToSpacingPropsInternal as o}from"../Spacing/index.js";import{H1 as $,H2 as l,H3 as a,H4 as m,H5 as x,H6 as i}from"./styles.js";function n({textSize:n,textAlign:p,textColor:w,wordBreak:f,overflowWrap:h,h1:c,h2:d,h3:s,h4:g,h5:k,h6:S,...v}){const z=t(),A={...r,...z},B=o(v);return c?e.createElement($,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):d?e.createElement(l,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):s?e.createElement(a,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):g?e.createElement(m,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):k?e.createElement(x,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):S?e.createElement(i,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h}):e.createElement(l,{...B,theme:A,$textSize:n,$textAlign:p,$textColor:w,$wordBreak:f,$overflowWrap:h})}export{n as Heading,n as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Heading/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ElementType } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport {\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"../Spacing\";\n\nimport {\n type FontSizeType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\nimport { H1, H2, H3, H4, H5, H6 } from \"./styles\";\n\nexport type HeadingProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n h1?: boolean;\n h2?: boolean;\n h3?: boolean;\n h4?: boolean;\n h5?: boolean;\n h6?: boolean;\n /** font size FontSizeType t-shirt sizes */\n textSize?: FontSizeType;\n /** horizontal alignment of text */\n textAlign?: \"left\" | \"right\" | \"center\";\n /** color of text */\n textColor?: string;\n /** word-break behavior */\n wordBreak?: WordBreakType;\n /** overflow-wrap behavior */\n overflowWrap?: OverflowWrapType;\n /** styled-component polymorphic feature so you take the styling of a header and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * \n * Use headings consistently to create a clear hierarchy throughout your service.\nMarkup headings semantically using the appropriate <h#> level HTML element and\nuse the corresponding heading class (h1, h2, h3, ....). Write all headings in sentence case. Heading differs from the Text component by using a different font-family and it changes the font size according to the screen width breakpoints.\n * \n */\nexport function Heading({\n textSize,\n textAlign,\n textColor,\n wordBreak,\n overflowWrap,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n ...props\n}: HeadingProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const propsConvertedToInternalSpacingProps =\n spacingPropsToSpacingPropsInternal(props);\n\n if (h1)\n return (\n <H1\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h2)\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h3)\n return (\n <H3\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h4)\n return (\n <H4\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h5)\n return (\n <H5\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h6)\n return (\n <H6\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n}\n\nexport default Heading;\n"],"names":["Heading","_a","textSize","textAlign","textColor","wordBreak","overflowWrap","h1","h2","h3","h4","h5","h6","props","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","propsConvertedToInternalSpacingProps","spacingPropsToSpacingPropsInternal","React","H1","$textSize","$textAlign","$wordBreak","$overflowWrap","H2","H3","H4","H5","H6"],"mappings":"qVA6CM,SAAUA,EAAQC,GACtB,IAAAC,EAAQD,EAAAC,SACRC,EAASF,EAAAE,UACTC,EAASH,EAAAG,UACTC,cACAC,EAAYL,EAAAK,aACZC,EAAEN,EAAAM,GACFC,EAAEP,EAAAO,GACFC,EAAER,EAAAQ,GACFC,OACAC,EAAEV,EAAAU,GACFC,EAAEX,EAAAW,GACCC,EAAKC,EAAAb,EAZc,+FAchBc,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACJC,EAAmCR,GAErC,OAAIN,EAEAe,gBAACC,EAAEL,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBE,EAEAc,gBAACM,EAAEV,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBG,EAEAa,gBAACO,EAAEX,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBI,EAEAY,gBAACQ,EAAEZ,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBK,EAEAW,gBAACS,EAAEb,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAGjBM,EAEAU,gBAACU,EAAEd,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,KAInBgB,gBAACM,EAAEV,EAAA,CAAA,EACGE,EACJ,CAAAH,MAAOA,EAAKO,UACDtB,EACCuB,WAAAtB,aACAC,EAASsB,WACTrB,EACGsB,cAAArB,IAGrB"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Heading/index.tsx"],"sourcesContent":["import React, { type HTMLAttributes, type ElementType } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport {\n spacingPropsToSpacingPropsInternal,\n type SpacingProps,\n} from \"../Spacing\";\n\nimport {\n type FontSizeType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\nimport { H1, H2, H3, H4, H5, H6 } from \"./styles\";\n\nexport type HeadingProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n h1?: boolean;\n h2?: boolean;\n h3?: boolean;\n h4?: boolean;\n h5?: boolean;\n h6?: boolean;\n /** font size FontSizeType t-shirt sizes */\n textSize?: FontSizeType;\n /** horizontal alignment of text */\n textAlign?: \"left\" | \"right\" | \"center\";\n /** color of text */\n textColor?: string;\n /** word-break behavior */\n wordBreak?: WordBreakType;\n /** overflow-wrap behavior */\n overflowWrap?: OverflowWrapType;\n /** styled-component polymorphic feature so you take the styling of a header and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * \n * Use headings consistently to create a clear hierarchy throughout your service.\nMarkup headings semantically using the appropriate <h#> level HTML element and\nuse the corresponding heading class (h1, h2, h3, ....). Write all headings in sentence case. Heading differs from the Text component by using a different font-family and it changes the font size according to the screen width breakpoints.\n * \n */\nexport function Heading({\n textSize,\n textAlign,\n textColor,\n wordBreak,\n overflowWrap,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n ...props\n}: HeadingProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const propsConvertedToInternalSpacingProps =\n spacingPropsToSpacingPropsInternal(props);\n\n if (h1)\n return (\n <H1\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h2)\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h3)\n return (\n <H3\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h4)\n return (\n <H4\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h5)\n return (\n <H5\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n if (h6)\n return (\n <H6\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n return (\n <H2\n {...propsConvertedToInternalSpacingProps}\n theme={theme}\n $textSize={textSize}\n $textAlign={textAlign}\n $textColor={textColor}\n $wordBreak={wordBreak}\n $overflowWrap={overflowWrap}\n />\n );\n}\n\nexport default Heading;\n"],"names":["Heading","textSize","textAlign","textColor","wordBreak","overflowWrap","h1","h2","h3","h4","h5","h6","props","foundTheme","useTheme","theme","defaultTheme","propsConvertedToInternalSpacingProps","spacingPropsToSpacingPropsInternal","React","H1","$textSize","$textAlign","$wordBreak","$overflowWrap","H2","H3","H4","H5","H6"],"mappings":"qQA6CgB,SAAAA,GAAQC,SACtBA,EAAQC,UACRA,EAASC,UACTA,EAASC,UACTA,EAASC,aACTA,EAAYC,GACZA,EAAEC,GACFA,EAAEC,GACFA,EAAEC,GACFA,EAAEC,GACFA,EAAEC,GACFA,KACGC,IAEH,MAAMC,EAAaC,IACbC,EAAQ,IACTC,KACAH,GAGCI,EACJC,EAAmCN,GAErC,OAAIN,EAEAa,gBAACC,EAAE,IACGH,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,IAGjBE,EAEAY,gBAACM,EAAE,IACGR,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,IAGjBG,EAEAW,gBAACO,EAAE,IACGT,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,IAGjBI,EAEAU,gBAACQ,EAAE,IACGV,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,IAGjBK,EAEAS,gBAACS,EAAE,IACGX,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,IAGjBM,EAEAQ,gBAACU,EAAE,IACGZ,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,IAInBc,gBAACM,EAAE,IACGR,EACJF,MAAOA,EAAKM,UACDpB,EACCqB,WAAApB,aACAC,EAASoB,WACTnB,EACGoB,cAAAnB,GAGrB"}
@@ -1,2 +1,76 @@
1
- import{__makeTemplateObject as n,__rest as t}from"../../../node_modules/tslib/tslib.es6.js";import e,{css as i}from"styled-components";import{spacing as r}from"../Spacing/index.js";var o,f,m,a,u,s,l,x=function(e){return i(o||(o=n(["\n font-family: ",";\n font-weight: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"],["\n font-family: ",";\n font-weight: ",";\n word-break: ",";\n overflow-wrap: ",";\n color: ",";\n line-height: ",";\n text-transform: ",";\n margin-top: ",";\n margin-bottom: ",";\n max-width: 100%;\n text-align: ",";\n\n &:first-child {\n margin-top: 0;\n }\n\n ","\n"])),e.theme.typography.fontFamilyHeadings,e.theme.typography.fontWeightHeadings,e.$wordBreak||"normal",e.$overflowWrap||"break-word",e.$textColor&&void 0!==e.theme.colors[e.$textColor]?e.theme.colors[e.$textColor]:e.$textColor||e.theme.colors.textHeaderDefault,e.theme.typography.headerLineHeight,e.theme.typography.headerTextTransform,e.theme.spacing.m,e.theme.spacing.s,e.$textAlign||"left",(function(){e.theme;var n=t(e,["theme"]);return r(n,e.theme)}))},h=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":return e.fontSizes.l;case"xl":return e.fontSizes.xl;case"xxl":return e.fontSizes.xxl;case"xxxl":return e.fontSizes.xxxl;case"xxxxl":return e.fontSizes.xxxxl;default:return t}},z=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":return e.fontSizes.l;case"xxl":return e.fontSizes.xl;case"xxxl":return e.fontSizes.xxl;case"xxxxl":return e.fontSizes.xxxl;default:return t}},d=function(n,t,e){switch(n){case"m":return e.fontSizes.m;case"l":case"xl":case"xxl":return e.fontSizes.l;case"xxxl":return e.fontSizes.xl;case"xxxxl":return e.fontSizes.xxl;default:return t}},c=e.h1(f||(f=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.xxxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xxxxl,t)})),S=e.h2(m||(m=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.xxl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xxxl,t)})),p=e.h3(a||(a=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.xl,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xxl,t)})),w=e.h4(u||(u=n(["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.xl,t)})),b=e.h5(s||(s=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.l,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.l,t)})),$=e.h6(l||(l=n(["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"],["\n ","\n\n font-size: ",";\n @media (min-width: ",") {\n font-size: ",";\n }\n @media (min-width: ",") {\n font-size: ",";\n }\n"])),(function(n){return x(n)}),(function(n){var t=n.theme,e=n.$textSize;return d(e||null,t.fontSizes.m,t)}),(function(n){return n.theme.breakpoint.tablet}),(function(n){var t=n.theme,e=n.$textSize;return z(e||null,t.fontSizes.m,t)}),(function(n){return n.theme.breakpoint.desktop}),(function(n){var t=n.theme,e=n.$textSize;return h(e||null,t.fontSizes.m,t)}));export{c as H1,S as H2,p as H3,w as H4,b as H5,$ as H6};
1
+ import e,{css as t}from"styled-components";import{spacing as i}from"../Spacing/index.js";const n=e=>t`
2
+ font-family: ${e.theme.typography.fontFamilyHeadings};
3
+ font-weight: ${e.theme.typography.fontWeightHeadings};
4
+ word-break: ${e.$wordBreak||"normal"};
5
+ overflow-wrap: ${e.$overflowWrap||"break-word"};
6
+ color: ${e.$textColor&&void 0!==e.theme.colors[e.$textColor]?e.theme.colors[e.$textColor]:e.$textColor||e.theme.colors.textHeaderDefault};
7
+ line-height: ${e.theme.typography.headerLineHeight};
8
+ text-transform: ${e.theme.typography.headerTextTransform};
9
+ margin-top: ${e.theme.spacing.m};
10
+ margin-bottom: ${e.theme.spacing.s};
11
+ max-width: 100%;
12
+ text-align: ${e.$textAlign||"left"};
13
+
14
+ &:first-child {
15
+ margin-top: 0;
16
+ }
17
+
18
+ ${()=>{const{theme:t,...n}=e;return i(n,e.theme)}}
19
+ `,o=(e,t,i)=>{switch(e){case"m":return i.fontSizes.m;case"l":return i.fontSizes.l;case"xl":return i.fontSizes.xl;case"xxl":return i.fontSizes.xxl;case"xxxl":return i.fontSizes.xxxl;case"xxxxl":return i.fontSizes.xxxxl;default:return t}},l=(e,t,i)=>{switch(e){case"m":return i.fontSizes.m;case"l":case"xl":return i.fontSizes.l;case"xxl":return i.fontSizes.xl;case"xxxl":return i.fontSizes.xxl;case"xxxxl":return i.fontSizes.xxxl;default:return t}},x=(e,t,i)=>{switch(e){case"m":return i.fontSizes.m;case"l":case"xl":case"xxl":return i.fontSizes.l;case"xxxl":return i.fontSizes.xl;case"xxxxl":return i.fontSizes.xxl;default:return t}},s=e.h1`
20
+ ${e=>n(e)}
21
+ font-size: ${({theme:e,$textSize:t})=>x(t||null,e.fontSizes.xxl,e)};
22
+ @media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
23
+ font-size: ${({theme:e,$textSize:t})=>l(t||null,e.fontSizes.xxxl,e)};
24
+ }
25
+ @media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
26
+ font-size: ${({theme:e,$textSize:t})=>o(t||null,e.fontSizes.xxxxl,e)};
27
+ }
28
+ `,m=e.h2`
29
+ ${e=>n(e)}
30
+ font-size: ${({theme:e,$textSize:t})=>x(t||null,e.fontSizes.xl,e)};
31
+ @media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
32
+ font-size: ${({theme:e,$textSize:t})=>l(t||null,e.fontSizes.xxl,e)};
33
+ }
34
+ @media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
35
+ font-size: ${({theme:e,$textSize:t})=>o(t||null,e.fontSizes.xxxl,e)};
36
+ }
37
+ `,r=e.h3`
38
+ ${e=>n(e)}
39
+ font-size: ${({theme:e,$textSize:t})=>x(t||null,e.fontSizes.l,e)};
40
+ @media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
41
+ font-size: ${({theme:e,$textSize:t})=>l(t||null,e.fontSizes.xl,e)};
42
+ }
43
+ @media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
44
+ font-size: ${({theme:e,$textSize:t})=>o(t||null,e.fontSizes.xxl,e)};
45
+ }
46
+ `,a=e.h4`
47
+ ${e=>n(e)}
48
+ font-size: ${({theme:e,$textSize:t})=>x(t||null,e.fontSizes.l,e)};
49
+ @media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
50
+ font-size: ${({theme:e,$textSize:t})=>l(t||null,e.fontSizes.l,e)};
51
+ }
52
+ @media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
53
+ font-size: ${({theme:e,$textSize:t})=>o(t||null,e.fontSizes.xl,e)};
54
+ }
55
+ `,h=e.h5`
56
+ ${e=>n(e)}
57
+
58
+ font-size: ${({theme:e,$textSize:t})=>x(t||null,e.fontSizes.l,e)};
59
+ @media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
60
+ font-size: ${({theme:e,$textSize:t})=>l(t||null,e.fontSizes.l,e)};
61
+ }
62
+ @media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
63
+ font-size: ${({theme:e,$textSize:t})=>o(t||null,e.fontSizes.l,e)};
64
+ }
65
+ `,$=e.h6`
66
+ ${e=>n(e)}
67
+
68
+ font-size: ${({theme:e,$textSize:t})=>x(t||null,e.fontSizes.m,e)};
69
+ @media (min-width: ${({theme:e})=>e.breakpoint.tablet}) {
70
+ font-size: ${({theme:e,$textSize:t})=>l(t||null,e.fontSizes.m,e)};
71
+ }
72
+ @media (min-width: ${({theme:e})=>e.breakpoint.desktop}) {
73
+ font-size: ${({theme:e,$textSize:t})=>o(t||null,e.fontSizes.m,e)};
74
+ }
75
+ `;export{s as H1,m as H2,r as H3,a as H4,h as H5,$ as H6};
2
76
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/Heading/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\n\nimport {\n type ThemeType,\n type FontSizeType,\n type ColorKeyType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingPropsInternal & {\n theme: ThemeType;\n $textSize?: FontSizeType;\n $textAlign?: \"left\" | \"right\" | \"center\";\n $textColor?: string;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n};\n\nconst StyledHeading = (props: StyledHeadingProps) => css`\n font-family: ${props.theme.typography.fontFamilyHeadings};\n font-weight: ${props.theme.typography.fontWeightHeadings};\n word-break: ${props.$wordBreak || \"normal\"};\n overflow-wrap: ${props.$overflowWrap || \"break-word\"};\n color: ${props.$textColor &&\n typeof props.theme.colors[props.$textColor as ColorKeyType] !== \"undefined\"\n ? props.theme.colors[props.$textColor as ColorKeyType]\n : props.$textColor || props.theme.colors.textHeaderDefault};\n line-height: ${props.theme.typography.headerLineHeight};\n text-transform: ${props.theme.typography.headerTextTransform};\n margin-top: ${props.theme.spacing.m};\n margin-bottom: ${props.theme.spacing.s};\n max-width: 100%;\n text-align: ${props.$textAlign || \"left\"};\n\n &:first-child {\n margin-top: 0;\n }\n\n ${() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { theme, ...propsWithoutTheme } = props;\n\n return spacing(propsWithoutTheme, props.theme);\n }}\n`;\n\nconst desktopFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.xl;\n case \"xxl\":\n return theme.fontSizes.xxl;\n case \"xxxl\":\n return theme.fontSizes.xxxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down a size on the typography scale\nconst tabletFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.xl;\n case \"xxxl\":\n return theme.fontSizes.xxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down two sizes on the typography scale\nconst mobileFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.l;\n case \"xxxl\":\n return theme.fontSizes.xl;\n case \"xxxxl\":\n return theme.fontSizes.xxl;\n\n default:\n return defaultFontSize;\n }\n};\n\nexport const H1 = styled.h1<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxxl, theme)};\n }\n`;\n\nexport const H2 = styled.h2<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n`;\n\nexport const H3 = styled.h3<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n`;\n\nexport const H4 = styled.h4<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n`;\n\nexport const H5 = styled.h5<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n`;\n\nexport const H6 = styled.h6<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.m, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n`;\n"],"names":["StyledHeading","props","css","templateObject_1","__makeTemplateObject","theme","typography","fontFamilyHeadings","fontWeightHeadings","$wordBreak","$overflowWrap","$textColor","colors","textHeaderDefault","headerLineHeight","headerTextTransform","spacing","m","s","$textAlign","propsWithoutTheme","__rest","desktopFontSize","$textSize","defaultFontSize","fontSizes","l","xl","xxl","xxxl","xxxxl","tabletFontSize","mobileFontSize","H1","styled","h1","templateObject_2","_a","breakpoint","tablet","desktop","H2","h2","templateObject_3","H3","h3","templateObject_4","H4","h4","templateObject_5","H5","h5","templateObject_6","H6","h6","templateObject_7"],"mappings":"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"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/Heading/styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { spacing, type SpacingPropsInternal } from \"../Spacing\";\n\nimport {\n type ThemeType,\n type FontSizeType,\n type ColorKeyType,\n type WordBreakType,\n type OverflowWrapType,\n} from \"../../types\";\n\ntype StyledHeadingProps = SpacingPropsInternal & {\n theme: ThemeType;\n $textSize?: FontSizeType;\n $textAlign?: \"left\" | \"right\" | \"center\";\n $textColor?: string;\n $wordBreak?: WordBreakType;\n $overflowWrap?: OverflowWrapType;\n};\n\nconst StyledHeading = (props: StyledHeadingProps) => css`\n font-family: ${props.theme.typography.fontFamilyHeadings};\n font-weight: ${props.theme.typography.fontWeightHeadings};\n word-break: ${props.$wordBreak || \"normal\"};\n overflow-wrap: ${props.$overflowWrap || \"break-word\"};\n color: ${props.$textColor &&\n typeof props.theme.colors[props.$textColor as ColorKeyType] !== \"undefined\"\n ? props.theme.colors[props.$textColor as ColorKeyType]\n : props.$textColor || props.theme.colors.textHeaderDefault};\n line-height: ${props.theme.typography.headerLineHeight};\n text-transform: ${props.theme.typography.headerTextTransform};\n margin-top: ${props.theme.spacing.m};\n margin-bottom: ${props.theme.spacing.s};\n max-width: 100%;\n text-align: ${props.$textAlign || \"left\"};\n\n &:first-child {\n margin-top: 0;\n }\n\n ${() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { theme, ...propsWithoutTheme } = props;\n\n return spacing(propsWithoutTheme, props.theme);\n }}\n`;\n\nconst desktopFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.xl;\n case \"xxl\":\n return theme.fontSizes.xxl;\n case \"xxxl\":\n return theme.fontSizes.xxxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down a size on the typography scale\nconst tabletFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.xl;\n case \"xxxl\":\n return theme.fontSizes.xxl;\n case \"xxxxl\":\n return theme.fontSizes.xxxl;\n\n default:\n return defaultFontSize;\n }\n};\n\n// everything drops down two sizes on the typography scale\nconst mobileFontSize = (\n $textSize: FontSizeType | null,\n defaultFontSize: string,\n theme: ThemeType,\n) => {\n switch ($textSize) {\n case \"m\":\n return theme.fontSizes.m;\n case \"l\":\n return theme.fontSizes.l;\n case \"xl\":\n return theme.fontSizes.l;\n case \"xxl\":\n return theme.fontSizes.l;\n case \"xxxl\":\n return theme.fontSizes.xl;\n case \"xxxxl\":\n return theme.fontSizes.xxl;\n\n default:\n return defaultFontSize;\n }\n};\n\nexport const H1 = styled.h1<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxxl, theme)};\n }\n`;\n\nexport const H2 = styled.h2<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.xl, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxxl, theme)};\n }\n`;\n\nexport const H3 = styled.h3<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xxl, theme)};\n }\n`;\n\nexport const H4 = styled.h4<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.xl, theme)};\n }\n`;\n\nexport const H5 = styled.h5<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.l, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.l, theme)};\n }\n`;\n\nexport const H6 = styled.h6<StyledHeadingProps>`\n ${(props) => StyledHeading(props)}\n\n font-size: ${({ theme, $textSize }) =>\n mobileFontSize($textSize || null, theme.fontSizes.m, theme)};\n @media (min-width: ${({ theme }) => theme.breakpoint.tablet}) {\n font-size: ${({ theme, $textSize }) =>\n tabletFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n @media (min-width: ${({ theme }) => theme.breakpoint.desktop}) {\n font-size: ${({ theme, $textSize }) =>\n desktopFontSize($textSize || null, theme.fontSizes.m, theme)};\n }\n`;\n"],"names":["StyledHeading","props","css","theme","typography","fontFamilyHeadings","fontWeightHeadings","$wordBreak","$overflowWrap","$textColor","colors","textHeaderDefault","headerLineHeight","headerTextTransform","spacing","m","s","$textAlign","propsWithoutTheme","desktopFontSize","$textSize","defaultFontSize","fontSizes","l","xl","xxl","xxxl","xxxxl","tabletFontSize","mobileFontSize","H1","styled","h1","breakpoint","tablet","desktop","H2","h2","H3","h3","H4","h4","H5","h5","H6","h6"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { StoryObj } from "@storybook/react";
1
+ import { type StoryObj } from "@storybook/react";
2
2
  import { IconFa } from "..";
3
3
  declare const _default: {
4
4
  title: string;
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import o from"react";import{useTheme as t}from"styled-components";import{crukTheme as r}from"../../themes/cruk.js";import{StyledIcon as m}from"./styles.js";import{themeSizeOrString as s,themeColorOrString as i}from"../../utils/themeUtils.js";function c(c){var n=c.faIcon,l=c.color,a=c.size,p=void 0===a?"1.1rem":a,f=t(),d=e(e({},r),f),u=n.icon,h=u[0],j=u[1],v=u[4];return o.createElement(m,{theme:d,role:"presentation",viewBox:"0 0 ".concat(h," ").concat(j),$size:s(p,d),$color:i(l,d)},v&&o.createElement("path",{d:v}))}export{c as IconFa,c as default};
1
+ import e from"react";import{useTheme as t}from"styled-components";import{crukTheme as o}from"../../themes/cruk.js";import{StyledIcon as r}from"./styles.js";import{themeColorOrString as m,themeSizeOrString as s}from"../../utils/themeUtils.js";function i({faIcon:i,color:n,size:c="1.1rem"}){const l=t(),p={...o,...l},[a,f,,,u]=i.icon;return e.createElement(r,{theme:p,role:"presentation",viewBox:`0 0 ${a} ${f}`,$size:s(c,p),$color:m(n,p)},u&&e.createElement("path",{d:u}))}export{i as IconFa,i as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/IconFa/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { type IconDefinition } from \"@fortawesome/fontawesome-common-types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledIcon } from \"./styles\";\nimport { themeColorOrString, themeSizeOrString } from \"../../utils/themeUtils\";\n\nexport type IconFaProps = {\n /** imported icon definition from \"@fortawesome/free-solid-svg-icons\" or \"@fortawesome/free-brands-svg-icons\" */\n faIcon: IconDefinition;\n /** color of icon, inherits current text colour by default */\n color?: string;\n /** size of ion 1.1em by default */\n size?: string;\n};\n\n/**\n * The IconFa component (Icon Font Awesome) displays an icon glyph as an `<svg>` element.\n *\n * This is an svg icon wrapper where a font awesome icon definition can be passed in a long with colour and size\n * */\nexport function IconFa({ faIcon, color, size = \"1.1rem\" }: IconFaProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const [width, height, , , svgPathData] = faIcon.icon;\n\n return (\n <StyledIcon\n theme={theme}\n role=\"presentation\"\n viewBox={`0 0 ${width} ${height}`}\n $size={themeSizeOrString(size, theme)}\n $color={themeColorOrString(color, theme)}\n >\n {svgPathData && <path d={svgPathData as string} />}\n </StyledIcon>\n );\n}\n\nexport default IconFa;\n"],"names":["IconFa","_a","faIcon","color","_b","size","foundTheme","useTheme","theme","__assign","defaultTheme","_c","icon","width","height","svgPathData","React","createElement","StyledIcon","role","viewBox","concat","$size","themeSizeOrString","$color","themeColorOrString","d"],"mappings":"sTAsBM,SAAUA,EAAOC,OAAEC,EAAMD,EAAAC,OAAEC,EAAKF,EAAAE,MAAEC,SAAAC,OAAO,IAAAD,EAAA,SAAQA,EAC/CE,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAECK,EAAmCT,EAAOU,KAAzCC,EAAKF,EAAA,GAAEG,EAAMH,EAAA,GAAMI,OAE1B,OACEC,EAACC,cAAAC,GACCV,MAAOA,EACPW,KAAK,eACLC,QAAS,OAAAC,OAAOR,EAAS,KAAAQ,OAAAP,GAClBQ,MAAAC,EAAkBlB,EAAMG,GAAMgB,OAC7BC,EAAmBtB,EAAOK,IAEjCO,GAAeC,wBAAMU,EAAGX,IAG/B"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/IconFa/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { type IconDefinition } from \"@fortawesome/fontawesome-common-types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledIcon } from \"./styles\";\nimport { themeColorOrString, themeSizeOrString } from \"../../utils/themeUtils\";\n\nexport type IconFaProps = {\n /** imported icon definition from \"@fortawesome/free-solid-svg-icons\" or \"@fortawesome/free-brands-svg-icons\" */\n faIcon: IconDefinition;\n /** color of icon, inherits current text colour by default */\n color?: string;\n /** size of ion 1.1em by default */\n size?: string;\n};\n\n/**\n * The IconFa component (Icon Font Awesome) displays an icon glyph as an `<svg>` element.\n *\n * This is an svg icon wrapper where a font awesome icon definition can be passed in a long with colour and size\n * */\nexport function IconFa({ faIcon, color, size = \"1.1rem\" }: IconFaProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n const [width, height, , , svgPathData] = faIcon.icon;\n\n return (\n <StyledIcon\n theme={theme}\n role=\"presentation\"\n viewBox={`0 0 ${width} ${height}`}\n $size={themeSizeOrString(size, theme)}\n $color={themeColorOrString(color, theme)}\n >\n {svgPathData && <path d={svgPathData as string} />}\n </StyledIcon>\n );\n}\n\nexport default IconFa;\n"],"names":["IconFa","faIcon","color","size","foundTheme","useTheme","theme","defaultTheme","width","height","svgPathData","icon","React","createElement","StyledIcon","role","viewBox","$size","themeSizeOrString","$color","themeColorOrString","d"],"mappings":"kPAsBM,SAAUA,GAAOC,OAAEA,EAAMC,MAAEA,EAAKC,KAAEA,EAAO,WAC7C,MAAMC,EAAaC,IACbC,EAAQ,IACTC,KACAH,IAEEI,EAAOC,EAAY,CAAA,CAAAC,GAAeT,EAAOU,KAEhD,OACEC,EAACC,cAAAC,GACCR,MAAOA,EACPS,KAAK,eACLC,QAAS,OAAOR,KAASC,IAClBQ,MAAAC,EAAkBf,EAAMG,GAAMa,OAC7BC,EAAmBlB,EAAOI,IAEjCI,GAAeE,wBAAMS,EAAGX,IAG/B"}
@@ -1,2 +1,11 @@
1
- import{__makeTemplateObject as n}from"../../../node_modules/tslib/tslib.es6.js";import i from"styled-components";var t,e=i.svg(t||(t=n(["\n display: inline-block;\n height: ",";\n margin-top: -0.2em;\n vertical-align: middle;\n width: ",";\n path {\n fill: ",";\n }\n"],["\n display: inline-block;\n height: ",";\n margin-top: -0.2em;\n vertical-align: middle;\n width: ",";\n path {\n fill: ",";\n }\n"])),(function(n){return n.$size}),(function(n){return n.$size}),(function(n){return n.$color}));export{e as StyledIcon,e as default};
1
+ import i from"styled-components";const e=i.svg`
2
+ display: inline-block;
3
+ height: ${({$size:i})=>i};
4
+ margin-top: -0.2em;
5
+ vertical-align: middle;
6
+ width: ${({$size:i})=>i};
7
+ path {
8
+ fill: ${({$color:i})=>i};
9
+ }
10
+ `;export{e as StyledIcon,e as default};
2
11
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sources":["../../../../src/components/IconFa/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nexport const StyledIcon = styled.svg<{\n theme: ThemeType;\n $color?: string;\n $size: string;\n}>`\n display: inline-block;\n height: ${({ $size }) => $size};\n margin-top: -0.2em;\n vertical-align: middle;\n width: ${({ $size }) => $size};\n path {\n fill: ${({ $color }) => $color};\n }\n`;\n\nexport default StyledIcon;\n"],"names":["StyledIcon","styled","svg","templateObject_1","__makeTemplateObject","_a","$size","$color"],"mappings":"iHAGa,MAAAA,EAAaC,EAAOC,IAAGC,IAAAA,EAAAC,EAAA,CAAA,yCAAA,iEAAA,0BAAA,YAAA,CAIlC,yCAE8B,iEAGD,0BAEG,eALtB,SAACC,GAAc,OAAPA,EAAAC,KAAO,IAGhB,SAACD,GAAc,OAAPA,EAAAC,KAAO,IAEd,SAACD,GAAe,OAAPA,EAAAE,MAAO"}
1
+ {"version":3,"file":"styles.js","sources":["../../../../src/components/IconFa/styles.ts"],"sourcesContent":["import styled from \"styled-components\";\nimport { type ThemeType } from \"../../types\";\n\nexport const StyledIcon = styled.svg<{\n theme: ThemeType;\n $color?: string;\n $size: string;\n}>`\n display: inline-block;\n height: ${({ $size }) => $size};\n margin-top: -0.2em;\n vertical-align: middle;\n width: ${({ $size }) => $size};\n path {\n fill: ${({ $color }) => $color};\n }\n`;\n\nexport default StyledIcon;\n"],"names":["StyledIcon","styled","svg","$size","$color"],"mappings":"iCAGa,MAAAA,EAAaC,EAAOC,GAI/B;;YAEU,EAAGC,WAAYA;;;WAGhB,EAAGA,WAAYA;;YAEd,EAAGC,YAAaA;;"}
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { StoryObj } from "@storybook/react";
2
+ import { type StoryObj } from "@storybook/react";
3
3
  import InfoBox from ".";
4
4
  declare const _default: {
5
5
  title: string;
6
- component: React.ForwardRefExoticComponent<Omit<import(".").InfoBoxProps, "ref"> & React.RefAttributes<HTMLElement>>;
6
+ component: ({ children, titleText, titleTextColor, descriptionText, descriptionTextColor, icon, ref, ...spacingAndHTMLElementProps }: import(".").InfoBoxProps) => React.JSX.Element;
7
7
  args: {
8
8
  titleText: string;
9
9
  titleTextColor: string;
@@ -24,5 +24,5 @@ export type InfoBoxProps = SpacingProps & HTMLAttributes<HTMLElement> & {
24
24
 
25
25
  The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.
26
26
  */
27
- export declare const InfoBox: React.ForwardRefExoticComponent<Omit<InfoBoxProps, "ref"> & React.RefAttributes<HTMLElement>>;
27
+ export declare const InfoBox: ({ children, titleText, titleTextColor, descriptionText, descriptionTextColor, icon, ref, ...spacingAndHTMLElementProps }: InfoBoxProps) => React.JSX.Element;
28
28
  export default InfoBox;
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as t}from"../../../node_modules/tslib/tslib.es6.js";import o,{forwardRef as r}from"react";import{useTheme as i}from"styled-components";import{crukTheme as n}from"../../themes/cruk.js";import{Box as m}from"../Box/index.js";import{Text as l}from"../Text/index.js";import{Heading as s}from"../Heading/index.js";import{StyledInfoBox as a}from"./styles.js";var c=r((function(r,c){var x=r.children,d=r.titleText,p=r.titleTextColor,f=r.descriptionText,g=r.descriptionTextColor,C=r.icon,T=e(r,["children","titleText","titleTextColor","descriptionText","descriptionTextColor","icon"]),u=i(),h=t(t({},n),u),j=T.backgroundColor||h.tokenColors.grey_200;return o.createElement(a,t({theme:h},T,{backgroundColor:j,margin:T.margin||"none",ref:c}),C&&o.createElement(m,{marginRight:"s"},C),o.createElement("div",null,d&&o.createElement(s,{as:"p",margin:"none",h4:!0,marginBottom:"xxs",textColor:p||h.colors.textDark},d),f&&o.createElement(l,{textColor:g||h.colors.textDark,marginBottom:"none"},f),x))}));export{c as InfoBox,c as default};
1
+ import e from"react";import{useTheme as t}from"styled-components";import{crukTheme as o}from"../../themes/cruk.js";import{Box as r}from"../Box/index.js";import{Text as n}from"../Text/index.js";import{Heading as m}from"../Heading/index.js";import{StyledInfoBox as i}from"./styles.js";const l=({children:l,titleText:s,titleTextColor:a,descriptionText:c,descriptionTextColor:x,icon:d,ref:p,...g})=>{const f=t(),C={...o,...f},k=g.backgroundColor||C.tokenColors.grey_200;return e.createElement(i,{theme:C,...g,backgroundColor:k,margin:g.margin||"none",ref:p},d&&e.createElement(r,{marginRight:"s"},d),e.createElement("div",null,s&&e.createElement(m,{as:"p",margin:"none",h4:!0,marginBottom:"xxs",textColor:a||C.colors.textDark},s),c&&e.createElement(n,{textColor:x||C.colors.textDark,marginBottom:"none"},c),l))};export{l as InfoBox,l as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/InfoBox/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type Ref,\n forwardRef,\n type ReactNode,\n type ElementType,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { Box } from \"../Box\";\nimport { Text } from \"../Text\";\nimport { Heading } from \"../Heading\";\n\nimport { type SpacingProps } from \"../Spacing\";\nimport { StyledInfoBox } from \"./styles\";\n\nexport type InfoBoxProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n /** background color of wrapping element, this will add default padding */\n backgroundColor?: string;\n /** Title text */\n titleText: string;\n /** Title text colour */\n titleTextColor?: string;\n /** Description text */\n descriptionText: string;\n /** Description text colour */\n descriptionTextColor?: string;\n /** Space for extra element underneath description */\n children?: ReactNode;\n /** Icon in left column usually 2em squared */\n icon?: ReactNode;\n ref?: Ref<HTMLElement>;\n /** styled-component polymorphic feature so you take the styling of a box and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * Box is used to wrap other components to add margin and padding. The values will be in the t-shirt sizes specified in the theme sizes.\n \n The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.\n */\nexport const InfoBox = forwardRef(\n (\n {\n children,\n titleText,\n titleTextColor,\n descriptionText,\n descriptionTextColor,\n icon,\n ...spacingAndHTMLElementProps\n }: InfoBoxProps,\n ref?: Ref<HTMLElement>,\n ) => {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const backgroundColorOrDefault =\n spacingAndHTMLElementProps.backgroundColor || theme.tokenColors.grey_200;\n\n return (\n <StyledInfoBox\n theme={theme}\n {...spacingAndHTMLElementProps}\n backgroundColor={backgroundColorOrDefault}\n margin={spacingAndHTMLElementProps.margin || \"none\"}\n ref={ref}\n >\n {icon && <Box marginRight=\"s\">{icon}</Box>}\n <div>\n {titleText && (\n <Heading\n as=\"p\"\n margin=\"none\"\n h4\n marginBottom=\"xxs\"\n textColor={titleTextColor || theme.colors.textDark}\n >\n {titleText}\n </Heading>\n )}\n {descriptionText && (\n <Text\n textColor={descriptionTextColor || theme.colors.textDark}\n marginBottom=\"none\"\n >\n {descriptionText}\n </Text>\n )}\n {children}\n </div>\n </StyledInfoBox>\n );\n },\n);\n\nexport default InfoBox;\n"],"names":["InfoBox","forwardRef","_a","ref","children","titleText","titleTextColor","descriptionText","descriptionTextColor","icon","spacingAndHTMLElementProps","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","backgroundColorOrDefault","backgroundColor","tokenColors","grey_200","React","createElement","StyledInfoBox","margin","Box","marginRight","Heading","as","h4","marginBottom","textColor","colors","textDark","Text"],"mappings":"gYA2CaA,EAAUC,GACrB,SACEC,EASAC,GARE,IAAAC,aACAC,cACAC,mBACAC,oBACAC,yBACAC,SACGC,EAPLC,EAAAT,EAAA,CAAA,WAAA,YAAA,iBAAA,kBAAA,uBAAA,SAWMU,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EACJP,EAA2BQ,iBAAmBJ,EAAMK,YAAYC,SAElE,OACEC,EAACC,cAAAC,EACCR,EAAA,CAAAD,MAAOA,GACHJ,EAA0B,CAC9BQ,gBAAiBD,EACjBO,OAAQd,EAA2Bc,QAAU,OAC7CrB,IAAKA,IAEJM,GAAQY,gBAACI,EAAG,CAACC,YAAY,KAAKjB,GAC/BY,EAAAC,cAAA,MAAA,KACGjB,GACCgB,EAACC,cAAAK,EACC,CAAAC,GAAG,IACHJ,OAAO,OACPK,IAAE,EACFC,aAAa,MACbC,UAAWzB,GAAkBQ,EAAMkB,OAAOC,UAEzC5B,GAGJE,GACCc,EAACC,cAAAY,GACCH,UAAWvB,GAAwBM,EAAMkB,OAAOC,SAChDH,aAAa,QAEZvB,GAGJH,GAIT"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/InfoBox/index.tsx"],"sourcesContent":["import React, {\n type HTMLAttributes,\n type Ref,\n type ReactNode,\n type ElementType,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\nimport { Box } from \"../Box\";\nimport { Text } from \"../Text\";\nimport { Heading } from \"../Heading\";\n\nimport { type SpacingProps } from \"../Spacing\";\nimport { StyledInfoBox } from \"./styles\";\n\nexport type InfoBoxProps = SpacingProps &\n HTMLAttributes<HTMLElement> & {\n /** background color of wrapping element, this will add default padding */\n backgroundColor?: string;\n /** Title text */\n titleText: string;\n /** Title text colour */\n titleTextColor?: string;\n /** Description text */\n descriptionText: string;\n /** Description text colour */\n descriptionTextColor?: string;\n /** Space for extra element underneath description */\n children?: ReactNode;\n /** Icon in left column usually 2em squared */\n icon?: ReactNode;\n ref?: Ref<HTMLElement>;\n /** styled-component polymorphic feature so you take the styling of a box and cast the component to be a \"span\" for example */\n as?: ElementType;\n };\n\n/**\n * Box is used to wrap other components to add margin and padding. The values will be in the t-shirt sizes specified in the theme sizes.\n \n The more specific the the target the higher priority the css will have. For example `margin` will be overridden by the `marginVertical` or `marginHorizontal` props. `marginTop`, `marginBottom`, `marginLeft`, `marginRight` will override the the `marginVertical` and `marginHorizontal` props.\n */\nexport const InfoBox = ({\n children,\n titleText,\n titleTextColor,\n descriptionText,\n descriptionTextColor,\n icon,\n ref,\n ...spacingAndHTMLElementProps\n}: InfoBoxProps) => {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const backgroundColorOrDefault =\n spacingAndHTMLElementProps.backgroundColor || theme.tokenColors.grey_200;\n\n return (\n <StyledInfoBox\n theme={theme}\n {...spacingAndHTMLElementProps}\n backgroundColor={backgroundColorOrDefault}\n margin={spacingAndHTMLElementProps.margin || \"none\"}\n ref={ref}\n >\n {icon && <Box marginRight=\"s\">{icon}</Box>}\n <div>\n {titleText && (\n <Heading\n as=\"p\"\n margin=\"none\"\n h4\n marginBottom=\"xxs\"\n textColor={titleTextColor || theme.colors.textDark}\n >\n {titleText}\n </Heading>\n )}\n {descriptionText && (\n <Text\n textColor={descriptionTextColor || theme.colors.textDark}\n marginBottom=\"none\"\n >\n {descriptionText}\n </Text>\n )}\n {children}\n </div>\n </StyledInfoBox>\n );\n};\n\nexport default InfoBox;\n"],"names":["InfoBox","children","titleText","titleTextColor","descriptionText","descriptionTextColor","icon","ref","spacingAndHTMLElementProps","foundTheme","useTheme","theme","defaultTheme","backgroundColorOrDefault","backgroundColor","tokenColors","grey_200","React","createElement","StyledInfoBox","margin","Box","marginRight","Heading","as","h4","marginBottom","textColor","colors","textDark","Text"],"mappings":"2RA0Ca,MAAAA,EAAU,EACrBC,WACAC,YACAC,iBACAC,kBACAC,uBACAC,OACAC,SACGC,MAEH,MAAMC,EAAaC,IACbC,EAAQ,IACTC,KACAH,GAGCI,EACJL,EAA2BM,iBAAmBH,EAAMI,YAAYC,SAElE,OACEC,EAACC,cAAAC,EACC,CAAAR,MAAOA,KACHH,EACJM,gBAAiBD,EACjBO,OAAQZ,EAA2BY,QAAU,OAC7Cb,IAAKA,GAEJD,GAAQW,gBAACI,EAAG,CAACC,YAAY,KAAKhB,GAC/BW,EAAAC,cAAA,MAAA,KACGhB,GACCe,EAACC,cAAAK,EACC,CAAAC,GAAG,IACHJ,OAAO,OACPK,IAAE,EACFC,aAAa,MACbC,UAAWxB,GAAkBQ,EAAMiB,OAAOC,UAEzC3B,GAGJE,GACCa,EAACC,cAAAY,GACCH,UAAWtB,GAAwBM,EAAMiB,OAAOC,SAChDH,aAAa,QAEZtB,GAGJH,GAEW"}
@@ -0,0 +1,13 @@
1
+ import { type ThemeType } from "../../types";
2
+ import { type BoxProps } from "../Box";
3
+ type InfoBoxProps = BoxProps & {
4
+ css?: string;
5
+ theme: ThemeType;
6
+ };
7
+ export declare const StyledInfoBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("../Spacing").SpacingProps & import("react").HTMLAttributes<HTMLElement> & {
8
+ backgroundColor?: string;
9
+ ref?: import("react").Ref<HTMLDivElement>;
10
+ children?: import("react").ReactNode;
11
+ as?: import("react").ElementType;
12
+ }, InfoBoxProps>> & string & Omit<({ ...props }: BoxProps) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
13
+ export default StyledInfoBox;