@vygruppen/spor-react 8.2.1 → 9.0.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/.turbo/turbo-build.log +10 -12
- package/CHANGELOG.md +34 -0
- package/dist/{CountryCodeSelect-NEASN3EC.mjs → CountryCodeSelect-LFDBAHV7.mjs} +1 -1
- package/dist/{chunk-AKOJGLTQ.mjs → chunk-BWLVKMWU.mjs} +1262 -1785
- package/dist/index.d.mts +1664 -813
- package/dist/index.d.ts +1664 -813
- package/dist/index.js +1551 -2011
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/accordion/Expandable.tsx +22 -2
- package/src/breadcrumb/Breadcrumb.tsx +4 -2
- package/src/datepicker/DateRangePicker.tsx +1 -0
- package/src/input/ChoiceChip.tsx +3 -3
- package/src/input/NumericStepper.tsx +7 -49
- package/src/input/PasswordInput.tsx +2 -0
- package/src/input/PhoneNumberInput.tsx +1 -1
- package/src/input/Switch.tsx +4 -7
- package/src/loader/ProgressBar.tsx +7 -24
- package/src/tab/Tabs.tsx +4 -5
- package/src/theme/components/accordion.ts +12 -16
- package/src/theme/components/alert-expandable.ts +10 -21
- package/src/theme/components/breadcrumb.ts +60 -5
- package/src/theme/components/button.ts +40 -75
- package/src/theme/components/card-select.ts +14 -56
- package/src/theme/components/card.ts +56 -63
- package/src/theme/components/checkbox.ts +20 -20
- package/src/theme/components/choice-chip.ts +28 -43
- package/src/theme/components/close-button.ts +1 -1
- package/src/theme/components/datepicker.ts +48 -166
- package/src/theme/components/drawer.ts +6 -4
- package/src/theme/components/fab.ts +35 -62
- package/src/theme/components/index.ts +3 -1
- package/src/theme/components/info-select.ts +5 -9
- package/src/theme/components/input.ts +17 -32
- package/src/theme/components/link.ts +8 -8
- package/src/theme/components/listbox.ts +5 -7
- package/src/theme/components/media-controller-button.ts +20 -25
- package/src/theme/components/modal.ts +8 -6
- package/src/theme/components/numeric-stepper.ts +65 -0
- package/src/theme/components/popover.ts +7 -8
- package/src/theme/components/progress-bar.ts +43 -0
- package/src/theme/components/progress-indicator.ts +5 -2
- package/src/theme/components/radio.ts +15 -12
- package/src/theme/components/select.ts +2 -2
- package/src/theme/components/stepper.ts +10 -7
- package/src/theme/components/switch.ts +35 -82
- package/src/theme/components/table.ts +10 -12
- package/src/theme/components/tabs.ts +55 -261
- package/src/theme/components/travel-tag.ts +3 -6
- package/src/theme/foundations/colors.ts +3 -1
- package/src/theme/foundations/fonts.ts +2 -2
- package/src/theme/index.ts +9 -6
- package/src/theme/utils/accent-utils.ts +54 -0
- package/src/theme/utils/base-utils.ts +94 -0
- package/src/theme/utils/bg-utils.ts +19 -0
- package/src/theme/utils/brand-utils.ts +42 -0
- package/src/theme/utils/floating-utils.ts +64 -0
- package/src/theme/utils/{focus-util.ts → focus-utils.ts} +1 -1
- package/src/theme/utils/ghost-utils.ts +40 -0
- package/src/theme/utils/surface-utils.ts +35 -0
- package/src/tooltip/Tooltip.tsx +17 -20
- package/src/typography/Heading.tsx +7 -2
- package/src/util/externals.tsx +0 -1
- package/src/theme/utils/background-utils.ts +0 -179
- package/src/theme/utils/border-utils.ts +0 -176
- package/src/theme/utils/box-shadow-utils.ts +0 -44
- package/src/theme/utils/text-utils.ts +0 -60
@@ -1,8 +1,11 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { focusVisibleStyles } from "../utils/focus-
|
2
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
3
|
+
import { brandBackground, brandText } from "../utils/brand-utils";
|
4
|
+
import { floatingBackground, floatingBorder } from "../utils/floating-utils";
|
5
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
|
+
import { ghostBackground } from "../utils/ghost-utils";
|
7
|
+
import { surface } from "../utils/surface-utils";
|
8
|
+
import { accentBackground, accentText } from "../utils/accent-utils";
|
6
9
|
|
7
10
|
const config = defineStyleConfig({
|
8
11
|
baseStyle: (props) => ({
|
@@ -16,111 +19,73 @@ const config = defineStyleConfig({
|
|
16
19
|
textWrap: "wrap",
|
17
20
|
paddingX: 3,
|
18
21
|
paddingY: 1,
|
19
|
-
_focus: {
|
20
|
-
boxShadow: 0,
|
21
|
-
outline: 0,
|
22
|
-
},
|
23
22
|
...focusVisibleStyles(props),
|
24
23
|
_disabled: {
|
25
24
|
cursor: "not-allowed",
|
25
|
+
pointerEvents: "none",
|
26
26
|
boxShadow: "none",
|
27
|
-
|
28
|
-
|
29
|
-
},
|
30
|
-
_hover: {
|
31
|
-
_disabled: {
|
32
|
-
background: mode("blackAlpha.100", "whiteAlpha.100")(props),
|
33
|
-
},
|
27
|
+
...surface("disabled", props),
|
28
|
+
...baseText("disabled", props),
|
34
29
|
},
|
35
30
|
}),
|
36
31
|
variants: {
|
37
32
|
primary: (props) => ({
|
38
|
-
|
39
|
-
|
40
|
-
backgroundColor: mode("pine", "coralGreen")(props),
|
41
|
-
color: mode("white", "darkTeal")(props),
|
33
|
+
...brandBackground("default", props),
|
34
|
+
...brandText("default", props),
|
42
35
|
_hover: {
|
43
|
-
|
36
|
+
...brandBackground("hover", props),
|
44
37
|
},
|
45
38
|
_active: {
|
46
|
-
|
39
|
+
...brandBackground("active", props),
|
47
40
|
},
|
48
41
|
}),
|
49
42
|
secondary: (props) => ({
|
50
|
-
|
51
|
-
|
52
|
-
color: mode("darkTeal", "seaMist")(props),
|
53
|
-
// order is important here for now while we do not have global defined background color for darkMode
|
43
|
+
...accentBackground("default", props),
|
44
|
+
...accentText("default", props),
|
54
45
|
_hover: {
|
55
|
-
|
46
|
+
...accentBackground("hover", props),
|
56
47
|
},
|
57
48
|
_active: {
|
58
|
-
|
59
|
-
boxShadow: `inset 0 0 0 2px ${mode(
|
60
|
-
colors.greenHaze,
|
61
|
-
colors.azure,
|
62
|
-
)(props)}, inset 0 0 0 4px ${mode(
|
63
|
-
colors.white,
|
64
|
-
colors.blackAlpha[600],
|
65
|
-
)(props)}`,
|
66
|
-
_hover: {
|
67
|
-
boxShadow: `inset 0 0 0 2px ${mode(
|
68
|
-
colors.greenHaze,
|
69
|
-
colors.azure,
|
70
|
-
)(props)}, inset 0 0 0 4px ${mode(
|
71
|
-
colors.white,
|
72
|
-
colors.blackAlpha[600],
|
73
|
-
)(props)}`,
|
74
|
-
},
|
49
|
+
...accentBackground("active", props),
|
75
50
|
},
|
76
51
|
}),
|
77
52
|
tertiary: (props) => ({
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
colors.blackAlpha[400],
|
82
|
-
colors.whiteAlpha[400],
|
83
|
-
)(props)}`,
|
53
|
+
...baseBackground("default", props),
|
54
|
+
...baseText("default", props),
|
55
|
+
...baseBorder("default", props),
|
84
56
|
_hover: {
|
85
|
-
|
57
|
+
...baseBorder("hover", props),
|
86
58
|
},
|
87
59
|
_active: {
|
88
|
-
|
89
|
-
|
90
|
-
colors.whiteAlpha[300],
|
91
|
-
)(props)}`,
|
92
|
-
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
60
|
+
...baseBorder("default", props), // We want a
|
61
|
+
...baseBackground("active", props),
|
93
62
|
},
|
94
63
|
}),
|
95
64
|
ghost: (props) => ({
|
96
|
-
|
97
|
-
|
65
|
+
...ghostBackground("default", props),
|
66
|
+
...baseText("default", props),
|
98
67
|
_hover: {
|
99
|
-
|
68
|
+
...ghostBackground("hover", props),
|
100
69
|
_disabled: {
|
101
|
-
|
70
|
+
...baseText("disabled", props),
|
102
71
|
},
|
103
72
|
},
|
104
73
|
_active: {
|
105
|
-
|
74
|
+
...ghostBackground("active", props),
|
106
75
|
},
|
107
76
|
}),
|
108
77
|
floating: (props) => ({
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
baseShadow: "sm",
|
113
|
-
}),
|
114
|
-
_active: {
|
115
|
-
backgroundColor: mode("mint", "whiteAlpha.400")(props),
|
116
|
-
},
|
78
|
+
...floatingBackground("default", props),
|
79
|
+
...floatingBorder("default", props),
|
80
|
+
boxShadow: "sm",
|
117
81
|
_hover: {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
82
|
+
...floatingBackground("hover", props),
|
83
|
+
...floatingBorder("hover", props),
|
84
|
+
boxShadow: "md",
|
85
|
+
},
|
86
|
+
_active: {
|
87
|
+
...floatingBackground("active", props),
|
88
|
+
boxShadow: "sm",
|
124
89
|
},
|
125
90
|
}),
|
126
91
|
},
|
@@ -146,8 +111,8 @@ const config = defineStyleConfig({
|
|
146
111
|
xs: {
|
147
112
|
minHeight: 5,
|
148
113
|
minWidth: 5,
|
114
|
+
paddingY: 0.5,
|
149
115
|
fontSize: "16px",
|
150
|
-
|
151
116
|
fontWeight: "normal",
|
152
117
|
},
|
153
118
|
},
|
@@ -1,13 +1,9 @@
|
|
1
1
|
import { anatomy } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
|
6
|
-
|
7
|
-
ghostBackground,
|
8
|
-
} from "../utils/background-utils";
|
9
|
-
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
10
|
-
import { focusVisibleStyles } from "../utils/focus-util";
|
3
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
|
+
import { floatingBackground, floatingBorder } from "../utils/floating-utils";
|
5
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
|
+
import { ghostBackground } from "../utils/ghost-utils";
|
11
7
|
|
12
8
|
const parts = anatomy("card-select").parts("trigger", "card");
|
13
9
|
|
@@ -18,48 +14,31 @@ const config = helpers.defineMultiStyleConfig({
|
|
18
14
|
appearance: "none",
|
19
15
|
display: "flex",
|
20
16
|
alignItems: "center",
|
17
|
+
transitionProperty: "outline",
|
18
|
+
transitionDuration: "fast",
|
21
19
|
...focusVisibleStyles(props),
|
22
20
|
},
|
23
21
|
card: {
|
24
22
|
borderRadius: "sm",
|
25
23
|
boxShadow: "md",
|
26
24
|
padding: 3,
|
27
|
-
|
25
|
+
...baseText("default", props),
|
28
26
|
...floatingBackground("default", props),
|
29
27
|
},
|
30
28
|
}),
|
31
29
|
variants: {
|
32
30
|
base: (props) => ({
|
33
31
|
trigger: {
|
34
|
-
|
35
|
-
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
36
|
-
}),
|
32
|
+
...baseBorder("default", props),
|
37
33
|
_hover: {
|
38
|
-
|
39
|
-
borderColor: mode("darkGrey", "white")(props),
|
40
|
-
borderWidth: 2,
|
41
|
-
}),
|
34
|
+
...baseBorder("hover", props),
|
42
35
|
},
|
43
36
|
_active: {
|
44
37
|
...baseBackground("active", props),
|
45
|
-
|
46
|
-
borderColor: mode("darkGrey", "whiteAlpha.400")(props),
|
47
|
-
borderWidth: 1,
|
48
|
-
}),
|
38
|
+
...baseBorder("default", props),
|
49
39
|
},
|
50
40
|
_expanded: {
|
51
41
|
...baseBackground("active", props),
|
52
|
-
_hover: {
|
53
|
-
...baseBackground("active", props),
|
54
|
-
boxShadow: "none",
|
55
|
-
},
|
56
|
-
_active: {
|
57
|
-
...baseBackground("active", props),
|
58
|
-
boxShadow: getBoxShadowString({
|
59
|
-
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
60
|
-
borderWidth: 1,
|
61
|
-
}),
|
62
|
-
},
|
63
42
|
},
|
64
43
|
},
|
65
44
|
}),
|
@@ -78,41 +57,20 @@ const config = helpers.defineMultiStyleConfig({
|
|
78
57
|
}),
|
79
58
|
floating: (props) => ({
|
80
59
|
trigger: {
|
60
|
+
boxShadow: "sm",
|
81
61
|
...floatingBackground("default", props),
|
82
|
-
|
83
|
-
borderColor: mode("silver", "whiteAlpha.400")(props),
|
84
|
-
borderWidth: 1,
|
85
|
-
baseShadow: "sm",
|
86
|
-
}),
|
62
|
+
...floatingBorder("default", props),
|
87
63
|
transition: "all .1s ease-out",
|
88
64
|
_hover: {
|
89
65
|
...floatingBackground("hover", props),
|
90
|
-
|
91
|
-
borderColor: mode("silver", "whiteAlpha.400")(props),
|
92
|
-
borderWidth: 2,
|
93
|
-
baseShadow: "sm",
|
94
|
-
}),
|
66
|
+
...floatingBorder("hover", props),
|
95
67
|
},
|
96
68
|
_active: {
|
97
69
|
...floatingBackground("active", props),
|
98
|
-
|
99
|
-
borderColor: mode("silver", "whiteAlpha.400")(props),
|
100
|
-
borderWidth: mode(0, 1)(props),
|
101
|
-
baseShadow: "sm",
|
102
|
-
}),
|
70
|
+
...floatingBorder("active", props),
|
103
71
|
},
|
104
72
|
_expanded: {
|
105
73
|
...floatingBackground("active", props),
|
106
|
-
_hover: {
|
107
|
-
boxShadow: getBoxShadowString({
|
108
|
-
borderColor: "darkGrey",
|
109
|
-
borderWidth: 3,
|
110
|
-
}),
|
111
|
-
},
|
112
|
-
_active: {
|
113
|
-
...floatingBackground("active", props),
|
114
|
-
boxShadow: "none",
|
115
|
-
},
|
116
74
|
},
|
117
75
|
},
|
118
76
|
}),
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { mode } from "@chakra-ui/theme-tools";
|
3
3
|
import { colors } from "../foundations";
|
4
|
-
import {
|
5
|
-
import { focusVisibleStyles } from "../utils/focus-
|
4
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
5
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
6
|
|
7
7
|
const config = defineStyleConfig({
|
8
8
|
baseStyle: (props: any) => ({
|
@@ -14,24 +14,52 @@ const config = defineStyleConfig({
|
|
14
14
|
transitionProperty: "common",
|
15
15
|
transitionDuration: "fast",
|
16
16
|
borderRadius: "md",
|
17
|
+
// Except for white cards, all cards are light mode always
|
18
|
+
color: "text.default.light",
|
17
19
|
...getColorSchemeBaseProps(props),
|
18
20
|
|
19
21
|
"button&, a&, label&, &.is-clickable": {
|
22
|
+
outline: "1px solid",
|
20
23
|
...getColorSchemeClickableProps(props),
|
21
|
-
_hover: getColorSchemeHoverProps(props),
|
22
24
|
...focusVisibleStyles(props),
|
25
|
+
_hover: getColorSchemeHoverProps(props),
|
23
26
|
_active: getColorSchemeActiveProps(props),
|
24
27
|
_disabled: {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
isInset: false,
|
29
|
-
}),
|
30
|
-
color: "osloGrey",
|
28
|
+
...baseBackground("disabled", props),
|
29
|
+
...baseBorder("disabled", props),
|
30
|
+
...baseText("disabled", props),
|
31
31
|
pointerEvents: "none",
|
32
32
|
},
|
33
33
|
},
|
34
34
|
}),
|
35
|
+
sizes: {
|
36
|
+
sm: {
|
37
|
+
"button&, a&, label&, &.is-clickable": {
|
38
|
+
boxShadow: "sm",
|
39
|
+
|
40
|
+
_hover: {
|
41
|
+
boxShadow: "md",
|
42
|
+
},
|
43
|
+
|
44
|
+
_active: {
|
45
|
+
boxShadow: "none",
|
46
|
+
},
|
47
|
+
},
|
48
|
+
},
|
49
|
+
lg: {
|
50
|
+
"button&, a&, label&, &.is-clickable": {
|
51
|
+
boxShadow: "md",
|
52
|
+
|
53
|
+
_hover: {
|
54
|
+
boxShadow: "lg",
|
55
|
+
},
|
56
|
+
|
57
|
+
_active: {
|
58
|
+
boxShadow: "sm",
|
59
|
+
},
|
60
|
+
},
|
61
|
+
},
|
62
|
+
},
|
35
63
|
});
|
36
64
|
|
37
65
|
export default config;
|
@@ -50,17 +78,13 @@ type CardThemeProps = {
|
|
50
78
|
};
|
51
79
|
|
52
80
|
const getColorSchemeBaseProps = (props: CardThemeProps) => {
|
53
|
-
|
54
|
-
const baseShadow = size === "lg" ? "md" : "sm";
|
55
|
-
switch (colorScheme) {
|
81
|
+
switch (props.colorScheme) {
|
56
82
|
case "white":
|
57
83
|
return {
|
84
|
+
outline: "1px solid",
|
85
|
+
outlineColor: "silver",
|
58
86
|
backgroundColor: mode("white", "whiteAlpha.100")(props),
|
59
|
-
|
60
|
-
baseShadow,
|
61
|
-
borderColor: "silver",
|
62
|
-
isInset: false,
|
63
|
-
}),
|
87
|
+
color: "inherit",
|
64
88
|
};
|
65
89
|
case "grey":
|
66
90
|
return {
|
@@ -78,95 +102,64 @@ const getColorSchemeBaseProps = (props: CardThemeProps) => {
|
|
78
102
|
}
|
79
103
|
default:
|
80
104
|
return {
|
81
|
-
backgroundColor: colors[colorScheme]?.[100] ?? "platinum",
|
105
|
+
backgroundColor: colors[props.colorScheme]?.[100] ?? "platinum",
|
82
106
|
};
|
83
107
|
}
|
84
108
|
};
|
85
109
|
|
86
|
-
function getColorSchemeClickableProps(
|
87
|
-
|
88
|
-
switch (colorScheme) {
|
110
|
+
function getColorSchemeClickableProps(props: CardThemeProps) {
|
111
|
+
switch (props.colorScheme) {
|
89
112
|
case "white":
|
90
113
|
return {
|
91
|
-
|
92
|
-
baseShadow,
|
93
|
-
borderColor: "silver",
|
94
|
-
}),
|
114
|
+
outlineColor: "silver",
|
95
115
|
};
|
96
116
|
case "grey":
|
97
117
|
return {
|
98
|
-
|
99
|
-
baseShadow,
|
100
|
-
borderColor: "steel",
|
101
|
-
}),
|
118
|
+
outlineColor: "steel",
|
102
119
|
};
|
103
120
|
default:
|
104
121
|
return {
|
105
|
-
backgroundColor: colors[colorScheme]?.[100] ?? "platinum",
|
106
|
-
|
107
|
-
baseShadow,
|
108
|
-
borderColor: colors[colorScheme]?.[200] ?? "silver",
|
109
|
-
}),
|
122
|
+
backgroundColor: colors[props.colorScheme]?.[100] ?? "platinum",
|
123
|
+
outlineColor: colors[props.colorScheme]?.[200] ?? "silver",
|
110
124
|
};
|
111
125
|
}
|
112
126
|
}
|
113
127
|
|
114
128
|
const getColorSchemeHoverProps = (props: CardThemeProps) => {
|
115
|
-
|
116
|
-
const baseShadow = size === "lg" ? "lg" : "md";
|
117
|
-
switch (colorScheme) {
|
129
|
+
switch (props.colorScheme) {
|
118
130
|
case "white":
|
119
131
|
return {
|
120
132
|
backgroundColor: mode("white", "whiteAlpha.200")(props),
|
121
|
-
|
122
|
-
baseShadow,
|
123
|
-
borderColor: colors.steel,
|
124
|
-
}),
|
133
|
+
outlineColor: "steel",
|
125
134
|
};
|
126
135
|
case "grey":
|
127
136
|
return {
|
128
|
-
|
129
|
-
baseShadow,
|
130
|
-
borderColor: colors.osloGrey,
|
131
|
-
}),
|
137
|
+
outlineColor: "osloGrey",
|
132
138
|
};
|
133
139
|
default:
|
134
140
|
return {
|
135
|
-
backgroundColor: colors[colorScheme]?.[200] ?? "silver",
|
136
|
-
|
137
|
-
baseShadow,
|
138
|
-
borderColor: colors[colorScheme]?.[400] ?? colors.silver,
|
139
|
-
}),
|
141
|
+
backgroundColor: colors[props.colorScheme]?.[200] ?? "silver",
|
142
|
+
outlineColor: colors[props.colorScheme]?.[400] ?? "silver",
|
140
143
|
};
|
141
144
|
}
|
142
145
|
};
|
143
146
|
const getColorSchemeActiveProps = (props: CardThemeProps) => {
|
144
147
|
const { colorScheme, size } = props;
|
145
|
-
const baseShadow = size === "lg" ? "sm" : "none";
|
146
148
|
switch (colorScheme) {
|
147
149
|
case "white":
|
148
150
|
return {
|
149
151
|
backgroundColor: mode("mint", "teal")(props),
|
150
|
-
|
151
|
-
baseShadow,
|
152
|
-
borderColor: colors.silver,
|
153
|
-
}),
|
152
|
+
outlineColor: "silver",
|
154
153
|
};
|
155
154
|
case "grey":
|
156
155
|
return {
|
157
156
|
backgroundColor: "white",
|
158
|
-
|
159
|
-
baseShadow,
|
160
|
-
borderColor: colors.steel,
|
161
|
-
}),
|
157
|
+
outlineColor: "steel",
|
162
158
|
};
|
163
159
|
default:
|
164
160
|
return {
|
165
161
|
backgroundColor: colors[colorScheme]?.[50] ?? "lightGrey",
|
166
|
-
|
167
|
-
baseShadow,
|
168
|
-
borderColor: colors[colorScheme]?.[100] ?? colors.silver,
|
169
|
-
}),
|
162
|
+
outlineColor: colors[colorScheme]?.[100] ?? "silver",
|
170
163
|
};
|
171
164
|
}
|
172
165
|
};
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { checkboxAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { focusVisibleStyles } from "../utils/focus-util";
|
4
3
|
import { mode } from "@chakra-ui/theme-tools";
|
5
|
-
import { baseBackground } from "../utils/
|
6
|
-
import {
|
4
|
+
import { baseBackground, baseText } from "../utils/base-utils";
|
5
|
+
import { brandBackground, brandText } from "../utils/brand-utils";
|
6
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
7
7
|
|
8
8
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
9
9
|
|
@@ -13,20 +13,20 @@ const config = helpers.defineMultiStyleConfig({
|
|
13
13
|
_hover: {
|
14
14
|
"input:enabled:not([aria-invalid]) + .chakra-checkbox__control": {
|
15
15
|
...baseBackground("hover", props),
|
16
|
-
borderColor:
|
16
|
+
borderColor: brandBackground("hover", props).backgroundColor,
|
17
17
|
},
|
18
18
|
"input:enabled[aria-invalid] + .chakra-checkbox__control": {
|
19
19
|
backgroundColor: mode("white", "inherit")(props),
|
20
|
-
borderColor: "
|
20
|
+
borderColor: mode("outline.error.light", "outline.error.dark"),
|
21
21
|
},
|
22
22
|
"input:enabled:checked:not([aria-invalid]) + .chakra-checkbox__control":
|
23
23
|
{
|
24
|
-
|
25
|
-
borderColor:
|
24
|
+
...brandBackground("hover", props),
|
25
|
+
borderColor: brandBackground("hover", props).backgroundColor,
|
26
26
|
},
|
27
27
|
"input:enabled:checked[aria-invalid] + .chakra-checkbox__control": {
|
28
|
-
|
29
|
-
|
28
|
+
borderColor: mode("outline.error.light", "outline.error.dark"),
|
29
|
+
backgroundColor: mode("outline.error.light", "outline.error.dark"),
|
30
30
|
},
|
31
31
|
},
|
32
32
|
},
|
@@ -42,23 +42,23 @@ const config = helpers.defineMultiStyleConfig({
|
|
42
42
|
transitionProperty: "background, border-color",
|
43
43
|
transitionDuration: "normal",
|
44
44
|
border: "2px solid",
|
45
|
-
borderColor: mode(
|
45
|
+
borderColor: mode(
|
46
|
+
"base.outline.default.light",
|
47
|
+
"base.outline.default.dark",
|
48
|
+
)(props),
|
46
49
|
borderRadius: "xs",
|
47
|
-
color: mode("white", "darkTeal")(props),
|
48
50
|
...baseBackground("default", props),
|
51
|
+
...focusVisibleStyles(props),
|
49
52
|
|
50
53
|
_checked: {
|
51
|
-
...
|
52
|
-
|
53
|
-
|
54
|
-
color: mode("white", "darkTeal")(props),
|
55
|
-
|
56
|
-
...focusVisibleStyles(props),
|
54
|
+
...brandText("default", props),
|
55
|
+
...brandBackground("default", props),
|
56
|
+
borderColor: brandBackground("default", props).backgroundColor,
|
57
57
|
|
58
58
|
_disabled: {
|
59
59
|
...baseBackground("disabled", props),
|
60
|
-
|
61
|
-
|
60
|
+
...baseText("disabled", props),
|
61
|
+
borderColor: "currentColor",
|
62
62
|
},
|
63
63
|
|
64
64
|
_invalid: {
|
@@ -69,7 +69,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
69
69
|
|
70
70
|
_disabled: {
|
71
71
|
...baseBackground("disabled", props),
|
72
|
-
borderColor:
|
72
|
+
borderColor: baseText("disabled", props).color,
|
73
73
|
},
|
74
74
|
_invalid: {
|
75
75
|
...baseBackground("default", props),
|