@databiosphere/findable-ui 49.0.0 → 49.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +26 -0
- package/lib/common/ai/config/types.d.ts +22 -0
- package/lib/common/ai/config/types.js +1 -0
- package/lib/common/ai/constants.d.ts +3 -0
- package/lib/common/ai/constants.js +3 -0
- package/lib/components/Filter/components/FilterLabel/filterLabel.js +1 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.d.ts +3 -0
- package/lib/components/Filter/components/FilterLabel/filterLabel.stories.js +5 -0
- package/lib/components/Filter/components/Filters/stories/constants.js +21 -1
- package/lib/components/Filter/components/SearchAllFilters/searchAllFilters.styles.js +2 -0
- package/lib/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.d.ts +4 -0
- package/lib/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.js +4 -0
- package/lib/components/common/Chip/components/Beta/beta.d.ts +10 -0
- package/lib/components/common/Chip/components/Beta/beta.js +12 -0
- package/lib/components/common/Chip/components/Beta/beta.styles.d.ts +3 -0
- package/lib/components/common/Chip/components/Beta/beta.styles.js +14 -0
- package/lib/components/common/Chip/components/Beta/stories/beta.stories.d.ts +6 -0
- package/lib/components/common/Chip/components/Beta/stories/beta.stories.js +6 -0
- package/lib/components/common/CustomIcon/components/UpArrowIcon/upArrowIcon.d.ts +6 -0
- package/lib/components/common/CustomIcon/components/UpArrowIcon/upArrowIcon.js +8 -0
- package/lib/components/common/Tabs/tabs.js +1 -1
- package/lib/components/common/ToggleButtonGroup/provider/context.d.ts +2 -0
- package/lib/components/common/ToggleButtonGroup/provider/context.js +5 -0
- package/lib/components/common/ToggleButtonGroup/provider/hook.d.ts +7 -0
- package/lib/components/common/ToggleButtonGroup/provider/hook.js +9 -0
- package/lib/components/common/ToggleButtonGroup/provider/provider.d.ts +12 -0
- package/lib/components/common/ToggleButtonGroup/provider/provider.js +22 -0
- package/lib/components/common/ToggleButtonGroup/provider/types.d.ts +9 -0
- package/lib/components/common/ToggleButtonGroup/provider/types.js +1 -0
- package/lib/config/entities.d.ts +2 -0
- package/lib/hooks/ai/useAiRoutes/hook.d.ts +6 -0
- package/lib/hooks/ai/useAiRoutes/hook.js +18 -0
- package/lib/styles/common/mui/drawer.d.ts +9 -0
- package/lib/styles/common/mui/drawer.js +15 -0
- package/lib/styles/common/mui/inputBase.d.ts +13 -0
- package/lib/styles/common/mui/inputBase.js +25 -0
- package/lib/styles/common/mui/stack.d.ts +11 -0
- package/lib/styles/common/mui/stack.js +22 -0
- package/lib/tests/testIds.d.ts +3 -0
- package/lib/tests/testIds.js +3 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.d.ts +6 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.js +17 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.d.ts +6 -0
- package/lib/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.js +23 -0
- package/lib/views/ExploreView/entityList/filters/filters.styles.d.ts +7 -0
- package/lib/views/ExploreView/entityList/filters/filters.styles.js +17 -0
- package/lib/views/ExploreView/exploreView.js +3 -2
- package/lib/views/ResearchView/assistant/assistant.d.ts +6 -0
- package/lib/views/ResearchView/assistant/assistant.js +16 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.js +15 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.styles.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Drawer/drawer.styles.js +21 -0
- package/lib/views/ResearchView/assistant/components/Drawer/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Drawer/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Form/constants.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Form/constants.js +3 -0
- package/lib/views/ResearchView/assistant/components/Form/form.d.ts +11 -0
- package/lib/views/ResearchView/assistant/components/Form/form.js +27 -0
- package/lib/views/ResearchView/assistant/components/Form/form.styles.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Form/form.styles.js +7 -0
- package/lib/views/ResearchView/assistant/components/Form/types.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Form/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Form/utils.d.ts +16 -0
- package/lib/views/ResearchView/assistant/components/Form/utils.js +41 -0
- package/lib/views/ResearchView/assistant/components/Input/constants.d.ts +2 -0
- package/lib/views/ResearchView/assistant/components/Input/constants.js +14 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/constants.d.ts +7 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/constants.js +7 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/hook.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/hook.js +32 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/types.d.ts +8 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/utils.d.ts +32 -0
- package/lib/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/utils.js +74 -0
- package/lib/views/ResearchView/assistant/components/Input/input.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Input/input.js +19 -0
- package/lib/views/ResearchView/assistant/components/Input/input.styles.d.ts +8 -0
- package/lib/views/ResearchView/assistant/components/Input/input.styles.js +19 -0
- package/lib/views/ResearchView/assistant/components/Input/stories/input.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/Input/stories/input.stories.js +11 -0
- package/lib/views/ResearchView/assistant/components/Input/types.d.ts +2 -0
- package/lib/views/ResearchView/assistant/components/Input/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Input/utils.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Input/utils.js +25 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/assistantMessage.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/assistantMessage.js +15 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/utils.d.ts +13 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/AssistantMessage/utils.js +25 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/errorMessage.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/errorMessage.js +12 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/ErrorMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.js +10 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.js +26 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/types.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/promptMessage.d.ts +10 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/promptMessage.js +14 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/types.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/PromptMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/useMessage.styles.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/useMessage.styles.js +10 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/userMessage.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/components/UserMessage/userMessage.js +13 -0
- package/lib/views/ResearchView/assistant/components/Messages/hooks/UseScroll/hook.d.ts +8 -0
- package/lib/views/ResearchView/assistant/components/Messages/hooks/UseScroll/hook.js +20 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.d.ts +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.js +16 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.styles.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/messages.styles.js +9 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/messageSelector.d.ts +17 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/messageSelector.js +32 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/types.d.ts +5 -0
- package/lib/views/ResearchView/assistant/components/Messages/selector/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/args.d.ts +3 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/args.js +109 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/messages.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/Messages/stories/messages.stories.js +14 -0
- package/lib/views/ResearchView/assistant/components/Messages/types.d.ts +4 -0
- package/lib/views/ResearchView/assistant/components/Messages/types.js +1 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.js +12 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.js +16 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.styles.d.ts +6 -0
- package/lib/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.styles.js +20 -0
- package/lib/views/ResearchView/assistant/stories/args.d.ts +4 -0
- package/lib/views/ResearchView/assistant/stories/args.js +30 -0
- package/lib/views/ResearchView/assistant/stories/assistant.stories.d.ts +6 -0
- package/lib/views/ResearchView/assistant/stories/assistant.stories.js +23 -0
- package/lib/views/ResearchView/query/constants.d.ts +5 -0
- package/lib/views/ResearchView/query/constants.js +5 -0
- package/lib/views/ResearchView/query/fetch.d.ts +17 -0
- package/lib/views/ResearchView/query/fetch.js +44 -0
- package/lib/views/ResearchView/researchView.d.ts +10 -0
- package/lib/views/ResearchView/researchView.js +13 -0
- package/lib/views/ResearchView/state/actions/setError/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setError/action.js +17 -0
- package/lib/views/ResearchView/state/actions/setError/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setError/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setError/types.d.ts +14 -0
- package/lib/views/ResearchView/state/actions/setError/types.js +1 -0
- package/lib/views/ResearchView/state/actions/setMessage/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setMessage/action.js +21 -0
- package/lib/views/ResearchView/state/actions/setMessage/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setMessage/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setMessage/types.d.ts +15 -0
- package/lib/views/ResearchView/state/actions/setMessage/types.js +1 -0
- package/lib/views/ResearchView/state/actions/setQuery/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setQuery/action.js +17 -0
- package/lib/views/ResearchView/state/actions/setQuery/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setQuery/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setQuery/types.d.ts +14 -0
- package/lib/views/ResearchView/state/actions/setQuery/types.js +1 -0
- package/lib/views/ResearchView/state/actions/setStatus/action.d.ts +10 -0
- package/lib/views/ResearchView/state/actions/setStatus/action.js +13 -0
- package/lib/views/ResearchView/state/actions/setStatus/dispatch.d.ts +7 -0
- package/lib/views/ResearchView/state/actions/setStatus/dispatch.js +12 -0
- package/lib/views/ResearchView/state/actions/setStatus/types.d.ts +14 -0
- package/lib/views/ResearchView/state/actions/setStatus/types.js +1 -0
- package/lib/views/ResearchView/state/actions/types.d.ts +17 -0
- package/lib/views/ResearchView/state/actions/types.js +10 -0
- package/lib/views/ResearchView/state/constants.d.ts +5 -0
- package/lib/views/ResearchView/state/constants.js +7 -0
- package/lib/views/ResearchView/state/context.d.ts +5 -0
- package/lib/views/ResearchView/state/context.js +9 -0
- package/lib/views/ResearchView/state/guards/guards.d.ts +33 -0
- package/lib/views/ResearchView/state/guards/guards.js +41 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/hook.d.ts +6 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/hook.js +26 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/types.d.ts +10 -0
- package/lib/views/ResearchView/state/hooks/UseChatDispatch/types.js +1 -0
- package/lib/views/ResearchView/state/hooks/UseChatReducer/hook.d.ts +8 -0
- package/lib/views/ResearchView/state/hooks/UseChatReducer/hook.js +12 -0
- package/lib/views/ResearchView/state/hooks/UseChatState/hook.d.ts +7 -0
- package/lib/views/ResearchView/state/hooks/UseChatState/hook.js +11 -0
- package/lib/views/ResearchView/state/initializer/initializer.d.ts +8 -0
- package/lib/views/ResearchView/state/initializer/initializer.js +22 -0
- package/lib/views/ResearchView/state/initializer/types.d.ts +2 -0
- package/lib/views/ResearchView/state/initializer/types.js +1 -0
- package/lib/views/ResearchView/state/provider.d.ts +19 -0
- package/lib/views/ResearchView/state/provider.js +20 -0
- package/lib/views/ResearchView/state/query/context.d.ts +5 -0
- package/lib/views/ResearchView/state/query/context.js +7 -0
- package/lib/views/ResearchView/state/query/hooks/UseQuery/hook.d.ts +6 -0
- package/lib/views/ResearchView/state/query/hooks/UseQuery/hook.js +9 -0
- package/lib/views/ResearchView/state/query/hooks/UseSubmit/hook.d.ts +7 -0
- package/lib/views/ResearchView/state/query/hooks/UseSubmit/hook.js +46 -0
- package/lib/views/ResearchView/state/query/provider.d.ts +13 -0
- package/lib/views/ResearchView/state/query/provider.js +15 -0
- package/lib/views/ResearchView/state/query/types.d.ts +24 -0
- package/lib/views/ResearchView/state/query/types.js +1 -0
- package/lib/views/ResearchView/state/reducer.d.ts +10 -0
- package/lib/views/ResearchView/state/reducer.js +32 -0
- package/lib/views/ResearchView/state/types.d.ts +125 -0
- package/lib/views/ResearchView/state/types.js +22 -0
- package/package.json +1 -1
- package/src/common/ai/config/types.ts +25 -0
- package/src/common/ai/constants.ts +3 -0
- package/src/components/Filter/components/FilterLabel/filterLabel.stories.tsx +6 -0
- package/src/components/Filter/components/FilterLabel/filterLabel.tsx +6 -1
- package/src/components/Filter/components/Filters/stories/constants.ts +25 -1
- package/src/components/Filter/components/SearchAllFilters/searchAllFilters.styles.ts +2 -0
- package/src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts +4 -0
- package/src/components/common/Chip/components/Beta/beta.styles.ts +15 -0
- package/src/components/common/Chip/components/Beta/beta.tsx +25 -0
- package/src/components/common/Chip/components/Beta/stories/beta.stories.tsx +12 -0
- package/src/components/common/CustomIcon/components/UpArrowIcon/upArrowIcon.tsx +21 -0
- package/src/components/common/Tabs/tabs.tsx +5 -1
- package/src/components/common/ToggleButtonGroup/provider/context.ts +9 -0
- package/src/components/common/ToggleButtonGroup/provider/hook.ts +16 -0
- package/src/components/common/ToggleButtonGroup/provider/provider.tsx +37 -0
- package/src/components/common/ToggleButtonGroup/provider/types.ts +17 -0
- package/src/config/entities.ts +2 -0
- package/src/hooks/ai/useAiRoutes/hook.ts +22 -0
- package/src/styles/common/mui/drawer.ts +24 -0
- package/src/styles/common/mui/inputBase.ts +38 -0
- package/src/styles/common/mui/stack.ts +33 -0
- package/src/tests/testIds.ts +3 -0
- package/src/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.styles.ts +25 -0
- package/src/views/ExploreView/entityList/filters/components/ToggleButtonGroup/toggleButtonGroup.tsx +35 -0
- package/src/views/ExploreView/entityList/filters/filters.styles.ts +19 -0
- package/src/views/ExploreView/exploreView.tsx +16 -12
- package/src/views/ResearchView/assistant/assistant.tsx +28 -0
- package/src/views/ResearchView/assistant/components/Drawer/drawer.styles.ts +24 -0
- package/src/views/ResearchView/assistant/components/Drawer/drawer.tsx +26 -0
- package/src/views/ResearchView/assistant/components/Drawer/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Form/constants.ts +3 -0
- package/src/views/ResearchView/assistant/components/Form/form.styles.ts +8 -0
- package/src/views/ResearchView/assistant/components/Form/form.tsx +40 -0
- package/src/views/ResearchView/assistant/components/Form/types.ts +9 -0
- package/src/views/ResearchView/assistant/components/Form/utils.ts +51 -0
- package/src/views/ResearchView/assistant/components/Input/constants.ts +16 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/constants.ts +7 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/hook.ts +45 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/types.ts +10 -0
- package/src/views/ResearchView/assistant/components/Input/hooks/UseKeyShortCuts/utils.ts +93 -0
- package/src/views/ResearchView/assistant/components/Input/input.styles.ts +21 -0
- package/src/views/ResearchView/assistant/components/Input/input.tsx +37 -0
- package/src/views/ResearchView/assistant/components/Input/stories/input.stories.tsx +21 -0
- package/src/views/ResearchView/assistant/components/Input/types.ts +3 -0
- package/src/views/ResearchView/assistant/components/Input/utils.ts +34 -0
- package/src/views/ResearchView/assistant/components/Messages/components/AssistantMessage/assistantMessage.tsx +49 -0
- package/src/views/ResearchView/assistant/components/Messages/components/AssistantMessage/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Messages/components/AssistantMessage/utils.ts +31 -0
- package/src/views/ResearchView/assistant/components/Messages/components/ErrorMessage/errorMessage.tsx +21 -0
- package/src/views/ResearchView/assistant/components/Messages/components/ErrorMessage/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.styles.ts +27 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/chips.tsx +31 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/components/Chips/types.ts +6 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/promptMessage.tsx +26 -0
- package/src/views/ResearchView/assistant/components/Messages/components/PromptMessage/types.ts +6 -0
- package/src/views/ResearchView/assistant/components/Messages/components/UserMessage/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/Messages/components/UserMessage/useMessage.styles.ts +11 -0
- package/src/views/ResearchView/assistant/components/Messages/components/UserMessage/userMessage.tsx +21 -0
- package/src/views/ResearchView/assistant/components/Messages/hooks/UseScroll/hook.ts +25 -0
- package/src/views/ResearchView/assistant/components/Messages/messages.styles.ts +10 -0
- package/src/views/ResearchView/assistant/components/Messages/messages.tsx +29 -0
- package/src/views/ResearchView/assistant/components/Messages/selector/messageSelector.tsx +37 -0
- package/src/views/ResearchView/assistant/components/Messages/selector/types.ts +6 -0
- package/src/views/ResearchView/assistant/components/Messages/stories/args.ts +115 -0
- package/src/views/ResearchView/assistant/components/Messages/stories/messages.stories.tsx +24 -0
- package/src/views/ResearchView/assistant/components/Messages/types.ts +5 -0
- package/src/views/ResearchView/assistant/components/ToggleButtonGroup/stories/toggleButtonGroup.stories.tsx +22 -0
- package/src/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.styles.ts +22 -0
- package/src/views/ResearchView/assistant/components/ToggleButtonGroup/toggleButtonGroup.tsx +34 -0
- package/src/views/ResearchView/assistant/stories/args.ts +36 -0
- package/src/views/ResearchView/assistant/stories/assistant.stories.tsx +39 -0
- package/src/views/ResearchView/query/constants.ts +5 -0
- package/src/views/ResearchView/query/fetch.ts +58 -0
- package/src/views/ResearchView/researchView.tsx +19 -0
- package/src/views/ResearchView/state/actions/setError/action.ts +22 -0
- package/src/views/ResearchView/state/actions/setError/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setError/types.ts +16 -0
- package/src/views/ResearchView/state/actions/setMessage/action.ts +26 -0
- package/src/views/ResearchView/state/actions/setMessage/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setMessage/types.ts +19 -0
- package/src/views/ResearchView/state/actions/setQuery/action.ts +22 -0
- package/src/views/ResearchView/state/actions/setQuery/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setQuery/types.ts +16 -0
- package/src/views/ResearchView/state/actions/setStatus/action.ts +19 -0
- package/src/views/ResearchView/state/actions/setStatus/dispatch.ts +14 -0
- package/src/views/ResearchView/state/actions/setStatus/types.ts +16 -0
- package/src/views/ResearchView/state/actions/types.ts +23 -0
- package/src/views/ResearchView/state/constants.ts +9 -0
- package/src/views/ResearchView/state/context.ts +11 -0
- package/src/views/ResearchView/state/guards/guards.ts +58 -0
- package/src/views/ResearchView/state/hooks/UseChatDispatch/hook.ts +46 -0
- package/src/views/ResearchView/state/hooks/UseChatDispatch/types.ts +11 -0
- package/src/views/ResearchView/state/hooks/UseChatReducer/hook.ts +15 -0
- package/src/views/ResearchView/state/hooks/UseChatState/hook.ts +14 -0
- package/src/views/ResearchView/state/initializer/initializer.ts +23 -0
- package/src/views/ResearchView/state/initializer/types.ts +3 -0
- package/src/views/ResearchView/state/provider.tsx +34 -0
- package/src/views/ResearchView/state/query/context.ts +9 -0
- package/src/views/ResearchView/state/query/hooks/UseQuery/hook.ts +11 -0
- package/src/views/ResearchView/state/query/hooks/UseSubmit/hook.ts +66 -0
- package/src/views/ResearchView/state/query/provider.tsx +27 -0
- package/src/views/ResearchView/state/query/types.ts +31 -0
- package/src/views/ResearchView/state/reducer.ts +34 -0
- package/src/views/ResearchView/state/types.ts +149 -0
- package/tests/research.assistantMessageUtils.test.ts +149 -0
- package/tests/research.chatState.test.ts +463 -0
- package/tests/research.fetchResponse.test.ts +164 -0
- package/tests/research.queryProvider.test.ts +321 -0
- package/tests/research.useKeyShortCuts.test.ts +254 -0
- package/tests/toggleButtonGroupProvider.test.tsx +125 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChatState } from "../types";
|
|
2
|
+
import { InitialArgs } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Initializer function for the chat reducer, returning initial state.
|
|
5
|
+
* @param initialArgs - Initial arguments.
|
|
6
|
+
* @returns The initialized chat state.
|
|
7
|
+
*/
|
|
8
|
+
export declare function initializer(initialArgs?: InitialArgs): ChatState;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { INITIAL_STATE } from "../constants";
|
|
2
|
+
import { MESSAGE_TYPE } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Initializer function for the chat reducer, returning initial state.
|
|
5
|
+
* @param initialArgs - Initial arguments.
|
|
6
|
+
* @returns The initialized chat state.
|
|
7
|
+
*/
|
|
8
|
+
export function initializer(initialArgs) {
|
|
9
|
+
if (!initialArgs)
|
|
10
|
+
return INITIAL_STATE;
|
|
11
|
+
return {
|
|
12
|
+
...INITIAL_STATE,
|
|
13
|
+
messages: [
|
|
14
|
+
{
|
|
15
|
+
...initialArgs,
|
|
16
|
+
createdAt: Date.now(),
|
|
17
|
+
initial: true,
|
|
18
|
+
type: MESSAGE_TYPE.PROMPT,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSX, ReactNode } from "react";
|
|
2
|
+
import { InitialArgs } from "./initializer/types";
|
|
3
|
+
/**
|
|
4
|
+
* Provider for Chat state.
|
|
5
|
+
* Manages chat state such as query and response data.
|
|
6
|
+
* Nests QueryProvider to own the fetch lifecycle for query submission.
|
|
7
|
+
*
|
|
8
|
+
* @param props - Props.
|
|
9
|
+
* @param props.children - Children.
|
|
10
|
+
* @param props.initialArgs - Initial arguments.
|
|
11
|
+
* @param props.url - URL for the query endpoint.
|
|
12
|
+
*
|
|
13
|
+
* @returns A context provider wrapping the given children.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ChatProvider({ children, initialArgs, url, }: {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
initialArgs?: InitialArgs;
|
|
18
|
+
url: string;
|
|
19
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ChatContext } from "./context";
|
|
3
|
+
import { useChatReducer } from "./hooks/UseChatReducer/hook";
|
|
4
|
+
import { QueryProvider } from "./query/provider";
|
|
5
|
+
/**
|
|
6
|
+
* Provider for Chat state.
|
|
7
|
+
* Manages chat state such as query and response data.
|
|
8
|
+
* Nests QueryProvider to own the fetch lifecycle for query submission.
|
|
9
|
+
*
|
|
10
|
+
* @param props - Props.
|
|
11
|
+
* @param props.children - Children.
|
|
12
|
+
* @param props.initialArgs - Initial arguments.
|
|
13
|
+
* @param props.url - URL for the query endpoint.
|
|
14
|
+
*
|
|
15
|
+
* @returns A context provider wrapping the given children.
|
|
16
|
+
*/
|
|
17
|
+
export function ChatProvider({ children, initialArgs, url, }) {
|
|
18
|
+
const reducer = useChatReducer(initialArgs);
|
|
19
|
+
return (_jsx(ChatContext.Provider, { value: reducer, children: _jsx(QueryProvider, { url: url, children: children }) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { QueryContext } from "../../context";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to access query submission from the QueryProvider.
|
|
5
|
+
* @returns Query context value with onSubmit.
|
|
6
|
+
*/
|
|
7
|
+
export const useQuery = () => {
|
|
8
|
+
return useContext(QueryContext);
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { QueryContextValue } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Hook that manages query submission and abort lifecycle.
|
|
4
|
+
* @param url - The API URL to send queries to.
|
|
5
|
+
* @returns Object containing the onSubmit handler.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSubmit: (url: string) => Pick<QueryContextValue, "onSubmit">;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useCallback, useRef } from "react";
|
|
2
|
+
import { fetchResponse } from "../../../../query/fetch";
|
|
3
|
+
import { useChatDispatch } from "../../../hooks/UseChatDispatch/hook";
|
|
4
|
+
/**
|
|
5
|
+
* Hook that manages query submission and abort lifecycle.
|
|
6
|
+
* @param url - The API URL to send queries to.
|
|
7
|
+
* @returns Object containing the onSubmit handler.
|
|
8
|
+
*/
|
|
9
|
+
export const useSubmit = (url) => {
|
|
10
|
+
const abortRef = useRef(null);
|
|
11
|
+
const dispatch = useChatDispatch();
|
|
12
|
+
const onSubmit = useCallback(async (e, payload, options) => {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
if (options.status.loading)
|
|
15
|
+
return;
|
|
16
|
+
const { query } = payload;
|
|
17
|
+
if (!query)
|
|
18
|
+
return;
|
|
19
|
+
const form = e.currentTarget;
|
|
20
|
+
// Dispatch query and loading state.
|
|
21
|
+
dispatch.onSetQuery(query);
|
|
22
|
+
dispatch.onSetStatus(true);
|
|
23
|
+
form.reset();
|
|
24
|
+
options.onMutate?.(form, query);
|
|
25
|
+
// Abort any in-flight request.
|
|
26
|
+
abortRef.current?.abort();
|
|
27
|
+
const controller = new AbortController();
|
|
28
|
+
abortRef.current = controller;
|
|
29
|
+
await fetchResponse(url, query, {
|
|
30
|
+
controller,
|
|
31
|
+
onError: (error) => {
|
|
32
|
+
dispatch.onSetError(error.message);
|
|
33
|
+
options.onError?.(error);
|
|
34
|
+
},
|
|
35
|
+
onSettled: () => {
|
|
36
|
+
dispatch.onSetStatus(false);
|
|
37
|
+
options.onSettled?.(form);
|
|
38
|
+
},
|
|
39
|
+
onSuccess: (data) => {
|
|
40
|
+
dispatch.onSetMessage(data);
|
|
41
|
+
options.onSuccess?.(data);
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}, [dispatch, url]);
|
|
45
|
+
return { onSubmit };
|
|
46
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Provider that owns the fetch lifecycle for query submission.
|
|
4
|
+
* Persists across page navigation so in-flight requests are not aborted.
|
|
5
|
+
* @param props - Props.
|
|
6
|
+
* @param props.children - Children.
|
|
7
|
+
* @param props.url - URL for the query endpoint.
|
|
8
|
+
* @returns A context provider wrapping the given children.
|
|
9
|
+
*/
|
|
10
|
+
export declare function QueryProvider({ children, url, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
url: string;
|
|
13
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { QueryContext } from "./context";
|
|
3
|
+
import { useSubmit } from "./hooks/UseSubmit/hook";
|
|
4
|
+
/**
|
|
5
|
+
* Provider that owns the fetch lifecycle for query submission.
|
|
6
|
+
* Persists across page navigation so in-flight requests are not aborted.
|
|
7
|
+
* @param props - Props.
|
|
8
|
+
* @param props.children - Children.
|
|
9
|
+
* @param props.url - URL for the query endpoint.
|
|
10
|
+
* @returns A context provider wrapping the given children.
|
|
11
|
+
*/
|
|
12
|
+
export function QueryProvider({ children, url, }) {
|
|
13
|
+
const { onSubmit } = useSubmit(url);
|
|
14
|
+
return (_jsx(QueryContext.Provider, { value: { onSubmit }, children: children }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FormEvent } from "react";
|
|
2
|
+
import { Status } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Options for the onSubmit action.
|
|
5
|
+
*/
|
|
6
|
+
export interface OnSubmitOptions {
|
|
7
|
+
onError?: (error: Error) => void;
|
|
8
|
+
onMutate?: (form: HTMLFormElement, query: string) => void;
|
|
9
|
+
onSettled?: (form: HTMLFormElement) => void;
|
|
10
|
+
onSuccess?: (data: unknown) => void;
|
|
11
|
+
status: Status;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Payload for the onSubmit action.
|
|
15
|
+
*/
|
|
16
|
+
export interface OnSubmitPayload {
|
|
17
|
+
query: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Context value for the QueryProvider.
|
|
21
|
+
*/
|
|
22
|
+
export interface QueryContextValue {
|
|
23
|
+
onSubmit: (e: FormEvent<HTMLFormElement>, payload: OnSubmitPayload, options: OnSubmitOptions) => Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChatAction } from "./actions/types";
|
|
2
|
+
import { ChatState } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Reducer for the Chat state.
|
|
5
|
+
*
|
|
6
|
+
* @param state - State.
|
|
7
|
+
* @param action - Action.
|
|
8
|
+
* @returns State.
|
|
9
|
+
*/
|
|
10
|
+
export declare function chatReducer(state: ChatState, action: ChatAction): ChatState;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { setErrorAction } from "./actions/setError/action";
|
|
2
|
+
import { setMessageAction } from "./actions/setMessage/action";
|
|
3
|
+
import { setQueryAction } from "./actions/setQuery/action";
|
|
4
|
+
import { setStatusAction } from "./actions/setStatus/action";
|
|
5
|
+
import { ChatActionKind } from "./actions/types";
|
|
6
|
+
/**
|
|
7
|
+
* Reducer for the Chat state.
|
|
8
|
+
*
|
|
9
|
+
* @param state - State.
|
|
10
|
+
* @param action - Action.
|
|
11
|
+
* @returns State.
|
|
12
|
+
*/
|
|
13
|
+
export function chatReducer(state, action) {
|
|
14
|
+
const { payload, type } = action;
|
|
15
|
+
switch (type) {
|
|
16
|
+
case ChatActionKind.SetError: {
|
|
17
|
+
return setErrorAction(state, payload);
|
|
18
|
+
}
|
|
19
|
+
case ChatActionKind.SetMessage: {
|
|
20
|
+
return setMessageAction(state, payload);
|
|
21
|
+
}
|
|
22
|
+
case ChatActionKind.SetQuery: {
|
|
23
|
+
return setQueryAction(state, payload);
|
|
24
|
+
}
|
|
25
|
+
case ChatActionKind.SetStatus: {
|
|
26
|
+
return setStatusAction(state, payload);
|
|
27
|
+
}
|
|
28
|
+
default: {
|
|
29
|
+
return state;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { ChatAction } from "./actions/types";
|
|
3
|
+
/**
|
|
4
|
+
* Assistant message in the chat.
|
|
5
|
+
*/
|
|
6
|
+
export interface AssistantMessage<R extends MessageResponse = MessageResponse> extends BaseMessage {
|
|
7
|
+
response: R;
|
|
8
|
+
type: MESSAGE_TYPE.ASSISTANT;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Base message type for chat messages.
|
|
12
|
+
*/
|
|
13
|
+
export interface BaseMessage {
|
|
14
|
+
createdAt: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Context value for the Chat state provider.
|
|
18
|
+
*/
|
|
19
|
+
export interface ChatContextValue {
|
|
20
|
+
dispatch: Dispatch<ChatAction>;
|
|
21
|
+
state: ChatState;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* State for the Chat feature.
|
|
25
|
+
*/
|
|
26
|
+
export interface ChatState {
|
|
27
|
+
messages: Message[];
|
|
28
|
+
status: Status;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Error message in the chat.
|
|
32
|
+
*/
|
|
33
|
+
export interface ErrorMessage extends BaseMessage {
|
|
34
|
+
error: string;
|
|
35
|
+
type: MESSAGE_TYPE.ERROR;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Intent values for the research API response.
|
|
39
|
+
*/
|
|
40
|
+
export declare const INTENT: {
|
|
41
|
+
readonly AUTO: "auto";
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Intent type for the research API response.
|
|
45
|
+
*/
|
|
46
|
+
export type Intent = (typeof INTENT)[keyof typeof INTENT] | (string & {});
|
|
47
|
+
/**
|
|
48
|
+
* Union type for messages in the chat.
|
|
49
|
+
*/
|
|
50
|
+
export type Message<R extends MessageResponse = MessageResponse> = AssistantMessage<R> | ErrorMessage | PromptMessage | UserMessage;
|
|
51
|
+
/**
|
|
52
|
+
* Message types for the chat.
|
|
53
|
+
*/
|
|
54
|
+
export declare enum MESSAGE_TYPE {
|
|
55
|
+
ASSISTANT = "ASSISTANT",
|
|
56
|
+
ERROR = "ERROR",
|
|
57
|
+
PROMPT = "PROMPT",
|
|
58
|
+
USER = "USER"
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Mention extracted from the user query.
|
|
62
|
+
*/
|
|
63
|
+
export interface Mention {
|
|
64
|
+
exclude: boolean;
|
|
65
|
+
facet: string;
|
|
66
|
+
originalText: string;
|
|
67
|
+
values: string[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Response from the research API.
|
|
71
|
+
*/
|
|
72
|
+
export interface MessageResponse {
|
|
73
|
+
intent: Intent;
|
|
74
|
+
message: string | null;
|
|
75
|
+
query: {
|
|
76
|
+
mentions: Mention[];
|
|
77
|
+
message: string | null;
|
|
78
|
+
};
|
|
79
|
+
timing: {
|
|
80
|
+
lookupMs: number;
|
|
81
|
+
pipelineMs: number;
|
|
82
|
+
totalMs: number;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Prompt message in the chat, initiated by the system.
|
|
87
|
+
*/
|
|
88
|
+
export interface PromptMessage extends BaseMessage {
|
|
89
|
+
initial?: boolean;
|
|
90
|
+
inputPlaceholder?: string;
|
|
91
|
+
suggestions?: PromptSuggestion[];
|
|
92
|
+
text: string;
|
|
93
|
+
type: MESSAGE_TYPE.PROMPT;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Suggestion within a prompt message.
|
|
97
|
+
*/
|
|
98
|
+
export interface PromptSuggestion {
|
|
99
|
+
label: string;
|
|
100
|
+
query: string;
|
|
101
|
+
variant: SuggestionVariant;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Status of the chat interaction, such as loading state.
|
|
105
|
+
*/
|
|
106
|
+
export interface Status {
|
|
107
|
+
loading: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Suggestion variant values for rendering suggestions.
|
|
111
|
+
*/
|
|
112
|
+
export declare const SUGGESTION_VARIANT: {
|
|
113
|
+
readonly CHIP: "CHIP";
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Suggestion variant type.
|
|
117
|
+
*/
|
|
118
|
+
export type SuggestionVariant = (typeof SUGGESTION_VARIANT)[keyof typeof SUGGESTION_VARIANT];
|
|
119
|
+
/**
|
|
120
|
+
* User message in the chat.
|
|
121
|
+
*/
|
|
122
|
+
export interface UserMessage extends BaseMessage {
|
|
123
|
+
text: string;
|
|
124
|
+
type: MESSAGE_TYPE.USER;
|
|
125
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent values for the research API response.
|
|
3
|
+
*/
|
|
4
|
+
export const INTENT = {
|
|
5
|
+
AUTO: "auto",
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Message types for the chat.
|
|
9
|
+
*/
|
|
10
|
+
export var MESSAGE_TYPE;
|
|
11
|
+
(function (MESSAGE_TYPE) {
|
|
12
|
+
MESSAGE_TYPE["ASSISTANT"] = "ASSISTANT";
|
|
13
|
+
MESSAGE_TYPE["ERROR"] = "ERROR";
|
|
14
|
+
MESSAGE_TYPE["PROMPT"] = "PROMPT";
|
|
15
|
+
MESSAGE_TYPE["USER"] = "USER";
|
|
16
|
+
})(MESSAGE_TYPE || (MESSAGE_TYPE = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Suggestion variant values for rendering suggestions.
|
|
19
|
+
*/
|
|
20
|
+
export const SUGGESTION_VARIANT = {
|
|
21
|
+
CHIP: "CHIP",
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI configuration.
|
|
3
|
+
*/
|
|
4
|
+
export interface AiConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
prompt?: AiPrompt;
|
|
7
|
+
routes: {
|
|
8
|
+
research: string;
|
|
9
|
+
search: string;
|
|
10
|
+
};
|
|
11
|
+
url: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AiPrompt {
|
|
15
|
+
inputPlaceholder?: string;
|
|
16
|
+
suggestions?: AiSuggestions[];
|
|
17
|
+
text: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AiSuggestions {
|
|
21
|
+
label: string;
|
|
22
|
+
query: string;
|
|
23
|
+
// For now, we only have one variant, but this allows for future expansion.
|
|
24
|
+
variant: "CHIP";
|
|
25
|
+
}
|
|
@@ -5,6 +5,7 @@ import { FilterLabel } from "./filterLabel";
|
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
argTypes: {
|
|
8
|
+
annotation: { control: "object" },
|
|
8
9
|
count: { control: "number" },
|
|
9
10
|
disabled: { control: "boolean" },
|
|
10
11
|
isOpen: { control: "boolean" },
|
|
@@ -27,6 +28,11 @@ type Story = StoryObj<typeof meta>;
|
|
|
27
28
|
|
|
28
29
|
export const FilterLabelStory: Story = {
|
|
29
30
|
args: {
|
|
31
|
+
annotation: {
|
|
32
|
+
description:
|
|
33
|
+
"This is a description of the filter label that provides additional context to the user.",
|
|
34
|
+
label: "Label",
|
|
35
|
+
},
|
|
30
36
|
count: 123,
|
|
31
37
|
disabled: false,
|
|
32
38
|
isOpen: false,
|
|
@@ -26,7 +26,12 @@ export const FilterLabel = ({
|
|
|
26
26
|
}: FilterLabelProps): JSX.Element => {
|
|
27
27
|
const filterLabel = count ? `${label}\xa0(${count})` : label; // When the count is present, a non-breaking space is used to prevent it from being on its own line
|
|
28
28
|
return (
|
|
29
|
-
<Tooltip
|
|
29
|
+
<Tooltip
|
|
30
|
+
description={annotation?.description}
|
|
31
|
+
enterDelay={300}
|
|
32
|
+
placement="right"
|
|
33
|
+
title={annotation?.label}
|
|
34
|
+
>
|
|
30
35
|
<StyledButton
|
|
31
36
|
color="inherit"
|
|
32
37
|
disabled={disabled}
|
|
@@ -105,6 +105,11 @@ const PROCESSED = {
|
|
|
105
105
|
* Biological Sex select category view
|
|
106
106
|
*/
|
|
107
107
|
export const BIOLOGICAL_SEX: SelectCategoryView = {
|
|
108
|
+
annotation: {
|
|
109
|
+
description:
|
|
110
|
+
"The biological sex of the donor organism, typically determined by chromosomal composition.",
|
|
111
|
+
label: "Biological Sex",
|
|
112
|
+
},
|
|
108
113
|
key: "biologicalSex",
|
|
109
114
|
label: "Biological Sex",
|
|
110
115
|
values: [MALE, FEMALE],
|
|
@@ -114,6 +119,11 @@ export const BIOLOGICAL_SEX: SelectCategoryView = {
|
|
|
114
119
|
* Genus Species select category view
|
|
115
120
|
*/
|
|
116
121
|
export const GENUS_SPECIES: SelectCategoryView = {
|
|
122
|
+
annotation: {
|
|
123
|
+
description:
|
|
124
|
+
"The scientific name of the organism from which the sample was derived.",
|
|
125
|
+
label: "Genus Species",
|
|
126
|
+
},
|
|
117
127
|
key: "genusSpecies",
|
|
118
128
|
label: "Genus Species",
|
|
119
129
|
values: [HOMO_SAPIENS, MUS_MUSCLES],
|
|
@@ -123,7 +133,11 @@ export const GENUS_SPECIES: SelectCategoryView = {
|
|
|
123
133
|
* Donor Count range category view
|
|
124
134
|
*/
|
|
125
135
|
export const DONOR_COUNT: RangeCategoryView = {
|
|
126
|
-
|
|
136
|
+
annotation: {
|
|
137
|
+
description: "The number of unique donors contributing to the dataset.",
|
|
138
|
+
label: "Donor Count",
|
|
139
|
+
},
|
|
140
|
+
key: "donorCount",
|
|
127
141
|
label: "Donor Count",
|
|
128
142
|
max: 200,
|
|
129
143
|
min: 10,
|
|
@@ -135,6 +149,11 @@ export const DONOR_COUNT: RangeCategoryView = {
|
|
|
135
149
|
* File Format select category view
|
|
136
150
|
*/
|
|
137
151
|
export const FILE_FORMAT: SelectCategoryView = {
|
|
152
|
+
annotation: {
|
|
153
|
+
description:
|
|
154
|
+
"The format of the file, such as BAM, CSV, FASTQ, or TSV, indicating how the data is structured.",
|
|
155
|
+
label: "File Format",
|
|
156
|
+
},
|
|
138
157
|
key: "fileFormat",
|
|
139
158
|
label: "File Format",
|
|
140
159
|
values: [BAM, CSV, FASTQ, TSV],
|
|
@@ -144,6 +163,11 @@ export const FILE_FORMAT: SelectCategoryView = {
|
|
|
144
163
|
* File Type select category view
|
|
145
164
|
*/
|
|
146
165
|
export const FILE_TYPE: SelectCategoryView = {
|
|
166
|
+
annotation: {
|
|
167
|
+
description:
|
|
168
|
+
"The type of file, indicating whether the data is raw or has been processed.",
|
|
169
|
+
label: "File Type",
|
|
170
|
+
},
|
|
147
171
|
isDisabled: true,
|
|
148
172
|
key: "fileType",
|
|
149
173
|
label: "File Type",
|
package/src/components/Layout/components/Sidebar/components/SidebarTools/sidebarTools.styles.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { bpUpMd } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Container for sidebar tools, including the mode toggle and filter controls.
|
|
6
|
+
* @deprecated - This styled component is deprecated and will be removed in a future release.
|
|
7
|
+
*/
|
|
4
8
|
export const SidebarTools = styled.div`
|
|
5
9
|
display: grid;
|
|
6
10
|
gap: 8px 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { Chip } from "@mui/material";
|
|
3
|
+
import { PALETTE } from "../../../../../styles/common/constants/palette";
|
|
4
|
+
import { FONT } from "../../../../../styles/common/constants/font";
|
|
5
|
+
|
|
6
|
+
export const StyledChip = styled(Chip)`
|
|
7
|
+
background-color: ${PALETTE.PRIMARY_LIGHTEST};
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
color: ${PALETTE.PRIMARY_MAIN};
|
|
10
|
+
|
|
11
|
+
.MuiChip-label {
|
|
12
|
+
font: ${FONT.BODY_SMALL_500};
|
|
13
|
+
padding: 0 5px;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChipProps } from "@mui/material";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
import { CHIP_PROPS } from "../../../../../styles/common/mui/chip";
|
|
4
|
+
import { BaseComponentProps } from "../../../../types";
|
|
5
|
+
import { StyledChip } from "./beta.styles";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Beta chip component to indicate features that are in beta.
|
|
9
|
+
* @param props - Component props.
|
|
10
|
+
* @param props.className - Classname.
|
|
11
|
+
* @returns Beta chip JSX element.
|
|
12
|
+
*/
|
|
13
|
+
export const Beta = ({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: BaseComponentProps & ChipProps): JSX.Element => {
|
|
17
|
+
return (
|
|
18
|
+
<StyledChip
|
|
19
|
+
className={className}
|
|
20
|
+
label="Beta"
|
|
21
|
+
size={CHIP_PROPS.SIZE.SMALL}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
2
|
+
import { Beta } from "../beta";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Beta> = {
|
|
5
|
+
component: Beta,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default meta;
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
|
|
12
|
+
export const DEFAULT: Story = {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvgIcon, SvgIconProps } from "@mui/material";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Custom up arrow icon.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const UpArrowIcon = ({
|
|
9
|
+
fontSize = "xsmall",
|
|
10
|
+
viewBox = "0 0 18 18",
|
|
11
|
+
...props /* SvgIconProps */
|
|
12
|
+
}: SvgIconProps): JSX.Element => {
|
|
13
|
+
return (
|
|
14
|
+
<SvgIcon fontSize={fontSize} viewBox={viewBox} {...props}>
|
|
15
|
+
<path
|
|
16
|
+
d="M8.24985 6.60005L6.07485 8.77505C5.93735 8.91255 5.76235 8.9813 5.54985 8.9813C5.33735 8.9813 5.16235 8.91255 5.02485 8.77505C4.88735 8.63755 4.8186 8.46255 4.8186 8.25005C4.8186 8.03755 4.88735 7.86255 5.02485 7.72505L8.47485 4.27505C8.62485 4.12505 8.79985 4.05005 8.99985 4.05005C9.19985 4.05005 9.37485 4.12505 9.52485 4.27505L12.9749 7.72505C13.1124 7.86255 13.1811 8.03755 13.1811 8.25005C13.1811 8.46255 13.1124 8.63755 12.9749 8.77505C12.8374 8.91255 12.6624 8.9813 12.4499 8.9813C12.2374 8.9813 12.0624 8.91255 11.9249 8.77505L9.74985 6.60005V12.75C9.74985 12.9625 9.67798 13.1407 9.53423 13.2844C9.39048 13.4282 9.21235 13.5 8.99985 13.5C8.78735 13.5 8.60923 13.4282 8.46548 13.2844C8.32173 13.1407 8.24985 12.9625 8.24985 12.75V6.60005Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
/>
|
|
19
|
+
</SvgIcon>
|
|
20
|
+
);
|
|
21
|
+
};
|