Skip to content

Commit

Permalink
update missing custom css instances
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Apr 26, 2023
1 parent 75e0ec6 commit 4cb14ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/react-core/src/components/Modal/examples/Modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ To exclusively present information in a modal, remove the `header` and/or `foote

### Title icon

To add an icon before a modal’s title, use the `titleIconVariant`, which can be set to one of the predefined variants -- "success", "danger", "warning", "info", and "default" -- or to an imported custom icon. The following example uses a "warning" variant.
To add an icon before a modal’s title, use the `titleIconVariant`, which can be set to one of the predefined variants -- "success", "danger", "warning", "info", and "custom" -- or to an imported custom icon. The following example uses a "warning" variant.

```ts file="./ModalTitleIcon.tsx"

Expand Down
4 changes: 2 additions & 2 deletions packages/react-core/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface PopoverProps {
/** Severity variants for an alert popover. This modifies the color of the header to
* match the severity.
*/
alertSeverityVariant?: 'default' | 'info' | 'warning' | 'success' | 'danger';
alertSeverityVariant?: 'custom' | 'info' | 'warning' | 'success' | 'danger';
/** The duration of the CSS fade transition animation. */
animationDuration?: number;
/** The element to append the popover to. Defaults to "inline". */
Expand Down Expand Up @@ -210,7 +210,7 @@ export interface PopoverProps {
}

const alertStyle = {
default: styles.modifiers.custom,
custom: styles.modifiers.custom,
info: styles.modifiers.info,
success: styles.modifiers.success,
warning: styles.modifiers.warning,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const AlertPopover: React.FunctionComponent = () => {
const [alertSeverityVariant, setAlertSeverityVariant] = React.useState('default');

const alertIcons = {
default: <BellIcon />,
custom: <BellIcon />,
info: <InfoCircleIcon />,
success: <CheckCircleIcon />,
warning: <ExclamationTriangleIcon />,
Expand All @@ -21,7 +21,7 @@ export const AlertPopover: React.FunctionComponent = () => {
<>
<div>
<span style={{ paddingRight: '10px' }}>Alert variant:</span>
<select aria-label="Popover alert type" onChange={event => setAlertSeverityVariant(event.target.value)}>
<select aria-label="Popover alert type" onChange={(event) => setAlertSeverityVariant(event.target.value)}>
<option value="default">default</option>
<option value="info">info</option>
<option value="success">success</option>
Expand All @@ -32,7 +32,7 @@ export const AlertPopover: React.FunctionComponent = () => {
<div style={{ margin: '50px' }}>
<Popover
aria-label="Alert popover"
alertSeverityVariant={alertSeverityVariant as 'default' | 'info' | 'warning' | 'success' | 'danger'}
alertSeverityVariant={alertSeverityVariant as 'custom' | 'info' | 'warning' | 'success' | 'danger'}
headerContent="Default popover title"
headerIcon={alertIcons[alertSeverityVariant]}
headerComponent="h1"
Expand Down

0 comments on commit 4cb14ae

Please sign in to comment.