Skip to content

Commit

Permalink
Merge branch 'main' into docs-update
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored Feb 22, 2024
2 parents 75be86e + 688a183 commit 22ebc97
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 11 additions & 10 deletions .github/workflows/issue-triage-strategic-adopter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 != '' }}
Expand Down
13 changes: 13 additions & 0 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
9 changes: 9 additions & 0 deletions packages/react/src/components/ChatButton/ChatButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const ChatButton = React.forwardRef(function ChatButton(
isQuickAction,
isSelected,
kind,
renderIcon,
size,
...other
},
Expand All @@ -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,
});
Expand All @@ -48,6 +50,7 @@ const ChatButton = React.forwardRef(function ChatButton(
kind={kind}
ref={ref}
size={size}
renderIcon={renderIcon}
{...other}>
{children}
</Button>
Expand Down Expand Up @@ -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:
*/
Expand Down
24 changes: 24 additions & 0 deletions packages/react/src/components/ChatButton/ChatButton.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export const Default = () => (
<ChatButton size="lg" renderIcon={Add}>
Primary
</ChatButton>
<br />
<br />
<ChatButton size="sm">Primary</ChatButton>
<ChatButton size="md">Primary</ChatButton>
<ChatButton size="lg">Primary</ChatButton>
</div>
<div className="test-button-kinds">
<h3>Kinds</h3>
Expand All @@ -82,6 +87,13 @@ export const Default = () => (
<ChatButton kind="danger" renderIcon={Add}>
Danger
</ChatButton>
<br />
<br />
<ChatButton kind="primary">Primary</ChatButton>
<ChatButton kind="secondary">Secondary</ChatButton>
<ChatButton kind="tertiary">Tertiary</ChatButton>
<ChatButton kind="ghost">Ghost</ChatButton>
<ChatButton kind="danger">Danger</ChatButton>
</div>
<div className="test-button-quick-action">
<h3>Quick action</h3>
Expand All @@ -98,6 +110,18 @@ export const Default = () => (
<ChatButton disabled isQuickAction renderIcon={Add}>
Disabled
</ChatButton>
<br />
<br />
<ChatButton isQuickAction>Quick action</ChatButton>
<ChatButton isSelected isQuickAction>
Selected and Enabled
</ChatButton>
<ChatButton disabled isSelected isQuickAction>
Selected and Disabled
</ChatButton>
<ChatButton disabled isQuickAction>
Disabled
</ChatButton>
</div>

<div className="test-button-skeleton">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const ComposedModal = React.forwardRef<HTMLDivElement, ComposedModalProps>(
const startSentinel = useRef<HTMLButtonElement>(null);
const endSentinel = useRef<HTMLButtonElement>(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) {
Expand All @@ -259,13 +259,15 @@ const ComposedModal = React.forwardRef<HTMLDivElement, ComposedModalProps>(
}, []); // eslint-disable-line react-hooks/exhaustive-deps

function handleKeyDown(evt: KeyboardEvent) {
evt.stopPropagation();
if (match(evt, keys.Escape)) {
closeModal(evt);
}

onKeyDown?.(evt);
}
function handleMousedown(evt: MouseEvent) {
evt.stopPropagation();
const isInside = innerModal.current?.contains(evt.target as Node);
if (!isInside && !preventCloseOnClickOutside) {
closeModal(evt);
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ const Modal = React.forwardRef(function Modal(
}

function handleKeyDown(evt: React.KeyboardEvent<HTMLDivElement>) {
evt.stopPropagation();
if (open) {
if (match(evt, keys.Escape)) {
onRequestClose(evt);
Expand All @@ -295,6 +296,7 @@ const Modal = React.forwardRef(function Modal(

function handleMousedown(evt: React.MouseEvent<HTMLDivElement>) {
const target = evt.target as Node;
evt.stopPropagation();
if (
innerModal.current &&
!innerModal.current.contains(target) &&
Expand Down
4 changes: 4 additions & 0 deletions packages/styles/scss/components/chat-button/_chat-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 22ebc97

Please sign in to comment.