@vygruppen/spor-react 6.2.3 → 7.0.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +22 -0
- package/dist/{CountryCodeSelect-QZYP3GSD.mjs → CountryCodeSelect-EKQUBVBJ.mjs} +1 -1
- package/dist/{chunk-YFZOYRGT.mjs → chunk-CSCLMQYA.mjs} +183 -654
- package/dist/index.d.mts +502 -496
- package/dist/index.d.ts +502 -496
- package/dist/index.js +212 -685
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/button/Button.tsx +4 -4
- package/src/input/NumericStepper.tsx +0 -4
- package/src/stepper/Stepper.tsx +1 -1
- package/src/stepper/StepperStep.tsx +1 -1
- package/src/theme/components/accordion.ts +4 -15
- package/src/theme/components/breadcrumb.ts +2 -14
- package/src/theme/components/button.ts +8 -58
- package/src/theme/components/card-select.ts +11 -26
- package/src/theme/components/card.ts +2 -18
- package/src/theme/components/checkbox.ts +4 -12
- package/src/theme/components/choice-chip.ts +2 -11
- package/src/theme/components/close-button.ts +2 -14
- package/src/theme/components/code.ts +1 -1
- package/src/theme/components/datepicker.ts +14 -65
- package/src/theme/components/drawer.ts +7 -7
- package/src/theme/components/fab.ts +12 -65
- package/src/theme/components/form-label.ts +1 -1
- package/src/theme/components/form.ts +1 -1
- package/src/theme/components/info-select.ts +5 -35
- package/src/theme/components/info-tag.ts +1 -1
- package/src/theme/components/input.ts +9 -31
- package/src/theme/components/link.ts +5 -29
- package/src/theme/components/listbox.ts +3 -5
- package/src/theme/components/media-controller-button.ts +5 -46
- package/src/theme/components/modal.ts +7 -7
- package/src/theme/components/popover.ts +7 -15
- package/src/theme/components/progress-indicator.ts +2 -6
- package/src/theme/components/radio.ts +5 -11
- package/src/theme/components/select.ts +2 -2
- package/src/theme/components/stepper.ts +11 -11
- package/src/theme/components/switch.ts +5 -73
- package/src/theme/components/table.ts +18 -18
- package/src/theme/components/tabs.ts +11 -14
- package/src/theme/components/travel-tag.ts +2 -15
- package/src/theme/utils/focus-util.ts +10 -0
- package/tsconfig.json +2 -2
- package/src/theme/utils/focus-utils.ts +0 -16
@@ -28,9 +28,9 @@ const config = helpers.defineMultiStyleConfig({
|
|
28
28
|
boxShadow: "md",
|
29
29
|
},
|
30
30
|
header: {
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
paddingX: 5,
|
32
|
+
paddingTop: 6,
|
33
|
+
paddingBottom: 2,
|
34
34
|
fontWeight: "bold",
|
35
35
|
fontFamily: "body",
|
36
36
|
},
|
@@ -41,14 +41,14 @@ const config = helpers.defineMultiStyleConfig({
|
|
41
41
|
insetEnd: 3,
|
42
42
|
},
|
43
43
|
body: {
|
44
|
-
|
45
|
-
|
44
|
+
paddingX: 5,
|
45
|
+
paddingBottom: 6,
|
46
46
|
flex: 1,
|
47
47
|
overflow: props.scrollBehavior === "inside" ? "auto" : undefined,
|
48
48
|
},
|
49
49
|
footer: {
|
50
|
-
|
51
|
-
|
50
|
+
paddingX: 3,
|
51
|
+
paddingBottom: 3,
|
52
52
|
},
|
53
53
|
}),
|
54
54
|
sizes: {
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { popoverAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { cssVar, mode } from "@chakra-ui/theme-tools";
|
4
|
-
import {
|
5
|
-
import { focusVisible } from "../utils/focus-utils";
|
4
|
+
import { focusVisibleStyles } from "../utils/focus-util";
|
6
5
|
|
7
6
|
const $popperBg = cssVar("popper-bg");
|
8
7
|
const $arrowBg = cssVar("popper-arrow-bg");
|
@@ -22,7 +21,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
22
21
|
[$arrowShadowColor.variable]: `colors.blackAlpha.300`,
|
23
22
|
color: "white",
|
24
23
|
borderRadius: "sm",
|
25
|
-
|
24
|
+
padding: 1.5,
|
26
25
|
zIndex: "inherit",
|
27
26
|
maxWidth: "20em",
|
28
27
|
_focus: {
|
@@ -40,14 +39,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
40
39
|
position: "absolute",
|
41
40
|
color: "white",
|
42
41
|
hover: "whiteAlpha.100",
|
43
|
-
...
|
44
|
-
focus: {
|
45
|
-
boxShadow: getBoxShadowString({ borderColor: "azure" }),
|
46
|
-
},
|
47
|
-
notFocus: {
|
48
|
-
boxShadow: "none",
|
49
|
-
},
|
50
|
-
}),
|
42
|
+
...focusVisibleStyles(props),
|
51
43
|
_active: {
|
52
44
|
backgroundColor: "whiteAlpha.200",
|
53
45
|
},
|
@@ -62,14 +54,14 @@ const config = helpers.defineMultiStyleConfig({
|
|
62
54
|
sizes: {
|
63
55
|
sm: {
|
64
56
|
content: {
|
65
|
-
|
66
|
-
|
57
|
+
paddingX: 1.5,
|
58
|
+
paddingY: 1,
|
67
59
|
},
|
68
60
|
},
|
69
61
|
lg: {
|
70
62
|
content: {
|
71
|
-
|
72
|
-
|
63
|
+
paddingX: 3,
|
64
|
+
paddingY: 2,
|
73
65
|
},
|
74
66
|
},
|
75
67
|
},
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
|
-
import { anatomy, mode
|
2
|
+
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
3
3
|
|
4
4
|
const parts = anatomy("progress-indicator").parts(
|
5
5
|
"root",
|
@@ -29,14 +29,10 @@ const config = helpers.defineMultiStyleConfig({
|
|
29
29
|
},
|
30
30
|
},
|
31
31
|
circle: {
|
32
|
-
fill: mode("blackAlpha.
|
32
|
+
fill: mode("blackAlpha.200", "whiteAlpha.200")(props),
|
33
33
|
},
|
34
34
|
},
|
35
35
|
}),
|
36
|
-
|
37
|
-
variants: {
|
38
|
-
base: (props) => ({}),
|
39
|
-
},
|
40
36
|
defaultProps: {
|
41
37
|
variant: "base",
|
42
38
|
},
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { radioAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
+
import { focusVisibleStyles } from "../utils/focus-util";
|
3
4
|
|
4
5
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
5
6
|
|
6
7
|
const config = helpers.defineMultiStyleConfig({
|
7
|
-
baseStyle: {
|
8
|
+
baseStyle: (props) => ({
|
8
9
|
container: {
|
9
10
|
_hover: {
|
10
11
|
"input:enabled + .chakra-radio__control": {
|
@@ -28,10 +29,8 @@ const config = helpers.defineMultiStyleConfig({
|
|
28
29
|
borderColor: "primaryGreen",
|
29
30
|
borderRadius: "50%",
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
borderColor: "azure",
|
34
|
-
},
|
32
|
+
...focusVisibleStyles(props),
|
33
|
+
|
35
34
|
_disabled: {
|
36
35
|
backgroundColor: "lightGrey",
|
37
36
|
borderColor: "steel",
|
@@ -48,17 +47,12 @@ const config = helpers.defineMultiStyleConfig({
|
|
48
47
|
borderRadius: "50%",
|
49
48
|
background: "currentColor",
|
50
49
|
},
|
51
|
-
|
52
|
-
_focus: {
|
53
|
-
backgroundColor: "white",
|
54
|
-
color: "azure",
|
55
|
-
},
|
56
50
|
_disabled: {
|
57
51
|
backgroundColor: "lightGrey",
|
58
52
|
borderColor: "steel",
|
59
53
|
},
|
60
54
|
},
|
61
55
|
},
|
62
|
-
},
|
56
|
+
}),
|
63
57
|
});
|
64
58
|
export default config;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { selectAnatomy } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { default as Input } from "./input";
|
4
3
|
import { mode } from "@chakra-ui/theme-tools";
|
4
|
+
import { default as Input } from "./input";
|
5
5
|
|
6
6
|
const parts = selectAnatomy.extend("root");
|
7
7
|
|
@@ -19,7 +19,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
19
19
|
left: 3,
|
20
20
|
zIndex: 2,
|
21
21
|
position: "absolute",
|
22
|
-
|
22
|
+
marginY: 2,
|
23
23
|
transformOrigin: "top left",
|
24
24
|
transform: [
|
25
25
|
"scale(0.825) translateY(-12px)",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
|
-
import { anatomy, mode
|
2
|
+
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
3
3
|
|
4
4
|
const parts = anatomy("stepper").parts(
|
5
5
|
"root",
|
@@ -18,30 +18,30 @@ const parts = anatomy("stepper").parts(
|
|
18
18
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
19
19
|
|
20
20
|
const config = helpers.defineMultiStyleConfig({
|
21
|
-
baseStyle:
|
21
|
+
baseStyle: {
|
22
22
|
root: {
|
23
23
|
display: "flex",
|
24
24
|
alignItems: "center",
|
25
|
-
justifyContent: ["space-between", "center"],
|
26
|
-
minHeight: ["48px", "60px"],
|
25
|
+
justifyContent: ["space-between", null, "center"],
|
26
|
+
minHeight: ["48px", null, "60px"],
|
27
27
|
overflowX: "auto",
|
28
28
|
width: "100%",
|
29
29
|
},
|
30
30
|
container: {
|
31
|
-
|
31
|
+
paddingX: [2, null, null, 0],
|
32
32
|
maxWidth: "container.lg",
|
33
|
-
|
33
|
+
marginX: "auto",
|
34
34
|
width: "100%",
|
35
35
|
},
|
36
36
|
innerContainer: {
|
37
37
|
overflow: "hidden",
|
38
|
-
display: ["flex", "none"],
|
38
|
+
display: ["flex", null, "none"],
|
39
39
|
alignItems: "center",
|
40
40
|
justifyContent: "space-between",
|
41
41
|
},
|
42
42
|
backButton: {
|
43
43
|
borderRadius: "xs",
|
44
|
-
|
44
|
+
paddingX: 0,
|
45
45
|
width: "auto",
|
46
46
|
minWidth: "auto",
|
47
47
|
},
|
@@ -51,7 +51,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
51
51
|
WebkitLineClamp: 2,
|
52
52
|
display: "-webkit-box",
|
53
53
|
WebkitBoxOrient: "vertical",
|
54
|
-
|
54
|
+
marginLeft: 2,
|
55
55
|
textAlign: "right",
|
56
56
|
},
|
57
57
|
stepContainer: {
|
@@ -62,9 +62,9 @@ const config = helpers.defineMultiStyleConfig({
|
|
62
62
|
textStyle: "sm",
|
63
63
|
whiteSpace: "nowrap",
|
64
64
|
},
|
65
|
-
}
|
65
|
+
},
|
66
66
|
variants: {
|
67
|
-
base: (
|
67
|
+
base: () => ({
|
68
68
|
root: {
|
69
69
|
backgroundColor: "transparent",
|
70
70
|
},
|
@@ -3,7 +3,7 @@ import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
3
3
|
import { calc, cssVar, mode } from "@chakra-ui/theme-tools";
|
4
4
|
import { colors } from "../foundations";
|
5
5
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
6
|
-
import {
|
6
|
+
import { focusVisibleStyles } from "../utils/focus-util";
|
7
7
|
|
8
8
|
const $width = cssVar("switch-track-width");
|
9
9
|
const $height = cssVar("switch-track-height");
|
@@ -53,38 +53,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
53
53
|
borderColor: colors.whiteAlpha[400],
|
54
54
|
}),
|
55
55
|
)({ colorMode }),
|
56
|
-
|
57
|
-
...focusVisible({
|
58
|
-
focus: {
|
59
|
-
boxShadow: mode(
|
60
|
-
getBoxShadowString([
|
61
|
-
{
|
62
|
-
borderColor: "white",
|
63
|
-
borderWidth: 2,
|
64
|
-
isInset: false,
|
65
|
-
},
|
66
|
-
{
|
67
|
-
borderColor: "primaryGreen",
|
68
|
-
borderWidth: 4,
|
69
|
-
isInset: false,
|
70
|
-
},
|
71
|
-
]),
|
72
|
-
getBoxShadowString({
|
73
|
-
borderColor: "coralGreen",
|
74
|
-
borderWidth: 2,
|
75
|
-
isInset: false,
|
76
|
-
}),
|
77
|
-
)({ colorMode }),
|
78
|
-
},
|
79
|
-
notFocus: {
|
80
|
-
boxShadow: mode(
|
81
|
-
"none",
|
82
|
-
getBoxShadowString({
|
83
|
-
borderColor: colors.whiteAlpha[400],
|
84
|
-
}),
|
85
|
-
)({ colorMode }),
|
86
|
-
},
|
87
|
-
}),
|
56
|
+
...focusVisibleStyles({ colorMode }),
|
88
57
|
_hover: {
|
89
58
|
backgroundColor: "steel",
|
90
59
|
boxShadow: mode(
|
@@ -94,35 +63,6 @@ const config = helpers.defineMultiStyleConfig({
|
|
94
63
|
},
|
95
64
|
_checked: {
|
96
65
|
backgroundColor: mode("darkTeal", "celadon")({ colorMode }),
|
97
|
-
...focusVisible({
|
98
|
-
focus: {
|
99
|
-
boxShadow: mode(
|
100
|
-
getBoxShadowString([
|
101
|
-
{
|
102
|
-
borderColor: "white",
|
103
|
-
borderWidth: 2,
|
104
|
-
isInset: false,
|
105
|
-
},
|
106
|
-
{
|
107
|
-
borderColor: "primaryGreen",
|
108
|
-
borderWidth: 4,
|
109
|
-
isInset: false,
|
110
|
-
},
|
111
|
-
]),
|
112
|
-
getBoxShadowString({
|
113
|
-
borderWidth: 2,
|
114
|
-
borderColor: "coralGreen",
|
115
|
-
isInset: false,
|
116
|
-
}),
|
117
|
-
)({ colorMode }),
|
118
|
-
},
|
119
|
-
notFocus: {
|
120
|
-
boxShadow: mode(
|
121
|
-
"none",
|
122
|
-
getBoxShadowString({ borderColor: colors.white }),
|
123
|
-
)({ colorMode }),
|
124
|
-
},
|
125
|
-
}),
|
126
66
|
|
127
67
|
_hover: {
|
128
68
|
backgroundColor: mode("pine", "river")({ colorMode }),
|
@@ -161,10 +101,6 @@ const config = helpers.defineMultiStyleConfig({
|
|
161
101
|
boxShadow: getBoxShadowString({
|
162
102
|
borderColor: colors.blackAlpha["400"],
|
163
103
|
}),
|
164
|
-
_focus: {
|
165
|
-
backgroundColor: "platinum",
|
166
|
-
boxShadow: `0 0 0 2px ${colors.greenHaze}`,
|
167
|
-
},
|
168
104
|
_hover: {
|
169
105
|
backgroundColor: "white",
|
170
106
|
},
|
@@ -173,10 +109,6 @@ const config = helpers.defineMultiStyleConfig({
|
|
173
109
|
_hover: {
|
174
110
|
backgroundColor: "mint",
|
175
111
|
},
|
176
|
-
_focus: {
|
177
|
-
backgroundColor: "white",
|
178
|
-
boxShadow: `0 0 0 4px ${colors.greenHaze}, 0 0 0 2px ${colors.white}`,
|
179
|
-
},
|
180
112
|
},
|
181
113
|
},
|
182
114
|
thumb: {
|
@@ -196,7 +128,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
196
128
|
},
|
197
129
|
track: {
|
198
130
|
borderRadius: "24px",
|
199
|
-
|
131
|
+
padding: "2px",
|
200
132
|
},
|
201
133
|
},
|
202
134
|
md: {
|
@@ -206,7 +138,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
206
138
|
},
|
207
139
|
track: {
|
208
140
|
borderRadius: "30px",
|
209
|
-
|
141
|
+
padding: "3px",
|
210
142
|
},
|
211
143
|
},
|
212
144
|
lg: {
|
@@ -216,7 +148,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
216
148
|
},
|
217
149
|
track: {
|
218
150
|
borderRadius: "36px",
|
219
|
-
|
151
|
+
padding: "3px",
|
220
152
|
},
|
221
153
|
},
|
222
154
|
},
|
@@ -106,16 +106,16 @@ const config = helpers.defineMultiStyleConfig({
|
|
106
106
|
fontSize: ["mobile.xs", "desktop.xs"],
|
107
107
|
},
|
108
108
|
th: {
|
109
|
-
|
110
|
-
|
109
|
+
paddingX: 3,
|
110
|
+
paddingY: 1.5,
|
111
111
|
},
|
112
112
|
td: {
|
113
|
-
|
114
|
-
|
113
|
+
paddingX: 3,
|
114
|
+
paddingY: 1.5,
|
115
115
|
},
|
116
116
|
caption: {
|
117
|
-
|
118
|
-
|
117
|
+
paddingX: 3,
|
118
|
+
paddingY: 1.5,
|
119
119
|
},
|
120
120
|
},
|
121
121
|
md: {
|
@@ -123,16 +123,16 @@ const config = helpers.defineMultiStyleConfig({
|
|
123
123
|
fontSize: ["mobile.sm", "desktop.sm"],
|
124
124
|
},
|
125
125
|
th: {
|
126
|
-
|
127
|
-
|
126
|
+
paddingX: 3,
|
127
|
+
paddingY: 1.5,
|
128
128
|
},
|
129
129
|
td: {
|
130
|
-
|
131
|
-
|
130
|
+
paddingX: 3,
|
131
|
+
paddingY: 1.5,
|
132
132
|
},
|
133
133
|
caption: {
|
134
|
-
|
135
|
-
|
134
|
+
paddingX: 3,
|
135
|
+
paddingY: 1.5,
|
136
136
|
},
|
137
137
|
},
|
138
138
|
lg: {
|
@@ -140,16 +140,16 @@ const config = helpers.defineMultiStyleConfig({
|
|
140
140
|
fontSize: ["mobile.sm", "desktop.sm"],
|
141
141
|
},
|
142
142
|
th: {
|
143
|
-
|
144
|
-
|
143
|
+
paddingX: 3,
|
144
|
+
paddingY: "15px",
|
145
145
|
},
|
146
146
|
td: {
|
147
|
-
|
148
|
-
|
147
|
+
paddingX: 3,
|
148
|
+
paddingY: "15px",
|
149
149
|
},
|
150
150
|
caption: {
|
151
|
-
|
152
|
-
|
151
|
+
paddingX: 3,
|
152
|
+
paddingY: "15px",
|
153
153
|
},
|
154
154
|
},
|
155
155
|
},
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { tabsAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { mode, type StyleFunctionProps } from "@chakra-ui/theme-tools";
|
4
|
+
import { focusVisibleStyles } from "../utils/focus-util";
|
4
5
|
|
5
6
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
6
7
|
|
@@ -33,11 +34,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
33
34
|
pointerEvents: "none",
|
34
35
|
...getTabColorSchemeSelectedProps(props),
|
35
36
|
},
|
36
|
-
|
37
|
-
":focus:not(:focus-visible)": {
|
38
|
-
boxShadow: "none",
|
39
|
-
},
|
40
|
-
_focusVisible: getTabColorSchemeFocusProps(props),
|
37
|
+
...focusVisibleStyles(props),
|
41
38
|
_hover: getTabColorSchemeHoverProps(props),
|
42
39
|
_active: getTabColorSchemeActiveProps(props),
|
43
40
|
_disabled: getTabColorSchemeDisabledProps(props),
|
@@ -66,40 +63,40 @@ const config = helpers.defineMultiStyleConfig({
|
|
66
63
|
sm: {
|
67
64
|
tablist: {
|
68
65
|
height: "30px",
|
69
|
-
|
66
|
+
padding: "2px",
|
70
67
|
},
|
71
68
|
tab: {
|
72
|
-
|
73
|
-
|
69
|
+
paddingX: 2,
|
70
|
+
paddingY: 0,
|
74
71
|
},
|
75
72
|
},
|
76
73
|
md: {
|
77
74
|
tablist: {
|
78
75
|
height: "36px",
|
79
|
-
|
76
|
+
padding: 0.5,
|
80
77
|
},
|
81
78
|
tab: {
|
82
|
-
|
79
|
+
paddingX: 2,
|
83
80
|
},
|
84
81
|
},
|
85
82
|
lg: {
|
86
83
|
tablist: {
|
87
84
|
height: "42px",
|
88
|
-
|
85
|
+
padding: 0.5,
|
89
86
|
},
|
90
87
|
tab: {
|
91
88
|
fontWeight: "bold",
|
92
|
-
|
89
|
+
paddingX: 2,
|
93
90
|
},
|
94
91
|
},
|
95
92
|
xl: {
|
96
93
|
tablist: {
|
97
94
|
height: "54px",
|
98
|
-
|
95
|
+
padding: "4px",
|
99
96
|
},
|
100
97
|
tab: {
|
101
98
|
fontWeight: "bold",
|
102
|
-
|
99
|
+
paddingX: 3,
|
103
100
|
},
|
104
101
|
},
|
105
102
|
},
|
@@ -2,7 +2,7 @@ import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
|
2
2
|
import type { StyleFunctionProps } from "@chakra-ui/theme-tools";
|
3
3
|
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
4
4
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
5
|
-
import {
|
5
|
+
import { focusVisibleStyles } from "../utils/focus-util";
|
6
6
|
|
7
7
|
const parts = anatomy("travel-tag").parts(
|
8
8
|
"container",
|
@@ -37,20 +37,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
37
37
|
baseShadow: "sm",
|
38
38
|
}),
|
39
39
|
},
|
40
|
-
...
|
41
|
-
focus: {
|
42
|
-
outline: "none",
|
43
|
-
borderColor: "transparent",
|
44
|
-
boxShadow: getBoxShadowString({
|
45
|
-
borderWidth: 2,
|
46
|
-
borderColor: "darkGrey",
|
47
|
-
}),
|
48
|
-
},
|
49
|
-
notFocus: {
|
50
|
-
boxShadow: "none",
|
51
|
-
borderColor: getDeviationBorderColor(props),
|
52
|
-
},
|
53
|
-
}),
|
40
|
+
...focusVisibleStyles(props),
|
54
41
|
_active: {
|
55
42
|
opacity: 0.5,
|
56
43
|
boxShadow: "none",
|
package/tsconfig.json
CHANGED
@@ -1,16 +0,0 @@
|
|
1
|
-
import { SystemStyleObject } from "@chakra-ui/theme-tools";
|
2
|
-
|
3
|
-
type FocusArgs = {
|
4
|
-
/** The styles applied for when the element is not focused */
|
5
|
-
notFocus: SystemStyleObject;
|
6
|
-
/** The styles applied for when the element is focused */
|
7
|
-
focus: SystemStyleObject;
|
8
|
-
};
|
9
|
-
/**
|
10
|
-
* A helper function for applying focus styles in such a way that they work with Safari – which doesn't support :focus-visible.
|
11
|
-
*/
|
12
|
-
export const focusVisible = ({ notFocus, focus }: FocusArgs) => ({
|
13
|
-
_focus: focus,
|
14
|
-
_focusVisible: focus,
|
15
|
-
"&[data-focus]:not([data-focus-visible])": notFocus,
|
16
|
-
});
|