@vygruppen/spor-react 4.0.2 → 4.1.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 (95) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CHANGELOG.md +27 -0
  3. package/dist/{CountryCodeSelect-WSPQNU6B.mjs → CountryCodeSelect-FBKDO5JS.mjs} +1 -1
  4. package/dist/{chunk-MGJQOEU2.mjs → chunk-FPWAXD72.mjs} +149 -220
  5. package/dist/index.d.mts +22 -96
  6. package/dist/index.d.ts +22 -96
  7. package/dist/index.js +148 -219
  8. package/dist/index.mjs +1 -1
  9. package/package.json +1 -1
  10. package/src/accordion/Accordion.test.tsx +1 -1
  11. package/src/accordion/Accordion.tsx +1 -1
  12. package/src/accordion/AccordionContext.tsx +1 -1
  13. package/src/accordion/Expandable.tsx +6 -6
  14. package/src/alert/BaseAlert.test.tsx +5 -5
  15. package/src/alert/BaseAlert.tsx +5 -1
  16. package/src/alert/ClosableAlert.test.tsx +3 -3
  17. package/src/alert/ExpandableAlert.test.tsx +5 -5
  18. package/src/button/Button.test.tsx +1 -1
  19. package/src/button/Button.tsx +1 -1
  20. package/src/button/CloseButton.tsx +1 -1
  21. package/src/button/FloatingActionButton.tsx +5 -5
  22. package/src/button/IconButton.tsx +1 -1
  23. package/src/card/Card.tsx +3 -2
  24. package/src/card/index.tsx +1 -1
  25. package/src/datepicker/Calendar.tsx +6 -6
  26. package/src/datepicker/CalendarCell.tsx +9 -8
  27. package/src/datepicker/CalendarGrid.tsx +9 -9
  28. package/src/datepicker/CalendarHeader.tsx +2 -2
  29. package/src/datepicker/CalendarTriggerButton.tsx +5 -10
  30. package/src/datepicker/DateField.tsx +2 -2
  31. package/src/datepicker/DatePicker.tsx +3 -3
  32. package/src/datepicker/DateTimeSegment.tsx +2 -2
  33. package/src/datepicker/RangeCalendar.tsx +5 -2
  34. package/src/datepicker/StyledField.tsx +2 -6
  35. package/src/datepicker/TimePicker.test.tsx +4 -4
  36. package/src/datepicker/TimePicker.tsx +9 -7
  37. package/src/index.tsx +0 -1
  38. package/src/input/CardSelect.tsx +3 -3
  39. package/src/input/Combobox.tsx +1 -1
  40. package/src/input/CountryCodeSelect.tsx +1 -1
  41. package/src/input/FormErrorMessage.tsx +1 -1
  42. package/src/input/InfoSelect.tsx +1 -1
  43. package/src/input/Input.tsx +1 -1
  44. package/src/input/InputElement.tsx +2 -2
  45. package/src/input/ListBox.tsx +3 -3
  46. package/src/input/NativeSelect.tsx +1 -1
  47. package/src/input/PasswordInput.tsx +1 -1
  48. package/src/input/PhoneNumberInput.tsx +13 -4
  49. package/src/input/Popover.tsx +4 -4
  50. package/src/input/RadioGroup.tsx +1 -1
  51. package/src/input/SearchInput.tsx +1 -1
  52. package/src/input/Switch.tsx +1 -1
  53. package/src/layout/Stack.tsx +1 -1
  54. package/src/linjetag/TravelTag.tsx +2 -2
  55. package/src/link/TextLink.tsx +1 -1
  56. package/src/list/index.tsx +0 -1
  57. package/src/loader/DarkSpinner.tsx +5 -5
  58. package/src/loader/SkeletonText.tsx +6 -3
  59. package/src/loader/useRotatingLabel.tsx +2 -2
  60. package/src/media-controller/index.test.tsx +6 -6
  61. package/src/modal/Drawer.tsx +2 -4
  62. package/src/modal/ModalHeader.tsx +1 -1
  63. package/src/provider/index.tsx +1 -1
  64. package/src/stepper/Stepper.tsx +10 -6
  65. package/src/stepper/StepperContext.tsx +7 -7
  66. package/src/stepper/StepperStep.tsx +56 -16
  67. package/src/theme/components/button.ts +25 -44
  68. package/src/theme/components/card.ts +7 -1
  69. package/src/theme/components/close-button.ts +3 -1
  70. package/src/theme/components/datepicker.ts +2 -2
  71. package/src/theme/components/divider.ts +17 -17
  72. package/src/theme/components/fab.ts +16 -13
  73. package/src/theme/components/info-tag.ts +7 -8
  74. package/src/theme/components/input.ts +4 -2
  75. package/src/theme/components/line-icon.ts +1 -2
  76. package/src/theme/components/media-controller-button.ts +1 -1
  77. package/src/theme/components/popover.ts +1 -2
  78. package/src/theme/components/select.ts +4 -4
  79. package/src/theme/components/stepper.ts +8 -155
  80. package/src/theme/components/switch.ts +9 -9
  81. package/src/theme/components/table.ts +3 -3
  82. package/src/theme/components/tabs.ts +24 -18
  83. package/src/theme/components/textarea.ts +1 -1
  84. package/src/theme/components/travel-tag.ts +2 -2
  85. package/src/theme/foundations/spacing.ts +1 -1
  86. package/src/theme/foundations/styles.ts +10 -10
  87. package/src/theme/utils/box-shadow-utils.ts +2 -2
  88. package/src/toast/ActionToast.test.tsx +1 -1
  89. package/src/toast/BaseToast.test.tsx +3 -3
  90. package/src/toast/ClosableToast.test.tsx +1 -1
  91. package/src/toast/index.tsx +1 -1
  92. package/src/toast/useToast.tsx +3 -3
  93. package/src/typography/Badge.tsx +1 -1
  94. package/src/typography/Text.tsx +1 -1
  95. package/tsconfig.json +1 -1
