@cleanweb/oore 2.0.0-alpha.31 → 2.0.0-alpha.33

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,4 +1,4 @@
1
- import type { ReactElement, ReactNode, ComponentType, ReactPortal, JSX } from 'react';
1
+ import type { ReactElement, ReactNode, ComponentType, JSX } from 'react';
2
2
  /** @todo ComponentType force children to be ReactNode, but custom components can have any children type. */
3
3
  type JSXTagLike = string | keyof JSX.IntrinsicElements | ComponentType<any>;
4
4
  /** This fixes overly narrow T type used by React's ComponentProps type. */
@@ -85,7 +85,9 @@ export type SlottedComponent<TOwner extends object = ComponentType<any>, TSlots
85
85
  Slots: TSlots;
86
86
  requiredSlotAliases?: Array<keyof TSlots>;
87
87
  };
88
- export type TypedNode<P, T extends JSXTagLike> = (ReactElement<P, T> | (ReactElement<P, T> & ReactPortal));
88
+ export type TypedNode<P, T extends JSXTagLike> = Omit<ReactElement<P>, 'type'> & {
89
+ type: T;
90
+ };
89
91
  export type TSlotNode<TSlotted extends SlottedComponent, Key extends keyof TSlotted['Slots'] = keyof TSlotted['Slots']> = (TypedNode<ComponentProps<TSlotted['Slots'][Key]>, TSlotted['Slots'][Key]>);
90
92
  /**
91
93
  * A record of slot aliases mapped to the corresponding `ReactNode`(s)
@@ -1,4 +1,4 @@
1
- import type { ReactElement, ReactNode, ComponentType, ReactPortal, JSX } from 'react';
1
+ import type { ReactElement, ReactNode, ComponentType, JSX } from 'react';
2
2
  /** @todo ComponentType force children to be ReactNode, but custom components can have any children type. */
3
3
  type JSXTagLike = string | keyof JSX.IntrinsicElements | ComponentType<any>;
4
4
  /** This fixes overly narrow T type used by React's ComponentProps type. */
@@ -85,7 +85,9 @@ export type SlottedComponent<TOwner extends object = ComponentType<any>, TSlots
85
85
  Slots: TSlots;
86
86
  requiredSlotAliases?: Array<keyof TSlots>;
87
87
  };
88
- export type TypedNode<P, T extends JSXTagLike> = (ReactElement<P, T> | (ReactElement<P, T> & ReactPortal));
88
+ export type TypedNode<P, T extends JSXTagLike> = Omit<ReactElement<P>, 'type'> & {
89
+ type: T;
90
+ };
89
91
  export type TSlotNode<TSlotted extends SlottedComponent, Key extends keyof TSlotted['Slots'] = keyof TSlotted['Slots']> = (TypedNode<ComponentProps<TSlotted['Slots'][Key]>, TSlotted['Slots'][Key]>);
90
92
  /**
91
93
  * A record of slot aliases mapped to the corresponding `ReactNode`(s)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "2.0.0-alpha.31",
3
+ "version": "2.0.0-alpha.33",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=22"