@mitodl/smoot-design 0.0.0-0a23f44

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 (325) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +35 -0
  3. package/dist/bundles/aiDrawerManager.es.js +38832 -0
  4. package/dist/bundles/aiDrawerManager.es.js.map +1 -0
  5. package/dist/bundles/aiDrawerManager.umd.js +245 -0
  6. package/dist/bundles/aiDrawerManager.umd.js.map +1 -0
  7. package/dist/bundles/remoteTutorDrawer.es.js +38832 -0
  8. package/dist/bundles/remoteTutorDrawer.es.js.map +1 -0
  9. package/dist/bundles/remoteTutorDrawer.umd.js +245 -0
  10. package/dist/bundles/remoteTutorDrawer.umd.js.map +1 -0
  11. package/dist/cjs/VERSION.d.ts +12 -0
  12. package/dist/cjs/VERSION.js +15 -0
  13. package/dist/cjs/ai.d.ts +3 -0
  14. package/dist/cjs/ai.js +9 -0
  15. package/dist/cjs/bundles/AiDrawer/AiDrawer.d.ts +55 -0
  16. package/dist/cjs/bundles/AiDrawer/AiDrawer.js +262 -0
  17. package/dist/cjs/bundles/AiDrawer/AiDrawer.stories.d.ts +17 -0
  18. package/dist/cjs/bundles/AiDrawer/AiDrawer.stories.js +264 -0
  19. package/dist/cjs/bundles/AiDrawer/AiDrawerManager.d.ts +12 -0
  20. package/dist/cjs/bundles/AiDrawer/AiDrawerManager.js +51 -0
  21. package/dist/cjs/bundles/AiDrawer/AiDrawerManager.stories.d.ts +6 -0
  22. package/dist/cjs/bundles/AiDrawer/AiDrawerManager.stories.js +267 -0
  23. package/dist/cjs/bundles/AiDrawer/AiDrawerManager.test.d.ts +1 -0
  24. package/dist/cjs/bundles/AiDrawer/AiDrawerManager.test.js +245 -0
  25. package/dist/cjs/bundles/AiDrawer/FlashcardsScreen.d.ts +9 -0
  26. package/dist/cjs/bundles/AiDrawer/FlashcardsScreen.js +87 -0
  27. package/dist/cjs/bundles/aiDrawerManager.d.ts +6 -0
  28. package/dist/cjs/bundles/aiDrawerManager.js +44 -0
  29. package/dist/cjs/components/AiChat/AiChat.d.ts +5 -0
  30. package/dist/cjs/components/AiChat/AiChat.js +267 -0
  31. package/dist/cjs/components/AiChat/AiChat.stories.d.ts +17 -0
  32. package/dist/cjs/components/AiChat/AiChat.stories.js +194 -0
  33. package/dist/cjs/components/AiChat/AiChat.test.d.ts +1 -0
  34. package/dist/cjs/components/AiChat/AiChat.test.js +211 -0
  35. package/dist/cjs/components/AiChat/AiChatContext.d.ts +26 -0
  36. package/dist/cjs/components/AiChat/AiChatContext.js +106 -0
  37. package/dist/cjs/components/AiChat/AiChatContext.stories.d.ts +14 -0
  38. package/dist/cjs/components/AiChat/AiChatContext.stories.js +75 -0
  39. package/dist/cjs/components/AiChat/AiChatMarkdown.stories.d.ts +15 -0
  40. package/dist/cjs/components/AiChat/AiChatMarkdown.stories.js +282 -0
  41. package/dist/cjs/components/AiChat/ChatTitle.d.ts +8 -0
  42. package/dist/cjs/components/AiChat/ChatTitle.js +43 -0
  43. package/dist/cjs/components/AiChat/EllipsisIcon.d.ts +6 -0
  44. package/dist/cjs/components/AiChat/EllipsisIcon.js +17 -0
  45. package/dist/cjs/components/AiChat/EntryScreen.d.ts +11 -0
  46. package/dist/cjs/components/AiChat/EntryScreen.js +123 -0
  47. package/dist/cjs/components/AiChat/Markdown.d.ts +7 -0
  48. package/dist/cjs/components/AiChat/Markdown.js +14 -0
  49. package/dist/cjs/components/AiChat/TimLogo.d.ts +5 -0
  50. package/dist/cjs/components/AiChat/TimLogo.js +15 -0
  51. package/dist/cjs/components/AiChat/test-utils/api.d.ts +2 -0
  52. package/dist/cjs/components/AiChat/test-utils/api.js +164 -0
  53. package/dist/cjs/components/AiChat/types.d.ts +96 -0
  54. package/dist/cjs/components/AiChat/types.js +3 -0
  55. package/dist/cjs/components/AiChat/utils.d.ts +9 -0
  56. package/dist/cjs/components/AiChat/utils.js +41 -0
  57. package/dist/cjs/components/Alert/Alert.d.ts +15 -0
  58. package/dist/cjs/components/Alert/Alert.js +62 -0
  59. package/dist/cjs/components/Alert/Alert.stories.d.ts +8 -0
  60. package/dist/cjs/components/Alert/Alert.stories.js +53 -0
  61. package/dist/cjs/components/Button/ActionButton.d.ts +30 -0
  62. package/dist/cjs/components/Button/ActionButton.js +73 -0
  63. package/dist/cjs/components/Button/ActionButton.stories.d.ts +15 -0
  64. package/dist/cjs/components/Button/ActionButton.stories.js +113 -0
  65. package/dist/cjs/components/Button/Button.d.ts +58 -0
  66. package/dist/cjs/components/Button/Button.js +261 -0
  67. package/dist/cjs/components/Button/Button.stories.d.ts +18 -0
  68. package/dist/cjs/components/Button/Button.stories.js +148 -0
  69. package/dist/cjs/components/Button/Button.test.d.ts +1 -0
  70. package/dist/cjs/components/Button/Button.test.js +46 -0
  71. package/dist/cjs/components/Checkbox/Checkbox.d.ts +20 -0
  72. package/dist/cjs/components/Checkbox/Checkbox.js +85 -0
  73. package/dist/cjs/components/Checkbox/Checkbox.stories.d.ts +8 -0
  74. package/dist/cjs/components/Checkbox/Checkbox.stories.js +33 -0
  75. package/dist/cjs/components/CheckboxChoiceField/CheckboxChoiceField.d.ts +21 -0
  76. package/dist/cjs/components/CheckboxChoiceField/CheckboxChoiceField.js +43 -0
  77. package/dist/cjs/components/CheckboxChoiceField/CheckboxChoiceField.stories.d.ts +8 -0
  78. package/dist/cjs/components/CheckboxChoiceField/CheckboxChoiceField.stories.js +50 -0
  79. package/dist/cjs/components/CheckboxChoiceField/CheckboxChoiceField.test.d.ts +1 -0
  80. package/dist/cjs/components/CheckboxChoiceField/CheckboxChoiceField.test.js +52 -0
  81. package/dist/cjs/components/ImageAdapter/ImageAdapter.d.ts +23 -0
  82. package/dist/cjs/components/ImageAdapter/ImageAdapter.js +30 -0
  83. package/dist/cjs/components/Input/Input.d.ts +116 -0
  84. package/dist/cjs/components/Input/Input.js +237 -0
  85. package/dist/cjs/components/Input/Input.stories.d.ts +19 -0
  86. package/dist/cjs/components/Input/Input.stories.js +135 -0
  87. package/dist/cjs/components/Input/Input.test.d.ts +1 -0
  88. package/dist/cjs/components/Input/Input.test.js +32 -0
  89. package/dist/cjs/components/LinkAdapter/LinkAdapter.d.ts +23 -0
  90. package/dist/cjs/components/LinkAdapter/LinkAdapter.js +34 -0
  91. package/dist/cjs/components/RadioChoiceField/BooleanRadioChoiceField.stories.d.ts +6 -0
  92. package/dist/cjs/components/RadioChoiceField/BooleanRadioChoiceField.stories.js +47 -0
  93. package/dist/cjs/components/RadioChoiceField/RadioChoiceField.d.ts +45 -0
  94. package/dist/cjs/components/RadioChoiceField/RadioChoiceField.js +69 -0
  95. package/dist/cjs/components/RadioChoiceField/RadioChoiceField.stories.d.ts +6 -0
  96. package/dist/cjs/components/RadioChoiceField/RadioChoiceField.stories.js +55 -0
  97. package/dist/cjs/components/RadioChoiceField/RadioChoiceField.test.d.ts +1 -0
  98. package/dist/cjs/components/RadioChoiceField/RadioChoiceField.test.js +53 -0
  99. package/dist/cjs/components/ScrollSnap/ScrollSnap.d.ts +19 -0
  100. package/dist/cjs/components/ScrollSnap/ScrollSnap.js +59 -0
  101. package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
  102. package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.js +43 -0
  103. package/dist/cjs/components/ScrollSnap/useScrollSnap.d.ts +6 -0
  104. package/dist/cjs/components/ScrollSnap/useScrollSnap.js +36 -0
  105. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
  106. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.js +43 -0
  107. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
  108. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.js +44 -0
  109. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
  110. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.js +62 -0
  111. package/dist/cjs/components/TabButtons/TabButtonList.d.ts +25 -0
  112. package/dist/cjs/components/TabButtons/TabButtonList.js +97 -0
  113. package/dist/cjs/components/TabButtons/TabButtonList.stories.d.ts +24 -0
  114. package/dist/cjs/components/TabButtons/TabButtonList.stories.js +139 -0
  115. package/dist/cjs/components/TextField/TextField.d.ts +29 -0
  116. package/dist/cjs/components/TextField/TextField.js +33 -0
  117. package/dist/cjs/components/TextField/TextField.stories.d.ts +10 -0
  118. package/dist/cjs/components/TextField/TextField.stories.js +136 -0
  119. package/dist/cjs/components/TextField/TextField.test.d.ts +1 -0
  120. package/dist/cjs/components/TextField/TextField.test.js +77 -0
  121. package/dist/cjs/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  122. package/dist/cjs/components/ThemeProvider/ThemeProvider.js +86 -0
  123. package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.d.ts +63 -0
  124. package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.js +102 -0
  125. package/dist/cjs/components/ThemeProvider/Typography.stories.d.ts +39 -0
  126. package/dist/cjs/components/ThemeProvider/Typography.stories.js +65 -0
  127. package/dist/cjs/components/ThemeProvider/breakpoints.d.ts +4 -0
  128. package/dist/cjs/components/ThemeProvider/breakpoints.js +19 -0
  129. package/dist/cjs/components/ThemeProvider/buttons.d.ts +7 -0
  130. package/dist/cjs/components/ThemeProvider/buttons.js +20 -0
  131. package/dist/cjs/components/ThemeProvider/chips.d.ts +3 -0
  132. package/dist/cjs/components/ThemeProvider/chips.js +154 -0
  133. package/dist/cjs/components/ThemeProvider/colors.d.ts +32 -0
  134. package/dist/cjs/components/ThemeProvider/colors.js +35 -0
  135. package/dist/cjs/components/ThemeProvider/typography.d.ts +18 -0
  136. package/dist/cjs/components/ThemeProvider/typography.js +173 -0
  137. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  138. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js +33 -0
  139. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
  140. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.js +13 -0
  141. package/dist/cjs/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
  142. package/dist/cjs/components/internal/FormHelpers/FormHelpers.js +78 -0
  143. package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
  144. package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.js +93 -0
  145. package/dist/cjs/index.d.ts +25 -0
  146. package/dist/cjs/index.js +44 -0
  147. package/dist/cjs/jest-setup.d.ts +1 -0
  148. package/dist/cjs/jest-setup.js +18 -0
  149. package/dist/cjs/jsdom-extended.d.ts +6 -0
  150. package/dist/cjs/jsdom-extended.js +14 -0
  151. package/dist/cjs/story-utils/index.d.ts +6 -0
  152. package/dist/cjs/story-utils/index.js +17 -0
  153. package/dist/cjs/utils/composeRefs.d.ts +7 -0
  154. package/dist/cjs/utils/composeRefs.js +20 -0
  155. package/dist/cjs/utils/composeRefs.test.d.ts +1 -0
  156. package/dist/cjs/utils/composeRefs.test.js +19 -0
  157. package/dist/cjs/utils/retryingFetch.d.ts +19 -0
  158. package/dist/cjs/utils/retryingFetch.js +98 -0
  159. package/dist/cjs/utils/retryingFetch.test.d.ts +1 -0
  160. package/dist/cjs/utils/retryingFetch.test.js +48 -0
  161. package/dist/cjs/utils/useDevCheckStable.d.ts +8 -0
  162. package/dist/cjs/utils/useDevCheckStable.js +29 -0
  163. package/dist/cjs/utils/useInterval.d.ts +7 -0
  164. package/dist/cjs/utils/useInterval.js +25 -0
  165. package/dist/esm/VERSION.d.ts +12 -0
  166. package/dist/esm/VERSION.js +12 -0
  167. package/dist/esm/ai.d.ts +3 -0
  168. package/dist/esm/ai.js +2 -0
  169. package/dist/esm/bundles/AiDrawer/AiDrawer.d.ts +55 -0
  170. package/dist/esm/bundles/AiDrawer/AiDrawer.js +259 -0
  171. package/dist/esm/bundles/AiDrawer/AiDrawer.stories.d.ts +17 -0
  172. package/dist/esm/bundles/AiDrawer/AiDrawer.stories.js +261 -0
  173. package/dist/esm/bundles/AiDrawer/AiDrawerManager.d.ts +12 -0
  174. package/dist/esm/bundles/AiDrawer/AiDrawerManager.js +48 -0
  175. package/dist/esm/bundles/AiDrawer/AiDrawerManager.stories.d.ts +6 -0
  176. package/dist/esm/bundles/AiDrawer/AiDrawerManager.stories.js +264 -0
  177. package/dist/esm/bundles/AiDrawer/AiDrawerManager.test.d.ts +1 -0
  178. package/dist/esm/bundles/AiDrawer/AiDrawerManager.test.js +243 -0
  179. package/dist/esm/bundles/AiDrawer/FlashcardsScreen.d.ts +9 -0
  180. package/dist/esm/bundles/AiDrawer/FlashcardsScreen.js +83 -0
  181. package/dist/esm/bundles/aiDrawerManager.d.ts +6 -0
  182. package/dist/esm/bundles/aiDrawerManager.js +41 -0
  183. package/dist/esm/components/AiChat/AiChat.d.ts +5 -0
  184. package/dist/esm/components/AiChat/AiChat.js +263 -0
  185. package/dist/esm/components/AiChat/AiChat.stories.d.ts +17 -0
  186. package/dist/esm/components/AiChat/AiChat.stories.js +191 -0
  187. package/dist/esm/components/AiChat/AiChat.test.d.ts +1 -0
  188. package/dist/esm/components/AiChat/AiChat.test.js +209 -0
  189. package/dist/esm/components/AiChat/AiChatContext.d.ts +26 -0
  190. package/dist/esm/components/AiChat/AiChatContext.js +102 -0
  191. package/dist/esm/components/AiChat/AiChatContext.stories.d.ts +14 -0
  192. package/dist/esm/components/AiChat/AiChatContext.stories.js +72 -0
  193. package/dist/esm/components/AiChat/AiChatMarkdown.stories.d.ts +15 -0
  194. package/dist/esm/components/AiChat/AiChatMarkdown.stories.js +279 -0
  195. package/dist/esm/components/AiChat/ChatTitle.d.ts +8 -0
  196. package/dist/esm/components/AiChat/ChatTitle.js +40 -0
  197. package/dist/esm/components/AiChat/EllipsisIcon.d.ts +6 -0
  198. package/dist/esm/components/AiChat/EllipsisIcon.js +15 -0
  199. package/dist/esm/components/AiChat/EntryScreen.d.ts +11 -0
  200. package/dist/esm/components/AiChat/EntryScreen.js +120 -0
  201. package/dist/esm/components/AiChat/Markdown.d.ts +7 -0
  202. package/dist/esm/components/AiChat/Markdown.js +12 -0
  203. package/dist/esm/components/AiChat/TimLogo.d.ts +5 -0
  204. package/dist/esm/components/AiChat/TimLogo.js +13 -0
  205. package/dist/esm/components/AiChat/test-utils/api.d.ts +2 -0
  206. package/dist/esm/components/AiChat/test-utils/api.js +161 -0
  207. package/dist/esm/components/AiChat/types.d.ts +96 -0
  208. package/dist/esm/components/AiChat/types.js +2 -0
  209. package/dist/esm/components/AiChat/utils.d.ts +9 -0
  210. package/dist/esm/components/AiChat/utils.js +38 -0
  211. package/dist/esm/components/Alert/Alert.d.ts +15 -0
  212. package/dist/esm/components/Alert/Alert.js +59 -0
  213. package/dist/esm/components/Alert/Alert.stories.d.ts +8 -0
  214. package/dist/esm/components/Alert/Alert.stories.js +50 -0
  215. package/dist/esm/components/Button/ActionButton.d.ts +30 -0
  216. package/dist/esm/components/Button/ActionButton.js +68 -0
  217. package/dist/esm/components/Button/ActionButton.stories.d.ts +15 -0
  218. package/dist/esm/components/Button/ActionButton.stories.js +110 -0
  219. package/dist/esm/components/Button/Button.d.ts +58 -0
  220. package/dist/esm/components/Button/Button.js +252 -0
  221. package/dist/esm/components/Button/Button.stories.d.ts +18 -0
  222. package/dist/esm/components/Button/Button.stories.js +145 -0
  223. package/dist/esm/components/Button/Button.test.d.ts +1 -0
  224. package/dist/esm/components/Button/Button.test.js +44 -0
  225. package/dist/esm/components/Checkbox/Checkbox.d.ts +20 -0
  226. package/dist/esm/components/Checkbox/Checkbox.js +81 -0
  227. package/dist/esm/components/Checkbox/Checkbox.stories.d.ts +8 -0
  228. package/dist/esm/components/Checkbox/Checkbox.stories.js +30 -0
  229. package/dist/esm/components/CheckboxChoiceField/CheckboxChoiceField.d.ts +21 -0
  230. package/dist/esm/components/CheckboxChoiceField/CheckboxChoiceField.js +40 -0
  231. package/dist/esm/components/CheckboxChoiceField/CheckboxChoiceField.stories.d.ts +8 -0
  232. package/dist/esm/components/CheckboxChoiceField/CheckboxChoiceField.stories.js +47 -0
  233. package/dist/esm/components/CheckboxChoiceField/CheckboxChoiceField.test.d.ts +1 -0
  234. package/dist/esm/components/CheckboxChoiceField/CheckboxChoiceField.test.js +50 -0
  235. package/dist/esm/components/ImageAdapter/ImageAdapter.d.ts +23 -0
  236. package/dist/esm/components/ImageAdapter/ImageAdapter.js +27 -0
  237. package/dist/esm/components/Input/Input.d.ts +116 -0
  238. package/dist/esm/components/Input/Input.js +232 -0
  239. package/dist/esm/components/Input/Input.stories.d.ts +19 -0
  240. package/dist/esm/components/Input/Input.stories.js +132 -0
  241. package/dist/esm/components/Input/Input.test.d.ts +1 -0
  242. package/dist/esm/components/Input/Input.test.js +30 -0
  243. package/dist/esm/components/LinkAdapter/LinkAdapter.d.ts +23 -0
  244. package/dist/esm/components/LinkAdapter/LinkAdapter.js +31 -0
  245. package/dist/esm/components/RadioChoiceField/BooleanRadioChoiceField.stories.d.ts +6 -0
  246. package/dist/esm/components/RadioChoiceField/BooleanRadioChoiceField.stories.js +44 -0
  247. package/dist/esm/components/RadioChoiceField/RadioChoiceField.d.ts +45 -0
  248. package/dist/esm/components/RadioChoiceField/RadioChoiceField.js +65 -0
  249. package/dist/esm/components/RadioChoiceField/RadioChoiceField.stories.d.ts +6 -0
  250. package/dist/esm/components/RadioChoiceField/RadioChoiceField.stories.js +52 -0
  251. package/dist/esm/components/RadioChoiceField/RadioChoiceField.test.d.ts +1 -0
  252. package/dist/esm/components/RadioChoiceField/RadioChoiceField.test.js +51 -0
  253. package/dist/esm/components/ScrollSnap/ScrollSnap.d.ts +19 -0
  254. package/dist/esm/components/ScrollSnap/ScrollSnap.js +56 -0
  255. package/dist/esm/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
  256. package/dist/esm/components/ScrollSnap/ScrollSnap.stories.js +40 -0
  257. package/dist/esm/components/ScrollSnap/useScrollSnap.d.ts +6 -0
  258. package/dist/esm/components/ScrollSnap/useScrollSnap.js +33 -0
  259. package/dist/esm/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
  260. package/dist/esm/components/SrAnnouncer/SrAnnouncer.js +40 -0
  261. package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
  262. package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.js +41 -0
  263. package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
  264. package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.js +60 -0
  265. package/dist/esm/components/TabButtons/TabButtonList.d.ts +25 -0
  266. package/dist/esm/components/TabButtons/TabButtonList.js +92 -0
  267. package/dist/esm/components/TabButtons/TabButtonList.stories.d.ts +24 -0
  268. package/dist/esm/components/TabButtons/TabButtonList.stories.js +136 -0
  269. package/dist/esm/components/TextField/TextField.d.ts +29 -0
  270. package/dist/esm/components/TextField/TextField.js +30 -0
  271. package/dist/esm/components/TextField/TextField.stories.d.ts +10 -0
  272. package/dist/esm/components/TextField/TextField.stories.js +133 -0
  273. package/dist/esm/components/TextField/TextField.test.d.ts +1 -0
  274. package/dist/esm/components/TextField/TextField.test.js +75 -0
  275. package/dist/esm/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  276. package/dist/esm/components/ThemeProvider/ThemeProvider.js +82 -0
  277. package/dist/esm/components/ThemeProvider/ThemeProvider.stories.d.ts +63 -0
  278. package/dist/esm/components/ThemeProvider/ThemeProvider.stories.js +99 -0
  279. package/dist/esm/components/ThemeProvider/Typography.stories.d.ts +39 -0
  280. package/dist/esm/components/ThemeProvider/Typography.stories.js +62 -0
  281. package/dist/esm/components/ThemeProvider/breakpoints.d.ts +4 -0
  282. package/dist/esm/components/ThemeProvider/breakpoints.js +15 -0
  283. package/dist/esm/components/ThemeProvider/buttons.d.ts +7 -0
  284. package/dist/esm/components/ThemeProvider/buttons.js +17 -0
  285. package/dist/esm/components/ThemeProvider/chips.d.ts +3 -0
  286. package/dist/esm/components/ThemeProvider/chips.js +151 -0
  287. package/dist/esm/components/ThemeProvider/colors.d.ts +32 -0
  288. package/dist/esm/components/ThemeProvider/colors.js +32 -0
  289. package/dist/esm/components/ThemeProvider/typography.d.ts +18 -0
  290. package/dist/esm/components/ThemeProvider/typography.js +167 -0
  291. package/dist/esm/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  292. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +30 -0
  293. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
  294. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js +10 -0
  295. package/dist/esm/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
  296. package/dist/esm/components/internal/FormHelpers/FormHelpers.js +73 -0
  297. package/dist/esm/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
  298. package/dist/esm/components/internal/FormHelpers/FormHelpers.test.js +91 -0
  299. package/dist/esm/index.d.ts +25 -0
  300. package/dist/esm/index.js +16 -0
  301. package/dist/esm/jest-setup.d.ts +1 -0
  302. package/dist/esm/jest-setup.js +16 -0
  303. package/dist/esm/jsdom-extended.d.ts +6 -0
  304. package/dist/esm/jsdom-extended.js +12 -0
  305. package/dist/esm/story-utils/index.d.ts +6 -0
  306. package/dist/esm/story-utils/index.js +13 -0
  307. package/dist/esm/utils/composeRefs.d.ts +7 -0
  308. package/dist/esm/utils/composeRefs.js +17 -0
  309. package/dist/esm/utils/composeRefs.test.d.ts +1 -0
  310. package/dist/esm/utils/composeRefs.test.js +17 -0
  311. package/dist/esm/utils/retryingFetch.d.ts +19 -0
  312. package/dist/esm/utils/retryingFetch.js +96 -0
  313. package/dist/esm/utils/retryingFetch.test.d.ts +1 -0
  314. package/dist/esm/utils/retryingFetch.test.js +46 -0
  315. package/dist/esm/utils/useDevCheckStable.d.ts +8 -0
  316. package/dist/esm/utils/useDevCheckStable.js +26 -0
  317. package/dist/esm/utils/useInterval.d.ts +7 -0
  318. package/dist/esm/utils/useInterval.js +22 -0
  319. package/dist/tsconfig.tsbuildinfo +1 -0
  320. package/dist/type-augmentation/TypescriptDocs.mdx +17 -0
  321. package/dist/type-augmentation/imports.d.ts +3 -0
  322. package/dist/type-augmentation/index.d.ts +3 -0
  323. package/dist/type-augmentation/theme.d.ts +105 -0
  324. package/dist/type-augmentation/typography.d.ts +54 -0
  325. package/package.json +159 -0
