@vygruppen/spor-react 3.7.3 → 3.7.5
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 -10
- package/CHANGELOG.md +21 -0
- package/dist/{CountryCodeSelect-WGNXQHWO.mjs → CountryCodeSelect-SNFTRR3O.mjs} +1 -1
- package/dist/{chunk-D2XVZVE6.mjs → chunk-GIAB4PHV.mjs} +213 -131
- package/dist/index.d.mts +40 -22
- package/dist/index.d.ts +40 -22
- package/dist/index.js +212 -128
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/button/Button.tsx +1 -0
- package/src/button/FloatingActionButton.tsx +76 -61
- package/src/input/ChoiceChip.tsx +2 -0
- package/src/theme/components/accordion.ts +38 -21
- package/src/theme/components/breadcrumb.ts +21 -17
- package/src/theme/components/button.ts +71 -24
- package/src/theme/components/choice-chip.ts +22 -9
- package/src/theme/components/input.ts +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
BoxProps,
|
|
4
|
+
ComponentWithAs,
|
|
5
|
+
forwardRef,
|
|
6
|
+
useMultiStyleConfig,
|
|
7
|
+
} from "@chakra-ui/react";
|
|
2
8
|
import { motion } from "framer-motion";
|
|
3
|
-
import React from "react";
|
|
9
|
+
import React, { useEffect } from "react";
|
|
4
10
|
|
|
5
11
|
const MotionBox = motion(Box);
|
|
6
12
|
|
|
@@ -24,76 +30,85 @@ type FloatingActionButtonProps = BoxProps & {
|
|
|
24
30
|
* placement="bottom right"
|
|
25
31
|
* />
|
|
26
32
|
*/
|
|
27
|
-
export const FloatingActionButton =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
1000
|
|
33
|
+
export const FloatingActionButton = forwardRef<
|
|
34
|
+
FloatingActionButtonProps,
|
|
35
|
+
ComponentWithAs<"a" | "button">
|
|
36
|
+
>(
|
|
37
|
+
(
|
|
38
|
+
{
|
|
39
|
+
as,
|
|
40
|
+
children,
|
|
41
|
+
icon,
|
|
42
|
+
variant,
|
|
43
|
+
isTextVisible: externalIsTextVisible,
|
|
44
|
+
placement = "bottom right",
|
|
45
|
+
...props
|
|
46
|
+
},
|
|
47
|
+
ref
|
|
48
|
+
) => {
|
|
49
|
+
const [isTextVisible, setIsTextVisible] = React.useState(
|
|
50
|
+
externalIsTextVisible !== undefined ? externalIsTextVisible : false
|
|
46
51
|
);
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
const scrollDirection = useScrollDirection();
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (externalIsTextVisible !== undefined) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const id = window.setTimeout(
|
|
58
|
+
() => setIsTextVisible(scrollDirection !== "down"),
|
|
59
|
+
1000
|
|
60
|
+
);
|
|
61
|
+
return () => window.clearTimeout(id);
|
|
62
|
+
}, [scrollDirection, externalIsTextVisible]);
|
|
49
63
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
setIsTextVisible(!!externalIsTextVisible);
|
|
66
|
+
}, [externalIsTextVisible]);
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<MotionBox
|
|
61
|
-
__css={style.container}
|
|
62
|
-
as="button"
|
|
63
|
-
aria-label={children}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
<Box __css={style.icon}>
|
|
67
|
-
{icon}
|
|
68
|
-
</Box>
|
|
68
|
+
const style = useMultiStyleConfig("FloatingActionButton", {
|
|
69
|
+
variant,
|
|
70
|
+
isTextVisible,
|
|
71
|
+
placement,
|
|
72
|
+
});
|
|
73
|
+
return (
|
|
69
74
|
<MotionBox
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
opacity: 1,
|
|
75
|
-
width: "auto",
|
|
76
|
-
visibility: "visible",
|
|
77
|
-
},
|
|
78
|
-
hide: {
|
|
79
|
-
opacity: 0,
|
|
80
|
-
width: 0,
|
|
81
|
-
visibility: "hidden",
|
|
82
|
-
},
|
|
83
|
-
}}
|
|
84
|
-
__css={style.text}
|
|
75
|
+
__css={style.container}
|
|
76
|
+
aria-label={children}
|
|
77
|
+
ref={ref}
|
|
78
|
+
{...props}
|
|
85
79
|
>
|
|
86
|
-
{
|
|
80
|
+
<Box __css={style.icon}>{icon}</Box>
|
|
81
|
+
<MotionBox
|
|
82
|
+
animate={isTextVisible ? "show" : "hide"}
|
|
83
|
+
initial={externalIsTextVisible ? "show" : "hide"}
|
|
84
|
+
variants={{
|
|
85
|
+
show: {
|
|
86
|
+
opacity: 1,
|
|
87
|
+
width: "auto",
|
|
88
|
+
visibility: "visible",
|
|
89
|
+
},
|
|
90
|
+
hide: {
|
|
91
|
+
opacity: 0,
|
|
92
|
+
width: 0,
|
|
93
|
+
visibility: "hidden",
|
|
94
|
+
},
|
|
95
|
+
}}
|
|
96
|
+
__css={style.text}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</MotionBox>
|
|
87
100
|
</MotionBox>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
91
104
|
|
|
92
105
|
type ScrollDirection = "up" | "down" | null;
|
|
93
106
|
const useScrollDirection = () => {
|
|
94
107
|
const [scrollDirection, setScrollDirection] =
|
|
95
108
|
React.useState<ScrollDirection>(null);
|
|
96
|
-
const lastScrollPosition = React.useRef(
|
|
109
|
+
const lastScrollPosition = React.useRef(
|
|
110
|
+
typeof window !== "undefined" ? window.scrollY : 0
|
|
111
|
+
);
|
|
97
112
|
React.useEffect(() => {
|
|
98
113
|
const onScroll = () => {
|
|
99
114
|
const delta = window.scrollY - lastScrollPosition.current;
|
package/src/input/ChoiceChip.tsx
CHANGED
|
@@ -83,6 +83,8 @@ export const ChoiceChip = forwardRef((props: ChoiceChipProps, ref) => {
|
|
|
83
83
|
data-checked={dataAttr(state.isChecked)}
|
|
84
84
|
data-hover={dataAttr(state.isHovered)}
|
|
85
85
|
data-focus={dataAttr(state.isFocused)}
|
|
86
|
+
data-active={dataAttr(state.isActive)}
|
|
87
|
+
data-disabled={dataAttr(state.isDisabled)}
|
|
86
88
|
>
|
|
87
89
|
{icon && (
|
|
88
90
|
<chakra.span __css={styles.icon}>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { accordionAnatomy as parts } from "@chakra-ui/anatomy";
|
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
|
|
3
|
-
import { colors } from "../foundations";
|
|
3
|
+
import { colors, shadows } from "../foundations";
|
|
4
4
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
|
5
5
|
import { focusVisible } from "../utils/focus-utils";
|
|
6
|
+
import { mode } from "@chakra-ui/theme-tools";
|
|
6
7
|
|
|
7
8
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
|
8
9
|
const config = helpers.defineMultiStyleConfig({
|
|
9
|
-
baseStyle: {
|
|
10
|
+
baseStyle: (props) => ({
|
|
10
11
|
container: {
|
|
11
12
|
border: "none",
|
|
12
13
|
borderRadius: "sm",
|
|
@@ -19,7 +20,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
19
20
|
borderRadius: "sm",
|
|
20
21
|
display: "flex",
|
|
21
22
|
justifyContent: "space-between",
|
|
22
|
-
color: "darkGrey",
|
|
23
|
+
color: mode("darkGrey", "white")(props),
|
|
23
24
|
textAlign: "left",
|
|
24
25
|
fontFamily: "body",
|
|
25
26
|
fontWeight: "bold",
|
|
@@ -31,7 +32,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
31
32
|
},
|
|
32
33
|
focus: {
|
|
33
34
|
boxShadow: getBoxShadowString({
|
|
34
|
-
borderColor: "greenHaze",
|
|
35
|
+
borderColor: mode("greenHaze", "azure")(props),
|
|
35
36
|
borderWidth: 2,
|
|
36
37
|
}),
|
|
37
38
|
},
|
|
@@ -48,23 +49,26 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
48
49
|
icon: {
|
|
49
50
|
fontSize: "1.25em",
|
|
50
51
|
},
|
|
51
|
-
},
|
|
52
|
+
}),
|
|
52
53
|
variants: {
|
|
53
|
-
list: {
|
|
54
|
+
list: (props) => ({
|
|
54
55
|
button: {
|
|
55
56
|
boxShadow: "none",
|
|
56
57
|
_hover: {
|
|
57
|
-
backgroundColor: "seaMist",
|
|
58
|
+
backgroundColor: mode("seaMist", "pine")(props),
|
|
58
59
|
},
|
|
59
60
|
_active: {
|
|
60
|
-
backgroundColor: "mint",
|
|
61
|
+
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
|
61
62
|
},
|
|
62
63
|
},
|
|
63
|
-
},
|
|
64
|
-
outline: {
|
|
64
|
+
}),
|
|
65
|
+
outline: (props) => ({
|
|
65
66
|
container: {
|
|
66
67
|
boxShadow: getBoxShadowString({
|
|
67
|
-
borderColor:
|
|
68
|
+
borderColor: mode(
|
|
69
|
+
colors.blackAlpha["400"],
|
|
70
|
+
colors.whiteAlpha["400"],
|
|
71
|
+
)(props),
|
|
68
72
|
}),
|
|
69
73
|
},
|
|
70
74
|
button: {
|
|
@@ -73,23 +77,24 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
73
77
|
},
|
|
74
78
|
_hover: {
|
|
75
79
|
boxShadow: getBoxShadowString({
|
|
76
|
-
borderColor: "darkGrey",
|
|
80
|
+
borderColor: mode("darkGrey", "white")(props),
|
|
77
81
|
borderWidth: 2,
|
|
78
82
|
}),
|
|
79
83
|
},
|
|
80
84
|
_active: {
|
|
81
|
-
backgroundColor: "mint",
|
|
85
|
+
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
|
82
86
|
boxShadow: getBoxShadowString({
|
|
83
|
-
borderColor: "darkGrey",
|
|
87
|
+
borderColor: mode("darkGrey", colors.whiteAlpha[400])(props),
|
|
84
88
|
}),
|
|
85
89
|
},
|
|
86
90
|
},
|
|
87
|
-
},
|
|
88
|
-
card: {
|
|
91
|
+
}),
|
|
92
|
+
card: (props) => ({
|
|
89
93
|
container: {
|
|
94
|
+
backgroundColor: mode("white", "whiteAlpha.100")(props),
|
|
90
95
|
boxShadow: getBoxShadowString({
|
|
91
|
-
baseShadow: "sm",
|
|
92
|
-
borderColor: "silver",
|
|
96
|
+
baseShadow: mode<keyof typeof shadows>("sm", "none")(props),
|
|
97
|
+
borderColor: mode("silver", "whiteAlpha.400")(props),
|
|
93
98
|
}),
|
|
94
99
|
},
|
|
95
100
|
button: {
|
|
@@ -97,13 +102,22 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
97
102
|
borderBottomRadius: "none",
|
|
98
103
|
},
|
|
99
104
|
_hover: {
|
|
100
|
-
backgroundColor: "seaMist",
|
|
105
|
+
backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
|
|
106
|
+
boxShadow: getBoxShadowString({
|
|
107
|
+
borderColor: mode("darkGrey", "white")(props),
|
|
108
|
+
borderWidth: 1,
|
|
109
|
+
}),
|
|
101
110
|
},
|
|
102
111
|
_active: {
|
|
103
|
-
backgroundColor: "mint",
|
|
112
|
+
backgroundColor: mode("mint", "inherit")(props),
|
|
113
|
+
boxShadow: getBoxShadowString({
|
|
114
|
+
baseShadow: "none",
|
|
115
|
+
borderWidth: 1,
|
|
116
|
+
borderColor: mode("darkGrey", "whiteAlpha.400")(props),
|
|
117
|
+
}),
|
|
104
118
|
},
|
|
105
119
|
},
|
|
106
|
-
},
|
|
120
|
+
}),
|
|
107
121
|
},
|
|
108
122
|
sizes: {
|
|
109
123
|
sm: {
|
|
@@ -111,6 +125,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
111
125
|
fontSize: ["mobile.xs", null, "desktop.xs"],
|
|
112
126
|
paddingX: 2,
|
|
113
127
|
paddingY: 1,
|
|
128
|
+
minHeight: 6,
|
|
114
129
|
},
|
|
115
130
|
panel: {
|
|
116
131
|
fontSize: ["mobile.xs", null, "desktop.xs"],
|
|
@@ -122,6 +137,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
122
137
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
|
123
138
|
paddingX: 3,
|
|
124
139
|
paddingY: 1,
|
|
140
|
+
minHeight: 7,
|
|
125
141
|
},
|
|
126
142
|
panel: {
|
|
127
143
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
|
@@ -133,6 +149,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
133
149
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
|
134
150
|
paddingX: 3,
|
|
135
151
|
paddingY: 2,
|
|
152
|
+
minHeight: 8,
|
|
136
153
|
},
|
|
137
154
|
panel: {
|
|
138
155
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { breadcrumbAnatomy as parts } from "@chakra-ui/anatomy";
|
|
2
|
-
import {
|
|
3
|
-
createMultiStyleConfigHelpers,
|
|
4
|
-
defineStyle,
|
|
5
|
-
} from "@chakra-ui/styled-system";
|
|
2
|
+
import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/styled-system";
|
|
6
3
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
|
4
|
+
import { mode } from "@chakra-ui/theme-tools";
|
|
5
|
+
import { focusVisible } from "../utils/focus-utils";
|
|
7
6
|
|
|
8
7
|
const { defineMultiStyleConfig, definePartsStyle } =
|
|
9
8
|
createMultiStyleConfigHelpers(parts.keys);
|
|
10
9
|
|
|
11
|
-
const baseStyleLink = defineStyle({
|
|
10
|
+
const baseStyleLink = defineStyle((props) => ({
|
|
12
11
|
transitionProperty: "common",
|
|
13
12
|
transitionDuration: "fast",
|
|
14
13
|
transitionTimingFunction: "ease-out",
|
|
@@ -21,27 +20,32 @@ const baseStyleLink = defineStyle({
|
|
|
21
20
|
paddingX: 0.5,
|
|
22
21
|
borderRadius: "xs",
|
|
23
22
|
_hover: {
|
|
24
|
-
backgroundColor: "
|
|
25
|
-
},
|
|
26
|
-
_focusVisible: {
|
|
27
|
-
boxShadow: getBoxShadowString({
|
|
28
|
-
borderColor: "greenHaze",
|
|
29
|
-
borderWidth: 2,
|
|
30
|
-
}),
|
|
23
|
+
backgroundColor: mode("seaMist", "pine")(props),
|
|
31
24
|
},
|
|
25
|
+
...focusVisible({
|
|
26
|
+
focus: {
|
|
27
|
+
boxShadow: getBoxShadowString({
|
|
28
|
+
borderColor: mode("greenHaze", "azure")(props),
|
|
29
|
+
borderWidth: 2,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
notFocus: {
|
|
33
|
+
notFocus: { boxShadow: "none" },
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
32
36
|
_active: {
|
|
33
|
-
backgroundColor: "mint",
|
|
37
|
+
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
|
34
38
|
},
|
|
35
39
|
},
|
|
36
|
-
});
|
|
40
|
+
}));
|
|
37
41
|
|
|
38
|
-
const baseStyle = definePartsStyle({
|
|
39
|
-
link: baseStyleLink,
|
|
42
|
+
const baseStyle = definePartsStyle((props) => ({
|
|
43
|
+
link: baseStyleLink(props),
|
|
40
44
|
list: {
|
|
41
45
|
flexWrap: "wrap",
|
|
42
46
|
alignItems: "flex-start",
|
|
43
47
|
},
|
|
44
|
-
});
|
|
48
|
+
}));
|
|
45
49
|
|
|
46
50
|
export default defineMultiStyleConfig({
|
|
47
51
|
baseStyle,
|
|
@@ -29,28 +29,39 @@ const config = defineStyleConfig({
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
variants: {
|
|
32
|
-
control: {
|
|
33
|
-
backgroundColor: "darkTeal",
|
|
34
|
-
color: "white",
|
|
32
|
+
control: (props) => ({
|
|
33
|
+
backgroundColor: mode("darkTeal", "mint")(props),
|
|
34
|
+
color: mode("white", "darkTeal")(props),
|
|
35
35
|
...focusVisible({
|
|
36
36
|
focus: {
|
|
37
|
-
boxShadow: `inset 0 0 0 4px ${
|
|
37
|
+
boxShadow: `inset 0 0 0 4px ${mode(
|
|
38
|
+
colors.darkTeal,
|
|
39
|
+
colors.seaMist,
|
|
40
|
+
)(props)}, inset 0 0 0 6px currentColor`,
|
|
38
41
|
},
|
|
39
42
|
notFocus: { boxShadow: "none" },
|
|
40
43
|
}),
|
|
41
44
|
_hover: {
|
|
42
|
-
backgroundColor: "night",
|
|
45
|
+
backgroundColor: mode("night", "coralGreen")(props),
|
|
43
46
|
},
|
|
44
47
|
_active: {
|
|
45
|
-
backgroundColor: "pine",
|
|
48
|
+
backgroundColor: mode("pine", "white")(props),
|
|
46
49
|
},
|
|
47
|
-
},
|
|
48
|
-
primary: {
|
|
50
|
+
}),
|
|
51
|
+
primary: (props) => ({
|
|
52
|
+
// FIXME: Update to use a global defined background color for darkMode whenever it is available.
|
|
53
|
+
// hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
|
|
49
54
|
backgroundColor: "primaryGreen",
|
|
50
55
|
color: "white",
|
|
51
56
|
...focusVisible({
|
|
52
57
|
focus: {
|
|
53
|
-
boxShadow: `inset 0 0 0
|
|
58
|
+
boxShadow: `inset 0 0 0 2px ${mode(
|
|
59
|
+
colors.greenHaze,
|
|
60
|
+
colors.azure,
|
|
61
|
+
)(props)}, inset 0 0 0 4px ${mode(
|
|
62
|
+
colors.white,
|
|
63
|
+
colors.darkGrey,
|
|
64
|
+
)(props)}`,
|
|
54
65
|
},
|
|
55
66
|
notFocus: { boxShadow: "none" },
|
|
56
67
|
}),
|
|
@@ -60,25 +71,61 @@ const config = defineStyleConfig({
|
|
|
60
71
|
_active: {
|
|
61
72
|
backgroundColor: "azure",
|
|
62
73
|
},
|
|
63
|
-
},
|
|
64
|
-
secondary: {
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
}),
|
|
75
|
+
secondary: (props) => ({
|
|
76
|
+
// FIXME: Update to use global defined background color for darkMode whenever it is available instead of alpha
|
|
77
|
+
backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
|
|
78
|
+
color: mode("darkTeal", "white")(props),
|
|
79
|
+
// order is important here for now while we do not have global defined background color for darkMode
|
|
80
|
+
_hover: {
|
|
81
|
+
backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
|
|
82
|
+
},
|
|
67
83
|
...focusVisible({
|
|
68
84
|
focus: {
|
|
69
|
-
boxShadow: `inset 0 0 0
|
|
85
|
+
boxShadow: `inset 0 0 0 2px ${mode(
|
|
86
|
+
colors.greenHaze,
|
|
87
|
+
colors.azure,
|
|
88
|
+
)(props)}, inset 0 0 0 4px ${mode(
|
|
89
|
+
colors.white,
|
|
90
|
+
colors.blackAlpha[300],
|
|
91
|
+
)(props)}`,
|
|
92
|
+
_hover: {
|
|
93
|
+
boxShadow: `inset 0 0 0 2px ${mode(
|
|
94
|
+
colors.greenHaze,
|
|
95
|
+
colors.azure,
|
|
96
|
+
)(props)}, inset 0 0 0 4px ${mode(
|
|
97
|
+
colors.white,
|
|
98
|
+
colors.blackAlpha[500],
|
|
99
|
+
)(props)}`,
|
|
100
|
+
},
|
|
70
101
|
},
|
|
71
102
|
notFocus: {
|
|
72
103
|
boxShadow: "none",
|
|
73
104
|
},
|
|
74
105
|
}),
|
|
75
|
-
_hover: {
|
|
76
|
-
backgroundColor: "blueGreen",
|
|
77
|
-
},
|
|
78
106
|
_active: {
|
|
79
|
-
backgroundColor: "mint",
|
|
107
|
+
backgroundColor: mode("mint", "whiteAlpha.300")(props),
|
|
108
|
+
boxShadow: `inset 0 0 0 2px ${mode(
|
|
109
|
+
colors.greenHaze,
|
|
110
|
+
colors.azure,
|
|
111
|
+
)(props)}, inset 0 0 0 4px ${mode(
|
|
112
|
+
colors.white,
|
|
113
|
+
colors.blackAlpha[600],
|
|
114
|
+
)(props)}`,
|
|
115
|
+
_hover: {
|
|
116
|
+
boxShadow: `inset 0 0 0 2px ${mode(
|
|
117
|
+
colors.greenHaze,
|
|
118
|
+
colors.azure,
|
|
119
|
+
)(props)}, inset 0 0 0 4px ${mode(
|
|
120
|
+
colors.white,
|
|
121
|
+
colors.blackAlpha[600],
|
|
122
|
+
)(props)}`,
|
|
123
|
+
},
|
|
80
124
|
},
|
|
81
|
-
},
|
|
125
|
+
}),
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated use `secondary` instead.
|
|
128
|
+
*/
|
|
82
129
|
tertiary: {
|
|
83
130
|
backgroundColor: "mint",
|
|
84
131
|
color: "darkGrey",
|
|
@@ -102,19 +149,19 @@ const config = defineStyleConfig({
|
|
|
102
149
|
fontWeight: "normal",
|
|
103
150
|
boxShadow: `inset 0 0 0 1px ${mode(
|
|
104
151
|
colors.blackAlpha[400],
|
|
105
|
-
colors.whiteAlpha[400]
|
|
152
|
+
colors.whiteAlpha[400],
|
|
106
153
|
)(props)}`,
|
|
107
154
|
...focusVisible({
|
|
108
155
|
focus: {
|
|
109
156
|
boxShadow: getBoxShadowString({
|
|
110
|
-
borderWidth:
|
|
157
|
+
borderWidth: 2,
|
|
111
158
|
borderColor: "greenHaze",
|
|
112
159
|
}),
|
|
113
160
|
},
|
|
114
161
|
notFocus: {
|
|
115
162
|
boxShadow: `inset 0 0 0 1px ${mode(
|
|
116
163
|
colors.blackAlpha[400],
|
|
117
|
-
colors.whiteAlpha[400]
|
|
164
|
+
colors.whiteAlpha[400],
|
|
118
165
|
)(props)}`,
|
|
119
166
|
},
|
|
120
167
|
}),
|
|
@@ -124,7 +171,7 @@ const config = defineStyleConfig({
|
|
|
124
171
|
_active: {
|
|
125
172
|
boxShadow: `inset 0 0 0 1px ${mode(
|
|
126
173
|
colors.blackAlpha[400],
|
|
127
|
-
colors.whiteAlpha[300]
|
|
174
|
+
colors.whiteAlpha[300],
|
|
128
175
|
)(props)}`,
|
|
129
176
|
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
|
130
177
|
},
|
|
@@ -182,7 +229,7 @@ const config = defineStyleConfig({
|
|
|
182
229
|
boxShadow: getBoxShadowString({
|
|
183
230
|
borderColor: mode("greenHaze", "azure")(props),
|
|
184
231
|
borderWidth: 2,
|
|
185
|
-
baseShadow: "md"
|
|
232
|
+
baseShadow: "md",
|
|
186
233
|
}),
|
|
187
234
|
},
|
|
188
235
|
},
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
2
|
-
import { anatomy } from "@chakra-ui/theme-tools";
|
|
2
|
+
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
|
3
3
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
|
4
|
+
import { colors } from "../foundations";
|
|
5
|
+
import { focusVisible } from "../utils/focus-utils";
|
|
4
6
|
|
|
5
7
|
const parts = anatomy("choice-chip").parts("container", "icon", "label");
|
|
6
8
|
|
|
@@ -9,33 +11,44 @@ const helpers = createMultiStyleConfigHelpers(parts.keys);
|
|
|
9
11
|
const config = helpers.defineMultiStyleConfig({
|
|
10
12
|
baseStyle: (props) => ({
|
|
11
13
|
container: {
|
|
12
|
-
backgroundColor: "white",
|
|
14
|
+
backgroundColor: mode("white", "transparent")(props),
|
|
13
15
|
boxShadow: getBoxShadowString({ borderColor: "celadon" }),
|
|
14
|
-
color: "darkTeal",
|
|
16
|
+
color: mode("darkTeal", "white")(props),
|
|
15
17
|
display: "inline-flex",
|
|
16
18
|
alignItems: "center",
|
|
17
19
|
fontSize: "16px",
|
|
18
20
|
px: 1,
|
|
19
21
|
_checked: {
|
|
20
|
-
|
|
22
|
+
color: "white",
|
|
23
|
+
background: "pine",
|
|
21
24
|
boxShadow: getBoxShadowString({ borderColor: "celadon" }),
|
|
22
25
|
},
|
|
23
26
|
"input:focus-visible + &": {
|
|
24
|
-
boxShadow:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
27
|
+
boxShadow: `inset 0 0 0 2px ${mode(
|
|
28
|
+
colors.greenHaze,
|
|
29
|
+
colors.azure,
|
|
30
|
+
)(props)}, inset 0 0 0 4px ${mode(
|
|
31
|
+
colors.white,
|
|
32
|
+
colors.darkGrey,
|
|
33
|
+
)(props)}`,
|
|
28
34
|
},
|
|
29
35
|
"@media (hover:hover)": {
|
|
30
36
|
_hover: {
|
|
37
|
+
color: mode("darkTeal", "white")(props),
|
|
31
38
|
boxShadow: getBoxShadowString({
|
|
32
39
|
borderColor: "greenHaze",
|
|
33
40
|
borderWidth: 2,
|
|
34
41
|
}),
|
|
35
|
-
background: "
|
|
42
|
+
background: mode("coralGreen", "whiteAlpha.200")(props),
|
|
36
43
|
cursor: "pointer",
|
|
37
44
|
},
|
|
38
45
|
},
|
|
46
|
+
_active: {
|
|
47
|
+
backgroundColor: mode("mint", "whiteAlpha.300")(props),
|
|
48
|
+
boxShadow: getBoxShadowString({
|
|
49
|
+
borderColor: "pine",
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
39
52
|
},
|
|
40
53
|
icon: {
|
|
41
54
|
mr: props.hasLabel ? 1 : 0,
|
|
@@ -26,7 +26,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
|
26
26
|
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
|
27
27
|
}),
|
|
28
28
|
_active: {
|
|
29
|
-
backgroundColor: mode("
|
|
29
|
+
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
|
30
30
|
boxShadow: getBoxShadowString({
|
|
31
31
|
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
|
32
32
|
}),
|