Skip to content

Commit 4dfd50a

Browse files
committed
feat(icon): added an error icon to the IconProvider Component and useIcon Hook
This will be useful for the new form validation hooks and components that are being made.
1 parent 9ece3e1 commit 4dfd50a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/documentation/src/components/Layout/Layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
ArrowUpwardSVGIcon,
1111
CheckBoxSVGIcon,
1212
CheckSVGIcon,
13+
ErrorOutlineSVGIcon,
1314
FileDownloadSVGIcon,
1415
KeyboardArrowDownSVGIcon,
1516
KeyboardArrowLeftSVGIcon,
@@ -49,6 +50,7 @@ const icons: ConfiguredIcons = {
4950
dropdown: <ArrowDropDownSVGIcon />,
5051
download: <FileDownloadSVGIcon />,
5152
expander: <KeyboardArrowDownSVGIcon />,
53+
error: <ErrorOutlineSVGIcon />,
5254
forward: <KeyboardArrowRightSVGIcon />,
5355
menu: <MenuSVGIcon />,
5456
notification: <NotificationsSVGIcon />,

packages/icon/src/IconProvider.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ export interface ConfigurableIcons {
3030
*/
3131
download?: ReactNode;
3232

33+
/**
34+
* The general icon to use when there are form errors.
35+
*/
36+
error?: ReactNode;
37+
3338
/**
3439
* The general icon to use for expanding content vertically.
3540
*/
@@ -84,6 +89,7 @@ const DEFAULT_ICONS: ConfiguredIcons = {
8489
checkbox: <FontIcon>check_box</FontIcon>,
8590
download: <FontIcon>file_download</FontIcon>,
8691
dropdown: <FontIcon>arrow_drop_down</FontIcon>,
92+
error: <FontIcon>error_outline</FontIcon>,
8793
expander: <FontIcon>keyboard_arrow_down</FontIcon>,
8894
forward: <FontIcon>keyboard_arrow_right</FontIcon>,
8995
menu: <FontIcon>menu</FontIcon>,
@@ -144,6 +150,7 @@ export function IconProvider({
144150
download = DEFAULT_ICONS.download,
145151
dropdown = DEFAULT_ICONS.dropdown,
146152
expander = DEFAULT_ICONS.expander,
153+
error = DEFAULT_ICONS.error,
147154
forward = DEFAULT_ICONS.forward,
148155
menu = DEFAULT_ICONS.menu,
149156
notification = DEFAULT_ICONS.notification,
@@ -158,6 +165,7 @@ export function IconProvider({
158165
checkbox,
159166
download,
160167
dropdown,
168+
error,
161169
expander,
162170
forward,
163171
menu,
@@ -172,6 +180,7 @@ export function IconProvider({
172180
checkbox,
173181
download,
174182
dropdown,
183+
error,
175184
expander,
176185
forward,
177186
menu,
@@ -196,6 +205,7 @@ if (process.env.NODE_ENV !== "production") {
196205
checkbox: PropTypes.node,
197206
download: PropTypes.node,
198207
dropdown: PropTypes.node,
208+
error: PropTypes.node,
199209
expander: PropTypes.node,
200210
forward: PropTypes.node,
201211
menu: PropTypes.node,

0 commit comments

Comments
 (0)