File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed
packages/frontend/src/theme/components Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createMultiStyleConfigHelpers } from '@chakra-ui/react'
2+ import { anatomy } from '@chakra-ui/theme-tools'
3+
4+ const parts = anatomy ( 'attachment' ) . parts (
5+ 'container' ,
6+ 'dropzone' ,
7+ 'icon' ,
8+ 'fileInfoContainer' ,
9+ 'fileInfo' ,
10+ 'fileInfoDescription' ,
11+ 'fileInfoImage' ,
12+ 'fileInfoTitle' ,
13+ 'fileInfoIcon' ,
14+ 'fileErrorIcon' ,
15+ 'fileErrorMessage' ,
16+ )
17+
18+ const { definePartsStyle, defineMultiStyleConfig } =
19+ createMultiStyleConfigHelpers ( parts . keys )
20+
21+ const getDropzoneColors = definePartsStyle ( ( { colorScheme : c } ) => {
22+ return {
23+ dropzone : {
24+ borderColor : `${ c } .700` ,
25+ bg : `${ c } .100` ,
26+ _hover : {
27+ bg : `${ c } .200` ,
28+ } ,
29+ _active : {
30+ bg : `${ c } .200` ,
31+ } ,
32+ } ,
33+ }
34+ } )
35+
36+ const variantOutline = definePartsStyle ( ( props ) => {
37+ const { errorBorderColor : ec } = props
38+
39+ const colorProps = getDropzoneColors ( props )
40+
41+ return {
42+ dropzone : {
43+ ...colorProps . dropzone ,
44+ } ,
45+ }
46+ } )
47+
48+ const variants = {
49+ outline : variantOutline ,
50+ }
51+
52+ export const Attachment = defineMultiStyleConfig ( {
53+ variants,
54+ } )
Original file line number Diff line number Diff line change 1+ import { Attachment } from './Attachment'
12import { Button } from './Button'
23import { Container } from './Container'
34import { FormLabel } from './FormLabel'
@@ -20,4 +21,5 @@ export const components = {
2021 Sidebar,
2122 SingleSelect,
2223 Radio,
24+ Attachment,
2325}
You can’t perform that action at this time.
0 commit comments