@transferwise/components 46.0.2 → 46.0.4

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.
@@ -4,8 +4,10 @@
4
4
  "neptune.ClearButton.ariaLabel": "Clear",
5
5
  "neptune.CloseButton.ariaLabel": "Close",
6
6
  "neptune.DateInput.day.label": "Day",
7
+ "neptune.DateInput.day.placeholder": "DD",
7
8
  "neptune.DateInput.month.label": "Month",
8
9
  "neptune.DateInput.year.label": "Year",
10
+ "neptune.DateInput.year.placeholder": "YYYY",
9
11
  "neptune.DateLookup.day": "day",
10
12
  "neptune.DateLookup.goTo20YearView": "Go to 20 year view",
11
13
  "neptune.DateLookup.month": "month",
@@ -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
- }) => /*#__PURE__*/jsx("span", {
544
- className: classNames('tw-icon', 'tw-icon-chevron', className),
545
- role: "presentation",
546
- "aria-hidden": true,
547
- children: /*#__PURE__*/jsx("svg", {
548
- width: "10",
549
- height: "10",
550
- viewBox: "0 0 10 10",
551
- fill: "currentColor",
552
- focusable: "false",
553
- children: /*#__PURE__*/jsx("path", {
554
- fillRule: "evenodd",
555
- d: "M4.9995 2.0865L0.0635004 6.7645L1.2745 7.9125L4.9995 4.3835L8.7245 7.9135L9.9355 6.7645L4.9995 2.0865Z"
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
- }, `${[orientation]}`.toLowerCase(), className);
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$1, {
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 = null,
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$1, {
2440
+ button: children && /*#__PURE__*/jsx(Chevron, {
2458
2441
  orientation: isOpen ? Position.TOP : Position.BOTTOM
2459
2442
  }),
2460
2443
  onClick: () => children && onClick(!isExpanded)
@@ -2856,6 +2839,12 @@ var messages$8 = defineMessages({
2856
2839
  },
2857
2840
  yearLabel: {
2858
2841
  id: "neptune.DateInput.year.label"
2842
+ },
2843
+ dayPlaceholder: {
2844
+ id: "neptune.DateInput.day.placeholder"
2845
+ },
2846
+ yearPlaceholder: {
2847
+ id: "neptune.DateInput.year.placeholder"
2859
2848
  }
2860
2849
  });
2861
2850
 
@@ -2931,9 +2920,9 @@ const DateInput = ({
2931
2920
  monthLabel = monthLabel || formatMessage(messages$8.monthLabel);
2932
2921
  yearLabel = yearLabel || formatMessage(messages$8.yearLabel);
2933
2922
  placeholders = {
2934
- day: placeholders?.day || 'DD',
2923
+ day: placeholders?.day || formatMessage(messages$8.dayPlaceholder),
2935
2924
  month: placeholders?.month || formatMessage(messages$8.monthLabel),
2936
- year: placeholders?.year || 'YYYY'
2925
+ year: placeholders?.year || formatMessage(messages$8.yearPlaceholder)
2937
2926
  };
2938
2927
  const getDateAsString = date => {
2939
2928
  if (!isDateValid(date)) {
@@ -3424,7 +3413,7 @@ const DateTrigger = ({
3424
3413
  }) : /*#__PURE__*/jsx("span", {
3425
3414
  className: "form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",
3426
3415
  children: placeholder
3427
- }), !onClear ? /*#__PURE__*/jsx(Chevron$1, {
3416
+ }), !onClear ? /*#__PURE__*/jsx(Chevron, {
3428
3417
  orientation: Position.BOTTOM,
3429
3418
  disabled: disabled
3430
3419
  }) : null]
@@ -3513,7 +3502,7 @@ const DateHeader = ({
3513
3502
  className: `d-inline-flex ${buttonClasses}`,
3514
3503
  "aria-label": `${intl.formatMessage(messages$7.previous)} ${dateMode}`,
3515
3504
  onClick: onPreviousClick,
3516
- children: /*#__PURE__*/jsx(Chevron$1, {
3505
+ children: /*#__PURE__*/jsx(Chevron, {
3517
3506
  orientation: Position.LEFT,
3518
3507
  className: "left-single-direction",
3519
3508
  size: Size.MEDIUM
@@ -3536,7 +3525,7 @@ const DateHeader = ({
3536
3525
  className: `d-inline-flex ${buttonClasses}`,
3537
3526
  "aria-label": `${useIntl().formatMessage(messages$7.next)} ${dateMode}`,
3538
3527
  onClick: onNextClick,
3539
- children: /*#__PURE__*/jsx(Chevron$1, {
3528
+ children: /*#__PURE__*/jsx(Chevron, {
3540
3529
  orientation: Position.RIGHT,
3541
3530
  className: "right-single-direction",
3542
3531
  size: Size.MEDIUM
@@ -4490,7 +4479,7 @@ const NavigationOption = /*#__PURE__*/forwardRef(({
4490
4479
  ref: reference,
4491
4480
  as: component,
4492
4481
  className: classNames('np-navigation-option', className),
4493
- button: /*#__PURE__*/jsx(Chevron$1, {
4482
+ button: /*#__PURE__*/jsx(Chevron, {
4494
4483
  orientation: Position.RIGHT,
4495
4484
  disabled: disabled,
4496
4485
  className: "d-block"
@@ -10212,8 +10201,10 @@ var en = {
10212
10201
  "neptune.ClearButton.ariaLabel": "Clear",
10213
10202
  "neptune.CloseButton.ariaLabel": "Close",
10214
10203
  "neptune.DateInput.day.label": "Day",
10204
+ "neptune.DateInput.day.placeholder": "DD",
10215
10205
  "neptune.DateInput.month.label": "Month",
10216
10206
  "neptune.DateInput.year.label": "Year",
10207
+ "neptune.DateInput.year.placeholder": "YYYY",
10217
10208
  "neptune.DateLookup.day": "day",
10218
10209
  "neptune.DateLookup.goTo20YearView": "Go to 20 year view",
10219
10210
  "neptune.DateLookup.month": "month",
@@ -11136,7 +11127,7 @@ function Select({
11136
11127
  }) : /*#__PURE__*/jsx("span", {
11137
11128
  className: s('form-control-placeholder'),
11138
11129
  children: placeholder
11139
- }), /*#__PURE__*/jsx(Chevron$1
11130
+ }), /*#__PURE__*/jsx(Chevron
11140
11131
  // disabled={disabled}
11141
11132
  , {
11142
11133
  className: classNames(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
@@ -15609,5 +15600,5 @@ const translations = {
15609
15600
  'zh-HK': zhHK
15610
15601
  };
15611
15602
 
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$1 as 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 };
15603
+ 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
15604
  //# sourceMappingURL=index.esm.js.map