@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.
Files changed (46) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CHANGELOG.md +22 -0
  3. package/dist/{CountryCodeSelect-QZYP3GSD.mjs → CountryCodeSelect-EKQUBVBJ.mjs} +1 -1
  4. package/dist/{chunk-YFZOYRGT.mjs → chunk-CSCLMQYA.mjs} +183 -654
  5. package/dist/index.d.mts +502 -496
  6. package/dist/index.d.ts +502 -496
  7. package/dist/index.js +212 -685
  8. package/dist/index.mjs +1 -1
  9. package/package.json +1 -1
  10. package/src/button/Button.tsx +4 -4
  11. package/src/input/NumericStepper.tsx +0 -4
  12. package/src/stepper/Stepper.tsx +1 -1
  13. package/src/stepper/StepperStep.tsx +1 -1
  14. package/src/theme/components/accordion.ts +4 -15
  15. package/src/theme/components/breadcrumb.ts +2 -14
  16. package/src/theme/components/button.ts +8 -58
  17. package/src/theme/components/card-select.ts +11 -26
  18. package/src/theme/components/card.ts +2 -18
  19. package/src/theme/components/checkbox.ts +4 -12
  20. package/src/theme/components/choice-chip.ts +2 -11
  21. package/src/theme/components/close-button.ts +2 -14
  22. package/src/theme/components/code.ts +1 -1
  23. package/src/theme/components/datepicker.ts +14 -65
  24. package/src/theme/components/drawer.ts +7 -7
  25. package/src/theme/components/fab.ts +12 -65
  26. package/src/theme/components/form-label.ts +1 -1
  27. package/src/theme/components/form.ts +1 -1
  28. package/src/theme/components/info-select.ts +5 -35
  29. package/src/theme/components/info-tag.ts +1 -1
  30. package/src/theme/components/input.ts +9 -31
  31. package/src/theme/components/link.ts +5 -29
  32. package/src/theme/components/listbox.ts +3 -5
  33. package/src/theme/components/media-controller-button.ts +5 -46
  34. package/src/theme/components/modal.ts +7 -7
  35. package/src/theme/components/popover.ts +7 -15
  36. package/src/theme/components/progress-indicator.ts +2 -6
  37. package/src/theme/components/radio.ts +5 -11
  38. package/src/theme/components/select.ts +2 -2
  39. package/src/theme/components/stepper.ts +11 -11
  40. package/src/theme/components/switch.ts +5 -73
  41. package/src/theme/components/table.ts +18 -18
  42. package/src/theme/components/tabs.ts +11 -14
  43. package/src/theme/components/travel-tag.ts +2 -15
  44. package/src/theme/utils/focus-util.ts +10 -0
  45. package/tsconfig.json +2 -2
  46. package/src/theme/utils/focus-utils.ts +0 -16
@@ -2,7 +2,7 @@ import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy, cssVar, mode } from "@chakra-ui/theme-tools";
3
3
  import { colors, zIndices } from "../foundations";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
- import { focusVisible } from "../utils/focus-utils";
5
+ import { focusVisibleStyles } from "../utils/focus-util";
6
6
 
