@transferwise/components 0.0.0-experimental-1a9f157 → 0.0.0-experimental-3ab1d06
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/avatar/Avatar.js +0 -2
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +0 -2
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/badge/Badge.js +0 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +0 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js +3 -1
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs +3 -1
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/circle/Circle.js +3 -19
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +3 -19
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +7 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +7 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/main.css +22 -6
- package/build/popover/Popover.js +6 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +7 -2
- package/build/popover/Popover.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +4 -4
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +4 -4
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/circularButton/CircularButton.css +2 -2
- package/build/styles/common/circle/Circle.css +0 -4
- package/build/styles/main.css +22 -6
- package/build/styles/statusIcon/StatusIcon.css +20 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +1 -9
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
- package/build/types/popover/Popover.d.ts +6 -4
- package/build/types/popover/Popover.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/avatar/Avatar.spec.tsx +1 -3
- package/src/avatar/Avatar.tsx +0 -2
- package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +11 -11
- package/src/badge/Badge.spec.tsx +1 -3
- package/src/badge/Badge.tsx +1 -1
- package/src/circularButton/CircularButton.css +2 -2
- package/src/circularButton/CircularButton.less +1 -1
- package/src/circularButton/CircularButton.tsx +1 -1
- package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +20 -20
- package/src/common/bottomSheet/BottomSheet.tsx +4 -2
- package/src/common/circle/Circle.css +0 -4
- package/src/common/circle/Circle.less +0 -8
- package/src/common/circle/Circle.tsx +3 -36
- package/src/common/responsivePanel/ResponsivePanel.tsx +13 -3
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +4 -4
- package/src/main.css +22 -6
- package/src/overlayHeader/OverlayHeader.spec.tsx +1 -3
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +2 -2
- package/src/popover/Popover.spec.tsx +64 -21
- package/src/popover/Popover.story.tsx +54 -42
- package/src/popover/Popover.tsx +12 -5
- package/src/popover/__snapshots__/Popover.spec.tsx.snap +2 -0
- package/src/promoCard/PromoCard.spec.tsx +1 -3
- package/src/radio/Radio.rtl.spec.tsx +1 -2
- package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +2 -2
- package/src/statusIcon/StatusIcon.css +20 -0
- package/src/statusIcon/StatusIcon.less +17 -0
- package/src/statusIcon/StatusIcon.spec.tsx +21 -3
- package/src/statusIcon/StatusIcon.story.tsx +8 -31
- package/src/statusIcon/StatusIcon.tsx +6 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsivePanel.mjs","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel
|
|
1
|
+
{"version":3,"file":"ResponsivePanel.mjs","sources":["../../../src/common/responsivePanel/ResponsivePanel.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { Position } from '..';\nimport BottomSheet from '../bottomSheet';\nimport { useLayout } from '../hooks';\nimport Panel, { type PanelProps } from '../panel';\n\nconst ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(\n {\n anchorRef,\n arrow = false,\n flip = true,\n children,\n className = undefined,\n onClose,\n open = false,\n position = Position.BOTTOM,\n anchorWidth = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n }: PanelProps,\n reference,\n) {\n const { isMobile } = useLayout();\n if (isMobile) {\n return (\n <BottomSheet\n key=\"bottomSheet\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n open={open}\n className={className}\n onClose={onClose}\n >\n {children}\n </BottomSheet>\n );\n }\n return (\n <Panel\n key=\"panel\"\n ref={reference}\n flip={flip}\n arrow={arrow}\n open={open}\n position={position}\n anchorWidth={anchorWidth}\n anchorRef={anchorRef}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={className}\n onClose={onClose}\n >\n {children}\n </Panel>\n );\n});\n\nexport default ResponsivePanel;\n"],"names":["ResponsivePanel","forwardRef","anchorRef","arrow","flip","children","className","undefined","onClose","open","position","Position","BOTTOM","anchorWidth","ariaLabel","ariaLabelledBy","reference","is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AAH,IAAAA,QAAA,EAEhBA,QAAAA;AAAQ,GAAA,EAbL,OAcC,CAAC,CAAA;AAEZ,CAAC;;;;"}
|
package/build/main.css
CHANGED
|
@@ -1013,8 +1013,8 @@ div.critical-comms .critical-comms-body {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
@media (max-width: 320px) {
|
|
1015
1015
|
.np-circular-btn .tw-icon {
|
|
1016
|
-
top:
|
|
1017
|
-
top: var(--size-
|
|
1016
|
+
top: 8px;
|
|
1017
|
+
top: var(--size-8);
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
.np-circular-btn .tw-icon > svg {
|
|
@@ -1169,10 +1169,6 @@ div.critical-comms .critical-comms-body {
|
|
|
1169
1169
|
height: var(--circle-size);
|
|
1170
1170
|
flex-shrink: 0;
|
|
1171
1171
|
}
|
|
1172
|
-
.np-circle-icons-size .tw-icon > svg {
|
|
1173
|
-
height: var(--circle-icon-size);
|
|
1174
|
-
width: var(--circle-icon-size);
|
|
1175
|
-
}
|
|
1176
1172
|
.np-bottom-sheet {
|
|
1177
1173
|
border-radius: 10px 10px 0 0;
|
|
1178
1174
|
}
|
|
@@ -4159,6 +4155,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4159
4155
|
transform: translateY(-24px);
|
|
4160
4156
|
}
|
|
4161
4157
|
}
|
|
4158
|
+
.status-icon > svg {
|
|
4159
|
+
height: 32px;
|
|
4160
|
+
height: var(--size-32);
|
|
4161
|
+
width: 32px;
|
|
4162
|
+
width: var(--size-32);
|
|
4163
|
+
}
|
|
4162
4164
|
.status-circle .light {
|
|
4163
4165
|
color: var(--color-contrast);
|
|
4164
4166
|
}
|
|
@@ -4174,6 +4176,20 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4174
4176
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
4175
4177
|
color: var(--color-dark);
|
|
4176
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
|
+
}
|
|
4185
|
+
@media (max-width: 320px) {
|
|
4186
|
+
.status-circle-sm .status-icon > svg {
|
|
4187
|
+
width: 24px;
|
|
4188
|
+
width: var(--size-24);
|
|
4189
|
+
height: 24px;
|
|
4190
|
+
height: var(--size-24);
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4177
4193
|
.status-circle.negative,
|
|
4178
4194
|
.status-circle.error {
|
|
4179
4195
|
background-color: var(--color-sentiment-negative);
|
package/build/popover/Popover.js
CHANGED
|
@@ -27,8 +27,10 @@ function Popover({
|
|
|
27
27
|
content,
|
|
28
28
|
preferredPlacement = position.Position.RIGHT,
|
|
29
29
|
title,
|
|
30
|
-
onClose
|
|
30
|
+
onClose,
|
|
31
|
+
'aria-label': ariaLabel
|
|
31
32
|
}) {
|
|
33
|
+
const titleId = React.useId();
|
|
32
34
|
const resolvedPlacement = resolvePlacement(preferredPlacement);
|
|
33
35
|
React.useEffect(() => {
|
|
34
36
|
if (resolvedPlacement !== preferredPlacement) {
|
|
@@ -53,6 +55,8 @@ function Popover({
|
|
|
53
55
|
}
|
|
54
56
|
}) : children
|
|
55
57
|
}), /*#__PURE__*/jsxRuntime.jsx(ResponsivePanel, {
|
|
58
|
+
"aria-label": ariaLabel,
|
|
59
|
+
"aria-labelledby": title && !ariaLabel ? titleId : undefined,
|
|
56
60
|
open: open,
|
|
57
61
|
anchorRef: anchorReference,
|
|
58
62
|
position: resolvedPlacement,
|
|
@@ -63,6 +67,7 @@ function Popover({
|
|
|
63
67
|
className: "np-popover__content np-text-default-body",
|
|
64
68
|
children: [title && /*#__PURE__*/jsxRuntime.jsx(Title, {
|
|
65
69
|
type: typography.Typography.TITLE_BODY,
|
|
70
|
+
id: titleId,
|
|
66
71
|
className: "m-b-1",
|
|
67
72
|
children: title
|
|
68
73
|
}), content]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../src/popover/Popover.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useRef, useState, cloneElement, useEffect, isValidElement } from 'react';\n\nimport { Position, Typography } from '../common';\nimport ResponsivePanel from '../common/responsivePanel';\nimport Title from '../title';\nimport { logActionRequired } from '../utilities';\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype PopoverPreferredPlacementDeprecated =\n | `${Position.LEFT_TOP}`\n | `${Position.RIGHT_TOP}`\n | `${Position.BOTTOM_RIGHT}`\n | `${Position.BOTTOM_LEFT}`;\n\nexport type PopoverPreferredPlacement =\n | `${Position.TOP}`\n | `${Position.RIGHT}`\n | `${Position.BOTTOM}`\n | `${Position.LEFT}`\n | PopoverPreferredPlacementDeprecated;\n\nexport interface PopoverProps {\n children?: React.ReactNode;\n
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../src/popover/Popover.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useRef, useState, cloneElement, useEffect, isValidElement, useId } from 'react';\n\nimport { Position, Typography } from '../common';\nimport ResponsivePanel from '../common/responsivePanel';\nimport Title from '../title';\nimport { logActionRequired } from '../utilities';\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype PopoverPreferredPlacementDeprecated =\n | `${Position.LEFT_TOP}`\n | `${Position.RIGHT_TOP}`\n | `${Position.BOTTOM_RIGHT}`\n | `${Position.BOTTOM_LEFT}`;\n\nexport type PopoverPreferredPlacement =\n | `${Position.TOP}`\n | `${Position.RIGHT}`\n | `${Position.BOTTOM}`\n | `${Position.LEFT}`\n | PopoverPreferredPlacementDeprecated;\n\nexport interface PopoverProps {\n children?: React.ReactNode;\n title?: React.ReactNode;\n /** Screen-reader-friendly title. Must be provided if `title` prop is not set. */\n 'aria-label'?: string;\n preferredPlacement?: PopoverPreferredPlacement;\n content: React.ReactNode;\n onClose?: () => void;\n className?: string;\n}\n\nfunction resolvePlacement(preferredPlacement: PopoverPreferredPlacement) {\n switch (preferredPlacement) {\n case 'left-top':\n case 'right-top':\n return 'top';\n case 'bottom-left':\n case 'bottom-right':\n return 'bottom';\n default:\n return preferredPlacement;\n }\n}\n\nexport default function Popover({\n children,\n className,\n content,\n preferredPlacement = Position.RIGHT,\n title,\n onClose,\n 'aria-label': ariaLabel,\n}: PopoverProps) {\n const titleId = useId();\n\n const resolvedPlacement = resolvePlacement(preferredPlacement);\n useEffect(() => {\n if (resolvedPlacement !== preferredPlacement) {\n logActionRequired(\n `Popover has deprecated ${preferredPlacement} value for the 'preferredPlacement' prop. Please use ${resolvedPlacement} instead.`,\n );\n }\n }, [preferredPlacement, resolvedPlacement]);\n\n const anchorReference = useRef(null);\n const [open, setOpen] = useState(false);\n\n const handleOnClose = () => {\n setOpen(false);\n onClose?.();\n };\n\n return (\n <span className={clsx('np-popover', className)}>\n <span ref={anchorReference} className=\"d-inline-block\">\n {isValidElement<{ onClick?: () => void }>(children)\n ? cloneElement(children, {\n onClick: () => {\n children.props.onClick?.();\n setOpen((prevOpen) => !prevOpen);\n },\n })\n : children}\n </span>\n <ResponsivePanel\n aria-label={ariaLabel}\n aria-labelledby={title && !ariaLabel ? titleId : undefined}\n open={open}\n anchorRef={anchorReference}\n position={resolvedPlacement}\n arrow\n className=\"np-popover__container\"\n onClose={handleOnClose}\n >\n <div className=\"np-popover__content np-text-default-body\">\n {title && (\n <Title type={Typography.TITLE_BODY} id={titleId} className=\"m-b-1\">\n {title}\n </Title>\n )}\n {content}\n </div>\n </ResponsivePanel>\n </span>\n );\n}\n"],"names":["resolvePlacement","preferredPlacement","Popover","children","className","content","Position","RIGHT","title","onClose","ariaLabel","titleId","useId","resolvedPlacement","useEffect","logActionRequired","anchorReference","useRef","open","setOpen","useState","handleOnClose","_jsxs","clsx","_jsx","ref","isValidElement","cloneElement","onClick","props","prevOpen","ResponsivePanel","undefined","anchorRef","position","arrow","Title","type","Typography","T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 -1,5 +1,5 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import { useEffect, useRef, useState, isValidElement, cloneElement } from 'react';
|
|
2
|
+
import { useId, useEffect, useRef, useState, isValidElement, cloneElement } from 'react';
|
|
3
3
|
import Title from '../title/Title.mjs';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { logActionRequired } from '../utilities/logActionRequired.mjs';
|
|
@@ -25,8 +25,10 @@ function Popover({
|
|
|
25
25
|
content,
|
|
26
26
|
preferredPlacement = Position.RIGHT,
|
|
27
27
|
title,
|
|
28
|
-
onClose
|
|
28
|
+
onClose,
|
|
29
|
+
'aria-label': ariaLabel
|
|
29
30
|
}) {
|
|
31
|
+
const titleId = useId();
|
|
30
32
|
const resolvedPlacement = resolvePlacement(preferredPlacement);
|
|
31
33
|
useEffect(() => {
|
|
32
34
|
if (resolvedPlacement !== preferredPlacement) {
|
|
@@ -51,6 +53,8 @@ function Popover({
|
|
|
51
53
|
}
|
|
52
54
|
}) : children
|
|
53
55
|
}), /*#__PURE__*/jsx(ResponsivePanel, {
|
|
56
|
+
"aria-label": ariaLabel,
|
|
57
|
+
"aria-labelledby": title && !ariaLabel ? titleId : undefined,
|
|
54
58
|
open: open,
|
|
55
59
|
anchorRef: anchorReference,
|
|
56
60
|
position: resolvedPlacement,
|
|
@@ -61,6 +65,7 @@ function Popover({
|
|
|
61
65
|
className: "np-popover__content np-text-default-body",
|
|
62
66
|
children: [title && /*#__PURE__*/jsx(Title, {
|
|
63
67
|
type: Typography.TITLE_BODY,
|
|
68
|
+
id: titleId,
|
|
64
69
|
className: "m-b-1",
|
|
65
70
|
children: title
|
|
66
71
|
}), content]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.mjs","sources":["../../src/popover/Popover.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useRef, useState, cloneElement, useEffect, isValidElement } from 'react';\n\nimport { Position, Typography } from '../common';\nimport ResponsivePanel from '../common/responsivePanel';\nimport Title from '../title';\nimport { logActionRequired } from '../utilities';\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype PopoverPreferredPlacementDeprecated =\n | `${Position.LEFT_TOP}`\n | `${Position.RIGHT_TOP}`\n | `${Position.BOTTOM_RIGHT}`\n | `${Position.BOTTOM_LEFT}`;\n\nexport type PopoverPreferredPlacement =\n | `${Position.TOP}`\n | `${Position.RIGHT}`\n | `${Position.BOTTOM}`\n | `${Position.LEFT}`\n | PopoverPreferredPlacementDeprecated;\n\nexport interface PopoverProps {\n children?: React.ReactNode;\n
|
|
1
|
+
{"version":3,"file":"Popover.mjs","sources":["../../src/popover/Popover.tsx"],"sourcesContent":["import { useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useRef, useState, cloneElement, useEffect, isValidElement, useId } from 'react';\n\nimport { Position, Typography } from '../common';\nimport ResponsivePanel from '../common/responsivePanel';\nimport Title from '../title';\nimport { logActionRequired } from '../utilities';\n\n/** @deprecated Use `\"top\" | \"bottom\"` instead. */\ntype PopoverPreferredPlacementDeprecated =\n | `${Position.LEFT_TOP}`\n | `${Position.RIGHT_TOP}`\n | `${Position.BOTTOM_RIGHT}`\n | `${Position.BOTTOM_LEFT}`;\n\nexport type PopoverPreferredPlacement =\n | `${Position.TOP}`\n | `${Position.RIGHT}`\n | `${Position.BOTTOM}`\n | `${Position.LEFT}`\n | PopoverPreferredPlacementDeprecated;\n\nexport interface PopoverProps {\n children?: React.ReactNode;\n title?: React.ReactNode;\n /** Screen-reader-friendly title. Must be provided if `title` prop is not set. */\n 'aria-label'?: string;\n preferredPlacement?: PopoverPreferredPlacement;\n content: React.ReactNode;\n onClose?: () => void;\n className?: string;\n}\n\nfunction resolvePlacement(preferredPlacement: PopoverPreferredPlacement) {\n switch (preferredPlacement) {\n case 'left-top':\n case 'right-top':\n return 'top';\n case 'bottom-left':\n case 'bottom-right':\n return 'bottom';\n default:\n return preferredPlacement;\n }\n}\n\nexport default function Popover({\n children,\n className,\n content,\n preferredPlacement = Position.RIGHT,\n title,\n onClose,\n 'aria-label': ariaLabel,\n}: PopoverProps) {\n const titleId = useId();\n\n const resolvedPlacement = resolvePlacement(preferredPlacement);\n useEffect(() => {\n if (resolvedPlacement !== preferredPlacement) {\n logActionRequired(\n `Popover has deprecated ${preferredPlacement} value for the 'preferredPlacement' prop. Please use ${resolvedPlacement} instead.`,\n );\n }\n }, [preferredPlacement, resolvedPlacement]);\n\n const anchorReference = useRef(null);\n const [open, setOpen] = useState(false);\n\n const handleOnClose = () => {\n setOpen(false);\n onClose?.();\n };\n\n return (\n <span className={clsx('np-popover', className)}>\n <span ref={anchorReference} className=\"d-inline-block\">\n {isValidElement<{ onClick?: () => void }>(children)\n ? cloneElement(children, {\n onClick: () => {\n children.props.onClick?.();\n setOpen((prevOpen) => !prevOpen);\n },\n })\n : children}\n </span>\n <ResponsivePanel\n aria-label={ariaLabel}\n aria-labelledby={title && !ariaLabel ? titleId : undefined}\n open={open}\n anchorRef={anchorReference}\n position={resolvedPlacement}\n arrow\n className=\"np-popover__container\"\n onClose={handleOnClose}\n >\n <div className=\"np-popover__content np-text-default-body\">\n {title && (\n <Title type={Typography.TITLE_BODY} id={titleId} className=\"m-b-1\">\n {title}\n </Title>\n )}\n {content}\n </div>\n </ResponsivePanel>\n </span>\n );\n}\n"],"names":["resolvePlacement","preferredPlacement","Popover","children","className","content","Position","RIGHT","title","onClose","ariaLabel","titleId","useId","resolvedPlacement","useEffect","logActionRequired","anchorReference","useRef","open","setOpen","useState","handleOnClose","_jsxs","clsx","_jsx","ref","isValidElement","cloneElement","onClick","props","prevOpen","ResponsivePanel","undefined","anchorRef","position","arrow","Title","type","Typography","TITLE_BODY","id"],"mappings":";;;;;;;;;AAkCA,SAASA,gBAAgBA,CAACC,kBAA6C,EAAA;AACrE,EAAA,QAAQA,kBAAkB;AACxB,IAAA,KAAK,UAAU,CAAA;AACf,IAAA,KAA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
29
29
|
}) => {
|
|
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 = mapLegacySize[sizeProp]
|
|
33
|
+
const size$1 = sizeProp === size.Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];
|
|
34
34
|
return /*#__PURE__*/jsxRuntime.jsx(Circle, {
|
|
35
35
|
as: "span",
|
|
36
|
-
size:
|
|
36
|
+
size: size$1,
|
|
37
37
|
"data-testid": "status-icon",
|
|
38
|
-
className: clsx.clsx('status-circle', sentiment),
|
|
38
|
+
className: clsx.clsx('status-circle', `status-circle-${sizeProp}`, sentiment),
|
|
39
39
|
children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
40
40
|
className: clsx.clsx('status-icon', iconColor)
|
|
41
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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
27
27
|
}) => {
|
|
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 = mapLegacySize[sizeProp]
|
|
31
|
+
const size = sizeProp === Size.SMALL && isTinyViewport ? 32 : mapLegacySize[sizeProp];
|
|
32
32
|
return /*#__PURE__*/jsx(Circle, {
|
|
33
33
|
as: "span",
|
|
34
|
-
size:
|
|
34
|
+
size: size,
|
|
35
35
|
"data-testid": "status-icon",
|
|
36
|
-
className: clsx('status-circle', sentiment),
|
|
36
|
+
className: clsx('status-circle', `status-circle-${sizeProp}`, sentiment),
|
|
37
37
|
children: /*#__PURE__*/jsx(Icon, {
|
|
38
38
|
className: clsx('status-icon', iconColor)
|
|
39
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;;;;"}
|
package/build/styles/main.css
CHANGED
|
@@ -1013,8 +1013,8 @@ div.critical-comms .critical-comms-body {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
@media (max-width: 320px) {
|
|
1015
1015
|
.np-circular-btn .tw-icon {
|
|
1016
|
-
top:
|
|
1017
|
-
top: var(--size-
|
|
1016
|
+
top: 8px;
|
|
1017
|
+
top: var(--size-8);
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
.np-circular-btn .tw-icon > svg {
|
|
@@ -1169,10 +1169,6 @@ div.critical-comms .critical-comms-body {
|
|
|
1169
1169
|
height: var(--circle-size);
|
|
1170
1170
|
flex-shrink: 0;
|
|
1171
1171
|
}
|
|
1172
|
-
.np-circle-icons-size .tw-icon > svg {
|
|
1173
|
-
height: var(--circle-icon-size);
|
|
1174
|
-
width: var(--circle-icon-size);
|
|
1175
|
-
}
|
|
1176
1172
|
.np-bottom-sheet {
|
|
1177
1173
|
border-radius: 10px 10px 0 0;
|
|
1178
1174
|
}
|
|
@@ -4159,6 +4155,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4159
4155
|
transform: translateY(-24px);
|
|
4160
4156
|
}
|
|
4161
4157
|
}
|
|
4158
|
+
.status-icon > svg {
|
|
4159
|
+
height: 32px;
|
|
4160
|
+
height: var(--size-32);
|
|
4161
|
+
width: 32px;
|
|
4162
|
+
width: var(--size-32);
|
|
4163
|
+
}
|
|
4162
4164
|
.status-circle .light {
|
|
4163
4165
|
color: var(--color-contrast);
|
|
4164
4166
|
}
|
|
@@ -4174,6 +4176,20 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4174
4176
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
4175
4177
|
color: var(--color-dark);
|
|
4176
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
|
+
}
|
|
4185
|
+
@media (max-width: 320px) {
|
|
4186
|
+
.status-circle-sm .status-icon > svg {
|
|
4187
|
+
width: 24px;
|
|
4188
|
+
width: var(--size-24);
|
|
4189
|
+
height: 24px;
|
|
4190
|
+
height: var(--size-24);
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4177
4193
|
.status-circle.negative,
|
|
4178
4194
|
.status-circle.error {
|
|
4179
4195
|
background-color: var(--color-sentiment-negative);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
.status-icon > svg {
|
|
2
|
+
height: 32px;
|
|
3
|
+
height: var(--size-32);
|
|
4
|
+
width: 32px;
|
|
5
|
+
width: var(--size-32);
|
|
6
|
+
}
|
|
1
7
|
.status-circle .light {
|
|
2
8
|
color: var(--color-contrast);
|
|
3
9
|
}
|
|
@@ -13,6 +19,20 @@
|
|
|
13
19
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
14
20
|
color: var(--color-dark);
|
|
15
21
|
}
|
|
22
|
+
.status-circle-sm .status-icon > svg {
|
|
23
|
+
height: 14px;
|
|
24
|
+
height: var(--size-14);
|
|
25
|
+
width: 14px;
|
|
26
|
+
width: var(--size-14);
|
|
27
|
+
}
|
|
28
|
+
@media (max-width: 320px) {
|
|
29
|
+
.status-circle-sm .status-icon > svg {
|
|
30
|
+
width: 24px;
|
|
31
|
+
width: var(--size-24);
|
|
32
|
+
height: 24px;
|
|
33
|
+
height: var(--size-24);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
16
36
|
.status-circle.negative,
|
|
17
37
|
.status-circle.error {
|
|
18
38
|
background-color: var(--color-sentiment-negative);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/avatar/Avatar.tsx"],"names":[],"mappings":"AAOA,KAAK,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEhD,KAAK,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,UAA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AAE,MAAM,CAAC;CACvB;AAkBD,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4CjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { CommonProps } from '../commonProps';
|
|
|
3
3
|
export type BottomSheetProps = PropsWithChildren<{
|
|
4
4
|
onClose?: (event: Event | SyntheticEvent) => void;
|
|
5
5
|
open: boolean;
|
|
6
|
-
} & CommonProps & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>>;
|
|
6
|
+
} & CommonProps & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby' | 'aria-label'>>;
|
|
7
7
|
/**
|
|
8
8
|
* Neptune: https://transferwise.github.io/neptune/components/bottom-sheet/
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/common/bottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,cAAc,EAIf,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAC9C;IACE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,KAAK,IAAI,CAAC;IAClD,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,WAAW,GACb,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../../src/common/bottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,cAAc,EAIf,MAAM,OAAO,CAAC;AAOf,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAC9C;IACE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,KAAK,IAAI,CAAC;IAClD,IAAI,EAAE,OAAO,CAAC;CACf,GAAG,WAAW,GACb,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,iBAAiB,GAAG,YAAY,CAAC,CAClF,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,WAAW,uBAAmC,gBAAgB,gCA6LnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;
|
|
2
|
+
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
|
|
3
3
|
export type Props = {
|
|
4
4
|
/**
|
|
5
5
|
* Modify underlying element, `div` by default
|
|
@@ -14,10 +14,6 @@ export type Props = {
|
|
|
14
14
|
* as those can be dynamic a at certain viewport sizes
|
|
15
15
|
*/
|
|
16
16
|
fixedSize?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* This property is temporary, as some components (e.g legacy Avatar) doesn't need new icon sizing, we delete it at some point
|
|
19
|
-
*/
|
|
20
|
-
iconSizing?: boolean;
|
|
21
17
|
} & HTMLAttributes<HTMLDivElement>;
|
|
22
18
|
declare const Circle: import("react").ForwardRefExoticComponent<{
|
|
23
19
|
/**
|
|
@@ -33,10 +29,6 @@ declare const Circle: import("react").ForwardRefExoticComponent<{
|
|
|
33
29
|
* as those can be dynamic a at certain viewport sizes
|
|
34
30
|
*/
|
|
35
31
|
fixedSize?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* This property is temporary, as some components (e.g legacy Avatar) doesn't need new icon sizing, we delete it at some point
|
|
38
|
-
*/
|
|
39
|
-
iconSizing?: boolean;
|
|
40
32
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<unknown>>;
|
|
41
33
|
export default Circle;
|
|
42
34
|
//# sourceMappingURL=Circle.d.ts.map
|
|
@@ -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;
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponsivePanel.d.ts","sourceRoot":"","sources":["../../../../src/common/responsivePanel/ResponsivePanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResponsivePanel.d.ts","sourceRoot":"","sources":["../../../../src/common/responsivePanel/ResponsivePanel.tsx"],"names":[],"mappings":"AAOA,QAAA,MAAM,eAAe;;;;;;;;;;;mGAiDnB,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -4,12 +4,14 @@ type PopoverPreferredPlacementDeprecated = `${Position.LEFT_TOP}` | `${Position.
|
|
|
4
4
|
export type PopoverPreferredPlacement = `${Position.TOP}` | `${Position.RIGHT}` | `${Position.BOTTOM}` | `${Position.LEFT}` | PopoverPreferredPlacementDeprecated;
|
|
5
5
|
export interface PopoverProps {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
/** Screen-reader-friendly title. Must be provided if `title` prop is not set. */
|
|
9
|
+
'aria-label'?: string;
|
|
9
10
|
preferredPlacement?: PopoverPreferredPlacement;
|
|
11
|
+
content: React.ReactNode;
|
|
10
12
|
onClose?: () => void;
|
|
11
|
-
|
|
13
|
+
className?: string;
|
|
12
14
|
}
|
|
13
|
-
export default function Popover({ children, className, content, preferredPlacement, title, onClose, }: PopoverProps): import("react").JSX.Element;
|
|
15
|
+
export default function Popover({ children, className, content, preferredPlacement, title, onClose, 'aria-label': ariaLabel, }: PopoverProps): import("react").JSX.Element;
|
|
14
16
|
export {};
|
|
15
17
|
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/popover/Popover.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAc,MAAM,WAAW,CAAC;AAKjD,kDAAkD;AAClD,KAAK,mCAAmC,GACpC,GAAG,QAAQ,CAAC,QAAQ,EAAE,GACtB,GAAG,QAAQ,CAAC,SAAS,EAAE,GACvB,GAAG,QAAQ,CAAC,YAAY,EAAE,GAC1B,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;AAE9B,MAAM,MAAM,yBAAyB,GACjC,GAAG,QAAQ,CAAC,GAAG,EAAE,GACjB,GAAG,QAAQ,CAAC,KAAK,EAAE,GACnB,GAAG,QAAQ,CAAC,MAAM,EAAE,GACpB,GAAG,QAAQ,CAAC,IAAI,EAAE,GAClB,mCAAmC,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/popover/Popover.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAc,MAAM,WAAW,CAAC;AAKjD,kDAAkD;AAClD,KAAK,mCAAmC,GACpC,GAAG,QAAQ,CAAC,QAAQ,EAAE,GACtB,GAAG,QAAQ,CAAC,SAAS,EAAE,GACvB,GAAG,QAAQ,CAAC,YAAY,EAAE,GAC1B,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;AAE9B,MAAM,MAAM,yBAAyB,GACjC,GAAG,QAAQ,CAAC,GAAG,EAAE,GACjB,GAAG,QAAQ,CAAC,KAAK,EAAE,GACnB,GAAG,QAAQ,CAAC,MAAM,EAAE,GACpB,GAAG,QAAQ,CAAC,IAAI,EAAE,GAClB,mCAAmC,CAAC;AAExC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,kBAAmC,EACnC,KAAK,EACL,OAAO,EACP,YAAY,EAAE,SAAS,GACxB,EAAE,YAAY,+BAqDd"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { SizeSmall, SizeMedium, SizeLarge, Sentiment } from '../common';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead
|
|
4
|
-
*/
|
|
5
|
-
type LegacySizes = SizeSmall | SizeMedium | SizeLarge;
|
|
6
2
|
export type StatusIconProps = {
|
|
7
|
-
sentiment
|
|
8
|
-
size
|
|
3
|
+
sentiment: `${Sentiment}`;
|
|
4
|
+
size: SizeSmall | SizeMedium | SizeLarge;
|
|
9
5
|
};
|
|
10
6
|
declare const StatusIcon: ({ sentiment, size: sizeProp }: StatusIconProps) => import("react").JSX.Element;
|
|
11
7
|
export default StatusIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAC;AAI1F
|
|
1
|
+
{"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAC;AAI1F,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC;IAC1B,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;CAC1C,CAAC;AAmBF,QAAA,MAAM,UAAU,kCAAsD,eAAe,gCAepF,CAAC;AAEF,eAAe,UAAU,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-3ab1d06",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"rollup-preserve-directives": "^1.1.1",
|
|
93
93
|
"storybook": "^8.2.2",
|
|
94
94
|
"@transferwise/less-config": "3.1.0",
|
|
95
|
-
"@
|
|
96
|
-
"@
|
|
95
|
+
"@transferwise/neptune-css": "14.19.1",
|
|
96
|
+
"@wise/components-theming": "1.6.1"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@transferwise/icons": "^3.13.1",
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Size } from '../common';
|
|
2
|
-
import { render, screen
|
|
2
|
+
import { render, screen } from '../test-utils';
|
|
3
3
|
|
|
4
4
|
import avatarColorTestCases from './colors/avatarColorTestCases.json';
|
|
5
5
|
|
|
6
6
|
import Avatar, { AvatarType } from '.';
|
|
7
7
|
|
|
8
|
-
mockMatchMedia();
|
|
9
|
-
|
|
10
8
|
describe('Avatar', () => {
|
|
11
9
|
it('renders a medium sized thumbnail Avatar with NO outline', () => {
|
|
12
10
|
render(
|
package/src/avatar/Avatar.tsx
CHANGED
|
@@ -68,7 +68,6 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
68
68
|
<Circle
|
|
69
69
|
size={size}
|
|
70
70
|
fixedSize
|
|
71
|
-
iconSizing={false}
|
|
72
71
|
className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {
|
|
73
72
|
'tw-avatar--outlined': outlined,
|
|
74
73
|
'tw-avatar--branded': Boolean(backgroundColorFromSeed),
|
|
@@ -79,7 +78,6 @@ const Avatar: React.FC<AvatarProps> = ({
|
|
|
79
78
|
<Circle
|
|
80
79
|
size={size}
|
|
81
80
|
fixedSize
|
|
82
|
-
iconSizing={false}
|
|
83
81
|
className="tw-avatar__content"
|
|
84
82
|
style={{
|
|
85
83
|
backgroundColor: backgroundColor || backgroundColorFromSeed,
|