@transferwise/components 0.0.0-experimental-d9b4d5e → 0.0.0-experimental-a0d696c

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.mjs CHANGED
@@ -4652,7 +4652,7 @@ const NavigationOption = /*#__PURE__*/forwardRef(({
4652
4652
  });
4653
4653
  });
4654
4654
 
4655
- function Tile({
4655
+ const Tile = ({
4656
4656
  className,
4657
4657
  description,
4658
4658
  disabled,
@@ -4660,10 +4660,10 @@ function Tile({
4660
4660
  target,
4661
4661
  media,
4662
4662
  onClick,
4663
- size = 'md',
4663
+ size,
4664
4664
  title
4665
- }) {
4666
- const isSmall = size === 'sm';
4665
+ }) => {
4666
+ const isSmall = size === Size.SMALL;
4667
4667
  const Element = href ? 'a' : 'button';
4668
4668
  return /*#__PURE__*/jsxs(Element, {
4669
4669
  className: classNames('decision', 'flex-column', 'np-tile', 'text-no-decoration', 'text-xs-center', className, {
@@ -4672,12 +4672,12 @@ function Tile({
4672
4672
  }, disabled && 'disabled'),
4673
4673
  href: href,
4674
4674
  target: target,
4675
- onClick: disabled ? undefined : onClick,
4676
- onKeyDown: disabled ? undefined : ({
4675
+ onClick: disabled ? null : onClick,
4676
+ onKeyDown: disabled ? null : ({
4677
4677
  key
4678
4678
  }) => {
4679
4679
  if (key === 'Enter' || key === ' ') {
4680
- onClick?.();
4680
+ onClick();
4681
4681
  }
4682
4682
  },
4683
4683
  children: [/*#__PURE__*/jsx("div", {
@@ -4694,7 +4694,29 @@ function Tile({
4694
4694
  children: description
4695
4695
  }) : null]
4696
4696
  });
4697
- }
4697
+ };
4698
+ Tile.propTypes = {
4699
+ /** Classes to apply to the Tile container */
4700
+ className: PropTypes.string,
4701
+ description: PropTypes.node,
4702
+ disabled: PropTypes.bool,
4703
+ href: PropTypes.string,
4704
+ target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
4705
+ /** Accepts only Avatar and images */
4706
+ media: PropTypes.node.isRequired,
4707
+ /** Function called onClick or onKeyDown */
4708
+ onClick: PropTypes.func,
4709
+ /** The size applied to Tile */
4710
+ size: PropTypes.oneOf(['sm', 'md']),
4711
+ title: PropTypes.node.isRequired
4712
+ };
4713
+ Tile.defaultProps = {
4714
+ className: '',
4715
+ description: null,
4716
+ disabled: false,
4717
+ size: Size.MEDIUM,
4718
+ target: undefined
4719
+ };
4698
4720
 
4699
4721
  var DecisionPresentation;
4700
4722
  (function (DecisionPresentation) {
@@ -4786,9 +4808,9 @@ const Decision = ({
4786
4808
  return null;
4787
4809
  };
4788
4810
 
4789
- const isLayoutHorizontal = layout => [Layout.HORIZONTAL_LEFT_ALIGNED, Layout.HORIZONTAL_RIGHT_ALIGNED, Layout.HORIZONTAL_JUSTIFIED].includes(layout);
4811
+ const isLayoutHorizontal = layout => layout === Layout.HORIZONTAL_LEFT_ALIGNED || layout === Layout.HORIZONTAL_RIGHT_ALIGNED || layout === Layout.HORIZONTAL_JUSTIFIED;
4790
4812
  const getAlignmentClasses = (layout, action) => {
4791
- let classes = ['d-flex'];
4813
+ const classes = ['d-flex'];
4792
4814
  if (action) {
4793
4815
  if (isLayoutHorizontal(layout)) {
4794
4816
  classes.push('align-items-center');
@@ -4806,60 +4828,44 @@ const getAlignmentClasses = (layout, action) => {
4806
4828
  }
4807
4829
  return classes;
4808
4830
  };
4809
- const DefinitionList = ({
4810
- definitions,
4811
- layout,
4831
+ const defaultDefinitions = [];
4832
+ function DefinitionList({
4833
+ definitions = defaultDefinitions,
4834
+ layout = 'VERTICAL_TWO_COLUMN',
4812
4835
  muted
4813
- }) => /*#__PURE__*/jsx("dl", {
4814
- className: classNames('tw-definition-list d-flex ', {
4815
- 'text-muted': muted,
4816
- 'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,
4817
- 'tw-definition-list--columns flex-column flex-row--sm': layout === Layout.VERTICAL_TWO_COLUMN,
4818
- 'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout)
4819
- }),
4820
- children: definitions.filter(definition => definition).map(({
4821
- action,
4822
- title,
4823
- value,
4824
- key
4825
- }) => /*#__PURE__*/jsxs("div", {
4826
- className: "tw-definition-list__item",
4827
- children: [/*#__PURE__*/jsx("dt", {
4828
- children: title
4829
- }), /*#__PURE__*/jsxs("dd", {
4830
- className: classNames(...getAlignmentClasses(layout, action)),
4831
- children: [/*#__PURE__*/jsx("div", {
4832
- children: value
4833
- }), action ? /*#__PURE__*/jsx("div", {
4834
- className: classNames(isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2', 'tw-definition-list__action'),
4835
- children: /*#__PURE__*/jsx(ActionButton, {
4836
- className: "tw-definition-list__button",
4837
- onClick: action.onClick,
4838
- children: action.label
4839
- })
4840
- }) : null]
4841
- })]
4842
- }, key))
4843
- });
4844
- DefinitionList.propTypes = {
4845
- definitions: PropTypes.arrayOf(PropTypes.shape({
4846
- action: PropTypes.shape({
4847
- label: PropTypes.string.isRequired,
4848
- onClick: PropTypes.func
4836
+ }) {
4837
+ return /*#__PURE__*/jsx("dl", {
4838
+ className: classNames('tw-definition-list d-flex ', {
4839
+ 'text-muted': muted,
4840
+ 'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,
4841
+ 'tw-definition-list--columns flex-column flex-row--sm': layout === Layout.VERTICAL_TWO_COLUMN,
4842
+ 'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout)
4849
4843
  }),
4850
- title: PropTypes.node.isRequired,
4851
- value: PropTypes.node.isRequired,
4852
- key: PropTypes.string.isRequired
4853
- })),
4854
- layout: PropTypes.oneOf(['VERTICAL_TWO_COLUMN', 'VERTICAL_ONE_COLUMN', 'HORIZONTAL_JUSTIFIED', 'HORIZONTAL_LEFT_ALIGNED', 'HORIZONTAL_RIGHT_ALIGNED']),
4855
- muted: PropTypes.bool
4856
- };
4857
- DefinitionList.defaultProps = {
4858
- definitions: [],
4859
- layout: Layout.VERTICAL_TWO_COLUMN,
4860
- muted: false
4861
- };
4862
- var DefinitionList$1 = DefinitionList;
4844
+ children: definitions.filter(definition => definition).map(({
4845
+ action,
4846
+ title,
4847
+ value,
4848
+ key
4849
+ }) => /*#__PURE__*/jsxs("div", {
4850
+ className: "tw-definition-list__item",
4851
+ children: [/*#__PURE__*/jsx("dt", {
4852
+ children: title
4853
+ }), /*#__PURE__*/jsxs("dd", {
4854
+ className: classNames(...getAlignmentClasses(layout, action)),
4855
+ children: [/*#__PURE__*/jsx("div", {
4856
+ children: value
4857
+ }), action ? /*#__PURE__*/jsx("div", {
4858
+ className: classNames(isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2', 'tw-definition-list__action'),
4859
+ children: /*#__PURE__*/jsx(ActionButton, {
4860
+ className: "tw-definition-list__button",
4861
+ onClick: action.onClick,
4862
+ children: action.label
4863
+ })
4864
+ }) : null]
4865
+ })]
4866
+ }, key))
4867
+ });
4868
+ }
4863
4869
 
4864
4870
  const DropFade = ({
4865
4871
  children,
@@ -14723,5 +14729,5 @@ const translations = {
14723
14729
  'zh-HK': zhHK
14724
14730
  };
14725
14731
 
14726
- export { Accordion, ActionButton, ActionOption, Alert, AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card$2 as BaseCard, Body, BottomSheet$1 as BottomSheet, Breakpoint, Button, Card$1 as Card, Carousel, Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList$1 as DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, Emphasis, Field, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList, Label, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader, Logo$1 as Logo, LogoType, Markdown, MarkdownNodeType, Modal, Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$1 as Popover, Position, Priority, ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCardGroup$1 as PromoCardGroup, Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip, Type, Typeahead$1 as Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
14732
+ export { Accordion, ActionButton, ActionOption, Alert, AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card$2 as BaseCard, Body, BottomSheet$1 as BottomSheet, Breakpoint, Button, Card$1 as Card, Carousel, Checkbox, CheckboxButton$1 as CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer$1 as Drawer, DropFade, Emphasis, Field, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList, Label, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader, Logo$1 as Logo, LogoType, Markdown, MarkdownNodeType, Modal, Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$1 as Popover, Position, Priority, ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCardGroup$1 as PromoCardGroup, Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip, Type, Typeahead$1 as Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
14727
14733
  //# sourceMappingURL=index.mjs.map