@patternfly/chatbot 6.7.0-prerelease.2 → 6.7.0-prerelease.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +2 -2
  2. package/dist/cjs/ChatbotToggle/ChatbotToggle.d.ts +2 -0
  3. package/dist/cjs/ChatbotToggle/ChatbotToggle.js +5 -5
  4. package/dist/cjs/ChatbotToggle/ChatbotToggle.test.js +4 -0
  5. package/dist/cjs/MessageDivider/MessageDivider.js +1 -1
  6. package/dist/css/main.css +78 -83
  7. package/dist/css/main.css.map +1 -1
  8. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +2 -2
  9. package/dist/esm/ChatbotToggle/ChatbotToggle.d.ts +2 -0
  10. package/dist/esm/ChatbotToggle/ChatbotToggle.js +5 -5
  11. package/dist/esm/ChatbotToggle/ChatbotToggle.test.js +4 -0
  12. package/dist/esm/MessageDivider/MessageDivider.js +1 -1
  13. package/package.json +8 -8
  14. package/patternfly-docs/content/extensions/chatbot/examples/UI/SecondaryChatbotToggle.tsx +15 -0
  15. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +8 -0
  16. package/src/Chatbot/Chatbot.scss +42 -26
  17. package/src/ChatbotContent/ChatbotContent.scss +10 -5
  18. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +14 -0
  19. package/src/ChatbotFooter/ChatbotFooter.scss +12 -10
  20. package/src/ChatbotHeader/ChatbotHeader.scss +7 -53
  21. package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +2 -2
  22. package/src/ChatbotModal/ChatbotModal.scss +0 -9
  23. package/src/ChatbotToggle/ChatbotToggle.scss +24 -7
  24. package/src/ChatbotToggle/ChatbotToggle.test.tsx +4 -0
  25. package/src/ChatbotToggle/ChatbotToggle.tsx +18 -18
  26. package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +1 -1
  27. package/src/FileDetailsLabel/FileDetailsLabel.scss +5 -0
  28. package/src/LoadingMessage/__snapshots__/LoadingMessage.test.tsx.snap +16 -4
  29. package/src/MessageBar/MessageBar.scss +4 -24
  30. package/src/MessageDivider/MessageDivider.scss +7 -9
  31. package/src/MessageDivider/MessageDivider.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/chatbot",
3
- "version": "6.7.0-prerelease.2",
3
+ "version": "6.7.0-prerelease.4",
4
4
  "description": "This library provides React components based on PatternFly 6 that can be used to build chatbots.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -33,11 +33,11 @@
33
33
  "tag": "prerelease"
34
34
  },
