@transferwise/components 0.0.0-experimental-b3b1d01 → 0.0.0-experimental-d953b10
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/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/types/common/circle/Circle.d.ts +20 -0
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common/circle/Circle.story.tsx +1 -0
- package/src/common/circle/Circle.tsx +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;\n\nexport type Props = {\n as?: React.ElementType;\n size?: ShapeSize;\n fixedSize?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n return (\n <Element\n {...props}\n ref={ref}\n style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}\n className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["Circle","forwardRef","as","Element","children","size","fixedSize","className","style","props","ref","_jsx","clsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Circle.js","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n return (\n <Element\n {...props}\n ref={ref}\n style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}\n className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["Circle","forwardRef","as","Element","children","size","fixedSize","className","style","props","ref","_jsx","clsx"],"mappings":";;;;;;AAqBA,MAAMA,MAAM,gBAAGC,gBAAU,CAAC,SAASD,MAAMA,CACvC;EACEE,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,SAAS,GAAG,KAAK;EACjBC,SAAS;EACTC,KAAK;EACL,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;EAEH,oBACEC,cAAA,CAACR,OAAO,EAAA;AAAA,IAAA,GACFM,KAAK;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTF,IAAAA,KAAK,EAAE;AAAE,MAAA,GAAGA,KAAK;MAAE,eAAe,EAAEF,SAAS,GAAG,CAAA,EAAGD,IAAI,CAAI,EAAA,CAAA,GAAG,cAAcA,IAAI,CAAA,CAAA,CAAA;KAAM;IACtFE,SAAS,EAAEK,SAAI,CAAC,WAAW,EAAE,kDAAkD,EAAEL,SAAS,CAAE;AAAAH,IAAAA,QAAA,EAE3FA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.mjs","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;\n\nexport type Props = {\n as?: React.ElementType;\n size?: ShapeSize;\n fixedSize?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n return (\n <Element\n {...props}\n ref={ref}\n style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}\n className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["Circle","forwardRef","as","Element","children","size","fixedSize","className","style","props","ref","_jsx","clsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"Circle.mjs","sources":["../../../src/common/circle/Circle.tsx"],"sourcesContent":["import { HTMLAttributes, forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nexport type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;\n\nexport type Props = {\n /**\n * Modify underlying element, `div` by default\n */\n as?: React.ElementType;\n /**\n * Set size of the circle in px, `48` by default\n */\n size?: ShapeSize;\n /**\n * When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)\n * as those can be dynamic a at certain viewport sizes\n */\n fixedSize?: boolean;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst Circle = forwardRef(function Circle(\n {\n as: Element = 'div',\n children,\n size = 48,\n fixedSize = false,\n className,\n style,\n ...props\n }: Props,\n ref,\n) {\n return (\n <Element\n {...props}\n ref={ref}\n style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}\n className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}\n >\n {children}\n </Element>\n );\n});\n\nexport default Circle;\n"],"names":["Circle","forwardRef","as","Element","children","size","fixedSize","className","style","props","ref","_jsx","clsx"],"mappings":";;;;AAqBA,MAAMA,MAAM,gBAAGC,UAAU,CAAC,SAASD,MAAMA,CACvC;EACEE,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,QAAQ;AACRC,EAAAA,IAAI,GAAG,EAAE;AACTC,EAAAA,SAAS,GAAG,KAAK;EACjBC,SAAS;EACTC,KAAK;EACL,GAAGC,KAAAA;AAAK,CACF,EACRC,GAAG,EAAA;EAEH,oBACEC,GAAA,CAACR,OAAO,EAAA;AAAA,IAAA,GACFM,KAAK;AACTC,IAAAA,GAAG,EAAEA,GAAI;AACTF,IAAAA,KAAK,EAAE;AAAE,MAAA,GAAGA,KAAK;MAAE,eAAe,EAAEF,SAAS,GAAG,CAAA,EAAGD,IAAI,CAAI,EAAA,CAAA,GAAG,cAAcA,IAAI,CAAA,CAAA,CAAA;KAAM;IACtFE,SAAS,EAAEK,IAAI,CAAC,WAAW,EAAE,kDAAkD,EAAEL,SAAS,CAAE;AAAAH,IAAAA,QAAA,EAE3FA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd,CAAC;;;;"}
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
|
|
3
3
|
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* Modify underlying element, `div` by default
|
|
6
|
+
*/
|
|
4
7
|
as?: React.ElementType;
|
|
8
|
+
/**
|
|
9
|
+
* Set size of the circle in px, `48` by default
|
|
10
|
+
*/
|
|
5
11
|
size?: ShapeSize;
|
|
12
|
+
/**
|
|
13
|
+
* When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)
|
|
14
|
+
* as those can be dynamic a at certain viewport sizes
|
|
15
|
+
*/
|
|
6
16
|
fixedSize?: boolean;
|
|
7
17
|
} & HTMLAttributes<HTMLDivElement>;
|
|
8
18
|
declare const Circle: import("react").ForwardRefExoticComponent<{
|
|
19
|
+
/**
|
|
20
|
+
* Modify underlying element, `div` by default
|
|
21
|
+
*/
|
|
9
22
|
as?: React.ElementType;
|
|
23
|
+
/**
|
|
24
|
+
* Set size of the circle in px, `48` by default
|
|
25
|
+
*/
|
|
10
26
|
size?: ShapeSize;
|
|
27
|
+
/**
|
|
28
|
+
* When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)
|
|
29
|
+
* as those can be dynamic a at certain viewport sizes
|
|
30
|
+
*/
|
|
11
31
|
fixedSize?: boolean;
|
|
12
32
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<unknown>>;
|
|
13
33
|
export default Circle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../src/common/circle/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,QAAA,MAAM,MAAM;
|
|
1
|
+
{"version":3,"file":"Circle.d.ts","sourceRoot":"","sources":["../../../../src/common/circle/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,QAAA,MAAM,MAAM;IAfV;;OAEG;SACE,KAAK,CAAC,WAAW;IACtB;;OAEG;WACI,SAAS;IAChB;;;OAGG;gBACS,OAAO;4EAyBnB,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-d953b10",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -92,12 +92,12 @@
|
|
|
92
92
|
"rollup-preserve-directives": "^1.1.1",
|
|
93
93
|
"storybook": "^8.2.2",
|
|
94
94
|
"@transferwise/less-config": "3.1.0",
|
|
95
|
-
"@transferwise/neptune-css": "0.0.0-experimental-
|
|
95
|
+
"@transferwise/neptune-css": "0.0.0-experimental-d953b10",
|
|
96
96
|
"@wise/components-theming": "1.6.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@transferwise/icons": "^3.13.1",
|
|
100
|
-
"@transferwise/neptune-css": "0.0.0-experimental-
|
|
100
|
+
"@transferwise/neptune-css": "0.0.0-experimental-d953b10",
|
|
101
101
|
"@wise/art": "^2.7.0",
|
|
102
102
|
"@wise/components-theming": "^1.0.0",
|
|
103
103
|
"react": ">=18",
|
|
@@ -4,8 +4,18 @@ import { clsx } from 'clsx';
|
|
|
4
4
|
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
|
|
5
5
|
|
|
6
6
|
export type Props = {
|
|
7
|
+
/**
|
|
8
|
+
* Modify underlying element, `div` by default
|
|
9
|
+
*/
|
|
7
10
|
as?: React.ElementType;
|
|
11
|
+
/**
|
|
12
|
+
* Set size of the circle in px, `48` by default
|
|
13
|
+
*/
|
|
8
14
|
size?: ShapeSize;
|
|
15
|
+
/**
|
|
16
|
+
* When `true` will use the fixed size (`48px`) instead of the CSS spacing variable (`--size-*`)
|
|
17
|
+
* as those can be dynamic a at certain viewport sizes
|
|
18
|
+
*/
|
|
9
19
|
fixedSize?: boolean;
|
|
10
20
|
} & HTMLAttributes<HTMLDivElement>;
|
|
11
21
|
|