@transferwise/components 46.133.0 → 46.134.0
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/chips/Chips.js.map +1 -1
- package/build/chips/Chips.mjs.map +1 -1
- package/build/label/Label.js +1 -1
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.mjs +1 -1
- package/build/label/Label.mjs.map +1 -1
- package/build/logo/Logo.js +6 -0
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +6 -0
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +47 -9
- package/build/moneyInput/MoneyInput.js +28 -12
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +30 -14
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js +8 -2
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs +5 -4
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +1 -12
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -12
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/listItem/ListItem.css +4 -4
- package/build/styles/listItem/ListItem.grid.css +3 -3
- package/build/styles/main.css +47 -9
- package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
- package/build/styles/statusIcon/StatusIcon.css +35 -4
- package/build/types/chips/Chips.d.ts +1 -1
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/common/commonProps.d.ts +0 -6
- package/build/types/common/commonProps.d.ts.map +1 -1
- package/build/types/label/Label.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +10 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts +6 -0
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/currencyFormatting.d.ts +4 -3
- package/build/types/moneyInput/currencyFormatting.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/button/_stories/Button.story.tsx +15 -5
- package/src/checkboxButton/CheckboxButton.story.tsx +125 -44
- package/src/checkboxButton/CheckboxButton.test.story.tsx +236 -0
- package/src/chips/Chips.story.tsx +141 -102
- package/src/chips/Chips.test.story.tsx +177 -0
- package/src/chips/Chips.tsx +1 -1
- package/src/circularButton/CircularButton.story.tsx +261 -49
- package/src/circularButton/CircularButton.test.story.tsx +192 -2
- package/src/common/commonProps.ts +0 -6
- package/src/iconButton/IconButton.story.tsx +315 -110
- package/src/iconButton/IconButton.test.story.tsx +217 -44
- package/src/label/Label.tsx +1 -2
- package/src/listItem/ListItem.css +4 -4
- package/src/listItem/ListItem.grid.css +3 -3
- package/src/listItem/ListItem.grid.less +5 -3
- package/src/listItem/ListItem.less +1 -1
- package/src/listItem/ListItem.vars.less +2 -2
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +55 -0
- package/src/logo/Logo.story.tsx +181 -21
- package/src/logo/Logo.test.story.tsx +40 -7
- package/src/logo/Logo.tsx +10 -1
- package/src/main.css +47 -9
- package/src/moneyInput/MoneyInput.story.tsx +10 -1
- package/src/moneyInput/MoneyInput.test.story.tsx +141 -1
- package/src/moneyInput/MoneyInput.test.tsx +45 -0
- package/src/moneyInput/MoneyInput.tsx +27 -3
- package/src/moneyInput/currencyFormatting.ts +11 -5
- package/src/sentimentSurface/SentimentSurface.css +1 -1
- package/src/sentimentSurface/SentimentSurface.less +1 -1
- package/src/statusIcon/StatusIcon.css +35 -4
- package/src/statusIcon/StatusIcon.less +35 -4
- package/src/statusIcon/StatusIcon.story.tsx +119 -79
- package/src/statusIcon/StatusIcon.test.story.tsx +125 -0
- package/src/statusIcon/StatusIcon.test.tsx +16 -23
- package/src/statusIcon/StatusIcon.tsx +2 -16
- package/src/switch/Switch.story.tsx +64 -42
- package/src/switch/Switch.test.story.tsx +123 -0
package/build/styles/main.css
CHANGED
|
@@ -25824,7 +25824,7 @@ a[data-toggle="tooltip"] {
|
|
|
25824
25824
|
--color-sentiment-interactive-control: #CB272F;
|
|
25825
25825
|
--color-sentiment-interactive-control-hover: #B8232B;
|
|
25826
25826
|
--color-sentiment-interactive-control-active: #A72027;
|
|
25827
|
-
--color-sentiment-background-surface: #
|
|
25827
|
+
--color-sentiment-background-surface: #CB272F;
|
|
25828
25828
|
--color-sentiment-background-surface-hover: #B8232B;
|
|
25829
25829
|
--color-sentiment-background-surface-active: #A72027;
|
|
25830
25830
|
}
|
|
@@ -29430,7 +29430,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29430
29430
|
margin-top: -2px;
|
|
29431
29431
|
}
|
|
29432
29432
|
|
|
29433
|
-
@container (
|
|
29433
|
+
@container (width > 308px) {
|
|
29434
29434
|
.wds-list-item-gridWrapper .wds-list-item-control-wrapper {
|
|
29435
29435
|
height: var(--wds-list-item-control-wrapper-height);
|
|
29436
29436
|
align-content: center;
|
|
@@ -29527,7 +29527,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29527
29527
|
}
|
|
29528
29528
|
}
|
|
29529
29529
|
|
|
29530
|
-
@container (
|
|
29530
|
+
@container (240px < width <= 308px) {
|
|
29531
29531
|
.wds-list-item-gridWrapper .wds-list-item-media-image {
|
|
29532
29532
|
-o-object-position: bottom left;
|
|
29533
29533
|
object-position: bottom left;
|
|
@@ -29659,7 +29659,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29659
29659
|
}
|
|
29660
29660
|
}
|
|
29661
29661
|
|
|
29662
|
-
@container (
|
|
29662
|
+
@container (width <= 240px) {
|
|
29663
29663
|
.wds-list-item-gridWrapper .wds-list-item-control-wrapper {
|
|
29664
29664
|
align-content: start;
|
|
29665
29665
|
}
|
|
@@ -29987,7 +29987,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29987
29987
|
justify-content: center;
|
|
29988
29988
|
}
|
|
29989
29989
|
|
|
29990
|
-
@container (
|
|
29990
|
+
@container (width > 308px) {
|
|
29991
29991
|
.wds-list-item-titles,
|
|
29992
29992
|
.wds-list-item-value {
|
|
29993
29993
|
min-height: 100%;
|
|
@@ -32429,12 +32429,50 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32429
32429
|
}
|
|
32430
32430
|
}
|
|
32431
32431
|
|
|
32432
|
-
.
|
|
32433
|
-
|
|
32432
|
+
.status-circle.negative,
|
|
32433
|
+
.status-circle.error {
|
|
32434
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-negative));
|
|
32434
32435
|
}
|
|
32435
32436
|
|
|
32436
|
-
.
|
|
32437
|
-
|
|
32437
|
+
.status-circle.negative .status-icon,
|
|
32438
|
+
.status-circle.error .status-icon {
|
|
32439
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-negative-secondary));
|
|
32440
|
+
}
|
|
32441
|
+
|
|
32442
|
+
.status-circle.positive,
|
|
32443
|
+
.status-circle.success {
|
|
32444
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-positive));
|
|
32445
|
+
}
|
|
32446
|
+
|
|
32447
|
+
.status-circle.positive .status-icon,
|
|
32448
|
+
.status-circle.success .status-icon {
|
|
32449
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-positive-secondary));
|
|
32450
|
+
}
|
|
32451
|
+
|
|
32452
|
+
.status-circle.warning,
|
|
32453
|
+
.status-circle.pending {
|
|
32454
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-warning));
|
|
32455
|
+
}
|
|
32456
|
+
|
|
32457
|
+
.status-circle.warning .status-icon,
|
|
32458
|
+
.status-circle.pending .status-icon {
|
|
32459
|
+
color: var(--color-sentiment-interactive-control, var(--color-dark));
|
|
32460
|
+
}
|
|
32461
|
+
|
|
32462
|
+
.status-circle.neutral,
|
|
32463
|
+
.status-circle.info {
|
|
32464
|
+
background-color: #5d7079;
|
|
32465
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-content-secondary));
|
|
32466
|
+
}
|
|
32467
|
+
|
|
32468
|
+
.status-circle.neutral .status-icon,
|
|
32469
|
+
.status-circle.info .status-icon {
|
|
32470
|
+
color: var(--color-sentiment-interactive-control, var(--color-contrast-overlay));
|
|
32471
|
+
}
|
|
32472
|
+
|
|
32473
|
+
.np-theme-personal--bright-green .status-circle.neutral .status-icon,
|
|
32474
|
+
.np-theme-personal--bright-green .status-circle.info .status-icon {
|
|
32475
|
+
color: var(--color-sentiment-interactive-control, var(--color-white));
|
|
32438
32476
|
}
|
|
32439
32477
|
|
|
32440
32478
|
.tw-stepper {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
--color-sentiment-interactive-control: #CB272F;
|
|
50
50
|
--color-sentiment-interactive-control-hover: #B8232B;
|
|
51
51
|
--color-sentiment-interactive-control-active: #A72027;
|
|
52
|
-
--color-sentiment-background-surface: #
|
|
52
|
+
--color-sentiment-background-surface: #CB272F;
|
|
53
53
|
--color-sentiment-background-surface-hover: #B8232B;
|
|
54
54
|
--color-sentiment-background-surface-active: #A72027;
|
|
55
55
|
}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.status-circle.negative,
|
|
2
|
+
.status-circle.error {
|
|
3
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-negative));
|
|
3
4
|
}
|
|
4
|
-
.
|
|
5
|
-
|
|
5
|
+
.status-circle.negative .status-icon,
|
|
6
|
+
.status-circle.error .status-icon {
|
|
7
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-negative-secondary));
|
|
8
|
+
}
|
|
9
|
+
.status-circle.positive,
|
|
10
|
+
.status-circle.success {
|
|
11
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-positive));
|
|
12
|
+
}
|
|
13
|
+
.status-circle.positive .status-icon,
|
|
14
|
+
.status-circle.success .status-icon {
|
|
15
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-positive-secondary));
|
|
16
|
+
}
|
|
17
|
+
.status-circle.warning,
|
|
18
|
+
.status-circle.pending {
|
|
19
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-warning));
|
|
20
|
+
}
|
|
21
|
+
.status-circle.warning .status-icon,
|
|
22
|
+
.status-circle.pending .status-icon {
|
|
23
|
+
color: var(--color-sentiment-interactive-control, var(--color-dark));
|
|
24
|
+
}
|
|
25
|
+
.status-circle.neutral,
|
|
26
|
+
.status-circle.info {
|
|
27
|
+
background-color: #5d7079;
|
|
28
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-content-secondary));
|
|
29
|
+
}
|
|
30
|
+
.status-circle.neutral .status-icon,
|
|
31
|
+
.status-circle.info .status-icon {
|
|
32
|
+
color: var(--color-sentiment-interactive-control, var(--color-contrast-overlay));
|
|
33
|
+
}
|
|
34
|
+
.np-theme-personal--bright-green .status-circle.neutral .status-icon,
|
|
35
|
+
.np-theme-personal--bright-green .status-circle.info .status-icon {
|
|
36
|
+
color: var(--color-sentiment-interactive-control, var(--color-white));
|
|
6
37
|
}
|
|
@@ -14,7 +14,7 @@ export type ChipsProps = CommonProps & AriaLabelProperty & {
|
|
|
14
14
|
}) => void;
|
|
15
15
|
/** Used to manage which chips are selected */
|
|
16
16
|
selected: ChipValue | readonly ChipValue[];
|
|
17
|
-
/**
|
|
17
|
+
/** True turns on Filter-mode, False is Choice */
|
|
18
18
|
multiple?: boolean;
|
|
19
19
|
};
|
|
20
20
|
declare const Chips: ({ chips, onChange, selected, "aria-label": ariaLabel, className, multiple, }: ChipsProps) => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chips.d.ts","sourceRoot":"","sources":["../../../src/chips/Chips.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAA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C;CACpB,CAAC;AAEJ,QAAA,MAAM,KAAK,GAAI,8EAOZ,UAAU,gCA6CZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export type CommonProps = {
|
|
2
|
-
/**
|
|
3
|
-
* Space-separated list of the case-sensitive CSS classes,
|
|
4
|
-
* most would be applied to outermost element inside the component
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/transferwise/neptune-web/blob/main/rfc/0001-always-pass-classname.md
|
|
7
|
-
*/
|
|
8
2
|
className?: string;
|
|
9
3
|
};
|
|
10
4
|
export type AriaLabelProperty = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonProps.d.ts","sourceRoot":"","sources":["../../../src/common/commonProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB
|
|
1
|
+
{"version":3,"file":"commonProps.d.ts","sourceRoot":"","sources":["../../../src/common/commonProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC;IACzC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/label/Label.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/label/Label.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AA6BF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAchE,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,WAAW,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAWrF,QAAA,MAAM,cAAc;wCAvBwC,kBAAkB;+CAcR,qBAAqB;CASrB,CAAC;AAGvE,OAAO,EAAE,cAAc,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -6,7 +6,10 @@ export declare enum LogoType {
|
|
|
6
6
|
export interface LogoProps {
|
|
7
7
|
/** Extra classes applied to Logo */
|
|
8
8
|
className?: string;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Renders a light-coloured version suited for dark backgrounds.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
10
13
|
inverse?: boolean;
|
|
11
14
|
/**
|
|
12
15
|
* What type of logo to display
|
|
@@ -14,5 +17,11 @@ export interface LogoProps {
|
|
|
14
17
|
*/
|
|
15
18
|
type?: `${LogoType}`;
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
|
|
22
|
+
* and the full wordmark on ≥576px (small breakpoint and above).
|
|
23
|
+
*
|
|
24
|
+
* @see {@link https://wise.design/foundations/logo Design Spec}
|
|
25
|
+
*/
|
|
17
26
|
export default function Logo({ className, inverse, type }: LogoProps): import("react").JSX.Element;
|
|
18
27
|
//# sourceMappingURL=Logo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/logo/Logo.tsx"],"names":[],"mappings":"AA0BA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/logo/Logo.tsx"],"names":[],"mappings":"AA0BA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC;CACtB;AAQD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAa,EAAE,EAAE,SAAS,+BAW5E"}
|
|
@@ -37,6 +37,12 @@ export interface MoneyInputProps extends WrappedComponentProps {
|
|
|
37
37
|
onCustomAction?: () => void;
|
|
38
38
|
classNames?: Record<string, string>;
|
|
39
39
|
selectProps?: Partial<SelectInputProps<CurrencyOptionItem>>;
|
|
40
|
+
/**
|
|
41
|
+
* Specify the number of decimal places to format the amount. When not specified, the number of
|
|
42
|
+
* decimals is determined by the selected currency (e.g. 2 for EUR, 0 for JPY, 3 for BHD).
|
|
43
|
+
* This override is ignored for zero-decimal currencies (e.g. JPY, KRW, HUF), which always use 0.
|
|
44
|
+
*/
|
|
45
|
+
decimals?: number;
|
|
40
46
|
}
|
|
41
47
|
export type MoneyInputPropsWithInputAttributes = MoneyInputProps & Partial<WithInputAttributesProps>;
|
|
42
48
|
declare const _default: import("react").FC<import("react-intl").WithIntlProps<Omit<MoneyInputPropsWithInputAttributes, "inputAttributes"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAGL,SAAS,EACT,UAAU,EACV,SAAS,EAEV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAuB,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAKL,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAO/B,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"MoneyInput.d.ts","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CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,YAAY,EAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3F,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC5D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,kCAAkC,GAAG,eAAe,GAC9D,OAAO,CAAC,wBAAwB,CAAC,CAAC;;;;;;;;AAoapC,wBAA2F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { formatAmount } from '@transferwise/formatting';
|
|
2
|
-
export { formatAmount };
|
|
3
|
-
export declare function
|
|
1
|
+
import { formatAmount, formatNumber } from '@transferwise/formatting';
|
|
2
|
+
export { formatAmount, formatNumber };
|
|
3
|
+
export declare function getCurrencyDecimals(currency: string): number;
|
|
4
|
+
export declare function parseAmount(number: string, currency: string, locale?: string, decimals?: number): number;
|
|
4
5
|
//# sourceMappingURL=currencyFormatting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencyFormatting.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/currencyFormatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"currencyFormatting.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/currencyFormatting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAItE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAkDtC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,UAGnD;AAMD,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAiB,EACvB,QAAQ,CAAC,EAAE,MAAM,UAgBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusIcon.d.ts","sourceRoot":"","sources":["../../../src/statusIcon/StatusIcon.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAoB,MAAM,EAAE,MAAM,WAAW,CAAC;AAMlG;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,SAAS,CAAC,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACrC,kBAAkB;IAClB,IAAI,CAAC,EAAE,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACtD;;;;SAIK;IACL,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAQF,QAAA,MAAM,UAAU,GAAI,+CAKjB,eAAe,gCA8DjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.134.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
50
50
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
51
51
|
"@rollup/plugin-url": "^8.0.2",
|
|
52
|
-
"@storybook/addon-a11y": "^10.3.
|
|
53
|
-
"@storybook/addon-docs": "^10.3.
|
|
52
|
+
"@storybook/addon-a11y": "^10.3.3",
|
|
53
|
+
"@storybook/addon-docs": "^10.3.3",
|
|
54
54
|
"@storybook/addon-mcp": "^0.4.1",
|
|
55
55
|
"@storybook/addon-webpack5-compiler-babel": "^4.0.0",
|
|
56
|
-
"@storybook/react-webpack5": "^10.3.
|
|
56
|
+
"@storybook/react-webpack5": "^10.3.3",
|
|
57
57
|
"@testing-library/dom": "^10.4.1",
|
|
58
58
|
"@testing-library/jest-dom": "^6.9.1",
|
|
59
59
|
"@testing-library/react": "^16.3.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@wise/eslint-config": "^13.3.0",
|
|
74
74
|
"babel-plugin-formatjs": "^10.5.41",
|
|
75
75
|
"eslint": "^9.39.4",
|
|
76
|
-
"eslint-plugin-storybook": "^10.3.
|
|
76
|
+
"eslint-plugin-storybook": "^10.3.3",
|
|
77
77
|
"gulp": "^5.0.1",
|
|
78
78
|
"jest": "^30.3.0",
|
|
79
79
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"react-intl": "^7.1.14",
|
|
84
84
|
"rollup": "^4.57.1",
|
|
85
85
|
"rollup-preserve-directives": "^1.1.3",
|
|
86
|
-
"storybook": "^10.3.
|
|
86
|
+
"storybook": "^10.3.3",
|
|
87
87
|
"storybook-addon-tag-badges": "^3.1.0",
|
|
88
88
|
"storybook-addon-test-codegen": "^3.0.1",
|
|
89
89
|
"@transferwise/less-config": "3.1.2",
|
|
90
|
-
"@
|
|
90
|
+
"@transferwise/neptune-css": "14.27.1",
|
|
91
91
|
"@wise/components-theming": "1.10.1",
|
|
92
|
-
"@
|
|
92
|
+
"@wise/wds-configs": "0.0.0"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@transferwise/icons": "^3 || ^4",
|
|
@@ -158,7 +158,6 @@ const meta: Meta<typeof Button> = {
|
|
|
158
158
|
table: {
|
|
159
159
|
readonly: true,
|
|
160
160
|
},
|
|
161
|
-
description: 'If set, toggles the new Button API',
|
|
162
161
|
},
|
|
163
162
|
size: {
|
|
164
163
|
type: {
|
|
@@ -195,13 +194,11 @@ const meta: Meta<typeof Button> = {
|
|
|
195
194
|
},
|
|
196
195
|
},
|
|
197
196
|
disabled: {
|
|
198
|
-
description: 'Toggles the disabled state',
|
|
199
197
|
table: {
|
|
200
198
|
defaultValue: { summary: 'false' },
|
|
201
199
|
},
|
|
202
200
|
},
|
|
203
201
|
loading: {
|
|
204
|
-
description: 'Toggles the loading state',
|
|
205
202
|
table: {
|
|
206
203
|
defaultValue: { summary: 'false' },
|
|
207
204
|
},
|
|
@@ -215,7 +212,6 @@ const meta: Meta<typeof Button> = {
|
|
|
215
212
|
type: {
|
|
216
213
|
name: 'string',
|
|
217
214
|
},
|
|
218
|
-
description: 'If set, the component will render as an HTML anchor.',
|
|
219
215
|
},
|
|
220
216
|
target: {
|
|
221
217
|
type: {
|
|
@@ -240,7 +236,6 @@ const meta: Meta<typeof Button> = {
|
|
|
240
236
|
summary: 'string',
|
|
241
237
|
},
|
|
242
238
|
},
|
|
243
|
-
description: "Native HTML button's `type` attribute",
|
|
244
239
|
},
|
|
245
240
|
htmlType: {
|
|
246
241
|
table: {
|
|
@@ -254,6 +249,21 @@ const meta: Meta<typeof Button> = {
|
|
|
254
249
|
},
|
|
255
250
|
},
|
|
256
251
|
},
|
|
252
|
+
id: {
|
|
253
|
+
table: {
|
|
254
|
+
category: 'Common',
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
className: {
|
|
258
|
+
table: {
|
|
259
|
+
category: 'Common',
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
onClick: {
|
|
263
|
+
table: {
|
|
264
|
+
category: 'Common',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
257
267
|
},
|
|
258
268
|
args: {
|
|
259
269
|
v2: true,
|
|
@@ -1,67 +1,148 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
2
3
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
-
import { useState } from 'react';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { storySourceWithoutNoise } from '../../.storybook/helpers';
|
|
6
|
+
import CheckboxButton, { type CheckboxButtonProps } from './CheckboxButton';
|
|
7
|
+
import { Label } from '../label/Label';
|
|
6
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Use <a href="?path=/docs/forms-checkbox--docs">Checkbox</a> component instead when pairing with a label. Only use CheckboxButton when you need a standalone checkbox (e.g. settings matrix) and provide an `aria-label`.
|
|
11
|
+
*
|
|
12
|
+
* **Design guidance**: <a href="https://wise.design/components/checkbox" target="_blank">wise.design/components/checkbox</a>
|
|
13
|
+
*/
|
|
7
14
|
export default {
|
|
8
15
|
component: CheckboxButton,
|
|
9
16
|
title: 'Actions/CheckboxButton',
|
|
10
17
|
args: {
|
|
18
|
+
'aria-label': 'Toggle checkbox',
|
|
19
|
+
checked: true,
|
|
11
20
|
disabled: false,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
indeterminate: false,
|
|
22
|
+
onBlur: fn(),
|
|
23
|
+
onChange: fn(),
|
|
24
|
+
onClick: fn(),
|
|
25
|
+
onFocus: fn(),
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
'aria-label': {
|
|
29
|
+
description: 'Provides the accessible name when the control has no visible text label.',
|
|
30
|
+
},
|
|
31
|
+
checked: {
|
|
32
|
+
description: 'Controls whether the checkbox is checked.',
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
description: 'Toggles the disabled state.',
|
|
36
|
+
},
|
|
37
|
+
name: {
|
|
38
|
+
description: 'Name submitted with the form when the checkbox is checked.',
|
|
39
|
+
},
|
|
40
|
+
value: {
|
|
41
|
+
description: 'Value submitted with the form when the checkbox is checked.',
|
|
42
|
+
},
|
|
43
|
+
onChange: {
|
|
44
|
+
description: 'Called when the checked state changes.',
|
|
45
|
+
},
|
|
46
|
+
indeterminate: {
|
|
47
|
+
description:
|
|
48
|
+
'Sets the native mixed state — used when some (not all) child items are selected. Clicking resolves to checked; clear `indeterminate` in `onChange` to reflect the transition.',
|
|
49
|
+
},
|
|
50
|
+
defaultChecked: { table: { category: 'Common' } },
|
|
51
|
+
id: { table: { category: 'Common' } },
|
|
52
|
+
className: { table: { category: 'Common' } },
|
|
53
|
+
onBlur: { table: { category: 'Common' } },
|
|
54
|
+
onClick: { table: { category: 'Common' } },
|
|
55
|
+
onFocus: { table: { category: 'Common' } },
|
|
56
|
+
},
|
|
57
|
+
parameters: {
|
|
58
|
+
docs: { toc: true },
|
|
15
59
|
},
|
|
16
60
|
} satisfies Meta<typeof CheckboxButton>;
|
|
17
61
|
|
|
18
62
|
type Story = StoryObj<typeof CheckboxButton>;
|
|
19
63
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const [checked, setChecked] = useState(true);
|
|
64
|
+
const withColumnLayout = (Story: () => JSX.Element) => (
|
|
65
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
66
|
+
<Story />
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
26
69
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
70
|
+
/** Interactive single checkbox — use the Controls panel to toggle `disabled` and `indeterminate`. */
|
|
71
|
+
export const Playground: Story = storySourceWithoutNoise({
|
|
72
|
+
render: function Render(args: CheckboxButtonProps) {
|
|
73
|
+
const [checked, setChecked] = useState(args.checked ?? true);
|
|
30
74
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* It is used to indicate a mixed state, where some but not all items are selected, but does not
|
|
35
|
-
* change the `checked` state of the input itself – it remains either checked or unchecked.
|
|
36
|
-
*
|
|
37
|
-
* In the example below the 1st checkbox is unchecked and the 2nd checkbox is checked.
|
|
38
|
-
*/
|
|
39
|
-
export const Indeterminate: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
indeterminate: true,
|
|
42
|
-
},
|
|
43
|
-
render: (args) => {
|
|
44
|
-
const [checked1, setChecked1] = useState<boolean | undefined>(false);
|
|
45
|
-
const [checked2, setChecked2] = useState<boolean | undefined>(true);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
setChecked(args.checked ?? true);
|
|
77
|
+
}, [args.checked]);
|
|
46
78
|
|
|
47
79
|
return (
|
|
48
|
-
|
|
80
|
+
<CheckboxButton
|
|
81
|
+
{...args}
|
|
82
|
+
checked={checked}
|
|
83
|
+
onChange={(e) => {
|
|
84
|
+
setChecked(e.currentTarget.checked);
|
|
85
|
+
args.onChange?.(e);
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/** Disabled state — checked and unchecked. */
|
|
93
|
+
export const Disabled: Story = {
|
|
94
|
+
decorators: [withColumnLayout],
|
|
95
|
+
render: (args) => (
|
|
96
|
+
<>
|
|
97
|
+
<div>
|
|
98
|
+
<Label htmlFor="disabled-unchecked">Disabled unchecked</Label>
|
|
99
|
+
<CheckboxButton
|
|
100
|
+
id="disabled-unchecked"
|
|
101
|
+
aria-label="Disabled unchecked"
|
|
102
|
+
checked={false}
|
|
103
|
+
disabled
|
|
104
|
+
onChange={() => {}}
|
|
105
|
+
/>
|
|
106
|
+
</div>
|
|
107
|
+
<div>
|
|
108
|
+
<Label htmlFor="disabled-checked">Disabled checked</Label>
|
|
49
109
|
<CheckboxButton
|
|
50
|
-
|
|
51
|
-
checked
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
onChange={() =>
|
|
110
|
+
id="disabled-checked"
|
|
111
|
+
aria-label="Disabled checked"
|
|
112
|
+
checked
|
|
113
|
+
disabled
|
|
114
|
+
onChange={() => {}}
|
|
55
115
|
/>
|
|
116
|
+
</div>
|
|
117
|
+
</>
|
|
118
|
+
),
|
|
119
|
+
};
|
|
56
120
|
|
|
121
|
+
/** Indeterminate state — checked and unchecked. */
|
|
122
|
+
export const Indeterminate: Story = {
|
|
123
|
+
decorators: [withColumnLayout],
|
|
124
|
+
render: (args) => (
|
|
125
|
+
<>
|
|
126
|
+
<div>
|
|
127
|
+
<Label htmlFor="indeterminate-unchecked">Indeterminate (unchecked)</Label>
|
|
57
128
|
<CheckboxButton
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
onChange={() =>
|
|
129
|
+
id="indeterminate-unchecked"
|
|
130
|
+
aria-label="Indeterminate unchecked"
|
|
131
|
+
checked={false}
|
|
132
|
+
indeterminate
|
|
133
|
+
onChange={() => {}}
|
|
63
134
|
/>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
135
|
+
</div>
|
|
136
|
+
<div>
|
|
137
|
+
<Label htmlFor="indeterminate-checked">Indeterminate (checked)</Label>
|
|
138
|
+
<CheckboxButton
|
|
139
|
+
id="indeterminate-checked"
|
|
140
|
+
aria-label="Indeterminate checked"
|
|
141
|
+
checked
|
|
142
|
+
indeterminate
|
|
143
|
+
onChange={() => {}}
|
|
144
|
+
/>
|
|
145
|
+
</div>
|
|
146
|
+
</>
|
|
147
|
+
),
|
|
67
148
|
};
|