@vygruppen/spor-react 3.7.2 → 3.7.4
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 +22 -0
- package/dist/{CountryCodeSelect-LFJGSTTV.mjs → CountryCodeSelect-FLRREZ6C.mjs} +1 -1
- package/dist/{chunk-YVEFEGE4.mjs → chunk-TMLJPE4H.mjs} +196 -103
- package/dist/index.d.mts +70 -45
- package/dist/index.d.ts +70 -45
- package/dist/index.js +204 -102
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/button/Button.tsx +1 -0
- package/src/button/FloatingActionButton.tsx +9 -9
- package/src/input/ChoiceChip.tsx +2 -0
- package/src/link/TextLink.tsx +5 -1
- package/src/theme/components/accordion.ts +39 -21
- package/src/theme/components/breadcrumb.ts +13 -12
- package/src/theme/components/button.ts +71 -24
- package/src/theme/components/choice-chip.ts +22 -9
- package/src/theme/components/index.ts +1 -1
- package/src/theme/components/link.ts +30 -30
- package/src/theme/components/list.ts +23 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Box, BoxProps, useMultiStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { motion } from "framer-motion";
|
3
|
-
import React from "react";
|
3
|
+
import React, { useEffect } from "react";
|
4
4
|
|
5
5
|
const MotionBox = motion(Box);
|
6
6
|
|
@@ -33,10 +33,10 @@ export const FloatingActionButton = ({
|
|
33
33
|
...props
|
34
34
|
}: FloatingActionButtonProps) => {
|
35
35
|
const [isTextVisible, setIsTextVisible] = React.useState(
|
36
|
-
externalIsTextVisible !== undefined ? externalIsTextVisible :
|
36
|
+
externalIsTextVisible !== undefined ? externalIsTextVisible : false
|
37
37
|
);
|
38
38
|
const scrollDirection = useScrollDirection();
|
39
|
-
|
39
|
+
useEffect(() => {
|
40
40
|
if (externalIsTextVisible !== undefined) {
|
41
41
|
return;
|
42
42
|
}
|
@@ -47,7 +47,7 @@ export const FloatingActionButton = ({
|
|
47
47
|
return () => window.clearTimeout(id);
|
48
48
|
}, [scrollDirection, externalIsTextVisible]);
|
49
49
|
|
50
|
-
|
50
|
+
useEffect(() => {
|
51
51
|
setIsTextVisible(!!externalIsTextVisible);
|
52
52
|
}, [externalIsTextVisible]);
|
53
53
|
|
@@ -63,12 +63,10 @@ export const FloatingActionButton = ({
|
|
63
63
|
aria-label={children}
|
64
64
|
{...props}
|
65
65
|
>
|
66
|
-
<Box __css={style.icon}>
|
67
|
-
{icon}
|
68
|
-
</Box>
|
66
|
+
<Box __css={style.icon}>{icon}</Box>
|
69
67
|
<MotionBox
|
70
68
|
animate={isTextVisible ? "show" : "hide"}
|
71
|
-
initial="show"
|
69
|
+
initial={externalIsTextVisible ? "show" : "hide"}
|
72
70
|
variants={{
|
73
71
|
show: {
|
74
72
|
opacity: 1,
|
@@ -93,7 +91,9 @@ type ScrollDirection = "up" | "down" | null;
|
|
93
91
|
const useScrollDirection = () => {
|
94
92
|
const [scrollDirection, setScrollDirection] =
|
95
93
|
React.useState<ScrollDirection>(null);
|
96
|
-
const lastScrollPosition = React.useRef(
|
94
|
+
const lastScrollPosition = React.useRef(
|
95
|
+
typeof window !== "undefined" ? window.scrollY : 0
|
96
|
+
);
|
97
97
|
React.useEffect(() => {
|
98
98
|
const onScroll = () => {
|
99
99
|
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}>
|
package/src/link/TextLink.tsx
CHANGED
@@ -8,7 +8,11 @@ import React from "react";
|
|
8
8
|
import { createTexts, useTranslation } from "..";
|
9
9
|
|
10
10
|
type LinkProps = Omit<ChakraLinkProps, "variant"> & {
|
11
|
-
variant?:
|
11
|
+
variant?:
|
12
|
+
| "primary"
|
13
|
+
| "secondary"
|
14
|
+
/** @deprecated Use `secondary` instead */
|
15
|
+
| "tertiary";
|
12
16
|
};
|
13
17
|
/** Link to different sites or parts of site
|
14
18
|
*
|
@@ -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,8 +20,9 @@ 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",
|
25
|
+
fontFamily: "body",
|
24
26
|
fontWeight: "bold",
|
25
27
|
...focusVisible({
|
26
28
|
notFocus: {
|
@@ -30,7 +32,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
30
32
|
},
|
31
33
|
focus: {
|
32
34
|
boxShadow: getBoxShadowString({
|
33
|
-
borderColor: "greenHaze",
|
35
|
+
borderColor: mode("greenHaze", "azure")(props),
|
34
36
|
borderWidth: 2,
|
35
37
|
}),
|
36
38
|
},
|
@@ -47,23 +49,26 @@ const config = helpers.defineMultiStyleConfig({
|
|
47
49
|
icon: {
|
48
50
|
fontSize: "1.25em",
|
49
51
|
},
|
50
|
-
},
|
52
|
+
}),
|
51
53
|
variants: {
|
52
|
-
list: {
|
54
|
+
list: (props) => ({
|
53
55
|
button: {
|
54
56
|
boxShadow: "none",
|
55
57
|
_hover: {
|
56
|
-
backgroundColor: "seaMist",
|
58
|
+
backgroundColor: mode("seaMist", "pine")(props),
|
57
59
|
},
|
58
60
|
_active: {
|
59
|
-
backgroundColor: "mint",
|
61
|
+
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
60
62
|
},
|
61
63
|
},
|
62
|
-
},
|
63
|
-
outline: {
|
64
|
+
}),
|
65
|
+
outline: (props) => ({
|
64
66
|
container: {
|
65
67
|
boxShadow: getBoxShadowString({
|
66
|
-
borderColor:
|
68
|
+
borderColor: mode(
|
69
|
+
colors.blackAlpha["400"],
|
70
|
+
colors.whiteAlpha["400"],
|
71
|
+
)(props),
|
67
72
|
}),
|
68
73
|
},
|
69
74
|
button: {
|
@@ -72,23 +77,24 @@ const config = helpers.defineMultiStyleConfig({
|
|
72
77
|
},
|
73
78
|
_hover: {
|
74
79
|
boxShadow: getBoxShadowString({
|
75
|
-
borderColor: "darkGrey",
|
80
|
+
borderColor: mode("darkGrey", "white")(props),
|
76
81
|
borderWidth: 2,
|
77
82
|
}),
|
78
83
|
},
|
79
84
|
_active: {
|
80
|
-
backgroundColor: "mint",
|
85
|
+
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
81
86
|
boxShadow: getBoxShadowString({
|
82
|
-
borderColor: "darkGrey",
|
87
|
+
borderColor: mode("darkGrey", colors.whiteAlpha[400])(props),
|
83
88
|
}),
|
84
89
|
},
|
85
90
|
},
|
86
|
-
},
|
87
|
-
card: {
|
91
|
+
}),
|
92
|
+
card: (props) => ({
|
88
93
|
container: {
|
94
|
+
backgroundColor: mode("white", "whiteAlpha.100")(props),
|
89
95
|
boxShadow: getBoxShadowString({
|
90
|
-
baseShadow: "sm",
|
91
|
-
borderColor: "silver",
|
96
|
+
baseShadow: mode<keyof typeof shadows>("sm", "none")(props),
|
97
|
+
borderColor: mode("silver", "whiteAlpha.400")(props),
|
92
98
|
}),
|
93
99
|
},
|
94
100
|
button: {
|
@@ -96,13 +102,22 @@ const config = helpers.defineMultiStyleConfig({
|
|
96
102
|
borderBottomRadius: "none",
|
97
103
|
},
|
98
104
|
_hover: {
|
99
|
-
backgroundColor: "seaMist",
|
105
|
+
backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
|
106
|
+
boxShadow: getBoxShadowString({
|
107
|
+
borderColor: mode("darkGrey", "white")(props),
|
108
|
+
borderWidth: 1,
|
109
|
+
}),
|
100
110
|
},
|
101
111
|
_active: {
|
102
|
-
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
|
+
}),
|
103
118
|
},
|
104
119
|
},
|
105
|
-
},
|
120
|
+
}),
|
106
121
|
},
|
107
122
|
sizes: {
|
108
123
|
sm: {
|
@@ -110,6 +125,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
110
125
|
fontSize: ["mobile.xs", null, "desktop.xs"],
|
111
126
|
paddingX: 2,
|
112
127
|
paddingY: 1,
|
128
|
+
minHeight: 6,
|
113
129
|
},
|
114
130
|
panel: {
|
115
131
|
fontSize: ["mobile.xs", null, "desktop.xs"],
|
@@ -121,6 +137,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
121
137
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
122
138
|
paddingX: 3,
|
123
139
|
paddingY: 1,
|
140
|
+
minHeight: 7,
|
124
141
|
},
|
125
142
|
panel: {
|
126
143
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
@@ -132,6 +149,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
132
149
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
133
150
|
paddingX: 3,
|
134
151
|
paddingY: 2,
|
152
|
+
minHeight: 8,
|
135
153
|
},
|
136
154
|
panel: {
|
137
155
|
fontSize: ["mobile.sm", null, "desktop.sm"],
|
@@ -1,14 +1,12 @@
|
|
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";
|
7
5
|
|
8
6
|
const { defineMultiStyleConfig, definePartsStyle } =
|
9
7
|
createMultiStyleConfigHelpers(parts.keys);
|
10
8
|
|
11
|
-
const baseStyleLink = defineStyle({
|
9
|
+
const baseStyleLink = defineStyle((props) => ({
|
12
10
|
transitionProperty: "common",
|
13
11
|
transitionDuration: "fast",
|
14
12
|
transitionTimingFunction: "ease-out",
|
@@ -21,27 +19,30 @@ const baseStyleLink = defineStyle({
|
|
21
19
|
paddingX: 0.5,
|
22
20
|
borderRadius: "xs",
|
23
21
|
_hover: {
|
24
|
-
backgroundColor: "
|
22
|
+
backgroundColor: mode("seaMist", "pine")(props),
|
25
23
|
},
|
26
24
|
_focusVisible: {
|
27
25
|
boxShadow: getBoxShadowString({
|
28
|
-
borderColor: "greenHaze",
|
26
|
+
borderColor: mode("greenHaze", "azure")(props),
|
29
27
|
borderWidth: 2,
|
30
28
|
}),
|
29
|
+
notFocus: {
|
30
|
+
notFocus: { boxShadow: "none" },
|
31
|
+
}
|
31
32
|
},
|
32
33
|
_active: {
|
33
|
-
backgroundColor: "mint",
|
34
|
+
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
34
35
|
},
|
35
36
|
},
|
36
|
-
});
|
37
|
+
}));
|
37
38
|
|
38
|
-
const baseStyle = definePartsStyle({
|
39
|
-
link: baseStyleLink,
|
39
|
+
const baseStyle = definePartsStyle((props) => ({
|
40
|
+
link: baseStyleLink(props),
|
40
41
|
list: {
|
41
42
|
flexWrap: "wrap",
|
42
43
|
alignItems: "flex-start",
|
43
44
|
},
|
44
|
-
});
|
45
|
+
}));
|
45
46
|
|
46
47
|
export default defineMultiStyleConfig({
|
47
48
|
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,
|
@@ -20,6 +20,7 @@ export { default as InfoTag } from "./info-tag";
|
|
20
20
|
export { default as Input } from "./input";
|
21
21
|
export { default as LineIcon } from "./line-icon";
|
22
22
|
export { default as Link } from "./link";
|
23
|
+
export { default as List } from "./list";
|
23
24
|
export { default as ListBox } from "./listbox";
|
24
25
|
export { default as MediaControllerButton } from "./media-controller-button";
|
25
26
|
export { default as Modal } from "./modal";
|
@@ -34,4 +35,3 @@ export { default as Tabs } from "./tabs";
|
|
34
35
|
export { default as Textarea } from "./textarea";
|
35
36
|
export { default as Toast } from "./toast";
|
36
37
|
export { default as TravelTag } from "./travel-tag";
|
37
|
-
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
3
3
|
import { focusVisible } from "../utils/focus-utils";
|
4
|
+
import { mode } from "@chakra-ui/theme-tools";
|
4
5
|
|
5
6
|
const config = defineStyleConfig({
|
6
7
|
baseStyle: {
|
@@ -35,80 +36,79 @@ const config = defineStyleConfig({
|
|
35
36
|
},
|
36
37
|
},
|
37
38
|
variants: {
|
38
|
-
primary: {
|
39
|
-
color: "pine",
|
39
|
+
primary: (props) => ({
|
40
|
+
color: mode("pine", "seaMist")(props),
|
40
41
|
...focusVisible({
|
41
42
|
focus: {
|
42
|
-
|
43
|
-
backgroundColor: "pine",
|
43
|
+
backgroundColor: "transparent",
|
44
44
|
boxShadow: getBoxShadowString({
|
45
|
-
borderColor: "
|
46
|
-
borderWidth:
|
45
|
+
borderColor: "azure",
|
46
|
+
borderWidth: 2,
|
47
47
|
isInset: false,
|
48
48
|
}),
|
49
49
|
},
|
50
50
|
notFocus: {
|
51
51
|
color: "pine",
|
52
|
-
boxShadow: "none",
|
53
52
|
backgroundColor: "transparent",
|
53
|
+
boxShadow: "none",
|
54
54
|
},
|
55
55
|
}),
|
56
56
|
_hover: {
|
57
|
-
|
58
|
-
|
57
|
+
color: "white",
|
58
|
+
backgroundColor: "pine",
|
59
59
|
boxShadow: getBoxShadowString({
|
60
|
-
borderColor: "
|
61
|
-
borderWidth:
|
60
|
+
borderColor: "pine",
|
61
|
+
borderWidth: 2,
|
62
62
|
isInset: false,
|
63
63
|
}),
|
64
64
|
},
|
65
65
|
_active: {
|
66
|
-
|
66
|
+
color: "white",
|
67
|
+
backgroundColor: "azure",
|
67
68
|
boxShadow: getBoxShadowString({
|
68
|
-
borderColor: "
|
69
|
-
borderWidth:
|
69
|
+
borderColor: "azure",
|
70
|
+
borderWidth: 2,
|
70
71
|
isInset: false,
|
71
72
|
}),
|
72
|
-
color: "pine",
|
73
73
|
},
|
74
|
-
},
|
74
|
+
}),
|
75
75
|
secondary: (props) => ({
|
76
|
-
color: "darkGrey",
|
76
|
+
color: mode("darkGrey", "white")(props),
|
77
77
|
...focusVisible({
|
78
78
|
focus: {
|
79
|
-
|
80
|
-
backgroundColor: "darkGrey",
|
79
|
+
backgroundColor: "transparent",
|
81
80
|
boxShadow: getBoxShadowString({
|
82
|
-
borderColor: "
|
83
|
-
borderWidth:
|
81
|
+
borderColor: "azure",
|
82
|
+
borderWidth: 2,
|
84
83
|
isInset: false,
|
85
84
|
}),
|
86
85
|
},
|
87
86
|
notFocus: {
|
88
|
-
color: "darkGrey",
|
89
87
|
boxShadow: "none",
|
90
88
|
backgroundColor: "transparent",
|
91
89
|
},
|
92
90
|
}),
|
93
91
|
_hover: {
|
94
|
-
|
95
|
-
backgroundColor: "blackAlpha.100",
|
92
|
+
backgroundColor: mode("seaMist", "pine")(props),
|
96
93
|
boxShadow: getBoxShadowString({
|
97
|
-
borderColor: props
|
98
|
-
borderWidth:
|
94
|
+
borderColor: mode("seaMist", "pine")(props),
|
95
|
+
borderWidth: 2,
|
99
96
|
isInset: false,
|
100
97
|
}),
|
101
98
|
},
|
102
99
|
_active: {
|
103
|
-
|
104
|
-
backgroundColor: "mint",
|
100
|
+
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
105
101
|
boxShadow: getBoxShadowString({
|
106
|
-
borderColor: "mint",
|
107
|
-
borderWidth:
|
102
|
+
borderColor: mode("mint", "whiteAlpha.200")(props),
|
103
|
+
borderWidth: 2,
|
108
104
|
isInset: false,
|
109
105
|
}),
|
110
106
|
},
|
111
107
|
}),
|
108
|
+
/**
|
109
|
+
* @deprecated tertiary style will be deprecated in the future.
|
110
|
+
* Please use the secondary style instead.
|
111
|
+
*/
|
112
112
|
tertiary: (props) => ({
|
113
113
|
color: "white",
|
114
114
|
...focusVisible({
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { listAnatomy as parts } from "@chakra-ui/anatomy";
|
2
|
+
import {
|
3
|
+
createMultiStyleConfigHelpers,
|
4
|
+
defineStyle,
|
5
|
+
} from "@chakra-ui/styled-system";
|
6
|
+
|
7
|
+
const { defineMultiStyleConfig, definePartsStyle } =
|
8
|
+
createMultiStyleConfigHelpers(parts.keys);
|
9
|
+
|
10
|
+
const baseStyleIcon = defineStyle({
|
11
|
+
marginEnd: "2",
|
12
|
+
display: "inline",
|
13
|
+
verticalAlign: "text-bottom",
|
14
|
+
fontFamily: "body",
|
15
|
+
});
|
16
|
+
|
17
|
+
const baseStyle = definePartsStyle({
|
18
|
+
icon: baseStyleIcon,
|
19
|
+
});
|
20
|
+
|
21
|
+
export default defineMultiStyleConfig({
|
22
|
+
baseStyle,
|
23
|
+
});
|