diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f75d96a1918e..cc47135abf2b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -24,9 +24,9 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 #v3.24.3 + uses: github/codeql-action/init@e2e140ad1441662206e8f97754b166877dfa1c73 #v3.24.4 with: languages: javascript - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 #v3.24.3 + uses: github/codeql-action/analyze@e2e140ad1441662206e8f97754b166877dfa1c73 #v3.24.4 diff --git a/.github/workflows/issue-triage-strategic-adopter.yml b/.github/workflows/issue-triage-strategic-adopter.yml index 6938c3720b0d..56a58700363f 100644 --- a/.github/workflows/issue-triage-strategic-adopter.yml +++ b/.github/workflows/issue-triage-strategic-adopter.yml @@ -16,16 +16,17 @@ jobs: with: text: ${{ github.event.issue.body }} regex: - '\b(Instana|QRadar|MaaS360|Environmental Intelligence Suite|Watson - Orchestrate|Watson Assistant|Planning Analytics|ReaQta|API - Connect|Fusion|Flash Storage|Envizi|Maximo|Turbonomic|Fusion - Microsoft 360)|StepZen|APP Connect Enterprise|Watson - Discovery|Watson Code Assistant|Hybrid Cloud Mesh|AIOps - Insights|Databand|OpenPages|watsonx.data|watsonx.ai|watsonx.gov|QRadar - Log Insights|QRadar XDR|QRadar EDR (ReaQta)|QRadar SOAR|Randori - ASM|Guardium Insights|Trusteer Fraud Protection|Security Verify on - Cloud|Sterling Data Exchange SaaS|TRIRIGA|Sterling Order and - Inventory Management|Supply Chain Intelligence Suite\b' + '\b(API Connect|Turbonomic|Instana|NS1|watsonx Orchestrate|watsonx + Code Assistant|Planning Analytics|SPSS + Statistics|watsonx.data|watsonx.ai|watsonx.governance|Maximo + Application Suite|Environmental Intelligence Suite|Envizi ESG + Suite|QRadar Log Insights|QRadar XDR/EDR (ReaQta)|Randori ASM|QRadar + SIEM|MaaS360|Flash|Defender|Fusion|APP Connect|Apptio + Cloudability|Apptio Targetprocess|AIOps Insights|Hybrid Cloud + Mesh|Aspera|Blueworks Live|OpenPages|Databand.ai|Cognos + Analytics|Sterling B2B Integration SaaS|Sterling Order & Inventory + Management|Supply Chain Intelligence Suite|TRIRIGA Application + Suite|QRadar SOAR|Guardium Insights|Verify on Cloud\b' flags: g - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 if: ${{ steps.regex-match.outputs.match != '' }} diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index f8a2a04f1178..1432eab99574 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -9716,6 +9716,19 @@ Map { ], "type": "oneOf", }, + "renderIcon": Object { + "args": Array [ + Array [ + Object { + "type": "func", + }, + Object { + "type": "object", + }, + ], + ], + "type": "oneOfType", + }, "size": Object { "args": Array [ Array [ diff --git a/packages/react/src/components/ChatButton/ChatButton.js b/packages/react/src/components/ChatButton/ChatButton.js index 6f181e854ecb..6448fd2fa67d 100644 --- a/packages/react/src/components/ChatButton/ChatButton.js +++ b/packages/react/src/components/ChatButton/ChatButton.js @@ -19,6 +19,7 @@ const ChatButton = React.forwardRef(function ChatButton( isQuickAction, isSelected, kind, + renderIcon, size, ...other }, @@ -27,6 +28,7 @@ const ChatButton = React.forwardRef(function ChatButton( const prefix = usePrefix(); const classNames = classnames(className, { [`${prefix}--chat-btn`]: true, + [`${prefix}--chat-btn--with-icon`]: renderIcon, [`${prefix}--chat-btn--quick-action`]: isQuickAction, [`${prefix}--chat-btn--quick-action--selected`]: isSelected, }); @@ -48,6 +50,7 @@ const ChatButton = React.forwardRef(function ChatButton( kind={kind} ref={ref} size={size} + renderIcon={renderIcon} {...other}> {children} @@ -91,6 +94,12 @@ ChatButton.propTypes = { 'tertiary', ]), + /** + * Optional prop to specify an icon to be rendered. + * Can be a React component class + */ + renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]), + /** * Specify the size of the `ChatButton`, from the following list of sizes: */ diff --git a/packages/react/src/components/ChatButton/ChatButton.stories.js b/packages/react/src/components/ChatButton/ChatButton.stories.js index 8f2d940cb18d..28c31a8c15fd 100644 --- a/packages/react/src/components/ChatButton/ChatButton.stories.js +++ b/packages/react/src/components/ChatButton/ChatButton.stories.js @@ -63,6 +63,11 @@ export const Default = () => ( Primary +
+
+ Primary + Primary + Primary