35
35
  "dependencies": {
36
- "@patternfly/react-code-editor": "^6.1.0",
37
- "@patternfly/react-core": "^6.1.0",
38
- "@patternfly/react-icons": "^6.1.0",
39
- "@patternfly/react-styles": "^6.1.0",
40
- "@patternfly/react-table": "^6.1.0",
36
+ "@patternfly/react-code-editor": "^6.5.1",
37
+ "@patternfly/react-core": "^6.5.1",
38
+ "@patternfly/react-icons": "^6.5.1",
39
+ "@patternfly/react-styles": "^6.5.1",
40
+ "@patternfly/react-table": "^6.5.1",
41
41
  "@segment/analytics-next": "^1.76.0",
42
42
  "clsx": "^2.1.0",
43
43
  "path-browserify": "^1.0.1",
@@ -66,8 +66,8 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@octokit/rest": "^18.0.0",
69
- "@patternfly/documentation-framework": "6.28.9",
70
- "@patternfly/patternfly": "^6.1.0",
69
+ "@patternfly/documentation-framework": "^6.44.0",
70
+ "@patternfly/patternfly": "^6.5.2",
71
71
  "@patternfly/patternfly-a11y": "^5.0.0",
72
72
  "@types/dom-speech-recognition": "^0.0.4",
73
73
  "@types/react": "^18.2.61",
@@ -0,0 +1,15 @@
1
+ import { FunctionComponent, useState } from 'react';
2
+ import ChatbotToggle from '@patternfly/chatbot/dist/dynamic/ChatbotToggle';
3
+
4
+ export const SecondaryChatbotToggle: FunctionComponent = () => {
5
+ const [chatbotVisible, setChatbotVisible] = useState<boolean>(false);
6
+
7
+ return (
8
+ <ChatbotToggle
9
+ tooltipLabel="Virtual assistant"
10
+ isChatbotVisible={chatbotVisible}
11
+ onToggleChatbot={() => setChatbotVisible(!chatbotVisible)}
12
+ colorVariant="secondary"
13
+ />
14
+ );
15
+ };
@@ -165,6 +165,14 @@ To allow users to open and close the ChatBot window as needed, add a toggle.
165
165
 
166
166
  ```
167
167
 
168
+ ### Secondary color toggle
169
+
170
+ Use `colorVariant="secondary"` for a light gray toggle with a default border. This is useful when the floating default style does not match the surrounding UI.
171
+
172
+ ```js file="./SecondaryChatbotToggle.tsx" isFullscreen
173
+
174
+ ```
175
+
168
176
  ### Custom toggle icon
169
177
 
170
178
  A custom icon can be passed to the toggle. To ensure the icon is visible in both light and dark themes, use an SVG image and set `fill="currentColor"`.
@@ -9,10 +9,7 @@
9
9
  flex-direction: column;
10
10
  width: 30rem;
11
11
  height: 70vh;
12
- background-color: var(
13
- --pf-t--global--background--color--floating--secondary--default,
14
- --pf-t--global--background--color--secondary--default
15
- );
12
+ background-color: var(--pf-t--global--background--color--floating--secondary--default);
16
13
  border-radius: var(--pf-t--global--border--radius--medium);
17
14
  box-shadow: var(--pf-t--global--box-shadow--lg);
18
15
  font-size: var(--pf-t--global--font--size--md);
@@ -31,9 +28,8 @@
31
28
  opacity: 1;
32
29
  transform: translateY(0);
33
30
  }
34
- // for high contrast support
35
- border: var(--pf-t--global--border--width--high-contrast--regular) solid
36
- var(--pf-t--global--border--color--high-contrast);
31
+
32
+ border: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--subtle);
37
33
 
38
34
  // 32 rem is the width of the overlay chatbot plus the insets
39
35
  // if the screen is smaller, we want to be 100%
@@ -46,24 +42,41 @@
46
42
  @media screen and (max-height: 518px) {
47
43
  overflow: auto;
48
44
  }
45
+
46
+ &:not(&--default) {
47
+ background-color: var(
48
+ --pf-t--global--background--color--glass--primary--default,
49
+ var(--pf-t--global--background--color--secondary--default)
50
+ );
51
+ }
52
+ }
53
+
54
+ :root:where(.pf-v6-theme-felt):not(.pf-v6-theme-glass) {
55
+ .pf-chatbot.pf-chatbot--default {
56
+ box-shadow: var(--pf-t--global--box-shadow--md);
57
+ }
49
58
  }
50
59
 
51
60
  // ============================================================================
52
61
  // Chatbot Display Mode - Docked
53
62
  // ============================================================================
54
63
  .pf-chatbot--docked {
55
- // for high contrast support
56
64
  border: unset;
57
- border-left: var(--pf-t--global--border--width--high-contrast--regular) solid
58
- var(--pf-t--global--border--color--high-contrast);
65
+ border-left: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--subtle);
59
66
  inset-block-end: 0;
60
67
  inset-inline-end: 0;
61
68
  padding: 0;
62
69
  height: 100%;
63
70
  border-radius: 0;
64
- box-shadow: var(--pf-t--global--box-shadow--lg--left);
65
71
  overflow: inherit;
66
72
 
73
+ @at-root :where(.pf-v6-theme-glass) & {
74
+ border-left: var(--pf-t--global--border--width--glass--default) solid
75
+ var(--pf-t--global--border--color--glass--default);
76
+ box-shadow: var(--pf-t--global--box-shadow--md--left);
77
+ backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
78
+ }
79
+
67
80
  // 30rem is the width of the docked chatbot
68
81
  // if the screen is smaller, we want to be 100%
69
82
  @media screen and (max-width: 30rem) {
@@ -75,9 +88,6 @@
75
88
  // Chatbot Display Mode - Fullscreen
76
89
  // ============================================================================
77
90
  .pf-chatbot--fullscreen {
78
- background-color: var(--pf-t--global--background--color--secondary--default);
79
-
80
- // for high contrast support
81
91
  border: unset;
82
92
  inset-block-end: 0;
83
93
  inset-inline-end: 0;
@@ -86,21 +96,27 @@
86
96
  height: 100%;
87
97
  border-radius: 0;
88
98
  box-shadow: none;
99
+
100
+ @at-root :where(.pf-v6-theme-glass) & {
101
+ backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
102
+ }
89
103
  }
90
104
 
91
105
  // ============================================================================
92
106
  // Chatbot Display Mode - Embedded
93
107
  // ============================================================================
94
108
  .pf-chatbot--embedded {
95
- background-color: var(--pf-t--global--background--color--secondary--default);
96
-
97
- // for high contrast support
98
- border: unset;
99
109
  position: static;
100
110
  width: 100%;
101
111
  min-height: 100%;
102
112
  border-radius: 0;
103
- box-shadow: none;
113
+ box-shadow: var(--pf-t--global--box-shadow--lg);
114
+
115
+ @at-root :where(.pf-v6-theme-glass) & {
116
+ border: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
117
+ box-shadow: var(--pf-t--global--box-shadow--md);
118
+ backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
119
+ }
104
120
  }
105
121
 
106
122
  .pf-chatbot-container {
@@ -143,19 +159,19 @@
143
159
  height: 100%;
144
160
  border-radius: 0;
145
161
  box-shadow: none;
146
- border-color: var(--pf-t--global--border--color--default);
162
+ border-color: var(--pf-t--global--border--color--subtle);
147
163
 
148
- .pf-chatbot-container {
149
- border-radius: var(--pf-t--global--border--radius--sharp);
164
+ @at-root :where(.pf-v6-theme-glass) & {
165
+ border: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
166
+ box-shadow: var(--pf-t--global--box-shadow--md);
167
+ backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
150
168
  }
151
169
 
152
- @media screen and (min-width: 768px) {
153
- // only want if drawer open - drawer closes/stops being inline on mobile
154
- border-left: var(--pf-t--global--border--width--divider--default) solid;
170
+ .pf-chatbot-container {
171
+ border-radius: var(--pf-t--global--border--radius--sharp);
155
172
  }
156
173
  }
157
174
 
158
- // for high contrast support
159
175
  :root:where(.pf-v6-theme-high-contrast) {
160
176
  .pf-chatbot--drawer {
161
177
  border: unset;
@@ -3,10 +3,7 @@
3
3
  // ============================================================================
4
4
  .pf-chatbot__content {
5
5
  position: relative;
6
- background-color: var(
7
- --pf-t--global--background--color--floating--secondary--default,
8
- --pf-t--global--background--color--secondary--default
9
- );
6
+ background-color: var(--pf-t--global--background--color--floating--secondary--default);
10
7
  overflow-y: auto;
11
8
  overflow: hidden; // needed in Red Hat Developer Hub workspace
12
9
  flex: 1; // needed in Composer AI
@@ -21,6 +18,15 @@
21
18
  }
22
19
  }
23
20
 
21
+ .pf-chatbot:not(.pf-chatbot--default) {
22
+ .pf-chatbot__content {
23
+ background-color: var(
24
+ --pf-t--global--background--color--glass--primary--default,
25
+ var(--pf-t--global--background--color--secondary--default)
26
+ );
27
+ }
28
+ }
29
+
24
30
  // ============================================================================
25
31
  // Chatbot Display Mode - Fullscreen and Embedded
26
32
  // ============================================================================
@@ -29,7 +35,6 @@
29
35
  .pf-chatbot--fullscreen,
30
36
  .pf-chatbot--embedded {
31
37
  .pf-chatbot__content {
32
- background-color: var(--pf-t--global--background--color--secondary--default);
33
38
  display: flex;
34
39
  justify-content: center;
35
40
  }
@@ -203,6 +203,20 @@
203
203
  }
204
204
  }
205
205
 
206
+ .pf-chatbot:is(.pf-chatbot--drawer, .pf-chatbot--docked) .pf-chatbot__history {
207
+ // .pf-v6-c-menu {
208
+ // @at-root :where(.pf-v6-theme-glass) & {
209
+ // --pf-v6-c-menu--BackgroundColor: var(--pf-t--global--background--color--floating--default);
210
+ // }
211
+ // }
212
+
213
+ // .pf-chatbot__menu-item-header > .pf-v6-c-menu__group-title {
214
+ // @at-root :where(.pf-v6-theme-glass) & {
215
+ // background-color: var(--pf-t--global--background--color--floating--default);
216
+ // }
217
+ // }
218
+ }
219
+
206
220
  // ============================================================================
207
221
  // Chatbot Display Mode - Docked
208
222
  // ============================================================================
@@ -6,10 +6,7 @@
6
6
  // ============================================================================
7
7
  .pf-chatbot__footer {
8
8
  --pf-chatbot__footer--RowGap: var(--pf-t--global--spacer--md);
9
- background-color: var(
10
- --pf-t--global--background--color--floating--secondary--default,
11
- --pf-t--global--background--color--secondary--default
12
- );
9
+ background-color: var(--pf-t--global--background--color--floating--secondary--default);
13
10
  display: flex;
14
11
  flex-direction: column;
15
12
  row-gap: var(--pf-chatbot__footer--RowGap);
@@ -19,6 +16,17 @@
19
16
  background-color: var(--pf-t--global--background--color--primary--default);
20
17
  }
21
18
  }
19
+
20
+ .pf-chatbot:not(.pf-chatnot--default) {
21
+ .pf-chatbot__footer {
22
+ background-color: var(--pf-t--global--background--color--secondary--default);
23
+
24
+ @at-root :where(.pf-v6-theme-glass) & {
25
+ background-color: var(--pf-t--global--background--color--glass--primary--default);
26
+ }
27
+ }
28
+ }
29
+
22
30
  .pf-chatbot__footer-container {
23
31
  padding: 0 var(--pf-t--global--spacer--lg) var(--pf-t--global--spacer--lg) var(--pf-t--global--spacer--lg);
24
32
  display: flex;
@@ -35,12 +43,6 @@
35
43
  .pf-chatbot--fullscreen {
36
44
  .pf-chatbot__footer {
37
45
  align-items: center;
38
- .pf-v6-c-divider {
39
- display: none;
40
- }
41
- }
42
- .pf-chatbot__footer {
43
- background-color: var(--pf-t--global--background--color--secondary--default);
44
46
  }
45
47
 
46
48
  .pf-chatbot__footer-container {
@@ -9,10 +9,7 @@
9
9
  grid-template-columns: 1fr auto;
10
10
  gap: var(--pf-t--global--spacer--sm);
11
11
  position: relative; // this is so focus ring on parent chatbot doesn't include header
12
- background-color: var(
13
- --pf-t--global--background--color--floating--secondary--default,
14
- --pf-t--global--background--color--secondary--default
15
- );
12
+ background-color: var(--pf-t--global--background--color--floating--secondary--default);
16
13
  justify-content: space-between;
17
14
  padding: var(--pf-t--global--spacer--lg);
18
15
 
@@ -58,28 +55,13 @@
58
55
  }
59
56
  }
60
57
 
61
- // ============================================================================
62
- // Chatbot Display Mode - Fullscreen and Embedded
63
- // ============================================================================
64
- @media screen and (min-width: 64rem) {
65
- .pf-chatbot--fullscreen,
66
- .pf-chatbot--embedded {
67
- .pf-chatbot__header {
68
- background-color: var(--pf-t--global--background--color--primary--default);
69
- }
70
- .pf-chatbot__header__divider {
71
- display: none;
72
- }
73
- }
74
- }
75
-
76
- // ============================================================================
77
- // Chatbot Display Mode - Docked and Drawer
78
- // ============================================================================
79
- .pf-chatbot--drawer,
80
- .pf-chatbot--docked {
58
+ .pf-chatbot:not(.pf-chatbot--default) {
81
59
  .pf-chatbot__header {
82
- background-color: var(--pf-t--global--background--color--secondary--floating--default);
60
+ background-color: var(--pf-t--global--background--color--secondary--default);
61
+
62
+ @at-root :where(.pf-v6-theme-glass) & {
63
+ background-color: var(--pf-t--global--background--color--glass--primary--default);
64
+ }
83
65
  }
84
66
  }
85
67
 
@@ -98,12 +80,6 @@
98
80
  border-radius: inherit;
99
81
  }
100
82
 
101
- .pf-v6-c-button__icon,
102
- .pf-v6-c-menu-toggle__icon,
103
- .pf-v6-c-icon__content {
104
- color: var(--pf-t--global--icon--color--subtle);
105
- }
106
-
107
83
  .pf-v6-c-button__icon,
108
84
  .pf-v6-c-menu-toggle__icon {
109
85
  display: flex;
@@ -122,13 +98,6 @@
122
98
  }
123
99
  }
124
100
 
125
- // Rotate icon
126
- .pf-chatbot__button--toggle-options {
127
- svg {
128
- transform: rotate(90deg);
129
- }
130
- }
131
-
132
101
  // ============================================================================
133
102
  // Examples
134
103
  // ============================================================================
@@ -169,18 +138,3 @@
169
138
  .pf-chatbot__header .pf-chatbot__actions .pf-v6-c-menu-toggle.pf-m-secondary.pf-m-compact {
170
139
  width: initial;
171
140
  }
172
-
173
- // ============================================================================
174
- // High contrast
175
- // ============================================================================
176
- :root:where(.pf-v6-theme-high-contrast) {
177
- // Chatbot Display Mode - Fullscreen and Embedded
178
- @media screen and (min-width: 64rem) {
179
- .pf-chatbot--fullscreen,
180
- .pf-chatbot--embedded {
181
- .pf-chatbot__header__divider {
182
- display: var(--pf-v6-hidden-visible--Display);
183
- }
184
- }
185
- }
186
- }
@@ -11,7 +11,7 @@ import {
11
11
  Icon,
12
12
  MenuToggleProps
13
13
  } from '@patternfly/react-core';
14
- import EllipsisIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
14
+ import RhUiEllipsisHorizontalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-horizontal-fill-icon';
15
15
 
16
16
  export interface ChatbotHeaderOptionsDropdownProps extends Omit<DropdownProps, 'toggle'> {
17
17
  /** Content to be displayed in the chatbot header */
@@ -56,7 +56,7 @@ export const ChatbotHeaderOptionsDropdown: FunctionComponent<ChatbotHeaderOption
56
56
  ref={toggleRef}
57
57
  icon={
58
58
  <Icon size={isCompact ? 'lg' : 'xl'} isInline>
59
- <EllipsisIcon />
59
+ <RhUiEllipsisHorizontalFillIcon />
60
60
  </Icon>
61
61
  }
62
62
  isExpanded={isOptionsMenuOpen}
@@ -9,7 +9,6 @@
9
9
  inset-inline-end: var(--pf-t--global--spacer--lg);
10
10
  width: 30rem !important;
11
11
  height: 70vh;
12
- background-color: var(--pf-t--global--background--color--secondary--default) !important;
13
12
 
14
13
  .pf-v6-c-modal-box__title {
15
14
  --pf-v6-c-modal-box__title--FontSize: var(--pf-t--global--font--size--heading--h3);
@@ -55,13 +54,6 @@
55
54
  }
56
55
  }
57
56
 
58
- // ============================================================================
59
- // Chatbot Display Mode - Default
60
- // ============================================================================
61
- .pf-chatbot__chatbot-modal--default {
62
- box-shadow: unset !important;
63
- }
64
-
65
57
  // ============================================================================
66
58
  // Chatbot Display Mode - Docked
67
59
  // ============================================================================
@@ -71,7 +63,6 @@
71
63
  inset-inline-end: 0;
72
64
  border-radius: 0 !important;
73
65
  --pf-v6-c-modal-box--MaxHeight: 100vh !important;
74
- box-shadow: unset !important;
75
66
  }
76
67
 
77
68
  // ============================================================================
@@ -5,14 +5,17 @@
5
5
  position: fixed;
6
6
  inset-block-end: var(--pf-t--global--spacer--md);
7
7
  inset-inline-end: var(--pf-t--global--spacer--md);
8
- background-color: var(--pf-t--global--background--color--inverse--default);
9
- --pf-v6-c-button__icon--Color: var(--pf-t--global--icon--color--inverse);
8
+ --pf-v6-c-button--m-plain--BackgroundColor: var(--pf-t--global--background--color--floating--default);
9
+ --pf-v6-c-button--m-plain--hover--BackgroundColor: var(--pf-t--global--background--color--floating--hover);
10
+ --pf-v6-c-button--m-plain--m-clicked--BackgroundColor: var(--pf-t--global--background--color--floating--clicked);
11
+ --pf-v6-c-button--m-plain--BorderColor: var(--pf-t--global--border--color--default);
12
+ --pf-v6-c-button--m-plain--hover--BorderColor: var(--pf-t--global--border--color--default);
13
+ --pf-v6-c-button--m-plain--m-clicked--BorderColor: var(--pf-t--global--border--color--default);
14
+ --pf-v6-c-button--m-plain--BorderWidth: 1px;
15
+ --pf-v6-c-button--m-plain--hover--BorderWidth: 1px;
16
+ --pf-v6-c-button--m-plain--m-clicked--BorderWidth: 1px;
10
17
  padding: var(--pf-t--global--spacer--md);
11
-
12
- &:hover,
13
- &:focus {
14
- background-color: var(--pf-t--color--gray--70);
15
- }
18
+ box-shadow: var(--pf-t--global--box-shadow--sm);
16
19
 
17
20
  .pf-v6-c-button__icon {
18
21
  display: contents;
@@ -23,6 +26,20 @@
23
26
  width: var(--pf-t--global--spacer--lg);
24
27
  height: var(--pf-t--global--spacer--lg);
25
28
  }
29
+
30
+ &--active {
31
+ --pf-v6-c-button--m-plain--BackgroundColor: var(--pf-t--global--background--color--floating--clicked);
32
+ }
33
+
34
+ &--secondary {
35
+ --pf-v6-c-button--m-plain--BackgroundColor: var(--pf-t--global--background--color--secondary--default);
36
+ --pf-v6-c-button--m-plain--hover--BackgroundColor: var(--pf-t--global--background--color--secondary--hover);
37
+ --pf-v6-c-button--m-plain--m-clicked--BackgroundColor: var(--pf-t--global--background--color--secondary--clicked);
38
+
39
+ &.pf-chatbot__button--active {
40
+ --pf-v6-c-button--m-plain--BackgroundColor: var(--pf-t--global--background--color--secondary--clicked);
41
+ }
42
+ }
26
43
  }
27
44
 
28
45
  .pf-chatbot__button--round {
@@ -43,4 +43,8 @@ describe('ChatbotToggle', () => {
43
43
  expect(screen.getByRole('button')).toHaveClass('pf-chatbot__button');
44
44
  expect(screen.getByRole('button')).toHaveClass('test');
45
45
  });
46
+ it('should handle colorVariant secondary correctly', () => {
47
+ render(<ChatbotToggle tooltipLabel="Chatbot" colorVariant="secondary" />);
48
+ expect(screen.getByRole('button')).toHaveClass('pf-chatbot__button--secondary');
49
+ });
46
50
  });
@@ -5,7 +5,7 @@ import type { Ref, FunctionComponent } from 'react';
5
5
 
6
6
  import { forwardRef } from 'react';
7
7
  import { Button, ButtonProps, Tooltip, TooltipProps, Icon } from '@patternfly/react-core';
8
- import AngleDownIcon from '@patternfly/react-icons/dist/esm/icons/angle-down-icon';
8
+ import RhMicronsCaretDownIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-caret-down-icon';
9
9
 
10
10
  export interface ChatbotToggleProps extends ButtonProps {
11
11
  /** Contents of the tooltip applied to the toggle button */
@@ -28,24 +28,23 @@ export interface ChatbotToggleProps extends ButtonProps {
28
28
  className?: string;
29
29
  /** Test id applied to default open icon */
30
30
  openIconTestId?: string;
31
+ /** Color variant applied to the toggle button */
32
+ colorVariant?: 'default' | 'secondary';
31
33
  }
32
34
 
33
35
  const ChatIcon = () => (
34
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
35
- <path
36
- fill="var(--pf-t--global--icon--color--inverse)"
37
- stroke="var(--pf-t--global--icon--color--inverse)"
38
- strokeLinejoin="round"
39
- strokeWidth=".75"
40
- d="M3.577 14.382c0 .198.12.38.31.46l.19.04a.492.492 0 0 0 .349-.143l3.028-3.028h8.513a.489.489 0 0 0 .492-.492V2.491A.489.489 0 0 0 15.967 2H1.691a.489.489 0 0 0-.492.491v8.728c0 .135.056.262.143.349a.498.498 0 0 0 .349.143h1.878v2.663h.008v.008ZM2.19 10.72V2.983h13.278v7.729H7.24a.512.512 0 0 0-.35.143l-2.322 2.322v-1.974a.498.498 0 0 0-.142-.348.492.492 0 0 0-.35-.143H2.19v.008Z"
41
- />
42
- <path
43
- fill="var(--pf-t--global--text--color--inverse)"
44
- stroke="var(--pf-t--global--text--color--inverse)"
45
- strokeLinejoin="round"
46
- strokeWidth=".75"
47
- d="M22.301 9.135h-3.963a.489.489 0 0 0-.492.491c0 .27.222.492.492.492h3.472v7.737h-1.88a.404.404 0 0 0-.348.134.492.492 0 0 0-.143.35v1.973l-2.322-2.323a.492.492 0 0 0-.349-.142H8.532v-4.265a.489.489 0 0 0-.492-.492.494.494 0 0 0-.491.492v4.756c0 .277.222.492.491.492h8.514l3.028 3.028a.492.492 0 0 0 .349.142l.19-.04a.502.502 0 0 0 .31-.459V18.83h1.878c.111-.008.262-.048.349-.135a.491.491 0 0 0 .142-.349v-8.72a.489.489 0 0 0-.491-.491h-.008Z"
48
- />
36
+ <svg xmlns="http://www.w3.org/2000/svg" width="33" height="31" viewBox="0 0 33 31" fill="none">
37
+ <g clipPath="url(#clip0_11685_20917)">
38
+ <path
39
+ d="M29.7 11.0714H17.6V7.75H19.525C20.2834 7.75 20.9 7.12939 20.9 6.36607V1.38393C20.9 0.620609 20.2834 0 19.525 0H13.475C12.7166 0 12.1 0.620609 12.1 1.38393V6.36607C12.1 7.12939 12.7166 7.75 13.475 7.75H15.4V11.0714H3.3C1.48027 11.0714 0 12.5613 0 14.3929V27.6786C0 29.5101 1.48027 31 3.3 31H29.7C31.5197 31 33 29.5101 33 27.6786V14.3929C33 12.5613 31.5197 11.0714 29.7 11.0714ZM14.3 2.21429H18.7V5.53571H14.3V2.21429ZM30.8 27.6786C30.8 28.2894 30.3069 28.7857 29.7 28.7857H3.3C2.6936 28.7857 2.2 28.2894 2.2 27.6786V14.3929C2.2 13.7825 2.6936 13.2857 3.3 13.2857H29.7C30.3069 13.2857 30.8 13.7825 30.8 14.3929V27.6786ZM8.525 17.7143V19.9286C8.525 20.387 8.15547 20.7589 7.7 20.7589H5.5C5.04453 20.7589 4.675 20.387 4.675 19.9286V17.7143C4.675 17.2559 5.04453 16.8839 5.5 16.8839H7.7C8.15547 16.8839 8.525 17.2559 8.525 17.7143ZM28.325 17.7143V19.9286C28.325 20.387 27.9555 20.7589 27.5 20.7589H25.3C24.8445 20.7589 24.475 20.387 24.475 19.9286V17.7143C24.475 17.2559 24.8445 16.8839 25.3 16.8839H27.5C27.9555 16.8839 28.325 17.2559 28.325 17.7143ZM20.5691 22.6683C20.8893 23.0965 20.8033 23.703 20.3779 24.0241C19.2521 24.8761 17.9115 25.3259 16.5 25.3259C15.0885 25.3259 13.7473 24.8761 12.6215 24.0241C12.1961 23.703 12.1107 23.0965 12.4298 22.6683C12.7494 22.2391 13.3536 22.1526 13.7774 22.4759C15.3576 23.6695 17.6408 23.6695 19.2221 22.4759C19.6475 22.1515 20.2512 22.2402 20.5691 22.6683Z"
40
+ fill="currentColor"
41
+ />
42
+ </g>
43
+ <defs>
44
+ <clipPath id="clip0_11685_20917">
45
+ <rect width="33" height="31" fill="currentColor" />
46
+ </clipPath>
47
+ </defs>
49
48
  </svg>
50
49
  );
51
50
 
@@ -60,11 +59,12 @@ const ChatbotToggleBase: FunctionComponent<ChatbotToggleProps> = ({
60
59
  isRound = true,
61
60
  className,
62
61
  openIconTestId,
62
+ colorVariant = 'default',
63
63
  ...props
64
64
  }: ChatbotToggleProps) => {
65
65
  // Configure icon
66
66
  const closedIcon = ClosedToggleIcon ? <ClosedToggleIcon /> : <ChatIcon />;
67
- const icon = isChatbotVisible ? <AngleDownIcon data-testid={openIconTestId} /> : closedIcon;
67
+ const icon = isChatbotVisible ? <RhMicronsCaretDownIcon data-testid={openIconTestId} /> : closedIcon;
68
68
 
69
69
  return (
70
70
  <Tooltip
@@ -74,7 +74,7 @@ const ChatbotToggleBase: FunctionComponent<ChatbotToggleProps> = ({
74
74
  {...tooltipProps}
75
75
  >
76
76
  <Button
77
- className={`pf-chatbot__button ${isChatbotVisible ? 'pf-chatbot__button--active' : ''} ${isRound ? 'pf-chatbot__button--round' : ''} ${className ? className : ''}`}
77
+ className={`pf-chatbot__button ${colorVariant === 'secondary' ? 'pf-chatbot__button--secondary' : ''} ${isChatbotVisible ? 'pf-chatbot__button--active' : ''} ${isRound ? 'pf-chatbot__button--round' : ''} ${className ? className : ''}`}
78
78
  variant="plain"
79
79
  aria-label={toggleButtonLabel || `${tooltipLabel} toggle`}
80
80
  onClick={onToggleChatbot}
@@ -7,7 +7,7 @@ exports[`ChatbotWelcomePrompt should render welcome prompt 1`] = `
7
7
  >
8
8
  <h1
9
9
  class="pf-v6-c-content--h1"
10
- data-ouia-component-id="OUIA-Generated-Content-1"
10
+ data-ouia-component-id="OUIA-Generated-Content-:r0:"
11
11
  data-ouia-component-type="PF6/Content"
12
12
  data-ouia-safe="true"
13
13
  data-pf-content="true"
@@ -30,6 +30,11 @@
30
30
  .pf-chatbot__file-label > .pf-v6-c-label__content {
31
31
  --pf-v6-c-label--Color: var(--pf-t--global--background--color--primary--default);
32
32
  }
33
+
34
+ @at-root :where(.pf-v6-theme-glass) & {
35
+ --pf-v6-c-label--BackgroundColor: var(--pf-t--global--background--color--secondary--default);
36
+ --pf-v6-c-label--m-clickable--hover--BackgroundColor: var(--pf-t--global--background--color--secondary--hover);
37
+ }
33
38
  }
