@aliexme/react-utils 2.5.2 → 3.0.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.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './components';
2
2
  export * from './hooks';
3
+ export * from './lib';
@@ -0,0 +1 @@
1
+ export * from './override';
@@ -0,0 +1,11 @@
1
+ import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
2
+ export interface OverridableComponent<P, D extends ElementType> {
3
+ <C extends ElementType = D>(props: {
4
+ as: C;
5
+ } & OverrideProps<C, P>): ReactNode;
6
+ (props: OverrideProps<D, P>): ReactNode;
7
+ }
8
+ export type OverrideProps<C extends ElementType, P> = P & Omit<ComponentPropsWithRef<C>, keyof P>;
9
+ export type PropsWithOverride<P = unknown, C extends ElementType = ElementType> = P & {
10
+ as?: C;
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliexme/react-utils",
3
- "version": "2.5.2",
3
+ "version": "3.0.0",
4
4
  "description": "React utilities",
5
5
  "private": false,
6
6
  "author": "Alexander Smirnov <al.smirnov996@gmail.com>",
@@ -36,12 +36,12 @@
36
36
  "@aliexme/js-utils": "^2.3.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/react": "19.0.12",
40
- "@vitejs/plugin-react": "4.3.4",
39
+ "@types/react": "19.1.8",
40
+ "@vitejs/plugin-react": "4.5.2",
41
41
  "react": "19.1.0"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": "^18.0.0 || ^19.0.0"
44
+ "react": "^19.0.0"
45
45
  },
46
- "gitHead": "6c40c2572e104b50bf5c90d8387bafbc27433641"
46
+ "gitHead": "321970688f8f10ed7dade8a34bdc39bee724f4c8"
47
47
  }