@vygruppen/spor-react 3.7.6 → 3.8.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 (34) hide show
  1. package/.turbo/turbo-build.log +11 -11
  2. package/CHANGELOG.md +29 -0
  3. package/dist/{CountryCodeSelect-IV4VKD4A.mjs → CountryCodeSelect-BA3A7ODU.mjs} +1 -1
  4. package/dist/{chunk-LQEO65MM.mjs → chunk-HL3ESNVB.mjs} +654 -445
  5. package/dist/index.d.mts +237 -43
  6. package/dist/index.d.ts +237 -43
  7. package/dist/index.js +830 -621
  8. package/dist/index.mjs +1 -1
  9. package/package.json +2 -2
  10. package/src/button/Button.tsx +7 -1
  11. package/src/button/FloatingActionButton.tsx +10 -1
  12. package/src/datepicker/Calendar.tsx +8 -3
  13. package/src/datepicker/CalendarCell.tsx +8 -3
  14. package/src/datepicker/CalendarGrid.tsx +9 -3
  15. package/src/datepicker/CalendarTriggerButton.tsx +10 -3
  16. package/src/datepicker/DatePicker.tsx +15 -35
  17. package/src/datepicker/DateRangePicker.tsx +14 -25
  18. package/src/datepicker/DateTimeSegment.tsx +0 -2
  19. package/src/datepicker/RangeCalendar.tsx +8 -4
  20. package/src/datepicker/StyledField.tsx +6 -1
  21. package/src/datepicker/TimePicker.tsx +1 -1
  22. package/src/input/NumericStepper.tsx +91 -68
  23. package/src/tab/Tabs.tsx +11 -1
  24. package/src/theme/components/button.ts +18 -16
  25. package/src/theme/components/card.ts +18 -10
  26. package/src/theme/components/close-button.ts +9 -8
  27. package/src/theme/components/datepicker.ts +74 -23
  28. package/src/theme/components/fab.ts +76 -1
  29. package/src/theme/components/info-tag.ts +16 -1
  30. package/src/theme/components/line-icon.ts +5 -4
  31. package/src/theme/components/link.ts +14 -36
  32. package/src/theme/components/modal.ts +4 -3
  33. package/src/theme/components/tabs.ts +82 -1
  34. package/src/theme/components/travel-tag.ts +6 -4
@@ -1,5 +1,5 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
- import { anatomy, StyleFunctionProps } from "@chakra-ui/theme-tools";
2
+ import { anatomy, mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
3
3
  import { getBoxShadowString } from "../utils/box-shadow-utils";
4
4
  import { focusVisible } from "../utils/focus-utils";
5
5
 
@@ -89,6 +89,81 @@ const config = helpers.defineMultiStyleConfig({
89
89
  _active: { color: "darkTeal", backgroundColor: "lightGrey" },
90
90
  },
91
91
  },
92
+ brand: (props) => ({
93
+ container: {
94
+ backgroundColor: mode("darkTeal", "mint")(props),
95
+ color: mode("white", "darkTeal")(props),
96
+ _active: { backgroundColor: mode("pine", "white")(props) },
97
+ _hover: {
98
+ backgroundColor: mode("night", "seaMist")(props),
99
+ },
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
+ },
113
+ }),
114
+ base: (props) => ({
115
+ container: {
116
+ backgroundColor: mode("white", "whiteAlpha.100")(props),
117
+ color: mode("darkGrey", "white")(props),
118
+ _active: {
119
+ backgroundColor: mode("mint", "whiteAlpha.100")(props),
120
+ color: mode("darkGrey", "white")(props)
121
+ },
122
+ _hover: {
123
+ backgroundColor: mode("white", "transparent")(props),
124
+ boxShadow: mode(`inset 0 0 0 2px ${props.theme.colors.darkGrey}`, `inset 0 0 0 2px ${props.theme.colors.white}`)(props),
125
+ color: mode("darkGrey", "white")(props)
126
+ },
127
+ ...focusVisible({
128
+ focus: {
129
+ boxShadow: mode(
130
+ `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.white}, inset 0 0 0 6px ${props.theme.colors.darkGrey}`,
131
+ `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.brightRed }, inset 0 0 0 6px ${props.theme.colors.white}`
132
+ )(props),
133
+ outline: "none",
134
+ },
135
+ notFocus: {
136
+ boxShadow: "md",
137
+ },
138
+ }),
139
+ },
140
+ }),
141
+ accent: (props) => ({
142
+ container: {
143
+ backgroundColor: mode("mint", "pine")(props),
144
+ color: mode("darkTeal", "white")(props),
145
+ _active: {
146
+ backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
147
+ color: mode("darkTeal", "white")(props)
148
+ },
149
+ _hover: {
150
+ backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
151
+ color: mode("darkTeal", "white")(props)
152
+ },
153
+ ...focusVisible({
154
+ focus: {
155
+ boxShadow: mode(
156
+ `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.mint}, inset 0 0 0 6px ${props.theme.colors.azure}`,
157
+ `${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.pine}, inset 0 0 0 6px ${props.theme.colors.azure}`
158
+ )(props),
159
+ outline: "none",
160
+ },
161
+ notFocus: {
162
+ boxShadow: "md",
163
+ },
164
+ }),
165
+ },
166
+ }),
92
167
  },
