@vygruppen/spor-react 6.2.3 → 7.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.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CHANGELOG.md +14 -0
  3. package/dist/{CountryCodeSelect-QZYP3GSD.mjs → CountryCodeSelect-OK6RZ6AY.mjs} +1 -1
  4. package/dist/{chunk-YFZOYRGT.mjs → chunk-CYU6YFQK.mjs} +166 -641
  5. package/dist/index.d.mts +483 -497
  6. package/dist/index.d.ts +483 -497
  7. package/dist/index.js +195 -672
  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/theme/components/accordion.ts +4 -15
  13. package/src/theme/components/breadcrumb.ts +2 -14
  14. package/src/theme/components/button.ts +5 -55
  15. package/src/theme/components/card-select.ts +11 -26
  16. package/src/theme/components/card.ts +2 -18
  17. package/src/theme/components/checkbox.ts +4 -12
  18. package/src/theme/components/choice-chip.ts +2 -11
  19. package/src/theme/components/close-button.ts +2 -14
  20. package/src/theme/components/code.ts +1 -1
  21. package/src/theme/components/datepicker.ts +14 -65
  22. package/src/theme/components/drawer.ts +7 -7
  23. package/src/theme/components/fab.ts +6 -63
  24. package/src/theme/components/form-label.ts +1 -1
  25. package/src/theme/components/form.ts +1 -1
  26. package/src/theme/components/info-select.ts +5 -35
  27. package/src/theme/components/info-tag.ts +1 -1
  28. package/src/theme/components/input.ts +9 -31
  29. package/src/theme/components/link.ts +5 -29
  30. package/src/theme/components/listbox.ts +3 -5
  31. package/src/theme/components/media-controller-button.ts +5 -46
  32. package/src/theme/components/modal.ts +7 -7
  33. package/src/theme/components/popover.ts +7 -15
  34. package/src/theme/components/progress-indicator.ts +1 -5
  35. package/src/theme/components/radio.ts +5 -11
  36. package/src/theme/components/select.ts +2 -2
  37. package/src/theme/components/stepper.ts +6 -6
  38. package/src/theme/components/switch.ts +5 -73
  39. package/src/theme/components/table.ts +18 -18
  40. package/src/theme/components/tabs.ts +11 -14
  41. package/src/theme/components/travel-tag.ts +2 -15
  42. package/src/theme/utils/focus-util.ts +10 -0
  43. package/tsconfig.json +2 -2
  44. package/src/theme/utils/focus-utils.ts +0 -16
@@ -1,5 +1,5 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
- import { anatomy, mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
2
+ import { anatomy, mode } from "@chakra-ui/theme-tools";
3
3
 
4
4
  const parts = anatomy("stepper").parts(
5
5
  "root",
@@ -28,9 +28,9 @@ const config = helpers.defineMultiStyleConfig({
28
28
  width: "100%",
29
29
  },
30
30
  container: {
31
- px: [2, 2, 0],
31
+ paddingX: [2, 2, 0],
32
32
  maxWidth: "container.lg",
33
- mx: "auto",
33
+ marginX: "auto",
34
34
  width: "100%",
35
35
  },
36
36
  innerContainer: {
@@ -41,7 +41,7 @@ const config = helpers.defineMultiStyleConfig({
41
41
  },
42
42
  backButton: {
43
43
  borderRadius: "xs",
44
- px: 0,
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
- ml: 2,
54
+ marginLeft: 2,
55
55
  textAlign: "right",
56
56
  },
57
57
  stepContainer: {
@@ -64,7 +64,7 @@ const config = helpers.defineMultiStyleConfig({
64
64
  },
65
65
  }),
66
66
  variants: {
67
- base: (props) => ({
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 { focusVisible } from "../utils/focus-utils";
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
- p: "2px",
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
- p: "3px",
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
- p: "3px",
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
- px: 3,
110
- py: 1.5,
109
+ paddingX: 3,
110
+ paddingY: 1.5,
111
111
  },
112
112
  td: {
113
- px: 3,
114
- py: 1.5,
113
+ paddingX: 3,
114
+ paddingY: 1.5,
115
115
  },
116
116
  caption: {
117
- px: 3,
118
- py: 1.5,
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
- px: 3,
127
- py: 1.5,
126
+ paddingX: 3,
127
+ paddingY: 1.5,
128
128
  },
129
129
  td: {
130
- px: 3,
131
- py: 1.5,
130
+ paddingX: 3,
131
+ paddingY: 1.5,
132
132
  },
133
133
  caption: {
134
- px: 3,
135
- py: 1.5,
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
- px: 3,
144
- py: "15px",
143
+ paddingX: 3,
144
+ paddingY: "15px",
145
145
  },
146
146
  td: {
147
- px: 3,
148
- py: "15px",
147
+ paddingX: 3,
148
+ paddingY: "15px",
149
149
  },
150
150
  caption: {
151
- px: 3,
152
- py: "15px",
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
- _focus: getTabColorSchemeFocusProps(props),
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
- p: "2px",
66
+ padding: "2px",
70
67
  },
71
68
  tab: {
72
- px: 2,
73
- py: 0,
69
+ paddingX: 2,
70
+ paddingY: 0,
74
71
  },
75
72
  },
76
73
  md: {
77
74
  tablist: {
78
75
  height: "36px",
79
- p: 0.5,
76
+ padding: 0.5,
80
77
  },
81
78
  tab: {
82
- px: 2,
79
+ paddingX: 2,
83
80
  },
84
81
  },
85
82
  lg: {
86
83
  tablist: {
87
84
  height: "42px",
88
- p: 0.5,
85
+ padding: 0.5,
89
86
  },
90
87
  tab: {
91
88
  fontWeight: "bold",
92
- px: 2,
89
+ paddingX: 2,
93
90
  },
94
91
  },
95
92
  xl: {
96
93
  tablist: {
97
94
  height: "54px",
98
- p: "4px",
95
+ padding: "4px",
99
96
  },
100
97
  tab: {
101
98
  fontWeight: "bold",
102
- px: 3,
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 { focusVisible } from "../utils/focus-utils";
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
- ...focusVisible({
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",
@@ -0,0 +1,10 @@
1
+ import { mode } from "@chakra-ui/theme-tools";
2
+
3
+ export const focusVisibleStyles = (props: any) => ({
4
+ _focusVisible: {
5
+ outlineWidth: "2px",
6
+ outlineColor: mode("greenHaze", "azure")(props),
7
+ outlineStyle: "solid",
8
+ outlineOffset: "1px",
9
+ },
10
+ });
package/tsconfig.json CHANGED
@@ -3,6 +3,6 @@
3
3
  "include": ["."],
4
4
  "exclude": ["dist", "build", "node_modules"],
5
5
  "compilerOptions": {
6
- "rootDir": ".",
7
- },
6
+ "rootDir": "."
7
+ }
8
8
  }
@@ -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
- });