@koobiq/react-components 0.0.1-beta.22 → 0.0.1-beta.23
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.
|
@@ -25,7 +25,7 @@ export type ButtonToggleGroupBaseProps = {
|
|
|
25
25
|
/** The initial selected key in the collection (uncontrolled). */
|
|
26
26
|
defaultSelectedKey?: ButtonToggleGroupKey;
|
|
27
27
|
/** Handler that is called when the selection changes. */
|
|
28
|
-
onSelectionChange?: (
|
|
28
|
+
onSelectionChange?: (key: ButtonToggleGroupKey) => void;
|
|
29
29
|
/** Unique identifier for testing purposes. */
|
|
30
30
|
'data-testid'?: string | number;
|
|
31
31
|
/** The props used for each slot inside. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useRef } from "react";
|
|
4
|
-
import { useDOMRef, useMultiRef, useBoolean,
|
|
4
|
+
import { useDOMRef, useMultiRef, useBoolean, mergeProps, clsx, FocusableProvider } from "@koobiq/react-core";
|
|
5
5
|
import { useTooltipTriggerState, useTooltipTrigger, useOverlayPosition, useTooltip, Overlay } from "@koobiq/react-primitives";
|
|
6
6
|
import { Transition } from "react-transition-group";
|
|
7
7
|
import { utilClasses } from "../../styles/utility.js";
|
|
@@ -40,7 +40,7 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
40
40
|
const domRef = useDOMRef(ref);
|
|
41
41
|
const controlRef = useRef(null);
|
|
42
42
|
const controlRefCallback = useMultiRef([controlRef]);
|
|
43
|
-
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
43
|
+
const { triggerProps, tooltipProps: tooltipTriggerProps } = useTooltipTrigger(
|
|
44
44
|
{
|
|
45
45
|
delay,
|
|
46
46
|
closeDelay,
|
|
@@ -66,7 +66,20 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
66
66
|
onClose: () => state.close(true),
|
|
67
67
|
targetRef: anchorRef || controlRef
|
|
68
68
|
});
|
|
69
|
-
const { tooltipProps:
|
|
69
|
+
const { tooltipProps: tooltipCommonProps } = useTooltip(overlayProps, state);
|
|
70
|
+
const tooltipProps = mergeProps(
|
|
71
|
+
{
|
|
72
|
+
className: clsx(
|
|
73
|
+
s.base,
|
|
74
|
+
s[variant],
|
|
75
|
+
utilClasses.typography["text-normal"]
|
|
76
|
+
),
|
|
77
|
+
ref: domRef
|
|
78
|
+
},
|
|
79
|
+
other,
|
|
80
|
+
tooltipCommonProps,
|
|
81
|
+
tooltipTriggerProps
|
|
82
|
+
);
|
|
70
83
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
84
|
/* @__PURE__ */ jsx(FocusableProvider, { ...triggerProps, ref: controlRef, children: control?.({
|
|
72
85
|
ref: controlRefCallback,
|
|
@@ -85,18 +98,11 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
85
98
|
children: (transition) => /* @__PURE__ */ jsx(Overlay, { portalContainer, children: /* @__PURE__ */ jsxs(
|
|
86
99
|
"div",
|
|
87
100
|
{
|
|
88
|
-
...
|
|
101
|
+
...tooltipProps,
|
|
89
102
|
"data-arrow": showArrow,
|
|
90
103
|
"data-variant": variant,
|
|
91
104
|
"data-placement": placement,
|
|
92
105
|
"data-transition": transition,
|
|
93
|
-
className: clsx(
|
|
94
|
-
s.base,
|
|
95
|
-
s[variant],
|
|
96
|
-
utilClasses.typography["text-normal"]
|
|
97
|
-
),
|
|
98
|
-
...other,
|
|
99
|
-
ref: domRef,
|
|
100
106
|
children: [
|
|
101
107
|
showArrow && /* @__PURE__ */ jsx(
|
|
102
108
|
"div",
|
package/dist/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-components",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.23",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@koobiq/design-tokens": "^3.12.1",
|
|
28
28
|
"@types/react-transition-group": "^4.4.12",
|
|
29
29
|
"react-transition-group": "^4.4.5",
|
|
30
|
-
"@koobiq/logger": "0.0.1-beta.
|
|
31
|
-
"@koobiq/react-core": "0.0.1-beta.
|
|
32
|
-
"@koobiq/react-icons": "0.0.1-beta.
|
|
33
|
-
"@koobiq/react-primitives": "0.0.1-beta.
|
|
30
|
+
"@koobiq/logger": "0.0.1-beta.23",
|
|
31
|
+
"@koobiq/react-core": "0.0.1-beta.23",
|
|
32
|
+
"@koobiq/react-icons": "0.0.1-beta.23",
|
|
33
|
+
"@koobiq/react-primitives": "0.0.1-beta.23"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@koobiq/design-tokens": "^3.11.2",
|