93
168
  defaultProps: {
94
169
  variant: "dark",
@@ -1,5 +1,5 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
- import { anatomy } from "@chakra-ui/theme-tools";
2
+ import { StyleFunctionProps, anatomy, mode } from "@chakra-ui/theme-tools";
3
3
  import travelTagStyles from "./travel-tag";
4
4
 
5
5
  const parts = anatomy("info-tag").parts(
@@ -20,6 +20,9 @@ const config = helpers.defineMultiStyleConfig({
20
20
  ...travelTagStyles.baseStyle!(props).iconContainer,
21
21
  padding: 1,
22
22
  },
23
+ textContainer: {
24
+ color: mode("darkGrey", "white")(props),
25
+ },
23
26
  }),
24
27
  sizes: {
25
28
  ...travelTagStyles.sizes,
@@ -45,5 +48,17 @@ const config = helpers.defineMultiStyleConfig({
45
48
  defaultProps: {
46
49
  size: "md",
47
50
  },
51
+ variants: {
52
+ "walk": (props) => ({
53
+ iconContainer: {
54
+ backgroundColor: mode("white", "transparent")(props),
55
+ boxShadow: mode(
56
+ `${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.black[200]}`,
57
+ `${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.whiteAlpha[400]}`
58
+ )(props),
59
+ },
60
+ }),
61
+ }
48
62
  });
49
63
  export default config;
64
+
@@ -1,5 +1,5 @@
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
 
4
4
  const parts = anatomy("line-tag").parts("iconContainer", "icon");
5
5
  const helpers = createMultiStyleConfigHelpers(parts.keys);
@@ -77,8 +77,9 @@ const config = helpers.defineMultiStyleConfig({
77
77
  },
78
78
  },
79
79
  },
80
+
81
+ walk: (props) => ({
80
82
 
81
- walk: {
82
83
  iconContainer: {
83
84
  backgroundColor: "white",
84
85
  borderWidth: 1,
@@ -86,12 +87,12 @@ const config = helpers.defineMultiStyleConfig({
86
87
  borderColor: "blackAlpha.200",
87
88
  },
88
89
  icon: {
89
- color: "darkGrey",
90
+ color: mode("darkGrey", "white")(props),
90
91
  "[aria-disabled=true] &": {
91
92
  color: "osloGrey",
92
93
  },
93
94
  },
94
- },
95
+ }),
95
96
  },
96
97
  sizes: {
97
98
  sm: {
@@ -14,7 +14,7 @@ const config = defineStyleConfig({
14
14
  backgroundPosition: "0 100%",
15
15
  backgroundRepeat: "no-repeat",
16
16
  borderRadius: "none",
17
- pb: "2px",
17
+ padding: "2px",
18
18
  color: "inherit",
19
19
  display: "inline",
20
20
  position: "relative",
@@ -37,12 +37,12 @@ const config = defineStyleConfig({
37
37
  },
38
38
  variants: {
39
39
  primary: (props) => ({
40
- color: mode("pine", "seaMist")(props),
40
+ color: mode("pine", "coralGreen")(props),
41
41
  ...focusVisible({
42
42
  focus: {
43
- backgroundColor: "transparent",
43
+ backgroundColor: mode("pine", "white")(props),
44
+ color: mode("white", "pine")(props),
44
45
  boxShadow: getBoxShadowString({
45
- borderColor: "azure",
46
46
  borderWidth: 2,
47
47
  isInset: false,
48
48
  }),
@@ -54,34 +54,20 @@ const config = defineStyleConfig({
54
54
  },
55
55
  }),
56
56
  _hover: {
57
- color: "white",
58
- backgroundColor: "pine",
59
- boxShadow: getBoxShadowString({
60
- borderColor: "pine",
61
- borderWidth: 2,
62
- isInset: false,
63
- }),
57
+ color: mode("darkTeal", "white")(props),
58
+ backgroundColor: mode("coralGreen", "whiteAlpha.200")(props)
64
59
  },
65
60
  _active: {
66
- color: "white",
67
- backgroundColor: "azure",
68
- boxShadow: getBoxShadowString({
69
- borderColor: "azure",
70
- borderWidth: 2,
71
- isInset: false,
72
- }),
61
+ color: mode("pine", "white")(props),
62
+ backgroundColor: mode("mint", "whiteAlpha.100")(props),
73
63
  },
74
64
  }),
75
65
  secondary: (props) => ({
76
66
  color: mode("darkGrey", "white")(props),
77
67
  ...focusVisible({
78
68
  focus: {
79
- backgroundColor: "transparent",
80
- boxShadow: getBoxShadowString({
81
- borderColor: "azure",
82
- borderWidth: 2,
83
- isInset: false,
84
- }),
69
+ backgroundColor: mode("darkGrey", "white")(props),
70
+ color: mode("white", "darkTeal")(props)
85
71
  },
86
72
  notFocus: {
87
73
  boxShadow: "none",
@@ -89,20 +75,12 @@ const config = defineStyleConfig({
89
75
  },
90
76
  }),
91
77
  _hover: {
92
- backgroundColor: mode("seaMist", "pine")(props),
93
- boxShadow: getBoxShadowString({
94
- borderColor: mode("seaMist", "pine")(props),
95
- borderWidth: 2,
96
- isInset: false,
97
- }),
78
+ backgroundColor: mode("blackAlpha.100", "whiteAlpha.200")(props),
79
+ color: mode("darkGrey", "white")(props)
98
80
  },
99
81
  _active: {
100
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
101
- boxShadow: getBoxShadowString({
102
- borderColor: mode("mint", "whiteAlpha.200")(props),
103
- borderWidth: 2,
104
- isInset: false,
105
- }),
82
+ backgroundColor: mode("mint", "whiteAlpha.100")(props),
83
+ color: mode("darkGrey", "white")(props)
106
84
  },
107
85
  }),
108
86
  /**
@@ -1,6 +1,6 @@
1
1
  import { modalAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
- import type { PartsStyleObject } from "@chakra-ui/theme-tools";
3
+ import { mode, type PartsStyleObject } from "@chakra-ui/theme-tools";
4
4
 
5
5
  const helpers = createMultiStyleConfigHelpers(parts.keys);
6
6
 
@@ -19,8 +19,8 @@ const config = helpers.defineMultiStyleConfig({
19
19
  },
20
20
  dialog: {
21
21
  borderRadius: "md",
22
- background: "white",
23
- color: "inherit",
22
+ background: mode("white", "night")(props),
23
+ color: mode("inherit", "white")(props),
24
24
  my: "3.75rem",
25
25
  zIndex: "modal",
26
26
  maxHeight:
@@ -36,6 +36,7 @@ const config = helpers.defineMultiStyleConfig({
36
36
  },
37
37
  closeButton: {
38
38
  position: "absolute",
39
+ color: "inherit",
39
40
  top: 3,
40
41
  insetEnd: 3,
41
42
  },
@@ -1,6 +1,6 @@
1
1
  import { tabsAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
- import type { StyleFunctionProps } from "@chakra-ui/theme-tools";
3
+ import { mode, type StyleFunctionProps } from "@chakra-ui/theme-tools";
4
4
 
5
5
  const helpers = createMultiStyleConfigHelpers(parts.keys);
6
6
 
@@ -129,6 +129,14 @@ const getTabColorSchemeProps = (props: StyleFunctionProps) => {
129
129
  return {
130
130
  color: "darkGrey",
131
131
  };
132
+ case "base":
133
+ return {
134
+ color: mode("darkGrey", "white")(props),
135
+ };
136
+ case "accent":
137
+ return {
138
+ color: mode("darkTeal", "white")(props),
139
+ };
132
140
  default:
133
141
  return {};
134
142
  }
@@ -158,6 +166,32 @@ const getTabColorSchemeSelectedProps = (props: StyleFunctionProps) => {
158
166
  color: "darkTeal",
159
167
  },
160
168
  };
169
+ case "base":
170
+ return {
171
+ backgroundColor: "pine",
172
+ color: "white",
173
+ _hover: {
174
+ backgroundColor: "darkTeal",
175
+ color: "white",
176
+ },
177
+ _active: {
178
+ backgroundColor: "darkTeal",
179
+ color: "white",
180
+ },
181
+ }
182
+ case "accent":
183
+ return {
184
+ backgroundColor: "pine",
185
+ color: "white",
186
+ _hover: {
187
+ backgroundColor: "darkTeal",
188
+ color: "white",
189
+ },
190
+ _active: {
191
+ backgroundColor: "darkTeal",
192
+ color: "white",
193
+ },
194
+ }
161
195
  default:
162
196
  return {
163
197
  backgroundColor: "darkTeal",
@@ -180,6 +214,14 @@ const getTabColorSchemeFocusProps = (props: StyleFunctionProps) => {
180
214
  return {
181
215
  boxShadow: `inset 0 0 0 2px ${props.theme.colors.white}`,
182
216
  };
217
+ case "base":
218
+ return {
219
+ boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
220
+ }
221
+ case "accent":
222
+ return {
223
+ boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
224
+ }
183
225
  default:
184
226
  return {
185
227
  boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
@@ -205,6 +247,16 @@ const getTabColorSchemeHoverProps = (props: StyleFunctionProps) => {
205
247
  return {
206
248
  backgroundColor: "silver",
207
249
  };
250
+ case "base":
251
+ return {
252
+ boxShadow: mode(`inset 0 0 0 2px ${props.theme.colors.darkGrey}`, `inset 0 0 0 2px ${props.theme.colors.white}`)(props),
253
+ color: mode("darkGrey", "white")(props)
254
+ };
255
+ case "accent":
256
+ return {
257
+ backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
258
+ color: mode("darkTeal", "white")(props)
259
+ };
208
260
  default:
209
261
  return {};
210
262
  }
@@ -232,6 +284,16 @@ const getTabColorSchemeActiveProps = (props: StyleFunctionProps) => {
232
284
  backgroundColor: "lightGrey",
233
285
  color: "darkGrey",
234
286
  };
287
+ case "base":
288
+ return {
289
+ backgroundColor: mode("mint", "whiteAlpha.100")(props),
290
+ color: mode("darkGrey", "white")(props),
291
+ };
292
+ case "accent":
293
+ return {
294
+ backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
295
+ color: mode("darkTeal", "white")(props),
296
+ };
235
297
  default:
236
298
  return {};
237
299
  }
@@ -255,6 +317,14 @@ const getTabColorSchemeDisabledProps = (props: StyleFunctionProps) => {
255
317
  return {
256
318
  color: "steel",
257
319
  };
320
+ case "base":
321
+ return {
322
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props),
323
+ };
324
+ case "accent":
325
+ return {
326
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props),
327
+ };
258
328
  default:
259
329
  return {};
260
330
  }
@@ -277,6 +347,17 @@ const getTablistColorSchemeProps = (props: StyleFunctionProps) => {
277
347
  backgroundColor: "platinum",
278
348
  color: "darkGrey",
279
349
  };
350
+ case "base":
351
+ return {
352
+ backgroundColor: mode("white", "transparent")(props),
353
+ color: "darkGrey",
354
+ boxShadow: mode(`inset 0 0 0 1px ${props.theme.colors.blackAlpha["400"]}`, `inset 0 0 0 1px ${props.theme.colors.whiteAlpha["400"]}`)(props),
355
+ };
356
+ case "accent":
357
+ return {
358
+ backgroundColor: mode("mint", "whiteAlpha.100")(props),
359
+ color: "darkTeal"
360
+ };
280
361
  default:
281
362
  return {};
282
363
  }
@@ -1,6 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import type { StyleFunctionProps } from "@chakra-ui/theme-tools";
3
- import { anatomy } from "@chakra-ui/theme-tools";
3
+ import { anatomy, mode } from "@chakra-ui/theme-tools";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
5
  import { focusVisible } from "../utils/focus-utils";
6
6
 
@@ -138,9 +138,9 @@ const config = helpers.defineMultiStyleConfig({
138
138
  backgroundColor: "linjetag.altTransportLight",
139
139
  },
140
140
  },
141
- walk: {
141
+ walk: (props) => ({
142
142
  container: {
143
- backgroundColor: "white",
143
+ backgroundColor: mode("white", "transparent")(props),
144
144
  _disabled: {
145
145
  backgroundColor: "white",
146
146
  },
@@ -149,6 +149,7 @@ const config = helpers.defineMultiStyleConfig({
149
149
  border: "none",
150
150
  position: "relative",
151
151
  left: -1,
152
+ backgroundColor: mode("white", "transparent")(props),
152
153
  "[aria-disabled=true] &": {
153
154
  backgroundColor: "transparent",
154
155
  color: "osloGrey",
@@ -165,11 +166,12 @@ const config = helpers.defineMultiStyleConfig({
165
166
  title: {
166
167
  fontSize: "mobile.xs",
167
168
  fontWeight: "normal",
169
+ color: mode("black", "white")(props)
168
170
  },
169
171
  description: {
170
172
  display: "none",
171
173
  },
172
- },
174
+ }),
173
175
  },
174
176
  sizes: {
175
177
  sm: {