@veracity/vui 2.5.0-beta.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/cjs/checkbox/checkbox.js +5 -5
- package/dist/cjs/checkbox/checkbox.types.d.ts +1 -1
- package/dist/cjs/checkbox/checkbox.types.d.ts.map +1 -1
- package/dist/cjs/checkbox/checkboxGroup.d.ts.map +1 -1
- package/dist/cjs/checkbox/checkboxGroup.js +2 -2
- package/dist/cjs/checkbox/checkboxGroup.types.d.ts +1 -1
- package/dist/cjs/checkbox/checkboxGroup.types.d.ts.map +1 -1
- package/dist/cjs/checkbox/consts.d.ts +6 -0
- package/dist/cjs/checkbox/consts.d.ts.map +1 -0
- package/dist/cjs/checkbox/consts.js +8 -0
- package/dist/cjs/checkbox/theme.d.ts +7 -13
- package/dist/cjs/checkbox/theme.d.ts.map +1 -1
- package/dist/cjs/checkbox/theme.js +8 -19
- package/dist/cjs/core/consts.d.ts +1 -0
- package/dist/cjs/core/consts.d.ts.map +1 -1
- package/dist/cjs/core/consts.js +2 -1
- package/dist/cjs/core/vuiProvider/fontFaces.d.ts.map +1 -1
- package/dist/cjs/core/vuiProvider/fontFaces.js +44 -4
- package/dist/cjs/core/vuiProvider/globalStyle.d.ts.map +1 -1
- package/dist/cjs/core/vuiProvider/globalStyle.js +5 -2
- package/dist/cjs/icons/baseIcons/fal/falClockRotateLeft.d.ts +4 -0
- package/dist/cjs/icons/baseIcons/fal/falClockRotateLeft.d.ts.map +1 -0
- package/dist/cjs/icons/baseIcons/fal/falClockRotateLeft.js +7 -0
- package/dist/cjs/icons/baseIcons/icons.d.ts +1 -0
- package/dist/cjs/icons/baseIcons/icons.d.ts.map +1 -1
- package/dist/cjs/icons/baseIcons/icons.js +7 -5
- package/dist/cjs/icons/baseIcons/types.d.ts +1 -1
- package/dist/cjs/icons/baseIcons/types.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/input/inputInput.d.ts.map +1 -1
- package/dist/cjs/input/inputInput.js +0 -5
- package/dist/cjs/panel/theme.js +1 -1
- package/dist/cjs/progress/progress.d.ts +1 -1
- package/dist/cjs/progress/progress.d.ts.map +1 -1
- package/dist/cjs/progress/progress.js +10 -7
- package/dist/cjs/progress/progress.types.d.ts +0 -1
- package/dist/cjs/progress/progress.types.d.ts.map +1 -1
- package/dist/cjs/progress/theme.d.ts +15 -1
- package/dist/cjs/progress/theme.d.ts.map +1 -1
- package/dist/cjs/progress/theme.js +16 -2
- package/dist/cjs/progressCircular/consts.d.ts +12 -0
- package/dist/cjs/progressCircular/consts.d.ts.map +1 -0
- package/dist/cjs/progressCircular/consts.js +14 -0
- package/dist/cjs/progressCircular/index.d.ts +4 -0
- package/dist/cjs/progressCircular/index.d.ts.map +1 -0
- package/dist/cjs/progressCircular/index.js +24 -0
- package/dist/cjs/progressCircular/progressCircular.d.ts +6 -0
- package/dist/cjs/progressCircular/progressCircular.d.ts.map +1 -0
- package/dist/cjs/progressCircular/progressCircular.js +82 -0
- package/dist/cjs/progressCircular/progressCircular.types.d.ts +8 -0
- package/dist/cjs/progressCircular/progressCircular.types.d.ts.map +1 -0
- package/dist/cjs/progressCircular/progressCircular.types.js +2 -0
- package/dist/cjs/progressCircular/theme.d.ts +57 -0
- package/dist/cjs/progressCircular/theme.d.ts.map +1 -0
- package/dist/cjs/progressCircular/theme.js +47 -0
- package/dist/cjs/radio/consts.d.ts +6 -0
- package/dist/cjs/radio/consts.d.ts.map +1 -0
- package/dist/cjs/radio/consts.js +8 -0
- package/dist/cjs/radio/radio.d.ts.map +1 -1
- package/dist/cjs/radio/radio.js +5 -4
- package/dist/cjs/radio/radio.types.d.ts +1 -1
- package/dist/cjs/radio/radio.types.d.ts.map +1 -1
- package/dist/cjs/radio/radioGroup.d.ts.map +1 -1
- package/dist/cjs/radio/radioGroup.js +2 -3
- package/dist/cjs/radio/radioGroup.types.d.ts +1 -1
- package/dist/cjs/radio/radioGroup.types.d.ts.map +1 -1
- package/dist/cjs/radio/theme.d.ts +7 -13
- package/dist/cjs/radio/theme.d.ts.map +1 -1
- package/dist/cjs/radio/theme.js +8 -19
- package/dist/cjs/switch/consts.d.ts +9 -0
- package/dist/cjs/switch/consts.d.ts.map +1 -0
- package/dist/cjs/switch/consts.js +11 -0
- package/dist/cjs/switch/switch.types.d.ts +2 -2
- package/dist/cjs/switch/switch.types.d.ts.map +1 -1
- package/dist/cjs/switch/switchButton.d.ts.map +1 -1
- package/dist/cjs/switch/switchButton.js +19 -21
- package/dist/cjs/switch/switchMain.d.ts.map +1 -1
- package/dist/cjs/switch/switchMain.js +2 -3
- package/dist/cjs/switch/theme.d.ts +30 -14
- package/dist/cjs/switch/theme.d.ts.map +1 -1
- package/dist/cjs/switch/theme.js +33 -17
- package/dist/cjs/textarea/textarea.d.ts.map +1 -1
- package/dist/cjs/textarea/textarea.js +8 -17
- package/dist/cjs/textarea/textarea.types.d.ts +2 -2
- package/dist/cjs/textarea/textarea.types.d.ts.map +1 -1
- package/dist/cjs/textarea/theme.d.ts +29 -12
- package/dist/cjs/textarea/theme.d.ts.map +1 -1
- package/dist/cjs/textarea/theme.js +28 -17
- package/dist/cjs/theme/components.d.ts +132 -34
- package/dist/cjs/theme/components.d.ts.map +1 -1
- package/dist/cjs/theme/components.js +26 -24
- package/dist/cjs/theme/defaultTheme.d.ts +132 -34
- package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
- package/dist/cjs/tutorial/consts.d.ts +6 -0
- package/dist/cjs/tutorial/consts.d.ts.map +1 -0
- package/dist/cjs/tutorial/consts.js +8 -0
- package/dist/cjs/tutorial/tutorial.d.ts +1 -1
- package/dist/cjs/tutorial/tutorial.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorial.js +2 -2
- package/dist/cjs/tutorial/tutorial.types.d.ts +20 -12
- package/dist/cjs/tutorial/tutorial.types.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorialCard.d.ts +1 -1
- package/dist/cjs/tutorial/tutorialCard.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorialCard.js +19 -18
- package/dist/cjs/tutorial/tutorialStep.d.ts +1 -1
- package/dist/cjs/tutorial/tutorialStep.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorialStep.js +4 -5
- package/dist/esm/checkbox/checkbox.d.ts.map +1 -1
- package/dist/esm/checkbox/checkbox.js +5 -5
- package/dist/esm/checkbox/checkbox.types.d.ts +1 -1
- package/dist/esm/checkbox/checkbox.types.d.ts.map +1 -1
- package/dist/esm/checkbox/checkboxGroup.d.ts.map +1 -1
- package/dist/esm/checkbox/checkboxGroup.js +2 -2
- package/dist/esm/checkbox/checkboxGroup.types.d.ts +1 -1
- package/dist/esm/checkbox/checkboxGroup.types.d.ts.map +1 -1
- package/dist/esm/checkbox/consts.d.ts +6 -0
- package/dist/esm/checkbox/consts.d.ts.map +1 -0
- package/dist/esm/checkbox/consts.js +5 -0
- package/dist/esm/checkbox/theme.d.ts +7 -13
- package/dist/esm/checkbox/theme.d.ts.map +1 -1
- package/dist/esm/checkbox/theme.js +8 -19
- package/dist/esm/core/consts.d.ts +1 -0
- package/dist/esm/core/consts.d.ts.map +1 -1
- package/dist/esm/core/consts.js +1 -0
- package/dist/esm/core/vuiProvider/fontFaces.d.ts.map +1 -1
- package/dist/esm/core/vuiProvider/fontFaces.js +45 -5
- package/dist/esm/core/vuiProvider/globalStyle.d.ts.map +1 -1
- package/dist/esm/core/vuiProvider/globalStyle.js +5 -2
- package/dist/esm/icons/baseIcons/fal/falClockRotateLeft.d.ts +4 -0
- package/dist/esm/icons/baseIcons/fal/falClockRotateLeft.d.ts.map +1 -0
- package/dist/esm/icons/baseIcons/fal/falClockRotateLeft.js +5 -0
- package/dist/esm/icons/baseIcons/icons.d.ts +1 -0
- package/dist/esm/icons/baseIcons/icons.d.ts.map +1 -1
- package/dist/esm/icons/baseIcons/icons.js +1 -0
- package/dist/esm/icons/baseIcons/types.d.ts +1 -1
- package/dist/esm/icons/baseIcons/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/input/inputInput.d.ts.map +1 -1
- package/dist/esm/input/inputInput.js +0 -5
- package/dist/esm/panel/theme.js +1 -1
- package/dist/esm/progress/progress.d.ts +1 -1
- package/dist/esm/progress/progress.d.ts.map +1 -1
- package/dist/esm/progress/progress.js +10 -7
- package/dist/esm/progress/progress.types.d.ts +0 -1
- package/dist/esm/progress/progress.types.d.ts.map +1 -1
- package/dist/esm/progress/theme.d.ts +15 -1
- package/dist/esm/progress/theme.d.ts.map +1 -1
- package/dist/esm/progress/theme.js +16 -2
- package/dist/esm/progressCircular/consts.d.ts +12 -0
- package/dist/esm/progressCircular/consts.d.ts.map +1 -0
- package/dist/esm/progressCircular/consts.js +11 -0
- package/dist/esm/progressCircular/index.d.ts +4 -0
- package/dist/esm/progressCircular/index.d.ts.map +1 -0
- package/dist/esm/progressCircular/index.js +3 -0
- package/dist/esm/progressCircular/progressCircular.d.ts +6 -0
- package/dist/esm/progressCircular/progressCircular.d.ts.map +1 -0
- package/dist/esm/progressCircular/progressCircular.js +45 -0
- package/dist/esm/progressCircular/progressCircular.types.d.ts +8 -0
- package/dist/esm/progressCircular/progressCircular.types.d.ts.map +1 -0
- package/dist/esm/progressCircular/progressCircular.types.js +1 -0
- package/dist/esm/progressCircular/theme.d.ts +57 -0
- package/dist/esm/progressCircular/theme.d.ts.map +1 -0
- package/dist/esm/progressCircular/theme.js +45 -0
- package/dist/esm/radio/consts.d.ts +6 -0
- package/dist/esm/radio/consts.d.ts.map +1 -0
- package/dist/esm/radio/consts.js +5 -0
- package/dist/esm/radio/radio.d.ts.map +1 -1
- package/dist/esm/radio/radio.js +5 -4
- package/dist/esm/radio/radio.types.d.ts +1 -1
- package/dist/esm/radio/radio.types.d.ts.map +1 -1
- package/dist/esm/radio/radioGroup.d.ts.map +1 -1
- package/dist/esm/radio/radioGroup.js +2 -3
- package/dist/esm/radio/radioGroup.types.d.ts +1 -1
- package/dist/esm/radio/radioGroup.types.d.ts.map +1 -1
- package/dist/esm/radio/theme.d.ts +7 -13
- package/dist/esm/radio/theme.d.ts.map +1 -1
- package/dist/esm/radio/theme.js +8 -19
- package/dist/esm/switch/consts.d.ts +9 -0
- package/dist/esm/switch/consts.d.ts.map +1 -0
- package/dist/esm/switch/consts.js +8 -0
- package/dist/esm/switch/switch.types.d.ts +2 -2
- package/dist/esm/switch/switch.types.d.ts.map +1 -1
- package/dist/esm/switch/switchButton.d.ts.map +1 -1
- package/dist/esm/switch/switchButton.js +19 -21
- package/dist/esm/switch/switchMain.d.ts.map +1 -1
- package/dist/esm/switch/switchMain.js +2 -3
- package/dist/esm/switch/theme.d.ts +30 -14
- package/dist/esm/switch/theme.d.ts.map +1 -1
- package/dist/esm/switch/theme.js +33 -17
- package/dist/esm/textarea/textarea.d.ts.map +1 -1
- package/dist/esm/textarea/textarea.js +8 -17
- package/dist/esm/textarea/textarea.types.d.ts +2 -2
- package/dist/esm/textarea/textarea.types.d.ts.map +1 -1
- package/dist/esm/textarea/theme.d.ts +29 -12
- package/dist/esm/textarea/theme.d.ts.map +1 -1
- package/dist/esm/textarea/theme.js +28 -17
- package/dist/esm/theme/components.d.ts +132 -34
- package/dist/esm/theme/components.d.ts.map +1 -1
- package/dist/esm/theme/components.js +2 -0
- package/dist/esm/theme/defaultTheme.d.ts +132 -34
- package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
- package/dist/esm/tutorial/consts.d.ts +6 -0
- package/dist/esm/tutorial/consts.d.ts.map +1 -0
- package/dist/esm/tutorial/consts.js +5 -0
- package/dist/esm/tutorial/tutorial.d.ts +1 -1
- package/dist/esm/tutorial/tutorial.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorial.js +2 -2
- package/dist/esm/tutorial/tutorial.types.d.ts +20 -12
- package/dist/esm/tutorial/tutorial.types.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorialCard.d.ts +1 -1
- package/dist/esm/tutorial/tutorialCard.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorialCard.js +20 -19
- package/dist/esm/tutorial/tutorialStep.d.ts +1 -1
- package/dist/esm/tutorial/tutorialStep.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorialStep.js +5 -6
- package/package.json +1 -1
- package/src/checkbox/checkbox.tsx +5 -5
- package/src/checkbox/checkbox.types.ts +1 -1
- package/src/checkbox/checkboxGroup.tsx +3 -16
- package/src/checkbox/checkboxGroup.types.ts +1 -1
- package/src/checkbox/consts.ts +5 -0
- package/src/checkbox/theme.ts +7 -23
- package/src/core/consts.ts +1 -0
- package/src/core/vuiProvider/fontFaces.ts +46 -5
- package/src/core/vuiProvider/globalStyle.tsx +5 -2
- package/src/icons/baseIcons/fal/falClockRotateLeft.ts +8 -0
- package/src/icons/baseIcons/icons.ts +1 -0
- package/src/icons/baseIcons/types.ts +1 -0
- package/src/index.ts +1 -0
- package/src/input/inputInput.tsx +0 -5
- package/src/panel/theme.ts +1 -1
- package/src/progress/progress.tsx +11 -7
- package/src/progress/progress.types.ts +0 -1
- package/src/progress/theme.ts +16 -2
- package/src/progressCircular/consts.ts +13 -0
- package/src/progressCircular/index.ts +3 -0
- package/src/progressCircular/progressCircular.tsx +89 -0
- package/src/progressCircular/progressCircular.types.ts +9 -0
- package/src/progressCircular/theme.ts +50 -0
- package/src/radio/consts.ts +5 -0
- package/src/radio/radio.tsx +5 -5
- package/src/radio/radio.types.ts +1 -1
- package/src/radio/radioGroup.tsx +3 -17
- package/src/radio/radioGroup.types.ts +1 -1
- package/src/radio/theme.ts +7 -23
- package/src/switch/consts.ts +8 -0
- package/src/switch/switch.types.ts +2 -2
- package/src/switch/switchButton.tsx +20 -20
- package/src/switch/switchMain.tsx +1 -3
- package/src/switch/theme.ts +34 -22
- package/src/textarea/textarea.tsx +7 -17
- package/src/textarea/textarea.types.ts +2 -2
- package/src/textarea/theme.ts +28 -23
- package/src/theme/components.ts +2 -0
- package/src/tutorial/consts.ts +5 -0
- package/src/tutorial/tutorial.tsx +7 -5
- package/src/tutorial/tutorial.types.ts +20 -12
- package/src/tutorial/tutorialCard.tsx +71 -80
- package/src/tutorial/tutorialStep.tsx +5 -11
- package/dist/cjs/textarea/consts.d.ts +0 -4
- package/dist/cjs/textarea/consts.d.ts.map +0 -1
- package/dist/cjs/textarea/consts.js +0 -6
- package/dist/esm/textarea/consts.d.ts +0 -4
- package/dist/esm/textarea/consts.d.ts.map +0 -1
- package/dist/esm/textarea/consts.js +0 -3
- package/src/textarea/consts.ts +0 -3
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Box, BoxProps } from '../box'
|
|
4
|
+
import { styled, useStyleConfig, vui } from '../core'
|
|
5
|
+
import { T } from '../t'
|
|
6
|
+
import { cs } from '../utils'
|
|
7
|
+
import { absCenterStyles, labelBottom, maxValue } from './consts'
|
|
8
|
+
import { ProgressCircularProps } from './progressCircular.types'
|
|
9
|
+
|
|
10
|
+
export const ProgressCircularBase = styled.divBox`
|
|
11
|
+
display: flex;
|
|
12
|
+
position: relative;
|
|
13
|
+
width: 100%;
|
|
14
|
+
`
|
|
15
|
+
const MainCircle = styled.circle`
|
|
16
|
+
fill: transparent;
|
|
17
|
+
`
|
|
18
|
+
|
|
19
|
+
const ProgressCircle = styled(MainCircle)`
|
|
20
|
+
transform: rotate(-90deg);
|
|
21
|
+
transform-origin: 50% 50%;
|
|
22
|
+
transition: stroke-dashoffset 0.5s ease-out;
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
/** [Beta] Indicates a process progress. */
|
|
26
|
+
export const ProgressCircular = vui<'div', ProgressCircularProps>((props, ref) => {
|
|
27
|
+
const { children, className, label, value = 0, showPercentage, ...rest } = props
|
|
28
|
+
|
|
29
|
+
const styles = useStyleConfig('ProgressCircular', props)
|
|
30
|
+
|
|
31
|
+
const [progress, setProgress] = useState(value)
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setProgress(value ? Math.ceil(value) : 0)
|
|
35
|
+
}, [value])
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const w = !value ? 0 : Math.ceil(value)
|
|
39
|
+
setProgress(w > maxValue ? maxValue : w)
|
|
40
|
+
}, [value])
|
|
41
|
+
|
|
42
|
+
const radius = maxValue / 2 - styles.strokeWidth * 2
|
|
43
|
+
const angle = radius * 2 * Math.PI
|
|
44
|
+
const offset = angle - (progress / maxValue) * angle
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<ProgressCircularBase className={cs('vui-progress-circular', className)} ref={ref} w={styles.width} {...rest}>
|
|
48
|
+
<svg
|
|
49
|
+
aria-valuemax={maxValue}
|
|
50
|
+
aria-valuemin={0}
|
|
51
|
+
aria-valuenow={progress}
|
|
52
|
+
height={styles.width}
|
|
53
|
+
version="1.1"
|
|
54
|
+
viewBox="0 0 100 100"
|
|
55
|
+
width={styles.width}
|
|
56
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
+
>
|
|
58
|
+
<MainCircle cx="50" cy="50" r={radius} stroke={styles.stroke.main} strokeWidth={styles.strokeWidth} />
|
|
59
|
+
<ProgressCircle
|
|
60
|
+
cx="50"
|
|
61
|
+
cy="50"
|
|
62
|
+
r={radius}
|
|
63
|
+
stroke={styles.stroke.progress}
|
|
64
|
+
strokeDasharray={`${angle} ${angle}`}
|
|
65
|
+
strokeDashoffset={offset}
|
|
66
|
+
strokeWidth={styles.strokeWidth}
|
|
67
|
+
/>
|
|
68
|
+
</svg>
|
|
69
|
+
<Box {...(absCenterStyles as BoxProps)} top={styles.top}>
|
|
70
|
+
{children ? (
|
|
71
|
+
children
|
|
72
|
+
) : showPercentage ? (
|
|
73
|
+
<T color={styles.color} fontSize={styles.fontSize}>
|
|
74
|
+
{progress}%
|
|
75
|
+
</T>
|
|
76
|
+
) : null}
|
|
77
|
+
</Box>
|
|
78
|
+
{!!label && (
|
|
79
|
+
<Box {...(absCenterStyles as BoxProps)} bottom={labelBottom}>
|
|
80
|
+
<T color={styles.color} fontSize={styles.fontSize}>
|
|
81
|
+
{label}
|
|
82
|
+
</T>
|
|
83
|
+
</Box>
|
|
84
|
+
)}
|
|
85
|
+
</ProgressCircularBase>
|
|
86
|
+
)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export default ProgressCircular
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { darkBlue, energyRed, landGreen } from '../theme/foundations/colors'
|
|
2
|
+
|
|
3
|
+
const baseStyle = {
|
|
4
|
+
color: 'darkBlue.main'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const defaultProps = {
|
|
8
|
+
size: 'md',
|
|
9
|
+
variant: 'primary'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const sizes = {
|
|
13
|
+
sm: {
|
|
14
|
+
strokeWidth: 4,
|
|
15
|
+
width: 46,
|
|
16
|
+
top: 15,
|
|
17
|
+
fontSize: 12
|
|
18
|
+
},
|
|
19
|
+
md: { strokeWidth: 5, width: 80, top: 30, fontSize: 16 },
|
|
20
|
+
lg: { strokeWidth: 6, width: 120, top: 48, fontSize: 18 },
|
|
21
|
+
xl: { strokeWidth: 7, width: 160, top: 64, fontSize: 22 }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const variants = {
|
|
25
|
+
primary: {
|
|
26
|
+
stroke: {
|
|
27
|
+
main: darkBlue[95],
|
|
28
|
+
progress: darkBlue.main
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
green: {
|
|
32
|
+
stroke: {
|
|
33
|
+
main: landGreen[95],
|
|
34
|
+
progress: landGreen.main
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
red: {
|
|
38
|
+
stroke: {
|
|
39
|
+
main: energyRed[95],
|
|
40
|
+
progress: energyRed.main
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
baseStyle,
|
|
47
|
+
defaultProps,
|
|
48
|
+
sizes,
|
|
49
|
+
variants
|
|
50
|
+
}
|
package/src/radio/radio.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { omitThemingProps, styled, th, useStyleConfig, vui } from '../core'
|
|
|
4
4
|
import Icon from '../icon'
|
|
5
5
|
import T from '../t'
|
|
6
6
|
import { ChangeEvent, cs, filterUndefined } from '../utils'
|
|
7
|
+
import { radioColors } from './consts'
|
|
7
8
|
import { useRadioGroupContext } from './context'
|
|
8
9
|
import { RadioProps, RadioStyleProps } from './radio.types'
|
|
9
10
|
|
|
@@ -39,11 +40,11 @@ export const RadioBase = styled.labelBox<RadioStyleProps>`
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
&[aria-disabled='true'] {
|
|
42
|
-
color: disabled
|
|
43
|
+
color: ${radioColors.disabled};
|
|
43
44
|
cursor: not-allowed;
|
|
44
45
|
|
|
45
46
|
.vui-radioControl {
|
|
46
|
-
color: disabled
|
|
47
|
+
color: ${radioColors.disabled};
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
`
|
|
@@ -87,8 +88,8 @@ export const Radio = vui<'span', RadioProps>((props, ref) => {
|
|
|
87
88
|
|
|
88
89
|
const icon = isChecked ? iconChecked : iconProp
|
|
89
90
|
const controlMr = children || label ? 1 : 0
|
|
90
|
-
const color =
|
|
91
|
-
const controlHoverColor =
|
|
91
|
+
const color = controlColor ? controlColor : radioColors.main
|
|
92
|
+
const controlHoverColor = hoverColor ? hoverColor : radioColors.hover
|
|
92
93
|
|
|
93
94
|
useEffect(() => {
|
|
94
95
|
if (groupIsChecked !== undefined) {
|
|
@@ -132,7 +133,6 @@ export const Radio = vui<'span', RadioProps>((props, ref) => {
|
|
|
132
133
|
{...{ checked, defaultChecked, disabled, id, name, required, value }}
|
|
133
134
|
{...inputProps}
|
|
134
135
|
/>
|
|
135
|
-
|
|
136
136
|
<Icon className="vui-radioIcon" h="100%" name={icon} w="100%" />
|
|
137
137
|
</RadioControl>
|
|
138
138
|
|
package/src/radio/radio.types.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type RadioProps = SystemProps &
|
|
|
9
9
|
ThemingProps<'Radio'> & {
|
|
10
10
|
/** Provides value to radio in controlled mode. */
|
|
11
11
|
checked?: boolean
|
|
12
|
-
/**
|
|
12
|
+
/** Deprecated. Please use variant instead. @deprecated */
|
|
13
13
|
colorScheme?: 'blue' | 'prussian'
|
|
14
14
|
/** Disables radio and related elements with the right styling. */
|
|
15
15
|
disabled?: boolean
|
package/src/radio/radioGroup.tsx
CHANGED
|
@@ -16,21 +16,8 @@ export const RadioGroupBase = styled.divBox`
|
|
|
16
16
|
* Exposes some props to the children via context.
|
|
17
17
|
*/
|
|
18
18
|
export const RadioGroup = vui<'div', RadioGroupProps>((props, ref) => {
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
colorScheme,
|
|
22
|
-
defaultValue,
|
|
23
|
-
disabled,
|
|
24
|
-
isRow,
|
|
25
|
-
name,
|
|
26
|
-
onBlur,
|
|
27
|
-
onChange,
|
|
28
|
-
onFocus,
|
|
29
|
-
size,
|
|
30
|
-
value,
|
|
31
|
-
variant,
|
|
32
|
-
...rest
|
|
33
|
-
} = props
|
|
19
|
+
const { className, defaultValue, disabled, isRow, name, onBlur, onChange, onFocus, size, value, variant, ...rest } =
|
|
20
|
+
props
|
|
34
21
|
const [isChecked, setIsChecked] = useState(value ?? defaultValue)
|
|
35
22
|
|
|
36
23
|
const handleOnChange = useCallback(
|
|
@@ -44,7 +31,6 @@ export const RadioGroup = vui<'div', RadioGroupProps>((props, ref) => {
|
|
|
44
31
|
const context = useMemo(
|
|
45
32
|
() =>
|
|
46
33
|
filterUndefined({
|
|
47
|
-
colorScheme,
|
|
48
34
|
defaultValue,
|
|
49
35
|
disabled,
|
|
50
36
|
isChecked,
|
|
@@ -56,7 +42,7 @@ export const RadioGroup = vui<'div', RadioGroupProps>((props, ref) => {
|
|
|
56
42
|
value,
|
|
57
43
|
variant
|
|
58
44
|
}),
|
|
59
|
-
[
|
|
45
|
+
[defaultValue, disabled, handleOnChange, isChecked, name, onBlur, onFocus, size, value, variant]
|
|
60
46
|
)
|
|
61
47
|
|
|
62
48
|
const aliasedProps = filterUndefined({
|
|
@@ -4,7 +4,7 @@ import { ChangeEventHandler, FocusEventHandler } from '../utils'
|
|
|
4
4
|
|
|
5
5
|
export type RadioGroupProps = SystemProps &
|
|
6
6
|
ThemingProps<'Radio'> & {
|
|
7
|
-
/**
|
|
7
|
+
/** Deprecated. Please use variant instead. @deprecated */
|
|
8
8
|
colorScheme?: 'blue' | 'prussian'
|
|
9
9
|
/** Passes the prop to each radio. */
|
|
10
10
|
disabled?: boolean
|
package/src/radio/theme.ts
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { radioColors } from './consts'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
color: `${c}.80`,
|
|
8
|
-
hoverColor: `${c}.90`
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (c === 'prussian') {
|
|
12
|
-
control.hoverColor = 'prussian.70'
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
control
|
|
3
|
+
const baseStyle = {
|
|
4
|
+
control: {
|
|
5
|
+
color: radioColors.main,
|
|
6
|
+
hoverColor: radioColors.hover
|
|
17
7
|
}
|
|
18
8
|
}
|
|
19
9
|
|
|
20
|
-
const baseStyle = {}
|
|
21
|
-
|
|
22
10
|
const defaultProps = {
|
|
23
|
-
|
|
24
|
-
size: 'md',
|
|
25
|
-
variant: 'default'
|
|
11
|
+
size: 'md'
|
|
26
12
|
}
|
|
27
13
|
|
|
28
14
|
const parts = ['container', 'control', 'label']
|
|
@@ -57,9 +43,7 @@ const sizes = {
|
|
|
57
43
|
}
|
|
58
44
|
}
|
|
59
45
|
|
|
60
|
-
const variants = {
|
|
61
|
-
default: variantDefault
|
|
62
|
-
}
|
|
46
|
+
const variants = {}
|
|
63
47
|
|
|
64
48
|
export default {
|
|
65
49
|
baseStyle,
|
|
@@ -8,7 +8,7 @@ export type SwitchButtonProps = SystemProps &
|
|
|
8
8
|
ThemingProps<'Switch'> & {
|
|
9
9
|
/** Provides value to switch in controlled mode. */
|
|
10
10
|
checked?: boolean
|
|
11
|
-
/**
|
|
11
|
+
/** Deprecated. Please use variant instead. @deprecated */
|
|
12
12
|
colorScheme?: 'blue' | 'green' | 'prussian'
|
|
13
13
|
/** Disables switch and related elements with the right styling. */
|
|
14
14
|
disabled?: boolean
|
|
@@ -57,7 +57,7 @@ export type SwitchProps = SystemProps &
|
|
|
57
57
|
button?: ReactNode
|
|
58
58
|
/** Provides value to switch button in controlled mode. */
|
|
59
59
|
checked?: boolean
|
|
60
|
-
/**
|
|
60
|
+
/** Deprecated. Please use variant instead. @deprecated */
|
|
61
61
|
colorScheme?: 'blue' | 'green' | 'prussian'
|
|
62
62
|
/** Disables switch and related elements with the right styling. */
|
|
63
63
|
disabled?: boolean
|
|
@@ -2,6 +2,7 @@ import React, { useEffect, useRef, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
|
|
4
4
|
import { ChangeEvent, cs, filterUndefined, FocusEvent } from '../utils'
|
|
5
|
+
import { switchColors } from './consts'
|
|
5
6
|
import { useSwitchContext } from './context'
|
|
6
7
|
import { SwitchButtonProps } from './switch.types'
|
|
7
8
|
|
|
@@ -18,43 +19,41 @@ const SwitchInput = styled.inputBox`
|
|
|
18
19
|
z-index: 1;
|
|
19
20
|
`
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
border-radius: round;
|
|
22
|
+
const SwitchFoundation = styled.spanBox`
|
|
23
|
+
border-radius: 100px;
|
|
24
24
|
display: inline-flex;
|
|
25
25
|
flex-shrink: 0;
|
|
26
|
-
position: absolute;
|
|
27
26
|
transition-duration: fast;
|
|
27
|
+
position: relative;
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
/** Circular element that moves along the track when toggled. */
|
|
31
|
+
const SwitchThumb = styled(SwitchFoundation)`
|
|
32
|
+
position: absolute;
|
|
28
33
|
`
|
|
29
34
|
|
|
30
35
|
/** Track element along which the thumb moves when toggled. */
|
|
31
|
-
const SwitchTrack = styled
|
|
36
|
+
const SwitchTrack = styled(SwitchFoundation)`
|
|
32
37
|
align-items: center;
|
|
33
|
-
border-radius: round;
|
|
34
|
-
display: inline-flex;
|
|
35
38
|
flex: 1;
|
|
36
|
-
position: relative;
|
|
37
|
-
transition-duration: fast;
|
|
38
39
|
`
|
|
39
40
|
|
|
40
|
-
export const SwitchButtonBase = styled
|
|
41
|
+
export const SwitchButtonBase = styled(SwitchFoundation)`
|
|
41
42
|
color: white;
|
|
42
43
|
cursor: pointer;
|
|
43
|
-
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
position: relative;
|
|
44
|
+
--x-ring-color: green;
|
|
46
45
|
|
|
47
46
|
&[aria-disabled='true'] {
|
|
48
47
|
cursor: not-allowed;
|
|
49
48
|
|
|
50
49
|
.vui-switchThumb {
|
|
51
|
-
background-color: disabled
|
|
50
|
+
background-color: ${switchColors.disabled};
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
.vui-switchTrack {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
--x-ring-color: ${switchColors.disabled};
|
|
55
|
+
background-color: ${switchColors.disabledBg};
|
|
56
|
+
color: ${switchColors.disabled};
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
`
|
|
@@ -124,10 +123,10 @@ export const SwitchButton = vui<'span', SwitchButtonProps>((props, ref) => {
|
|
|
124
123
|
})
|
|
125
124
|
|
|
126
125
|
const trackAliasedProps = filterUndefined({
|
|
127
|
-
bg: isChecked ? trackStyles.bg :
|
|
126
|
+
bg: isChecked ? trackStyles.bg : switchColors.disabled,
|
|
128
127
|
pl: isChecked ? 1 : labelOffset,
|
|
129
128
|
pr: isChecked ? labelOffset : 1,
|
|
130
|
-
ring: !disabled ? (isFocused ? trackStyles.ring : 0) :
|
|
129
|
+
ring: !disabled ? (isFocused ? trackStyles.ring : 0) : 3
|
|
131
130
|
})
|
|
132
131
|
|
|
133
132
|
return (
|
|
@@ -144,12 +143,13 @@ export const SwitchButton = vui<'span', SwitchButtonProps>((props, ref) => {
|
|
|
144
143
|
onChange={handleOnChange}
|
|
145
144
|
onFocus={handleOnFocus}
|
|
146
145
|
ref={inputRef}
|
|
146
|
+
tabIndex={-1}
|
|
147
147
|
type="checkbox"
|
|
148
148
|
{...{ checked, defaultChecked, disabled, id, name, required, value }}
|
|
149
149
|
{...inputProps}
|
|
150
150
|
/>
|
|
151
151
|
|
|
152
|
-
<SwitchTrack className="vui-switchTrack" {...trackStyles} {...trackAliasedProps}>
|
|
152
|
+
<SwitchTrack className="vui-switchTrack" tabIndex={0} {...trackStyles} {...trackAliasedProps}>
|
|
153
153
|
{!isChecked && innerLabelOff}
|
|
154
154
|
|
|
155
155
|
<SwitchThumb className="vui-switchThumb" {...thumbStyles} {...thumbAliasedProps} />
|
|
@@ -33,7 +33,6 @@ export const Switch = vui<'label', SwitchProps>((props, ref) => {
|
|
|
33
33
|
checked,
|
|
34
34
|
children,
|
|
35
35
|
className,
|
|
36
|
-
colorScheme,
|
|
37
36
|
defaultChecked,
|
|
38
37
|
disabled,
|
|
39
38
|
id,
|
|
@@ -59,7 +58,6 @@ export const Switch = vui<'label', SwitchProps>((props, ref) => {
|
|
|
59
58
|
() =>
|
|
60
59
|
filterUndefined({
|
|
61
60
|
checked,
|
|
62
|
-
colorScheme,
|
|
63
61
|
defaultChecked,
|
|
64
62
|
disabled,
|
|
65
63
|
name,
|
|
@@ -71,7 +69,7 @@ export const Switch = vui<'label', SwitchProps>((props, ref) => {
|
|
|
71
69
|
value,
|
|
72
70
|
variant
|
|
73
71
|
}),
|
|
74
|
-
[checked,
|
|
72
|
+
[checked, defaultChecked, disabled, name, onBlur, onChange, onFocus, required, size, value, variant]
|
|
75
73
|
)
|
|
76
74
|
|
|
77
75
|
const aliasedProps = filterUndefined({
|
package/src/switch/theme.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { switchColors } from './consts'
|
|
2
|
+
|
|
3
|
+
const baseStyle = {
|
|
4
|
+
button: {
|
|
5
|
+
thumb: {
|
|
6
|
+
bg: 'white'
|
|
7
|
+
},
|
|
8
|
+
track: {
|
|
9
|
+
ring: 3
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
|
|
3
14
|
function sizeLg() {
|
|
4
15
|
const button = {
|
|
@@ -60,28 +71,9 @@ function sizeSm() {
|
|
|
60
71
|
return { button, label }
|
|
61
72
|
}
|
|
62
73
|
|
|
63
|
-
function variantContained(props: Dict) {
|
|
64
|
-
const { colorScheme: c } = props
|
|
65
|
-
|
|
66
|
-
const button = {
|
|
67
|
-
thumb: {
|
|
68
|
-
bg: 'white'
|
|
69
|
-
},
|
|
70
|
-
track: {
|
|
71
|
-
bg: `${c}.80`,
|
|
72
|
-
ring: 3
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return { button }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const baseStyle = {}
|
|
80
|
-
|
|
81
74
|
const defaultProps = {
|
|
82
|
-
colorScheme: 'blue',
|
|
83
75
|
size: 'md',
|
|
84
|
-
variant: '
|
|
76
|
+
variant: 'primary'
|
|
85
77
|
}
|
|
86
78
|
|
|
87
79
|
const parts = ['container', 'button', 'label']
|
|
@@ -93,7 +85,27 @@ const sizes = {
|
|
|
93
85
|
}
|
|
94
86
|
|
|
95
87
|
const variants = {
|
|
96
|
-
|
|
88
|
+
primary: {
|
|
89
|
+
button: {
|
|
90
|
+
track: {
|
|
91
|
+
bg: switchColors.main
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
green: {
|
|
96
|
+
button: {
|
|
97
|
+
track: {
|
|
98
|
+
bg: switchColors.green
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
red: {
|
|
103
|
+
button: {
|
|
104
|
+
track: {
|
|
105
|
+
bg: switchColors.red
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
97
109
|
}
|
|
98
110
|
|
|
99
111
|
export default {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
|
|
4
|
+
import { inputColors } from '../input/consts'
|
|
4
5
|
import T from '../t'
|
|
5
6
|
import { ChangeEvent, cs, filterUndefined } from '../utils'
|
|
6
|
-
import { greyColor, greyLightColor, redColor } from './consts'
|
|
7
7
|
import { getInitialCount } from './helpers'
|
|
8
8
|
import { TextareaProps } from './textarea.types'
|
|
9
9
|
|
|
@@ -16,15 +16,9 @@ const TextareaTextarea = styled.textareaBox`
|
|
|
16
16
|
transition-duration: fast;
|
|
17
17
|
width: 100%;
|
|
18
18
|
|
|
19
|
-
&::placeholder {
|
|
20
|
-
color: grey.60;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
19
|
&[aria-disabled='true'],
|
|
24
20
|
&[aria-disabled='true']::placeholder {
|
|
25
|
-
|
|
26
|
-
border-color: disabled.border;
|
|
27
|
-
color: disabled.color;
|
|
21
|
+
opacity: 0.5;
|
|
28
22
|
cursor: not-allowed;
|
|
29
23
|
}
|
|
30
24
|
`
|
|
@@ -49,7 +43,6 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
|
|
|
49
43
|
defaultValue,
|
|
50
44
|
disabled,
|
|
51
45
|
id,
|
|
52
|
-
isInvalid,
|
|
53
46
|
maxLength,
|
|
54
47
|
name,
|
|
55
48
|
onBlur,
|
|
@@ -70,10 +63,7 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
|
|
|
70
63
|
const [count, setCount] = useState(getInitialCount(props))
|
|
71
64
|
const [valueInternal, setValueInternal] = useState(defaultValue)
|
|
72
65
|
|
|
73
|
-
const
|
|
74
|
-
colorScheme: colorSchemeProp ?? (isInvalid ? 'red' : undefined)
|
|
75
|
-
})
|
|
76
|
-
const styles = useStyleConfig('Textarea', { ...colorProps, ...props })
|
|
66
|
+
const styles = useStyleConfig('Textarea', props)
|
|
77
67
|
|
|
78
68
|
function onChange(e: ChangeEvent<HTMLTextAreaElement>) {
|
|
79
69
|
setValueInternal(e.target.value)
|
|
@@ -87,9 +77,9 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
|
|
|
87
77
|
|
|
88
78
|
const textareaAliasedProps = filterUndefined({
|
|
89
79
|
'aria-disabled': disabled,
|
|
90
|
-
bg: readOnly ?
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
bg: readOnly ? inputColors.disabled : undefined,
|
|
81
|
+
focusWithinBorderColor: !readOnly ? 'transparent' : undefined,
|
|
82
|
+
focusWithinRingColor: readOnly ? 'transparent' : undefined
|
|
93
83
|
})
|
|
94
84
|
|
|
95
85
|
useEffect(() => {
|
|
@@ -128,7 +118,7 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
|
|
|
128
118
|
{showCount && (
|
|
129
119
|
<T
|
|
130
120
|
className="vui-textareaCount"
|
|
131
|
-
color={maxLength && count > maxLength ?
|
|
121
|
+
color={maxLength && count > maxLength ? inputColors.error : inputColors.helpText}
|
|
132
122
|
position="absolute"
|
|
133
123
|
right={0}
|
|
134
124
|
size="sm"
|
|
@@ -8,7 +8,7 @@ export type TextareaProps = SystemProps &
|
|
|
8
8
|
autoFocus?: boolean
|
|
9
9
|
/** Children are disabled for this component. */
|
|
10
10
|
children?: never
|
|
11
|
-
/**
|
|
11
|
+
/** Deprecated. Please use variant instead. @deprecated */
|
|
12
12
|
colorScheme?: 'green' | 'grey' | 'red'
|
|
13
13
|
/** Passed to the inner input. */
|
|
14
14
|
cols?: number
|
|
@@ -16,7 +16,7 @@ export type TextareaProps = SystemProps &
|
|
|
16
16
|
defaultValue?: number | string
|
|
17
17
|
/** Passed to the inner input. */
|
|
18
18
|
disabled?: boolean
|
|
19
|
-
/**
|
|
19
|
+
/** Deprecated. Please use variant="red" instead. @deprecated*/
|
|
20
20
|
isInvalid?: boolean
|
|
21
21
|
/** Passed to the inner input. */
|
|
22
22
|
maxLength?: number
|
package/src/textarea/theme.ts
CHANGED
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
focusRing: 2,
|
|
11
|
-
focusRingColor: `${c}.80`
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (c === 'grey') {
|
|
15
|
-
textarea.borderColor = `${c}.60`
|
|
16
|
-
textarea.focusRingColor = 'blue.50'
|
|
1
|
+
import { inputColors } from '../input/consts'
|
|
2
|
+
|
|
3
|
+
const baseStyle = {
|
|
4
|
+
textarea: {
|
|
5
|
+
focusWithinRing: 2,
|
|
6
|
+
color: inputColors.inputText
|
|
7
|
+
},
|
|
8
|
+
input: {
|
|
9
|
+
color: { placeholder: inputColors.placeholder }
|
|
17
10
|
}
|
|
18
|
-
|
|
19
|
-
return { container, textarea }
|
|
20
11
|
}
|
|
21
12
|
|
|
22
|
-
const baseStyle = {}
|
|
23
|
-
|
|
24
13
|
const defaultProps = {
|
|
25
|
-
|
|
26
|
-
variant: 'default'
|
|
14
|
+
variant: 'grey'
|
|
27
15
|
}
|
|
28
16
|
|
|
29
17
|
const parts = ['container', 'textarea']
|
|
@@ -31,7 +19,24 @@ const parts = ['container', 'textarea']
|
|
|
31
19
|
const sizes = {}
|
|
32
20
|
|
|
33
21
|
const variants = {
|
|
34
|
-
|
|
22
|
+
grey: {
|
|
23
|
+
textarea: {
|
|
24
|
+
borderColor: inputColors.border,
|
|
25
|
+
focusWithinRingColor: inputColors.focus
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
green: {
|
|
29
|
+
textarea: {
|
|
30
|
+
borderColor: inputColors.success,
|
|
31
|
+
focusWithinRingColor: inputColors.success
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
red: {
|
|
35
|
+
textarea: {
|
|
36
|
+
borderColor: inputColors.error,
|
|
37
|
+
focusWithinRingColor: inputColors.error
|
|
38
|
+
}
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
export default {
|