34
39
 
35
40
  .pf-v6-theme-dark {
@@ -20,12 +20,24 @@ exports[`LoadingMessage should render loading message 1`] = `
20
20
  fill="currentColor"
21
21
  height="1em"
22
22
  role="img"
23
- viewBox="0 0 640 512"
24
23
  width="1em"
25
24
  >
26
- <path
27
- d="M32,224H64V416H32A31.96166,31.96166,0,0,1,0,384V256A31.96166,31.96166,0,0,1,32,224Zm512-48V448a64.06328,64.06328,0,0,1-64,64H160a64.06328,64.06328,0,0,1-64-64V176a79.974,79.974,0,0,1,80-80H288V32a32,32,0,0,1,64,0V96H464A79.974,79.974,0,0,1,544,176ZM264,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,264,256Zm-8,128H192v32h64Zm96,0H288v32h64ZM456,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,456,256Zm-8,128H384v32h64ZM640,256V384a31.96166,31.96166,0,0,1-32,32H576V224h32A31.96166,31.96166,0,0,1,640,256Z"
28
- />
25
+ <svg
26
+ class="pf-v6-icon-default"
27
+ viewBox="0 0 640 512"
28
+ >
29
+ <path
30
+ d="M32,224H64V416H32A31.96166,31.96166,0,0,1,0,384V256A31.96166,31.96166,0,0,1,32,224Zm512-48V448a64.06328,64.06328,0,0,1-64,64H160a64.06328,64.06328,0,0,1-64-64V176a79.974,79.974,0,0,1,80-80H288V32a32,32,0,0,1,64,0V96H464A79.974,79.974,0,0,1,544,176ZM264,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,264,256Zm-8,128H192v32h64Zm96,0H288v32h64ZM456,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,456,256Zm-8,128H384v32h64ZM640,256V384a31.96166,31.96166,0,0,1-32,32H576V224h32A31.96166,31.96166,0,0,1,640,256Z"
31
+ />
32
+ </svg>
33
+ <svg
34
+ class="pf-v6-icon-rh-ui"
35
+ viewBox="0 0 32 32"
36
+ >
37
+ <path
38
+ d="M29 22.5V29a1 1 0 1 1-2 0v-6H5v6a1 1 0 1 1-2 0v-6.5c0-.827.673-1.5 1.5-1.5h23c.827 0 1.5.673 1.5 1.5ZM3 11a1 1 0 0 1 1-1h2V5.5C6 4.673 6.673 4 7.5 4H12V2a1 1 0 1 1 2 0v2h4V2a1 1 0 1 1 2 0v2h4.5c.827 0 1.5.673 1.5 1.5V10h2a1 1 0 1 1 0 2h-2v4.5c0 .827-.673 1.5-1.5 1.5h-17c-.827 0-1.5-.673-1.5-1.5V12H4a1 1 0 0 1-1-1Zm5 5h16V6H8v10Zm5-6.612a1.626 1.626 0 1 0 .001 3.251A1.626 1.626 0 0 0 13 9.388Zm6-.01a1.626 1.626 0 1 0 .001 3.251A1.626 1.626 0 0 0 19 9.378Z"
39
+ />
40
+ </svg>
29
41
  </svg>
30
42
  </span>
31
43
  </span>