/
icons.tsx
93 lines (87 loc) · 2.53 KB
/
icons.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import * as React from 'react';
import {
CheckCircleIcon,
InfoCircleIcon,
ExclamationCircleIcon,
ExclamationTriangleIcon,
} from '@patternfly/react-icons';
import * as classNames from 'classnames';
import './icons.scss';
export type ColoredIconProps = {
className?: string;
title?: string;
size?: 'sm' | 'md' | 'lg' | 'xl';
};
/**
* Component for displaying a green check mark circle icon
* @param {string} [className] - (optional) class name for styling
* @param {string} [title] - (optional) icon title
* @param {string} [size] - (optional) icon size: 'sm' | 'md' | 'lg' | 'xl'
* @example
* ```tsx
* <GreenCheckCircleIcon />
* ```
*/
export const GreenCheckCircleIcon: React.FC<ColoredIconProps> = ({ className, title, size }) => (
<CheckCircleIcon
data-test="success-icon"
size={size}
className={classNames('dps-icons__green-check-icon', className)}
title={title}
/>
);
/**
* Component for displaying a red exclamation mark circle icon
* @param {string} [className] - (optional) class name for styling
* @param {string} [title] - (optional) icon title
* @param {string} [size] - (optional) icon size: 'sm' | 'md' | 'lg' | 'xl'
* @example
* ```tsx
* <RedExclamationCircleIcon />
* ```
*/
export const RedExclamationCircleIcon: React.FC<ColoredIconProps> = ({
className,
title,
size,
}) => (
<ExclamationCircleIcon
size={size}
className={classNames('dps-icons__red-exclamation-icon', className)}
title={title}
/>
);
/**
* Component for displaying a yellow triangle exclamation icon
* @param {string} [className] - (optional) class name for styling
* @param {string} [title] - (optional) icon title
* @param {string} [size] - (optional) icon size: 'sm' | 'md' | 'lg' | 'xl'
* @example
* ```tsx
* <YellowExclamationTriangleIcon />
* ```
*/
export const YellowExclamationTriangleIcon: React.FC<ColoredIconProps> = ({
className,
title,
size,
}) => (
<ExclamationTriangleIcon
size={size}
className={classNames('dps-icons__yellow-exclamation-icon', className)}
title={title}
/>
);
/**
* Component for displaying a blue info circle icon
* @param {string} [className] - (optional) class name for styling
* @param {string} [title] - (optional) icon title
* @param {string} [size] - (optional) icon size: 'sm' | 'md' | 'lg' | 'xl'
* @example
* ```tsx
* <BlueInfoCircleIcon />
* ```
*/
export const BlueInfoCircleIcon: React.FC<ColoredIconProps> = ({ className, title }) => (
<InfoCircleIcon className={classNames('dps-icons__blue-info-icon', className)} title={title} />
);