@latte-macchiat-io/latte-vanilla-components 0.0.494 → 0.0.495

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latte-macchiat-io/latte-vanilla-components",
3
- "version": "0.0.494",
3
+ "version": "0.0.495",
4
4
  "description": "Beautiful components for amazing projects, with a touch of Vanilla 🥤",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -14,13 +14,18 @@ import { Paragraph } from '../../Paragraph';
14
14
  export type AlertBoxProps = React.HTMLAttributes<HTMLDivElement> &
15
15
  AlertBoxVariants & {
16
16
  noIcon?: boolean;
17
- iconPath?: string;
17
+ icon?: string | React.ReactNode;
18
18
  title?: string | null;
19
19
  };
20
20
 
21
- export const AlertBox = ({ title, noIcon = false, variant = 'info', className, iconPath = undefined, children }: AlertBoxProps) => (
21
+ export const AlertBox = ({ title, noIcon = false, variant = 'info', className, icon = undefined, children }: AlertBoxProps) => (
22
22
  <Box direction="row" className={cn(alertBox({ variant }), className)}>
23
- {!noIcon && <Icon iconPath={iconPath || icons[variant]} size={50} color={themeContract.boxAlert.variant[variant].iconColor} />}
23
+ {!noIcon &&
24
+ (typeof icon === 'string' ? (
25
+ <Icon iconPath={icon || icons[variant]} size={50} color={themeContract.boxAlert.variant[variant].iconColor} />
26
+ ) : (
27
+ icon
28
+ ))}
24
29
  <div className={alertBoxContent}>
25
30
  {title && <Heading as="h4">{title}</Heading>}
26
31
  <Paragraph>{children}</Paragraph>