Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,100 changes: 3,056 additions & 2,044 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@octokit/rest": "^18.0.0",
"@patternfly/documentation-framework": "6.28.9",
"@patternfly/patternfly": "^6.1.0",
"@patternfly/documentation-framework": "^6.44.0",
"@patternfly/patternfly": "^6.5.2",
"@patternfly/react-icons": "^6.5.1",
"@patternfly/react-table": "^6.1.0",
"@patternfly/react-table": "^6.5.1",
"@swc/core": "1.3.96",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
Expand Down
12 changes: 6 additions & 6 deletions packages/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"tag": "prerelease"
},
"dependencies": {
"@patternfly/react-code-editor": "^6.1.0",
"@patternfly/react-core": "^6.1.0",
"@patternfly/react-code-editor": "^6.5.1",
"@patternfly/react-core": "^6.5.1",
"@patternfly/react-icons": "^6.5.1",
"@patternfly/react-styles": "^6.1.0",
"@patternfly/react-table": "^6.1.0",
"@patternfly/react-styles": "^6.5.1",
"@patternfly/react-table": "^6.5.1",
"@segment/analytics-next": "^1.76.0",
"clsx": "^2.1.0",
"path-browserify": "^1.0.1",
Expand Down Expand Up @@ -66,8 +66,8 @@
},
"devDependencies": {
"@octokit/rest": "^18.0.0",
"@patternfly/documentation-framework": "6.28.9",
"@patternfly/patternfly": "^6.1.0",
"@patternfly/documentation-framework": "^6.44.0",
"@patternfly/patternfly": "^6.5.2",
"@patternfly/patternfly-a11y": "^5.0.0",
"@types/dom-speech-recognition": "^0.0.4",
"@types/react": "^18.2.61",
Expand Down
68 changes: 42 additions & 26 deletions packages/module/src/Chatbot/Chatbot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
flex-direction: column;
width: 30rem;
height: 70vh;
background-color: var(
--pf-t--global--background--color--floating--secondary--default,
--pf-t--global--background--color--secondary--default
);
background-color: var(--pf-t--global--background--color--floating--secondary--default);
border-radius: var(--pf-t--global--border--radius--medium);
box-shadow: var(--pf-t--global--box-shadow--lg);
font-size: var(--pf-t--global--font--size--md);
Expand All @@ -31,9 +28,8 @@
opacity: 1;
transform: translateY(0);
}
// for high contrast support
border: var(--pf-t--global--border--width--high-contrast--regular) solid
var(--pf-t--global--border--color--high-contrast);

border: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--subtle);

// 32 rem is the width of the overlay chatbot plus the insets
// if the screen is smaller, we want to be 100%
Expand All @@ -46,24 +42,41 @@
@media screen and (max-height: 518px) {
overflow: auto;
}

&:not(&--default) {
background-color: var(
--pf-t--global--background--color--glass--primary--default,
var(--pf-t--global--background--color--secondary--default)
);
}
}

:root:where(.pf-v6-theme-felt):not(.pf-v6-theme-glass) {
.pf-chatbot.pf-chatbot--default {
box-shadow: var(--pf-t--global--box-shadow--md);
}
}

