@vygruppen/spor-react 13.1.2 → 13.1.4
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/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-postinstall.log +2 -2
- package/CHANGELOG.md +16 -0
- package/dist/index.cjs +48 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.mjs +49 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/input/PasswordInput.tsx +3 -2
- package/src/logo/VyLogo.tsx +14 -0
- package/src/popover/index.tsx +9 -3
- package/src/theme/slot-recipes/menu.ts +4 -0
- package/src/theme/slot-recipes/popover.ts +1 -2
- package/src/theme/slot-recipes/table.ts +0 -1
- package/src/tooltip.tsx +13 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vygruppen/spor-react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.1.
|
|
4
|
+
"version": "13.1.4",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"react-stately": "^3.31.1",
|
|
48
48
|
"react-swipeable": "^7.0.1",
|
|
49
49
|
"usehooks-ts": "^3.1.0",
|
|
50
|
-
"@vygruppen/spor-design-tokens": "5.0.
|
|
51
|
-
"@vygruppen/spor-
|
|
52
|
-
"@vygruppen/spor-
|
|
50
|
+
"@vygruppen/spor-design-tokens": "5.0.2",
|
|
51
|
+
"@vygruppen/spor-icon-react": "5.0.0",
|
|
52
|
+
"@vygruppen/spor-loader": "0.7.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@react-types/datepicker": "^3.10.0",
|
|
@@ -16,7 +16,8 @@ export interface PasswordVisibilityProps {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface PasswordInputProps
|
|
19
|
-
extends InputProps,
|
|
19
|
+
extends InputProps,
|
|
20
|
+
PasswordVisibilityProps {
|
|
20
21
|
rootProps?: InputProps;
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -68,7 +69,7 @@ export const PasswordInput = ({
|
|
|
68
69
|
return (
|
|
69
70
|
<Input
|
|
70
71
|
ref={ref}
|
|
71
|
-
startElement={startElement
|
|
72
|
+
startElement={startElement}
|
|
72
73
|
label={label}
|
|
73
74
|
type={visible ? "text" : "password"}
|
|
74
75
|
endElement={
|
package/src/logo/VyLogo.tsx
CHANGED
|
@@ -77,6 +77,14 @@ export const VyLogo = ({
|
|
|
77
77
|
clipRule="evenodd"
|
|
78
78
|
d="M98.49.07h-1.82c-2.98 0-4.6 1.49-5.63 5.06l-6.52 21.79a18.22 18.22 0 0 1-1.67 3.96c.57.78 1.17 1.26 1.76 1.38 1.13-.96 2.06-2.75 2.89-5.46l6.49-21.67c.9-3.1 2.23-4.63 4.5-4.98a.04.04 0 0 0 0-.08Z"
|
|
79
79
|
fill={fillForAccent}
|
|
80
|
+
display={{ _light: "block", _dark: "none" }}
|
|
81
|
+
/>
|
|
82
|
+
<Path
|
|
83
|
+
fillRule="evenodd"
|
|
84
|
+
clipRule="evenodd"
|
|
85
|
+
d="M98.49.07h-1.82c-2.98 0-4.6 1.49-5.63 5.06l-6.52 21.79a18.22 18.22 0 0 1-1.67 3.96c.57.78 1.17 1.26 1.76 1.38 1.13-.96 2.06-2.75 2.89-5.46l6.49-21.67c.9-3.1 2.23-4.63 4.5-4.98a.04.04 0 0 0 0-.08Z"
|
|
86
|
+
fill="main"
|
|
87
|
+
display={{ _light: "none", _dark: "block" }}
|
|
80
88
|
/>
|
|
81
89
|
<Path
|
|
82
90
|
fillRule="evenodd"
|
|
@@ -112,6 +120,12 @@ export const VyLogo = ({
|
|
|
112
120
|
<Path
|
|
113
121
|
d="M53.78 1.44a4.64 4.64 0 0 0-4.17.93A10.79 10.79 0 0 0 46.19 8L34.53 47.72c-.58 1.93-1.2 3.75-2.56 4.87-.62.5-1.4.86-2.39 1.01a.04.04 0 0 0 0 .08h1.8c1.57 0 2.69-.41 3.53-1.1 1.36-1.1 1.98-2.93 2.56-4.86L49.05 8.3c.73-2.74 1.95-4.63 3.43-5.9.43-.36.88-.68 1.35-.95l-.05-.01Z"
|
|
114
122
|
fill={fillForAccent}
|
|
123
|
+
display={{ _light: "block", _dark: "none" }}
|
|
124
|
+
/>
|
|
125
|
+
<Path
|
|
126
|
+
d="M53.78 1.44a4.64 4.64 0 0 0-4.17.93A10.79 10.79 0 0 0 46.19 8L34.53 47.72c-.58 1.93-1.2 3.75-2.56 4.87-.62.5-1.4.86-2.39 1.01a.04.04 0 0 0 0 .08h1.8c1.57 0 2.69-.41 3.53-1.1 1.36-1.1 1.98-2.93 2.56-4.86L49.05 8.3c.73-2.74 1.95-4.63 3.43-5.9.43-.36.88-.68 1.35-.95l-.05-.01Z"
|
|
127
|
+
fill="main"
|
|
128
|
+
display={{ _light: "none", _dark: "block" }}
|
|
115
129
|
/>
|
|
116
130
|
</SVGGroup>
|
|
117
131
|
<Path
|
package/src/popover/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
Box,
|
|
4
5
|
Popover as ChakraPopover,
|
|
5
6
|
Portal,
|
|
6
7
|
usePopoverContext,
|
|
@@ -22,8 +23,13 @@ export const PopoverTrigger = ({
|
|
|
22
23
|
const isStringChild = typeof children === "string";
|
|
23
24
|
|
|
24
25
|
return (
|
|
25
|
-
<ChakraPopover.Trigger
|
|
26
|
-
{
|
|
26
|
+
<ChakraPopover.Trigger
|
|
27
|
+
ref={ref}
|
|
28
|
+
asChild={!isStringChild}
|
|
29
|
+
width={isStringChild ? undefined : "fit-content"}
|
|
30
|
+
{...props}
|
|
31
|
+
>
|
|
32
|
+
{isStringChild ? children : <Box>{children}</Box>}
|
|
27
33
|
</ChakraPopover.Trigger>
|
|
28
34
|
);
|
|
29
35
|
};
|
|
@@ -58,6 +64,7 @@ export const PopoverContent = ({
|
|
|
58
64
|
<ChakraPopover.Positioner>
|
|
59
65
|
<ChakraPopover.Content ref={ref} {...props}>
|
|
60
66
|
<ChakraPopover.Arrow />
|
|
67
|
+
<ChakraPopover.Body {...props}>{children}</ChakraPopover.Body>
|
|
61
68
|
{showCloseButton && (
|
|
62
69
|
<div>
|
|
63
70
|
<ChakraPopover.CloseTrigger asChild>
|
|
@@ -68,7 +75,6 @@ export const PopoverContent = ({
|
|
|
68
75
|
</ChakraPopover.CloseTrigger>
|
|
69
76
|
</div>
|
|
70
77
|
)}
|
|
71
|
-
<ChakraPopover.Body {...props}>{children}</ChakraPopover.Body>
|
|
72
78
|
</ChakraPopover.Content>
|
|
73
79
|
</ChakraPopover.Positioner>
|
|
74
80
|
</Portal>
|
|
@@ -36,6 +36,7 @@ export const menuSlotRecipe = defineSlotRecipe({
|
|
|
36
36
|
display: "flex",
|
|
37
37
|
justifyContent: "space-between",
|
|
38
38
|
gap: 1.5,
|
|
39
|
+
cursor: "pointer",
|
|
39
40
|
|
|
40
41
|
_hover: {
|
|
41
42
|
backgroundColor: "surface.accent.hover",
|
|
@@ -68,18 +69,21 @@ export const menuSlotRecipe = defineSlotRecipe({
|
|
|
68
69
|
display: "flex",
|
|
69
70
|
justifyContent: "space-between",
|
|
70
71
|
gap: 2,
|
|
72
|
+
cursor: "pointer",
|
|
71
73
|
},
|
|
72
74
|
triggerItem: {
|
|
73
75
|
display: "flex",
|
|
74
76
|
justifyContent: "space-between",
|
|
75
77
|
gap: 1.5,
|
|
76
78
|
alignItems: "center",
|
|
79
|
+
cursor: "pointer",
|
|
77
80
|
},
|
|
78
81
|
checkboxItem: {
|
|
79
82
|
display: "flex",
|
|
80
83
|
gap: 2,
|
|
81
84
|
alignItems: "center",
|
|
82
85
|
width: "full",
|
|
86
|
+
cursor: "pointer",
|
|
83
87
|
},
|
|
84
88
|
},
|
|
85
89
|
variants: {
|
|
@@ -9,7 +9,7 @@ export const popoverSlotRecipe = defineSlotRecipe({
|
|
|
9
9
|
content: {
|
|
10
10
|
position: "relative",
|
|
11
11
|
display: "flex",
|
|
12
|
-
flexDirection: "row
|
|
12
|
+
flexDirection: "row",
|
|
13
13
|
color: "text.brand",
|
|
14
14
|
|
|
15
15
|
gap: "0.625rem",
|
|
@@ -35,7 +35,6 @@ export const popoverSlotRecipe = defineSlotRecipe({
|
|
|
35
35
|
},
|
|
36
36
|
body: {
|
|
37
37
|
color: "text.brand",
|
|
38
|
-
|
|
39
38
|
alignItems: "center",
|
|
40
39
|
borderRadius: "sm",
|
|
41
40
|
zIndex: "inherit",
|
package/src/tooltip.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { Portal, Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
|
3
|
+
import { Box, Portal, Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
|
4
4
|
|
|
5
5
|
export const Tooltip = ChakraTooltip.Root;
|
|
6
6
|
|
|
@@ -14,17 +14,20 @@ export const TooltipTrigger = ({
|
|
|
14
14
|
const isStringChild = typeof children === "string";
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<ChakraTooltip.Trigger
|
|
18
|
-
{children}
|
|
17
|
+
<ChakraTooltip.Trigger ref={ref} asChild={!isStringChild} {...props}>
|
|
18
|
+
{isStringChild ? children : <Box width="fit-content">{children}</Box>}
|
|
19
19
|
</ChakraTooltip.Trigger>
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
export type TooltipProps = ChakraTooltip.ContentProps
|
|
23
|
+
export type TooltipProps = ChakraTooltip.ContentProps & {
|
|
24
|
+
showArrow?: boolean;
|
|
25
|
+
};
|
|
24
26
|
|
|
25
27
|
export const TooltipContent = ({
|
|
26
28
|
ref,
|
|
27
29
|
children,
|
|
30
|
+
showArrow = false,
|
|
28
31
|
...props
|
|
29
32
|
}: TooltipProps & {
|
|
30
33
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -33,8 +36,12 @@ export const TooltipContent = ({
|
|
|
33
36
|
<Portal>
|
|
34
37
|
<ChakraTooltip.Positioner>
|
|
35
38
|
<ChakraTooltip.Content ref={ref} {...props}>
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
{showArrow && (
|
|
40
|
+
<ChakraTooltip.Arrow>
|
|
41
|
+
<ChakraTooltip.ArrowTip />
|
|
42
|
+
</ChakraTooltip.Arrow>
|
|
43
|
+
)}
|
|
44
|
+
{children}
|
|
38
45
|
</ChakraTooltip.Content>
|
|
39
46
|
</ChakraTooltip.Positioner>
|
|
40
47
|
</Portal>
|