@mitodl/smoot-design 0.0.0-1967631

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 (261) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +35 -0
  3. package/dist/bundles/remoteTutorDrawer.es.js +38609 -0
  4. package/dist/bundles/remoteTutorDrawer.es.js.map +1 -0
  5. package/dist/bundles/remoteTutorDrawer.umd.js +241 -0
  6. package/dist/bundles/remoteTutorDrawer.umd.js.map +1 -0
  7. package/dist/cjs/VERSION.d.ts +6 -0
  8. package/dist/cjs/VERSION.js +9 -0
  9. package/dist/cjs/ai.d.ts +3 -0
  10. package/dist/cjs/ai.js +9 -0
  11. package/dist/cjs/bundles/RemoteTutorDrawer/FlashcardsScreen.d.ts +9 -0
  12. package/dist/cjs/bundles/RemoteTutorDrawer/FlashcardsScreen.js +87 -0
  13. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.d.ts +56 -0
  14. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.js +283 -0
  15. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.d.ts +17 -0
  16. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.js +302 -0
  17. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.d.ts +1 -0
  18. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.js +247 -0
  19. package/dist/cjs/bundles/remoteTutorDrawer.d.ts +7 -0
  20. package/dist/cjs/bundles/remoteTutorDrawer.js +43 -0
  21. package/dist/cjs/components/AiChat/AiChat.d.ts +5 -0
  22. package/dist/cjs/components/AiChat/AiChat.js +233 -0
  23. package/dist/cjs/components/AiChat/AiChat.stories.d.ts +21 -0
  24. package/dist/cjs/components/AiChat/AiChat.stories.js +257 -0
  25. package/dist/cjs/components/AiChat/AiChat.test.d.ts +1 -0
  26. package/dist/cjs/components/AiChat/AiChat.test.js +211 -0
  27. package/dist/cjs/components/AiChat/AiChatContext.d.ts +26 -0
  28. package/dist/cjs/components/AiChat/AiChatContext.js +105 -0
  29. package/dist/cjs/components/AiChat/AiChatContext.stories.d.ts +14 -0
  30. package/dist/cjs/components/AiChat/AiChatContext.stories.js +75 -0
  31. package/dist/cjs/components/AiChat/ChatTitle.d.ts +8 -0
  32. package/dist/cjs/components/AiChat/ChatTitle.js +43 -0
  33. package/dist/cjs/components/AiChat/EntryScreen.d.ts +11 -0
  34. package/dist/cjs/components/AiChat/EntryScreen.js +123 -0
  35. package/dist/cjs/components/AiChat/Markdown.d.ts +7 -0
  36. package/dist/cjs/components/AiChat/Markdown.js +14 -0
  37. package/dist/cjs/components/AiChat/TimLogo.d.ts +5 -0
  38. package/dist/cjs/components/AiChat/TimLogo.js +15 -0
  39. package/dist/cjs/components/AiChat/test-utils/api.d.ts +2 -0
  40. package/dist/cjs/components/AiChat/test-utils/api.js +164 -0
  41. package/dist/cjs/components/AiChat/types.d.ts +91 -0
  42. package/dist/cjs/components/AiChat/types.js +3 -0
  43. package/dist/cjs/components/AiChat/utils.d.ts +9 -0
  44. package/dist/cjs/components/AiChat/utils.js +41 -0
  45. package/dist/cjs/components/Alert/Alert.d.ts +15 -0
  46. package/dist/cjs/components/Alert/Alert.js +62 -0
  47. package/dist/cjs/components/Alert/Alert.stories.d.ts +8 -0
  48. package/dist/cjs/components/Alert/Alert.stories.js +53 -0
  49. package/dist/cjs/components/Button/ActionButton.d.ts +30 -0
  50. package/dist/cjs/components/Button/ActionButton.js +73 -0
  51. package/dist/cjs/components/Button/ActionButton.stories.d.ts +15 -0
  52. package/dist/cjs/components/Button/ActionButton.stories.js +113 -0
  53. package/dist/cjs/components/Button/Button.d.ts +54 -0
  54. package/dist/cjs/components/Button/Button.js +240 -0
  55. package/dist/cjs/components/Button/Button.stories.d.ts +17 -0
  56. package/dist/cjs/components/Button/Button.stories.js +135 -0
  57. package/dist/cjs/components/Button/Button.test.d.ts +1 -0
  58. package/dist/cjs/components/Button/Button.test.js +46 -0
  59. package/dist/cjs/components/ImageAdapter/ImageAdapter.d.ts +23 -0
  60. package/dist/cjs/components/ImageAdapter/ImageAdapter.js +30 -0
  61. package/dist/cjs/components/Input/Input.d.ts +116 -0
  62. package/dist/cjs/components/Input/Input.js +237 -0
  63. package/dist/cjs/components/Input/Input.stories.d.ts +19 -0
  64. package/dist/cjs/components/Input/Input.stories.js +135 -0
  65. package/dist/cjs/components/Input/Input.test.d.ts +1 -0
  66. package/dist/cjs/components/Input/Input.test.js +32 -0
  67. package/dist/cjs/components/LinkAdapter/LinkAdapter.d.ts +23 -0
  68. package/dist/cjs/components/LinkAdapter/LinkAdapter.js +34 -0
  69. package/dist/cjs/components/ScrollSnap/ScrollSnap.d.ts +19 -0
  70. package/dist/cjs/components/ScrollSnap/ScrollSnap.js +59 -0
  71. package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
  72. package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.js +43 -0
  73. package/dist/cjs/components/ScrollSnap/useScrollSnap.d.ts +6 -0
  74. package/dist/cjs/components/ScrollSnap/useScrollSnap.js +36 -0
  75. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
  76. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.js +43 -0
  77. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
  78. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.js +44 -0
  79. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
  80. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.js +62 -0
  81. package/dist/cjs/components/TabButtons/TabButtonList.d.ts +25 -0
  82. package/dist/cjs/components/TabButtons/TabButtonList.js +97 -0
  83. package/dist/cjs/components/TabButtons/TabButtonList.stories.d.ts +24 -0
  84. package/dist/cjs/components/TabButtons/TabButtonList.stories.js +139 -0
  85. package/dist/cjs/components/TextField/TextField.d.ts +29 -0
  86. package/dist/cjs/components/TextField/TextField.js +33 -0
  87. package/dist/cjs/components/TextField/TextField.stories.d.ts +10 -0
  88. package/dist/cjs/components/TextField/TextField.stories.js +136 -0
  89. package/dist/cjs/components/TextField/TextField.test.d.ts +1 -0
  90. package/dist/cjs/components/TextField/TextField.test.js +77 -0
  91. package/dist/cjs/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  92. package/dist/cjs/components/ThemeProvider/ThemeProvider.js +86 -0
  93. package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.d.ts +63 -0
  94. package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.js +102 -0
  95. package/dist/cjs/components/ThemeProvider/Typography.stories.d.ts +39 -0
  96. package/dist/cjs/components/ThemeProvider/Typography.stories.js +65 -0
  97. package/dist/cjs/components/ThemeProvider/breakpoints.d.ts +4 -0
  98. package/dist/cjs/components/ThemeProvider/breakpoints.js +19 -0
  99. package/dist/cjs/components/ThemeProvider/buttons.d.ts +7 -0
  100. package/dist/cjs/components/ThemeProvider/buttons.js +20 -0
  101. package/dist/cjs/components/ThemeProvider/chips.d.ts +3 -0
  102. package/dist/cjs/components/ThemeProvider/chips.js +154 -0
  103. package/dist/cjs/components/ThemeProvider/colors.d.ts +32 -0
  104. package/dist/cjs/components/ThemeProvider/colors.js +35 -0
  105. package/dist/cjs/components/ThemeProvider/typography.d.ts +18 -0
  106. package/dist/cjs/components/ThemeProvider/typography.js +173 -0
  107. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  108. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js +33 -0
  109. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
  110. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.js +13 -0
  111. package/dist/cjs/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
  112. package/dist/cjs/components/internal/FormHelpers/FormHelpers.js +78 -0
  113. package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
  114. package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.js +93 -0
  115. package/dist/cjs/index.d.ts +16 -0
  116. package/dist/cjs/index.js +30 -0
  117. package/dist/cjs/jest-setup.d.ts +1 -0
  118. package/dist/cjs/jest-setup.js +18 -0
  119. package/dist/cjs/jsdom-extended.d.ts +6 -0
  120. package/dist/cjs/jsdom-extended.js +14 -0
  121. package/dist/cjs/story-utils/index.d.ts +6 -0
  122. package/dist/cjs/story-utils/index.js +17 -0
  123. package/dist/cjs/utils/composeRefs.d.ts +7 -0
  124. package/dist/cjs/utils/composeRefs.js +20 -0
  125. package/dist/cjs/utils/composeRefs.test.d.ts +1 -0
  126. package/dist/cjs/utils/composeRefs.test.js +19 -0
  127. package/dist/cjs/utils/useDevCheckStable.d.ts +8 -0
  128. package/dist/cjs/utils/useDevCheckStable.js +29 -0
  129. package/dist/cjs/utils/useInterval.d.ts +7 -0
  130. package/dist/cjs/utils/useInterval.js +25 -0
  131. package/dist/esm/VERSION.d.ts +6 -0
  132. package/dist/esm/VERSION.js +6 -0
  133. package/dist/esm/ai.d.ts +3 -0
  134. package/dist/esm/ai.js +2 -0
  135. package/dist/esm/bundles/RemoteTutorDrawer/FlashcardsScreen.d.ts +9 -0
  136. package/dist/esm/bundles/RemoteTutorDrawer/FlashcardsScreen.js +83 -0
  137. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.d.ts +56 -0
  138. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.js +280 -0
  139. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.d.ts +17 -0
  140. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.js +299 -0
  141. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.d.ts +1 -0
  142. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.js +245 -0
  143. package/dist/esm/bundles/remoteTutorDrawer.d.ts +7 -0
  144. package/dist/esm/bundles/remoteTutorDrawer.js +40 -0
  145. package/dist/esm/components/AiChat/AiChat.d.ts +5 -0
  146. package/dist/esm/components/AiChat/AiChat.js +229 -0
  147. package/dist/esm/components/AiChat/AiChat.stories.d.ts +21 -0
  148. package/dist/esm/components/AiChat/AiChat.stories.js +254 -0
  149. package/dist/esm/components/AiChat/AiChat.test.d.ts +1 -0
  150. package/dist/esm/components/AiChat/AiChat.test.js +209 -0
  151. package/dist/esm/components/AiChat/AiChatContext.d.ts +26 -0
  152. package/dist/esm/components/AiChat/AiChatContext.js +101 -0
  153. package/dist/esm/components/AiChat/AiChatContext.stories.d.ts +14 -0
  154. package/dist/esm/components/AiChat/AiChatContext.stories.js +72 -0
  155. package/dist/esm/components/AiChat/ChatTitle.d.ts +8 -0
  156. package/dist/esm/components/AiChat/ChatTitle.js +40 -0
  157. package/dist/esm/components/AiChat/EntryScreen.d.ts +11 -0
  158. package/dist/esm/components/AiChat/EntryScreen.js +120 -0
  159. package/dist/esm/components/AiChat/Markdown.d.ts +7 -0
  160. package/dist/esm/components/AiChat/Markdown.js +12 -0
  161. package/dist/esm/components/AiChat/TimLogo.d.ts +5 -0
  162. package/dist/esm/components/AiChat/TimLogo.js +13 -0
  163. package/dist/esm/components/AiChat/test-utils/api.d.ts +2 -0
  164. package/dist/esm/components/AiChat/test-utils/api.js +161 -0
  165. package/dist/esm/components/AiChat/types.d.ts +91 -0
  166. package/dist/esm/components/AiChat/types.js +2 -0
  167. package/dist/esm/components/AiChat/utils.d.ts +9 -0
  168. package/dist/esm/components/AiChat/utils.js +38 -0
  169. package/dist/esm/components/Alert/Alert.d.ts +15 -0
  170. package/dist/esm/components/Alert/Alert.js +59 -0
  171. package/dist/esm/components/Alert/Alert.stories.d.ts +8 -0
  172. package/dist/esm/components/Alert/Alert.stories.js +50 -0
  173. package/dist/esm/components/Button/ActionButton.d.ts +30 -0
  174. package/dist/esm/components/Button/ActionButton.js +68 -0
  175. package/dist/esm/components/Button/ActionButton.stories.d.ts +15 -0
  176. package/dist/esm/components/Button/ActionButton.stories.js +110 -0
  177. package/dist/esm/components/Button/Button.d.ts +54 -0
  178. package/dist/esm/components/Button/Button.js +232 -0
  179. package/dist/esm/components/Button/Button.stories.d.ts +17 -0
  180. package/dist/esm/components/Button/Button.stories.js +132 -0
  181. package/dist/esm/components/Button/Button.test.d.ts +1 -0
  182. package/dist/esm/components/Button/Button.test.js +44 -0
  183. package/dist/esm/components/ImageAdapter/ImageAdapter.d.ts +23 -0
  184. package/dist/esm/components/ImageAdapter/ImageAdapter.js +27 -0
  185. package/dist/esm/components/Input/Input.d.ts +116 -0
  186. package/dist/esm/components/Input/Input.js +232 -0
  187. package/dist/esm/components/Input/Input.stories.d.ts +19 -0
  188. package/dist/esm/components/Input/Input.stories.js +132 -0
  189. package/dist/esm/components/Input/Input.test.d.ts +1 -0
  190. package/dist/esm/components/Input/Input.test.js +30 -0
  191. package/dist/esm/components/LinkAdapter/LinkAdapter.d.ts +23 -0
  192. package/dist/esm/components/LinkAdapter/LinkAdapter.js +31 -0
  193. package/dist/esm/components/ScrollSnap/ScrollSnap.d.ts +19 -0
  194. package/dist/esm/components/ScrollSnap/ScrollSnap.js +56 -0
  195. package/dist/esm/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
  196. package/dist/esm/components/ScrollSnap/ScrollSnap.stories.js +40 -0
  197. package/dist/esm/components/ScrollSnap/useScrollSnap.d.ts +6 -0
  198. package/dist/esm/components/ScrollSnap/useScrollSnap.js +33 -0
  199. package/dist/esm/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
  200. package/dist/esm/components/SrAnnouncer/SrAnnouncer.js +40 -0
  201. package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
  202. package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.js +41 -0
  203. package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
  204. package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.js +60 -0
  205. package/dist/esm/components/TabButtons/TabButtonList.d.ts +25 -0
  206. package/dist/esm/components/TabButtons/TabButtonList.js +92 -0
  207. package/dist/esm/components/TabButtons/TabButtonList.stories.d.ts +24 -0
  208. package/dist/esm/components/TabButtons/TabButtonList.stories.js +136 -0
  209. package/dist/esm/components/TextField/TextField.d.ts +29 -0
  210. package/dist/esm/components/TextField/TextField.js +30 -0
  211. package/dist/esm/components/TextField/TextField.stories.d.ts +10 -0
  212. package/dist/esm/components/TextField/TextField.stories.js +133 -0
  213. package/dist/esm/components/TextField/TextField.test.d.ts +1 -0
  214. package/dist/esm/components/TextField/TextField.test.js +75 -0
  215. package/dist/esm/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  216. package/dist/esm/components/ThemeProvider/ThemeProvider.js +82 -0
  217. package/dist/esm/components/ThemeProvider/ThemeProvider.stories.d.ts +63 -0
  218. package/dist/esm/components/ThemeProvider/ThemeProvider.stories.js +99 -0
  219. package/dist/esm/components/ThemeProvider/Typography.stories.d.ts +39 -0
  220. package/dist/esm/components/ThemeProvider/Typography.stories.js +62 -0
  221. package/dist/esm/components/ThemeProvider/breakpoints.d.ts +4 -0
  222. package/dist/esm/components/ThemeProvider/breakpoints.js +15 -0
  223. package/dist/esm/components/ThemeProvider/buttons.d.ts +7 -0
  224. package/dist/esm/components/ThemeProvider/buttons.js +17 -0
  225. package/dist/esm/components/ThemeProvider/chips.d.ts +3 -0
  226. package/dist/esm/components/ThemeProvider/chips.js +151 -0
  227. package/dist/esm/components/ThemeProvider/colors.d.ts +32 -0
  228. package/dist/esm/components/ThemeProvider/colors.js +32 -0
  229. package/dist/esm/components/ThemeProvider/typography.d.ts +18 -0
  230. package/dist/esm/components/ThemeProvider/typography.js +167 -0
  231. package/dist/esm/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  232. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +30 -0
  233. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
  234. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js +10 -0
  235. package/dist/esm/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
  236. package/dist/esm/components/internal/FormHelpers/FormHelpers.js +73 -0
  237. package/dist/esm/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
  238. package/dist/esm/components/internal/FormHelpers/FormHelpers.test.js +91 -0
  239. package/dist/esm/index.d.ts +16 -0
  240. package/dist/esm/index.js +11 -0
  241. package/dist/esm/jest-setup.d.ts +1 -0
  242. package/dist/esm/jest-setup.js +16 -0
  243. package/dist/esm/jsdom-extended.d.ts +6 -0
  244. package/dist/esm/jsdom-extended.js +12 -0
  245. package/dist/esm/story-utils/index.d.ts +6 -0
  246. package/dist/esm/story-utils/index.js +13 -0
  247. package/dist/esm/utils/composeRefs.d.ts +7 -0
  248. package/dist/esm/utils/composeRefs.js +17 -0
  249. package/dist/esm/utils/composeRefs.test.d.ts +1 -0
  250. package/dist/esm/utils/composeRefs.test.js +17 -0
  251. package/dist/esm/utils/useDevCheckStable.d.ts +8 -0
  252. package/dist/esm/utils/useDevCheckStable.js +26 -0
  253. package/dist/esm/utils/useInterval.d.ts +7 -0
  254. package/dist/esm/utils/useInterval.js +22 -0
  255. package/dist/tsconfig.tsbuildinfo +1 -0
  256. package/dist/type-augmentation/TypescriptDocs.mdx +17 -0
  257. package/dist/type-augmentation/imports.d.ts +3 -0
  258. package/dist/type-augmentation/index.d.ts +3 -0
  259. package/dist/type-augmentation/theme.d.ts +105 -0
  260. package/dist/type-augmentation/typography.d.ts +54 -0
  261. package/package.json +158 -0
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.chipComponent = void 0;
4
+ const React = require("react");
5
+ const colors_1 = require("./colors");
6
+ const react_1 = require("@remixicon/react");
7
+ const chipComponent = {
8
+ defaultProps: {
9
+ size: "medium",
10
+ color: "default",
11
+ variant: "outlined",
12
+ deleteIcon: React.createElement(react_1.RiCloseLine, { "aria-hidden": "true" }),
13
+ },
14
+ styleOverrides: {
15
+ root: {
16
+ borderRadius: "100vh",
17
+ borderWidth: "1px",
18
+ },
19
+ deleteIcon: {
20
+ "&:hover": {
21
+ color: "inherit",
22
+ },
23
+ "&.MuiChip-deleteIconLarge": {
24
+ width: "16px",
25
+ height: "16px",
26
+ },
27
+ "&.MuiChip-deleteIconMedium": {
28
+ width: "14px",
29
+ height: "14px",
30
+ },
31
+ margin: "0 -2px 0 8px",
32
+ color: "inherit",
33
+ },
34
+ icon: {
35
+ margin: "0 8px 0 -2px",
36
+ color: "inherit",
37
+ "&.MuiChip-iconLarge": {
38
+ width: "16px",
39
+ height: "16px",
40
+ },
41
+ "&.MuiChip-iconMedium": {
42
+ width: "14px",
43
+ height: "14px",
44
+ },
45
+ },
46
+ },
47
+ variants: [
48
+ {
49
+ props: { size: "medium" },
50
+ style: ({ theme }) => (Object.assign(Object.assign({}, theme.typography.body3), { boxSizing: "border-box", height: "24px", paddingRight: "12px", paddingLeft: "12px", ".MuiChip-label": {
51
+ paddingLeft: "0px",
52
+ paddingRight: "0px",
53
+ } })),
54
+ },
55
+ {
56
+ props: { size: "large" },
57
+ style: ({ theme }) => (Object.assign(Object.assign({}, theme.typography.body2), { height: "32px", paddingLeft: "16px", paddingRight: "16px", ".MuiChip-label": {
58
+ paddingLeft: "0px",
59
+ paddingRight: "0px",
60
+ } })),
61
+ },
62
+ {
63
+ props: { variant: "outlined" },
64
+ style: {
65
+ borderColor: colors_1.colors.silverGrayLight,
66
+ color: colors_1.colors.darkGray1,
67
+ "&.Mui-focusVisible": {
68
+ backgroundColor: "transparent",
69
+ },
70
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
71
+ color: colors_1.colors.darkGray1,
72
+ borderColor: colors_1.colors.silverGrayDark,
73
+ backgroundColor: "transparent", // mui has a default background color for hover
74
+ },
75
+ },
76
+ },
77
+ {
78
+ props: { variant: "outlinedWhite" },
79
+ style: {
80
+ backgroundColor: "white",
81
+ border: "1px solid",
82
+ borderColor: colors_1.colors.silverGrayLight,
83
+ color: colors_1.colors.darkGray1,
84
+ "&.Mui-focusVisible": {
85
+ backgroundColor: "white",
86
+ },
87
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
88
+ color: colors_1.colors.darkGray1,
89
+ borderColor: colors_1.colors.silverGrayDark,
90
+ backgroundColor: "white", // mui has a default background color hover
91
+ },
92
+ },
93
+ },
94
+ {
95
+ props: { variant: "gray" },
96
+ style: {
97
+ backgroundColor: colors_1.colors.lightGray2,
98
+ border: "none",
99
+ color: colors_1.colors.darkGray2,
100
+ "&.Mui-focusVisible": {
101
+ backgroundColor: colors_1.colors.lightGray2,
102
+ },
103
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
104
+ color: colors_1.colors.darkGray1,
105
+ backgroundColor: colors_1.colors.silverGrayLight,
106
+ },
107
+ },
108
+ },
109
+ {
110
+ props: { variant: "dark" },
111
+ style: {
112
+ backgroundColor: colors_1.colors.silverGrayDark,
113
+ border: "none",
114
+ color: colors_1.colors.white,
115
+ "&.Mui-focusVisible": {
116
+ backgroundColor: colors_1.colors.silverGrayDark,
117
+ },
118
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
119
+ backgroundColor: colors_1.colors.darkGray1,
120
+ },
121
+ },
122
+ },
123
+ {
124
+ props: { variant: "darker" },
125
+ style: {
126
+ backgroundColor: colors_1.colors.darkGray2,
127
+ border: `1px solid ${colors_1.colors.darkGray1}`,
128
+ color: colors_1.colors.white,
129
+ "&.Mui-focusVisible": {
130
+ backgroundColor: colors_1.colors.darkGray2,
131
+ },
132
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
133
+ backgroundColor: colors_1.colors.black,
134
+ border: `1px solid ${colors_1.colors.silverGray}`,
135
+ },
136
+ },
137
+ },
138
+ {
139
+ props: { variant: "filled" },
140
+ style: {
141
+ backgroundColor: colors_1.colors.mitRed,
142
+ border: "none",
143
+ color: colors_1.colors.white,
144
+ "&.Mui-focusVisible": {
145
+ backgroundColor: colors_1.colors.mitRed,
146
+ },
147
+ "&.MuiChip-clickable:hover, &.MuiChip-deletable:hover": {
148
+ backgroundColor: colors_1.colors.red,
149
+ },
150
+ },
151
+ },
152
+ ],
153
+ };
154
+ exports.chipComponent = 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,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.colors = void 0;
4
+ const colors = {
5
+ mitRed: "#750014",
6
+ brightRed: "#FF1423",
7
+ black: "#000000",
8
+ white: "#FFFFFF",
9
+ darkGray2: "#212326",
10
+ darkGray1: "#40464C",
11
+ silverGrayDark: "#626A73",
12
+ silverGray: "#8B959E",
13
+ silverGrayLight: "#B8C2CC",
14
+ lightGray2: "#DDE1E6",
15
+ lightGray1: "#F3F4F8",
16
+ navGray: "#303337",
17
+ darkPink: "#750062",
18
+ pink: "#FF14F0",
19
+ lightPink: "#FFB3FF",
20
+ darkPurple: "#3E006B",
21
+ purple: "#93F",
22
+ lightPurple: "#BFB3FF",
23
+ darkBlue: "#002896",
24
+ blue: "#1966FF",
25
+ lightBlue: "#99EBFF",
26
+ darkGreen: "#004D1A",
27
+ green: "#00AD00",
28
+ lightGreen: "#AF3",
29
+ darkRed: "#83192A",
30
+ red: "#A31F34",
31
+ lightRed: "#D02E44",
32
+ orange: "#FAB005",
33
+ yellow: "#FFEB00",
34
+ };
35
+ exports.colors = 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,173 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.typography = exports.pxToRem = exports.component = exports.globalSettings = void 0;
4
+ const styles_1 = require("@mui/material/styles");
5
+ const fontWeights = {
6
+ text: {
7
+ roman: 400,
8
+ medium: 500,
9
+ bold: 700,
10
+ },
11
+ };
12
+ /**
13
+ * This function converts from pixels to rems, assuming a base font size of 16px
14
+ * (which is the default for most modern browsers).
15
+ *
16
+ * Using this function, we can:
17
+ * - match desgins that are in pixels for default font size
18
+ * - allow users to scale the font size up or down by chaning base font size.
19
+ *
20
+ * For example, a Chrome user might specify a base font size of 20px ("large")
21
+ * in their browser settings. Then, `pxToRem(32)` would actually be 40px for
22
+ * that user.
23
+ */
24
+ const pxToRem = (px) => `${px / 16}rem`;
25
+ exports.pxToRem = pxToRem;
26
+ const globalSettings = {
27
+ // Note: Figma calls this "Neue Haas Grotesk Text", but that is incorrect based on Adobe's font family.
28
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
29
+ fontWeightLight: fontWeights.text.roman,
30
+ fontWeightRegular: fontWeights.text.roman,
31
+ fontWeightMedium: fontWeights.text.medium,
32
+ fontWeightBold: fontWeights.text.bold,
33
+ h1: {
34
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
35
+ fontWeight: fontWeights.text.bold,
36
+ fontStyle: "normal",
37
+ fontSize: pxToRem(52),
38
+ lineHeight: pxToRem(60),
39
+ },
40
+ h2: {
41
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
42
+ fontWeight: fontWeights.text.bold,
43
+ fontStyle: "normal",
44
+ fontSize: pxToRem(34),
45
+ lineHeight: pxToRem(40),
46
+ },
47
+ h3: {
48
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
49
+ fontWeight: fontWeights.text.bold,
50
+ fontStyle: "normal",
51
+ fontSize: pxToRem(28),
52
+ lineHeight: pxToRem(36),
53
+ },
54
+ h4: {
55
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
56
+ fontWeight: fontWeights.text.bold,
57
+ fontStyle: "normal",
58
+ fontSize: pxToRem(24),
59
+ lineHeight: pxToRem(30),
60
+ },
61
+ h5: {
62
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
63
+ fontWeight: fontWeights.text.medium,
64
+ fontStyle: "normal",
65
+ fontSize: pxToRem(18),
66
+ lineHeight: pxToRem(22),
67
+ },
68
+ subtitle1: {
69
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
70
+ fontWeight: fontWeights.text.medium,
71
+ fontStyle: "normal",
72
+ fontSize: pxToRem(16),
73
+ lineHeight: pxToRem(20),
74
+ },
75
+ subtitle2: {
76
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
77
+ fontWeight: fontWeights.text.medium,
78
+ fontStyle: "normal",
79
+ fontSize: pxToRem(14),
80
+ lineHeight: pxToRem(18),
81
+ },
82
+ subtitle3: {
83
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
84
+ fontWeight: fontWeights.text.medium,
85
+ fontStyle: "normal",
86
+ fontSize: pxToRem(12),
87
+ lineHeight: pxToRem(16),
88
+ },
89
+ subtitle4: {
90
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
91
+ fontWeight: fontWeights.text.medium,
92
+ fontStyle: "normal",
93
+ fontSize: pxToRem(10),
94
+ lineHeight: pxToRem(14),
95
+ },
96
+ body1: {
97
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
98
+ fontWeight: fontWeights.text.roman,
99
+ fontStyle: "normal",
100
+ fontSize: pxToRem(16),
101
+ lineHeight: pxToRem(20),
102
+ },
103
+ body2: {
104
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
105
+ fontWeight: fontWeights.text.roman,
106
+ fontStyle: "normal",
107
+ fontSize: pxToRem(14),
108
+ lineHeight: pxToRem(18),
109
+ },
110
+ body3: {
111
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
112
+ fontWeight: fontWeights.text.roman,
113
+ fontStyle: "normal",
114
+ fontSize: pxToRem(12),
115
+ lineHeight: pxToRem(16),
116
+ },
117
+ body4: {
118
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
119
+ fontWeight: fontWeights.text.roman,
120
+ fontStyle: "normal",
121
+ fontSize: pxToRem(10),
122
+ lineHeight: pxToRem(14),
123
+ },
124
+ buttonLarge: {
125
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
126
+ fontWeight: fontWeights.text.medium,
127
+ fontStyle: "normal",
128
+ fontSize: pxToRem(16),
129
+ lineHeight: pxToRem(20),
130
+ },
131
+ button: {
132
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
133
+ fontWeight: fontWeights.text.medium,
134
+ fontStyle: "normal",
135
+ fontSize: pxToRem(14),
136
+ lineHeight: pxToRem(18),
137
+ textTransform: "none",
138
+ },
139
+ buttonSmall: {
140
+ fontFamily: "neue-haas-grotesk-text, sans-serif",
141
+ fontWeight: fontWeights.text.medium,
142
+ fontStyle: "normal",
143
+ fontSize: pxToRem(12),
144
+ lineHeight: pxToRem(16),
145
+ },
146
+ };
147
+ exports.globalSettings = globalSettings;
148
+ const component = {
149
+ defaultProps: {
150
+ variantMapping: {
151
+ h1: "span",
152
+ h2: "span",
153
+ h3: "span",
154
+ h4: "span",
155
+ h5: "span",
156
+ body1: "p",
157
+ body2: "p",
158
+ body3: "p",
159
+ body4: "p",
160
+ subtitle1: "p",
161
+ subtitle2: "p",
162
+ subtitle3: "p",
163
+ subtitle4: "p",
164
+ button: "span",
165
+ },
166
+ },
167
+ };
168
+ exports.component = component;
169
+ const { typography } = (0, styles_1.createTheme)({
170
+ typography: globalSettings,
171
+ custom: {},
172
+ });
173
+ exports.typography = 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 };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VisuallyHidden = void 0;
4
+ const styled_1 = require("@emotion/styled");
5
+ /**
6
+ * VisuallyHidden is a utility component that hides its children from sighted
7
+ * users, but keeps them accessible to screen readers.
8
+ *
9
+ * Often, screenreader-only content can be handled with an `aria-label`. However,
10
+ * occasionally we need actual elements.
11
+ *
12
+ * Example:
13
+ * - a visually hidden aria-live section that reads announcements that
14
+ * isual users can ascertain in some other way.
15
+ * - a visually hidden Heading for a section whose purpose is clear for sighted users
16
+ * - a visually hidden description used for aria-describeddby
17
+ * - There is an aria-description attribute that can be used to provide a
18
+ * without an actual element on the page. However, it is introduced in
19
+ * ARIA 1.3 (working draft), not compatible with some screen readers, and
20
+ * flagged problematic by our linting.
21
+ *
22
+ * The CSS here is based on https://inclusive-components.design/tooltips-toggletips/
23
+ */
24
+ const VisuallyHidden = styled_1.default.span({
25
+ clipPath: "inset(100%)",
26
+ clip: "rect(1px, 1px, 1px, 1px)",
27
+ height: "1px",
28
+ overflow: "hidden",
29
+ position: "absolute",
30
+ whiteSpace: "nowrap",
31
+ width: "1px",
32
+ });
33
+ exports.VisuallyHidden = VisuallyHidden;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { VisuallyHidden } from "./VisuallyHidden";
3
+ declare const meta: Meta<typeof VisuallyHidden>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof VisuallyHidden>;
6
+ export declare const ScreenreaderOnly: Story;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScreenreaderOnly = void 0;
4
+ const VisuallyHidden_1 = require("./VisuallyHidden");
5
+ const meta = {
6
+ title: "smoot-design/VisuallyHidden",
7
+ component: VisuallyHidden_1.VisuallyHidden,
8
+ args: {
9
+ children: "Not visible, but screen readers can still read this text.",
10
+ },
11
+ };
12
+ exports.default = meta;
13
+ exports.ScreenreaderOnly = {};
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ declare const Description: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme;
4
+ as?: React.ElementType;
5
+ } & {
6
+ error?: boolean;
7
+ }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ type ControlLabelProps = {
9
+ htmlFor: string;
10
+ label: React.ReactNode;
11
+ required?: boolean;
12
+ id?: string;
13
+ fullWidth?: boolean;
14
+ };
15
+ declare const ControlLabel: React.FC<ControlLabelProps>;
16
+ type FormFieldWrapperProps = {
17
+ label: React.ReactNode;
18
+ required?: boolean;
19
+ helpText?: string;
20
+ error?: boolean;
21
+ errorText?: string;
22
+ className?: string;
23
+ fullWidth?: boolean;
24
+ /**
25
+ * The id of the input element. If not provided, a unique id will be generated.
26
+ */
27
+ id?: string;
28
+ children: (childProps: {
29
+ id: string;
30
+ required?: boolean;
31
+ error?: boolean;
32
+ fullWidth?: boolean;
33
+ labelId: string;
34
+ "aria-describedby"?: string;
35
+ }) => React.ReactNode;
36
+ };
37
+ declare const FormFieldWrapper: React.FC<FormFieldWrapperProps>;
38
+ export { FormFieldWrapper, ControlLabel, Description };
39
+ export type { FormFieldWrapperProps, ControlLabelProps };
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Description = exports.ControlLabel = exports.FormFieldWrapper = void 0;
4
+ const React = require("react");
5
+ const styled_1 = require("@emotion/styled");
6
+ const react_1 = require("@remixicon/react");
7
+ const Typography_1 = require("@mui/material/Typography");
8
+ const Required = styled_1.default.span(({ theme }) => ({
9
+ color: theme.custom.colors.lightRed,
10
+ marginLeft: "4px",
11
+ }));
12
+ const Description = styled_1.default.div(({ theme, error }) => [
13
+ Object.assign(Object.assign({}, theme.typography.body2), { color: error
14
+ ? theme.custom.colors.lightRed
15
+ : theme.custom.colors.silverGrayDark }),
16
+ error && {
17
+ textIndent: "-24px",
18
+ paddingLeft: "24px",
19
+ "> svg:first-of-type": {
20
+ marginRight: "4px",
21
+ transform: "translateY(2px)",
22
+ width: "18px",
23
+ height: "18px",
24
+ position: "relative",
25
+ top: "2px",
26
+ },
27
+ },
28
+ ]);
29
+ exports.Description = Description;
30
+ const Container = styled_1.default.div(({ fullWidth }) => [
31
+ {
32
+ display: "inline-flex",
33
+ flexDirection: "column",
34
+ alignItems: "start",
35
+ "> *:not(:last-child)": {
36
+ marginBottom: "4px",
37
+ },
38
+ },
39
+ fullWidth && {
40
+ width: "100%",
41
+ },
42
+ ]);
43
+ const ControlLabel = ({ htmlFor, label, required, id, fullWidth, }) => {
44
+ return (React.createElement(Typography_1.default, { id: id, component: "label", htmlFor: htmlFor, variant: "subtitle2", sx: { marginBottom: "4px", width: fullWidth ? "100%" : "auto" } },
45
+ label,
46
+ required ? React.createElement(Required, { "aria-hidden": "true" }, "*") : null));
47
+ };
48
+ exports.ControlLabel = ControlLabel;
49
+ const FormFieldWrapper = ({ label, required, helpText, error, errorText, className, fullWidth, id, children, }) => {
50
+ const fallbackInputId = React.useId();
51
+ const inputId = id || fallbackInputId;
52
+ const helpId = React.useId();
53
+ const errorId = React.useId();
54
+ const labelId = React.useId();
55
+ /**
56
+ * aria-errormessage would be more semantic for the error message but has
57
+ * somewhat limited support. See https://github.com/w3c/aria/issues/2048 for
58
+ * some related information.
59
+ */
60
+ const describedBy = [helpText && helpId, error && errorText && errorId]
61
+ .filter(Boolean)
62
+ .join(" ") || undefined;
63
+ return (React.createElement(Container, { className: className, fullWidth: fullWidth },
64
+ React.createElement(ControlLabel, { htmlFor: inputId, id: labelId, label: label, required: required, fullWidth: fullWidth }),
65
+ children({
66
+ id: inputId,
67
+ error,
68
+ required,
69
+ labelId,
70
+ fullWidth,
71
+ "aria-describedby": describedBy,
72
+ }),
73
+ helpText && React.createElement(Description, { id: helpId }, helpText),
74
+ error && errorText && (React.createElement(Description, { id: errorId, error: true },
75
+ React.createElement(react_1.RiErrorWarningLine, { fontSize: "inherit" }),
76
+ errorText))));
77
+ };
78
+ exports.FormFieldWrapper = FormFieldWrapper;