@koobiq/react-primitives 0.21.0 → 0.21.1
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.
|
@@ -5,7 +5,7 @@ import { filterDOMProps } from "@koobiq/react-core";
|
|
|
5
5
|
import { useLocale } from "@react-aria/i18n";
|
|
6
6
|
import { useNumberField } from "@react-aria/numberfield";
|
|
7
7
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
8
|
-
import { useSlottedContext, removeDataAttributes, useRenderProps, Provider } from "../../utils/index.js";
|
|
8
|
+
import { useSlottedContext, removeDataAttributes, useRenderProps, Provider, DEFAULT_SLOT } from "../../utils/index.js";
|
|
9
9
|
import { GroupContext } from "../Group/GroupContext.js";
|
|
10
10
|
import { LabelContext } from "../Label/LabelContext.js";
|
|
11
11
|
import { InputContext } from "../Input/InputContext.js";
|
|
@@ -57,6 +57,7 @@ const NumberField = forwardRef(
|
|
|
57
57
|
ButtonContext,
|
|
58
58
|
{
|
|
59
59
|
slots: {
|
|
60
|
+
[DEFAULT_SLOT]: {},
|
|
60
61
|
increment: incrementButtonProps,
|
|
61
62
|
decrement: decrementButtonProps
|
|
62
63
|
}
|
|
@@ -66,6 +67,7 @@ const NumberField = forwardRef(
|
|
|
66
67
|
TextContext,
|
|
67
68
|
{
|
|
68
69
|
slots: {
|
|
70
|
+
[DEFAULT_SLOT]: {},
|
|
69
71
|
description: descriptionProps,
|
|
70
72
|
errorMessage: errorMessageProps
|
|
71
73
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { filterDOMProps } from "@koobiq/react-core";
|
|
5
|
-
import { useSlottedContext, removeDataAttributes, useRenderProps, Provider } from "../../utils/index.js";
|
|
5
|
+
import { useSlottedContext, removeDataAttributes, useRenderProps, Provider, DEFAULT_SLOT } from "../../utils/index.js";
|
|
6
6
|
import { useRadioGroupState } from "../../behaviors/useRadioGroupState.js";
|
|
7
7
|
import { useRadioGroup } from "../../behaviors/useRadioGroup.js";
|
|
8
8
|
import { FieldErrorContext } from "../FieldError/FieldError.js";
|
|
@@ -59,6 +59,7 @@ const RadioGroup = forwardRef(
|
|
|
59
59
|
TextContext,
|
|
60
60
|
{
|
|
61
61
|
slots: {
|
|
62
|
+
[DEFAULT_SLOT]: {},
|
|
62
63
|
description: descriptionProps,
|
|
63
64
|
errorMessage: errorMessageProps
|
|
64
65
|
}
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef, useRef, useCallback } from "react";
|
|
4
4
|
import { useLocalizedStringFormatter, useControlledState, useIsomorphicEffect, filterDOMProps } from "@koobiq/react-core";
|
|
5
5
|
import { useTextField } from "@react-aria/textfield";
|
|
6
|
-
import { useSlottedContext, removeDataAttributes, useRenderProps, Provider } from "../../utils/index.js";
|
|
6
|
+
import { useSlottedContext, removeDataAttributes, useRenderProps, Provider, DEFAULT_SLOT } from "../../utils/index.js";
|
|
7
7
|
import intlMessages from "./intl.json.js";
|
|
8
8
|
import { InputContext } from "../Input/InputContext.js";
|
|
9
9
|
import { TextareaContext } from "../Textarea/TextareaContext.js";
|
|
@@ -99,6 +99,7 @@ function TextFieldRender(props, ref) {
|
|
|
99
99
|
TextContext,
|
|
100
100
|
{
|
|
101
101
|
slots: {
|
|
102
|
+
[DEFAULT_SLOT]: {},
|
|
102
103
|
description: descriptionProps,
|
|
103
104
|
errorMessage: errorMessageProps
|
|
104
105
|
}
|
|
@@ -108,6 +109,7 @@ function TextFieldRender(props, ref) {
|
|
|
108
109
|
ButtonContext,
|
|
109
110
|
{
|
|
110
111
|
slots: {
|
|
112
|
+
[DEFAULT_SLOT]: {},
|
|
111
113
|
"clear-button": {
|
|
112
114
|
"aria-label": stringFormatter.format("clear"),
|
|
113
115
|
preventFocusOnPress: true,
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useContext } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useObjectRef, mergeRefs, mergeProps } from "@koobiq/react-core";
|
|
4
4
|
const DEFAULT_SLOT = Symbol("default");
|
|
5
5
|
function useRenderProps(props) {
|
|
6
6
|
const {
|
|
@@ -69,7 +69,7 @@ function removeDataAttributes(props) {
|
|
|
69
69
|
}
|
|
70
70
|
function useSlottedContext(context, slot) {
|
|
71
71
|
const ctx = useContext(context);
|
|
72
|
-
if (
|
|
72
|
+
if (slot === null) {
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
75
|
if (ctx && typeof ctx === "object" && "slots" in ctx && ctx.slots) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-primitives",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"@react-stately/toggle": "^3.9.2",
|
|
72
72
|
"@react-stately/tooltip": "^3.5.5",
|
|
73
73
|
"@react-stately/tree": "^3.8.9",
|
|
74
|
-
"@koobiq/
|
|
75
|
-
"@koobiq/
|
|
74
|
+
"@koobiq/logger": "0.21.1",
|
|
75
|
+
"@koobiq/react-core": "0.21.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": "18.x || 19.x",
|