7
7
  const parts = anatomy("datepicker").parts(
8
8
  "wrapper",
@@ -40,6 +40,9 @@ const config = helpers.defineMultiStyleConfig({
40
40
  _disabled: {
41
41
  pointerEvents: "none",
42
42
  },
43
+ _focusWithin: {
44
+ ...focusVisibleStyles(props)._focusVisible,
45
+ },
43
46
  },
44
47
  inputLabel: {
45
48
  fontSize: "mobile.xs",
@@ -55,7 +58,10 @@ const config = helpers.defineMultiStyleConfig({
55
58
  },
56
59
  calendarTriggerButton: {
57
60
  backgroundColor: mode("white", "night")(props),
58
- boxShadow: "none",
61
+ boxShadow: getBoxShadowString({
62
+ borderColor: mode("darkGrey", "white")(props),
63
+ borderWidth: 1,
64
+ }),
59
65
  width: 8,
60
66
  display: "flex",
61
67
  alignItems: "center",
@@ -76,21 +82,7 @@ const config = helpers.defineMultiStyleConfig({
76
82
  _active: {
77
83
  backgroundColor: mode("mint", "whiteAlpha.200")(props),
78
84
  },
79
- ...focusVisible({
80
- focus: {
81
- outline: "none",
82
- boxShadow: getBoxShadowString({
83
- borderColor: mode("greenHaze", "azure")(props),
84
- borderWidth: 2,
85
- }),
86
- },
87
- notFocus: {
88
- boxShadow: getBoxShadowString({
89
- borderColor: mode("darkGrey", "white")(props),
90
- borderWidth: 1,
91
- }),
92
- },
93
- }),
85
+ ...focusVisibleStyles(props),
94
86
  _invalid: {
95
87
  boxShadow: getBoxShadowString({
96
88
  borderColor: "brightRed",
@@ -110,7 +102,6 @@ const config = helpers.defineMultiStyleConfig({
110
102
  baseShadow: "md",
111
103
  }),
112
104
  },
113
-
114
105
  weekdays: {
115
106
  color: mode("darkGrey", "white")(props),
116
107
  },
@@ -132,27 +123,11 @@ const config = helpers.defineMultiStyleConfig({
132
123
  _hover: {
133
124
  backgroundColor: mode("seaMist", "pine")(props),
134
125
  },
135
- ...focusVisible({
136
- focus: {
137
- outline: "none",
138
- boxShadow: getBoxShadowString({
139
- borderWidth: 2,
140
- borderColor: mode("greenHaze", "azure")(props),
141
- }),
142
- },
143
- notFocus: {
144
- boxShadow: "none",
145
- _hover: {
146
- boxShadow: getBoxShadowString({
147
- borderWidth: 2,
148
- borderColor: "osloGrey",
149
- }),
150
- },
151
- _active: {
152
- color: mode("darkGrey", "white")(props),
153
- },
154
- },
155
- }),
126
+ _focusVisible: {
127
+ outlineColor: "greenHaze",
128
+ outlineWidth: 2,
129
+ outlineStyle: "solid",
130
+ },
156
131
  _active: {
157
132
  backgroundColor: "seaMist",
158
133
  boxShadow: "none",
@@ -177,13 +152,6 @@ const config = helpers.defineMultiStyleConfig({
177
152
  borderWidth: 1,
178
153
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
179
154
  }),
180
- _focus: {
181
- outline: "none",
182
- boxShadow: getBoxShadowString({
183
- borderWidth: 2,
184
- borderColor: mode("greenHaze", "azure")(props),
185
- }),
186
- },
187
155
  },
188
156
  "&[data-unavailable]": {
189
157
  pointerEvents: "none",
@@ -203,12 +171,6 @@ const config = helpers.defineMultiStyleConfig({
203
171
  borderWidth: 2,
204
172
  }),
205
173
  },
206
- _focusWithin: {
207
- boxShadow: getBoxShadowString({
208
- borderColor: mode("greenHaze", "azure")(props),
209
- borderWidth: 2,
210
- }),
211
- },
212
174
  _invalid: {
213
175
  boxShadow: getBoxShadowString({
214
176
  borderColor: "brightRed",
@@ -262,13 +224,6 @@ const config = helpers.defineMultiStyleConfig({
262
224
  baseShadow: "sm",
263
225
  }),
264
226
  },
265
- _focusWithin: {
266
- boxShadow: getBoxShadowString({
267
- borderColor: mode("greenHaze", "azure")(props),
268
- borderWidth: 2,
269
- baseShadow: "sm",
270
- }),
271
- },
272
227
  _invalid: {
273
228
  boxShadow: getBoxShadowString({
274
229
  borderColor: "brightRed",
@@ -315,12 +270,6 @@ const config = helpers.defineMultiStyleConfig({
315
270
  borderWidth: 2,
316
271
  }),
317
272
  },
318
- _focusWithin: {
319
- boxShadow: getBoxShadowString({
320
- borderColor: mode("greenHaze", "azure")(props),
321
- borderWidth: 2,
322
- }),
323
- },
324
273
  _invalid: {
325
274
  boxShadow: getBoxShadowString({
326
275
  borderColor: "brightRed",
@@ -27,9 +27,9 @@ const config = helpers.defineMultiStyleConfig({
27
27
  boxShadow: "md",
28
28
  },
29
29
  header: {
30
- px: 3,
31
- pt: 6,
32
- pb: 2,
30
+ paddingX: 3,
31
+ paddingTop: 6,
32
+ paddingBottom: 2,
33
33
  fontWeight: "bold",
34
34
  fontFamily: "body",
35
35
  },
@@ -40,14 +40,14 @@ const config = helpers.defineMultiStyleConfig({
40
40
  zIndex: "modal",
41
41
  },
42
42
  body: {
43
- px: 3,
44
- pb: 6,
43
+ paddingX: 3,
44
+ paddingBottom: 6,
45
45
  flex: 1,
46
46
  overflow: props.scrollBehavior === "inside" ? "auto" : undefined,
47
47
  },
48
48
  footer: {
49
- px: 3,
50
- pb: 3,
49
+ paddingX: 3,
50
+ paddingBottom: 3,
51
51
  },
52
52
  }),
53
53
  sizes: {
@@ -1,7 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy, mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
3
- import { getBoxShadowString } from "../utils/box-shadow-utils";
4
- import { focusVisible } from "../utils/focus-utils";
3
+ import { focusVisibleStyles } from "../utils/focus-util";
5
4
 
6
5
  const parts = anatomy("fab").parts("container", "icon", "text");
7
6
 
@@ -11,9 +10,9 @@ const config = helpers.defineMultiStyleConfig({
11
10
  container: {
12
11
  display: "flex",
13
12
  alignItems: "center",
14
- py: 2,
15
- pl: 2,
16
- pr: props.isTextVisible ? 3 : 2,
13
+ paddingY: 2,
14
+ paddingLeft: 2,
15
+ paddingRight: props.isTextVisible ? 3 : 2,
17
16
  cursor: "pointer",
18
17
  overflowX: "hidden",
19
18
  whiteSpace: "nowrap",
@@ -24,28 +23,21 @@ const config = helpers.defineMultiStyleConfig({
24
23
  position: "fixed",
25
24
  ...getPositionProps(props),
26
25
  _disabled: {
27
- backgroundColor: "whiteAlpha.400",
28
- color: "white",
26
+ backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
27
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props),
29
28
  },
30
- ...focusVisible({
31
- focus: {
32
- boxShadow: getBoxShadowString({
33
- borderColor: "greenHaze",
34
- borderWidth: 2,
35
- baseShadow: "md",
36
- }),
37
- },
38
- notFocus: {
39
- boxShadow: "md",
40
- },
41
- }),
29
+ ...focusVisibleStyles(props),
42
30
  _hover: {
43
31
  backgroundColor: "seaMist",
32
+ _disabled: {
33
+ backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
34
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props),
35
+ },
44
36
  },
45
37
  zIndex: "sticky",
46
38
  },
47
39
  icon: {
48
- mr: props.isTextVisible ? 1 : 0,
40
+ marginRight: props.isTextVisible ? 1 : 0,
49
41
  },
50
42
  text: {
51
43
  display: "flex",
@@ -64,15 +56,6 @@ const config = helpers.defineMultiStyleConfig({
64
56
  _hover: {
65
57
  backgroundColor: "night",
66
58
  },
67
- ...focusVisible({
68
- focus: {
69
- boxShadow: `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.darkTeal}, inset 0 0 0 6px ${props.theme.colors.white}`,
70
- outline: "none",
71
- },
72
- notFocus: {
73
- boxShadow: "md",
74
- },
75
- }),
76
59
  },
77
60
  }),
78
61
  light: {
@@ -97,18 +80,6 @@ const config = helpers.defineMultiStyleConfig({
97
80
  _hover: {
98
81
  backgroundColor: mode("night", "seaMist")(props),
99
82
  },
100
- ...focusVisible({
101
- focus: {
102
- boxShadow: mode(
103
- `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.darkTeal}, inset 0 0 0 6px ${props.theme.colors.white}`,
104
- `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.mint}, inset 0 0 0 6px ${props.theme.colors.darkTeal}`,
105
- )(props),
106
- outline: "none",
107
- },
108
- notFocus: {
109
- boxShadow: "md",
110
- },
111
- }),
112
83
  },
113
84
  }),
114
85
  base: (props) => ({
@@ -127,18 +98,6 @@ const config = helpers.defineMultiStyleConfig({
127
98
  )(props),
128
99
  color: mode("darkGrey", "white")(props),
129
100
  },
130
- ...focusVisible({
131
- focus: {
132
- boxShadow: mode(
133
- `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.white}, inset 0 0 0 6px ${props.theme.colors.darkGrey}`,
134
- `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.brightRed}, inset 0 0 0 6px ${props.theme.colors.white}`,
135
- )(props),
136
- outline: "none",
137
- },
138
- notFocus: {
139
- boxShadow: "md",
140
- },
141
- }),
142
101
  },
143
102
  }),
144
103
  accent: (props) => ({
@@ -153,18 +112,6 @@ const config = helpers.defineMultiStyleConfig({
153
112
  backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
154
113
  color: mode("darkTeal", "white")(props),
155
114
  },
156
- ...focusVisible({
157
- focus: {
158
- boxShadow: mode(
159
- `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.mint}, inset 0 0 0 6px ${props.theme.colors.azure}`,
160
- `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.pine}, inset 0 0 0 6px ${props.theme.colors.azure}`,
161
- )(props),
162
- outline: "none",
163
- },
164
- notFocus: {
165
- boxShadow: "md",
166
- },
167
- }),
168
115
  },
169
116
  }),
170
117
  },
@@ -4,7 +4,7 @@ const config = defineStyleConfig({
4
4
  baseStyle: {
5
5
  fontSize: "mobile.sm",
6
6
  marginEnd: 3,
7
- mb: 2,
7
+ marginBottom: 2,
8
8
  transitionProperty: "common",
9
9
  transitionDuration: "normal",
10
10
  opacity: 1,
@@ -17,7 +17,7 @@ const config = helpers.defineMultiStyleConfig({
17
17
  color: mode("brightRed", "lightRed")(props),
18
18
  },
19
19
  helperText: {
20
- mt: 2,
20
+ marginTop: 2,
21
21
  color: mode("dimGrey", "whiteAlpha.600")(props),
22
22
  lineHeight: "normal",
23
23
  fontSize: "sm",
@@ -1,10 +1,9 @@
1
1
  import { anatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
- import { focusVisible } from "../utils/focus-utils";
4
- import { srOnly } from "../utils/sr-utils";
5
- import { baseBorder, floatingBorder } from "../utils/border-utils";
6
3
  import { baseBackground, floatingBackground } from "../utils/background-utils";
7
- import { PartsStyleInterpolation } from "@chakra-ui/styled-system";
4
+ import { baseBorder, floatingBorder } from "../utils/border-utils";
5
+ import { focusVisibleStyles } from "../utils/focus-util";
6
+ import { srOnly } from "../utils/sr-utils";
8
7
 
9
8
  const parts = anatomy("InfoSelect").parts(
10
9
  "container",
@@ -36,15 +35,7 @@ const config = helpers.defineMultiStyleConfig({
36
35
  _hover: {
37
36
  ...baseBorder("hover", props),
38
37
  },
39
- ...focusVisible({
40
- focus: {
41
- ...baseBorder("focus", props),
42
- outline: "none",
43
- },
44
- notFocus: {
45
- ...baseBorder("default", props),
46
- },
47
- }),
38
+ ...focusVisibleStyles(props),
48
39
  _disabled: {
49
40
  color: "whiteAlpha.400",
50
41
  ...baseBackground("disabled", props),
@@ -53,30 +44,18 @@ const config = helpers.defineMultiStyleConfig({
53
44
  },
54
45
  _active: {
55
46
  ...baseBackground("active", props),
56
- ...baseBorder("focus", props),
57
- },
58
- _expanded: {
59
- ...baseBorder("focus", props),
60
47
  },
61
48
  _invalid: {
62
49
  ...baseBorder("invalid", props),
63
50
  _hover: {
64
51
  ...baseBorder("hover", props),
65
52
  },
66
- ...focusVisible({
67
- focus: {
68
- ...baseBorder("focus", props),
69
- },
70
- notFocus: {
71
- ...baseBorder("invalid", props),
72
- },
73
- }),
74
53
  },
75
54
  },
76
55
  arrowIcon: {},
77
56
  }),
78
57
  variants: {
79
- base: (props) => ({}),
58
+ base: () => ({}),
80
59
  floating: (props) => ({
81
60
  button: {
82
61
  ...floatingBackground("default", props),
@@ -85,15 +64,6 @@ const config = helpers.defineMultiStyleConfig({
85
64
  ...floatingBorder("hover", props),
86
65
  ...floatingBackground("hover", props),
87
66
  },
88
- ...focusVisible({
89
- focus: {
90
- ...floatingBorder("focus", props),
91
- outline: "none",
92
- },
93
- notFocus: {
94
- ...floatingBorder("default", props),
95
- },
96
- }),
97
67
  _active: {
98
68
  ...floatingBorder("active", props),
99
69
  ...floatingBackground("active", props),
@@ -1,5 +1,5 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
- import { StyleFunctionProps, anatomy, mode } from "@chakra-ui/theme-tools";
2
+ import { anatomy, mode } from "@chakra-ui/theme-tools";
3
3
  import travelTagStyles from "./travel-tag";
4
4
 
5
5
  const parts = anatomy("info-tag").parts(
@@ -2,7 +2,7 @@ import { inputAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
3
  import { mode } from "@chakra-ui/theme-tools";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
- import { focusVisible } from "../utils/focus-utils";
5
+ import { focusVisibleStyles } from "../utils/focus-util";
6
6
 
7
7
  const helpers = createMultiStyleConfigHelpers(parts.keys);
8
8
 
@@ -18,7 +18,7 @@ const config = helpers.defineMultiStyleConfig({
18
18
  transitionProperty: "common",
19
19
  transitionDuration: "fast",
20
20
  position: "relative",
21
- px: 3,
21
+ paddingX: 3,
22
22
  height: "54px",
23
23
  fontSize: "mobile.md",
24
24
 
@@ -37,19 +37,11 @@ const config = helpers.defineMultiStyleConfig({
37
37
  borderWidth: 2,
38
38
  }),
39
39
  },
40
- ...focusVisible({
41
- focus: {
42
- boxShadow: getBoxShadowString({
43
- borderColor: mode("greenHaze", "azure")(props),
44
- borderWidth: 2,
45
- }),
46
- },
47
- notFocus: {
48
- boxShadow: getBoxShadowString({
49
- borderColor: mode("darkGrey", "white")(props),
50
- }),
51
- },
52
- }),
40
+ _focusVisible: {
41
+ ...focusVisibleStyles(props)._focusVisible,
42
+ outlineOffset: -2,
43
+ },
44
+
53
45
  _disabled: {
54
46
  backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
55
47
  boxShadow: getBoxShadowString({
@@ -68,20 +60,6 @@ const config = helpers.defineMultiStyleConfig({
68
60
  borderWidth: 2,
69
61
  }),
70
62
  },
71
- ...focusVisible({
72
- focus: {
73
- boxShadow: getBoxShadowString({
74
- borderColor: mode("greenHaze", "azure")(props),
75
- borderWidth: 2,
76
- }),
77
- },
78
- notFocus: {
79
- boxShadow: getBoxShadowString({
80
- borderColor: "brightRed",
81
- borderWidth: 2,
82
- }),
83
- },
84
- }),
85
63
  },
86
64
  " + label": {
87
65
  fontSize: ["mobile.sm", "desktop.sm"],
@@ -89,13 +67,13 @@ const config = helpers.defineMultiStyleConfig({
89
67
  left: props.paddingLeft || props.pl || 3,
90
68
  zIndex: 2,
91
69
  position: "absolute",
92
- my: 2,
70
+ marginY: 2,
93
71
  transition: ".1s ease-out",
94
72
  transformOrigin: "top left",
95
73
  cursor: "text",
96
74
  },
97
75
  "&:not(:placeholder-shown)": {
98
- pt: "16px",
76
+ paddingTop: "16px",
99
77
  "& + label": {
100
78
  transform: "scale(0.825) translateY(-10px)",
101
79
  },
@@ -1,10 +1,9 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { mode } from "@chakra-ui/theme-tools";
3
- import { getBoxShadowString } from "../utils/box-shadow-utils";
4
- import { focusVisible } from "../utils/focus-utils";
3
+ import { focusVisibleStyles } from "../utils/focus-util";
5
4
 
6
5
  const config = defineStyleConfig({
7
- baseStyle: {
6
+ baseStyle: (props) => ({
8
7
  transitionProperty: "common",
9
8
  transitionDuration: "fast",
10
9
  transitionTimingFunction: "ease-out",
@@ -27,6 +26,8 @@ const config = defineStyleConfig({
27
26
  borderRadius: "xs",
28
27
  },
29
28
 
29
+ ...focusVisibleStyles(props),
30
+
30
31
  svg: {
31
32
  display: "inline-block",
32
33
  width: "1.125em",
@@ -34,25 +35,10 @@ const config = defineStyleConfig({
34
35
  position: "relative",
35
36
  bottom: "-0.2em",
36
37
  },
37
- },
38
+ }),
38
39
  variants: {
39
40
  primary: (props) => ({
40
41
  color: mode("pine", "coralGreen")(props),
41
- ...focusVisible({
42
- focus: {
43
- backgroundColor: mode("pine", "white")(props),
44
- color: mode("white", "pine")(props),
45
- boxShadow: getBoxShadowString({
46
- borderWidth: 2,
47
- isInset: false,
48
- }),
49
- },
50
- notFocus: {
51
- color: "pine",
52
- backgroundColor: "transparent",
53
- boxShadow: "none",
54
- },
55
- }),
56
42
  _hover: {
57
43
  color: mode("darkTeal", "white")(props),
58
44
  backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
@@ -64,16 +50,6 @@ const config = defineStyleConfig({
64
50
  }),
65
51
  secondary: (props) => ({
66
52
  color: mode("darkGrey", "white")(props),
67
- ...focusVisible({
68
- focus: {
69
- backgroundColor: mode("darkGrey", "white")(props),
70
- color: mode("white", "darkTeal")(props),
71
- },
72
- notFocus: {
73
- boxShadow: "none",
74
- backgroundColor: "transparent",
75
- },
76
- }),
77
53
  _hover: {
78
54
  backgroundColor: mode("blackAlpha.100", "whiteAlpha.200")(props),
79
55
  color: mode("darkGrey", "white")(props),
@@ -2,8 +2,8 @@ import { anatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
3
  import { mode } from "@chakra-ui/theme-tools";
4
4
  import { colors } from "../foundations";
5
- import { baseBackground, ghostBackground } from "../utils/background-utils";
6
- import { baseBorder } from "../utils/border-utils";
5
+ import { ghostBackground } from "../utils/background-utils";
6
+ import { focusVisibleStyles } from "../utils/focus-util";
7
7
 
8
8
  const parts = anatomy("ListBox").parts(
9
9
  "container",
@@ -41,12 +41,10 @@ const config = helpers.defineMultiStyleConfig({
41
41
  _active: {
42
42
  ...ghostBackground("active", props),
43
43
  },
44
- _focus: {
45
- ...ghostBackground("focus", props),
46
- },
47
44
  _hover: {
48
45
  ...ghostBackground("hover", props),
49
46
  },
47
+ ...focusVisibleStyles(props),
50
48
  _selected: {
51
49
  ...ghostBackground("selected", props),
52
50
  },
@@ -1,13 +1,12 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy } from "@chakra-ui/theme-tools";
3
- import { getBoxShadowString } from "../utils/box-shadow-utils";
4
- import { focusVisible } from "../utils/focus-utils";
3
+ import { focusVisibleStyles } from "../utils/focus-util";
5
4
 
6
5
  const parts = anatomy("media-controller-button").parts("container", "icon");
7
6
  const helpers = createMultiStyleConfigHelpers(parts.keys);
8
7
 
9
8
  const config = helpers.defineMultiStyleConfig({
10
- baseStyle: {
9
+ baseStyle: (props) => ({
11
10
  container: {
12
11
  fontSize: 30,
13
12
  transitionProperty: "common",
@@ -21,6 +20,7 @@ const config = helpers.defineMultiStyleConfig({
21
20
  padding: 1,
22
21
  alignSelf: "center",
23
22
  color: "primaryGreen",
23
+ ...focusVisibleStyles(props),
24
24
  },
25
25
  icon: {
26
26
  flex: "0 0 auto",
@@ -28,7 +28,7 @@ const config = helpers.defineMultiStyleConfig({
28
28
  width: "1em",
29
29
  height: "1em",
30
30
  },
31
- },
31
+ }),
32
32
  variants: {
33
33
  play: {
34
34
  container: {
@@ -39,34 +39,7 @@ const config = helpers.defineMultiStyleConfig({
39
39
  _active: {
40
40
  color: "greenHaze",
41
41
  },
42
- ...focusVisible({
43
- focus: {
44
- position: "relative",
45
- outline: "none",
46
- _after: {
47
- content: '""',
48
- display: "block",
49
- zIndex: 2,
50
- margin: 0.5,
51
- borderRadius: "round",
52
- borderWidth: 2,
53
- borderColor: "white",
54
- borderStyle: "solid",
55
- pointerEvents: "none",
56
- position: "absolute",
57
- top: 0,
58
- right: 0,
59
- bottom: 0,
60
- left: 0,
61
- outline: "none",
62
- },
63
- },
64
- notFocus: {
65
- _after: {
66
- display: "none",
67
- },
68
- },
69
- }),
42
+
70
43
  _disabled: {
71
44
  color: "silver",
72
45
  _hover: {
@@ -80,18 +53,6 @@ const config = helpers.defineMultiStyleConfig({
80
53
  },
81
54
  jumpSkip: {
82
55
  container: {
83
- ...focusVisible({
84
- focus: {
85
- boxShadow: getBoxShadowString({
86
- borderColor: "greenHaze",
87
- borderWidth: 2,
88
- }),
89
- outline: "none",
90
- },
91
- notFocus: {
92
- boxShadow: "none",
93
- },
94
- }),
95
56
  _hover: {
96
57
  backgroundColor: "seaMist",
97
58
  },
@@ -130,5 +91,3 @@ const config = helpers.defineMultiStyleConfig({
130
91
  });
131
92
 
132
93
  export default config;
133
-
134
- // 3341 minus hund