@vygruppen/spor-react 12.8.1 → 12.8.3
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 +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/index.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.mjs +20 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +1 -0
- package/src/input/CheckboxGroup.tsx +1 -1
- package/src/input/Field.tsx +1 -1
- package/src/theme/slot-recipes/field.ts +1 -1
- package/src/theme/slot-recipes/index.ts +1 -0
- package/src/theme/slot-recipes/popover.ts +2 -0
- package/src/tooltip.tsx +38 -0
package/package.json
CHANGED
package/src/index.tsx
CHANGED
@@ -4,7 +4,7 @@ import React from "react";
|
|
4
4
|
export type CheckboxGroupProps = React.ComponentProps<
|
5
5
|
typeof ChakraCheckboxGroup
|
6
6
|
> & {
|
7
|
-
direction
|
7
|
+
direction?: "row" | "column";
|
8
8
|
};
|
9
9
|
/**
|
10
10
|
* Used to group several checkboxes together. You can pass the default value, as well as whether or not they're all disabled
|
package/src/input/Field.tsx
CHANGED
@@ -30,7 +30,7 @@ export type FieldBaseProps = {
|
|
30
30
|
|
31
31
|
export type FieldProps = Omit<
|
32
32
|
ChakraField.RootProps,
|
33
|
-
"label" | "onChange" | "onBlur"
|
33
|
+
"label" | "onChange" | "onBlur"
|
34
34
|
> &
|
35
35
|
React.PropsWithChildren<FieldVariantProps> &
|
36
36
|
FieldBaseProps;
|
package/src/tooltip.tsx
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
import { Portal, Tooltip as ChakraTooltip } from "@chakra-ui/react";
|
4
|
+
import { forwardRef } from "react";
|
5
|
+
|
6
|
+
export const Tooltip = ChakraTooltip.Root;
|
7
|
+
|
8
|
+
export const TooltipTrigger = forwardRef<
|
9
|
+
HTMLButtonElement,
|
10
|
+
ChakraTooltip.TriggerProps
|
11
|
+
>(({ children, ...props }, ref) => {
|
12
|
+
const isStringChild = typeof children === "string";
|
13
|
+
|
14
|
+
return (
|
15
|
+
<ChakraTooltip.Trigger {...props} ref={ref} asChild={!isStringChild}>
|
16
|
+
{children}
|
17
|
+
</ChakraTooltip.Trigger>
|
18
|
+
);
|
19
|
+
});
|
20
|
+
TooltipTrigger.displayName = "TooltipTrigger";
|
21
|
+
|
22
|
+
export type TooltipProps = ChakraTooltip.ContentProps;
|
23
|
+
|
24
|
+
export const TooltipContent = forwardRef<HTMLDivElement, TooltipProps>(
|
25
|
+
({ children, ...props }, ref) => {
|
26
|
+
return (
|
27
|
+
<Portal>
|
28
|
+
<ChakraTooltip.Positioner>
|
29
|
+
<ChakraTooltip.Content ref={ref} {...props}>
|
30
|
+
<ChakraTooltip.Arrow />
|
31
|
+
<ChakraTooltip.Content {...props}>{children}</ChakraTooltip.Content>
|
32
|
+
</ChakraTooltip.Content>
|
33
|
+
</ChakraTooltip.Positioner>
|
34
|
+
</Portal>
|
35
|
+
);
|
36
|
+
},
|
37
|
+
);
|
38
|
+
TooltipContent.displayName = "TooltipContent";
|