@transferwise/components 46.71.4 → 46.71.5
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/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.js +5 -4
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.js.map +1 -1
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs +5 -4
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs.map +1 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx +10 -6
|
@@ -4,12 +4,13 @@ var React = require('react');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
|
|
6
6
|
const PolymorphicWithOverrides = /*#__PURE__*/React.forwardRef(function PolymorphicWithOverrides({
|
|
7
|
-
__overrides
|
|
8
|
-
as: Element,
|
|
9
|
-
...restOverrides
|
|
10
|
-
},
|
|
7
|
+
__overrides,
|
|
11
8
|
...restProps
|
|
12
9
|
}, ref) {
|
|
10
|
+
const {
|
|
11
|
+
as: Element,
|
|
12
|
+
...restOverrides
|
|
13
|
+
} = __overrides;
|
|
13
14
|
return /*#__PURE__*/jsxRuntime.jsx(Element, {
|
|
14
15
|
ref: ref,
|
|
15
16
|
...restProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolymorphicWithOverrides.js","sources":["../../../src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nexport interface PolymorphicWithOverridesProps {\n __overrides: {\n as: React.ElementType;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n * For overcoming the limitations of third-party components with an `as` prop.\n */\nexport const PolymorphicWithOverrides = forwardRef(function PolymorphicWithOverrides(\n
|
|
1
|
+
{"version":3,"file":"PolymorphicWithOverrides.js","sources":["../../../src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nexport interface PolymorphicWithOverridesProps {\n __overrides: {\n as: React.ElementType;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n * For overcoming the limitations of third-party components with an `as` prop.\n */\nexport const PolymorphicWithOverrides = forwardRef<Element | null, PolymorphicWithOverridesProps>(\n function PolymorphicWithOverrides(\n { __overrides, ...restProps },\n ref: React.ForwardedRef<Element | null>,\n ) {\n const { as: Element, ...restOverrides } =\n __overrides as PolymorphicWithOverridesProps['__overrides'];\n return <Element ref={ref} {...restProps} {...restOverrides} />;\n },\n);\n"],"names":["PolymorphicWithOverrides","forwardRef","__overrides","restProps","ref","as","Element","restOverrides","_jsx"],"mappings":";;;;;MAaaA,wBAAwB,gBAAGC,gBAAU,CAChD,SAASD,wBAAwBA,CAC/B;EAAEE,WAAW;EAAE,GAAGC,SAAAA;AAAS,CAAE,EAC7BC,GAAuC,EAAA;EAEvC,MAAM;AAAEC,IAAAA,EAAE,EAAEC,OAAO;IAAE,GAAGC,aAAAA;AAAa,GAAE,GACrCL,WAA2D,CAAA;EAC7D,oBAAOM,cAAA,CAACF,OAAO,EAAA;AAACF,IAAAA,GAAG,EAAEA,GAAI;AAAA,IAAA,GAAKD,SAAS;IAAA,GAAMI,aAAAA;AAAa,IAAI,CAAA;AAChE,CAAC;;;;"}
|
|
@@ -2,12 +2,13 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
const PolymorphicWithOverrides = /*#__PURE__*/forwardRef(function PolymorphicWithOverrides({
|
|
5
|
-
__overrides
|
|
6
|
-
as: Element,
|
|
7
|
-
...restOverrides
|
|
8
|
-
},
|
|
5
|
+
__overrides,
|
|
9
6
|
...restProps
|
|
10
7
|
}, ref) {
|
|
8
|
+
const {
|
|
9
|
+
as: Element,
|
|
10
|
+
...restOverrides
|
|
11
|
+
} = __overrides;
|
|
11
12
|
return /*#__PURE__*/jsx(Element, {
|
|
12
13
|
ref: ref,
|
|
13
14
|
...restProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolymorphicWithOverrides.mjs","sources":["../../../src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nexport interface PolymorphicWithOverridesProps {\n __overrides: {\n as: React.ElementType;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n * For overcoming the limitations of third-party components with an `as` prop.\n */\nexport const PolymorphicWithOverrides = forwardRef(function PolymorphicWithOverrides(\n
|
|
1
|
+
{"version":3,"file":"PolymorphicWithOverrides.mjs","sources":["../../../src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nexport interface PolymorphicWithOverridesProps {\n __overrides: {\n as: React.ElementType;\n [key: string]: unknown;\n };\n [key: string]: unknown;\n}\n\n/**\n * For overcoming the limitations of third-party components with an `as` prop.\n */\nexport const PolymorphicWithOverrides = forwardRef<Element | null, PolymorphicWithOverridesProps>(\n function PolymorphicWithOverrides(\n { __overrides, ...restProps },\n ref: React.ForwardedRef<Element | null>,\n ) {\n const { as: Element, ...restOverrides } =\n __overrides as PolymorphicWithOverridesProps['__overrides'];\n return <Element ref={ref} {...restProps} {...restOverrides} />;\n },\n);\n"],"names":["PolymorphicWithOverrides","forwardRef","__overrides","restProps","ref","as","Element","restOverrides","_jsx"],"mappings":";;;MAaaA,wBAAwB,gBAAGC,UAAU,CAChD,SAASD,wBAAwBA,CAC/B;EAAEE,WAAW;EAAE,GAAGC,SAAAA;AAAS,CAAE,EAC7BC,GAAuC,EAAA;EAEvC,MAAM;AAAEC,IAAAA,EAAE,EAAEC,OAAO;IAAE,GAAGC,aAAAA;AAAa,GAAE,GACrCL,WAA2D,CAAA;EAC7D,oBAAOM,GAAA,CAACF,OAAO,EAAA;AAACF,IAAAA,GAAG,EAAEA,GAAI;AAAA,IAAA,GAAKD,SAAS;IAAA,GAAMI,aAAAA;AAAa,IAAI,CAAA;AAChE,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolymorphicWithOverrides.d.ts","sourceRoot":"","sources":["../../../../src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE;QACX,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC;QACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"PolymorphicWithOverrides.d.ts","sourceRoot":"","sources":["../../../../src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,6BAA6B;IAC5C,WAAW,EAAE;QACX,EAAE,EAAE,KAAK,CAAC,WAAW,CAAC;QACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,uIASpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.71.
|
|
3
|
+
"version": "46.71.5",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@types/lodash": "4.17.6",
|
|
77
77
|
"@types/lodash.clamp": "^4.0.9",
|
|
78
78
|
"@types/lodash.debounce": "^4.0.9",
|
|
79
|
-
"@types/react": "^18.3.
|
|
80
|
-
"@types/react-dom": "^18.3.
|
|
79
|
+
"@types/react": "^18.3.11",
|
|
80
|
+
"@types/react-dom": "^18.3.1",
|
|
81
81
|
"@types/react-transition-group": "4.4.10",
|
|
82
82
|
"@wise/art": "^2.7.0",
|
|
83
83
|
"babel-plugin-formatjs": "^10.5.16",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"storybook": "^8.2.2",
|
|
94
94
|
"@transferwise/less-config": "3.1.0",
|
|
95
95
|
"@transferwise/neptune-css": "14.19.1",
|
|
96
|
-
"@wise/components-theming": "1.6.
|
|
96
|
+
"@wise/components-theming": "1.6.1"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@transferwise/icons": "^3.13.1",
|
|
@@ -11,9 +11,13 @@ export interface PolymorphicWithOverridesProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* For overcoming the limitations of third-party components with an `as` prop.
|
|
13
13
|
*/
|
|
14
|
-
export const PolymorphicWithOverrides = forwardRef
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
14
|
+
export const PolymorphicWithOverrides = forwardRef<Element | null, PolymorphicWithOverridesProps>(
|
|
15
|
+
function PolymorphicWithOverrides(
|
|
16
|
+
{ __overrides, ...restProps },
|
|
17
|
+
ref: React.ForwardedRef<Element | null>,
|
|
18
|
+
) {
|
|
19
|
+
const { as: Element, ...restOverrides } =
|
|
20
|
+
__overrides as PolymorphicWithOverridesProps['__overrides'];
|
|
21
|
+
return <Element ref={ref} {...restProps} {...restOverrides} />;
|
|
22
|
+
},
|
|
23
|
+
);
|