@vygruppen/spor-react 12.8.0 → 12.8.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
3
  "type": "module",
4
- "version": "12.8.0",
4
+ "version": "12.8.2",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -46,9 +46,9 @@
46
46
  "react-stately": "^3.31.1",
47
47
  "react-swipeable": "^7.0.1",
48
48
  "usehooks-ts": "^3.1.0",
49
- "@vygruppen/spor-design-tokens": "4.0.7",
50
49
  "@vygruppen/spor-icon-react": "4.2.1",
51
- "@vygruppen/spor-loader": "0.7.0"
50
+ "@vygruppen/spor-loader": "0.7.0",
51
+ "@vygruppen/spor-design-tokens": "4.0.7"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@react-types/datepicker": "^3.10.0",
@@ -67,8 +67,8 @@
67
67
  "vitest": "^0.26.3",
68
68
  "vitest-axe": "^0.1.0",
69
69
  "vitest-canvas-mock": "^0.2.2",
70
- "@vygruppen/tsconfig": "0.1.1",
71
- "@vygruppen/eslint-config": "1.1.1"
70
+ "@vygruppen/eslint-config": "1.1.1",
71
+ "@vygruppen/tsconfig": "0.1.1"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "react": ">=18.0.0 <19.0.0",
@@ -1,21 +1,10 @@
1
- import {
2
- CheckboxGroup as ChakraCheckboxGroup,
3
- CheckboxGroupProps as ChakraCheckboxGroupProps,
4
- Stack,
5
- } from "@chakra-ui/react";
6
- import React, { forwardRef } from "react";
1
+ import { CheckboxGroup as ChakraCheckboxGroup, Stack } from "@chakra-ui/react";
2
+ import React from "react";
7
3
 
8
- export type CheckboxGroupProps = Exclude<
9
- ChakraCheckboxGroupProps,
10
- "colorPalette" | "size" | "variant"
4
+ export type CheckboxGroupProps = React.ComponentProps<
5
+ typeof ChakraCheckboxGroup
11
6
  > & {
12
- /* Defaults to row */
13
7
  direction?: "row" | "column";
14
- children: React.ReactNode;
15
- /* Defaults to 1 */
16
- gap?: number | string;
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- [key: string]: any; //Find a way to not use type any
19
8
  };
20
9
  /**
21
10
  * Used to group several checkboxes together. You can pass the default value, as well as whether or not they're all disabled
@@ -36,19 +25,19 @@ export type CheckboxGroupProps = Exclude<
36
25
  * <Checkbox>Business</Checkbox>
37
26
  * <Checkbox>First Class</Checkbox>
38
27
  * </CheckboxGroup>
28
+ * ```
39
29
  */
40
30
 
41
- export const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(
42
- (props, ref) => {
43
- const { direction = "row", children, gap = 1, ...rest } = props;
31
+ export const CheckboxGroup = (props: CheckboxGroupProps) => {
32
+ // Forwardref caues issue with prop types not working. Forwardref is unessessary here, as ChakraCheckbox already has a ref prop and is deprecated in react 19.
33
+ const { direction = "row", children, gap = 1, ...rest } = props;
44
34
 
45
- return (
46
- <ChakraCheckboxGroup ref={ref} {...rest}>
47
- <Stack direction={direction} gap={gap}>
48
- {children}
49
- </Stack>
50
- </ChakraCheckboxGroup>
51
- );
52
- },
53
- );
35
+ return (
36
+ <ChakraCheckboxGroup {...rest}>
37
+ <Stack direction={direction} gap={gap}>
38
+ {children}
39
+ </Stack>
40
+ </ChakraCheckboxGroup>
41
+ );
42
+ };
54
43
  CheckboxGroup.displayName = "CheckboxGroup";
@@ -28,7 +28,10 @@ export type FieldBaseProps = {
28
28
  floatingLabel?: boolean;
29
29
  };
30
30
 
31
- export type FieldProps = Omit<ChakraField.RootProps, "label" | "onChange"> &
31
+ export type FieldProps = Omit<
32
+ ChakraField.RootProps,
33
+ "label" | "onChange" | "onBlur"
34
+ > &
32
35
  React.PropsWithChildren<FieldVariantProps> &
33
36
  FieldBaseProps;
34
37
 
@@ -31,7 +31,7 @@ export const fieldSlotRecipe = defineSlotRecipe({
31
31
  textStyle: "xs",
32
32
  width: "fit-content",
33
33
  position: "absolute",
34
- bottom: -5,
34
+ top: "100%",
35
35
  left: 3,
36
36
  zIndex: "dropdown",
37
37
  maxWidth: "50ch",