@veracity/vui 2.4.1 → 2.5.0-beta.1
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/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- 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/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 +84 -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 +35 -0
- package/dist/cjs/progressCircular/theme.d.ts.map +1 -0
- package/dist/cjs/progressCircular/theme.js +24 -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/theme/components.d.ts +47 -22
- 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 +47 -22
- package/dist/cjs/theme/defaultTheme.d.ts.map +1 -1
- 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/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- 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/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 +47 -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 +35 -0
- package/dist/esm/progressCircular/theme.d.ts.map +1 -0
- package/dist/esm/progressCircular/theme.js +22 -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/theme/components.d.ts +47 -22
- 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 +47 -22
- package/dist/esm/theme/defaultTheme.d.ts.map +1 -1
- 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/index.ts +1 -0
- package/src/progress/progress.tsx +11 -7
- package/src/progress/progress.types.ts +0 -1
- package/src/progressCircular/consts.ts +13 -0
- package/src/progressCircular/index.ts +3 -0
- package/src/progressCircular/progressCircular.tsx +82 -0
- package/src/progressCircular/progressCircular.types.ts +9 -0
- package/src/progressCircular/theme.ts +26 -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/theme/components.ts +2 -0
|
@@ -1098,11 +1098,14 @@ declare const defaultTheme: {
|
|
|
1098
1098
|
variants: {};
|
|
1099
1099
|
};
|
|
1100
1100
|
Checkbox: {
|
|
1101
|
-
baseStyle: {
|
|
1101
|
+
baseStyle: {
|
|
1102
|
+
control: {
|
|
1103
|
+
color: string;
|
|
1104
|
+
hoverColor: string;
|
|
1105
|
+
};
|
|
1106
|
+
};
|
|
1102
1107
|
defaultProps: {
|
|
1103
|
-
colorScheme: string;
|
|
1104
1108
|
size: string;
|
|
1105
|
-
variant: string;
|
|
1106
1109
|
};
|
|
1107
1110
|
parts: string[];
|
|
1108
1111
|
sizes: {
|
|
@@ -1134,14 +1137,7 @@ declare const defaultTheme: {
|
|
|
1134
1137
|
};
|
|
1135
1138
|
};
|
|
1136
1139
|
};
|
|
1137
|
-
variants: {
|
|
1138
|
-
default: (props: import("..").Dict<any>) => {
|
|
1139
|
-
control: {
|
|
1140
|
-
color: string;
|
|
1141
|
-
hoverColor: string;
|
|
1142
|
-
};
|
|
1143
|
-
};
|
|
1144
|
-
};
|
|
1140
|
+
variants: {};
|
|
1145
1141
|
};
|
|
1146
1142
|
Dialog: {
|
|
1147
1143
|
baseStyle: {};
|
|
@@ -1883,6 +1879,39 @@ declare const defaultTheme: {
|
|
|
1883
1879
|
};
|
|
1884
1880
|
variants: {};
|
|
1885
1881
|
};
|
|
1882
|
+
ProgressCircular: {
|
|
1883
|
+
baseStyle: {};
|
|
1884
|
+
defaultProps: {
|
|
1885
|
+
size: string;
|
|
1886
|
+
};
|
|
1887
|
+
sizes: {
|
|
1888
|
+
sm: {
|
|
1889
|
+
strokeWidth: number;
|
|
1890
|
+
width: number;
|
|
1891
|
+
top: number;
|
|
1892
|
+
fontSize: number;
|
|
1893
|
+
};
|
|
1894
|
+
md: {
|
|
1895
|
+
strokeWidth: number;
|
|
1896
|
+
width: number;
|
|
1897
|
+
top: number;
|
|
1898
|
+
fontSize: number;
|
|
1899
|
+
};
|
|
1900
|
+
lg: {
|
|
1901
|
+
strokeWidth: number;
|
|
1902
|
+
width: number;
|
|
1903
|
+
top: number;
|
|
1904
|
+
fontSize: number;
|
|
1905
|
+
};
|
|
1906
|
+
xl: {
|
|
1907
|
+
strokeWidth: number;
|
|
1908
|
+
width: number;
|
|
1909
|
+
top: number;
|
|
1910
|
+
fontSize: number;
|
|
1911
|
+
};
|
|
1912
|
+
};
|
|
1913
|
+
variants: {};
|
|
1914
|
+
};
|
|
1886
1915
|
Popover: {
|
|
1887
1916
|
baseStyle: {};
|
|
1888
1917
|
defaultProps: {};
|
|
@@ -1891,11 +1920,14 @@ declare const defaultTheme: {
|
|
|
1891
1920
|
variants: {};
|
|
1892
1921
|
};
|
|
1893
1922
|
Radio: {
|
|
1894
|
-
baseStyle: {
|
|
1923
|
+
baseStyle: {
|
|
1924
|
+
control: {
|
|
1925
|
+
color: string;
|
|
1926
|
+
hoverColor: string;
|
|
1927
|
+
};
|
|
1928
|
+
};
|
|
1895
1929
|
defaultProps: {
|
|
1896
|
-
colorScheme: string;
|
|
1897
1930
|
size: string;
|
|
1898
|
-
variant: string;
|
|
1899
1931
|
};
|
|
1900
1932
|
parts: string[];
|
|
1901
1933
|
sizes: {
|
|
@@ -1927,14 +1959,7 @@ declare const defaultTheme: {
|
|
|
1927
1959
|
};
|
|
1928
1960
|
};
|
|
1929
1961
|
};
|
|
1930
|
-
variants: {
|
|
1931
|
-
default: (props: import("..").Dict<any>) => {
|
|
1932
|
-
control: {
|
|
1933
|
-
color: string;
|
|
1934
|
-
hoverColor: string;
|
|
1935
|
-
};
|
|
1936
|
-
};
|
|
1937
|
-
};
|
|
1962
|
+
variants: {};
|
|
1938
1963
|
};
|
|
1939
1964
|
Select: {
|
|
1940
1965
|
baseStyle: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGjB,CAAA;AAED,eAAe,YAAY,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-beta.1",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -5,6 +5,7 @@ import Icon from '../icon'
|
|
|
5
5
|
import T from '../t'
|
|
6
6
|
import { ChangeEvent, cs, filterUndefined } from '../utils'
|
|
7
7
|
import { CheckboxProps, CheckboxStyleProps } from './checkbox.types'
|
|
8
|
+
import { checkboxColors } from './consts'
|
|
8
9
|
import { useCheckboxGroupContext } from './context'
|
|
9
10
|
|
|
10
11
|
const CheckboxControl = styled.spanBox`
|
|
@@ -39,11 +40,11 @@ export const CheckboxBase = styled.labelBox<CheckboxStyleProps>`
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
&[aria-disabled='true'] {
|
|
42
|
-
color: disabled
|
|
43
|
+
color: ${checkboxColors.disabled};
|
|
43
44
|
cursor: not-allowed;
|
|
44
45
|
|
|
45
46
|
.vui-checkboxControl {
|
|
46
|
-
color: disabled
|
|
47
|
+
color: ${checkboxColors.disabled};
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
`
|
|
@@ -80,11 +81,10 @@ export const Checkbox = vui<'span', CheckboxProps>((props, ref) => {
|
|
|
80
81
|
const styles = useStyleConfig('Checkbox', mergedProps)
|
|
81
82
|
const { color: controlColor, hoverColor, ...controlStyles } = styles.control
|
|
82
83
|
|
|
83
|
-
const isFilled = isChecked || isIndeterminate
|
|
84
84
|
const icon = isIndeterminate ? iconIndeterminate : isChecked ? iconChecked : iconProp
|
|
85
85
|
const controlMr = children || label ? 1 : 0
|
|
86
|
-
const color =
|
|
87
|
-
const controlHoverColor =
|
|
86
|
+
const color = controlColor ? controlColor : checkboxColors.main
|
|
87
|
+
const controlHoverColor = hoverColor ? hoverColor : checkboxColors.hover
|
|
88
88
|
|
|
89
89
|
useEffect(() => {
|
|
90
90
|
checked !== undefined && setIsChecked(checked)
|
|
@@ -9,7 +9,7 @@ export type CheckboxProps = SystemProps &
|
|
|
9
9
|
ThemingProps<'Checkbox'> & {
|
|
10
10
|
/** Provides value to checkbox in controlled mode. */
|
|
11
11
|
checked?: boolean
|
|
12
|
-
/** Available theme colors for this component.
|
|
12
|
+
/** @deprecated Available theme colors for this component. */
|
|
13
13
|
colorScheme?: 'blue' | 'prussian'
|
|
14
14
|
/** Disables checkbox and related elements with the right styling. */
|
|
15
15
|
disabled?: boolean
|
|
@@ -15,24 +15,11 @@ export const CheckboxGroupBase = styled.divBox`
|
|
|
15
15
|
* Exposes some props to the children via context.
|
|
16
16
|
*/
|
|
17
17
|
export const CheckboxGroup = vui<'div', CheckboxGroupProps>((props, ref) => {
|
|
18
|
-
const {
|
|
19
|
-
className,
|
|
20
|
-
colorScheme,
|
|
21
|
-
defaultValue,
|
|
22
|
-
disabled,
|
|
23
|
-
isRow,
|
|
24
|
-
name,
|
|
25
|
-
onBlur,
|
|
26
|
-
onChange,
|
|
27
|
-
onFocus,
|
|
28
|
-
size,
|
|
29
|
-
variant,
|
|
30
|
-
...rest
|
|
31
|
-
} = props
|
|
18
|
+
const { className, defaultValue, disabled, isRow, name, onBlur, onChange, onFocus, size, variant, ...rest } = props
|
|
32
19
|
|
|
33
20
|
const context = useMemo(
|
|
34
|
-
() => filterUndefined({
|
|
35
|
-
[
|
|
21
|
+
() => filterUndefined({ defaultValue, disabled, name, onBlur, onChange, onFocus, size, variant }),
|
|
22
|
+
[defaultValue, disabled, name, onBlur, onChange, onFocus, size, variant]
|
|
36
23
|
)
|
|
37
24
|
|
|
38
25
|
const aliasedProps = filterUndefined({
|
|
@@ -4,7 +4,7 @@ import { ChangeEventHandler, FocusEventHandler } from '../utils'
|
|
|
4
4
|
|
|
5
5
|
export type CheckboxGroupProps = SystemProps &
|
|
6
6
|
ThemingProps<'Checkbox'> & {
|
|
7
|
-
/** Available theme colors for this component. */
|
|
7
|
+
/** @deprecated Available theme colors for this component. */
|
|
8
8
|
colorScheme?: 'blue' | 'prussian'
|
|
9
9
|
/** Passes the prop to each checkbox. */
|
|
10
10
|
disabled?: boolean
|
package/src/checkbox/theme.ts
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { checkboxColors } 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: checkboxColors.main,
|
|
6
|
+
hoverColor: checkboxColors.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,
|
package/src/index.ts
CHANGED
|
@@ -11,19 +11,23 @@ export const ProgressBase = styled.divBox`
|
|
|
11
11
|
`
|
|
12
12
|
|
|
13
13
|
const minPercentageDisplay = 3
|
|
14
|
+
const maxValue = 100
|
|
14
15
|
|
|
15
|
-
/** Indicates a process progress. */
|
|
16
|
+
/** [Beta] Indicates a process progress. */
|
|
16
17
|
export const Progress = vui<'div', ProgressProps>((props, ref) => {
|
|
17
|
-
const { className,
|
|
18
|
+
const { className, value = 0, showPercentage, ...rest } = props
|
|
18
19
|
|
|
19
20
|
const [width, setWidth] = useState(0)
|
|
20
21
|
|
|
21
22
|
const styles = useStyleConfig('Progress', props)
|
|
22
23
|
|
|
23
24
|
useEffect(() => {
|
|
24
|
-
const w = !value ? 0 : Math.ceil(
|
|
25
|
-
setWidth(w >
|
|
26
|
-
}, [value
|
|
25
|
+
const w = !value ? 0 : Math.ceil(value)
|
|
26
|
+
setWidth(w > maxValue ? maxValue : w)
|
|
27
|
+
}, [value])
|
|
28
|
+
|
|
29
|
+
const bg = rest.bg || 'darkBlue.95'
|
|
30
|
+
const color = rest.color || 'darkBlue.main'
|
|
27
31
|
|
|
28
32
|
return (
|
|
29
33
|
<ProgressBase
|
|
@@ -31,12 +35,12 @@ export const Progress = vui<'div', ProgressProps>((props, ref) => {
|
|
|
31
35
|
ref={ref}
|
|
32
36
|
{...styles.container}
|
|
33
37
|
{...rest}
|
|
34
|
-
bg=
|
|
38
|
+
bg={bg}
|
|
35
39
|
borderRadius="sm"
|
|
36
40
|
h={1}
|
|
37
41
|
>
|
|
38
42
|
<Box
|
|
39
|
-
bg=
|
|
43
|
+
bg={color}
|
|
40
44
|
borderRadius="sm"
|
|
41
45
|
position="relative"
|
|
42
46
|
textAlign="right"
|
|
@@ -0,0 +1,82 @@
|
|
|
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 Circle = styled.circle`
|
|
16
|
+
fill: transparent;
|
|
17
|
+
stroke: hsl(223, 67%, 95%);
|
|
18
|
+
`
|
|
19
|
+
|
|
20
|
+
const ProgressCircle = styled(Circle)`
|
|
21
|
+
stroke: hsl(223, 67%, 18%);
|
|
22
|
+
transform: rotate(-90deg);
|
|
23
|
+
transform-origin: 50% 50%;
|
|
24
|
+
transition: stroke-dashoffset 0.5s ease-out;
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
/** [Beta] Indicates a process progress. */
|
|
28
|
+
export const ProgressCircular = vui<'div', ProgressCircularProps>((props, ref) => {
|
|
29
|
+
const { children, className, label, value = 0, showPercentage, ...rest } = props
|
|
30
|
+
|
|
31
|
+
const styles = useStyleConfig('ProgressCircular', props)
|
|
32
|
+
|
|
33
|
+
const [progress, setProgress] = useState(value)
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setProgress(value ? Math.ceil(value) : 0)
|
|
37
|
+
}, [value])
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const w = !value ? 0 : Math.ceil(value)
|
|
41
|
+
setProgress(w > maxValue ? maxValue : w)
|
|
42
|
+
}, [value])
|
|
43
|
+
|
|
44
|
+
const radius = maxValue / 2 - styles.strokeWidth * 2
|
|
45
|
+
const angle = radius * 2 * Math.PI
|
|
46
|
+
const offset = angle - (progress / maxValue) * angle
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<ProgressCircularBase className={cs('vui-progress-circular', className)} ref={ref} w={styles.width} {...rest}>
|
|
50
|
+
<svg
|
|
51
|
+
aria-valuemax={maxValue}
|
|
52
|
+
aria-valuemin={0}
|
|
53
|
+
aria-valuenow={progress}
|
|
54
|
+
height={styles.width}
|
|
55
|
+
version="1.1"
|
|
56
|
+
viewBox="0 0 100 100"
|
|
57
|
+
width={styles.width}
|
|
58
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
+
>
|
|
60
|
+
<Circle cx="50" cy="50" r={radius} strokeWidth={styles.strokeWidth} />
|
|
61
|
+
<ProgressCircle
|
|
62
|
+
cx="50"
|
|
63
|
+
cy="50"
|
|
64
|
+
r={radius}
|
|
65
|
+
strokeDasharray={`${angle} ${angle}`}
|
|
66
|
+
strokeDashoffset={offset}
|
|
67
|
+
strokeWidth={styles.strokeWidth}
|
|
68
|
+
/>
|
|
69
|
+
</svg>
|
|
70
|
+
<Box {...(absCenterStyles as BoxProps)} top={styles.top}>
|
|
71
|
+
{children ? children : showPercentage ? <T fontSize={styles.fontSize}>{progress}%</T> : null}
|
|
72
|
+
</Box>
|
|
73
|
+
{!!label && (
|
|
74
|
+
<Box {...(absCenterStyles as BoxProps)} bottom={labelBottom}>
|
|
75
|
+
<T fontSize={styles.fontSize}>{label}</T>
|
|
76
|
+
</Box>
|
|
77
|
+
)}
|
|
78
|
+
</ProgressCircularBase>
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
export default ProgressCircular
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const baseStyle = {}
|
|
2
|
+
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
size: 'md'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const sizes = {
|
|
8
|
+
sm: {
|
|
9
|
+
strokeWidth: 4,
|
|
10
|
+
width: 46,
|
|
11
|
+
top: 15,
|
|
12
|
+
fontSize: 12
|
|
13
|
+
},
|
|
14
|
+
md: { strokeWidth: 5, width: 80, top: 30, fontSize: 16 },
|
|
15
|
+
lg: { strokeWidth: 6, width: 120, top: 48, fontSize: 18 },
|
|
16
|
+
xl: { strokeWidth: 7, width: 160, top: 64, fontSize: 22 }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const variants = {}
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
baseStyle,
|
|
23
|
+
defaultProps,
|
|
24
|
+
sizes,
|
|
25
|
+
variants
|
|
26
|
+
}
|
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
|
-
/** Available theme colors for this component.
|
|
12
|
+
/** @deprecated Available theme colors for this component. */
|
|
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
|
-
/** Available theme colors for this component. */
|
|
7
|
+
/** @deprecated Available theme colors for this component. */
|
|
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,
|
package/src/theme/components.ts
CHANGED
|
@@ -28,6 +28,7 @@ import Pagination from '../pagination/theme'
|
|
|
28
28
|
import Panel from '../panel/theme'
|
|
29
29
|
import Popover from '../popover/theme'
|
|
30
30
|
import Progress from '../progress/theme'
|
|
31
|
+
import ProgressCircular from '../progressCircular/theme'
|
|
31
32
|
import Radio from '../radio/theme'
|
|
32
33
|
import Select from '../select/theme'
|
|
33
34
|
import Sidemenu from '../sidemenu/theme'
|
|
@@ -78,6 +79,7 @@ export default {
|
|
|
78
79
|
Pagination,
|
|
79
80
|
Panel,
|
|
80
81
|
Progress,
|
|
82
|
+
ProgressCircular,
|
|
81
83
|
Popover,
|
|
82
84
|
Radio,
|
|
83
85
|
Select,
|