@transferwise/components 0.0.0-experimental-37d8e2c → 0.0.0-experimental-dabe7c7
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/actionButton/ActionButton.js +1 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +1 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +7 -2
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +8 -3
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/avatar/Avatar.js +1 -4
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +1 -4
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatar/colors/colors.js +1 -1
- package/build/avatar/colors/colors.js.map +1 -1
- package/build/avatar/colors/colors.mjs +1 -1
- package/build/avatar/colors/colors.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +9 -6
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +8 -5
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +1 -6
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +1 -6
- package/build/badge/Badge.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +7 -4
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +7 -4
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/circle/Circle.js +1 -24
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +1 -24
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/display/Display.js +1 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +1 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/index.js +0 -6
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -3
- package/build/index.mjs.map +1 -1
- package/build/main.css +56 -82
- package/build/statusIcon/StatusIcon.js +2 -4
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +2 -4
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/actionButton/ActionButton.css +11 -0
- package/build/styles/actionOption/ActionOption.css +4 -0
- package/build/styles/badge/Badge.css +5 -5
- package/build/styles/circularButton/CircularButton.css +24 -0
- package/build/styles/common/circle/Circle.css +0 -17
- package/build/styles/main.css +56 -82
- package/build/styles/statusIcon/StatusIcon.css +12 -0
- package/build/types/actionButton/ActionButton.d.ts +3 -3
- package/build/types/actionButton/ActionButton.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +2 -2
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/avatar/Avatar.d.ts +0 -3
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatar/colors/colors.d.ts +1 -1
- package/build/types/avatar/colors/colors.d.ts.map +1 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts +0 -3
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts +1 -2
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +1 -1
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/build/types/common/index.d.ts +0 -1
- package/build/types/index.d.ts +1 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +2 -6
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/actionButton/ActionButton.css +11 -0
- package/src/actionButton/ActionButton.less +14 -0
- package/src/actionButton/ActionButton.story.tsx +7 -0
- package/src/actionButton/ActionButton.tsx +7 -3
- package/src/actionOption/ActionOption.css +4 -0
- package/src/actionOption/ActionOption.less +3 -0
- package/src/actionOption/ActionOption.story.tsx +4 -0
- package/src/actionOption/ActionOption.tsx +15 -2
- package/src/avatar/Avatar.tsx +1 -4
- package/src/avatar/colors/colors.ts +4 -4
- package/src/avatarWrapper/AvatarWrapper.tsx +16 -12
- package/src/badge/Badge.css +5 -5
- package/src/badge/Badge.less +3 -3
- package/src/badge/Badge.tsx +1 -10
- package/src/circularButton/CircularButton.css +24 -0
- package/src/circularButton/CircularButton.less +15 -15
- package/src/circularButton/CircularButton.tsx +5 -4
- package/src/common/circle/Circle.css +0 -17
- package/src/common/circle/Circle.less +0 -22
- package/src/common/circle/Circle.tsx +2 -33
- package/src/common/index.js +0 -1
- package/src/display/Display.tsx +1 -1
- package/src/index.ts +0 -4
- package/src/main.css +56 -82
- package/src/main.less +1 -3
- package/src/statusIcon/StatusIcon.css +12 -0
- package/src/statusIcon/StatusIcon.less +6 -6
- package/src/statusIcon/StatusIcon.story.tsx +28 -32
- package/src/statusIcon/StatusIcon.tsx +4 -18
- package/build/avatarView/AvatarView.js +0 -207
- package/build/avatarView/AvatarView.js.map +0 -1
- package/build/avatarView/AvatarView.mjs +0 -205
- package/build/avatarView/AvatarView.mjs.map +0 -1
- package/build/common/initials.js +0 -12
- package/build/common/initials.js.map +0 -1
- package/build/common/initials.mjs +0 -10
- package/build/common/initials.mjs.map +0 -1
- package/build/common/notificationDot/NotificationDot.js +0 -16
- package/build/common/notificationDot/NotificationDot.js.map +0 -1
- package/build/common/notificationDot/NotificationDot.mjs +0 -14
- package/build/common/notificationDot/NotificationDot.mjs.map +0 -1
- package/build/styles/avatarGroup/AvatarGroup.css +0 -28
- package/build/styles/avatarView/AvatarView.css +0 -22
- package/build/styles/common/notificationDot/NotificationDot.css +0 -10
- package/build/types/avatarGroup/AvatarGroup.d.ts +0 -19
- package/build/types/avatarGroup/AvatarGroup.d.ts.map +0 -1
- package/build/types/avatarGroup/index.d.ts +0 -3
- package/build/types/avatarGroup/index.d.ts.map +0 -1
- package/build/types/avatarView/AvatarView.d.ts +0 -25
- package/build/types/avatarView/AvatarView.d.ts.map +0 -1
- package/build/types/avatarView/index.d.ts +0 -3
- package/build/types/avatarView/index.d.ts.map +0 -1
- package/build/types/common/initials.d.ts +0 -2
- package/build/types/common/initials.d.ts.map +0 -1
- package/build/types/common/notificationDot/NotificationDot.d.ts +0 -8
- package/build/types/common/notificationDot/NotificationDot.d.ts.map +0 -1
- package/src/avatarGroup/AvatarGroup.css +0 -28
- package/src/avatarGroup/AvatarGroup.less +0 -32
- package/src/avatarGroup/AvatarGroup.story.tsx +0 -249
- package/src/avatarGroup/AvatarGroup.tsx +0 -78
- package/src/avatarGroup/index.ts +0 -2
- package/src/avatarView/AvatarView.css +0 -22
- package/src/avatarView/AvatarView.less +0 -24
- package/src/avatarView/AvatarView.story.tsx +0 -425
- package/src/avatarView/AvatarView.tsx +0 -217
- package/src/avatarView/index.ts +0 -2
- package/src/common/initials.ts +0 -13
- package/src/common/notificationDot/NotificationDot.css +0 -10
- package/src/common/notificationDot/NotificationDot.less +0 -7
- package/src/common/notificationDot/NotificationDot.tsx +0 -10
- package/src/test-utils/avatar-img.webp +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
+
import { cloneElement } from 'react';
|
|
2
3
|
import Body from '../body/Body.mjs';
|
|
3
4
|
import { typeClassMap, priorityClassMap } from '../button/classMap.mjs';
|
|
4
5
|
import Circle from '../common/circle/Circle.mjs';
|
|
@@ -18,11 +19,14 @@ const CircularButton = ({
|
|
|
18
19
|
...rest
|
|
19
20
|
}) => {
|
|
20
21
|
const classes = clsx('btn np-btn', 'm-b-1', typeClassMap[type], priorityClassMap[priority]);
|
|
22
|
+
const iconElement = Number(icon.props.size) !== 24 ? /*#__PURE__*/cloneElement(icon, {
|
|
23
|
+
size: 24
|
|
24
|
+
}) : icon;
|
|
21
25
|
const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
22
26
|
return /*#__PURE__*/jsxs("label", {
|
|
23
27
|
className: clsx('np-circular-btn', priority, type, disabled && 'disabled', className),
|
|
24
28
|
children: [/*#__PURE__*/jsx(Circle, {
|
|
25
|
-
as: "
|
|
29
|
+
as: "input"
|
|
26
30
|
// @ts-expect-error it's input[type=button] element
|
|
27
31
|
,
|
|
28
32
|
type: "button",
|
|
@@ -30,9 +34,8 @@ const CircularButton = ({
|
|
|
30
34
|
"aria-label": children,
|
|
31
35
|
className: classes,
|
|
32
36
|
disabled: disabled,
|
|
33
|
-
...rest
|
|
34
|
-
|
|
35
|
-
}), /*#__PURE__*/jsx(Body, {
|
|
37
|
+
...rest
|
|
38
|
+
}), iconElement, /*#__PURE__*/jsx(Body, {
|
|
36
39
|
as: "span",
|
|
37
40
|
className: "np-circular-btn__label",
|
|
38
41
|
type: Typography.BODY_DEFAULT_BOLD,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularButton.mjs","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { cloneElement } from 'react';\n\nimport Body from '../body/Body';\nimport { typeClassMap, priorityClassMap } from '../button/classMap';\nimport { Breakpoint, ControlType, Priority, Typography } from '../common';\nimport Circle from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport interface CircularButtonProps {\n className?: string;\n children: string;\n disabled?: boolean;\n icon: React.ReactElement<{ size?: unknown }>;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n priority?: `${Priority.PRIMARY | Priority.SECONDARY}`;\n type?: `${ControlType.ACCENT | ControlType.POSITIVE | ControlType.NEGATIVE}`;\n}\n\nconst CircularButton = ({\n className,\n children,\n disabled,\n icon,\n priority = Priority.PRIMARY,\n type = ControlType.ACCENT,\n ...rest\n}: CircularButtonProps) => {\n const classes = clsx('btn np-btn', 'm-b-1', typeClassMap[type], priorityClassMap[priority]);\n\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n return (\n <label className={clsx('np-circular-btn', priority, type, disabled && 'disabled', className)}>\n <Circle\n as=\"
|
|
1
|
+
{"version":3,"file":"CircularButton.mjs","sources":["../../src/circularButton/CircularButton.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { cloneElement } from 'react';\n\nimport Body from '../body/Body';\nimport { typeClassMap, priorityClassMap } from '../button/classMap';\nimport { Breakpoint, ControlType, Priority, Typography } from '../common';\nimport Circle from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport interface CircularButtonProps {\n className?: string;\n children: string;\n disabled?: boolean;\n icon: React.ReactElement<{ size?: unknown }>;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n priority?: `${Priority.PRIMARY | Priority.SECONDARY}`;\n type?: `${ControlType.ACCENT | ControlType.POSITIVE | ControlType.NEGATIVE}`;\n}\n\nconst CircularButton = ({\n className,\n children,\n disabled,\n icon,\n priority = Priority.PRIMARY,\n type = ControlType.ACCENT,\n ...rest\n}: CircularButtonProps) => {\n const classes = clsx('btn np-btn', 'm-b-1', typeClassMap[type], priorityClassMap[priority]);\n\n const iconElement = Number(icon.props.size) !== 24 ? cloneElement(icon, { size: 24 }) : icon;\n\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n\n return (\n <label className={clsx('np-circular-btn', priority, type, disabled && 'disabled', className)}>\n <Circle\n as=\"input\"\n // @ts-expect-error it's input[type=button] element\n type=\"button\"\n size={isTinyViewport ? 64 : 56}\n aria-label={children}\n className={classes}\n disabled={disabled}\n {...rest}\n />\n {iconElement}\n <Body as=\"span\" className=\"np-circular-btn__label\" type={Typography.BODY_DEFAULT_BOLD}>\n {children}\n </Body>\n </label>\n );\n};\n\nexport default CircularButton;\n"],"names":["CircularButton","className","children","disabled","icon","priority","Priority","PRIMARY","type","ControlType","ACCENT","rest","classes","clsx","typeClassMap","priorityClassMap","iconElement","Number","props","size","cloneElement","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsxs","_jsx","Circle","as","Body","Typography","BODY_DEFAULT_BOLD"],"mappings":";;;;;;;;;;;AAmBMA,MAAAA,cAAc,GAAGA,CAAC;EACtBC,SAAS;EACTC,QAAQ;EACRC,QAAQ;EACRC,IAAI;EACJC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,IAAI,GAAGC,WAAW,CAACC,MAAM;EACzB,GAAGC,IAAAA;AACiB,CAAA,KAAI;AACxB,EAAA,MAAMC,OAAO,GAAGC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAEC,YAAY,CAACN,IAAI,CAAC,EAAEO,gBAAgB,CAACV,QAAQ,CAAC,CAAC,CAAA;AAE3F,EAAA,MAAMW,WAAW,GAAGC,MAAM,CAACb,IAAI,CAACc,KAAK,CAACC,IAAI,CAAC,KAAK,EAAE,gBAAGC,YAAY,CAAChB,IAAI,EAAE;AAAEe,IAAAA,IAAI,EAAE,EAAA;GAAI,CAAC,GAAGf,IAAI,CAAA;EAE5F,MAAMiB,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AAExE,EAAA,oBACEC,IAAA,CAAA,OAAA,EAAA;AAAOxB,IAAAA,SAAS,EAAEY,IAAI,CAAC,iBAAiB,EAAER,QAAQ,EAAEG,IAAI,EAAEL,QAAQ,IAAI,UAAU,EAAEF,SAAS,CAAE;IAAAC,QAAA,EAAA,cAC3FwB,GAAA,CAACC,MAAM,EAAA;AACLC,MAAAA,EAAE,EAAC,OAAA;AACH;AAAA;AACApB,MAAAA,IAAI,EAAC,QAAQ;AACbW,MAAAA,IAAI,EAAEE,cAAc,GAAG,EAAE,GAAG,EAAG;AAC/B,MAAA,YAAA,EAAYnB,QAAS;AACrBD,MAAAA,SAAS,EAAEW,OAAQ;AACnBT,MAAAA,QAAQ,EAAEA,QAAS;MAAA,GACfQ,IAAAA;AAAI,KAEV,CAAA,EAACK,WAAW,eACZU,GAAA,CAACG,IAAI,EAAA;AAACD,MAAAA,EAAE,EAAC,MAAM;AAAC3B,MAAAA,SAAS,EAAC,wBAAwB;MAACO,IAAI,EAAEsB,UAAU,CAACC,iBAAkB;AAAA7B,MAAAA,QAAA,EACnFA,QAAAA;AAAQ,KACL,CACR,CAAA;AAAA,GAAO,CAAC,CAAA;AAEZ;;;;"}
|
|
@@ -4,27 +4,6 @@ var React = require('react');
|
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
|
-
const mapIconSize = {
|
|
8
|
-
16: 12,
|
|
9
|
-
24: 16,
|
|
10
|
-
32: 18,
|
|
11
|
-
40: 20,
|
|
12
|
-
48: 24,
|
|
13
|
-
56: 28,
|
|
14
|
-
72: 36
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* circle like components have custom font styles
|
|
18
|
-
*/
|
|
19
|
-
const mapFontSize = {
|
|
20
|
-
16: 8,
|
|
21
|
-
24: 12,
|
|
22
|
-
32: 14,
|
|
23
|
-
40: 18,
|
|
24
|
-
48: 22,
|
|
25
|
-
56: 26,
|
|
26
|
-
72: 30
|
|
27
|
-
};
|
|
28
7
|
const Circle = /*#__PURE__*/React.forwardRef(function Circle({
|
|
29
8
|
as: Element = 'div',
|
|
30
9
|
children,
|
|
@@ -39,9 +18,7 @@ const Circle = /*#__PURE__*/React.forwardRef(function Circle({
|
|
|
39
18
|
ref: ref,
|
|
40
19
|
style: {
|
|
41
20
|
...style,
|
|
42
|
-
'--circle-size': fixedSize ? `${size}px` : `var(--size-${size})
|
|
43
|
-
'--circle-icon-size': `${mapIconSize[size]}px`,
|
|
44
|
-
'--circle-font-size': `${mapFontSize[size]}px`
|
|
21
|
+
'--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`
|
|
45
22
|
},
|
|
46
23
|
className: clsx.clsx('np-circle', 'd-flex align-items-center justify-content-center', className),
|
|
47
24
|
children: children
|
|
@@ -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 | 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\
|
|
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;;;;"}
|
|
@@ -2,27 +2,6 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
const mapIconSize = {
|
|
6
|
-
16: 12,
|
|
7
|
-
24: 16,
|
|
8
|
-
32: 18,
|
|
9
|
-
40: 20,
|
|
10
|
-
48: 24,
|
|
11
|
-
56: 28,
|
|
12
|
-
72: 36
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* circle like components have custom font styles
|
|
16
|
-
*/
|
|
17
|
-
const mapFontSize = {
|
|
18
|
-
16: 8,
|
|
19
|
-
24: 12,
|
|
20
|
-
32: 14,
|
|
21
|
-
40: 18,
|
|
22
|
-
48: 22,
|
|
23
|
-
56: 26,
|
|
24
|
-
72: 30
|
|
25
|
-
};
|
|
26
5
|
const Circle = /*#__PURE__*/forwardRef(function Circle({
|
|
27
6
|
as: Element = 'div',
|
|
28
7
|
children,
|
|
@@ -37,9 +16,7 @@ const Circle = /*#__PURE__*/forwardRef(function Circle({
|
|
|
37
16
|
ref: ref,
|
|
38
17
|
style: {
|
|
39
18
|
...style,
|
|
40
|
-
'--circle-size': fixedSize ? `${size}px` : `var(--size-${size})
|
|
41
|
-
'--circle-icon-size': `${mapIconSize[size]}px`,
|
|
42
|
-
'--circle-font-size': `${mapFontSize[size]}px`
|
|
19
|
+
'--circle-size': fixedSize ? `${size}px` : `var(--size-${size})`
|
|
43
20
|
},
|
|
44
21
|
className: clsx('np-circle', 'd-flex align-items-center justify-content-center', className),
|
|
45
22
|
children: children
|
|
@@ -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 | 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\
|
|
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;;;;"}
|
package/build/display/Display.js
CHANGED
|
@@ -13,7 +13,7 @@ function Display({
|
|
|
13
13
|
}) {
|
|
14
14
|
return /*#__PURE__*/jsxRuntime.jsx(Heading, {
|
|
15
15
|
id: id,
|
|
16
|
-
className: clsx.clsx(
|
|
16
|
+
className: clsx.clsx(`np-text-${type}`, 'text-primary', className),
|
|
17
17
|
children: children
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Display.js","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx(
|
|
1
|
+
{"version":3,"file":"Display.js","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx(`np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,qBAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA,EAAAA;AACM,CAAA,EAAA;EACN,oBACEC,cAAA,CAACP,OAAO,EAAA;AAACM,IAAAA,EAAE,EAAEA,EAAG;IAACD,SAAS,EAAEG,SAAI,CAAC,CAAWP,QAAAA,EAAAA,IAAI,EAAE,EAAE,cAAc,EAAEI,SAAS,CAAE;AAAAD,IAAAA,QAAA,EAC5EA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Display.mjs","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx(
|
|
1
|
+
{"version":3,"file":"Display.mjs","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx(`np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,UAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA,EAAAA;AACM,CAAA,EAAA;EACN,oBACEC,GAAA,CAACP,OAAO,EAAA;AAACM,IAAAA,EAAE,EAAEA,EAAG;IAACD,SAAS,EAAEG,IAAI,CAAC,CAAWP,QAAAA,EAAAA,IAAI,EAAE,EAAE,cAAc,EAAEI,SAAS,CAAE;AAAAD,IAAAA,QAAA,EAC5EA,QAAAA;AAAQ,GACF,CAAC,CAAA;AAEd;;;;"}
|
package/build/index.js
CHANGED
|
@@ -8,7 +8,6 @@ var SelectOption = require('./selectOption/SelectOption.js');
|
|
|
8
8
|
var Alert = require('./alert/Alert.js');
|
|
9
9
|
var avatarTypes = require('./avatar/avatarTypes.js');
|
|
10
10
|
var Avatar = require('./avatar/Avatar.js');
|
|
11
|
-
var AvatarView = require('./avatarView/AvatarView.js');
|
|
12
11
|
var AvatarWrapper = require('./avatarWrapper/AvatarWrapper.js');
|
|
13
12
|
var Badge = require('./badge/Badge.js');
|
|
14
13
|
var Body = require('./body/Body.js');
|
|
@@ -98,7 +97,6 @@ var Upload = require('./upload/Upload.js');
|
|
|
98
97
|
var UploadInput = require('./uploadInput/UploadInput.js');
|
|
99
98
|
var useScreenSize = require('./common/hooks/useScreenSize.js');
|
|
100
99
|
var useSnackbar = require('./snackbar/useSnackbar.js');
|
|
101
|
-
var colors = require('./avatar/colors/colors.js');
|
|
102
100
|
var index$1 = require('./i18n/index.js');
|
|
103
101
|
var withId = require('./withId/withId.js');
|
|
104
102
|
var CheckboxButton = require('./checkboxButton/CheckboxButton.js');
|
|
@@ -126,7 +124,6 @@ var variant = require('./common/propsValues/variant.js');
|
|
|
126
124
|
var width = require('./common/propsValues/width.js');
|
|
127
125
|
var index = require('./common/locale/index.js');
|
|
128
126
|
var documentIosClick = require('./common/domHelpers/documentIosClick.js');
|
|
129
|
-
var initials = require('./common/initials.js');
|
|
130
127
|
|
|
131
128
|
|
|
132
129
|
|
|
@@ -144,7 +141,6 @@ Object.defineProperty(exports, "AvatarType", {
|
|
|
144
141
|
get: function () { return avatarTypes.AvatarType; }
|
|
145
142
|
});
|
|
146
143
|
exports.Avatar = Avatar;
|
|
147
|
-
exports.AvatarView = AvatarView;
|
|
148
144
|
exports.AvatarWrapper = AvatarWrapper;
|
|
149
145
|
exports.Badge = Badge;
|
|
150
146
|
exports.Body = Body;
|
|
@@ -256,7 +252,6 @@ Object.defineProperty(exports, "UploadStep", {
|
|
|
256
252
|
exports.UploadInput = UploadInput;
|
|
257
253
|
exports.useScreenSize = useScreenSize.useScreenSize;
|
|
258
254
|
exports.useSnackbar = useSnackbar;
|
|
259
|
-
exports.getAvatarColorFromSeed = colors.getAvatarColorFromSeed;
|
|
260
255
|
exports.translations = index$1;
|
|
261
256
|
exports.withId = withId;
|
|
262
257
|
exports.CheckboxButton = CheckboxButton;
|
|
@@ -353,5 +348,4 @@ exports.getDirectionFromLocale = index.getDirectionFromLocale;
|
|
|
353
348
|
exports.getLangFromLocale = index.getLangFromLocale;
|
|
354
349
|
exports.isBrowser = documentIosClick.isBrowser;
|
|
355
350
|
exports.isServerSide = documentIosClick.isServerSide;
|
|
356
|
-
exports.getInitials = initials.getInitials;
|
|
357
351
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/index.mjs
CHANGED
|
@@ -6,7 +6,6 @@ export { default as SelectOption } from './selectOption/SelectOption.mjs';
|
|
|
6
6
|
export { default as Alert, AlertArrowPosition } from './alert/Alert.mjs';
|
|
7
7
|
export { AvatarType } from './avatar/avatarTypes.mjs';
|
|
8
8
|
export { default as Avatar } from './avatar/Avatar.mjs';
|
|
9
|
-
export { default as AvatarView } from './avatarView/AvatarView.mjs';
|
|
10
9
|
export { default as AvatarWrapper } from './avatarWrapper/AvatarWrapper.mjs';
|
|
11
10
|
export { default as Badge } from './badge/Badge.mjs';
|
|
12
11
|
export { default as Body } from './body/Body.mjs';
|
|
@@ -96,7 +95,6 @@ export { default as Upload, UploadStep } from './upload/Upload.mjs';
|
|
|
96
95
|
export { default as UploadInput } from './uploadInput/UploadInput.mjs';
|
|
97
96
|
export { useScreenSize } from './common/hooks/useScreenSize.mjs';
|
|
98
97
|
export { default as useSnackbar } from './snackbar/useSnackbar.mjs';
|
|
99
|
-
export { getAvatarColorFromSeed } from './avatar/colors/colors.mjs';
|
|
100
98
|
export { default as translations } from './i18n/index.mjs';
|
|
101
99
|
export { default as withId } from './withId/withId.mjs';
|
|
102
100
|
export { default as CheckboxButton } from './checkboxButton/CheckboxButton.mjs';
|
|
@@ -124,5 +122,4 @@ export { Variant } from './common/propsValues/variant.mjs';
|
|
|
124
122
|
export { Width } from './common/propsValues/width.mjs';
|
|
125
123
|
export { DEFAULT_LANG, DEFAULT_LOCALE, RTL_LANGUAGES, SUPPORTED_LANGUAGES, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale } from './common/locale/index.mjs';
|
|
126
124
|
export { isBrowser, isServerSide } from './common/domHelpers/documentIosClick.mjs';
|
|
127
|
-
export { getInitials } from './common/initials.mjs';
|
|
128
125
|
//# sourceMappingURL=index.mjs.map
|
package/build/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/main.css
CHANGED
|
@@ -186,6 +186,10 @@ div.critical-comms .critical-comms-body {
|
|
|
186
186
|
background-color: var(--color-background-neutral);
|
|
187
187
|
color: var(--color-interactive-primary);
|
|
188
188
|
}
|
|
189
|
+
.np-action-btn.btn-priority-3 {
|
|
190
|
+
background-color: transparent !important;
|
|
191
|
+
color: var(--color-interactive-primary);
|
|
192
|
+
}
|
|
189
193
|
.np-action-btn:not(:disabled):hover {
|
|
190
194
|
background-color: #008fc9;
|
|
191
195
|
background-color: var(--color-interactive-accent-hover);
|
|
@@ -193,6 +197,9 @@ div.critical-comms .critical-comms-body {
|
|
|
193
197
|
.np-action-btn:not(:disabled):hover.btn-priority-2 {
|
|
194
198
|
background-color: var(--color-background-neutral-hover);
|
|
195
199
|
}
|
|
200
|
+
.np-action-btn:not(:disabled):hover.btn-priority-3 {
|
|
201
|
+
color: var(--color-interactive-primary-hover);
|
|
202
|
+
}
|
|
196
203
|
.np-action-btn:not(:disabled):active {
|
|
197
204
|
box-shadow: none;
|
|
198
205
|
border-color: transparent;
|
|
@@ -202,6 +209,10 @@ div.critical-comms .critical-comms-body {
|
|
|
202
209
|
.np-action-btn:not(:disabled):active.btn-priority-2 {
|
|
203
210
|
background-color: var(--color-background-neutral-active);
|
|
204
211
|
}
|
|
212
|
+
.np-action-btn:not(:disabled):active.btn-priority-3 {
|
|
213
|
+
color: var(--color-interactive-primary-active);
|
|
214
|
+
background-color: var(--color-background-screen-active) !important;
|
|
215
|
+
}
|
|
205
216
|
.np-action-btn:not(:disabled):focus {
|
|
206
217
|
box-shadow: none;
|
|
207
218
|
}
|
|
@@ -421,56 +432,6 @@ div.critical-comms .critical-comms-body {
|
|
|
421
432
|
.np-theme-personal .tw-avatar--outlined:not(.disabled):not(:disabled):hover {
|
|
422
433
|
border-color: var(--color-interactive-primary-hover);
|
|
423
434
|
}
|
|
424
|
-
.np-avatar-view {
|
|
425
|
-
border-radius: 9999px;
|
|
426
|
-
border-radius: var(--radius-full);
|
|
427
|
-
color: var(--color-interactive-primary);
|
|
428
|
-
height: -moz-fit-content;
|
|
429
|
-
height: fit-content;
|
|
430
|
-
width: -moz-fit-content;
|
|
431
|
-
width: fit-content;
|
|
432
|
-
}
|
|
433
|
-
.np-avatar-view .np-circle {
|
|
434
|
-
background-color: transparent;
|
|
435
|
-
border: var(--avatar-view-non-interactive-border-width) solid rgba(0,0,0,0.10196);
|
|
436
|
-
border: var(--avatar-view-non-interactive-border-width) solid var(--color-border-neutral);
|
|
437
|
-
}
|
|
438
|
-
.np-avatar-view-selected .np-circle {
|
|
439
|
-
border: var(--avatar-view-selected-border-width) solid var(--color-interactive-primary) !important;
|
|
440
|
-
}
|
|
441
|
-
.np-avatar-view-interactive .np-circle {
|
|
442
|
-
background-color: rgba(134,167,189,0.10196);
|
|
443
|
-
background-color: var(--color-background-neutral);
|
|
444
|
-
border: none;
|
|
445
|
-
}
|
|
446
|
-
.np-avatar-group {
|
|
447
|
-
display: inline-flex;
|
|
448
|
-
--np-avatar-group-size: 48px;
|
|
449
|
-
--np-avatar-size: 32px;
|
|
450
|
-
}
|
|
451
|
-
.np-avatar-group-diagonal {
|
|
452
|
-
width: var(--np-avatar-group-size);
|
|
453
|
-
height: var(--np-avatar-group-size);
|
|
454
|
-
}
|
|
455
|
-
.np-avatar-group-diagonal-mask {
|
|
456
|
-
-webkit-mask-image: radial-gradient(circle at right 100%, transparent, transparent calc(var(--np-avatar-size) / 1.8), black 0);
|
|
457
|
-
mask-image: radial-gradient(circle at right 100%, transparent, transparent calc(var(--np-avatar-size) / 1.8), black 0);
|
|
458
|
-
}
|
|
459
|
-
.np-avatar-group-diagonal-child {
|
|
460
|
-
margin-left: calc((var(--np-avatar-size) / 2) * -1);
|
|
461
|
-
margin-top: calc((var(--np-avatar-size) * var(--np-avatar-group-index)) / 2);
|
|
462
|
-
}
|
|
463
|
-
.np-avatar-group-horizontal {
|
|
464
|
-
width: calc((var(--np-avatar-size) * 2) - 2px);
|
|
465
|
-
height: var(--np-avatar-group-size);
|
|
466
|
-
}
|
|
467
|
-
.np-avatar-group-horizontal-mask {
|
|
468
|
-
-webkit-mask-image: radial-gradient(circle at right 50%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
|
|
469
|
-
mask-image: radial-gradient(circle at right 50%, transparent, transparent calc(var(--np-avatar-size) / 2), black 0);
|
|
470
|
-
}
|
|
471
|
-
.np-avatar-group-horizontal-child {
|
|
472
|
-
margin-left: calc((var(--np-avatar-size) / 4) * -1);
|
|
473
|
-
}
|
|
474
435
|
.tw-badge {
|
|
475
436
|
position: relative;
|
|
476
437
|
display: inline-block;
|
|
@@ -487,16 +448,16 @@ div.critical-comms .critical-comms-body {
|
|
|
487
448
|
--badge-border-color: rgba(0, 0, 0, 0.08);
|
|
488
449
|
}
|
|
489
450
|
.tw-badge > .tw-badge__children {
|
|
490
|
-
-webkit-mask-image: radial-gradient(circle at
|
|
491
|
-
mask-image: radial-gradient(circle at
|
|
451
|
+
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset)) left calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
452
|
+
mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset)) left calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
492
453
|
}
|
|
493
454
|
[dir="rtl"] .tw-badge > .tw-badge__children {
|
|
494
|
-
-webkit-mask-image: radial-gradient(circle at
|
|
495
|
-
mask-image: radial-gradient(circle at
|
|
455
|
+
-webkit-mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset)) right calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
456
|
+
mask-image: radial-gradient(circle at top calc(100% - var(--badge-mask-offset)) right calc(100% - var(--badge-mask-offset)), transparent 0, transparent calc(var(--badge-size) / 2 + var(--badge-mask)), black calc(var(--badge-size) / 2 + var(--badge-mask) + 0.5px));
|
|
496
457
|
}
|
|
497
458
|
.tw-badge > .tw-badge__content {
|
|
498
459
|
position: absolute;
|
|
499
|
-
bottom:
|
|
460
|
+
bottom: 0;
|
|
500
461
|
right: 0;
|
|
501
462
|
box-sizing: border-box;
|
|
502
463
|
text-align: center;
|
|
@@ -1035,6 +996,30 @@ div.critical-comms .critical-comms-body {
|
|
|
1035
996
|
cursor: pointer;
|
|
1036
997
|
position: relative;
|
|
1037
998
|
}
|
|
999
|
+
.np-circular-btn .tw-icon {
|
|
1000
|
+
position: absolute;
|
|
1001
|
+
top: 16px;
|
|
1002
|
+
top: var(--size-16);
|
|
1003
|
+
pointer-events: none;
|
|
1004
|
+
color: white;
|
|
1005
|
+
transition: color 0.15s ease-in-out;
|
|
1006
|
+
width: 100%;
|
|
1007
|
+
left: 0;
|
|
1008
|
+
}
|
|
1009
|
+
[dir="rtl"] .np-circular-btn .tw-icon {
|
|
1010
|
+
right: 0;
|
|
1011
|
+
left: auto;
|
|
1012
|
+
left: initial;
|
|
1013
|
+
}
|
|
1014
|
+
@media (max-width: 320px) {
|
|
1015
|
+
.np-circular-btn .tw-icon {
|
|
1016
|
+
top: 8px;
|
|
1017
|
+
top: var(--size-8);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
.np-circular-btn .tw-icon > svg {
|
|
1021
|
+
margin: 0 auto;
|
|
1022
|
+
}
|
|
1038
1023
|
.np-theme-personal .np-circular-btn {
|
|
1039
1024
|
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1040
1025
|
}
|
|
@@ -1183,23 +1168,6 @@ div.critical-comms .critical-comms-body {
|
|
|
1183
1168
|
width: var(--circle-size);
|
|
1184
1169
|
height: var(--circle-size);
|
|
1185
1170
|
flex-shrink: 0;
|
|
1186
|
-
font-size: var(--circle-font-size);
|
|
1187
|
-
font-weight: 600;
|
|
1188
|
-
font-weight: var(--font-weight-semi-bold);
|
|
1189
|
-
line-height: 1;
|
|
1190
|
-
}
|
|
1191
|
-
.np-circle img {
|
|
1192
|
-
border-radius: 9999px;
|
|
1193
|
-
border-radius: var(--radius-full);
|
|
1194
|
-
width: 100%;
|
|
1195
|
-
height: 100%;
|
|
1196
|
-
}
|
|
1197
|
-
.np-circle .np-display {
|
|
1198
|
-
font-size: var(--circle-font-size);
|
|
1199
|
-
}
|
|
1200
|
-
.np-circle .tw-icon > svg {
|
|
1201
|
-
height: var(--circle-icon-size);
|
|
1202
|
-
width: var(--circle-icon-size);
|
|
1203
1171
|
}
|
|
1204
1172
|
.np-bottom-sheet {
|
|
1205
1173
|
border-radius: 10px 10px 0 0;
|
|
@@ -1482,16 +1450,6 @@ button.np-option {
|
|
|
1482
1450
|
border-radius: var(--radius-small);
|
|
1483
1451
|
}
|
|
1484
1452
|
}
|
|
1485
|
-
.np-notification-dot {
|
|
1486
|
-
--badge-notification-dot-size: 14px;
|
|
1487
|
-
width: 14px;
|
|
1488
|
-
width: var(--badge-notification-dot-size);
|
|
1489
|
-
height: 14px;
|
|
1490
|
-
height: var(--badge-notification-dot-size);
|
|
1491
|
-
background-color: var(--color-sentiment-negative);
|
|
1492
|
-
border-radius: 9999px;
|
|
1493
|
-
border-radius: var(--radius-full);
|
|
1494
|
-
}
|
|
1495
1453
|
.np-select-option {
|
|
1496
1454
|
border-radius: 10px;
|
|
1497
1455
|
border-radius: var(--radius-small);
|
|
@@ -4197,6 +4155,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4197
4155
|
transform: translateY(-24px);
|
|
4198
4156
|
}
|
|
4199
4157
|
}
|
|
4158
|
+
.status-icon > svg {
|
|
4159
|
+
height: 32px;
|
|
4160
|
+
height: var(--size-32);
|
|
4161
|
+
width: 32px;
|
|
4162
|
+
width: var(--size-32);
|
|
4163
|
+
}
|
|
4200
4164
|
.status-circle .light {
|
|
4201
4165
|
color: var(--color-contrast);
|
|
4202
4166
|
}
|
|
@@ -4212,6 +4176,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4212
4176
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
4213
4177
|
color: var(--color-dark);
|
|
4214
4178
|
}
|
|
4179
|
+
.status-circle-sm .status-icon > svg {
|
|
4180
|
+
height: 14px;
|
|
4181
|
+
height: var(--size-14);
|
|
4182
|
+
width: 14px;
|
|
4183
|
+
width: var(--size-14);
|
|
4184
|
+
}
|
|
4215
4185
|
@media (max-width: 320px) {
|
|
4216
4186
|
.status-circle-sm .status-icon > svg {
|
|
4217
4187
|
width: 24px;
|
|
@@ -5732,3 +5702,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5732
5702
|
.np-list-item__action {
|
|
5733
5703
|
flex-shrink: 0;
|
|
5734
5704
|
}
|
|
5705
|
+
.np-action-btn-chevron {
|
|
5706
|
+
color: #c9cbce;
|
|
5707
|
+
color: var(--color-interactive-secondary);
|
|
5708
|
+
}
|
|
@@ -30,14 +30,12 @@ const StatusIcon = ({
|
|
|
30
30
|
const Icon = iconTypeMap[sentiment];
|
|
31
31
|
const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';
|
|
32
32
|
const isTinyViewport = useMedia.useMedia(`(max-width: ${breakpoint.Breakpoint.ZOOM_400}px)`);
|
|
33
|
-
const size$1 = sizeProp === size.Size.SMALL && isTinyViewport ? 32 :
|
|
33
|
+
const size$1 = sizeProp === size.Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];
|
|
34
34
|
return /*#__PURE__*/jsxRuntime.jsx(Circle, {
|
|
35
35
|
as: "span",
|
|
36
36
|
size: size$1,
|
|
37
37
|
"data-testid": "status-icon",
|
|
38
|
-
className: clsx.clsx('status-circle',
|
|
39
|
-
// `status-circle-${sizeProp}`,
|
|
40
|
-
sentiment),
|
|
38
|
+
className: clsx.clsx('status-circle', `status-circle-${sizeProp}`, sentiment),
|
|
41
39
|
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
42
40
|
className: clsx.clsx('status-icon', iconColor)
|
|
43
41
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\
|
|
1
|
+
{"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport type StatusIconProps = {\n sentiment: `${Sentiment}`;\n size: SizeSmall | SizeMedium | SizeLarge;\n};\n\nconst iconTypeMap = {\n positive: Check,\n neutral: Info,\n warning: Alert,\n negative: Cross,\n pending: ClockBorderless,\n info: Info,\n error: Cross,\n success: Check,\n} satisfies Record<`${Sentiment}`, React.ElementType>;\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 'md' }: StatusIconProps) => {\n const Icon = iconTypeMap[sentiment];\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = sizeProp === Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];\n return (\n <Circle\n as=\"span\"\n size={size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', `status-circle-${sizeProp}`, sentiment)}\n >\n <Icon className={clsx('status-icon', iconColor)} />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["iconTypeMap","positive","Check","neutral","Info","warning","Alert","negative","Cross","pending","ClockBorderless","info","error","success","mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","Icon","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children"],"mappings":";;;;;;;;;;AAYA,MAAMA,WAAW,GAAG;AAClBC,EAAAA,QAAQ,EAAEC,WAAK;AACfC,EAAAA,OAAO,EAAEC,UAAI;AACbC,EAAAA,OAAO,EAAEC,WAAK;AACdC,EAAAA,QAAQ,EAAEC,WAAK;AACfC,EAAAA,OAAO,EAAEC,qBAAe;AACxBC,EAAAA,IAAI,EAAEP,UAAI;AACVQ,EAAAA,KAAK,EAAEJ,WAAK;AACZK,EAAAA,OAAO,EAAEX,WAAAA;CAC0C,CAAA;AAErD,MAAMY,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,IAAA;AAAI,CAAmB,KAAI;AACvF,EAAA,MAAMC,IAAI,GAAGxB,WAAW,CAACqB,SAAS,CAAC,CAAA;AACnC,EAAA,MAAMI,SAAS,GAAGJ,SAAS,KAAK,SAAS,IAAIA,SAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;EACvF,MAAMK,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMP,MAAI,GAAGC,QAAQ,KAAKP,SAAI,CAACC,KAAK,IAAIS,cAAc,GAAG,EAAE,GAAGZ,aAAa,CAACS,QAAQ,CAAC,CAAA;EACrF,oBACEO,cAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;AACTV,IAAAA,IAAI,EAAEA,MAAK;AACX,IAAA,aAAA,EAAY,aAAa;IACzBW,SAAS,EAAEC,SAAI,CAAC,eAAe,EAAE,iBAAiBX,QAAQ,CAAA,CAAE,EAAEF,SAAS,CAAE;IAAAc,QAAA,eAEzEL,cAAA,CAACN,IAAI,EAAA;AAACS,MAAAA,SAAS,EAAEC,SAAI,CAAC,aAAa,EAAET,SAAS,CAAA;KAChD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
|
|
@@ -28,14 +28,12 @@ const StatusIcon = ({
|
|
|
28
28
|
const Icon = iconTypeMap[sentiment];
|
|
29
29
|
const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';
|
|
30
30
|
const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
31
|
-
const size = sizeProp === Size.SMALL && isTinyViewport ? 32 :
|
|
31
|
+
const size = sizeProp === Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];
|
|
32
32
|
return /*#__PURE__*/jsx(Circle, {
|
|
33
33
|
as: "span",
|
|
34
34
|
size: size,
|
|
35
35
|
"data-testid": "status-icon",
|
|
36
|
-
className: clsx('status-circle',
|
|
37
|
-
// `status-circle-${sizeProp}`,
|
|
38
|
-
sentiment),
|
|
36
|
+
className: clsx('status-circle', `status-circle-${sizeProp}`, sentiment),
|
|
39
37
|
children: /*#__PURE__*/jsx(Icon, {
|
|
40
38
|
className: clsx('status-icon', iconColor)
|
|
41
39
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\
|
|
1
|
+
{"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nexport type StatusIconProps = {\n sentiment: `${Sentiment}`;\n size: SizeSmall | SizeMedium | SizeLarge;\n};\n\nconst iconTypeMap = {\n positive: Check,\n neutral: Info,\n warning: Alert,\n negative: Cross,\n pending: ClockBorderless,\n info: Info,\n error: Cross,\n success: Check,\n} satisfies Record<`${Sentiment}`, React.ElementType>;\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 'md' }: StatusIconProps) => {\n const Icon = iconTypeMap[sentiment];\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = sizeProp === Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];\n return (\n <Circle\n as=\"span\"\n size={size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', `status-circle-${sizeProp}`, sentiment)}\n >\n <Icon className={clsx('status-icon', iconColor)} />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["iconTypeMap","positive","Check","neutral","Info","warning","Alert","negative","Cross","pending","ClockBorderless","info","error","success","mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","Icon","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children"],"mappings":";;;;;;;;AAYA,MAAMA,WAAW,GAAG;AAClBC,EAAAA,QAAQ,EAAEC,KAAK;AACfC,EAAAA,OAAO,EAAEC,IAAI;AACbC,EAAAA,OAAO,EAAEC,KAAK;AACdC,EAAAA,QAAQ,EAAEC,KAAK;AACfC,EAAAA,OAAO,EAAEC,eAAe;AACxBC,EAAAA,IAAI,EAAEP,IAAI;AACVQ,EAAAA,KAAK,EAAEJ,KAAK;AACZK,EAAAA,OAAO,EAAEX,KAAAA;CAC0C,CAAA;AAErD,MAAMY,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,IAAA;AAAI,CAAmB,KAAI;AACvF,EAAA,MAAMC,IAAI,GAAGxB,WAAW,CAACqB,SAAS,CAAC,CAAA;AACnC,EAAA,MAAMI,SAAS,GAAGJ,SAAS,KAAK,SAAS,IAAIA,SAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;EACvF,MAAMK,cAAc,GAAGC,QAAQ,CAAC,eAAeC,UAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMP,IAAI,GAAGC,QAAQ,KAAKP,IAAI,CAACC,KAAK,IAAIS,cAAc,GAAG,EAAE,GAAGZ,aAAa,CAACS,QAAQ,CAAC,CAAA;EACrF,oBACEO,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;AACTV,IAAAA,IAAI,EAAEA,IAAK;AACX,IAAA,aAAA,EAAY,aAAa;IACzBW,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAE,iBAAiBX,QAAQ,CAAA,CAAE,EAAEF,SAAS,CAAE;IAAAc,QAAA,eAEzEL,GAAA,CAACN,IAAI,EAAA;AAACS,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAA;KAChD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
background-color: var(--color-background-neutral);
|
|
33
33
|
color: var(--color-interactive-primary);
|
|
34
34
|
}
|
|
35
|
+
.np-action-btn.btn-priority-3 {
|
|
36
|
+
background-color: transparent !important;
|
|
37
|
+
color: var(--color-interactive-primary);
|
|
38
|
+
}
|
|
35
39
|
.np-action-btn:not(:disabled):hover {
|
|
36
40
|
background-color: #008fc9;
|
|
37
41
|
background-color: var(--color-interactive-accent-hover);
|
|
@@ -39,6 +43,9 @@
|
|
|
39
43
|
.np-action-btn:not(:disabled):hover.btn-priority-2 {
|
|
40
44
|
background-color: var(--color-background-neutral-hover);
|
|
41
45
|
}
|
|
46
|
+
.np-action-btn:not(:disabled):hover.btn-priority-3 {
|
|
47
|
+
color: var(--color-interactive-primary-hover);
|
|
48
|
+
}
|
|
42
49
|
.np-action-btn:not(:disabled):active {
|
|
43
50
|
box-shadow: none;
|
|
44
51
|
border-color: transparent;
|
|
@@ -48,6 +55,10 @@
|
|
|
48
55
|
.np-action-btn:not(:disabled):active.btn-priority-2 {
|
|
49
56
|
background-color: var(--color-background-neutral-active);
|
|
50
57
|
}
|
|
58
|
+
.np-action-btn:not(:disabled):active.btn-priority-3 {
|
|
59
|
+
color: var(--color-interactive-primary-active);
|
|
60
|
+
background-color: var(--color-background-screen-active) !important;
|
|
61
|
+
}
|
|
51
62
|
.np-action-btn:not(:disabled):focus {
|
|
52
63
|
box-shadow: none;
|
|
53
64
|
}
|