Skip to content

Commit

Permalink
feat: Add typedef to Alert component
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed Mar 11, 2024
1 parent dccc685 commit 16f2097
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions react/Alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ const Alert = forwardRef(

Alert.displayName = 'Alert'

/**
* @typedef {Object} AlertProps
* @property {string} className - Classname of the alert
* @property {React.FC<PropTypes.InferProps<typeof Icon.propTypes>>|false} icon - Icon component to display in the alert (or false to hide it)
* @property {'primary'|'secondary'|'success'|'error'|'warning'|'info'} severity - Severity of the alert (default: primary)
* @property {boolean} block - Block the alert to the full width of its container (default: false)
* @property {string} color - Background color of the alert
* @property {boolean} square - Square the alert corners (default: false)
* @property {'standard'|'outlined'|'filled'} variant - Variant of the alert (default: standard)
*/

export const AlertPropTypes = {
className: PropTypes.string,
icon: PropTypes.oneOfType([PropTypes.element, PropTypes.bool]),
Expand Down

0 comments on commit 16f2097

Please sign in to comment.