@bodhan-ai/react 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/LICENSE +5 -0
  2. package/README.md +73 -2
  3. package/dist/components/Accordion/Accordion.d.ts +56 -0
  4. package/dist/components/Accordion/Accordion.js +91 -0
  5. package/dist/components/Accordion/Accordion.js.map +1 -0
  6. package/dist/components/Account/Account.d.ts +20 -0
  7. package/dist/components/Account/Account.js +39 -0
  8. package/dist/components/Account/Account.js.map +1 -0
  9. package/dist/components/ActionSheet/ActionSheet.d.ts +36 -0
  10. package/dist/components/ActionSheet/ActionSheet.js +93 -0
  11. package/dist/components/ActionSheet/ActionSheet.js.map +1 -0
  12. package/dist/components/ActivityPill/ActivityPill.d.ts +27 -0
  13. package/dist/components/ActivityPill/ActivityPill.js +75 -0
  14. package/dist/components/ActivityPill/ActivityPill.js.map +1 -0
  15. package/dist/components/AgentStatus/AgentStatus.d.ts +23 -0
  16. package/dist/components/AgentStatus/AgentStatus.js +83 -0
  17. package/dist/components/AgentStatus/AgentStatus.js.map +1 -0
  18. package/dist/components/AgentTask/AgentTask.d.ts +41 -0
  19. package/dist/components/AgentTask/AgentTask.js +159 -0
  20. package/dist/components/AgentTask/AgentTask.js.map +1 -0
  21. package/dist/components/Alert/Alert.d.ts +34 -0
  22. package/dist/components/Alert/Alert.js +83 -0
  23. package/dist/components/Alert/Alert.js.map +1 -0
  24. package/dist/components/AnswerOption/AnswerOption.d.ts +26 -0
  25. package/dist/components/AnswerOption/AnswerOption.js +57 -0
  26. package/dist/components/AnswerOption/AnswerOption.js.map +1 -0
  27. package/dist/components/AudioPlayer/AudioPlayer.d.ts +39 -0
  28. package/dist/components/AudioPlayer/AudioPlayer.js +172 -0
  29. package/dist/components/AudioPlayer/AudioPlayer.js.map +1 -0
  30. package/dist/components/Avatar/Avatar.d.ts +34 -0
  31. package/dist/components/Avatar/Avatar.js +133 -0
  32. package/dist/components/Avatar/Avatar.js.map +1 -0
  33. package/dist/components/AvatarGroup/AvatarGroup.d.ts +24 -0
  34. package/dist/components/AvatarGroup/AvatarGroup.js +40 -0
  35. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -0
  36. package/dist/components/Badge/Badge.d.ts +22 -0
  37. package/dist/components/Badge/Badge.js +23 -0
  38. package/dist/components/Badge/Badge.js.map +1 -0
  39. package/dist/components/Banner/Banner.d.ts +36 -0
  40. package/dist/components/Banner/Banner.js +81 -0
  41. package/dist/components/Banner/Banner.js.map +1 -0
  42. package/dist/components/BarChart/BarChart.d.ts +42 -0
  43. package/dist/components/BarChart/BarChart.js +221 -0
  44. package/dist/components/BarChart/BarChart.js.map +1 -0
  45. package/dist/components/BodhanLogo/BodhanLogo.d.ts +17 -0
  46. package/dist/components/BodhanLogo/BodhanLogo.js +32 -0
  47. package/dist/components/BodhanLogo/BodhanLogo.js.map +1 -0
  48. package/dist/components/BodhanLogo/logos.d.ts +5 -0
  49. package/dist/components/BodhanLogo/logos.js +31 -0
  50. package/dist/components/BodhanLogo/logos.js.map +1 -0
  51. package/dist/components/BottomAppBar/BottomAppBar.d.ts +33 -0
  52. package/dist/components/BottomAppBar/BottomAppBar.js +86 -0
  53. package/dist/components/BottomAppBar/BottomAppBar.js.map +1 -0
  54. package/dist/components/BottomSheet/BottomSheet.d.ts +66 -0
  55. package/dist/components/BottomSheet/BottomSheet.js +165 -0
  56. package/dist/components/BottomSheet/BottomSheet.js.map +1 -0
  57. package/dist/components/Breadcrumb/Breadcrumb.d.ts +47 -0
  58. package/dist/components/Breadcrumb/Breadcrumb.js +102 -0
  59. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  60. package/dist/components/Button/Button.d.ts +30 -0
  61. package/dist/components/Button/Button.js +40 -0
  62. package/dist/components/Button/Button.js.map +1 -0
  63. package/dist/components/ButtonGroup/ButtonGroup.d.ts +34 -0
  64. package/dist/components/ButtonGroup/ButtonGroup.js +47 -0
  65. package/dist/components/ButtonGroup/ButtonGroup.js.map +1 -0
  66. package/dist/components/Calendar/Calendar.d.ts +111 -0
  67. package/dist/components/Calendar/Calendar.js +338 -0
  68. package/dist/components/Calendar/Calendar.js.map +1 -0
  69. package/dist/components/CameraCapture/CameraCapture.d.ts +22 -0
  70. package/dist/components/CameraCapture/CameraCapture.js +155 -0
  71. package/dist/components/CameraCapture/CameraCapture.js.map +1 -0
  72. package/dist/components/Card/Card.d.ts +50 -0
  73. package/dist/components/Card/Card.js +120 -0
  74. package/dist/components/Card/Card.js.map +1 -0
  75. package/dist/components/Carousel/Carousel.d.ts +51 -0
  76. package/dist/components/Carousel/Carousel.js +152 -0
  77. package/dist/components/Carousel/Carousel.js.map +1 -0
  78. package/dist/components/Celebration/Celebration.d.ts +23 -0
  79. package/dist/components/Celebration/Celebration.js +93 -0
  80. package/dist/components/Celebration/Celebration.js.map +1 -0
  81. package/dist/components/ChartStatus/ChartStatus.d.ts +54 -0
  82. package/dist/components/ChartStatus/ChartStatus.js +144 -0
  83. package/dist/components/ChartStatus/ChartStatus.js.map +1 -0
  84. package/dist/components/ChatArtifact/ChatArtifact.d.ts +23 -0
  85. package/dist/components/ChatArtifact/ChatArtifact.js +91 -0
  86. package/dist/components/ChatArtifact/ChatArtifact.js.map +1 -0
  87. package/dist/components/ChatBubble/ChatBubble.d.ts +26 -0
  88. package/dist/components/ChatBubble/ChatBubble.js +57 -0
  89. package/dist/components/ChatBubble/ChatBubble.js.map +1 -0
  90. package/dist/components/ChatContent/ChatContent.d.ts +23 -0
  91. package/dist/components/ChatContent/ChatContent.js +333 -0
  92. package/dist/components/ChatContent/ChatContent.js.map +1 -0
  93. package/dist/components/Checkbox/Checkbox.d.ts +29 -0
  94. package/dist/components/Checkbox/Checkbox.js +58 -0
  95. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  96. package/dist/components/Chip/Chip.d.ts +28 -0
  97. package/dist/components/Chip/Chip.js +48 -0
  98. package/dist/components/Chip/Chip.js.map +1 -0
  99. package/dist/components/CircularLoader/CircularLoader.d.ts +12 -0
  100. package/dist/components/CircularLoader/CircularLoader.js +36 -0
  101. package/dist/components/CircularLoader/CircularLoader.js.map +1 -0
  102. package/dist/components/ColorSwatch/ColorSwatch.d.ts +14 -0
  103. package/dist/components/ColorSwatch/ColorSwatch.js +30 -0
  104. package/dist/components/ColorSwatch/ColorSwatch.js.map +1 -0
  105. package/dist/components/Combobox/Combobox.d.ts +40 -0
  106. package/dist/components/Combobox/Combobox.js +167 -0
  107. package/dist/components/Combobox/Combobox.js.map +1 -0
  108. package/dist/components/CommandPalette/CommandPalette.d.ts +48 -0
  109. package/dist/components/CommandPalette/CommandPalette.js +235 -0
  110. package/dist/components/CommandPalette/CommandPalette.js.map +1 -0
  111. package/dist/components/ContextMenu/ContextMenu.d.ts +31 -0
  112. package/dist/components/ContextMenu/ContextMenu.js +138 -0
  113. package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
  114. package/dist/components/DateField/DateField.d.ts +28 -0
  115. package/dist/components/DateField/DateField.js +134 -0
  116. package/dist/components/DateField/DateField.js.map +1 -0
  117. package/dist/components/DigitField/DigitField.d.ts +16 -0
  118. package/dist/components/DigitField/DigitField.js +27 -0
  119. package/dist/components/DigitField/DigitField.js.map +1 -0
  120. package/dist/components/Divider/Divider.d.ts +19 -0
  121. package/dist/components/Divider/Divider.js +22 -0
  122. package/dist/components/Divider/Divider.js.map +1 -0
  123. package/dist/components/DottedLoader/DottedLoader.d.ts +15 -0
  124. package/dist/components/DottedLoader/DottedLoader.js +36 -0
  125. package/dist/components/DottedLoader/DottedLoader.js.map +1 -0
  126. package/dist/components/DoughnutChart/DoughnutChart.d.ts +16 -0
  127. package/dist/components/DoughnutChart/DoughnutChart.js +31 -0
  128. package/dist/components/DoughnutChart/DoughnutChart.js.map +1 -0
  129. package/dist/components/Drawer/Drawer.d.ts +39 -0
  130. package/dist/components/Drawer/Drawer.js +109 -0
  131. package/dist/components/Drawer/Drawer.js.map +1 -0
  132. package/dist/components/DropdownMenu/DropdownMenu.d.ts +79 -0
  133. package/dist/components/DropdownMenu/DropdownMenu.js +262 -0
  134. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  135. package/dist/components/DropdownMenuCheckbox/DropdownMenuCheckbox.d.ts +46 -0
  136. package/dist/components/DropdownMenuCheckbox/DropdownMenuCheckbox.js +75 -0
  137. package/dist/components/DropdownMenuCheckbox/DropdownMenuCheckbox.js.map +1 -0
  138. package/dist/components/EmptyState/EmptyState.d.ts +34 -0
  139. package/dist/components/EmptyState/EmptyState.js +53 -0
  140. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  141. package/dist/components/FAB/FAB.d.ts +19 -0
  142. package/dist/components/FAB/FAB.js +27 -0
  143. package/dist/components/FAB/FAB.js.map +1 -0
  144. package/dist/components/FABMenu/FABMenu.d.ts +25 -0
  145. package/dist/components/FABMenu/FABMenu.js +95 -0
  146. package/dist/components/FABMenu/FABMenu.js.map +1 -0
  147. package/dist/components/FeedbackReasons/FeedbackReasons.d.ts +19 -0
  148. package/dist/components/FeedbackReasons/FeedbackReasons.js +62 -0
  149. package/dist/components/FeedbackReasons/FeedbackReasons.js.map +1 -0
  150. package/dist/components/FileUpload/FileUpload.d.ts +88 -0
  151. package/dist/components/FileUpload/FileUpload.js +199 -0
  152. package/dist/components/FileUpload/FileUpload.js.map +1 -0
  153. package/dist/components/FlashcardStack/FlashcardStack.d.ts +37 -0
  154. package/dist/components/FlashcardStack/FlashcardStack.js +237 -0
  155. package/dist/components/FlashcardStack/FlashcardStack.js.map +1 -0
  156. package/dist/components/HandoffCard/HandoffCard.d.ts +25 -0
  157. package/dist/components/HandoffCard/HandoffCard.js +80 -0
  158. package/dist/components/HandoffCard/HandoffCard.js.map +1 -0
  159. package/dist/components/HomeIndicator/HomeIndicator.d.ts +12 -0
  160. package/dist/components/HomeIndicator/HomeIndicator.js +20 -0
  161. package/dist/components/HomeIndicator/HomeIndicator.js.map +1 -0
  162. package/dist/components/Icon/Icon.d.ts +15 -0
  163. package/dist/components/Icon/Icon.js +24 -0
  164. package/dist/components/Icon/Icon.js.map +1 -0
  165. package/dist/components/IconButton/IconButton.d.ts +29 -0
  166. package/dist/components/IconButton/IconButton.js +33 -0
  167. package/dist/components/IconButton/IconButton.js.map +1 -0
  168. package/dist/components/Illustration/Illustration.d.ts +22 -0
  169. package/dist/components/Illustration/Illustration.js +37 -0
  170. package/dist/components/Illustration/Illustration.js.map +1 -0
  171. package/dist/components/Illustration/illustrations.d.ts +5 -0
  172. package/dist/components/Illustration/illustrations.js +266 -0
  173. package/dist/components/Illustration/illustrations.js.map +1 -0
  174. package/dist/components/ImageViewer/ImageViewer.d.ts +31 -0
  175. package/dist/components/ImageViewer/ImageViewer.js +132 -0
  176. package/dist/components/ImageViewer/ImageViewer.js.map +1 -0
  177. package/dist/components/InkPad/InkPad.d.ts +27 -0
  178. package/dist/components/InkPad/InkPad.js +205 -0
  179. package/dist/components/InkPad/InkPad.js.map +1 -0
  180. package/dist/components/Input/Input.d.ts +42 -0
  181. package/dist/components/Input/Input.js +104 -0
  182. package/dist/components/Input/Input.js.map +1 -0
  183. package/dist/components/LearningCard/LearningCard.d.ts +32 -0
  184. package/dist/components/LearningCard/LearningCard.js +116 -0
  185. package/dist/components/LearningCard/LearningCard.js.map +1 -0
  186. package/dist/components/Legend/Legend.d.ts +30 -0
  187. package/dist/components/Legend/Legend.js +48 -0
  188. package/dist/components/Legend/Legend.js.map +1 -0
  189. package/dist/components/LineChart/LineChart.d.ts +33 -0
  190. package/dist/components/LineChart/LineChart.js +139 -0
  191. package/dist/components/LineChart/LineChart.js.map +1 -0
  192. package/dist/components/Link/Link.d.ts +16 -0
  193. package/dist/components/Link/Link.js +30 -0
  194. package/dist/components/Link/Link.js.map +1 -0
  195. package/dist/components/ListGroup/ListGroup.d.ts +18 -0
  196. package/dist/components/ListGroup/ListGroup.js +42 -0
  197. package/dist/components/ListGroup/ListGroup.js.map +1 -0
  198. package/dist/components/ListItem/ListItem.d.ts +40 -0
  199. package/dist/components/ListItem/ListItem.js +132 -0
  200. package/dist/components/ListItem/ListItem.js.map +1 -0
  201. package/dist/components/MascotBodhanBird/MascotBodhanBird.d.ts +14 -0
  202. package/dist/components/MascotBodhanBird/MascotBodhanBird.js +124 -0
  203. package/dist/components/MascotBodhanBird/MascotBodhanBird.js.map +1 -0
  204. package/dist/components/Message/Message.d.ts +15 -0
  205. package/dist/components/Message/Message.js +52 -0
  206. package/dist/components/Message/Message.js.map +1 -0
  207. package/dist/components/Modal/Modal.d.ts +54 -0
  208. package/dist/components/Modal/Modal.js +152 -0
  209. package/dist/components/Modal/Modal.js.map +1 -0
  210. package/dist/components/MultiSelect/MultiSelect.d.ts +62 -0
  211. package/dist/components/MultiSelect/MultiSelect.js +282 -0
  212. package/dist/components/MultiSelect/MultiSelect.js.map +1 -0
  213. package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +35 -0
  214. package/dist/components/NavigationDrawer/NavigationDrawer.js +107 -0
  215. package/dist/components/NavigationDrawer/NavigationDrawer.js.map +1 -0
  216. package/dist/components/NavigationItem/NavigationItem.d.ts +16 -0
  217. package/dist/components/NavigationItem/NavigationItem.js +34 -0
  218. package/dist/components/NavigationItem/NavigationItem.js.map +1 -0
  219. package/dist/components/NavigationRail/NavigationRail.d.ts +39 -0
  220. package/dist/components/NavigationRail/NavigationRail.js +100 -0
  221. package/dist/components/NavigationRail/NavigationRail.js.map +1 -0
  222. package/dist/components/NumberStepper/NumberStepper.d.ts +23 -0
  223. package/dist/components/NumberStepper/NumberStepper.js +84 -0
  224. package/dist/components/NumberStepper/NumberStepper.js.map +1 -0
  225. package/dist/components/OTPInput/OTPInput.d.ts +42 -0
  226. package/dist/components/OTPInput/OTPInput.js +122 -0
  227. package/dist/components/OTPInput/OTPInput.js.map +1 -0
  228. package/dist/components/Pagination/Pagination.d.ts +50 -0
  229. package/dist/components/Pagination/Pagination.js +122 -0
  230. package/dist/components/Pagination/Pagination.js.map +1 -0
  231. package/dist/components/PermissionSheet/PermissionSheet.d.ts +31 -0
  232. package/dist/components/PermissionSheet/PermissionSheet.js +113 -0
  233. package/dist/components/PermissionSheet/PermissionSheet.js.map +1 -0
  234. package/dist/components/PieChart/PieChart.d.ts +9 -0
  235. package/dist/components/PieChart/PieChart.js +19 -0
  236. package/dist/components/PieChart/PieChart.js.map +1 -0
  237. package/dist/components/PieChart/PieCore.d.ts +35 -0
  238. package/dist/components/PieChart/PieCore.js +128 -0
  239. package/dist/components/PieChart/PieCore.js.map +1 -0
  240. package/dist/components/Popover/Popover.d.ts +94 -0
  241. package/dist/components/Popover/Popover.js +324 -0
  242. package/dist/components/Popover/Popover.js.map +1 -0
  243. package/dist/components/Progress/Progress.d.ts +27 -0
  244. package/dist/components/Progress/Progress.js +77 -0
  245. package/dist/components/Progress/Progress.js.map +1 -0
  246. package/dist/components/PromptStarter/PromptStarter.d.ts +16 -0
  247. package/dist/components/PromptStarter/PromptStarter.js +33 -0
  248. package/dist/components/PromptStarter/PromptStarter.js.map +1 -0
  249. package/dist/components/Promptbox/Promptbox.d.ts +109 -0
  250. package/dist/components/Promptbox/Promptbox.js +469 -0
  251. package/dist/components/Promptbox/Promptbox.js.map +1 -0
  252. package/dist/components/Question/Question.d.ts +55 -0
  253. package/dist/components/Question/Question.js +161 -0
  254. package/dist/components/Question/Question.js.map +1 -0
  255. package/dist/components/RadioButton/RadioButton.d.ts +28 -0
  256. package/dist/components/RadioButton/RadioButton.js +43 -0
  257. package/dist/components/RadioButton/RadioButton.js.map +1 -0
  258. package/dist/components/Rating/Rating.d.ts +25 -0
  259. package/dist/components/Rating/Rating.js +79 -0
  260. package/dist/components/Rating/Rating.js.map +1 -0
  261. package/dist/components/ReadAloud/ReadAloud.d.ts +24 -0
  262. package/dist/components/ReadAloud/ReadAloud.js +76 -0
  263. package/dist/components/ReadAloud/ReadAloud.js.map +1 -0
  264. package/dist/components/RecommendationCard/RecommendationCard.d.ts +28 -0
  265. package/dist/components/RecommendationCard/RecommendationCard.js +78 -0
  266. package/dist/components/RecommendationCard/RecommendationCard.js.map +1 -0
  267. package/dist/components/ResizablePanel/ResizablePanel.d.ts +32 -0
  268. package/dist/components/ResizablePanel/ResizablePanel.js +102 -0
  269. package/dist/components/ResizablePanel/ResizablePanel.js.map +1 -0
  270. package/dist/components/ResizeHandle/ResizeHandle.d.ts +32 -0
  271. package/dist/components/ResizeHandle/ResizeHandle.js +61 -0
  272. package/dist/components/ResizeHandle/ResizeHandle.js.map +1 -0
  273. package/dist/components/ResultsSummary/ResultsSummary.d.ts +37 -0
  274. package/dist/components/ResultsSummary/ResultsSummary.js +121 -0
  275. package/dist/components/ResultsSummary/ResultsSummary.js.map +1 -0
  276. package/dist/components/ScoreCounter/ScoreCounter.d.ts +18 -0
  277. package/dist/components/ScoreCounter/ScoreCounter.js +78 -0
  278. package/dist/components/ScoreCounter/ScoreCounter.js.map +1 -0
  279. package/dist/components/ScreenTemplate/ScreenTemplate.d.ts +30 -0
  280. package/dist/components/ScreenTemplate/ScreenTemplate.js +88 -0
  281. package/dist/components/ScreenTemplate/ScreenTemplate.js.map +1 -0
  282. package/dist/components/ScrollEdgeEffect/ScrollEdgeEffect.d.ts +15 -0
  283. package/dist/components/ScrollEdgeEffect/ScrollEdgeEffect.js +20 -0
  284. package/dist/components/ScrollEdgeEffect/ScrollEdgeEffect.js.map +1 -0
  285. package/dist/components/Search/Search.d.ts +33 -0
  286. package/dist/components/Search/Search.js +74 -0
  287. package/dist/components/Search/Search.js.map +1 -0
  288. package/dist/components/SearchView/SearchView.d.ts +36 -0
  289. package/dist/components/SearchView/SearchView.js +124 -0
  290. package/dist/components/SearchView/SearchView.js.map +1 -0
  291. package/dist/components/SegmentedControl/SegmentedControl.d.ts +63 -0
  292. package/dist/components/SegmentedControl/SegmentedControl.js +164 -0
  293. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
  294. package/dist/components/Select/Select.d.ts +49 -0
  295. package/dist/components/Select/Select.js +143 -0
  296. package/dist/components/Select/Select.js.map +1 -0
  297. package/dist/components/Sidebar/Sidebar.d.ts +78 -0
  298. package/dist/components/Sidebar/Sidebar.js +167 -0
  299. package/dist/components/Sidebar/Sidebar.js.map +1 -0
  300. package/dist/components/Skeleton/Skeleton.d.ts +25 -0
  301. package/dist/components/Skeleton/Skeleton.js +26 -0
  302. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  303. package/dist/components/Slider/Slider.d.ts +39 -0
  304. package/dist/components/Slider/Slider.js +83 -0
  305. package/dist/components/Slider/Slider.js.map +1 -0
  306. package/dist/components/Snackbar/Snackbar.d.ts +38 -0
  307. package/dist/components/Snackbar/Snackbar.js +103 -0
  308. package/dist/components/Snackbar/Snackbar.js.map +1 -0
  309. package/dist/components/SourcePanel/SourcePanel.d.ts +20 -0
  310. package/dist/components/SourcePanel/SourcePanel.js +82 -0
  311. package/dist/components/SourcePanel/SourcePanel.js.map +1 -0
  312. package/dist/components/StatTile/StatTile.d.ts +22 -0
  313. package/dist/components/StatTile/StatTile.js +71 -0
  314. package/dist/components/StatTile/StatTile.js.map +1 -0
  315. package/dist/components/StatusBar/StatusBar.d.ts +18 -0
  316. package/dist/components/StatusBar/StatusBar.js +131 -0
  317. package/dist/components/StatusBar/StatusBar.js.map +1 -0
  318. package/dist/components/Stepper/Stepper.d.ts +50 -0
  319. package/dist/components/Stepper/Stepper.js +99 -0
  320. package/dist/components/Stepper/Stepper.js.map +1 -0
  321. package/dist/components/SuggestionCard/SuggestionCard.d.ts +22 -0
  322. package/dist/components/SuggestionCard/SuggestionCard.js +74 -0
  323. package/dist/components/SuggestionCard/SuggestionCard.js.map +1 -0
  324. package/dist/components/Switch/Switch.d.ts +35 -0
  325. package/dist/components/Switch/Switch.js +54 -0
  326. package/dist/components/Switch/Switch.js.map +1 -0
  327. package/dist/components/SystemNavigationBar/SystemNavigationBar.d.ts +16 -0
  328. package/dist/components/SystemNavigationBar/SystemNavigationBar.js +54 -0
  329. package/dist/components/SystemNavigationBar/SystemNavigationBar.js.map +1 -0
  330. package/dist/components/TabBar/TabBar.d.ts +101 -0
  331. package/dist/components/TabBar/TabBar.js +287 -0
  332. package/dist/components/TabBar/TabBar.js.map +1 -0
  333. package/dist/components/Table/Table.d.ts +135 -0
  334. package/dist/components/Table/Table.js +323 -0
  335. package/dist/components/Table/Table.js.map +1 -0
  336. package/dist/components/Tabs/Tabs.d.ts +61 -0
  337. package/dist/components/Tabs/Tabs.js +179 -0
  338. package/dist/components/Tabs/Tabs.js.map +1 -0
  339. package/dist/components/Tag/Tag.d.ts +37 -0
  340. package/dist/components/Tag/Tag.js +56 -0
  341. package/dist/components/Tag/Tag.js.map +1 -0
  342. package/dist/components/Textarea/Textarea.d.ts +37 -0
  343. package/dist/components/Textarea/Textarea.js +77 -0
  344. package/dist/components/Textarea/Textarea.js.map +1 -0
  345. package/dist/components/Tile/Tile.d.ts +31 -0
  346. package/dist/components/Tile/Tile.js +70 -0
  347. package/dist/components/Tile/Tile.js.map +1 -0
  348. package/dist/components/TimePicker/TimePicker.d.ts +43 -0
  349. package/dist/components/TimePicker/TimePicker.js +186 -0
  350. package/dist/components/TimePicker/TimePicker.js.map +1 -0
  351. package/dist/components/Toast/Toast.d.ts +42 -0
  352. package/dist/components/Toast/Toast.js +115 -0
  353. package/dist/components/Toast/Toast.js.map +1 -0
  354. package/dist/components/Toolbar/Toolbar.d.ts +22 -0
  355. package/dist/components/Toolbar/Toolbar.js +52 -0
  356. package/dist/components/Toolbar/Toolbar.js.map +1 -0
  357. package/dist/components/Tooltip/Tooltip.d.ts +28 -0
  358. package/dist/components/Tooltip/Tooltip.js +101 -0
  359. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  360. package/dist/components/TopAppBar/TopAppBar.d.ts +36 -0
  361. package/dist/components/TopAppBar/TopAppBar.js +70 -0
  362. package/dist/components/TopAppBar/TopAppBar.js.map +1 -0
  363. package/dist/components/Topbar/Topbar.d.ts +28 -0
  364. package/dist/components/Topbar/Topbar.js +63 -0
  365. package/dist/components/Topbar/Topbar.js.map +1 -0
  366. package/dist/components/Topbar/TopbarLogo.d.ts +2 -0
  367. package/dist/components/Topbar/TopbarLogo.js +98 -0
  368. package/dist/components/Topbar/TopbarLogo.js.map +1 -0
  369. package/dist/components/TreeItem/TreeItem.d.ts +38 -0
  370. package/dist/components/TreeItem/TreeItem.js +126 -0
  371. package/dist/components/TreeItem/TreeItem.js.map +1 -0
  372. package/dist/components/VersionSwitcher/VersionSwitcher.d.ts +13 -0
  373. package/dist/components/VersionSwitcher/VersionSwitcher.js +43 -0
  374. package/dist/components/VersionSwitcher/VersionSwitcher.js.map +1 -0
  375. package/dist/components/VideoPlayer/VideoPlayer.d.ts +28 -0
  376. package/dist/components/VideoPlayer/VideoPlayer.js +160 -0
  377. package/dist/components/VideoPlayer/VideoPlayer.js.map +1 -0
  378. package/dist/components/VoiceMode/VoiceMode.d.ts +27 -0
  379. package/dist/components/VoiceMode/VoiceMode.js +123 -0
  380. package/dist/components/VoiceMode/VoiceMode.js.map +1 -0
  381. package/dist/components/WebScreenTemplate/WebScreenTemplate.d.ts +36 -0
  382. package/dist/components/WebScreenTemplate/WebScreenTemplate.js +66 -0
  383. package/dist/components/WebScreenTemplate/WebScreenTemplate.js.map +1 -0
  384. package/dist/components/WhyThisSheet/WhyThisSheet.d.ts +23 -0
  385. package/dist/components/WhyThisSheet/WhyThisSheet.js +73 -0
  386. package/dist/components/WhyThisSheet/WhyThisSheet.js.map +1 -0
  387. package/dist/index.d.ts +124 -0
  388. package/dist/index.js +125 -0
  389. package/dist/styles.css +5637 -0
  390. package/dist/tokens.css +2338 -0
  391. package/package.json +50 -4
