@transferwise/components 46.83.3 → 46.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +8 -3
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +8 -3
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/i18n/de.json +5 -0
- package/build/i18n/de.json.js +5 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +5 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/iconButton/IconButton.js +41 -0
- package/build/iconButton/IconButton.js.map +1 -0
- package/build/iconButton/IconButton.mjs +39 -0
- package/build/iconButton/IconButton.mjs.map +1 -0
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/main.css +86 -32
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +83 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +81 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +90 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +88 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -0
- package/build/styles/iconButton/IconButton.css +82 -0
- package/build/styles/main.css +86 -32
- package/build/styles/summary/Summary.css +4 -0
- package/build/summary/Summary.js +3 -3
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +3 -3
- package/build/summary/Summary.mjs.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +3 -0
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +15 -0
- package/build/types/iconButton/IconButton.d.ts.map +1 -0
- package/build/types/iconButton/index.d.ts +3 -0
- package/build/types/iconButton/index.d.ts.map +1 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common/closeButton/CloseButton.tsx +3 -0
- package/src/flowNavigation/FlowNavigation.spec.js +7 -8
- package/src/flowNavigation/FlowNavigation.tsx +11 -2
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +27 -3
- package/src/i18n/de.json +5 -0
- package/src/iconButton/IconButton.css +82 -0
- package/src/iconButton/IconButton.less +55 -0
- package/src/iconButton/IconButton.story.tsx +107 -0
- package/src/iconButton/IconButton.tsx +51 -0
- package/src/iconButton/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/inputs/SelectInput.story.tsx +68 -24
- package/src/main.css +86 -32
- package/src/main.less +1 -1
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +81 -32
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +124 -42
- package/src/summary/Summary.css +4 -0
- package/src/summary/Summary.less +3 -0
- package/src/summary/Summary.story.tsx +13 -3
- package/src/summary/Summary.tsx +13 -11
- package/build/flowNavigation/backButton/BackButton.js +0 -30
- package/build/flowNavigation/backButton/BackButton.js.map +0 -1
- package/build/flowNavigation/backButton/BackButton.mjs +0 -28
- package/build/flowNavigation/backButton/BackButton.mjs.map +0 -1
- package/build/styles/flowNavigation/backButton/BackButton.css +0 -32
- package/build/types/flowNavigation/backButton/BackButton.d.ts +0 -7
- package/build/types/flowNavigation/backButton/BackButton.d.ts.map +0 -1
- package/build/types/flowNavigation/backButton/index.d.ts +0 -3
- package/build/types/flowNavigation/backButton/index.d.ts.map +0 -1
- package/src/flowNavigation/backButton/BackButton.css +0 -32
- package/src/flowNavigation/backButton/BackButton.less +0 -36
- package/src/flowNavigation/backButton/BackButton.tsx +0 -29
- package/src/flowNavigation/backButton/index.ts +0 -2
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { forwardRef, useCallback } from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const PrimitiveAnchor = /*#__PURE__*/forwardRef(({
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
href,
|
|
9
|
+
id,
|
|
10
|
+
disabled = false,
|
|
11
|
+
testId,
|
|
12
|
+
onClick,
|
|
13
|
+
onFocus,
|
|
14
|
+
onBlur,
|
|
15
|
+
onMouseEnter,
|
|
16
|
+
onMouseLeave,
|
|
17
|
+
onKeyDown,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) => {
|
|
20
|
+
const anchorClasses = clsx('wds-Anchor', {
|
|
21
|
+
'wds-Anchor--disabled': disabled
|
|
22
|
+
}, className);
|
|
23
|
+
const handleClick = useCallback(event => {
|
|
24
|
+
if (disabled) {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
} else {
|
|
27
|
+
onClick?.(event);
|
|
28
|
+
}
|
|
29
|
+
}, [disabled, onClick]);
|
|
30
|
+
const handleFocus = useCallback(event => {
|
|
31
|
+
onFocus?.(event);
|
|
32
|
+
}, [onFocus]);
|
|
33
|
+
const handleBlur = useCallback(event => {
|
|
34
|
+
onBlur?.(event);
|
|
35
|
+
}, [onBlur]);
|
|
36
|
+
const handleMouseEnter = useCallback(event => {
|
|
37
|
+
onMouseEnter?.(event);
|
|
38
|
+
}, [onMouseEnter]);
|
|
39
|
+
const handleMouseLeave = useCallback(event => {
|
|
40
|
+
onMouseLeave?.(event);
|
|
41
|
+
}, [onMouseLeave]);
|
|
42
|
+
const handleKeyDown = useCallback(event => {
|
|
43
|
+
onKeyDown?.(event);
|
|
44
|
+
}, [onKeyDown]);
|
|
45
|
+
/**
|
|
46
|
+
* The following props are set to handle the `disabled` state for the link:
|
|
47
|
+
*
|
|
48
|
+
* - `aria-disabled`: Exposes the link as disabled to assistive technologies.
|
|
49
|
+
* - `href`: Removed when `disabled` is true to prevent navigation.
|
|
50
|
+
* - `role`: Set to 'link' when `disabled` is true to ensure the element
|
|
51
|
+
* is still exposed as a link.
|
|
52
|
+
*
|
|
53
|
+
* For more details, refer to Scott O'Hara's article on disabling links:
|
|
54
|
+
* https://www.scottohara.me/blog/2021/05/28/disabled-links.html
|
|
55
|
+
*/
|
|
56
|
+
const anchorProps = {
|
|
57
|
+
'aria-disabled': disabled,
|
|
58
|
+
className: anchorClasses,
|
|
59
|
+
'data-testid': testId,
|
|
60
|
+
href: disabled ? undefined : href,
|
|
61
|
+
id,
|
|
62
|
+
ref,
|
|
63
|
+
role: disabled ? 'link' : undefined,
|
|
64
|
+
rel: props.target === '_blank' ? 'noopener noreferrer' : undefined,
|
|
65
|
+
onClick: handleClick,
|
|
66
|
+
onFocus: handleFocus,
|
|
67
|
+
onBlur: handleBlur,
|
|
68
|
+
onMouseEnter: handleMouseEnter,
|
|
69
|
+
onMouseLeave: handleMouseLeave,
|
|
70
|
+
onKeyDown: handleKeyDown,
|
|
71
|
+
...props
|
|
72
|
+
};
|
|
73
|
+
return /*#__PURE__*/jsx("a", {
|
|
74
|
+
...anchorProps,
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
PrimitiveAnchor.displayName = 'PrimitiveAnchor';
|
|
79
|
+
|
|
80
|
+
export { PrimitiveAnchor as default };
|
|
81
|
+
//# sourceMappingURL=PrimitiveAnchor.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveAnchor.mjs","sources":["../../../../src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx"],"sourcesContent":["import React, { forwardRef, useCallback } from 'react';\nimport { clsx } from 'clsx';\nimport type { PrimitiveAnchorProps } from '..';\n\n/**\n * The Primitive `PrimitiveAnchor` component is customisable link element that can be\n * used in various parts of the Wise Design System internally. It supports\n * different states such as disabled and provides event handlers for common\n * interactions like click, focus, blur, mouse enter, mouse leave, and key down.\n *\n * @see {@link PrimitiveAnchor} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/primitive-anchor--docs|Storybook Wise Design}\n */\nconst PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(\n (\n {\n children,\n className,\n href,\n id,\n disabled = false,\n testId,\n onClick,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const anchorClasses = clsx(\n 'wds-Anchor',\n {\n 'wds-Anchor--disabled': disabled,\n },\n className,\n );\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n } else {\n onClick?.(event);\n }\n },\n [disabled, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLAnchorElement>) => {\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLAnchorElement>) => {\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n onMouseEnter?.(event);\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLAnchorElement>) => {\n onMouseLeave?.(event);\n },\n [onMouseLeave],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLAnchorElement>) => {\n onKeyDown?.(event);\n },\n [onKeyDown],\n );\n\n /**\n * The following props are set to handle the `disabled` state for the link:\n *\n * - `aria-disabled`: Exposes the link as disabled to assistive technologies.\n * - `href`: Removed when `disabled` is true to prevent navigation.\n * - `role`: Set to 'link' when `disabled` is true to ensure the element\n * is still exposed as a link.\n *\n * For more details, refer to Scott O'Hara's article on disabling links:\n * https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n */\n const anchorProps = {\n 'aria-disabled': disabled,\n className: anchorClasses,\n 'data-testid': testId,\n href: disabled ? undefined : href,\n id,\n ref,\n role: disabled ? 'link' : undefined,\n rel: props.target === '_blank' ? 'noopener noreferrer' : undefined,\n onClick: handleClick,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n ...props,\n };\n\n return <a {...anchorProps}>{children}</a>;\n },\n);\n\nPrimitiveAnchor.displayName = 'PrimitiveAnchor';\n\nexport default PrimitiveAnchor;\n"],"names":["PrimitiveAnchor","forwardRef","children","className","href","id","disabled","testId","onClick","onFocus","onBlur","onMouseEnter","onMouseLeave","onKeyDown","props","ref","anchorClasses","clsx","handleClick","useCallback","event","preventDefault","handleFocus","handleBlur","handleMouseEnter","handleMouseLeave","handleKeyDown","anchorProps","undefined","role","rel","target","_jsx","displayName"],"mappings":";;;;AAaA,MAAMA,eAAe,gBAAGC,UAAU,CAChC,CACE;EACEC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJC,EAAE;AACFC,EAAAA,QAAQ,GAAG,KAAK;EAChBC,MAAM;EACNC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,YAAY;EACZC,YAAY;EACZC,SAAS;EACT,GAAGC,KAAAA;CACJ,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,aAAa,GAAGC,IAAI,CACxB,YAAY,EACZ;AACE,IAAA,sBAAsB,EAAEX,QAAAA;GACzB,EACDH,SAAS,CACV,CAAA;AAED,EAAA,MAAMe,WAAW,GAAGC,WAAW,CAC5BC,KAA0C,IAAI;AAC7C,IAAA,IAAId,QAAQ,EAAE;MACZc,KAAK,CAACC,cAAc,EAAE,CAAA;AACxB,KAAC,MAAM;MACLb,OAAO,GAAGY,KAAK,CAAC,CAAA;AACl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AAEa,WAAW;AACpBZ,IAAAA,MAAM,EAAEa,UAAU;AAClBZ,IAAAA,YAAY,EAAEa,gBAAgB;AAC9BZ,IAAAA,YAAY,EAAEa,gBAAgB;AAC9BZ,IAAAA,SAAS,EAAEa,aAAa;IACxB,GAAGZ,KAAAA;GACJ,CAAA;AAED,EAAA,oBAAOkB,GAAA,CAAA,GAAA,EAAA;AAAA,IAAA,GAAOL,WAAW;AAAAzB,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,GAAI,CAAC,CAAA;AAC3C,CAAC,EACF;AAEDF,eAAe,CAACiC,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var clsx = require('clsx');
|
|
5
|
+
var reactIntl = require('react-intl');
|
|
6
|
+
var Button_messages = require('../../../i18n/commonMessages/Button.messages.js');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
/* eslint-disable react/button-has-type */
|
|
10
|
+
const PrimitiveButton = /*#__PURE__*/React.forwardRef(({
|
|
11
|
+
children,
|
|
12
|
+
className,
|
|
13
|
+
id,
|
|
14
|
+
disabled = false,
|
|
15
|
+
loading = false,
|
|
16
|
+
testId,
|
|
17
|
+
type = 'button',
|
|
18
|
+
onClick,
|
|
19
|
+
onFocus,
|
|
20
|
+
onBlur,
|
|
21
|
+
onMouseEnter,
|
|
22
|
+
onMouseLeave,
|
|
23
|
+
onKeyDown,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) => {
|
|
26
|
+
const intl = reactIntl.useIntl();
|
|
27
|
+
const classNames = clsx.clsx('wds-Button', {
|
|
28
|
+
'wds-Button--disabled': disabled,
|
|
29
|
+
'wds-Button--loading': loading
|
|
30
|
+
}, className);
|
|
31
|
+
const handleClick = React.useCallback(event => {
|
|
32
|
+
if (disabled || loading) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
} else {
|
|
35
|
+
onClick?.(event);
|
|
36
|
+
}
|
|
37
|
+
}, [disabled, loading, onClick]);
|
|
38
|
+
const handleFocus = React.useCallback(event => {
|
|
39
|
+
onFocus?.(event);
|
|
40
|
+
}, [onFocus]);
|
|
41
|
+
const handleBlur = React.useCallback(event => {
|
|
42
|
+
onBlur?.(event);
|
|
43
|
+
}, [onBlur]);
|
|
44
|
+
const handleMouseEnter = React.useCallback(event => {
|
|
45
|
+
onMouseEnter?.(event);
|
|
46
|
+
}, [onMouseEnter]);
|
|
47
|
+
const handleMouseLeave = React.useCallback(event => {
|
|
48
|
+
onMouseLeave?.(event);
|
|
49
|
+
}, [onMouseLeave]);
|
|
50
|
+
const handleKeyDown = React.useCallback(event => {
|
|
51
|
+
onKeyDown?.(event);
|
|
52
|
+
}, [onKeyDown]);
|
|
53
|
+
/**
|
|
54
|
+
* The following props are used to manage the `disabled` and `loading`
|
|
55
|
+
* states for the button:
|
|
56
|
+
*
|
|
57
|
+
* - `aria-disabled`: Communicates to assistive technologies that the button
|
|
58
|
+
* is disabled when it is either disabled or loading.
|
|
59
|
+
* - `aria-label`: Provides an accessible label for the button, using a
|
|
60
|
+
* localized loading message when the button is in a loading state.
|
|
61
|
+
* - `aria-live`: Ensures that updates to the button's content are announced
|
|
62
|
+
* by assistive technologies, set to 'polite' during loading.
|
|
63
|
+
*/
|
|
64
|
+
const buttonProps = {
|
|
65
|
+
'aria-disabled': disabled || loading,
|
|
66
|
+
'aria-label': loading ? intl.formatMessage(Button_messages.loadingAriaLabel) : props['aria-label'],
|
|
67
|
+
'aria-live': loading ? 'polite' : 'off',
|
|
68
|
+
className: classNames,
|
|
69
|
+
'data-testid': testId,
|
|
70
|
+
disabled,
|
|
71
|
+
id,
|
|
72
|
+
ref,
|
|
73
|
+
type,
|
|
74
|
+
onBlur: handleBlur,
|
|
75
|
+
onClick: handleClick,
|
|
76
|
+
onFocus: handleFocus,
|
|
77
|
+
onMouseEnter: handleMouseEnter,
|
|
78
|
+
onMouseLeave: handleMouseLeave,
|
|
79
|
+
onKeyDown: handleKeyDown,
|
|
80
|
+
...props
|
|
81
|
+
};
|
|
82
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
83
|
+
...buttonProps,
|
|
84
|
+
children: children
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
PrimitiveButton.displayName = 'PrimitiveButton';
|
|
88
|
+
|
|
89
|
+
module.exports = PrimitiveButton;
|
|
90
|
+
//# sourceMappingURL=PrimitiveButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveButton.js","sources":["../../../../src/primitives/PrimitiveButton/src/PrimitiveButton.tsx"],"sourcesContent":["/* eslint-disable react/button-has-type */\nimport React, { forwardRef, useCallback } from 'react';\nimport { clsx } from 'clsx';\nimport { useIntl, MessageDescriptor } from 'react-intl';\nimport messages from '../../../i18n/commonMessages/Button.messages';\nimport type { PrimitiveButtonProps } from '..';\n\n/**\n * The Primitive `PrimitiveButton` component can be used in various parts the Wise Design\n * System internally. It supports different states such as disabled and loading,\n * and provides event handlers for common interactions like click, focus, blur,\n * mouse enter, mouse leave, and keydown.\n *\n * @see {@link PrimitiveButton} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/primitive-button--docs|Storybook Wise Design}\n */\nconst PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(\n (\n {\n children,\n className,\n id,\n disabled = false,\n loading = false,\n testId,\n type = 'button',\n onClick,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const intl = useIntl();\n const classNames = clsx(\n 'wds-Button',\n {\n 'wds-Button--disabled': disabled,\n 'wds-Button--loading': loading,\n },\n className,\n );\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else {\n onClick?.(event);\n }\n },\n [disabled, loading, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(event);\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(event);\n },\n [onMouseLeave],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n },\n [onKeyDown],\n );\n\n /**\n * The following props are used to manage the `disabled` and `loading`\n * states for the button:\n *\n * - `aria-disabled`: Communicates to assistive technologies that the button\n * is disabled when it is either disabled or loading.\n * - `aria-label`: Provides an accessible label for the button, using a\n * localized loading message when the button is in a loading state.\n * - `aria-live`: Ensures that updates to the button's content are announced\n * by assistive technologies, set to 'polite' during loading.\n */\n const buttonProps = {\n 'aria-disabled': disabled || loading,\n 'aria-label': loading\n ? intl.formatMessage(messages.loadingAriaLabel as MessageDescriptor)\n : props['aria-label'],\n 'aria-live': (loading ? 'polite' : 'off') as 'polite' | 'off' | 'assertive' | undefined,\n className: classNames,\n 'data-testid': testId,\n disabled,\n id,\n ref,\n type,\n onBlur: handleBlur,\n onClick: handleClick,\n onFocus: handleFocus,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n ...props,\n };\n\n return <button {...buttonProps}>{children}</button>;\n },\n);\n\nPrimitiveButton.displayName = 'PrimitiveButton';\n\nexport default PrimitiveButton;\n"],"names":["PrimitiveButton","forwardRef","children","className","id","disabled","loading","testId","type","onClick","onFocus","onBlur","onMouseEnter","onMouseLeave","onKeyDown","props","ref","intl","useIntl","classNames","clsx","handleClick","useCallback","event","preventDefault","handleFocus","handleBlur","handleMouseEnter","handleMouseLeave","handleKe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
1
|
+
import { forwardRef, useCallback } from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import messages from '../../../i18n/commonMessages/Button.messages.mjs';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
/* eslint-disable react/button-has-type */
|
|
8
|
+
const PrimitiveButton = /*#__PURE__*/forwardRef(({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
id,
|
|
12
|
+
disabled = false,
|
|
13
|
+
loading = false,
|
|
14
|
+
testId,
|
|
15
|
+
type = 'button',
|
|
16
|
+
onClick,
|
|
17
|
+
onFocus,
|
|
18
|
+
onBlur,
|
|
19
|
+
onMouseEnter,
|
|
20
|
+
onMouseLeave,
|
|
21
|
+
onKeyDown,
|
|
22
|
+
...props
|
|
23
|
+
}, ref) => {
|
|
24
|
+
const intl = useIntl();
|
|
25
|
+
const classNames = clsx('wds-Button', {
|
|
26
|
+
'wds-Button--disabled': disabled,
|
|
27
|
+
'wds-Button--loading': loading
|
|
28
|
+
}, className);
|
|
29
|
+
const handleClick = useCallback(event => {
|
|
30
|
+
if (disabled || loading) {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
} else {
|
|
33
|
+
onClick?.(event);
|
|
34
|
+
}
|
|
35
|
+
}, [disabled, loading, onClick]);
|
|
36
|
+
const handleFocus = useCallback(event => {
|
|
37
|
+
onFocus?.(event);
|
|
38
|
+
}, [onFocus]);
|
|
39
|
+
const handleBlur = useCallback(event => {
|
|
40
|
+
onBlur?.(event);
|
|
41
|
+
}, [onBlur]);
|
|
42
|
+
const handleMouseEnter = useCallback(event => {
|
|
43
|
+
onMouseEnter?.(event);
|
|
44
|
+
}, [onMouseEnter]);
|
|
45
|
+
const handleMouseLeave = useCallback(event => {
|
|
46
|
+
onMouseLeave?.(event);
|
|
47
|
+
}, [onMouseLeave]);
|
|
48
|
+
const handleKeyDown = useCallback(event => {
|
|
49
|
+
onKeyDown?.(event);
|
|
50
|
+
}, [onKeyDown]);
|
|
51
|
+
/**
|
|
52
|
+
* The following props are used to manage the `disabled` and `loading`
|
|
53
|
+
* states for the button:
|
|
54
|
+
*
|
|
55
|
+
* - `aria-disabled`: Communicates to assistive technologies that the button
|
|
56
|
+
* is disabled when it is either disabled or loading.
|
|
57
|
+
* - `aria-label`: Provides an accessible label for the button, using a
|
|
58
|
+
* localized loading message when the button is in a loading state.
|
|
59
|
+
* - `aria-live`: Ensures that updates to the button's content are announced
|
|
60
|
+
* by assistive technologies, set to 'polite' during loading.
|
|
61
|
+
*/
|
|
62
|
+
const buttonProps = {
|
|
63
|
+
'aria-disabled': disabled || loading,
|
|
64
|
+
'aria-label': loading ? intl.formatMessage(messages.loadingAriaLabel) : props['aria-label'],
|
|
65
|
+
'aria-live': loading ? 'polite' : 'off',
|
|
66
|
+
className: classNames,
|
|
67
|
+
'data-testid': testId,
|
|
68
|
+
disabled,
|
|
69
|
+
id,
|
|
70
|
+
ref,
|
|
71
|
+
type,
|
|
72
|
+
onBlur: handleBlur,
|
|
73
|
+
onClick: handleClick,
|
|
74
|
+
onFocus: handleFocus,
|
|
75
|
+
onMouseEnter: handleMouseEnter,
|
|
76
|
+
onMouseLeave: handleMouseLeave,
|
|
77
|
+
onKeyDown: handleKeyDown,
|
|
78
|
+
...props
|
|
79
|
+
};
|
|
80
|
+
return /*#__PURE__*/jsx("button", {
|
|
81
|
+
...buttonProps,
|
|
82
|
+
children: children
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
PrimitiveButton.displayName = 'PrimitiveButton';
|
|
86
|
+
|
|
87
|
+
export { PrimitiveButton as default };
|
|
88
|
+
//# sourceMappingURL=PrimitiveButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveButton.mjs","sources":["../../../../src/primitives/PrimitiveButton/src/PrimitiveButton.tsx"],"sourcesContent":["/* eslint-disable react/button-has-type */\nimport React, { forwardRef, useCallback } from 'react';\nimport { clsx } from 'clsx';\nimport { useIntl, MessageDescriptor } from 'react-intl';\nimport messages from '../../../i18n/commonMessages/Button.messages';\nimport type { PrimitiveButtonProps } from '..';\n\n/**\n * The Primitive `PrimitiveButton` component can be used in various parts the Wise Design\n * System internally. It supports different states such as disabled and loading,\n * and provides event handlers for common interactions like click, focus, blur,\n * mouse enter, mouse leave, and keydown.\n *\n * @see {@link PrimitiveButton} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/primitive-button--docs|Storybook Wise Design}\n */\nconst PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(\n (\n {\n children,\n className,\n id,\n disabled = false,\n loading = false,\n testId,\n type = 'button',\n onClick,\n onFocus,\n onBlur,\n onMouseEnter,\n onMouseLeave,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const intl = useIntl();\n const classNames = clsx(\n 'wds-Button',\n {\n 'wds-Button--disabled': disabled,\n 'wds-Button--loading': loading,\n },\n className,\n );\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else {\n onClick?.(event);\n }\n },\n [disabled, loading, onClick],\n );\n\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n onFocus?.(event);\n },\n [onFocus],\n );\n\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLButtonElement>) => {\n onBlur?.(event);\n },\n [onBlur],\n );\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseEnter?.(event);\n },\n [onMouseEnter],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n onMouseLeave?.(event);\n },\n [onMouseLeave],\n );\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n },\n [onKeyDown],\n );\n\n /**\n * The following props are used to manage the `disabled` and `loading`\n * states for the button:\n *\n * - `aria-disabled`: Communicates to assistive technologies that the button\n * is disabled when it is either disabled or loading.\n * - `aria-label`: Provides an accessible label for the button, using a\n * localized loading message when the button is in a loading state.\n * - `aria-live`: Ensures that updates to the button's content are announced\n * by assistive technologies, set to 'polite' during loading.\n */\n const buttonProps = {\n 'aria-disabled': disabled || loading,\n 'aria-label': loading\n ? intl.formatMessage(messages.loadingAriaLabel as MessageDescriptor)\n : props['aria-label'],\n 'aria-live': (loading ? 'polite' : 'off') as 'polite' | 'off' | 'assertive' | undefined,\n className: classNames,\n 'data-testid': testId,\n disabled,\n id,\n ref,\n type,\n onBlur: handleBlur,\n onClick: handleClick,\n onFocus: handleFocus,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n ...props,\n };\n\n return <button {...buttonProps}>{children}</button>;\n },\n);\n\nPrimitiveButton.displayName = 'PrimitiveButton';\n\nexport default PrimitiveButton;\n"],"names":["PrimitiveButton","forwardRef","children","className","id","disabled","loading","testId","type","onClick","onFocus","onBlur","onMouseEnter","onMouseLeave","onKeyDown","props","ref","intl","useIntl","classNames","clsx","handleClick","useCallback","event","preventDefault","handleFocus","handleBlur","handleMouseEnter","handleMouseLeave","handleKeyDown","buttonProps","formatMessage","messages","loadingAriaLabel","_jsx","displayName"],"mappings":";;;;;;AAAA;AAgBA,MAAMA,eAAe,gBAAGC,UAAU,CAChC,CACE;EACEC,QAAQ;EACRC,SAAS;EACTC,EAAE;AACFC,EAAAA,QAAQ,GAAG,KAAK;AAChBC,EAAAA,OAAO,GAAG,KAAK;EACfC,MAAM;AACNC,EAAAA,IAAI,GAAG,QAAQ;EACfC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,YAAY;EACZC,YAAY;EACZC,SAAS;EACT,GAAGC,KAAAA;CACJ,EACDC,GAAG,KACD;AACF,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;AACtB,EAAA,MAAMC,UAAU,GAAGC,IAAI,CACrB,YAAY,EACZ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AAO,GACjBW,IAAI,CAACc,aAAa,CAACC,QAAQ,CAACC,gBAAqC,CAAC,GAClElB,KAAK,CAAC,YAAY,CAAC;AACvB,IAAA,WAAW,EAAGT,OAAO,GAAG,QAAQ,GAAG,KAAoD;AACvFH,IAAAA,SAAS,EAAEgB,UAAU;AACrB,IAAA,aAAa,EAAEZ,MAAM;IACrBF,QAAQ;IACRD,EAAE;IACFY,GAAG;IACHR,IAAI;AACJG,IAAAA,MAAM,EAAEe,UAAU;AAClBjB,IAAAA,OAAO,EAAEY,WAAW;AACpBX,IAAAA,OAAO,EAAEe,WAAW;AACpBb,IAAAA,YAAY,EAAEe,gBAAgB;AAC9Bd,IAAAA,YAAY,EAAEe,gBAAgB;AAC9Bd,IAAAA,SAAS,EAAEe,aAAa;IACxB,GAAGd,KAAAA;GACJ,CAAA;AAED,EAAA,oBAAOmB,GAAA,CAAA,QAAA,EAAA;AAAA,IAAA,GAAYJ,WAAW;AAAA5B,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,GAAS,CAAC,CAAA;AACrD,CAAC,EACF;AAEDF,eAAe,CAACmC,WAAW,GAAG,iBAAiB;;;;"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
.np-icon-button {
|
|
2
|
+
border: none;
|
|
3
|
+
}
|
|
4
|
+
.np-icon-button-tertiary-default {
|
|
5
|
+
color: var(--color-interactive-primary);
|
|
6
|
+
background-color: rgba(134,167,189,0.10196);
|
|
7
|
+
background-color: var(--color-background-neutral);
|
|
8
|
+
}
|
|
9
|
+
.np-icon-button-tertiary-default:not(.disabled):not(:disabled):hover {
|
|
10
|
+
background-color: var(--color-background-neutral-hover);
|
|
11
|
+
}
|
|
12
|
+
.np-icon-button-tertiary-default:not(.disabled):not(:disabled):active {
|
|
13
|
+
background-color: var(--color-background-neutral-active);
|
|
14
|
+
}
|
|
15
|
+
.np-icon-button-primary-default {
|
|
16
|
+
color: var(--color-interactive-control);
|
|
17
|
+
background-color: #00a2dd;
|
|
18
|
+
background-color: var(--color-interactive-accent);
|
|
19
|
+
}
|
|
20
|
+
.np-icon-button-primary-default:not(.disabled):not(:disabled):hover {
|
|
21
|
+
background-color: #008fc9;
|
|
22
|
+
background-color: var(--color-interactive-accent-hover);
|
|
23
|
+
}
|
|
24
|
+
.np-icon-button-primary-default:not(.disabled):not(:disabled):active {
|
|
25
|
+
background-color: #0081ba;
|
|
26
|
+
background-color: var(--color-interactive-accent-active);
|
|
27
|
+
}
|
|
28
|
+
.np-icon-button-primary-negative {
|
|
29
|
+
color: var(--color-contrast-overlay);
|
|
30
|
+
background-color: var(--color-sentiment-negative-primary);
|
|
31
|
+
}
|
|
32
|
+
.np-icon-button-primary-negative:not(.disabled):not(:disabled):hover {
|
|
33
|
+
background-color: var(--color-sentiment-negative-primary-hover);
|
|
34
|
+
}
|
|
35
|
+
.np-icon-button-primary-negative:not(.disabled):not(:disabled):active {
|
|
36
|
+
background-color: var(--color-sentiment-negative-primary-active);
|
|
37
|
+
}
|
|
38
|
+
.np-theme-personal--bright-green .np-icon-button-primary-negative {
|
|
39
|
+
color: var(--color-white);
|
|
40
|
+
}
|
|
41
|
+
.np-icon-button-minimal-default {
|
|
42
|
+
color: var(--color-interactive-primary);
|
|
43
|
+
background-color: #ffffff;
|
|
44
|
+
background-color: var(--color-background-screen);
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
}
|
|
47
|
+
.np-icon-button-minimal-default:not(.disabled):not(:disabled):hover {
|
|
48
|
+
background-color: var(--color-background-screen-hover);
|
|
49
|
+
}
|
|
50
|
+
.np-icon-button-minimal-default:not(.disabled):not(:disabled):active {
|
|
51
|
+
background-color: var(--color-background-screen-active);
|
|
52
|
+
}
|
|
53
|
+
.np-icon-button-secondary-default {
|
|
54
|
+
color: var(--color-interactive-primary);
|
|
55
|
+
background-color: var(--color-interactive-neutral);
|
|
56
|
+
}
|
|
57
|
+
.np-icon-button-secondary-default:not(.disabled):not(:disabled):hover {
|
|
58
|
+
background-color: var(--color-interactive-neutral-hover);
|
|
59
|
+
}
|
|
60
|
+
.np-icon-button-secondary-default:not(.disabled):not(:disabled):active {
|
|
61
|
+
background-color: var(--color-interactive-neutral-active);
|
|
62
|
+
}
|
|
63
|
+
.np-theme-personal--bright-green .np-icon-button-secondary-default,
|
|
64
|
+
.np-theme-personal--forest-green .np-icon-button-secondary-default {
|
|
65
|
+
color: var(--color-interactive-control);
|
|
66
|
+
}
|
|
67
|
+
.np-icon-button-secondary-negative {
|
|
68
|
+
color: var(--color-sentiment-negative-primary);
|
|
69
|
+
background-color: var(--color-sentiment-negative-secondary);
|
|
70
|
+
}
|
|
71
|
+
.np-icon-button-secondary-negative:not(.disabled):not(:disabled):hover {
|
|
72
|
+
background-color: var(--color-sentiment-negative-secondary-hover);
|
|
73
|
+
}
|
|
74
|
+
.np-icon-button-secondary-negative:not(.disabled):not(:disabled):active {
|
|
75
|
+
background-color: var(--color-sentiment-negative-secondary-active);
|
|
76
|
+
}
|
|
77
|
+
.np-theme-personal--bright-green .np-icon-button-secondary-negative {
|
|
78
|
+
color: var(--color-white);
|
|
79
|
+
}
|
|
80
|
+
.np-theme-personal--forest-green .np-icon-button-secondary-negative {
|
|
81
|
+
color: var(--color-contrast-overlay);
|
|
82
|
+
}
|
package/build/styles/main.css
CHANGED
|
@@ -535,6 +535,88 @@ div.critical-comms .critical-comms-body {
|
|
|
535
535
|
.np-avatar-layout-horizontal-child {
|
|
536
536
|
margin-left: calc(var(--np-avatar-offset) * -1);
|
|
537
537
|
}
|
|
538
|
+
.np-icon-button {
|
|
539
|
+
border: none;
|
|
540
|
+
}
|
|
541
|
+
.np-icon-button-tertiary-default {
|
|
542
|
+
color: var(--color-interactive-primary);
|
|
543
|
+
background-color: rgba(134,167,189,0.10196);
|
|
544
|
+
background-color: var(--color-background-neutral);
|
|
545
|
+
}
|
|
546
|
+
.np-icon-button-tertiary-default:not(.disabled):not(:disabled):hover {
|
|
547
|
+
background-color: var(--color-background-neutral-hover);
|
|
548
|
+
}
|
|
549
|
+
.np-icon-button-tertiary-default:not(.disabled):not(:disabled):active {
|
|
550
|
+
background-color: var(--color-background-neutral-active);
|
|
551
|
+
}
|
|
552
|
+
.np-icon-button-primary-default {
|
|
553
|
+
color: var(--color-interactive-control);
|
|
554
|
+
background-color: #00a2dd;
|
|
555
|
+
background-color: var(--color-interactive-accent);
|
|
556
|
+
}
|
|
557
|
+
.np-icon-button-primary-default:not(.disabled):not(:disabled):hover {
|
|
558
|
+
background-color: #008fc9;
|
|
559
|
+
background-color: var(--color-interactive-accent-hover);
|
|
560
|
+
}
|
|
561
|
+
.np-icon-button-primary-default:not(.disabled):not(:disabled):active {
|
|
562
|
+
background-color: #0081ba;
|
|
563
|
+
background-color: var(--color-interactive-accent-active);
|
|
564
|
+
}
|
|
565
|
+
.np-icon-button-primary-negative {
|
|
566
|
+
color: var(--color-contrast-overlay);
|
|
567
|
+
background-color: var(--color-sentiment-negative-primary);
|
|
568
|
+
}
|
|
569
|
+
.np-icon-button-primary-negative:not(.disabled):not(:disabled):hover {
|
|
570
|
+
background-color: var(--color-sentiment-negative-primary-hover);
|
|
571
|
+
}
|
|
572
|
+
.np-icon-button-primary-negative:not(.disabled):not(:disabled):active {
|
|
573
|
+
background-color: var(--color-sentiment-negative-primary-active);
|
|
574
|
+
}
|
|
575
|
+
.np-theme-personal--bright-green .np-icon-button-primary-negative {
|
|
576
|
+
color: var(--color-white);
|
|
577
|
+
}
|
|
578
|
+
.np-icon-button-minimal-default {
|
|
579
|
+
color: var(--color-interactive-primary);
|
|
580
|
+
background-color: #ffffff;
|
|
581
|
+
background-color: var(--color-background-screen);
|
|
582
|
+
background-color: transparent;
|
|
583
|
+
}
|
|
584
|
+
.np-icon-button-minimal-default:not(.disabled):not(:disabled):hover {
|
|
585
|
+
background-color: var(--color-background-screen-hover);
|
|
586
|
+
}
|
|
587
|
+
.np-icon-button-minimal-default:not(.disabled):not(:disabled):active {
|
|
588
|
+
background-color: var(--color-background-screen-active);
|
|
589
|
+
}
|
|
590
|
+
.np-icon-button-secondary-default {
|
|
591
|
+
color: var(--color-interactive-primary);
|
|
592
|
+
background-color: var(--color-interactive-neutral);
|
|
593
|
+
}
|
|
594
|
+
.np-icon-button-secondary-default:not(.disabled):not(:disabled):hover {
|
|
595
|
+
background-color: var(--color-interactive-neutral-hover);
|
|
596
|
+
}
|
|
597
|
+
.np-icon-button-secondary-default:not(.disabled):not(:disabled):active {
|
|
598
|
+
background-color: var(--color-interactive-neutral-active);
|
|
599
|
+
}
|
|
600
|
+
.np-theme-personal--bright-green .np-icon-button-secondary-default,
|
|
601
|
+
.np-theme-personal--forest-green .np-icon-button-secondary-default {
|
|
602
|
+
color: var(--color-interactive-control);
|
|
603
|
+
}
|
|
604
|
+
.np-icon-button-secondary-negative {
|
|
605
|
+
color: var(--color-sentiment-negative-primary);
|
|
606
|
+
background-color: var(--color-sentiment-negative-secondary);
|
|
607
|
+
}
|
|
608
|
+
.np-icon-button-secondary-negative:not(.disabled):not(:disabled):hover {
|
|
609
|
+
background-color: var(--color-sentiment-negative-secondary-hover);
|
|
610
|
+
}
|
|
611
|
+
.np-icon-button-secondary-negative:not(.disabled):not(:disabled):active {
|
|
612
|
+
background-color: var(--color-sentiment-negative-secondary-active);
|
|
613
|
+
}
|
|
614
|
+
.np-theme-personal--bright-green .np-icon-button-secondary-negative {
|
|
615
|
+
color: var(--color-white);
|
|
616
|
+
}
|
|
617
|
+
.np-theme-personal--forest-green .np-icon-button-secondary-negative {
|
|
618
|
+
color: var(--color-contrast-overlay);
|
|
619
|
+
}
|
|
538
620
|
.tw-badge {
|
|
539
621
|
position: relative;
|
|
540
622
|
display: inline-block;
|
|
@@ -2201,38 +2283,6 @@ button.np-option {
|
|
|
2201
2283
|
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
2202
2284
|
outline-offset: var(--ring-outline-offset);
|
|
2203
2285
|
}
|
|
2204
|
-
.np-back-button {
|
|
2205
|
-
color: #00a2dd;
|
|
2206
|
-
color: var(--color-interactive-accent);
|
|
2207
|
-
display: flex !important;
|
|
2208
|
-
}
|
|
2209
|
-
.np-back-button:hover {
|
|
2210
|
-
color: #008fc9;
|
|
2211
|
-
color: var(--color-interactive-accent-hover);
|
|
2212
|
-
}
|
|
2213
|
-
.np-back-button:active {
|
|
2214
|
-
color: #0081ba;
|
|
2215
|
-
color: var(--color-interactive-accent-active);
|
|
2216
|
-
}
|
|
2217
|
-
.np-theme-personal .np-back-button {
|
|
2218
|
-
color: #37517e;
|
|
2219
|
-
color: var(--color-content-primary);
|
|
2220
|
-
}
|
|
2221
|
-
.np-theme-personal .np-back-button:hover {
|
|
2222
|
-
color: var(--color-content-primary-hover);
|
|
2223
|
-
}
|
|
2224
|
-
.np-theme-personal .np-back-button:active {
|
|
2225
|
-
color: var(--color-content-primary-active);
|
|
2226
|
-
}
|
|
2227
|
-
.np-theme-personal .np-back-button .tw-icon {
|
|
2228
|
-
color: var(--color-interactive-primary);
|
|
2229
|
-
}
|
|
2230
|
-
.np-theme-personal .np-back-button .tw-icon:hover {
|
|
2231
|
-
color: var(--color-interactive-primary-hover);
|
|
2232
|
-
}
|
|
2233
|
-
.np-theme-personal .np-back-button .tw-icon:active {
|
|
2234
|
-
color: var(--color-interactive-primary-active);
|
|
2235
|
-
}
|
|
2236
2286
|
.np-flow-navigation {
|
|
2237
2287
|
width: 100%;
|
|
2238
2288
|
min-height: 97px;
|
|
@@ -4950,6 +5000,10 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4950
5000
|
padding-left: calc(var(--size-24) + var(--size-8));
|
|
4951
5001
|
padding-right: 0;
|
|
4952
5002
|
}
|
|
5003
|
+
.np-summary__description-icon {
|
|
5004
|
+
margin-top: 4px;
|
|
5005
|
+
margin-top: var(--size-4);
|
|
5006
|
+
}
|
|
4953
5007
|
.np-summary__action {
|
|
4954
5008
|
margin-top: 4px;
|
|
4955
5009
|
margin-top: var(--size-4);
|
package/build/summary/Summary.js
CHANGED
|
@@ -78,7 +78,7 @@ const Summary = ({
|
|
|
78
78
|
// @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`
|
|
79
79
|
,
|
|
80
80
|
"aria-label": status && intl.formatMessage(Summary_messages[statusLabels[status]]),
|
|
81
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
81
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
82
82
|
className: "np-summary__icon",
|
|
83
83
|
children: [media, Badge && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
84
84
|
children: /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
|
|
@@ -87,7 +87,7 @@ const Summary = ({
|
|
|
87
87
|
})
|
|
88
88
|
})]
|
|
89
89
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
90
|
-
className:
|
|
90
|
+
className: `np-summary__body ${icon ? 'm-l-2' : ''}`,
|
|
91
91
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
92
92
|
className: "np-summary__title d-flex",
|
|
93
93
|
children: [/*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
@@ -109,7 +109,7 @@ const Summary = ({
|
|
|
109
109
|
}), description && /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
110
110
|
as: "span",
|
|
111
111
|
type: typography.Typography.BODY_DEFAULT,
|
|
112
|
-
className:
|
|
112
|
+
className: `d-block ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`,
|
|
113
113
|
children: description
|
|
114
114
|
}), action && /*#__PURE__*/jsxRuntime.jsx(Action.Action, {
|
|
115
115
|
action: action,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.js","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport { Action, ActionOptions } from '../common/action/Action';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: ActionOptions;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n <div className=\"np-summary__icon\">\n
|
|
1
|
+
{"version":3,"file":"Summary.js","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport { Action, ActionOptions } from '../common/action/Action';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: ActionOptions;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n {icon && (\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n )}\n <div className={`np-summary__body ${icon ? 'm-l-2' : ''}`}>\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className={`d-block ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`}\n >\n {description}\n </Body>\n )}\n {action && <Action action={action} className=\"np-summary__action\" />}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Action"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAyBA,MAAMA,UAAU,GAAG;AACjB,EAAA,CAACC,aAAM,CAACC,IAAI,GAAGC,qBAAe;EAC9B,CAACF,aAAM,CAACG,OAAO,GAAGC,eAAAA;CACnB,CAAA;AAED,MAAMC,YAAY,GAAG;AACnB,EAAA,CAACL,aAAM,CAACM,QAAQ,GAAG,eAAe;AAClC,EAAA,CAACN,aAAM,CAACC,IAAI,GAAG,YAAY;EAC3B,CAACD,aAAM,CAACG,OAAO,GAAG,eAAA;CACnB,CAAA;AAED,MAAMI,aAAa,GAAG;AACpB,EAAA,CAACP,aAAM,CAACC,IAAI,GAAGO,mBAAS,CAACC,QAAQ;AACjC,EAAA,CAACT,aAAM,CAACG,OAAO,GAAGK,mBAAS,CAACL,OAAAA;CAC7B,CAAA;AAoDKO,MAAAA,OAAO,GAAGA,CAAC;EACfC,MAAM;EACNC,EAAE,EAAEC,OAAO,GAAG,KAAK;EACnBC,SAAS;AACTC,EAAAA,OAAO,GAAG,IAAI;AACdC,EAAAA,WAAW,GAAGD,OAAO;EACrBE,IAAI;EACJC,IAAI;AACJC,EAAAA,YAAY,GAAG,IAAI;AACnBC,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YAAY,CAAE;AAC/BN,MAAAA,SAAS,EAAC,+CAA+C;MACzDC,OAAO,EAAEK,IAAI,CAACL,OAAQ;MACtBgC,YAAY,EAAE3B,IAAI,CAAC2B,YAAa;MAChCnB,IAAI,EAAEU,SAAI,CAACU,KAAM;MACjB1B,KAAK,EAAEF,IAAI,CAACE,KAAM;MAClB2B,OAAO,EAAE7B,IAAI,CAAC6B,OAAAA;AAAQ,KACtB,CACH,CAAA;AAAA,GACM,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -76,7 +76,7 @@ const Summary = ({
|
|
|
76
76
|
// @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`
|
|
77
77
|
,
|
|
78
78
|
"aria-label": status && intl.formatMessage(messages[statusLabels[status]]),
|
|
79
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
79
|
+
children: [icon && /*#__PURE__*/jsxs("div", {
|
|
80
80
|
className: "np-summary__icon",
|
|
81
81
|
children: [media, Badge && /*#__PURE__*/jsx("div", {
|
|
82
82
|
children: /*#__PURE__*/jsx(StatusIcon, {
|
|
@@ -85,7 +85,7 @@ const Summary = ({
|
|
|
85
85
|
})
|
|
86
86
|
})]
|
|
87
87
|
}), /*#__PURE__*/jsxs("div", {
|
|
88
|
-
className:
|
|
88
|
+
className: `np-summary__body ${icon ? 'm-l-2' : ''}`,
|
|
89
89
|
children: [/*#__PURE__*/jsxs("div", {
|
|
90
90
|
className: "np-summary__title d-flex",
|
|
91
91
|
children: [/*#__PURE__*/jsx(Body, {
|
|
@@ -107,7 +107,7 @@ const Summary = ({
|
|
|
107
107
|
}), description && /*#__PURE__*/jsx(Body, {
|
|
108
108
|
as: "span",
|
|
109
109
|
type: Typography.BODY_DEFAULT,
|
|
110
|
-
className:
|
|
110
|
+
className: `d-block ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`,
|
|
111
111
|
children: description
|
|
112
112
|
}), action && /*#__PURE__*/jsx(Action, {
|
|
113
113
|
action: action,
|