@vygruppen/spor-react 13.4.1 → 13.4.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": "13.4.1",
4
+ "version": "13.4.2",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -9,6 +9,7 @@ interface DialogContentProps extends ChakraDialog.ContentProps {
9
9
  portalRef?: React.RefObject<HTMLElement>;
10
10
  backdrop?: boolean;
11
11
  children?: React.ReactNode;
12
+ positionerProps?: ChakraDialog.PositionerProps;
12
13
  }
13
14
 
14
15
  export const DialogContent = ({
@@ -22,13 +23,14 @@ export const DialogContent = ({
22
23
  portalled = true,
23
24
  portalRef,
24
25
  backdrop = true,
26
+ positionerProps,
25
27
  ...rest
26
28
  } = props;
27
29
 
28
30
  return (
29
31
  <Portal disabled={!portalled} container={portalRef}>
30
32
  {backdrop && <ChakraDialog.Backdrop />}
31
- <ChakraDialog.Positioner>
33
+ <ChakraDialog.Positioner {...positionerProps}>
32
34
  <ChakraDialog.Content ref={ref} {...rest} asChild={false}>
33
35
  {children}
34
36
  </ChakraDialog.Content>
@@ -6,6 +6,7 @@ import {
6
6
  defineRecipe,
7
7
  Group,
8
8
  GroupProps,
9
+ IconButtonProps,
9
10
  RecipeVariantProps,
10
11
  useRecipe,
11
12
  } from "@chakra-ui/react";
@@ -40,10 +41,22 @@ export type AttachedInputsProps = RecipeVariantProps<
40
41
  onFlip: () => void;
41
42
  flipAriaLabel: string;
42
43
  }
43
- );
44
+ ) & {
45
+ flipButtonProps?: Omit<
46
+ IconButtonProps,
47
+ | "icon"
48
+ | "aria-label"
49
+ | "onClick"
50
+ | "variant"
51
+ | "size"
52
+ | "orientation"
53
+ | "spinner"
54
+ >;
55
+ };
44
56
 
45
57
  export const AttachedInputs = ({
46
58
  ref,
59
+ flipButtonProps,
47
60
  ...props
48
61
  }: AttachedInputsProps & {
49
62
  ref?: React.Ref<HTMLDivElement>;
@@ -76,6 +89,10 @@ export const AttachedInputs = ({
76
89
  size={["xs", null, "sm"]}
77
90
  aria-label={flipAriaLabel}
78
91
  onClick={onFlip}
92
+ position="absolute"
93
+ bg="bg"
94
+ outlineWidth="1px"
95
+ {...flipButtonProps}
79
96
  />
80
97
  </Box>
81
98
  );
@@ -85,24 +102,20 @@ const SwitchButton = chakra(
85
102
  IconButton,
86
103
  defineRecipe({
87
104
  base: {
88
- position: "absolute !important",
89
- zIndex: "101 !important",
90
- // eslint-disable-next-line spor/use-semantic-tokens
91
- bg: "bg !important",
92
- outlineWidth: "1px !important",
93
-
105
+ zIndex: "101",
94
106
  _focus: {
95
- outlineOffset: "0px !important",
107
+ outlineOffset: "0px",
108
+ alignItems: "center",
96
109
  },
97
110
  },
98
111
  variants: {
99
112
  orientation: {
100
113
  horizontal: {
101
- top: "calc(50% - 18px)",
102
- right: "calc(50% - 18px)",
114
+ top: "calc(50% - 1.1rem)",
115
+ right: "calc(50% - 1.1rem)",
103
116
  },
104
117
  vertical: {
105
- top: "calc(50% - 15px)",
118
+ top: "calc(50% - 1.1rem)",
106
119
  right: "3rem",
107
120
  transform: "rotate(90deg)",
108
121
  },
@@ -1,5 +1,4 @@
1
1
  import { defineSlotRecipe } from "@chakra-ui/react";
2
- import tokens from "@vygruppen/spor-design-tokens";
3
2
 
4
3
  import { breadcrumbAnatomy } from "./anatomy";
5
4
 
@@ -15,9 +14,9 @@ export const breadcrumbSlotRecipe = defineSlotRecipe({
15
14
  link: {
16
15
  cursor: "pointer",
17
16
  borderRadius: "xs",
17
+ textDecoration: "underline",
18
18
  },
19
19
  currentLink: {
20
- borderRadius: "xs",
21
20
  cursor: "default",
22
21
  },
23
22
  separator: {
@@ -32,12 +31,10 @@ export const breadcrumbSlotRecipe = defineSlotRecipe({
32
31
  core: {
33
32
  link: {
34
33
  _hover: {
35
- outlineColor: "outline.core.hover",
36
- outlineWidth: tokens.size.stroke.md,
37
- outlineStyle: "solid",
34
+ textDecoration: "none",
35
+
38
36
  _active: {
39
37
  backgroundColor: "surface.core.active",
40
- outline: "none",
41
38
  },
42
39
  },
43
40
  },
@@ -3,10 +3,18 @@ import {
3
3
  Badge as ChakraBadge,
4
4
  BadgeProps as ChakraBadgeProps,
5
5
  Box,
6
+ RecipeVariantProps,
6
7
  } from "@chakra-ui/react";
7
8
  import { IconComponent } from "@vygruppen/spor-icon-react";
8
9
 
9
- export type BadgeProps = ChakraBadgeProps & { icon?: IconComponent };
10
+ import { badgeRecipie } from "../theme/recipes/badge";
11
+
12
+ type BadgeVariantProps = RecipeVariantProps<typeof badgeRecipie>;
13
+
14
+ export type BadgeProps = ChakraBadgeProps & {
15
+ colorPalette?: BadgeVariantProps["colorPalette"];
16
+ icon?: IconComponent;
17
+ };
10
18
 
11
19
  export const Badge = function Badge({
12
20
  ref,