// ============================================================================
// Chatbot Display Mode - Docked
// ============================================================================
.pf-chatbot--docked {
// for high contrast support
border: unset;
border-left: var(--pf-t--global--border--width--high-contrast--regular) solid
var(--pf-t--global--border--color--high-contrast);
border-left: var(--pf-t--global--border--width--regular) solid var(--pf-t--global--border--color--subtle);
inset-block-end: 0;
inset-inline-end: 0;
padding: 0;
height: 100%;
border-radius: 0;
box-shadow: var(--pf-t--global--box-shadow--lg--left);
overflow: inherit;

@at-root :where(.pf-v6-theme-glass) & {
border-left: var(--pf-t--global--border--width--glass--default) solid
var(--pf-t--global--border--color--glass--default);
box-shadow: var(--pf-t--global--box-shadow--md--left);
backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
}

// 30rem is the width of the docked chatbot
// if the screen is smaller, we want to be 100%
@media screen and (max-width: 30rem) {
Expand All @@ -75,9 +88,6 @@
// Chatbot Display Mode - Fullscreen
// ============================================================================
.pf-chatbot--fullscreen {
background-color: var(--pf-t--global--background--color--secondary--default);

// for high contrast support
border: unset;
inset-block-end: 0;
inset-inline-end: 0;
Expand All @@ -86,21 +96,27 @@
height: 100%;
border-radius: 0;
box-shadow: none;

@at-root :where(.pf-v6-theme-glass) & {
backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
}
}

// ============================================================================
// Chatbot Display Mode - Embedded
// ============================================================================
.pf-chatbot--embedded {
background-color: var(--pf-t--global--background--color--secondary--default);

// for high contrast support
border: unset;
position: static;
width: 100%;
min-height: 100%;
border-radius: 0;
box-shadow: none;
box-shadow: var(--pf-t--global--box-shadow--lg);

@at-root :where(.pf-v6-theme-glass) & {
border: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
box-shadow: var(--pf-t--global--box-shadow--md);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have a glass box-shadow token (--pf-t--global--box-shadow--glass--default) if that's the intent here. It resolves to --md, but if design ever decided to update the default glass container box-shadow, using the glass token would get that update where using --md wouldn't. Though up to design if that's the intent of this shadow, or if it should be fixed at --md

backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
}
}

.pf-chatbot-container {
Expand Down Expand Up @@ -143,19 +159,19 @@
height: 100%;
border-radius: 0;
box-shadow: none;
border-color: var(--pf-t--global--border--color--default);
border-color: var(--pf-t--global--border--color--subtle);

.pf-chatbot-container {
border-radius: var(--pf-t--global--border--radius--sharp);
@at-root :where(.pf-v6-theme-glass) & {
border: var(--pf-t--global--border--width--glass--default) solid var(--pf-t--global--border--color--glass--default);
box-shadow: var(--pf-t--global--box-shadow--md);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment here about the glass box shadow token

backdrop-filter: var(--pf-t--global--background--filter--glass--blur--primary);
}

@media screen and (min-width: 768px) {
// only want if drawer open - drawer closes/stops being inline on mobile
border-left: var(--pf-t--global--border--width--divider--default) solid;
.pf-chatbot-container {
border-radius: var(--pf-t--global--border--radius--sharp);
}
}

// for high contrast support
:root:where(.pf-v6-theme-high-contrast) {
.pf-chatbot--drawer {
border: unset;
Expand Down
15 changes: 10 additions & 5 deletions packages/module/src/ChatbotContent/ChatbotContent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
// ============================================================================
.pf-chatbot__content {
position: relative;
background-color: var(
--pf-t--global--background--color--floating--secondary--default,
--pf-t--global--background--color--secondary--default
);
background-color: var(--pf-t--global--background--color--floating--secondary--default);
overflow-y: auto;
overflow: hidden; // needed in Red Hat Developer Hub workspace
flex: 1; // needed in Composer AI
Expand All @@ -21,6 +18,15 @@
}
}

.pf-chatbot:not(.pf-chatbot--default) {
.pf-chatbot__content {
background-color: var(
--pf-t--global--background--color--glass--primary--default,
var(--pf-t--global--background--color--secondary--default)
);
}
}

Comment on lines +21 to +29

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--pf-t--global--background--color--glass--primary--default has a value of initial in non-glass themes, which means you can probably use a fallback here like this since initial triggers the next fallback to be used.

Suggested change
.pf-chatbot:not(.pf-chatbot--default) {
.pf-chatbot__content {
background-color: var(--pf-t--global--background--color--secondary--default);
@at-root :where(.pf-v6-theme-glass) & {
background-color: var(--pf-t--global--background--color--glass--primary--default);
}
}
}
.pf-chatbot:not(.pf-chatbot--default) {
.pf-chatbot__content {
background-color: var(--pf-t--global--background--color--glass--primary--default, var(--pf-t--global--background--color--secondary--default));
}
}

// ============================================================================
// Chatbot Display Mode - Fullscreen and Embedded
// ============================================================================
Expand All @@ -29,7 +35,6 @@
.pf-chatbot--fullscreen,
.pf-chatbot--embedded {
.pf-chatbot__content {
background-color: var(--pf-t--global--background--color--secondary--default);
display: flex;
justify-content: center;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,20 @@
}
}

.pf-chatbot:is(.pf-chatbot--drawer, .pf-chatbot--docked) .pf-chatbot__history {
// .pf-v6-c-menu {
// @at-root :where(.pf-v6-theme-glass) & {
// --pf-v6-c-menu--BackgroundColor: var(--pf-t--global--background--color--floating--default);
// }
// }

// .pf-chatbot__menu-item-header > .pf-v6-c-menu__group-title {
// @at-root :where(.pf-v6-theme-glass) & {
// background-color: var(--pf-t--global--background--color--floating--default);
// }
// }
}

// ============================================================================
// Chatbot Display Mode - Docked
// ============================================================================
Expand Down
22 changes: 12 additions & 10 deletions packages/module/src/ChatbotFooter/ChatbotFooter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
// ============================================================================
.pf-chatbot__footer {
--pf-chatbot__footer--RowGap: var(--pf-t--global--spacer--md);
background-color: var(
--pf-t--global--background--color--floating--secondary--default,
--pf-t--global--background--color--secondary--default
);
background-color: var(--pf-t--global--background--color--floating--secondary--default);
display: flex;
flex-direction: column;
row-gap: var(--pf-chatbot__footer--RowGap);
Expand All @@ -19,6 +16,17 @@
background-color: var(--pf-t--global--background--color--primary--default);
}
}

.pf-chatbot:not(.pf-chatnot--default) {
.pf-chatbot__footer {
background-color: var(--pf-t--global--background--color--secondary--default);

@at-root :where(.pf-v6-theme-glass) & {
background-color: var(--pf-t--global--background--color--glass--primary--default);
}
}
}

.pf-chatbot__footer-container {
padding: 0 var(--pf-t--global--spacer--lg) var(--pf-t--global--spacer--lg) var(--pf-t--global--spacer--lg);
display: flex;
Expand All @@ -35,12 +43,6 @@
.pf-chatbot--fullscreen {
.pf-chatbot__footer {
align-items: center;
.pf-v6-c-divider {
display: none;
}
}
.pf-chatbot__footer {
background-color: var(--pf-t--global--background--color--secondary--default);
}

.pf-chatbot__footer-container {
Expand Down
60 changes: 7 additions & 53 deletions packages/module/src/ChatbotHeader/ChatbotHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
grid-template-columns: 1fr auto;
gap: var(--pf-t--global--spacer--sm);
position: relative; // this is so focus ring on parent chatbot doesn't include header
background-color: var(
--pf-t--global--background--color--floating--secondary--default,
--pf-t--global--background--color--secondary--default
);
background-color: var(--pf-t--global--background--color--floating--secondary--default);
justify-content: space-between;
padding: var(--pf-t--global--spacer--lg);

Expand Down Expand Up @@ -58,28 +55,13 @@
}
}

// ============================================================================
// Chatbot Display Mode - Fullscreen and Embedded
// ============================================================================
@media screen and (min-width: 64rem) {
.pf-chatbot--fullscreen,
.pf-chatbot--embedded {
.pf-chatbot__header {
background-color: var(--pf-t--global--background--color--primary--default);
}
.pf-chatbot__header__divider {
display: none;
}
}
}

// ============================================================================
// Chatbot Display Mode - Docked and Drawer
// ============================================================================
.pf-chatbot--drawer,
.pf-chatbot--docked {
.pf-chatbot:not(.pf-chatbot--default) {
.pf-chatbot__header {
background-color: var(--pf-t--global--background--color--secondary--floating--default);
background-color: var(--pf-t--global--background--color--secondary--default);

@at-root :where(.pf-v6-theme-glass) & {
background-color: var(--pf-t--global--background--color--glass--primary--default);
}
}
}

Expand All @@ -98,12 +80,6 @@
border-radius: inherit;
}

.pf-v6-c-button__icon,
.pf-v6-c-menu-toggle__icon,
.pf-v6-c-icon__content {
color: var(--pf-t--global--icon--color--subtle);
}

.pf-v6-c-button__icon,
.pf-v6-c-menu-toggle__icon {
display: flex;
Expand All @@ -122,13 +98,6 @@
}
}

// Rotate icon
.pf-chatbot__button--toggle-options {
svg {
transform: rotate(90deg);
}
}

// ============================================================================
// Examples
// ============================================================================
Expand Down Expand Up @@ -169,18 +138,3 @@
.pf-chatbot__header .pf-chatbot__actions .pf-v6-c-menu-toggle.pf-m-secondary.pf-m-compact {
width: initial;
}

// ============================================================================
// High contrast
// ============================================================================
:root:where(.pf-v6-theme-high-contrast) {
// Chatbot Display Mode - Fullscreen and Embedded
@media screen and (min-width: 64rem) {
.pf-chatbot--fullscreen,
.pf-chatbot--embedded {
.pf-chatbot__header__divider {
display: var(--pf-v6-hidden-visible--Display);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Icon,
MenuToggleProps
} from '@patternfly/react-core';
import EllipsisIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
import RhUiEllipsisHorizontalFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-ellipsis-horizontal-fill-icon';

export interface ChatbotHeaderOptionsDropdownProps extends Omit<DropdownProps, 'toggle'> {
/** Content to be displayed in the chatbot header */
Expand Down Expand Up @@ -56,7 +56,7 @@ export const ChatbotHeaderOptionsDropdown: FunctionComponent<ChatbotHeaderOption
ref={toggleRef}
icon={
<Icon size={isCompact ? 'lg' : 'xl'} isInline>
<EllipsisIcon />
<RhUiEllipsisHorizontalFillIcon />
</Icon>
}
isExpanded={isOptionsMenuOpen}
Expand Down
Loading
Loading