@@ -51,7 +51,7 @@ const config = helpers.defineMultiStyleConfig({
51
51
  "none",
52
52
  getBoxShadowString({
53
53
  borderColor: colors.whiteAlpha[400],
54
- })
54
+ }),
55
55
  )({ colorMode }),
56
56
 
57
57
  ...focusVisible({
@@ -73,7 +73,7 @@ const config = helpers.defineMultiStyleConfig({
73
73
  borderColor: "coralGreen",
74
74
  borderWidth: 2,
75
75
  isInset: false,
76
- })
76
+ }),
77
77
  )({ colorMode }),
78
78
  },
79
79
  notFocus: {
@@ -81,7 +81,7 @@ const config = helpers.defineMultiStyleConfig({
81
81
  "none",
82
82
  getBoxShadowString({
83
83
  borderColor: colors.whiteAlpha[400],
84
- })
84
+ }),
85
85
  )({ colorMode }),
86
86
  },
87
87
  }),
@@ -89,7 +89,7 @@ const config = helpers.defineMultiStyleConfig({
89
89
  backgroundColor: "steel",
90
90
  boxShadow: mode(
91
91
  "none",
92
- getBoxShadowString({ borderColor: colors.white })
92
+ getBoxShadowString({ borderColor: colors.white }),
93
93
  )({ colorMode }),
94
94
  },
95
95
  _checked: {
@@ -113,13 +113,13 @@ const config = helpers.defineMultiStyleConfig({
113
113
  borderWidth: 2,
114
114
  borderColor: "coralGreen",
115
115
  isInset: false,
116
- })
116
+ }),
117
117
  )({ colorMode }),
118
118
  },
119
119
  notFocus: {
120
120
  boxShadow: mode(
121
121
  "none",
122
- getBoxShadowString({ borderColor: colors.white })
122
+ getBoxShadowString({ borderColor: colors.white }),
123
123
  )({ colorMode }),
124
124
  },
125
125
  }),
