@cleanweb/oore 2.0.0-beta.4 → 2.0.0-beta.6

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 } from 'react';
1
+ import type { ReactElement, ReactNode, ComponentType, ReactPortal, JSX } from 'react';
2
2
  type JSXTagLike = string | keyof JSX.IntrinsicElements | ComponentType<any>;
3
3
  /** This fixes overly narrow T type used by React's ComponentProps type. */
4
4
  export type ComponentProps<T extends JSXTagLike> = (T extends ComponentType<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : {});
@@ -90,13 +90,13 @@ export type SlottedComponent<TOwner extends object = ComponentType<any>, TSlots
90
90
  requiredSlotAliases?: Array<keyof TSlots>;
91
91
  };
92
92
  export type TypedNode<P, T extends JSXTagLike> = (ReactElement<P, T> | (ReactElement<P, T> & ReactPortal));
93
- export type TSlotNode<TSlottted extends SlottedComponent> = TypedNode<ComponentProps<valueof<TSlottted['Slots']>>, valueof<TSlottted['Slots']>>;
93
+ export type TSlotNode<TSlotted extends SlottedComponent, Key extends keyof TSlotted['Slots'] = keyof TSlotted['Slots']> = (TypedNode<ComponentProps<TSlotted['Slots'][Key]>, TSlotted['Slots'][Key]>);
94
94
  /**
95
95
  * A record of slot aliases mapped to the corresponding `ReactNode`(s)
96
96
  * to be rendered for that slot.
97
97
  */
98
- export type TSlotNodes<TSlottted extends SlottedComponent> = {
99
- [Key in keyof TSlottted['Slots']]?: Array<TSlotNode<TSlottted>>;
98
+ export type TSlotNodes<TSlotted extends SlottedComponent> = {
99
+ [Key in keyof TSlotted['Slots']]?: Array<TSlotNode<TSlotted, Key>>;
100
100
  };
101
101
  export type TUseSlotsResult<TSlotted extends SlottedComponent> = Readonly<[
102
102
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.6",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=22"