Skip to content

Commit a9cb9eb

Browse files
committed
chore: change import dropzone background colors
1 parent b232e81 commit a9cb9eb

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 colorProps = getDropzoneColors(props)
38+
39+
return {
40+
dropzone: {
41+
...colorProps.dropzone,
42+
},
43+
}
44+
})
45+
46+
const variants = {
47+
outline: variantOutline,
48+
}
49+
50+
export const Attachment = defineMultiStyleConfig({
51+
variants,
52+
})

packages/frontend/src/theme/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Attachment } from './Attachment'
12
import { Button } from './Button'
23
import { Container } from './Container'
34
import { FormLabel } from './FormLabel'
@@ -20,4 +21,5 @@ export const components = {
2021
Sidebar,
2122
SingleSelect,
2223
Radio,
24+
Attachment,
2325
}

0 commit comments

Comments
 (0)