diff --git a/system/core/src/components/InputAlert.ts b/system/core/src/components/InputAlert.ts index fbb25f47b..30b7d92b1 100644 --- a/system/core/src/components/InputAlert.ts +++ b/system/core/src/components/InputAlert.ts @@ -3,7 +3,7 @@ import { css } from '@emotion/react'; export const element = 'span'; export const className = 'input-alert'; -const variants = ['info', 'error', 'warning'] as const; +const variants = ['info', 'error', 'warning', 'bare', 'bare-disabled'] as const; export type InputAlertVariant = (typeof variants)[number]; @@ -28,13 +28,14 @@ export const baseStyles = css` } &[data-variant='error'], - &[data-variant='warning'] { + &[data-variant='warning'], + &[data-variant='info'] { border-radius: var(--border-radius-small); padding: var(--spacing-l2) var(--spacing-l3); } - &[data-variant='info'] > svg:first-child { - color: var(--info); + &[data-variant='bare-disabled'] { + color: var(--text-disabled); } &[data-variant='error'] { @@ -46,4 +47,9 @@ export const baseStyles = css` background: var(--warning-surface); color: var(--warning-text); } + + &[data-variant='info'] { + background: var(--info-surface); + color: var(--info-text); + } `; diff --git a/system/react-css/src/structuredComponents/InputAlert.tsx b/system/react-css/src/structuredComponents/InputAlert.tsx index 0bfc9cc2d..e537d0ebd 100644 --- a/system/react-css/src/structuredComponents/InputAlert.tsx +++ b/system/react-css/src/structuredComponents/InputAlert.tsx @@ -6,12 +6,16 @@ export interface Props extends inputAlert.Props { children: React.ReactNode; } -const inputAlertIconMap: Record = - { - info: , - error: , - warning: - }; +const inputAlertIconMap: Record< + inputAlert.Props['data-variant'], + JSX.Element | null +> = { + info: , + error: , + warning: , + bare: null, + 'bare-disabled': null +}; export const InputAlert = React.forwardRef< HTMLSpanElement, diff --git a/system/react/src/structuredComponents/InputAlert.tsx b/system/react/src/structuredComponents/InputAlert.tsx index cf75eca15..cbe49e4a0 100644 --- a/system/react/src/structuredComponents/InputAlert.tsx +++ b/system/react/src/structuredComponents/InputAlert.tsx @@ -11,12 +11,16 @@ export const InputAlertInner = styled(inputAlert.element)` ${inputAlert.baseStyles} `; -const inputAlertIconMap: Record = - { - info: , - error: , - warning: - }; +const inputAlertIconMap: Record< + inputAlert.Props['data-variant'], + JSX.Element | null +> = { + info: , + error: , + warning: , + bare: null, + 'bare-disabled': null +}; export const InputAlert = React.forwardRef< HTMLSpanElement, diff --git a/system/stories/src/InputAlert.stories.tsx b/system/stories/src/InputAlert.stories.tsx index a19d66a8a..ef07554d8 100644 --- a/system/stories/src/InputAlert.stories.tsx +++ b/system/stories/src/InputAlert.stories.tsx @@ -6,7 +6,9 @@ import * as css from '@tablecheck/tablekit-react-css'; const contentVariants: emotion.InputAlertProps[] = [ { id: '1', 'data-variant': 'info', children: 'Info' }, { id: '2', 'data-variant': 'warning', children: 'Warning' }, - { id: '3', 'data-variant': 'error', children: 'Error' } + { id: '3', 'data-variant': 'error', children: 'Error' }, + { id: '4', 'data-variant': 'bare', children: 'Bare' }, + { id: '5', 'data-variant': 'bare-disabled', children: 'Bare Disabled' } ]; export default {