@mitodl/smoot-design 0.0.0-355a925

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 (247) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +35 -0
  3. package/dist/bundles/remoteTutorDrawer.es.js +38364 -0
  4. package/dist/bundles/remoteTutorDrawer.umd.js +207 -0
  5. package/dist/cjs/ai.d.ts +3 -0
  6. package/dist/cjs/ai.js +9 -0
  7. package/dist/cjs/bundles/RemoteTutorDrawer/FlashcardsScreen.d.ts +9 -0
  8. package/dist/cjs/bundles/RemoteTutorDrawer/FlashcardsScreen.js +87 -0
  9. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.d.ts +56 -0
  10. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.js +276 -0
  11. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.d.ts +16 -0
  12. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.js +284 -0
  13. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.d.ts +1 -0
  14. package/dist/cjs/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.js +241 -0
  15. package/dist/cjs/bundles/remoteTutorDrawer.d.ts +7 -0
  16. package/dist/cjs/bundles/remoteTutorDrawer.js +40 -0
  17. package/dist/cjs/components/AiChat/AiChat.d.ts +5 -0
  18. package/dist/cjs/components/AiChat/AiChat.js +226 -0
  19. package/dist/cjs/components/AiChat/AiChat.stories.d.ts +21 -0
  20. package/dist/cjs/components/AiChat/AiChat.stories.js +243 -0
  21. package/dist/cjs/components/AiChat/AiChat.test.d.ts +1 -0
  22. package/dist/cjs/components/AiChat/AiChat.test.js +211 -0
  23. package/dist/cjs/components/AiChat/AiChatContext.d.ts +22 -0
  24. package/dist/cjs/components/AiChat/AiChatContext.js +105 -0
  25. package/dist/cjs/components/AiChat/AiChatContext.stories.d.ts +14 -0
  26. package/dist/cjs/components/AiChat/AiChatContext.stories.js +75 -0
  27. package/dist/cjs/components/AiChat/ChatTitle.d.ts +8 -0
  28. package/dist/cjs/components/AiChat/ChatTitle.js +43 -0
  29. package/dist/cjs/components/AiChat/EntryScreen.d.ts +11 -0
  30. package/dist/cjs/components/AiChat/EntryScreen.js +123 -0
  31. package/dist/cjs/components/AiChat/TimLogo.d.ts +5 -0
  32. package/dist/cjs/components/AiChat/TimLogo.js +15 -0
  33. package/dist/cjs/components/AiChat/test-utils/api.d.ts +2 -0
  34. package/dist/cjs/components/AiChat/test-utils/api.js +125 -0
  35. package/dist/cjs/components/AiChat/types.d.ts +86 -0
  36. package/dist/cjs/components/AiChat/types.js +3 -0
  37. package/dist/cjs/components/Alert/Alert.d.ts +15 -0
  38. package/dist/cjs/components/Alert/Alert.js +62 -0
  39. package/dist/cjs/components/Alert/Alert.stories.d.ts +8 -0
  40. package/dist/cjs/components/Alert/Alert.stories.js +53 -0
  41. package/dist/cjs/components/Button/ActionButton.d.ts +30 -0
  42. package/dist/cjs/components/Button/ActionButton.js +73 -0
  43. package/dist/cjs/components/Button/ActionButton.stories.d.ts +15 -0
  44. package/dist/cjs/components/Button/ActionButton.stories.js +113 -0
  45. package/dist/cjs/components/Button/Button.d.ts +54 -0
  46. package/dist/cjs/components/Button/Button.js +240 -0
  47. package/dist/cjs/components/Button/Button.stories.d.ts +17 -0
  48. package/dist/cjs/components/Button/Button.stories.js +135 -0
  49. package/dist/cjs/components/Button/Button.test.d.ts +1 -0
  50. package/dist/cjs/components/Button/Button.test.js +46 -0
  51. package/dist/cjs/components/ImageAdapter/ImageAdapter.d.ts +23 -0
  52. package/dist/cjs/components/ImageAdapter/ImageAdapter.js +30 -0
  53. package/dist/cjs/components/Input/Input.d.ts +116 -0
  54. package/dist/cjs/components/Input/Input.js +237 -0
  55. package/dist/cjs/components/Input/Input.stories.d.ts +19 -0
  56. package/dist/cjs/components/Input/Input.stories.js +135 -0
  57. package/dist/cjs/components/Input/Input.test.d.ts +1 -0
  58. package/dist/cjs/components/Input/Input.test.js +32 -0
  59. package/dist/cjs/components/LinkAdapter/LinkAdapter.d.ts +23 -0
  60. package/dist/cjs/components/LinkAdapter/LinkAdapter.js +34 -0
  61. package/dist/cjs/components/ScrollSnap/ScrollSnap.d.ts +19 -0
  62. package/dist/cjs/components/ScrollSnap/ScrollSnap.js +59 -0
  63. package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
  64. package/dist/cjs/components/ScrollSnap/ScrollSnap.stories.js +43 -0
  65. package/dist/cjs/components/ScrollSnap/useScrollSnap.d.ts +6 -0
  66. package/dist/cjs/components/ScrollSnap/useScrollSnap.js +36 -0
  67. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
  68. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.js +43 -0
  69. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
  70. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.stories.js +44 -0
  71. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
  72. package/dist/cjs/components/SrAnnouncer/SrAnnouncer.test.js +62 -0
  73. package/dist/cjs/components/TabButtons/TabButtonList.d.ts +25 -0
  74. package/dist/cjs/components/TabButtons/TabButtonList.js +97 -0
  75. package/dist/cjs/components/TabButtons/TabButtonList.stories.d.ts +24 -0
  76. package/dist/cjs/components/TabButtons/TabButtonList.stories.js +139 -0
  77. package/dist/cjs/components/TextField/TextField.d.ts +29 -0
  78. package/dist/cjs/components/TextField/TextField.js +33 -0
  79. package/dist/cjs/components/TextField/TextField.stories.d.ts +10 -0
  80. package/dist/cjs/components/TextField/TextField.stories.js +136 -0
  81. package/dist/cjs/components/TextField/TextField.test.d.ts +1 -0
  82. package/dist/cjs/components/TextField/TextField.test.js +77 -0
  83. package/dist/cjs/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  84. package/dist/cjs/components/ThemeProvider/ThemeProvider.js +86 -0
  85. package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.d.ts +63 -0
  86. package/dist/cjs/components/ThemeProvider/ThemeProvider.stories.js +102 -0
  87. package/dist/cjs/components/ThemeProvider/Typography.stories.d.ts +39 -0
  88. package/dist/cjs/components/ThemeProvider/Typography.stories.js +65 -0
  89. package/dist/cjs/components/ThemeProvider/breakpoints.d.ts +4 -0
  90. package/dist/cjs/components/ThemeProvider/breakpoints.js +19 -0
  91. package/dist/cjs/components/ThemeProvider/buttons.d.ts +7 -0
  92. package/dist/cjs/components/ThemeProvider/buttons.js +20 -0
  93. package/dist/cjs/components/ThemeProvider/chips.d.ts +3 -0
  94. package/dist/cjs/components/ThemeProvider/chips.js +154 -0
  95. package/dist/cjs/components/ThemeProvider/colors.d.ts +32 -0
  96. package/dist/cjs/components/ThemeProvider/colors.js +35 -0
  97. package/dist/cjs/components/ThemeProvider/typography.d.ts +18 -0
  98. package/dist/cjs/components/ThemeProvider/typography.js +173 -0
  99. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  100. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.js +33 -0
  101. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
  102. package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.js +13 -0
  103. package/dist/cjs/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
  104. package/dist/cjs/components/internal/FormHelpers/FormHelpers.js +78 -0
  105. package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
  106. package/dist/cjs/components/internal/FormHelpers/FormHelpers.test.js +93 -0
  107. package/dist/cjs/index.d.ts +16 -0
  108. package/dist/cjs/index.js +30 -0
  109. package/dist/cjs/jest-setup.d.ts +1 -0
  110. package/dist/cjs/jest-setup.js +18 -0
  111. package/dist/cjs/jsdom-extended.d.ts +6 -0
  112. package/dist/cjs/jsdom-extended.js +14 -0
  113. package/dist/cjs/story-utils/index.d.ts +6 -0
  114. package/dist/cjs/story-utils/index.js +17 -0
  115. package/dist/cjs/utils/composeRefs.d.ts +7 -0
  116. package/dist/cjs/utils/composeRefs.js +20 -0
  117. package/dist/cjs/utils/composeRefs.test.d.ts +1 -0
  118. package/dist/cjs/utils/composeRefs.test.js +19 -0
  119. package/dist/cjs/utils/useDevCheckStable.d.ts +8 -0
  120. package/dist/cjs/utils/useDevCheckStable.js +29 -0
  121. package/dist/cjs/utils/useInterval.d.ts +7 -0
  122. package/dist/cjs/utils/useInterval.js +25 -0
  123. package/dist/esm/ai.d.ts +3 -0
  124. package/dist/esm/ai.js +2 -0
  125. package/dist/esm/bundles/RemoteTutorDrawer/FlashcardsScreen.d.ts +9 -0
  126. package/dist/esm/bundles/RemoteTutorDrawer/FlashcardsScreen.js +83 -0
  127. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.d.ts +56 -0
  128. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.js +273 -0
  129. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.d.ts +16 -0
  130. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.stories.js +281 -0
  131. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.d.ts +1 -0
  132. package/dist/esm/bundles/RemoteTutorDrawer/RemoteTutorDrawer.test.js +239 -0
  133. package/dist/esm/bundles/remoteTutorDrawer.d.ts +7 -0
  134. package/dist/esm/bundles/remoteTutorDrawer.js +37 -0
  135. package/dist/esm/components/AiChat/AiChat.d.ts +5 -0
  136. package/dist/esm/components/AiChat/AiChat.js +222 -0
  137. package/dist/esm/components/AiChat/AiChat.stories.d.ts +21 -0
  138. package/dist/esm/components/AiChat/AiChat.stories.js +240 -0
  139. package/dist/esm/components/AiChat/AiChat.test.d.ts +1 -0
  140. package/dist/esm/components/AiChat/AiChat.test.js +209 -0
  141. package/dist/esm/components/AiChat/AiChatContext.d.ts +22 -0
  142. package/dist/esm/components/AiChat/AiChatContext.js +101 -0
  143. package/dist/esm/components/AiChat/AiChatContext.stories.d.ts +14 -0
  144. package/dist/esm/components/AiChat/AiChatContext.stories.js +72 -0
  145. package/dist/esm/components/AiChat/ChatTitle.d.ts +8 -0
  146. package/dist/esm/components/AiChat/ChatTitle.js +40 -0
  147. package/dist/esm/components/AiChat/EntryScreen.d.ts +11 -0
  148. package/dist/esm/components/AiChat/EntryScreen.js +120 -0
  149. package/dist/esm/components/AiChat/TimLogo.d.ts +5 -0
  150. package/dist/esm/components/AiChat/TimLogo.js +13 -0
  151. package/dist/esm/components/AiChat/test-utils/api.d.ts +2 -0
  152. package/dist/esm/components/AiChat/test-utils/api.js +122 -0
  153. package/dist/esm/components/AiChat/types.d.ts +86 -0
  154. package/dist/esm/components/AiChat/types.js +2 -0
  155. package/dist/esm/components/Alert/Alert.d.ts +15 -0
  156. package/dist/esm/components/Alert/Alert.js +59 -0
  157. package/dist/esm/components/Alert/Alert.stories.d.ts +8 -0
  158. package/dist/esm/components/Alert/Alert.stories.js +50 -0
  159. package/dist/esm/components/Button/ActionButton.d.ts +30 -0
  160. package/dist/esm/components/Button/ActionButton.js +68 -0
  161. package/dist/esm/components/Button/ActionButton.stories.d.ts +15 -0
  162. package/dist/esm/components/Button/ActionButton.stories.js +110 -0
  163. package/dist/esm/components/Button/Button.d.ts +54 -0
  164. package/dist/esm/components/Button/Button.js +232 -0
  165. package/dist/esm/components/Button/Button.stories.d.ts +17 -0
  166. package/dist/esm/components/Button/Button.stories.js +132 -0
  167. package/dist/esm/components/Button/Button.test.d.ts +1 -0
  168. package/dist/esm/components/Button/Button.test.js +44 -0
  169. package/dist/esm/components/ImageAdapter/ImageAdapter.d.ts +23 -0
  170. package/dist/esm/components/ImageAdapter/ImageAdapter.js +27 -0
  171. package/dist/esm/components/Input/Input.d.ts +116 -0
  172. package/dist/esm/components/Input/Input.js +232 -0
  173. package/dist/esm/components/Input/Input.stories.d.ts +19 -0
  174. package/dist/esm/components/Input/Input.stories.js +132 -0
  175. package/dist/esm/components/Input/Input.test.d.ts +1 -0
  176. package/dist/esm/components/Input/Input.test.js +30 -0
  177. package/dist/esm/components/LinkAdapter/LinkAdapter.d.ts +23 -0
  178. package/dist/esm/components/LinkAdapter/LinkAdapter.js +31 -0
  179. package/dist/esm/components/ScrollSnap/ScrollSnap.d.ts +19 -0
  180. package/dist/esm/components/ScrollSnap/ScrollSnap.js +56 -0
  181. package/dist/esm/components/ScrollSnap/ScrollSnap.stories.d.ts +6 -0
  182. package/dist/esm/components/ScrollSnap/ScrollSnap.stories.js +40 -0
  183. package/dist/esm/components/ScrollSnap/useScrollSnap.d.ts +6 -0
  184. package/dist/esm/components/ScrollSnap/useScrollSnap.js +33 -0
  185. package/dist/esm/components/SrAnnouncer/SrAnnouncer.d.ts +25 -0
  186. package/dist/esm/components/SrAnnouncer/SrAnnouncer.js +40 -0
  187. package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.d.ts +6 -0
  188. package/dist/esm/components/SrAnnouncer/SrAnnouncer.stories.js +41 -0
  189. package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.d.ts +1 -0
  190. package/dist/esm/components/SrAnnouncer/SrAnnouncer.test.js +60 -0
  191. package/dist/esm/components/TabButtons/TabButtonList.d.ts +25 -0
  192. package/dist/esm/components/TabButtons/TabButtonList.js +92 -0
  193. package/dist/esm/components/TabButtons/TabButtonList.stories.d.ts +24 -0
  194. package/dist/esm/components/TabButtons/TabButtonList.stories.js +136 -0
  195. package/dist/esm/components/TextField/TextField.d.ts +29 -0
  196. package/dist/esm/components/TextField/TextField.js +30 -0
  197. package/dist/esm/components/TextField/TextField.stories.d.ts +10 -0
  198. package/dist/esm/components/TextField/TextField.stories.js +133 -0
  199. package/dist/esm/components/TextField/TextField.test.d.ts +1 -0
  200. package/dist/esm/components/TextField/TextField.test.js +75 -0
  201. package/dist/esm/components/ThemeProvider/ThemeProvider.d.ts +21 -0
  202. package/dist/esm/components/ThemeProvider/ThemeProvider.js +82 -0
  203. package/dist/esm/components/ThemeProvider/ThemeProvider.stories.d.ts +63 -0
  204. package/dist/esm/components/ThemeProvider/ThemeProvider.stories.js +99 -0
  205. package/dist/esm/components/ThemeProvider/Typography.stories.d.ts +39 -0
  206. package/dist/esm/components/ThemeProvider/Typography.stories.js +62 -0
  207. package/dist/esm/components/ThemeProvider/breakpoints.d.ts +4 -0
  208. package/dist/esm/components/ThemeProvider/breakpoints.js +15 -0
  209. package/dist/esm/components/ThemeProvider/buttons.d.ts +7 -0
  210. package/dist/esm/components/ThemeProvider/buttons.js +17 -0
  211. package/dist/esm/components/ThemeProvider/chips.d.ts +3 -0
  212. package/dist/esm/components/ThemeProvider/chips.js +151 -0
  213. package/dist/esm/components/ThemeProvider/colors.d.ts +32 -0
  214. package/dist/esm/components/ThemeProvider/colors.js +32 -0
  215. package/dist/esm/components/ThemeProvider/typography.d.ts +18 -0
  216. package/dist/esm/components/ThemeProvider/typography.js +167 -0
  217. package/dist/esm/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  218. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +30 -0
  219. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
  220. package/dist/esm/components/VisuallyHidden/VisuallyHidden.stories.js +10 -0
  221. package/dist/esm/components/internal/FormHelpers/FormHelpers.d.ts +39 -0
  222. package/dist/esm/components/internal/FormHelpers/FormHelpers.js +73 -0
  223. package/dist/esm/components/internal/FormHelpers/FormHelpers.test.d.ts +1 -0
  224. package/dist/esm/components/internal/FormHelpers/FormHelpers.test.js +91 -0
  225. package/dist/esm/index.d.ts +16 -0
  226. package/dist/esm/index.js +11 -0
  227. package/dist/esm/jest-setup.d.ts +1 -0
  228. package/dist/esm/jest-setup.js +16 -0
  229. package/dist/esm/jsdom-extended.d.ts +6 -0
  230. package/dist/esm/jsdom-extended.js +12 -0
  231. package/dist/esm/story-utils/index.d.ts +6 -0
  232. package/dist/esm/story-utils/index.js +13 -0
  233. package/dist/esm/utils/composeRefs.d.ts +7 -0
  234. package/dist/esm/utils/composeRefs.js +17 -0
  235. package/dist/esm/utils/composeRefs.test.d.ts +1 -0
  236. package/dist/esm/utils/composeRefs.test.js +17 -0
  237. package/dist/esm/utils/useDevCheckStable.d.ts +8 -0
  238. package/dist/esm/utils/useDevCheckStable.js +26 -0
  239. package/dist/esm/utils/useInterval.d.ts +7 -0
  240. package/dist/esm/utils/useInterval.js +22 -0
  241. package/dist/tsconfig.tsbuildinfo +1 -0
  242. package/dist/type-augmentation/TypescriptDocs.mdx +17 -0
  243. package/dist/type-augmentation/imports.d.ts +3 -0
  244. package/dist/type-augmentation/index.d.ts +3 -0
  245. package/dist/type-augmentation/theme.d.ts +105 -0
  246. package/dist/type-augmentation/typography.d.ts +54 -0
  247. package/package.json +155 -0
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.handlers = void 0;
13
+ const msw_1 = require("msw");
14
+ const SAMPLE_RESPONSES = [
15
+ `For exploring AI applications in business, I recommend the following course from MIT:
16
+
17
+ 1. **[Machine Learning, Modeling, and Simulation Principles](https://xpro.mit.edu/courses/course-v1:xPRO+MLx1/)**: Offered by MIT xPRO, this course is part of the program "Machine Learning, Modeling, and Simulation: Engineering Problem-Solving in the Age of AI." It focuses on the principles of machine learning and how they can be applied to solve engineering problems, which is highly relevant for business applications of AI.
18
+
19
+ This course is not free, but it provides a certification upon completion, which can be valuable for professionals looking to apply AI in business contexts. It covers essential concepts that can help you understand how AI can be leveraged to improve business processes and decision-making.
20
+ <!-- Comment! -->
21
+ `,
22
+ `
23
+ To understand global warming, I recommend the following resources from MIT:
24
+
25
+ 1. **[Global Warming Science](https://www.edx.org/learn/global-warming/massachusetts-institute-of-technology-global-warming-science)**: This course offered by MITx covers the physics, chemistry, biology, and geology of the earth’s climate system. It's a comprehensive introduction to the scientific principles underlying global warming.
26
+
27
+ 2. **[Global Warming Science](https://openlearninglibrary.mit.edu/courses/course-v1:MITx+12.340x+1T2020/about)**: Another offering of the same course by MITx, available through the Open Learning Library. It provides the same in-depth exploration of the earth's climate system.
28
+
29
+ These courses are free and provide a solid foundation in understanding the scientific aspects of global warming. They are suitable for anyone interested in the topic, regardless of prior knowledge.
30
+ <!-- Comment! -->
31
+ `,
32
+ `
33
+ Here are some courses on linear algebra that you can explore:
34
+
35
+ 1. **[Linear Algebra (MIT OpenCourseWare)](https://openlearninglibrary.mit.edu/courses/course-v1:OCW+18.06SC+2T2019/about)**: This course covers matrix theory and linear algebra, emphasizing topics useful in various disciplines such as physics, economics, social sciences, natural sciences, and engineering. It parallels the combination of theory and applications in Professor Strang's textbook "Introduction to Linear Algebra." This course is free and available through MIT OpenCourseWare.
36
+
37
+ 2. **[Mathematical Methods for Quantitative Finance (MITx)](https://www.edx.org/learn/finance/massachusetts-institute-of-technology-mathematical-methods-for-quantitative-finance)**: This course covers the mathematical foundations essential for financial engineering and quantitative finance, including linear algebra, optimization, probability, stochastic processes, statistics, and applied computational techniques in R. It is free and offers certification upon completion.
38
+
39
+ 3. **[Quantum Information Science I, Part 1 (MITx)](https://openlearninglibrary.mit.edu/courses/course-v1:MITx+8.370.1x+1T2018/about)**: While primarily focused on quantum information science, this course requires some knowledge of linear algebra and is suitable for those interested in quantum mechanics. It is free and available through MITx.
40
+
41
+ These courses provide a comprehensive introduction to linear algebra and its applications across various fields.
42
+ <!-- Comment! -->
43
+ `,
44
+ `Here are some courses on quantum computing that offer certificates:
45
+
46
+ 1. [Introduction to Quantum Computing](https://xpro.mit.edu/courses/course-v1:xPRO+QCFx1/)
47
+ - **Description**: This is the first course in the Quantum Computing Fundamentals professional certificate program. You can earn a Professional Certificate and CEUs by completing both courses in the program. Alternatively, you can take this course individually for a certificate of completion and CEUs.
48
+ - **Offered by**: MIT xPRO
49
+ - **Instructors**: Isaac Chuang, William Oliver, Peter Shor, Aram Harrow
50
+
51
+ 2. [Practical Realities of Quantum Computation and Quantum Communication](https://xpro.mit.edu/courses/course-v1:xPRO+QCRx1/)
52
+ - **Description**: This course is part of the Quantum Computing Realities professional certificate program. Completing both courses in the program will earn you a Professional Certificate and CEUs. You can also take this course individually for a certificate of completion and CEUs.
53
+ - **Offered by**: MIT xPRO
54
+ - **Instructors**: Isaac Chuang, William Oliver, Peter Shor, Aram Harrow
55
+
56
+ These courses are part of professional certificate programs, and you can choose to complete the entire program or take individual courses for certification.`,
57
+ ];
58
+ const rand = (min, max) => {
59
+ // min and max included
60
+ return Math.floor(Math.random() * (max - min + 1) + min);
61
+ };
62
+ const getReadableStream = () => {
63
+ let timerId;
64
+ const response = SAMPLE_RESPONSES[rand(0, SAMPLE_RESPONSES.length - 1)];
65
+ const chunks = response.split(" ").reduce((acc, word) => {
66
+ const last = acc[acc.length - 1];
67
+ if (acc.length === 0) {
68
+ acc.push(word);
69
+ }
70
+ else if (Math.random() < 0.75) {
71
+ acc[acc.length - 1] = `${last} ${word}`;
72
+ }
73
+ else {
74
+ acc.push(` ${word}`);
75
+ }
76
+ return acc;
77
+ }, []);
78
+ const num = chunks.length;
79
+ let i = 0;
80
+ return new ReadableStream({
81
+ start(controller) {
82
+ timerId = setInterval(() => {
83
+ const msg = new TextEncoder().encode(chunks[i]);
84
+ controller.enqueue(msg);
85
+ i++;
86
+ if (i === num) {
87
+ controller.close();
88
+ clearInterval(timerId);
89
+ }
90
+ }, 100);
91
+ },
92
+ cancel() {
93
+ if (timerId) {
94
+ clearInterval(timerId);
95
+ }
96
+ },
97
+ });
98
+ };
99
+ const handlers = [
100
+ msw_1.http.post("http://localhost:4567/streaming", (_a) => __awaiter(void 0, [_a], void 0, function* ({ request }) {
101
+ yield (0, msw_1.delay)(600);
102
+ const body = getReadableStream();
103
+ const requestBody = yield request.json();
104
+ if (Array.isArray(requestBody)) {
105
+ const last = requestBody[requestBody.length - 1];
106
+ const { content } = last;
107
+ if (content === "error") {
108
+ return new msw_1.HttpResponse("Internal Server Error", {
109
+ status: 500,
110
+ });
111
+ }
112
+ }
113
+ return new msw_1.HttpResponse(body, {
114
+ headers: {
115
+ "Content-Type": "text/plain",
116
+ },
117
+ });
118
+ })),
119
+ msw_1.http.post("http://localhost:4567/json", () => __awaiter(void 0, void 0, void 0, function* () {
120
+ const message = SAMPLE_RESPONSES[rand(0, SAMPLE_RESPONSES.length - 1)];
121
+ yield (0, msw_1.delay)(800);
122
+ return msw_1.HttpResponse.json({ message });
123
+ })),
124
+ ];
125
+ exports.handlers = handlers;
@@ -0,0 +1,86 @@
1
+ import { RefAttributes } from "react";
2
+ type Role = "assistant" | "user";
3
+ type AiChatMessage = {
4
+ id: string;
5
+ content: string;
6
+ role: Role;
7
+ };
8
+ type RequestOpts = {
9
+ apiUrl: string;
10
+ /**
11
+ * Transforms array of chat messages into request body. Messages
12
+ * are ordered oldest to newest.
13
+ *
14
+ * JSON.stringify is applied to the return value.
15
+ */
16
+ transformBody?: (messages: AiChatMessage[]) => unknown;
17
+ /**
18
+ * Extra options to pass to fetch.
19
+ */
20
+ fetchOpts?: RequestInit;
21
+ onFinish?: (message: AiChatMessage) => void;
22
+ };
23
+ type AiChatContextProps = {
24
+ /**
25
+ * Changing the `chatId` will reset the chat. Changing the `chatId` to a
26
+ * previously used value will restore the session state.
27
+ */
28
+ chatId?: string;
29
+ /**
30
+ * Options for making requests to the AI service.
31
+ */
32
+ requestOpts: RequestOpts;
33
+ parseContent?: (content: unknown) => string;
34
+ /**
35
+ * Initial messages to display on the chat. If not provided, the entry screen title will be used as the initial message.
36
+ */
37
+ initialMessages?: Omit<AiChatMessage, "id">[];
38
+ children?: React.ReactNode;
39
+ };
40
+ type AiChatDisplayProps = {
41
+ /**
42
+ * If provided, renders the "AskTIM" title motif followed by the text.
43
+ */
44
+ askTimTitle?: string;
45
+ /**
46
+ * Placeholder message for chat input.
47
+ */
48
+ placeholder?: string;
49
+ className?: string;
50
+ /**
51
+ * Set to false to disable the entry screen and load the chat immediately.
52
+ * Defaults to true.
53
+ */
54
+ entryScreenEnabled?: boolean;
55
+ /**
56
+ * Title to display on the entry screen, also the initial assistant message if not overridden by `initialMessages`.
57
+ */
58
+ entryScreenTitle?: string;
59
+ /**
60
+ * Prompt suggestions for the user, clickable on the entry screen or in the chat if the entry screen is not enabled.
61
+ */
62
+ conversationStarters?: {
63
+ content: string;
64
+ }[];
65
+ /**
66
+ * A message to display while the component is in a loading state.
67
+ *
68
+ * Identical consecutive messages may not be read on some screen readers.
69
+ */
70
+ srLoadingMessages?: {
71
+ delay: number;
72
+ text: string;
73
+ }[];
74
+ /**
75
+ * If provided, element to use for rendering avatar images.
76
+ * By default, the theme's ImageAdater is used.
77
+ */
78
+ ImgComponent?: React.ElementType;
79
+ /**
80
+ * Where the scroll container is provided by the component,
81
+ * the AiChat will scroll to the bottom as chat messages are added.
82
+ */
83
+ scrollElement?: HTMLElement | null;
84
+ } & RefAttributes<HTMLDivElement>;
85
+ type AiChatProps = AiChatContextProps & AiChatDisplayProps;
86
+ export type { RequestOpts, AiChatMessage, AiChatContextProps, AiChatDisplayProps, AiChatProps, };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Some of these are based on (compatible, but simplified / restricted) versions of ai/react types.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import type { AlertColor } from "@mui/material/Alert";
3
+ type AlertProps = {
4
+ visible?: boolean;
5
+ closable?: boolean;
6
+ className?: string;
7
+ severity?: AlertColor;
8
+ /**
9
+ * Alert Content
10
+ */
11
+ children?: React.ReactNode;
12
+ };
13
+ declare const Alert: React.FC<AlertProps>;
14
+ export { Alert };
15
+ export type { AlertProps };
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Alert = void 0;
5
+ const React = require("react");
6
+ const styled_1 = require("@emotion/styled");
7
+ const Alert_1 = require("@mui/material/Alert");
8
+ const getColor = (theme, severity) => {
9
+ return {
10
+ info: theme.custom.colors.blue,
11
+ success: theme.custom.colors.green,
12
+ warning: theme.custom.colors.orange,
13
+ error: theme.custom.colors.lightRed,
14
+ }[severity];
15
+ };
16
+ const AlertStyled = (0, styled_1.default)(Alert_1.default)(({ theme, severity }) => ({
17
+ padding: "11px 16px",
18
+ borderRadius: 4,
19
+ borderWidth: 2,
20
+ borderStyle: "solid",
21
+ borderColor: getColor(theme, severity),
22
+ background: "#FFF",
23
+ ".MuiAlert-message": Object.assign(Object.assign({}, theme.typography.body2), { color: theme.custom.colors.darkGray2, alignSelf: "center" }),
24
+ "> div": {
25
+ paddingTop: 0,
26
+ paddingBottom: 0,
27
+ },
28
+ ".MuiAlert-icon": {
29
+ marginRight: 8,
30
+ svg: {
31
+ width: 16,
32
+ fill: getColor(theme, severity),
33
+ },
34
+ },
35
+ button: {
36
+ padding: 0,
37
+ ":hover": {
38
+ margin: 0,
39
+ background: "none",
40
+ },
41
+ },
42
+ }));
43
+ const Hidden = styled_1.default.span({ display: "none" });
44
+ const Alert = ({ visible = true, severity = "info", closable, children, className, }) => {
45
+ const [_visible, setVisible] = React.useState(visible);
46
+ const id = React.useId();
47
+ const onCloseClick = () => {
48
+ setVisible(false);
49
+ };
50
+ React.useEffect(() => {
51
+ setVisible(visible);
52
+ }, [visible]);
53
+ if (!_visible) {
54
+ return null;
55
+ }
56
+ return (React.createElement(AlertStyled, { severity: severity, onClose: closable ? onCloseClick : undefined, role: "alert", "aria-describedby": id, className: className },
57
+ children,
58
+ React.createElement(Hidden, { id: id },
59
+ severity,
60
+ " message")));
61
+ };
62
+ exports.Alert = Alert;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Alert } from "./Alert";
3
+ declare const meta: Meta<typeof Alert>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Alert>;
6
+ export declare const Basic: Story;
7
+ export declare const Closable: Story;
8
+ export declare const Variants: Story;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Variants = exports.Closable = exports.Basic = void 0;
4
+ const React = require("react");
5
+ const Alert_1 = require("./Alert");
6
+ const Stack_1 = require("@mui/material/Stack");
7
+ const meta = {
8
+ title: "smoot-design/Alert",
9
+ component: Alert_1.Alert,
10
+ };
11
+ exports.default = meta;
12
+ exports.Basic = {
13
+ args: {
14
+ severity: "info",
15
+ },
16
+ render: (args) => (React.createElement(Alert_1.Alert, Object.assign({}, args),
17
+ "Alert with severity \"",
18
+ args.severity,
19
+ "\"")),
20
+ };
21
+ exports.Closable = {
22
+ args: {
23
+ severity: "warning",
24
+ closable: true,
25
+ },
26
+ render: (args) => (React.createElement(Alert_1.Alert, Object.assign({}, args),
27
+ "Closable alert with severity \"",
28
+ args.severity,
29
+ "\"")),
30
+ };
31
+ exports.Variants = {
32
+ argTypes: {
33
+ severity: {
34
+ table: {
35
+ disable: true,
36
+ },
37
+ },
38
+ closable: {
39
+ table: {
40
+ disable: true,
41
+ },
42
+ },
43
+ },
44
+ render: (args) => (React.createElement(Stack_1.default, { direction: "column", gap: 2, sx: { my: 2 } },
45
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { severity: "info" }), "Alert with severity \"info\""),
46
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { closable: true, severity: "info" }), "Closable alert with severity \"info\""),
47
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { severity: "success" }), "Alert with severity \"success\""),
48
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { closable: true, severity: "success" }), "Closable alert with severity \"success\""),
49
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { severity: "warning" }), "Alert with severity \"warning\""),
50
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { closable: true, severity: "warning" }), "Closable alert with severity \"warning\""),
51
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { severity: "error" }), "Alert with severity \"error\""),
52
+ React.createElement(Alert_1.Alert, Object.assign({}, args, { closable: true, severity: "error" }), "Closable alert with severity \"error\""))),
53
+ };
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ import { DEFAULT_PROPS } from "./Button";
3
+ import type { ButtonStyleProps } from "./Button";
4
+ import type { LinkAdapterPropsOverrides } from "../LinkAdapter/LinkAdapter";
5
+ type ActionButtonStyleProps = Omit<ButtonStyleProps, "startIcon" | "endIcon">;
6
+ type ActionButtonProps = ActionButtonStyleProps & React.ComponentProps<"button">;
7
+ /**
8
+ * A button that should contain a remixicon icon and nothing else.
9
+ * See [ActionButton docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs).
10
+ *
11
+ * See also:
12
+ * - [ActionButtonLink](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs#links)
13
+ * - [Button](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs) for text buttons
14
+ */
15
+ declare const ActionButton: import("@emotion/styled").StyledComponent<Omit<ActionButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement> & {
16
+ theme?: import("@emotion/react").Theme;
17
+ }, {}, {}>;
18
+ type ActionButtonLinkProps = ActionButtonStyleProps & React.ComponentProps<"a"> & {
19
+ Component?: React.ElementType;
20
+ } & LinkAdapterPropsOverrides;
21
+ /**
22
+ * See [ActionButtonLink docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs#links)
23
+ */
24
+ declare const ActionButtonLink: import("@emotion/styled").StyledComponent<Omit<ActionButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement> & {
25
+ theme?: import("@emotion/react").Theme;
26
+ } & ActionButtonStyleProps & React.ClassAttributes<HTMLAnchorElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
27
+ Component?: React.ElementType;
28
+ } & LinkAdapterPropsOverrides, {}, {}>;
29
+ export { ActionButton, ActionButtonLink, DEFAULT_PROPS };
30
+ export type { ActionButtonProps, ActionButtonLinkProps };
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.DEFAULT_PROPS = exports.ActionButtonLink = exports.ActionButton = void 0;
15
+ const React = require("react");
16
+ const styled_1 = require("@emotion/styled");
17
+ const typography_1 = require("../ThemeProvider/typography");
18
+ const Button_1 = require("./Button");
19
+ Object.defineProperty(exports, "DEFAULT_PROPS", { enumerable: true, get: function () { return Button_1.DEFAULT_PROPS; } });
20
+ const actionStyles = (size) => {
21
+ return {
22
+ minWidth: "auto",
23
+ padding: 0,
24
+ height: {
25
+ small: "32px",
26
+ medium: "40px",
27
+ large: "48px",
28
+ }[size],
29
+ width: {
30
+ small: "32px",
31
+ medium: "40px",
32
+ large: "48px",
33
+ }[size],
34
+ "& svg, & .MuiSvgIcon-root": {
35
+ width: "1em",
36
+ height: "1em",
37
+ fontSize: (0, typography_1.pxToRem)({
38
+ small: 20,
39
+ medium: 24,
40
+ large: 32,
41
+ }[size]),
42
+ },
43
+ };
44
+ };
45
+ /**
46
+ * A button that should contain a remixicon icon and nothing else.
47
+ * See [ActionButton docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs).
48
+ *
49
+ * See also:
50
+ * - [ActionButtonLink](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs#links)
51
+ * - [Button](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs) for text buttons
52
+ */
53
+ const ActionButton = (0, styled_1.default)(React.forwardRef(function Root(props, ref) {
54
+ return React.createElement(Button_1.ButtonRoot, Object.assign({ ref: ref, type: "button" }, props));
55
+ }))(({ size = Button_1.DEFAULT_PROPS.size, responsive, theme }) => {
56
+ return [
57
+ actionStyles(size),
58
+ responsive && {
59
+ [theme.breakpoints.down("sm")]: actionStyles(Button_1.RESPONSIVE_SIZES[size]),
60
+ },
61
+ ];
62
+ });
63
+ exports.ActionButton = ActionButton;
64
+ ActionButton.displayName = "ActionButton";
65
+ /**
66
+ * See [ActionButtonLink docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs#links)
67
+ */
68
+ const ActionButtonLink = ActionButton.withComponent((_a) => {
69
+ var { Component } = _a, props = __rest(_a, ["Component"]);
70
+ return React.createElement(Button_1.ButtonLinkRoot, Object.assign({ Component: Component }, props));
71
+ });
72
+ exports.ActionButtonLink = ActionButtonLink;
73
+ ActionButtonLink.displayName = "ActionButtonLink";
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ActionButton } from "./ActionButton";
3
+ declare const meta: Meta<typeof ActionButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ActionButton>;
6
+ export declare const VariantsAndEdge: Story;
7
+ /**
8
+ * `ActionButtonLink` is styled as a `ActionButton` that renders an anchor tag.
9
+ *
10
+ * To use a custom link component (E.g. `Link` from `react-router` or `next/link`),
11
+ * pass it as the `Component` prop. Alternatively, customize the project-wide
12
+ * default link adapter via [Theme's LinkAdapter](../?path=/docs/smoot-design-themeprovider--docs)
13
+ */
14
+ export declare const Links: Story;
15
+ export declare const Showcase: Story;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Showcase = exports.Links = exports.VariantsAndEdge = void 0;
4
+ const React = require("react");
5
+ const ActionButton_1 = require("./ActionButton");
6
+ const Grid2_1 = require("@mui/material/Grid2");
7
+ const Stack_1 = require("@mui/material/Stack");
8
+ const react_1 = require("@remixicon/react");
9
+ const test_1 = require("@storybook/test");
10
+ const story_utils_1 = require("../../story-utils");
11
+ const ICONS = {
12
+ None: undefined,
13
+ ArrowBackIcon: React.createElement(react_1.RiArrowLeftLine, null),
14
+ DeleteIcon: React.createElement(react_1.RiDeleteBinLine, null),
15
+ TestTubeIcon: React.createElement(react_1.RiTestTubeLine, null),
16
+ };
17
+ const VARIANTS = (0, story_utils_1.enumValues)({
18
+ primary: true,
19
+ secondary: true,
20
+ tertiary: true,
21
+ bordered: true,
22
+ text: true,
23
+ });
24
+ const STABLE_VARIANTS = VARIANTS.filter((v) => !v.startsWith("unstable"));
25
+ const SIZES = (0, story_utils_1.enumValues)({
26
+ small: true,
27
+ medium: true,
28
+ large: true,
29
+ });
30
+ const EDGES = (0, story_utils_1.enumValues)({
31
+ circular: true,
32
+ rounded: true,
33
+ none: true,
34
+ });
35
+ const meta = {
36
+ title: "smoot-design/ActionButton",
37
+ component: ActionButton_1.ActionButton,
38
+ argTypes: {
39
+ variant: {
40
+ control: { type: "select" },
41
+ table: {
42
+ defaultValue: { summary: ActionButton_1.DEFAULT_PROPS.variant },
43
+ },
44
+ },
45
+ size: {
46
+ control: { type: "select" },
47
+ table: {
48
+ defaultValue: { summary: ActionButton_1.DEFAULT_PROPS.size },
49
+ },
50
+ },
51
+ edge: {
52
+ control: { type: "select" },
53
+ table: {
54
+ defaultValue: { summary: ActionButton_1.DEFAULT_PROPS.edge },
55
+ },
56
+ },
57
+ },
58
+ args: {
59
+ onClick: (0, test_1.fn)(),
60
+ },
61
+ };
62
+ exports.default = meta;
63
+ exports.VariantsAndEdge = {
64
+ render: (args) => (React.createElement(React.Fragment, null,
65
+ React.createElement(Stack_1.default, { direction: "row", gap: 2, sx: { my: 2 } },
66
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "none", variant: "primary" }), ICONS.DeleteIcon),
67
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "none", variant: "secondary" }), ICONS.DeleteIcon),
68
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "none", variant: "tertiary" }), ICONS.DeleteIcon),
69
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "none", variant: "bordered" }), ICONS.DeleteIcon),
70
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "none", variant: "text" }), ICONS.DeleteIcon)),
71
+ React.createElement(Stack_1.default, { direction: "row", gap: 2, sx: { my: 2 } },
72
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "rounded", variant: "primary" }), ICONS.DeleteIcon),
73
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "rounded", variant: "secondary" }), ICONS.DeleteIcon),
74
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "rounded", variant: "tertiary" }), ICONS.DeleteIcon),
75
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "rounded", variant: "bordered" }), ICONS.DeleteIcon),
76
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "rounded", variant: "text" }), ICONS.DeleteIcon)),
77
+ React.createElement(Stack_1.default, { direction: "row", gap: 2, sx: { my: 2 } },
78
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "circular", variant: "primary" }), ICONS.DeleteIcon),
79
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "circular", variant: "secondary" }), ICONS.DeleteIcon),
80
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "circular", variant: "tertiary" }), ICONS.DeleteIcon),
81
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "circular", variant: "bordered" }), ICONS.DeleteIcon),
82
+ React.createElement(ActionButton_1.ActionButton, Object.assign({}, args, { edge: "circular", variant: "text" }), ICONS.DeleteIcon)))),
83
+ tags: ["main"],
84
+ };
85
+ /**
86
+ * `ActionButtonLink` is styled as a `ActionButton` that renders an anchor tag.
87
+ *
88
+ * To use a custom link component (E.g. `Link` from `react-router` or `next/link`),
89
+ * pass it as the `Component` prop. Alternatively, customize the project-wide
90
+ * default link adapter via [Theme's LinkAdapter](../?path=/docs/smoot-design-themeprovider--docs)
91
+ */
92
+ exports.Links = {
93
+ render: () => (React.createElement(Stack_1.default, { direction: "row", gap: 2, sx: { my: 2 } },
94
+ React.createElement(ActionButton_1.ActionButtonLink, { href: "#fake", variant: "primary" }, ICONS.DeleteIcon),
95
+ React.createElement(ActionButton_1.ActionButtonLink, { href: "#fake", variant: "secondary" }, ICONS.DeleteIcon),
96
+ React.createElement(ActionButton_1.ActionButtonLink, { href: "#fake", variant: "tertiary" }, ICONS.DeleteIcon),
97
+ React.createElement(ActionButton_1.ActionButtonLink, { href: "#fake", variant: "bordered" }, ICONS.DeleteIcon),
98
+ React.createElement(ActionButton_1.ActionButtonLink, { href: "#fake", variant: "text" }, ICONS.DeleteIcon))),
99
+ };
100
+ exports.Showcase = {
101
+ render: (args) => (React.createElement(Grid2_1.default, { container: true, sx: { maxWidth: "750px" }, rowGap: 2 }, STABLE_VARIANTS.flatMap((variant) => EDGES.flatMap((edge) => (React.createElement(React.Fragment, { key: `${variant}-${edge}` },
102
+ React.createElement(Grid2_1.default, { size: { xs: 12, sm: 3 }, alignItems: "center" },
103
+ React.createElement("code", null,
104
+ "variant=",
105
+ variant,
106
+ React.createElement("br", null),
107
+ "edge=",
108
+ edge)),
109
+ SIZES.flatMap((size) => Object.entries(ICONS)
110
+ .filter(([_key, icon]) => icon)
111
+ .map(([iconKey, icon]) => (React.createElement(Grid2_1.default, { size: { xs: 4, sm: 1 }, key: `${size}-${iconKey}` },
112
+ React.createElement(ActionButton_1.ActionButton, Object.assign({ variant: variant, edge: edge, size: size }, args), icon))))))))))),
113
+ };
@@ -0,0 +1,54 @@
1
+ import * as React from "react";
2
+ import { LinkAdapterPropsOverrides } from "../LinkAdapter/LinkAdapter";
3
+ type ButtonVariant = "primary" | "secondary" | "tertiary" | "text" | "bordered";
4
+ type ButtonSize = "small" | "medium" | "large";
5
+ type ButtonEdge = "circular" | "rounded" | "none";
6
+ type ButtonStyleProps = {
7
+ variant?: ButtonVariant;
8
+ size?: ButtonSize;
9
+ edge?: ButtonEdge;
10
+ /**
11
+ * Display an icon before the button text
12
+ */
13
+ startIcon?: React.ReactNode;
14
+ /**
15
+ * Display an icon after the button text.
16
+ */
17
+ endIcon?: React.ReactNode;
18
+ /**
19
+ * If true (default: `false`), the button will become one size smaller at the
20
+ * `sm` breakpoint.
21
+ * - large -> medium
22
+ * - medium -> small
23
+ * - small -> small
24
+ */
25
+ responsive?: boolean;
26
+ color?: "secondary";
27
+ };
28
+ declare const DEFAULT_PROPS: Required<Omit<ButtonStyleProps, "startIcon" | "endIcon" | "color">>;
29
+ declare const RESPONSIVE_SIZES: Record<ButtonSize, ButtonSize>;
30
+ declare const ButtonRoot: import("@emotion/styled").StyledComponent<{
31
+ theme?: import("@emotion/react").Theme;
32
+ as?: React.ElementType;
33
+ } & ButtonStyleProps, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
34
+ declare const ButtonLinkRoot: import("@emotion/styled").StyledComponent<Omit<import("../LinkAdapter/LinkAdapter").LinkAdapterProps, "ref"> & React.RefAttributes<HTMLAnchorElement> & {
35
+ theme?: import("@emotion/react").Theme;
36
+ } & ButtonStyleProps, {}, {}>;
37
+ type ButtonProps = ButtonStyleProps & React.ComponentProps<"button">;
38
+ /**
39
+ * Our standard button component. See [Button Docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs).
40
+ *
41
+ * See also:
42
+ * - [ButtonLink](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs#links)
43
+ * - [ActionButton](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-actionbutton--docs) for icon-only uses
44
+ */
45
+ declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
46
+ type ButtonLinkProps = ButtonStyleProps & React.ComponentProps<"a"> & {
47
+ Component?: React.ElementType;
48
+ } & LinkAdapterPropsOverrides;
49
+ /**
50
+ * See [ButtonLink docs](https://mitodl.github.io/smoot-design/?path=/docs/smoot-design-button--docs#links)
51
+ */
52
+ declare const ButtonLink: React.ForwardRefExoticComponent<Omit<ButtonLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
53
+ export { Button, ButtonLink, ButtonRoot, DEFAULT_PROPS, ButtonLinkRoot, RESPONSIVE_SIZES, };
54
+ export type { ButtonProps, ButtonLinkProps, ButtonStyleProps, ButtonSize };