@@ -0,0 +1,83 @@
1
+ import { Icon } from "../Icon/Icon.js";
2
+ import { DottedLoader } from "../DottedLoader/DottedLoader.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ // src/components/AgentStatus/AgentStatus.tsx
5
+ var ACTIVE = [
6
+ "thinking",
7
+ "searching",
8
+ "working"
9
+ ];
10
+ var LABEL = {
11
+ thinking: "Thinking…",
12
+ searching: "Searching your lesson…",
13
+ working: "Working on it…",
14
+ "waiting-for-you": "Waiting for your approval",
15
+ done: "Done",
16
+ failed: "Couldn't finish",
17
+ cancelled: "Stopped",
18
+ queued: "Queued"
19
+ };
20
+ var ICON = {
21
+ "waiting-for-you": "pending",
22
+ done: "check_circle",
23
+ failed: "error",
24
+ cancelled: "stop_circle",
25
+ queued: "schedule"
26
+ };
27
+ var FILLED = ["done", "failed"];
28
+ var ACTION = {
29
+ thinking: "Stop",
30
+ searching: "Stop",
31
+ working: "Stop",
32
+ "waiting-for-you": "Review",
33
+ failed: "Retry"
34
+ };
35
+ /**
36
+ * Bodhan Agent Status — the shared inline status line for AI work: indicator + label + optional action.
37
+ * Identical anatomy on Web, iOS and Android (no Platform property); type and colours come from tokens.
38
+ * Polite live region (Failed is assertive); the action is a real button.
39
+ * Android: Row(indicator, Text, TextButton) · iOS: HStack(ProgressView/Image, Text, Button)
40
+ */
41
+ function AgentStatus({ status = "thinking", label, showAction = true, actionLabel, actionAriaLabel, onAction, className, ...rest }) {
42
+ const active = ACTIVE.includes(status);
43
+ const action = actionLabel ?? ACTION[status];
44
+ const text = label ?? LABEL[status];
45
+ return /* @__PURE__ */ jsxs("div", {
46
+ className: ["bodhan-agent-status", className].filter(Boolean).join(" "),
47
+ "data-status": status,
48
+ role: "status",
49
+ "aria-live": status === "failed" ? "assertive" : "polite",
50
+ "aria-busy": active || void 0,
51
+ ...rest,
52
+ children: [
53
+ active ? /* @__PURE__ */ jsx(DottedLoader, {
54
+ className: "bodhan-agent-status__dots",
55
+ label: "",
56
+ "aria-hidden": "true",
57
+ role: void 0
58
+ }) : /* @__PURE__ */ jsx(Icon, {
59
+ name: ICON[status],
60
+ filled: FILLED.includes(status),
61
+ className: "bodhan-agent-status__icon"
62
+ }),
63
+ /* @__PURE__ */ jsx("span", {
64
+ className: "bodhan-agent-status__label",
65
+ children: text
66
+ }),
67
+ showAction && action && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
68
+ className: "bodhan-agent-status__sep",
69
+ "aria-hidden": "true",
70
+ children: "·"
71
+ }), /* @__PURE__ */ jsx("button", {
72
+ type: "button",
73
+ className: "bodhan-agent-status__action",
74
+ "aria-label": actionAriaLabel,
75
+ onClick: onAction,
76
+ children: action
77
+ })] })
78
+ ]
79
+ });
80
+ }
81
+ export { AgentStatus };
82
+
83
+ //# sourceMappingURL=AgentStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentStatus.js","names":["_Fragment"],"sources":["../../../src/components/AgentStatus/AgentStatus.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport { Icon } from '../Icon/Icon';\nimport { DottedLoader } from '../DottedLoader/DottedLoader';\n\nexport type AgentStatusStatus =\n | 'thinking' | 'searching' | 'working' | 'waiting-for-you' | 'done' | 'failed' | 'cancelled' | 'queued';\n\nexport interface AgentStatusProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Figma `Status`. */\n status?: AgentStatusStatus;\n /** Figma `Label` — describe the work in the learner's words. Defaults per status (\"Thinking…\", \"Done\"…). */\n label?: ReactNode;\n /** Figma `Show Action`: Stop on active states, Review on Waiting for You, Retry on Failed. */\n showAction?: boolean;\n /** Visible action text. Defaults to Stop / Review / Retry. */\n actionLabel?: string;\n /** Accessible name of the action button (e.g. \"Stop answer\"). Defaults to the visible text. */\n actionAriaLabel?: string;\n /** Called when the action is pressed. */\n onAction?: () => void;\n}\n\nconst ACTIVE: AgentStatusStatus[] = ['thinking', 'searching', 'working'];\nconst LABEL: Record<AgentStatusStatus, string> = {\n thinking: 'Thinking…', searching: 'Searching your lesson…', working: 'Working on it…',\n 'waiting-for-you': 'Waiting for your approval', done: 'Done', failed: \"Couldn't finish\", cancelled: 'Stopped', queued: 'Queued',\n};\nconst ICON: Partial<Record<AgentStatusStatus, string>> = {\n 'waiting-for-you': 'pending', done: 'check_circle', failed: 'error', cancelled: 'stop_circle', queued: 'schedule',\n};\nconst FILLED: AgentStatusStatus[] = ['done', 'failed'];\nconst ACTION: Partial<Record<AgentStatusStatus, string>> = {\n thinking: 'Stop', searching: 'Stop', working: 'Stop', 'waiting-for-you': 'Review', failed: 'Retry',\n};\n\n/**\n * Bodhan Agent Status — the shared inline status line for AI work: indicator + label + optional action.\n * Identical anatomy on Web, iOS and Android (no Platform property); type and colours come from tokens.\n * Polite live region (Failed is assertive); the action is a real button.\n * Android: Row(indicator, Text, TextButton) · iOS: HStack(ProgressView/Image, Text, Button)\n */\nexport function AgentStatus({\n status = 'thinking', label, showAction = true, actionLabel, actionAriaLabel, onAction, className, ...rest\n}: AgentStatusProps) {\n const active = ACTIVE.includes(status);\n const action = actionLabel ?? ACTION[status];\n const text = label ?? LABEL[status];\n return (\n <div\n className={['bodhan-agent-status', className].filter(Boolean).join(' ')}\n data-status={status}\n role=\"status\"\n aria-live={status === 'failed' ? 'assertive' : 'polite'}\n aria-busy={active || undefined}\n {...rest}\n >\n {active\n ? <DottedLoader className=\"bodhan-agent-status__dots\" label=\"\" aria-hidden=\"true\" role={undefined} />\n : <Icon name={ICON[status]!} filled={FILLED.includes(status)} className=\"bodhan-agent-status__icon\" />}\n <span className=\"bodhan-agent-status__label\">{text}</span>\n {showAction && action && (\n <>\n <span className=\"bodhan-agent-status__sep\" aria-hidden=\"true\">·</span>\n <button type=\"button\" className=\"bodhan-agent-status__action\" aria-label={actionAriaLabel} onClick={onAction}>{action}</button>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;AAsBA,IAAM,SAA8B;CAAC;CAAY;CAAa;AAAS;AACvE,IAAM,QAA2C;CAC/C,UAAU;CAAa,WAAW;CAA0B,SAAS;CACrE,mBAAmB;CAA6B,MAAM;CAAQ,QAAQ;CAAmB,WAAW;CAAW,QAAQ;AACzH;AACA,IAAM,OAAmD;CACvD,mBAAmB;CAAW,MAAM;CAAgB,QAAQ;CAAS,WAAW;CAAe,QAAQ;AACzG;AACA,IAAM,SAA8B,CAAC,QAAQ,QAAQ;AACrD,IAAM,SAAqD;CACzD,UAAU;CAAQ,WAAW;CAAQ,SAAS;CAAQ,mBAAmB;CAAU,QAAQ;AAC7F;;;;;;;AAQA,SAAgB,YAAY,EAC1B,SAAS,YAAY,OAAO,aAAa,MAAM,aAAa,iBAAiB,UAAU,WAAW,GAAG,QAClF;CACnB,MAAM,SAAS,OAAO,SAAS,MAAM;CACrC,MAAM,SAAS,eAAe,OAAO;CACrC,MAAM,OAAO,SAAS,MAAM;CAC5B,OACE,qBAAC,OAAD;EACE,WAAW,CAAC,uBAAuB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACtE,eAAa;EACb,MAAK;EACL,aAAW,WAAW,WAAW,cAAc;EAC/C,aAAW,UAAU,KAAA;EACrB,GAAI;EANN,UAAA;GAQG,SACG,oBAAC,cAAD;IAAc,WAAU;IAA4B,OAAM;IAAG,eAAY;IAAO,MAAM,KAAA;GAAY,CAAA,IAClG,oBAAC,MAAD;IAAM,MAAM,KAAK;IAAU,QAAQ,OAAO,SAAS,MAAM;IAAG,WAAU;GAA6B,CAAA;GACvG,oBAAC,QAAD;IAAM,WAAU;IAA8B,UAAA;GAAW,CAAA;GACxD,cAAc,UACb,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IAAM,WAAU;IAA2B,eAAY;IAAO,UAAA;GAAO,CAAA,GACrE,oBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAA8B,cAAY;IAAiB,SAAS;IAAW,UAAA;GAAe,CAAA,CAC9H,EAAA,CAAA;EAED;;AAET"}
@@ -0,0 +1,41 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ import { type AgentStatusStatus } from '../AgentStatus/AgentStatus';
3
+ export type AgentTaskStatus = 'running' | 'waiting-for-you' | 'done' | 'failed';
4
+ export interface AgentTaskStep {
5
+ /** Step label in the learner's or teacher's words. */
6
+ label: string;
7
+ /** Agent Status of the row. */
8
+ status: AgentStatusStatus;
9
+ }
10
+ export interface AgentTaskProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
11
+ /** Figma `Title`. */
12
+ title?: ReactNode;
13
+ /** Figma `Subtitle`. */
14
+ subtitle?: ReactNode;
15
+ /** Figma `Status` — chooses the actions (and the default steps when `steps` is not set). */
16
+ status?: AgentTaskStatus;
17
+ /** Step rows (Agent Status rows). Defaults to the Figma example for the status. */
18
+ steps?: AgentTaskStep[];
19
+ /** Running → Stop. */
20
+ onStop?: () => void;
21
+ /** Waiting for You → Edit. */
22
+ onEdit?: () => void;
23
+ /** Waiting for You → Review and approve (opens the approval dialog). */
24
+ onApprove?: () => void;
25
+ /** Done → open the result. */
26
+ onOpen?: () => void;
27
+ /** Label of the Done action (default "Open quiz"). */
28
+ openLabel?: string;
29
+ /** Failed → Retry (the failed step only). */
30
+ onRetry?: () => void;
31
+ /** Failed → Cancel task. */
32
+ onCancel?: () => void;
33
+ /** Heading level of the title (default 3). */
34
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
35
+ }
36
+ /**
37
+ * Bodhan Agent Task — multi-step AI work the user started: a card of Agent Status rows with one primary action
38
+ * per state. Shared on Web, iOS and Android; card radius and nested Buttons follow the `06 Platform` mode.
39
+ * Android: Card + Column of status rows · iOS: GroupBox / card with a VStack of rows.
40
+ */
41
+ export declare function AgentTask({ title, subtitle, status, steps, onStop, onEdit, onApprove, onOpen, openLabel, onRetry, onCancel, headingLevel, className, ...rest }: AgentTaskProps): import("react").JSX.Element;
@@ -0,0 +1,159 @@
1
+ import { Icon } from "../Icon/Icon.js";
2
+ import { Button } from "../Button/Button.js";
3
+ import { AgentStatus } from "../AgentStatus/AgentStatus.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ // src/components/AgentTask/AgentTask.tsx
6
+ var STEPS = {
7
+ running: [
8
+ {
9
+ label: "Read Chapter 4",
10
+ status: "done"
11
+ },
12
+ {
13
+ label: "Picked 10 questions",
14
+ status: "done"
15
+ },
16
+ {
17
+ label: "Writing answer explanations…",
18
+ status: "working"
19
+ },
20
+ {
21
+ label: "Check difficulty",
22
+ status: "queued"
23
+ }
24
+ ],
25
+ "waiting-for-you": [
26
+ {
27
+ label: "Read Chapter 4",
28
+ status: "done"
29
+ },
30
+ {
31
+ label: "Picked 10 questions",
32
+ status: "done"
33
+ },
34
+ {
35
+ label: "Wrote explanations",
36
+ status: "done"
37
+ },
38
+ {
39
+ label: "Review before sharing",
40
+ status: "waiting-for-you"
41
+ }
42
+ ],
43
+ done: [
44
+ {
45
+ label: "Read Chapter 4",
46
+ status: "done"
47
+ },
48
+ {
49
+ label: "Picked 10 questions",
50
+ status: "done"
51
+ },
52
+ {
53
+ label: "Wrote explanations",
54
+ status: "done"
55
+ },
56
+ {
57
+ label: "Ready to share",
58
+ status: "done"
59
+ }
60
+ ],
61
+ failed: [
62
+ {
63
+ label: "Read Chapter 4",
64
+ status: "done"
65
+ },
66
+ {
67
+ label: "Picked 10 questions",
68
+ status: "done"
69
+ },
70
+ {
71
+ label: "Couldn't write explanations",
72
+ status: "failed"
73
+ },
74
+ {
75
+ label: "Check difficulty",
76
+ status: "queued"
77
+ }
78
+ ]
79
+ };
80
+ /**
81
+ * Bodhan Agent Task — multi-step AI work the user started: a card of Agent Status rows with one primary action
82
+ * per state. Shared on Web, iOS and Android; card radius and nested Buttons follow the `06 Platform` mode.
83
+ * Android: Card + Column of status rows · iOS: GroupBox / card with a VStack of rows.
84
+ */
85
+ function AgentTask({ title = "Preparing your quiz", subtitle = "Chapter 4 · Linear equations · 10 questions", status = "running", steps, onStop, onEdit, onApprove, onOpen, openLabel = "Open quiz", onRetry, onCancel, headingLevel = 3, className, ...rest }) {
86
+ const H = `h${headingLevel}`;
87
+ return /* @__PURE__ */ jsxs("section", {
88
+ className: ["bodhan-agent-task", className].filter(Boolean).join(" "),
89
+ "data-status": status,
90
+ "aria-busy": status === "running" || void 0,
91
+ ...rest,
92
+ children: [
93
+ /* @__PURE__ */ jsxs("div", {
94
+ className: "bodhan-agent-task__header",
95
+ children: [/* @__PURE__ */ jsx(Icon, {
96
+ name: "auto_awesome",
97
+ className: "bodhan-agent-task__icon"
98
+ }), /* @__PURE__ */ jsx(H, {
99
+ className: "bodhan-agent-task__title",
100
+ children: title
101
+ })]
102
+ }),
103
+ subtitle && /* @__PURE__ */ jsx("p", {
104
+ className: "bodhan-agent-task__subtitle",
105
+ children: subtitle
106
+ }),
107
+ /* @__PURE__ */ jsx("ol", {
108
+ className: "bodhan-agent-task__steps",
109
+ "aria-live": "polite",
110
+ children: (steps ?? STEPS[status]).map((s, i) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(AgentStatus, {
111
+ status: s.status,
112
+ label: s.label,
113
+ showAction: false,
114
+ role: void 0,
115
+ "aria-live": void 0
116
+ }) }, i))
117
+ }),
118
+ /* @__PURE__ */ jsxs("div", {
119
+ className: "bodhan-agent-task__actions",
120
+ children: [
121
+ status === "running" && /* @__PURE__ */ jsx(Button, {
122
+ size: "small",
123
+ variant: "secondary",
124
+ onClick: onStop,
125
+ children: "Stop"
126
+ }),
127
+ status === "waiting-for-you" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
128
+ size: "small",
129
+ variant: "secondary",
130
+ onClick: onEdit,
131
+ children: "Edit"
132
+ }), /* @__PURE__ */ jsx(Button, {
133
+ size: "small",
134
+ onClick: onApprove,
135
+ children: "Review and approve"
136
+ })] }),
137
+ status === "done" && /* @__PURE__ */ jsx(Button, {
138
+ size: "small",
139
+ onClick: onOpen,
140
+ children: openLabel
141
+ }),
142
+ status === "failed" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
143
+ size: "small",
144
+ variant: "tertiary",
145
+ onClick: onCancel,
146
+ children: "Cancel task"
147
+ }), /* @__PURE__ */ jsx(Button, {
148
+ size: "small",
149
+ onClick: onRetry,
150
+ children: "Retry"
151
+ })] })
152
+ ]
153
+ })
154
+ ]
155
+ });
156
+ }
157
+ export { AgentTask };
158
+
159
+ //# sourceMappingURL=AgentTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentTask.js","names":["_Fragment"],"sources":["../../../src/components/AgentTask/AgentTask.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport { Icon } from '../Icon/Icon';\nimport { Button } from '../Button/Button';\nimport { AgentStatus, type AgentStatusStatus } from '../AgentStatus/AgentStatus';\n\nexport type AgentTaskStatus = 'running' | 'waiting-for-you' | 'done' | 'failed';\n\nexport interface AgentTaskStep {\n /** Step label in the learner's or teacher's words. */\n label: string;\n /** Agent Status of the row. */\n status: AgentStatusStatus;\n}\n\nexport interface AgentTaskProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** Figma `Title`. */\n title?: ReactNode;\n /** Figma `Subtitle`. */\n subtitle?: ReactNode;\n /** Figma `Status` — chooses the actions (and the default steps when `steps` is not set). */\n status?: AgentTaskStatus;\n /** Step rows (Agent Status rows). Defaults to the Figma example for the status. */\n steps?: AgentTaskStep[];\n /** Running → Stop. */\n onStop?: () => void;\n /** Waiting for You → Edit. */\n onEdit?: () => void;\n /** Waiting for You → Review and approve (opens the approval dialog). */\n onApprove?: () => void;\n /** Done → open the result. */\n onOpen?: () => void;\n /** Label of the Done action (default \"Open quiz\"). */\n openLabel?: string;\n /** Failed → Retry (the failed step only). */\n onRetry?: () => void;\n /** Failed → Cancel task. */\n onCancel?: () => void;\n /** Heading level of the title (default 3). */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n}\n\nconst STEPS: Record<AgentTaskStatus, AgentTaskStep[]> = {\n running: [\n { label: 'Read Chapter 4', status: 'done' }, { label: 'Picked 10 questions', status: 'done' },\n { label: 'Writing answer explanations…', status: 'working' }, { label: 'Check difficulty', status: 'queued' },\n ],\n 'waiting-for-you': [\n { label: 'Read Chapter 4', status: 'done' }, { label: 'Picked 10 questions', status: 'done' },\n { label: 'Wrote explanations', status: 'done' }, { label: 'Review before sharing', status: 'waiting-for-you' },\n ],\n done: [\n { label: 'Read Chapter 4', status: 'done' }, { label: 'Picked 10 questions', status: 'done' },\n { label: 'Wrote explanations', status: 'done' }, { label: 'Ready to share', status: 'done' },\n ],\n failed: [\n { label: 'Read Chapter 4', status: 'done' }, { label: 'Picked 10 questions', status: 'done' },\n { label: \"Couldn't write explanations\", status: 'failed' }, { label: 'Check difficulty', status: 'queued' },\n ],\n};\n\n/**\n * Bodhan Agent Task — multi-step AI work the user started: a card of Agent Status rows with one primary action\n * per state. Shared on Web, iOS and Android; card radius and nested Buttons follow the `06 Platform` mode.\n * Android: Card + Column of status rows · iOS: GroupBox / card with a VStack of rows.\n */\nexport function AgentTask({\n title = 'Preparing your quiz', subtitle = 'Chapter 4 · Linear equations · 10 questions', status = 'running', steps,\n onStop, onEdit, onApprove, onOpen, openLabel = 'Open quiz', onRetry, onCancel, headingLevel = 3, className, ...rest\n}: AgentTaskProps) {\n const H = `h${headingLevel}` as 'h3';\n return (\n <section className={['bodhan-agent-task', className].filter(Boolean).join(' ')} data-status={status} aria-busy={status === 'running' || undefined} {...rest}>\n <div className=\"bodhan-agent-task__header\">\n <Icon name=\"auto_awesome\" className=\"bodhan-agent-task__icon\" />\n <H className=\"bodhan-agent-task__title\">{title}</H>\n </div>\n {subtitle && <p className=\"bodhan-agent-task__subtitle\">{subtitle}</p>}\n <ol className=\"bodhan-agent-task__steps\" aria-live=\"polite\">\n {(steps ?? STEPS[status]).map((s, i) => (\n <li key={i}><AgentStatus status={s.status} label={s.label} showAction={false} role={undefined} aria-live={undefined} /></li>\n ))}\n </ol>\n <div className=\"bodhan-agent-task__actions\">\n {status === 'running' && <Button size=\"small\" variant=\"secondary\" onClick={onStop}>Stop</Button>}\n {status === 'waiting-for-you' && <>\n <Button size=\"small\" variant=\"secondary\" onClick={onEdit}>Edit</Button>\n <Button size=\"small\" onClick={onApprove}>Review and approve</Button>\n </>}\n {status === 'done' && <Button size=\"small\" onClick={onOpen}>{openLabel}</Button>}\n {status === 'failed' && <>\n <Button size=\"small\" variant=\"tertiary\" onClick={onCancel}>Cancel task</Button>\n <Button size=\"small\" onClick={onRetry}>Retry</Button>\n </>}\n </div>\n </section>\n );\n}\n"],"mappings":";;;;;AAyCA,IAAM,QAAkD;CACtD,SAAS;EACP;GAAE,OAAO;GAAkB,QAAQ;EAAO;EAAG;GAAE,OAAO;GAAuB,QAAQ;EAAO;EAC5F;GAAE,OAAO;GAAgC,QAAQ;EAAU;EAAG;GAAE,OAAO;GAAoB,QAAQ;EAAS;CAC9G;CACA,mBAAmB;EACjB;GAAE,OAAO;GAAkB,QAAQ;EAAO;EAAG;GAAE,OAAO;GAAuB,QAAQ;EAAO;EAC5F;GAAE,OAAO;GAAsB,QAAQ;EAAO;EAAG;GAAE,OAAO;GAAyB,QAAQ;EAAkB;CAC/G;CACA,MAAM;EACJ;GAAE,OAAO;GAAkB,QAAQ;EAAO;EAAG;GAAE,OAAO;GAAuB,QAAQ;EAAO;EAC5F;GAAE,OAAO;GAAsB,QAAQ;EAAO;EAAG;GAAE,OAAO;GAAkB,QAAQ;EAAO;CAC7F;CACA,QAAQ;EACN;GAAE,OAAO;GAAkB,QAAQ;EAAO;EAAG;GAAE,OAAO;GAAuB,QAAQ;EAAO;EAC5F;GAAE,OAAO;GAA+B,QAAQ;EAAS;EAAG;GAAE,OAAO;GAAoB,QAAQ;EAAS;CAC5G;AACF;;;;;;AAOA,SAAgB,UAAU,EACxB,QAAQ,uBAAuB,WAAW,+CAA+C,SAAS,WAAW,OAC7G,QAAQ,QAAQ,WAAW,QAAQ,YAAY,aAAa,SAAS,UAAU,eAAe,GAAG,WAAW,GAAG,QAC9F;CACjB,MAAM,IAAI,IAAI;CACd,OACE,qBAAC,WAAD;EAAS,WAAW,CAAC,qBAAqB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAG,eAAa;EAAQ,aAAW,WAAW,aAAa,KAAA;EAAW,GAAI;EAAvJ,UAAA;GACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,MAAD;KAAM,MAAK;KAAe,WAAU;IAA2B,CAAA,GAC/D,oBAAC,GAAD;KAAG,WAAU;KAA4B,UAAA;IAAS,CAAA,CAC/C;;GACJ,YAAY,oBAAC,KAAD;IAAG,WAAU;IAA+B,UAAA;GAAY,CAAA;GACrE,oBAAC,MAAD;IAAI,WAAU;IAA2B,aAAU;IAC/C,WAAA,SAAS,MAAM,QAAA,CAAS,KAAK,GAAG,MAChC,oBAAC,MAAD,EAAA,UAAY,oBAAC,aAAD;KAAa,QAAQ,EAAE;KAAQ,OAAO,EAAE;KAAO,YAAY;KAAO,MAAM,KAAA;KAAW,aAAW,KAAA;IAAY,CAAA,EAAK,GAAlH,CAAkH,CAC5H;GACC,CAAA;GACJ,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACG,WAAW,aAAa,oBAAC,QAAD;MAAQ,MAAK;MAAQ,SAAQ;MAAY,SAAS;MAAQ,UAAA;KAAY,CAAA;KAC9F,WAAW,qBAAqB,qBAAAA,UAAA,EAAA,UAAA,CAC/B,oBAAC,QAAD;MAAQ,MAAK;MAAQ,SAAQ;MAAY,SAAS;MAAQ,UAAA;KAAY,CAAA,GACtE,oBAAC,QAAD;MAAQ,MAAK;MAAQ,SAAS;MAAW,UAAA;KAA0B,CAAA,CACnE,EAAA,CAAA;KACD,WAAW,UAAU,oBAAC,QAAD;MAAQ,MAAK;MAAQ,SAAS;MAAS,UAAA;KAAkB,CAAA;KAC9E,WAAW,YAAY,qBAAAA,UAAA,EAAA,UAAA,CACtB,oBAAC,QAAD;MAAQ,MAAK;MAAQ,SAAQ;MAAW,SAAS;MAAU,UAAA;KAAmB,CAAA,GAC9E,oBAAC,QAAD;MAAQ,MAAK;MAAQ,SAAS;MAAS,UAAA;KAAa,CAAA,CACpD,EAAA,CAAA;IACC;;EACE;;AAEb"}
@@ -0,0 +1,34 @@
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
+ export type AlertLayout = 'horizontal' | 'vertical';
3
+ export interface AlertAction {
4
+ label: ReactNode;
5
+ onClick?: () => void;
6
+ /** Button type of the confirming action. Use `destructive` only for destructive actions. Default `primary`. */
7
+ variant?: 'primary' | 'destructive';
8
+ }
9
+ export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
10
+ /** Alert title (announced first; labels the dialog). */
11
+ title: ReactNode;
12
+ /** Body text (describes the dialog). */
13
+ description?: ReactNode;
14
+ /** The confirming action (trailing in Horizontal, top in Vertical). */
15
+ action: AlertAction;
16
+ /** The cancel action (Button Type=Cancel). Also triggered by Esc. */
17
+ cancel?: {
18
+ label: ReactNode;
19
+ onClick?: () => void;
20
+ };
21
+ /** Figma `Layout`: two buttons side by side, or stacked (long labels, 3+ choices). */
22
+ layout?: AlertLayout;
23
+ /** Figma `Visibility`. Animates in (scale Motion/Scale/Enter → 1 + fade) and out (fade). Fade only with reduced motion. */
24
+ open?: boolean;
25
+ /** Set when the alert is shown as a real modal over a scrim (adds `aria-modal`). Inline previews leave it off. */
26
+ modal?: boolean;
27
+ }
28
+ /**
29
+ * Bodhan Alert: iOS-only alert dialog (`role="alertdialog"`, labelled by its title, described by its body) on a
30
+ * Liquid Glass surface. Always renders with the iOS `06 Platform` mode (radius 40, 50pt Large buttons, Mobile type),
31
+ * like the Figma set, which exists only as Platform=iOS. Web and Android use Modal / AlertDialog instead.
32
+ * Focus moves to the cancel button when it opens; Esc cancels. iOS (SwiftUI): .alert
33
+ */
34
+ export declare function Alert({ title, description, action, cancel, layout, open, modal, className, onKeyDown, ...rest }: AlertProps): import("react").JSX.Element;
@@ -0,0 +1,83 @@
1
+ import { Button } from "../Button/Button.js";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useId, useRef, useState } from "react";
4
+ // src/components/Alert/Alert.tsx
5
+ /**
6
+ * Bodhan Alert: iOS-only alert dialog (`role="alertdialog"`, labelled by its title, described by its body) on a
7
+ * Liquid Glass surface. Always renders with the iOS `06 Platform` mode (radius 40, 50pt Large buttons, Mobile type),
8
+ * like the Figma set, which exists only as Platform=iOS. Web and Android use Modal / AlertDialog instead.
9
+ * Focus moves to the cancel button when it opens; Esc cancels. iOS (SwiftUI): .alert
10
+ */
11
+ function Alert({ title, description, action, cancel, layout = "horizontal", open = true, modal, className, onKeyDown, ...rest }) {
12
+ const id = useId().replace(/:/g, "");
13
+ const actionsRef = useRef(null);
14
+ const [mounted, setMounted] = useState(open);
15
+ const [shown, setShown] = useState(open);
16
+ const wasOpen = useRef(open);
17
+ useEffect(() => {
18
+ if (open) {
19
+ setMounted(true);
20
+ const r = requestAnimationFrame(() => setShown(true));
21
+ if (!wasOpen.current) actionsRef.current?.querySelector(cancel ? "[data-variant=\"cancel\"]" : "button")?.focus();
22
+ wasOpen.current = true;
23
+ return () => cancelAnimationFrame(r);
24
+ }
25
+ wasOpen.current = false;
26
+ setShown(false);
27
+ }, [open]);
28
+ const cancelBtn = cancel && /* @__PURE__ */ jsx(Button, {
29
+ variant: "cancel",
30
+ size: "large",
31
+ className: "bodhan-alert__button",
32
+ onClick: cancel.onClick,
33
+ children: cancel.label
34
+ });
35
+ const actionBtn = /* @__PURE__ */ jsx(Button, {
36
+ variant: action.variant ?? "primary",
37
+ size: "large",
38
+ className: "bodhan-alert__button",
39
+ onClick: action.onClick,
40
+ children: action.label
41
+ });
42
+ return /* @__PURE__ */ jsxs("div", {
43
+ className: ["bodhan-alert", className].filter(Boolean).join(" "),
44
+ "data-platform": "ios",
45
+ "data-layout": layout,
46
+ "data-state": shown ? "open" : "closed",
47
+ role: "alertdialog",
48
+ "aria-modal": modal || void 0,
49
+ "aria-labelledby": `${id}-title`,
50
+ "aria-describedby": description ? `${id}-desc` : void 0,
51
+ hidden: !mounted && !open,
52
+ onTransitionEnd: (e) => {
53
+ if (e.target === e.currentTarget && !open) setMounted(false);
54
+ },
55
+ onKeyDown: (e) => {
56
+ if (e.key === "Escape" && cancel) {
57
+ e.stopPropagation();
58
+ cancel.onClick?.();
59
+ }
60
+ onKeyDown?.(e);
61
+ },
62
+ ...rest,
63
+ children: [/* @__PURE__ */ jsxs("div", {
64
+ className: "bodhan-alert__text",
65
+ children: [/* @__PURE__ */ jsx("h2", {
66
+ id: `${id}-title`,
67
+ className: "bodhan-alert__title",
68
+ children: title
69
+ }), description && /* @__PURE__ */ jsx("p", {
70
+ id: `${id}-desc`,
71
+ className: "bodhan-alert__description",
72
+ children: description
73
+ })]
74
+ }), /* @__PURE__ */ jsx("div", {
75
+ className: "bodhan-alert__actions",
76
+ ref: actionsRef,
77
+ children: layout === "horizontal" ? /* @__PURE__ */ jsxs(Fragment, { children: [cancelBtn, actionBtn] }) : /* @__PURE__ */ jsxs(Fragment, { children: [actionBtn, cancelBtn] })
78
+ })]
79
+ });
80
+ }
81
+ export { Alert };
82
+
83
+ //# sourceMappingURL=Alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Alert.js","names":["_Fragment"],"sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import { useEffect, useId, useRef, useState, type HTMLAttributes, type KeyboardEvent, type ReactNode } from 'react';\nimport { Button } from '../Button/Button';\n\nexport type AlertLayout = 'horizontal' | 'vertical';\n\nexport interface AlertAction {\n label: ReactNode;\n onClick?: () => void;\n /** Button type of the confirming action. Use `destructive` only for destructive actions. Default `primary`. */\n variant?: 'primary' | 'destructive';\n}\n\nexport interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Alert title (announced first; labels the dialog). */\n title: ReactNode;\n /** Body text (describes the dialog). */\n description?: ReactNode;\n /** The confirming action (trailing in Horizontal, top in Vertical). */\n action: AlertAction;\n /** The cancel action (Button Type=Cancel). Also triggered by Esc. */\n cancel?: { label: ReactNode; onClick?: () => void };\n /** Figma `Layout`: two buttons side by side, or stacked (long labels, 3+ choices). */\n layout?: AlertLayout;\n /** Figma `Visibility`. Animates in (scale Motion/Scale/Enter → 1 + fade) and out (fade). Fade only with reduced motion. */\n open?: boolean;\n /** Set when the alert is shown as a real modal over a scrim (adds `aria-modal`). Inline previews leave it off. */\n modal?: boolean;\n}\n\n/**\n * Bodhan Alert: iOS-only alert dialog (`role=\"alertdialog\"`, labelled by its title, described by its body) on a\n * Liquid Glass surface. Always renders with the iOS `06 Platform` mode (radius 40, 50pt Large buttons, Mobile type),\n * like the Figma set, which exists only as Platform=iOS. Web and Android use Modal / AlertDialog instead.\n * Focus moves to the cancel button when it opens; Esc cancels. iOS (SwiftUI): .alert\n */\nexport function Alert({\n title, description, action, cancel, layout = 'horizontal', open = true, modal, className, onKeyDown, ...rest\n}: AlertProps) {\n const id = useId().replace(/:/g, '');\n const actionsRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(open);\n const [shown, setShown] = useState(open);\n const wasOpen = useRef(open);\n useEffect(() => {\n if (open) {\n setMounted(true);\n const r = requestAnimationFrame(() => setShown(true));\n // move focus in only when it opens after mount (not on first render of an inline preview)\n if (!wasOpen.current) actionsRef.current?.querySelector<HTMLButtonElement>(cancel ? '[data-variant=\"cancel\"]' : 'button')?.focus();\n wasOpen.current = true;\n return () => cancelAnimationFrame(r);\n }\n wasOpen.current = false;\n setShown(false);\n }, [open]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const cancelBtn = cancel && (\n <Button variant=\"cancel\" size=\"large\" className=\"bodhan-alert__button\" onClick={cancel.onClick}>{cancel.label}</Button>\n );\n const actionBtn = (\n <Button variant={action.variant ?? 'primary'} size=\"large\" className=\"bodhan-alert__button\" onClick={action.onClick}>{action.label}</Button>\n );\n return (\n <div\n className={['bodhan-alert', className].filter(Boolean).join(' ')}\n data-platform=\"ios\" data-layout={layout} data-state={shown ? 'open' : 'closed'}\n role=\"alertdialog\" aria-modal={modal || undefined} aria-labelledby={`${id}-title`}\n aria-describedby={description ? `${id}-desc` : undefined} hidden={!mounted && !open}\n onTransitionEnd={(e) => { if (e.target === e.currentTarget && !open) setMounted(false); }}\n onKeyDown={(e: KeyboardEvent<HTMLDivElement>) => { if (e.key === 'Escape' && cancel) { e.stopPropagation(); cancel.onClick?.(); } onKeyDown?.(e); }}\n {...rest}\n >\n <div className=\"bodhan-alert__text\">\n <h2 id={`${id}-title`} className=\"bodhan-alert__title\">{title}</h2>\n {description && <p id={`${id}-desc`} className=\"bodhan-alert__description\">{description}</p>}\n </div>\n <div className=\"bodhan-alert__actions\" ref={actionsRef}>\n {layout === 'horizontal' ? <>{cancelBtn}{actionBtn}</> : <>{actionBtn}{cancelBtn}</>}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAmCA,SAAgB,MAAM,EACpB,OAAO,aAAa,QAAQ,QAAQ,SAAS,cAAc,OAAO,MAAM,OAAO,WAAW,WAAW,GAAG,QAC3F;CACb,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ,MAAM,EAAE;CACnC,MAAM,aAAa,OAAuB,IAAI;CAC9C,MAAM,CAAC,SAAS,cAAc,SAAS,IAAI;CAC3C,MAAM,CAAC,OAAO,YAAY,SAAS,IAAI;CACvC,MAAM,UAAU,OAAO,IAAI;CAC3B,gBAAgB;EACd,IAAI,MAAM;GACR,WAAW,IAAI;GACf,MAAM,IAAI,4BAA4B,SAAS,IAAI,CAAC;GAEpD,IAAI,CAAC,QAAQ,SAAS,WAAW,SAAS,cAAiC,SAAS,8BAA4B,QAAQ,CAAC,EAAE,MAAM;GACjI,QAAQ,UAAU;GAClB,aAAa,qBAAqB,CAAC;EACrC;EACA,QAAQ,UAAU;EAClB,SAAS,KAAK;CAChB,GAAG,CAAC,IAAI,CAAC;CAET,MAAM,YAAY,UAChB,oBAAC,QAAD;EAAQ,SAAQ;EAAS,MAAK;EAAQ,WAAU;EAAuB,SAAS,OAAO;EAAU,UAAA,OAAO;CAAc,CAAA;CAExH,MAAM,YACJ,oBAAC,QAAD;EAAQ,SAAS,OAAO,WAAW;EAAW,MAAK;EAAQ,WAAU;EAAuB,SAAS,OAAO;EAAU,UAAA,OAAO;CAAc,CAAA;CAE7I,OACE,qBAAC,OAAD;EACE,WAAW,CAAC,gBAAgB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC/D,iBAAc;EAAM,eAAa;EAAQ,cAAY,QAAQ,SAAS;EACtE,MAAK;EAAc,cAAY,SAAS,KAAA;EAAW,mBAAiB,GAAG,GAAG;EAC1E,oBAAkB,cAAc,GAAG,GAAG,SAAS,KAAA;EAAW,QAAQ,CAAC,WAAW,CAAC;EAC/E,kBAAkB,MAAM;GAAE,IAAI,EAAE,WAAW,EAAE,iBAAiB,CAAC,MAAM,WAAW,KAAK;EAAG;EACxF,YAAY,MAAqC;GAAE,IAAI,EAAE,QAAQ,YAAY,QAAQ;IAAE,EAAE,gBAAgB;IAAG,OAAO,UAAU;GAAG;GAAE,YAAY,CAAC;EAAG;EAClJ,GAAI;EAPN,UAAA,CASE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,MAAD;IAAI,IAAI,GAAG,GAAG;IAAS,WAAU;IAAuB,UAAA;GAAU,CAAA,GACjE,eAAe,oBAAC,KAAD;IAAG,IAAI,GAAG,GAAG;IAAQ,WAAU;IAA6B,UAAA;GAAe,CAAA,CACxF;EACL,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAU;GAAwB,KAAK;GACzC,UAAA,WAAW,eAAe,qBAAAA,UAAA,EAAA,UAAA,CAAG,WAAW,SAAY,EAAA,CAAA,IAAI,qBAAAA,UAAA,EAAA,UAAA,CAAG,WAAW,SAAY,EAAA,CAAA;EAChF,CAAA,CACF;;AAET"}
@@ -0,0 +1,26 @@
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ export type AnswerOptionType = 'single' | 'multiple';
3
+ export type AnswerOptionResult = 'correct' | 'incorrect';
4
+ export interface AnswerOptionProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children'> {
5
+ /** Figma `Label` — the answer text. */
6
+ label?: ReactNode;
7
+ /** Figma `Key` (A, B, C…). Shown when set (`Show Key`). Named `optionKey` because `key` is reserved in React. */
8
+ optionKey?: ReactNode;
9
+ /** Figma `Type`: Single → radio semantics (give options the same `name`), Multiple → checkbox. */
10
+ type?: AnswerOptionType;
11
+ /**
12
+ * Figma `State=Correct|Incorrect` after Submit: colours + icon, and the option is announced as "Correct" / "Incorrect".
13
+ * Mark the chosen one and the right answer; set the others `disabled`.
14
+ */
15
+ result?: AnswerOptionResult;
16
+ /** Force a visual state for documentation (`State=Hover|Focus|Pressed`). Leave unset in product code. */
17
+ forceState?: 'hover' | 'focus' | 'pressed';
18
+ }
19
+ /**
20
+ * Bodhan Answer Option — a selectable answer card. The whole card is a `<label>` around a native
21
+ * `<input type="radio|checkbox">`, so click, Space and arrow keys (radio group) work natively.
22
+ * Put options in a `role="radiogroup"` / `role="group"` labelled by the question (Question does this).
23
+ * Shared on every platform (min height 56 ≥ 48 dp / 44 pt). Android: Row(selectable) + RadioButton/Checkbox ·
24
+ * iOS: Button rows with .accessibilityAddTraits(.isSelected).
25
+ */
26
+ export declare function AnswerOption({ label, optionKey, type, result, forceState, disabled, className, style, ...rest }: AnswerOptionProps): import("react").JSX.Element;
@@ -0,0 +1,57 @@
1
+ import { Icon } from "../Icon/Icon.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ // src/components/AnswerOption/AnswerOption.tsx
4
+ /**
5
+ * Bodhan Answer Option — a selectable answer card. The whole card is a `<label>` around a native
6
+ * `<input type="radio|checkbox">`, so click, Space and arrow keys (radio group) work natively.
7
+ * Put options in a `role="radiogroup"` / `role="group"` labelled by the question (Question does this).
8
+ * Shared on every platform (min height 56 ≥ 48 dp / 44 pt). Android: Row(selectable) + RadioButton/Checkbox ·
9
+ * iOS: Button rows with .accessibilityAddTraits(.isSelected).
10
+ */
11
+ function AnswerOption({ label = "x = 5", optionKey = "A", type = "single", result, forceState, disabled, className, style, ...rest }) {
12
+ return /* @__PURE__ */ jsxs("label", {
13
+ className: ["bodhan-answer-option", className].filter(Boolean).join(" "),
14
+ "data-type": type,
15
+ "data-result": result,
16
+ "data-state": forceState,
17
+ "data-disabled": disabled || void 0,
18
+ style,
19
+ children: [
20
+ /* @__PURE__ */ jsx("input", {
21
+ className: "bodhan-answer-option__input",
22
+ type: type === "multiple" ? "checkbox" : "radio",
23
+ disabled,
24
+ ...rest
25
+ }),
26
+ /* @__PURE__ */ jsx("span", {
27
+ className: "bodhan-answer-option__indicator",
28
+ "aria-hidden": "true",
29
+ children: type === "multiple" ? /* @__PURE__ */ jsx(Icon, {
30
+ name: "check",
31
+ className: "bodhan-answer-option__check"
32
+ }) : /* @__PURE__ */ jsx("span", { className: "bodhan-answer-option__dot" })
33
+ }),
34
+ optionKey !== void 0 && optionKey !== null && optionKey !== "" && /* @__PURE__ */ jsx("span", {
35
+ className: "bodhan-answer-option__key",
36
+ children: optionKey
37
+ }),
38
+ /* @__PURE__ */ jsx("span", {
39
+ className: "bodhan-answer-option__label",
40
+ children: label
41
+ }),
42
+ result && /* @__PURE__ */ jsxs("span", {
43
+ className: "bodhan-answer-option__result",
44
+ children: [/* @__PURE__ */ jsx(Icon, {
45
+ name: result === "correct" ? "check_circle" : "cancel",
46
+ filled: result === "correct"
47
+ }), /* @__PURE__ */ jsx("span", {
48
+ className: "bodhan-answer-option__sr",
49
+ children: result === "correct" ? "Correct" : "Incorrect"
50
+ })]
51
+ })
52
+ ]
53
+ });
54
+ }
55
+ export { AnswerOption };
56
+
57
+ //# sourceMappingURL=AnswerOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnswerOption.js","names":[],"sources":["../../../src/components/AnswerOption/AnswerOption.tsx"],"sourcesContent":["import type { InputHTMLAttributes, ReactNode } from 'react';\nimport { Icon } from '../Icon/Icon';\n\nexport type AnswerOptionType = 'single' | 'multiple';\nexport type AnswerOptionResult = 'correct' | 'incorrect';\n\nexport interface AnswerOptionProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children'> {\n /** Figma `Label` — the answer text. */\n label?: ReactNode;\n /** Figma `Key` (A, B, C…). Shown when set (`Show Key`). Named `optionKey` because `key` is reserved in React. */\n optionKey?: ReactNode;\n /** Figma `Type`: Single → radio semantics (give options the same `name`), Multiple → checkbox. */\n type?: AnswerOptionType;\n /**\n * Figma `State=Correct|Incorrect` after Submit: colours + icon, and the option is announced as \"Correct\" / \"Incorrect\".\n * Mark the chosen one and the right answer; set the others `disabled`.\n */\n result?: AnswerOptionResult;\n /** Force a visual state for documentation (`State=Hover|Focus|Pressed`). Leave unset in product code. */\n forceState?: 'hover' | 'focus' | 'pressed';\n}\n\n/**\n * Bodhan Answer Option — a selectable answer card. The whole card is a `<label>` around a native\n * `<input type=\"radio|checkbox\">`, so click, Space and arrow keys (radio group) work natively.\n * Put options in a `role=\"radiogroup\"` / `role=\"group\"` labelled by the question (Question does this).\n * Shared on every platform (min height 56 ≥ 48 dp / 44 pt). Android: Row(selectable) + RadioButton/Checkbox ·\n * iOS: Button rows with .accessibilityAddTraits(.isSelected).\n */\nexport function AnswerOption({\n label = 'x = 5', optionKey = 'A', type = 'single', result, forceState, disabled, className, style, ...rest\n}: AnswerOptionProps) {\n return (\n <label\n className={['bodhan-answer-option', className].filter(Boolean).join(' ')}\n data-type={type}\n data-result={result}\n data-state={forceState}\n data-disabled={disabled || undefined}\n style={style}\n >\n <input\n className=\"bodhan-answer-option__input\"\n type={type === 'multiple' ? 'checkbox' : 'radio'}\n disabled={disabled}\n {...rest}\n />\n <span className=\"bodhan-answer-option__indicator\" aria-hidden=\"true\">\n {type === 'multiple' ? <Icon name=\"check\" className=\"bodhan-answer-option__check\" /> : <span className=\"bodhan-answer-option__dot\" />}\n </span>\n {optionKey !== undefined && optionKey !== null && optionKey !== '' && <span className=\"bodhan-answer-option__key\">{optionKey}</span>}\n <span className=\"bodhan-answer-option__label\">{label}</span>\n {result && (\n <span className=\"bodhan-answer-option__result\">\n <Icon name={result === 'correct' ? 'check_circle' : 'cancel'} filled={result === 'correct'} />\n <span className=\"bodhan-answer-option__sr\">{result === 'correct' ? 'Correct' : 'Incorrect'}</span>\n </span>\n )}\n </label>\n );\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAgB,aAAa,EAC3B,QAAQ,SAAS,YAAY,KAAK,OAAO,UAAU,QAAQ,YAAY,UAAU,WAAW,OAAO,GAAG,QAClF;CACpB,OACE,qBAAC,SAAD;EACE,WAAW,CAAC,wBAAwB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACvE,aAAW;EACX,eAAa;EACb,cAAY;EACZ,iBAAe,YAAY,KAAA;EACpB;EANT,UAAA;GAQE,oBAAC,SAAD;IACE,WAAU;IACV,MAAM,SAAS,aAAa,aAAa;IAC/B;IACV,GAAI;GACL,CAAA;GACD,oBAAC,QAAD;IAAM,WAAU;IAAkC,eAAY;IAC3D,UAAA,SAAS,aAAa,oBAAC,MAAD;KAAM,MAAK;KAAQ,WAAU;IAA+B,CAAA,IAAI,oBAAC,QAAD,EAAM,WAAU,4BAA6B,CAAA;GAChI,CAAA;GACL,cAAc,KAAA,KAAa,cAAc,QAAQ,cAAc,MAAM,oBAAC,QAAD;IAAM,WAAU;IAA6B,UAAA;GAAgB,CAAA;GACnI,oBAAC,QAAD;IAAM,WAAU;IAA+B,UAAA;GAAY,CAAA;GAC1D,UACC,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,oBAAC,MAAD;KAAM,MAAM,WAAW,YAAY,iBAAiB;KAAU,QAAQ,WAAW;IAAY,CAAA,GAC7F,oBAAC,QAAD;KAAM,WAAU;KAA4B,UAAA,WAAW,YAAY,YAAY;IAAkB,CAAA,CAC7F;;EAEH;;AAEX"}
@@ -0,0 +1,39 @@
1
+ import { type HTMLAttributes, type RefObject } from 'react';
2
+ export declare const formatTime: (s: number) => string;
3
+ /**
4
+ * Shared media state (Audio / Video Player). With a `src`, it drives and follows the real media element
5
+ * (play, pause, timeupdate, rate). Without one (docs, previews) it runs a clock so the UI still works.
6
+ */
7
+ export declare function useMediaPlayer(ref: RefObject<HTMLMediaElement | null>, { src, duration: d0, defaultTime, playing: forced, speed }: {
8
+ src?: string;
9
+ duration?: number;
10
+ defaultTime?: number;
11
+ playing?: boolean;
12
+ speed?: number;
13
+ }): {
14
+ playing: boolean;
15
+ time: number;
16
+ duration: number;
17
+ toggle: () => void;
18
+ seek: (t: number) => void;
19
+ };
20
+ export interface AudioPlayerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
21
+ /** Figma `Title`. Also names the play button and scrubber. */
22
+ title?: string;
23
+ /** Audio source. Without it the player runs a silent clock (previews). */
24
+ src?: string;
25
+ /** Duration in seconds when there is no `src` (default 6:12). */
26
+ duration?: number;
27
+ /** Start position in seconds. */
28
+ defaultTime?: number;
29
+ /** Figma `State` for docs: force Playing / Paused (leave unset for real interaction). */
30
+ playing?: boolean;
31
+ /** Initial speed (0.75 · 1 · 1.25 · 1.5). */
32
+ defaultSpeed?: number;
33
+ }
34
+ /**
35
+ * Bodhan Audio Player — lesson audio, read-aloud and voice notes: play/pause (44 px), title, scrubber (a native range
36
+ * input: ←/→ seek 5 s, value read as time), elapsed / total, speed (0.75× – 1.5×). Card surface and radius from 06 Platform.
37
+ * Android: Media3 ExoPlayer + MediaSession · iOS: AVPlayer + MPNowPlayingInfoCenter · Web: <audio> + these controls.
38
+ */
39
+ export declare function AudioPlayer({ title, src, duration, defaultTime, playing: forced, defaultSpeed, className, ...rest }: AudioPlayerProps): import("react").JSX.Element;