@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.
- package/LICENSE +5 -0
- package/README.md +73 -2
- package/dist/components/Accordion/Accordion.d.ts +56 -0
- package/dist/components/Accordion/Accordion.js +91 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Account/Account.d.ts +20 -0
- package/dist/components/Account/Account.js +39 -0
- package/dist/components/Account/Account.js.map +1 -0
- package/dist/components/ActionSheet/ActionSheet.d.ts +36 -0
- package/dist/components/ActionSheet/ActionSheet.js +93 -0
- package/dist/components/ActionSheet/ActionSheet.js.map +1 -0
- package/dist/components/ActivityPill/ActivityPill.d.ts +27 -0
- package/dist/components/ActivityPill/ActivityPill.js +75 -0
- package/dist/components/ActivityPill/ActivityPill.js.map +1 -0
- package/dist/components/AgentStatus/AgentStatus.d.ts +23 -0
- package/dist/components/AgentStatus/AgentStatus.js +83 -0
- package/dist/components/AgentStatus/AgentStatus.js.map +1 -0
- package/dist/components/AgentTask/AgentTask.d.ts +41 -0
- package/dist/components/AgentTask/AgentTask.js +159 -0
- package/dist/components/AgentTask/AgentTask.js.map +1 -0
- package/dist/components/Alert/Alert.d.ts +34 -0
- package/dist/components/Alert/Alert.js +83 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/AnswerOption/AnswerOption.d.ts +26 -0
- package/dist/components/AnswerOption/AnswerOption.js +57 -0
- package/dist/components/AnswerOption/AnswerOption.js.map +1 -0
- package/dist/components/AudioPlayer/AudioPlayer.d.ts +39 -0
- package/dist/components/AudioPlayer/AudioPlayer.js +172 -0
- package/dist/components/AudioPlayer/AudioPlayer.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +34 -0
- package/dist/components/Avatar/Avatar.js +133 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +24 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +40 -0
- package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +22 -0
- package/dist/components/Badge/Badge.js +23 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Banner/Banner.d.ts +36 -0
- package/dist/components/Banner/Banner.js +81 -0
- package/dist/components/Banner/Banner.js.map +1 -0
- package/dist/components/BarChart/BarChart.d.ts +42 -0
- package/dist/components/BarChart/BarChart.js +221 -0
- package/dist/components/BarChart/BarChart.js.map +1 -0
- package/dist/components/BodhanLogo/BodhanLogo.d.ts +17 -0
- package/dist/components/BodhanLogo/BodhanLogo.js +32 -0
- package/dist/components/BodhanLogo/BodhanLogo.js.map +1 -0
- package/dist/components/BodhanLogo/logos.d.ts +5 -0
- package/dist/components/BodhanLogo/logos.js +31 -0
- package/dist/components/BodhanLogo/logos.js.map +1 -0
- package/dist/components/BottomAppBar/BottomAppBar.d.ts +33 -0
- package/dist/components/BottomAppBar/BottomAppBar.js +86 -0
- package/dist/components/BottomAppBar/BottomAppBar.js.map +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +66 -0
- package/dist/components/BottomSheet/BottomSheet.js +165 -0
- package/dist/components/BottomSheet/BottomSheet.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +47 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +102 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Button/Button.d.ts +30 -0
- package/dist/components/Button/Button.js +40 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +34 -0
- package/dist/components/ButtonGroup/ButtonGroup.js +47 -0
- package/dist/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/components/Calendar/Calendar.d.ts +111 -0
- package/dist/components/Calendar/Calendar.js +338 -0
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/CameraCapture/CameraCapture.d.ts +22 -0
- package/dist/components/CameraCapture/CameraCapture.js +155 -0
- package/dist/components/CameraCapture/CameraCapture.js.map +1 -0
- package/dist/components/Card/Card.d.ts +50 -0
- package/dist/components/Card/Card.js +120 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Carousel/Carousel.d.ts +51 -0
- package/dist/components/Carousel/Carousel.js +152 -0
- package/dist/components/Carousel/Carousel.js.map +1 -0
- package/dist/components/Celebration/Celebration.d.ts +23 -0
- package/dist/components/Celebration/Celebration.js +93 -0
- package/dist/components/Celebration/Celebration.js.map +1 -0
- package/dist/components/ChartStatus/ChartStatus.d.ts +54 -0
- package/dist/components/ChartStatus/ChartStatus.js +144 -0
- package/dist/components/ChartStatus/ChartStatus.js.map +1 -0
- package/dist/components/ChatArtifact/ChatArtifact.d.ts +23 -0
- package/dist/components/ChatArtifact/ChatArtifact.js +91 -0
- package/dist/components/ChatArtifact/ChatArtifact.js.map +1 -0
- package/dist/components/ChatBubble/ChatBubble.d.ts +26 -0
- package/dist/components/ChatBubble/ChatBubble.js +57 -0
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -0
- package/dist/components/ChatContent/ChatContent.d.ts +23 -0
- package/dist/components/ChatContent/ChatContent.js +333 -0
- package/dist/components/ChatContent/ChatContent.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +29 -0
- package/dist/components/Checkbox/Checkbox.js +58 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Chip/Chip.d.ts +28 -0
- package/dist/components/Chip/Chip.js +48 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/CircularLoader/CircularLoader.d.ts +12 -0
- package/dist/components/CircularLoader/CircularLoader.js +36 -0
- package/dist/components/CircularLoader/CircularLoader.js.map +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.d.ts +14 -0
- package/dist/components/ColorSwatch/ColorSwatch.js +30 -0
- package/dist/components/ColorSwatch/ColorSwatch.js.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +40 -0
- package/dist/components/Combobox/Combobox.js +167 -0
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +48 -0
- package/dist/components/CommandPalette/CommandPalette.js +235 -0
- package/dist/components/CommandPalette/CommandPalette.js.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +31 -0
- package/dist/components/ContextMenu/ContextMenu.js +138 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/components/DateField/DateField.d.ts +28 -0
- package/dist/components/DateField/DateField.js +134 -0
- package/dist/components/DateField/DateField.js.map +1 -0
- package/dist/components/DigitField/DigitField.d.ts +16 -0
- package/dist/components/DigitField/DigitField.js +27 -0
- package/dist/components/DigitField/DigitField.js.map +1 -0
- package/dist/components/Divider/Divider.d.ts +19 -0
- package/dist/components/Divider/Divider.js +22 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/DottedLoader/DottedLoader.d.ts +15 -0
- package/dist/components/DottedLoader/DottedLoader.js +36 -0
- package/dist/components/DottedLoader/DottedLoader.js.map +1 -0
- package/dist/components/DoughnutChart/DoughnutChart.d.ts +16 -0
- package/dist/components/DoughnutChart/DoughnutChart.js +31 -0
- package/dist/components/DoughnutChart/DoughnutChart.js.map +1 -0
- package/dist/components/Drawer/Drawer.d.ts +39 -0
- package/dist/components/Drawer/Drawer.js +109 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +79 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +262 -0
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
- package/dist/components/DropdownMenuCheckbox/DropdownMenuCheckbox.d.ts +46 -0
- package/dist/components/DropdownMenuCheckbox/DropdownMenuCheckbox.js +75 -0
- package/dist/components/DropdownMenuCheckbox/DropdownMenuCheckbox.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +34 -0
- package/dist/components/EmptyState/EmptyState.js +53 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/FAB/FAB.d.ts +19 -0
- package/dist/components/FAB/FAB.js +27 -0
- package/dist/components/FAB/FAB.js.map +1 -0
- package/dist/components/FABMenu/FABMenu.d.ts +25 -0
- package/dist/components/FABMenu/FABMenu.js +95 -0
- package/dist/components/FABMenu/FABMenu.js.map +1 -0
- package/dist/components/FeedbackReasons/FeedbackReasons.d.ts +19 -0
- package/dist/components/FeedbackReasons/FeedbackReasons.js +62 -0
- package/dist/components/FeedbackReasons/FeedbackReasons.js.map +1 -0
- package/dist/components/FileUpload/FileUpload.d.ts +88 -0
- package/dist/components/FileUpload/FileUpload.js +199 -0
- package/dist/components/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/FlashcardStack/FlashcardStack.d.ts +37 -0
- package/dist/components/FlashcardStack/FlashcardStack.js +237 -0
- package/dist/components/FlashcardStack/FlashcardStack.js.map +1 -0
- package/dist/components/HandoffCard/HandoffCard.d.ts +25 -0
- package/dist/components/HandoffCard/HandoffCard.js +80 -0
- package/dist/components/HandoffCard/HandoffCard.js.map +1 -0
- package/dist/components/HomeIndicator/HomeIndicator.d.ts +12 -0
- package/dist/components/HomeIndicator/HomeIndicator.js +20 -0
- package/dist/components/HomeIndicator/HomeIndicator.js.map +1 -0
- package/dist/components/Icon/Icon.d.ts +15 -0
- package/dist/components/Icon/Icon.js +24 -0
- package/dist/components/Icon/Icon.js.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts +29 -0
- package/dist/components/IconButton/IconButton.js +33 -0
- package/dist/components/IconButton/IconButton.js.map +1 -0
- package/dist/components/Illustration/Illustration.d.ts +22 -0
- package/dist/components/Illustration/Illustration.js +37 -0
- package/dist/components/Illustration/Illustration.js.map +1 -0
- package/dist/components/Illustration/illustrations.d.ts +5 -0
- package/dist/components/Illustration/illustrations.js +266 -0
- package/dist/components/Illustration/illustrations.js.map +1 -0
- package/dist/components/ImageViewer/ImageViewer.d.ts +31 -0
- package/dist/components/ImageViewer/ImageViewer.js +132 -0
- package/dist/components/ImageViewer/ImageViewer.js.map +1 -0
- package/dist/components/InkPad/InkPad.d.ts +27 -0
- package/dist/components/InkPad/InkPad.js +205 -0
- package/dist/components/InkPad/InkPad.js.map +1 -0
- package/dist/components/Input/Input.d.ts +42 -0
- package/dist/components/Input/Input.js +104 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/LearningCard/LearningCard.d.ts +32 -0
- package/dist/components/LearningCard/LearningCard.js +116 -0
- package/dist/components/LearningCard/LearningCard.js.map +1 -0
- package/dist/components/Legend/Legend.d.ts +30 -0
- package/dist/components/Legend/Legend.js +48 -0
- package/dist/components/Legend/Legend.js.map +1 -0
- package/dist/components/LineChart/LineChart.d.ts +33 -0
- package/dist/components/LineChart/LineChart.js +139 -0
- package/dist/components/LineChart/LineChart.js.map +1 -0
- package/dist/components/Link/Link.d.ts +16 -0
- package/dist/components/Link/Link.js +30 -0
- package/dist/components/Link/Link.js.map +1 -0
- package/dist/components/ListGroup/ListGroup.d.ts +18 -0
- package/dist/components/ListGroup/ListGroup.js +42 -0
- package/dist/components/ListGroup/ListGroup.js.map +1 -0
- package/dist/components/ListItem/ListItem.d.ts +40 -0
- package/dist/components/ListItem/ListItem.js +132 -0
- package/dist/components/ListItem/ListItem.js.map +1 -0
- package/dist/components/MascotBodhanBird/MascotBodhanBird.d.ts +14 -0
- package/dist/components/MascotBodhanBird/MascotBodhanBird.js +124 -0
- package/dist/components/MascotBodhanBird/MascotBodhanBird.js.map +1 -0
- package/dist/components/Message/Message.d.ts +15 -0
- package/dist/components/Message/Message.js +52 -0
- package/dist/components/Message/Message.js.map +1 -0
- package/dist/components/Modal/Modal.d.ts +54 -0
- package/dist/components/Modal/Modal.js +152 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +62 -0
- package/dist/components/MultiSelect/MultiSelect.js +282 -0
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +35 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.js +107 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.js.map +1 -0
- package/dist/components/NavigationItem/NavigationItem.d.ts +16 -0
- package/dist/components/NavigationItem/NavigationItem.js +34 -0
- package/dist/components/NavigationItem/NavigationItem.js.map +1 -0
- package/dist/components/NavigationRail/NavigationRail.d.ts +39 -0
- package/dist/components/NavigationRail/NavigationRail.js +100 -0
- package/dist/components/NavigationRail/NavigationRail.js.map +1 -0
- package/dist/components/NumberStepper/NumberStepper.d.ts +23 -0
- package/dist/components/NumberStepper/NumberStepper.js +84 -0
- package/dist/components/NumberStepper/NumberStepper.js.map +1 -0
- package/dist/components/OTPInput/OTPInput.d.ts +42 -0
- package/dist/components/OTPInput/OTPInput.js +122 -0
- package/dist/components/OTPInput/OTPInput.js.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +50 -0
- package/dist/components/Pagination/Pagination.js +122 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/PermissionSheet/PermissionSheet.d.ts +31 -0
- package/dist/components/PermissionSheet/PermissionSheet.js +113 -0
- package/dist/components/PermissionSheet/PermissionSheet.js.map +1 -0
- package/dist/components/PieChart/PieChart.d.ts +9 -0
- package/dist/components/PieChart/PieChart.js +19 -0
- package/dist/components/PieChart/PieChart.js.map +1 -0
- package/dist/components/PieChart/PieCore.d.ts +35 -0
- package/dist/components/PieChart/PieCore.js +128 -0
- package/dist/components/PieChart/PieCore.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +94 -0
- package/dist/components/Popover/Popover.js +324 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Progress/Progress.d.ts +27 -0
- package/dist/components/Progress/Progress.js +77 -0
- package/dist/components/Progress/Progress.js.map +1 -0
- package/dist/components/PromptStarter/PromptStarter.d.ts +16 -0
- package/dist/components/PromptStarter/PromptStarter.js +33 -0
- package/dist/components/PromptStarter/PromptStarter.js.map +1 -0
- package/dist/components/Promptbox/Promptbox.d.ts +109 -0
- package/dist/components/Promptbox/Promptbox.js +469 -0
- package/dist/components/Promptbox/Promptbox.js.map +1 -0
- package/dist/components/Question/Question.d.ts +55 -0
- package/dist/components/Question/Question.js +161 -0
- package/dist/components/Question/Question.js.map +1 -0
- package/dist/components/RadioButton/RadioButton.d.ts +28 -0
- package/dist/components/RadioButton/RadioButton.js +43 -0
- package/dist/components/RadioButton/RadioButton.js.map +1 -0
- package/dist/components/Rating/Rating.d.ts +25 -0
- package/dist/components/Rating/Rating.js +79 -0
- package/dist/components/Rating/Rating.js.map +1 -0
- package/dist/components/ReadAloud/ReadAloud.d.ts +24 -0
- package/dist/components/ReadAloud/ReadAloud.js +76 -0
- package/dist/components/ReadAloud/ReadAloud.js.map +1 -0
- package/dist/components/RecommendationCard/RecommendationCard.d.ts +28 -0
- package/dist/components/RecommendationCard/RecommendationCard.js +78 -0
- package/dist/components/RecommendationCard/RecommendationCard.js.map +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.d.ts +32 -0
- package/dist/components/ResizablePanel/ResizablePanel.js +102 -0
- package/dist/components/ResizablePanel/ResizablePanel.js.map +1 -0
- package/dist/components/ResizeHandle/ResizeHandle.d.ts +32 -0
- package/dist/components/ResizeHandle/ResizeHandle.js +61 -0
- package/dist/components/ResizeHandle/ResizeHandle.js.map +1 -0
- package/dist/components/ResultsSummary/ResultsSummary.d.ts +37 -0
- package/dist/components/ResultsSummary/ResultsSummary.js +121 -0
- package/dist/components/ResultsSummary/ResultsSummary.js.map +1 -0
- package/dist/components/ScoreCounter/ScoreCounter.d.ts +18 -0
- package/dist/components/ScoreCounter/ScoreCounter.js +78 -0
- package/dist/components/ScoreCounter/ScoreCounter.js.map +1 -0
- package/dist/components/ScreenTemplate/ScreenTemplate.d.ts +30 -0
- package/dist/components/ScreenTemplate/ScreenTemplate.js +88 -0
- package/dist/components/ScreenTemplate/ScreenTemplate.js.map +1 -0
- package/dist/components/ScrollEdgeEffect/ScrollEdgeEffect.d.ts +15 -0
- package/dist/components/ScrollEdgeEffect/ScrollEdgeEffect.js +20 -0
- package/dist/components/ScrollEdgeEffect/ScrollEdgeEffect.js.map +1 -0
- package/dist/components/Search/Search.d.ts +33 -0
- package/dist/components/Search/Search.js +74 -0
- package/dist/components/Search/Search.js.map +1 -0
- package/dist/components/SearchView/SearchView.d.ts +36 -0
- package/dist/components/SearchView/SearchView.js +124 -0
- package/dist/components/SearchView/SearchView.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +63 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +164 -0
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/Select/Select.d.ts +49 -0
- package/dist/components/Select/Select.js +143 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +78 -0
- package/dist/components/Sidebar/Sidebar.js +167 -0
- package/dist/components/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +25 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Slider/Slider.d.ts +39 -0
- package/dist/components/Slider/Slider.js +83 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Snackbar/Snackbar.d.ts +38 -0
- package/dist/components/Snackbar/Snackbar.js +103 -0
- package/dist/components/Snackbar/Snackbar.js.map +1 -0
- package/dist/components/SourcePanel/SourcePanel.d.ts +20 -0
- package/dist/components/SourcePanel/SourcePanel.js +82 -0
- package/dist/components/SourcePanel/SourcePanel.js.map +1 -0
- package/dist/components/StatTile/StatTile.d.ts +22 -0
- package/dist/components/StatTile/StatTile.js +71 -0
- package/dist/components/StatTile/StatTile.js.map +1 -0
- package/dist/components/StatusBar/StatusBar.d.ts +18 -0
- package/dist/components/StatusBar/StatusBar.js +131 -0
- package/dist/components/StatusBar/StatusBar.js.map +1 -0
- package/dist/components/Stepper/Stepper.d.ts +50 -0
- package/dist/components/Stepper/Stepper.js +99 -0
- package/dist/components/Stepper/Stepper.js.map +1 -0
- package/dist/components/SuggestionCard/SuggestionCard.d.ts +22 -0
- package/dist/components/SuggestionCard/SuggestionCard.js +74 -0
- package/dist/components/SuggestionCard/SuggestionCard.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +35 -0
- package/dist/components/Switch/Switch.js +54 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/SystemNavigationBar/SystemNavigationBar.d.ts +16 -0
- package/dist/components/SystemNavigationBar/SystemNavigationBar.js +54 -0
- package/dist/components/SystemNavigationBar/SystemNavigationBar.js.map +1 -0
- package/dist/components/TabBar/TabBar.d.ts +101 -0
- package/dist/components/TabBar/TabBar.js +287 -0
- package/dist/components/TabBar/TabBar.js.map +1 -0
- package/dist/components/Table/Table.d.ts +135 -0
- package/dist/components/Table/Table.js +323 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +61 -0
- package/dist/components/Tabs/Tabs.js +179 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tag/Tag.d.ts +37 -0
- package/dist/components/Tag/Tag.js +56 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +37 -0
- package/dist/components/Textarea/Textarea.js +77 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Tile/Tile.d.ts +31 -0
- package/dist/components/Tile/Tile.js +70 -0
- package/dist/components/Tile/Tile.js.map +1 -0
- package/dist/components/TimePicker/TimePicker.d.ts +43 -0
- package/dist/components/TimePicker/TimePicker.js +186 -0
- package/dist/components/TimePicker/TimePicker.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +42 -0
- package/dist/components/Toast/Toast.js +115 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toolbar/Toolbar.d.ts +22 -0
- package/dist/components/Toolbar/Toolbar.js +52 -0
- package/dist/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +28 -0
- package/dist/components/Tooltip/Tooltip.js +101 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/TopAppBar/TopAppBar.d.ts +36 -0
- package/dist/components/TopAppBar/TopAppBar.js +70 -0
- package/dist/components/TopAppBar/TopAppBar.js.map +1 -0
- package/dist/components/Topbar/Topbar.d.ts +28 -0
- package/dist/components/Topbar/Topbar.js +63 -0
- package/dist/components/Topbar/Topbar.js.map +1 -0
- package/dist/components/Topbar/TopbarLogo.d.ts +2 -0
- package/dist/components/Topbar/TopbarLogo.js +98 -0
- package/dist/components/Topbar/TopbarLogo.js.map +1 -0
- package/dist/components/TreeItem/TreeItem.d.ts +38 -0
- package/dist/components/TreeItem/TreeItem.js +126 -0
- package/dist/components/TreeItem/TreeItem.js.map +1 -0
- package/dist/components/VersionSwitcher/VersionSwitcher.d.ts +13 -0
- package/dist/components/VersionSwitcher/VersionSwitcher.js +43 -0
- package/dist/components/VersionSwitcher/VersionSwitcher.js.map +1 -0
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +28 -0
- package/dist/components/VideoPlayer/VideoPlayer.js +160 -0
- package/dist/components/VideoPlayer/VideoPlayer.js.map +1 -0
- package/dist/components/VoiceMode/VoiceMode.d.ts +27 -0
- package/dist/components/VoiceMode/VoiceMode.js +123 -0
- package/dist/components/VoiceMode/VoiceMode.js.map +1 -0
- package/dist/components/WebScreenTemplate/WebScreenTemplate.d.ts +36 -0
- package/dist/components/WebScreenTemplate/WebScreenTemplate.js +66 -0
- package/dist/components/WebScreenTemplate/WebScreenTemplate.js.map +1 -0
- package/dist/components/WhyThisSheet/WhyThisSheet.d.ts +23 -0
- package/dist/components/WhyThisSheet/WhyThisSheet.js +73 -0
- package/dist/components/WhyThisSheet/WhyThisSheet.js.map +1 -0
- package/dist/index.d.ts +124 -0
- package/dist/index.js +125 -0
- package/dist/styles.css +5637 -0
- package/dist/tokens.css +2338 -0
- package/package.json +50 -4
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export type QuestionFeedback = 'none' | 'correct' | 'incorrect' | 'hint';
|
|
3
|
+
export interface QuestionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Figma `Question Number`, e.g. "3." */
|
|
5
|
+
questionNumber?: ReactNode;
|
|
6
|
+
/** Figma `Question Text`. Also the accessible name of the answer group. */
|
|
7
|
+
questionText?: ReactNode;
|
|
8
|
+
/** Figma `Required` — a visual asterisk plus "required" for screen readers. */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** Figma `Supporting Text`. Shown when set (`Show Supporting Text`). */
|
|
11
|
+
supportingText?: ReactNode;
|
|
12
|
+
/** Figma `Validation Message`. Shown when set (`Show Validation`); marks the group invalid. */
|
|
13
|
+
validationMessage?: ReactNode;
|
|
14
|
+
/** Figma `Feedback` banner after Submit / on request (announced politely). */
|
|
15
|
+
feedback?: QuestionFeedback;
|
|
16
|
+
/** Banner title. Defaults: "Correct", "Not quite", "Hint". */
|
|
17
|
+
feedbackTitle?: ReactNode;
|
|
18
|
+
/** Optional banner body (explanation, hint text). */
|
|
19
|
+
feedbackMessage?: ReactNode;
|
|
20
|
+
/** Answer group semantics: `radiogroup` for single choice (default), `group` for multiple choice. */
|
|
21
|
+
answerRole?: 'radiogroup' | 'group';
|
|
22
|
+
/** Figma `Answer` slot — Answer Options (stack with Spacing/12) or Radio Buttons / Checkboxes. */
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Bodhan Question — one question with its answers. The answer slot is a `radiogroup` / `group` named by the question
|
|
27
|
+
* text and described by the supporting text and validation message; the feedback banner is a polite live region.
|
|
28
|
+
* Shared on every platform. Android: Column + Modifier.selectableGroup() · iOS: Section with a Picker / Buttons.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Question({ questionNumber, questionText, required, supportingText, validationMessage, feedback, feedbackTitle, feedbackMessage, answerRole, children, className, ...rest }: QuestionProps): import("react").JSX.Element;
|
|
31
|
+
export interface QuestionContentDesktopProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
32
|
+
/** Survey / quiz title (Title/L). */
|
|
33
|
+
title?: ReactNode;
|
|
34
|
+
/** Description under the title (Body/M). */
|
|
35
|
+
description?: ReactNode;
|
|
36
|
+
/** Current question number (1-based) and total — drives the "3 of 10" progress. */
|
|
37
|
+
current?: number;
|
|
38
|
+
total?: number;
|
|
39
|
+
/** The Question (with its answers). */
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
/** Navigation. Omit a handler to hide that button (e.g. no Previous on the first question). */
|
|
42
|
+
onPrevious?: () => void;
|
|
43
|
+
onSkip?: () => void;
|
|
44
|
+
onNext?: () => void;
|
|
45
|
+
previousLabel?: string;
|
|
46
|
+
skipLabel?: string;
|
|
47
|
+
nextLabel?: string;
|
|
48
|
+
/** Disable Next until an answer is chosen (pair with a validation message on Submit instead where possible). */
|
|
49
|
+
nextDisabled?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `Question / Content (Desktop)` — questionnaire body for desktop: title + progress, description, divider, the
|
|
53
|
+
* Question, and Previous · Skip · Next navigation (Secondary · Tertiary · Primary). Buttons follow the frame's platform.
|
|
54
|
+
*/
|
|
55
|
+
export declare function QuestionContentDesktop({ title, description, current, total, children, onPrevious, onSkip, onNext, previousLabel, skipLabel, nextLabel, nextDisabled, className, ...rest }: QuestionContentDesktopProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { Icon } from "../Icon/Icon.js";
|
|
2
|
+
import { Button } from "../Button/Button.js";
|
|
3
|
+
import { Progress } from "../Progress/Progress.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
// src/components/Question/Question.tsx
|
|
7
|
+
var FEEDBACK = {
|
|
8
|
+
correct: {
|
|
9
|
+
icon: "check_circle",
|
|
10
|
+
title: "Correct"
|
|
11
|
+
},
|
|
12
|
+
incorrect: {
|
|
13
|
+
icon: "error",
|
|
14
|
+
title: "Not quite"
|
|
15
|
+
},
|
|
16
|
+
hint: {
|
|
17
|
+
icon: "info",
|
|
18
|
+
title: "Hint"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Bodhan Question — one question with its answers. The answer slot is a `radiogroup` / `group` named by the question
|
|
23
|
+
* text and described by the supporting text and validation message; the feedback banner is a polite live region.
|
|
24
|
+
* Shared on every platform. Android: Column + Modifier.selectableGroup() · iOS: Section with a Picker / Buttons.
|
|
25
|
+
*/
|
|
26
|
+
function Question({ questionNumber = "3.", questionText = "Which subject do you enjoy most?", required = true, supportingText = "Select the one option that applies best.", validationMessage, feedback = "none", feedbackTitle, feedbackMessage, answerRole = "radiogroup", children, className, ...rest }) {
|
|
27
|
+
const id = useId();
|
|
28
|
+
const f = feedback !== "none" ? FEEDBACK[feedback] : null;
|
|
29
|
+
const describedBy = [supportingText && `${id}-s`, validationMessage && `${id}-v`].filter(Boolean).join(" ") || void 0;
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: ["bodhan-question", className].filter(Boolean).join(" "),
|
|
32
|
+
"data-feedback": feedback,
|
|
33
|
+
...rest,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "bodhan-question__head",
|
|
37
|
+
children: [/* @__PURE__ */ jsxs("h3", {
|
|
38
|
+
className: "bodhan-question__title",
|
|
39
|
+
id: `${id}-q`,
|
|
40
|
+
children: [
|
|
41
|
+
questionNumber && /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "bodhan-question__number",
|
|
43
|
+
children: questionNumber
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx("span", { children: questionText }),
|
|
46
|
+
required && /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: "bodhan-question__sr",
|
|
48
|
+
children: " (required)"
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
}), required && /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "bodhan-question__required",
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
children: "*"
|
|
55
|
+
})]
|
|
56
|
+
}),
|
|
57
|
+
supportingText && /* @__PURE__ */ jsx("p", {
|
|
58
|
+
className: "bodhan-question__supporting",
|
|
59
|
+
id: `${id}-s`,
|
|
60
|
+
children: supportingText
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: "bodhan-question__answer",
|
|
64
|
+
role: answerRole,
|
|
65
|
+
"aria-labelledby": `${id}-q`,
|
|
66
|
+
"aria-describedby": describedBy,
|
|
67
|
+
"aria-required": answerRole === "radiogroup" && required ? true : void 0,
|
|
68
|
+
"aria-invalid": validationMessage ? true : void 0,
|
|
69
|
+
children
|
|
70
|
+
}),
|
|
71
|
+
validationMessage && /* @__PURE__ */ jsxs("p", {
|
|
72
|
+
className: "bodhan-question__validation",
|
|
73
|
+
id: `${id}-v`,
|
|
74
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
75
|
+
name: "error",
|
|
76
|
+
filled: true
|
|
77
|
+
}), validationMessage]
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: "bodhan-question__live",
|
|
81
|
+
role: "status",
|
|
82
|
+
children: f && /* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "bodhan-question__feedback",
|
|
84
|
+
"data-type": feedback,
|
|
85
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
86
|
+
name: f.icon,
|
|
87
|
+
filled: true
|
|
88
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
89
|
+
className: "bodhan-question__feedback-text",
|
|
90
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: "bodhan-question__feedback-title",
|
|
92
|
+
children: feedbackTitle ?? f.title
|
|
93
|
+
}), feedbackMessage && /* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: "bodhan-question__feedback-message",
|
|
95
|
+
children: feedbackMessage
|
|
96
|
+
})]
|
|
97
|
+
})]
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* `Question / Content (Desktop)` — questionnaire body for desktop: title + progress, description, divider, the
|
|
105
|
+
* Question, and Previous · Skip · Next navigation (Secondary · Tertiary · Primary). Buttons follow the frame's platform.
|
|
106
|
+
*/
|
|
107
|
+
function QuestionContentDesktop({ title = "Subject Preferences Survey", description = "Help us understand your academic interests. This will take about 2 minutes.", current = 3, total = 10, children, onPrevious, onSkip, onNext, previousLabel = "Previous", skipLabel = "Skip", nextLabel = "Next", nextDisabled, className, ...rest }) {
|
|
108
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
109
|
+
className: ["bodhan-question-content", className].filter(Boolean).join(" "),
|
|
110
|
+
...rest,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsxs("header", {
|
|
113
|
+
className: "bodhan-question-content__header",
|
|
114
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
115
|
+
className: "bodhan-question-content__top",
|
|
116
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
117
|
+
className: "bodhan-question-content__title",
|
|
118
|
+
children: title
|
|
119
|
+
}), /* @__PURE__ */ jsx(Progress, {
|
|
120
|
+
className: "bodhan-question-content__progress",
|
|
121
|
+
value: current,
|
|
122
|
+
max: total,
|
|
123
|
+
text: `${current} of ${total}`,
|
|
124
|
+
label: "Question progress"
|
|
125
|
+
})]
|
|
126
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
127
|
+
className: "bodhan-question-content__description",
|
|
128
|
+
children: description
|
|
129
|
+
})]
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsx("hr", { className: "bodhan-question-content__divider" }),
|
|
132
|
+
children ?? /* @__PURE__ */ jsx(Question, {}),
|
|
133
|
+
/* @__PURE__ */ jsxs("nav", {
|
|
134
|
+
className: "bodhan-question-content__nav",
|
|
135
|
+
"aria-label": "Question navigation",
|
|
136
|
+
children: [
|
|
137
|
+
onPrevious && /* @__PURE__ */ jsx(Button, {
|
|
138
|
+
variant: "secondary",
|
|
139
|
+
onClick: onPrevious,
|
|
140
|
+
children: previousLabel
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: "bodhan-question-content__spacer" }),
|
|
143
|
+
onSkip && /* @__PURE__ */ jsx(Button, {
|
|
144
|
+
variant: "tertiary",
|
|
145
|
+
onClick: onSkip,
|
|
146
|
+
children: skipLabel
|
|
147
|
+
}),
|
|
148
|
+
onNext && /* @__PURE__ */ jsx(Button, {
|
|
149
|
+
variant: "primary",
|
|
150
|
+
onClick: onNext,
|
|
151
|
+
disabled: nextDisabled,
|
|
152
|
+
children: nextLabel
|
|
153
|
+
})
|
|
154
|
+
]
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
export { Question, QuestionContentDesktop };
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=Question.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Question.js","names":[],"sources":["../../../src/components/Question/Question.tsx"],"sourcesContent":["import { useId, type HTMLAttributes, type ReactNode } from 'react';\nimport { Icon } from '../Icon/Icon';\nimport { Button } from '../Button/Button';\nimport { Progress } from '../Progress/Progress';\n\nexport type QuestionFeedback = 'none' | 'correct' | 'incorrect' | 'hint';\n\nexport interface QuestionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** Figma `Question Number`, e.g. \"3.\" */\n questionNumber?: ReactNode;\n /** Figma `Question Text`. Also the accessible name of the answer group. */\n questionText?: ReactNode;\n /** Figma `Required` — a visual asterisk plus \"required\" for screen readers. */\n required?: boolean;\n /** Figma `Supporting Text`. Shown when set (`Show Supporting Text`). */\n supportingText?: ReactNode;\n /** Figma `Validation Message`. Shown when set (`Show Validation`); marks the group invalid. */\n validationMessage?: ReactNode;\n /** Figma `Feedback` banner after Submit / on request (announced politely). */\n feedback?: QuestionFeedback;\n /** Banner title. Defaults: \"Correct\", \"Not quite\", \"Hint\". */\n feedbackTitle?: ReactNode;\n /** Optional banner body (explanation, hint text). */\n feedbackMessage?: ReactNode;\n /** Answer group semantics: `radiogroup` for single choice (default), `group` for multiple choice. */\n answerRole?: 'radiogroup' | 'group';\n /** Figma `Answer` slot — Answer Options (stack with Spacing/12) or Radio Buttons / Checkboxes. */\n children?: ReactNode;\n}\n\nconst FEEDBACK = {\n correct: { icon: 'check_circle', title: 'Correct' },\n incorrect: { icon: 'error', title: 'Not quite' },\n hint: { icon: 'info', title: 'Hint' },\n} as const;\n\n/**\n * Bodhan Question — one question with its answers. The answer slot is a `radiogroup` / `group` named by the question\n * text and described by the supporting text and validation message; the feedback banner is a polite live region.\n * Shared on every platform. Android: Column + Modifier.selectableGroup() · iOS: Section with a Picker / Buttons.\n */\nexport function Question({\n questionNumber = '3.', questionText = 'Which subject do you enjoy most?', required = true,\n supportingText = 'Select the one option that applies best.', validationMessage, feedback = 'none', feedbackTitle,\n feedbackMessage, answerRole = 'radiogroup', children, className, ...rest\n}: QuestionProps) {\n const id = useId();\n const f = feedback !== 'none' ? FEEDBACK[feedback] : null;\n const describedBy = [supportingText && `${id}-s`, validationMessage && `${id}-v`].filter(Boolean).join(' ') || undefined;\n return (\n <div className={['bodhan-question', className].filter(Boolean).join(' ')} data-feedback={feedback} {...rest}>\n <div className=\"bodhan-question__head\">\n <h3 className=\"bodhan-question__title\" id={`${id}-q`}>\n {questionNumber && <span className=\"bodhan-question__number\">{questionNumber}</span>}\n <span>{questionText}</span>\n {required && <span className=\"bodhan-question__sr\"> (required)</span>}\n </h3>\n {required && <span className=\"bodhan-question__required\" aria-hidden=\"true\">*</span>}\n </div>\n {supportingText && <p className=\"bodhan-question__supporting\" id={`${id}-s`}>{supportingText}</p>}\n <div className=\"bodhan-question__answer\" role={answerRole} aria-labelledby={`${id}-q`} aria-describedby={describedBy}\n aria-required={answerRole === 'radiogroup' && required ? true : undefined} aria-invalid={validationMessage ? true : undefined}>\n {children}\n </div>\n {validationMessage && (\n <p className=\"bodhan-question__validation\" id={`${id}-v`}><Icon name=\"error\" filled />{validationMessage}</p>\n )}\n <div className=\"bodhan-question__live\" role=\"status\">\n {f && (\n <div className=\"bodhan-question__feedback\" data-type={feedback}>\n <Icon name={f.icon} filled />\n <div className=\"bodhan-question__feedback-text\">\n <span className=\"bodhan-question__feedback-title\">{feedbackTitle ?? f.title}</span>\n {feedbackMessage && <span className=\"bodhan-question__feedback-message\">{feedbackMessage}</span>}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n}\n\nexport interface QuestionContentDesktopProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\n /** Survey / quiz title (Title/L). */\n title?: ReactNode;\n /** Description under the title (Body/M). */\n description?: ReactNode;\n /** Current question number (1-based) and total — drives the \"3 of 10\" progress. */\n current?: number;\n total?: number;\n /** The Question (with its answers). */\n children?: ReactNode;\n /** Navigation. Omit a handler to hide that button (e.g. no Previous on the first question). */\n onPrevious?: () => void;\n onSkip?: () => void;\n onNext?: () => void;\n previousLabel?: string;\n skipLabel?: string;\n nextLabel?: string;\n /** Disable Next until an answer is chosen (pair with a validation message on Submit instead where possible). */\n nextDisabled?: boolean;\n}\n\n/**\n * `Question / Content (Desktop)` — questionnaire body for desktop: title + progress, description, divider, the\n * Question, and Previous · Skip · Next navigation (Secondary · Tertiary · Primary). Buttons follow the frame's platform.\n */\nexport function QuestionContentDesktop({\n title = 'Subject Preferences Survey', description = 'Help us understand your academic interests. This will take about 2 minutes.',\n current = 3, total = 10, children, onPrevious, onSkip, onNext, previousLabel = 'Previous', skipLabel = 'Skip', nextLabel = 'Next',\n nextDisabled, className, ...rest\n}: QuestionContentDesktopProps) {\n return (\n <section className={['bodhan-question-content', className].filter(Boolean).join(' ')} {...rest}>\n <header className=\"bodhan-question-content__header\">\n <div className=\"bodhan-question-content__top\">\n <h2 className=\"bodhan-question-content__title\">{title}</h2>\n <Progress className=\"bodhan-question-content__progress\" value={current} max={total} text={`${current} of ${total}`}\n label=\"Question progress\" />\n </div>\n {description && <p className=\"bodhan-question-content__description\">{description}</p>}\n </header>\n <hr className=\"bodhan-question-content__divider\" />\n {children ?? <Question />}\n <nav className=\"bodhan-question-content__nav\" aria-label=\"Question navigation\">\n {onPrevious && <Button variant=\"secondary\" onClick={onPrevious}>{previousLabel}</Button>}\n <span className=\"bodhan-question-content__spacer\" />\n {onSkip && <Button variant=\"tertiary\" onClick={onSkip}>{skipLabel}</Button>}\n {onNext && <Button variant=\"primary\" onClick={onNext} disabled={nextDisabled}>{nextLabel}</Button>}\n </nav>\n </section>\n );\n}\n"],"mappings":";;;;;;AA8BA,IAAM,WAAW;CACf,SAAS;EAAE,MAAM;EAAgB,OAAO;CAAU;CAClD,WAAW;EAAE,MAAM;EAAS,OAAO;CAAY;CAC/C,MAAM;EAAE,MAAM;EAAQ,OAAO;CAAO;AACtC;;;;;;AAOA,SAAgB,SAAS,EACvB,iBAAiB,MAAM,eAAe,oCAAoC,WAAW,MACrF,iBAAiB,4CAA4C,mBAAmB,WAAW,QAAQ,eACnG,iBAAiB,aAAa,cAAc,UAAU,WAAW,GAAG,QACpD;CAChB,MAAM,KAAK,MAAM;CACjB,MAAM,IAAI,aAAa,SAAS,SAAS,YAAY;CACrD,MAAM,cAAc,CAAC,kBAAkB,GAAG,GAAG,KAAK,qBAAqB,GAAG,GAAG,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;CAC/G,OACE,qBAAC,OAAD;EAAK,WAAW,CAAC,mBAAmB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAG,iBAAe;EAAU,GAAI;EAAvG,UAAA;GACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,qBAAC,MAAD;KAAI,WAAU;KAAyB,IAAI,GAAG,GAAG;KAAjD,UAAA;MACG,kBAAkB,oBAAC,QAAD;OAAM,WAAU;OAA2B,UAAA;MAAqB,CAAA;MACnF,oBAAC,QAAD,EAAA,UAAO,aAAmB,CAAA;MACzB,YAAY,oBAAC,QAAD;OAAM,WAAU;OAAsB,UAAA;MAAiB,CAAA;KAClE;IACH,CAAA,GAAA,YAAY,oBAAC,QAAD;KAAM,WAAU;KAA4B,eAAY;KAAO,UAAA;IAAO,CAAA,CAChF;;GACJ,kBAAkB,oBAAC,KAAD;IAAG,WAAU;IAA8B,IAAI,GAAG,GAAG;IAAM,UAAA;GAAkB,CAAA;GAChG,oBAAC,OAAD;IAAK,WAAU;IAA0B,MAAM;IAAY,mBAAiB,GAAG,GAAG;IAAK,oBAAkB;IACvG,iBAAe,eAAe,gBAAgB,WAAW,OAAO,KAAA;IAAW,gBAAc,oBAAoB,OAAO,KAAA;IACnH;GACE,CAAA;GACJ,qBACC,qBAAC,KAAD;IAAG,WAAU;IAA8B,IAAI,GAAG,GAAG;IAArD,UAAA,CAA0D,oBAAC,MAAD;KAAM,MAAK;KAAQ,QAAA;IAAQ,CAAA,GAAE,iBAAqB;;GAE9G,oBAAC,OAAD;IAAK,WAAU;IAAwB,MAAK;IACzC,UAAA,KACC,qBAAC,OAAD;KAAK,WAAU;KAA4B,aAAW;KAAtD,UAAA,CACE,oBAAC,MAAD;MAAM,MAAM,EAAE;MAAM,QAAA;KAAQ,CAAA,GAC5B,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,QAAD;OAAM,WAAU;OAAmC,UAAA,iBAAiB,EAAE;MAAY,CAAA,GACjF,mBAAmB,oBAAC,QAAD;OAAM,WAAU;OAAqC,UAAA;MAAsB,CAAA,CAC5F;KACF,CAAA,CAAA;;GAEJ,CAAA;EACF;;AAET;;;;;AA2BA,SAAgB,uBAAuB,EACrC,QAAQ,8BAA8B,cAAc,+EACpD,UAAU,GAAG,QAAQ,IAAI,UAAU,YAAY,QAAQ,QAAQ,gBAAgB,YAAY,YAAY,QAAQ,YAAY,QAC3H,cAAc,WAAW,GAAG,QACE;CAC9B,OACE,qBAAC,WAAD;EAAS,WAAW,CAAC,2BAA2B,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAG,GAAI;EAA1F,UAAA;GACE,qBAAC,UAAD;IAAQ,WAAU;IAAlB,UAAA,CACE,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,MAAD;MAAI,WAAU;MAAkC,UAAA;KAAU,CAAA,GAC1D,oBAAC,UAAD;MAAU,WAAU;MAAoC,OAAO;MAAS,KAAK;MAAO,MAAM,GAAG,QAAQ,MAAM;MACzG,OAAM;KAAqB,CAAA,CAC1B;IACJ,CAAA,GAAA,eAAe,oBAAC,KAAD;KAAG,WAAU;KAAwC,UAAA;IAAe,CAAA,CAC9E;;GACR,oBAAC,MAAD,EAAI,WAAU,mCAAoC,CAAA;GACjD,YAAY,oBAAC,UAAD,CAAW,CAAA;GACxB,qBAAC,OAAD;IAAK,WAAU;IAA+B,cAAW;IAAzD,UAAA;KACG,cAAc,oBAAC,QAAD;MAAQ,SAAQ;MAAY,SAAS;MAAa,UAAA;KAAsB,CAAA;KACvF,oBAAC,QAAD,EAAM,WAAU,kCAAmC,CAAA;KAClD,UAAU,oBAAC,QAAD;MAAQ,SAAQ;MAAW,SAAS;MAAS,UAAA;KAAkB,CAAA;KACzE,UAAU,oBAAC,QAAD;MAAQ,SAAQ;MAAU,SAAS;MAAQ,UAAU;MAAe,UAAA;KAAkB,CAAA;IAC9F;;EACE;;AAEb"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CSSProperties, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type RadioButtonStyle = 'circular' | 'rectangle';
|
|
3
|
+
export type RadioButtonValidation = 'none' | 'error';
|
|
4
|
+
export type RadioButtonLabelPosition = 'right' | 'left';
|
|
5
|
+
export interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children' | 'style'> {
|
|
6
|
+
/** Figma `Label`. Clickable: the whole row (or card, for `rectangle`) selects the option. */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** Figma `Style`: `circular` (plain row) or `rectangle` (bordered option card). */
|
|
9
|
+
variant?: RadioButtonStyle;
|
|
10
|
+
/** Figma `Validation`. `error` also sets aria-invalid. */
|
|
11
|
+
validation?: RadioButtonValidation;
|
|
12
|
+
/** Figma `Label Position`. */
|
|
13
|
+
labelPosition?: RadioButtonLabelPosition;
|
|
14
|
+
/**
|
|
15
|
+
* Force a visual state for documentation (`State=Hover|Focus|Pressed`). Real interaction uses CSS
|
|
16
|
+
* :hover / :focus-visible / :active, so leave this unset in product code.
|
|
17
|
+
*/
|
|
18
|
+
forceState?: 'hover' | 'focus' | 'pressed';
|
|
19
|
+
/** Inline style for the outer label. */
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Bodhan Radio Button — a native `<input type="radio">` inside a `<label>`. Give options in a set the same `name`
|
|
24
|
+
* and wrap them in a `<fieldset>` with a `<legend>`: arrow keys then move the selection natively.
|
|
25
|
+
* Platform (Web / iOS / Android) comes from the `data-platform` mode on an ancestor (label size, 44/48 touch target).
|
|
26
|
+
* Android: Compose RadioButton · iOS: Picker(.inline) / List checkmark.
|
|
27
|
+
*/
|
|
28
|
+
export declare function RadioButton({ label, variant, validation, labelPosition, forceState, disabled, className, style, ...rest }: RadioButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
// src/components/RadioButton/RadioButton.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Bodhan Radio Button — a native `<input type="radio">` inside a `<label>`. Give options in a set the same `name`
|
|
5
|
+
* and wrap them in a `<fieldset>` with a `<legend>`: arrow keys then move the selection natively.
|
|
6
|
+
* Platform (Web / iOS / Android) comes from the `data-platform` mode on an ancestor (label size, 44/48 touch target).
|
|
7
|
+
* Android: Compose RadioButton · iOS: Picker(.inline) / List checkmark.
|
|
8
|
+
*/
|
|
9
|
+
function RadioButton({ label = "Radio Button Label", variant = "circular", validation = "none", labelPosition = "right", forceState, disabled, className, style, ...rest }) {
|
|
10
|
+
const error = validation === "error";
|
|
11
|
+
return /* @__PURE__ */ jsx("label", {
|
|
12
|
+
className: ["bodhan-radio-button", className].filter(Boolean).join(" "),
|
|
13
|
+
style,
|
|
14
|
+
"data-style": variant,
|
|
15
|
+
"data-label-position": labelPosition,
|
|
16
|
+
"data-validation": validation,
|
|
17
|
+
"data-state": forceState,
|
|
18
|
+
"data-disabled": disabled || void 0,
|
|
19
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
20
|
+
className: "bodhan-radio-button__row",
|
|
21
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
22
|
+
className: "bodhan-radio-button__control",
|
|
23
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
24
|
+
type: "radio",
|
|
25
|
+
className: "bodhan-radio-button__input",
|
|
26
|
+
disabled,
|
|
27
|
+
"aria-invalid": error || void 0,
|
|
28
|
+
...rest
|
|
29
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "bodhan-radio-button__circle",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: /* @__PURE__ */ jsx("span", { className: "bodhan-radio-button__dot" })
|
|
33
|
+
})]
|
|
34
|
+
}), label && /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "bodhan-radio-button__label",
|
|
36
|
+
children: label
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { RadioButton };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=RadioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.js","names":[],"sources":["../../../src/components/RadioButton/RadioButton.tsx"],"sourcesContent":["import type { CSSProperties, InputHTMLAttributes, ReactNode } from 'react';\n\nexport type RadioButtonStyle = 'circular' | 'rectangle';\nexport type RadioButtonValidation = 'none' | 'error';\nexport type RadioButtonLabelPosition = 'right' | 'left';\n\nexport interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'children' | 'style'> {\n /** Figma `Label`. Clickable: the whole row (or card, for `rectangle`) selects the option. */\n label?: ReactNode;\n /** Figma `Style`: `circular` (plain row) or `rectangle` (bordered option card). */\n variant?: RadioButtonStyle;\n /** Figma `Validation`. `error` also sets aria-invalid. */\n validation?: RadioButtonValidation;\n /** Figma `Label Position`. */\n labelPosition?: RadioButtonLabelPosition;\n /**\n * Force a visual state for documentation (`State=Hover|Focus|Pressed`). Real interaction uses CSS\n * :hover / :focus-visible / :active, so leave this unset in product code.\n */\n forceState?: 'hover' | 'focus' | 'pressed';\n /** Inline style for the outer label. */\n style?: CSSProperties;\n}\n\n/**\n * Bodhan Radio Button — a native `<input type=\"radio\">` inside a `<label>`. Give options in a set the same `name`\n * and wrap them in a `<fieldset>` with a `<legend>`: arrow keys then move the selection natively.\n * Platform (Web / iOS / Android) comes from the `data-platform` mode on an ancestor (label size, 44/48 touch target).\n * Android: Compose RadioButton · iOS: Picker(.inline) / List checkmark.\n */\nexport function RadioButton({\n label = 'Radio Button Label', variant = 'circular', validation = 'none', labelPosition = 'right',\n forceState, disabled, className, style, ...rest\n}: RadioButtonProps) {\n const error = validation === 'error';\n return (\n <label\n className={['bodhan-radio-button', className].filter(Boolean).join(' ')}\n style={style}\n data-style={variant}\n data-label-position={labelPosition}\n data-validation={validation}\n data-state={forceState}\n data-disabled={disabled || undefined}\n >\n <span className=\"bodhan-radio-button__row\">\n <span className=\"bodhan-radio-button__control\">\n <input type=\"radio\" className=\"bodhan-radio-button__input\" disabled={disabled} aria-invalid={error || undefined} {...rest} />\n <span className=\"bodhan-radio-button__circle\" aria-hidden=\"true\"><span className=\"bodhan-radio-button__dot\" /></span>\n </span>\n {label && <span className=\"bodhan-radio-button__label\">{label}</span>}\n </span>\n </label>\n );\n}\n"],"mappings":";;;;;;;;AA8BA,SAAgB,YAAY,EAC1B,QAAQ,sBAAsB,UAAU,YAAY,aAAa,QAAQ,gBAAgB,SACzF,YAAY,UAAU,WAAW,OAAO,GAAG,QACxB;CACnB,MAAM,QAAQ,eAAe;CAC7B,OACE,oBAAC,SAAD;EACE,WAAW,CAAC,uBAAuB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC/D;EACP,cAAY;EACZ,uBAAqB;EACrB,mBAAiB;EACjB,cAAY;EACZ,iBAAe,YAAY,KAAA;EAE3B,UAAA,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,oBAAC,SAAD;KAAO,MAAK;KAAQ,WAAU;KAAuC;KAAU,gBAAc,SAAS,KAAA;KAAW,GAAI;IAAO,CAAA,GAC5H,oBAAC,QAAD;KAAM,WAAU;KAA8B,eAAY;KAAO,UAAA,oBAAC,QAAD,EAAM,WAAU,2BAA4B,CAAA;IAAO,CAAA,CAChH;GACL,CAAA,GAAA,SAAS,oBAAC,QAAD;IAAM,WAAU;IAA8B,UAAA;GAAY,CAAA,CAChE;;CACD,CAAA;AAEX"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type RatingSize = 'small' | 'medium';
|
|
3
|
+
export interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
4
|
+
/** Figma `Value` 0–5 (controlled). */
|
|
5
|
+
value?: number;
|
|
6
|
+
/** Initial value when uncontrolled. */
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
/** Called with the new value (click / tap a star, ←/→/↑/↓, Home/End). */
|
|
9
|
+
onValueChange?: (value: number) => void;
|
|
10
|
+
/** Figma `Size`: Small 16 px (read-only display), Medium 24 px (interactive). */
|
|
11
|
+
size?: RatingSize;
|
|
12
|
+
/** Read-only display. Defaults to true for Size=Small, false for Medium. */
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
/** Accessible name of the control ("Rate this lesson"). */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Number of stars (5). */
|
|
17
|
+
max?: number;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Bodhan Rating — 0–5 stars. Filled stars Warning/Strong, empty stars Icon/Secondary (filled vs outline shape,
|
|
22
|
+
* never colour alone). Interactive: a radio group of stars with roving focus (arrow keys). Read-only: one image
|
|
23
|
+
* "Rating, 3 of 5 stars". Shared on every platform. Android: RatingBar-style Row · iOS: HStack with adjustable action.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Rating({ value, defaultValue, onValueChange, size, readOnly, label, max, disabled, className, ...rest }: RatingProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Icon } from "../Icon/Icon.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useState } from "react";
|
|
4
|
+
// src/components/Rating/Rating.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Bodhan Rating — 0–5 stars. Filled stars Warning/Strong, empty stars Icon/Secondary (filled vs outline shape,
|
|
7
|
+
* never colour alone). Interactive: a radio group of stars with roving focus (arrow keys). Read-only: one image
|
|
8
|
+
* "Rating, 3 of 5 stars". Shared on every platform. Android: RatingBar-style Row · iOS: HStack with adjustable action.
|
|
9
|
+
*/
|
|
10
|
+
function Rating({ value, defaultValue = 0, onValueChange, size = "small", readOnly, label = "Rating", max = 5, disabled, className, ...rest }) {
|
|
11
|
+
const [inner, setInner] = useState(defaultValue);
|
|
12
|
+
const [hover, setHover] = useState(null);
|
|
13
|
+
const current = Math.max(0, Math.min(max, Math.round(value ?? inner)));
|
|
14
|
+
const ro = readOnly ?? size === "small";
|
|
15
|
+
const refs = useRef([]);
|
|
16
|
+
const stars = Array.from({ length: max }, (_, i) => i + 1);
|
|
17
|
+
if (ro) return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: ["bodhan-rating", className].filter(Boolean).join(" "),
|
|
19
|
+
"data-size": size,
|
|
20
|
+
"data-readonly": "",
|
|
21
|
+
role: "img",
|
|
22
|
+
"aria-label": `${label}, ${current} of ${max} stars`,
|
|
23
|
+
...rest,
|
|
24
|
+
children: stars.map((n) => /* @__PURE__ */ jsx(Icon, {
|
|
25
|
+
name: "star",
|
|
26
|
+
filled: n <= current,
|
|
27
|
+
className: n <= current ? "bodhan-rating__star bodhan-rating__star--filled" : "bodhan-rating__star"
|
|
28
|
+
}, n))
|
|
29
|
+
});
|
|
30
|
+
const set = (n) => {
|
|
31
|
+
const v = Math.max(1, Math.min(max, n));
|
|
32
|
+
if (value === void 0) setInner(v);
|
|
33
|
+
onValueChange?.(v);
|
|
34
|
+
refs.current[v - 1]?.focus();
|
|
35
|
+
};
|
|
36
|
+
const onKey = (e) => {
|
|
37
|
+
const k = e.key;
|
|
38
|
+
const base = current || 0;
|
|
39
|
+
if (k === "ArrowRight" || k === "ArrowUp") set(base + 1);
|
|
40
|
+
else if (k === "ArrowLeft" || k === "ArrowDown") set(base - 1);
|
|
41
|
+
else if (k === "Home") set(1);
|
|
42
|
+
else if (k === "End") set(max);
|
|
43
|
+
else return;
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
};
|
|
46
|
+
const shown = hover ?? current;
|
|
47
|
+
return /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: ["bodhan-rating", className].filter(Boolean).join(" "),
|
|
49
|
+
"data-size": size,
|
|
50
|
+
role: "radiogroup",
|
|
51
|
+
"aria-label": label,
|
|
52
|
+
"aria-disabled": disabled || void 0,
|
|
53
|
+
onKeyDown: disabled ? void 0 : onKey,
|
|
54
|
+
onMouseLeave: () => setHover(null),
|
|
55
|
+
...rest,
|
|
56
|
+
children: stars.map((n) => /* @__PURE__ */ jsx("button", {
|
|
57
|
+
ref: (el) => {
|
|
58
|
+
refs.current[n - 1] = el;
|
|
59
|
+
},
|
|
60
|
+
type: "button",
|
|
61
|
+
role: "radio",
|
|
62
|
+
"aria-checked": n === current,
|
|
63
|
+
"aria-label": `${n} ${n === 1 ? "star" : "stars"}`,
|
|
64
|
+
tabIndex: n === (current || 1) ? 0 : -1,
|
|
65
|
+
disabled,
|
|
66
|
+
className: "bodhan-rating__button",
|
|
67
|
+
onClick: () => set(n),
|
|
68
|
+
onMouseEnter: () => setHover(n),
|
|
69
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
70
|
+
name: "star",
|
|
71
|
+
filled: n <= shown,
|
|
72
|
+
className: n <= shown ? "bodhan-rating__star bodhan-rating__star--filled" : "bodhan-rating__star"
|
|
73
|
+
})
|
|
74
|
+
}, n))
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export { Rating };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=Rating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.js","names":[],"sources":["../../../src/components/Rating/Rating.tsx"],"sourcesContent":["import { useRef, useState, type HTMLAttributes, type KeyboardEvent } from 'react';\nimport { Icon } from '../Icon/Icon';\n\nexport type RatingSize = 'small' | 'medium';\n\nexport interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n /** Figma `Value` 0–5 (controlled). */\n value?: number;\n /** Initial value when uncontrolled. */\n defaultValue?: number;\n /** Called with the new value (click / tap a star, ←/→/↑/↓, Home/End). */\n onValueChange?: (value: number) => void;\n /** Figma `Size`: Small 16 px (read-only display), Medium 24 px (interactive). */\n size?: RatingSize;\n /** Read-only display. Defaults to true for Size=Small, false for Medium. */\n readOnly?: boolean;\n /** Accessible name of the control (\"Rate this lesson\"). */\n label?: string;\n /** Number of stars (5). */\n max?: number;\n disabled?: boolean;\n}\n\n/**\n * Bodhan Rating — 0–5 stars. Filled stars Warning/Strong, empty stars Icon/Secondary (filled vs outline shape,\n * never colour alone). Interactive: a radio group of stars with roving focus (arrow keys). Read-only: one image\n * \"Rating, 3 of 5 stars\". Shared on every platform. Android: RatingBar-style Row · iOS: HStack with adjustable action.\n */\nexport function Rating({\n value, defaultValue = 0, onValueChange, size = 'small', readOnly, label = 'Rating', max = 5, disabled,\n className, ...rest\n}: RatingProps) {\n const [inner, setInner] = useState(defaultValue);\n const [hover, setHover] = useState<number | null>(null);\n const current = Math.max(0, Math.min(max, Math.round(value ?? inner)));\n const ro = readOnly ?? size === 'small';\n const refs = useRef<(HTMLButtonElement | null)[]>([]);\n const stars = Array.from({ length: max }, (_, i) => i + 1);\n\n if (ro) {\n return (\n <div className={['bodhan-rating', className].filter(Boolean).join(' ')} data-size={size} data-readonly=\"\"\n role=\"img\" aria-label={`${label}, ${current} of ${max} stars`} {...rest}>\n {stars.map((n) => (\n <Icon key={n} name=\"star\" filled={n <= current} className={n <= current ? 'bodhan-rating__star bodhan-rating__star--filled' : 'bodhan-rating__star'} />\n ))}\n </div>\n );\n }\n\n const set = (n: number) => {\n const v = Math.max(1, Math.min(max, n));\n if (value === undefined) setInner(v);\n onValueChange?.(v);\n refs.current[v - 1]?.focus();\n };\n const onKey = (e: KeyboardEvent) => {\n const k = e.key;\n const base = current || 0;\n if (k === 'ArrowRight' || k === 'ArrowUp') set(base + 1);\n else if (k === 'ArrowLeft' || k === 'ArrowDown') set(base - 1);\n else if (k === 'Home') set(1);\n else if (k === 'End') set(max);\n else return;\n e.preventDefault();\n };\n const shown = hover ?? current;\n return (\n <div className={['bodhan-rating', className].filter(Boolean).join(' ')} data-size={size}\n role=\"radiogroup\" aria-label={label} aria-disabled={disabled || undefined}\n onKeyDown={disabled ? undefined : onKey} onMouseLeave={() => setHover(null)} {...rest}>\n {stars.map((n) => (\n <button\n key={n}\n ref={(el) => { refs.current[n - 1] = el; }}\n type=\"button\"\n role=\"radio\"\n aria-checked={n === current}\n aria-label={`${n} ${n === 1 ? 'star' : 'stars'}`}\n tabIndex={n === (current || 1) ? 0 : -1}\n disabled={disabled}\n className=\"bodhan-rating__button\"\n onClick={() => set(n)}\n onMouseEnter={() => setHover(n)}\n >\n <Icon name=\"star\" filled={n <= shown} className={n <= shown ? 'bodhan-rating__star bodhan-rating__star--filled' : 'bodhan-rating__star'} />\n </button>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AA4BA,SAAgB,OAAO,EACrB,OAAO,eAAe,GAAG,eAAe,OAAO,SAAS,UAAU,QAAQ,UAAU,MAAM,GAAG,UAC7F,WAAW,GAAG,QACA;CACd,MAAM,CAAC,OAAO,YAAY,SAAS,YAAY;CAC/C,MAAM,CAAC,OAAO,YAAY,SAAwB,IAAI;CACtD,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,SAAS,KAAK,CAAC,CAAC;CACrE,MAAM,KAAK,YAAY,SAAS;CAChC,MAAM,OAAO,OAAqC,CAAC,CAAC;CACpD,MAAM,QAAQ,MAAM,KAAK,EAAE,QAAQ,IAAI,IAAI,GAAG,MAAM,IAAI,CAAC;CAEzD,IAAI,IACF,OACE,oBAAC,OAAD;EAAK,WAAW,CAAC,iBAAiB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAG,aAAW;EAAM,iBAAc;EACrG,MAAK;EAAM,cAAY,GAAG,MAAM,IAAI,QAAQ,MAAM,IAAI;EAAS,GAAI;EAClE,UAAA,MAAM,KAAK,MACV,oBAAC,MAAD;GAAc,MAAK;GAAO,QAAQ,KAAK;GAAS,WAAW,KAAK,UAAU,oDAAoD;EAAwB,GAA3I,CAA2I,CACvJ;CACE,CAAA;CAIT,MAAM,OAAO,MAAc;EACzB,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC;EACtC,IAAI,UAAU,KAAA,GAAW,SAAS,CAAC;EACnC,gBAAgB,CAAC;EACjB,KAAK,QAAQ,IAAI,EAAE,EAAE,MAAM;CAC7B;CACA,MAAM,SAAS,MAAqB;EAClC,MAAM,IAAI,EAAE;EACZ,MAAM,OAAO,WAAW;EACxB,IAAI,MAAM,gBAAgB,MAAM,WAAW,IAAI,OAAO,CAAC;OAClD,IAAI,MAAM,eAAe,MAAM,aAAa,IAAI,OAAO,CAAC;OACxD,IAAI,MAAM,QAAQ,IAAI,CAAC;OACvB,IAAI,MAAM,OAAO,IAAI,GAAG;OACxB;EACL,EAAE,eAAe;CACnB;CACA,MAAM,QAAQ,SAAS;CACvB,OACE,oBAAC,OAAD;EAAK,WAAW,CAAC,iBAAiB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAG,aAAW;EACjF,MAAK;EAAa,cAAY;EAAO,iBAAe,YAAY,KAAA;EAChE,WAAW,WAAW,KAAA,IAAY;EAAO,oBAAoB,SAAS,IAAI;EAAG,GAAI;EAChF,UAAA,MAAM,KAAK,MACV,oBAAC,UAAD;GAEE,MAAM,OAAO;IAAE,KAAK,QAAQ,IAAI,KAAK;GAAI;GACzC,MAAK;GACL,MAAK;GACL,gBAAc,MAAM;GACpB,cAAY,GAAG,EAAE,GAAG,MAAM,IAAI,SAAS;GACvC,UAAU,OAAO,WAAW,KAAK,IAAI;GAC3B;GACV,WAAU;GACV,eAAe,IAAI,CAAC;GACpB,oBAAoB,SAAS,CAAC;GAE9B,UAAA,oBAAC,MAAD;IAAM,MAAK;IAAO,QAAQ,KAAK;IAAO,WAAW,KAAK,QAAQ,oDAAoD;GAAwB,CAAA;EACpI,GAbD,CAaC,CACT;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type ReadAloudState = 'idle' | 'playing' | 'paused';
|
|
3
|
+
export interface ReadAloudProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
|
+
/** Figma `State`. Controlled when set; otherwise the control keeps its own state (Listen → Playing ⇄ Paused). */
|
|
5
|
+
state?: ReadAloudState;
|
|
6
|
+
/** Called with the next state when the play / pause button is pressed. */
|
|
7
|
+
onStateChange?: (state: ReadAloudState) => void;
|
|
8
|
+
/** Elapsed time label, e.g. "0:12". */
|
|
9
|
+
elapsed?: string;
|
|
10
|
+
/** Total duration label, e.g. "0:48". */
|
|
11
|
+
duration?: string;
|
|
12
|
+
/** Playback speed. Controlled when set; the speed button cycles 0.75 → 1 → 1.25 → 1.5. */
|
|
13
|
+
speed?: number;
|
|
14
|
+
/** Called with the next speed. */
|
|
15
|
+
onSpeedChange?: (speed: number) => void;
|
|
16
|
+
/** Idle label (Figma "Listen"). */
|
|
17
|
+
label?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Bodhan Read Aloud — read-aloud control in the answer action row. Idle ("Listen") → Playing (time, speed) → Paused.
|
|
21
|
+
* Shared on every platform. Speech itself comes from the platform (Web SpeechSynthesis · Android TextToSpeech ·
|
|
22
|
+
* iOS AVSpeechSynthesizer); this is only the control. Android: custom composable · iOS: custom view.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ReadAloud({ state, onStateChange, elapsed, duration, speed, onSpeedChange, label, className, ...rest }: ReadAloudProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Icon } from "../Icon/Icon.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
// src/components/ReadAloud/ReadAloud.tsx
|
|
5
|
+
var SPEEDS = [
|
|
6
|
+
.75,
|
|
7
|
+
1,
|
|
8
|
+
1.25,
|
|
9
|
+
1.5
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Bodhan Read Aloud — read-aloud control in the answer action row. Idle ("Listen") → Playing (time, speed) → Paused.
|
|
13
|
+
* Shared on every platform. Speech itself comes from the platform (Web SpeechSynthesis · Android TextToSpeech ·
|
|
14
|
+
* iOS AVSpeechSynthesizer); this is only the control. Android: custom composable · iOS: custom view.
|
|
15
|
+
*/
|
|
16
|
+
function ReadAloud({ state, onStateChange, elapsed = "0:12", duration = "0:48", speed, onSpeedChange, label = "Listen", className, ...rest }) {
|
|
17
|
+
const [ownState, setOwnState] = useState("idle");
|
|
18
|
+
const [ownSpeed, setOwnSpeed] = useState(1);
|
|
19
|
+
const s = state ?? ownState;
|
|
20
|
+
const sp = speed ?? ownSpeed;
|
|
21
|
+
const toggle = () => {
|
|
22
|
+
const next = s === "playing" ? "paused" : "playing";
|
|
23
|
+
if (state === void 0) setOwnState(next);
|
|
24
|
+
onStateChange?.(next);
|
|
25
|
+
};
|
|
26
|
+
const cycle = () => {
|
|
27
|
+
const next = SPEEDS[(SPEEDS.indexOf(sp) + 1) % SPEEDS.length] ?? 1;
|
|
28
|
+
if (speed === void 0) setOwnSpeed(next);
|
|
29
|
+
onSpeedChange?.(next);
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: ["bodhan-read-aloud", className].filter(Boolean).join(" "),
|
|
33
|
+
"data-state": s,
|
|
34
|
+
...rest,
|
|
35
|
+
children: s === "idle" ? /* @__PURE__ */ jsxs("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
className: "bodhan-read-aloud__main",
|
|
38
|
+
onClick: toggle,
|
|
39
|
+
"aria-label": "Read answer aloud",
|
|
40
|
+
children: [/* @__PURE__ */ jsx(Icon, { name: "volume_up" }), /* @__PURE__ */ jsx("span", { children: label })]
|
|
41
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ jsxs("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
className: "bodhan-read-aloud__main",
|
|
45
|
+
onClick: toggle,
|
|
46
|
+
"aria-label": s === "playing" ? "Pause reading" : "Resume reading",
|
|
47
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
48
|
+
name: s === "playing" ? "pause" : "play_arrow",
|
|
49
|
+
filled: s === "playing"
|
|
50
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
51
|
+
className: "bodhan-read-aloud__time",
|
|
52
|
+
"aria-label": `${elapsed} of ${duration}`,
|
|
53
|
+
children: [
|
|
54
|
+
elapsed,
|
|
55
|
+
" / ",
|
|
56
|
+
duration
|
|
57
|
+
]
|
|
58
|
+
})]
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsx("span", {
|
|
61
|
+
className: "bodhan-read-aloud__divider",
|
|
62
|
+
"aria-hidden": "true"
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ jsxs("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
className: "bodhan-read-aloud__speed",
|
|
67
|
+
onClick: cycle,
|
|
68
|
+
"aria-label": `Playback speed ${sp}×, change speed`,
|
|
69
|
+
children: [sp, "×"]
|
|
70
|
+
})
|
|
71
|
+
] })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export { ReadAloud };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=ReadAloud.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadAloud.js","names":["_Fragment"],"sources":["../../../src/components/ReadAloud/ReadAloud.tsx"],"sourcesContent":["import { useState, type HTMLAttributes } from 'react';\nimport { Icon } from '../Icon/Icon';\n\nexport type ReadAloudState = 'idle' | 'playing' | 'paused';\n\nexport interface ReadAloudProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Figma `State`. Controlled when set; otherwise the control keeps its own state (Listen → Playing ⇄ Paused). */\n state?: ReadAloudState;\n /** Called with the next state when the play / pause button is pressed. */\n onStateChange?: (state: ReadAloudState) => void;\n /** Elapsed time label, e.g. \"0:12\". */\n elapsed?: string;\n /** Total duration label, e.g. \"0:48\". */\n duration?: string;\n /** Playback speed. Controlled when set; the speed button cycles 0.75 → 1 → 1.25 → 1.5. */\n speed?: number;\n /** Called with the next speed. */\n onSpeedChange?: (speed: number) => void;\n /** Idle label (Figma \"Listen\"). */\n label?: string;\n}\n\nconst SPEEDS = [0.75, 1, 1.25, 1.5];\n\n/**\n * Bodhan Read Aloud — read-aloud control in the answer action row. Idle (\"Listen\") → Playing (time, speed) → Paused.\n * Shared on every platform. Speech itself comes from the platform (Web SpeechSynthesis · Android TextToSpeech ·\n * iOS AVSpeechSynthesizer); this is only the control. Android: custom composable · iOS: custom view.\n */\nexport function ReadAloud({\n state, onStateChange, elapsed = '0:12', duration = '0:48', speed, onSpeedChange, label = 'Listen', className, ...rest\n}: ReadAloudProps) {\n const [ownState, setOwnState] = useState<ReadAloudState>('idle');\n const [ownSpeed, setOwnSpeed] = useState(1);\n const s = state ?? ownState;\n const sp = speed ?? ownSpeed;\n const toggle = () => {\n const next: ReadAloudState = s === 'playing' ? 'paused' : 'playing';\n if (state === undefined) setOwnState(next);\n onStateChange?.(next);\n };\n const cycle = () => {\n const next = SPEEDS[(SPEEDS.indexOf(sp) + 1) % SPEEDS.length] ?? 1;\n if (speed === undefined) setOwnSpeed(next);\n onSpeedChange?.(next);\n };\n return (\n <div className={['bodhan-read-aloud', className].filter(Boolean).join(' ')} data-state={s} {...rest}>\n {s === 'idle' ? (\n <button type=\"button\" className=\"bodhan-read-aloud__main\" onClick={toggle} aria-label=\"Read answer aloud\">\n <Icon name=\"volume_up\" />\n <span>{label}</span>\n </button>\n ) : (\n <>\n <button type=\"button\" className=\"bodhan-read-aloud__main\" onClick={toggle}\n aria-label={s === 'playing' ? 'Pause reading' : 'Resume reading'}>\n <Icon name={s === 'playing' ? 'pause' : 'play_arrow'} filled={s === 'playing'} />\n <span className=\"bodhan-read-aloud__time\" aria-label={`${elapsed} of ${duration}`}>{elapsed} / {duration}</span>\n </button>\n <span className=\"bodhan-read-aloud__divider\" aria-hidden=\"true\" />\n <button type=\"button\" className=\"bodhan-read-aloud__speed\" onClick={cycle} aria-label={`Playback speed ${sp}×, change speed`}>\n {sp}×\n </button>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;AAsBA,IAAM,SAAS;CAAC;CAAM;CAAG;CAAM;AAAG;;;;;;AAOlC,SAAgB,UAAU,EACxB,OAAO,eAAe,UAAU,QAAQ,WAAW,QAAQ,OAAO,eAAe,QAAQ,UAAU,WAAW,GAAG,QAChG;CACjB,MAAM,CAAC,UAAU,eAAe,SAAyB,MAAM;CAC/D,MAAM,CAAC,UAAU,eAAe,SAAS,CAAC;CAC1C,MAAM,IAAI,SAAS;CACnB,MAAM,KAAK,SAAS;CACpB,MAAM,eAAe;EACnB,MAAM,OAAuB,MAAM,YAAY,WAAW;EAC1D,IAAI,UAAU,KAAA,GAAW,YAAY,IAAI;EACzC,gBAAgB,IAAI;CACtB;CACA,MAAM,cAAc;EAClB,MAAM,OAAO,QAAQ,OAAO,QAAQ,EAAE,IAAI,KAAK,OAAO,WAAW;EACjE,IAAI,UAAU,KAAA,GAAW,YAAY,IAAI;EACzC,gBAAgB,IAAI;CACtB;CACA,OACE,oBAAC,OAAD;EAAK,WAAW,CAAC,qBAAqB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAG,cAAY;EAAG,GAAI;EAC5F,UAAA,MAAM,SACL,qBAAC,UAAD;GAAQ,MAAK;GAAS,WAAU;GAA0B,SAAS;GAAQ,cAAW;GAAtF,UAAA,CACE,oBAAC,MAAD,EAAM,MAAK,YAAa,CAAA,GACxB,oBAAC,QAAD,EAAA,UAAO,MAAY,CAAA,CACb;EAER,CAAA,IAAA,qBAAAA,UAAA,EAAA,UAAA;GACE,qBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAA0B,SAAS;IACjE,cAAY,MAAM,YAAY,kBAAkB;IADlD,UAAA,CAEE,oBAAC,MAAD;KAAM,MAAM,MAAM,YAAY,UAAU;KAAc,QAAQ,MAAM;IAAY,CAAA,GAChF,qBAAC,QAAD;KAAM,WAAU;KAA0B,cAAY,GAAG,QAAQ,MAAM;KAAvE,UAAA;MAAoF;MAAQ;MAAI;KAAe;IACzG,CAAA,CAAA;;GACR,oBAAC,QAAD;IAAM,WAAU;IAA6B,eAAY;GAAQ,CAAA;GACjE,qBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAA2B,SAAS;IAAO,cAAY,kBAAkB,GAAG;IAA5G,UAAA,CACG,IAAG,GACE;;EACR,EAAA,CAAA;CAED,CAAA;AAET"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface RecommendationCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
3
|
+
/** Eyebrow (default "Recommended for you"). */
|
|
4
|
+
eyebrow?: ReactNode;
|
|
5
|
+
/** What to do next. */
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
/** Meta: length, "at your level". */
|
|
8
|
+
meta?: ReactNode;
|
|
9
|
+
/** Reason row — always show why. */
|
|
10
|
+
reason?: ReactNode;
|
|
11
|
+
/** "Why?" link — opens Why This Sheet. */
|
|
12
|
+
onWhy?: () => void;
|
|
13
|
+
/** Primary action label (default "Start"). */
|
|
14
|
+
actionLabel?: string;
|
|
15
|
+
onAction?: () => void;
|
|
16
|
+
/** Not now — dismisses (collapse + Undo in the host). */
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
/** Overflow (Show fewer like this, Personalisation settings). Shown when set. */
|
|
19
|
+
onMore?: () => void;
|
|
20
|
+
/** Heading level of the title (default 3). */
|
|
21
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Bodhan Recommendation Card — personalised "what to do next" with the reason (adaptive UX).
|
|
25
|
+
* Same anatomy on Web, iOS and Android; nested Buttons follow the `06 Platform` mode and the overflow glyph is
|
|
26
|
+
* more_vert (Web/Android) or the iOS "ellipsis" (more_horiz). Compose: Card + Row · SwiftUI: custom view in a List.
|
|
27
|
+
*/
|
|
28
|
+
export declare function RecommendationCard({ eyebrow, title, meta, reason, onWhy, actionLabel, onAction, onDismiss, onMore, headingLevel, className, ...rest }: RecommendationCardProps): import("react").JSX.Element;
|