Kinds

@@ -82,6 +87,13 @@ export const Default = () => ( Danger +
+
+ Primary + Secondary + Tertiary + Ghost + Danger

Quick action

@@ -98,6 +110,18 @@ export const Default = () => ( Disabled +
+
+ Quick action + + Selected and Enabled + + + Selected and Disabled + + + Disabled +
diff --git a/packages/react/src/components/ComposedModal/ComposedModal.tsx b/packages/react/src/components/ComposedModal/ComposedModal.tsx index 9587badedea3..883e6eb15601 100644 --- a/packages/react/src/components/ComposedModal/ComposedModal.tsx +++ b/packages/react/src/components/ComposedModal/ComposedModal.tsx @@ -242,7 +242,7 @@ const ComposedModal = React.forwardRef( const startSentinel = useRef(null); const endSentinel = useRef(null); - // Kepp track of modal open/close state + // Keep track of modal open/close state // and propagate it to the document.body useEffect(() => { if (open !== wasOpen) { @@ -259,6 +259,7 @@ const ComposedModal = React.forwardRef( }, []); // eslint-disable-line react-hooks/exhaustive-deps function handleKeyDown(evt: KeyboardEvent) { + evt.stopPropagation(); if (match(evt, keys.Escape)) { closeModal(evt); } @@ -266,6 +267,7 @@ const ComposedModal = React.forwardRef( onKeyDown?.(evt); } function handleMousedown(evt: MouseEvent) { + evt.stopPropagation(); const isInside = innerModal.current?.contains(evt.target as Node); if (!isInside && !preventCloseOnClickOutside) { closeModal(evt); diff --git a/packages/react/src/components/Modal/Modal.tsx b/packages/react/src/components/Modal/Modal.tsx index 028d2ddac1b1..8496ed0373b3 100644 --- a/packages/react/src/components/Modal/Modal.tsx +++ b/packages/react/src/components/Modal/Modal.tsx @@ -279,6 +279,7 @@ const Modal = React.forwardRef(function Modal( } function handleKeyDown(evt: React.KeyboardEvent) { + evt.stopPropagation(); if (open) { if (match(evt, keys.Escape)) { onRequestClose(evt); @@ -295,6 +296,7 @@ const Modal = React.forwardRef(function Modal( function handleMousedown(evt: React.MouseEvent) { const target = evt.target as Node; + evt.stopPropagation(); if ( innerModal.current && !innerModal.current.contains(target) && diff --git a/packages/styles/scss/components/chat-button/_chat-button.scss b/packages/styles/scss/components/chat-button/_chat-button.scss index 29395c0ea7be..6c3a33b3e88b 100644 --- a/packages/styles/scss/components/chat-button/_chat-button.scss +++ b/packages/styles/scss/components/chat-button/_chat-button.scss @@ -16,6 +16,10 @@ border-radius: convert.to-rem(24px); } + .#{$prefix}--chat-btn:not(.#{$prefix}--chat-btn--with-icon) { + padding-inline-end: convert.to-rem(15px); + } + .#{$prefix}--chat-btn.#{$prefix}--btn--md { border-radius: convert.to-rem(20px); }