@transferwise/components 46.0.1 → 46.0.3
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/index.esm.js +32 -49
- package/build/index.esm.js.map +1 -1
- package/build/index.js +32 -49
- package/build/index.js.map +1 -1
- package/build/types/chevron/Chevron.d.ts +14 -17
- package/build/types/chevron/Chevron.d.ts.map +1 -1
- package/build/types/chevron/index.d.ts +1 -1
- package/build/types/chevron/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatar/Avatar.tsx +1 -1
- package/src/card/Card.spec.js +2 -4
- package/src/chevron/Chevron.story.tsx +7 -14
- package/src/chevron/Chevron.tsx +73 -0
- package/src/moneyInput/MoneyInput.js +1 -1
- package/src/moneyInput/MoneyInput.story.tsx +25 -2
- package/src/chevron/Chevron.js +0 -67
- package/src/chevron/__mocks__/index.js +0 -7
- /package/src/chevron/{Chevron.spec.js → Chevron.spec.tsx} +0 -0
- /package/src/chevron/__snapshots__/{Chevron.spec.js.snap → Chevron.spec.tsx.snap} +0 -0
- /package/src/chevron/{index.js → index.ts} +0 -0
package/build/index.esm.js
CHANGED
|
@@ -4,8 +4,8 @@ import * as React from 'react';
|
|
|
4
4
|
import React__default, { forwardRef, cloneElement, useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect, createContext, useContext, Component, PureComponent, createRef, Children, Fragment as Fragment$1 } from 'react';
|
|
5
5
|
import { useId } from '@radix-ui/react-id';
|
|
6
6
|
import { ChevronUp, CrossCircleFill, Cross, NavigateAway, Check, Info as Info$1, Alert as Alert$2, ClockBorderless, CheckCircle, InfoCircle, Warning, CrossCircle, Clock, Briefcase, Person, ArrowLeft, QuestionMarkCircle, AlertCircle, Search, ChevronDown, CheckCircleFill, ArrowRight, Download, ClockFill, Upload as Upload$2, Document, Plus, PlusCircle, AlertCircleFill } from '@transferwise/icons';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
7
|
import { defineMessages, useIntl, injectIntl, IntlProvider } from 'react-intl';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
9
|
import { useTheme, ThemeProvider } from '@wise/components-theming';
|
|
10
10
|
import { Transition, Listbox } from '@headlessui/react';
|
|
11
11
|
import mergeProps from 'merge-props';
|
|
@@ -540,61 +540,44 @@ const CONTAINER_SIZE = {
|
|
|
540
540
|
};
|
|
541
541
|
const ExtraSmallChevron = ({
|
|
542
542
|
className
|
|
543
|
-
}) =>
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
543
|
+
}) => {
|
|
544
|
+
return /*#__PURE__*/jsx("span", {
|
|
545
|
+
className: classNames('tw-icon', 'tw-icon-chevron', className),
|
|
546
|
+
role: "presentation",
|
|
547
|
+
"aria-hidden": true,
|
|
548
|
+
children: /*#__PURE__*/jsx("svg", {
|
|
549
|
+
width: "10",
|
|
550
|
+
height: "10",
|
|
551
|
+
viewBox: "0 0 10 10",
|
|
552
|
+
fill: "currentColor",
|
|
553
|
+
focusable: "false",
|
|
554
|
+
children: /*#__PURE__*/jsx("path", {
|
|
555
|
+
fillRule: "evenodd",
|
|
556
|
+
d: "M4.9995 2.0865L0.0635004 6.7645L1.2745 7.9125L4.9995 4.3835L8.7245 7.9135L9.9355 6.7645L4.9995 2.0865Z"
|
|
557
|
+
})
|
|
556
558
|
})
|
|
557
|
-
})
|
|
558
|
-
});
|
|
559
|
-
ExtraSmallChevron.propTypes = {
|
|
560
|
-
className: PropTypes.string
|
|
561
|
-
};
|
|
562
|
-
ExtraSmallChevron.defaultProps = {
|
|
563
|
-
className: null
|
|
559
|
+
});
|
|
564
560
|
};
|
|
565
561
|
const Chevron = ({
|
|
566
|
-
orientation,
|
|
567
|
-
size,
|
|
568
|
-
disabled,
|
|
562
|
+
orientation = Position.BOTTOM,
|
|
563
|
+
size = Size.SMALL,
|
|
564
|
+
disabled = false,
|
|
569
565
|
className
|
|
570
566
|
}) => {
|
|
571
567
|
const classNameValue = classNames('tw-chevron', {
|
|
572
568
|
'chevron-color': !disabled
|
|
573
|
-
}, `${
|
|
574
|
-
const sizeValue = CONTAINER_SIZE[size];
|
|
569
|
+
}, `${orientation}`.toLowerCase(), className);
|
|
575
570
|
if (size === Size.EXTRA_SMALL) {
|
|
576
571
|
return /*#__PURE__*/jsx(ExtraSmallChevron, {
|
|
577
572
|
className: classNameValue
|
|
578
573
|
});
|
|
579
574
|
}
|
|
575
|
+
const sizeValue = CONTAINER_SIZE[size];
|
|
580
576
|
return /*#__PURE__*/jsx(ChevronUp, {
|
|
581
577
|
className: classNameValue,
|
|
582
578
|
size: sizeValue
|
|
583
579
|
});
|
|
584
580
|
};
|
|
585
|
-
Chevron.propTypes = {
|
|
586
|
-
orientation: PropTypes.oneOf(['top', 'bottom', 'left', 'right']),
|
|
587
|
-
size: PropTypes.oneOf(['xs', 'sm', 'md']),
|
|
588
|
-
disabled: PropTypes.bool,
|
|
589
|
-
className: PropTypes.string
|
|
590
|
-
};
|
|
591
|
-
Chevron.defaultProps = {
|
|
592
|
-
orientation: Position.BOTTOM,
|
|
593
|
-
size: Size.SMALL,
|
|
594
|
-
disabled: false,
|
|
595
|
-
className: null
|
|
596
|
-
};
|
|
597
|
-
var Chevron$1 = Chevron;
|
|
598
581
|
|
|
599
582
|
const Option$2 = /*#__PURE__*/forwardRef(({
|
|
600
583
|
media = '',
|
|
@@ -679,7 +662,7 @@ const AccordionItem = ({
|
|
|
679
662
|
as: "button",
|
|
680
663
|
media: iconElement,
|
|
681
664
|
title: title,
|
|
682
|
-
button: /*#__PURE__*/jsx(Chevron
|
|
665
|
+
button: /*#__PURE__*/jsx(Chevron, {
|
|
683
666
|
orientation: open ? Position.TOP : Position.BOTTOM,
|
|
684
667
|
size: Size.MEDIUM
|
|
685
668
|
}),
|
|
@@ -1345,7 +1328,7 @@ const Avatar = ({
|
|
|
1345
1328
|
backgroundColor = null,
|
|
1346
1329
|
backgroundColorSeed = null,
|
|
1347
1330
|
children = null,
|
|
1348
|
-
className
|
|
1331
|
+
className,
|
|
1349
1332
|
outlined = false,
|
|
1350
1333
|
size: sizeFromProps = 48,
|
|
1351
1334
|
theme = Theme.LIGHT,
|
|
@@ -2454,7 +2437,7 @@ const Card$1 = /*#__PURE__*/forwardRef((props, reference) => {
|
|
|
2454
2437
|
title: title,
|
|
2455
2438
|
content: details,
|
|
2456
2439
|
showMediaAtAllSizes: true,
|
|
2457
|
-
button: children && /*#__PURE__*/jsx(Chevron
|
|
2440
|
+
button: children && /*#__PURE__*/jsx(Chevron, {
|
|
2458
2441
|
orientation: isOpen ? Position.TOP : Position.BOTTOM
|
|
2459
2442
|
}),
|
|
2460
2443
|
onClick: () => children && onClick(!isExpanded)
|
|
@@ -3424,7 +3407,7 @@ const DateTrigger = ({
|
|
|
3424
3407
|
}) : /*#__PURE__*/jsx("span", {
|
|
3425
3408
|
className: "form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",
|
|
3426
3409
|
children: placeholder
|
|
3427
|
-
}), !onClear ? /*#__PURE__*/jsx(Chevron
|
|
3410
|
+
}), !onClear ? /*#__PURE__*/jsx(Chevron, {
|
|
3428
3411
|
orientation: Position.BOTTOM,
|
|
3429
3412
|
disabled: disabled
|
|
3430
3413
|
}) : null]
|
|
@@ -3513,7 +3496,7 @@ const DateHeader = ({
|
|
|
3513
3496
|
className: `d-inline-flex ${buttonClasses}`,
|
|
3514
3497
|
"aria-label": `${intl.formatMessage(messages$7.previous)} ${dateMode}`,
|
|
3515
3498
|
onClick: onPreviousClick,
|
|
3516
|
-
children: /*#__PURE__*/jsx(Chevron
|
|
3499
|
+
children: /*#__PURE__*/jsx(Chevron, {
|
|
3517
3500
|
orientation: Position.LEFT,
|
|
3518
3501
|
className: "left-single-direction",
|
|
3519
3502
|
size: Size.MEDIUM
|
|
@@ -3536,7 +3519,7 @@ const DateHeader = ({
|
|
|
3536
3519
|
className: `d-inline-flex ${buttonClasses}`,
|
|
3537
3520
|
"aria-label": `${useIntl().formatMessage(messages$7.next)} ${dateMode}`,
|
|
3538
3521
|
onClick: onNextClick,
|
|
3539
|
-
children: /*#__PURE__*/jsx(Chevron
|
|
3522
|
+
children: /*#__PURE__*/jsx(Chevron, {
|
|
3540
3523
|
orientation: Position.RIGHT,
|
|
3541
3524
|
className: "right-single-direction",
|
|
3542
3525
|
size: Size.MEDIUM
|
|
@@ -4490,7 +4473,7 @@ const NavigationOption = /*#__PURE__*/forwardRef(({
|
|
|
4490
4473
|
ref: reference,
|
|
4491
4474
|
as: component,
|
|
4492
4475
|
className: classNames('np-navigation-option', className),
|
|
4493
|
-
button: /*#__PURE__*/jsx(Chevron
|
|
4476
|
+
button: /*#__PURE__*/jsx(Chevron, {
|
|
4494
4477
|
orientation: Position.RIGHT,
|
|
4495
4478
|
disabled: disabled,
|
|
4496
4479
|
className: "d-block"
|
|
@@ -8075,7 +8058,7 @@ class MoneyInput extends Component {
|
|
|
8075
8058
|
compareValues: "currency",
|
|
8076
8059
|
renderValue: (currency, withinTrigger) => {
|
|
8077
8060
|
return /*#__PURE__*/jsx(SelectInputOptionContent, {
|
|
8078
|
-
title: currency.label,
|
|
8061
|
+
title: withinTrigger ? currency.currency.toUpperCase() : currency.label,
|
|
8079
8062
|
note: withinTrigger ? undefined : currency.note,
|
|
8080
8063
|
icon: /*#__PURE__*/jsx(Flag, {
|
|
8081
8064
|
code: currency.currency,
|
|
@@ -11136,7 +11119,7 @@ function Select({
|
|
|
11136
11119
|
}) : /*#__PURE__*/jsx("span", {
|
|
11137
11120
|
className: s('form-control-placeholder'),
|
|
11138
11121
|
children: placeholder
|
|
11139
|
-
}), /*#__PURE__*/jsx(Chevron
|
|
11122
|
+
}), /*#__PURE__*/jsx(Chevron
|
|
11140
11123
|
// disabled={disabled}
|
|
11141
11124
|
, {
|
|
11142
11125
|
className: classNames(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
|
|
@@ -15609,5 +15592,5 @@ const translations = {
|
|
|
15609
15592
|
'zh-HK': zhHK
|
|
15610
15593
|
};
|
|
15611
15594
|
|
|
15612
|
-
export { Accordion, ActionButton, ActionOption, Alert$1 as Alert, ArrowPosition as AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card as BaseCard, Body, BottomSheet$2 as BottomSheet, Breakpoint, Button, Card$2 as Card, Checkbox$1 as Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron
|
|
15595
|
+
export { Accordion, ActionButton, ActionOption, Alert$1 as Alert, ArrowPosition as AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card as BaseCard, Body, BottomSheet$2 as BottomSheet, Breakpoint, Button, Card$2 as Card, Checkbox$1 as Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton$1 as CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput$1 as DateInput, DateLookup$1 as DateLookup, DateMode, Decision$1 as Decision, Presentation as DecisionPresentation, Type as DecisionType, DefinitionList$1 as DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, DynamicFieldDefinitionList$1 as DynamicFieldDefinitionList, Emphasis, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat$1 as InputWithDisplayFormat, InstructionsList$1 as InstructionsList, LanguageProvider, Layout$1 as Layout, Link, ListItem$1 as ListItem, Loader$1 as Loader, Logo$1 as Logo, LogoType, Markdown$1 as Markdown, MarkdownNodeType, Modal, Money$1 as Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList$1 as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput$1 as PhoneNumberInput, Popover$2 as Popover, Position, Priority, ProcessIndicator$1 as ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCard$1 as PromoCardGroup, Provider$1 as Provider, RTL_LANGUAGES, Radio$1 as Radio, RadioGroup$1 as RadioGroup, RadioOption$1 as RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel$1 as SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider$1 as SnackbarProvider, Status, StatusIcon, Stepper, Sticky$1 as Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat$1 as TextareaWithDisplayFormat, Theme, Title, Tooltip$1 as Tooltip, Type$1 as Type, Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
|
|
15613
15596
|
//# sourceMappingURL=index.esm.js.map
|