@nimbus-ds/typings 1.2.0 → 1.3.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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  This package is intended for internal use in creating components with polymorphic typing.
4
4
 
5
+ ## 2025-07-29 `1.3.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added `SVGElementProps` type to support SVG element props in gradient applications and icon components. ([#321](https://github.com/TiendaNube/nimbus-design-system/pull/321) by [@joacotornello](https://github.com/joacotornello))
10
+
11
+ ## 2025-03-20 `1.2.1`
12
+
13
+ #### 🐛 Bug fixes
14
+
15
+ - Rebuild after failed release. ([#277](https://github.com/TiendaNube/nimbus-design-system/pull/277) by [@joacotornello](https://github.com/joacotornello))
16
+
5
17
  ## 2025-03-18 `1.2.0`
6
18
 
7
19
  #### 🎉 New features
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ This package is intended for internal use in creating components with polymorphic typing.
4
+
5
+ ## 2025-07-29 `1.3.0`
6
+
7
+ #### 🎉 New features
8
+
9
+ - Added `SVGElementProps` type to support SVG element props in gradient applications and icon components. ([#321](https://github.com/TiendaNube/nimbus-design-system/pull/321) by [@joacotornello](https://github.com/joacotornello))
10
+
11
+ ## 2025-03-20 `1.2.1`
12
+
13
+ #### 🐛 Bug fixes
14
+
15
+ - Rebuild after failed release. ([#277](https://github.com/TiendaNube/nimbus-design-system/pull/277) by [@joacotornello](https://github.com/joacotornello))
16
+
17
+ ## 2025-03-18 `1.2.0`
18
+
19
+ #### 🎉 New features
20
+
21
+ - 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))
22
+
23
+ ### 💡 Others
24
+
25
+ - 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))
26
+
27
+ ## 2023-03-24 `1.1.0`
28
+
29
+ ### 🎉 New features
30
+
31
+ - 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))
32
+
33
+ ## 2023-02-08 `1.0.0`
34
+
35
+ ### 🎉 New features
36
+
37
+ - 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 ADDED
@@ -0,0 +1,17 @@
1
+ # `@nimbus-ds/typings`
2
+
3
+ [![@nimbus-ds/typings](https://img.shields.io/npm/v/@nimbus-ds/typings?label=%40nimbus-ds%2Ftypings)](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.
@@ -0,0 +1,59 @@
1
+ // Generated by dts-bundle-generator v7.2.0
2
+
3
+ import React from 'react';
4
+ import { ForwardedRef, ReactNode, RefObject } from 'react';
5
+
6
+ export type Merge<P1 = {}, P2 = {}> = Omit<P1, keyof P2> & P2;
7
+ /**
8
+ * Properties for SVG elements including common attributes and flexible extension.
9
+ * Used for typing SVG element props in gradient applications and icon components.
10
+ */
11
+ export type SVGElementProps = {
12
+ fill?: string;
13
+ stroke?: string;
14
+ children?: ReactNode;
15
+ [key: string]: unknown;
16
+ };
17
+ /**
18
+ * Infers the OwnProps if E is a ForwardRefExoticComponentWithAs
19
+ */
20
+ export type OwnProps<E> = E extends PolymorphicForwardRefComponent<any, infer P> ? P : {};
21
+ /**
22
+ * Infers the JSX.IntrinsicElement if E is a ForwardRefExoticComponentWithAs
23
+ */
24
+ export type IntrinsicElement<E> = E extends PolymorphicForwardRefComponent<infer I, any> ? I : never;
25
+ export type ForwardRefExoticComponent<E, OwnProps> = React.ForwardRefExoticComponent<Merge<E extends React.ElementType ? React.ComponentPropsWithRef<E> : never, OwnProps & {
26
+ as?: E;
27
+ }>>;
28
+ export interface PolymorphicForwardRefComponent<IntrinsicElementString, OwnProps = {}
29
+ /**
30
+ * Extends original type to ensure built in React types play nice
31
+ * with polymorphic components still e.g. `React.ElementRef` etc.
32
+ */
33
+ > extends ForwardRefExoticComponent<IntrinsicElementString, OwnProps> {
34
+ /**
35
+ * When `as` prop is passed, use this overload.
36
+ * Merges original own props (without DOM props) and the inferred props
37
+ * from `as` element with the own props taking precendence.
38
+ *
39
+ * We explicitly avoid `React.ElementType` and manually narrow the prop types
40
+ * so that events are typed when using JSX.IntrinsicElements.
41
+ */
42
+ <As = IntrinsicElementString>(props: As extends "" ? {
43
+ as: keyof JSX.IntrinsicElements;
44
+ } : As extends React.ComponentType<infer P> ? Merge<P, OwnProps & {
45
+ as: As;
46
+ }> : As extends keyof JSX.IntrinsicElements ? Merge<JSX.IntrinsicElements[As], OwnProps & {
47
+ as: As;
48
+ }> : never): React.ReactElement | null;
49
+ }
50
+ /**
51
+ * Use a ref object as the imperative handle for a forwarded ref. This can be used to
52
+ * synchronize the ref object with the forwarded ref and allow local access the reference
53
+ * instance with `.current`.
54
+ *
55
+ * **NOTE**: The `refObject` should be passed to the underlying element, NOT the `forwardedRef`.
56
+ */
57
+ export declare function useRefObjectAsForwardedRef<T>(forwardedRef: ForwardedRef<T>, refObject: RefObject<T>): void;
58
+
59
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
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})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimbus-ds/typings",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -22,6 +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"
25
+ "@nimbus-ds/webpack": "^1.5.1"
26
26
  }
27
27
  }