@koobiq/react-primitives 0.22.0 → 0.23.0
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.
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { polymorphicForwardRef,
|
|
3
|
+
import { polymorphicForwardRef, useObjectRef, filterDOMProps, mergeProps } from "@koobiq/react-core";
|
|
4
4
|
import { useRenderProps } from "../../utils/index.js";
|
|
5
5
|
import { useLink } from "../../behaviors/useLink.js";
|
|
6
6
|
const Link = polymorphicForwardRef((props, ref) => {
|
|
7
7
|
const { as: Tag = "a", ...other } = props;
|
|
8
|
-
const domRef =
|
|
8
|
+
const domRef = useObjectRef(ref);
|
|
9
9
|
const { isHovered, isPressed, isFocusVisible, isFocused, linkProps } = useLink(
|
|
10
10
|
{
|
|
11
11
|
...other,
|
|
12
|
+
elementType: `${Tag}`,
|
|
12
13
|
...other.isDisabled && {
|
|
13
14
|
onPress: void 0,
|
|
14
15
|
onPressStart: void 0,
|
|
@@ -34,6 +35,8 @@ const Link = polymorphicForwardRef((props, ref) => {
|
|
|
34
35
|
...props,
|
|
35
36
|
values: renderValues
|
|
36
37
|
});
|
|
38
|
+
const DOMProps = filterDOMProps(props, { global: true });
|
|
39
|
+
delete DOMProps.onClick;
|
|
37
40
|
return /* @__PURE__ */ jsx(
|
|
38
41
|
Tag,
|
|
39
42
|
{
|
|
@@ -42,7 +45,7 @@ const Link = polymorphicForwardRef((props, ref) => {
|
|
|
42
45
|
"data-focused": isFocused || void 0,
|
|
43
46
|
"data-disabled": props.isDisabled || void 0,
|
|
44
47
|
"data-focus-visible": isFocusVisible || void 0,
|
|
45
|
-
...mergeProps(
|
|
48
|
+
...mergeProps(DOMProps, renderProps, linkProps),
|
|
46
49
|
..."tabIndex" in props && { tabIndex: props.tabIndex },
|
|
47
50
|
ref: domRef,
|
|
48
51
|
children: renderProps.children
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-primitives",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"@react-stately/toggle": "^3.9.2",
|
|
74
74
|
"@react-stately/tooltip": "^3.5.5",
|
|
75
75
|
"@react-stately/tree": "^3.8.9",
|
|
76
|
-
"@koobiq/logger": "0.
|
|
77
|
-
"@koobiq/react-core": "0.
|
|
76
|
+
"@koobiq/logger": "0.23.0",
|
|
77
|
+
"@koobiq/react-core": "0.23.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"react": "18.x || 19.x",
|