File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { css } from '@emotion/react' ;
2+ import React , { ReactNode } from 'react' ;
3+ import { error , warning , mutedBlue } from '../../definitions/colors' ;
4+
5+ export interface Props {
6+ type : 'info' | 'warning' | 'error' ;
7+ children : ReactNode ;
8+ }
9+
10+ const baseCss = css `
11+ border-left : 0.25em solid var (--note-box-border-color );
12+ border-radius : 0.25em ;
13+ padding : 0.5em 1em ;
14+ background : var (--note-box-bg-color );
15+ gap : 1em ;
16+ margin-bottom : 1em ;
17+ ` ;
18+
19+ const infoCss = css `
20+ --note-box-bg-color : ${ mutedBlue [ 100 ] } ;
21+ --note-box-border-color : ${ mutedBlue [ 600 ] } ;
22+ ${ baseCss } ;
23+ ` ;
24+
25+ const warningCss = css `
26+ - - not e-box- bg- color : ${ warning [ 100 ] } ;
27+ - - not e-box- bor der- color : ${ warning [ 600 ] } ;
28+ font- weight: 500 ;
29+ ${ baseCss } ;
30+ ` ;
31+
32+ const errorCss = css `
33+ - - not e-box- bg- color : ${ error [ 100 ] } ;
34+ - - not e-box- bor der- color : ${ error [ 600 ] } ;
35+ font- weight: 500;
36+ ${ baseCss } ;
37+ ` ;
38+
39+ export function NoteBox ( props : Props ) {
40+ const finalCss =
41+ props . type === 'warning'
42+ ? warningCss
43+ : props . type === 'error'
44+ ? errorCss
45+ : infoCss ;
46+ return < div css = { finalCss } > { props . children } </ div > ;
47+ }
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export { default as SelectTree } from './components/inputs/SelectTree/SelectTree
3030export { default as SearchBox } from './components/inputs/SearchBox/SearchBox' ;
3131export { default as CheckboxList } from './components/inputs/checkboxes/CheckboxList' ;
3232export { default as CheckboxTree } from './components/inputs/checkboxes/CheckboxTree/CheckboxTree' ;
33+ export { NoteBox } from './components/containers/NoteBox' ;
3334
3435export { default as styles } from './styleDefinitions' ;
3536export { default as colors } from './definitions/colors' ;
You can’t perform that action at this time.
0 commit comments