@@ -128,7 +128,7 @@ const config = helpers.defineMultiStyleConfig({
128
128
  backgroundColor: mode("pine", "river")({ colorMode }),
129
129
  boxShadow: mode(
130
130
  "none",
131
- getBoxShadowString({ borderColor: colors.white })
131
+ getBoxShadowString({ borderColor: colors.white }),
132
132
  )({ colorMode }),
133
133
  },
134
134
  },
@@ -136,13 +136,13 @@ const config = helpers.defineMultiStyleConfig({
136
136
  backgroundColor: mode("platinum", "dimGrey")({ colorMode }),
137
137
  boxShadow: mode(
138
138
  "none",
139
- getBoxShadowString({ borderColor: colors.whiteAlpha[400] })
139
+ getBoxShadowString({ borderColor: colors.whiteAlpha[400] }),
140
140
  )({ colorMode }),
141
141
  _checked: {
142
142
  backgroundColor: mode("platinum", "dimGrey")({ colorMode }),
143
143
  boxShadow: mode(
144
144
  "none",
145
- getBoxShadowString({ borderColor: colors.whiteAlpha[400] })
145
+ getBoxShadowString({ borderColor: colors.whiteAlpha[400] }),
146
146
  )({ colorMode }),
147
147
  },
148
148
  },
@@ -63,11 +63,11 @@ const config = helpers.defineMultiStyleConfig({
63
63
  _hover: {
64
64
  boxShadow: mode(
65
65
  getBoxShadowString({ borderColor: "darkTeal", borderWidth: 3 }),
66
- getBoxShadowString({ borderColor: "blueGreen", borderWidth: 3 })
66
+ getBoxShadowString({ borderColor: "blueGreen", borderWidth: 3 }),
67
67
  )(props),
68
68
  backgroundColor: mode(
69
69
  props.colorScheme === "grey" ? "mint" : "coralGreen",
70
- "whiteAlpha.200"
70
+ "whiteAlpha.200",
71
71
  )(props),
72
72
  },
73
73
  },
@@ -83,7 +83,7 @@ const config = helpers.defineMultiStyleConfig({
83
83
  border: mode("sm", "md"),
84
84
  borderColor: mode(
85
85
  props.colorScheme === "grey" ? "silver" : "blackAlpha.200",
86
- "whiteAlpha.200"
86
+ "whiteAlpha.200",
87
87
  )(props),
88
88
  ...numericStyles,
89
89
  _first: {
@@ -178,7 +178,7 @@ const getTabColorSchemeSelectedProps = (props: StyleFunctionProps) => {
178
178
  backgroundColor: "darkTeal",
179
179
  color: "white",
180
180
  },
181
- }
181
+ };
182
182
  case "accent":
183
183
  return {
184
184
  backgroundColor: "pine",
@@ -191,7 +191,7 @@ const getTabColorSchemeSelectedProps = (props: StyleFunctionProps) => {
191
191
  backgroundColor: "darkTeal",
192
192
  color: "white",
193
193
  },
194
- }
194
+ };
195
195
  default:
196
196
  return {
197
197
  backgroundColor: "darkTeal",
@@ -217,11 +217,11 @@ const getTabColorSchemeFocusProps = (props: StyleFunctionProps) => {
217
217
  case "base":
218
218
  return {
219
219
  boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
220
- }
220
+ };
221
221
  case "accent":
222
222
  return {
223
223
  boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
224
- }
224
+ };
225
225
  default:
226
226
  return {
227
227
  boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
@@ -249,13 +249,16 @@ const getTabColorSchemeHoverProps = (props: StyleFunctionProps) => {
249
249
  };
250
250
  case "base":
251
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)
252
+ boxShadow: mode(
253
+ `inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
254
+ `inset 0 0 0 2px ${props.theme.colors.white}`,
255
+ )(props),
256
+ color: mode("darkGrey", "white")(props),
254
257
  };
255
258
  case "accent":
256
259
  return {
257
260
  backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
258
- color: mode("darkTeal", "white")(props)
261
+ color: mode("darkTeal", "white")(props),
259
262
  };
260
263
  default:
261
264
  return {};
@@ -318,13 +321,13 @@ const getTabColorSchemeDisabledProps = (props: StyleFunctionProps) => {
318
321
  color: "steel",
319
322
  };
320
323
  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
- };
324
+ return {
325
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props),
326
+ };
327
+ case "accent":
328
+ return {
329
+ color: mode("blackAlpha.400", "whiteAlpha.400")(props),
330
+ };
328
331
  default:
329
332
  return {};
330
333
  }
@@ -351,12 +354,15 @@ const getTablistColorSchemeProps = (props: StyleFunctionProps) => {
351
354
  return {
352
355
  backgroundColor: mode("white", "transparent")(props),
353
356
  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),
357
+ boxShadow: mode(
358
+ `inset 0 0 0 1px ${props.theme.colors.blackAlpha["400"]}`,
359
+ `inset 0 0 0 1px ${props.theme.colors.whiteAlpha["400"]}`,
360
+ )(props),
355
361
  };
356
362
  case "accent":
357
- return {
358
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
359
- color: "darkTeal"
363
+ return {
364
+ backgroundColor: mode("mint", "whiteAlpha.100")(props),
365
+ color: "darkTeal",
360
366
  };
361
367
  default:
362
368
  return {};
@@ -10,7 +10,7 @@ const config = defineStyleConfig({
10
10
  paddingTop: 2,
11
11
  "&:not(:placeholder-shown)": {
12
12
  "&:has(+ label)": {
13
- paddingTop: 4
13
+ paddingTop: 4,
14
14
  },
15
15
  "& + label": {
16
16
  transform: "scale(0.825) translateY(-10px)",
@@ -11,7 +11,7 @@ const parts = anatomy("travel-tag").parts(
11
11
  "textContainer",
12
12
  "title",
13
13
  "description",
14
- "deviationIcon"
14
+ "deviationIcon",
15
15
  );
16
16
 
17
17
  const helpers = createMultiStyleConfigHelpers(parts.keys);
@@ -166,7 +166,7 @@ const config = helpers.defineMultiStyleConfig({
166
166
  title: {
167
167
  fontSize: "mobile.xs",
168
168
  fontWeight: "normal",
169
- color: mode("black", "white")(props)
169
+ color: mode("black", "white")(props),
170
170
  },
171
171
  description: {
172
172
  display: "none",
@@ -24,7 +24,7 @@ export const spacing = Object.entries(tokens.size.spacing).reduce(
24
24
  ...tokens,
25
25
  [Number(key)]: token,
26
26
  }),
27
- {} as Record<keyof Spacing, string>
27
+ {} as Record<keyof Spacing, string>,
28
28
  );
29
29
 
30
30
  export const space = spacing;
@@ -1,12 +1,12 @@
1
- import {StyleFunctionProps, mode} from "@chakra-ui/theme-tools";
1
+ import { StyleFunctionProps, mode } from "@chakra-ui/theme-tools";
2
2
 
3
3
  export const styles = {
4
- global: (props: StyleFunctionProps | Record<string, any>) => ({
5
- 'html, body': {
6
- color: mode("darkGrey", "lightGrey")(props),
7
- },
8
- svg : {
9
- display: "initial"
10
- }
11
- })
12
- }
4
+ global: (props: StyleFunctionProps | Record<string, any>) => ({
5
+ "html, body": {
6
+ color: mode("darkGrey", "lightGrey")(props),
7
+ },
8
+ svg: {
9
+ display: "initial",
10
+ },
11
+ }),
12
+ };
@@ -11,7 +11,7 @@ type GetBoxShadowStringArgs = {
11
11
  * A utility for creating box shadow strings
12
12
  */
13
13
  export const getBoxShadowString = (
14
- args: GetBoxShadowStringArgs | GetBoxShadowStringArgs[]
14
+ args: GetBoxShadowStringArgs | GetBoxShadowStringArgs[],
15
15
  ): string => {
16
16
  if (Array.isArray(args)) {
17
17
  return args.map((arg) => getBoxShadowString(arg)).join(", ");
@@ -34,7 +34,7 @@ export const getBoxShadowString = (
34
34
  }
35
35
  }
36
36
  allShadows.push(
37
- `${isInset ? "inset " : ""}0 0 0 ${borderWidth}px ${color}`
37
+ `${isInset ? "inset " : ""}0 0 0 ${borderWidth}px ${color}`,
38
38
  );
39
39
  }
40
40
  if (baseShadow) {
@@ -13,7 +13,7 @@ describe("<ActionToast />", () => {
13
13
  buttonText="Click me"
14
14
  >
15
15
  Test text
16
- </ActionToast>
16
+ </ActionToast>,
17
17
  );
18
18
  getByRole("button").click();
19
19
  expect(handleClick).toHaveBeenCalled();
@@ -6,21 +6,21 @@ import { BaseToast } from "./BaseToast";
6
6
  describe("<BaseToast />", () => {
7
7
  it("is accessible in variant success", async () => {
8
8
  const { container } = render(
9
- <BaseToast variant="success">Test text</BaseToast>
9
+ <BaseToast variant="success">Test text</BaseToast>,
10
10
  );
11
11
  expect(await axe(container)).toHaveNoViolations();
12
12
  });
13
13
 
14
14
  it("is accessible in variant info", async () => {
15
15
  const { container } = render(
16
- <BaseToast variant="info">Test text</BaseToast>
16
+ <BaseToast variant="info">Test text</BaseToast>,
17
17
  );
18
18
  expect(await axe(container)).toHaveNoViolations();
19
19
  });
20
20
 
21
21
  it("is accessible in variant error", async () => {
22
22
  const { container } = render(
23
- <BaseToast variant="error">Test text</BaseToast>
23
+ <BaseToast variant="error">Test text</BaseToast>,
24
24
  );
25
25
  expect(await axe(container)).toHaveNoViolations();
26
26
  });
@@ -9,7 +9,7 @@ describe("<ClosableToast />", () => {
9
9
  const { getByRole } = render(
10
10
  <ClosableToast variant="success" onClose={handleClick}>
11
11
  Test text
12
- </ClosableToast>
12
+ </ClosableToast>,
13
13
  );
14
14
  getByRole("button").click();
15
15
  expect(handleClick).toHaveBeenCalled();
@@ -1 +1 @@
1
- export * from "./useToast";
1
+ export * from "./useToast";
@@ -31,8 +31,8 @@ type BaseToastOptions = {
31
31
  duration?: number;
32
32
  };
33
33
 
34
- export type ToastOptions =
35
- | BaseToastOptions & (ClosableToastOptions | ActionToastOptions | {});
34
+ export type ToastOptions = BaseToastOptions &
35
+ (ClosableToastOptions | ActionToastOptions | {});
36
36
 
37
37
  /**
38
38
  * Creates a function that can trigger toasts
@@ -96,4 +96,4 @@ const getToastComponent = (opts: ToastOptions) => {
96
96
  {opts.text}
97
97
  </BaseToast>
98
98
  );
99
- };
99
+ };
@@ -64,5 +64,5 @@ export const Badge = forwardRef<BadgeProps, As>(
64
64
  {children}
65
65
  </ChakraBadge>
66
66
  );
67
- }
67
+ },
68
68
  );
@@ -22,5 +22,5 @@ export type TextProps = Omit<ChakraTextProps, "textStyle"> & {
22
22
  export const Text = forwardRef<TextProps, "p">(
23
23
  ({ variant = "sm", ...props }, ref) => {
24
24
  return <ChakraText {...props} textStyle={variant} ref={ref} />;
25
- }
25
+ },
26
26
  );
package/tsconfig.json CHANGED
@@ -3,6 +3,6 @@
3
3
  "include": ["."],
4
4
  "exclude": ["dist", "build", "node_modules"],
5
5
  "compilerOptions": {
6
- "rootDir": ".",
6
+ "rootDir": "."
7
7
  }
8
8
  }