@@ -0,0 +1,99 @@
1
+ import * as React from "react";
2
+ import { ThemeProvider, createTheme } from "./ThemeProvider";
3
+ import { ButtonLink } from "../Button/Button";
4
+ const CustomLinkAdapater = React.forwardRef((props, ref) => (
5
+ // eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
6
+ React.createElement("a", Object.assign({ ref: ref, onClick: (e) => {
7
+ e.preventDefault();
8
+ alert(`Custom link to: ${e.currentTarget.href}. (Preventing Navigation.)`);
9
+ }, "data-custom": "theme-default" }, props))));
10
+ CustomLinkAdapater.displayName = "CustomLinkAdapter";
11
+ const customTheme = createTheme({
12
+ custom: {
13
+ LinkAdapter: CustomLinkAdapater,
14
+ },
15
+ });
16
+ const meta = {
17
+ title: "smoot-design/ThemeProvider",
18
+ component: ThemeProvider,
19
+ argTypes: {
20
+ theme: {
21
+ options: ["Default", "Custom Link Adapter"],
22
+ mapping: {
23
+ Default: undefined,
24
+ "Custom Link Adapter": customTheme,
25
+ },
26
+ },
27
+ children: {
28
+ table: { disable: true },
29
+ },
30
+ },
31
+ id: "smoot-design/ThemeProvider",
32
+ };
33
+ /**
34
+ * `ThemeProvider` must wrap all components from `smoot`-design, and allows
35
+ * styling any component via [`styled`](https://emotion.sh/docs/styled).
36
+ *
37
+ * In general, most useful theme properties are exposed on `theme.custom`. (Root
38
+ * `theme` properties are used internally by MUI.) See typescript definitions
39
+ * for more information about `theme.custom`.
40
+ *
41
+ * ## Further Customized Theme with `createTheme`
42
+ * Consuming applications can customize `smoot-design`'s default theme by creating
43
+ * a theme instance with `createTheme` and passing it to `ThemeProvider`:
44
+ *
45
+ * ```tsx
46
+ * const customTheme = createTheme({...})
47
+ *
48
+ * <ThemeProvider theme={customTheme}>
49
+ * {children}
50
+ * </ThemeProvider>
51
+ * ```
52
+ *
53
+ * ### Custom Link Adapter
54
+ * One particularly notable property is `theme.custom.LinkAdapter`. Some `smoot-design`
55
+ * components render links. These links are native anchor tags by default. In
56
+ * order to use these components with custom routing libraries (e.g. `react-router`
57
+ * or `next/link`), you can provide a custom link adapter.
58
+ *
59
+ * Components such as `ButtonLink` will:
60
+ * - use `Component` on `ButtonLink` if specified (`<ButtonLink Component={Link} />`)
61
+ * - else, use `theme.custom.LinkAdapter` if specified,
62
+ * - else, use `a` tag.
63
+ *
64
+ * For example, to use `next/link` as the default link implementation:
65
+ *
66
+ * ```tsx
67
+ * import Link from "next/link"
68
+ * const theme = createTheme({ LinkAdapter: Link })
69
+ * ```
70
+ *
71
+ * You can use [module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)
72
+ * to add the custom props to relevant components. For example, to expose
73
+ * `next/link`'s `scroll` prop on `ButtonLink`:
74
+ *
75
+ * ```ts
76
+ * // Add scroll prop to all components using LinkAdapter
77
+ * declare module "@mitodl/smoot-design" {
78
+ * interface LinkAdapterPropsOverrides {
79
+ * scroll?: boolean
80
+ * }
81
+ * }
82
+ * ```
83
+ *
84
+ * ### ImageAdapter
85
+ * Similarly, `theme.custom.ImageAdapter` can be used to customize the image
86
+ * component used by `smoot-design`. By default, `ImageAdapter` uses a simple `img`
87
+ * tag. Interface `ImageAdapterPropsOverrides` is similarly available for
88
+ * augmentation.
89
+ */
90
+ export const LinkAdapterOverride = {
91
+ args: {
92
+ theme: customTheme,
93
+ },
94
+ render: (args) => {
95
+ return (React.createElement(ThemeProvider, { theme: args.theme },
96
+ React.createElement(ButtonLink, { href: "https://mit.edu" }, args.theme ? "Custom theme in use" : "Default theme in use")));
97
+ },
98
+ };
99
+ export default meta;
@@ -0,0 +1,39 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Typography from "@mui/material/Typography";
3
+ /**
4
+ * Typography styles can be controlled via the `theme.typography` object when
5
+ * using the `styled` helper or via the `<Tyopgraphy variant="..." />` component.
6
+ *
7
+ * For the `Typography` component, see [MUI's documentation](https://mui.com/material-ui/react-typography/).
8
+ *
9
+ * ```tsx
10
+ * const MyHeading = styled(({ theme }) => ({
11
+ * ...theme.typography.h2,
12
+ * [theme.breakpoints.down("sm")]: {
13
+ * ...theme.typography.h3,
14
+ * },
15
+ * }))
16
+ *
17
+ * // or:
18
+ * <Typography component="h1" typography={
19
+ * {
20
+ * xs: "h3", // above xs
21
+ * sm: "h2" // above sm
22
+ * }
23
+ * }>
24
+ * Hello, world!
25
+ * </Typography>
26
+ * ```
27
+ *
28
+ */
29
+ declare const meta: Meta<typeof Typography>;
30
+ export default meta;
31
+ type Story = StoryObj<typeof Typography>;
32
+ /**
33
+ * Typography variants are shown below.
34
+ *
35
+ * **Note:** The typography variant is not related to the HTML element used. A
36
+ * `variant="h1"` component does not automatically render an `<h1>` element.
37
+ *
38
+ */
39
+ export declare const Variants: Story;
@@ -0,0 +1,62 @@
1
+ import * as React from "react";
2
+ import Stack from "@mui/material/Stack";
3
+ import Typography from "@mui/material/Typography";
4
+ /**
5
+ * Typography styles can be controlled via the `theme.typography` object when
6
+ * using the `styled` helper or via the `<Tyopgraphy variant="..." />` component.
7
+ *
8
+ * For the `Typography` component, see [MUI's documentation](https://mui.com/material-ui/react-typography/).
9
+ *
10
+ * ```tsx
11
+ * const MyHeading = styled(({ theme }) => ({
12
+ * ...theme.typography.h2,
13
+ * [theme.breakpoints.down("sm")]: {
14
+ * ...theme.typography.h3,
15
+ * },
16
+ * }))
17
+ *
18
+ * // or:
19
+ * <Typography component="h1" typography={
20
+ * {
21
+ * xs: "h3", // above xs
22
+ * sm: "h2" // above sm
23
+ * }
24
+ * }>
25
+ * Hello, world!
26
+ * </Typography>
27
+ * ```
28
+ *
29
+ */
30
+ const meta = {
31
+ title: "smoot-design/Typography",
32
+ component: Typography,
33
+ };
34
+ export default meta;
35
+ const text = "The quick brown fox jumps over the lazy dog. ".repeat(10);
36
+ const INSTANCES = [
37
+ { variant: "h1", children: "Heading level 1" },
38
+ { variant: "h2", children: "Heading level 2" },
39
+ { variant: "h3", children: "Heading level 3" },
40
+ { variant: "h4", children: "Heading level 4" },
41
+ { variant: "h5", children: "Heading level 5" },
42
+ { variant: "subtitle1", children: "Subtitle level 1" },
43
+ { variant: "subtitle2", children: "Subtitle level 2" },
44
+ { variant: "subtitle3", children: "Subtitle level 3" },
45
+ { variant: "subtitle4", children: "Subtitle level 4" },
46
+ { variant: "body1", children: `body level 1... ${text}` },
47
+ { variant: "body2", children: `body level 2... ${text}` },
48
+ { variant: "body3", children: `body level 3... ${text}` },
49
+ { variant: "body4", children: `body level 4... ${text}` },
50
+ ];
51
+ /**
52
+ * Typography variants are shown below.
53
+ *
54
+ * **Note:** The typography variant is not related to the HTML element used. A
55
+ * `variant="h1"` component does not automatically render an `<h1>` element.
56
+ *
57
+ */
58
+ export const Variants = {
59
+ render: () => {
60
+ return (React.createElement(Stack, { gap: "1rem" }, INSTANCES.map((props) => (React.createElement(Typography, Object.assign({ key: props.variant }, props))))));
61
+ },
62
+ };
@@ -0,0 +1,4 @@
1
+ import type { ThemeOptions } from "@mui/material/styles";
2
+ declare const BREAKPOINT_VALUES: ThemeOptions["breakpoints"];
3
+ declare const breakpoints: import("@mui/material/styles").Breakpoints;
4
+ export { BREAKPOINT_VALUES, breakpoints };
@@ -0,0 +1,15 @@
1
+ import { createTheme } from "@mui/material/styles";
2
+ const BREAKPOINT_VALUES = {
3
+ values: {
4
+ xs: 0,
5
+ sm: 600,
6
+ md: 900,
7
+ lg: 1280,
8
+ xl: 1536,
9
+ },
10
+ };
11
+ const { breakpoints } = createTheme({
12
+ breakpoints: BREAKPOINT_VALUES,
13
+ custom: {},
14
+ });
15
+ export { BREAKPOINT_VALUES, breakpoints };
@@ -0,0 +1,7 @@
1
+ import type { ThemeOptions } from "@mui/material/styles";
2
+ /**
3
+ * We don't use MUI's button directly, but ButtonBase does get used internally
4
+ * by some MUI components, so we override a few styles.
5
+ */
6
+ declare const buttonBaseComponent: NonNullable<ThemeOptions["components"]>["MuiButtonBase"];
7
+ export { buttonBaseComponent };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * We don't use MUI's button directly, but ButtonBase does get used internally
3
+ * by some MUI components, so we override a few styles.
4
+ */
5
+ const buttonBaseComponent = {
6
+ defaultProps: {
7
+ disableRipple: true,
8
+ },
9
+ styleOverrides: {
10
+ root: {
11
+ ":focus-visible": {
12
+ outline: "revert",
13
+ },
14
+ },
15
+ },
16
+ };
17
+ export { buttonBaseComponent };
@@ -0,0 +1,3 @@
1
+ import type { ThemeOptions } from "@mui/material/styles";
2
+ declare const chipComponent: NonNullable<ThemeOptions["components"]>["MuiChip"];
3
+ export { chipComponent };
@@ -0,0 +1,151 @@
1
+ import * as React from "react";
2
+ import { colors } from "./colors";
3
+ import { RiCloseLine } from "@remixicon/react";
4
+ const chipComponent = {
5
+ defaultProps: {
6
+ size: "medium",
7
+ color: "default",
8
+ variant: "outlined",
9
+ deleteIcon: React.createElement(RiCloseLine, { "aria-hidden": "true" }),
10
+ },
11
+ styleOverrides: {
12
+ root: {
13
+ borderRadius: "100vh",
14
+ borderWidth: "1px",
15
+ },
16
+ deleteIcon: {
17
+ "&:hover": {
18
+ color: "inherit",
19
+ },
20
+ "&.MuiChip-deleteIconLarge": {
21
+ width: "16px",
22
+ height: "16px",
23
+ },
24
+ "&.MuiChip-deleteIconMedium": {
25
+ width: "14px",
26
+ height: "14px",
27
+ },
28
+ margin: "0 -2px 0 8px",
29
+ color: "inherit",
30
+ },
31
+ icon: {
32
+ margin: "0 8px 0 -2px",
33
+ color: "inherit",
34
+ "&.MuiChip-iconLarge": {
35
+ width: "16px",
36
+ height: "16px",
37
+ },
38
+ "&.MuiChip-iconMedium": {
39
+ width: "14px",
40
+ height: "14px",
41
+ },
42
+ },
43
+ },
44
+ variants: [
45
+ {
46
+ props: { size: "medium" },
47
+ style: ({ theme }) => (Object.assign(Object.assign({}, theme.typography.body3), { boxSizing: "border-box", height: "24px", paddingRight: "12px", paddingLeft: "12px", ".MuiChip-label": {
48
+ paddingLeft: "0px",
49
+ paddingRight: "0px",
50
+ } })),
51
+ },
52
+ {
53
+ props: { size: "large" },
54
+ style: ({ theme }) => (Object.assign(Object.assign({}, theme.typography.body2), { height: "32px", paddingLeft: "16px", paddingRight: "16px", ".MuiChip-label": {
55
+ paddingLeft: "0px",
56
+ paddingRight: "0px",
57
+ } })),
58
+ },
59
+ {
60
+ props: { variant: "outlined" },
61
+ style: {
62
+ borderColor: colors.silverGrayLight,
63
+ color: colors.darkGray1,
64
+ "&.Mui-focusVisible": {
65
+ backgroundColor: "transparent",
66
+ },
67
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
68
+ color: colors.darkGray1,
69
+ borderColor: colors.silverGrayDark,
70
+ backgroundColor: "transparent", // mui has a default background color for hover
71
+ },
72
+ },
73
+ },
74
+ {
75
+ props: { variant: "outlinedWhite" },
76
+ style: {
77
+ backgroundColor: "white",
78
+ border: "1px solid",
79
+ borderColor: colors.silverGrayLight,
80
+ color: colors.darkGray1,
81
+ "&.Mui-focusVisible": {
82
+ backgroundColor: "white",
83
+ },
84
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
85
+ color: colors.darkGray1,
86
+ borderColor: colors.silverGrayDark,
87
+ backgroundColor: "white", // mui has a default background color hover
88
+ },
89
+ },
90
+ },
91
+ {
92
+ props: { variant: "gray" },
93
+ style: {
94
+ backgroundColor: colors.lightGray2,
95
+ border: "none",
96
+ color: colors.darkGray2,
97
+ "&.Mui-focusVisible": {
98
+ backgroundColor: colors.lightGray2,
99
+ },
100
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
101
+ color: colors.darkGray1,
102
+ backgroundColor: colors.silverGrayLight,
103
+ },
104
+ },
105
+ },
106
+ {
107
+ props: { variant: "dark" },
108
+ style: {
109
+ backgroundColor: colors.silverGrayDark,
110
+ border: "none",
111
+ color: colors.white,
112
+ "&.Mui-focusVisible": {
113
+ backgroundColor: colors.silverGrayDark,
114
+ },
115
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
116
+ backgroundColor: colors.darkGray1,
117
+ },
118
+ },
119
+ },
120
+ {
121
+ props: { variant: "darker" },
122
+ style: {
123
+ backgroundColor: colors.darkGray2,
124
+ border: `1px solid ${colors.darkGray1}`,
125
+ color: colors.white,
126
+ "&.Mui-focusVisible": {
127
+ backgroundColor: colors.darkGray2,
128
+ },
129
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
130
+ backgroundColor: colors.black,
131
+ border: `1px solid ${colors.silverGray}`,
132
+ },
133
+ },
134
+ },
135
+ {
136
+ props: { variant: "filled" },
137
+ style: {
138
+ backgroundColor: colors.mitRed,
139
+ border: "none",
140
+ color: colors.white,
141
+ "&.Mui-focusVisible": {
142
+ backgroundColor: colors.mitRed,
143
+ },
144
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
145
+ backgroundColor: colors.red,
146
+ },
147
+ },
148
+ },
149
+ ],
150
+ };
151
+ export { chipComponent };
@@ -0,0 +1,32 @@
1
+ declare const colors: {
2
+ mitRed: string;
3
+ brightRed: string;
4
+ black: string;
5
+ white: string;
6
+ darkGray2: string;
7
+ darkGray1: string;
8
+ silverGrayDark: string;
9
+ silverGray: string;
10
+ silverGrayLight: string;
11
+ lightGray2: string;
12
+ lightGray1: string;
13
+ navGray: string;
14
+ darkPink: string;
15
+ pink: string;
16
+ lightPink: string;
17
+ darkPurple: string;
18
+ purple: string;
19
+ lightPurple: string;
20
+ darkBlue: string;
21
+ blue: string;
22
+ lightBlue: string;
23
+ darkGreen: string;
24
+ green: string;
25
+ lightGreen: string;
26
+ darkRed: string;
27
+ red: string;
28
+ lightRed: string;
29
+ orange: string;
30
+ yellow: string;
31
+ };
32
+ export { colors };
@@ -0,0 +1,32 @@
1
+ const colors = {
2
+ mitRed: "#750014",
3
+ brightRed: "#FF1423",
4
+ black: "#000000",
5
+ white: "#FFFFFF",
6
+ darkGray2: "#212326",
7
+ darkGray1: "#40464C",
8
+ silverGrayDark: "#626A73",
9
+ silverGray: "#8B959E",
10
+ silverGrayLight: "#B8C2CC",
11
+ lightGray2: "#DDE1E6",
12
+ lightGray1: "#F3F4F8",
13
+ navGray: "#303337",
14
+ darkPink: "#750062",
15
+ pink: "#FF14F0",
16
+ lightPink: "#FFB3FF",
17
+ darkPurple: "#3E006B",
18
+ purple: "#93F",
19
+ lightPurple: "#BFB3FF",
20
+ darkBlue: "#002896",
21
+ blue: "#1966FF",
22
+ lightBlue: "#99EBFF",
23
+ darkGreen: "#004D1A",
24
+ green: "#00AD00",
25
+ lightGreen: "#AF3",
26
+ darkRed: "#83192A",
27
+ red: "#A31F34",
28
+ lightRed: "#D02E44",
29
+ orange: "#FAB005",
30
+ yellow: "#FFEB00",
31
+ };
32
+ export { colors };
@@ -0,0 +1,18 @@
1
+ import type { ThemeOptions } from "@mui/material/styles";
2
+ /**
3
+ * This function converts from pixels to rems, assuming a base font size of 16px
4
+ * (which is the default for most modern browsers).
5
+ *
6
+ * Using this function, we can:
7
+ * - match desgins that are in pixels for default font size
8
+ * - allow users to scale the font size up or down by chaning base font size.
9
+ *
10
+ * For example, a Chrome user might specify a base font size of 20px ("large")
11
+ * in their browser settings. Then, `pxToRem(32)` would actually be 40px for
12
+ * that user.
13
+ */
14
+ declare const pxToRem: (px: number) => string;
15
+ declare const globalSettings: ThemeOptions["typography"];
16
+ declare const component: NonNullable<ThemeOptions["components"]>["MuiTypography"];
17
+ declare const typography: import("@mui/material/styles").TypographyVariants;
18
+ export { globalSettings, component, pxToRem, typography };
@@ -0,0 +1,167 @@
1
+ import { createTheme } from "@mui/material/styles";
2
+ const fontWeights = {
3
+ text: {
4
+ roman: 400,
5
+ medium: 500,
6
+ bold: 700,
7
+ },
8
+ };
9
+ /**
10
+ * This function converts from pixels to rems, assuming a base font size of 16px
11
+ * (which is the default for most modern browsers).
12
+ *
13
+ * Using this function, we can:
14
+ * - match desgins that are in pixels for default font size
15
+ * - allow users to scale the font size up or down by chaning base font size.
16
+ *
17
+ * For example, a Chrome user might specify a base font size of 20px ("large")
18
+ * in their browser settings. Then, `pxToRem(32)` would actually be 40px for
19
+ * that user.
20
+ */
21
+ const pxToRem = (px) => `${px / 16}rem`;
22
+ const globalSettings = {
23
+ // Note: Figma calls this "Neue Haas Grotesk Text", but that is incorrect based on Adobe's font family.
24
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
25
+ fontWeightLight: fontWeights.text.roman,
26
+ fontWeightRegular: fontWeights.text.roman,
27
+ fontWeightMedium: fontWeights.text.medium,
28
+ fontWeightBold: fontWeights.text.bold,
29
+ h1: {
30
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
31
+ fontWeight: fontWeights.text.bold,
32
+ fontStyle: "normal",
33
+ fontSize: pxToRem(52),
34
+ lineHeight: pxToRem(60),
35
+ },
36
+ h2: {
37
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
38
+ fontWeight: fontWeights.text.bold,
39
+ fontStyle: "normal",
40
+ fontSize: pxToRem(34),
41
+ lineHeight: pxToRem(40),
42
+ },
43
+ h3: {
44
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
45
+ fontWeight: fontWeights.text.bold,
46
+ fontStyle: "normal",
47
+ fontSize: pxToRem(28),
48
+ lineHeight: pxToRem(36),
49
+ },
50
+ h4: {
51
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
52
+ fontWeight: fontWeights.text.bold,
53
+ fontStyle: "normal",
54
+ fontSize: pxToRem(24),
55
+ lineHeight: pxToRem(30),
56
+ },
57
+ h5: {
58
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
59
+ fontWeight: fontWeights.text.medium,
60
+ fontStyle: "normal",
61
+ fontSize: pxToRem(18),
62
+ lineHeight: pxToRem(22),
63
+ },
64
+ subtitle1: {
65
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
66
+ fontWeight: fontWeights.text.medium,
67
+ fontStyle: "normal",
68
+ fontSize: pxToRem(16),
69
+ lineHeight: pxToRem(20),
70
+ },
71
+ subtitle2: {
72
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
73
+ fontWeight: fontWeights.text.medium,
74
+ fontStyle: "normal",
75
+ fontSize: pxToRem(14),
76
+ lineHeight: pxToRem(18),
77
+ },
78
+ subtitle3: {
79
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
80
+ fontWeight: fontWeights.text.medium,
81
+ fontStyle: "normal",
82
+ fontSize: pxToRem(12),
83
+ lineHeight: pxToRem(16),
84
+ },
85
+ subtitle4: {
86
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
87
+ fontWeight: fontWeights.text.medium,
88
+ fontStyle: "normal",
89
+ fontSize: pxToRem(10),
90
+ lineHeight: pxToRem(14),
91
+ },
92
+ body1: {
93
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
94
+ fontWeight: fontWeights.text.roman,
95
+ fontStyle: "normal",
96
+ fontSize: pxToRem(16),
97
+ lineHeight: pxToRem(20),
98
+ },
99
+ body2: {
100
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
101
+ fontWeight: fontWeights.text.roman,
102
+ fontStyle: "normal",
103
+ fontSize: pxToRem(14),
104
+ lineHeight: pxToRem(18),
105
+ },
106
+ body3: {
107
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
108
+ fontWeight: fontWeights.text.roman,
109
+ fontStyle: "normal",
110
+ fontSize: pxToRem(12),
111
+ lineHeight: pxToRem(16),
112
+ },
113
+ body4: {
114
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
115
+ fontWeight: fontWeights.text.roman,
116
+ fontStyle: "normal",
117
+ fontSize: pxToRem(10),
118
+ lineHeight: pxToRem(14),
119
+ },
120
+ buttonLarge: {
121
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
122
+ fontWeight: fontWeights.text.medium,
123
+ fontStyle: "normal",
124
+ fontSize: pxToRem(16),
125
+ lineHeight: pxToRem(20),
126
+ },
127
+ button: {
128
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
129
+ fontWeight: fontWeights.text.medium,
130
+ fontStyle: "normal",
131
+ fontSize: pxToRem(14),
132
+ lineHeight: pxToRem(18),
133
+ textTransform: "none",
134
+ },
135
+ buttonSmall: {
136
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
137
+ fontWeight: fontWeights.text.medium,
138
+ fontStyle: "normal",
139
+ fontSize: pxToRem(12),
140
+ lineHeight: pxToRem(16),
141
+ },
142
+ };
143
+ const component = {
144
+ defaultProps: {
145
+ variantMapping: {
146
+ h1: "span",
147
+ h2: "span",
148
+ h3: "span",
149
+ h4: "span",
150
+ h5: "span",
151
+ body1: "p",
152
+ body2: "p",
153
+ body3: "p",
154
+ body4: "p",
155
+ subtitle1: "p",
156
+ subtitle2: "p",
157
+ subtitle3: "p",
158
+ subtitle4: "p",
159
+ button: "span",
160
+ },
161
+ },
162
+ };
163
+ const { typography } = createTheme({
164
+ typography: globalSettings,
165
+ custom: {},
166
+ });
167
+ export { globalSettings, component, pxToRem, typography };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * VisuallyHidden is a utility component that hides its children from sighted
3
+ * users, but keeps them accessible to screen readers.
4
+ *
5
+ * Often, screenreader-only content can be handled with an `aria-label`. However,
6
+ * occasionally we need actual elements.
7
+ *
8
+ * Example:
9
+ * - a visually hidden aria-live section that reads announcements that
10
+ * isual users can ascertain in some other way.
11
+ * - a visually hidden Heading for a section whose purpose is clear for sighted users
12
+ * - a visually hidden description used for aria-describeddby
13
+ * - There is an aria-description attribute that can be used to provide a
14
+ * without an actual element on the page. However, it is introduced in
15
+ * ARIA 1.3 (working draft), not compatible with some screen readers, and
16
+ * flagged problematic by our linting.
17
+ *
18
+ * The CSS here is based on https://inclusive-components.design/tooltips-toggletips/
19
+ */
20
+ declare const VisuallyHidden: import("@emotion/styled").StyledComponent<{
21
+ theme?: import("@emotion/react").Theme;
22
+ as?: React.ElementType;
23
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
24
+ export { VisuallyHidden };