Skip to content

Commit

Permalink
feat: bump to PF6 and reorganize docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolethoen committed Jul 9, 2024
1 parent fdaa4b3 commit 6fa6e86
Show file tree
Hide file tree
Showing 29 changed files with 13,780 additions and 398 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: check-pr
on:
pull_request:
branches:
- main
- v4
- v6
jobs:
call-build-lint-test-workflow:
uses: ./.github/workflows/build-lint-test.yml
8 changes: 4 additions & 4 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
git checkout tmp
- run: |
git rev-parse origin/main
git rev-parse origin/v6
git rev-parse HEAD
git rev-parse origin/main..HEAD
git log origin/main..HEAD --format="%b"
git rev-parse origin/v6..HEAD
git log origin/v6..HEAD --format="%b"
# Yes, we really want to checkout the PR
# Injected by generate-workflows.js
Expand Down Expand Up @@ -52,4 +52,4 @@ jobs:
name: a11y tests
- run: node .github/upload-preview.js packages/module/coverage
name: Upload a11y report
if: always()
if: always()
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: release
on:
push:
branches:
- main
- v4
- v6
jobs:
call-build-lint-test-workflow:
uses: ./.github/workflows/build-lint-test.yml
Expand Down
12 changes: 7 additions & 5 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"homepage": "https://github.com/patternfly/virtual-assistant#readme",
"publishConfig": {
"access": "public",
"tag": "prerelease"
"tag": "alpha"
},
"dependencies": {
"@patternfly/react-core": "^5.1.2",
"@patternfly/react-icons": "^5.1.2",
"@patternfly/react-core": "6.0.0-alpha.79",
"@patternfly/react-icons": "6.0.0-alpha.29",
"react-jss": "^10.10.0",
"react-markdown": "^9.0.1",
"clsx": "^2.1.0"
Expand All @@ -43,8 +43,10 @@
},
"devDependencies": {
"@patternfly/patternfly-a11y": "^4.3.1",
"@patternfly/documentation-framework": "^2.0.0-alpha.57",
"@patternfly/patternfly": "^5.1.0",
"@patternfly/documentation-framework": "6.0.0-alpha.54",
"@patternfly/react-table": "6.0.0-alpha.80",
"@patternfly/react-code-editor": "6.0.0-alpha.79",
"@patternfly/patternfly": "6.0.0-alpha.181",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/react-router-dom": "^5.3.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
section: extensions
subsection: Virtual assistant
subsection: Chat bots / AI
id: About virtual assistant
sortValue: 1
---
Expand All @@ -12,3 +12,5 @@ Virtual assistant lives in its own package [`@patternfly/virtual-assistant`](htt
The virtual assistant extension contains implementation of the react virtual assistant.

If you notice a bug or have a suggestion for the virtual assistant, feel free to file an issue in our [GitHub repository](https://github.com/patternfly/virtual-assistant/issues)! Please make sure to check if there is already a pre-existing issue before creating a new issue.

To view a working demo of the virtual assistant, view them under the react-demos tab of [Virtual assistant docs](/extensions/chat-bots--ai/virtual-assistant/react-demos).
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Chat bots / AI
# Sidenav secondary level section
# should be the same for all markdown files
id: Conversation alert
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
source: react
# If you use typescript, the name of the interface to display props for
# These are found through the sourceProps function provided in patternfly-docs.source.js
propComponents: ['ConversationAlert']
sourceLink: https://github.com/patternfly/virtual-assistant/blob/main/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/ConversationAlert/ConversationAlert.md
---

import ConversationAlert from '@patternfly/virtual-assistant/dist/dynamic/ConversationAlert';

The **conversation alert** component renders an alert to be used in the body of the virtual assistant.

### Conversation Alert

You can configure a custom title and variant input value using `title` and `variant` props.

```js file="./ConversationAlertBasic.tsx"

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import ConversationAlert from '@patternfly/virtual-assistant/dist/esm/ConversationAlert'

export const BasicExample: React.FunctionComponent = () => (
<ConversationAlert title="You can start a new conversation at any time by typing below.">
You can add any body content
</ConversationAlert>
);
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from 'react';
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant';
import AssistantMessageEntry from '@patternfly/virtual-assistant/dist/dynamic/AssistantMessageEntry';
import GrinIcon from '@patternfly/react-icons/dist/js/icons/bacon-icon';

export const AssistantMessage: React.FunctionComponent = () => (
<VirtualAssistant>
<>
<AssistantMessageEntry>
How may I help you today? Do you have some question for me?
</AssistantMessageEntry>
<AssistantMessageEntry icon={GrinIcon}>
Assistant message example with custom icon
</AssistantMessageEntry>
</VirtualAssistant>
</>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import AssistantMessageEntry from '@patternfly/virtual-assistant/dist/dynamic/AssistantMessageEntry';

export const AssistantMessage: React.FunctionComponent = () => (
<AssistantMessageEntry
// eslint-disable-next-line no-console
options={[ { title: "Option #1", props: { onClick: () => {console.log('This is an example of onClick event')} } }, { title: "Option #2" }, { title: "Option #3" } ]}
>
How may I help you today? Do you have some question for me?
</AssistantMessageEntry>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Chat bots / AI
# Sidenav secondary level section
# should be the same for all markdown files
id: Messages
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
source: react
# If you use typescript, the name of the interface to display props for
# These are found through the sourceProps function provided in patternfly-docs.source.js
propComponents: ['UserMessageEntry', 'AssistantMessageEntry', 'LoadingMessage', 'SystemMessageEntry',]
sourceLink: https://github.com/patternfly/virtual-assistant/blob/main/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/Messages/Messages.md
---

import SystemMessageEntry from '@patternfly/virtual-assistant/dist/dynamic/SystemMessageEntry';
import LoadingMessage from '@patternfly/virtual-assistant/dist/dynamic/LoadingMessage';
import AssistantMessageEntry from '@patternfly/virtual-assistant/dist/dynamic/AssistantMessageEntry';
import UserMessageEntry from '@patternfly/virtual-assistant/dist/dynamic/UserMessageEntry';
import { GrinIcon } from '@patternfly/react-icons';
import { AngleDownIcon } from '@patternfly/react-icons';


### System Message Entry

The `SystemMessageEntry` component provides a simple system message with an option for text links.


```js file="./VirtualAssistantSystemMessageEntry.tsx"

```

### Loading Messages

The `LoadingMessage` component shows a typing indicator for messages still being processed, introducing an intentional delay to simulate a smoother flow of conversation. Additionally, it allows for the use of a custom icon through the `icon` property.


```js file="./VirtualAssistantLoadingMessage.tsx"

```

### Assistant Message

This is an example of a message sent by assistant. Additionally, it allows for the use of a custom icon through the `icon` property.

```js file="./AssistantMessage.tsx"

```

### Assistant Message with follow-up options

This is an example of a message sent by assistant with follow-up options. Follow-up options are defined within `options` property.

```js file="./AssistantMessageWithFollowup.tsx"

```

### User Message

This is an example of a message sent by user. Additionally, it allows for the use of a custom icon through the `icon` property.

```js file="./UserMessage.tsx"

```
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant';
import UserMessageEntry from '@patternfly/virtual-assistant/dist/dynamic/UserMessageEntry';
import GrinIcon from '@patternfly/react-icons/dist/js/icons/bacon-icon';

export const UserMessage: React.FunctionComponent = () => (
<VirtualAssistant>
<>
<UserMessageEntry>Hello, can you help me?</UserMessageEntry>
<UserMessageEntry icon={GrinIcon}>User message example with custom icon</UserMessageEntry>
</VirtualAssistant>
</>
);
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant';
import LoadingMessage from '@patternfly/virtual-assistant/dist/esm/LoadingMessage'
import GrinIcon from '@patternfly/react-icons/dist/js/icons/bacon-icon';

export const BasicExample: React.FunctionComponent = () => (
<VirtualAssistant >
<>
<LoadingMessage />
<LoadingMessage icon={GrinIcon} />
</VirtualAssistant>
</>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import SystemMessageEntry from '@patternfly/virtual-assistant/dist/esm/SystemMessageEntry'

export const BasicExample: React.FunctionComponent = () => (
<SystemMessageEntry>End of conversation.</SystemMessageEntry>
);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Virtual assistant
subsection: Chat bots / AI
# Sidenav secondary level section
# should be the same for all markdown files
id: Virtual assistant
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
source: react
# If you use typescript, the name of the interface to display props for
# These are found through the sourceProps function provided in patternfly-docs.source.js
propComponents: ['VirtualAssistant']
propComponents: ['VirtualAssistant', 'VirtualAssistantAction']
sourceLink: https://github.com/patternfly/virtual-assistant/blob/main/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/VirtualAssistant/VirtualAssistant.md
---

Expand Down Expand Up @@ -67,53 +67,3 @@ Custom actions can be added to the assistant body using the `actions` property.
```js file="./VirtualAssistantWithActions.tsx"

```

### Conversation Alert

You can configure a custom title and variant input value using `title` and `variant` props.

```js file="./VirtualAssistantConversationAlert.tsx"

```

### System Message Entry

The `SystemMessageEntry` component provides a simple system message with an option for text links.


```js file="./VirtualAssistantSystemMessageEntry.tsx"

```

### Loading Messages

The `LoadingMessage` component shows a typing indicator for messages still being processed, introducing an intentional delay to simulate a smoother flow of conversation. Additionally, it allows for the use of a custom icon through the `icon` property.


```js file="./VirtualAssistantLoadingMessage.tsx"

```

### Assistant Message

This is an example of a message sent by assistant. Additionally, it allows for the use of a custom icon through the `icon` property.

```js file="./AssistantMessage.tsx"

```

### Assistant Message with follow-up options

This is an example of a message sent by assistant with follow-up options. Follow-up options are defined within `options` property.

```js file="./AssistantMessageWithFollowup.tsx"

```

### User Message

This is an example of a message sent by user. Additionally, it allows for the use of a custom icon through the `icon` property.

```js file="./UserMessage.tsx"

```

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant';

export const BasicDemo: React.FunctionComponent = () => (
<VirtualAssistant />
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Sidenav top-level section
# should be the same for all markdown files
section: extensions
subsection: Chat bots / AI
# Sidenav secondary level section
# should be the same for all markdown files
id: Virtual assistant
# Tab (react | react-demos | html | html-demos | design-guidelines | accessibility)
source: react-demos
sourceLink: https://github.com/patternfly/virtual-assistant/blob/main/packages/module/patternfly-docs/content/extensions/virtual-assistant/examples/demos/demos.md
---

import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant';

# Demos

### Basic example

A blank example of the virtual assistant body.

```js file="./VirtualAssistantDemo.tsx" isFullscreen

```

Loading

0 comments on commit 6fa6e86

Please sign in to comment.