forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59ebcdf
commit 6cf0b70
Showing
24 changed files
with
429 additions
and
25 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
...rvability_ai_assistant/public/components/buttons/hide_expand_conversation_list_button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import React from 'react'; | ||
import { EuiButtonEmpty } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export function HideExpandConversationListButton( | ||
props: React.ComponentProps<typeof EuiButtonEmpty> & { isExpanded: boolean } | ||
) { | ||
return ( | ||
<EuiButtonEmpty iconType={props.isExpanded ? 'menuLeft' : 'menuRight'} size="xs" {...props}> | ||
{props.isExpanded | ||
? i18n.translate('xpack.observabilityAiAssistant.hideExpandConversationButton.hide', { | ||
defaultMessage: 'Hide chats', | ||
}) | ||
: i18n.translate('xpack.observabilityAiAssistant.hideExpandConversationButton.show', { | ||
defaultMessage: 'Show chats', | ||
})} | ||
</EuiButtonEmpty> | ||
); | ||
} |
19 changes: 19 additions & 0 deletions
19
.../plugins/observability_ai_assistant/public/components/buttons/new_chat_button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { ComponentMeta, ComponentStoryObj } from '@storybook/react'; | ||
import { NewChatButton as Component } from './new_chat_button'; | ||
|
||
const meta: ComponentMeta<typeof Component> = { | ||
component: Component, | ||
title: 'app/Atoms/NewChatButton', | ||
}; | ||
|
||
export default meta; | ||
|
||
export const NewChatButton: ComponentStoryObj<typeof Component> = { | ||
args: {}, | ||
}; |
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/observability_ai_assistant/public/components/buttons/new_chat_button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import React from 'react'; | ||
import { EuiButton } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
export function NewChatButton(props: React.ComponentProps<typeof EuiButton>) { | ||
return ( | ||
<EuiButton {...props} fill iconType="discuss"> | ||
{i18n.translate('xpack.observabilityAiAssistant.newChatButton', { | ||
defaultMessage: 'New chat', | ||
})} | ||
</EuiButton> | ||
); | ||
} |
19 changes: 19 additions & 0 deletions
19
...servability_ai_assistant/public/components/buttons/regenerate_response_button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { ComponentMeta, ComponentStoryObj } from '@storybook/react'; | ||
import { RegenerateResponseButton as Component } from './regenerate_response_button'; | ||
|
||
const meta: ComponentMeta<typeof Component> = { | ||
component: Component, | ||
title: 'app/Atoms/RegenerateResponseButton', | ||
}; | ||
|
||
export default meta; | ||
|
||
export const RegenerateResponseButton: ComponentStoryObj<typeof Component> = { | ||
args: {}, | ||
}; |
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
...lugins/observability_ai_assistant/public/components/buttons/start_chat_button.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
import { ComponentMeta, ComponentStoryObj } from '@storybook/react'; | ||
import { StartChatButton as Component } from './start_chat_button'; | ||
|
||
const meta: ComponentMeta<typeof Component> = { | ||
component: Component, | ||
title: 'app/Atoms/StartChatButton', | ||
}; | ||
|
||
export default meta; | ||
|
||
export const StartChatButton: ComponentStoryObj<typeof Component> = { | ||
args: {}, | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/observability_ai_assistant/public/components/chat/chat_flyout.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ComponentStory } from '@storybook/react'; | ||
import React from 'react'; | ||
import { KibanaReactStorybookDecorator } from '../../utils/storybook_decorator'; | ||
import { ChatFlyout as Component } from './chat_flyout'; | ||
|
||
export default { | ||
component: Component, | ||
title: 'app/Organisms/ChatFlyout', | ||
decorators: [KibanaReactStorybookDecorator], | ||
}; | ||
|
||
type ChatFlyoutProps = React.ComponentProps<typeof Component>; | ||
|
||
const Template: ComponentStory<typeof Component> = (props: ChatFlyoutProps) => { | ||
return ( | ||
<div style={{ display: 'flex', minHeight: 800 }}> | ||
<Component {...props} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const defaultProps: ChatFlyoutProps = { | ||
isOpen: true, | ||
initialConversation: { | ||
'@timestamp': '', | ||
conversation: { | ||
title: 'How is this working', | ||
}, | ||
messages: [], | ||
labels: {}, | ||
numeric_labels: {}, | ||
}, | ||
onClose: () => {}, | ||
}; | ||
|
||
export const ChatFlyout = Template.bind({}); | ||
ChatFlyout.args = defaultProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...k/plugins/observability_ai_assistant/public/components/chat/conversation_list.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ComponentStory } from '@storybook/react'; | ||
import React from 'react'; | ||
import { KibanaReactStorybookDecorator } from '../../utils/storybook_decorator'; | ||
import { ConversationList as Component } from './conversation_list'; | ||
|
||
export default { | ||
component: Component, | ||
title: 'app/Organisms/ConversationList', | ||
decorators: [KibanaReactStorybookDecorator], | ||
}; | ||
|
||
type ConversationListProps = React.ComponentProps<typeof Component>; | ||
|
||
const Template: ComponentStory<typeof Component> = (props: ConversationListProps) => { | ||
return ( | ||
<div style={{ minHeight: 800, display: 'flex' }}> | ||
<Component {...props} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const defaultProps: ConversationListProps = { | ||
onClickConversation: (conversationId: string) => {}, | ||
onClickNewChat: () => {}, | ||
onClickSettings: () => {}, | ||
}; | ||
|
||
export const ConversationList = Template.bind({}); | ||
ConversationList.args = defaultProps; |
Oops, something went wrong.