@koobiq/react-components 0.20.0 → 0.21.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,5 +1,6 @@
1
1
  import type { ReactNode, ComponentRef } from 'react';
2
- import { type ExtendableComponentPropsWithRef } from '@koobiq/react-core';
2
+ import type { ExtendableComponentPropsWithRef } from '@koobiq/react-core';
3
+ import type { ContextValue } from '@koobiq/react-primitives';
3
4
  export type DialogBodyRef = ComponentRef<'div'>;
4
5
  export type DialogBodyProps = ExtendableComponentPropsWithRef<{
5
6
  /** Additional CSS-classes. */
@@ -9,5 +10,5 @@ export type DialogBodyProps = ExtendableComponentPropsWithRef<{
9
10
  /** Unique identifier for testing purposes. */
10
11
  'data-testid'?: string;
11
12
  }, 'div'>;
12
- export declare const DialogBodyContext: import("react").Context<DialogBodyProps>;
13
+ export declare const DialogBodyContext: import("react").Context<ContextValue<DialogBodyProps, HTMLDivElement>>;
13
14
  export declare const DialogBody: import("react").ForwardRefExoticComponent<Omit<DialogBodyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { createContext, forwardRef, useContext } from "react";
4
- import { mergeProps, clsx, useMultiRef } from "@koobiq/react-core";
3
+ import { createContext, forwardRef } from "react";
4
+ import { clsx } from "@koobiq/react-core";
5
+ import { useContextProps } from "@koobiq/react-primitives";
5
6
  import { utilClasses } from "../../../styles/utility.js";
6
7
  import s from "../Dialog.module.css.js";
7
- const DialogBodyContext = createContext({});
8
+ const DialogBodyContext = createContext(null);
8
9
  const DialogBody = forwardRef(
9
10
  ({ children, className, ...other }, ref) => {
10
- const defaultProps = useContext(DialogBodyContext);
11
- const { ref: contextRef } = mergeProps(defaultProps, other);
11
+ const [, ctxRef] = useContextProps({}, ref, DialogBodyContext);
12
12
  return /* @__PURE__ */ jsx(
13
13
  "div",
14
14
  {
15
- ref: useMultiRef([ref, contextRef]),
15
+ ref: ctxRef,
16
16
  className: clsx(
17
17
  s.content,
18
18
  utilClasses.typography["text-normal"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koobiq/react-components",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,10 +28,10 @@
28
28
  "@koobiq/design-tokens": "^3.15.0",
29
29
  "@types/react-transition-group": "^4.4.12",
30
30
  "react-transition-group": "^4.4.5",
31
- "@koobiq/logger": "0.20.0",
32
- "@koobiq/react-icons": "0.20.0",
33
- "@koobiq/react-primitives": "0.20.0",
34
- "@koobiq/react-core": "0.20.0"
31
+ "@koobiq/logger": "0.21.0",
32
+ "@koobiq/react-core": "0.21.0",
33
+ "@koobiq/react-icons": "0.21.0",
34
+ "@koobiq/react-primitives": "0.21.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@koobiq/design-tokens": "^3.15.0",