@nimbus-ds/typings 1.2.0-rc.2 → 1.2.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/CHANGELOG.md +10 -0
- package/package.json +3 -4
- package/dist/CHANGELOG.md +0 -15
- package/dist/README.md +0 -17
- package/dist/index.d.ts +0 -49
- package/dist/index.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
This package is intended for internal use in creating components with polymorphic typing.
|
|
4
4
|
|
|
5
|
+
## 2025-03-18 `1.2.0`
|
|
6
|
+
|
|
7
|
+
#### 🎉 New features
|
|
8
|
+
|
|
9
|
+
- Adds `use-client` directive to the build output in order to support NextJS applications. ([#276](https://github.com/TiendaNube/nimbus-design-system/pull/276) by [@joacotornello](https://github.com/joacotornello))
|
|
10
|
+
|
|
11
|
+
### 💡 Others
|
|
12
|
+
|
|
13
|
+
- Rebuild after build process changes to add support for modular imports and Server Components. ([#276](https://github.com/TiendaNube/nimbus-design-system/pull/276) by [@joacotornello](https://github.com/joacotornello))
|
|
14
|
+
|
|
5
15
|
## 2023-03-24 `1.1.0`
|
|
6
16
|
|
|
7
17
|
### 🎉 New features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-ds/typings",
|
|
3
|
-
"version": "1.2.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"url": "https://github.com/TiendaNube/nimbus-design-system/issues"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@nimbus-ds/webpack": "^1.5.0
|
|
26
|
-
}
|
|
27
|
-
"stableVersion": "1.1.0"
|
|
25
|
+
"@nimbus-ds/webpack": "^1.5.0"
|
|
26
|
+
}
|
|
28
27
|
}
|
package/dist/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
This package is intended for internal use in creating components with polymorphic typing.
|
|
4
|
-
|
|
5
|
-
## 2023-03-24 `1.1.0`
|
|
6
|
-
|
|
7
|
-
### 🎉 New features
|
|
8
|
-
|
|
9
|
-
- Added useRefObjectAsForwardedRef hook used to sync ref object with forwarded ref and allow local access to instance reference with `.current`. ([#134](https://github.com/TiendaNube/nimbus-design-system/pull/134) by [@juniorconquista](https://github.com/juniorconquista))
|
|
10
|
-
|
|
11
|
-
## 2023-02-08 `1.0.0`
|
|
12
|
-
|
|
13
|
-
### 🎉 New features
|
|
14
|
-
|
|
15
|
-
- Added types that support dynamic typing of polymorphic components. ([#81](https://github.com/TiendaNube/nimbus-design-system/pull/81) by [@juniorconquista](https://github.com/juniorconquista))
|
package/dist/README.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# `@nimbus-ds/typings`
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@nimbus-ds/typings)
|
|
4
|
-
|
|
5
|
-
This package is intended for internal use in creating components with polymorphic typing.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
$ yarn add @nimbus-ds/typings
|
|
11
|
-
# or
|
|
12
|
-
$ npm install @nimbus-ds/typings
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
This is an internal utility, not intended for public usage.
|
package/dist/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v7.2.0
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { ForwardedRef, RefObject } from 'react';
|
|
5
|
-
|
|
6
|
-
export type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
|
|
7
|
-
/**
|
|
8
|
-
* Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
|
|
9
|
-
*/
|
|
10
|
-
export type OwnProps<E> = E extends PolymorphicForwardRefComponent<any, infer P> ? P : {};
|
|
11
|
-
/**
|
|
12
|
-
* Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
|
|
13
|
-
*/
|
|
14
|
-
export type IntrinsicElement<E> = E extends PolymorphicForwardRefComponent<infer I, any> ? I : never;
|
|
15
|
-
export type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
|
|
16
|
-
as?: E;
|
|
17
|
-
}>>;
|
|
18
|
-
export interface PolymorphicForwardRefComponent<IntrinsicElementString, OwnProps = {}
|
|
19
|
-
/**
|
|
20
|
-
* Extends original type to ensure built in React types play nice
|
|
21
|
-
* with polymorphic components still e.g. `React.ElementRef` etc.
|
|
22
|
-
*/
|
|
23
|
-
> extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
|
|
24
|
-
/**
|
|
25
|
-
* When `as` prop is passed, use this overload.
|
|
26
|
-
* Merges original own props (without DOM props) and the inferred props
|
|
27
|
-
* from `as` element with the own props taking precendence.
|
|
28
|
-
*
|
|
29
|
-
* We explicitly avoid `React.ElementType` and manually narrow the prop types
|
|
30
|
-
* so that events are typed when using JSX.IntrinsicElements.
|
|
31
|
-
*/
|
|
32
|
-
<As = IntrinsicElementString>(props: As extends "" ? {
|
|
33
|
-
as: keyof JSX.IntrinsicElements;
|
|
34
|
-
} : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
|
|
35
|
-
as: As;
|
|
36
|
-
}> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
|
|
37
|
-
as: As;
|
|
38
|
-
}> : never): React.ReactElement | null;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Use a ref object as the imperative handle for a forwarded ref. This can be used to
|
|
42
|
-
* synchronize the ref object with the forwarded ref and allow local access the reference
|
|
43
|
-
* instance with `.current`.
|
|
44
|
-
*
|
|
45
|
-
* **NOTE**: The `refObject` should be passed to the underlying element, NOT the `forwardedRef`.
|
|
46
|
-
*/
|
|
47
|
-
export declare function useRefObjectAsForwardedRef<T>(forwardedRef: ForwardedRef<T>, refObject: RefObject<T>): void;
|
|
48
|
-
|
|
49
|
-
export {};
|
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports["@nimbus-ds/typings"]=r(require("react")):e["@nimbus-ds/typings"]=r(e.react)}(global,(e=>(()=>{"use strict";var r={155:r=>{r.exports=e}},t={};function o(e){var s=t[e];if(void 0!==s)return s.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,o),n.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.useRefObjectAsForwardedRef=void 0;const r=o(155);e.useRefObjectAsForwardedRef=function(e,t){(0,r.useImperativeHandle)(e,(()=>t.current))}})(),s})()));
|